Jelajahi Sumber

号表同步开发完成

hurugang 5 tahun lalu
induk
melakukan
5443a8367c

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

@@ -45,6 +45,12 @@ public class MzyRequestController {
                 return resultMap;
             }
             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 -> {

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

@@ -1,6 +1,7 @@
 package cn.hnthyy.thmz.mapper.his;
 
 import cn.hnthyy.thmz.entity.his.MzyRequest;
+import org.apache.ibatis.annotations.Insert;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.apache.ibatis.annotations.Update;
@@ -63,4 +64,13 @@ public interface MzyRequestMapper {
     @Update("update mzy_request_new set left_num=#{leftNum,jdbcType=INTEGER}, bespeak_no=#{bespeakNo,jdbcType=SMALLINT} where " +
             "id = #{id,jdbcType=BIGINT} and left_num=#{orgiLeftNum,jdbcType=INTEGER} and bespeak_no=#{orgiBespeakNo,jdbcType=SMALLINT}")
     int updateMzyRequest(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) " +
+            "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();
 }

+ 7 - 0
src/main/java/cn/hnthyy/thmz/service/his/MzyRequestService.java

@@ -3,6 +3,7 @@ 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;
@@ -54,4 +55,10 @@ public interface MzyRequestService {
      */
     Integer getReqOrder(MzyRequest mzyRequest) throws MzException;
 
+
+    /**
+     * 同步排班表
+     * @return
+     */
+    int synchronizationRequest();
 }

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

@@ -86,4 +86,9 @@ public class MzyRequestServiceImpl implements MzyRequestService {
         }
         return mzyRequest.getOrgiBespeakNo();
     }
+
+    @Override
+    public int synchronizationRequest() {
+        return mzyRequestMapper.synchronizationRequest();
+    }
 }