Parcourir la source

11月9日库存管理

XMLWAN il y a 2 ans
Parent
révision
83352bacae

+ 1 - 1
conf/app.conf Voir le fichier

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

+ 32 - 3
controllers/dialysis_record_api_controller.go Voir le fichier

394
 	systemDialysisPrescribe, _ := service.GetSystemDialysisPrescribeByModeId(adminInfo.CurrentOrgId, schedual.ModeId)
394
 	systemDialysisPrescribe, _ := service.GetSystemDialysisPrescribeByModeId(adminInfo.CurrentOrgId, schedual.ModeId)
395
 
395
 
396
 	lastDryWeightDislysis, getDryErr := service.GetLastDryWeight(adminInfo.CurrentOrgId, patientID)
396
 	lastDryWeightDislysis, getDryErr := service.GetLastDryWeight(adminInfo.CurrentOrgId, patientID)
397
+
398
+	lastOrder, _ := service.GetLastDilysisOrder(adminInfo.CurrentOrgId, patientID, date.Unix())
397
 	if getDryErr != nil {
399
 	if getDryErr != nil {
398
 		this.ErrorLog("获取最后一条干体重失败:%v", getDryErr)
400
 		this.ErrorLog("获取最后一条干体重失败:%v", getDryErr)
399
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
401
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
447
 			"lastAssessment":              lastAssessment,
449
 			"lastAssessment":              lastAssessment,
448
 			"information":                 information,
450
 			"information":                 information,
449
 			"is_advice_open":              adviceConfig,
451
 			"is_advice_open":              adviceConfig,
452
+			"lastOrder":                   lastOrder,
450
 		}
453
 		}
451
 		this.ServeSuccessJSON(returnData)
454
 		this.ServeSuccessJSON(returnData)
452
 
455
 
483
 			"lastAssessment":              lastAssessment,
486
 			"lastAssessment":              lastAssessment,
484
 			"information":                 information,
487
 			"information":                 information,
485
 			"is_advice_open":              adviceConfig,
488
 			"is_advice_open":              adviceConfig,
489
+			"lastOrder":                   lastOrder,
486
 		}
490
 		}
487
 		this.ServeSuccessJSON(returnData)
491
 		this.ServeSuccessJSON(returnData)
488
 	}
492
 	}
782
 	dialysis_irrigation := this.GetString("dialysis_irrigation")
786
 	dialysis_irrigation := this.GetString("dialysis_irrigation")
783
 	blood_access_id, _ := this.GetInt64("blood_access_id")
787
 	blood_access_id, _ := this.GetInt64("blood_access_id")
784
 	bedID, _ := this.GetInt64("bed")
788
 	bedID, _ := this.GetInt64("bed")
789
+	nuclein_date := this.GetString("nuclein_date")
785
 
790
 
786
 	if patientID <= 0 || len(recordDateStr) == 0 || nurseID <= 0 || bedID <= 0 {
791
 	if patientID <= 0 || len(recordDateStr) == 0 || nurseID <= 0 || bedID <= 0 {
787
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
792
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
868
 	schedulestartTime := theStartTime.Unix()
873
 	schedulestartTime := theStartTime.Unix()
869
 	scheduleendTime := theEndTime.Unix()
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
 	schedule, err := service.GetDayScheduleByBedid(adminUserInfo.CurrentOrgId, schedulestartTime, bedID, schedual_type)
889
 	schedule, err := service.GetDayScheduleByBedid(adminUserInfo.CurrentOrgId, schedulestartTime, bedID, schedual_type)
984
 		DialysisDialyszers:     dialysis_dialyszers,
1000
 		DialysisDialyszers:     dialysis_dialyszers,
985
 		DialysisIrrigation:     dialysis_irrigation,
1001
 		DialysisIrrigation:     dialysis_irrigation,
986
 		BloodAccessId:          blood_access_id,
1002
 		BloodAccessId:          blood_access_id,
1003
+		NucleinDate:            theNucleinDate,
987
 	}
1004
 	}
988
 
1005
 
989
 	createErr := service.MobileCreateDialysisOrder(adminUserInfo.CurrentOrgId, patientID, dialysisRecord)
1006
 	createErr := service.MobileCreateDialysisOrder(adminUserInfo.CurrentOrgId, patientID, dialysisRecord)
1110
 			if adminUserInfo.CurrentOrgId == 9671 || adminUserInfo.CurrentOrgId == 9675 || adminUserInfo.CurrentOrgId == 10340 {
1127
 			if adminUserInfo.CurrentOrgId == 9671 || adminUserInfo.CurrentOrgId == 9675 || adminUserInfo.CurrentOrgId == 10340 {
1111
 
1128
 
1112
 				record.Temperature = 36.5
1129
 				record.Temperature = 36.5
1113
-
1130
+				record.ArterialPressure = -100
1114
 			}
1131
 			}
1115
 
1132
 
1116
 			err := service.CreateMonitor(&record)
1133
 			err := service.CreateMonitor(&record)
1285
 			//获取最后一条透析处方数据
1302
 			//获取最后一条透析处方数据
1286
 			prescription, _ := service.GetLastDialysisPrescriptionByPatientIdTwo(adminUserInfo.CurrentOrgId, patientID, recordDate.Unix())
1303
 			prescription, _ := service.GetLastDialysisPrescriptionByPatientIdTwo(adminUserInfo.CurrentOrgId, patientID, recordDate.Unix())
1287
 			evaluation, _ := service.MobileGetPredialysisEvaluationTwo(adminUserInfo.CurrentOrgId, patientID, recordDate.Unix())
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
 		if adminUserInfo.CurrentOrgId == 10101 {
1307
 		if adminUserInfo.CurrentOrgId == 10101 {
1291
 			tempassessmentAfterDislysis.ActualUltrafiltration = endmonitorRecords.UltrafiltrationVolume / 1000
1308
 			tempassessmentAfterDislysis.ActualUltrafiltration = endmonitorRecords.UltrafiltrationVolume / 1000
1507
 	dialysis_dialyszers := this.GetString("dialysis_dialyszers")
1524
 	dialysis_dialyszers := this.GetString("dialysis_dialyszers")
1508
 	dialysis_irrigation := this.GetString("dialysis_irrigation")
1525
 	dialysis_irrigation := this.GetString("dialysis_irrigation")
1509
 	blood_access_id, _ := this.GetInt64("blood_access_id")
1526
 	blood_access_id, _ := this.GetInt64("blood_access_id")
1527
+	nuclein_date := this.GetString("nuclein_date")
1510
 	if record_id == 0 {
1528
 	if record_id == 0 {
1511
 		this.ErrorLog("id:%v", record_id)
1529
 		this.ErrorLog("id:%v", record_id)
1512
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
1530
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
1577
 	schedulestartTime := theStartTime.Unix()
1595
 	schedulestartTime := theStartTime.Unix()
1578
 	scheduleendTime := theEndTime.Unix()
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
 	schedule, err := service.GetDayScheduleByBedid(adminUserInfo.CurrentOrgId, schedulestartTime, bedID, schedual_type)
1610
 	schedule, err := service.GetDayScheduleByBedid(adminUserInfo.CurrentOrgId, schedulestartTime, bedID, schedual_type)
1638
 		}
1666
 		}
1639
 
1667
 
1640
 	}
1668
 	}
1641
-	fmt.Println("quality_nurse", quality_nurse)
1669
+	fmt.Println("theNucleinDate", theNucleinDate)
1642
 	dialysisRecord := &models.DialysisOrder{
1670
 	dialysisRecord := &models.DialysisOrder{
1643
 		ID:                     record_id,
1671
 		ID:                     record_id,
1644
 		UserOrgId:              adminUserInfo.CurrentOrgId,
1672
 		UserOrgId:              adminUserInfo.CurrentOrgId,
1659
 		DialysisDialyszers:     dialysis_dialyszers,
1687
 		DialysisDialyszers:     dialysis_dialyszers,
1660
 		DialysisIrrigation:     dialysis_irrigation,
1688
 		DialysisIrrigation:     dialysis_irrigation,
1661
 		BloodAccessId:          blood_access_id,
1689
 		BloodAccessId:          blood_access_id,
1690
+		NucleinDate:            theNucleinDate,
1662
 	}
1691
 	}
1663
 
1692
 
1664
 	updateErr := service.ModifyStartDialysisOrder(dialysisRecord)
1693
 	updateErr := service.ModifyStartDialysisOrder(dialysisRecord)

+ 27 - 5
controllers/mobile_api_controllers/dialysis_api_controller.go Voir le fichier

1796
 		//获取最后一条透析处方数据
1796
 		//获取最后一条透析处方数据
1797
 		prescription, _ := service.GetLastDialysisPrescriptionByPatientIdTwo(adminUserInfo.Org.Id, id, recordDate.Unix())
1797
 		prescription, _ := service.GetLastDialysisPrescriptionByPatientIdTwo(adminUserInfo.Org.Id, id, recordDate.Unix())
1798
 		evaluation, _ := service.MobileGetPredialysisEvaluationTwo(adminUserInfo.Org.Id, id, recordDate.Unix())
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
 	if dialysisOrder.Stage == 1 {
1802
 	if dialysisOrder.Stage == 1 {
2113
 	blood_access_id, _ := this.GetInt64("blood_access_id")
2113
 	blood_access_id, _ := this.GetInt64("blood_access_id")
2114
 	zone_id, _ := this.GetInt64("zone_id")
2114
 	zone_id, _ := this.GetInt64("zone_id")
2115
 	elecsign := this.GetString("url")
2115
 	elecsign := this.GetString("url")
2116
+	nuclein_date_str := this.GetString("nuclein_date_str")
2117
+
2116
 	if patientID <= 0 || len(recordDateStr) == 0 || nurseID <= 0 || bedID <= 0 {
2118
 	if patientID <= 0 || len(recordDateStr) == 0 || nurseID <= 0 || bedID <= 0 {
2117
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
2119
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
2118
 		return
2120
 		return
2186
 	schedulestartTime := theStartTime.Unix()
2188
 	schedulestartTime := theStartTime.Unix()
2187
 	scheduleendTime := theEndTime.Unix()
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
 	template, _ := service.GetOrgInfoTemplate(adminUserInfo.Org.Id)
2201
 	template, _ := service.GetOrgInfoTemplate(adminUserInfo.Org.Id)
2190
 
2202
 
2191
 	//查询更改的机号,是否有人用了,如果只是排班了,但是没上机,直接替换,如果排班且上机了,就提示他无法上机
2203
 	//查询更改的机号,是否有人用了,如果只是排班了,但是没上机,直接替换,如果排班且上机了,就提示他无法上机
2302
 		DialysisDialyszers:     dialysis_dialyszers,
2314
 		DialysisDialyszers:     dialysis_dialyszers,
2303
 		BloodAccessId:          blood_access_id,
2315
 		BloodAccessId:          blood_access_id,
2304
 		Url:                    elecsign,
2316
 		Url:                    elecsign,
2317
+		NucleinDate:            theNucleinDate,
2305
 	}
2318
 	}
2306
 	//查询该床位是否有人用了
2319
 	//查询该床位是否有人用了
2307
 	_, errorscode := service.GetDialysisOrderByBedId(adminUserInfo.Org.Id, schedulestartTime, bedID, schedual_type)
2320
 	_, errorscode := service.GetDialysisOrderByBedId(adminUserInfo.Org.Id, schedulestartTime, bedID, schedual_type)
2422
 	if newdialysisRecord.ID > 0 {
2435
 	if newdialysisRecord.ID > 0 {
2423
 		if adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 9675 {
2436
 		if adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 9675 {
2424
 			record.Temperature = 36.5
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
 		err := service.CreateMonitor(&record)
2440
 		err := service.CreateMonitor(&record)
2431
 		key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":monitor_records"
2441
 		key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":monitor_records"
3093
 	dialysis_dialyszers := this.GetString("dialysis_dialyszers")
3103
 	dialysis_dialyszers := this.GetString("dialysis_dialyszers")
3094
 	dialysis_irrigation := this.GetString("dialysis_irrigation")
3104
 	dialysis_irrigation := this.GetString("dialysis_irrigation")
3095
 	blood_access_id, _ := this.GetInt64("blood_access_id")
3105
 	blood_access_id, _ := this.GetInt64("blood_access_id")
3106
+	nuclein_date_str := this.GetString("nuclein_date_str")
3096
 	if record_id == 0 {
3107
 	if record_id == 0 {
3097
 		this.ErrorLog("id:%v", record_id)
3108
 		this.ErrorLog("id:%v", record_id)
3098
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
3109
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
3163
 	schedulestartTime := theStartTime.Unix()
3174
 	schedulestartTime := theStartTime.Unix()
3164
 	scheduleendTime := theEndTime.Unix()
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
 	schedule, err := service.GetDayScheduleByBedid(adminUserInfo.Org.Id, schedulestartTime, bedID, schedual_type)
3189
 	schedule, err := service.GetDayScheduleByBedid(adminUserInfo.Org.Id, schedulestartTime, bedID, schedual_type)
3244
 		DialysisDialyszers:     dialysis_dialyszers,
3265
 		DialysisDialyszers:     dialysis_dialyszers,
3245
 		DialysisIrrigation:     dialysis_irrigation,
3266
 		DialysisIrrigation:     dialysis_irrigation,
3246
 		BloodAccessId:          blood_access_id,
3267
 		BloodAccessId:          blood_access_id,
3268
+		NucleinDate:            theNucleinDate,
3247
 	}
3269
 	}
3248
 
3270
 
3249
 	updateErr := service.ModifyStartDialysisOrder(dialysisRecord)
3271
 	updateErr := service.ModifyStartDialysisOrder(dialysisRecord)

+ 16 - 16
controllers/mobile_api_controllers/patient_api_controller.go Voir le fichier

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 Voir le fichier

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

+ 1 - 0
models/dialysis.go Voir le fichier

843
 	DialysisIrrigation         string        `gorm:"column:dialysis_irrigation" json:"dialysis_irrigation" form:"dialysis_irrigation"`
843
 	DialysisIrrigation         string        `gorm:"column:dialysis_irrigation" json:"dialysis_irrigation" form:"dialysis_irrigation"`
844
 	BloodAccessId              int64         `gorm:"column:blood_access_id" json:"blood_access_id" form:"blood_access_id"`
844
 	BloodAccessId              int64         `gorm:"column:blood_access_id" json:"blood_access_id" form:"blood_access_id"`
845
 	Mission                    string        `gorm:"column:mission" json:"mission" form:"mission"`
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
 func (DialysisOrder) TableName() string {
849
 func (DialysisOrder) TableName() string {

+ 3 - 0
models/patient_models.go Voir le fichier

23
 	IdCardNo           string `gorm:"column:id_card_no" json:"id_card_no" form:"id_card_no"`
23
 	IdCardNo           string `gorm:"column:id_card_no" json:"id_card_no" form:"id_card_no"`
24
 	UserSysBeforeCount int64  `gorm:"column:user_sys_before_count" json:"user_sys_before_count" form:"user_sys_before_count"`
24
 	UserSysBeforeCount int64  `gorm:"column:user_sys_before_count" json:"user_sys_before_count" form:"user_sys_before_count"`
25
 	TrobleShoot        int64  `gorm:"column:troble_shoot" json:"troble_shoot" form:"troble_shoot"`
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
 func (MSchedualPatientList) TableName() string {
29
 func (MSchedualPatientList) TableName() string {
43
 	DeviceNumber  *MDeviceNumberForList `gorm:"ForeignKey:BedID" json:"device_number"`
44
 	DeviceNumber  *MDeviceNumberForList `gorm:"ForeignKey:BedID" json:"device_number"`
44
 	Creator       int64                 `gorm:"column:creator" json:"creator"`
45
 	Creator       int64                 `gorm:"column:creator" json:"creator"`
45
 	WashpipeNurse int64                 `gorm:"column:washpipe_nurse" json:"washpipe_nurse" form:"washpipe_nurse"`
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
 func (MDialysisOrderForList) TableName() string {
51
 func (MDialysisOrderForList) TableName() string {

+ 3 - 1
service/mobile_dialysis_service.go Voir le fichier

165
 	IdCardNo           string `gorm:"column:id_card_no" json:"id_card_no" form:"id_card_no"`
165
 	IdCardNo           string `gorm:"column:id_card_no" json:"id_card_no" form:"id_card_no"`
166
 	UserSysBeforeCount int64  `gorm:"column:user_sys_before_count" json:"user_sys_before_count" form:"user_sys_before_count"`
166
 	UserSysBeforeCount int64  `gorm:"column:user_sys_before_count" json:"user_sys_before_count" form:"user_sys_before_count"`
167
 	TrobleShoot        int64  `gorm:"column:troble_shoot" json:"troble_shoot" form:"troble_shoot"`
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
 func (MSchedualPatientVMList) TableName() string {
171
 func (MSchedualPatientVMList) TableName() string {
289
 	DeviceNumber  *MDeviceNumberVM `gorm:"ForeignKey:BedID" json:"device_number"`
290
 	DeviceNumber  *MDeviceNumberVM `gorm:"ForeignKey:BedID" json:"device_number"`
290
 	Creator       int64            `gorm:"column:creator" json:"creator"`
291
 	Creator       int64            `gorm:"column:creator" json:"creator"`
291
 	WashpipeNurse int64            `gorm:"column:washpipe_nurse" json:"washpipe_nurse" form:"washpipe_nurse"`
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
 func (MDialysisOrderVMList) TableName() string {
296
 func (MDialysisOrderVMList) TableName() string {
2021
 func ModifyStartDialysisOrder(order *models.DialysisOrder) error {
2023
 func ModifyStartDialysisOrder(order *models.DialysisOrder) error {
2022
 	tx := writeDb.Begin()
2024
 	tx := writeDb.Begin()
2023
 	updateTime := time.Now().Unix()
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
 	if err != nil {
2027
 	if err != nil {
2026
 		tx.Rollback()
2028
 		tx.Rollback()
2027
 		return err
2029
 		return err

+ 2 - 2
service/stock_service.go Voir le fichier

4237
 		db = db.Where("x.org_id = ?", orgid)
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
 	return out, err
4242
 	return out, err
4243
 }
4243
 }
7168
 
7168
 
7169
 func ModifyWarehouseOutInfo(id int64, info *models.WarehouseOutInfo) error {
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
 	return err
7172
 	return err
7173
 }
7173
 }
7174
 
7174
 

+ 2 - 0
service/warhouse_service.go Voir le fichier

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