|
@@ -1060,116 +1060,187 @@ func (c *ZHHisApiController) GetUploadInfo() {
|
1060
|
1060
|
}
|
1061
|
1061
|
|
1062
|
1062
|
if isSuccess == true {
|
1063
|
|
- var total float64
|
1064
|
|
- for _, item := range prescriptions {
|
1065
|
|
- if item.Type == 1 { //药品
|
1066
|
|
- for _, subItem := range item.HisDoctorAdviceInfo {
|
1067
|
|
- total = total + (subItem.Price * subItem.PrescribingNumber)
|
|
1063
|
+ if settle_accounts_type == 1 {
|
|
1064
|
+ for _, subItem := range ress {
|
|
1065
|
+ for _, item := range subItem.Output.Result {
|
|
1066
|
+ temp := strings.Split(item.FeedetlSn, "-")
|
|
1067
|
+ var advice_id int64 = 0
|
|
1068
|
+ var project_id int64 = 0
|
|
1069
|
+ var types int64 = 0
|
|
1070
|
+
|
|
1071
|
+ id, _ := strconv.ParseInt(temp[2], 10, 64)
|
|
1072
|
+ types, _ = strconv.ParseInt(temp[1], 10, 64)
|
|
1073
|
+
|
|
1074
|
+ if temp[1] == "1" {
|
|
1075
|
+ advice_id = id
|
|
1076
|
+ project_id = 0
|
|
1077
|
+ } else if temp[1] == "2" {
|
|
1078
|
+ advice_id = 0
|
|
1079
|
+ project_id = id
|
|
1080
|
+ }
|
|
1081
|
+ info := &models.HisOrderInfo{
|
|
1082
|
+ OrderNumber: record.Number,
|
|
1083
|
+ FeedetlSn: item.FeedetlSn,
|
|
1084
|
+ UploadDate: time.Now().Unix(),
|
|
1085
|
+ AdviceId: advice_id,
|
|
1086
|
+ DetItemFeeSumamt: item.DetItemFeeSumamt,
|
|
1087
|
+ Cnt: item.Cnt,
|
|
1088
|
+ Pric: float64(item.Pric),
|
|
1089
|
+ PatientId: record.PatientId,
|
|
1090
|
+ PricUplmtAmt: item.PricUplmtAmt,
|
|
1091
|
+ SelfpayProp: item.SelfpayProp,
|
|
1092
|
+ FulamtOwnpayAmt: item.FulamtOwnpayAmt,
|
|
1093
|
+ OverlmtAmt: item.OverlmtAmt,
|
|
1094
|
+ PreselfpayAmt: item.PreselfpayAmt,
|
|
1095
|
+ BasMednFlag: item.BasMednFlag,
|
|
1096
|
+ MedChrgitmType: item.MedChrgitmType,
|
|
1097
|
+ HiNegoDrugFlag: item.HiNegoDrugFlag,
|
|
1098
|
+ Status: 1,
|
|
1099
|
+ Memo: item.Memo,
|
|
1100
|
+ Mtime: time.Now().Unix(),
|
|
1101
|
+ InscpScpAmt: item.InscpScpAmt,
|
|
1102
|
+ DrtReimFlag: item.DrtReimFlag,
|
|
1103
|
+ Ctime: time.Now().Unix(),
|
|
1104
|
+ ListSpItemFlag: item.ListSpItemFlag,
|
|
1105
|
+ ChldMedcFlag: item.ChldMedcFlag,
|
|
1106
|
+ LmtUsedFlag: item.LmtUsedFlag,
|
|
1107
|
+ ChrgitmLv: item.ChrgitmLv,
|
|
1108
|
+ UserOrgId: adminUser.CurrentOrgId,
|
|
1109
|
+ HisPatientId: record.ID,
|
|
1110
|
+ OrderId: 0,
|
|
1111
|
+ ProjectId: project_id,
|
|
1112
|
+ Type: types,
|
|
1113
|
+ SettleType: settle_accounts_type,
|
|
1114
|
+ }
|
|
1115
|
+ service.CreateOrderInfo(info)
|
|
1116
|
+ }
|
|
1117
|
+ }
|
|
1118
|
+ err := service.UpDatePrescriptionOrderStatus(adminUser.CurrentOrgId, ids)
|
|
1119
|
+ if err == nil {
|
|
1120
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
1121
|
+ "msg": "上传费用明细成功",
|
|
1122
|
+ })
|
|
1123
|
+ return
|
|
1124
|
+ } else {
|
|
1125
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
1126
|
+ return
|
|
1127
|
+ }
|
|
1128
|
+
|
|
1129
|
+ } else {
|
|
1130
|
+ var total float64
|
|
1131
|
+ for _, item := range prescriptions {
|
|
1132
|
+ if item.Type == 1 { //药品
|
|
1133
|
+ for _, subItem := range item.HisDoctorAdviceInfo {
|
|
1134
|
+ total = total + (subItem.Price * subItem.PrescribingNumber)
|
|
1135
|
+ }
|
|
1136
|
+ }
|
|
1137
|
+ if item.Type == 2 { //项目
|
|
1138
|
+ for _, subItem := range item.HisPrescriptionProject {
|
|
1139
|
+ total = total + (subItem.Price * float64(subItem.Count))
|
|
1140
|
+ }
|
1068
|
1141
|
}
|
1069
|
1142
|
}
|
1070
|
|
- if item.Type == 2 { //项目
|
1071
|
|
- for _, subItem := range item.HisPrescriptionProject {
|
|
1143
|
+ for _, item := range prescriptions {
|
|
1144
|
+ for _, subItem := range item.HisAdditionalCharge {
|
1072
|
1145
|
total = total + (subItem.Price * float64(subItem.Count))
|
1073
|
1146
|
}
|
1074
|
1147
|
}
|
1075
|
|
- }
|
1076
|
|
- for _, item := range prescriptions {
|
1077
|
|
- for _, subItem := range item.HisAdditionalCharge {
|
1078
|
|
- total = total + (subItem.Price * float64(subItem.Count))
|
|
1148
|
+ allTotal := fmt.Sprintf("%.2f", total)
|
|
1149
|
+ totals, _ := strconv.ParseFloat(allTotal, 64)
|
|
1150
|
+
|
|
1151
|
+ order := &models.HisOrder{
|
|
1152
|
+ UserOrgId: adminUser.CurrentOrgId,
|
|
1153
|
+ HisPatientId: record.ID,
|
|
1154
|
+ PatientId: record.PatientId,
|
|
1155
|
+ SettleAccountsDate: recordDateTime,
|
|
1156
|
+ Ctime: time.Now().Unix(),
|
|
1157
|
+ Mtime: time.Now().Unix(),
|
|
1158
|
+ Status: 1,
|
|
1159
|
+ Number: record.Number,
|
|
1160
|
+ Infcode: 0,
|
|
1161
|
+ WarnMsg: "",
|
|
1162
|
+ Cainfo: "",
|
|
1163
|
+ ErrMsg: "",
|
|
1164
|
+ RespondTime: "",
|
|
1165
|
+ InfRefmsgid: "",
|
|
1166
|
+ OrderStatus: 1,
|
|
1167
|
+ MdtrtId: record.Number,
|
|
1168
|
+ IsMedicineInsurance: 1,
|
|
1169
|
+ SettleType: settle_accounts_type,
|
|
1170
|
+ SettleStartTime: start_time,
|
|
1171
|
+ SettleEndTime: end_time,
|
|
1172
|
+ Creator: roles.AdminUserId,
|
|
1173
|
+ Modify: roles.AdminUserId,
|
|
1174
|
+ PType: 1,
|
|
1175
|
+ MedfeeSumamt: totals,
|
1079
|
1176
|
}
|
1080
|
|
- }
|
1081
|
|
- allTotal := fmt.Sprintf("%.2f", total)
|
1082
|
|
- totals, _ := strconv.ParseFloat(allTotal, 64)
|
1083
|
|
-
|
1084
|
|
- order := &models.HisOrder{
|
1085
|
|
- UserOrgId: adminUser.CurrentOrgId,
|
1086
|
|
- HisPatientId: record.ID,
|
1087
|
|
- PatientId: record.PatientId,
|
1088
|
|
- SettleAccountsDate: recordDateTime,
|
1089
|
|
- Ctime: time.Now().Unix(),
|
1090
|
|
- Mtime: time.Now().Unix(),
|
1091
|
|
- Status: 1,
|
1092
|
|
- Number: chrg_bchno,
|
1093
|
|
- Infcode: 0,
|
1094
|
|
- WarnMsg: "",
|
1095
|
|
- Cainfo: "",
|
1096
|
|
- ErrMsg: "",
|
1097
|
|
- RespondTime: "",
|
1098
|
|
- InfRefmsgid: "",
|
1099
|
|
- OrderStatus: 1,
|
1100
|
|
- MdtrtId: record.Number,
|
1101
|
|
- IsMedicineInsurance: 1,
|
1102
|
|
- SettleType: settle_accounts_type,
|
1103
|
|
- SettleStartTime: start_time,
|
1104
|
|
- SettleEndTime: end_time,
|
1105
|
|
- Creator: roles.AdminUserId,
|
1106
|
|
- Modify: roles.AdminUserId,
|
1107
|
|
- PType: 1,
|
1108
|
|
- MedfeeSumamt: totals,
|
1109
|
|
- }
|
1110
|
|
- err = service.CreateOrder(order)
|
1111
|
|
- if err != nil {
|
1112
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreatePreOrderException)
|
1113
|
|
- return
|
1114
|
|
- }
|
1115
|
|
- for _, subItem := range ress {
|
1116
|
|
- for _, item := range subItem.Output.Result {
|
1117
|
|
- temp := strings.Split(item.FeedetlSn, "-")
|
1118
|
|
- var advice_id int64 = 0
|
1119
|
|
- var project_id int64 = 0
|
1120
|
|
- var types int64 = 0
|
1121
|
|
-
|
1122
|
|
- id, _ := strconv.ParseInt(temp[2], 10, 64)
|
1123
|
|
- types, _ = strconv.ParseInt(temp[1], 10, 64)
|
1124
|
|
-
|
1125
|
|
- if temp[1] == "1" {
|
1126
|
|
- advice_id = id
|
1127
|
|
- project_id = 0
|
1128
|
|
- } else if temp[1] == "2" {
|
1129
|
|
- advice_id = 0
|
1130
|
|
- project_id = id
|
1131
|
|
- }
|
1132
|
|
- info := &models.HisOrderInfo{
|
1133
|
|
- OrderNumber: order.Number,
|
1134
|
|
- FeedetlSn: item.FeedetlSn,
|
1135
|
|
- UploadDate: time.Now().Unix(),
|
1136
|
|
- AdviceId: advice_id,
|
1137
|
|
- DetItemFeeSumamt: item.DetItemFeeSumamt,
|
1138
|
|
- Cnt: item.Cnt,
|
1139
|
|
- Pric: float64(item.Pric),
|
1140
|
|
- PatientId: record.PatientId,
|
1141
|
|
- PricUplmtAmt: item.PricUplmtAmt,
|
1142
|
|
- SelfpayProp: item.SelfpayProp,
|
1143
|
|
- FulamtOwnpayAmt: item.FulamtOwnpayAmt,
|
1144
|
|
- OverlmtAmt: item.OverlmtAmt,
|
1145
|
|
- PreselfpayAmt: item.PreselfpayAmt,
|
1146
|
|
- BasMednFlag: item.BasMednFlag,
|
1147
|
|
- MedChrgitmType: item.MedChrgitmType,
|
1148
|
|
- HiNegoDrugFlag: item.HiNegoDrugFlag,
|
1149
|
|
- Status: 1,
|
1150
|
|
- Memo: item.Memo,
|
1151
|
|
- Mtime: time.Now().Unix(),
|
1152
|
|
- InscpScpAmt: item.InscpScpAmt,
|
1153
|
|
- DrtReimFlag: item.DrtReimFlag,
|
1154
|
|
- Ctime: time.Now().Unix(),
|
1155
|
|
- ListSpItemFlag: item.ListSpItemFlag,
|
1156
|
|
- ChldMedcFlag: item.ChldMedcFlag,
|
1157
|
|
- LmtUsedFlag: item.LmtUsedFlag,
|
1158
|
|
- ChrgitmLv: item.ChrgitmLv,
|
1159
|
|
- UserOrgId: adminUser.CurrentOrgId,
|
1160
|
|
- HisPatientId: record.ID,
|
1161
|
|
- OrderId: order.ID,
|
1162
|
|
- ProjectId: project_id,
|
1163
|
|
- Type: types,
|
|
1177
|
+ err = service.CreateOrder(order)
|
|
1178
|
+ if err != nil {
|
|
1179
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreatePreOrderException)
|
|
1180
|
+ return
|
|
1181
|
+ }
|
|
1182
|
+ for _, subItem := range ress {
|
|
1183
|
+ for _, item := range subItem.Output.Result {
|
|
1184
|
+ temp := strings.Split(item.FeedetlSn, "-")
|
|
1185
|
+ var advice_id int64 = 0
|
|
1186
|
+ var project_id int64 = 0
|
|
1187
|
+ var types int64 = 0
|
|
1188
|
+
|
|
1189
|
+ id, _ := strconv.ParseInt(temp[2], 10, 64)
|
|
1190
|
+ types, _ = strconv.ParseInt(temp[1], 10, 64)
|
|
1191
|
+
|
|
1192
|
+ if temp[1] == "1" {
|
|
1193
|
+ advice_id = id
|
|
1194
|
+ project_id = 0
|
|
1195
|
+ } else if temp[1] == "2" {
|
|
1196
|
+ advice_id = 0
|
|
1197
|
+ project_id = id
|
|
1198
|
+ }
|
|
1199
|
+ info := &models.HisOrderInfo{
|
|
1200
|
+ OrderNumber: order.Number,
|
|
1201
|
+ FeedetlSn: item.FeedetlSn,
|
|
1202
|
+ UploadDate: time.Now().Unix(),
|
|
1203
|
+ AdviceId: advice_id,
|
|
1204
|
+ DetItemFeeSumamt: item.DetItemFeeSumamt,
|
|
1205
|
+ Cnt: item.Cnt,
|
|
1206
|
+ Pric: float64(item.Pric),
|
|
1207
|
+ PatientId: record.PatientId,
|
|
1208
|
+ PricUplmtAmt: item.PricUplmtAmt,
|
|
1209
|
+ SelfpayProp: item.SelfpayProp,
|
|
1210
|
+ FulamtOwnpayAmt: item.FulamtOwnpayAmt,
|
|
1211
|
+ OverlmtAmt: item.OverlmtAmt,
|
|
1212
|
+ PreselfpayAmt: item.PreselfpayAmt,
|
|
1213
|
+ BasMednFlag: item.BasMednFlag,
|
|
1214
|
+ MedChrgitmType: item.MedChrgitmType,
|
|
1215
|
+ HiNegoDrugFlag: item.HiNegoDrugFlag,
|
|
1216
|
+ Status: 1,
|
|
1217
|
+ Memo: item.Memo,
|
|
1218
|
+ Mtime: time.Now().Unix(),
|
|
1219
|
+ InscpScpAmt: item.InscpScpAmt,
|
|
1220
|
+ DrtReimFlag: item.DrtReimFlag,
|
|
1221
|
+ Ctime: time.Now().Unix(),
|
|
1222
|
+ ListSpItemFlag: item.ListSpItemFlag,
|
|
1223
|
+ ChldMedcFlag: item.ChldMedcFlag,
|
|
1224
|
+ LmtUsedFlag: item.LmtUsedFlag,
|
|
1225
|
+ ChrgitmLv: item.ChrgitmLv,
|
|
1226
|
+ UserOrgId: adminUser.CurrentOrgId,
|
|
1227
|
+ HisPatientId: record.ID,
|
|
1228
|
+ OrderId: order.ID,
|
|
1229
|
+ ProjectId: project_id,
|
|
1230
|
+ Type: types,
|
|
1231
|
+ SettleType: settle_accounts_type,
|
|
1232
|
+ }
|
|
1233
|
+ service.CreateOrderInfo(info)
|
1164
|
1234
|
}
|
1165
|
|
- service.CreateOrderInfo(info)
|
1166
|
1235
|
}
|
|
1236
|
+ service.UpDatePrescriptionNumber(adminUser.CurrentOrgId, ids, record.Number)
|
|
1237
|
+ service.UpDatePrescriptionInfoNumber(adminUser.CurrentOrgId, patientPrescription.PatientId, record.Number, recordDateTime)
|
|
1238
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
1239
|
+ "msg": "上传费用明细成功",
|
|
1240
|
+ })
|
|
1241
|
+
|
1167
|
1242
|
}
|
1168
|
|
- service.UpDatePrescriptionNumber(adminUser.CurrentOrgId, ids, chrg_bchno)
|
1169
|
|
- service.UpDatePrescriptionInfoNumber(adminUser.CurrentOrgId, patientPrescription.PatientId, chrg_bchno, recordDateTime)
|
1170
|
|
- c.ServeSuccessJSON(map[string]interface{}{
|
1171
|
|
- "msg": "上传费用明细成功",
|
1172
|
|
- })
|
|
1243
|
+
|
1173
|
1244
|
}
|
1174
|
1245
|
|
1175
|
1246
|
}
|
|
@@ -1233,34 +1304,111 @@ func (c *ZHHisApiController) ZHRefund() {
|
1233
|
1304
|
|
1234
|
1305
|
}
|
1235
|
1306
|
func (c *ZHHisApiController) ZHRefundDetail() {
|
|
1307
|
+ patient_id, _ := c.GetInt64("patient_id")
|
|
1308
|
+ his_patient_id, _ := c.GetInt64("his_patient_id")
|
|
1309
|
+ record_time := c.GetString("record_time")
|
|
1310
|
+ settle_accounts_type, _ := c.GetInt64("settle_accounts_type")
|
1236
|
1311
|
order_id, _ := c.GetInt64("order_id")
|
1237
|
1312
|
admin_user_id, _ := c.GetInt64("admin_user_id")
|
|
1313
|
+
|
|
1314
|
+ timeLayout := "2006-01-02"
|
|
1315
|
+ loc, _ := time.LoadLocation("Local")
|
|
1316
|
+ theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_time+" 00:00:00", loc)
|
|
1317
|
+ if err != nil {
|
|
1318
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
1319
|
+ return
|
|
1320
|
+ }
|
|
1321
|
+ recordDateTime := theTime.Unix()
|
1238
|
1322
|
adminUser := c.GetAdminUserInfo()
|
1239
|
|
- var order models.HisOrder
|
1240
|
|
- order, _ = service.GetHisOrderByID(order_id)
|
1241
|
|
- roles, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, admin_user_id)
|
|
1323
|
+
|
|
1324
|
+ //var prescriptions []*models.HisPrescription
|
1242
|
1325
|
miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
|
1243
|
|
- config, _ := service.GetMedicalInsuranceConfig(adminUser.CurrentOrgId)
|
1244
|
|
- if config.IsOpen == 1 { //对接了医保,走医保流程
|
|
1326
|
+ roles, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, admin_user_id)
|
1245
|
1327
|
|
1246
|
|
- result := service.Gdyb2302(order.PsnNo, order.MdtrtId, miConfig.OrgName, roles.UserName, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, miConfig.Code)
|
1247
|
|
- var dat map[string]interface{}
|
1248
|
|
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
|
1249
|
|
- fmt.Println(dat)
|
1250
|
|
- } else {
|
1251
|
|
- fmt.Println(err)
|
|
1328
|
+ if settle_accounts_type == 1 { //日结
|
|
1329
|
+ infos, _ := service.GetZHHisUploadOrderInfo(adminUser.CurrentOrgId, patient_id, recordDateTime)
|
|
1330
|
+ record, _ := service.GetInHospitalRecord(his_patient_id)
|
|
1331
|
+ var isSuccess bool = true
|
|
1332
|
+
|
|
1333
|
+ for _, item := range infos {
|
|
1334
|
+ result := service.Gdyb2302(record.PsnNo, record.Number, miConfig.OrgName, roles.UserName, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, miConfig.Code, item.FeedetlSn, 1)
|
|
1335
|
+ var dat map[string]interface{}
|
|
1336
|
+ if err := json.Unmarshal([]byte(result), &dat); err == nil {
|
|
1337
|
+ fmt.Println(dat)
|
|
1338
|
+ } else {
|
|
1339
|
+ fmt.Println(err)
|
|
1340
|
+ }
|
|
1341
|
+ userJSONBytes, _ := json.Marshal(dat)
|
|
1342
|
+ var res2 ResultEmpty
|
|
1343
|
+ if err := json.Unmarshal(userJSONBytes, &res2); err != nil {
|
|
1344
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
1345
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
1346
|
+ return
|
|
1347
|
+ }
|
|
1348
|
+ if res2.Infcode == -1 {
|
|
1349
|
+ isSuccess = false
|
|
1350
|
+ }
|
1252
|
1351
|
}
|
|
1352
|
+ if isSuccess {
|
|
1353
|
+ err := service.UpDateOrderInfoStatus(patient_id, recordDateTime, adminUser.CurrentOrgId)
|
1253
|
1354
|
|
1254
|
|
- userJSONBytes, _ := json.Marshal(dat)
|
|
1355
|
+ if err != nil {
|
|
1356
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
1357
|
+ return
|
|
1358
|
+ }
|
|
1359
|
+ err1 := service.UpDatePrescriptionOrderStatusTwo(patient_id, recordDateTime, adminUser.CurrentOrgId)
|
|
1360
|
+ if err1 != nil {
|
|
1361
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
1362
|
+ return
|
|
1363
|
+ }
|
|
1364
|
+
|
|
1365
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
1366
|
+ "msg": "撤销明细成功",
|
|
1367
|
+ })
|
1255
|
1368
|
|
1256
|
|
- var res2 ResultEmpty
|
1257
|
|
- if err := json.Unmarshal(userJSONBytes, &res2); err != nil {
|
1258
|
|
- utils.ErrorLog("解析失败:%v", err)
|
1259
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
1260
|
|
- return
|
1261
|
1369
|
}
|
1262
|
|
- if res2.Infcode == 0 {
|
1263
|
|
- err := service.UpdataOrderStatus(order_id, order.Number, adminUser.CurrentOrgId, "", result)
|
|
1370
|
+
|
|
1371
|
+ } else {
|
|
1372
|
+ //prescriptions, _ = service.GetZHMonthHisUploadPrescription(adminUser.CurrentOrgId, patient_id, recordDateTime)
|
|
1373
|
+ var order models.HisOrder
|
|
1374
|
+ order, _ = service.GetHisOrderByID(order_id)
|
|
1375
|
+ config, _ := service.GetMedicalInsuranceConfig(adminUser.CurrentOrgId)
|
|
1376
|
+ if config.IsOpen == 1 { //对接了医保,走医保流程
|
|
1377
|
+
|
|
1378
|
+ result := service.Gdyb2302(order.PsnNo, order.MdtrtId, miConfig.OrgName, roles.UserName, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, miConfig.Code, "0000", 0)
|
|
1379
|
+ var dat map[string]interface{}
|
|
1380
|
+ if err := json.Unmarshal([]byte(result), &dat); err == nil {
|
|
1381
|
+ fmt.Println(dat)
|
|
1382
|
+ } else {
|
|
1383
|
+ fmt.Println(err)
|
|
1384
|
+ }
|
|
1385
|
+
|
|
1386
|
+ userJSONBytes, _ := json.Marshal(dat)
|
|
1387
|
+
|
|
1388
|
+ var res2 ResultEmpty
|
|
1389
|
+ if err := json.Unmarshal(userJSONBytes, &res2); err != nil {
|
|
1390
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
1391
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
1392
|
+ return
|
|
1393
|
+ }
|
|
1394
|
+ if res2.Infcode == 0 {
|
|
1395
|
+ err := service.UpdataOrderStatus(order_id, order.Number, adminUser.CurrentOrgId, "", result)
|
|
1396
|
+ if err == nil {
|
|
1397
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
1398
|
+ "msg": "退费成功",
|
|
1399
|
+ })
|
|
1400
|
+ } else {
|
|
1401
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
1402
|
+ return
|
|
1403
|
+ }
|
|
1404
|
+ } else {
|
|
1405
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
1406
|
+ "code": -10,
|
|
1407
|
+ "msg": res2.ErrMsg,
|
|
1408
|
+ })
|
|
1409
|
+ }
|
|
1410
|
+ } else {
|
|
1411
|
+ err := service.UpdataOrderStatus(order_id, order.Number, adminUser.CurrentOrgId, "", "")
|
1264
|
1412
|
if err == nil {
|
1265
|
1413
|
c.ServeSuccessJSON(map[string]interface{}{
|
1266
|
1414
|
"msg": "退费成功",
|
|
@@ -1269,22 +1417,8 @@ func (c *ZHHisApiController) ZHRefundDetail() {
|
1269
|
1417
|
c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
1270
|
1418
|
return
|
1271
|
1419
|
}
|
1272
|
|
- } else {
|
1273
|
|
- c.ServeSuccessJSON(map[string]interface{}{
|
1274
|
|
- "code": -10,
|
1275
|
|
- "msg": res2.ErrMsg,
|
1276
|
|
- })
|
1277
|
|
- }
|
1278
|
|
- } else {
|
1279
|
|
- err := service.UpdataOrderStatus(order_id, order.Number, adminUser.CurrentOrgId, "", "")
|
1280
|
|
- if err == nil {
|
1281
|
|
- c.ServeSuccessJSON(map[string]interface{}{
|
1282
|
|
- "msg": "退费成功",
|
1283
|
|
- })
|
1284
|
|
- } else {
|
1285
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
1286
|
|
- return
|
1287
|
1420
|
}
|
|
1421
|
+
|
1288
|
1422
|
}
|
1289
|
1423
|
|
1290
|
1424
|
}
|