Browse Source

历史排班

28169 10 months ago
parent
commit
8fc53f3ebf

+ 8 - 9
controllers/his_api_controller.go View File

@@ -1,15 +1,8 @@
1 1
 package controllers
2 2
 
3 3
 import (
4
-	"XT_New/enums"
5
-	"XT_New/models"
6
-	"XT_New/service"
7
-	"XT_New/utils"
8 4
 	"encoding/json"
9 5
 	"fmt"
10
-	"github.com/astaxie/beego"
11
-	"github.com/jinzhu/gorm"
12
-	"github.com/shopspring/decimal"
13 6
 	"math/rand"
14 7
 	"reflect"
15 8
 	"strconv"
@@ -17,6 +10,14 @@ import (
17 10
 	"syscall"
18 11
 	"time"
19 12
 	"unsafe"
13
+
14
+	"XT_New/enums"
15
+	"XT_New/models"
16
+	"XT_New/service"
17
+	"XT_New/utils"
18
+	"github.com/astaxie/beego"
19
+	"github.com/jinzhu/gorm"
20
+	"github.com/shopspring/decimal"
20 21
 )
21 22
 
22 23
 type HisApiController struct {
@@ -3633,8 +3634,6 @@ func (c *HisApiController) CreateHisPrescription() {
3633 3634
 												for _, item := range flowGood {
3634 3635
 													out_count += item.Count
3635 3636
 												}
3636
-												fmt.Println("out_count_five+=====================", out_count)
3637
-												fmt.Println("pareIntCount============================", parseIntCount)
3638 3637
 												//如果历史数和当前数据不想等才进行退库出库
3639 3638
 												if out_count != parseIntCount {
3640 3639
 													service.ConsumableNewPrescriptionDelivery(adminInfo.CurrentOrgId, p.PatientId, p.RecordDate, &dialyPrepareOne, &lastOut, creater, parseIntCount, tx)

+ 24 - 24
controllers/mobile_api_controllers/dialysis_api_controller.go View File

@@ -866,30 +866,30 @@ func (c *DialysisAPIController) PostDoubleCheck() {
866 866
 		firstCheckDate = firstCheckDateUnix.Unix()
867 867
 	}
868 868
 
869
-	//if adminUserInfo.Org.Id == 10340 {
870
-	//
871
-	//	list, _ := service.GetRoleList(adminUserInfo.Org.Id, modifier)
872
-	//	_, check := service.FindDoubleCheckByReordDate(id, recordDate.Unix(), adminUserInfo.Org.Id)
873
-	//	if check.ID == 0 {
874
-	//		if employee_number != list.JobNumber {
875
-	//			c.ServeSuccessJSON(map[string]interface{}{
876
-	//				"doubleCheck": check,
877
-	//				"msg":         "2",
878
-	//			})
879
-	//			return
880
-	//		}
881
-	//	}
882
-	//	if check.ID > 0 {
883
-	//		if employee_number != list.JobNumber {
884
-	//			c.ServeSuccessJSON(map[string]interface{}{
885
-	//				"doubleCheck": check,
886
-	//				"msg":         "2",
887
-	//			})
888
-	//			return
889
-	//		}
890
-	//	}
891
-	//
892
-	//}
869
+	if adminUserInfo.Org.Id == 10644 {
870
+
871
+		list, _ := service.GetRoleList(adminUserInfo.Org.Id, modifier)
872
+		_, check := service.FindDoubleCheckByReordDate(id, recordDate.Unix(), adminUserInfo.Org.Id)
873
+		if check.ID == 0 {
874
+			if employee_number != list.JobNumber {
875
+				c.ServeSuccessJSON(map[string]interface{}{
876
+					"doubleCheck": check,
877
+					"msg":         "2",
878
+				})
879
+				return
880
+			}
881
+		}
882
+		if check.ID > 0 {
883
+			if employee_number != list.JobNumber {
884
+				c.ServeSuccessJSON(map[string]interface{}{
885
+					"doubleCheck": check,
886
+					"msg":         "2",
887
+				})
888
+				return
889
+			}
890
+		}
891
+
892
+	}
893 893
 
894 894
 	doubleCheck := models.DoubleCheck{
895 895
 		UserOrgId:                  adminUserInfo.Org.Id,

+ 11 - 4
service/self_drug_service.go View File

@@ -1,10 +1,11 @@
1 1
 package service
2 2
 
3 3
 import (
4
-	"XT_New/models"
5 4
 	"fmt"
6
-	"github.com/jinzhu/gorm"
7 5
 	"time"
6
+
7
+	"XT_New/models"
8
+	"github.com/jinzhu/gorm"
8 9
 )
9 10
 
10 11
 func GetCurrentPatient(orgid int64) (patients []*models.DrugPatients, err error) {
@@ -2974,8 +2975,14 @@ func ModifyDrugFlowById(id int64, over_count int64) error {
2974 2975
 
2975 2976
 func GetDrugInventoryWarehouseInfoList(org_id int64, storehouse_id int64) (info []*models.XtDrugWarehouseInfo, err error) {
2976 2977
 
2977
-	err = XTReadDB().Model(&info).Where("status = 1 and storehouse_id = ? and is_check = 1 and org_id = ? and (stock_max_number >0 or stock_min_number >0)", storehouse_id, org_id).Preload("XtBaseDrug", "status= 1").Order("drug_id").Find(&info).Error
2978
-	return info, err
2978
+	if org_id == 10138 || org_id == 10278 {
2979
+		err = XTReadDB().Model(&info).Where("status = 1 and storehouse_id = ? and is_check = 1 and org_id = ?", storehouse_id, org_id).Preload("XtBaseDrug", "status= 1").Order("drug_id").Find(&info).Error
2980
+		return info, err
2981
+	} else {
2982
+		err = XTReadDB().Model(&info).Where("status = 1 and storehouse_id = ? and is_check = 1 and org_id = ? and (stock_max_number >0 or stock_min_number >0)", storehouse_id, org_id).Preload("XtBaseDrug", "status= 1").Order("drug_id").Find(&info).Error
2983
+		return info, err
2984
+	}
2985
+
2979 2986
 }
2980 2987
 
2981 2988
 func GetGoodStockCountList(user_org_id int64, good_id int64) (stock []*models.XtGoodStockCount, err error) {

+ 2 - 2
service/stock_service.go View File

@@ -6287,7 +6287,7 @@ func GetStockDamagedList(orgid int64, keyword string, page int64, limit int64, s
6287 6287
 		db = db.Where("x.storehouse_id = ?", storehouse_id)
6288 6288
 	}
6289 6289
 
6290
-	err = db.Group("x.id").Select("x.ctime,x.id,x.good_name,x.specification_name,x.warehousing_unit,x.count,x.buy_price,x.packing_price,x.new_price,x.manufacturer,x.dealer,x.remark,x.good_id,x.warehousing_order,x.license_number,x.start_time,x.creater,x.checker,x.checker_status,x.checker_time,x.total,x.number,x.storehouse_id,t.packing_unit,r.user_name").Joins("left join sgj_users.sgj_user_admin_role as r on r.admin_user_id = x.creater").Joins("left join xt_good_information as t on t.id =x.good_id").Count(&total).Offset(offset).Limit(limit).Scan(&adjust).Error
6290
+	err = db.Group("x.good_id").Select("x.ctime,x.id,x.good_name,x.specification_name,x.warehousing_unit,x.count,x.buy_price,x.packing_price,x.new_price,x.manufacturer,x.dealer,x.remark,x.good_id,x.warehousing_order,x.license_number,x.start_time,x.creater,x.checker,x.checker_status,x.checker_time,x.total,x.number,x.storehouse_id,t.packing_unit,r.user_name").Joins("left join sgj_users.sgj_user_admin_role as r on r.admin_user_id = x.creater").Joins("left join xt_good_information as t on t.id =x.good_id").Count(&total).Offset(offset).Limit(limit).Scan(&adjust).Error
6291 6291
 	return adjust, total, err
6292 6292
 
6293 6293
 }
@@ -8615,7 +8615,7 @@ func ReduceGoodSumOutCount(storehouse_id int64, good_id int64, user_org_id int64
8615 8615
 
8616 8616
 func GetInvetoryWarehouseInfoList(orgid int64, storehouse_id int64) (info []*models.WarehousingInfo, err error) {
8617 8617
 
8618
-	if orgid == 10191 {
8618
+	if orgid == 10191 || orgid == 10138 || orgid == 10278 {
8619 8619
 		err = XTReadDB().Model(&info).Where("status = 1 and storehouse_id=? and is_check= 1 and org_id = ?", storehouse_id, orgid).Preload("GoodInfo", "status = 1").Order("good_id").Find(&info).Error
8620 8620
 		return info, err
8621 8621
 	} else {