Browse Source

11月9日库存管理

XMLWAN 2 years ago
parent
commit
83352bacae

+ 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
 #dev/prod
5 5
 

+ 32 - 3
controllers/dialysis_record_api_controller.go View File

@@ -394,6 +394,8 @@ func (this *DialysisRecordAPIController) DialysisSchedule() {
394 394
 	systemDialysisPrescribe, _ := service.GetSystemDialysisPrescribeByModeId(adminInfo.CurrentOrgId, schedual.ModeId)
395 395
 
396 396
 	lastDryWeightDislysis, getDryErr := service.GetLastDryWeight(adminInfo.CurrentOrgId, patientID)
397
+
398
+	lastOrder, _ := service.GetLastDilysisOrder(adminInfo.CurrentOrgId, patientID, date.Unix())
397 399
 	if getDryErr != nil {
398 400
 		this.ErrorLog("获取最后一条干体重失败:%v", getDryErr)
399 401
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
@@ -447,6 +449,7 @@ func (this *DialysisRecordAPIController) DialysisSchedule() {
447 449
 			"lastAssessment":              lastAssessment,
448 450
 			"information":                 information,
449 451
 			"is_advice_open":              adviceConfig,
452
+			"lastOrder":                   lastOrder,
450 453
 		}
451 454
 		this.ServeSuccessJSON(returnData)
452 455
 
@@ -483,6 +486,7 @@ func (this *DialysisRecordAPIController) DialysisSchedule() {
483 486
 			"lastAssessment":              lastAssessment,
484 487
 			"information":                 information,
485 488
 			"is_advice_open":              adviceConfig,
489
+			"lastOrder":                   lastOrder,
486 490
 		}
487 491
 		this.ServeSuccessJSON(returnData)
488 492
 	}
@@ -782,6 +786,7 @@ func (this *DialysisRecordAPIController) StartDialysis() {
782 786
 	dialysis_irrigation := this.GetString("dialysis_irrigation")
783 787
 	blood_access_id, _ := this.GetInt64("blood_access_id")
784 788
 	bedID, _ := this.GetInt64("bed")
789
+	nuclein_date := this.GetString("nuclein_date")
785 790
 
786 791
 	if patientID <= 0 || len(recordDateStr) == 0 || nurseID <= 0 || bedID <= 0 {
787 792
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
@@ -868,6 +873,17 @@ func (this *DialysisRecordAPIController) StartDialysis() {
868 873
 	schedulestartTime := theStartTime.Unix()
869 874
 	scheduleendTime := theEndTime.Unix()
870 875
 
876
+	var theNucleinDate int64
877
+	timeLayoutOne := "2006-01-02"
878
+
879
+	if len(nuclein_date) > 0 {
880
+		theTime, err := time.ParseInLocation(timeLayoutOne+" 15:04:05", nuclein_date+" 00:00:00", loc)
881
+		if err != nil {
882
+			utils.ErrorLog(err.Error())
883
+		}
884
+		theNucleinDate = theTime.Unix()
885
+	}
886
+
871 887
 	//查询更改的机号,是否有人用了,如果只是排班了,但是没上机,直接替换,如果排班且上机了,就提示他无法上机
872 888
 
873 889
 	schedule, err := service.GetDayScheduleByBedid(adminUserInfo.CurrentOrgId, schedulestartTime, bedID, schedual_type)
@@ -984,6 +1000,7 @@ func (this *DialysisRecordAPIController) StartDialysis() {
984 1000
 		DialysisDialyszers:     dialysis_dialyszers,
985 1001
 		DialysisIrrigation:     dialysis_irrigation,
986 1002
 		BloodAccessId:          blood_access_id,
1003
+		NucleinDate:            theNucleinDate,
987 1004
 	}
988 1005
 
989 1006
 	createErr := service.MobileCreateDialysisOrder(adminUserInfo.CurrentOrgId, patientID, dialysisRecord)
@@ -1110,7 +1127,7 @@ func (this *DialysisRecordAPIController) StartDialysis() {
1110 1127
 			if adminUserInfo.CurrentOrgId == 9671 || adminUserInfo.CurrentOrgId == 9675 || adminUserInfo.CurrentOrgId == 10340 {
1111 1128
 
1112 1129
 				record.Temperature = 36.5
1113
-
1130
+				record.ArterialPressure = -100
1114 1131
 			}
1115 1132
 
1116 1133
 			err := service.CreateMonitor(&record)
@@ -1285,7 +1302,7 @@ func (this *DialysisRecordAPIController) FinishDialysis() {
1285 1302
 			//获取最后一条透析处方数据
1286 1303
 			prescription, _ := service.GetLastDialysisPrescriptionByPatientIdTwo(adminUserInfo.CurrentOrgId, patientID, recordDate.Unix())
1287 1304
 			evaluation, _ := service.MobileGetPredialysisEvaluationTwo(adminUserInfo.CurrentOrgId, patientID, recordDate.Unix())
1288
-			tempassessmentAfterDislysis.WeightAfter = evaluation.WeightBefore - prescription.TargetUltrafiltration
1305
+			tempassessmentAfterDislysis.WeightAfter = evaluation.WeightBefore - prescription.TargetUltrafiltration/1000
1289 1306
 		}
1290 1307
 		if adminUserInfo.CurrentOrgId == 10101 {
1291 1308
 			tempassessmentAfterDislysis.ActualUltrafiltration = endmonitorRecords.UltrafiltrationVolume / 1000
@@ -1507,6 +1524,7 @@ func (this *DialysisRecordAPIController) ModifyStartDialysis() {
1507 1524
 	dialysis_dialyszers := this.GetString("dialysis_dialyszers")
1508 1525
 	dialysis_irrigation := this.GetString("dialysis_irrigation")
1509 1526
 	blood_access_id, _ := this.GetInt64("blood_access_id")
1527
+	nuclein_date := this.GetString("nuclein_date")
1510 1528
 	if record_id == 0 {
1511 1529
 		this.ErrorLog("id:%v", record_id)
1512 1530
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
@@ -1577,6 +1595,16 @@ func (this *DialysisRecordAPIController) ModifyStartDialysis() {
1577 1595
 	schedulestartTime := theStartTime.Unix()
1578 1596
 	scheduleendTime := theEndTime.Unix()
1579 1597
 
1598
+	var theNucleinDate int64
1599
+	timeLayoutOne := "2006-01-02"
1600
+
1601
+	if len(nuclein_date) > 0 {
1602
+		theTime, err := time.ParseInLocation(timeLayoutOne+" 15:04:05", nuclein_date+" 00:00:00", loc)
1603
+		if err != nil {
1604
+			utils.ErrorLog(err.Error())
1605
+		}
1606
+		theNucleinDate = theTime.Unix()
1607
+	}
1580 1608
 	//查询更改的机号,是否有人用了,如果只是排班了,但是没上机,直接替换,如果排班且上机了,就提示他无法上机
1581 1609
 
1582 1610
 	schedule, err := service.GetDayScheduleByBedid(adminUserInfo.CurrentOrgId, schedulestartTime, bedID, schedual_type)
@@ -1638,7 +1666,7 @@ func (this *DialysisRecordAPIController) ModifyStartDialysis() {
1638 1666
 		}
1639 1667
 
1640 1668
 	}
1641
-	fmt.Println("quality_nurse", quality_nurse)
1669
+	fmt.Println("theNucleinDate", theNucleinDate)
1642 1670
 	dialysisRecord := &models.DialysisOrder{
1643 1671
 		ID:                     record_id,
1644 1672
 		UserOrgId:              adminUserInfo.CurrentOrgId,
@@ -1659,6 +1687,7 @@ func (this *DialysisRecordAPIController) ModifyStartDialysis() {
1659 1687
 		DialysisDialyszers:     dialysis_dialyszers,
1660 1688
 		DialysisIrrigation:     dialysis_irrigation,
1661 1689
 		BloodAccessId:          blood_access_id,
1690
+		NucleinDate:            theNucleinDate,
1662 1691
 	}
1663 1692
 
1664 1693
 	updateErr := service.ModifyStartDialysisOrder(dialysisRecord)

+ 27 - 5
controllers/mobile_api_controllers/dialysis_api_controller.go View File

@@ -1796,7 +1796,7 @@ func (c *DialysisAPIController) Finish() {
1796 1796
 		//获取最后一条透析处方数据
1797 1797
 		prescription, _ := service.GetLastDialysisPrescriptionByPatientIdTwo(adminUserInfo.Org.Id, id, recordDate.Unix())
1798 1798
 		evaluation, _ := service.MobileGetPredialysisEvaluationTwo(adminUserInfo.Org.Id, id, recordDate.Unix())
1799
-		tempassessmentAfterDislysis.WeightAfter = evaluation.WeightBefore - prescription.TargetUltrafiltration
1799
+		tempassessmentAfterDislysis.WeightAfter = evaluation.WeightBefore - prescription.TargetUltrafiltration/1000
1800 1800
 	}
1801 1801
 
1802 1802
 	if dialysisOrder.Stage == 1 {
@@ -2113,6 +2113,8 @@ func (this *DialysisAPIController) StartDialysis() {
2113 2113
 	blood_access_id, _ := this.GetInt64("blood_access_id")
2114 2114
 	zone_id, _ := this.GetInt64("zone_id")
2115 2115
 	elecsign := this.GetString("url")
2116
+	nuclein_date_str := this.GetString("nuclein_date_str")
2117
+
2116 2118
 	if patientID <= 0 || len(recordDateStr) == 0 || nurseID <= 0 || bedID <= 0 {
2117 2119
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
2118 2120
 		return
@@ -2186,6 +2188,16 @@ func (this *DialysisAPIController) StartDialysis() {
2186 2188
 	schedulestartTime := theStartTime.Unix()
2187 2189
 	scheduleendTime := theEndTime.Unix()
2188 2190
 
2191
+	var theNucleinDate int64
2192
+	timeLayoutOne := "2006-01-02"
2193
+	if len(nuclein_date_str) > 0 {
2194
+		theTime, err := time.ParseInLocation(timeLayoutOne+" 15:04:05", nuclein_date_str+" 00:00:00", loc)
2195
+		if err != nil {
2196
+			utils.ErrorLog(err.Error())
2197
+		}
2198
+		theNucleinDate = theTime.Unix()
2199
+	}
2200
+	fmt.Println("wo2o3o23o2o2323oo232o3swo", theNucleinDate)
2189 2201
 	template, _ := service.GetOrgInfoTemplate(adminUserInfo.Org.Id)
2190 2202
 
2191 2203
 	//查询更改的机号,是否有人用了,如果只是排班了,但是没上机,直接替换,如果排班且上机了,就提示他无法上机
@@ -2302,6 +2314,7 @@ func (this *DialysisAPIController) StartDialysis() {
2302 2314
 		DialysisDialyszers:     dialysis_dialyszers,
2303 2315
 		BloodAccessId:          blood_access_id,
2304 2316
 		Url:                    elecsign,
2317
+		NucleinDate:            theNucleinDate,
2305 2318
 	}
2306 2319
 	//查询该床位是否有人用了
2307 2320
 	_, errorscode := service.GetDialysisOrderByBedId(adminUserInfo.Org.Id, schedulestartTime, bedID, schedual_type)
@@ -2422,10 +2435,7 @@ func (this *DialysisAPIController) StartDialysis() {
2422 2435
 	if newdialysisRecord.ID > 0 {
2423 2436
 		if adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 9675 {
2424 2437
 			record.Temperature = 36.5
2425
-			//var pressure string
2426
-			//pressure = "-"
2427
-			//floatPressure, _ := strconv.ParseFloat(pressure, 64)
2428
-			//record.ArterialPressure = floatPressure
2438
+			record.ArterialPressure = -100
2429 2439
 		}
2430 2440
 		err := service.CreateMonitor(&record)
2431 2441
 		key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":monitor_records"
@@ -3093,6 +3103,7 @@ func (this *DialysisAPIController) ModifyStartDialysisOrder() {
3093 3103
 	dialysis_dialyszers := this.GetString("dialysis_dialyszers")
3094 3104
 	dialysis_irrigation := this.GetString("dialysis_irrigation")
3095 3105
 	blood_access_id, _ := this.GetInt64("blood_access_id")
3106
+	nuclein_date_str := this.GetString("nuclein_date_str")
3096 3107
 	if record_id == 0 {
3097 3108
 		this.ErrorLog("id:%v", record_id)
3098 3109
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
@@ -3163,6 +3174,16 @@ func (this *DialysisAPIController) ModifyStartDialysisOrder() {
3163 3174
 	schedulestartTime := theStartTime.Unix()
3164 3175
 	scheduleendTime := theEndTime.Unix()
3165 3176
 
3177
+	var theNucleinDate int64
3178
+	timeLayoutOne := "2006-01-02"
3179
+	if len(nuclein_date_str) > 0 {
3180
+		theTime, err := time.ParseInLocation(timeLayoutOne+" 15:04:05", nuclein_date_str+" 00:00:00", loc)
3181
+		if err != nil {
3182
+			utils.ErrorLog(err.Error())
3183
+		}
3184
+		theNucleinDate = theTime.Unix()
3185
+	}
3186
+
3166 3187
 	//查询更改的机号,是否有人用了,如果只是排班了,但是没上机,直接替换,如果排班且上机了,就提示他无法上机
3167 3188
 
3168 3189
 	schedule, err := service.GetDayScheduleByBedid(adminUserInfo.Org.Id, schedulestartTime, bedID, schedual_type)
@@ -3244,6 +3265,7 @@ func (this *DialysisAPIController) ModifyStartDialysisOrder() {
3244 3265
 		DialysisDialyszers:     dialysis_dialyszers,
3245 3266
 		DialysisIrrigation:     dialysis_irrigation,
3246 3267
 		BloodAccessId:          blood_access_id,
3268
+		NucleinDate:            theNucleinDate,
3247 3269
 	}
3248 3270
 
3249 3271
 	updateErr := service.ModifyStartDialysisOrder(dialysisRecord)

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

@@ -1228,22 +1228,22 @@ func (c *PatientApiController) ExecDoctorAdvice() {
1228 1228
 						}
1229 1229
 					}
1230 1230
 
1231
-					if config.IsOpen == 1 && item.UserOrgId == 10318 {
1232
-
1233
-						service.HisDrugsDelivery(adminInfo.Org.Id, creater, &advice)
1234
-						//更新字典里面的库存
1235
-						stockInfo, _ := service.GetDrugAllStockInfo(storeHouseConfig.DrugStorehouseOut, item.UserOrgId, item.DrugId)
1236
-						var sum_count int64
1237
-						for _, its := range stockInfo {
1238
-							if its.MaxUnit == medical.MaxUnit {
1239
-								its.StockMaxNumber = its.StockMaxNumber * medical.MinNumber
1240
-							}
1241
-							sum_count += its.StockMaxNumber + its.StockMinNumber
1242
-						}
1243
-						service.UpdateBaseDrugSumTwo(item.DrugId, sum_count, item.UserOrgId)
1244
-						//剩余库存
1245
-						service.UpdateDrugStockCount(item.DrugId, item.UserOrgId, storeHouseConfig.DrugStorehouseOut, sum_count)
1246
-					}
1231
+					//if config.IsOpen == 1 && item.UserOrgId == 10028 {
1232
+					//
1233
+					//	service.HisDrugsDelivery(adminInfo.Org.Id, creater, &advice)
1234
+					//	//更新字典里面的库存
1235
+					//	stockInfo, _ := service.GetDrugAllStockInfo(storeHouseConfig.DrugStorehouseOut, item.UserOrgId, item.DrugId)
1236
+					//	var sum_count int64
1237
+					//	for _, its := range stockInfo {
1238
+					//		if its.MaxUnit == medical.MaxUnit {
1239
+					//			its.StockMaxNumber = its.StockMaxNumber * medical.MinNumber
1240
+					//		}
1241
+					//		sum_count += its.StockMaxNumber + its.StockMinNumber
1242
+					//	}
1243
+					//	service.UpdateBaseDrugSumTwo(item.DrugId, sum_count, item.UserOrgId)
1244
+					//	//剩余库存
1245
+					//	service.UpdateDrugStockCount(item.DrugId, item.UserOrgId, storeHouseConfig.DrugStorehouseOut, sum_count)
1246
+					//}
1247 1247
 
1248 1248
 				}
1249 1249
 			}

+ 8 - 0
controllers/stock_in_api_controller.go View File

@@ -1199,6 +1199,8 @@ func (c *StockManagerApiController) CreateWarehouseOut() {
1199 1199
 
1200 1200
 				stock_count := items["stock_count"].(string)
1201 1201
 
1202
+				register_number := items["register_number"].(string)
1203
+
1202 1204
 				timeLayout := "2006-01-02"
1203 1205
 				loc, _ := time.LoadLocation("Local")
1204 1206
 				var expiryDate int64
@@ -1250,6 +1252,7 @@ func (c *StockManagerApiController) CreateWarehouseOut() {
1250 1252
 					BuyPrice:                buy_price,
1251 1253
 					StockCount:              stock_count,
1252 1254
 					IsCheck:                 2,
1255
+					RegisterNumber:          register_number,
1253 1256
 				}
1254 1257
 				warehousingOutInfo = append(warehousingOutInfo, warehouseOutInfo)
1255 1258
 
@@ -1297,6 +1300,7 @@ func (c *StockManagerApiController) CreateWarehouseOut() {
1297 1300
 			StockCount:              it.StockCount,
1298 1301
 			Count:                   it.Count,
1299 1302
 			IsCheck:                 2,
1303
+			RegisterNumber:          it.RegisterNumber,
1300 1304
 		}
1301 1305
 		if it.ID == 0 {
1302 1306
 			service.AddSigleWarehouseOutInfo(warehouseOutInfo)
@@ -1613,6 +1617,8 @@ func (c *StockManagerApiController) EditWarehouseOut() {
1613 1617
 
1614 1618
 				stock_count := items["stock_count"].(string)
1615 1619
 
1620
+				register_number := items["register_number"].(string)
1621
+
1616 1622
 				var productDate int64
1617 1623
 				if len(product_date) > 0 {
1618 1624
 					theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", product_date+" 00:00:00", loc)
@@ -1650,6 +1656,7 @@ func (c *StockManagerApiController) EditWarehouseOut() {
1650 1656
 						StorehouseId:            storehouse_id,
1651 1657
 						AdminUserId:             admin_user_id,
1652 1658
 						StockCount:              stock_count,
1659
+						RegisterNumber:          register_number,
1653 1660
 					}
1654 1661
 					warehousingOutInfo = append(warehousingOutInfo, warehouseOutInfo)
1655 1662
 
@@ -1696,6 +1703,7 @@ func (c *StockManagerApiController) EditWarehouseOut() {
1696 1703
 						StorehouseId:            storehouse_id,
1697 1704
 						AdminUserId:             admin_user_id,
1698 1705
 						StockCount:              stock_count,
1706
+						RegisterNumber:          register_number,
1699 1707
 					}
1700 1708
 					upDateWarehouseOutInfos = append(upDateWarehouseOutInfos, warehouseOutInfo)
1701 1709
 				}

+ 1 - 0
models/dialysis.go View File

@@ -843,6 +843,7 @@ type DialysisOrder struct {
843 843
 	DialysisIrrigation         string        `gorm:"column:dialysis_irrigation" json:"dialysis_irrigation" form:"dialysis_irrigation"`
844 844
 	BloodAccessId              int64         `gorm:"column:blood_access_id" json:"blood_access_id" form:"blood_access_id"`
845 845
 	Mission                    string        `gorm:"column:mission" json:"mission" form:"mission"`
846
+	NucleinDate                int64         `gorm:"column:nuclein_date" json:"nuclein_date" form:"nuclein_date"`
846 847
 }
847 848
 
848 849
 func (DialysisOrder) TableName() string {

+ 3 - 0
models/patient_models.go View File

@@ -23,6 +23,7 @@ type MSchedualPatientList struct {
23 23
 	IdCardNo           string `gorm:"column:id_card_no" json:"id_card_no" form:"id_card_no"`
24 24
 	UserSysBeforeCount int64  `gorm:"column:user_sys_before_count" json:"user_sys_before_count" form:"user_sys_before_count"`
25 25
 	TrobleShoot        int64  `gorm:"column:troble_shoot" json:"troble_shoot" form:"troble_shoot"`
26
+	SchRemark          string `gorm:"column:sch_remark" json:"sch_remark" form:"sch_remark"`
26 27
 }
27 28
 
28 29
 func (MSchedualPatientList) TableName() string {
@@ -43,6 +44,8 @@ type MDialysisOrderForList struct {
43 44
 	DeviceNumber  *MDeviceNumberForList `gorm:"ForeignKey:BedID" json:"device_number"`
44 45
 	Creator       int64                 `gorm:"column:creator" json:"creator"`
45 46
 	WashpipeNurse int64                 `gorm:"column:washpipe_nurse" json:"washpipe_nurse" form:"washpipe_nurse"`
47
+	NucleinDate   int64                 `gorm:"column:nuclein_date" json:"nuclein_date" form:"nuclein_date"`
48
+	EndTime       int64                 `gorm:"column:end_time" json:"end_time" form:"end_time"`
46 49
 }
47 50
 
48 51
 func (MDialysisOrderForList) TableName() string {

+ 3 - 1
service/mobile_dialysis_service.go View File

@@ -165,6 +165,7 @@ type MSchedualPatientVMList struct {
165 165
 	IdCardNo           string `gorm:"column:id_card_no" json:"id_card_no" form:"id_card_no"`
166 166
 	UserSysBeforeCount int64  `gorm:"column:user_sys_before_count" json:"user_sys_before_count" form:"user_sys_before_count"`
167 167
 	TrobleShoot        int64  `gorm:"column:troble_shoot" json:"troble_shoot" form:"troble_shoot"`
168
+	SchRemark          string `gorm:"column:sch_remark" json:"sch_remark" form:"sch_remark"`
168 169
 }
169 170
 
170 171
 func (MSchedualPatientVMList) TableName() string {
@@ -289,6 +290,7 @@ type MDialysisOrderVMList struct {
289 290
 	DeviceNumber  *MDeviceNumberVM `gorm:"ForeignKey:BedID" json:"device_number"`
290 291
 	Creator       int64            `gorm:"column:creator" json:"creator"`
291 292
 	WashpipeNurse int64            `gorm:"column:washpipe_nurse" json:"washpipe_nurse" form:"washpipe_nurse"`
293
+	NucleinDate   int64            `gorm:"column:nuclein_date" json:"nuclein_date" form:"nuclein_date"`
292 294
 }
293 295
 
294 296
 func (MDialysisOrderVMList) TableName() string {
@@ -2021,7 +2023,7 @@ func BatchUpdateMonitors(monitors []*models.MonitoringRecord) error {
2021 2023
 func ModifyStartDialysisOrder(order *models.DialysisOrder) error {
2022 2024
 	tx := writeDb.Begin()
2023 2025
 	updateTime := time.Now().Unix()
2024
-	err := tx.Model(&models.DialysisOrder{}).Where("user_org_id = ? AND id = ? AND status = 1 ", order.UserOrgId, order.ID).Updates(map[string]interface{}{"start_nurse": order.StartNurse, "updated_time": updateTime, "bed_id": order.BedID, "puncture_nurse": order.PunctureNurse, "start_time": order.StartTime, "modifier": order.Modifier, "schedual_type": order.SchedualType, "washpipe_nurse": order.WashpipeNurse, "change_nurse": order.ChangeNurse, "difficult_puncture_nurse": order.DifficultPunctureNurse, "new_fistula_nurse": order.NewFistulaNurse, "quality_nurse_id": order.QualityNurseId, "puncture_needle": order.PunctureNeedle, "puncture_way": order.PunctureWay, "dialysis_dialyszers": order.DialysisDialyszers, "dialysis_irrigation": order.DialysisIrrigation, "blood_access_id": order.BloodAccessId}).Error
2026
+	err := tx.Model(&models.DialysisOrder{}).Where("user_org_id = ? AND id = ? AND status = 1 ", order.UserOrgId, order.ID).Updates(map[string]interface{}{"start_nurse": order.StartNurse, "updated_time": updateTime, "bed_id": order.BedID, "puncture_nurse": order.PunctureNurse, "start_time": order.StartTime, "modifier": order.Modifier, "schedual_type": order.SchedualType, "washpipe_nurse": order.WashpipeNurse, "change_nurse": order.ChangeNurse, "difficult_puncture_nurse": order.DifficultPunctureNurse, "new_fistula_nurse": order.NewFistulaNurse, "quality_nurse_id": order.QualityNurseId, "puncture_needle": order.PunctureNeedle, "puncture_way": order.PunctureWay, "dialysis_dialyszers": order.DialysisDialyszers, "dialysis_irrigation": order.DialysisIrrigation, "blood_access_id": order.BloodAccessId, "nuclein_date": order.NucleinDate}).Error
2025 2027
 	if err != nil {
2026 2028
 		tx.Rollback()
2027 2029
 		return err

+ 2 - 2
service/stock_service.go View File

@@ -4237,7 +4237,7 @@ func GetOrderDetialByOrderIdOne(id []string, orgid int64) (out []*models.Warehou
4237 4237
 		db = db.Where("x.org_id = ?", orgid)
4238 4238
 	}
4239 4239
 
4240
-	err = db.Select("x.id,x.warehouse_out_id,x.good_id,sum(x.count) as count,x.price,x.total_price,x.product_date,x.expiry_date,x.ctime,x.org_id,x.warehouse_out_order_number,x.type,x.dealer,x.manufacturer,t.social_security_directory_code,x.is_sys,x.sys_record_time,n.number,x.remark,x.license_number,x.storehouse_id,x.admin_user_id,x.buy_price,x.stock_count,x.warehouse_info_id,t.good_name,t.good_type_id,t.specification_name,t.min_number,t.packing_unit,t.min_unit,t.packing_price").Joins("left join xt_warehouse_info as n on n.id=x.warehouse_info_id").Joins("left join xt_good_information as t on t.id=x.good_id").Group("x.warehouse_out_id,x.good_id").Order("x.ctime desc").Scan(&out).Error
4240
+	err = db.Select("x.id,x.warehouse_out_id,x.good_id,sum(x.count) as count,x.price,x.total_price,x.product_date,x.expiry_date,x.ctime,x.org_id,x.warehouse_out_order_number,x.type,x.dealer,x.manufacturer,t.social_security_directory_code,x.is_sys,x.sys_record_time,n.number,x.remark,x.license_number,x.storehouse_id,x.admin_user_id,x.buy_price,x.stock_count,x.warehouse_info_id,t.good_name,t.good_type_id,t.specification_name,t.min_number,t.packing_unit,t.min_unit,t.packing_price,x.register_number").Joins("left join xt_warehouse_info as n on n.id=x.warehouse_info_id").Joins("left join xt_good_information as t on t.id=x.good_id").Group("x.warehouse_out_id,x.good_id").Order("x.ctime desc").Scan(&out).Error
4241 4241
 
4242 4242
 	return out, err
4243 4243
 }
@@ -7168,7 +7168,7 @@ func GetLastGoodWarehouseOutInfoById(orgid int64) (models.WarehouseOutInfo, erro
7168 7168
 
7169 7169
 func ModifyWarehouseOutInfo(id int64, info *models.WarehouseOutInfo) error {
7170 7170
 
7171
-	err := XTWriteDB().Model(&models.WarehouseOutInfo{}).Where("id = ? and status = 1", id).Update(map[string]interface{}{"good_id": info.GoodId, "good_type_id": info.GoodTypeId, "count": info.Count, "price": info.Price, "total_price": info.TotalPrice, "product_date": info.ProductDate, "expiry_date": info.ExpiryDate, "remark": info.Remark, "dealer": info.Dealer, "manufacturer": info.Manufacturer, "number": info.Number, "license_number": info.LicenseNumber, "storehouse_id": info.StorehouseId, "admin_user_id": info.AdminUserId, "buy_price": info.BuyPrice, "stock_count": info.StockCount}).Error
7171
+	err := XTWriteDB().Model(&models.WarehouseOutInfo{}).Where("id = ? and status = 1", id).Update(map[string]interface{}{"good_id": info.GoodId, "good_type_id": info.GoodTypeId, "count": info.Count, "price": info.Price, "total_price": info.TotalPrice, "product_date": info.ProductDate, "expiry_date": info.ExpiryDate, "remark": info.Remark, "dealer": info.Dealer, "manufacturer": info.Manufacturer, "number": info.Number, "license_number": info.LicenseNumber, "storehouse_id": info.StorehouseId, "admin_user_id": info.AdminUserId, "buy_price": info.BuyPrice, "stock_count": info.StockCount, "register_number": info.RegisterNumber}).Error
7172 7172
 	return err
7173 7173
 }
7174 7174
 

+ 2 - 0
service/warhouse_service.go View File

@@ -5291,6 +5291,7 @@ func ConsumablesDeliveryThirty(orgID int64, record_time int64, goods *models.War
5291 5291
 			BatchNumberCount:        warehouse.StockCount - goods.Count,
5292 5292
 			IsCheck:                 1,
5293 5293
 			OverCount:               sum_count,
5294
+			RegisterNumber:          goods.RegisterNumber,
5294 5295
 		}
5295 5296
 		//创建出库流水
5296 5297
 		errflow := CreateStockFlowOne(stockFlow)
@@ -5438,6 +5439,7 @@ func ConsumablesDeliveryThirty(orgID int64, record_time int64, goods *models.War
5438 5439
 			BatchNumberCount:        0,
5439 5440
 			IsCheck:                 1,
5440 5441
 			OverCount:               sum_count,
5442
+			RegisterNumber:          goods.RegisterNumber,
5441 5443
 		}
5442 5444
 		//创建出库流水
5443 5445
 		errflow := CreateStockFlowOne(stockFlow)