瀏覽代碼

历史排班

28169 1 年之前
父節點
當前提交
f940f27d81

+ 2 - 2
controllers/dialysis_api_controller.go 查看文件

@@ -2536,13 +2536,13 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
2536 2536
 		if dialysisFinish.ID == 0 {
2537 2537
 			service.CreateDialysisFinish(finish)
2538 2538
 		}
2539
-		if adminUserInfo.CurrentOrgId == 9671 || adminUserInfo.CurrentOrgId == 3877 || adminUserInfo.CurrentOrgId == 10469 || adminUserInfo.CurrentOrgId == 10551 || adminUserInfo.CurrentOrgId == 10579 || adminUserInfo.CurrentOrgId == 10580 {
2539
+		if adminUserInfo.CurrentOrgId == 9671 || adminUserInfo.CurrentOrgId == 3877 || adminUserInfo.CurrentOrgId == 10469 || adminUserInfo.CurrentOrgId == 10551 || adminUserInfo.CurrentOrgId == 10579 || adminUserInfo.CurrentOrgId == 10580 || adminUserInfo.CurrentOrgId == 10585 {
2540 2540
 			var dewater_amount float64
2541 2541
 			dewater_amount = 0
2542 2542
 			if dry_weight > 0 {
2543 2543
 				dewater_amount = weight_before - dry_weight - additional_weight
2544 2544
 
2545
-				if adminUserInfo.CurrentOrgId != 10551 && adminUserInfo.CurrentOrgId != 10579 && adminUserInfo.CurrentOrgId != 10580 {
2545
+				if adminUserInfo.CurrentOrgId != 10551 && adminUserInfo.CurrentOrgId != 10579 && adminUserInfo.CurrentOrgId != 10580 && adminUserInfo.CurrentOrgId != 10585 {
2546 2546
 					dewater_amount = dewater_amount * 1000
2547 2547
 				}
2548 2548
 

+ 2 - 2
controllers/mobile_api_controllers/patient_api_controller.go 查看文件

@@ -2600,9 +2600,9 @@ func (c *PatientApiController) EditAssessmentBeforeDislysis() {
2600 2600
 	if evaluation.DryWeight > 0 {
2601 2601
 		dewater_amount = evaluation.WeightBefore - evaluation.DryWeight - evaluation.AdditionalWeight
2602 2602
 
2603
-		if template.TemplateId == 17 || template.TemplateId == 22 || template.TemplateId == 21 || template.TemplateId == 26 || template.TemplateId == 34 || template.TemplateId == 32 || adminUserInfo.Org.Id == 10469 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 10551 || adminUserInfo.Org.Id == 10579 || adminUserInfo.Org.Id == 10580 {
2603
+		if template.TemplateId == 17 || template.TemplateId == 22 || template.TemplateId == 21 || template.TemplateId == 26 || template.TemplateId == 34 || template.TemplateId == 32 || adminUserInfo.Org.Id == 10469 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 10551 || adminUserInfo.Org.Id == 10579 || adminUserInfo.Org.Id == 10580 || adminUserInfo.Org.Id == 10585 {
2604 2604
 
2605
-			if adminUserInfo.Org.Id != 10551 && adminUserInfo.Org.Id != 10579 && adminUserInfo.Org.Id != 10580 {
2605
+			if adminUserInfo.Org.Id != 10551 && adminUserInfo.Org.Id != 10579 && adminUserInfo.Org.Id != 10580 && adminUserInfo.Org.Id != 10585 {
2606 2606
 				dewater_amount = dewater_amount * 1000
2607 2607
 			}
2608 2608
 

+ 15 - 0
controllers/sign_api_controller.go 查看文件

@@ -86,6 +86,8 @@ func SignApiRegistRouters() {
86 86
 
87 87
 	beego.Router("/api/device/tocheckinformation", &SignApiController{}, "Get:ToCheckInformation")
88 88
 
89
+	beego.Router("/api/device/toautodrug", &SignApiController{}, "Get:ToAutoDrug")
90
+
89 91
 }
90 92
 
91 93
 // 短信服务接口
@@ -1143,3 +1145,16 @@ func (this *SignApiController) ToCheckInformation() {
1143 1145
 		"informationOne": informationOne,
1144 1146
 	})
1145 1147
 }
1148
+
1149
+func (this *SignApiController) ToAutoDrug() {
1150
+
1151
+	advice, _ := service.GetAutoDrugList(9919)
1152
+
1153
+	for _, item := range advice {
1154
+		//查找该患者是否出库过
1155
+		outList, _ := service.GetDrugAutoWarehouseOutList(item.PatientId, item.UserOrgId, item.DrugId, item.AdviceDate)
1156
+		if outList.ID == 0 {
1157
+			service.HisDrugsDelivery(item.UserOrgId, item.ExecutionStaff, item)
1158
+		}
1159
+	}
1160
+}

+ 16 - 0
service/sign_service.go 查看文件

@@ -2074,3 +2074,19 @@ func UpdateBaseList(id int64, firstleterr string) error {
2074 2074
 	err := XTWriteDB().Model(&models.BaseDrugLib{}).Where("id = ? and status =1", id, firstleterr).Updates(map[string]interface{}{"first_letter": firstleterr}).Error
2075 2075
 	return err
2076 2076
 }
2077
+
2078
+func GetAutoDrugList(user_org_id int64) (advice []*models.HisDoctorAdviceInfo, err error) {
2079
+
2080
+	err = XTReadDB().Where("user_org_id =? and status =1 and advice_date = 1698681600 and drug_id =239", user_org_id).Find(&advice).Error
2081
+
2082
+	return advice, err
2083
+}
2084
+
2085
+func GetDrugAutoWarehouseOutList(patient_id int64, user_org_id int64, drug_id int64, advice_date int64) (models.DrugWarehouseOutInfo, error) {
2086
+
2087
+	info := models.DrugWarehouseOutInfo{}
2088
+
2089
+	err2 := XTReadDB().Where("patient_id = ? and org_id = ? and drug_id = ? and sys_record_time =? and status=1", patient_id, user_org_id, drug_id, advice_date).Find(&info).Error
2090
+
2091
+	return info, err2
2092
+}