瀏覽代碼

Merge branch 'master' of https://172.16.32.165/lighter/web-server

xiaochan 3 年之前
父節點
當前提交
9e3e237925

+ 35 - 0
src/main/java/thyyxxk/webserver/controller/inpatient/DoctorsAdviseController.java

@@ -0,0 +1,35 @@
+package thyyxxk.webserver.controller.inpatient;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import thyyxxk.webserver.config.exception.ExceptionEnum;
+import thyyxxk.webserver.entity.ResultVo;
+import thyyxxk.webserver.entity.inpatient.doctorsadvise.BriefPatInfo;
+import thyyxxk.webserver.service.inpatient.DoctorsAdviseService;
+import thyyxxk.webserver.utils.ListUtil;
+import thyyxxk.webserver.utils.ResultVoUtil;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/doctorsAdvise")
+public class DoctorsAdviseController {
+    private final DoctorsAdviseService service;
+
+    @Autowired
+    public DoctorsAdviseController(DoctorsAdviseService service) {
+        this.service = service;
+    }
+
+    @GetMapping("/selectPatientList")
+    public ResultVo<List<BriefPatInfo>> selectPatientList(@RequestParam("ward") String ward) {
+        List<BriefPatInfo> result = service.selectPatientList(ward);
+        if (ListUtil.isBlank(result)) {
+            return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST);
+        }
+        return ResultVoUtil.success(result);
+    }
+}

+ 15 - 0
src/main/java/thyyxxk/webserver/dao/his/inpatient/DoctorsAdviseDao.java

@@ -0,0 +1,15 @@
+package thyyxxk.webserver.dao.his.inpatient;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+import thyyxxk.webserver.entity.inpatient.doctorsadvise.BriefPatInfo;
+
+import java.util.List;
+
+@Mapper
+public interface DoctorsAdviseDao {
+
+    @Select("SELECT rtrim(inpatient_no) as patNo,admiss_times as times,rtrim(name) as name,rtrim(bed_no) as bedNo, " +
+            "total_charge,balance,admiss_date as admdate,own_flag FROM zy_actpatient where dept=#{ward} and ward=#{ward} order by bed_no")
+    List<BriefPatInfo> selectPatientList(String ward);
+}

+ 16 - 0
src/main/java/thyyxxk/webserver/dao/his/inpatient/PatientDao.java

@@ -277,6 +277,22 @@ public interface PatientDao {
             "</script>")
     void insertDisDiags(@Param("staffId") String staffId, @Param("list") List<ZyInYbDiag> list);
 
+    @Update("update zy_detail_charge set charge_date=#{admdate} where inpatient_no=#{zyh} " +
+            "and admiss_times=#{times} and charge_date<#{admdate}")
+    void correctFeeChargeTimeBeforeAdmiss(@Param("zyh") String zyh,
+                              @Param("times") int times,
+                              @Param("admdate") Date admdate);
+
+    @Select("select start_time from yz_act_order where inpatient_no=#{patNo} and admiss_times=#{times} " +
+            "and status_flag > '1' and isnull(group_no, '00')='00' and order_code in ('06026','06053','05973')")
+    Date selectActOrderDisDate(@Param("patNo") String patNo, @Param("times") Integer times);
+
+    @Update("update zy_detail_charge set charge_date=#{disdate} where inpatient_no=#{zyh} " +
+            "and admiss_times=#{times} and charge_date>#{disdate}")
+    void correctFeeChargeTimeAfterDismiss(@Param("zyh") String zyh,
+                              @Param("times") int times,
+                              @Param("disdate") Date disdate);
+
     @Update("update zy_ledger_file set deposit=(select isnull(sum(depo_amount),0) from zy_deposit_file f with(nolock) " +
             "where f.inpatient_no=#{zyh} and f.admiss_times=#{times} and f.ledger_sn=#{ledger} and f.status in ('1','2') ) " +
             "where inpatient_no=#{zyh} and admiss_times=#{times} and ledger_sn=#{ledger}")

+ 2 - 0
src/main/java/thyyxxk/webserver/entity/examinations/covidexam/CovidExamResult.java

@@ -18,6 +18,8 @@ public class CovidExamResult {
     @JsonFormat(timezone = "GMT+8", pattern = "yyyy/MM/dd HH:mm:ss", shape = JsonFormat.Shape.STRING)
     private Date ordrCreateDate;
 
+    private String ordrCreateIns = "长沙泰和医院";
+
     /**
      * 流调报告
      * */

+ 18 - 0
src/main/java/thyyxxk/webserver/entity/inpatient/doctorsadvise/BriefPatInfo.java

@@ -0,0 +1,18 @@
+package thyyxxk.webserver.entity.inpatient.doctorsadvise;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+public class BriefPatInfo {
+    private String patNo;
+    private Integer times;
+    private String name;
+    private String bedNo;
+    private BigDecimal totalCharge;
+    private BigDecimal balance;
+    private Date admdate;
+    private String ownFlag;
+}

+ 22 - 0
src/main/java/thyyxxk/webserver/service/inpatient/DoctorsAdviseService.java

@@ -0,0 +1,22 @@
+package thyyxxk.webserver.service.inpatient;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import thyyxxk.webserver.dao.his.inpatient.DoctorsAdviseDao;
+import thyyxxk.webserver.entity.inpatient.doctorsadvise.BriefPatInfo;
+
+import java.util.List;
+
+@Service
+public class DoctorsAdviseService {
+    private final DoctorsAdviseDao dao;
+
+    @Autowired
+    public DoctorsAdviseService(DoctorsAdviseDao dao) {
+        this.dao = dao;
+    }
+
+    public List<BriefPatInfo> selectPatientList(String ward) {
+        return dao.selectPatientList(ward);
+    }
+}

+ 6 - 0
src/main/java/thyyxxk/webserver/service/inpatient/PatientService.java

@@ -23,6 +23,7 @@ import thyyxxk.webserver.utils.*;
 
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -298,6 +299,11 @@ public class PatientService {
         int times = p.getAdmissTimes();
         int infant = zyh.startsWith("$") ? 1 : 0;
         int ledger = p.getLedgerSn();
+        dao.correctFeeChargeTimeBeforeAdmiss(zyh, times, p.getAdmissDate());
+        Date disdate = dao.selectActOrderDisDate(zyh, times);
+        if (null != disdate) {
+            dao.correctFeeChargeTimeAfterDismiss(zyh, times, disdate);
+        }
         dao.recountDeposit(zyh, times, ledger);
         dao.zyReceiveDrug(zyh, times, infant);
         dao.zyReceiveOne(zyh, times, infant);

+ 40 - 17
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiQueryService.java

@@ -452,28 +452,20 @@ public class SiQueryService {
 
     private Map<String, String[]> analyseFeedtle(List<SiSetlFeeDetl> fees) {
         Map<String, String[]> map = new HashMap<>();
-        map.put("zhj", new String[]{"合计", "0.00", "0.00", "0.00"});
+        map.put("zhj", new String[]{"合计", "0.00", "0.00", "0.00", "0.00"});
         fees.forEach(itm -> {
-            if (StringUtil.isBlank(itm.getChrgitmLvName())) {
-                ChrgitmLv chrgitmLv = ChrgitmLv.get(itm.getChrgitmLv());
-                if (null == chrgitmLv) {
-                    chrgitmLv = ChrgitmLv.SELF_PAY;
-                }
+            ChrgitmLv chrgitmLv = ChrgitmLv.get(itm.getChrgitmLv());
+            if (null == chrgitmLv) {
+                chrgitmLv = ChrgitmLv.SELF_PAY;
                 itm.setChrgitmLvName(chrgitmLv.getName());
             }
-
             String[] all = map.get("zhj");
-            all[1] = DecimalUtil.add(all[1], itm.getDetItemFeeSumamt());
-            all[2] = DecimalUtil.add(all[2], itm.getInscpScpAmt());
-            all[3] = DecimalUtil.add(all[3], DecimalUtil.minus(itm.getDetItemFeeSumamt(), itm.getInscpScpAmt()));
-
+            sumChargeFeeByType(itm, chrgitmLv, all);
             if (map.containsKey(itm.getMedChrgitmType())) {
                 String[] dtle = map.get(itm.getMedChrgitmType());
-                dtle[1] = DecimalUtil.add(dtle[1], itm.getDetItemFeeSumamt());
-                dtle[2] = DecimalUtil.add(dtle[2], itm.getInscpScpAmt());
-                dtle[3] = DecimalUtil.add(dtle[3], DecimalUtil.minus(itm.getDetItemFeeSumamt(), itm.getInscpScpAmt()));
+                sumChargeFeeByType(itm, chrgitmLv, dtle);
             } else {
-                String[] dtle = new String[4];
+                String[] dtle = new String[5];
                 MedChrgitmType type = MedChrgitmType.get(itm.getMedChrgitmType());
                 if (type == null) {
                     type = MedChrgitmType.OTH;
@@ -481,8 +473,24 @@ public class SiQueryService {
                 }
                 dtle[0] = type.getName();
                 dtle[1] = itm.getDetItemFeeSumamt();
-                dtle[2] = itm.getInscpScpAmt();
-                dtle[3] = DecimalUtil.minus(itm.getDetItemFeeSumamt(), itm.getInscpScpAmt());
+
+                switch (chrgitmLv) {
+                    case FIRST_CLASS:
+                        dtle[2] = itm.getDetItemFeeSumamt();
+                        dtle[3] = "0.00";
+                        dtle[4] = "0.00";
+                        break;
+                    case SECOND_CLASS:
+                        dtle[3] = itm.getDetItemFeeSumamt();
+                        dtle[2] = "0.00";
+                        dtle[4] = "0.00";
+                        break;
+                    case SELF_PAY:
+                        dtle[4] = itm.getDetItemFeeSumamt();
+                        dtle[3] = "0.00";
+                        dtle[2] = "0.00";
+                        break;
+                }
                 map.put(type.getCode(), dtle);
             }
         });
@@ -496,6 +504,21 @@ public class SiQueryService {
         return map;
     }
 
+    private void sumChargeFeeByType(SiSetlFeeDetl itm, ChrgitmLv chrgitmLv, String[] dtle) {
+        dtle[1] = DecimalUtil.add(dtle[1], itm.getDetItemFeeSumamt());
+        switch (chrgitmLv) {
+            case FIRST_CLASS:
+                dtle[2] = DecimalUtil.add(dtle[2], itm.getDetItemFeeSumamt());
+                break;
+            case SECOND_CLASS:
+                dtle[3] = DecimalUtil.add(dtle[3], itm.getDetItemFeeSumamt());
+                break;
+            case SELF_PAY:
+                dtle[4] = DecimalUtil.add(dtle[4], itm.getDetItemFeeSumamt());
+                break;
+        }
+    }
+
     public ResultVo<List<TrtInfo>> checkPersonTreatment(BscQryPrm q) {
         JSONObject input = exec.makeTradeHeaderWithInsureArea(SiFunction.CHECK_PERSON_TREATMENT, dao.selectAdmdvs(q.getPatNo(), q.getTimes()));
         JSONObject data = new JSONObject();