Browse Source

Merge branch '20230223_xt_api_new_branch' of http://git.shengws.com/csx/XT_New into 20230223_xt_api_new_branch

陈少旭 1 year ago
parent
commit
54e1036e06

+ 10 - 11
controllers/base_api_controller.go View File

@@ -71,9 +71,9 @@ func (this *BaseAuthAPIController) Prepare() {
71 71
 	this.BaseAPIController.Prepare()
72 72
 	if this.GetAdminUserInfo() == nil {
73 73
 		var userAdmin models.AdminUser
74
-		userAdmin.Id = 841
74
+		userAdmin.Id = 809
75 75
 		userAdmin.Mobile = "15717313968"
76
-		userAdmin.Id = 841 //4,809
76
+		userAdmin.Id = 809 //4,809
77 77
 		userAdmin.Mobile = "12222222222"
78 78
 		userAdmin.IsSuperAdmin = true
79 79
 		userAdmin.Status = 1
@@ -81,7 +81,7 @@ func (this *BaseAuthAPIController) Prepare() {
81 81
 		userAdmin.ModifyTime = 1530786071
82 82
 		var subscibe models.ServeSubscibe
83 83
 		subscibe.ID = 11
84
-		subscibe.OrgId = 10340 //机构id 10344
84
+		subscibe.OrgId = 9671 //机构id 10344
85 85
 		subscibe.PeriodStart = 1547447814
86 86
 		subscibe.PeriodEnd = 1550039814
87 87
 		subscibe.State = 1
@@ -91,8 +91,8 @@ func (this *BaseAuthAPIController) Prepare() {
91 91
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
92 92
 		subscibes[4] = &subscibe
93 93
 		var adminUserInfo service.AdminUserInfo
94
-		adminUserInfo.CurrentOrgId = 10340 //机构id小英9675或4
95
-		adminUserInfo.CurrentAppId = 3467  //4
94
+		adminUserInfo.CurrentOrgId = 9671 //机构id小英9675或4
95
+		adminUserInfo.CurrentAppId = 3244 //4
96 96
 		adminUserInfo.AdminUser = &userAdmin
97 97
 		adminUserInfo.Subscibes = subscibes
98 98
 		this.SetSession("admin_user_info", &adminUserInfo)
@@ -316,10 +316,9 @@ func (this *BaseServeAPIController) Prepare() {
316 316
 	this.BaseAPIController.Prepare()
317 317
 	if this.GetAdminUserInfo() == nil {
318 318
 		var userAdmin models.AdminUser
319
-		userAdmin.Id = 841
319
+		userAdmin.Id = 809
320 320
 		userAdmin.Mobile = "15717313968"
321
-
322
-		userAdmin.Id = 841 //4,809
321
+		userAdmin.Id = 809 //4,809
323 322
 		userAdmin.Mobile = "12222222222"
324 323
 		userAdmin.IsSuperAdmin = false
325 324
 		userAdmin.Status = 1
@@ -327,7 +326,7 @@ func (this *BaseServeAPIController) Prepare() {
327 326
 		userAdmin.ModifyTime = 1530786071
328 327
 		var subscibe models.ServeSubscibe
329 328
 		subscibe.ID = 11
330
-		subscibe.OrgId = 10340 //机构id小英10344或4
329
+		subscibe.OrgId = 9671 //机构id小英10344或4
331 330
 		subscibe.PeriodStart = 1538035409
332 331
 		subscibe.PeriodEnd = 1569571409
333 332
 		subscibe.State = 1
@@ -337,8 +336,8 @@ func (this *BaseServeAPIController) Prepare() {
337 336
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
338 337
 		subscibes[4] = &subscibe
339 338
 		var adminUserInfo service.AdminUserInfo
340
-		adminUserInfo.CurrentOrgId = 10340 //机构id小英9675或4
341
-		adminUserInfo.CurrentAppId = 3467  //4
339
+		adminUserInfo.CurrentOrgId = 9671 //机构id小英9675或4
340
+		adminUserInfo.CurrentAppId = 3244 //4
342 341
 		adminUserInfo.AdminUser = &userAdmin
343 342
 		adminUserInfo.Subscibes = subscibes
344 343
 		this.SetSession("admin_user_info", &adminUserInfo)

+ 3 - 0
controllers/common_api_controller.go View File

@@ -740,6 +740,8 @@ func (this *CommonApiController) GetDialysislist() {
740 740
 
741 741
 	//按排班
742 742
 	scheduleCount, _ := service.GetScheduleModeIdCount(statime, entime, orgId, page, 1000)
743
+
744
+	scheduleList, _ := service.GetDialysisScheduleList(statime, entime, page, limit, orgId)
743 745
 	if err != nil {
744 746
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
745 747
 		return
@@ -753,6 +755,7 @@ func (this *CommonApiController) GetDialysislist() {
753 755
 		"count":            count,
754 756
 		"modeIdCount":      modeIdCount,
755 757
 		"scheduleCount":    scheduleCount,
758
+		"scheduleList":     scheduleList,
756 759
 	})
757 760
 }
758 761
 

+ 1 - 0
controllers/dialysis_api_controller.go View File

@@ -2127,6 +2127,7 @@ func (c *DialysisApiController) PostAssessmentAfterDislysis() {
2127 2127
 	assessment.AfterUrea = data.AfterUrea
2128 2128
 	assessment.PipCoagulation = data.PipCoagulation
2129 2129
 	assessment.AccumulatedBloodVolume = data.AccumulatedBloodVolume
2130
+	assessment.TransfusionVolume = data.TransfusionVolume
2130 2131
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentOrgId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)
2131 2132
 
2132 2133
 	if assessment.ID > 0 {

+ 62 - 3
controllers/doctors_api_controller.go View File

@@ -67,6 +67,9 @@ func DoctorApiRegistRouters() {
67 67
 	beego.Router("/api/patient/deletefirstdisease", &DoctorsApiController{}, "Get:DeleteFirstDisease")
68 68
 
69 69
 	beego.Router("/api/schedule/new/long/advices", &DoctorsApiController{}, "Get:GetLongScheduleAdvicesList")
70
+
71
+	beego.Router("/api/schedule/getpatientbyname", &DoctorsApiController{}, "Get:GetPatientByName")
72
+	beego.Router("/api/schedule/getdocadvicebypatientid", &DoctorsApiController{}, "Get:GetDoctorAdviceByPatientId")
70 73
 }
71 74
 
72 75
 func (c *DoctorsApiController) ScheduleAdvices() {
@@ -825,7 +828,7 @@ func (this *DoctorsApiController) GetInitDateList() {
825 828
 	startTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
826 829
 	end_time := this.GetString("end_time")
827 830
 	endTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
828
-	fmt.Println("endtime2323232233223232332", endTime)
831
+
829 832
 	prescription_list, _ := service.GetDialysisPrescriptionDataList(patient_id, startTime.Unix(), endTime.Unix())
830 833
 	befor_list, err := service.GetDialysisBeforInitDateList(patient_id, startTime.Unix(), endTime.Unix())
831 834
 	after_list, err := service.GetDialysisAssementAfter(patient_id, startTime.Unix(), endTime.Unix())
@@ -1244,10 +1247,10 @@ func (this *DoctorsApiController) GetHospitalSummaryList() {
1244 1247
 	orgId := this.GetAdminUserInfo().CurrentOrgId
1245 1248
 	patient_id, _ := this.GetInt64("patient_id")
1246 1249
 	start_time := this.GetString("start_time")
1247
-	fmt.Println("start_tim232232323232323232323232332", start_time)
1250
+
1248 1251
 	dischargeTimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
1249 1252
 	startime := dischargeTimes.Unix()
1250
-	fmt.Println("startime1111111111111111111111", startime)
1253
+
1251 1254
 	end_time := this.GetString("end_time")
1252 1255
 	endTimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 00:00:00", loc)
1253 1256
 	endtime := endTimes.Unix()
@@ -1671,3 +1674,59 @@ func (c *DoctorsApiController) GetLongScheduleAdvicesList() {
1671 1674
 	}
1672 1675
 
1673 1676
 }
1677
+
1678
+func (c *DoctorsApiController) GetPatientByName() {
1679
+
1680
+	keyword := c.GetString("keyword")
1681
+	orgId := c.GetAdminUserInfo().CurrentOrgId
1682
+	patients, _ := service.GetPatientByName(keyword, orgId)
1683
+	c.ServeSuccessJSON(map[string]interface{}{
1684
+		"patients": patients,
1685
+	})
1686
+}
1687
+
1688
+func (c *DoctorsApiController) GetDoctorAdviceByPatientId() {
1689
+
1690
+	patient_id, _ := c.GetInt64("patient_id")
1691
+	limit, _ := c.GetInt64("limit")
1692
+	page, _ := c.GetInt64("page")
1693
+	start_time := c.GetString("start_time")
1694
+	orgId := c.GetAdminUserInfo().CurrentOrgId
1695
+	end_time := c.GetString("end_time")
1696
+
1697
+	fmt.Println("patient_id", patient_id)
1698
+	fmt.Println("startdateunix", start_time)
1699
+	fmt.Println("enddateunix", end_time)
1700
+	fmt.Println("limit", limit)
1701
+	fmt.Println("page", page)
1702
+
1703
+	timeLayout := "2006-01-02"
1704
+	loc, _ := time.LoadLocation("Local")
1705
+
1706
+	var startTimeUnix int64
1707
+	if len(start_time) > 0 {
1708
+		theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
1709
+		if err != nil {
1710
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
1711
+			return
1712
+		}
1713
+		startTimeUnix = theTime.Unix()
1714
+	}
1715
+
1716
+	var endTimeUnix int64
1717
+	if len(end_time) > 0 {
1718
+		theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 00:00:00", loc)
1719
+		if err != nil {
1720
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
1721
+			return
1722
+		}
1723
+		endTimeUnix = theTime.Unix()
1724
+	}
1725
+
1726
+	list, total, _ := service.GetDoctorAdviceByPatientId(patient_id, orgId, startTimeUnix, endTimeUnix, limit, page)
1727
+
1728
+	c.ServeSuccessJSON(map[string]interface{}{
1729
+		"list":  list,
1730
+		"total": total,
1731
+	})
1732
+}

+ 1 - 1
controllers/drug_stock_api_contorller.go View File

@@ -241,7 +241,7 @@ func (c *StockDrugApiController) CreateDrugWarehouse() {
241 241
 
242 242
 				warehouseInfo := &models.DrugWarehouseInfo{
243 243
 					ID:               id,
244
-					WarehousingOrder: warehousing.WarehousingOrder,
244
+					WarehousingOrder: info.WarehousingOrder,
245 245
 					WarehousingId:    info.ID,
246 246
 					DrugId:           drug_id,
247 247
 					Number:           number,

+ 3 - 2
controllers/manage_api_controller.go View File

@@ -5402,9 +5402,9 @@ func (this *MachineApiController) GetObjectDisInfectionLongTime() {
5402 5402
 
5403 5403
 func (this *MachineApiController) GetInformationmanalist() {
5404 5404
 
5405
-	//获取5月1日到5月27日的上机患者
5405
+	//获取2022年8月1日到10月16日的上机患者
5406 5406
 
5407
-	list, _ := service.GetDialysisOrderPatient(9538)
5407
+	list, _ := service.GetDialysisOrderPatient(10101)
5408 5408
 
5409 5409
 	for _, dialysisOrder := range list {
5410 5410
 
@@ -5885,6 +5885,7 @@ func (this *MachineApiController) GetNewAirWayDisinfectList() {
5885 5885
 	}
5886 5886
 	orgId := this.GetAdminUserInfo().CurrentOrgId
5887 5887
 	list, total, err := service.GetNewAirWayDisinfectList(limit, page, startTime, endTime, orgId)
5888
+	fmt.Println("lisitwoowowow", list)
5888 5889
 	if err != nil {
5889 5890
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateConfig)
5890 5891
 		return

+ 23 - 1
controllers/mobile_api_controllers/check_weight_api_controller.go View File

@@ -437,6 +437,12 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
437 437
 				newprescribe.DialysisDurationMinute = 0
438 438
 				newprescribe.BloodAccess = dialysisSolution.BloodAccess
439 439
 			}
440
+
441
+			if adminUserInfo.Org.Id == 10445 {
442
+				lastDialysisPrescription, _ := service.GetLastDialysisPrescription(id, adminUserInfo.Org.Id)
443
+				newprescribe.Remark = lastDialysisPrescription.Remark
444
+			}
445
+
440 446
 			//插入透析处方
441 447
 			err := service.AddSigleRecord(&newprescribe)
442 448
 
@@ -538,6 +544,11 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
538 544
 					newprescribe.DialysisDurationMinute = 0
539 545
 					newprescribe.BloodAccess = dialysisSolution.BloodAccess
540 546
 				}
547
+
548
+				if adminUserInfo.Org.Id == 10445 {
549
+					lastDialysisPrescription, _ := service.GetLastDialysisPrescription(id, adminUserInfo.Org.Id)
550
+					newprescribe.Remark = lastDialysisPrescription.Remark
551
+				}
541 552
 				err := service.AddSigleRecord(&newprescribe)
542 553
 
543 554
 				//记录日志
@@ -629,6 +640,10 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
629 640
 					newprescribe.DialysisDurationMinute = 0
630 641
 					newprescribe.BloodAccess = dialysisSolution.BloodAccess
631 642
 				}
643
+				if adminUserInfo.Org.Id == 10445 {
644
+					lastDialysisPrescription, _ := service.GetLastDialysisPrescription(id, adminUserInfo.Org.Id)
645
+					newprescribe.Remark = lastDialysisPrescription.Remark
646
+				}
632 647
 				err := service.AddSigleRecord(&newprescribe)
633 648
 
634 649
 				//记录日志
@@ -671,7 +686,10 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
671 686
 				newprescribe.DewaterAmount = dewater_amount
672 687
 				newprescribe.TargetUltrafiltration = dewater_amount
673 688
 				newprescribe.Status = 1
674
-
689
+				if adminUserInfo.Org.Id == 10445 {
690
+					lastDialysisPrescription, _ := service.GetLastDialysisPrescription(id, adminUserInfo.Org.Id)
691
+					newprescribe.Remark = lastDialysisPrescription.Remark
692
+				}
675 693
 				err := service.AddSigleRecord(&newprescribe)
676 694
 				//记录日志
677 695
 				byterequest, _ := json.Marshal(newprescribe)
@@ -713,6 +731,10 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
713 731
 			if adminUserInfo.Org.Id == 10340 {
714 732
 				dialysisPrescribe.TargetUltrafiltration = 0
715 733
 			}
734
+			if adminUserInfo.Org.Id == 10445 {
735
+				lastDialysisPrescription, _ := service.GetLastDialysisPrescription(id, adminUserInfo.Org.Id)
736
+				dialysisPrescribe.Remark = lastDialysisPrescription.Remark
737
+			}
716 738
 			updateErr := service.UpDateDialysisPrescription(dialysisPrescribe)
717 739
 			//记录日志
718 740
 			byterequest, _ := json.Marshal(dialysisPrescribe)

+ 11 - 1
controllers/mobile_api_controllers/dialysis_api_controller.go View File

@@ -600,6 +600,8 @@ func (this *DialysisAPIController) DialysisRecord() {
600 600
 	if remind_config.ID > 0 && remind_config.IsOpen == 1 {
601 601
 		remind_lists, _ = service.GetAllInspectionRemind(adminInfo.Org.Id, patientID)
602 602
 	}
603
+
604
+	lastDialysisPrescription, _ := service.GetLastDialysisPrescription(patientID, adminInfo.Org.Id)
603 605
 	returnData := map[string]interface{}{
604 606
 		"patient":                        patient,
605 607
 		"schedual":                       schedual,
@@ -634,6 +636,7 @@ func (this *DialysisAPIController) DialysisRecord() {
634 636
 		"prescription_open":              prescriptionConfig.IsOpen,
635 637
 		"lastOrder":                      lastOrder,
636 638
 		"remind_lists":                   remind_lists,
639
+		"lastDialysisPrescription":       lastDialysisPrescription,
637 640
 	}
638 641
 
639 642
 	this.ServeSuccessJSON(returnData)
@@ -1386,7 +1389,8 @@ func (c *DialysisAPIController) PostAssessmentAfterDislysis() {
1386 1389
 	after_urea := c.GetString("after_urea")
1387 1390
 	pip_coagulation := c.GetString("pip_coagulation")
1388 1391
 	accumulated_blood_volume := c.GetString("accumulated_blood_volume")
1389
-	fmt.Println("accumulated_blood_volume", accumulated_blood_volume)
1392
+	transfusion_volume := c.GetString("transfusion_volume")
1393
+
1390 1394
 	if id <= 0 {
1391 1395
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
1392 1396
 		return
@@ -1494,6 +1498,7 @@ func (c *DialysisAPIController) PostAssessmentAfterDislysis() {
1494 1498
 		AfterUrea:                    after_urea,
1495 1499
 		PipCoagulation:               pip_coagulation,
1496 1500
 		AccumulatedBloodVolume:       accumulated_blood_volume,
1501
+		TransfusionVolume:            transfusion_volume,
1497 1502
 	}
1498 1503
 
1499 1504
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
@@ -3478,6 +3483,11 @@ func (this *DialysisAPIController) StartDialysis() {
3478 3483
 			record.BreathingRate = "18"
3479 3484
 			record.SodiumConcentration = 140
3480 3485
 		}
3486
+		//江成肾病医院
3487
+		if adminUserInfo.Org.Id == 10517 {
3488
+			record.SodiumConcentration = 138
3489
+			record.DialysateTemperature = 36.5
3490
+		}
3481 3491
 
3482 3492
 		err := service.CreateMonitor(&record)
3483 3493
 

+ 16 - 16
controllers/mobile_api_controllers/patient_api_controller.go View File

@@ -1659,22 +1659,22 @@ func (c *PatientApiController) ExecDoctorAdvice() {
1659 1659
 				}
1660 1660
 
1661 1661
 				//
1662
-				//if config.IsOpen == 1 && item.UserOrgId == 10188 {
1663
-				//
1664
-				//	service.HisDrugsDelivery(adminInfo.Org.Id, creater, &advice)
1665
-				//	//更新字典里面的库存
1666
-				//	stockInfo, _ := service.GetDrugAllStockInfo(storeHouseConfig.DrugStorehouseOut, item.UserOrgId, item.DrugId)
1667
-				//	var sum_count int64
1668
-				//	for _, its := range stockInfo {
1669
-				//		if its.MaxUnit == medical.MaxUnit {
1670
-				//			its.StockMaxNumber = its.StockMaxNumber * medical.MinNumber
1671
-				//		}
1672
-				//		sum_count += its.StockMaxNumber + its.StockMinNumber
1673
-				//	}
1674
-				//	service.UpdateBaseDrugSumTwo(item.DrugId, sum_count, item.UserOrgId)
1675
-				//	//剩余库存
1676
-				//	service.UpdateDrugStockCount(item.DrugId, item.UserOrgId, storeHouseConfig.DrugStorehouseOut, sum_count)
1677
-				//}
1662
+				if config.IsOpen == 1 && item.UserOrgId == 10028 {
1663
+
1664
+					service.HisDrugsDelivery(adminInfo.Org.Id, creater, &advice)
1665
+					//更新字典里面的库存
1666
+					stockInfo, _ := service.GetDrugAllStockInfo(storeHouseConfig.DrugStorehouseOut, item.UserOrgId, item.DrugId)
1667
+					var sum_count int64
1668
+					for _, its := range stockInfo {
1669
+						if its.MaxUnit == medical.MaxUnit {
1670
+							its.StockMaxNumber = its.StockMaxNumber * medical.MinNumber
1671
+						}
1672
+						sum_count += its.StockMaxNumber + its.StockMinNumber
1673
+					}
1674
+					service.UpdateBaseDrugSumTwo(item.DrugId, sum_count, item.UserOrgId)
1675
+					//剩余库存
1676
+					service.UpdateDrugStockCount(item.DrugId, item.UserOrgId, storeHouseConfig.DrugStorehouseOut, sum_count)
1677
+				}
1678 1678
 
1679 1679
 			}
1680 1680
 		}

+ 5 - 2
controllers/new_mobile_api_controllers/new_manage_api_controller.go View File

@@ -56,17 +56,20 @@ func (this *NewManageApiController) GetDisInfectionTime() {
56 56
 				return
57 57
 			}
58 58
 			this.ServeSuccessJSON(map[string]interface{}{
59
-				"plan": infor.LongTime,
59
+				"plan":    infor.LongTime,
60
+				"planObj": plan,
60 61
 			})
61 62
 		} else if errcode == nil {
62 63
 			this.ServeSuccessJSON(map[string]interface{}{
63
-				"plan": plan.DisinfecTime,
64
+				"plan":    plan.DisinfecTime,
65
+				"planObj": plan,
64 66
 			})
65 67
 		}
66 68
 	} else if err == nil {
67 69
 		this.ServeSuccessJSON(map[string]interface{}{
68 70
 			"plan":       infomation.LongTime,
69 71
 			"infomation": infomation,
72
+			"planObj":    "",
70 73
 		})
71 74
 	}
72 75
 	//查询改设备是否有消毒计划

+ 39 - 1
controllers/self_drug_api_congtroller.go View File

@@ -2762,10 +2762,30 @@ func (this *SelfDrugApiController) GetGoodNewQuery() {
2762 2762
 			sum_total += item.StockCount
2763 2763
 		}
2764 2764
 		service.UpdateGoodInformation(it.ID, orgId, sum_total)
2765
+
2766
+		//stockListTwo, _ := service.GetGoodStockCountList(orgId, it.ID)
2767
+		//if len(stockListTwo) > 0 {
2768
+		//	for _, item := range stockListTwo {
2769
+		//		var over_count int64
2770
+		//		over_count = item.StockInCount - item.FlushCount
2771
+		//		service.UpdateGoodListCount(item.UserOrgId, over_count, item.GoodId, item.StorehouseId)
2772
+		//
2773
+		//	}
2774
+		//}
2775
+		//
2776
+		//stockListOne, _ := service.GetGoodStockCountList(orgId, it.ID)
2777
+		//if len(stockListOne) > 0 {
2778
+		//	for _, item := range stockListOne {
2779
+		//		var over_count int64
2780
+		//		over_count = item.StockOutCount + item.StockCancelCount
2781
+		//		service.UpdateGoodListCountOne(item.UserOrgId, over_count, item.GoodId, item.StorehouseId)
2782
+		//	}
2783
+		//}
2784
+
2765 2785
 	}
2766 2786
 
2767 2787
 	var ids []int64
2768
-	//var goodIds []int64
2788
+
2769 2789
 	manufacturerList, _ := service.GetManufacturerListByKeyword(orgId, keyword)
2770 2790
 	for _, it := range manufacturerList {
2771 2791
 		ids = append(ids, it.ID)
@@ -3419,6 +3439,24 @@ func (this *SelfDrugApiController) GetDrugNewQuery() {
3419 3439
 		stockInt, _ := strconv.ParseInt(it.DrugStockLimit, 10, 64)
3420 3440
 		limit_count = stockInt * it.MinNumber
3421 3441
 		service.UpdateDrugById(it.ID, orgId, limit_count, sum_count)
3442
+
3443
+		//druglist, _ := service.GetDrugCountMapList(it.ID, orgId)
3444
+		//if len(druglist) > 0 {
3445
+		//	for _, item := range druglist {
3446
+		//		var over_count int64
3447
+		//		over_count = item.SumInCount - item.FlushCount
3448
+		//		service.UpdateDrugStockInCount(item.DrugId, item.StorehouseId, over_count, item.UserOrgId)
3449
+		//	}
3450
+		//}
3451
+
3452
+		//druglistOne, _ := service.GetDrugCountMapList(it.ID, orgId)
3453
+		//if len(druglistOne) > 0 {
3454
+		//	for _, item := range druglistOne {
3455
+		//		var over_count int64
3456
+		//		over_count = item.SumOutCount + item.SumCancelCount
3457
+		//		service.UpdateDrugStockInCountOne(item.DrugId, item.StorehouseId, over_count, item.UserOrgId)
3458
+		//	}
3459
+		//}
3422 3460
 	}
3423 3461
 
3424 3462
 	for _, it := range manufacturerList {

+ 233 - 50
controllers/sign_api_controller.go View File

@@ -510,16 +510,45 @@ func (this *SignApiController) CreateNewPersionSeal() {
510 510
 
511 511
 	admin_user_id, _ := this.GetInt64("admin_user_id")
512 512
 
513
+	creater := this.GetAdminUserInfo().AdminUser.Id
514
+
515
+	userName := service.GetLastAdminUserName(admin_user_id, orgId)
516
+	//查询医护是否完成认证
513 517
 	lastPerson, _ := service.GetLastPersonEnterPrise(admin_user_id, orgId)
514 518
 
515
-	//personSeal, personSealId := service.CreateNewPersionSeal(lastPerson.UserId)
519
+	if lastPerson.ID > 0 {
520
+		this.ServeDynamicFailJsonSend("已完成认证,无需再次认证")
521
+		return
522
+	}
516 523
 
517
-	personSeal, personSealId := service.CreateSKDPersionSeal(lastPerson.UserId)
518
-	service.UpdatePerseEnterPriseById(lastPerson.ID, personSealId)
519
-	this.ServeSuccessJSON(map[string]interface{}{
520
-		"personSeal": personSeal,
521
-	})
522
-	return
524
+	if lastPerson.ID == 0 {
525
+		//去认证
526
+		personSeal, sealBase64 := service.CreateSKDPersionSeal(lastPerson.UserId, userName)
527
+
528
+		fmt.Println("sealBase64", sealBase64)
529
+		enterprise := models.XtDevicePersonEnterprise{
530
+			AdminUserId:  admin_user_id,
531
+			DisplayName:  "",
532
+			Phone:        "",
533
+			IdCardNum:    "",
534
+			UserOrgId:    orgId,
535
+			Status:       1,
536
+			Creater:      creater,
537
+			Ctime:        time.Now().Unix(),
538
+			Mtime:        0,
539
+			UserId:       "",
540
+			Personsealid: "",
541
+			Sealid:       "",
542
+			UserName:     userName,
543
+			Sealbase64:   sealBase64,
544
+		}
545
+		service.CreateEnterpriseUserName(enterprise)
546
+
547
+		this.ServeSuccessJSON(map[string]interface{}{
548
+			"personSeal": personSeal,
549
+		})
550
+		return
551
+	}
523 552
 
524 553
 }
525 554
 
@@ -642,12 +671,36 @@ func (this *SignApiController) UploadPrintOrder() {
642 671
 
643 672
 func (this *SignApiController) CreateQianshuUserName() {
644 673
 
645
-	sign, userId := service.CreateQianshuUserName()
674
+	admin_user_id, _ := this.GetInt64("admin_user_id")
675
+
676
+	orgId := this.GetAdminUserInfo().CurrentOrgId
677
+	userName := service.GetLastAdminUserName(admin_user_id, orgId)
678
+
679
+	idCardNumber := service.GetLastAdminUserIdCardNumber(admin_user_id, orgId)
680
+
681
+	adminRole, _ := service.GetMobile(admin_user_id)
682
+
683
+	//查询该医护人员是否已经签署了
684
+	lastPerson, _ := service.GetLastPersonEnterPrise(admin_user_id, orgId)
685
+
686
+	if len(lastPerson.UserId) > 0 {
687
+		this.ServeDynamicFailJsonSend("已完成签署,无需再次签署")
688
+		return
689
+	}
690
+
691
+	if len(lastPerson.UserId) == 0 {
692
+		//去签署
693
+		sign, userId := service.CreateQianshuUserName(userName, adminRole.Mobile, idCardNumber)
694
+
695
+		err := service.UpdatePersionEnterPrise(lastPerson.ID, userId)
696
+		fmt.Println(err)
697
+		this.ServeSuccessJSON(map[string]interface{}{
698
+			"sign":   sign,
699
+			"userId": userId,
700
+		})
701
+
702
+	}
646 703
 
647
-	this.ServeSuccessJSON(map[string]interface{}{
648
-		"sign":   sign,
649
-		"userId": userId,
650
-	})
651 704
 }
652 705
 
653 706
 func (this *SignApiController) CreateSdkSendInformation() {
@@ -662,7 +715,8 @@ func (this *SignApiController) CreateSdkSendInformation() {
662 715
 
663 716
 func (this *SignApiController) SavePdfInformation() {
664 717
 
665
-	information, orderId := service.SavePdfInformation()
718
+	information, pdfBase64 := service.SavePdfInformation()
719
+	informationOne := service.ToCheckInformation(pdfBase64)
666 720
 
667 721
 	maprequest := make(map[string]interface{})
668 722
 
@@ -674,11 +728,12 @@ func (this *SignApiController) SavePdfInformation() {
674 728
 	maprequest["signTitle"] = "举报合同"
675 729
 
676 730
 	//file := "C:/Users/28169/Desktop/2.pdf"
677
-	file := "/swspan/gopath/src/XT_New/static/2.pdf"
731
+	file := "/swspan/gopath/src/XT_New/static/6.pdf"
678 732
 
679 733
 	fileBytes, _ := ioutil.ReadFile(file) // 读取file
680 734
 
681 735
 	contractBase64 := base64.StdEncoding.EncodeToString(fileBytes) // 加密成base64字符串
736
+
682 737
 	//文件获取方式
683 738
 	maprequest["fileType"] = 1
684 739
 
@@ -710,34 +765,68 @@ func (this *SignApiController) SavePdfInformation() {
710 765
 
711 766
 	keywordSignControls := make([]map[string]interface{}, 0)
712 767
 
768
+	//预冲者样式
713 769
 	inputArrOne := make(map[string]interface{})
714
-
715 770
 	inputArrOne["sealName"] = "1"
716
-	inputArrOne["keyword"] = ""
771
+	inputArrOne["keyword"] = "医生签名"
717 772
 	inputArrOne["pages"] = "0"
718 773
 	inputArrOne["offsetX"] = "100"
719 774
 	inputArrOne["offsetY"] = "100"
720 775
 
721 776
 	keywordSignControls = append(keywordSignControls, inputArrOne)
722 777
 
723
-	stepStamper["keywordSignControls"] = keywordSignControls
724
-
725
-	crossSignControls := make([]map[string]interface{}, 0)
726
-
727
-	inputArrTwo := make(map[string]interface{})
728
-	inputArrTwo["sealName"] = "2"
729
-	inputArrTwo["positionX"] = "100"
730
-	inputArrTwo["positionY"] = "100"
731
-	crossSignControls = append(crossSignControls, inputArrTwo)
732
-
733
-	stepStamper["crossSignControls"] = crossSignControls
778
+	//穿刺者样式
779
+	//inputArr := make(map[string]interface{})
780
+	//inputArr["sealName"] = "2"
781
+	//inputArr["keyword"] = "治疗护士"
782
+	//inputArr["pages"] = "1"
783
+	//inputArr["offsetX"] = "100"
784
+	//inputArr["offsetY"] = "0"
785
+	//
786
+	//keywordSignControls = append(keywordSignControls, inputArr)
787
+	//
788
+	////上机者
789
+	//inputArrSix := make(map[string]interface{})
790
+	//inputArrSix["sealName"] = "3"
791
+	//inputArrSix["keyword"] = "核对护士"
792
+	//inputArrSix["pages"] = "1"
793
+	//inputArrSix["offsetX"] = "100"
794
+	//inputArrSix["offsetY"] = "0"
795
+	//
796
+	//keywordSignControls = append(keywordSignControls, inputArrSix)
797
+	//
798
+	//stepStamper["keywordSignControls"] = keywordSignControls
799
+	//
800
+	////医生签名
801
+	//inputArrSeven := make(map[string]interface{})
802
+	//inputArrSeven["sealName"] = "4"
803
+	//inputArrSeven["keyword"] = "医生签名"
804
+	//inputArrSeven["pages"] = "1"
805
+	//inputArrSeven["offsetX"] = "100"
806
+	//inputArrSeven["offsetY"] = "0"
807
+	//
808
+	//keywordSignControls = append(keywordSignControls, inputArrSeven)
809
+	//
810
+	//stepStamper["keywordSignControls"] = keywordSignControls
734 811
 
812
+	//crossSignControls := make([]map[string]interface{}, 0)
813
+	//
814
+	//inputArrTwo := make(map[string]interface{})
815
+	//inputArrTwo["sealName"] = "1"
816
+	//inputArrTwo["positionX"] = "0"
817
+	//inputArrTwo["positionY"] = "0"
818
+	//inputArrTwo["pages"] = "0"
819
+	//crossSignControls = append(crossSignControls, inputArrTwo)
820
+	//
821
+	//stepStamper["crossSignControls"] = crossSignControls
822
+	//
735 823
 	xySignControls := make([]map[string]interface{}, 0)
736 824
 
737 825
 	inputArrThree := make(map[string]interface{})
738
-	inputArrThree["sealName"] = "2"
826
+	inputArrThree["sealName"] = "1"
739 827
 	inputArrThree["positionX"] = "100"
740
-	inputArrThree["positionY"] = "100"
828
+	inputArrThree["positionY"] = "0"
829
+	inputArrThree["pages"] = "0"
741 830
 
742 831
 	xySignControls = append(xySignControls, inputArrThree)
743 832
 
@@ -747,54 +836,148 @@ func (this *SignApiController) SavePdfInformation() {
747 836
 
748 837
 	seals := make([]map[string]interface{}, 0)
749 838
 
839
+	//预冲者
750 840
 	sealImagesList := make(map[string]interface{})
751
-
752
-	fileOne := "/swspan/gopath/src/XT_New/static/seal.jpg"
753
-
754
-	fileBytesOne, _ := ioutil.ReadFile(fileOne) // 读取file
755
-
841
+	fileOne := "/swspan/gopath/src/XT_New/static/huangzihui.jpg"
842
+	fileBytesOne, _ := ioutil.ReadFile(fileOne)                          // 读取file
756 843
 	contractBase64One := base64.StdEncoding.EncodeToString(fileBytesOne) // 加密成base64字符串
757 844
 	sealImagesList["sealBase64"] = contractBase64One
758
-	sealImagesList["width"] = "100"
759
-	sealImagesList["height"] = "100"
845
+	//控制签名的大小
846
+	sealImagesList["width"] = "50"
847
+	sealImagesList["height"] = "50"
760 848
 	sealImagesList["verticalAlign"] = "middle"
761 849
 
762 850
 	sealTextsList := make(map[string]interface{})
763
-	sealTextsList["text"] = "2"
851
+	sealTextsList["text"] = "2023年8月8日"
764 852
 	sealTextsList["fontSize"] = "100"
765
-	sealTextsList["fontColor"] = "100"
853
+	sealTextsList["fontColor"] = "#333333"
766 854
 	sealTextsList["isTextArea"] = true
767 855
 	sealTextsList["textAlign"] = 0
768
-	sealTextsList["width"] = 300
769
-	sealTextsList["height"] = 300
856
+	sealTextsList["width"] = 150
857
+	sealTextsList["height"] = 20
770 858
 
771 859
 	sealsObj := make(map[string]interface{})
772
-
773
-	sealsObj["sealWidth"] = "300"
774
-	sealsObj["sealHeight"] = "300"
775
-	sealsObj["sealName"] = 1
860
+	sealsObj["sealWidth"] = "150"
861
+	sealsObj["sealHeight"] = "150"
862
+	sealsObj["sealName"] = "1"
776 863
 	sealsObj["sealImage"] = sealImagesList
777 864
 	sealsObj["sealText"] = sealTextsList
778
-
779 865
 	seals = append(seals, sealsObj)
866
+
867
+	//穿刺者
868
+	//sealImagesListOne := make(map[string]interface{})
869
+	//
870
+	//fileTwo := "/swspan/gopath/src/XT_New/static/huangjunji.jpg"
871
+	//
872
+	//fileBytesTwo, _ := ioutil.ReadFile(fileTwo) // 读取file
873
+	//
874
+	//contractBase64Two := base64.StdEncoding.EncodeToString(fileBytesTwo) // 加密成base64字符串
875
+	//sealImagesListOne["sealBase64"] = contractBase64Two
876
+	////控制签名的大小
877
+	//sealImagesListOne["width"] = "50"
878
+	//sealImagesListOne["height"] = "50"
879
+	//sealImagesListOne["verticalAlign"] = "middle"
880
+	//
881
+	//sealTextsListOne := make(map[string]interface{})
882
+	//sealTextsListOne["text"] = "2023年8月8日"
883
+	//sealTextsListOne["fontSize"] = "100"
884
+	//sealTextsListOne["fontColor"] = "100"
885
+	//sealTextsListOne["isTextArea"] = true
886
+	//sealTextsListOne["textAlign"] = 0
887
+	//sealTextsListOne["width"] = 150
888
+	//sealTextsListOne["height"] = 20
889
+	//
890
+	//sealsObjOne := make(map[string]interface{})
891
+	//
892
+	//sealsObjOne["sealWidth"] = "150"
893
+	//sealsObjOne["sealHeight"] = "150"
894
+	//sealsObjOne["sealName"] = "2"
895
+	//sealsObjOne["sealImage"] = sealImagesListOne
896
+	//sealsObjOne["sealText"] = sealTextsListOne
897
+	//seals = append(seals, sealsObjOne)
898
+	//间隔签名
899
+
900
+	//上机者
901
+	//sealImagesListTwo := make(map[string]interface{})
902
+	//fileThree := "/swspan/gopath/src/XT_New/static/jianfeixia.jpg"
903
+	//fileBytesThree, _ := ioutil.ReadFile(fileThree)                          // 读取file
904
+	//contractBase64Three := base64.StdEncoding.EncodeToString(fileBytesThree) // 加密成base64字符串
905
+	//sealImagesListTwo["sealBase64"] = contractBase64Three
906
+	////控制签名的大小
907
+	//sealImagesListTwo["width"] = "50"
908
+	//sealImagesListTwo["height"] = "50"
909
+	//sealImagesListTwo["verticalAlign"] = "middle"
910
+	//
911
+	//sealTextsListTwo := make(map[string]interface{})
912
+	//sealTextsListTwo["text"] = "2023年8月8日"
913
+	//sealTextsListTwo["fontSize"] = "100"
914
+	//sealTextsListTwo["fontColor"] = "100"
915
+	//sealTextsListTwo["isTextArea"] = true
916
+	//sealTextsListTwo["textAlign"] = 0
917
+	//sealTextsListTwo["width"] = 150
918
+	//sealTextsListTwo["height"] = 20
919
+	//
920
+	//sealsObjTwo := make(map[string]interface{})
921
+	//
922
+	//sealsObjTwo["sealWidth"] = "150"
923
+	//sealsObjTwo["sealHeight"] = "150"
924
+	//sealsObjTwo["sealName"] = "3"
925
+	//sealsObjTwo["sealImage"] = sealImagesListTwo
926
+	//sealsObjTwo["sealText"] = sealTextsListTwo
927
+	//seals = append(seals, sealsObjTwo)
928
+
929
+	//医生签名
930
+	//sealImagesListThree := make(map[string]interface{})
931
+	//fileFour := "/swspan/gopath/src/XT_New/static/jianfeixia.jpg"
932
+	//fileBytesFour, _ := ioutil.ReadFile(fileFour)                          // 读取file
933
+	//contractBase64Tour := base64.StdEncoding.EncodeToString(fileBytesFour) // 加密成base64字符串
934
+	//sealImagesListThree["sealBase64"] = contractBase64Tour
935
+	////控制签名的大小
936
+	//sealImagesListThree["width"] = "50"
937
+	//sealImagesListThree["height"] = "50"
938
+	//sealImagesListThree["verticalAlign"] = "middle"
939
+	//
940
+	//sealTextsListThree := make(map[string]interface{})
941
+	//sealTextsListThree["text"] = "2023年8月8日"
942
+	//sealTextsListThree["fontSize"] = "100"
943
+	//sealTextsListThree["fontColor"] = "100"
944
+	//sealTextsListThree["isTextArea"] = true
945
+	//sealTextsListThree["textAlign"] = 0
946
+	//sealTextsListThree["width"] = 150
947
+	//sealTextsListThree["height"] = 20
948
+	//
949
+	//sealsObjThree := make(map[string]interface{})
950
+	//
951
+	//sealsObjThree["sealWidth"] = "150"
952
+	//sealsObjThree["sealHeight"] = "150"
953
+	//sealsObjThree["sealName"] = "4"
954
+	//sealsObjThree["sealImage"] = sealImagesListThree
955
+	//sealsObjThree["sealText"] = sealTextsListThree
956
+	//seals = append(seals, sealsObjThree)
957
+
780 958
 	maprequest["seals"] = seals
781 959
 
782 960
 	maprequest["isUserWishes"] = true
783 961
 	maprequest["phone"] = "13318464642"
784 962
 	maprequest["verificationCode"] = "18888888888"
963
+
785 964
 	this.ServeSuccessJSON(map[string]interface{}{
786
-		"maprequest":  maprequest,
787
-		"information": information,
788
-		"orderId":     orderId,
965
+
966
+		"information":    information,
967
+		"orderId":        pdfBase64,
968
+		"informationOne": informationOne,
969
+		"maprequest":     maprequest,
789 970
 	})
790 971
 
791 972
 }
792 973
 
793 974
 func (this *SignApiController) ToCheckInformation() {
794 975
 
795
-	information := service.ToCheckInformation()
976
+	information, pdfBase64 := service.SavePdfInformation()
977
+	informationOne := service.ToCheckInformation(pdfBase64)
796 978
 
797 979
 	this.ServeSuccessJSON(map[string]interface{}{
798
-		"information": information,
980
+		"information":    information,
981
+		"informationOne": informationOne,
799 982
 	})
800 983
 }

+ 2 - 0
controllers/stock_in_api_controller.go View File

@@ -1363,6 +1363,7 @@ func (c *StockManagerApiController) CreateWarehouseOut() {
1363 1363
 			}
1364 1364
 		}
1365 1365
 	}
1366
+	fmt.Println("warehouseOut_id", warehouseOut_id)
1366 1367
 	if warehouseOut_id == 0 {
1367 1368
 		//查询是否生成出库单
1368 1369
 		_, errcodes := service.FindStockOutByIsSys(adminUserInfo.CurrentOrgId, 0, operation_time)
@@ -1370,6 +1371,7 @@ func (c *StockManagerApiController) CreateWarehouseOut() {
1370 1371
 			service.AddSigleWarehouseOut(&warehouseOut)
1371 1372
 		}
1372 1373
 	}
1374
+
1373 1375
 	if warehouseOut_id > 0 {
1374 1376
 		service.UpdateSingleWarehoseOut(warehouseOut_id, storehouse_id)
1375 1377
 	}

+ 22 - 0
models/common_models.go View File

@@ -483,6 +483,28 @@ type BloodDialysisOrder struct {
483 483
 	UserSysBeforeCount int64  `gorm:"column:user_sys_before_count" json:"user_sys_before_count" form:"user_sys_before_count"`
484 484
 }
485 485
 
486
+type BloodDialysisOrderSchedule struct {
487
+	ID                  int64  `gorm:"column:id" json:"id" form:"id"`
488
+	UserOrgId           int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
489
+	PartitionId         int64  `gorm:"column:partition_id" json:"partition_id" form:"partition_id"`
490
+	BedId               int64  `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
491
+	PatientId           int64  `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
492
+	ScheduleDate        int64  `gorm:"column:schedule_date" json:"schedule_date" form:"schedule_date"`
493
+	ScheduleType        int64  `gorm:"column:schedule_type" json:"schedule_type" form:"schedule_type"`
494
+	ScheduleWeek        int64  `gorm:"column:schedule_week" json:"schedule_week" form:"schedule_week"`
495
+	ModeId              int64  `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
496
+	Status              int64  `gorm:"column:status" json:"status" form:"status"`
497
+	CreatedTime         int64  `gorm:"column:created_time" json:"created_time" form:"created_time"`
498
+	UpdatedTime         int64  `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
499
+	IsExport            int64  `gorm:"column:is_export" json:"is_export" form:"is_export"`
500
+	DialysisMachineName string `gorm:"column:dialysis_machine_name" json:"dialysis_machine_name" form:"dialysis_machine_name"`
501
+	Name                string `gorm:"column:name" json:"name" form:"name"`
502
+	DialysisNo          string `gorm:"column:dialysis_no" json:"dialysis_no" form:"dialysis_no"`
503
+	IdCardNo            string `gorm:"column:id_card_no" json:"id_card_no" form:"id_card_no"`
504
+	TotalDialysis       int64  `gorm:"column:total_dialysis" json:"total_dialysis" form:"total_dialysis"`
505
+	UserSysBeforeCount  int64  `gorm:"column:user_sys_before_count" json:"user_sys_before_count" form:"user_sys_before_count"`
506
+}
507
+
486 508
 type TreatDialysisOrder struct {
487 509
 	Date string `json:"date"`
488 510
 }

+ 1 - 0
models/dialysis.go View File

@@ -654,6 +654,7 @@ type AssessmentAfterDislysis struct {
654 654
 	AfterUrea                       string  `gorm:"column:after_urea" json:"after_urea" form:"after_urea"`
655 655
 	PipCoagulation                  string  `gorm:"column:pip_coagulation" json:"pip_coagulation" form:"pip_coagulation"`
656 656
 	AccumulatedBloodVolume          string  `gorm:"column:accumulated_blood_volume" json:"accumulated_blood_volume" form:"accumulated_blood_volume"`
657
+	TransfusionVolume               string  `gorm:"column:transfusion_volume" json:"transfusion_volume" form:"transfusion_volume"`
657 658
 }
658 659
 
659 660
 func (AssessmentAfterDislysis) TableName() string {

+ 2 - 0
models/sign.models.go View File

@@ -124,6 +124,8 @@ type XtDevicePersonEnterprise struct {
124 124
 	UserId       string `gorm:"column:user_id" json:"user_id" form:"user_id"`
125 125
 	Personsealid string `gorm:"column:person_seal_id" json:"person_seal_id" form:"person_seal_id"`
126 126
 	Sealid       string `gorm:"column:seal_id" json:"seal_id" form:"seal_id"`
127
+	UserName     string `gorm:"column:user_name" json:"user_name" form:"user_name"`
128
+	Sealbase64   string `gorm:"column:sealbase64" json:"sealbase64" form:"sealbase64"`
127 129
 }
128 130
 
129 131
 func (XtDevicePersonEnterprise) TableName() string {

+ 17 - 0
service/common_service.go View File

@@ -512,6 +512,23 @@ func GetDialysisList(startime int64, endtime int64, page int64, limit int64, org
512 512
 
513 513
 }
514 514
 
515
+func GetDialysisScheduleList(startime int64, endtime int64, page int64, limit int64, orgid int64) (order []*models.BloodDialysisOrderSchedule, err error) {
516
+
517
+	db := XTReadDB().Table("xt_schedule as o").Where("o.status = 1")
518
+
519
+	if orgid > 0 {
520
+		db = db.Where("o.user_org_id = ?", orgid)
521
+	}
522
+	if startime > 0 {
523
+		db = db.Where("o.schedule_date>=?", startime)
524
+	}
525
+	if endtime > 0 {
526
+		db = db.Where("o.schedule_date<=?", endtime)
527
+	}
528
+	err = db.Group("o.patient_id,o.mode_id").Select("o.mode_id,o.patient_id,p.name,p.id_card_no,p.dialysis_no,p.total_dialysis,p.user_sys_before_count").Joins("join  xt_patients as p on p.id = o.patient_id").Where("o.status = 1").Scan(&order).Error
529
+	return order, err
530
+}
531
+
515 532
 func GetAllDialysisList(startime int64, endtime int64, orgid int64) (order []*models.BloodDialysisOrder, err error) {
516 533
 
517 534
 	db := XTReadDB().Table("xt_dialysis_order as o").Where("o.status = 1")

+ 42 - 0
service/doctor_advice_service.go View File

@@ -491,3 +491,45 @@ func GetHisDoctorAdvice(record_time int64, org_id int64, patient_id int64) (advi
491 491
 	err = XTReadDB().Where("advice_date = ? and user_org_id = ? and patient_id = ? and status = 1", record_time, org_id, patient_id).Order("created_time asc").Find(&advice).Error
492 492
 	return advice, err
493 493
 }
494
+
495
+func GetPatientByName(keyword string, user_org_id int64) (patients []*models.XtPatients, err error) {
496
+
497
+	db := XTReadDB().Model(&patients).Where("status=1")
498
+	if len(keyword) > 0 {
499
+		likeKey := "%" + keyword + "%"
500
+		db = db.Where("name LIKE ? OR dialysis_no LIKE ?", likeKey, likeKey)
501
+	}
502
+
503
+	if user_org_id > 0 {
504
+		db = db.Where("user_org_id =?", user_org_id)
505
+	}
506
+
507
+	err = db.Find(&patients).Error
508
+
509
+	return patients, err
510
+}
511
+
512
+func GetDoctorAdviceByPatientId(patient_id int64, user_org_id int64, start_time int64, end_time int64, limit int64, page int64) (advice []*models.DoctorAdvice, total int64, err error) {
513
+
514
+	db := XTReadDB().Model(&advice).Where("status=1")
515
+	//offset := (page - 1) * limit
516
+	if patient_id > 0 {
517
+		db = db.Where("patient_id = ?", patient_id)
518
+	}
519
+
520
+	if user_org_id > 0 {
521
+		db = db.Where("user_org_id =?", user_org_id)
522
+	}
523
+
524
+	if start_time > 0 {
525
+		db = db.Where("advice_date >= ?", start_time)
526
+	}
527
+
528
+	if end_time > 0 {
529
+		db = db.Where("advice_date <= ?", end_time)
530
+	}
531
+
532
+	err = db.Find(&advice).Error
533
+
534
+	return advice, total, err
535
+}

+ 0 - 9
service/manage_center_service.go View File

@@ -441,7 +441,6 @@ func DrugAutoAddCancelInfo(advice *models.HisDoctorAdviceInfo, creater int64) er
441 441
 	info, _ := GetDrugAutoWarehouseOutEight(advice.PatientId, advice.AdviceDate, advice.DrugId, advice.ID)
442 442
 	list, _ := GetDrugAutoWarehouseOutNight(advice.PatientId, advice.AdviceDate, advice.DrugId, advice.ID)
443 443
 
444
-	fmt.Println("lsit233323232323233232332wo", list)
445 444
 	storeHouseConfig, _ := GetAllStoreHouseConfig(advice.UserOrgId)
446 445
 	//退库
447 446
 	drug, _ := FindBaseDrugLibRecord(advice.UserOrgId, advice.DrugId)
@@ -449,8 +448,6 @@ func DrugAutoAddCancelInfo(advice *models.HisDoctorAdviceInfo, creater int64) er
449 448
 	//如果剩余数量 + 退库数量 < 总入库数量
450 449
 	if len(list) > 0 {
451 450
 		for _, its := range list {
452
-			fmt.Println("its,23322323323223232332wo", its.WarehouseInfoId)
453
-
454 451
 			//查询该批次病人该药品出库数据
455 452
 			infos, _ := GetDrugAutoWarehouseOutTen(advice.PatientId, advice.AdviceDate, advice.DrugId, advice.ID, its.WarehouseInfoId)
456 453
 			fmt.Println("info2332323232332233223wo", infos.Count)
@@ -492,12 +489,8 @@ func DrugAutoAddCancelInfo(advice *models.HisDoctorAdviceInfo, creater int64) er
492 489
 				sum_count = druginfo.WarehousingCount
493 490
 			}
494 491
 
495
-			fmt.Println("//剩余数量", over_count)
496
-			fmt.Println("该批出出库数量3223323232wo", out_count)
497
-			fmt.Println("g该批次总库存wowowoowow", sum_count)
498 492
 			if (over_count + out_count) <= sum_count {
499 493
 				if its.CountUnit == drug.MinUnit && drug.MaxUnit != drug.MinUnit {
500
-					fmt.Print("itscoutn233232223999wi", its.Count)
501 494
 					//退库
502 495
 					warehouseInfo := models.DrugWarehouseInfo{
503 496
 						StockMinNumber: its.Count,
@@ -511,7 +504,6 @@ func DrugAutoAddCancelInfo(advice *models.HisDoctorAdviceInfo, creater int64) er
511 504
 
512 505
 				}
513 506
 				if its.CountUnit == drug.MaxUnit && drug.MaxUnit != drug.MinUnit {
514
-					fmt.Print("itscoutn999888", its.Count)
515 507
 					warehouseInfo := models.DrugWarehouseInfo{
516 508
 						StockMaxNumber: its.Count,
517 509
 					}
@@ -524,7 +516,6 @@ func DrugAutoAddCancelInfo(advice *models.HisDoctorAdviceInfo, creater int64) er
524 516
 				}
525 517
 
526 518
 				if its.CountUnit == drug.MaxUnit && drug.MaxUnit == drug.MinUnit {
527
-					fmt.Print("itscoutnwohhhhwhw", its.Count)
528 519
 					warehouseInfo := models.DrugWarehouseInfo{
529 520
 						StockMaxNumber: its.Count,
530 521
 					}

+ 1 - 1
service/manage_service.go View File

@@ -1818,7 +1818,7 @@ func GetObjectDisInfectionLongTime(user_org_id int64) (list []*models.XtNewObjec
1818 1818
 
1819 1819
 func GetDialysisOrderPatient(org_id int64) (order []*models.XtDialysisOrder, err error) {
1820 1820
 
1821
-	err = XTReadDB().Where("user_org_id = ? and dialysis_date>=? and dialysis_date<=? and status =1", org_id, 1672502400, 1675094400).Find(&order).Error
1821
+	err = XTReadDB().Where("user_org_id = ? and dialysis_date>=? and dialysis_date<=? and status =1", org_id, 1667232000, 1669737600).Find(&order).Error
1822 1822
 
1823 1823
 	return order, err
1824 1824
 }

+ 4 - 3
service/new_warehouse_service.go View File

@@ -1520,7 +1520,7 @@ func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseou
1520 1520
 			sum_count += its.StockMaxNumber + its.StockMinNumber
1521 1521
 		}
1522 1522
 
1523
-		if orgID != 10188 && orgID != 10217 && orgID != 3877 && orgID != 9671 {
1523
+		if orgID != 10188 && orgID != 10217 && orgID != 3877 {
1524 1524
 			warehouseOutInfo := &models.DrugWarehouseOutInfo{
1525 1525
 				WarehouseOutOrderNumber: warehouseout.WarehouseOutOrderNumber,
1526 1526
 				WarehouseOutId:          warehouseout.ID,
@@ -1554,6 +1554,7 @@ func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseou
1554 1554
 
1555 1555
 			//查询今日该药品该患者是否有出库数据
1556 1556
 			lastDrugOutInfo, _ := GetNewDrugWarehouseOutInfoSix(advice.DrugId, advice.PatientId, advice.RecordDate, advice.UserOrgId, advice.ID, warehouse.ID)
1557
+			fmt.Println("以色列---------------------------------------", lastDrugOutInfo.ID)
1557 1558
 			if lastDrugOutInfo.ID == 0 {
1558 1559
 				errOne := AddSigleDrugWarehouseOutInfo(warehouseOutInfo)
1559 1560
 				if errOne != nil {
@@ -1574,7 +1575,7 @@ func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseou
1574 1575
 				}
1575 1576
 			}
1576 1577
 			if lastDrugOutInfo.ID > 0 {
1577
-
1578
+				fmt.Println("wowowowowowwwwwwwwwwwwwwwwwwwwwwwww")
1578 1579
 				//删除在新增
1579 1580
 				UpdateDrugWarehouseOutInfoTen(lastDrugOutInfo.PatientId, lastDrugOutInfo.SysRecordTime, advice.ID)
1580 1581
 
@@ -1605,7 +1606,7 @@ func BloodHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseou
1605 1606
 		if deliver_number_one-(out_count-cancel_count) >= 0 {
1606 1607
 			if (deliver_number_one - out_count - cancel_count) != 0 {
1607 1608
 
1608
-				if orgID == 10217 || orgID == 10188 || orgID == 3877 || orgID == 9671 {
1609
+				if orgID == 10217 || orgID == 10188 || orgID == 3877 {
1609 1610
 					warehouseOutInfo := &models.DrugWarehouseOutInfo{
1610 1611
 						WarehouseOutOrderNumber: warehouseout.WarehouseOutOrderNumber,
1611 1612
 						WarehouseOutId:          warehouseout.ID,

+ 40 - 0
service/self_drug_service.go View File

@@ -1945,6 +1945,21 @@ func UpdateGoodInformation(id int64, orgid int64, total_count int64) error {
1945 1945
 	return err
1946 1946
 }
1947 1947
 
1948
+func UpdateGoodListCount(user_org_id int64, over_count int64, good_id int64, sotrehouse_id int64) error {
1949
+
1950
+	err := XTWriteDB().Model(&models.XtGoodStockCount{}).Where("status=1 and user_org_id =? and good_id =? and storehouse_id=?", user_org_id, good_id, sotrehouse_id).Update(map[string]interface{}{"stock_out_count": over_count}).Error
1951
+
1952
+	return err
1953
+
1954
+}
1955
+
1956
+func UpdateGoodListCountOne(user_org_id int64, over_count int64, good_id int64, storehouse_id int64) error {
1957
+
1958
+	err = XTWriteDB().Model(&models.XtGoodStockCount{}).Where("status=1 and user_org_id =? and good_id = ? and storehouse_id = ?", user_org_id, good_id, storehouse_id).Update(map[string]interface{}{"stock_act_out_count": over_count}).Error
1959
+	return err
1960
+
1961
+}
1962
+
1948 1963
 func GetBaseDrugName(orgid int64) (drug []*models.BaseDrugLibTwenty, err error) {
1949 1964
 
1950 1965
 	err = XTReadDB().Where("org_id = ? and status = 1", orgid).Find(&drug).Error
@@ -2924,3 +2939,28 @@ func GetDrugInventoryWarehouseInfoList(org_id int64, storehouse_id int64) (info
2924 2939
 	err = XTReadDB().Model(&info).Where("status = 1 and storehouse_id = ? and is_check = 1 and org_id = ? and (stock_max_number >0 or stock_min_number >0)", storehouse_id, org_id).Preload("XtBaseDrug", "status= 1").Order("drug_id").Find(&info).Error
2925 2940
 	return info, err
2926 2941
 }
2942
+
2943
+func GetGoodStockCountList(user_org_id int64, good_id int64) (stock []*models.XtGoodStockCount, err error) {
2944
+
2945
+	err = XTReadDB().Where("user_org_id =? and status=1 and good_id = ?", user_org_id, good_id).Find(&stock).Error
2946
+
2947
+	return stock, err
2948
+}
2949
+
2950
+func GetDrugCountMapList(drug_id int64, user_org_id int64) (drug []*models.XtDrugStockCount, err error) {
2951
+
2952
+	err = XTReadDB().Where("drug_id = ? and user_org_id =? and status=1", drug_id, user_org_id).Find(&drug).Error
2953
+	return drug, err
2954
+}
2955
+
2956
+func UpdateDrugStockInCount(drugId int64, storehouseId int64, over_count int64, user_org_id int64) error {
2957
+
2958
+	err := XTWriteDB().Model(&models.XtDrugStockCount{}).Where("drug_id =? and storehouse_id =? and status=1 and user_org_id =?", drugId, storehouseId, user_org_id).Update(map[string]interface{}{"sum_out_count": over_count}).Error
2959
+	return err
2960
+}
2961
+
2962
+func UpdateDrugStockInCountOne(drugId int64, storehouseId int64, over_count int64, user_org_id int64) error {
2963
+
2964
+	err := XTWriteDB().Model(&models.XtDrugStockCount{}).Where("drug_id =? and storehouse_id =? and status=1 and user_org_id =?", drugId, storehouseId, user_org_id).Update(map[string]interface{}{"sum_act_out_count": over_count}).Error
2965
+	return err
2966
+}

+ 219 - 73
service/sign_service.go View File

@@ -1102,16 +1102,14 @@ func CreateNewPersionSeal(userId string) (string, string) {
1102 1102
 	return str, personSealId
1103 1103
 }
1104 1104
 
1105
-func CreateSKDPersionSeal(userId string) (string, string) {
1105
+func CreateSKDPersionSeal(userId string, user_name string) (string, string) {
1106 1106
 
1107 1107
 	maprequest := make(map[string]interface{})
1108 1108
 
1109
-	//maprequest["userId"] = userId
1110
-
1111 1109
 	//印章字体 1宋体(默认)2 黑体
1112 1110
 	maprequest["fontType"] = 1
1113 1111
 	//个人姓名(1-42位字符)
1114
-	maprequest["personName"] = "王志文"
1112
+	maprequest["personName"] = user_name
1115 1113
 	var url string
1116 1114
 	url = "http://localhost:8890/sdk/seal/createPersonSeal"
1117 1115
 	appId := beego.AppConfig.String("sign_appid")
@@ -1157,10 +1155,10 @@ func CreateSKDPersionSeal(userId string) (string, string) {
1157 1155
 	if err := json.Unmarshal([]byte(string(respBytes)), &respJSON); err != nil {
1158 1156
 		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
1159 1157
 	}
1160
-	var personSealId string
1161
-	//personSealId = respJSON["data"].(map[string]interface{})["personSealId"].(string)
1162
-	//fmt.Println("str", personSealId)
1163
-	return str, personSealId
1158
+	var sealBase64 string
1159
+	sealBase64 = respJSON["data"].(map[string]interface{})["sealBase64"].(string)
1160
+
1161
+	return str, sealBase64
1164 1162
 }
1165 1163
 
1166 1164
 func UpdatePerseEnterPriseById(id int64, personSealId string) error {
@@ -1524,27 +1522,27 @@ func GetDataConfigDisinfectionFluid(org_id int64) (models.Dataconfig, error) {
1524 1522
 	return dataconfig, err
1525 1523
 }
1526 1524
 
1527
-func CreateQianshuUserName() (string, string) {
1525
+func CreateQianshuUserName(user_name string, phone string, id_card_number string) (string, string) {
1528 1526
 
1529 1527
 	var url string
1530 1528
 
1531 1529
 	url = "http://localhost:8890/sdk/user/create"
1532
-	var account string
1533
-
1534
-	account = "13318464642"
1535
-
1536
-	var realName string
1530
+	//var account string
1531
+	//
1532
+	//account = "13318464642"
1537 1533
 
1538
-	realName = "马文强"
1534
+	//var realName string
1535
+	//
1536
+	//realName = "马文强"
1539 1537
 
1540 1538
 	maprequest := make(map[string]interface{})
1541 1539
 
1542
-	maprequest["account"] = account
1540
+	maprequest["account"] = phone
1543 1541
 
1544 1542
 	//账号类型:1手机号,2邮箱
1545 1543
 	maprequest["accountType"] = 1
1546 1544
 
1547
-	maprequest["realName"] = realName
1545
+	maprequest["realName"] = user_name
1548 1546
 
1549 1547
 	//签署人类型 1个人 2.企业
1550 1548
 	maprequest["signerType"] = 1
@@ -1552,9 +1550,9 @@ func CreateQianshuUserName() (string, string) {
1552 1550
 	// 0表示 身份证
1553 1551
 	maprequest["cardType"] = 0
1554 1552
 
1555
-	maprequest["cardNumber"] = "430526199408156511"
1553
+	//maprequest["cardNumber"] = "430526199408156511"
1556 1554
 
1557
-	fmt.Println("maprequestwowowowowoowow", maprequest)
1555
+	maprequest["cardNumber"] = id_card_number
1558 1556
 
1559 1557
 	byterequest, _ := json.Marshal(maprequest)
1560 1558
 
@@ -1597,8 +1595,8 @@ func CreateQianshuUserName() (string, string) {
1597 1595
 		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
1598 1596
 	}
1599 1597
 	var UserId string
1600
-	//UserId = respJSON["data"].(map[string]interface{})["userId"].(string)
1601
-	//fmt.Println("str", UserId)
1598
+	UserId = respJSON["data"].(map[string]interface{})["userId"].(string)
1599
+	fmt.Println("str", UserId)
1602 1600
 	return str, UserId
1603 1601
 }
1604 1602
 
@@ -1674,11 +1672,12 @@ func SavePdfInformation() (string, string) {
1674 1672
 	maprequest["signTitle"] = "举报合同"
1675 1673
 
1676 1674
 	//file := "C:/Users/28169/Desktop/2.pdf"
1677
-	file := "/swspan/gopath/src/XT_New/static/2.pdf"
1675
+	file := "/swspan/gopath/src/XT_New/static/6.pdf"
1678 1676
 
1679 1677
 	fileBytes, _ := ioutil.ReadFile(file) // 读取file
1680 1678
 
1681 1679
 	contractBase64 := base64.StdEncoding.EncodeToString(fileBytes) // 加密成base64字符串
1680
+
1682 1681
 	//文件获取方式
1683 1682
 	maprequest["fileType"] = 1
1684 1683
 
@@ -1710,75 +1709,197 @@ func SavePdfInformation() (string, string) {
1710 1709
 
1711 1710
 	keywordSignControls := make([]map[string]interface{}, 0)
1712 1711
 
1712
+	//预冲者样式
1713 1713
 	inputArrOne := make(map[string]interface{})
1714
-
1715 1714
 	inputArrOne["sealName"] = "1"
1716
-	inputArrOne["keyword"] = "王志文"
1715
+	inputArrOne["keyword"] = "杨姣"
1717 1716
 	inputArrOne["pages"] = "0"
1718
-	inputArrOne["offsetX"] = "100"
1719
-	inputArrOne["offsetY"] = "100"
1717
+	inputArrOne["offsetX"] = "50"
1718
+	inputArrOne["offsetY"] = "0"
1720 1719
 
1721 1720
 	keywordSignControls = append(keywordSignControls, inputArrOne)
1722 1721
 
1723
-	stepStamper["keywordSignControls"] = keywordSignControls
1724
-
1725
-	crossSignControls := make([]map[string]interface{}, 0)
1726
-
1727
-	inputArrTwo := make(map[string]interface{})
1728
-	inputArrTwo["sealName"] = "1"
1729
-	inputArrTwo["positionX"] = "100"
1730
-	inputArrTwo["positionY"] = "100"
1731
-	inputArrTwo["pages"] = "0"
1732
-	crossSignControls = append(crossSignControls, inputArrTwo)
1733
-
1734
-	stepStamper["crossSignControls"] = crossSignControls
1735
-
1736
-	xySignControls := make([]map[string]interface{}, 0)
1737
-
1738
-	inputArrThree := make(map[string]interface{})
1739
-	inputArrThree["sealName"] = "1"
1740
-	inputArrThree["positionX"] = "100"
1741
-	inputArrThree["positionY"] = "100"
1742
-	inputArrThree["pages"] = "0"
1722
+	//穿刺者样式
1723
+	//inputArr := make(map[string]interface{})
1724
+	//inputArr["sealName"] = "2"
1725
+	//inputArr["keyword"] = "治疗护士"
1726
+	//inputArr["pages"] = "1"
1727
+	//inputArr["offsetX"] = "100"
1728
+	//inputArr["offsetY"] = "0"
1729
+	//
1730
+	//keywordSignControls = append(keywordSignControls, inputArr)
1731
+	//
1732
+	////上机者
1733
+	//inputArrSix := make(map[string]interface{})
1734
+	//inputArrSix["sealName"] = "3"
1735
+	//inputArrSix["keyword"] = "核对护士"
1736
+	//inputArrSix["pages"] = "1"
1737
+	//inputArrSix["offsetX"] = "100"
1738
+	//inputArrSix["offsetY"] = "0"
1739
+	//
1740
+	//keywordSignControls = append(keywordSignControls, inputArrSix)
1741
+	//
1743 1742
 
1744
-	xySignControls = append(xySignControls, inputArrThree)
1743
+	////医生签名
1744
+	//inputArrSeven := make(map[string]interface{})
1745
+	//inputArrSeven["sealName"] = "4"
1746
+	//inputArrSeven["keyword"] = "医生签名"
1747
+	//inputArrSeven["pages"] = "1"
1748
+	//inputArrSeven["offsetX"] = "100"
1749
+	//inputArrSeven["offsetY"] = "0"
1750
+	//
1751
+	//keywordSignControls = append(keywordSignControls, inputArrSeven)
1752
+	//
1753
+	//stepStamper["keywordSignControls"] = keywordSignControls
1754
+	stepStamper["keywordSignControls"] = keywordSignControls
1755
+	//
1745 1756
 
1746
-	stepStamper["xySignControls"] = xySignControls
1757
+	//crossSignControls := make([]map[string]interface{}, 0)
1758
+	//
1759
+	//inputArrTwo := make(map[string]interface{})
1760
+	//inputArrTwo["sealName"] = "1"
1761
+	//inputArrTwo["positionX"] = "0"
1762
+	//inputArrTwo["positionY"] = "0"
1763
+	//inputArrTwo["pages"] = "0"
1764
+	//crossSignControls = append(crossSignControls, inputArrTwo)
1765
+	//
1766
+	//stepStamper["crossSignControls"] = crossSignControls
1767
+	//
1768
+	//xySignControls := make([]map[string]interface{}, 0)
1769
+	//
1770
+	//inputArrThree := make(map[string]interface{})
1771
+	//inputArrThree["sealName"] = "1"
1772
+	//inputArrThree["positionX"] = "100"
1773
+	//inputArrThree["positionY"] = "0"
1774
+	//inputArrThree["pages"] = "0"
1775
+	//
1776
+	//xySignControls = append(xySignControls, inputArrThree)
1777
+	//
1778
+	//stepStamper["xySignControls"] = xySignControls
1747 1779
 
1748 1780
 	maprequest["stepStamper"] = stepStamper
1749 1781
 
1750 1782
 	seals := make([]map[string]interface{}, 0)
1751 1783
 
1784
+	//预冲者
1752 1785
 	sealImagesList := make(map[string]interface{})
1753
-
1754
-	fileOne := "/swspan/gopath/src/XT_New/static/seal.jpg"
1755
-
1756
-	fileBytesOne, _ := ioutil.ReadFile(fileOne) // 读取file
1757
-
1786
+	fileOne := "/swspan/gopath/src/XT_New/static/huangzihui.jpg"
1787
+	fileBytesOne, _ := ioutil.ReadFile(fileOne)                          // 读取file
1758 1788
 	contractBase64One := base64.StdEncoding.EncodeToString(fileBytesOne) // 加密成base64字符串
1759 1789
 	sealImagesList["sealBase64"] = contractBase64One
1760
-	sealImagesList["width"] = "100"
1761
-	sealImagesList["height"] = "100"
1790
+	//控制签名的大小
1791
+	sealImagesList["width"] = "50"
1792
+	sealImagesList["height"] = "50"
1762 1793
 	sealImagesList["verticalAlign"] = "middle"
1763 1794
 
1764 1795
 	sealTextsList := make(map[string]interface{})
1765
-	sealTextsList["text"] = "2"
1796
+	sealTextsList["text"] = "2023年8月8日"
1766 1797
 	sealTextsList["fontSize"] = "100"
1767
-	sealTextsList["fontColor"] = "100"
1798
+	sealTextsList["fontColor"] = "#333333"
1768 1799
 	sealTextsList["isTextArea"] = true
1769 1800
 	sealTextsList["textAlign"] = 0
1770
-	sealTextsList["width"] = 300
1771
-	sealTextsList["height"] = 300
1801
+	sealTextsList["width"] = 150
1802
+	sealTextsList["height"] = 20
1772 1803
 
1773 1804
 	sealsObj := make(map[string]interface{})
1774
-
1775
-	sealsObj["sealWidth"] = "300"
1776
-	sealsObj["sealHeight"] = "300"
1805
+	sealsObj["sealWidth"] = "150"
1806
+	sealsObj["sealHeight"] = "150"
1777 1807
 	sealsObj["sealName"] = "1"
1778 1808
 	sealsObj["sealImage"] = sealImagesList
1779 1809
 	sealsObj["sealText"] = sealTextsList
1780
-
1781 1810
 	seals = append(seals, sealsObj)
1811
+
1812
+	//穿刺者
1813
+	//sealImagesListOne := make(map[string]interface{})
1814
+	//
1815
+	//fileTwo := "/swspan/gopath/src/XT_New/static/huangjunji.jpg"
1816
+	//
1817
+	//fileBytesTwo, _ := ioutil.ReadFile(fileTwo) // 读取file
1818
+	//
1819
+	//contractBase64Two := base64.StdEncoding.EncodeToString(fileBytesTwo) // 加密成base64字符串
1820
+	//sealImagesListOne["sealBase64"] = contractBase64Two
1821
+	////控制签名的大小
1822
+	//sealImagesListOne["width"] = "50"
1823
+	//sealImagesListOne["height"] = "50"
1824
+	//sealImagesListOne["verticalAlign"] = "middle"
1825
+	//
1826
+	//sealTextsListOne := make(map[string]interface{})
1827
+	//sealTextsListOne["text"] = "2023年8月8日"
1828
+	//sealTextsListOne["fontSize"] = "100"
1829
+	//sealTextsListOne["fontColor"] = "100"
1830
+	//sealTextsListOne["isTextArea"] = true
1831
+	//sealTextsListOne["textAlign"] = 0
1832
+	//sealTextsListOne["width"] = 150
1833
+	//sealTextsListOne["height"] = 20
1834
+	//
1835
+	//sealsObjOne := make(map[string]interface{})
1836
+	//
1837
+	//sealsObjOne["sealWidth"] = "150"
1838
+	//sealsObjOne["sealHeight"] = "150"
1839
+	//sealsObjOne["sealName"] = "2"
1840
+	//sealsObjOne["sealImage"] = sealImagesListOne
1841
+	//sealsObjOne["sealText"] = sealTextsListOne
1842
+	//seals = append(seals, sealsObjOne)
1843
+	//间隔签名
1844
+
1845
+	//上机者
1846
+	//sealImagesListTwo := make(map[string]interface{})
1847
+	//fileThree := "/swspan/gopath/src/XT_New/static/jianfeixia.jpg"
1848
+	//fileBytesThree, _ := ioutil.ReadFile(fileThree)                          // 读取file
1849
+	//contractBase64Three := base64.StdEncoding.EncodeToString(fileBytesThree) // 加密成base64字符串
1850
+	//sealImagesListTwo["sealBase64"] = contractBase64Three
1851
+	////控制签名的大小
1852
+	//sealImagesListTwo["width"] = "50"
1853
+	//sealImagesListTwo["height"] = "50"
1854
+	//sealImagesListTwo["verticalAlign"] = "middle"
1855
+	//
1856
+	//sealTextsListTwo := make(map[string]interface{})
1857
+	//sealTextsListTwo["text"] = "2023年8月8日"
1858
+	//sealTextsListTwo["fontSize"] = "100"
1859
+	//sealTextsListTwo["fontColor"] = "100"
1860
+	//sealTextsListTwo["isTextArea"] = true
1861
+	//sealTextsListTwo["textAlign"] = 0
1862
+	//sealTextsListTwo["width"] = 150
1863
+	//sealTextsListTwo["height"] = 20
1864
+	//
1865
+	//sealsObjTwo := make(map[string]interface{})
1866
+	//
1867
+	//sealsObjTwo["sealWidth"] = "150"
1868
+	//sealsObjTwo["sealHeight"] = "150"
1869
+	//sealsObjTwo["sealName"] = "3"
1870
+	//sealsObjTwo["sealImage"] = sealImagesListTwo
1871
+	//sealsObjTwo["sealText"] = sealTextsListTwo
1872
+	//seals = append(seals, sealsObjTwo)
1873
+
1874
+	//医生签名
1875
+	//sealImagesListThree := make(map[string]interface{})
1876
+	//fileFour := "/swspan/gopath/src/XT_New/static/jianfeixia.jpg"
1877
+	//fileBytesFour, _ := ioutil.ReadFile(fileFour)                          // 读取file
1878
+	//contractBase64Tour := base64.StdEncoding.EncodeToString(fileBytesFour) // 加密成base64字符串
1879
+	//sealImagesListThree["sealBase64"] = contractBase64Tour
1880
+	////控制签名的大小
1881
+	//sealImagesListThree["width"] = "50"
1882
+	//sealImagesListThree["height"] = "50"
1883
+	//sealImagesListThree["verticalAlign"] = "middle"
1884
+	//
1885
+	//sealTextsListThree := make(map[string]interface{})
1886
+	//sealTextsListThree["text"] = "2023年8月8日"
1887
+	//sealTextsListThree["fontSize"] = "100"
1888
+	//sealTextsListThree["fontColor"] = "100"
1889
+	//sealTextsListThree["isTextArea"] = true
1890
+	//sealTextsListThree["textAlign"] = 0
1891
+	//sealTextsListThree["width"] = 150
1892
+	//sealTextsListThree["height"] = 20
1893
+	//
1894
+	//sealsObjThree := make(map[string]interface{})
1895
+	//
1896
+	//sealsObjThree["sealWidth"] = "150"
1897
+	//sealsObjThree["sealHeight"] = "150"
1898
+	//sealsObjThree["sealName"] = "4"
1899
+	//sealsObjThree["sealImage"] = sealImagesListThree
1900
+	//sealsObjThree["sealText"] = sealTextsListThree
1901
+	//seals = append(seals, sealsObjThree)
1902
+
1782 1903
 	maprequest["seals"] = seals
1783 1904
 
1784 1905
 	maprequest["isUserWishes"] = true
@@ -1825,24 +1946,24 @@ func SavePdfInformation() (string, string) {
1825 1946
 	if err := json.Unmarshal([]byte(string(respBytes)), &respJSON); err != nil {
1826 1947
 		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
1827 1948
 	}
1828
-	var orderId string
1829
-	//orderId = respJSON["data"].(map[string]interface{})["orderId"].(string)
1830
-	//fmt.Println("str", orderId)
1831
-	return str, orderId
1949
+	var pdfBase64 string
1950
+	pdfBase64 = respJSON["data"].(map[string]interface{})["pdfBase64"].(string)
1951
+
1952
+	return str, pdfBase64
1832 1953
 }
1833 1954
 
1834
-func ToCheckInformation() string {
1955
+func ToCheckInformation(contractBase64 string) string {
1835 1956
 
1836 1957
 	var url string
1837 1958
 
1838 1959
 	url = "http://localhost:8890/sdk/pdf/verify"
1839 1960
 	maprequest := make(map[string]interface{})
1840 1961
 
1841
-	file := "/swspan/gopath/src/XT_New/static/2.pdf"
1842
-
1843
-	fileBytes, _ := ioutil.ReadFile(file) // 读取file
1844
-
1845
-	contractBase64 := base64.StdEncoding.EncodeToString(fileBytes) // 加密成base64字符串
1962
+	//file := "/swspan/gopath/src/XT_New/static/a.pdf"
1963
+	//
1964
+	//fileBytes, _ := ioutil.ReadFile(file) // 读取file
1965
+	//
1966
+	//contractBase64 := base64.StdEncoding.EncodeToString(fileBytes) // 加密成base64字符串
1846 1967
 
1847 1968
 	maprequest["fileType"] = 1
1848 1969
 
@@ -1891,3 +2012,28 @@ func ToCheckInformation() string {
1891 2012
 
1892 2013
 	return str
1893 2014
 }
2015
+
2016
+func GetLastAdminUserName(doctor, orgid int64) string {
2017
+	var tmp models.VmUserAdminRole
2018
+	XTReadDB().Model(&models.VmUserAdminRole{}).Where("admin_user_id = ? and org_id = ? and status = 1", doctor, orgid).Last(&tmp)
2019
+	return tmp.UserName
2020
+}
2021
+
2022
+func GetLastAdminUserIdCardNumber(doctor, orgid int64) string {
2023
+	var tmp models.VmUserAdminRole
2024
+	XTReadDB().Model(&models.VmUserAdminRole{}).Where("admin_user_id = ? and org_id = ? and status = 1", doctor, orgid).Last(&tmp)
2025
+	return tmp.JobNumber
2026
+}
2027
+
2028
+func CreateEnterpriseUserName(enterprise models.XtDevicePersonEnterprise) error {
2029
+
2030
+	err := XTWriteDB().Create(&enterprise).Error
2031
+
2032
+	return err
2033
+}
2034
+
2035
+func UpdatePersionEnterPrise(id int64, userId string) error {
2036
+
2037
+	err := XTWriteDB().Model(&models.XtDevicePersonEnterprise{}).Where("id=? and status =1", id).Updates(map[string]interface{}{"user_id": userId}).Error
2038
+	return err
2039
+}

+ 95 - 30
service/stock_service.go View File

@@ -2912,39 +2912,77 @@ func FloatRound(f float64, n int) float64 {
2912 2912
 }
2913 2913
 
2914 2914
 func FindStockOutDetailList(orgId int64, page int64, limit int64, startTime int64, endTime int64, keywords string, manufacturer int64, order_type int64, dealer int64, storehouse_id int64) (list []*models.WarehouseOutInfo, total int64, err error) {
2915
-	db := readDb.Model(&models.WarehouseOutInfo{})
2916
-	db = db.Where("xt_warehouse_out_info.org_id = ? AND xt_warehouse_out_info.status = 1 AND xt_warehouse_out_info.is_check = 1 AND xt_warehouse_out_info.good_id <> 0 AND xt_warehouse_out_info.count <> 0 ", orgId)
2917 2915
 
2918
-	if len(keywords) > 0 {
2919
-		likeKey := "%" + keywords + "%"
2920
-		db = db.Joins("join xt_warehouse_out on xt_warehouse_out.id = xt_warehouse_out_info.warehouse_out_id AND xt_warehouse_out.warehouse_out_time >=? AND xt_warehouse_out.warehouse_out_time<= ? AND xt_warehouse_out.status = 1 AND xt_warehouse_out.org_id = ?", startTime, endTime, orgId)
2921
-		db = db.Joins("join sgj_users.sgj_user_admin_role on sgj_user_admin_role.admin_user_id = xt_warehouse_out.creater")
2922
-		db = db.Joins("join xt_good_information on xt_good_information.id = xt_warehouse_out_info.good_id")
2916
+	if orgId == 9671 {
2917
+		db := readDb.Model(&models.WarehouseOutInfo{})
2918
+		db = db.Where("xt_warehouse_out_info.org_id = ? AND xt_warehouse_out_info.status = 1 AND xt_warehouse_out_info.is_check = 1 AND xt_warehouse_out_info.good_id <> 0 AND xt_warehouse_out_info.count <> 0  AND xt_warehouse_out_info.sys_record_time>=? AND xt_warehouse_out_info.sys_record_time<=?", orgId, startTime, endTime)
2919
+
2920
+		if len(keywords) > 0 {
2921
+			likeKey := "%" + keywords + "%"
2922
+			db = db.Joins("join xt_warehouse_out on xt_warehouse_out.id = xt_warehouse_out_info.warehouse_out_id AND xt_warehouse_out.warehouse_out_time >=? AND xt_warehouse_out.warehouse_out_time<= ? AND xt_warehouse_out.status = 1 AND xt_warehouse_out.org_id = ?", startTime, endTime, orgId)
2923
+			db = db.Joins("join sgj_users.sgj_user_admin_role on sgj_user_admin_role.admin_user_id = xt_warehouse_out.creater")
2924
+			db = db.Joins("join xt_good_information on xt_good_information.id = xt_warehouse_out_info.good_id")
2923 2925
 
2924
-		db = db.Where("sgj_user_admin_role.user_name LIKE ? OR xt_warehouse_out_info.warehouse_out_order_number LIKE ?  OR xt_good_information.specification_name LIKE ?  OR xt_good_information.good_name LIKE ?", likeKey, likeKey, likeKey, likeKey).Group("xt_warehouse_out_info.id")
2926
+			db = db.Where("sgj_user_admin_role.user_name LIKE ? OR xt_warehouse_out_info.warehouse_out_order_number LIKE ?  OR xt_good_information.specification_name LIKE ?  OR xt_good_information.good_name LIKE ?", likeKey, likeKey, likeKey, likeKey).Group("xt_warehouse_out_info.id")
2927
+		} else {
2928
+			db = db.Joins("join xt_warehouse_out on xt_warehouse_out.id = xt_warehouse_out_info.warehouse_out_id AND xt_warehouse_out.warehouse_out_time >=? AND xt_warehouse_out.warehouse_out_time<= ? AND xt_warehouse_out.status = 1 AND xt_warehouse_out.org_id = ?", startTime, endTime, orgId)
2929
+		}
2930
+
2931
+		if manufacturer > 0 {
2932
+			db = db.Joins("join xt_warehouse_out as wa on wa.id = xt_warehouse_out_info.warehouse_out_id AND wa.manufacturer =?", manufacturer)
2933
+		}
2934
+
2935
+		if order_type > 0 {
2936
+			db = db.Where("xt_warehouse_out_info.type = ?", order_type)
2937
+		}
2938
+
2939
+		if storehouse_id > 0 {
2940
+			db = db.Where("xt_warehouse_out_info.storehouse_id = ?", storehouse_id)
2941
+		}
2942
+
2943
+		db = db.Preload("WarehouseOut", "status = 1 AND org_id = ?", orgId)
2944
+		db = db.Preload("WarehousingInfoNight", "status=1 and org_id = ?", orgId)
2945
+		db = db.Preload("GoodInfo", "status = 1 AND org_id = ?", orgId)
2946
+		db = db.Count(&total)
2947
+		offset := (page - 1) * limit
2948
+		err = db.Offset(offset).Limit(limit).Order("xt_warehouse_out_info.id desc").Find(&list).Error
2949
+		return
2925 2950
 	} else {
2926
-		db = db.Joins("join xt_warehouse_out on xt_warehouse_out.id = xt_warehouse_out_info.warehouse_out_id AND xt_warehouse_out.warehouse_out_time >=? AND xt_warehouse_out.warehouse_out_time<= ? AND xt_warehouse_out.status = 1 AND xt_warehouse_out.org_id = ?", startTime, endTime, orgId)
2927
-	}
2951
+		db := readDb.Model(&models.WarehouseOutInfo{})
2952
+		db = db.Where("xt_warehouse_out_info.org_id = ? AND xt_warehouse_out_info.status = 1 AND xt_warehouse_out_info.is_check = 1 AND xt_warehouse_out_info.good_id <> 0 AND xt_warehouse_out_info.count <> 0 ", orgId)
2928 2953
 
2929
-	if manufacturer > 0 {
2930
-		db = db.Joins("join xt_warehouse_out as wa on wa.id = xt_warehouse_out_info.warehouse_out_id AND wa.manufacturer =?", manufacturer)
2931
-	}
2954
+		if len(keywords) > 0 {
2955
+			likeKey := "%" + keywords + "%"
2956
+			db = db.Joins("join xt_warehouse_out on xt_warehouse_out.id = xt_warehouse_out_info.warehouse_out_id AND xt_warehouse_out.warehouse_out_time >=? AND xt_warehouse_out.warehouse_out_time<= ? AND xt_warehouse_out.status = 1 AND xt_warehouse_out.org_id = ?", startTime, endTime, orgId)
2957
+			db = db.Joins("join sgj_users.sgj_user_admin_role on sgj_user_admin_role.admin_user_id = xt_warehouse_out.creater")
2958
+			db = db.Joins("join xt_good_information on xt_good_information.id = xt_warehouse_out_info.good_id")
2932 2959
 
2933
-	if order_type > 0 {
2934
-		db = db.Where("xt_warehouse_out_info.type = ?", order_type)
2935
-	}
2960
+			db = db.Where("sgj_user_admin_role.user_name LIKE ? OR xt_warehouse_out_info.warehouse_out_order_number LIKE ?  OR xt_good_information.specification_name LIKE ?  OR xt_good_information.good_name LIKE ?", likeKey, likeKey, likeKey, likeKey).Group("xt_warehouse_out_info.id")
2961
+		} else {
2962
+			db = db.Joins("join xt_warehouse_out on xt_warehouse_out.id = xt_warehouse_out_info.warehouse_out_id AND xt_warehouse_out.warehouse_out_time >=? AND xt_warehouse_out.warehouse_out_time<= ? AND xt_warehouse_out.status = 1 AND xt_warehouse_out.org_id = ?", startTime, endTime, orgId)
2963
+		}
2936 2964
 
2937
-	if storehouse_id > 0 {
2938
-		db = db.Where("xt_warehouse_out_info.storehouse_id = ?", storehouse_id)
2965
+		if manufacturer > 0 {
2966
+			db = db.Joins("join xt_warehouse_out as wa on wa.id = xt_warehouse_out_info.warehouse_out_id AND wa.manufacturer =?", manufacturer)
2967
+		}
2968
+
2969
+		if order_type > 0 {
2970
+			db = db.Where("xt_warehouse_out_info.type = ?", order_type)
2971
+		}
2972
+
2973
+		if storehouse_id > 0 {
2974
+			db = db.Where("xt_warehouse_out_info.storehouse_id = ?", storehouse_id)
2975
+		}
2976
+
2977
+		db = db.Preload("WarehouseOut", "status = 1 AND org_id = ?", orgId)
2978
+		db = db.Preload("WarehousingInfoNight", "status=1 and org_id = ?", orgId)
2979
+		db = db.Preload("GoodInfo", "status = 1 AND org_id = ?", orgId)
2980
+		db = db.Count(&total)
2981
+		offset := (page - 1) * limit
2982
+		err = db.Offset(offset).Limit(limit).Order("xt_warehouse_out_info.id desc").Find(&list).Error
2983
+		return
2939 2984
 	}
2940 2985
 
2941
-	db = db.Preload("WarehouseOut", "status = 1 AND org_id = ?", orgId)
2942
-	db = db.Preload("WarehousingInfoNight", "status=1 and org_id = ?", orgId)
2943
-	db = db.Preload("GoodInfo", "status = 1 AND org_id = ?", orgId)
2944
-	db = db.Count(&total)
2945
-	offset := (page - 1) * limit
2946
-	err = db.Offset(offset).Limit(limit).Order("xt_warehouse_out_info.id desc").Find(&list).Error
2947
-	return
2948 2986
 }
2949 2987
 
2950 2988
 func GetStockOutDetailTotal(orgId int64, startTime int64, endTime int64, keywords string, manufacturer int64, order_type int64, dealer int64, storehouse_id int64) (err error, totalPrice float64) {
@@ -3884,9 +3922,7 @@ func UpdateAutoGood(orgid int64, patient_id int64, recordtime int64, goodid int6
3884 3922
 
3885 3923
 	err = XTWriteDB().Model(models.BloodAutomaticReduceDetail{}).Where("org_id = ? and patient_id = ? and record_time = ? and status =1 and good_id = ?", orgid, patient_id, recordtime, goodid).UpdateColumn("count", gorm.Expr("count - ?", count)).Error
3886 3924
 	err = XTWriteDB().Model(models.WarehouseOutInfo{}).Where("org_id = ? and patient_id = ? and sys_record_time = ? and good_id = ? and status = 1", orgid, patient_id, recordtime, goodid).UpdateColumn("count", gorm.Expr("count - ?", count)).Error
3887
-	//err = XTWriteDB().Model(models.WarehouseOutInfo{}).Where("org_id = ? and patient_id = ? and sys_record_time = ? and good_id = ? and status = 1", orgid, patient_id, recordtime, goodid).UpdateColumn("over_count", gorm.Expr("over_count + ?", count)).Error
3888 3925
 	err = XTWriteDB().Model(&models.DialysisBeforePrepare{}).Where("user_org_id = ? and patient_id = ? and record_date = ? and good_id = ? and status = 1", orgid, patient_id, recordtime, goodid).UpdateColumn("count", gorm.Expr("count - ?", count)).Error
3889
-	//err = XTWriteDB().Model(&models.VmStockFlow{}).Where("user_org_id = ? and patient_id = ? and system_time = ? and good_id = ? and status = 1 and project_id = ?", orgid, patient_id, recordtime, goodid, project_id).UpdateColumn("count", gorm.Expr("count - ?", count)).Error
3890 3926
 	return err
3891 3927
 }
3892 3928
 
@@ -5517,7 +5553,7 @@ func DeleteDrugAutoWarehouseSeven(drugid int64, patient_id int64, record_time in
5517 5553
 
5518 5554
 	err := XTWriteDB().Model(models.DrugAutomaticReduceDetail{}).Where("drug_id = ? and patient_id = ? and record_time = ? and status = 1 and advice_id = ?", drugid, patient_id, record_time, advice_id).Updates(map[string]interface{}{"status": 0}).Error
5519 5555
 	//err = XTWriteDB().Model(models.DrugWarehouseOutInfo{}).Where("drug_id = ? and patient_id = ? and sys_record_time = ? and status = 1 and advice_id = ?", drugid, patient_id, record_time, advice_id).Updates(map[string]interface{}{"status": 0}).Error
5520
-	//err = XTWriteDB().Model(models.DrugFlow{}).Where("drug_id = ? and patient_id = ? and system_time = ? and status = 1 and advice_id = ?", drugid, patient_id, record_time, advice_id).Updates(map[string]interface{}{"status": 0}).Error
5556
+	err = XTWriteDB().Model(models.DrugFlow{}).Where("drug_id = ? and patient_id = ? and system_time = ? and status = 1 and advice_id = ?", drugid, patient_id, record_time, advice_id).Updates(map[string]interface{}{"status": 0}).Error
5521 5557
 	return err
5522 5558
 }
5523 5559
 
@@ -6997,14 +7033,14 @@ func FindStockSettingById(orgid int64) (models.XtStockSetting, error) {
6997 7033
 	return setting, err
6998 7034
 }
6999 7035
 
7000
-func GetAutoStockOutById(good_id, record_date int64, orgid int64, patient_id int64) (models.BloodAutomaticReduceDetail, error) {
7036
+func GetAutoStockOutById(good_id int64, record_date int64, orgid int64, patient_id int64) (models.BloodAutomaticReduceDetail, error) {
7001 7037
 
7002 7038
 	detail := models.BloodAutomaticReduceDetail{}
7003 7039
 	err := XTReadDB().Where("good_id = ? and record_time = ? and org_id = ? and status = 1 and patient_id = ?", good_id, record_date, orgid, patient_id).Find(&detail).Error
7004 7040
 	return detail, err
7005 7041
 }
7006 7042
 
7007
-func GetAutoWarehouseOutList(good_id, record_date int64, orgid int64, patient_id int64) (models.WarehouseOutInfoNight, error) {
7043
+func GetAutoWarehouseOutList(good_id int64, record_date int64, orgid int64, patient_id int64) (models.WarehouseOutInfoNight, error) {
7008 7044
 
7009 7045
 	detail := models.WarehouseOutInfoNight{}
7010 7046
 	err := XTReadDB().Where("good_id = ? and sys_record_time = ? and org_id = ? and status = 1 and patient_id = ?", good_id, record_date, orgid, patient_id).Find(&detail).Error
@@ -8649,3 +8685,32 @@ func FindFirstWarehousingInfoByStockThree(good_id int64, storehouse_id int64) (i
8649 8685
 
8650 8686
 	return info, err
8651 8687
 }
8688
+
8689
+func GetHisPrescriptionNumberList(project_id int64, record_date int64, orgid int64, patient_id int64) (list []*models.HisPrescriptionProject, err error) {
8690
+
8691
+	err = readDb.Where("project_id = ? and record_date =? and user_org_id =? and status =1 and patient_id = ?", project_id, record_date, orgid, patient_id).Find(&list).Error
8692
+
8693
+	return list, err
8694
+}
8695
+
8696
+func GetWarehouseOutnfoByProjectId(project_id int64, record_date int64, orgid int64, patient_id int64) (infor []*models.WarehouseOutInfo, err error) {
8697
+
8698
+	err = readDb.Where("good_id =? and sys_record_time = ? and org_id = ? and patient_id = ? and status=1", project_id, record_date, orgid, patient_id).Find(&infor).Error
8699
+	return infor, err
8700
+}
8701
+
8702
+func UpdateWarehouseInfoByPatientId(project_id int64, record_date int64, orgid int64, patient_id int64) (models.WarehouseOutInfo, error) {
8703
+
8704
+	info := models.WarehouseOutInfo{}
8705
+	err := XTWriteDB().Model(&info).Where("good_id = ? and sys_record_time = ? and org_id = ? and status =1 and patient_id = ?", project_id, record_date, orgid, patient_id).Updates(map[string]interface{}{"status": 0}).Error
8706
+	return info, err
8707
+}
8708
+
8709
+func UpdateWarehouseInfoByProject(good_id int64, id int64, user_org_id int64, count int64) (models.WarehousingInfo, error) {
8710
+
8711
+	info := models.WarehousingInfo{}
8712
+
8713
+	err := XTWriteDB().Where("id = ? and good_id = ? and org_id = ? and status= 1", id, good_id, user_org_id).UpdateColumn("stock_count", gorm.Expr("stock_count + ?", count)).Error
8714
+
8715
+	return info, err
8716
+}