Browse Source

耗材参数

XMLWAN 3 years ago
parent
commit
37e062814e

+ 1 - 1
conf/app.conf View File

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

+ 0 - 1
controllers/dialysis_api_controller.go View File

@@ -2717,7 +2717,6 @@ func (c *DialysisApiController) GetDialysisOrder() {
2717 2717
 			"project_config":            project_config,
2718 2718
 			"projects":                  projects,
2719 2719
 		})
2720
-
2721 2720
 	}
2722 2721
 
2723 2722
 }

+ 5 - 6
controllers/gobal_config_api_controller.go View File

@@ -2010,19 +2010,18 @@ func (c *GobalConfigApiController) GetDrugCountList() {
2010 2010
 	orgId := c.GetAdminUserInfo().CurrentOrgId
2011 2011
 	list, err := service.GetDrugCountList(startTime, endTime, orgId)
2012 2012
 	countList, err := service.GetMinCountList(startTime, endTime, orgId)
2013
-	//outCountList, _ := service.GetOutDrugCountList(startTime, endTime, orgId)
2014
-	//auCountList, err := service.GetAutoDrugCountList(startTime, endTime, orgId)
2013
+	outCountList, _ := service.GetOutDrugCountList(startTime, endTime, orgId)
2014
+	auCountList, err := service.GetAutoDrugCountList(startTime, endTime, orgId)
2015 2015
 	info, _ := service.GetDrugWarehouOrderInfo(startTime, endTime, orgId)
2016 2016
 	cancelCountList, _ := service.GetCancelDrugCountList(startTime, endTime, orgId)
2017
-	//service.GetAllCountList(startTime,endTime,orgId)
2018 2017
 	if err != nil {
2019 2018
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateConfig)
2020 2019
 		return
2021 2020
 	}
2022 2021
 	c.ServeSuccessJSON(map[string]interface{}{
2023
-		"countList": list,
2024
-		//"outCountList":    outCountList,
2025
-		//"auCountList":     auCountList,
2022
+		"countList":       list,
2023
+		"outCountList":    outCountList,
2024
+		"auCountList":     auCountList,
2026 2025
 		"minCount":        countList,
2027 2026
 		"info":            info,
2028 2027
 		"cancelCountList": cancelCountList,

+ 12 - 0
controllers/mobile_api_controllers/dialysis_api_controller.go View File

@@ -4987,3 +4987,15 @@ func ConsumablesDeliveryDeleteThree(orgID int64, record_time int64, good_yc *mod
4987 4987
 		return errors.New("退库和出库数据不匹配")
4988 4988
 	}
4989 4989
 }
4990
+
4991
+func (this *DialysisAPIController) GetMobileScheduleList() {
4992
+
4993
+	limit, _ := this.GetInt64("limit")
4994
+
4995
+	page, _ := this.GetInt64("page")
4996
+
4997
+	type_options_visible, _ := this.GetInt64("type_options_visible")
4998
+	sch_type_options_visible, _ := this.GetInt64("sch_type_options_visible")
4999
+	zone_options_visible, _ := this.GetInt64("zone_options_visible")
5000
+	fmt.Println(limit, page, type_options_visible, sch_type_options_visible, zone_options_visible)
5001
+}

+ 2 - 0
controllers/mobile_api_controllers/mobile_api_router_register.go View File

@@ -163,4 +163,6 @@ func MobileAPIControllersRegisterRouters() {
163 163
 
164 164
 	beego.Router("/m/api/updatestockgoods", &DialysisAPIController{}, "Get:UpdateStockGoods")
165 165
 
166
+	beego.Router("/m/api/getmobileschedulelist", &DialysisAPIController{}, "Get:GetMobileScheduleList")
167
+
166 168
 }

+ 1 - 1
service/dialysis_service.go View File

@@ -1230,6 +1230,6 @@ func SaveHisProject(advice *models.HisPrescriptionProject) (err error) {
1230 1230
 }
1231 1231
 
1232 1232
 func FindAllHisProjectById(orgID int64, patient_id int64, record_time int64) (advice []*models.HisPrescriptionProject, err error) {
1233
-	err = readDb.Model(&models.HisPrescriptionProject{}).Preload("HisProject", "status = 1").Where("user_org_id=? and status=1 and patient_id = ? AND record_date = ?", orgID, patient_id, record_time).Find(&advice).Error
1233
+	err = readDb.Model(&models.HisPrescriptionProject{}).Preload("HisProject", "status = 1").Preload("GoodInfo", "status = 1").Where("user_org_id=? and status=1 and patient_id = ? AND record_date = ?", orgID, patient_id, record_time).Find(&advice).Error
1234 1234
 	return
1235 1235
 }

+ 26 - 1
service/gobal_config_service.go View File

@@ -552,7 +552,32 @@ func GetAllBaseDurgListCount(page int64, limit int64, keyword string, drugcatego
552 552
 		db = db.Where("drug_name like ?", likeKey)
553 553
 	}
554 554
 
555
-	err = db.Count(&total).Offset(offset).Limit(limit).Order("ctime desc").Preload("DrugWarehouseInfo", "status=1 and org_id = ? and ctime >=? and ctime<=?", orgid, startime, endtime).Preload("DrugCancelStockInfo", "status=1 and org_id = ? and ctime >=? and ctime<=?", orgid, startime, endtime).Preload("DrugWarehouseOutInfo", "status=1 and org_id = ? and ctime >=? and ctime<=?", orgid, startime, endtime).Find(&drug).Error
555
+	err = db.Count(&total).Offset(offset).Limit(limit).Order("ctime desc").Preload("DrugWarehouseInfo", func(db *gorm.DB) *gorm.DB {
556
+		if startime > 0 {
557
+			db = db.Where("ctime>=?", startime)
558
+		}
559
+		if endtime > 0 {
560
+			db = db.Where("ctime<=?", endtime)
561
+		}
562
+		return db.Where("status = 1")
563
+	}).Preload("DrugCancelStockInfo", func(db *gorm.DB) *gorm.DB {
564
+		if startime > 0 {
565
+			db = db.Where("ctime>=?", startime)
566
+		}
567
+		if endtime > 0 {
568
+			db = db.Where("ctime<=?", endtime)
569
+		}
570
+		return db.Where("status = 1")
571
+	}).Preload("DrugWarehouseOutInfo", func(db *gorm.DB) *gorm.DB {
572
+		if startime > 0 {
573
+			db = db.Where("ctime>=?", startime)
574
+		}
575
+		if endtime > 0 {
576
+			db = db.Where("ctime<=?", endtime)
577
+		}
578
+		return db.Where("status = 1")
579
+	}).Find(&drug).Error
580
+
556 581
 	return drug, total, err
557 582
 }
558 583
 

+ 24 - 8
service/stock_service.go View File

@@ -3228,7 +3228,23 @@ func GetAllGoodInfoStockList(page int64, limit int64, startime int64, endtime in
3228 3228
 		db = db.Where("x.good_type_id = ?", good_type)
3229 3229
 	}
3230 3230
 
3231
-	err = db.Count(&total).Offset(offset).Limit(limit).Order("x.ctime desc").Preload("StWarehousingInfo", "status= 1 and org_id =? and ctime>=? and ctime<=?", orgid, startime, endtime).Preload("CancelStockInfo", "status= 1 and org_id =? and ctime>=? and ctime<=?", orgid, startime, endtime).Find(&info).Error
3231
+	err = db.Count(&total).Offset(offset).Limit(limit).Order("x.ctime desc").Preload("StWarehousingInfo", func(db *gorm.DB) *gorm.DB {
3232
+		if startime > 0 {
3233
+			db = db.Where("ctime>=?", startime)
3234
+		}
3235
+		if endtime > 0 {
3236
+			db = db.Where("ctime<=?", endtime)
3237
+		}
3238
+		return db.Where("status = 1")
3239
+	}).Preload("CancelStockInfo", func(db *gorm.DB) *gorm.DB {
3240
+		if startime > 0 {
3241
+			db = db.Where("ctime>=?", startime)
3242
+		}
3243
+		if endtime > 0 {
3244
+			db = db.Where("ctime<=?", endtime)
3245
+		}
3246
+		return db.Where("status = 1")
3247
+	}).Find(&info).Error
3232 3248
 	return info, total, err
3233 3249
 }
3234 3250
 
@@ -3324,14 +3340,14 @@ func GetOutStockTotalCountFour(startime int64, endtime int64, orgid int64) (auto
3324 3340
 	//} else {
3325 3341
 	//	err = XTReadDB().Raw("SELECT good_id,SUM(b.count) as count FROM (SELECT DISTINCT x.patient_id,x.good_id,x.count FROM xt_automatic_reduce_detail as x WHERE x.org_id = ? and `status` = 1)  as b GROUP BY good_id", orgid).Scan(&autoMatic).Error
3326 3342
 	//}
3327
-	//
3328
-	//if endtime > 0 {
3329
-	//	err = XTReadDB().Raw("SELECT good_id,SUM(b.count) as count FROM (SELECT DISTINCT x.patient_id,x.good_id,x.count FROM xt_automatic_reduce_detail as x WHERE x.org_id = ? and x.record_time <=?  and `status` = 1)  as b GROUP BY good_id", orgid, endtime).Scan(&autoMatic).Error
3330
-	//} else {
3331
-	//	err = XTReadDB().Raw("SELECT good_id,SUM(b.count) as count FROM (SELECT DISTINCT x.patient_id,x.good_id,x.count FROM xt_automatic_reduce_detail as x WHERE x.org_id = ? and `status` = 1)  as b GROUP BY good_id", orgid).Scan(&autoMatic).Error
3332
-	//}
3333 3343
 
3334
-	err = XTReadDB().Raw("SELECT good_id,SUM(b.count) as count FROM (SELECT DISTINCT x.patient_id,x.good_id,x.record_time,x.count FROM xt_automatic_reduce_detail as x WHERE x.org_id = ? and x.record_time >= ? and x.record_time<=? and `status` = 1)  as b GROUP BY good_id", orgid, startime, endtime).Scan(&autoMatic).Error
3344
+	if startime > 0 || endtime > 0 {
3345
+		err = XTReadDB().Raw("SELECT good_id,SUM(b.count) as count FROM (SELECT DISTINCT x.patient_id,x.good_id,x.count FROM xt_automatic_reduce_detail as x WHERE x.org_id = ? and x.record_time >= ? and x.record_time <=?  and `status` = 1)  as b GROUP BY good_id", orgid, startime, endtime).Scan(&autoMatic).Error
3346
+	} else {
3347
+		err = XTReadDB().Raw("SELECT good_id,SUM(b.count) as count FROM (SELECT DISTINCT x.patient_id,x.good_id,x.count FROM xt_automatic_reduce_detail as x WHERE x.org_id = ? and `status` = 1)  as b GROUP BY good_id", orgid).Scan(&autoMatic).Error
3348
+	}
3349
+
3350
+	//err = XTReadDB().Raw("SELECT good_id,SUM(b.count) as count FROM (SELECT DISTINCT x.patient_id,x.good_id,x.record_time,x.count FROM xt_automatic_reduce_detail as x WHERE x.org_id = ? and x.record_time >= ? and x.record_time<=? and `status` = 1)  as b GROUP BY good_id", orgid, startime, endtime).Scan(&autoMatic).Error
3335 3351
 
3336 3352
 	return autoMatic, err
3337 3353