Bladeren bron

号表维护功能开发完成

hurugang 5 jaren geleden
bovenliggende
commit
f9d7675124

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

@@ -1,20 +1,14 @@
 package cn.hnthyy.thmz.common;
 
-import cn.hnthyy.thmz.entity.his.MzyRequest;
 import cn.hnthyy.thmz.service.his.ChargeFeeVoService;
-import cn.hnthyy.thmz.service.his.MzyRequestService;
 import cn.hnthyy.thmz.service.his.ZyDayclosingRecordService;
 import cn.hnthyy.thmz.service.thmz.TokenService;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.time.DateFormatUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.scheduling.annotation.EnableScheduling;
 import org.springframework.scheduling.annotation.Scheduled;
 
-import java.util.Date;
-import java.util.List;
-
 /**
  * 定时任务类
  */
@@ -27,8 +21,6 @@ public class ScheduledService {
     @Autowired
     private TokenService tokenService;
     @Autowired
-    private MzyRequestService mzyRequestService;
-    @Autowired
     private ChargeFeeVoService chargeFeeVoService;
     @Autowired
     private ZyDayclosingRecordService zyDayclosingRecordService;
@@ -42,13 +34,13 @@ public class ScheduledService {
 
 
 
-    /**
-     * 每天凌晨零点五分运行一次
-     */
-    @Scheduled(cron = "5 0 0 * * *")
-    public void scheduled() {
-        process();
-    }
+//    /**
+//     * 每天凌晨零点五分运行一次
+//     */
+//    @Scheduled(cron = "5 0 0 * * *")
+//    public void scheduled() {
+//        process();
+//    }
 
     /**
      * 每天23时58分将自助收费做日结
@@ -59,18 +51,18 @@ public class ScheduledService {
     }
 
 
-
-    /**
-     * 处理入库数据
-     *
-     */
-    private void process() {
-        List<MzyRequest> requests = mzyRequestService.queryMzyRequestByRequestDay(DateFormatUtils.format(new Date(), "yyyy-MM-dd"));
-        //此时排班表数据没有同步过来,需要手动同步,以后排班系统重做后需要移除此功能
-        if(requests==null || requests.size()==0){
-            mzyRequestService.synchronizationRequest();
-        }
-    }
+//
+//    /**
+//     * 处理入库数据
+//     *
+//     */
+//    private void process() {
+//        List<MzyRequest> requests = mzyRequestService.queryMzyRequestByRequestDay(DateFormatUtils.format(new Date(), "yyyy-MM-dd"));
+//        //此时排班表数据没有同步过来,需要手动同步,以后排班系统重做后需要移除此功能
+//        if(requests==null || requests.size()==0){
+//            mzyRequestService.synchronizationRequest();
+//        }
+//    }
 
 
 

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

@@ -53,16 +53,6 @@ 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);
             List<ZdUnitCode> data = new ArrayList<>();
             if (unitCodes != null && unitCodes.size() > 0) {
@@ -72,7 +62,6 @@ public class MzyRequestController {
                         if (zdUnitCode != null) {
                             data.add(zdUnitCode);
                         }
-                        //ZdUnitCode zdUnitCode = new ZdUnitCode(u, zdUnitCodeService.queryDeptNameByIdInCache(u));
                     }
                 });
             }

+ 15 - 0
src/main/java/cn/hnthyy/thmz/entity/his/MzyRequest.java

@@ -55,4 +55,19 @@ public class MzyRequest implements Serializable{
     //号别名称
     private String chargeTypeName;
 
+
+
+
+
+    //号段日期 老系统表维护的时候的组合键
+    private Date requestDayOld;
+    //上午/下午/中午/全天(a/p/n/d)  老系统表维护的时候的组合键
+    private String ampmOld;
+    //科室id  老系统表维护的时候的组合键
+    private String unitCodeOld;
+    //医生编码  老系统表维护的时候的组合键
+    private String doctorCodeOld;
+    //号别  老系统表维护的时候的组合键
+    private String chargeTypeOld;
+
 }

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

@@ -175,4 +175,22 @@ public interface MzyRequestMapper {
             "         request_day <= #{endDate,jdbcType=TIMESTAMP} order by request_day ")
     List<MzyRequest> selectByTimes(@Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
 
+
+    /**
+     * 更新号表
+     * @param mzyRequest
+     * @return
+     */
+    @Update("update mzy_request_new set request_day=#{requestDay,jdbcType=DATE},ampm=#{ampm},unit_code=#{unitCode},doctor_code=#{doctorCode},charge_type=#{chargeType},total_num=#{totalNum},left_num=#{leftNum,jdbcType=INTEGER}, bespeak_no=#{bespeakNo,jdbcType=SMALLINT} where id = #{id,jdbcType=BIGINT}")
+    int updateMzyRequestNew(MzyRequest mzyRequest);
+
+
+    /**
+     * 更新老号表
+     * @param mzyRequest
+     * @return
+     */
+    @Update("update mzy_request set request_day=#{requestDay,jdbcType=DATE},ampm=#{ampm},unit_code=#{unitCode},doctor_code=#{doctorCode},charge_type=#{chargeType},total_num=#{totalNum},left_num=#{leftNum,jdbcType=INTEGER}, bespeak_no=#{bespeakNo,jdbcType=SMALLINT} where request_day=#{requestDayOld,jdbcType=DATE} and ampm=#{ampmOld} and unit_code=#{unitCodeOld}  and doctor_code=#{doctorCodeOld} and charge_type=#{chargeTypeOld} ")
+    int updateMzyRequestOld(MzyRequest mzyRequest);
+
 }

+ 15 - 4
src/main/java/cn/hnthyy/thmz/service/impl/his/MzyRequestServiceImpl.java

@@ -139,12 +139,23 @@ public class MzyRequestServiceImpl implements MzyRequestService {
         Date now = new Date();
         for (MzyRequest m:mzyRequests){
             if(m!=null){
-                m.setGroupCode("");
                 m.setOpId(opId);
                 m.setSysDate(now);
-                m.setDelFlag(YesNoEnum.NO.code);
-                mzyRequestMapper.insertRequest(m);
-                mzyRequestMapper.insertOldRequest(m);
+                if(m.getId()!=null){
+                    MzyRequest dbMzyRequest = mzyRequestMapper.selectMzyRequestById(m.getId());
+                    m.setRequestDayOld(dbMzyRequest.getRequestDay());
+                    m.setAmpmOld(dbMzyRequest.getAmpm());
+                    m.setUnitCodeOld(dbMzyRequest.getUnitCode());
+                    m.setDoctorCodeOld(dbMzyRequest.getDoctorCode());
+                    m.setChargeTypeOld(dbMzyRequest.getChargeType());
+                    mzyRequestMapper.updateMzyRequestNew(m);
+                    mzyRequestMapper.updateMzyRequestOld(m);
+                }else {
+                    m.setGroupCode("");
+                    m.setDelFlag(YesNoEnum.NO.code);
+                    mzyRequestMapper.insertRequest(m);
+                    mzyRequestMapper.insertOldRequest(m);
+                }
             }
         }
         return mzyRequests.size();

+ 32 - 10
src/main/resources/static/js/request.js

@@ -29,6 +29,8 @@ $(function () {
         initSourceList();
         $("#btn_creat").removeClass('in').addClass('hide');
         $("#btn_cancel").removeClass('hide').addClass('in');
+        $("#tb_table_1").css("display","block");
+        $("#tb_table_2").css("display","block");
     });
     $("#btn_cancel").click(function (t) {
         showTwoTable = false;
@@ -37,6 +39,8 @@ $(function () {
         initSourceList();
         $("#btn_cancel").removeClass('in').addClass('hide');
         $("#btn_creat").removeClass('hide').addClass('in');
+        $("#tb_table_1").css("display","none");
+        $("#tb_table_2").css("display","none");
     });
 
     $("#btn_add").click(function (t) {
@@ -229,7 +233,6 @@ function initSourceList() {
                 valign: 'middle',
                 formatter: function (value, row, index) {
                     var str = '<button type="button" class="btn btn-primary  btn-sm" onclick="updateRequest(' + row.id + ')">编辑</button>';
-                    str += '<button type="button" class="btn btn-error  btn-sm" onclick="dleteRequest(' + row.id + ')">删除</button>';
                     return [str].join('');
                 }
             },
@@ -408,8 +411,7 @@ function initNewListCommon(url, newParams) {
                 align: "center",
                 valign: 'middle',
                 formatter: function (value, row, index) {
-                    var str = '<button type="button" class="btn btn-primary  btn-sm" onclick="updateRequest(' + row.id + ')">编辑</button>';
-                    str += '<button type="button" class="btn btn-error  btn-sm" onclick="dleteRequest(' + row.id + ')">删除</button>';
+                    var str = '<button type="button" class="btn btn-primary  btn-sm" onclick="updateRequestByIndex(' + index + ')">编辑</button>';
                     return [str].join('');
                 }
             },
@@ -601,6 +603,8 @@ function cleanParams() {
  * 保存临时生成的新号表数据
  */
 function saveTempRequest() {
+   var index =$("#requestId").val();
+    var realParams = JSON.parse('{"mzyRequests":""}');
     var tempJson = JSON.parse('{"requestDay":"","ampm":"","unitCode":"","doctorCode":"","chargeType":"","totalNum":"","leftNum":"","bespeakNo":"1","checkFee":""}');
     tempJson.requestDay = $("#editDay").val();
     tempJson.ampm = $("#ampm").val();
@@ -610,8 +614,11 @@ function saveTempRequest() {
     tempJson.totalNum = $("#totalNum").val();
     tempJson.leftNum = $("#totalNum").val();
     tempJson.checkFee = $("#checkFee").val();
-    tempData[tempData.length] = tempJson;
-    var realParams = JSON.parse('{"mzyRequests":""}');
+    if(index==null || index ==""){
+        tempData[tempData.length] = tempJson;
+    }else {
+        tempData[index] = tempJson;
+    }
     realParams.mzyRequests = tempData;
     $("#editModal").modal("hide");
     initNewListCommon("/thmz/formatRequest", realParams);
@@ -827,11 +834,26 @@ function updateRequest(id) {
     });
 }
 
-
 /**
- * 删除号表信息
- * @param id
+ * 临时新号表修改
+ * @param index
  */
-function dleteRequest(id) {
+function updateRequestByIndex(index) {
+    $("#requestId").val(index);
+    var data =tempData[index];
+    $("#classTitle").text("修改");
+    $("#editDay").val(format(data.requestDay, "yyyy-MM-dd"));
+    $('#ampm').selectpicker('val', data.ampm);
+    $('#ampm').selectpicker('refresh');
+    $('#deptNo').selectpicker('val', data.unitCode);
+    $('#deptNo').selectpicker('refresh');
+    $('#doctorParam').selectpicker('val', data.doctorCode);
+    $('#doctorParam').selectpicker('refresh');
+    $('#chargeType').selectpicker('val', data.chargeType);
+    $('#chargeType').selectpicker('refresh');
+    $("#totalNum").val(data.totalNum);
+    $("#totalNum").val(data.leftNum);
+    $("#checkFee").val(data.checkFee);
+    $("#editModal").modal();
+}
 
-}