ソースを参照

Merge remote-tracking branch 'origin/20230223_xt_api_new_branch' into 20230223_xt_api_new_branch

28169 1 年間 前
コミット
64177b9fd3

+ 6 - 6
controllers/base_api_controller.go ファイルの表示

@@ -82,7 +82,7 @@ func (this *BaseAuthAPIController) Prepare() {
82 82
 		userAdmin.ModifyTime = 1530786071
83 83
 		var subscibe models.ServeSubscibe
84 84
 		subscibe.ID = 11
85
-		subscibe.OrgId = 10440 //机构id
85
+		subscibe.OrgId = 9671 //机构id
86 86
 		subscibe.PeriodStart = 1547447814
87 87
 		subscibe.PeriodEnd = 1550039814
88 88
 		subscibe.State = 1
@@ -92,8 +92,8 @@ func (this *BaseAuthAPIController) Prepare() {
92 92
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
93 93
 		subscibes[4] = &subscibe
94 94
 		var adminUserInfo service.AdminUserInfo
95
-		adminUserInfo.CurrentOrgId = 10440 //机构id小英9675或4
96
-		adminUserInfo.CurrentAppId = 15388 //4
95
+		adminUserInfo.CurrentOrgId = 9671  //机构id小英9675或4
96
+		adminUserInfo.CurrentAppId = 15487 //4
97 97
 		adminUserInfo.AdminUser = &userAdmin
98 98
 		adminUserInfo.Subscibes = subscibes
99 99
 		this.SetSession("admin_user_info", &adminUserInfo)
@@ -328,7 +328,7 @@ func (this *BaseServeAPIController) Prepare() {
328 328
 		userAdmin.ModifyTime = 1530786071
329 329
 		var subscibe models.ServeSubscibe
330 330
 		subscibe.ID = 11
331
-		subscibe.OrgId = 10440 //机构id小英9675或4
331
+		subscibe.OrgId = 9671 //机构id小英9675或4
332 332
 		subscibe.PeriodStart = 1538035409
333 333
 		subscibe.PeriodEnd = 1569571409
334 334
 		subscibe.State = 1
@@ -338,8 +338,8 @@ func (this *BaseServeAPIController) Prepare() {
338 338
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
339 339
 		subscibes[4] = &subscibe
340 340
 		var adminUserInfo service.AdminUserInfo
341
-		adminUserInfo.CurrentOrgId = 10440 //机构id小英9675或4
342
-		adminUserInfo.CurrentAppId = 15388 //4
341
+		adminUserInfo.CurrentOrgId = 9671  //机构id小英9675或4
342
+		adminUserInfo.CurrentAppId = 15487 //4
343 343
 		adminUserInfo.AdminUser = &userAdmin
344 344
 		adminUserInfo.Subscibes = subscibes
345 345
 		this.SetSession("admin_user_info", &adminUserInfo)

+ 1 - 1
controllers/dialysis_api_controller.go ファイルの表示

@@ -3441,7 +3441,7 @@ func (c *DialysisApiController) GetDialysisOrder() {
3441 3441
 
3442 3442
 	//透析单
3443 3443
 	dialysisOrder, _ := service.MobileGetSchedualDialysisRecordTen(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
3444
-	fmt.Println("dialysisOrder----------------", dialysisOrder)
3444
+
3445 3445
 	if dialysisOrder != nil {
3446 3446
 		if dialysisOrder.FinishNurse > 0 {
3447 3447
 			operatorIDs = append(operatorIDs, dialysisOrder.FinishNurse)

+ 11 - 0
controllers/his_api_controller.go ファイルの表示

@@ -6205,6 +6205,12 @@ func (c *HisApiController) GetUploadInfo() {
6205 6205
 	pay_way, _ := c.GetInt64("pay_way")
6206 6206
 	pay_ways := c.GetString("pay_ways")
6207 6207
 
6208
+	cash_pay := c.GetString("cash_pay")
6209
+	band_card_pay := c.GetString("band_card_pay")
6210
+	wechat_pay := c.GetString("wechat_pay")
6211
+	ali_pay := c.GetString("ali_pay")
6212
+	jifen_pay := c.GetString("jifen_pay")
6213
+
6208 6214
 	pay_price, _ := c.GetFloat("pay_price")
6209 6215
 	pay_card_no := c.GetString("pay_card_no")
6210 6216
 	discount_price, _ := c.GetFloat("discount_price")
@@ -6529,6 +6535,11 @@ func (c *HisApiController) GetUploadInfo() {
6529 6535
 			SetlTime:              tm.Format("2006-01-02 15:04:05"),
6530 6536
 			Decimal:               decimal,
6531 6537
 			OthDesc:               oth_desc,
6538
+			CashPay:               cash_pay,
6539
+			WechatPay:             wechat_pay,
6540
+			AliPay:                ali_pay,
6541
+			JifenPay:              jifen_pay,
6542
+			BandCardPay:           band_card_pay,
6532 6543
 		}
6533 6544
 		err = service.CreateOrderTX(order, tx)
6534 6545
 		if err != nil {

+ 7 - 0
models/his_charge_models.go ファイルの表示

@@ -172,6 +172,13 @@ type HisChargeSettleOrder struct {
172 172
 	SettleStartTime     int64   `gorm:"column:settle_start_time" json:"settle_start_time" form:"settle_start_time"`
173 173
 	SettleEndTime       int64   `gorm:"column:settle_end_time" json:"settle_end_time" form:"settle_end_time"`
174 174
 	IsPre               int64   `gorm:"column:is_pre" json:"is_pre" form:"is_pre"`
175
+
176
+	CashPay     string `gorm:"cash_pay" json:"cash_pay" form:"cash_pay"`
177
+	BandCardPay string `gorm:"band_card_pay" json:"band_card_pay" form:"band_card_pay"`
178
+	WechatPay   string `gorm:"wechat_pay" json:"wechat_pay" form:"wechat_pay"`
179
+	AliPay      string `gorm:"ali_pay" json:"ali_pay" form:"ali_pay"`
180
+	JifenPay    string `gorm:"jifen_pay" json:"jifen_pay" form:"jifen_pay"`
181
+	OthDesc     string `gorm:"oth_desc" json:"oth_desc" form:"oth_desc"`
175 182
 }
176 183
 
177 184
 func (HisChargeSettleOrder) TableName() string {

+ 6 - 0
models/his_models.go ファイルの表示

@@ -1044,6 +1044,12 @@ type HisOrder struct {
1044 1044
 	OthDesc               string  `gorm:"oth_desc" json:"oth_desc" form:"oth_desc"`
1045 1045
 	PayWays               string  `gorm:"pay_ways" json:"pay_ways" form:"pay_ways"`
1046 1046
 
1047
+	CashPay     string `gorm:"cash_pay" json:"cash_pay" form:"cash_pay"`
1048
+	BandCardPay string `gorm:"band_card_pay" json:"band_card_pay" form:"band_card_pay"`
1049
+	WechatPay   string `gorm:"wechat_pay" json:"wechat_pay" form:"wechat_pay"`
1050
+	AliPay      string `gorm:"ali_pay" json:"ali_pay" form:"ali_pay"`
1051
+	JifenPay    string `gorm:"jifen_pay" json:"jifen_pay" form:"jifen_pay"`
1052
+
1047 1053
 	FaPiaoCode   string `gorm:"column:fa_piao_code" json:"fa_piao_code" form:"fa_piao_code"`
1048 1054
 	FaPiaoNumber string `gorm:"column:fa_piao_number" json:"fa_piao_number" form:"fa_piao_number"`
1049 1055
 

+ 1 - 1
service/dialysis_service.go ファイルの表示

@@ -872,7 +872,7 @@ func GetAdminUserES(orgID int64, appID int64, ids []int64) (es []*models.AdminUs
872 872
 //}
873 873
 
874 874
 func GetAdminUserEsOne(orgid int64) (admin []*models.UserAdminRoles, err error) {
875
-	db := readUserDb.Table("sgj_user_admin_role as x").Where("x.status =1")
875
+	db := readUserDb.Table("sgj_user_admin_role as x")
876 876
 	table := readUserDb.Table("sgj_user_admin_electronic_signature as s")
877 877
 	fmt.Println("table", table)
878 878
 	err = db.Select("x.id,x.admin_user_id,x.user_name,x.org_id,s.creator,s.url,s.hash").Joins("left join sgj_user_admin_electronic_signature as s on s.creator = x.admin_user_id").Where("x.org_id = ?", orgid).Scan(&admin).Error

+ 1 - 1
service/manage_service.go ファイルの表示

@@ -1036,7 +1036,7 @@ func GetTimeData(equitid int64, orgid int64, timenow int64) (information []*mode
1036 1036
 	//db := UserReadDB().Table("xt_device_information as x").Where("x.status = 1")
1037 1037
 	//err = db.Raw("select id,date,class,zone,bed_number,patient_id,contagion,dialysis_mode,start_time,end_time,dialysis_hour,hyperfiltratio,weight_loss,warning_value,user_total,move,failure_stage,fault_description,code_information,disinfect_type,disinfectant_type,disinfection,machine_run,fluid_path,disinfectant,disinfection_status,disinfection_residue,long_time,disinfec_startime,disinfec_endtime,dialysis_checked,dialysis_name,norms,dialysis_concentration,germ_checked,germ_name,germ_number,clean,sign_name,status,ctime,mtime,user_org_id,equiment_id,bed,stime from xt_device_information where DATE_SUB(CURDATE(), INTERVAL 30 DAY) <= ? and equiment_id = ? and user_org_id = ?",timenow,equitid, orgid).Error
1038 1038
 	day := time.Now().Day()
1039
-	oldMonth := day - 30
1039
+	oldMonth := day - 90
1040 1040
 	t := time.Date(time.Now().Year(), time.Now().Month(), oldMonth, time.Now().Hour(), time.Now().Minute(), time.Now().Second(), time.Now().Nanosecond(), time.Local)
1041 1041
 
1042 1042
 	err = UserReadDB().Model(&information).Where("date>= ? and date <= ? and equiment_id = ? and user_org_id = ? and dialysis_checked = 1 ", t.Unix(), timenow, equitid, orgid).Find(&information).Error

+ 9 - 6
service/pharmacy_service.go ファイルの表示

@@ -679,12 +679,15 @@ func DispensingMedicine(orgid, patient_id, stime, etime, creater int64) (err err
679 679
 			if PettyCash(v.DrugId) {
680 680
 				continue
681 681
 			}
682
-			////判断药品库存是否充足
683
-			kou := FenDrugInventory(v, orgid)
684
-			if !kou {
685
-				err = fmt.Errorf(FindDrugsName(v.DrugId) + "库存不足")
686
-				return
682
+			if orgid != 10217 && orgid != 10188 && orgid != 9671 && orgid != 10164 && orgid != 10387 {
683
+				////判断药品库存是否充足
684
+				kou := FenDrugInventory(v, orgid)
685
+				if !kou {
686
+					err = fmt.Errorf(FindDrugsName(v.DrugId) + "库存不足")
687
+					return
688
+				}
687 689
 			}
690
+
688 691
 			//扣减库存
689 692
 			err = FenStock(orgid, creater, v)
690 693
 			if err != nil {
@@ -2000,7 +2003,7 @@ func GetAllValidDeviceZones02(orgID int64) ([]*models.DeviceZone, error) {
2000 2003
 
2001 2004
 func FindeHisAdviceDocAdvice(orgid int64, patient_id int64, stime int64, etime int64) (advice []*models.HisDoctorAdviceInfo, err error) {
2002 2005
 
2003
-	db := XTReadDB().Model(&advice).Where("status= 1")
2006
+	db := XTReadDB().Model(&advice).Where("status= 1 and is_medicine = 0")
2004 2007
 
2005 2008
 	if orgid > 0 {
2006 2009
 		db = db.Where("user_org_id = ?", orgid)

+ 2 - 2
service/print_data_service/schedule_dialysis/print_schedule_dialysis_service.go ファイルの表示

@@ -107,13 +107,13 @@ type AdminUserListTwo struct {
107 107
 
108 108
 func GetAllAdminUsers(orgId int64, appid int64) (list []*AdminUserList, err error) {
109 109
 	db := p_service.UserReadDB()
110
-	err = db.Table("sgj_user_admin_role as uar").Joins("JOIN sgj_user_admin as ua ON ua.id = uar.admin_user_id").Where("uar.status=1 and uar.org_id=? and uar.app_id =? and ua.status=1", orgId, appid).Select("ua.id, uar.user_name as name, uar.user_type").Scan(&list).Error
110
+	err = db.Table("sgj_user_admin_role as uar").Joins("JOIN sgj_user_admin as ua ON ua.id = uar.admin_user_id").Where("uar.org_id=? and uar.app_id =? and ua.status=1", orgId, appid).Select("ua.id, uar.user_name as name, uar.user_type").Scan(&list).Error
111 111
 	return
112 112
 }
113 113
 
114 114
 func GetAllName(orgId int64, appid int64) (list []AdminUserListTwo, err error) {
115 115
 	db := p_service.UserReadDB()
116
-	err = db.Table("sgj_user_admin_role as uar").Joins("left join sgj_user_admin as ua on ua.id = uar.admin_user_id").Joins("left join sgj_user_admin_electronic_signature  as e on e.creator = uar.admin_user_id").Where("uar.status=1 and uar.org_id=? and uar.app_id =? and ua.status=1 and e.status = 1 and e.org_id = ? and e.app_id = ?", orgId, appid, orgId, appid).Select("ua.id, uar.user_name as name, uar.user_type,e.url").Scan(&list).Error
116
+	err = db.Table("sgj_user_admin_role as uar").Joins("left join sgj_user_admin as ua on ua.id = uar.admin_user_id").Joins("left join sgj_user_admin_electronic_signature  as e on e.creator = uar.admin_user_id").Where("uar.org_id=? and uar.app_id =? and ua.status=1 and e.status = 1 and e.org_id = ? and e.app_id = ?", orgId, appid, orgId, appid).Select("ua.id, uar.user_name as name, uar.user_type,e.url").Scan(&list).Error
117 117
 	return
118 118
 }
119 119
 

+ 4 - 3
service/stock_service.go ファイルの表示

@@ -1161,7 +1161,7 @@ func FindWarehousingInfoByIdOne(id []int64) (list []*models.WarehousingInfo, err
1161 1161
 }
1162 1162
 
1163 1163
 func FindDrugWarehousingInfoById(id int64, org_id int64) (list []*VMDrugWarehouseInfo, err error) {
1164
-	err = readDb.Model(&VMDrugWarehouseInfo{}).Preload("Drug", "status = 1 AND org_id = ? AND find_in_set('停用',drug_status) = 0", org_id).Where("warehousing_id = ? AND status = 1", id).Find(&list).Error
1164
+	err = readDb.Model(&VMDrugWarehouseInfo{}).Preload("Drug", "status = 1 AND org_id = ? AND find_in_set('',drug_status) = 0", org_id).Where("warehousing_id = ? AND status = 1", id).Find(&list).Error
1165 1165
 	return list, err
1166 1166
 }
1167 1167
 
@@ -3772,7 +3772,7 @@ func GetWarehouseOrderInfoList(orgid int64) (list []*models.WarehousingInfo, err
3772 3772
 
3773 3773
 func GetSearchDrugList(keywords string, orgid int64) (drug []*models.BaseDrugLib, err error) {
3774 3774
 
3775
-	db := XTReadDB().Model(&drug).Where("org_id=? and status=1  and drug_status<>'停用'", orgid)
3775
+	db := XTReadDB().Model(&drug).Where("org_id=? and status=1 and find_in_set('停用',drug_status) = 0", orgid)
3776 3776
 	if len(keywords) > 0 {
3777 3777
 		likekey := "%" + keywords + "%"
3778 3778
 		err = db.Where("(drug_name LIKE ?)", likekey).Preload("DrugWarehouseInfo", func(db *gorm.DB) *gorm.DB {
@@ -3788,7 +3788,8 @@ func GetSearchDrugList(keywords string, orgid int64) (drug []*models.BaseDrugLib
3788 3788
 
3789 3789
 func GetSearchDrugListSix(keywords string, orgid int64, storehouse_id int64) (drug []*models.BaseDrugLib, err error) {
3790 3790
 
3791
-	db := XTReadDB().Model(&drug).Where("org_id=? and status=1  AND find_in_set('停用',x.drug_status) = 0'", orgid)
3791
+	db := XTReadDB().Model(&drug).Where("org_id=? and status=1 and find_in_set('停用',drug_status) = 0", orgid)
3792
+
3792 3793
 	if len(keywords) > 0 {
3793 3794
 		likekey := "%" + keywords + "%"
3794 3795
 		err = db.Where("(drug_name LIKE ?)", likekey).Preload("DrugWarehouseInfo", func(db *gorm.DB) *gorm.DB {