Przeglądaj źródła

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

陈少旭 1 miesiąc temu
rodzic
commit
adf042943f

BIN
XT_New.exe Wyświetl plik


+ 4 - 4
controllers/base_api_controller.go Wyświetl plik

@@ -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 = 10744 //机构id
86
+		subscibe.OrgId = 9478 //机构id
87 87
 		subscibe.PeriodStart = 1547447814
88 88
 		subscibe.PeriodEnd = 1550039814
89 89
 		subscibe.State = 1
@@ -93,7 +93,7 @@ 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 = 10744 //机构id小英9675或4
96
+		adminUserInfo.CurrentOrgId = 9478  //机构id小英9675或4
97 97
 		adminUserInfo.CurrentAppId = 18723 //4
98 98
 		adminUserInfo.AdminUser = &userAdmin
99 99
 		adminUserInfo.Subscibes = subscibes
@@ -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 = 10744 //机构id小英9675或4
332
+		subscibe.OrgId = 9478 //机构id小英9675或4
333 333
 		subscibe.PeriodStart = 1538035409
334 334
 		subscibe.PeriodEnd = 1569571409
335 335
 		subscibe.State = 1
@@ -339,7 +339,7 @@ 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 = 10744 //机构id小英9675或4
342
+		adminUserInfo.CurrentOrgId = 9478  //机构id小英9675或4
343 343
 		adminUserInfo.CurrentAppId = 18723 //4
344 344
 		adminUserInfo.AdminUser = &userAdmin
345 345
 		adminUserInfo.Subscibes = subscibes

+ 7 - 0
controllers/dialysis_api_controller.go Wyświetl plik

@@ -3129,6 +3129,10 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
3129 3129
 				newprescribe.Amylaceum = dialysisSolution.Amylaceum
3130 3130
 				newprescribe.Status = 1
3131 3131
 
3132
+				if adminUserInfo.CurrentOrgId == 10677 {
3133
+					newprescribe.Remark = ""
3134
+				}
3135
+
3132 3136
 				if adminUserInfo.CurrentOrgId == 10579 {
3133 3137
 					newprescribe.Modifier = 0
3134 3138
 					newprescribe.PrescriptionDoctor = 0
@@ -3216,6 +3220,9 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
3216 3220
 						newprescribe.PrescriptionDoctor = 0
3217 3221
 						newprescribe.Creater = 0
3218 3222
 					}
3223
+					if adminUserInfo.CurrentOrgId == 10677 {
3224
+						newprescribe.Remark = ""
3225
+					}
3219 3226
 					err := service.AddSigleRecord(&newprescribe)
3220 3227
 					//记录日志
3221 3228
 					byterequest, _ := json.Marshal(newprescribe)

+ 1 - 0
controllers/his_config_api_controller.go Wyświetl plik

@@ -918,6 +918,7 @@ func (c *HisConfigApiController) DeleteModeProjectTemplate() {
918 918
 }
919 919
 
920 920
 func (c *HisConfigApiController) DeleteModeAdviceTemplate() {
921
+
921 922
 	id, _ := c.GetInt64("id")
922 923
 	err := service.DelelteHisModePrescriptionAdviceTemplate(id, c.GetAdminUserInfo().CurrentOrgId)
923 924
 	if err == nil {

+ 5 - 5
controllers/mobile_api_controllers/check_weight_api_controller.go Wyświetl plik

@@ -439,7 +439,7 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
439 439
 			newprescribe.BloodAccessPartId = dialysisSolution.BloodAccessPartId
440 440
 			newprescribe.Amylaceum = dialysisSolution.Amylaceum
441 441
 			newprescribe.Status = 1
442
-			if adminUserInfo.Org.Id != 10013 && adminUserInfo.Org.Id != 10014 && adminUserInfo.Org.Id != 10016 {
442
+			if adminUserInfo.Org.Id != 10013 && adminUserInfo.Org.Id != 10014 && adminUserInfo.Org.Id != 10016 && adminUserInfo.Org.Id != 10677 {
443 443
 				newprescribe.Remark = dialysisSolution.Remark
444 444
 			}
445 445
 
@@ -469,7 +469,7 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
469 469
 			}
470 470
 
471 471
 			//恒泰
472
-			if adminUserInfo.Org.Id == 10490 || adminUserInfo.Org.Id == 10016 {
472
+			if adminUserInfo.Org.Id == 10490 || adminUserInfo.Org.Id == 10016 || adminUserInfo.Org.Id == 10677 {
473 473
 				newprescribe.Remark = ""
474 474
 			}
475 475
 
@@ -601,7 +601,7 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
601 601
 				//} else {
602 602
 				//	newprescribe.Remark = ""
603 603
 				//}
604
-				if adminUserInfo.Org.Id == 10490 || adminUserInfo.Org.Id == 10016 {
604
+				if adminUserInfo.Org.Id == 10490 || adminUserInfo.Org.Id == 10016 || adminUserInfo.Org.Id == 10677 {
605 605
 					newprescribe.Remark = ""
606 606
 				}
607 607
 
@@ -940,7 +940,7 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
940 940
 				}
941 941
 
942 942
 				evaluation.Remark = lastPredialysisEvaluation.Remark
943
-				if adminUserInfo.Org.Id == 10318 || adminUserInfo.Org.Id == 10490 || adminUserInfo.Org.Id == 10016 {
943
+				if adminUserInfo.Org.Id == 10318 || adminUserInfo.Org.Id == 10490 || adminUserInfo.Org.Id == 10016 || adminUserInfo.Org.Id == 10677 {
944 944
 					evaluation.Remark = ""
945 945
 				}
946 946
 				if adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10447 {
@@ -1149,7 +1149,7 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
1149 1149
 				afterevaluation.ActualDisplacement = DisplacementQuantityOne
1150 1150
 			}
1151 1151
 		}
1152
-		if adminUserInfo.Org.Id == 10721 {
1152
+		if adminUserInfo.Org.Id == 10721 || adminUserInfo.Org.Id == 9478 {
1153 1153
 			afterevaluation.Temperature = 36.5
1154 1154
 		}
1155 1155
 

+ 5 - 0
controllers/mobile_api_controllers/dialysis_api_controller.go Wyświetl plik

@@ -3996,6 +3996,11 @@ func (this *DialysisAPIController) StartDialysis() {
3996 3996
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodePrescription)
3997 3997
 			return
3998 3998
 		}
3999
+		advices, _ := service.GetDialysisPrescriptionDoctorAdviceList(adminUserInfo.Org.Id, patientID, schedulestartTime)
4000
+		if len(advices) == 0 {
4001
+			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodePrescription)
4002
+			return
4003
+		}
3999 4004
 	}
4000 4005
 
4001 4006
 	//查询该床位是否有人用了

+ 10 - 0
controllers/mobile_api_controllers/patient_api_controller.go Wyświetl plik

@@ -4002,6 +4002,10 @@ func (c *PatientApiController) EditAssessmentBeforeDislysis() {
4002 4002
 				newprescribe.Creater = 0
4003 4003
 				newprescribe.PrescriptionDoctor = 0
4004 4004
 			}
4005
+
4006
+			if adminUserInfo.Org.Id == 10677 {
4007
+				newprescribe.Remark = ""
4008
+			}
4005 4009
 			err := service.AddSigleRecord(&newprescribe)
4006 4010
 			//记录日志
4007 4011
 			byterequest, _ := json.Marshal(newprescribe)
@@ -4171,6 +4175,9 @@ func (c *PatientApiController) EditAssessmentBeforeDislysis() {
4171 4175
 					newprescribe.Creater = 0
4172 4176
 					newprescribe.PrescriptionDoctor = 0
4173 4177
 				}
4178
+				if adminUserInfo.Org.Id == 10677 {
4179
+					newprescribe.Remark = ""
4180
+				}
4174 4181
 				err := service.AddSigleRecord(&newprescribe)
4175 4182
 
4176 4183
 				//记录日志
@@ -4339,6 +4346,9 @@ func (c *PatientApiController) EditAssessmentBeforeDislysis() {
4339 4346
 					newprescribe.Creater = 0
4340 4347
 					newprescribe.PrescriptionDoctor = 0
4341 4348
 				}
4349
+				if adminUserInfo.Org.Id == 10677 {
4350
+					newprescribe.Remark = ""
4351
+				}
4342 4352
 				err := service.AddSigleRecord(&newprescribe)
4343 4353
 				//记录日志
4344 4354
 				byterequest, _ := json.Marshal(newprescribe)

+ 51 - 0
controllers/self_drug_api_congtroller.go Wyświetl plik

@@ -199,6 +199,8 @@ func SelfDrugRouters() {
199 199
 
200 200
 	beego.Router("/api/drug/getdrugpurchasequerylist", &SelfDrugApiController{}, "Get:GetDrugPurchaseQueryList")
201 201
 
202
+	beego.Router("/api/patient/getgoodwarehouseinprintlist", &SelfDrugApiController{}, "Get:GetGoodWarehosueInfoPrintList")
203
+
202 204
 }
203 205
 
204 206
 func (this *SelfDrugApiController) GetCurrentPatient() {
@@ -6805,3 +6807,52 @@ func (this *SelfDrugApiController) GetDrugPurchaseQueryList() {
6805 6807
 		"dealerList":       dealerList,
6806 6808
 	})
6807 6809
 }
6810
+
6811
+func (this *SelfDrugApiController) GetGoodWarehosueInfoPrintList() {
6812
+
6813
+	good_id, _ := this.GetInt64("good_id")
6814
+
6815
+	start_time := this.GetString("start_time")
6816
+
6817
+	end_time := this.GetString("end_time")
6818
+
6819
+	orgId := this.GetAdminUserInfo().CurrentOrgId
6820
+
6821
+	timeLayout := "2006-01-02"
6822
+	loc, _ := time.LoadLocation("Local")
6823
+
6824
+	var startTime int64
6825
+
6826
+	if len(start_time) > 0 {
6827
+		theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
6828
+		if err != nil {
6829
+			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
6830
+			return
6831
+		}
6832
+		startTime = theTime.Unix()
6833
+	}
6834
+
6835
+	var endTime int64
6836
+	if len(end_time) > 0 {
6837
+		theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
6838
+		if err != nil {
6839
+			utils.ErrorLog(err.Error())
6840
+			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
6841
+			return
6842
+		}
6843
+		endTime = theTime.Unix()
6844
+	}
6845
+
6846
+	list, _ := service.GetGoodWarehosueInfoPrintList(good_id, startTime, endTime, orgId)
6847
+	manufacturerList, _ := service.GetAllManufacturerList(orgId)
6848
+	dealerList, _ := service.GetAllDealerList(orgId)
6849
+	goodList, _ := service.GetMobileGoodList(orgId)
6850
+	goodsType, _ := service.GetAllGoodType(orgId)
6851
+	this.ServeSuccessJSON(map[string]interface{}{
6852
+		"list":             list,
6853
+		"manufacturerList": manufacturerList,
6854
+		"dealerList":       dealerList,
6855
+		"goodList":         goodList,
6856
+		"goodsType":        goodsType,
6857
+	})
6858
+}

+ 1 - 1
controllers/stock_in_api_controller.go Wyświetl plik

@@ -8166,7 +8166,7 @@ func (this *StockManagerApiController) UpdateBaseDrugListByUserOrgID() {
8166 8166
 	//	service.UpdateDealerManufacturerOne(item.ID, manufacturer.ManufacturerName)
8167 8167
 	//}
8168 8168
 
8169
-	drugList, _ := service.GetAllBaseDrugListTwentyOne(10480)
8169
+	drugList, _ := service.GetAllBaseDrugListTwentyOne(10726)
8170 8170
 
8171 8171
 	for _, item := range drugList {
8172 8172
 		var drug_spec = item.Dose + item.DoseUnit + "*" + strconv.FormatInt(item.MinNumber, 10) + item.MinUnit + "/" + item.MaxUnit

+ 1 - 1
enums/error_code.go Wyświetl plik

@@ -557,7 +557,7 @@ var ErrCodeMsgs = map[int]string{
557 557
 	ErrorTimeCodeParamWrong: "时间跨度不能超过一个月",
558 558
 	ErrorCodeAuthWrong:      "尚未实名认证,请先认证",
559 559
 	ErrorCodeFlow:           "网络错误,数据异常,审核失败",
560
-	ErrorCodePrescription:   "请先开处方",
560
+	ErrorCodePrescription:   "请先开处方或医嘱",
561 561
 }
562 562
 
563 563
 type SGJError struct {

+ 38 - 0
models/stock_models.go Wyświetl plik

@@ -1865,3 +1865,41 @@ type XtDrugCodeOpen struct {
1865 1865
 func (XtDrugCodeOpen) TableName() string {
1866 1866
 	return "xt_drug_code_open"
1867 1867
 }
1868
+
1869
+type PrintWarehousingInfo struct {
1870
+	ID                        int64   `gorm:"column:id" json:"id"`
1871
+	WarehousingId             int64   `gorm:"column:warehousing_id" json:"warehousing_id"`
1872
+	GoodId                    int64   `gorm:"column:good_id" json:"good_id"`
1873
+	GoodTypeId                int64   `gorm:"column:good_type_id" json:"good_type_id"`
1874
+	Number                    string  `gorm:"column:number" json:"number"`
1875
+	ProductDate               int64   `gorm:"column:product_date" json:"product_date"`
1876
+	ExpiryDate                int64   `gorm:"column:expiry_date" json:"expiry_date"`
1877
+	WarehousingCount          int64   `gorm:"column:warehousing_count" json:"warehousing_count"`
1878
+	WarehousingUnit           string  `gorm:"column:warehousing_unit" json:"warehousing_unit"`
1879
+	Price                     float64 `gorm:"column:price" json:"price"`
1880
+	TotalPrice                float64 `gorm:"column:total_price" json:"total_price"`
1881
+	Dealer                    int64   `gorm:"column:dealer" json:"dealer"`
1882
+	Manufacturer              int64   `gorm:"column:manufacturer" json:"manufacturer"`
1883
+	Remark                    string  `gorm:"column:remark" json:"remark"`
1884
+	Ctime                     int64   `gorm:"column:ctime" json:"ctime"`
1885
+	Mtime                     int64   `gorm:"column:mtime" json:"mtime"`
1886
+	Status                    int64   `gorm:"column:status" json:"status"`
1887
+	OrgId                     int64   `gorm:"column:org_id" json:"org_id"`
1888
+	IsReturn                  int64   `gorm:"column:is_return" json:"is_return"`
1889
+	StockCount                int64   `gorm:"column:stock_count" json:"stock_count" form:"stock_count"`
1890
+	WarehousingOrder          string  `gorm:"column:warehousing_order" json:"warehousing_order"`
1891
+	Type                      int64   `gorm:"column:type" json:"type"`
1892
+	LicenseNumber             string  `gorm:"column:license_number" json:"license_number" form:"license_number"`
1893
+	WarehouseInfoId           int64   `gorm:"column:warehouse_info_id" json:"warehouse_info_id" form:"warehouse_info_id"`
1894
+	PackingPrice              float64 `gorm:"column:packing_price" json:"packing_price" form:"packing_price"`
1895
+	SupplyWarehouseId         int64   `gorm:"column:supply_warehouse_id" json:"supply_warehouse_id" form:"supply_warehouse_id"`
1896
+	SupplyWarehouseDetailInfo int64   `gorm:"column:supply_warehouse_detail_info" json:"supply_warehouse_detail_info" form:"supply_warehouse_detail_info"`
1897
+	StorehouseId              int64   `gorm:"column:storehouse_id" json:"storehouse_id" form:"storehouse_id"`
1898
+	SecondWarehouseInfoId     int64   `gorm:"column:second_warehouse_info_id" json:"second_warehouse_info_id" form:"second_warehouse_info_id"`
1899
+	RegisterNumber            string  `gorm:"column:register_number" json:"register_number" form:"register_number"`
1900
+	GoodCode                  string  `gorm:"column:good_code" json:"good_code" form:"good_code"`
1901
+}
1902
+
1903
+func (PrintWarehousingInfo) TableName() string {
1904
+	return "xt_warehouse_info"
1905
+}

+ 7 - 0
service/schedule_service.go Wyświetl plik

@@ -244,6 +244,13 @@ func GetDialysisPrescriptionByRecord(orgID int64, patient_id int64, record_date
244 244
 	return prescription, err
245 245
 }
246 246
 
247
+func GetDialysisPrescriptionDoctorAdviceList(orgID int64, patient_id int64, record_date int64) (advices []*models.DoctorAdvices, err error) {
248
+
249
+	err = readDb.Where("user_org_id = ? and patient_id = ? and advice_date = ? and status=1", orgID, patient_id, record_date).Find(&advices).Error
250
+
251
+	return advices, err
252
+}
253
+
247 254
 func GetDayScheduleByOrder(orgID, start, bed_id int64, schedule_type int64) (schedule models.DialysisOrder, err error) {
248 255
 	err = readDb.Model(&models.DialysisOrder{}).Where("user_org_id=?  and dialysis_date=? and bed_id=? and status=1 AND schedual_type = ?", orgID, start, bed_id, schedule_type).First(&schedule).Error
249 256
 	return

+ 23 - 0
service/stock_service.go Wyświetl plik

@@ -11232,3 +11232,26 @@ func GetPatientAdviceListDetail(patient_id int64, start_time int64, end_time int
11232 11232
 
11233 11233
 	return advice, err
11234 11234
 }
11235
+
11236
+func GetGoodWarehosueInfoPrintList(good_id int64, start_time int64, end_time int64, user_org_id int64) (info []*models.PrintWarehousingInfo, err error) {
11237
+
11238
+	db := XTReadDB().Model(&info).Where("status=1")
11239
+
11240
+	if good_id > 0 {
11241
+		db = db.Where("good_id = ?", good_id)
11242
+	}
11243
+
11244
+	if start_time > 0 {
11245
+		db = db.Where("ctime>=?", start_time)
11246
+	}
11247
+	if end_time > 0 {
11248
+		db = db.Where("ctime<=?", end_time)
11249
+	}
11250
+	if user_org_id > 0 {
11251
+		db = db.Where("org_id = ?", user_org_id)
11252
+	}
11253
+
11254
+	err = db.Find(&info).Error
11255
+
11256
+	return info, err
11257
+}