瀏覽代碼

停用正负相抵。

lighter 3 年之前
父節點
當前提交
acd479078c

+ 1 - 1
pom.xml

@@ -10,7 +10,7 @@
     </parent>
     <groupId>thyyxxk</groupId>
     <artifactId>web-server</artifactId>
-    <version>9.9.9</version>
+    <version>10.0.0</version>
     <name>web-server</name>
     <description>server for yibao-web</description>
     <properties>

+ 0 - 5
src/main/java/thyyxxk/webserver/controller/yibao/YiBaoController.java

@@ -88,9 +88,6 @@ public class YiBaoController {
             xmlrService.yiZhuTuiFeiPiPei(item.getInpatientNo(), item.getAdmissTimes());
             Integer ledgerSn = routines.getLedgerSn(item.getInpatientNo(), item.getAdmissTimes());
             routines.hisRecount(item.getInpatientNo(), item.getAdmissTimes(), ledgerSn);
-            item.setStaffId(TokenUtil.getTokenUserId());
-            item.setLedgerSn(ledgerSn);
-            settleService.posNegOffset(item);
         }
         if (responce.equals(ResponceType.NEW_RURAL_COOPERATIVE_MEDICAL_INSURANCE)) {
             return httpPost("multipleUploadFee", patients, responce);
@@ -113,7 +110,6 @@ public class YiBaoController {
         routines.hisRecount(overview.getInpatientNo(), overview.getAdmissTimes(), ledgerSn);
         overview.setStaffId(TokenUtil.getTokenUserId());
         overview.setLedgerSn(ledgerSn);
-        settleService.posNegOffset(overview);
         xmlrService.yiZhuTuiFeiPiPei(overview.getInpatientNo(), overview.getAdmissTimes());
         if (responce.equals(ResponceType.NEW_RURAL_COOPERATIVE_MEDICAL_INSURANCE)) {
             return httpPost("uploadFee", overview, responce);
@@ -161,7 +157,6 @@ public class YiBaoController {
             List<Overview> xnhybOverviews = new ArrayList<>();
             overviews.forEach(item -> {
                 routines.hisRecount(item.getInpatientNo(), item.getAdmissTimes(), item.getLedgerSn());
-                settleService.posNegOffset(item);
                 if (item.getResponceType().equals(ResponceType.NEW_RURAL_COOPERATIVE_MEDICAL_INSURANCE)) {
                     xnhybOverviews.add(item);
                 } else if (ResponceType.isChangShaCityMedicalInsurance(item.getResponceType())) {

+ 1 - 5
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiZyService.java

@@ -57,22 +57,19 @@ public class SiZyService {
     private final SiSetldetailDao setldetldao;
     private final SiChargeTempDao chrgtmpdao;
     private final ExecService exec;
-    private final SettleService settleService;
     private final DismissService dismissService;
     private final XiangMuLuRuService xmlrService;
 
     @Autowired
     public SiZyService(SiZyDao dao, SiQueryDao qrydao, SiSetlinfoDao setlinfoDao,
                        SiSetldetailDao setldetldao, SiChargeTempDao chrgtmpdao, ExecService exec,
-                       SettleService settleService, DismissService dismissService,
-                       XiangMuLuRuService xmlrService) {
+                       DismissService dismissService, XiangMuLuRuService xmlrService) {
         this.dao = dao;
         this.qrydao = qrydao;
         this.setlinfodao = setlinfoDao;
         this.setldetldao = setldetldao;
         this.chrgtmpdao = chrgtmpdao;
         this.exec = exec;
-        this.settleService = settleService;
         this.dismissService = dismissService;
         this.xmlrService = xmlrService;
     }
@@ -176,7 +173,6 @@ public class SiZyService {
         }
         dao.hisRecount(o.getInpatientNo(), o.getAdmissTimes(), o.getLedgerSn());
         o.setStaffId(TokenUtil.getTokenUserId());
-        settleService.posNegOffset(o);
         xmlrService.yiZhuTuiFeiPiPei(o.getInpatientNo(), o.getAdmissTimes());
         ZyPatientInfo p = dao.selectPatientInfo(o.getInpatientNo());
         p.setSid(o.getSid());

+ 1 - 89
src/main/java/thyyxxk/webserver/service/yibao/SettleService.java

@@ -6,14 +6,9 @@ import org.springframework.http.*;
 import org.springframework.stereotype.Service;
 import org.springframework.web.client.RestTemplate;
 import thyyxxk.webserver.config.exception.ExceptionEnum;
-import thyyxxk.webserver.constants.Capacity;
-import thyyxxk.webserver.dao.his.yibao.AdvanceUploadDao;
 import thyyxxk.webserver.entity.ResultVo;
 import thyyxxk.webserver.entity.yibao.dismiss.YbSettleFee;
-import thyyxxk.webserver.entity.yibao.patient.FeeCounteract;
-import thyyxxk.webserver.entity.yibao.patient.Overview;
 import thyyxxk.webserver.entity.yibao.patient.Patient;
-import thyyxxk.webserver.utils.DecimalUtil;
 import thyyxxk.webserver.utils.FilterUtil;
 import thyyxxk.webserver.utils.ResultVoUtil;
 import thyyxxk.webserver.utils.YbLinksUtil;
@@ -27,93 +22,10 @@ import java.util.*;
 @Service
 public class SettleService {
     private final DismissService service;
-    private final AdvanceUploadDao dao;
 
     @Autowired
-    public SettleService(DismissService service, AdvanceUploadDao dao) {
+    public SettleService(DismissService service) {
         this.service = service;
-        this.dao = dao;
-    }
-
-    public void posNegOffset(Overview overview) {
-        Integer offsetFeeSum = dao.selectOffsetFeeSum(overview.getInpatientNo(),
-                overview.getAdmissTimes(), overview.getLedgerSn());
-        if (null != offsetFeeSum && offsetFeeSum != 0) {
-            dao.rollbackOffsetFees(overview.getInpatientNo(),
-                    overview.getAdmissTimes(), overview.getLedgerSn());
-        }
-        Queue<FeeCounteract> fees = dao.selectAllNotUploadedFees(overview.getInpatientNo(),
-                overview.getAdmissTimes(), overview.getLedgerSn());
-        if (null == fees || fees.isEmpty()) {
-            return;
-        }
-        int count = 0;
-        Map<String, Map<String, List<FeeCounteract>>> feeMap = new HashMap<>(Capacity.DEFAULT);
-        while (!fees.isEmpty()) {
-            FeeCounteract fee = fees.poll();
-            String chargeCodeMx = fee.getChargeCodeMx();
-            if (feeMap.containsKey(chargeCodeMx)) {
-                if (fee.getChargeFee().startsWith("-")) {
-                    feeMap.get(chargeCodeMx).get("negative").add(fee);
-                } else {
-                    feeMap.get(chargeCodeMx).get("positive").add(fee);
-                }
-            } else {
-                Map<String, List<FeeCounteract>> tempMap = new HashMap<>();
-                tempMap.put("positive", new ArrayList<>());
-                tempMap.put("negative", new ArrayList<>());
-                if (fee.getChargeFee().startsWith("-")) {
-                    tempMap.get("negative").add(fee);
-                } else {
-                    tempMap.get("positive").add(fee);
-                }
-                feeMap.put(chargeCodeMx, tempMap);
-            }
-        }
-        for (Map.Entry<String, Map<String, List<FeeCounteract>>> entry : feeMap.entrySet()) {
-            List<FeeCounteract> negativeList = entry.getValue().get("negative");
-            if (negativeList.isEmpty()) {
-                continue;
-            }
-            List<FeeCounteract> positiveList = entry.getValue().get("positive");
-            List<Integer> updatedSn = new ArrayList<>();
-            for (FeeCounteract negativeFee : negativeList) {
-                boolean found = false;
-                for (FeeCounteract positiveFee : positiveList) {
-                    if (updatedSn.contains(positiveFee.getDetailSn())) {
-                        continue;
-                    }
-                    if (DecimalUtil.negativeAndPositive(positiveFee.getChargeFee(), negativeFee.getChargeFee())) {
-                        found = true;
-                        updatedSn.add(positiveFee.getDetailSn());
-                        dao.updateYbTransFlagInPair(overview.getInpatientNo(), overview.getAdmissTimes(),
-                                negativeFee.getDetailSn(), positiveFee.getDetailSn());
-                        count += 2;
-                        break;
-                    }
-                }
-                if (!found) {
-                    String positiveAmt = "0.00";
-                    List<Integer> detailSnList = new ArrayList<>();
-                    for (FeeCounteract positiveFee : positiveList) {
-                        if (updatedSn.contains(positiveFee.getDetailSn())) {
-                            continue;
-                        }
-                        detailSnList.add(positiveFee.getDetailSn());
-                        updatedSn.add(positiveFee.getDetailSn());
-                        positiveAmt = DecimalUtil.add(positiveAmt, positiveFee.getChargeFee());
-                        if (DecimalUtil.negativeAndPositive(positiveAmt, negativeFee.getChargeFee())) {
-                            dao.updateYbTransFlag(overview.getInpatientNo(), overview.getAdmissTimes(), negativeFee.getDetailSn());
-                            detailSnList.forEach(detailSn ->
-                                    dao.updateYbTransFlag(overview.getInpatientNo(), overview.getAdmissTimes(), detailSn));
-                            count += (detailSnList.size() + 1);
-                            break;
-                        }
-                    }
-                }
-            }
-        }
-        log.info("正负相抵完成:{},共抵消 {} 条费用。", overview.getLogBody(), count);
     }
 
     @SuppressWarnings({"rawtypes", "unchecked"})