|
@@ -65,6 +65,8 @@ func HisManagerApiRegistRouters() {
|
65
|
65
|
beego.Router("/api/reversal", &HisApiController{}, "get:ReversalData")
|
66
|
66
|
beego.Router("/api/reversal/other", &HisApiController{}, "get:ReversalOtherData")
|
67
|
67
|
beego.Router("/api/settlelist/get", &HisApiController{}, "get:GetSettleList")
|
|
68
|
+ beego.Router("/api/settlelisthosptial/get", &HisApiController{}, "get:GetSettleListHospital")
|
|
69
|
+
|
68
|
70
|
beego.Router("/api/pwd/check", &HisApiController{}, "get:CheckCardPWD")
|
69
|
71
|
beego.Router("/api/insutype/check", &HisApiController{}, "get:CheckInsutype")
|
70
|
72
|
beego.Router("/api/batchsettlelist/get", &HisApiController{}, "get:GetBatchSettleList")
|
|
@@ -1170,6 +1172,532 @@ func (c *HisApiController) GetSettleList() {
|
1170
|
1172
|
}
|
1171
|
1173
|
}
|
1172
|
1174
|
|
|
1175
|
+func (c *HisApiController) GetSettleListHospital() {
|
|
1176
|
+
|
|
1177
|
+ order_id, _ := c.GetInt64("order_id")
|
|
1178
|
+ admin_user_id, _ := c.GetInt64("admin_user_id")
|
|
1179
|
+
|
|
1180
|
+ order, _ := service.GetHisOrderByIDTwo(order_id)
|
|
1181
|
+ roles, _ := service.GetDoctorListTwo(c.GetAdminUserInfo().CurrentOrgId)
|
|
1182
|
+ his, _ := service.GetInHospitalRecordByNumber(order.MdtrtId)
|
|
1183
|
+ admin, _ := service.GetAdminUserByUserID(roles[0].AdminUserId)
|
|
1184
|
+ curRoles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
|
|
1185
|
+ depart, _ := service.GetDepartMentDetail(curRoles.DepartmentId)
|
|
1186
|
+ miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
|
|
1187
|
+
|
|
1188
|
+ if order.ID == 0 {
|
|
1189
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHisOrderNoExistParamWrong)
|
|
1190
|
+ return
|
|
1191
|
+ }
|
|
1192
|
+
|
|
1193
|
+ last_order, _ := service.GetLastHisOrder(c.GetAdminUserInfo().CurrentOrgId)
|
|
1194
|
+ max_order, _ := service.GetLastHisOrderTwo(c.GetAdminUserInfo().CurrentOrgId)
|
|
1195
|
+ count, _ := strconv.ParseInt(max_order.FaPiaoNumber, 10, 64)
|
|
1196
|
+ fmt.Println(count)
|
|
1197
|
+ var zero string
|
|
1198
|
+ number := count + 1
|
|
1199
|
+ if number >= 1000 {
|
|
1200
|
+ zero = "0000" + strconv.FormatInt(number, 10)
|
|
1201
|
+ } else if number >= 10000 {
|
|
1202
|
+ zero = "000" + strconv.FormatInt(number, 10)
|
|
1203
|
+ } else if number >= 100000 {
|
|
1204
|
+ zero = "00" + strconv.FormatInt(number, 10)
|
|
1205
|
+ } else if number >= 1000000 {
|
|
1206
|
+ zero = "0" + strconv.FormatInt(number, 10)
|
|
1207
|
+ } else {
|
|
1208
|
+ zero = strconv.FormatInt(number, 10)
|
|
1209
|
+ }
|
|
1210
|
+ fmt.Println(zero)
|
|
1211
|
+
|
|
1212
|
+ struct4101 := service.Struct4101{
|
|
1213
|
+ PsnNo: order.PsnNo,
|
|
1214
|
+ MdtrtId: order.MdtrtId,
|
|
1215
|
+ SetlId: order.SetlId,
|
|
1216
|
+ PsnName: order.PsnName,
|
|
1217
|
+ Gend: order.Gend,
|
|
1218
|
+ Brdy: his.Brdy,
|
|
1219
|
+ Age: order.Age,
|
|
1220
|
+ Naty: order.Naty,
|
|
1221
|
+ PatnCertType: "01",
|
|
1222
|
+ Certno: order.Certno,
|
|
1223
|
+ Prfs: "90",
|
|
1224
|
+ ConerName: roles[0].UserName,
|
|
1225
|
+ PatnRlts: "99",
|
|
1226
|
+ ConerAddr: miConfig.OrgName,
|
|
1227
|
+ ConerTel: admin.Mobile,
|
|
1228
|
+ HiType: order.Insutype,
|
|
1229
|
+ Insuplc: miConfig.InsuplcAdmdvs,
|
|
1230
|
+ MaindiagFlag: "1",
|
|
1231
|
+ BillCode: last_order.FaPiaoCode,
|
|
1232
|
+ BillNo: zero,
|
|
1233
|
+ BizSn: order.Number,
|
|
1234
|
+ PsnSelfPay: order.PsnPartAmt,
|
|
1235
|
+ PsnOwnPay: order.PsnPartAmt,
|
|
1236
|
+ AcctPay: order.AcctPay,
|
|
1237
|
+ PsnCashpay: order.PsnCashPay,
|
|
1238
|
+ HiPaymtd: "1",
|
|
1239
|
+ Hsorg: miConfig.InsuplcAdmdvs,
|
|
1240
|
+ HsorgOpter: miConfig.InsuplcAdmdvs,
|
|
1241
|
+ MedinsFillPsn: curRoles.UserName,
|
|
1242
|
+ MedinsFillDept: depart.Name,
|
|
1243
|
+ IptMedType: "2",
|
|
1244
|
+ }
|
|
1245
|
+ struct4101.SetlBegnDate = order.SetlTime
|
|
1246
|
+ struct4101.SetlEndDate = order.SetlTime
|
|
1247
|
+
|
|
1248
|
+ var rf []CustomFundPay
|
|
1249
|
+ json.Unmarshal([]byte(order.SetlDetail), &rf)
|
|
1250
|
+
|
|
1251
|
+ var tempFunPays []service.CustomStruct
|
|
1252
|
+ for _, item := range rf {
|
|
1253
|
+ var tempFunPay service.CustomStruct
|
|
1254
|
+ tempFunPay.FundPayamt = item.FundPayamt
|
|
1255
|
+ tempFunPay.FundPayType = item.FundPayType
|
|
1256
|
+ tempFunPays = append(tempFunPays, tempFunPay)
|
|
1257
|
+ }
|
|
1258
|
+ struct4101.CustomStruct = tempFunPays
|
|
1259
|
+
|
|
1260
|
+ var tempOpspdiseinfos []service.OpspdiseinfoStruct
|
|
1261
|
+ var tempOpspdiseinfo2 service.OpspdiseinfoStruct
|
|
1262
|
+ //sickConfig, _ := service.FindDiagnoseById(his.Diagnosis)
|
|
1263
|
+
|
|
1264
|
+ diagnosis_ids := strings.Split(his.Diagnosis, ",")
|
|
1265
|
+ var config []*models.HisXtDiagnoseConfig
|
|
1266
|
+ for _, item := range diagnosis_ids {
|
|
1267
|
+ id, _ := strconv.ParseInt(item, 10, 64)
|
|
1268
|
+ diagnosisConfig, _ := service.FindDiagnoseById(id)
|
|
1269
|
+ config = append(config, &diagnosisConfig)
|
|
1270
|
+ }
|
|
1271
|
+
|
|
1272
|
+ for _, item := range config {
|
|
1273
|
+ var tempOpspdiseinfo service.OpspdiseinfoStruct
|
|
1274
|
+ tempOpspdiseinfo.DiagCode = item.CountryCode
|
|
1275
|
+ tempOpspdiseinfo.DiagName = item.CountryContentName
|
|
1276
|
+ tempOpspdiseinfo.MaindiagFlag = "1"
|
|
1277
|
+ tempOpspdiseinfo.OprnOprtCode = ""
|
|
1278
|
+ tempOpspdiseinfo.OprnOprtName = ""
|
|
1279
|
+ tempOpspdiseinfos = append(tempOpspdiseinfos, tempOpspdiseinfo)
|
|
1280
|
+ }
|
|
1281
|
+
|
|
1282
|
+ sickConfigTwo, _ := service.FindSickById(his.SickType)
|
|
1283
|
+ tempOpspdiseinfo2.DiagCode = sickConfigTwo.ContentCode
|
|
1284
|
+ tempOpspdiseinfo2.DiagName = sickConfigTwo.CountryContentName
|
|
1285
|
+ tempOpspdiseinfo2.MaindiagFlag = "2"
|
|
1286
|
+ tempOpspdiseinfo2.OprnOprtCode = ""
|
|
1287
|
+ tempOpspdiseinfo2.OprnOprtName = ""
|
|
1288
|
+ tempOpspdiseinfos = append(tempOpspdiseinfos, tempOpspdiseinfo2)
|
|
1289
|
+ struct4101.OpspdiseinfoStruct = tempOpspdiseinfos
|
|
1290
|
+
|
|
1291
|
+ var iteminfo service.IteminfoStruct
|
|
1292
|
+
|
|
1293
|
+ var bedCostTotal float64 = 0 //床位总费
|
|
1294
|
+ var bedCostSelfTotal float64 = 0 //床位自费
|
|
1295
|
+ var bedCostPartSelfTotal float64 = 0 //床位部分项目自费
|
|
1296
|
+
|
|
1297
|
+ var operationCostTotal float64 = 0 //手术费
|
|
1298
|
+ var operationCostSelfTotal float64 = 0 //手术费
|
|
1299
|
+ var operationCostPartSelfTotal float64 = 0 //手术费
|
|
1300
|
+
|
|
1301
|
+ var otherCostTotal float64 = 0 //其他费用
|
|
1302
|
+ var otherCostSelfTotal float64 = 0 //其他费用
|
|
1303
|
+ var otherCostPartSelfTotal float64 = 0 //其他费用
|
|
1304
|
+
|
|
1305
|
+ var materialCostTotal float64 = 0 //材料费
|
|
1306
|
+ var materialCostSelfTotal float64 = 0 //材料费
|
|
1307
|
+ var materialCostPartSelfTotal float64 = 0 //材料费
|
|
1308
|
+
|
|
1309
|
+ var westernMedicineCostTotal float64 = 0 //西药费
|
|
1310
|
+ var westernMedicineCostSelfTotal float64 = 0 //西药费
|
|
1311
|
+ var westernMedicineCostPartSelfTotal float64 = 0 //西药费
|
|
1312
|
+
|
|
1313
|
+ var chineseTraditionalMedicineCostTotal float64 = 0 //中成药
|
|
1314
|
+ var chineseTraditionalMedicineCostSelfTotal float64 = 0 //中成药
|
|
1315
|
+ var chineseTraditionalMedicineCostPartSelfTotal float64 = 0 //中成药
|
|
1316
|
+
|
|
1317
|
+ var checkCostTotal float64 = 0 //检查费
|
|
1318
|
+ var checkCostSelfTotal float64 = 0 //检查费
|
|
1319
|
+ var checkCostPartSelfTotal float64 = 0 //检查费
|
|
1320
|
+
|
|
1321
|
+ var laboratoryCostTotal float64 = 0 //化验费
|
|
1322
|
+ var laboratoryCostSelfTotal float64 = 0 //化验费
|
|
1323
|
+ var laboratoryCostPartSelfTotal float64 = 0 //化验费
|
|
1324
|
+
|
|
1325
|
+ var treatCostTotal float64 = 0 //治疗费用
|
|
1326
|
+ var treatCostSelfTotal float64 = 0 //治疗费用
|
|
1327
|
+ var treatCostPartSelfTotal float64 = 0 //治疗费用
|
|
1328
|
+
|
|
1329
|
+ decimal.DivisionPrecision = 2
|
|
1330
|
+
|
|
1331
|
+ var bed_fulamt_ownpay_amt float64 = 0
|
|
1332
|
+ var operation_fulamt_ownpay_amt float64 = 0
|
|
1333
|
+ var other_fulamt_ownpay_amt float64 = 0
|
|
1334
|
+ var westernMedicine_fulamt_ownpay_amt float64 = 0
|
|
1335
|
+ var chineseTraditional_fulamt_ownpay_amt float64 = 0
|
|
1336
|
+ var check_fulamt_ownpay_amt float64 = 0
|
|
1337
|
+ var material_fulamt_ownpay_amt float64 = 0
|
|
1338
|
+ var laboratory_fulamt_ownpay_amt float64 = 0
|
|
1339
|
+ var treat_fulamt_ownpay_amt float64 = 0
|
|
1340
|
+
|
|
1341
|
+ var bed_claa_sunmfee float64 = 0
|
|
1342
|
+ var bed_clab_amt float64 = 0
|
|
1343
|
+ var bed_other_amt float64 = 0
|
|
1344
|
+
|
|
1345
|
+ var operation_claa_sunmfee float64 = 0
|
|
1346
|
+ var operation_clab_amt float64 = 0
|
|
1347
|
+ var operation_other_amt float64 = 0
|
|
1348
|
+
|
|
1349
|
+ var other_claa_sunmfee float64 = 0
|
|
1350
|
+ var other_clab_amt float64 = 0
|
|
1351
|
+ var other_other_amt float64 = 0
|
|
1352
|
+
|
|
1353
|
+ var westernMedicine_claa_sunmfee float64 = 0
|
|
1354
|
+ var westernMedicine_clab_amt float64 = 0
|
|
1355
|
+ var westernMedicine_other_amt float64 = 0
|
|
1356
|
+
|
|
1357
|
+ var chineseTraditional_claa_sunmfee float64 = 0
|
|
1358
|
+ var chineseTraditional_clab_amt float64 = 0
|
|
1359
|
+ var chineseTraditional_other_amt float64 = 0
|
|
1360
|
+
|
|
1361
|
+ var check_claa_sunmfee float64 = 0
|
|
1362
|
+ var check_clab_amt float64 = 0
|
|
1363
|
+ var check_other_amt float64 = 0
|
|
1364
|
+
|
|
1365
|
+ var material_claa_sunmfee float64 = 0
|
|
1366
|
+ var material_clab_amt float64 = 0
|
|
1367
|
+ var material_other_amt float64 = 0
|
|
1368
|
+
|
|
1369
|
+ var laboratory_claa_sunmfee float64 = 0
|
|
1370
|
+ var laboratory_clab_amt float64 = 0
|
|
1371
|
+ var laboratory_other_amt float64 = 0
|
|
1372
|
+
|
|
1373
|
+ var treat_claa_sunmfee float64 = 0
|
|
1374
|
+ var treat_clab_amt float64 = 0
|
|
1375
|
+ var treat_other_amt float64 = 0
|
|
1376
|
+
|
|
1377
|
+ for _, item := range order.HisOrderInfo {
|
|
1378
|
+ if item.MedChrgitmType == "01" { //床位费
|
|
1379
|
+ bedCostTotal, _ = decimal.NewFromFloat(bedCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
1380
|
+ bedCostSelfTotal, _ = decimal.NewFromFloat(bedCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
1381
|
+ bedCostPartSelfTotal, _ = decimal.NewFromFloat(bedCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
1382
|
+ bed_fulamt_ownpay_amt, _ = decimal.NewFromFloat(bed_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
|
|
1383
|
+ if item.ChrgitmLv == "1" {
|
|
1384
|
+ bed_claa_sunmfee, _ = decimal.NewFromFloat(bed_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
1385
|
+ }
|
|
1386
|
+ if item.ChrgitmLv == "2" {
|
|
1387
|
+ bed_clab_amt, _ = decimal.NewFromFloat(bed_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
1388
|
+
|
|
1389
|
+ }
|
|
1390
|
+ if item.ChrgitmLv == "3" {
|
|
1391
|
+ bed_other_amt, _ = decimal.NewFromFloat(bed_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
1392
|
+ }
|
|
1393
|
+
|
|
1394
|
+ }
|
|
1395
|
+
|
|
1396
|
+ if item.MedChrgitmType == "03" { //检查费
|
|
1397
|
+ checkCostTotal, _ = decimal.NewFromFloat(checkCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
1398
|
+ checkCostSelfTotal, _ = decimal.NewFromFloat(checkCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
1399
|
+ checkCostPartSelfTotal, _ = decimal.NewFromFloat(checkCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
1400
|
+ check_fulamt_ownpay_amt, _ = decimal.NewFromFloat(check_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
|
|
1401
|
+ if item.ChrgitmLv == "1" {
|
|
1402
|
+
|
|
1403
|
+ check_claa_sunmfee, _ = decimal.NewFromFloat(check_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
1404
|
+
|
|
1405
|
+ }
|
|
1406
|
+ if item.ChrgitmLv == "2" {
|
|
1407
|
+ check_clab_amt, _ = decimal.NewFromFloat(check_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
1408
|
+
|
|
1409
|
+ }
|
|
1410
|
+ if item.ChrgitmLv == "3" {
|
|
1411
|
+ check_other_amt, _ = decimal.NewFromFloat(check_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
1412
|
+ }
|
|
1413
|
+ }
|
|
1414
|
+
|
|
1415
|
+ if item.MedChrgitmType == "04" { //化验费
|
|
1416
|
+ laboratoryCostTotal, _ = decimal.NewFromFloat(laboratoryCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
1417
|
+ laboratoryCostSelfTotal, _ = decimal.NewFromFloat(laboratoryCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
1418
|
+ laboratoryCostPartSelfTotal, _ = decimal.NewFromFloat(laboratoryCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
1419
|
+ laboratory_fulamt_ownpay_amt, _ = decimal.NewFromFloat(laboratory_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
|
|
1420
|
+ if item.ChrgitmLv == "1" {
|
|
1421
|
+
|
|
1422
|
+ laboratory_claa_sunmfee, _ = decimal.NewFromFloat(laboratory_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
1423
|
+
|
|
1424
|
+ }
|
|
1425
|
+ if item.ChrgitmLv == "2" {
|
|
1426
|
+ laboratory_clab_amt, _ = decimal.NewFromFloat(laboratory_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
1427
|
+
|
|
1428
|
+ }
|
|
1429
|
+ if item.ChrgitmLv == "3" {
|
|
1430
|
+ laboratory_other_amt, _ = decimal.NewFromFloat(laboratory_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
1431
|
+ }
|
|
1432
|
+ }
|
|
1433
|
+
|
|
1434
|
+ if item.MedChrgitmType == "05" { //治疗费
|
|
1435
|
+ treatCostTotal, _ = decimal.NewFromFloat(treatCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
1436
|
+ treatCostSelfTotal, _ = decimal.NewFromFloat(treatCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
1437
|
+ treatCostPartSelfTotal, _ = decimal.NewFromFloat(treatCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
1438
|
+ treat_fulamt_ownpay_amt, _ = decimal.NewFromFloat(treat_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
|
|
1439
|
+ if item.ChrgitmLv == "1" {
|
|
1440
|
+
|
|
1441
|
+ treat_claa_sunmfee, _ = decimal.NewFromFloat(treat_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
1442
|
+
|
|
1443
|
+ }
|
|
1444
|
+ if item.ChrgitmLv == "2" {
|
|
1445
|
+ treat_clab_amt, _ = decimal.NewFromFloat(treat_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
1446
|
+
|
|
1447
|
+ }
|
|
1448
|
+ if item.ChrgitmLv == "3" {
|
|
1449
|
+ treat_other_amt, _ = decimal.NewFromFloat(treat_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
1450
|
+ }
|
|
1451
|
+ }
|
|
1452
|
+
|
|
1453
|
+ if item.MedChrgitmType == "06" { //手术费
|
|
1454
|
+ operationCostTotal, _ = decimal.NewFromFloat(operationCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
1455
|
+ operationCostSelfTotal, _ = decimal.NewFromFloat(operationCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
1456
|
+ operationCostPartSelfTotal, _ = decimal.NewFromFloat(operationCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
1457
|
+ operation_fulamt_ownpay_amt, _ = decimal.NewFromFloat(operation_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
|
|
1458
|
+
|
|
1459
|
+ if item.ChrgitmLv == "1" {
|
|
1460
|
+
|
|
1461
|
+ operation_claa_sunmfee, _ = decimal.NewFromFloat(operation_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
1462
|
+
|
|
1463
|
+ }
|
|
1464
|
+ if item.ChrgitmLv == "2" {
|
|
1465
|
+ operation_clab_amt, _ = decimal.NewFromFloat(operation_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
1466
|
+
|
|
1467
|
+ }
|
|
1468
|
+ if item.ChrgitmLv == "3" {
|
|
1469
|
+ operation_other_amt, _ = decimal.NewFromFloat(operation_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
1470
|
+ }
|
|
1471
|
+ }
|
|
1472
|
+
|
|
1473
|
+ if item.MedChrgitmType == "08" { //材料费
|
|
1474
|
+ materialCostTotal, _ = decimal.NewFromFloat(materialCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
1475
|
+ materialCostSelfTotal, _ = decimal.NewFromFloat(materialCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
1476
|
+ materialCostPartSelfTotal, _ = decimal.NewFromFloat(materialCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
1477
|
+ material_fulamt_ownpay_amt, _ = decimal.NewFromFloat(material_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
|
|
1478
|
+ if item.ChrgitmLv == "1" {
|
|
1479
|
+
|
|
1480
|
+ material_claa_sunmfee, _ = decimal.NewFromFloat(material_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
1481
|
+
|
|
1482
|
+ }
|
|
1483
|
+ if item.ChrgitmLv == "2" {
|
|
1484
|
+ material_clab_amt, _ = decimal.NewFromFloat(material_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
1485
|
+
|
|
1486
|
+ }
|
|
1487
|
+ if item.ChrgitmLv == "3" {
|
|
1488
|
+ material_other_amt, _ = decimal.NewFromFloat(material_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
1489
|
+ }
|
|
1490
|
+ }
|
|
1491
|
+
|
|
1492
|
+ if item.MedChrgitmType == "09" { //西药费
|
|
1493
|
+ westernMedicineCostTotal, _ = decimal.NewFromFloat(westernMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
1494
|
+ westernMedicineCostSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
1495
|
+ westernMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
1496
|
+ westernMedicine_fulamt_ownpay_amt, _ = decimal.NewFromFloat(westernMedicine_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
|
|
1497
|
+ if item.ChrgitmLv == "1" {
|
|
1498
|
+
|
|
1499
|
+ westernMedicine_claa_sunmfee, _ = decimal.NewFromFloat(westernMedicine_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
1500
|
+
|
|
1501
|
+ }
|
|
1502
|
+ if item.ChrgitmLv == "2" {
|
|
1503
|
+ westernMedicine_clab_amt, _ = decimal.NewFromFloat(westernMedicine_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
1504
|
+
|
|
1505
|
+ }
|
|
1506
|
+ if item.ChrgitmLv == "3" {
|
|
1507
|
+ westernMedicine_other_amt, _ = decimal.NewFromFloat(westernMedicine_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
1508
|
+ }
|
|
1509
|
+ }
|
|
1510
|
+
|
|
1511
|
+ if item.MedChrgitmType == "11" { //中成费
|
|
1512
|
+ chineseTraditionalMedicineCostTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
1513
|
+ chineseTraditionalMedicineCostSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
1514
|
+ chineseTraditionalMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
1515
|
+ chineseTraditional_fulamt_ownpay_amt, _ = decimal.NewFromFloat(chineseTraditional_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
|
|
1516
|
+ if item.ChrgitmLv == "1" {
|
|
1517
|
+
|
|
1518
|
+ chineseTraditional_claa_sunmfee, _ = decimal.NewFromFloat(chineseTraditional_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
1519
|
+
|
|
1520
|
+ }
|
|
1521
|
+ if item.ChrgitmLv == "2" {
|
|
1522
|
+ chineseTraditional_clab_amt, _ = decimal.NewFromFloat(chineseTraditional_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
1523
|
+
|
|
1524
|
+ }
|
|
1525
|
+ if item.ChrgitmLv == "3" {
|
|
1526
|
+ chineseTraditional_other_amt, _ = decimal.NewFromFloat(chineseTraditional_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
1527
|
+ }
|
|
1528
|
+ }
|
|
1529
|
+
|
|
1530
|
+ if item.MedChrgitmType == "14" { //其他费
|
|
1531
|
+ otherCostTotal, _ = decimal.NewFromFloat(otherCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
1532
|
+ otherCostSelfTotal, _ = decimal.NewFromFloat(otherCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
1533
|
+ otherCostPartSelfTotal, _ = decimal.NewFromFloat(otherCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
1534
|
+ other_fulamt_ownpay_amt, _ = decimal.NewFromFloat(other_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
|
|
1535
|
+ if item.ChrgitmLv == "1" {
|
|
1536
|
+ other_claa_sunmfee, _ = decimal.NewFromFloat(other_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
|
|
1537
|
+
|
|
1538
|
+ }
|
|
1539
|
+ if item.ChrgitmLv == "2" {
|
|
1540
|
+ other_clab_amt, _ = decimal.NewFromFloat(other_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
|
|
1541
|
+
|
|
1542
|
+ }
|
|
1543
|
+ if item.ChrgitmLv == "3" {
|
|
1544
|
+ other_other_amt, _ = decimal.NewFromFloat(other_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
|
|
1545
|
+ }
|
|
1546
|
+ }
|
|
1547
|
+
|
|
1548
|
+ }
|
|
1549
|
+
|
|
1550
|
+ var iteminfoStructs []service.IteminfoStruct
|
|
1551
|
+
|
|
1552
|
+ if bedCostTotal != 0 {
|
|
1553
|
+ iteminfo.MedChrgitm = "01"
|
|
1554
|
+ iteminfo.FulamtOwnpayAmt = bed_fulamt_ownpay_amt
|
|
1555
|
+ iteminfo.Amt = bedCostTotal
|
|
1556
|
+ iteminfo.ClaaSumfee = bed_claa_sunmfee
|
|
1557
|
+ iteminfo.ClabAmt = bed_clab_amt
|
|
1558
|
+ iteminfo.OthAmt = bed_other_amt
|
|
1559
|
+ iteminfoStructs = append(iteminfoStructs, iteminfo)
|
|
1560
|
+ }
|
|
1561
|
+
|
|
1562
|
+ if checkCostTotal != 0 {
|
|
1563
|
+ iteminfo.MedChrgitm = "03"
|
|
1564
|
+ iteminfo.FulamtOwnpayAmt = check_fulamt_ownpay_amt
|
|
1565
|
+ iteminfo.Amt = checkCostTotal
|
|
1566
|
+ iteminfo.ClaaSumfee = check_claa_sunmfee
|
|
1567
|
+ iteminfo.ClabAmt = check_clab_amt
|
|
1568
|
+ iteminfo.OthAmt = check_other_amt
|
|
1569
|
+ iteminfoStructs = append(iteminfoStructs, iteminfo)
|
|
1570
|
+
|
|
1571
|
+ }
|
|
1572
|
+
|
|
1573
|
+ if laboratoryCostTotal != 0 {
|
|
1574
|
+ iteminfo.MedChrgitm = "04"
|
|
1575
|
+ iteminfo.FulamtOwnpayAmt = laboratory_fulamt_ownpay_amt
|
|
1576
|
+ iteminfo.Amt = laboratoryCostTotal
|
|
1577
|
+ iteminfo.ClaaSumfee = laboratory_claa_sunmfee
|
|
1578
|
+ iteminfo.ClabAmt = laboratory_clab_amt
|
|
1579
|
+ iteminfo.OthAmt = laboratory_other_amt
|
|
1580
|
+ iteminfoStructs = append(iteminfoStructs, iteminfo)
|
|
1581
|
+
|
|
1582
|
+ //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
|
|
1583
|
+
|
|
1584
|
+ }
|
|
1585
|
+
|
|
1586
|
+ if treatCostTotal != 0 {
|
|
1587
|
+ iteminfo.MedChrgitm = "05"
|
|
1588
|
+ iteminfo.FulamtOwnpayAmt = treat_fulamt_ownpay_amt
|
|
1589
|
+ iteminfo.Amt = treatCostTotal
|
|
1590
|
+ iteminfo.ClaaSumfee = treat_claa_sunmfee
|
|
1591
|
+ iteminfo.ClabAmt = treat_clab_amt
|
|
1592
|
+ iteminfo.OthAmt = treat_other_amt
|
|
1593
|
+ iteminfoStructs = append(iteminfoStructs, iteminfo)
|
|
1594
|
+ //(struct4101.IteminfoStruct, iteminfo)
|
|
1595
|
+ //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
|
|
1596
|
+ }
|
|
1597
|
+
|
|
1598
|
+ if operationCostTotal != 0 {
|
|
1599
|
+ iteminfo.MedChrgitm = "06"
|
|
1600
|
+ iteminfo.FulamtOwnpayAmt = bed_fulamt_ownpay_amt
|
|
1601
|
+ iteminfo.Amt = operationCostTotal
|
|
1602
|
+ iteminfo.ClaaSumfee = operation_claa_sunmfee
|
|
1603
|
+ iteminfo.ClabAmt = operation_clab_amt
|
|
1604
|
+ iteminfo.OthAmt = operation_other_amt
|
|
1605
|
+ //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
|
|
1606
|
+ iteminfoStructs = append(iteminfoStructs, iteminfo)
|
|
1607
|
+ }
|
|
1608
|
+
|
|
1609
|
+ if materialCostTotal != 0 {
|
|
1610
|
+ iteminfo.MedChrgitm = "08"
|
|
1611
|
+ iteminfo.FulamtOwnpayAmt = material_fulamt_ownpay_amt
|
|
1612
|
+ iteminfo.Amt = materialCostTotal
|
|
1613
|
+ iteminfo.ClaaSumfee = material_claa_sunmfee
|
|
1614
|
+ iteminfo.ClabAmt = material_clab_amt
|
|
1615
|
+ iteminfo.OthAmt = material_other_amt
|
|
1616
|
+ //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
|
|
1617
|
+ iteminfoStructs = append(iteminfoStructs, iteminfo)
|
|
1618
|
+ }
|
|
1619
|
+
|
|
1620
|
+ if westernMedicineCostTotal != 0 {
|
|
1621
|
+ iteminfo.MedChrgitm = "09"
|
|
1622
|
+ iteminfo.FulamtOwnpayAmt = westernMedicine_fulamt_ownpay_amt
|
|
1623
|
+ iteminfo.Amt = westernMedicineCostTotal
|
|
1624
|
+ iteminfo.ClaaSumfee = westernMedicine_claa_sunmfee
|
|
1625
|
+ iteminfo.ClabAmt = westernMedicine_clab_amt
|
|
1626
|
+ iteminfo.OthAmt = westernMedicine_other_amt
|
|
1627
|
+ //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
|
|
1628
|
+ iteminfoStructs = append(iteminfoStructs, iteminfo)
|
|
1629
|
+
|
|
1630
|
+ }
|
|
1631
|
+ if chineseTraditionalMedicineCostTotal != 0 {
|
|
1632
|
+ iteminfo.MedChrgitm = "11"
|
|
1633
|
+ iteminfo.FulamtOwnpayAmt = westernMedicine_fulamt_ownpay_amt
|
|
1634
|
+ iteminfo.Amt = westernMedicineCostTotal
|
|
1635
|
+ iteminfo.ClaaSumfee = westernMedicine_claa_sunmfee
|
|
1636
|
+ iteminfo.ClabAmt = westernMedicine_clab_amt
|
|
1637
|
+ iteminfo.OthAmt = westernMedicine_other_amt
|
|
1638
|
+ //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
|
|
1639
|
+ iteminfoStructs = append(iteminfoStructs, iteminfo)
|
|
1640
|
+
|
|
1641
|
+ }
|
|
1642
|
+ if otherCostTotal != 0 {
|
|
1643
|
+ iteminfo.MedChrgitm = "14"
|
|
1644
|
+ iteminfo.FulamtOwnpayAmt = other_fulamt_ownpay_amt
|
|
1645
|
+ iteminfo.Amt = otherCostTotal
|
|
1646
|
+ iteminfo.ClaaSumfee = other_claa_sunmfee
|
|
1647
|
+ iteminfo.ClabAmt = other_clab_amt
|
|
1648
|
+ iteminfo.OthAmt = other_other_amt
|
|
1649
|
+ //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
|
|
1650
|
+ iteminfoStructs = append(iteminfoStructs, iteminfo)
|
|
1651
|
+
|
|
1652
|
+ }
|
|
1653
|
+ struct4101.IteminfoStruct = iteminfoStructs
|
|
1654
|
+ struct4101.Ntly = "中国"
|
|
1655
|
+ struct4101.AdmCaty = "A03.06"
|
|
1656
|
+ result := service.Gdyb4101(struct4101, miConfig.SecretKey, miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.UserOrgId)
|
|
1657
|
+ fmt.Println(result)
|
|
1658
|
+
|
|
1659
|
+ var dat map[string]interface{}
|
|
1660
|
+ if err := json.Unmarshal([]byte(result), &dat); err == nil {
|
|
1661
|
+ fmt.Println(dat)
|
|
1662
|
+ } else {
|
|
1663
|
+ fmt.Println(err)
|
|
1664
|
+ }
|
|
1665
|
+ userJSONBytes, _ := json.Marshal(dat)
|
|
1666
|
+ var res ResultSeventeen
|
|
1667
|
+ if err := json.Unmarshal(userJSONBytes, &res); err != nil {
|
|
1668
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
1669
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
1670
|
+ return
|
|
1671
|
+ }
|
|
1672
|
+ if res.Infcode != 0 {
|
|
1673
|
+
|
|
1674
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
1675
|
+ "failed_code": -10,
|
|
1676
|
+ "msg": res.ErrMsg,
|
|
1677
|
+ })
|
|
1678
|
+ return
|
|
1679
|
+ } else {
|
|
1680
|
+ order.FaPiaoNumber = zero
|
|
1681
|
+ order.FaPiaoCode = last_order.FaPiaoCode
|
|
1682
|
+ service.UpdateOrder(order)
|
|
1683
|
+ hisFundSettleListResult := &models.HisFundSettleListResult{
|
|
1684
|
+ Number: res.Output.SetlListId,
|
|
1685
|
+ Status: 1,
|
|
1686
|
+ Ctime: time.Now().Unix(),
|
|
1687
|
+ Mtime: time.Now().Unix(),
|
|
1688
|
+ UserOrgId: c.GetAdminUserInfo().CurrentOrgId,
|
|
1689
|
+ IsUpload: 1,
|
|
1690
|
+ OrderId: order_id,
|
|
1691
|
+ }
|
|
1692
|
+ service.CreateUploadRecord(hisFundSettleListResult)
|
|
1693
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
1694
|
+ "msg": "上传成功",
|
|
1695
|
+ "result": hisFundSettleListResult,
|
|
1696
|
+ })
|
|
1697
|
+ return
|
|
1698
|
+ }
|
|
1699
|
+}
|
|
1700
|
+
|
1173
|
1701
|
func (c *HisApiController) GetBatchSettleList() {
|
1174
|
1702
|
org_id, _ := beego.AppConfig.Int64("org_id")
|
1175
|
1703
|
//stage, _ := c.GetInt64("stage")
|