Browse Source

Merge branch 'master' of http://git.shengws.com/csx/gdyb

csx 3 years ago
parent
commit
80756b82bc
3 changed files with 31 additions and 24 deletions
  1. 3 3
      conf/app.conf
  2. 18 21
      controllers/sg/his_api_controller.go
  3. 10 0
      service/his_service.go

+ 3 - 3
conf/app.conf View File

@@ -45,7 +45,7 @@ appsecret="61ee2e6268497d5aa9de0b0187c39aea"
45 45
 
46 46
 
47 47
 [prod]
48
-org_id = 10188
48
+org_id = 10215
49 49
 mobile_token_expiration_second = 86400
50 50
 httpdomain = https://api.xt.kuyicloud.com
51 51
 sso_domain = https://sso.kuyicloud.com
@@ -53,7 +53,7 @@ call_domain = https://hf.sgjyun.com
53 53
 front_end_domain = "https://xt.kuyicloud.com/#"
54 54
 #url  = "http://192.168.1.228:17001/szsi-portal/transData"
55 55
 #url = "http://192.168.1.88:6666/szsi-portal/transData"
56
-# gdyb_url = "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/"
56
+gdyb_url = "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/"
57 57
 # gdyb_url="http://igb.hsa.gdgov.cn/ebus/sz_prd/hsa/hgs/"
58 58
 #内蒙古
59 59
 # gdyb_url = "http://10.38.23.105:8090/uif-hsaf-med-api/api/medical/service/"
@@ -61,7 +61,7 @@ front_end_domain = "https://xt.kuyicloud.com/#"
61 61
 # gdyb_paasid = "jm_sc_yjyy"
62 62
 # gdyb_paasid="zh_prd_yrojyy"
63 63
 # gdyb_paasid = "sz_prd_yjyy"
64
-# gdyb_paasid = "zq_prd_yjyy"
64
+gdyb_paasid = "zq_prd_yjyy"
65 65
 
66 66
 
67 67
 

+ 18 - 21
controllers/sg/his_api_controller.go View File

@@ -670,6 +670,10 @@ func (c *HisApiController) GetSettleList() {
670 670
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHisOrderNoExistParamWrong)
671 671
 		return
672 672
 	}
673
+	last_order, _ := service.GetLastHisOrderTwo(c.GetAdminUserInfo().CurrentOrgId)
674
+	count, _ := strconv.ParseInt(last_order.FaPiaoNumber, 10, 64)
675
+	new_fapiao_number := strconv.FormatInt(count, 10)
676
+
673 677
 	struct4101 := service.Struct4101{
674 678
 		PsnNo:          order.PsnNo,
675 679
 		MdtrtId:        order.MdtrtId,
@@ -689,9 +693,9 @@ func (c *HisApiController) GetSettleList() {
689 693
 		HiType:         order.Insutype,
690 694
 		Insuplc:        miConfig.InsuplcAdmdvs,
691 695
 		MaindiagFlag:   "1",
692
-		BillCode:       order.FaPiaoCode,
696
+		BillCode:       last_order.FaPiaoCode,
693 697
 		BillNo:         order.FaPiaoNumber,
694
-		BizSn:          order.Number,
698
+		BizSn:          new_fapiao_number,
695 699
 		PsnSelfPay:     order.PsnPartAmt,
696 700
 		PsnOwnPay:      order.PsnPartAmt,
697 701
 		AcctPay:        order.AcctPay,
@@ -705,19 +709,6 @@ func (c *HisApiController) GetSettleList() {
705 709
 	}
706 710
 	struct4101.SetlBegnDate = order.SetlTime
707 711
 	struct4101.SetlEndDate = order.SetlTime
708
-	//if order.SettleType == 1 {
709
-	//	t := time.Unix(int64(order.SettleAccountsDate), 0)
710
-	//	dateStr := t.Format("2006-01-02")
711
-	//	struct4101.SetlBegnDate = dateStr
712
-	//	struct4101.SetlEndDate = dateStr
713
-	//} else {
714
-	//	t := time.Unix(int64(order.SettleStartTime), 0)
715
-	//	t2 := time.Unix(int64(order.SettleEndTime), 0)
716
-	//	dateStartStr := t.Format("2006-01-02")
717
-	//	dateEndStr := t2.Format("2006-01-02")
718
-	//	struct4101.SetlBegnDate = dateStartStr
719
-	//	struct4101.SetlEndDate = dateEndStr
720
-	//}
721 712
 
722 713
 	var rf []CustomFundPay
723 714
 	json.Unmarshal([]byte(order.SetlDetail), &rf)
@@ -1143,8 +1134,14 @@ func (c *HisApiController) GetSettleList() {
1143 1134
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
1144 1135
 		return
1145 1136
 	}
1146
-
1147 1137
 	if res.Infcode != 0 {
1138
+		order.FaPiaoNumber = new_fapiao_number
1139
+		order.FaPiaoCode = last_order.FaPiaoCode
1140
+		err := service.UpdateOrder(order)
1141
+		if err != nil {
1142
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
1143
+			return
1144
+		}
1148 1145
 		c.ServeSuccessJSON(map[string]interface{}{
1149 1146
 			"failed_code": -10,
1150 1147
 			"msg":         res.ErrMsg,
@@ -3818,11 +3815,11 @@ func (c *HisApiController) GetUploadInfo() {
3818 3815
 			data["doctor_id"] = strconv.FormatInt(roles.AdminUserId, 10)
3819 3816
 			data["dept"] = strconv.FormatInt(patientPrescription.Departments, 10)
3820 3817
 			data["fixmedins_code"] = miConfig.Code
3821
-			if (department.ID == 0 && adminUser.CurrentOrgId == 9919) || (department.ID == 0 && adminUser.CurrentOrgId == 10106) {
3822
-				data["dept_code"] = "15"
3823
-			} else {
3824
-				data["dept_code"] = department.Number
3825
-			}
3818
+			//if (department.ID == 0 && adminUser.CurrentOrgId == 9919) || (department.ID == 0 && adminUser.CurrentOrgId == 10106) {
3819
+			//	data["dept_code"] = "15"
3820
+			//} else {
3821
+			data["dept_code"] = department.Number
3822
+			//}
3826 3823
 
3827 3824
 			data["insuplc_admdvs"] = his.InsuplcAdmdvs
3828 3825
 			data["mdtrtarea_admvs"] = miConfig.MdtrtareaAdmvs

+ 10 - 0
service/his_service.go View File

@@ -1292,6 +1292,11 @@ func GetLastHisOrder(org_id int64) (his models.HisOrder, err error) {
1292 1292
 	return
1293 1293
 }
1294 1294
 
1295
+func GetLastHisOrderTwo(org_id int64) (his models.HisOrder, err error) {
1296
+	err = readDb.Model(&models.HisOrder{}).Where("user_org_id = ? AND status = 1 AND order_status = 2 AND fa_piao_code <> '' AND fa_piao_number <> ''", org_id).Last(&his).Error
1297
+	return
1298
+}
1299
+
1295 1300
 func GetHisPatientInfoTwo(org_id int64, patient_id int64, record_date int64) (info []*models.HisPatient, err error) {
1296 1301
 	err = readDb.Model(&models.HisPatient{}).Where("user_org_id = ? AND status = 1 AND record_date = ? AND patient_id = ?", org_id, record_date, patient_id).Find(&info).Error
1297 1302
 	return
@@ -1413,3 +1418,8 @@ func GetClearRecordById(id int64) (record models.HisYidiClearRecord, err error)
1413 1418
 	err = readDb.Model(&models.HisYidiClearRecord{}).Where("id = ? AND status = 1").First(&record).Error
1414 1419
 	return
1415 1420
 }
1421
+
1422
+func UpdateOrder(order models.HisOrder) (err error) {
1423
+	err = writeDb.Save(&order).Error
1424
+	return
1425
+}