Jelajahi Sumber

Merge branch 'master' of https://gitlab.taihe.com/lighter/web-server

xiaochan 3 tahun lalu
induk
melakukan
8440b2ecbd

+ 1 - 1
pom.xml

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

+ 4 - 2
src/main/java/thyyxxk/webserver/controller/medicalinsurance/MarkMtFeesController.java

@@ -92,9 +92,10 @@ public class MarkMtFeesController {
         if (result.getCode() != ExceptionEnum.SUCCESS.getCode()) {
             map.put("code", -1);
             if (null == result.getMessage()) {
-                result.setMessage("医保中心网络异常!");
+                map.put("msg", "医保中心网络异常!");
+            } else {
+                map.put("msg", result.getMessage());
             }
-            map.put("msg", result.getMessage());
             return map;
         }
         FundDetail fund = result.getData();
@@ -105,6 +106,7 @@ public class MarkMtFeesController {
         payInfo.put("acctPay", fund.getAcctPay());
         payInfo.put("selfPay", fund.getSelfPay());
         map.put("code", 0);
+        map.put("msg", "成功。");
         map.put("payInfo", payInfo);
         if (settlement) {
             mzService.updateMzSaved(param.getPatientId(), param.getTimes(), 1);

+ 9 - 1
src/main/java/thyyxxk/webserver/dao/his/scheduled/DailyPatientCountDao.java

@@ -2,8 +2,11 @@ package thyyxxk.webserver.dao.his.scheduled;
 
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Select;
+import thyyxxk.webserver.entity.scheduled.ClinicCount;
 import thyyxxk.webserver.entity.scheduled.DailyPatientCount;
 
+import java.util.List;
+
 @Mapper
 public interface DailyPatientCountDao {
     @Select("select inHospCount=((select count(1) from zy_actpatient with(nolock) where inpatient_no not like 'JT%')- " +
@@ -24,7 +27,6 @@ public interface DailyPatientCountDao {
             "dangerCount=(select count(1) from yz_act_order with(nolock) where status_flag!='5' " +
             "and isnull(group_no,'00' )='00' and order_code='05887'), " +
             "operationCount=(select count(1) from op_record with(nolock) where status!='d' and datediff(day,op_datetime,getdate())=1), " +
-            "clinicCount=(select count(1) from mzy_reqrec with(nolock) where datediff(day,visit_date,getdate())=1), " +
             "rescueCount=((select count(1) from yz_act_order with(nolock) where status_flag > '2' and " +
             "datediff(day,start_time,getdate())=1 and isnull(group_no,'00' )='00' and order_code in " +
             "('05202','04311','08893','08894','01535','01537','05243','02628','05240','05242','05241','04313','01446','06383', " +
@@ -34,4 +36,10 @@ public interface DailyPatientCountDao {
             "('05202','04311','08893','08894','01535','01537','05243','02628','05240','05242','05241','04313','01446','06383', " +
             "'08897','08898','05011','01445','04312','08895','08896')))")
     DailyPatientCount selectDailyCount();
+
+    @Select("select unit_code,unit_name=(select rtrim(name) from zd_unit_code with(nolock) where code=unit_code),count(1) as count " +
+            "from mzy_reqrec with(nolock) where datediff(day,request_day,getdate())=1 and cancel_mark=0 group by unit_code " +
+            "order by count desc")
+    List<ClinicCount> selectClinicCount();
+
 }

+ 7 - 0
src/main/java/thyyxxk/webserver/dao/his/yibao/PatientDao.java

@@ -326,6 +326,13 @@ public interface PatientDao {
             "</script>")
     void insertDisDiags(@Param("staffId") String staffId, @Param("list") List<ZyInYbDiag> list);
 
+    @Update("update zy_ledger_file set deposit=(select sum(depo_amount) from zy_deposit_file f with(nolock) " +
+            "where f.inpatient_no=#{zyh} and f.admiss_times=#{times} and f.ledger_sn=#{ledger}) " +
+            "where inpatient_no=#{zyh} and admiss_times=#{times} and ledger_sn=#{ledger}")
+    void recountDeposit(@Param("zyh") String zyh,
+                        @Param("times") int times,
+                        @Param("ledger") int ledger);
+
     @Update("execute zy_receive_drug #{zyh},#{times},#{zyh},#{infant} ")
     void zyReceiveDrug(@Param("zyh") String zyh,
                        @Param("times") int times,

+ 10 - 0
src/main/java/thyyxxk/webserver/entity/scheduled/ClinicCount.java

@@ -0,0 +1,10 @@
+package thyyxxk.webserver.entity.scheduled;
+
+import lombok.Data;
+
+@Data
+public class ClinicCount {
+    private String unitCode;
+    private String unitName;
+    private Integer count;
+}

+ 9 - 7
src/main/java/thyyxxk/webserver/entity/scheduled/DailyPatientCount.java

@@ -1,7 +1,6 @@
 package thyyxxk.webserver.entity.scheduled;
 
 import lombok.Data;
-import thyyxxk.webserver.utils.DateUtil;
 
 @Data
 public class DailyPatientCount {
@@ -12,13 +11,16 @@ public class DailyPatientCount {
     private Integer heavyCount;
     private Integer dangerCount;
     private Integer operationCount;
-    private Integer clinicCount;
     private Integer rescueCount;
 
-    public String getDescription() {
-        return String.format("%s总值班情况汇报如下:住院总人数:%d,入院人数:%d,出院人数:%d,病重人数:%d,病危人数:%d,死亡人数:%d," +
-                "手术台次:%d,门诊人数:%d,抢救人次:%d。",
-                DateUtil.getYesterday(), inHospCount, admissCount, dismissCount, heavyCount, dangerCount, deadCount,
-                operationCount, clinicCount, rescueCount);
+    public void initAllCount() {
+        setInHospCount(0);
+        setAdmissCount(0);
+        setDismissCount(0);
+        setDeadCount(0);
+        setHeavyCount(0);
+        setDangerCount(0);
+        setOperationCount(0);
+        setRescueCount(0);
     }
 }

+ 32 - 2
src/main/java/thyyxxk/webserver/scheduled/DailyPatientCountTask.java

@@ -5,8 +5,13 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 import thyyxxk.webserver.dao.his.scheduled.DailyPatientCountDao;
+import thyyxxk.webserver.entity.scheduled.ClinicCount;
 import thyyxxk.webserver.entity.scheduled.DailyPatientCount;
 import thyyxxk.webserver.service.wxapi.SendWxInfoService;
+import thyyxxk.webserver.utils.DateUtil;
+
+import java.util.ArrayList;
+import java.util.List;
 
 @Component
 public class DailyPatientCountTask {
@@ -25,9 +30,34 @@ public class DailyPatientCountTask {
     public void notifyDailyCount() {
         if (executeScheduled) {
             DailyPatientCount count = dao.selectDailyCount();
-            if (null != count) {
-                service.sendGroupMsg("740552821090355200", count.getDescription());
+            List<ClinicCount> list = dao.selectClinicCount();
+            String message = makeDescription(count, list);
+            service.sendGroupMsg("740552821090355200", message);
+        }
+    }
+
+    private String makeDescription(DailyPatientCount count, List<ClinicCount> list) {
+        if (null == count) {
+            count = new DailyPatientCount();
+            count.initAllCount();
+        }
+        if (null == list) {
+            list = new ArrayList<>();
+        }
+        int clinicCount = 0;
+        StringBuilder builder = new StringBuilder();
+        if (!list.isEmpty()) {
+            builder.append("\n\n以下为挂号详情:\n");
+            for (ClinicCount item : list) {
+                clinicCount += item.getCount();
+                builder.append(item.getUnitName()).append(":").append(item.getCount()).append("\n");
             }
         }
+        String mainpart = String.format("%s总值班情况汇报如下:住院总人数:%d,入院人数:%d,出院人数:%d,病重人数:%d,病危人数:%d,死亡人数:%d," +
+                        "手术台次:%d,抢救人次:%d,挂号人数:%d。",
+                DateUtil.getYesterday(), count.getInHospCount(), count.getAdmissCount(), count.getDismissCount(),
+                count.getHeavyCount(), count.getDangerCount(), count.getDeadCount(), count.getOperationCount(),
+                count.getRescueCount(), clinicCount);
+        return mainpart + builder;
     }
 }

+ 0 - 3
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiZyService.java

@@ -221,9 +221,6 @@ public class SiZyService {
         if (infcode == 0) {
             JSONObject setlinfo = result.getJSONObject(OUTPUT).getJSONObject("setlinfo");
             String fundPay = setlinfo.getString("fund_pay_sumamt");
-            if (DecimalUtil.compare(fundPay, p.getTotalCharge()) == 1) {
-                fundPay = p.getTotalCharge();
-            }
             dao.updateFundPay(fundPay, p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
             String message = "患者【" + p.getName() + "】院内总费用与医保中心总费用一致,医保报销金额为:¥ " + fundPay + "。";
             return ResultVoUtil.success(message);

+ 1 - 0
src/main/java/thyyxxk/webserver/service/yibao/PatientService.java

@@ -231,6 +231,7 @@ public class PatientService {
         int times = p.getAdmissTimes();
         int infant = zyh.startsWith("$") ? 1 : 0;
         int ledger = p.getLedgerSn();
+        dao.recountDeposit(zyh, times, ledger);
         dao.zyReceiveDrug(zyh, times, infant);
         dao.zyReceiveOne(zyh, times, infant);
         dao.zyCnglFyjsListYz(zyh, times);