Bladeren bron

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

csx 3 jaren geleden
bovenliggende
commit
80756b82bc
3 gewijzigde bestanden met toevoegingen van 31 en 24 verwijderingen
  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 Bestand weergeven

45
 
45
 
46
 
46
 
47
 [prod]
47
 [prod]
48
-org_id = 10188
48
+org_id = 10215
49
 mobile_token_expiration_second = 86400
49
 mobile_token_expiration_second = 86400
50
 httpdomain = https://api.xt.kuyicloud.com
50
 httpdomain = https://api.xt.kuyicloud.com
51
 sso_domain = https://sso.kuyicloud.com
51
 sso_domain = https://sso.kuyicloud.com
53
 front_end_domain = "https://xt.kuyicloud.com/#"
53
 front_end_domain = "https://xt.kuyicloud.com/#"
54
 #url  = "http://192.168.1.228:17001/szsi-portal/transData"
54
 #url  = "http://192.168.1.228:17001/szsi-portal/transData"
55
 #url = "http://192.168.1.88:6666/szsi-portal/transData"
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
 # gdyb_url="http://igb.hsa.gdgov.cn/ebus/sz_prd/hsa/hgs/"
57
 # gdyb_url="http://igb.hsa.gdgov.cn/ebus/sz_prd/hsa/hgs/"
58
 #内蒙古
58
 #内蒙古
59
 # gdyb_url = "http://10.38.23.105:8090/uif-hsaf-med-api/api/medical/service/"
59
 # gdyb_url = "http://10.38.23.105:8090/uif-hsaf-med-api/api/medical/service/"
61
 # gdyb_paasid = "jm_sc_yjyy"
61
 # gdyb_paasid = "jm_sc_yjyy"
62
 # gdyb_paasid="zh_prd_yrojyy"
62
 # gdyb_paasid="zh_prd_yrojyy"
63
 # gdyb_paasid = "sz_prd_yjyy"
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 Bestand weergeven

670
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHisOrderNoExistParamWrong)
670
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHisOrderNoExistParamWrong)
671
 		return
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
 	struct4101 := service.Struct4101{
677
 	struct4101 := service.Struct4101{
674
 		PsnNo:          order.PsnNo,
678
 		PsnNo:          order.PsnNo,
675
 		MdtrtId:        order.MdtrtId,
679
 		MdtrtId:        order.MdtrtId,
689
 		HiType:         order.Insutype,
693
 		HiType:         order.Insutype,
690
 		Insuplc:        miConfig.InsuplcAdmdvs,
694
 		Insuplc:        miConfig.InsuplcAdmdvs,
691
 		MaindiagFlag:   "1",
695
 		MaindiagFlag:   "1",
692
-		BillCode:       order.FaPiaoCode,
696
+		BillCode:       last_order.FaPiaoCode,
693
 		BillNo:         order.FaPiaoNumber,
697
 		BillNo:         order.FaPiaoNumber,
694
-		BizSn:          order.Number,
698
+		BizSn:          new_fapiao_number,
695
 		PsnSelfPay:     order.PsnPartAmt,
699
 		PsnSelfPay:     order.PsnPartAmt,
696
 		PsnOwnPay:      order.PsnPartAmt,
700
 		PsnOwnPay:      order.PsnPartAmt,
697
 		AcctPay:        order.AcctPay,
701
 		AcctPay:        order.AcctPay,
705
 	}
709
 	}
706
 	struct4101.SetlBegnDate = order.SetlTime
710
 	struct4101.SetlBegnDate = order.SetlTime
707
 	struct4101.SetlEndDate = order.SetlTime
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
 	var rf []CustomFundPay
713
 	var rf []CustomFundPay
723
 	json.Unmarshal([]byte(order.SetlDetail), &rf)
714
 	json.Unmarshal([]byte(order.SetlDetail), &rf)
1143
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
1134
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
1144
 		return
1135
 		return
1145
 	}
1136
 	}
1146
-
1147
 	if res.Infcode != 0 {
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
 		c.ServeSuccessJSON(map[string]interface{}{
1145
 		c.ServeSuccessJSON(map[string]interface{}{
1149
 			"failed_code": -10,
1146
 			"failed_code": -10,
1150
 			"msg":         res.ErrMsg,
1147
 			"msg":         res.ErrMsg,
3818
 			data["doctor_id"] = strconv.FormatInt(roles.AdminUserId, 10)
3815
 			data["doctor_id"] = strconv.FormatInt(roles.AdminUserId, 10)
3819
 			data["dept"] = strconv.FormatInt(patientPrescription.Departments, 10)
3816
 			data["dept"] = strconv.FormatInt(patientPrescription.Departments, 10)
3820
 			data["fixmedins_code"] = miConfig.Code
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
 			data["insuplc_admdvs"] = his.InsuplcAdmdvs
3824
 			data["insuplc_admdvs"] = his.InsuplcAdmdvs
3828
 			data["mdtrtarea_admvs"] = miConfig.MdtrtareaAdmvs
3825
 			data["mdtrtarea_admvs"] = miConfig.MdtrtareaAdmvs

+ 10 - 0
service/his_service.go Bestand weergeven

1292
 	return
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
 func GetHisPatientInfoTwo(org_id int64, patient_id int64, record_date int64) (info []*models.HisPatient, err error) {
1300
 func GetHisPatientInfoTwo(org_id int64, patient_id int64, record_date int64) (info []*models.HisPatient, err error) {
1296
 	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
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
 	return
1302
 	return
1413
 	err = readDb.Model(&models.HisYidiClearRecord{}).Where("id = ? AND status = 1").First(&record).Error
1418
 	err = readDb.Model(&models.HisYidiClearRecord{}).Where("id = ? AND status = 1").First(&record).Error
1414
 	return
1419
 	return
1415
 }
1420
 }
1421
+
1422
+func UpdateOrder(order models.HisOrder) (err error) {
1423
+	err = writeDb.Save(&order).Error
1424
+	return
1425
+}