Browse Source

历史排班

28169 1 year ago
parent
commit
81980734a9

+ 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 {

+ 35 - 44
controllers/his_api_controller.go View File

@@ -3857,8 +3857,8 @@ func (c *HisApiController) DeletePrescription() {
3857 3857
 					if item.Type == 3 && item.IsOut == 1 {
3858 3858
 						good, _ := service.FindGoodInfoByIdTwo(item.ProjectId)
3859 3859
 						f_count, _ := strconv.ParseFloat(item.Count, 64)
3860
-						good.Total = good.Total + f_count
3861
-						service.UpdateGoodInfo(&good)
3860
+						//good.Total = good.Total + f_count
3861
+						//service.UpdateGoodInfo(&good)
3862 3862
 						operation_time := time.Now().Unix()
3863 3863
 						creater := c.GetAdminUserInfo().AdminUser.Id
3864 3864
 						//创建退库单
@@ -3975,6 +3975,21 @@ func (c *HisApiController) DeletePrescription() {
3975 3975
 								service.UpdateSumAddCancelCount(c.GetAdminUserInfo().CurrentOrgId, item.ProjectId, houseConfig.StorehouseOutInfo, total_count)
3976 3976
 								//出库数量减少
3977 3977
 								service.UpdateSumCount(c.GetAdminUserInfo().CurrentOrgId, houseConfig.StorehouseOutInfo, item.ProjectId, total_count)
3978
+
3979
+								//防止先出库 后开药的情况,查找当天是否出库完全
3980
+								numberList, _ := service.GetHisPrescriptionNumberList(item.ProjectId, item.RecordDate, c.GetAdminUserInfo().CurrentOrgId, item.PatientId)
3981
+								if len(numberList) == 0 {
3982
+									infor, _ := service.GetWarehouseOutnfoByProjectId(item.ProjectId, item.RecordDate, c.GetAdminUserInfo().CurrentOrgId, item.PatientId)
3983
+
3984
+									for _, item := range infor {
3985
+										//退库数量
3986
+										service.UpdateWarehouseInfoByProject(item.ProjectId, item.WarehouseInfotId, c.GetAdminUserInfo().CurrentOrgId, item.Count)
3987
+									}
3988
+
3989
+									//清空数据表
3990
+									service.UpdateWarehouseInfoByPatientId(item.ProjectId, item.RecordDate, c.GetAdminUserInfo().CurrentOrgId, item.PatientId)
3991
+
3992
+								}
3978 3993
 							}
3979 3994
 
3980 3995
 							if info.Count < total_count {
@@ -4081,6 +4096,20 @@ func (c *HisApiController) DeletePrescription() {
4081 4096
 							//更新基础库库存
4082 4097
 							service.UpdateGoodInfoSumCountSix(item.ProjectId, flush_count, c.GetAdminUserInfo().CurrentOrgId)
4083 4098
 
4099
+							//防止先出库 后开药的情况,查找当天是否出库完全
4100
+							numberList, _ := service.GetHisPrescriptionNumberList(item.ProjectId, item.RecordDate, c.GetAdminUserInfo().CurrentOrgId, item.PatientId)
4101
+							if len(numberList) == 0 {
4102
+								infor, _ := service.GetWarehouseOutnfoByProjectId(item.ProjectId, item.RecordDate, c.GetAdminUserInfo().CurrentOrgId, item.PatientId)
4103
+
4104
+								for _, item := range infor {
4105
+									//退库数量
4106
+									service.UpdateWarehouseInfoByProject(item.ProjectId, item.WarehouseInfotId, c.GetAdminUserInfo().CurrentOrgId, item.Count)
4107
+								}
4108
+
4109
+								//清空数据表
4110
+								service.UpdateWarehouseInfoByPatientId(item.ProjectId, item.RecordDate, c.GetAdminUserInfo().CurrentOrgId, item.PatientId)
4111
+
4112
+							}
4084 4113
 						}
4085 4114
 
4086 4115
 					}
@@ -4137,8 +4166,7 @@ func (c *HisApiController) DeletePrescription() {
4137 4166
 					for _, it := range goodList {
4138 4167
 						flush_count += it.StockCount
4139 4168
 					}
4140
-					fmt.Println("历史出库数据", info.Count)
4141
-					fmt.Println("出库数量", total_count)
4169
+
4142 4170
 					if info.ID > 0 {
4143 4171
 						cancelStockInfo := models.CancelStockInfo{
4144 4172
 							GoodId:          item.ProjectId,
@@ -4184,7 +4212,6 @@ func (c *HisApiController) DeletePrescription() {
4184 4212
 									flush_count_one += it.StockCount
4185 4213
 								}
4186 4214
 								//查询该批次是否有退库数据
4187
-								//flow, _ := service.GetWarehouseStockFlow(it.WarehouseInfotId, it.GoodId, c.GetAdminUserInfo().CurrentOrgId, it.PatientId, it.SysRecordTime)
4188 4215
 								creater := c.GetAdminUserInfo().AdminUser.Id
4189 4216
 
4190 4217
 								flow := models.VmStockFlow{
@@ -4222,48 +4249,10 @@ func (c *HisApiController) DeletePrescription() {
4222 4249
 								}
4223 4250
 								service.CreateStockFlowOne(flow)
4224 4251
 
4225
-								//if flow.ID > 0 {
4226
-								//	service.AddCountFlowOne(it.WarehouseInfotId, it.GoodId, c.GetAdminUserInfo().CurrentOrgId, it.PatientId, it.Count, it.SysRecordTime, flush_count_one)
4227
-								//}
4228 4252
 							}
4229 4253
 
4230 4254
 						}
4231 4255
 
4232
-						//flow := models.VmStockFlow{
4233
-						//	WarehousingId:           info.WarehouseInfotId,
4234
-						//	GoodId:                  item.ProjectId,
4235
-						//	Number:                  info.Number,
4236
-						//	LicenseNumber:           info.LicenseNumber,
4237
-						//	Count:                   prescribingNumber,
4238
-						//	UserOrgId:               c.GetAdminUserInfo().CurrentOrgId,
4239
-						//	PatientId:               item.PatientId,
4240
-						//	SystemTime:              info.SysRecordTime,
4241
-						//	ConsumableType:          7,
4242
-						//	IsSys:                   0,
4243
-						//	WarehousingOrder:        "",
4244
-						//	WarehouseOutId:          info.WarehouseOutId,
4245
-						//	WarehouseOutOrderNumber: info.WarehouseOutOrderNumber,
4246
-						//	IsEdit:                  0,
4247
-						//	CancelStockId:           cancel.ID,
4248
-						//	CancelOrderNumber:       cancel.OrderNumber,
4249
-						//	Manufacturer:            manufacturer.ID,
4250
-						//	Dealer:                  0,
4251
-						//	Creator:                 c.GetAdminUserInfo().CurrentOrgId,
4252
-						//	UpdateCreator:           0,
4253
-						//	Status:                  1,
4254
-						//	Ctime:                   time.Now().Unix(),
4255
-						//	Mtime:                   0,
4256
-						//	Price:                   info.Price,
4257
-						//	WarehousingDetailId:     info.WarehouseInfotId,
4258
-						//	WarehouseOutDetailId:    info.ID,
4259
-						//	CancelOutDetailId:       cancelInfo.ID,
4260
-						//	ProductDate:             info.ProductDate,
4261
-						//	ExpireDate:              info.ExpiryDate,
4262
-						//	StorehouseId:            houseConfig.StorehouseOutInfo,
4263
-						//	OverCount:               flush_count,
4264
-						//}
4265
-						//service.CreateStockFlowOne(flow)
4266
-
4267 4256
 						//退库数量增加
4268 4257
 						service.UpdateSumAddCancelCount(c.GetAdminUserInfo().CurrentOrgId, item.ProjectId, houseConfig.StorehouseOutInfo, total_count)
4269 4258
 						//出库数量减少
@@ -4272,11 +4261,13 @@ func (c *HisApiController) DeletePrescription() {
4272 4261
 						//查询已出库数量
4273 4262
 						dialysisInfo, _ := service.GetGoodDialysisOutInfoSix(c.GetAdminUserInfo().CurrentOrgId, info.PatientId, info.SysRecordTime, item.ProjectId)
4274 4263
 
4264
+						//如果当前处方数量 小于 出库数量
4275 4265
 						if prescribingNumber < dialysisInfo.Count {
4276 4266
 							//改变数量
4277 4267
 							service.UpdateAutoGood(c.GetAdminUserInfo().CurrentOrgId, info.PatientId, info.SysRecordTime, item.ProjectId, item.ID, prescribingNumber)
4278 4268
 						}
4279 4269
 
4270
+						//如果当前处方数量 大于或者等于出库数量
4280 4271
 						if prescribingNumber >= dialysisInfo.Count {
4281 4272
 							//删除出库表
4282 4273
 							service.DeleteAutoRedeceDetailTwenty(c.GetAdminUserInfo().CurrentOrgId, info.PatientId, info.SysRecordTime, item.ProjectId, item.ID)
@@ -4290,7 +4281,7 @@ func (c *HisApiController) DeletePrescription() {
4290 4281
 
4291 4282
 						//更新库存
4292 4283
 						msgerrkonde := service.UpdateSumGood(c.GetAdminUserInfo().CurrentOrgId, houseConfig.StorehouseOutInfo, item.ProjectId, flush_count_one)
4293
-						fmt.Println("msgerrkonde23332323", msgerrkonde)
4284
+						fmt.Println("msgerrkonde", msgerrkonde)
4294 4285
 
4295 4286
 						//更新基础库库存
4296 4287
 						service.UpdateGoodInfoReduceSumCount(item.ProjectId, flush_count_one, c.GetAdminUserInfo().CurrentOrgId)

+ 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

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

@@ -1386,7 +1386,8 @@ func (c *DialysisAPIController) PostAssessmentAfterDislysis() {
1386 1386
 	after_urea := c.GetString("after_urea")
1387 1387
 	pip_coagulation := c.GetString("pip_coagulation")
1388 1388
 	accumulated_blood_volume := c.GetString("accumulated_blood_volume")
1389
-	fmt.Println("accumulated_blood_volume", accumulated_blood_volume)
1389
+	transfusion_volume := c.GetString("transfusion_volume")
1390
+
1390 1391
 	if id <= 0 {
1391 1392
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
1392 1393
 		return
@@ -1494,6 +1495,7 @@ func (c *DialysisAPIController) PostAssessmentAfterDislysis() {
1494 1495
 		AfterUrea:                    after_urea,
1495 1496
 		PipCoagulation:               pip_coagulation,
1496 1497
 		AccumulatedBloodVolume:       accumulated_blood_volume,
1498
+		TransfusionVolume:            transfusion_volume,
1497 1499
 	}
1498 1500
 
1499 1501
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
@@ -3478,6 +3480,11 @@ func (this *DialysisAPIController) StartDialysis() {
3478 3480
 			record.BreathingRate = "18"
3479 3481
 			record.SodiumConcentration = 140
3480 3482
 		}
3483
+		//江成肾病医院
3484
+		if adminUserInfo.Org.Id == 10517 {
3485
+			record.SodiumConcentration = 138
3486
+			record.DialysateTemperature = 36.5
3487
+		}
3481 3488
 
3482 3489
 		err := service.CreateMonitor(&record)
3483 3490
 

+ 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 {

+ 168 - 38
controllers/sign_api_controller.go View File

@@ -662,7 +662,8 @@ func (this *SignApiController) CreateSdkSendInformation() {
662 662
 
663 663
 func (this *SignApiController) SavePdfInformation() {
664 664
 
665
-	information, orderId := service.SavePdfInformation()
665
+	information, pdfBase64 := service.SavePdfInformation()
666
+	informationOne := service.ToCheckInformation(pdfBase64)
666 667
 
667 668
 	maprequest := make(map[string]interface{})
668 669
 
@@ -674,11 +675,12 @@ func (this *SignApiController) SavePdfInformation() {
674 675
 	maprequest["signTitle"] = "举报合同"
675 676
 
676 677
 	//file := "C:/Users/28169/Desktop/2.pdf"
677
-	file := "/swspan/gopath/src/XT_New/static/2.pdf"
678
+	file := "/swspan/gopath/src/XT_New/static/6.pdf"
678 679
 
679 680
 	fileBytes, _ := ioutil.ReadFile(file) // 读取file
680 681
 
681 682
 	contractBase64 := base64.StdEncoding.EncodeToString(fileBytes) // 加密成base64字符串
683
+
682 684
 	//文件获取方式
683 685
 	maprequest["fileType"] = 1
684 686
 
@@ -710,34 +712,68 @@ func (this *SignApiController) SavePdfInformation() {
710 712
 
711 713
 	keywordSignControls := make([]map[string]interface{}, 0)
712 714
 
715
+	//预冲者样式
713 716
 	inputArrOne := make(map[string]interface{})
714
-
715 717
 	inputArrOne["sealName"] = "1"
716
-	inputArrOne["keyword"] = ""
718
+	inputArrOne["keyword"] = "医生签名"
717 719
 	inputArrOne["pages"] = "0"
718 720
 	inputArrOne["offsetX"] = "100"
719 721
 	inputArrOne["offsetY"] = "100"
720 722
 
721 723
 	keywordSignControls = append(keywordSignControls, inputArrOne)
722 724
 
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
725
+	//穿刺者样式
726
+	//inputArr := make(map[string]interface{})
727
+	//inputArr["sealName"] = "2"
728
+	//inputArr["keyword"] = "治疗护士"
729
+	//inputArr["pages"] = "1"
730
+	//inputArr["offsetX"] = "100"
731
+	//inputArr["offsetY"] = "0"
732
+	//
733
+	//keywordSignControls = append(keywordSignControls, inputArr)
734
+	//
735
+	////上机者
736
+	//inputArrSix := make(map[string]interface{})
737
+	//inputArrSix["sealName"] = "3"
738
+	//inputArrSix["keyword"] = "核对护士"
739
+	//inputArrSix["pages"] = "1"
740
+	//inputArrSix["offsetX"] = "100"
741
+	//inputArrSix["offsetY"] = "0"
742
+	//
743
+	//keywordSignControls = append(keywordSignControls, inputArrSix)
744
+	//
745
+	//stepStamper["keywordSignControls"] = keywordSignControls
746
+	//
747
+	////医生签名
748
+	//inputArrSeven := make(map[string]interface{})
749
+	//inputArrSeven["sealName"] = "4"
750
+	//inputArrSeven["keyword"] = "医生签名"
751
+	//inputArrSeven["pages"] = "1"
752
+	//inputArrSeven["offsetX"] = "100"
753
+	//inputArrSeven["offsetY"] = "0"
754
+	//
755
+	//keywordSignControls = append(keywordSignControls, inputArrSeven)
756
+	//
757
+	//stepStamper["keywordSignControls"] = keywordSignControls
734 758
 
759
+	//crossSignControls := make([]map[string]interface{}, 0)
760
+	//
761
+	//inputArrTwo := make(map[string]interface{})
762
+	//inputArrTwo["sealName"] = "1"
763
+	//inputArrTwo["positionX"] = "0"
764
+	//inputArrTwo["positionY"] = "0"
765
+	//inputArrTwo["pages"] = "0"
766
+	//crossSignControls = append(crossSignControls, inputArrTwo)
767
+	//
768
+	//stepStamper["crossSignControls"] = crossSignControls
769
+	//
735 770
 	xySignControls := make([]map[string]interface{}, 0)
736 771
 
737 772
 	inputArrThree := make(map[string]interface{})
738
-	inputArrThree["sealName"] = "2"
773
+	inputArrThree["sealName"] = "1"
739 774
 	inputArrThree["positionX"] = "100"
740
-	inputArrThree["positionY"] = "100"
775
+	inputArrThree["positionY"] = "0"
776
+	inputArrThree["pages"] = "0"
741 777
 
742 778
 	xySignControls = append(xySignControls, inputArrThree)
743 779
 
@@ -747,54 +783,148 @@ func (this *SignApiController) SavePdfInformation() {
747 783
 
748 784
 	seals := make([]map[string]interface{}, 0)
749 785
 
786
+	//预冲者
750 787
 	sealImagesList := make(map[string]interface{})
751
-
752
-	fileOne := "/swspan/gopath/src/XT_New/static/seal.jpg"
753
-
754
-	fileBytesOne, _ := ioutil.ReadFile(fileOne) // 读取file
755
-
788
+	fileOne := "/swspan/gopath/src/XT_New/static/huangzihui.jpg"
789
+	fileBytesOne, _ := ioutil.ReadFile(fileOne)                          // 读取file
756 790
 	contractBase64One := base64.StdEncoding.EncodeToString(fileBytesOne) // 加密成base64字符串
757 791
 	sealImagesList["sealBase64"] = contractBase64One
758
-	sealImagesList["width"] = "100"
759
-	sealImagesList["height"] = "100"
792
+	//控制签名的大小
793
+	sealImagesList["width"] = "50"
794
+	sealImagesList["height"] = "50"
760 795
 	sealImagesList["verticalAlign"] = "middle"
761 796
 
762 797
 	sealTextsList := make(map[string]interface{})
763
-	sealTextsList["text"] = "2"
798
+	sealTextsList["text"] = "2023年8月8日"
764 799
 	sealTextsList["fontSize"] = "100"
765
-	sealTextsList["fontColor"] = "100"
800
+	sealTextsList["fontColor"] = "#333333"
766 801
 	sealTextsList["isTextArea"] = true
767 802
 	sealTextsList["textAlign"] = 0
768
-	sealTextsList["width"] = 300
769
-	sealTextsList["height"] = 300
803
+	sealTextsList["width"] = 150
804
+	sealTextsList["height"] = 20
770 805
 
771 806
 	sealsObj := make(map[string]interface{})
772
-
773
-	sealsObj["sealWidth"] = "300"
774
-	sealsObj["sealHeight"] = "300"
775
-	sealsObj["sealName"] = 1
807
+	sealsObj["sealWidth"] = "150"
808
+	sealsObj["sealHeight"] = "150"
809
+	sealsObj["sealName"] = "1"
776 810
 	sealsObj["sealImage"] = sealImagesList
777 811
 	sealsObj["sealText"] = sealTextsList
778
-
779 812
 	seals = append(seals, sealsObj)
813
+
814
+	//穿刺者
815
+	//sealImagesListOne := make(map[string]interface{})
816
+	//
817
+	//fileTwo := "/swspan/gopath/src/XT_New/static/huangjunji.jpg"
818
+	//
819
+	//fileBytesTwo, _ := ioutil.ReadFile(fileTwo) // 读取file
820
+	//
821
+	//contractBase64Two := base64.StdEncoding.EncodeToString(fileBytesTwo) // 加密成base64字符串
822
+	//sealImagesListOne["sealBase64"] = contractBase64Two
823
+	////控制签名的大小
824
+	//sealImagesListOne["width"] = "50"
825
+	//sealImagesListOne["height"] = "50"
826
+	//sealImagesListOne["verticalAlign"] = "middle"
827
+	//
828
+	//sealTextsListOne := make(map[string]interface{})
829
+	//sealTextsListOne["text"] = "2023年8月8日"
830
+	//sealTextsListOne["fontSize"] = "100"
831
+	//sealTextsListOne["fontColor"] = "100"
832
+	//sealTextsListOne["isTextArea"] = true
833
+	//sealTextsListOne["textAlign"] = 0
834
+	//sealTextsListOne["width"] = 150
835
+	//sealTextsListOne["height"] = 20
836
+	//
837
+	//sealsObjOne := make(map[string]interface{})
838
+	//
839
+	//sealsObjOne["sealWidth"] = "150"
840
+	//sealsObjOne["sealHeight"] = "150"
841
+	//sealsObjOne["sealName"] = "2"
842
+	//sealsObjOne["sealImage"] = sealImagesListOne
843
+	//sealsObjOne["sealText"] = sealTextsListOne
844
+	//seals = append(seals, sealsObjOne)
845
+	//间隔签名
846
+
847
+	//上机者
848
+	//sealImagesListTwo := make(map[string]interface{})
849
+	//fileThree := "/swspan/gopath/src/XT_New/static/jianfeixia.jpg"
850
+	//fileBytesThree, _ := ioutil.ReadFile(fileThree)                          // 读取file
851
+	//contractBase64Three := base64.StdEncoding.EncodeToString(fileBytesThree) // 加密成base64字符串
852
+	//sealImagesListTwo["sealBase64"] = contractBase64Three
853
+	////控制签名的大小
854
+	//sealImagesListTwo["width"] = "50"
855
+	//sealImagesListTwo["height"] = "50"
856
+	//sealImagesListTwo["verticalAlign"] = "middle"
857
+	//
858
+	//sealTextsListTwo := make(map[string]interface{})
859
+	//sealTextsListTwo["text"] = "2023年8月8日"
860
+	//sealTextsListTwo["fontSize"] = "100"
861
+	//sealTextsListTwo["fontColor"] = "100"
862
+	//sealTextsListTwo["isTextArea"] = true
863
+	//sealTextsListTwo["textAlign"] = 0
864
+	//sealTextsListTwo["width"] = 150
865
+	//sealTextsListTwo["height"] = 20
866
+	//
867
+	//sealsObjTwo := make(map[string]interface{})
868
+	//
869
+	//sealsObjTwo["sealWidth"] = "150"
870
+	//sealsObjTwo["sealHeight"] = "150"
871
+	//sealsObjTwo["sealName"] = "3"
872
+	//sealsObjTwo["sealImage"] = sealImagesListTwo
873
+	//sealsObjTwo["sealText"] = sealTextsListTwo
874
+	//seals = append(seals, sealsObjTwo)
875
+
876
+	//医生签名
877
+	//sealImagesListThree := make(map[string]interface{})
878
+	//fileFour := "/swspan/gopath/src/XT_New/static/jianfeixia.jpg"
879
+	//fileBytesFour, _ := ioutil.ReadFile(fileFour)                          // 读取file
880
+	//contractBase64Tour := base64.StdEncoding.EncodeToString(fileBytesFour) // 加密成base64字符串
881
+	//sealImagesListThree["sealBase64"] = contractBase64Tour
882
+	////控制签名的大小
883
+	//sealImagesListThree["width"] = "50"
884
+	//sealImagesListThree["height"] = "50"
885
+	//sealImagesListThree["verticalAlign"] = "middle"
886
+	//
887
+	//sealTextsListThree := make(map[string]interface{})
888
+	//sealTextsListThree["text"] = "2023年8月8日"
889
+	//sealTextsListThree["fontSize"] = "100"
890
+	//sealTextsListThree["fontColor"] = "100"
891
+	//sealTextsListThree["isTextArea"] = true
892
+	//sealTextsListThree["textAlign"] = 0
893
+	//sealTextsListThree["width"] = 150
894
+	//sealTextsListThree["height"] = 20
895
+	//
896
+	//sealsObjThree := make(map[string]interface{})
897
+	//
898
+	//sealsObjThree["sealWidth"] = "150"
899
+	//sealsObjThree["sealHeight"] = "150"
900
+	//sealsObjThree["sealName"] = "4"
901
+	//sealsObjThree["sealImage"] = sealImagesListThree
902
+	//sealsObjThree["sealText"] = sealTextsListThree
903
+	//seals = append(seals, sealsObjThree)
904
+
780 905
 	maprequest["seals"] = seals
781 906
 
782 907
 	maprequest["isUserWishes"] = true
783 908
 	maprequest["phone"] = "13318464642"
784 909
 	maprequest["verificationCode"] = "18888888888"
910
+
785 911
 	this.ServeSuccessJSON(map[string]interface{}{
786
-		"maprequest":  maprequest,
787
-		"information": information,
788
-		"orderId":     orderId,
912
+
913
+		"information":    information,
914
+		"orderId":        pdfBase64,
915
+		"informationOne": informationOne,
916
+		"maprequest":     maprequest,
789 917
 	})
790 918
 
791 919
 }
792 920
 
793 921
 func (this *SignApiController) ToCheckInformation() {
794 922
 
795
-	information := service.ToCheckInformation()
923
+	information, pdfBase64 := service.SavePdfInformation()
924
+	informationOne := service.ToCheckInformation(pdfBase64)
796 925
 
797 926
 	this.ServeSuccessJSON(map[string]interface{}{
798
-		"information": information,
927
+		"information":    information,
928
+		"informationOne": informationOne,
799 929
 	})
800 930
 }

+ 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 {

+ 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")

+ 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
+}

+ 175 - 52
service/sign_service.go View File

@@ -1674,11 +1674,12 @@ func SavePdfInformation() (string, string) {
1674 1674
 	maprequest["signTitle"] = "举报合同"
1675 1675
 
1676 1676
 	//file := "C:/Users/28169/Desktop/2.pdf"
1677
-	file := "/swspan/gopath/src/XT_New/static/2.pdf"
1677
+	file := "/swspan/gopath/src/XT_New/static/6.pdf"
1678 1678
 
1679 1679
 	fileBytes, _ := ioutil.ReadFile(file) // 读取file
1680 1680
 
1681 1681
 	contractBase64 := base64.StdEncoding.EncodeToString(fileBytes) // 加密成base64字符串
1682
+
1682 1683
 	//文件获取方式
1683 1684
 	maprequest["fileType"] = 1
1684 1685
 
@@ -1710,75 +1711,197 @@ func SavePdfInformation() (string, string) {
1710 1711
 
1711 1712
 	keywordSignControls := make([]map[string]interface{}, 0)
1712 1713
 
1714
+	//预冲者样式
1713 1715
 	inputArrOne := make(map[string]interface{})
1714
-
1715 1716
 	inputArrOne["sealName"] = "1"
1716
-	inputArrOne["keyword"] = "王志文"
1717
+	inputArrOne["keyword"] = "杨姣"
1717 1718
 	inputArrOne["pages"] = "0"
1718
-	inputArrOne["offsetX"] = "100"
1719
-	inputArrOne["offsetY"] = "100"
1719
+	inputArrOne["offsetX"] = "50"
1720
+	inputArrOne["offsetY"] = "0"
1720 1721
 
1721 1722
 	keywordSignControls = append(keywordSignControls, inputArrOne)
1722 1723
 
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"
1724
+	//穿刺者样式
1725
+	//inputArr := make(map[string]interface{})
1726
+	//inputArr["sealName"] = "2"
1727
+	//inputArr["keyword"] = "治疗护士"
1728
+	//inputArr["pages"] = "1"
1729
+	//inputArr["offsetX"] = "100"
1730
+	//inputArr["offsetY"] = "0"
1731
+	//
1732
+	//keywordSignControls = append(keywordSignControls, inputArr)
1733
+	//
1734
+	////上机者
1735
+	//inputArrSix := make(map[string]interface{})
1736
+	//inputArrSix["sealName"] = "3"
1737
+	//inputArrSix["keyword"] = "核对护士"
1738
+	//inputArrSix["pages"] = "1"
1739
+	//inputArrSix["offsetX"] = "100"
1740
+	//inputArrSix["offsetY"] = "0"
1741
+	//
1742
+	//keywordSignControls = append(keywordSignControls, inputArrSix)
1743
+	//
1743 1744
 
1744
-	xySignControls = append(xySignControls, inputArrThree)
1745
+	////医生签名
1746
+	//inputArrSeven := make(map[string]interface{})
1747
+	//inputArrSeven["sealName"] = "4"
1748
+	//inputArrSeven["keyword"] = "医生签名"
1749
+	//inputArrSeven["pages"] = "1"
1750
+	//inputArrSeven["offsetX"] = "100"
1751
+	//inputArrSeven["offsetY"] = "0"
1752
+	//
1753
+	//keywordSignControls = append(keywordSignControls, inputArrSeven)
1754
+	//
1755
+	//stepStamper["keywordSignControls"] = keywordSignControls
1756
+	stepStamper["keywordSignControls"] = keywordSignControls
1757
+	//
1745 1758
 
1746
-	stepStamper["xySignControls"] = xySignControls
1759
+	//crossSignControls := make([]map[string]interface{}, 0)
1760
+	//
1761
+	//inputArrTwo := make(map[string]interface{})
1762
+	//inputArrTwo["sealName"] = "1"
1763
+	//inputArrTwo["positionX"] = "0"
1764
+	//inputArrTwo["positionY"] = "0"
1765
+	//inputArrTwo["pages"] = "0"
1766
+	//crossSignControls = append(crossSignControls, inputArrTwo)
1767
+	//
1768
+	//stepStamper["crossSignControls"] = crossSignControls
1769
+	//
1770
+	//xySignControls := make([]map[string]interface{}, 0)
1771
+	//
1772
+	//inputArrThree := make(map[string]interface{})
1773
+	//inputArrThree["sealName"] = "1"
1774
+	//inputArrThree["positionX"] = "100"
1775
+	//inputArrThree["positionY"] = "0"
1776
+	//inputArrThree["pages"] = "0"
1777
+	//
1778
+	//xySignControls = append(xySignControls, inputArrThree)
1779
+	//
1780
+	//stepStamper["xySignControls"] = xySignControls
1747 1781
 
1748 1782
 	maprequest["stepStamper"] = stepStamper
1749 1783
 
1750 1784
 	seals := make([]map[string]interface{}, 0)
1751 1785
 
1786
+	//预冲者
1752 1787
 	sealImagesList := make(map[string]interface{})
1753
-
1754
-	fileOne := "/swspan/gopath/src/XT_New/static/seal.jpg"
1755
-
1756
-	fileBytesOne, _ := ioutil.ReadFile(fileOne) // 读取file
1757
-
1788
+	fileOne := "/swspan/gopath/src/XT_New/static/huangzihui.jpg"
1789
+	fileBytesOne, _ := ioutil.ReadFile(fileOne)                          // 读取file
1758 1790
 	contractBase64One := base64.StdEncoding.EncodeToString(fileBytesOne) // 加密成base64字符串
1759 1791
 	sealImagesList["sealBase64"] = contractBase64One
1760
-	sealImagesList["width"] = "100"
1761
-	sealImagesList["height"] = "100"
1792
+	//控制签名的大小
1793
+	sealImagesList["width"] = "50"
1794
+	sealImagesList["height"] = "50"
1762 1795
 	sealImagesList["verticalAlign"] = "middle"
1763 1796
 
1764 1797
 	sealTextsList := make(map[string]interface{})
1765
-	sealTextsList["text"] = "2"
1798
+	sealTextsList["text"] = "2023年8月8日"
1766 1799
 	sealTextsList["fontSize"] = "100"
1767
-	sealTextsList["fontColor"] = "100"
1800
+	sealTextsList["fontColor"] = "#333333"
1768 1801
 	sealTextsList["isTextArea"] = true
1769 1802
 	sealTextsList["textAlign"] = 0
1770
-	sealTextsList["width"] = 300
1771
-	sealTextsList["height"] = 300
1803
+	sealTextsList["width"] = 150
1804
+	sealTextsList["height"] = 20
1772 1805
 
1773 1806
 	sealsObj := make(map[string]interface{})
1774
-
1775
-	sealsObj["sealWidth"] = "300"
1776
-	sealsObj["sealHeight"] = "300"
1807
+	sealsObj["sealWidth"] = "150"
1808
+	sealsObj["sealHeight"] = "150"
1777 1809
 	sealsObj["sealName"] = "1"
1778 1810
 	sealsObj["sealImage"] = sealImagesList
1779 1811
 	sealsObj["sealText"] = sealTextsList
1780
-
1781 1812
 	seals = append(seals, sealsObj)
1813
+
1814
+	//穿刺者
1815
+	//sealImagesListOne := make(map[string]interface{})
1816
+	//
1817
+	//fileTwo := "/swspan/gopath/src/XT_New/static/huangjunji.jpg"
1818
+	//
1819
+	//fileBytesTwo, _ := ioutil.ReadFile(fileTwo) // 读取file
1820
+	//
1821
+	//contractBase64Two := base64.StdEncoding.EncodeToString(fileBytesTwo) // 加密成base64字符串
1822
+	//sealImagesListOne["sealBase64"] = contractBase64Two
1823
+	////控制签名的大小
1824
+	//sealImagesListOne["width"] = "50"
1825
+	//sealImagesListOne["height"] = "50"
1826
+	//sealImagesListOne["verticalAlign"] = "middle"
1827
+	//
1828
+	//sealTextsListOne := make(map[string]interface{})
1829
+	//sealTextsListOne["text"] = "2023年8月8日"
1830
+	//sealTextsListOne["fontSize"] = "100"
1831
+	//sealTextsListOne["fontColor"] = "100"
1832
+	//sealTextsListOne["isTextArea"] = true
1833
+	//sealTextsListOne["textAlign"] = 0
1834
+	//sealTextsListOne["width"] = 150
1835
+	//sealTextsListOne["height"] = 20
1836
+	//
1837
+	//sealsObjOne := make(map[string]interface{})
1838
+	//
1839
+	//sealsObjOne["sealWidth"] = "150"
1840
+	//sealsObjOne["sealHeight"] = "150"
1841
+	//sealsObjOne["sealName"] = "2"
1842
+	//sealsObjOne["sealImage"] = sealImagesListOne
1843
+	//sealsObjOne["sealText"] = sealTextsListOne
1844
+	//seals = append(seals, sealsObjOne)
1845
+	//间隔签名
1846
+
1847
+	//上机者
1848
+	//sealImagesListTwo := make(map[string]interface{})
1849
+	//fileThree := "/swspan/gopath/src/XT_New/static/jianfeixia.jpg"
1850
+	//fileBytesThree, _ := ioutil.ReadFile(fileThree)                          // 读取file
1851
+	//contractBase64Three := base64.StdEncoding.EncodeToString(fileBytesThree) // 加密成base64字符串
1852
+	//sealImagesListTwo["sealBase64"] = contractBase64Three
1853
+	////控制签名的大小
1854
+	//sealImagesListTwo["width"] = "50"
1855
+	//sealImagesListTwo["height"] = "50"
1856
+	//sealImagesListTwo["verticalAlign"] = "middle"
1857
+	//
1858
+	//sealTextsListTwo := make(map[string]interface{})
1859
+	//sealTextsListTwo["text"] = "2023年8月8日"
1860
+	//sealTextsListTwo["fontSize"] = "100"
1861
+	//sealTextsListTwo["fontColor"] = "100"
1862
+	//sealTextsListTwo["isTextArea"] = true
1863
+	//sealTextsListTwo["textAlign"] = 0
1864
+	//sealTextsListTwo["width"] = 150
1865
+	//sealTextsListTwo["height"] = 20
1866
+	//
1867
+	//sealsObjTwo := make(map[string]interface{})
1868
+	//
1869
+	//sealsObjTwo["sealWidth"] = "150"
1870
+	//sealsObjTwo["sealHeight"] = "150"
1871
+	//sealsObjTwo["sealName"] = "3"
1872
+	//sealsObjTwo["sealImage"] = sealImagesListTwo
1873
+	//sealsObjTwo["sealText"] = sealTextsListTwo
1874
+	//seals = append(seals, sealsObjTwo)
1875
+
1876
+	//医生签名
1877
+	//sealImagesListThree := make(map[string]interface{})
1878
+	//fileFour := "/swspan/gopath/src/XT_New/static/jianfeixia.jpg"
1879
+	//fileBytesFour, _ := ioutil.ReadFile(fileFour)                          // 读取file
1880
+	//contractBase64Tour := base64.StdEncoding.EncodeToString(fileBytesFour) // 加密成base64字符串
1881
+	//sealImagesListThree["sealBase64"] = contractBase64Tour
1882
+	////控制签名的大小
1883
+	//sealImagesListThree["width"] = "50"
1884
+	//sealImagesListThree["height"] = "50"
1885
+	//sealImagesListThree["verticalAlign"] = "middle"
1886
+	//
1887
+	//sealTextsListThree := make(map[string]interface{})
1888
+	//sealTextsListThree["text"] = "2023年8月8日"
1889
+	//sealTextsListThree["fontSize"] = "100"
1890
+	//sealTextsListThree["fontColor"] = "100"
1891
+	//sealTextsListThree["isTextArea"] = true
1892
+	//sealTextsListThree["textAlign"] = 0
1893
+	//sealTextsListThree["width"] = 150
1894
+	//sealTextsListThree["height"] = 20
1895
+	//
1896
+	//sealsObjThree := make(map[string]interface{})
1897
+	//
1898
+	//sealsObjThree["sealWidth"] = "150"
1899
+	//sealsObjThree["sealHeight"] = "150"
1900
+	//sealsObjThree["sealName"] = "4"
1901
+	//sealsObjThree["sealImage"] = sealImagesListThree
1902
+	//sealsObjThree["sealText"] = sealTextsListThree
1903
+	//seals = append(seals, sealsObjThree)
1904
+
1782 1905
 	maprequest["seals"] = seals
1783 1906
 
1784 1907
 	maprequest["isUserWishes"] = true
@@ -1825,24 +1948,24 @@ func SavePdfInformation() (string, string) {
1825 1948
 	if err := json.Unmarshal([]byte(string(respBytes)), &respJSON); err != nil {
1826 1949
 		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
1827 1950
 	}
1828
-	var orderId string
1829
-	//orderId = respJSON["data"].(map[string]interface{})["orderId"].(string)
1830
-	//fmt.Println("str", orderId)
1831
-	return str, orderId
1951
+	var pdfBase64 string
1952
+	pdfBase64 = respJSON["data"].(map[string]interface{})["pdfBase64"].(string)
1953
+
1954
+	return str, pdfBase64
1832 1955
 }
1833 1956
 
1834
-func ToCheckInformation() string {
1957
+func ToCheckInformation(contractBase64 string) string {
1835 1958
 
1836 1959
 	var url string
1837 1960
 
1838 1961
 	url = "http://localhost:8890/sdk/pdf/verify"
1839 1962
 	maprequest := make(map[string]interface{})
1840 1963
 
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字符串
1964
+	//file := "/swspan/gopath/src/XT_New/static/a.pdf"
1965
+	//
1966
+	//fileBytes, _ := ioutil.ReadFile(file) // 读取file
1967
+	//
1968
+	//contractBase64 := base64.StdEncoding.EncodeToString(fileBytes) // 加密成base64字符串
1846 1969
 
1847 1970
 	maprequest["fileType"] = 1
1848 1971
 

+ 94 - 29
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
 
@@ -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
+}