Browse Source

11月8日库存管理

XMLWAN 3 years ago
parent
commit
146a4ffbba

+ 1 - 1
conf/app.conf View File

@@ -1,5 +1,5 @@
1 1
 appname = 血透
2
-httpport = 9531
2
+httpport = 9529
3 3
 runmode = dev
4 4
 
5 5
 #

+ 23 - 9
controllers/his_api_controller.go View File

@@ -757,6 +757,7 @@ func (c *HisApiController) CreateHisPrescription() {
757 757
 								totals := strconv.FormatInt(total_count, 10)
758 758
 								//查询该药品是否存在开药记录
759 759
 								advicelist, _ := service.GetHisAdviceListByDrugIdEight(drug_id, patient_id, recordDateTime, adviceId)
760
+
760 761
 								//修改处方
761 762
 								if advicelist.ID > 0 {
762 763
 									var device_number int64
@@ -810,6 +811,7 @@ func (c *HisApiController) CreateHisPrescription() {
810 811
 										}
811 812
 									}
812 813
 								}
814
+
813 815
 							}
814 816
 						}
815 817
 					}
@@ -845,7 +847,7 @@ func (c *HisApiController) CreateHisPrescription() {
845 847
 								if project_type == 3 {
846 848
 
847 849
 									//查找该耗材的出库记录
848
-									goodWarehouseInfo, _ := service.GetAutoRecordByGoodId(project_id, patient_id, recordDateTime)
850
+									goodWarehouseInfo, _ := service.GetAutoRecordByGoodIdSeven(project_id, patient_id, recordDateTime)
849 851
 
850 852
 									if goodWarehouseInfo.ID == 0 {
851 853
 										good, _ := service.FindGoodInfoByIdSeven(project_id)
@@ -927,6 +929,7 @@ func (c *HisApiController) CreateHisPrescription() {
927 929
 
928 930
 									//查询该药品是否存在开药记录
929 931
 									advicelist, _ := service.GetHisAdviceListByDrugIdEight(drug_id, patient_id, recordDateTime, adviceId)
932
+
930 933
 									//修改处方
931 934
 									if advicelist.ID > 0 {
932 935
 										var device_number int64
@@ -953,18 +956,31 @@ func (c *HisApiController) CreateHisPrescription() {
953 956
 											prescribingNumberInt, _ := strconv.ParseInt(prescribingNumber, 10, 64)
954 957
 											sum_count = prescribingNumberInt
955 958
 										}
956
-										fmt.Println("原先药品记录", device_number)
957
-										fmt.Println("现在出库数量", sum_count)
959
+
958 960
 										if device_number != sum_count {
959 961
 
960 962
 											// 查询该药品最后一次出库记录
961 963
 											druginfo, _ := service.GetLastDrugWarehouseOutByDrugId(drug_id, patient_id, recordDateTime)
962 964
 											//回退库存
963 965
 											if druginfo.CountUnit == drug.MaxUnit && drug.MaxUnit != drug.MinUnit {
966
+
964 967
 												service.ModefyDrugByWarehouseInfo(druginfo.WarehouseInfoId, druginfo.Count)
965 968
 											}
966 969
 											if druginfo.CountUnit == drug.MinUnit && drug.MaxUnit != drug.MinUnit {
967
-												service.ModefyDrugByWarehouseInfoOne(druginfo.WarehouseInfoId, druginfo.Count)
970
+												var stock_max_number int64
971
+												var stock_min_number int64
972
+												if druginfo.Count >= drug.MinNumber {
973
+													stock_max_number = druginfo.Count / drug.MinNumber
974
+													fmt.Println("大的值2323233232232323", stock_max_number)
975
+													service.ModefyDrugByWarehouseInfo(druginfo.WarehouseInfoId, stock_max_number)
976
+													stock_min_number = druginfo.Count % drug.MinNumber
977
+													fmt.Println("小的值322332332323233223", stock_min_number)
978
+													service.ModefyDrugByWarehouseInfoOne(druginfo.WarehouseInfoId, stock_min_number)
979
+
980
+												} else {
981
+													service.ModefyDrugByWarehouseInfoOne(druginfo.WarehouseInfoId, druginfo.Count)
982
+												}
983
+
968 984
 											}
969 985
 
970 986
 											if druginfo.CountUnit == drug.MaxUnit && druginfo.CountUnit == drug.MinUnit && drug.MaxUnit == drug.MinUnit {
@@ -1009,9 +1025,10 @@ func (c *HisApiController) CreateHisPrescription() {
1009 1025
 										total, _ := project.(map[string]interface{})["total"].(string)
1010 1026
 										parsetotal, _ = strconv.ParseInt(total, 10, 64)
1011 1027
 									}
1028
+
1012 1029
 									if project_type == 3 {
1013 1030
 										//查找该耗材的出库记录
1014
-										goodWarehouseInfo, _ := service.GetAutoRecordByGoodId(project_id, patient_id, recordDateTime)
1031
+										goodWarehouseInfo, _ := service.GetAutoRecordByGoodIdSeven(project_id, patient_id, recordDateTime)
1015 1032
 										//查询该患者耗材的历史数据
1016 1033
 										ordProject, _ := service.GetHisProjectPrescriptionByPatientId(patient_id, recordDateTime)
1017 1034
 										if goodWarehouseInfo.ID > 0 {
@@ -1269,9 +1286,7 @@ func (c *HisApiController) CreateHisPrescription() {
1269 1286
 							redis := service.RedisClient()
1270 1287
 							key := strconv.FormatInt(adminInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(theTime.Unix(), 10) + ":his_advices_list_all"
1271 1288
 							redis.Set(key, "", time.Second)
1272
-							fmt.Println("key55555555555555", key)
1273 1289
 							keyOne := strconv.FormatInt(adminInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(patient_id, 10) + ":" + strconv.FormatInt(recordDateTime, 10) + ":his_doctor_advice"
1274
-							fmt.Println("keyOne", keyOne)
1275 1290
 							redis.Set(keyOne, "", time.Second)
1276 1291
 							keySeven := "scheduals_" + record_date + "_" + strconv.FormatInt(adminInfo.CurrentOrgId, 10)
1277 1292
 							redis.Set(keySeven, "", time.Second)
@@ -1284,7 +1299,6 @@ func (c *HisApiController) CreateHisPrescription() {
1284 1299
 							service.CreateHisDoctorAdvice(&s)
1285 1300
 							keySix := strconv.FormatInt(adminInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(theTime.Unix(), 10) + ":his_advices_list_all"
1286 1301
 							redis.Set(keySix, "", time.Second)
1287
-							fmt.Println("key55555555555555", keySix)
1288 1302
 							keyFive := strconv.FormatInt(adminInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(patient_id, 10) + ":" + strconv.FormatInt(recordDateTime, 10) + ":his_doctor_advice"
1289 1303
 							redis.Set(keyFive, "", time.Second)
1290 1304
 							keyEight := "scheduals_" + record_date + "_" + strconv.FormatInt(adminInfo.CurrentOrgId, 10)
@@ -3143,7 +3157,7 @@ func (c *HisApiController) setAdviceWithJSON(advice *models.HisDoctorAdviceInfo,
3143 3157
 					advice.StartTime = hisAdvice.StartTime
3144 3158
 					advice.HospApprFlag = hisAdvice.HospApprFlag
3145 3159
 
3146
-					if hisAdvice.SingleDose != advice.SingleDose || hisAdvice.DeliveryWay != advice.DeliveryWay || hisAdvice.ExecutionFrequency != advice.ExecutionFrequency || hisAdvice.Day != advice.Day || hisAdvice.PrescribingNumber != advice.PrescribingNumber || hisAdvice.Price != advice.Price || hisAdvice.Remark != advice.Remark {
3160
+					if hisAdvice.SingleDose != advice.SingleDose || hisAdvice.DeliveryWay != advice.DeliveryWay || hisAdvice.ExecutionFrequency != advice.ExecutionFrequency || hisAdvice.Day != advice.Day || hisAdvice.PrescribingNumber != advice.PrescribingNumber || hisAdvice.Price != advice.Price || hisAdvice.Remark != advice.Remark || hisAdvice.PrescribingNumberUnit != advice.PrescribingNumberUnit {
3147 3161
 						advice.ExecutionTime = 0
3148 3162
 						advice.ExecutionStaff = 0
3149 3163
 						advice.ExecutionState = 2

+ 9 - 0
controllers/mobile_api_controllers/dialysis_api_controller.go View File

@@ -4706,10 +4706,17 @@ func (c *DialysisAPIController) CreateOtherStockOutInfo() {
4706 4706
 
4707 4707
 				count, _ := strconv.ParseInt(items["count"].(string), 10, 64)
4708 4708
 
4709
+				if items["project_id"] == nil || reflect.TypeOf(items["project_id"]).String() != "float64" {
4710
+					utils.ErrorLog("project_id")
4711
+					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
4712
+					return
4713
+				}
4714
+				project_id := int64(items["project_id"].(float64))
4709 4715
 				prepare := &models.DialysisBeforePrepareGoods{
4710 4716
 					GoodId:     good_id,
4711 4717
 					GoodTypeId: good_type_id,
4712 4718
 					Count:      count,
4719
+					ProjectId:  project_id,
4713 4720
 				}
4714 4721
 				beforePrepares = append(beforePrepares, prepare)
4715 4722
 
@@ -4717,6 +4724,7 @@ func (c *DialysisAPIController) CreateOtherStockOutInfo() {
4717 4724
 					GoodId:     good_id,
4718 4725
 					GoodTypeId: good_type_id,
4719 4726
 					Count:      count,
4727
+					ProjectId:  project_id,
4720 4728
 				}
4721 4729
 				newBeforePrepares = append(newBeforePrepares, newPrepare)
4722 4730
 			}
@@ -4760,6 +4768,7 @@ func (c *DialysisAPIController) CreateOtherStockOutInfo() {
4760 4768
 			Creater:    adminInfo.AdminUser.Id,
4761 4769
 			Status:     1,
4762 4770
 			Ctime:      time.Now().Unix(),
4771
+			ProjectId:  item.ProjectId,
4763 4772
 		}
4764 4773
 		//清空准备表的数据
4765 4774
 		err = service.DeleteDialysisBefor(adminInfo.Org.Id, patient_id, record_time, item.GoodId, item.GoodTypeId)

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

@@ -636,7 +636,7 @@ func (c *PatientApiController) ExecDoctorAdvice() {
636 636
 
637 637
 			fmt.Println("theTIME", theTime)
638 638
 			keyFour := "scheduals_" + theTime + "_" + strconv.FormatInt(adminUserInfo.Org.Id, 10)
639
-			fmt.Println("keyFour323223323232323232", keyFour)
639
+
640 640
 			redis.Set(keyFour, "", time.Second)
641 641
 			keyFive := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(advice.AdviceDate, 10) + ":his_advices_list_all"
642 642
 			redis.Set(keyFive, "", time.Second)

+ 3 - 0
models/dialysis.go View File

@@ -1028,6 +1028,7 @@ type DialysisBeforePrepare struct {
1028 1028
 	CommdityCode string                   `gorm:"column:commdity_code" json:"commdity_code" form:"commdity_code"`
1029 1029
 	NewCount     int64                    `gorm:"column:new_count" json:"new_count" form:"new_count"`
1030 1030
 	Children     []*DialysisBeforePrepare `gorm:"column:children" json:"children" form:"children"`
1031
+	ProjectId    int64                    `gorm:"column:project_id" json:"project_id" form:"project_id"`
1031 1032
 }
1032 1033
 
1033 1034
 func (DialysisBeforePrepare) TableName() string {
@@ -1040,6 +1041,7 @@ type DialysisBeforePrepareGoods struct {
1040 1041
 	GoodTypeId        int64  `gorm:"column:good_type_id" json:"good_type_id" form:"good_type_id"`
1041 1042
 	TypeName          string `gorm:"column:type_name" json:"type_name" form:"type_name"`
1042 1043
 	SpecificationName string `gorm:"column:specification_name" json:"specification_name" form:"specification_name"`
1044
+	ProjectId         int64  `gorm:"column:project_id" json:"project_id" form:"project_id"`
1043 1045
 }
1044 1046
 
1045 1047
 type NewDialysisBeforePrepareGoods struct {
@@ -1049,6 +1051,7 @@ type NewDialysisBeforePrepareGoods struct {
1049 1051
 	TypeName          string `gorm:"column:type_name" json:"type_name" form:"type_name"`
1050 1052
 	SpecificationName string `gorm:"column:specification_name" json:"specification_name" form:"specification_name"`
1051 1053
 	NewCount          int64  `gorm:"column:new_count" json:"new_count" form:"new_count"`
1054
+	ProjectId         int64  `gorm:"column:project_id" json:"project_id" form:"project_id"`
1052 1055
 }
1053 1056
 
1054 1057
 type QueueCallConfig struct {

+ 1 - 0
models/dialysis_parameter_models.go View File

@@ -95,6 +95,7 @@ type BloodAutomaticReduceDetail struct {
95 95
 	GoodId                  int64  `gorm:"column:good_id" json:"good_id" form:"good_id"`
96 96
 	GoodTypeId              int64  `gorm:"column:good_type_id" json:"good_type_id" form:"good_type_id"`
97 97
 	Count                   int64  `gorm:"column:count" json:"count" form:"count"`
98
+	ProjectId               int64  `gorm:"column:project_id" json:"project_id" form:"project_id"`
98 99
 }
99 100
 
100 101
 func (BloodAutomaticReduceDetail) TableName() string {

+ 12 - 0
models/stock_models.go View File

@@ -232,12 +232,22 @@ type WarehouseOutInfo struct {
232 232
 	Number                  string       `gorm:"column:number" json:"number" form:"number"`
233 233
 	LicenseNumber           string       `gorm:"column:license_number" json:"license_number" form:"license_number"`
234 234
 	ConsumableType          int64        `gorm:"column:consumable_type" json:"consumable_type" form:"consumable_type"`
235
+	ProjectId               int64        `gorm:"column:project_id" json:"project_id" form:"project_id"`
235 236
 }
236 237
 
237 238
 func (WarehouseOutInfo) TableName() string {
238 239
 	return "xt_warehouse_out_info"
239 240
 }
240 241
 
242
+type WarehouseOutInfoSeven struct {
243
+	ID    int64 `gorm:"column:id" json:"id"`
244
+	Count int64 `gorm:"column:count" json:"count"`
245
+}
246
+
247
+func (WarehouseOutInfoSeven) TableName() string {
248
+	return "xt_warehouse_out_info"
249
+}
250
+
241 251
 type SalesReturn struct {
242 252
 	ID           int64  `gorm:"column:id" json:"id"`
243 253
 	OrderNumber  string `gorm:"column:order_number" json:"order_number"`
@@ -372,6 +382,7 @@ type AutomaticReduceDetail struct {
372 382
 	Count                   int64               `gorm:"column:count" json:"count"`
373 383
 	Type                    int64               `gorm:"column:type" json:"type"`
374 384
 	WarehouseOutInfo        []*WarehouseOutInfo `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"warehouseOutInfo"`
385
+	ProjectId               int64               `gorm:"column:project_id" json:"project_id" form:"project_id"`
375 386
 }
376 387
 
377 388
 func (AutomaticReduceDetail) TableName() string {
@@ -552,6 +563,7 @@ type VmStockFlow struct {
552 563
 	ProductDate             int64   `gorm:"column:product_date" json:"product_date" form:"product_date"`
553 564
 	ExpireDate              int64   `gorm:"column:expire_date" json:"expire_date" form:"expire_date"`
554 565
 	ReturnCount             int64   `gorm:"column:return_count" json:"return_count" form:"return_count"`
566
+	ProjectId               int64   `gorm:"column:project_id" json:"project_id" form:"project_id"`
555 567
 }
556 568
 
557 569
 func (VmStockFlow) TableName() string {

+ 6 - 0
service/stock_service.go View File

@@ -3531,6 +3531,12 @@ func GetAutoRecordByGoodId(goodid int64, patientid int64, recorddate int64) (mod
3531 3531
 	return detail, err
3532 3532
 }
3533 3533
 
3534
+func GetAutoRecordByGoodIdSeven(goodid int64, patientid int64, recorddate int64) (models.WarehouseOutInfoSeven, error) {
3535
+	detail := models.WarehouseOutInfoSeven{}
3536
+	err := XTReadDB().Model(&detail).Where("sys_record_time = ? and good_id = ? and patient_id = ?  and status = 1", recorddate, goodid, patientid).Find(&detail).Error
3537
+	return detail, err
3538
+}
3539
+
3534 3540
 func GetHisProjectPrescriptionByPatientId(patientid int64, recorddate int64) (project []*models.HisPrescriptionProject, err error) {
3535 3541
 
3536 3542
 	err = XTReadDB().Model(&project).Where("patient_id = ? and record_date = ? and status =1", patientid, recorddate).Find(&project).Error

+ 18 - 17
service/warhouse_service.go View File

@@ -580,19 +580,8 @@ func HisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseout *mo
580 580
 		var maxNumber int64 = 0
581 581
 		var minNumber int64 = 0
582 582
 
583
-		//fmt.Println("deliver_number23332323232333232323233232323232",deliver_number)
584 583
 		maxNumber = deliver_number / drup.MinNumber
585
-
586
-		if deliver_number <= drup.MinNumber {
587
-			minNumber = deliver_number % drup.MinNumber
588
-		} else {
589
-			minNumber = deliver_number
590
-		}
591
-
592
-		if deliver_number <= drup.MinNumber && warehouse.StockMaxNumber == 0 {
593
-			minNumber = deliver_number
594
-		}
595
-
584
+		minNumber = deliver_number % drup.MinNumber
596 585
 		if warehouse.StockMaxNumber == 0 && drup.MaxUnit == drup.MinUnit {
597 586
 			minNumber = maxNumber
598 587
 		}
@@ -604,21 +593,21 @@ func HisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseout *mo
604 593
 		}
605 594
 
606 595
 		warehouse.StockMaxNumber = warehouse.StockMaxNumber - maxNumber
607
-		//fmt.Println("最大单位23323232323232332323233232323",warehouse.StockMaxNumber)
596
+
608 597
 		if warehouse.StockMaxNumber < 0 {
609 598
 			warehouse.StockMaxNumber = 0
610 599
 		}
600
+		if warehouse.StockMinNumber < 0 {
601
+			warehouse.StockMinNumber = 0
602
+		}
611 603
 
612 604
 		warehouse.Mtime = time.Now().Unix()
613
-		//fmt.Println("最小单位2323223233232233233232323232323323232",warehouse.StockMinNumber)
614
-		//fmt.Println("最小换算量233232332322323322332323232332323223",minNumber)
605
+
615 606
 		if warehouse.StockMinNumber < minNumber {
616 607
 			warehouse.StockMaxNumber = warehouse.StockMaxNumber - 1
617 608
 			warehouse.StockMinNumber = warehouse.StockMinNumber + drup.MinNumber - minNumber
618 609
 		} else {
619
-			//fmt.Println("hhhhhhhhhhhhhhhhhhhhhhhhh",warehouse.StockMinNumber,minNumber)
620 610
 			warehouse.StockMinNumber = warehouse.StockMinNumber - minNumber
621
-			//fmt.Println("我的魏2232332322323323",warehouse.StockMinNumber)
622 611
 		}
623 612
 
624 613
 		if drup.MaxUnit != drup.MinUnit {
@@ -1054,6 +1043,7 @@ func ConsumablesDeliveryTotal(orgID int64, patient_id int64, record_time int64,
1054 1043
 				GoodTypeId: item.GoodTypeId,
1055 1044
 				GoodId:     item.GoodId,
1056 1045
 				Count:      item.Count,
1046
+				ProjectId:  item.ProjectId,
1057 1047
 			}
1058 1048
 
1059 1049
 			ConsumablesDelivery(orgID, patient_id, record_time, &prepare, &out, newCount)
@@ -1116,6 +1106,7 @@ func ConsumablesDelivery(orgID int64, patient_id int64, record_time int64, goods
1116 1106
 			Price:                   info.PackingPrice,
1117 1107
 			ExpiryDate:              warehouse.ExpiryDate,
1118 1108
 			ProductDate:             warehouse.ProductDate,
1109
+			ProjectId:               goods.ProjectId,
1119 1110
 		}
1120 1111
 		warehouseOutInfo.Count = count
1121 1112
 
@@ -1141,6 +1132,7 @@ func ConsumablesDelivery(orgID int64, patient_id int64, record_time int64, goods
1141 1132
 			GoodId:                  goods.GoodId,
1142 1133
 			GoodTypeId:              goods.GoodTypeId,
1143 1134
 			Count:                   count,
1135
+			ProjectId:               goods.ProjectId,
1144 1136
 		}
1145 1137
 		//查询当天耗材是否已经存在数据
1146 1138
 		_, errcode := GetAutoMaticReduceDetail(orgID, patient_id, record_time, goods.GoodId, goods.GoodTypeId)
@@ -1174,6 +1166,7 @@ func ConsumablesDelivery(orgID int64, patient_id int64, record_time int64, goods
1174 1166
 				WarehouseOutOrderNumber: warehouseOut.WarehouseOutOrderNumber,
1175 1167
 				IsSys:                   1,
1176 1168
 				PatientId:               patient_id,
1169
+				ProjectId:               goods.ProjectId,
1177 1170
 			}
1178 1171
 			//查询流水是否存在
1179 1172
 			exsit, errflow := GetStockFlowIsExsit(warehouse.ID, patient_id, record_time, goods.GoodId)
@@ -1209,6 +1202,7 @@ func ConsumablesDelivery(orgID int64, patient_id int64, record_time int64, goods
1209 1202
 					IsSys:                   1,
1210 1203
 					PatientId:               patient_id,
1211 1204
 					ReturnCount:             exsit.Count + (exsit.Count + deliver_number),
1205
+					ProjectId:               goods.ProjectId,
1212 1206
 				}
1213 1207
 
1214 1208
 				errFour := UpdatedStockFlowOne(flow, warehouse.ID, patient_id, record_time, goods.GoodId)
@@ -1241,6 +1235,7 @@ func ConsumablesDelivery(orgID int64, patient_id int64, record_time int64, goods
1241 1235
 				WarehouseOutOrderNumber: warehouseOut.WarehouseOutOrderNumber,
1242 1236
 				IsSys:                   1,
1243 1237
 				PatientId:               patient_id,
1238
+				ProjectId:               goods.ProjectId,
1244 1239
 			}
1245 1240
 			//查询流水是否存在
1246 1241
 			exsit, errflow := GetStockFlowIsExsit(warehouse.ID, patient_id, record_time, goods.GoodId)
@@ -1275,6 +1270,7 @@ func ConsumablesDelivery(orgID int64, patient_id int64, record_time int64, goods
1275 1270
 					IsSys:                   1,
1276 1271
 					PatientId:               patient_id,
1277 1272
 					ReturnCount:             exsit.Count + (exsit.Count + deliver_number),
1273
+					ProjectId:               goods.ProjectId,
1278 1274
 				}
1279 1275
 				//UpdatedStockFlow(flow)
1280 1276
 				UpdatedStockFlowOne(flow, warehouse.ID, patient_id, record_time, goods.GoodId)
@@ -1327,6 +1323,7 @@ func ConsumablesDelivery(orgID int64, patient_id int64, record_time int64, goods
1327 1323
 			Price:                   info.PackingPrice,
1328 1324
 			ExpiryDate:              warehouse.ExpiryDate,
1329 1325
 			ProductDate:             warehouse.ProductDate,
1326
+			ProjectId:               goods.ProjectId,
1330 1327
 		}
1331 1328
 		warehouseOutInfo.Count = stock_number
1332 1329
 
@@ -1362,6 +1359,7 @@ func ConsumablesDelivery(orgID int64, patient_id int64, record_time int64, goods
1362 1359
 				WarehouseOutOrderNumber: warehouseOut.WarehouseOutOrderNumber,
1363 1360
 				IsSys:                   1,
1364 1361
 				PatientId:               patient_id,
1362
+				ProjectId:               goods.ProjectId,
1365 1363
 			}
1366 1364
 			//查询流水是否存在
1367 1365
 			exsit, errflows := GetStockFlowIsExsit(warehouse.ID, patient_id, record_time, goods.GoodId)
@@ -1394,6 +1392,7 @@ func ConsumablesDelivery(orgID int64, patient_id int64, record_time int64, goods
1394 1392
 					IsSys:                   1,
1395 1393
 					PatientId:               patient_id,
1396 1394
 					ReturnCount:             exsit.Count + (exsit.Count + deliver_number),
1395
+					ProjectId:               goods.ProjectId,
1397 1396
 				}
1398 1397
 				//UpdatedStockFlow(flow)
1399 1398
 				UpdatedStockFlowOne(flow, warehouse.ID, patient_id, record_time, goods.GoodId)
@@ -1429,6 +1428,7 @@ func ConsumablesDelivery(orgID int64, patient_id int64, record_time int64, goods
1429 1428
 				WarehouseOutOrderNumber: warehouseOut.WarehouseOutOrderNumber,
1430 1429
 				IsSys:                   1,
1431 1430
 				PatientId:               patient_id,
1431
+				ProjectId:               goods.ProjectId,
1432 1432
 			}
1433 1433
 			//查询流水是否存在
1434 1434
 			exsit, errflows := GetStockFlowIsExsit(warehouse.ID, patient_id, record_time, goods.GoodId)
@@ -1460,6 +1460,7 @@ func ConsumablesDelivery(orgID int64, patient_id int64, record_time int64, goods
1460 1460
 					WarehouseOutOrderNumber: warehouseOut.WarehouseOutOrderNumber,
1461 1461
 					IsSys:                   1,
1462 1462
 					PatientId:               patient_id,
1463
+					ProjectId:               goods.ProjectId,
1463 1464
 				}
1464 1465
 				//UpdatedStockFlow(flow)
1465 1466
 				UpdatedStockFlowOne(flow, warehouse.ID, patient_id, record_time, goods.GoodId)