|
|
@@ -488,6 +488,10 @@ public class ReconciliationService {
|
|
|
* @return
|
|
|
*/
|
|
|
public ResultVo<JSONObject> queryReconciliation(String setlMon, String upldBtch) {
|
|
|
+ return SiUtil.makeReturnWithoutOutputOfElseInfo(getQueryReconciliation(setlMon, upldBtch));
|
|
|
+ }
|
|
|
+
|
|
|
+ private JSONObject getQueryReconciliation(String setlMon, String upldBtch) {
|
|
|
JSONObject input = exec.makeTradeHeader(SiFunction.INSTITUTION_SETTLEMENT_MONTH_DZ_3267);
|
|
|
JSONObject inputInput = input.getJSONObject("input");
|
|
|
inputInput.put("fixmedins_code", cfg.getHospId());
|
|
|
@@ -499,7 +503,7 @@ public class ReconciliationService {
|
|
|
if(result.getJSONObject("output") != null) {
|
|
|
result.put("errorList", processMedicalData(result.getJSONObject("output").getString("memo"), setlMon, upldBtch));
|
|
|
}
|
|
|
- return SiUtil.makeReturnWithoutOutputOfElseInfo(result);
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -930,8 +934,11 @@ public class ReconciliationService {
|
|
|
JSONObject obj = (JSONObject) d;
|
|
|
if(obj.getString("solidify_id").equals(map.get("solid"))) {
|
|
|
map.put("fund_name", obj.getString("fund_name"));
|
|
|
+ map.put("fund_code", FundPayType.getCode(obj.getString("fund_name")));
|
|
|
map.put("insutype", Insutype.getName(obj.getString("insutype")));
|
|
|
+ map.put("insutype_code", obj.getString("insutype"));
|
|
|
map.put("med_type", MedType.getName(obj.getString("med_type")));
|
|
|
+ map.put("med_type_code", obj.getString("med_type"));
|
|
|
map.put("medfee_sumamt", obj.get("medfee_sumamt"));
|
|
|
map.put("inscp_amt", obj.get("inscp_amt"));
|
|
|
map.put("fund_pay_sumamt", obj.get("fund_pay_sumamt"));
|
|
|
@@ -1448,4 +1455,62 @@ public class ReconciliationService {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public void updateFund(String setlMon) {
|
|
|
+ JSONObject result = getQueryReconciliation(setlMon, "0");
|
|
|
+ JSONArray errorList = result.getJSONArray("errorList");
|
|
|
+ for (int i = 0; i < errorList.size(); i++) {
|
|
|
+ JSONObject error = errorList.getJSONObject(i);
|
|
|
+ String fullData = error.getString("fullData");
|
|
|
+ BigDecimal fundAmt = error.getBigDecimal("fund_amt");
|
|
|
+ if(StringUtils.isNotBlank(fullData) && fullData.contains("基金)与医保中心数据不一致,中心金额为")){
|
|
|
+ String[] split1 = fullData.split("中心金额为:");
|
|
|
+ if(split1.length == 2){
|
|
|
+ String[] split2 = split1[1].split(";");
|
|
|
+ if(split2.length > 0){
|
|
|
+ BigDecimal total = new BigDecimal(split2[0]);
|
|
|
+ if(total.compareTo(fundAmt) >= 0){
|
|
|
+ BigDecimal subtract = total.subtract(fundAmt);
|
|
|
+ Map<String, String> currentBeginAndEndTime = DateUtil.getCurrentBeginAndEndTime(setlMon);
|
|
|
+ List<SiSetldetail> siSetldetails = siSetlinfoDao.selectSiSetldetailOldByFund(error.getString("insutype_code"),
|
|
|
+ error.getString("med_type_code"), error.getString("fund_code"),
|
|
|
+ currentBeginAndEndTime.get("start"), currentBeginAndEndTime.get("end"));
|
|
|
+ boolean isOld = true;
|
|
|
+ if(siSetldetails == null || siSetldetails.isEmpty()){
|
|
|
+ siSetldetails = siSetlinfoDao.selectSiSetldetailByFund(error.getString("insutype_code"),
|
|
|
+ error.getString("med_type_code"), error.getString("fund_code"),
|
|
|
+ currentBeginAndEndTime.get("start"), currentBeginAndEndTime.get("end"));
|
|
|
+ isOld = false;
|
|
|
+ }
|
|
|
+ if(siSetldetails != null && siSetldetails.size() > 0){
|
|
|
+ SiSetldetail siSetldetail = siSetldetails.get(0);
|
|
|
+ BigDecimal newFundPayamt = siSetldetail.getFundPayamt().add(subtract);
|
|
|
+ String tableName = isOld ? "t_si_setldetail_old" : "t_si_setldetail";
|
|
|
+ siSetlinfoDao.updateSiSetldetail(tableName, siSetldetail.getPatNo(),
|
|
|
+ siSetldetail.getFundPayType(), siSetldetail.getFundPayamt(), siSetldetail.getSetlId(), newFundPayamt);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void main(String[] args) {
|
|
|
+ String fullData = "固化ID:(068b5998-39aa-4a6b-a2da-7939a4de7ace)中(城乡居民基本医疗保险基金)与医保中心数据不一致,中心金额为:83464.98;";
|
|
|
+
|
|
|
+ if(StringUtils.isNotBlank(fullData) && fullData.contains("基金)与医保中心数据不一致,中心金额为")){
|
|
|
+ String[] split1 = fullData.split("中心金额为:");
|
|
|
+ if(split1.length == 2){
|
|
|
+ String[] split2 = split1[1].split(";");
|
|
|
+ if(split2.length > 0){
|
|
|
+ BigDecimal money = new BigDecimal(split2[0]);
|
|
|
+ System.out.println(money);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|