Sfoglia il codice sorgente

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

陈少旭 9 mesi fa
parent
commit
f0923feb52

+ 6 - 6
controllers/base_api_controller.go Vedi File

@@ -83,7 +83,7 @@ func (this *BaseAuthAPIController) Prepare() {
83 83
 		userAdmin.ModifyTime = 1530786071
84 84
 		var subscibe models.ServeSubscibe
85 85
 		subscibe.ID = 11
86
-		subscibe.OrgId = 10666 //机构id
86
+		subscibe.OrgId = 10489 //机构id
87 87
 		subscibe.PeriodStart = 1547447814
88 88
 		subscibe.PeriodEnd = 1550039814
89 89
 		subscibe.State = 1
@@ -93,8 +93,8 @@ func (this *BaseAuthAPIController) Prepare() {
93 93
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
94 94
 		subscibes[4] = &subscibe
95 95
 		var adminUserInfo service.AdminUserInfo
96
-		adminUserInfo.CurrentOrgId = 10666 //机构id小英9675或4
97
-		adminUserInfo.CurrentAppId = 17997 //4
96
+		adminUserInfo.CurrentOrgId = 10489 //机构id小英9675或4
97
+		adminUserInfo.CurrentAppId = 14655 //4
98 98
 		adminUserInfo.AdminUser = &userAdmin
99 99
 		adminUserInfo.Subscibes = subscibes
100 100
 		this.SetSession("admin_user_info", &adminUserInfo)
@@ -329,7 +329,7 @@ func (this *BaseServeAPIController) Prepare() {
329 329
 		userAdmin.ModifyTime = 1530786071
330 330
 		var subscibe models.ServeSubscibe
331 331
 		subscibe.ID = 11
332
-		subscibe.OrgId = 10666 //机构id小英9675或4
332
+		subscibe.OrgId = 10489 //机构id小英9675或4
333 333
 		subscibe.PeriodStart = 1538035409
334 334
 		subscibe.PeriodEnd = 1569571409
335 335
 		subscibe.State = 1
@@ -339,8 +339,8 @@ func (this *BaseServeAPIController) Prepare() {
339 339
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
340 340
 		subscibes[4] = &subscibe
341 341
 		var adminUserInfo service.AdminUserInfo
342
-		adminUserInfo.CurrentOrgId = 10666 //机构id小英9675或4
343
-		adminUserInfo.CurrentAppId = 17997 //4
342
+		adminUserInfo.CurrentOrgId = 10489 //机构id小英9675或4
343
+		adminUserInfo.CurrentAppId = 14655 //4
344 344
 		adminUserInfo.AdminUser = &userAdmin
345 345
 		adminUserInfo.Subscibes = subscibes
346 346
 		this.SetSession("admin_user_info", &adminUserInfo)

+ 12 - 0
controllers/dialysis_api_controller.go Vedi File

@@ -4417,6 +4417,7 @@ func (c *DialysisApiController) GetDialysisOrder() {
4417 4417
 
4418 4418
 	DoctorAdvice, _ := service.FindDoctorAdviceOrderById(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
4419 4419
 	doctorAdevieInfo, err := service.FindDoctorAdviceByInfo(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
4420
+
4420 4421
 	//获取上次的透后体重
4421 4422
 	//	assessmentAfterDislysis, _ := service.MobileGetLastTimeAssessmentAfterDislysis(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
4422 4423
 	assessmentAfterDislysis, _ := service.MobileGetLast(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
@@ -5387,6 +5388,12 @@ func (this *DialysisApiController) GetTodayMonitor() {
5387 5388
 				record.UltrafiltrationRate = ultrafiltration_rate
5388 5389
 			}
5389 5390
 
5391
+			if adminInfo.CurrentOrgId == 10694 || adminInfo.CurrentOrgId == 10697 {
5392
+
5393
+				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration / float64(totalMin) * 60 * 1000)
5394
+				ultrafiltration_rate = ultrafiltration_rate / 1000
5395
+			}
5396
+
5390 5397
 		}
5391 5398
 	}
5392 5399
 	// record.UltrafiltrationRate = ultrafiltration_rate
@@ -5423,6 +5430,11 @@ func (this *DialysisApiController) GetTodayMonitor() {
5423 5430
 		record.DisplacementQuantity = record.DisplacementQuantity + record.DisplacementQuantity
5424 5431
 	}
5425 5432
 
5433
+	if adminInfo.CurrentOrgId == 10697 || adminInfo.CurrentOrgId == 10694 {
5434
+		ultrafiltration_volume := math.Floor(float64(record.OperateTime+3600-fristrecord.OperateTime) / 3600 * ultrafiltration_rate * 1000)
5435
+		record.UltrafiltrationVolume = ultrafiltration_volume / 1000
5436
+	}
5437
+
5426 5438
 	this.ServeSuccessJSON(map[string]interface{}{
5427 5439
 		"monitor": record,
5428 5440
 	})

+ 6 - 0
controllers/dialysis_record_api_controller.go Vedi File

@@ -1290,6 +1290,12 @@ func (this *DialysisRecordAPIController) StartDialysis() {
1290 1290
 					}
1291 1291
 				}
1292 1292
 
1293
+				if adminUserInfo.CurrentOrgId == 10694 || adminUserInfo.CurrentOrgId == 10697 {
1294
+
1295
+					ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration / float64(totalMin) * 60 * 1000)
1296
+					ultrafiltration_rate = ultrafiltration_rate / 1000
1297
+				}
1298
+
1293 1299
 			}
1294 1300
 		}
1295 1301
 		record := models.MonitoringRecord{

+ 7 - 7
controllers/his_api_controller.go Vedi File

@@ -2993,7 +2993,7 @@ func (c *HisApiController) CreateHisPrescription() {
2993 2993
 
2994 2994
 											}
2995 2995
 
2996
-											service.DeleteAutoWarehouse(patient_id, recordDateTime)
2996
+											//service.DeleteAutoWarehouse(patient_id, recordDateTime)
2997 2997
 
2998 2998
 										}
2999 2999
 
@@ -3046,7 +3046,7 @@ func (c *HisApiController) CreateHisPrescription() {
3046 3046
 													service.UpdateGoodInfoReduceSumCount(item.GoodId, total_count, item.OrgId)
3047 3047
 												}
3048 3048
 
3049
-												service.DeleteAutoWarehouse(patient_id, recordDateTime)
3049
+												//service.DeleteAutoWarehouse(patient_id, recordDateTime)
3050 3050
 
3051 3051
 											}
3052 3052
 
@@ -3176,7 +3176,7 @@ func (c *HisApiController) CreateHisPrescription() {
3176 3176
 	var adviceList []models.HisDoctorAdviceInfo
3177 3177
 	var projectList []models.HisPrescriptionProject
3178 3178
 
3179
-	if adminInfo.CurrentOrgId == 10489 || adminInfo.CurrentOrgId == 10510 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 10478 || adminInfo.CurrentOrgId == 10318 || adminInfo.CurrentOrgId == 10480 || adminInfo.CurrentOrgId == 10633 || adminInfo.CurrentOrgId == 10610 || adminInfo.CurrentOrgId == 10402 || adminInfo.CurrentOrgId == 10138 || adminInfo.CurrentOrgId == 10278 {
3179
+	if adminInfo.CurrentOrgId == 10489 || adminInfo.CurrentOrgId == 10510 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 10478 || adminInfo.CurrentOrgId == 10318 || adminInfo.CurrentOrgId == 10480 || adminInfo.CurrentOrgId == 10633 || adminInfo.CurrentOrgId == 10610 || adminInfo.CurrentOrgId == 10402 || adminInfo.CurrentOrgId == 10138 || adminInfo.CurrentOrgId == 10278 || adminInfo.CurrentOrgId == 10666 {
3180 3180
 		if dataBody["prescriptions"] != nil && reflect.TypeOf(dataBody["prescriptions"]).String() == "[]interface {}" {
3181 3181
 			prescriptions, _ := dataBody["prescriptions"].([]interface{})
3182 3182
 
@@ -3425,10 +3425,10 @@ func (c *HisApiController) CreateHisPrescription() {
3425 3425
 
3426 3426
 										}
3427 3427
 
3428
-										fmt.Println("药品名称----------------------", drug.DrugName)
3429
-										fmt.Println("药品名称----------------------", drug.IsUse)
3430
-										fmt.Println("is_user_total-------------------------", is_user_total)
3431
-										fmt.Println("no_user_total-------------------------", no_user_total)
3428
+										//fmt.Println("药品名称----------------------", drug.DrugName)
3429
+										//fmt.Println("药品名称----------------------", drug.IsUse)
3430
+										//fmt.Println("is_user_total-------------------------", is_user_total)
3431
+										//fmt.Println("no_user_total-------------------------", no_user_total)
3432 3432
 
3433 3433
 										if is_user_total != no_user_total {
3434 3434
 											//出库

+ 4 - 0
controllers/his_project_api_controller.go Vedi File

@@ -132,6 +132,7 @@ func (this *HisProjectApiController) SaveProject() {
132 132
 	bby01 := this.GetString("bby01")
133 133
 
134 134
 	is_print, _ := this.GetInt64("is_print")
135
+	is_show, _ := this.GetInt64("is_show")
135 136
 	theTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
136 137
 	adminUserInfo := this.GetAdminUserInfo()
137 138
 	orgId := adminUserInfo.CurrentOrgId
@@ -191,6 +192,7 @@ func (this *HisProjectApiController) SaveProject() {
191 192
 		Bby01:                       bby01,
192 193
 		ZuobiaoId:                   bbx01,
193 194
 		FirstLetter:                 firstLetter,
195
+		IsShow:                      is_show,
194 196
 	}
195 197
 	if this.GetAdminUserInfo().CurrentOrgId == 10206 {
196 198
 		de, _ := service.GetDepartMentDetail(executive_section)
@@ -292,6 +294,7 @@ func (this *HisProjectApiController) UpdatedProject() {
292 294
 	is_print, _ := this.GetInt64("is_print")
293 295
 	bbx01 := this.GetString("bbx01")
294 296
 	bby01 := this.GetString("bby01")
297
+	is_show, _ := this.GetInt64("is_show")
295 298
 	// 创建一个拼音转换器
296 299
 	p := pinyin.NewArgs()
297 300
 
@@ -347,6 +350,7 @@ func (this *HisProjectApiController) UpdatedProject() {
347 350
 		Bby01:                       bby01,
348 351
 		ZuobiaoId:                   bbx01,
349 352
 		UserOrgId:                   orgId,
353
+		IsShow:                      is_show,
350 354
 	}
351 355
 	if this.GetAdminUserInfo().CurrentOrgId == 10206 {
352 356
 		de, _ := service.GetDepartMentDetail(executive_section)

+ 8 - 2
controllers/manager_center_api_controller.go Vedi File

@@ -162,6 +162,7 @@ func (c *ManagerCenterApiController) CreateBaseDrugLib() {
162 162
 	bbx01 := c.GetString("bbx01")
163 163
 	bby01 := c.GetString("bby01")
164 164
 	is_project, _ := c.GetInt64("is_project")
165
+	is_show, _ := c.GetInt64("is_show")
165 166
 	adminInfo := c.GetAdminUserInfo()
166 167
 
167 168
 	hans := drug_name // 要转换的汉字字符串
@@ -252,6 +253,7 @@ func (c *ManagerCenterApiController) CreateBaseDrugLib() {
252 253
 		Bbx01:                       bbx01,
253 254
 		Bck01b:                      "10",
254 255
 		IsProject:                   is_project,
256
+		IsShow:                      is_show,
255 257
 	}
256 258
 	drugLib.FirstLetter = firstLetter
257 259
 	drugLib.Pinyin = firstLetter
@@ -363,6 +365,7 @@ func (c *ManagerCenterApiController) EditBaseDrugLib() {
363 365
 	bbx01 := c.GetString("bbx01")
364 366
 	bby01 := c.GetString("bby01")
365 367
 	is_project, _ := c.GetInt64("is_project")
368
+	is_show, _ := c.GetInt64("is_show")
366 369
 	adminInfo := c.GetAdminUserInfo()
367 370
 	drug, _ := service.FindBaseDrugLibRecord(adminInfo.CurrentOrgId, id)
368 371
 
@@ -457,6 +460,7 @@ func (c *ManagerCenterApiController) EditBaseDrugLib() {
457 460
 		Bck01b:                      "10",
458 461
 		IsProject:                   is_project,
459 462
 		FirstLetter:                 firstLetter,
463
+		IsShow:                      is_show,
460 464
 	}
461 465
 	if adminInfo.CurrentOrgId == 10206 || adminInfo.CurrentOrgId == 10344 {
462 466
 
@@ -1600,7 +1604,7 @@ func (c *ManagerCenterApiController) CreateGoodInfo() {
1600 1604
 	is_warehouse, _ := c.GetInt64("is_warehouse")
1601 1605
 	bbx01 := c.GetString("bbx01")
1602 1606
 	bby01 := c.GetString("bby01")
1603
-
1607
+	is_show, _ := c.GetInt64("is_show")
1604 1608
 	adminUserInfo := c.GetAdminUserInfo()
1605 1609
 
1606 1610
 	totals := service.FindGoodInfoByNameTwo(specification_name, adminUserInfo.CurrentOrgId, good_id, good_name)
@@ -1683,6 +1687,7 @@ func (c *ManagerCenterApiController) CreateGoodInfo() {
1683 1687
 		Bby01:                       bby01,
1684 1688
 		ZuobiaoId:                   bbx01,
1685 1689
 		Bck01b:                      "55",
1690
+		IsShow:                      is_show,
1686 1691
 	}
1687 1692
 	err, goodInfos := service.AddSigleGoodInfo(&goodInfo)
1688 1693
 	if err == nil {
@@ -1752,7 +1757,7 @@ func (c *ManagerCenterApiController) ModifyGoodInfo() {
1752 1757
 	is_warehouse, _ := c.GetInt64("is_warehouse")
1753 1758
 	bbx01 := c.GetString("bbx01")
1754 1759
 	bby01 := c.GetString("bby01")
1755
-
1760
+	is_show, _ := c.GetInt64("is_show")
1756 1761
 	// 创建一个拼音转换器
1757 1762
 	p := pinyin.NewArgs()
1758 1763
 
@@ -1827,6 +1832,7 @@ func (c *ManagerCenterApiController) ModifyGoodInfo() {
1827 1832
 		Bby01:                       bby01,
1828 1833
 		ZuobiaoId:                   bbx01,
1829 1834
 		Bck01b:                      "55",
1835
+		IsShow:                      is_show,
1830 1836
 	}
1831 1837
 
1832 1838
 	totals := service.FindGoodInfoByNameOne(specification_name, adminUserInfo.CurrentOrgId, good_id, id, good_name)

+ 38 - 5
controllers/mobile_api_controllers/check_weight_api_controller.go Vedi File

@@ -102,6 +102,21 @@ func (c *CheckWeightApiController) SaveBloodPressure() {
102 102
 			if err == gorm.ErrRecordNotFound {
103 103
 				if lastPredialysisEvaluation != nil {
104 104
 					evaluation.DryWeight = lastPredialysisEvaluation.DryWeight
105
+					evaluation.InternalFistula = lastPredialysisEvaluation.InternalFistula
106
+					evaluation.InternalFistulaSkin = lastPredialysisEvaluation.InternalFistulaSkin
107
+					evaluation.VenousCatheterization = lastPredialysisEvaluation.VenousCatheterization
108
+					evaluation.Catheter = lastPredialysisEvaluation.Catheter
109
+					evaluation.CatheterBend = lastPredialysisEvaluation.CatheterBend
110
+					evaluation.PunctureNeedle = lastPredialysisEvaluation.PunctureNeedle
111
+					evaluation.PunctureNeedleDirection = lastPredialysisEvaluation.PunctureNeedleDirection
112
+					evaluation.PunctureWay = lastPredialysisEvaluation.PunctureWay
113
+					evaluation.PointPuncture = lastPredialysisEvaluation.PointPuncture
114
+					evaluation.IsHemorrhage = lastPredialysisEvaluation.IsHemorrhage
115
+					evaluation.ThromubusType = lastPredialysisEvaluation.ThromubusType
116
+					evaluation.Skin = lastPredialysisEvaluation.Skin
117
+					evaluation.Complication = lastPredialysisEvaluation.Complication
118
+					evaluation.SymptomBeforeDialysis = lastPredialysisEvaluation.SymptomBeforeDialysis
119
+					evaluation.LastPostDialysisOther = lastPredialysisEvaluation.LastPostDialysisOther
105 120
 				} else {
106 121
 					evaluation.DryWeight = 0
107 122
 				}
@@ -118,10 +133,27 @@ func (c *CheckWeightApiController) SaveBloodPressure() {
118 133
 				evaluation.BloodAccessPartOperaId = lastPredialysisEvaluation.BloodAccessPartOperaId
119 134
 				evaluation.AdditionalWeight = lastPredialysisEvaluation.AdditionalWeight // 衣物重
120 135
 
136
+				evaluation.InternalFistula = lastPredialysisEvaluation.InternalFistula
137
+				evaluation.InternalFistulaSkin = lastPredialysisEvaluation.InternalFistulaSkin
138
+				evaluation.VenousCatheterization = lastPredialysisEvaluation.VenousCatheterization
139
+				evaluation.Catheter = lastPredialysisEvaluation.Catheter
140
+				evaluation.CatheterBend = lastPredialysisEvaluation.CatheterBend
141
+				evaluation.PunctureNeedle = lastPredialysisEvaluation.PunctureNeedle
142
+				evaluation.PunctureNeedleDirection = lastPredialysisEvaluation.PunctureNeedleDirection
143
+				evaluation.PunctureWay = lastPredialysisEvaluation.PunctureWay
144
+				evaluation.PointPuncture = lastPredialysisEvaluation.PointPuncture
145
+				evaluation.IsHemorrhage = lastPredialysisEvaluation.IsHemorrhage
146
+				evaluation.ThromubusType = lastPredialysisEvaluation.ThromubusType
147
+				evaluation.Skin = lastPredialysisEvaluation.Skin
148
+				evaluation.Complication = lastPredialysisEvaluation.Complication
149
+				evaluation.SymptomBeforeDialysis = lastPredialysisEvaluation.SymptomBeforeDialysis
150
+				evaluation.LastPostDialysisOther = lastPredialysisEvaluation.LastPostDialysisOther
151
+
121 152
 				//从化益达 备注默认上一次数据
122 153
 				if adminUserInfo.Org.Id == 10318 {
123 154
 					evaluation.Remark = lastPredialysisEvaluation.Remark
124 155
 				}
156
+
125 157
 			}
126 158
 		} else {
127 159
 			evaluation.UpdatedTime = time.Now().Unix()
@@ -129,7 +161,8 @@ func (c *CheckWeightApiController) SaveBloodPressure() {
129 161
 
130 162
 		evaluation.SystolicBloodPressure = systolic_blood_pressure   // 收缩压
131 163
 		evaluation.DiastolicBloodPressure = diastolic_blood_pressure // 舒张压
132
-		evaluation.PulseFrequency = pulse_frequency                  // 脉率
164
+		evaluation.PulseFrequency = pulse_frequency
165
+		// 脉率
133 166
 
134 167
 		evaluation.AssessmentTime = time.Now().Unix()
135 168
 
@@ -401,7 +434,7 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
401 434
 			newprescribe.PrescribingNumber = 1
402 435
 			newprescribe.BloodAccessPartId = dialysisSolution.BloodAccessPartId
403 436
 			newprescribe.Status = 1
404
-			if adminUserInfo.Org.Id != 10013 && adminUserInfo.Org.Id != 10014 {
437
+			if adminUserInfo.Org.Id != 10013 && adminUserInfo.Org.Id != 10014 && adminUserInfo.Org.Id != 10016 {
405 438
 				newprescribe.Remark = dialysisSolution.Remark
406 439
 			}
407 440
 
@@ -431,7 +464,7 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
431 464
 			}
432 465
 
433 466
 			//恒泰
434
-			if adminUserInfo.Org.Id == 10490 {
467
+			if adminUserInfo.Org.Id == 10490 || adminUserInfo.Org.Id == 10016 {
435 468
 				newprescribe.Remark = ""
436 469
 			}
437 470
 
@@ -555,7 +588,7 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
555 588
 				//} else {
556 589
 				//	newprescribe.Remark = ""
557 590
 				//}
558
-				if adminUserInfo.Org.Id == 10490 {
591
+				if adminUserInfo.Org.Id == 10490 || adminUserInfo.Org.Id == 10016 {
559 592
 					newprescribe.Remark = ""
560 593
 				}
561 594
 
@@ -884,7 +917,7 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
884 917
 				evaluation.Phinholing = lastPredialysisEvaluation.Phinholing                   //针眼
885 918
 
886 919
 				evaluation.Remark = lastPredialysisEvaluation.Remark
887
-				if adminUserInfo.Org.Id == 10318 || adminUserInfo.Org.Id == 10490 {
920
+				if adminUserInfo.Org.Id == 10318 || adminUserInfo.Org.Id == 10490 || adminUserInfo.Org.Id == 10016 {
888 921
 					evaluation.Remark = ""
889 922
 				}
890 923
 				if adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10447 {

File diff suppressed because it is too large
+ 487 - 484
controllers/mobile_api_controllers/dialysis_api_controller.go


+ 142 - 0
controllers/sign_api_controller.go Vedi File

@@ -5,10 +5,12 @@ import (
5 5
 	"encoding/json"
6 6
 	"fmt"
7 7
 	"io/ioutil"
8
+	"strconv"
8 9
 	"time"
9 10
 
10 11
 	"XT_New/models"
11 12
 	"XT_New/service"
13
+	"XT_New/utils"
12 14
 	"github.com/astaxie/beego"
13 15
 )
14 16
 
@@ -96,6 +98,8 @@ func SignApiRegistRouters() {
96 98
 	//显示字段脚本
97 99
 	beego.Router("/api/device/getfieldconfiglist", &SignApiController{}, "Get:GetFieldConfigList")
98 100
 
101
+	beego.Router("/api/device/tocheckquery", &SignApiController{}, "Get:ToCheckQuery")
102
+
99 103
 }
100 104
 
101 105
 // 短信服务接口
@@ -1347,3 +1351,141 @@ func (this *SignApiController) GetFieldConfigList() {
1347 1351
 		"msg": "ok",
1348 1352
 	})
1349 1353
 }
1354
+
1355
+// 校验库存的脚本
1356
+func (this *SignApiController) ToCheckQuery() {
1357
+
1358
+	//获取监测监控的库存情况
1359
+
1360
+	queryList, _ := service.GetAllCheckQuery()
1361
+
1362
+	var recordDateStr = time.Now().Format("2006-01-02")
1363
+	recordDate, _ := utils.ParseTimeStringToTime("2006-01-02", recordDateStr)
1364
+	if len(queryList) > 0 {
1365
+		for _, item := range queryList {
1366
+			//查询今日该机构总的医嘱数量
1367
+			adviceList, _ := service.GetAllDoctorAdviceQueryList(item.UserOrgId, recordDate.Unix())
1368
+			if len(adviceList) > 0 {
1369
+
1370
+				for _, it := range adviceList {
1371
+					var prescription_count int64
1372
+					var out_count int64
1373
+					advice, _ := service.GetDrugListById(it.DrugId, it.AdviceDate, it.PatientId)
1374
+					medical, _ := service.GetBaseDrugMedical(it.DrugId)
1375
+					if len(advice) > 0 {
1376
+						for _, its := range advice {
1377
+							prescribingNumberSix := strconv.FormatFloat(its.PrescribingNumber, 'f', -1, 64)
1378
+							prescribingNumberSeven, _ := strconv.ParseInt(prescribingNumberSix, 10, 64)
1379
+							if its.PrescribingNumberUnit == medical.MaxUnit && medical.MaxUnit != medical.MinUnit {
1380
+								prescription_count += prescribingNumberSeven * medical.MinNumber
1381
+							}
1382
+
1383
+							if its.PrescribingNumberUnit == medical.MinUnit && medical.MaxUnit != medical.MinUnit {
1384
+								prescription_count += prescribingNumberSeven
1385
+							}
1386
+
1387
+							if its.PrescribingNumberUnit == medical.MaxUnit && medical.MaxUnit == medical.MinUnit {
1388
+								prescription_count += prescribingNumberSeven
1389
+							}
1390
+						}
1391
+					}
1392
+
1393
+					outinfo, _ := service.GetDrugWarehouseOutQueryListById(it.DrugId, it.AdviceDate, it.PatientId)
1394
+
1395
+					if len(outinfo) > 0 {
1396
+						for _, s := range outinfo {
1397
+							if s.CountUnit == medical.MaxUnit && medical.MaxUnit != medical.MinUnit {
1398
+								out_count += s.Count * medical.MinNumber
1399
+							}
1400
+
1401
+							if s.CountUnit == medical.MinUnit && medical.MaxUnit != medical.MinUnit {
1402
+								out_count += s.Count
1403
+							}
1404
+
1405
+							if s.CountUnit == medical.MaxUnit && medical.MaxUnit == medical.MinUnit {
1406
+								out_count += s.Count
1407
+							}
1408
+						}
1409
+					}
1410
+
1411
+					patients, _ := service.GetPatientName(it.PatientId)
1412
+
1413
+					var specifaciton_name string
1414
+
1415
+					specifaciton_name = medical.Dose + medical.DoseUnit + "*" + strconv.FormatInt(medical.MinNumber, 10) + medical.MinUnit + "/" + medical.MaxUnit
1416
+
1417
+					//如果当天医嘱数量和出库数量不一致,那么则插入到数据库
1418
+					if prescription_count != out_count {
1419
+
1420
+						checkQuery := models.XtDrugCheckQuery{
1421
+							DrugId:            it.DrugId,
1422
+							RecordDate:        it.AdviceDate,
1423
+							AdviceCount:       prescription_count,
1424
+							OutCount:          out_count,
1425
+							PatientId:         it.PatientId,
1426
+							UserOrgId:         it.UserOrgId,
1427
+							ExecutionState:    it.ExecutionState,
1428
+							IsMedicine:        it.IsMedicine,
1429
+							DrugName:          medical.DrugName,
1430
+							SpecificationName: specifaciton_name,
1431
+							Name:              patients.Name,
1432
+						}
1433
+
1434
+						service.CreateCheckQuery(checkQuery)
1435
+					}
1436
+
1437
+				}
1438
+
1439
+			}
1440
+
1441
+			//查询今日改机构耗材的总的医嘱数量
1442
+			projectList, _ := service.GetAllPrescriptionProjectList(item.UserOrgId, recordDate.Unix())
1443
+			if len(projectList) > 0 {
1444
+
1445
+				for _, item := range projectList {
1446
+					var prescription_count int64
1447
+					var out_count int64
1448
+					project, _ := service.GetProjectListByPatient(item.PatientId, item.ProjectId, item.RecordDate)
1449
+					for _, its := range project {
1450
+						count, _ := strconv.ParseInt(its.Count, 10, 64)
1451
+						prescription_count += count
1452
+					}
1453
+
1454
+					outList, _ := service.GetWarehosueOutQueryList(item.PatientId, item.ProjectId, item.RecordDate)
1455
+					for _, s := range outList {
1456
+						out_count += s.Count
1457
+					}
1458
+
1459
+					goodIdThirty, _ := service.GetGoodInformationByGoodIdThirty(item.ProjectId)
1460
+
1461
+					patients, _ := service.GetPatientName(item.PatientId)
1462
+
1463
+					//fmt.Println("hahhahahahahhh", item.ProjectId)
1464
+					//fmt.Println("prescription_count", prescription_count)
1465
+					//fmt.Println("out_count", out_count)
1466
+					if prescription_count != out_count {
1467
+
1468
+						stockCheckQuery := models.XtStockCheckQuery{
1469
+							GoodId:            item.ProjectId,
1470
+							RecordDate:        item.RecordDate,
1471
+							AdviceCount:       prescription_count,
1472
+							OutCount:          out_count,
1473
+							PatientId:         item.PatientId,
1474
+							UserOrgId:         item.UserOrgId,
1475
+							GoodName:          goodIdThirty.GoodName,
1476
+							SpecificationName: goodIdThirty.SpecificationName,
1477
+							Name:              patients.Name,
1478
+						}
1479
+
1480
+						service.CreteStockCheckQuery(stockCheckQuery)
1481
+					}
1482
+				}
1483
+
1484
+			}
1485
+		}
1486
+	}
1487
+
1488
+	this.ServeSuccessJSON(map[string]interface{}{
1489
+		"msg": "ok",
1490
+	})
1491
+}

+ 1 - 0
controllers/stock_in_api_controller.go Vedi File

@@ -4784,6 +4784,7 @@ func (this *StockManagerApiController) AddDrugInformation() {
4784 4784
 				LimitRemark:                 item.LimitRemark,
4785 4785
 				DrugCategory:                item.DrugCategory,
4786 4786
 				DrugDose:                    item.DrugDose,
4787
+				SingleDose:                  item.DrugDose,
4787 4788
 				DrugDoseUnit:                item.DrugDoseUnit,
4788 4789
 				LmtUsedFlag:                 item.LmtUsedFlag,
4789 4790
 				DrugDay:                     item.DrugDay,

+ 46 - 0
models/data_models.go Vedi File

@@ -207,3 +207,49 @@ type XtPatientDiagnose struct {
207 207
 func (XtPatientDiagnose) TableName() string {
208 208
 	return "xt_patient_diagnose"
209 209
 }
210
+
211
+type XtDrugQuery struct {
212
+	ID        int64 `gorm:"column:id" json:"id" form:"id"`
213
+	UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
214
+	Status    int64 `gorm:"column:status" json:"status" form:"status"`
215
+}
216
+
217
+func (XtDrugQuery) TableName() string {
218
+	return "xt_drug_query"
219
+}
220
+
221
+type XtDrugCheckQuery struct {
222
+	ID                int64  `gorm:"column:id" json:"id" form:"id"`
223
+	DrugId            int64  `gorm:"column:drug_id" json:"drug_id" form:"drug_id"`
224
+	RecordDate        int64  `gorm:"column:record_date" json:"record_date" form:"record_date"`
225
+	AdviceCount       int64  `gorm:"column:advice_count" json:"advice_count" form:"advice_count"`
226
+	OutCount          int64  `gorm:"column:out_count" json:"out_count" form:"out_count"`
227
+	PatientId         int64  `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
228
+	UserOrgId         int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
229
+	ExecutionState    int64  `gorm:"column:execution_state" json:"execution_state" form:"execution_state"`
230
+	IsMedicine        int64  `gorm:"column:is_medicine" json:"is_medicine" form:"is_medicine"`
231
+	DrugName          string `gorm:"column:drug_name" json:"drug_name" form:"drug_name"`
232
+	SpecificationName string `gorm:"column:specification_name" json:"specification_name" form:"specification_name"`
233
+	Name              string `gorm:"column:name" json:"name" form:"name"`
234
+}
235
+
236
+func (XtDrugCheckQuery) TableName() string {
237
+	return "xt_drug_check_query"
238
+}
239
+
240
+type XtStockCheckQuery struct {
241
+	ID                int64  `gorm:"column:id" json:"id" form:"id"`
242
+	GoodId            int64  `gorm:"column:good_id" json:"good_id" form:"good_id"`
243
+	RecordDate        int64  `gorm:"column:record_date" json:"record_date" form:"record_date"`
244
+	AdviceCount       int64  `gorm:"column:advice_count" json:"advice_count" form:"advice_count"`
245
+	OutCount          int64  `gorm:"column:out_count" json:"out_count" form:"out_count"`
246
+	PatientId         int64  `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
247
+	UserOrgId         int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
248
+	GoodName          string `gorm:"column:good_name" json:"good_name" form:"good_name"`
249
+	SpecificationName string `gorm:"column:specification_name" json:"specification_name" form:"specification_name"`
250
+	Name              string `gorm:"column:name" json:"name" form:"name"`
251
+}
252
+
253
+func (XtStockCheckQuery) TableName() string {
254
+	return "xt_stock_check_query"
255
+}

+ 1 - 0
models/drug.go Vedi File

@@ -88,6 +88,7 @@ type BaseDrugLib struct {
88 88
 	FirstLetter        string `gorm:"column:first_letter" json:"first_letter" form:"first_letter"`
89 89
 	IsProject          int64  `gorm:"column:is_project" json:"is_project" form:"is_project"`
90 90
 	DrugDosageFormName string `gorm:"column:drug_dosage_form_name" json:"drug_dosage_form_name" form:"drug_dosage_form_name"`
91
+	IsShow             int64  `gorm:"column:is_show" json:"is_show" form:"is_show"`
91 92
 }
92 93
 
93 94
 func (BaseDrugLib) TableName() string {

+ 0 - 3
models/drug_stock.go Vedi File

@@ -462,9 +462,6 @@ type DrugFlow struct {
462 462
 	Remark                    string                 `gorm:"column:remark" json:"remark" form:"remark"`
463 463
 	OperateTime               int64                  `gorm:"column:operate_time" json:"operate_time" form:"operate_time"`
464 464
 	SaleDate                  string                 `gorm:"column:sale_date" json:"sale_date" form:"sale_date"`
465
-	PCount                    float64
466
-	SDate                     string
467
-	PDate                     int64
468 465
 }
469 466
 
470 467
 func (DrugFlow) TableName() string {

+ 1 - 0
models/good_models.go Vedi File

@@ -148,6 +148,7 @@ type GoodInfo struct {
148 148
 	SumOutCount                      int64          `gorm:"column:sum_out_count" json:"sum_out_count" form:"sum_out_count"`
149 149
 	SumCancelCount                   int64          `gorm:"column:sum_cancel_count" json:"sum_cancel_count" form:"sum_cancel_count"`
150 150
 	TotalCount                       int64          `gorm:"column:total_count" json:"total_count" form:"total_count"`
151
+	IsShow                           int64          `gorm:"column:is_show" json:"is_show" form:"is_show"`
151 152
 }
152 153
 
153 154
 func (GoodInfo) TableName() string {

+ 2 - 0
models/his_models.go Vedi File

@@ -49,6 +49,7 @@ type XtHisProject struct {
49 49
 	Bby01                       string  `gorm:"column:bby01" json:"bby01" form:"bby01"`
50 50
 	ZuobiaoId                   string  `gorm:"column:zuobiao_id" json:"zuobiao_id" form:"zuobiao_id"`
51 51
 	Bck01b                      string  `gorm:"column:bck01b" json:"bck01b" form:"bck01b"`
52
+	IsShow                      int64   `gorm:"column:is_show" json:"is_show" form:"is_show"`
52 53
 }
53 54
 
54 55
 func (XtHisProject) TableName() string {
@@ -617,6 +618,7 @@ type HisProject struct {
617 618
 	FirstLetter                 string  `gorm:"column:first_letter" json:"first_letter" form:"first_letter"`
618 619
 	Bbx01                       int64   `gorm:"column:bbx01" json:"bbx01" form:"bbx01"`
619 620
 	Bby01                       int64   `gorm:"column:bby01" json:"bby01" form:"bby01"`
621
+	IsShow                      int64   `gorm:"column:is_show" json:"is_show" form:"is_show"`
620 622
 }
621 623
 
622 624
 func (HisProject) TableName() string {

+ 1 - 0
models/self_drug_models.go Vedi File

@@ -79,6 +79,7 @@ type XtBaseDrug struct {
79 79
 	DrugDosageFormName     string  `gorm:"column:drug_dosage_form_name" json:"drug_dosage_form_name" form:"drug_dosage_form_name"`
80 80
 	TotalCountOne          int64   `gorm:"column:total_count_one" json:"total_count" form:"total_count_one"`
81 81
 	TotalCountTwo          int64   `gorm:"column:total_count_two" json:"total_count_two" form:"total_count_two"`
82
+	IsShow                 int64   `gorm:"column:is_show" json:"is_show" form:"is_show"`
82 83
 }
83 84
 
84 85
 func (XtBaseDrug) TableName() string {

+ 8 - 2
service/dialysis_service.go Vedi File

@@ -2500,9 +2500,15 @@ func GetAllAdviceList(patient_id int64, advice_date int64, user_org_id int64) (a
2500 2500
 	return advice, err
2501 2501
 }
2502 2502
 
2503
-func GetHistoryWarehouseOutInfo(patient_id int64, user_org_id int64, record_time int64, good_id int64) (outInfo []*models.WarehouseOutInfo, err error) {
2503
+func GetHistoryWarehouseOutInfo(patient_id int64, user_org_id int64, record_time int64, good_id int64, tx *gorm.DB) (outInfo []*models.WarehouseOutInfo, err error) {
2504 2504
 
2505
-	err = XTReadDB().Where("patient_id = ? and org_id = ? and sys_record_time = ? and status =1 and good_id = ?", patient_id, user_org_id, record_time, good_id).Find(&outInfo).Error
2505
+	err = tx.Where("patient_id = ? and org_id = ? and sys_record_time = ? and status =1 and good_id = ?", patient_id, user_org_id, record_time, good_id).Find(&outInfo).Error
2506 2506
 
2507
+	if err != gorm.ErrRecordNotFound {
2508
+		if err != nil {
2509
+			tx.Rollback()
2510
+			return
2511
+		}
2512
+	}
2507 2513
 	return outInfo, err
2508 2514
 }

+ 2 - 2
service/gobal_config_service.go Vedi File

@@ -185,7 +185,7 @@ func GetPrint(ids []int64, orgid int64, advicetype int64, stoptype int64) (docto
185 185
 			db = db.Where("stop_state = ?", stoptype)
186 186
 		}
187 187
 
188
-		err = db.Where("groupno = ?", ids[0]).Find(&doctor).Error
188
+		err = db.Where("groupno = ?", ids[0]).Order("advice_date asc").Find(&doctor).Error
189 189
 	} else {
190 190
 		if orgid > 0 {
191 191
 			db = db.Where("user_org_id = ?", orgid)
@@ -196,7 +196,7 @@ func GetPrint(ids []int64, orgid int64, advicetype int64, stoptype int64) (docto
196 196
 		if stoptype > 0 {
197 197
 			db = db.Where("stop_state = ?", stoptype)
198 198
 		}
199
-		err = db.Where("groupno IN(?)", ids).Find(&doctor).Error
199
+		err = db.Where("groupno IN(?)", ids).Order("advice_date asc").Find(&doctor).Error
200 200
 	}
201 201
 
202 202
 	return doctor, err

+ 1 - 1
service/his_project_service.go Vedi File

@@ -60,7 +60,7 @@ func GetProjectDetail(id int64) (models.XtHisProject, error) {
60 60
 
61 61
 func UpdatedProject(id int64, pro *models.XtHisProject) error {
62 62
 
63
-	err := XTWriteDB().Model(&pro).Where("id=?", id).Updates(map[string]interface{}{"project_name": pro.ProjectName, "pinyin": pro.Pinyin, "wubi": pro.Pinyin, "price": pro.Price, "unit": pro.Unit, "cost_classify": pro.CostClassify, "executive_section": pro.ExecutiveSection, "medical_coverage": pro.MedicalCoverage, "statistical_classification": pro.StatisticalClassification, "disease_directory": pro.DiseaseDirectory, "is_record": pro.IsRecord, "medical_code": pro.MedicalCode, "tube_color": pro.TubeColor, "medical_status": pro.MedicalStatus, "remark": pro.Remark, "sign": pro.Sign, "default_number": pro.DefaultNumber, "is_default": pro.IsDefault, "is_charge": pro.IsCharge, "is_estimate": pro.IsEstimate, "is_workload": pro.IsWorkload, "sort": pro.Sort, "doctor_advice": pro.DoctorAdvice, "single_dose": pro.SingleDose, "execution_frequency": pro.ExecutionFrequency, "delivery_way": pro.DeliveryWay, "number_days": pro.NumberDays, "total": pro.Total, "updated_time": pro.UpdatedTime, "category": pro.Category, "specail_project": pro.SpecailProject, "social_security_directory_code": pro.SocialSecurityDirectoryCode, "record_date": pro.RecordDate, "is_print": pro.IsPrint, "bbx01": pro.Bbx01, "bby01": pro.Bby01, "zuobiao_id": pro.ZuobiaoId, "bck01b": pro.Bck01b}).Error
63
+	err := XTWriteDB().Model(&pro).Where("id=?", id).Updates(map[string]interface{}{"project_name": pro.ProjectName, "pinyin": pro.Pinyin, "wubi": pro.Pinyin, "price": pro.Price, "unit": pro.Unit, "cost_classify": pro.CostClassify, "executive_section": pro.ExecutiveSection, "medical_coverage": pro.MedicalCoverage, "statistical_classification": pro.StatisticalClassification, "disease_directory": pro.DiseaseDirectory, "is_record": pro.IsRecord, "medical_code": pro.MedicalCode, "tube_color": pro.TubeColor, "medical_status": pro.MedicalStatus, "remark": pro.Remark, "sign": pro.Sign, "default_number": pro.DefaultNumber, "is_default": pro.IsDefault, "is_charge": pro.IsCharge, "is_estimate": pro.IsEstimate, "is_workload": pro.IsWorkload, "sort": pro.Sort, "doctor_advice": pro.DoctorAdvice, "single_dose": pro.SingleDose, "execution_frequency": pro.ExecutionFrequency, "delivery_way": pro.DeliveryWay, "number_days": pro.NumberDays, "total": pro.Total, "updated_time": pro.UpdatedTime, "category": pro.Category, "specail_project": pro.SpecailProject, "social_security_directory_code": pro.SocialSecurityDirectoryCode, "record_date": pro.RecordDate, "is_print": pro.IsPrint, "bbx01": pro.Bbx01, "bby01": pro.Bby01, "zuobiao_id": pro.ZuobiaoId, "bck01b": pro.Bck01b, "is_show": pro.IsShow}).Error
64 64
 	return err
65 65
 }
66 66
 

+ 1 - 1
service/inspection_service.go Vedi File

@@ -404,7 +404,7 @@ func GetInSpctionRerefce(project_id int64, user_org_id int64) (inspct []*models.
404 404
 
405 405
 func GetInspectionGroupByRecordDate(patient_id int64, project_id int64, org_id int64) (inspetion []*models.Inspection, err error) {
406 406
 
407
-	err = XTReadDB().Where("patient_id = ? and project_id = ? and org_id = ? and status=1", patient_id, project_id, org_id).Order("inspect_date asc").Limit(10).Group("inspect_date").Find(&inspetion).Error
407
+	err = XTReadDB().Where("patient_id = ? and project_id = ? and org_id = ? and status=1", patient_id, project_id, org_id).Order("inspect_date desc").Limit(10).Group("inspect_date").Find(&inspetion).Error
408 408
 
409 409
 	return inspetion, err
410 410
 }

+ 14 - 1
service/mobile_dialysis_service.go Vedi File

@@ -56,7 +56,7 @@ func GetMonitDialysisSolution(user_org_id int64, patient_id int64, mode_id int64
56 56
 
57 57
 	solution := models.DialysisSolution{}
58 58
 
59
-	err := XTReadDB().Where("user_org_id = ? and patient_id =? and solution_status = 1 and mode_id = ?", user_org_id, patient_id, mode_id).Find(&solution).Error
59
+	err := XTReadDB().Where("user_org_id = ? and patient_id =? and solution_status = 1 and mode_id = ? and status=1", user_org_id, patient_id, mode_id).Find(&solution).Error
60 60
 
61 61
 	return &solution, err
62 62
 }
@@ -2867,6 +2867,11 @@ func FindConsumablesByDateThree(orgID int64, patient_id int64, recordDate int64)
2867 2867
 	return
2868 2868
 }
2869 2869
 
2870
+func FindHisPrescription(orgID int64, patient_id int64, recordDate int64) (project []*models.HisPrescriptionProject, err error) {
2871
+	err = readDb.Model(&models.HisPrescriptionProject{}).Where("user_org_id = ? AND patient_id = ? AND record_date = ? AND status = 1 and type =3", orgID, patient_id, recordDate).Find(&project).Error
2872
+	return
2873
+}
2874
+
2870 2875
 //func FindLastConsumables(orgID int64, patient_id int64, recordDate int64) (consumables []*models.DialysisBeforePrepare, err error){
2871 2876
 //	err = readDb.Model(&models.DialysisBeforePrepare{}).Where("user_org_id = ? AND patient_id = ? AND record_date = ? AND status = 1", orgID, patient_id,recordDate).Find(&consumables).Error
2872 2877
 //	return
@@ -9923,3 +9928,11 @@ func GetLastAcceptTreatment(user_org_id int64, patient_id int64) (models.Receive
9923 9928
 	err := XTReadDB().Where("user_org_id = ? and patient_id = ? and status=1 and admission_number<>''", user_org_id, patient_id).Last(&treatmentAsses).Error
9924 9929
 	return treatmentAsses, err
9925 9930
 }
9931
+
9932
+func GetDrugIsShow(id int64, org_id int64) (models.XtBaseDrug, error) {
9933
+
9934
+	baseDrug := models.XtBaseDrug{}
9935
+	err := XTReadDB().Where("id = ? and status =1 and org_id = ?", id, org_id).Find(&baseDrug).Error
9936
+
9937
+	return baseDrug, err
9938
+}

+ 62 - 0
service/sign_service.go Vedi File

@@ -2269,3 +2269,65 @@ func GetFieldConfigList(user_org_id int64) (filedConfig []*models.FiledConfig, e
2269 2269
 	return filedConfig, err
2270 2270
 
2271 2271
 }
2272
+
2273
+func GetAllCheckQuery() (query []*models.XtDrugQuery, err error) {
2274
+
2275
+	err = XTReadDB().Where("status=1").Find(&query).Error
2276
+
2277
+	return query, err
2278
+}
2279
+
2280
+func GetAllDoctorAdviceQueryList(user_org_id int64, advice_date int64) (advice []*models.HisDoctorAdvice, err error) {
2281
+
2282
+	err = XTReadDB().Where("user_org_id = ? and advice_date = ? and status=1", user_org_id, advice_date).Find(&advice).Error
2283
+
2284
+	return advice, err
2285
+}
2286
+
2287
+func GetDrugListById(drug_id int64, advice_date int64, patient_id int64) (advice []*models.HisDoctorAdvice, err error) {
2288
+
2289
+	err = XTReadDB().Where("drug_id = ? and status =1 and advice_date = ? and patient_id =?", drug_id, advice_date, patient_id).Find(&advice).Error
2290
+
2291
+	return advice, err
2292
+}
2293
+
2294
+func GetDrugWarehouseOutQueryListById(drug_id int64, sys_record_date int64, patient_id int64) (outinfo []*models.DrugWarehouseOutInfo, err error) {
2295
+
2296
+	err = XTReadDB().Where("drug_id = ? and sys_record_time = ? and status =1 and patient_id = ?", drug_id, sys_record_date, patient_id).Find(&outinfo).Error
2297
+
2298
+	return outinfo, err
2299
+}
2300
+
2301
+func CreateCheckQuery(query models.XtDrugCheckQuery) error {
2302
+
2303
+	err := XTWriteDB().Create(&query).Error
2304
+
2305
+	return err
2306
+}
2307
+
2308
+func GetAllPrescriptionProjectList(user_org_id int64, record_date int64) (project []*models.HisPrescriptionProject, err error) {
2309
+
2310
+	err = XTReadDB().Where("user_org_id = ? and record_date = ? and status =1 and type =3", user_org_id, record_date).Find(&project).Error
2311
+
2312
+	return project, err
2313
+}
2314
+
2315
+func GetProjectListByPatient(patient_id int64, project_id int64, record_date int64) (project []*models.HisPrescriptionProject, err error) {
2316
+
2317
+	err = XTReadDB().Where("patient_id =? and project_id = ? and record_date =?", patient_id, project_id, record_date).Find(&project).Error
2318
+
2319
+	return project, err
2320
+}
2321
+
2322
+func GetWarehosueOutQueryList(patient_id int64, project_id int64, record_date int64) (out []*models.WarehouseOutInfo, err error) {
2323
+
2324
+	err = XTReadDB().Where("patient_id = ? and good_id = ? and sys_record_time = ? and status=1", patient_id, project_id, record_date).Find(&out).Error
2325
+	return out, err
2326
+}
2327
+
2328
+func CreteStockCheckQuery(query models.XtStockCheckQuery) error {
2329
+
2330
+	err := XTWriteDB().Create(&query).Error
2331
+
2332
+	return err
2333
+}

+ 2 - 1
service/stock_service.go Vedi File

@@ -278,6 +278,7 @@ func ModifyGoodInfo(goodInfo *models.GoodInfo) (error, *models.GoodInfo) {
278 278
 		"bby01":                          goodInfo.Bby01,
279 279
 		"zuobiao_id":                     goodInfo.Bbx01,
280 280
 		"first_letter":                   goodInfo.FirstLetter,
281
+		"is_show":                        goodInfo.IsShow,
281 282
 	}).Error
282 283
 
283 284
 	writeDb.Model(&models.WarehousingInfo{}).Where("good_id = ? AND org_id = ?", goodInfo.ID, goodInfo.OrgId).Updates(map[string]interface{}{"good_type_id": goodInfo.GoodTypeId})
@@ -3848,7 +3849,7 @@ func CreateDrugsInfomation(info *models.BaseDrugLib) error {
3848 3849
 
3849 3850
 func UpdateDrugsInformation(drug *models.BaseDrugLib, drugName string, drugSpec string, orgid int64) error {
3850 3851
 
3851
-	err := XTWriteDB().Model(&drug).Where("drug_name = ? and drug_spec = ? and org_id = ? and status = 1", drugName, drugSpec, orgid).Updates(map[string]interface{}{"drug_name": drug.DrugName, "drug_alias": drug.DrugAlias, "drug_spec": drug.DrugSpec, "drug_type": drug.DrugType, "drug_stock_limit": drug.DrugStockLimit, "drug_origin_place": drug.DrugOriginPlace, "drug_dosage_form": drug.DrugDosageForm, "medical_insurance_level": drug.MedicalInsuranceLevel, "max_unit": drug.MaxUnit, "min_unit": drug.MinUnit, "unit_matrixing": drug.UnitMatrixing, "retail_price": drug.RetailPrice, "last_price": drug.LastPrice, "drug_classify": drug.DrugClassify, "manufacturer": drug.Manufacturer, "dealer": drug.Dealer, "pinyin": drug.Pinyin, "wubi": drug.Wubi, "drug_alias_pinyin": drug.DrugAliasPinyin, "drug_alias_wubi": drug.DrugAliasWubi, "drug_category": drug.DrugCategory, "drug_control": drug.DrugControl, "number": drug.Number, "hosp_appr_flag": drug.HospApprFlag, "medical_insurance_number": drug.MedicalInsuranceNumber, "pharmacology_category": drug.PharmacologyCategory, "statistics_category": drug.StatisticsCategory, "code": drug.Code, "is_special_diseases": drug.IsSpecialDiseases, "is_record": drug.IsRecord, "prescription_mark": drug.PrescriptionMark, "social_security_directory_code": drug.SocialSecurityDirectoryCode, "record_date": drug.RecordDate, "drug_remark": drug.DrugRemark, "drug_status": drug.DrugStatus, "limit_remark": drug.LimitRemark, "drug_dose": drug.DrugDose, "drug_dose_unit": drug.DrugDoseUnit, "lmt_used_flag": drug.LmtUsedFlag, "delivery_way": drug.DeliveryWay, "execution_frequency": drug.ExecutionFrequency, "drug_day": drug.DrugDay}).Error
3852
+	err := XTWriteDB().Model(&drug).Where("drug_name = ? and drug_spec = ? and org_id = ? and status = 1", drugName, drugSpec, orgid).Updates(map[string]interface{}{"drug_name": drug.DrugName, "drug_alias": drug.DrugAlias, "drug_spec": drug.DrugSpec, "drug_type": drug.DrugType, "drug_stock_limit": drug.DrugStockLimit, "drug_origin_place": drug.DrugOriginPlace, "drug_dosage_form": drug.DrugDosageForm, "medical_insurance_level": drug.MedicalInsuranceLevel, "max_unit": drug.MaxUnit, "min_unit": drug.MinUnit, "unit_matrixing": drug.UnitMatrixing, "retail_price": drug.RetailPrice, "last_price": drug.LastPrice, "drug_classify": drug.DrugClassify, "manufacturer": drug.Manufacturer, "dealer": drug.Dealer, "pinyin": drug.Pinyin, "wubi": drug.Wubi, "drug_alias_pinyin": drug.DrugAliasPinyin, "drug_alias_wubi": drug.DrugAliasWubi, "drug_category": drug.DrugCategory, "drug_control": drug.DrugControl, "number": drug.Number, "hosp_appr_flag": drug.HospApprFlag, "medical_insurance_number": drug.MedicalInsuranceNumber, "pharmacology_category": drug.PharmacologyCategory, "statistics_category": drug.StatisticsCategory, "code": drug.Code, "is_special_diseases": drug.IsSpecialDiseases, "is_record": drug.IsRecord, "prescription_mark": drug.PrescriptionMark, "social_security_directory_code": drug.SocialSecurityDirectoryCode, "record_date": drug.RecordDate, "drug_remark": drug.DrugRemark, "drug_status": drug.DrugStatus, "limit_remark": drug.LimitRemark, "drug_dose": drug.DrugDose, "single_dose": drug.DrugDose, "drug_dose_unit": drug.DrugDoseUnit, "lmt_used_flag": drug.LmtUsedFlag, "delivery_way": drug.DeliveryWay, "execution_frequency": drug.ExecutionFrequency, "drug_day": drug.DrugDay}).Error
3852 3853
 	return err
3853 3854
 }
3854 3855