소스 검색

增加号表预警功能

hurugang 5 년 전
부모
커밋
b35a128421
22개의 변경된 파일1009개의 추가작업 그리고 16개의 파일을 삭제
  1. 18 0
      src/main/java/cn/hnthyy/thmz/Utils/DateUtil.java
  2. 10 0
      src/main/java/cn/hnthyy/thmz/common/Constants.java
  3. 95 0
      src/main/java/cn/hnthyy/thmz/controller/ConfigController.java
  4. 12 0
      src/main/java/cn/hnthyy/thmz/controller/NavigationController.java
  5. 277 3
      src/main/java/cn/hnthyy/thmz/controller/api/MedicalViewApiController.java
  6. 2 0
      src/main/java/cn/hnthyy/thmz/entity/his/Employee.java
  7. 22 0
      src/main/java/cn/hnthyy/thmz/entity/thmz/Config.java
  8. 2 2
      src/main/java/cn/hnthyy/thmz/mapper/his/EmployeeMapper.java
  9. 14 0
      src/main/java/cn/hnthyy/thmz/mapper/his/MzyReqrecMapper.java
  10. 22 0
      src/main/java/cn/hnthyy/thmz/mapper/his/MzyRequestMapper.java
  11. 59 0
      src/main/java/cn/hnthyy/thmz/mapper/thmz/ConfigMapper.java
  12. 9 0
      src/main/java/cn/hnthyy/thmz/service/his/MzyReqrecService.java
  13. 10 0
      src/main/java/cn/hnthyy/thmz/service/his/MzyRequestService.java
  14. 87 9
      src/main/java/cn/hnthyy/thmz/service/impl/his/MzyReqrecServiceImpl.java
  15. 5 0
      src/main/java/cn/hnthyy/thmz/service/impl/his/MzyRequestServiceImpl.java
  16. 6 2
      src/main/java/cn/hnthyy/thmz/service/impl/his/ZdUnitCodeServiceImpl.java
  17. 28 0
      src/main/java/cn/hnthyy/thmz/service/impl/thmz/ConfigServiceImpl.java
  18. 68 0
      src/main/java/cn/hnthyy/thmz/service/impl/thmz/MessageServiceImpl.java
  19. 28 0
      src/main/java/cn/hnthyy/thmz/service/thmz/ConfigService.java
  20. 14 0
      src/main/java/cn/hnthyy/thmz/service/thmz/MessageService.java
  21. 163 0
      src/main/resources/static/js/request-config.js
  22. 58 0
      src/main/resources/templates/request-config.html

+ 18 - 0
src/main/java/cn/hnthyy/thmz/Utils/DateUtil.java

@@ -116,6 +116,24 @@ public class DateUtil {
     }
 
 
+    /**
+     * 转换时间
+     * @param time
+     * @param format
+     * @return
+     */
+    public static Date pase(Date time,String format){
+        if(time==null || StringUtils.isBlank(format)){
+            return null;
+        }
+        SimpleDateFormat smf = new SimpleDateFormat(format);
+        try {
+            return smf.parse(smf.format(time));
+        } catch (ParseException e) {
+            return null;
+        }
+    }
+
     /**
      * 转换时间
      * @param time

+ 10 - 0
src/main/java/cn/hnthyy/thmz/common/Constants.java

@@ -248,4 +248,14 @@ public class Constants {
 //     * 收费窗口号KEY
 //     */
 //    public static final String WINDOWS_NO_KEY = "windows_no";
+
+
+    /**
+     * 触发号表告警的最小号数配置的key
+     */
+    public static final String  ALARM_NUM_KEY= "alarm_num";
+    /**
+     * 号表告警的人员配置的key
+     */
+    public static final String  ALARM_USER_KEY= "alarm_user";
 }

+ 95 - 0
src/main/java/cn/hnthyy/thmz/controller/ConfigController.java

@@ -0,0 +1,95 @@
+package cn.hnthyy.thmz.controller;
+
+import cn.hnthyy.thmz.comment.UserLoginToken;
+import cn.hnthyy.thmz.entity.thmz.Config;
+import cn.hnthyy.thmz.service.thmz.ConfigService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Slf4j
+@RestController
+public class ConfigController {
+    @Autowired
+    private ConfigService configService;
+
+    /**
+     * 根据键查询配置的内容
+     *
+     * @return
+     */
+    @UserLoginToken
+    @RequestMapping(value = "/getConfigByKey", method = {RequestMethod.GET})
+    public Map<String, Object> getConfigByKey(@RequestParam("key") String key) {
+        Map<String, Object> resultMap = new HashMap<>();
+        try {
+            if (StringUtils.isBlank(key)){
+                resultMap.put("code", -1);
+                resultMap.put("message", "配置的键不能为空");
+                return resultMap;
+            }
+            Config config =configService.queryUserByKey(key);
+            if (config==null){
+                resultMap.put("code", -1);
+                resultMap.put("message", "该键没有对应的配置");
+                return resultMap;
+            }
+            resultMap.put("code", 0);
+            resultMap.put("message", "根据键查询配置的内容成功");
+            resultMap.put("data", config);
+            return resultMap;
+        }catch (Exception e){
+            e.printStackTrace();
+            log.error("根据键查询配置的内容失败,错误信息{}",e.getMessage());
+            resultMap.put("code", -1);
+            resultMap.put("message", "根据键查询配置的内容失败");
+            return resultMap;
+        }
+    }
+
+
+
+    /**
+     * 更新配置的内容
+     *
+     * @return
+     */
+    @UserLoginToken
+    @RequestMapping(value = "/setConfig", method = {RequestMethod.POST})
+    public Map<String, Object> setConfig(@RequestBody Config config) {
+        Map<String, Object> resultMap = new HashMap<>();
+        try {
+            if (config==null){
+                resultMap.put("code", -1);
+                resultMap.put("message", "参数不能为空");
+                return resultMap;
+            }
+            if (StringUtils.isBlank(config.getConfigKey())){
+                resultMap.put("code", -1);
+                resultMap.put("message", "配置的键不能为空");
+                return resultMap;
+            }
+            if (StringUtils.isBlank(config.getConfigValue())){
+                resultMap.put("code", -1);
+                resultMap.put("message", "配置的值不能为空");
+                return resultMap;
+            }
+            configService.modifyConfigByKey(config);
+            resultMap.put("code", 0);
+            resultMap.put("message", "更新配置内容成功");
+            resultMap.put("data", config);
+            return resultMap;
+        }catch (Exception e){
+            e.printStackTrace();
+            log.error("更新配置内容失败,错误信息{}",e.getMessage());
+            resultMap.put("code", -1);
+            resultMap.put("message", "更新配置内容失败");
+            return resultMap;
+        }
+    }
+
+}

+ 12 - 0
src/main/java/cn/hnthyy/thmz/controller/NavigationController.java

@@ -309,4 +309,16 @@ public class NavigationController {
     }
 
 
+    /**
+     * 号表预警设置页面
+     * @return
+     */
+    @RequestMapping("/request-config")
+    public String requestConfig(HttpServletRequest httpServletRequest) throws Exception {
+        List<String> urls = getUrls(httpServletRequest);
+        if(!urls.contains("/thmz/request-config")){
+            throw new Exception("您没有此模块的权限,请联系管理员开通!");
+        }
+        return "request-config";
+    }
 }

+ 277 - 3
src/main/java/cn/hnthyy/thmz/controller/api/MedicalViewApiController.java

@@ -10,6 +10,7 @@ import cn.hnthyy.thmz.entity.his.*;
 import cn.hnthyy.thmz.enums.PayMarkEnum;
 import cn.hnthyy.thmz.enums.YesNoEnum;
 import cn.hnthyy.thmz.pageDto.MzChargeDetailPageDto;
+import cn.hnthyy.thmz.pageDto.MzyReqrecPageDto;
 import cn.hnthyy.thmz.pageDto.ZdUnitCodePageDto;
 import cn.hnthyy.thmz.service.his.*;
 import cn.hnthyy.thmz.vo.*;
@@ -56,6 +57,8 @@ public class MedicalViewApiController {
     private MzyZdChargeTypeService mzyZdChargeTypeService;
     @Autowired
     private MzZdWorkTimeService mzZdWorkTimeService;
+    @Autowired
+    private MzyReqrecService mzyReqrecService;
 
     //海慈身份证类型
     private static final String ID_CARD_TYPE = "11";
@@ -879,8 +882,6 @@ public class MedicalViewApiController {
 
 
 
-
-
     /**
      * 预约号源统计信息查询
      *
@@ -980,7 +981,6 @@ public class MedicalViewApiController {
             }
             MzZdWorkTime mzZdWorkTime=mzZdWorkTimeService.queryMzZdWorkTimeByCode(Constants.PM);
             SimpleDateFormat simpleDateFormat=new SimpleDateFormat("HH:mm");
-            //挂还开始时间取当前时间前15分钟
             Date dateEndTime=simpleDateFormat.parse(mzZdWorkTime.getEndTime());
             long tsEndTime =dateEndTime.getTime();
             String realNowStr = simpleDateFormat.format(new Date());
@@ -991,12 +991,19 @@ public class MedicalViewApiController {
                 ampms.add(Constants.PM);
             }
             Date requestDayD = DateUtil.pase(requestDay,"yyyy-MM-dd");
+            Date toDay = DateUtil.pase(new Date(),"yyyy-MM-dd");
+            if(requestDayD.before(toDay)){
+                results.put("resultCode", -1);
+                results.put("resultMessage", "预约挂号时间已过,无法挂号,请重新选择!");
+                return results;
+            }
             List<Map<String,Object>> list=mzyRequestService.queryDoctorByDateAndDept(requestDayD,ampms,unitCode);
             if (list == null || list.size() == 0) {
                 results.put("resultCode", -1);
                 results.put("resultMessage", "没有医生排班信息");
                 return results;
             }
+            List<Map<String,Object>> removeList = new ArrayList<>();
             for(Map map :list){
                 BigDecimal fee = BigDecimal.ZERO;
                 String chargeType= (String) map.get("chargeType");
@@ -1025,6 +1032,7 @@ public class MedicalViewApiController {
                 map.remove("checkFee");
                 String doctorCode= (String) map.get("doctorCode");
                 if(StringUtils.isBlank(doctorCode)){
+                    removeList.add(map);
                    continue;
                 }
                 Employee employee= employeeService.queryByUserCode(doctorCode);
@@ -1040,6 +1048,7 @@ public class MedicalViewApiController {
                     map.put("doctorTitle",zdEmpTitle.getName());
                 }
             }
+            list.removeAll(removeList);
             results.put("resultCode", 0);
             results.put("resultMessage", "查询可以挂号的科室内医生信息成功");
             results.put("data", list);
@@ -1050,12 +1059,277 @@ public class MedicalViewApiController {
             results.put("resultMessage", "查询可以挂号的科室内医生信息失败");
             return results;
         }
+    }
 
+
+
+
+    /**
+     * 查询可以挂号的医生号源信息
+     *
+     * @return
+     */
+    @RequestMapping(value = "/getRequestByDateAndDeptAndDoctor", method = {RequestMethod.GET})
+    public Map<String, Object> getRequestByDateAndDeptAndDoctor(@RequestParam("requestDay") String requestDay, @RequestParam("unitCode")String unitCode, @RequestParam("doctorCode")String doctorCode ) {
+        Map<String, Object> results = new HashMap<>();
+        try {
+            if(StringUtils.isBlank(requestDay)){
+                results.put("resultCode", -1);
+                results.put("resultMessage", "预约挂号时间不能为空");
+                return results;
+            }
+            if(StringUtils.isBlank(unitCode)){
+                results.put("resultCode", -1);
+                results.put("resultMessage", "科室编码不能为空");
+                return results;
+            }
+            if(StringUtils.isBlank(doctorCode)){
+                results.put("resultCode", -1);
+                results.put("resultMessage", "医生编码不能为空");
+                return results;
+            }
+            List<String> ampms=null;
+            int flg = DateUtil.IsAfternoon(java.util.Calendar.getInstance().getTime().getHours());
+            if (flg >= 0){
+                ampms=Arrays.asList(Constants.AM);
+            }
+            MzZdWorkTime mzZdWorkTime=mzZdWorkTimeService.queryMzZdWorkTimeByCode(Constants.PM);
+            SimpleDateFormat simpleDateFormat=new SimpleDateFormat("HH:mm");
+            Date dateEndTime=simpleDateFormat.parse(mzZdWorkTime.getEndTime());
+            long tsEndTime =dateEndTime.getTime();
+            String realNowStr = simpleDateFormat.format(new Date());
+            Date realHour = simpleDateFormat.parse(realNowStr);
+            long realHourTs = realHour.getTime();
+            if(realHourTs>tsEndTime){
+                ampms=new ArrayList<>(ampms);
+                ampms.add(Constants.PM);
+            }
+            Date requestDayD = DateUtil.pase(requestDay,"yyyy-MM-dd");
+            Date toDay = DateUtil.pase(new Date(),"yyyy-MM-dd");
+            if(requestDayD.before(toDay)){
+                results.put("resultCode", -1);
+                results.put("resultMessage", "预约挂号时间已过,无法挂号,请重新选择!");
+                return results;
+            }
+            List<Map<String,Object>> list=mzyRequestService.queryRequestByDateAndDeptAndDoctor(requestDayD,ampms,unitCode,doctorCode);
+            if (list == null || list.size() == 0) {
+                results.put("resultCode", -1);
+                results.put("resultMessage", "没有医生排班信息");
+                return results;
+            }
+            for(Map map :list){
+                BigDecimal fee = BigDecimal.ZERO;
+                String chargeType= (String) map.get("chargeType");
+                if(StringUtils.isNotBlank(chargeType)){
+                    MzyZdChargeType mzyZdChargeType=mzyZdChargeTypeService.queryByCode(chargeType);
+                    if(mzyZdChargeType!=null){
+                        map.put("chargeType",mzyZdChargeType.getName());
+                        if(mzyZdChargeType.getReqFee()==null){
+                            mzyZdChargeType.setReqFee(BigDecimal.ZERO);
+                        }
+                        if(mzyZdChargeType.getClinicFee()==null){
+                            mzyZdChargeType.setClinicFee(BigDecimal.ZERO);
+                        }
+                        if(mzyZdChargeType.getOthFee()==null){
+                            mzyZdChargeType.setOthFee(BigDecimal.ZERO);
+                        }
+                        fee=fee.add(mzyZdChargeType.getReqFee()).add(mzyZdChargeType.getClinicFee()).add(mzyZdChargeType.getOthFee());
+                    }
+                }
+                BigDecimal checkFee= (BigDecimal) map.get("checkFee");
+                if(checkFee==null){
+                    checkFee=BigDecimal.ZERO;
+                }
+                fee=fee.add(checkFee);
+                map.put("fee",fee);
+                map.remove("checkFee");
+                Employee employee= employeeService.queryByUserCode(doctorCode);
+                if(employee!=null){
+                    map.put("doctorName",employee.getEmployeeName());
+                    if(StringUtils.isNotBlank(employee.getEmpTitCode())){
+                        ZdEmpTitle zdEmpTitle=zdEmpTitleService.queryByCode(employee.getEmpTitCode());
+                        if(zdEmpTitle!=null){
+                            map.put("doctorTitle",zdEmpTitle.getName());
+                        }
+                    }
+                }
+                String ampm = (String) map.get("ampm");
+                if(Constants.AM.equals(ampm)){
+                    ampm="上午";
+                }else if(Constants.PM.equals(ampm)){
+                    ampm="下午";
+                }else if (Constants.DAY.equals(ampm)){
+                    ampm="全天";
+                }
+                map.put("ampm",ampm);
+            }
+            results.put("resultCode", 0);
+            results.put("resultMessage", "查询可以挂号的医生号源信息成功");
+            results.put("data", list);
+            return results;
+        }catch (Exception e){
+            e.printStackTrace();
+            results.put("resultCode", -1);
+            results.put("resultMessage", "查询可以挂号的医生号源信息失败");
+            return results;
+        }
     }
 
 
 
 
+    /**
+     * 门诊挂号支付
+     * @return
+     */
+    @RequestMapping(value = "/payRegistrationFormHaiCi", method = {RequestMethod.POST})
+    public Map<String, Object> payRegistrationFormHaiCi(@RequestBody MzyReqrecPageDto mzyReqrecPageDto) {
+        Map<String, Object> resultMap = new HashMap<>();
+        try {
+            if(mzyReqrecPageDto==null || mzyReqrecPageDto.getMzyReqrec()==null){
+                resultMap.put("code", -1);
+                resultMap.put("message", "挂号参数不能为空");
+                return resultMap;
+            }
+            MzyReqrec mzyReqrec = mzyReqrecPageDto.getMzyReqrec();
+            if(StringUtils.isBlank(mzyReqrec.getPatientId())){
+                resultMap.put("code", -1);
+                resultMap.put("message", "病人id不能为空");
+                return resultMap;
+            }
+            if(StringUtils.isBlank(mzyReqrec.getPaymode())){
+                resultMap.put("code", -1);
+                resultMap.put("message", "付款方式不能为空");
+                return resultMap;
+            }
+            if (!Arrays.asList(WX, ZFB).contains(mzyReqrec.getPaymode())) {
+                resultMap.put("resultCode", -1);
+                resultMap.put("resultMessage", "支付方式有误,请联系管理员");
+                return resultMap;
+            }
+            if(StringUtils.isBlank(mzyReqrec.getAgtordnum())){
+                resultMap.put("code", -1);
+                resultMap.put("message", "流水号不能为空");
+                return resultMap;
+            }
+            if(StringUtils.isBlank(mzyReqrec.getPsordnum())){
+                resultMap.put("code", -1);
+                resultMap.put("message", "订单号不能为空");
+                return resultMap;
+            }
+            if(mzyReqrecPageDto.getMzyRequestId()==null){
+                resultMap.put("code", -1);
+                resultMap.put("message", "门诊号表主键不能为空");
+                return resultMap;
+            }
+            mzyReqrecPageDto.setResponceType("01");
+            MzyRequest mzyRequest= mzyRequestService.queryById(mzyReqrecPageDto.getMzyRequestId());
+            if(mzyRequest==null){
+                resultMap.put("code", -1);
+                resultMap.put("message", "挂号信息对应的号表不存在");
+                return resultMap;
+            }
+            mzyReqrec.setAmpm(mzyRequest.getAmpm());
+            mzyReqrec.setUnitCode(mzyRequest.getUnitCode());
+            mzyReqrec.setChargeType(mzyRequest.getChargeType());
+            mzyReqrec.setDoctorCode(mzyRequest.getDoctorCode());
+            MzZdWorkTime mzZdWorkTime=mzZdWorkTimeService.queryMzZdWorkTimeByCode(mzyReqrec.getAmpm());
+            if(mzZdWorkTime==null){
+                resultMap.put("code", -1);
+                resultMap.put("message", "号段不存在");
+                return resultMap;
+            }
+            mzyReqrec.setOpId(Constants.BRZZJF_CODE);
+            int num =mzyReqrecService.saveMzyReqrec(mzyReqrecPageDto);
+            if(num==0){
+                resultMap.put("code", -1);
+                resultMap.put("message", "挂号失败,请稍后重试!");
+                return resultMap;
+            }
+            resultMap.put("code", 0);
+            resultMap.put("message", "保存挂号信息成功");
+            return resultMap;
+        }catch (Exception e){
+            e.printStackTrace();
+            resultMap.put("code", -1);
+            resultMap.put("message", StringUtils.isBlank(e.getMessage())?"挂号失败,系统出错,请联系管理员":e.getMessage());
+            log.error("挂号失败,系统异常,错误信息{}",e.getMessage());
+            return resultMap;
+        }
+    }
+
+
+
+    /**
+     * 门诊挂号订单支付状态查询
+     *
+     * @param haiciCharge
+     * @return
+     */
+    @RequestMapping(value = "/getPayStatusForRegistration", method = {RequestMethod.POST})
+    public Map<String, Object> getPayStatusForRegistration(@RequestBody HaiciCharge haiciCharge) {
+        Map<String, Object> results = new HashMap<>();
+        if (haiciCharge == null) {
+            results.put("resultCode", -1);
+            results.put("resultMessage", "门诊挂号订单支付状态查询参数为空");
+            return results;
+        }
+        if (StringUtils.isBlank(haiciCharge.getPsOrdNum())) {
+            results.put("resultCode", -1);
+            results.put("resultMessage", "平台订单号不能为空");
+            return results;
+        }
+        if (StringUtils.isBlank(haiciCharge.getPayMode())) {
+            results.put("resultCode", -1);
+            results.put("resultMessage", "支付方式不能为空");
+            return results;
+        }
+        if (!Arrays.asList(WX, ZFB).contains(haiciCharge.getPayMode())) {
+            results.put("resultCode", -1);
+            results.put("resultMessage", "支付方式有误,请联系管理员");
+            return results;
+        }
+        if (haiciCharge.getPayAmt() == null) {
+            results.put("resultCode", -1);
+            results.put("resultMessage", "支付金额不能为空");
+            return results;
+        }
+        if (StringUtils.isBlank(haiciCharge.getAgtOrdNum())) {
+            results.put("resultCode", -1);
+            results.put("resultMessage", "支付机构流水号不能为空");
+            return results;
+        }
+        if (haiciCharge.getPayTime() == null) {
+            results.put("resultCode", -1);
+            results.put("resultMessage", "支付时间不能为空");
+            return results;
+        }
+        try {
+            MzyReqrec mzyReqrec = mzyReqrecService.queryMzyReqrecByAgtordnum(haiciCharge.getPsOrdNum(), haiciCharge.getAgtOrdNum());
+            if (mzyReqrec != null) {
+                results.put("resultCode", 0);
+                results.put("resultMessage", "门诊挂号订单支付状态查询成功");
+                results.put("payStatus", "1");
+                results.put("guideListInfo", "");
+                results.put("receiptNum", "");
+                return results;
+            }
+            results.put("resultCode", 0);
+            results.put("resultMessage", "门诊挂号订单支付状态查询失败");
+            results.put("payStatus", "2");
+            results.put("guideListInfo", "");
+            results.put("receiptNum", "");
+            return results;
+        } catch (Exception e) {
+            e.printStackTrace();
+            results.put("resultCode", -1);
+            results.put("resultMessage", "门诊挂号订单支付状态查询失败,请联系管理员");
+            log.error("系统异常,错误信息{}", e.getMessage());
+            return results;
+        }
+    }
+
+
 
     /**
      * 查询门诊记录表 医患通已收费记录查询

+ 2 - 0
src/main/java/cn/hnthyy/thmz/entity/his/Employee.java

@@ -23,4 +23,6 @@ public class Employee {
     private String deptName;
     //职称编码
     private String empTitCode;
+    //员工工号
+    private String codeRs;
 }

+ 22 - 0
src/main/java/cn/hnthyy/thmz/entity/thmz/Config.java

@@ -0,0 +1,22 @@
+package cn.hnthyy.thmz.entity.thmz;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 门诊配置类
+ */
+@Data
+public class Config {
+    //主键
+    private Long id;
+    //参数的键
+    private String configKey;
+    //参数的值
+    private String configValue;
+    //创建人
+    private String createId;
+    //创建时间
+    private Date createDate;
+}

+ 2 - 2
src/main/java/cn/hnthyy/thmz/mapper/his/EmployeeMapper.java

@@ -76,7 +76,7 @@ public interface EmployeeMapper {
      * @return
      */
     @Select({"<script>",
-            "select rtrim(code) employeeCode,rtrim(name) employeeName,del_flag,rtrim(mark) mark,emp_tit_code from a_employee_mi  where  code in",
+            "select rtrim(code) employeeCode,rtrim(name) employeeName,del_flag,rtrim(mark) mark,emp_tit_code,rtrim(code_rs)  code_rs from a_employee_mi  where  code in",
             "<foreach item='item' index='index' collection='codes' open='(' separator=',' close=')'>",
             "#{item}",
             "</foreach>",
@@ -88,6 +88,6 @@ public interface EmployeeMapper {
      * 查询所有医生
      * @return
      */
-    @Select("select rtrim(code) employeeCode,rtrim(name) employeeName,del_flag,rtrim(mark) mark,emp_tit_code from a_employee_mi where (del_flag is null or del_flag =0 ) ")
+    @Select("select rtrim(code) employeeCode,rtrim(name) employeeName,del_flag,rtrim(mark) mark,emp_tit_code,rtrim(code_rs)  code_rs from a_employee_mi where (del_flag is null or del_flag =0 ) ")
     List<Employee> selectAll();
 }

+ 14 - 0
src/main/java/cn/hnthyy/thmz/mapper/his/MzyReqrecMapper.java

@@ -259,4 +259,18 @@ public interface MzyReqrecMapper {
     List<Map<String, Object>> countAndAmountMzyReqrec(MzyReqrecPageDto mzyReqrecPageDto);
 
 
+
+
+    /**
+     * 判断手机自助缴费平台对应的流水号有无成功挂号
+     * @param psordnum
+     * @param agtordnum
+     * @return
+     */
+    @Select("select rtrim(patient_id) patient_id,times,rtrim(name) name,rtrim(req_type) req_type,request_day,rtrim(ampm) ampm,rtrim(unit_code) unit_code,"+
+            "rtrim(group_code) group_code,rtrim(doctor_code) doctor_code,rtrim(charge_type) charge_type,req_order,req_fee,oth_fee,rtrim(cancel_mark) cancel_mark,"+
+            "rtrim(admiss_time) admiss_time,rtrim(op_id) op_id,op_day,clinic_fee,rtrim(visited_mark) visited_mark,rtrim(plus_mark) plus_mark,closing_date,"+
+            "rtrim(printer_id) printer_id,rtrim(print_flag) print_flag,rtrim(windows_no) windows_no,serial_no,rtrim(receipt_bill) receipt_bill,dcount_no,brochure_fee,dept_no,visit_dept,"+
+            "visit_doctor,visit_date,paymode,psordnum,agtordnum   from dbo.mzy_reqrec where psordnum=#{psordnum} and agtordnum = #{agtordnum}")
+    MzyReqrec selectMzyReqrecByAgtordnum(@Param("psordnum") String psordnum,@Param("agtordnum") String agtordnum);
 }

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

@@ -236,4 +236,26 @@ public interface MzyRequestMapper {
                     "  group by doctor_code,charge_type,check_fee",
             "</script>"})
     List<Map<String,Object>> selectDoctorByDateAndDept(@Param("requestDay") Date requestDay, @Param("ampms") List<String> ampms, @Param("unitCode") String unitCode);
+
+
+
+
+    /**
+     * 查询可以挂号的科室内医生信息
+     * @param requestDay 挂号日期
+     * @param ampms 当上下午不为空时,查询不在入参数集合的所有的号源
+     * @param unitCode 科室编码
+     * @param doctorCode 医生编码
+     * @return
+     */
+    @Select({"<script>",
+            "select id mzyRequestId,ampm,doctor_code doctorCode,charge_type chargeType,check_fee checkFee,left_num leftNum from mzy_request_new where unit_code=#{unitCode} and request_day=#{requestDay,jdbcType=TIMESTAMP} and doctor_code  =#{doctorCode} and del_flag=0 " ,
+            "<when test='ampms!=null'>",
+            " and ampm  not in " ,
+            "<foreach item='item' index='index' collection='ampms' open='(' separator=',' close=')'>",
+            "#{item}",
+            "</foreach>",
+            "</when>",
+            "</script>"})
+    List<Map<String,Object>> selectRequestByDateAndDeptAndDoctor(@Param("requestDay") Date requestDay, @Param("ampms") List<String> ampms, @Param("unitCode") String unitCode, @Param("doctorCode") String doctorCode);
 }

+ 59 - 0
src/main/java/cn/hnthyy/thmz/mapper/thmz/ConfigMapper.java

@@ -0,0 +1,59 @@
+package cn.hnthyy.thmz.mapper.thmz;
+
+import cn.hnthyy.thmz.entity.thmz.Config;
+import org.apache.ibatis.annotations.*;
+
+public interface ConfigMapper {
+    /**
+     * 按照查询键查询配置内容
+     *
+     * @param key 查询键
+     * @return
+     */
+    @Select("select id,config_key, config_value, create_id, create_date from t_config where config_key=#{configKey}")
+    Config selectUserByKey(@Param("configKey") String configKey);
+    /**
+     * 新增文件
+     *
+     * @param config
+     * @return
+     */
+    @Insert("INSERT INTO t_config(config_key, config_value, create_id, create_date) VALUES " +
+            "(#{configKey,jdbcType=VARCHAR}, #{configValue,jdbcType=VARCHAR},#{createId,jdbcType=BIGINT}, #{createDate,jdbcType=TIMESTAMP})")
+    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
+    int insertConfig(Config config);
+
+//    /**
+//     * 更新配置文件
+//     * @param config
+//     * @return
+//     */
+//    @Update({"<script>",
+//            "update t_config ",
+//            "<trim prefix='set' prefixOverrides=',' suffix=' where id = #{id,jdbcType=BIGINT} ' >",
+//            "<when test='configKey!=null'>",
+//            ",config_key =#{configKey,jdbcType=VARCHAR}",
+//            "</when>",
+//            "<when test='configValue!=null'>",
+//            ",config_value =#{configValue,jdbcType=VARCHAR}",
+//            "</when>",
+//            "</trim>",
+//            "</script>"})
+//    int updateConfig(Config config);
+
+
+    /**
+     * 更新配置文件
+     * @param config
+     * @return
+     */
+    @Update({"<script>",
+            "update t_config ",
+            "<trim prefix='set' prefixOverrides=',' suffix=' where config_key =#{configKey,jdbcType=VARCHAR} ' >",
+            "<when test='configValue!=null'>",
+            ",config_value =#{configValue,jdbcType=VARCHAR}",
+            "</when>",
+            "</trim>",
+            "</script>"})
+    int updateConfigByKey(Config config);
+}

+ 9 - 0
src/main/java/cn/hnthyy/thmz/service/his/MzyReqrecService.java

@@ -86,4 +86,13 @@ public interface MzyReqrecService {
      * @return
      */
     List<Map<String, Object>> countAndAmountMzyReqrec(MzyReqrecPageDto mzyReqrecPageDto);
+
+
+    /**
+     * 判断手机自助缴费平台对应的流水号有无成功挂号
+     * @param psordnum
+     * @param agtordnum
+     * @return
+     */
+    MzyReqrec queryMzyReqrecByAgtordnum(String psordnum,String agtordnum);
 }

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

@@ -135,4 +135,14 @@ public interface MzyRequestService {
      */
     List<Map<String,Object>> queryDoctorByDateAndDept(Date requestDay, List<String> ampms, String unitCode);
 
+    /**
+     * 查询医生的号源信息
+     * @param requestDay
+     * @param ampms
+     * @param unitCode
+     * @param doctorCode
+     * @return
+     */
+    List<Map<String,Object>> queryRequestByDateAndDeptAndDoctor(Date requestDay,List<String> ampms, String unitCode, String doctorCode);
+
 }

+ 87 - 9
src/main/java/cn/hnthyy/thmz/service/impl/his/MzyReqrecServiceImpl.java

@@ -1,22 +1,19 @@
 package cn.hnthyy.thmz.service.impl.his;
 
+import cn.hnthyy.thmz.Utils.DateUtil;
 import cn.hnthyy.thmz.common.Constants;
 import cn.hnthyy.thmz.entity.MzException;
 import cn.hnthyy.thmz.entity.his.*;
-import cn.hnthyy.thmz.entity.thmz.Receipt;
-import cn.hnthyy.thmz.entity.thmz.ReqrecRequestRelation;
-import cn.hnthyy.thmz.entity.thmz.User;
-import cn.hnthyy.thmz.entity.thmz.Windows;
+import cn.hnthyy.thmz.entity.thmz.*;
 import cn.hnthyy.thmz.enums.YesNoEnum;
 import cn.hnthyy.thmz.mapper.his.*;
 import cn.hnthyy.thmz.mapper.thmz.ReceiptMapper;
 import cn.hnthyy.thmz.mapper.thmz.ReqrecRequestRelationMapper;
 import cn.hnthyy.thmz.mapper.thmz.WindowsMapper;
-import cn.hnthyy.thmz.service.his.MzSerialNoService;
-import cn.hnthyy.thmz.service.his.MzfzConfigService;
-import cn.hnthyy.thmz.service.his.MzyReqrecService;
-import cn.hnthyy.thmz.service.his.MzyRequestService;
+import cn.hnthyy.thmz.service.his.*;
 import cn.hnthyy.thmz.pageDto.MzyReqrecPageDto;
+import cn.hnthyy.thmz.service.thmz.ConfigService;
+import cn.hnthyy.thmz.service.thmz.MessageService;
 import cn.hnthyy.thmz.vo.ThmzmxsrParamsVo;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -26,6 +23,7 @@ import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
+import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
@@ -62,12 +60,25 @@ public class MzyReqrecServiceImpl implements MzyReqrecService {
     @SuppressWarnings("all")
     @Autowired
     private ReqrecRequestRelationMapper reqrecRequestRelationMapper;
+    @SuppressWarnings("all")
+    @Autowired
+    private MzZdWorkTimeMapper mzZdWorkTimeMapper;
     @Autowired
     private MzyRequestService mzyRequestService;
     @Autowired
     private MzSerialNoService mzSerialNoService;
     @Autowired
     private MzfzConfigService mzfzConfigService;
+    @Autowired
+    private ConfigService configService;
+    @Autowired
+    private EmployeeService employeeService;
+    @Autowired
+    private MessageService messageService;
+    @Autowired
+    private ZdUnitCodeService zdUnitCodeService;
+    @Autowired
+    private MzyZdChargeTypeService mzyZdChargeTypeService;
 
     @Override
     @Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT,timeout=36000,rollbackFor=Exception.class)
@@ -111,8 +122,69 @@ public class MzyReqrecServiceImpl implements MzyReqrecService {
         mzPatientMiMapper.updateMzPatientMi(updateMzPatientMi);
         ReqrecRequestRelation reqrecRequestRelation = new ReqrecRequestRelation(mzyRequest.getId(),serialNo);
         reqrecRequestRelationMapper.insertReqrecRequestRelation(reqrecRequestRelation);
+        if (sendAlarmMessage(mzyRequest)) return 1;
         return 1;
     }
+    /**
+     * 发送号表剩余号数预警消息
+     * @param mzyRequest
+     * @return
+     */
+    private boolean sendAlarmMessage(MzyRequest mzyRequest) {
+        Config config=configService.queryUserByKey(Constants.ALARM_NUM_KEY);
+        if(config==null){
+            return true;
+        }
+        if(mzyRequest.getLeftNum()<=Integer.valueOf(config.getConfigValue())){
+            config=configService.queryUserByKey(Constants.ALARM_USER_KEY);
+            if(config==null || StringUtils.isBlank(config.getConfigValue())){
+                return true;
+            }
+            String [] arr = config.getConfigValue().split(",");
+            if(arr==null || arr.length==0){
+                return true;
+            }
+            List<Employee> employees= employeeService.queryByCodes(Arrays.asList(arr));
+            if(employees==null || employees.size()==0){
+                return true;
+            }
+            String codes=null;
+            for (Employee employee:employees){
+                if(codes==null){
+                    codes= employee.getCodeRs();
+                }else {
+                    codes+=","+employee.getCodeRs();
+                }
+            }
+            if(codes!=null){
+                StringBuffer sbf = new StringBuffer("警告:日期【");
+                sbf.append(DateUtil.fomart(mzyRequest.getRequestDay(),"yyyy-MM-dd")).append("】");
+                sbf.append("科室【").append(zdUnitCodeService.queryDeptNameByIdInCache(mzyRequest.getUnitCode())).append("】");
+                if(StringUtils.isNotBlank(mzyRequest.getDoctorCode())){
+                    Employee employee= employeeService.queryByUserCode(mzyRequest.getDoctorCode());
+                    if(employee!=null){
+                        sbf.append("医生【").append(employee.getEmployeeName()).append("】");
+                    }
+                }
+                if(StringUtils.isNotBlank(mzyRequest.getAmpm())){
+                    MzZdWorkTime mzZdWorkTime= mzZdWorkTimeMapper.selectMzZdWorkTimeByCode(mzyRequest.getAmpm());
+                    if(mzZdWorkTime!=null){
+                        sbf.append("号段【").append(mzZdWorkTime.getName()).append("】");
+                    }
+                }
+                if(StringUtils.isNotBlank(mzyRequest.getChargeType())){
+                    MzyZdChargeType mzyZdChargeType1=mzyZdChargeTypeService.queryByCode(mzyRequest.getChargeType());
+                    if(mzyZdChargeType1!=null){
+                        sbf.append("号别【").append(mzyZdChargeType1.getName()).append("】");
+                    }
+                }
+                sbf.append("剩余号数").append(mzyRequest.getLeftNum()).append("低于预警值,请及时关注处理!");
+                messageService.sendWxMessage(codes, sbf.toString());
+            }
+        }
+        return false;
+    }
+
 
     private MzfzPatientOrder getMzfzPatientOrder(MzyReqrec mzyReqrec, MzPatientMi mzPatientMi, int times, int serialNo, Date now) throws MzException {
         MzfzPatientOrder mzfzPatientOrder = new  MzfzPatientOrder();
@@ -247,8 +319,9 @@ public class MzyReqrecServiceImpl implements MzyReqrecService {
         newMzyReqrec.setPatientId(mzyReqrec.getPatientId());
         newMzyReqrec.setTimes(mzyReqrec.getTimes());
         Receipt receipt=null;
+        String printer =Constants.BRZZJF_CODE.equals(mzyReqrec.getOpId())?mzyReqrec.getPrinterId():mzyReqrec.getOpId();
         if(!isReprint){
-            receipt= receiptMapper.selectByUserIdCode(mzyReqrec.getOpId());
+            receipt= receiptMapper.selectByUserIdCode(printer);
             if (receipt == null || StringUtils.isBlank(receipt.getReceiptCurrent())) {
                 throw new MzException("用户id=" + mzyReqrec.getOpId() + "没有可用的发票,请先维护发票。");
             }
@@ -286,4 +359,9 @@ public class MzyReqrecServiceImpl implements MzyReqrecService {
     public List<Map<String, Object>> countAndAmountMzyReqrec(MzyReqrecPageDto mzyReqrecPageDto) {
         return mzyReqrecMapper.countAndAmountMzyReqrec(mzyReqrecPageDto);
     }
+
+    @Override
+    public MzyReqrec queryMzyReqrecByAgtordnum(String psordnum, String agtordnum) {
+        return mzyReqrecMapper.selectMzyReqrecByAgtordnum(psordnum,agtordnum);
+    }
 }

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

@@ -191,4 +191,9 @@ public class MzyRequestServiceImpl implements MzyRequestService {
     public List<Map<String, Object>> queryDoctorByDateAndDept(Date requestDay, List<String> ampms, String unitCode) {
         return mzyRequestMapper.selectDoctorByDateAndDept(requestDay,ampms,unitCode);
     }
+
+    @Override
+    public List<Map<String,Object>> queryRequestByDateAndDeptAndDoctor(Date requestDay, List<String> ampms, String unitCode, String doctorCode) {
+        return mzyRequestMapper.selectRequestByDateAndDeptAndDoctor(requestDay,ampms,unitCode,doctorCode);
+    }
 }

+ 6 - 2
src/main/java/cn/hnthyy/thmz/service/impl/his/ZdUnitCodeServiceImpl.java

@@ -72,12 +72,16 @@ public class ZdUnitCodeServiceImpl implements ZdUnitCodeService {
 
     @Override
     public int saveZdUnitCode(ZdUnitCode zdUnitCode) {
-        return zdUnitCodeMapper.insertZdUnitCode(zdUnitCode);
+       int num=zdUnitCodeMapper.insertZdUnitCode(zdUnitCode);
+        initMap(zdUnitCode.getCode());
+        return num;
     }
 
     @Override
     public int modifyZdUnitCode(ZdUnitCode zdUnitCode) {
-        return zdUnitCodeMapper.updateZdUnitCode(zdUnitCode);
+        int num= zdUnitCodeMapper.updateZdUnitCode(zdUnitCode);
+        initMap(zdUnitCode.getCode()==null?zdUnitCode.getOriginalCode():zdUnitCode.getCode());
+        return num;
     }
 
     @Override

+ 28 - 0
src/main/java/cn/hnthyy/thmz/service/impl/thmz/ConfigServiceImpl.java

@@ -0,0 +1,28 @@
+package cn.hnthyy.thmz.service.impl.thmz;
+
+import cn.hnthyy.thmz.entity.thmz.Config;
+import cn.hnthyy.thmz.mapper.thmz.ConfigMapper;
+import cn.hnthyy.thmz.service.thmz.ConfigService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class ConfigServiceImpl implements ConfigService {
+    @SuppressWarnings("all")
+    @Autowired
+    private ConfigMapper configMapper;
+    @Override
+    public Config queryUserByKey(String key) {
+        return configMapper.selectUserByKey(key);
+    }
+
+    @Override
+    public int saveConfig(Config config) {
+        return configMapper.insertConfig(config);
+    }
+
+    @Override
+    public int modifyConfigByKey(Config config) {
+        return configMapper.updateConfigByKey(config);
+    }
+}

+ 68 - 0
src/main/java/cn/hnthyy/thmz/service/impl/thmz/MessageServiceImpl.java

@@ -0,0 +1,68 @@
+package cn.hnthyy.thmz.service.impl.thmz;
+
+import cn.hnthyy.thmz.service.thmz.MessageService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.http.HttpStatus;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import java.io.IOException;
+@Slf4j
+@Service
+public class MessageServiceImpl implements MessageService {
+    @Value("${serviceUrl}")
+    private String serviceUrl;
+    @Override
+    public int sendWxMessage(String touser, String content) {
+        if (StringUtils.isBlank(touser)){
+            return 0;
+        }
+        if (StringUtils.isBlank(content)){
+            return 0;
+        }
+        try {
+            String url = serviceUrl+"?touser="+touser+"&content="+content;
+            sendGetData(url, "utf-8");
+        } catch (Exception e) {
+            e.printStackTrace();
+            return 0;
+        }
+        return 1;
+    }
+
+
+    /**
+     * get请求传输数据
+     *
+     * @param url
+     * @param encoding
+     * @return
+     * @throws ClientProtocolException
+     * @throws IOException
+     */
+    private String sendGetData(String url, String encoding) throws ClientProtocolException, IOException {
+        String result = "";
+        // 创建httpclient对象
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        // 创建get方式请求对象
+        HttpGet httpGet = new HttpGet(url);
+        httpGet.addHeader("Content-type", "application/json");
+        // 通过请求对象获取响应对象
+        CloseableHttpResponse response = httpClient.execute(httpGet);
+        // 获取结果实体
+        // 判断网络连接状态码是否正常(0--200都数正常)
+        if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
+            result = EntityUtils.toString(response.getEntity(), "utf-8");
+        }
+        // 释放链接
+        response.close();
+        return result;
+    }
+}

+ 28 - 0
src/main/java/cn/hnthyy/thmz/service/thmz/ConfigService.java

@@ -0,0 +1,28 @@
+package cn.hnthyy.thmz.service.thmz;
+
+import cn.hnthyy.thmz.entity.thmz.Config;
+import org.apache.ibatis.annotations.*;
+
+public interface ConfigService {
+    /**
+     * 按照查询键查询配置内容
+     *
+     * @param key 查询键
+     * @return
+     */
+    Config queryUserByKey(String key);
+    /**
+     * 新增文件
+     *
+     * @param config
+     * @return
+     */
+    int saveConfig(Config config);
+
+    /**
+     * 更新配置文件
+     * @param config
+     * @return
+     */
+    int modifyConfigByKey(Config config);
+}

+ 14 - 0
src/main/java/cn/hnthyy/thmz/service/thmz/MessageService.java

@@ -0,0 +1,14 @@
+package cn.hnthyy.thmz.service.thmz;
+
+/**
+ * 企业微信服务
+ */
+public interface MessageService {
+    /**
+     *
+     * @param touser 工号字符串  用| 拼接
+     * @param content 消息内容
+     * @return
+     */
+    int sendWxMessage(String touser,String content);
+}

+ 163 - 0
src/main/resources/static/js/request-config.js

@@ -0,0 +1,163 @@
+//@ sourceURL=request-config.js
+$(function () {
+    $(".selectpicker").selectpicker({
+        dropuAuto: false
+    });
+    initDeptSelect();
+
+    //告警阈值
+    $.ajax({
+        type: "GET",
+        url: '/thmz/getConfigByKey?key=alarm_num',
+        dataType: "json",
+        headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
+        success: function (res) {
+            if (res == '401' || res == 401) {
+                window.location.href = '/thmz/login/view'
+                return;
+            }
+            $("#alarmNum").val(res.data.configValue);
+        }
+    });
+
+    $('#send').click(function () {
+        //修改告警设置
+        $.ajax({
+            type: "POST",
+            contentType: "application/json;charset=UTF-8",
+            url: '/thmz/setConfig',
+            dataType: "json",
+            data: JSON.stringify({"configKey": "alarm_num","configValue": $("#alarmNum").val()}),
+            headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
+            success: function (res) {
+                if (res == '401' || res == 401) {
+                    window.location.href = '/thmz/login/view'
+                    return;
+                }
+                if (res.code == 0) {
+                    //修改告警人员
+                    var doctor=$("#doctor").val();
+                    var doctorStr=null;
+                    if(doctor!=null && doctor.length>0){
+                        for (var i=0;i<doctor.length;i++){
+                            if(doctorStr==null){
+                                doctorStr=doctor[i];
+                            }else {
+                                doctorStr+=","+doctor[i];
+                            }
+
+                        }
+                    }
+                    $.ajax({
+                        type: "POST",
+                        contentType: "application/json;charset=UTF-8",
+                        url: '/thmz/setConfig',
+                        dataType: "json",
+                        data: JSON.stringify({"configKey": "alarm_user","configValue": doctorStr}),
+                        headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
+                        success: function (res) {
+                            if (res == '401' || res == 401) {
+                                window.location.href = '/thmz/login/view'
+                                return;
+                            }
+                            if (res.code == 0) {
+                                successMesage(res);
+                            } else {
+                                errorMesage(res);
+                            }
+                        }
+                    });
+                } else {
+                    errorMesage(res);
+                }
+            }
+        });
+    });
+
+
+});
+
+
+
+
+
+
+/**
+ * 挂号列表中的科室列表
+ */
+function initDeptSelect() {
+    //科室列表
+    $.ajax({
+        type: "GET",
+        url: '/thmz/allMzUnitCode',
+        dataType: "json",
+        headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
+        success: function (data) {
+            if (data == '401' || data == 401) {
+                window.location.href = '/thmz/login/view'
+                return;
+            }
+            var html = '';
+            $.each(data.data, function (commentIndex, comment) {
+                html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
+            });
+            $('#deptNo').empty();
+            $('#deptNo').html(html);
+            $('#deptNo').selectpicker('refresh');
+            $("#deptNo").selectpicker('val', '1400002');
+            $("#deptNo").selectpicker('refresh');
+            initDoctorSelect();
+        }
+    });
+}
+
+
+/**
+ * 挂号列表中的医生列表初始化
+ */
+function initDoctorSelect() {
+    //医生列表
+    $.ajax({
+        type: "GET",
+        url: '/thmz/listEmployeeByDepts?depts=' + $('#deptNo').val(),
+        //url: '/thmz/listEmployeeByDepts?depts=null',
+        dataType: "json",
+        headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
+        success: function (res) {
+            if (res == '401' || res == 401) {
+                window.location.href = '/thmz/login/view'
+                return;
+            }
+            var html = '<option value=""></option>';
+            $.each(res.data, function (commentIndex, comment) {
+                html += '<option value="' + comment.employeeCode + '">' + comment.employeeName + ' (' + comment.deptName + ') </option>';
+            });
+            $('#doctor').empty();
+            $('#doctor').html(html);
+            $('#doctor').selectpicker('destroy').selectpicker('refresh');
+
+            //告警人员设置
+            $.ajax({
+                type: "GET",
+                url: '/thmz/getConfigByKey?key=alarm_user',
+                dataType: "json",
+                headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
+                success: function (res) {
+                    if (res == '401' || res == 401) {
+                        window.location.href = '/thmz/login/view'
+                        return;
+                    }
+                    var doctorStr=res.data.configValue;
+                    if(doctorStr!=null && doctorStr!=''){
+                        var arr =doctorStr.split(",");
+                        $("#doctor").selectpicker('val', arr);
+                        $("#doctor").selectpicker('refresh');
+                    }
+
+                }
+            });
+        }
+    });
+
+
+}

+ 58 - 0
src/main/resources/templates/request-config.html

@@ -0,0 +1,58 @@
+<link rel="stylesheet" href="/thmz/css/bootstrap/css/bootstrap-select.css"/>
+<link rel="stylesheet" href="/thmz/css/bootstrap/css/daterangepicker.css"/>
+<link rel="stylesheet" href="/thmz/css/custom.min.css"/>
+<link rel="stylesheet" href="/thmz/css/toll_administration.css"/>
+<script src="/thmz/js/bootstrap-select.js"></script>
+<script src="/thmz/js/request-config.js"></script>
+<div class="row">
+    <div class="col-md-12 col-sm-12 col-xs-12">
+        <div class="x_panel">
+            <div class="panel-body">
+            </div>
+
+            <div class="row" style="margin-top: -20px;">
+                <div>
+                    <form class="form-horizontal form-label-left" novalidate id="request_config_form" autocomplete="off">
+                        <span class="section">号表预警设置</span>
+                        <div class="item form-group">
+                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="alarmNum">剩余号数预警值 <span class="required">*</span>
+                            </label>
+                            <div class="col-md-4 col-sm-4 col-xs-12">
+                                <input type="text" id="alarmNum"  class="form-control col-md-7 col-xs-12">
+                            </div>
+                        </div>
+                        <div class="item form-group">
+                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="deptNo">科室
+                            </label>
+                            <div class="col-md-4 col-sm-4 col-xs-12">
+                                <select class="form-control selectpicker show-tick" data-live-search="true"
+                                        title="请选择" onchange="initDoctorSelect()"
+                                        id="deptNo">
+                                </select>
+                            </div>
+                        </div>
+                        <div class="item form-group">
+                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="doctor">预警信息通知人员 <span
+                                    class="required">*</span>
+                            </label>
+                            <div class="col-md-4 col-sm-4 col-xs-12">
+                                <select class="form-control selectpicker show-tick" multiple required="required"  title="请选择"
+                                        id="doctor">
+                                </select>
+                            </div>
+                        </div>
+                        <div class="ln_solid"></div>
+                        <div class="form-group">
+                            <div class="col-md-6 col-md-offset-3">
+                                <button id="send" type="button" class="btn btn-success">提交</button>
+                            </div>
+                        </div>
+                    </form>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+
+
+