hurugang 5 år sedan
förälder
incheckning
b2fd1809c1

+ 1 - 1
src/main/java/cn/hnthyy/thmz/common/ScheduledService.java

@@ -45,7 +45,7 @@ public class ScheduledService {
     }
 
 
-    @Scheduled(cron = "40 30 * * * *")
+    @Scheduled(cron = "5 0 2 * * *")
     public void scheduledFull() {
         process();
     }

+ 11 - 6
src/main/java/cn/hnthyy/thmz/controller/MzyRequestController.java

@@ -1,5 +1,6 @@
 package cn.hnthyy.thmz.controller;
 
+import cn.hnthyy.thmz.Utils.DateUtil;
 import cn.hnthyy.thmz.comment.UserLoginToken;
 import cn.hnthyy.thmz.entity.his.Employee;
 import cn.hnthyy.thmz.entity.his.MzyRequest;
@@ -44,13 +45,17 @@ public class MzyRequestController {
                 resultMap.put("message", "挂号时间区间不能为空");
                 return resultMap;
             }
+            //此时排班表数据没有同步过来,需要手动同步,以后排版系统重做后需要移除此功能
+            List<MzyRequest> mzyRequests=mzyRequestService.queryRequestForToday(DateUtil.getFirstSecond(new Date()));
+            if(mzyRequests!=null && mzyRequests.size()>0){
+                for (MzyRequest mzyRequest:mzyRequests){
+                    MzyRequest dbMzyRequest=mzyRequestService.queryMzyRequestByAllParams(mzyRequest);
+                    if(dbMzyRequest==null){
+                        mzyRequestService.saveRequest(mzyRequest);
+                    }
+                }
+            }
             List<String> unitCodes = mzyRequestService.queryUnitCodeByRequestDay(DateFormatUtils.format(new Date(), "yyyy-MM-dd"), ampm);
-//            //此时排班表数据没有同步过来,需要手动同步,以后排版系统重做后需要移除此功能
-//            if(unitCodes==null || unitCodes.size()==0){
-//                mzyRequestService.synchronizationRequest();
-//                //数据导入后重新查询
-//                unitCodes = mzyRequestService.queryUnitCodeByRequestDay(DateFormatUtils.format(new Date(), "yyyy-MM-dd"), ampm);
-//            }
             List<ZdUnitCode> data = new ArrayList<>();
             if (unitCodes != null && unitCodes.size() > 0) {
                 unitCodes.forEach(u -> {

+ 1 - 1
src/main/java/cn/hnthyy/thmz/mapper/his/MzChargeDetailMapper.java

@@ -500,7 +500,7 @@ public interface MzChargeDetailMapper {
      */
     @Select({"<script>",
             "SELECT distinct rtrim(a.patient_id) patient_id,name,a.times,a.receipt_no,charge_date=convert(char(10),a.charge_date,111) ,a.serial_no,real_no ,a.responce_type," +
-            " cheque_type=case when mz_receipt_serial.cheque_type='Y' " +
+            " cheque_type=case when mz_receipt_serial.cheque_type='Y' and cash_id <![CDATA[<>]]> '99999' " +
             " and len(ltrim(rtrim(mz_receipt_serial.receipt_bill))) <![CDATA[>=]]> 10 then '本院记账' else '自费' end " +
             "    FROM mz_charge_detail a,mz_receipt_serial " +
             "    WHERE a.charge_date <![CDATA[>=]]> #{beginDate,jdbcType=TIMESTAMP} and a.charge_date <![CDATA[<=]]> #{endDate,jdbcType=TIMESTAMP}  " +

+ 36 - 0
src/main/java/cn/hnthyy/thmz/mapper/his/MzyRequestMapper.java

@@ -6,6 +6,7 @@ import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.apache.ibatis.annotations.Update;
 
+import java.util.Date;
 import java.util.List;
 
 public interface MzyRequestMapper {
@@ -73,4 +74,39 @@ public interface MzyRequestMapper {
             "select request_day,ampm,unit_code,group_code,doctor_code,charge_type,op_id,total_num,left_num,bespeak_no,check_fee,sys_date,del_flag " +
             " from mzy_request where request_day >=(select top 1 request_day from mzy_request_new order by request_day desc ) and request_day <> '7019-10-27 00:00:00.000' order by request_day asc")
     int synchronizationRequest();
+
+
+//    /**
+//     * 查询最新的排班信息
+//     * @return
+//     */
+//    @Select("select request_day,ampm,unit_code,group_code,doctor_code,charge_type,op_id,total_num,left_num,bespeak_no,check_fee,sys_date,del_flag " +
+//            " from mzy_request where request_day >=(select top 1 request_day from mzy_request_new order by request_day desc ) and request_day <> '7019-10-27 00:00:00.000' order by request_day asc")
+//    List<MzyRequest> selectNewRequest();
+
+
+    /**
+     * 查询当天最新的排班信息
+     * @return
+     */
+    @Select("select request_day,ampm,unit_code,group_code,doctor_code,charge_type,op_id,total_num,left_num,bespeak_no,check_fee,sys_date,del_flag " +
+            " from mzy_request where request_day =#{today,jdbcType=DATE}")
+    List<MzyRequest> selectRequestForToday(Date today);
+
+    /**
+     * 根据所以筛选条件查询号表
+     * @param mzyRequest
+     * @return
+     */
+    @Select("select * from mzy_request_new where  ampm = #{ampm} and unit_code = #{unitCode}  and request_day = #{requestDay,jdbcType=DATE} and doctor_code =#{doctorCode} and charge_type =#{chargeType}  ")
+    MzyRequest selectMzyRequestByAllParams(MzyRequest mzyRequest);
+
+    /**
+     * 保存排班表
+     * @return
+     */
+    @Insert("insert into mzy_request_new(request_day,ampm,unit_code,group_code,doctor_code,charge_type,op_id,total_num,left_num,bespeak_no,check_fee,sys_date,del_flag) " +
+            "values(#{requestDay,jdbcType=DATE},#{ampm},#{unitCode},#{groupCode},#{doctorCode},#{chargeType},#{opId},#{totalNum},#{leftNum},#{bespeakNo},#{checkFee},#{sysDate,jdbcType=DATE},#{delFlag})")
+    int insertRequest(MzyRequest mzyRequest);
+
 }

+ 22 - 1
src/main/java/cn/hnthyy/thmz/service/his/MzyRequestService.java

@@ -3,7 +3,6 @@ package cn.hnthyy.thmz.service.his;
 import cn.hnthyy.thmz.entity.MzException;
 import cn.hnthyy.thmz.entity.his.MzyRequest;
 import cn.hnthyy.thmz.entity.his.MzyZdChargeType;
-import org.apache.ibatis.annotations.Insert;
 
 import java.util.Date;
 import java.util.List;
@@ -61,4 +60,26 @@ public interface MzyRequestService {
      * @return
      */
     int synchronizationRequest();
+
+
+    /**
+     * 查询当天最新的排班信息
+     * @return
+     */
+    List<MzyRequest> queryRequestForToday(Date today);
+
+
+    /**
+     * 根据所以筛选条件查询号表
+     * @param mzyRequest
+     * @return
+     */
+    MzyRequest queryMzyRequestByAllParams(MzyRequest mzyRequest);
+
+
+    /**
+     * 保存排班表
+     * @return
+     */
+    int saveRequest(MzyRequest mzyRequest);
 }

+ 16 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/MzyRequestServiceImpl.java

@@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 
 @Service
@@ -91,4 +92,19 @@ public class MzyRequestServiceImpl implements MzyRequestService {
     public int synchronizationRequest() {
         return mzyRequestMapper.synchronizationRequest();
     }
+
+    @Override
+    public List<MzyRequest> queryRequestForToday(Date today) {
+        return mzyRequestMapper.selectRequestForToday(today);
+    }
+
+    @Override
+    public MzyRequest queryMzyRequestByAllParams(MzyRequest mzyRequest) {
+        return mzyRequestMapper.selectMzyRequestByAllParams(mzyRequest);
+    }
+
+    @Override
+    public int saveRequest(MzyRequest mzyRequest) {
+        return mzyRequestMapper.insertRequest(mzyRequest);
+    }
 }

+ 6 - 6
src/main/resources/application.yml

@@ -13,18 +13,18 @@ spring:
       max-request-size: 100MB
   datasource:
     his:
-      #jdbc-url: "jdbc:sqlserver://172.16.32.168:1433;databaseName=thxyhisdb"
-      jdbc-url: "jdbc:sqlserver://172.16.32.160:1433;databaseName=thxyhisdb"
+      jdbc-url: "jdbc:sqlserver://172.16.32.168:1433;databaseName=thxyhisdb"
+      #jdbc-url: "jdbc:sqlserver://172.16.32.160:1433;databaseName=thxyhisdb"
       username: "sa"
       password:
       #password: "SAthyy123"
       driver-class-name: "com.microsoft.sqlserver.jdbc.SQLServerDriver"
     thmz:
-      jdbc-url: "jdbc:mariadb://localhost:3306/thyy_mz_system?useUnicode=true&characterEncoding=utf-8"
-      #jdbc-url: "jdbc:mariadb://172.16.32.160:3306/thyy_mz_system?useUnicode=true&characterEncoding=utf-8"
+      #jdbc-url: "jdbc:mariadb://localhost:3306/thyy_mz_system?useUnicode=true&characterEncoding=utf-8"
+      jdbc-url: "jdbc:mariadb://172.16.32.160:3306/thyy_mz_system?useUnicode=true&characterEncoding=utf-8"
       username: "root"
-      password: "hrg49086"
-      #password: "thyy@2018"
+      #password: "hrg49086"
+      password: "thyy@2018"
       driver-class-name: "org.mariadb.jdbc.Driver"
   devtools:
     restart:

+ 8 - 8
src/main/resources/templates/charge_list.html

@@ -24,14 +24,14 @@
             <div class="panel-body">
                 <form id="formSearch" class="form-horizontal" autocomplete="off">
                     <div class="form-group col-md-12 col-sm-12 col-xs-12">
-                        <div class="col-md-5 col-sm-5 col-xs-12"></div>
+                        <div class="col-md-3 col-sm-3 col-xs-12"></div>
                         <label class="control-label col-md-1 col-sm-1 col-xs-12" for="name">姓名
                         </label>
                         <div class="col-md-2 col-sm-2 col-xs-12">
                             <input id="name" class="form-control col-md-7 col-xs-12" type="text"
                                    placeholder="姓名">
                         </div>
-                        <label class="control-label col-md-1 col-sm-1 col-xs-12" for="patientId_or_cardNo">病人ID/就诊卡号
+                        <label class="control-label col-md-2 col-sm-2 col-xs-12" for="patientId_or_cardNo">病人ID/就诊卡号
                         </label>
                         <div class="col-md-2 col-sm-2 col-xs-12">
                             <input id="patientId_or_cardNo" class="form-control col-md-7 col-xs-12" type="text"
@@ -39,14 +39,14 @@
                                    placeholder="病人ID/就诊卡号">
                             <input id="patientId" type="hidden">
                         </div>
-                        <div class="col-md-1 col-sm-1 col-xs-12">
+                        <div class="col-md-2 col-sm-2 col-xs-12" style="padding-left: 50px;">
                             <label>
                                 历史数据 <input id="hisData" type="checkbox"/>
                             </label>
                         </div>
                     </div>
                     <div class="form-group col-md-12 col-sm-12 col-xs-12">
-                        <div class="col-md-5 col-sm-5 col-xs-12"></div>
+                        <div class="col-md-3 col-sm-3 col-xs-12"></div>
                         <label class="control-label col-md-1 col-sm-1 col-xs-12" for="serialNo">机制号
                         </label>
                         <div class="col-md-1 col-sm-1 col-xs-12">
@@ -55,7 +55,7 @@
                         </div>
                         <label class="control-label col-md-1 col-sm-1 col-xs-12" for="reportrange"> 缴费日期
                         </label>
-                        <div class="col-md-2 col-sm-2 col-xs-12">
+                        <div class="col-md-3 col-sm-3 col-xs-12">
                             <div id="reportrange" class="pull-right"
                                  style="background: #fff; cursor: pointer; padding: 5px 10px; border: 1px solid #ccc">
                                 <i class="glyphicon glyphicon-calendar fa fa-calendar"></i>
@@ -65,7 +65,7 @@
                         <!--<div class="col-md-1 col-sm-1 col-xs-12" style="text-align:left;">-->
                         <!---->
                         <!--</div>-->
-                        <div class="col-md-2 col-sm-2 col-xs-12" style="text-align:left;    padding-left: 50px;">
+                        <div class="col-md-3 col-sm-3 col-xs-12" style="text-align:left;    padding-left: 50px;">
                             <button type="button" style="margin-left:20px" id="btn_clean" class="btn btn-primary"
                                     title="重置"><i class="fa fa-rotate-left"></i>
                             </button>
@@ -81,10 +81,10 @@
             </div>
 
             <div class="row">
-                <div class="col-md-4 col-sm-4 col-xs-12" style="margin-top: -20px;">
+                <div class="col-md-5 col-sm-5 col-xs-12" style="margin-top: -20px;">
                     <table id="tb_table"></table>
                 </div>
-                <div class="col-md-8 col-sm-8 col-xs-12" style="height:700px;margin:0 auto;border: 1px solid #337ab7;font-size: 16px;padding: 40px 20px 40px 20px;overflow-y: auto; overflow-x:hidden;">
+                <div class="col-md-7 col-sm-7 col-xs-12" style="height:700px;margin:0 auto;border: 1px solid #337ab7;font-size: 16px;padding: 40px 20px 40px 20px;overflow-y: auto; overflow-x:hidden;">
                     <div id="right_title">
                         <table width="100%" style="font-size: 13px;">
                             <tbody>