Browse Source

提交代码

陈少旭 1 week ago
parent
commit
675c0eb695
3 changed files with 34 additions and 5 deletions
  1. 14 5
      controllers/pharmacy_controller.go
  2. 13 0
      models/stock_models.go
  3. 7 0
      service/stock_service.go

+ 14 - 5
controllers/pharmacy_controller.go View File

189
 	fmt.Println(partition)
189
 	fmt.Println(partition)
190
 	w_his_advice_patient, _ := service.GetWaitPharmacyHISAdvicePatient(partition, shift, stime, orgid, keyword, is_medicine)
190
 	w_his_advice_patient, _ := service.GetWaitPharmacyHISAdvicePatient(partition, shift, stime, orgid, keyword, is_medicine)
191
 	w_xt_advice_patient, _ := service.GetWaitPharmacyXTPatient(partition, shift, stime, orgid, keyword, is_medicine)
191
 	w_xt_advice_patient, _ := service.GetWaitPharmacyXTPatient(partition, shift, stime, orgid, keyword, is_medicine)
192
-	w_his_goods_patient, _ := service.GetWaitPharmacyHISGoodsPatient(partition, shift, stime, orgid, keyword, is_medicine)
193
 	var patients []*models.PharmacyPatients
192
 	var patients []*models.PharmacyPatients
194
 	patients = append(patients, w_his_advice_patient...)
193
 	patients = append(patients, w_his_advice_patient...)
195
 	patients = append(patients, w_xt_advice_patient...)
194
 	patients = append(patients, w_xt_advice_patient...)
196
-	patients = append(patients, w_his_goods_patient...)
195
+
196
+	//good_info,_ := service.GetGoodCodeOpen(orgid)
197
+	good_info, _ := service.GetGoodCodeOpen(orgid)
198
+	if good_info.IsOpen == 1 {
199
+		w_his_goods_patient, _ := service.GetWaitPharmacyHISGoodsPatient(partition, shift, stime, orgid, keyword, is_medicine)
200
+		patients = append(patients, w_his_goods_patient...)
201
+	}
197
 	patients = RemoveRepeatedPurviewElement(patients)
202
 	patients = RemoveRepeatedPurviewElement(patients)
198
 
203
 
199
 	this.ServeSuccessJSON(map[string]interface{}{
204
 	this.ServeSuccessJSON(map[string]interface{}{
273
 	is_medicine := 0
278
 	is_medicine := 0
274
 	w_his_advice_patient, _ := service.GetWaitPharmacyHISAdvicePatient(partition, shift, stime, orgid, keyword, is_medicine)
279
 	w_his_advice_patient, _ := service.GetWaitPharmacyHISAdvicePatient(partition, shift, stime, orgid, keyword, is_medicine)
275
 	w_xt_advice_patient, _ := service.GetWaitPharmacyXTPatient(partition, shift, stime, orgid, keyword, is_medicine)
280
 	w_xt_advice_patient, _ := service.GetWaitPharmacyXTPatient(partition, shift, stime, orgid, keyword, is_medicine)
276
-	w_his_goods_patient, _ := service.GetWaitPharmacyHISGoodsPatient(partition, shift, stime, orgid, keyword, is_medicine)
281
+
277
 	var patients []*models.PharmacyPatients
282
 	var patients []*models.PharmacyPatients
278
 	patients = append(patients, w_his_advice_patient...)
283
 	patients = append(patients, w_his_advice_patient...)
279
 	patients = append(patients, w_xt_advice_patient...)
284
 	patients = append(patients, w_xt_advice_patient...)
280
-	patients = append(patients, w_his_goods_patient...)
285
+
286
+	good_info, _ := service.GetGoodCodeOpen(orgid)
287
+	if good_info.IsOpen == 1 {
288
+		w_his_goods_patient, _ := service.GetWaitPharmacyHISGoodsPatient(partition, shift, stime, orgid, keyword, is_medicine)
289
+		patients = append(patients, w_his_goods_patient...)
290
+	}
281
 	patients = RemoveRepeatedPurviewElement(patients)
291
 	patients = RemoveRepeatedPurviewElement(patients)
282
 
292
 
283
 	this.ServeSuccessJSON(map[string]interface{}{
293
 	this.ServeSuccessJSON(map[string]interface{}{
1416
 	orgId := this.GetAdminUserInfo().CurrentOrgId
1426
 	orgId := this.GetAdminUserInfo().CurrentOrgId
1417
 	data_source, _ := this.GetInt64("data_source")
1427
 	data_source, _ := this.GetInt64("data_source")
1418
 	drug_code := this.GetString("drug_code")
1428
 	drug_code := this.GetString("drug_code")
1419
-	//item_type := this.GetString("type")
1420
 
1429
 
1421
 	str := strings.Replace(drug_code, " ", "", -1)
1430
 	str := strings.Replace(drug_code, " ", "", -1)
1422
 	// 去除换行符
1431
 	// 去除换行符

+ 13 - 0
models/stock_models.go View File

1867
 	return "xt_drug_code_open"
1867
 	return "xt_drug_code_open"
1868
 }
1868
 }
1869
 
1869
 
1870
+type XtGoodCodeOpen struct {
1871
+	ID        int64 `gorm:"column:id" json:"id" form:"id"`
1872
+	UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1873
+	IsOpen    int64 `gorm:"column:is_open" json:"is_open" form:"is_open"`
1874
+	Status    int64 `gorm:"column:status" json:"status" form:"status"`
1875
+	Ctime     int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
1876
+	Mtime     int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
1877
+}
1878
+
1879
+func (XtGoodCodeOpen) TableName() string {
1880
+	return "xt_good_code_open"
1881
+}
1882
+
1870
 type PrintWarehousingInfo struct {
1883
 type PrintWarehousingInfo struct {
1871
 	ID                        int64   `gorm:"column:id" json:"id"`
1884
 	ID                        int64   `gorm:"column:id" json:"id"`
1872
 	WarehousingId             int64   `gorm:"column:warehousing_id" json:"warehousing_id"`
1885
 	WarehousingId             int64   `gorm:"column:warehousing_id" json:"warehousing_id"`

+ 7 - 0
service/stock_service.go View File

11007
 	return drugCodeOpen, err
11007
 	return drugCodeOpen, err
11008
 }
11008
 }
11009
 
11009
 
11010
+func GetGoodCodeOpen(user_org_id int64) (models.XtGoodCodeOpen, error) {
11011
+
11012
+	drugCodeOpen := models.XtGoodCodeOpen{}
11013
+	err := XTReadDB().Where("user_org_id = ? and status=1", user_org_id).Find(&drugCodeOpen).Error
11014
+	return drugCodeOpen, err
11015
+}
11016
+
11010
 func CreateDrugOpen(open models.XtDrugCodeOpen) error {
11017
 func CreateDrugOpen(open models.XtDrugCodeOpen) error {
11011
 
11018
 
11012
 	err := XTWriteDB().Create(&open).Error
11019
 	err := XTWriteDB().Create(&open).Error