(1)同德短信问题处理
(2)同德过滤患者查询问题处理
(3)南华出院随访导出新增(年龄、病历号、性别)
已修改6个文件
173 ■■■■ 文件已修改
ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceSubtaskExport.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceSubtaskRes.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java 87 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java
@@ -493,16 +493,18 @@
                        if (active.equals("sltd")) {
                            data = MessageSend.sendMsg(sendMagParam.getContent(), "6", sendMagParam.getPhone(), LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")));
                            if (StringUtils.isNotEmpty(data)) {
                                ObjectMapper mapper = new ObjectMapper();
                                JsonNode root = mapper.readTree(data);
                                String status = root.get("result").get(0).get("status").asText();
                                if (status.equals("00000")) {
                                    s = "true";
                                } else {
                                    setFailPreachForm(serviceSubtask, sendPreachform, "短信发送失败: " + data, "5");
                                    throw new BaseException("短信发送失败");
                                String[] pairs = data.split("&");
                                String resultVal = null;
                                for (String pair : pairs) {
                                    String[] kv = pair.split("=", 2);
                                    if ("result".equals(kv[0])) {
                                        resultVal = kv.length > 1 ? kv[1] : null;
                                        break;
                                    }
                                }
                                if ("0".equals(resultVal)) {
                                    s = "true";
                                }
                            } else {
                                setFailPreachForm(serviceSubtask, sendPreachform, "短信发送失败: " + data, "5");
                                throw new BaseException("短信发送失败");
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
@@ -137,7 +137,7 @@
            return buildRedirect(path + "/login");
        }
        String redirectUrl = path + "/loginSSO?token=" + loginToken + "&orgid=" + orgid + "&orgname=null&ZuHuID=null&deptCode=null";
        String redirectUrl = path + "/loginSSO?token=" + loginToken + "&orgid=" + orgid + "&campusid=" + campusid + "&orgname=null&ZuHuID=null&deptCode=null";
        log.info("【SSO登录】重定向地址:{}", redirectUrl);
        return buildRedirect(redirectUrl);
    }
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
@@ -1143,10 +1143,18 @@
                            //省立同德的短信发送方式
                            String data = MessageSend.sendMsg(sendMagParam.getContent(), "6", sendMagParam.getPhone(), LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")));
                            if (StringUtils.isNotEmpty(data)) {
                                ObjectMapper mapper = new ObjectMapper();
                                JsonNode root = mapper.readTree(data);
                                String status = root.get("result").get(0).get("status").asText();
                                if (status.equals("00000")) {
                                // 解析 result=0&description=成功&faillist= 格式(result=0成功,1失败)
                                log.info("【sfHandlle】省立同德短信发送返回:{}", data);
                                String[] pairs = data.split("&");
                                String resultVal = null;
                                for (String pair : pairs) {
                                    String[] kv = pair.split("=", 2);
                                    if ("result".equals(kv[0])) {
                                        resultVal = kv.length > 1 ? kv[1] : null;
                                        break;
                                    }
                                }
                                if ("0".equals(resultVal)) {
                                    isSuccess = "true";
                                }
                            }
smartor/src/main/java/com/smartor/domain/ServiceSubtaskExport.java
@@ -35,6 +35,40 @@
    private String sendname;
    /**
     * 年龄
     */
    @Excel(name = "年龄 ")
    @ApiModelProperty(value = "年龄")
    private Long age;
    /**
     * 性别
     */
    @ApiModelProperty(value = "性别")
    private Long sex;
    /**
     * 性别
     */
    @Excel(name = "性别")
    @ApiModelProperty(value = "性别")
    private String sexName;
    /**
     * 就诊编号(对应的outhospno、inhospno)
     */
//    @Excel(name = "就诊编号")
    @ApiModelProperty(value = "就诊编号(对应的outhospno、inhospno)")
    private String hospno;
    /**
     * 病历号
     */
    @Excel(name = "病历号")
    @ApiModelProperty(value = "患者编号(病历号)")
    private String patno;
    /**
     * 出院时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
smartor/src/main/java/com/smartor/domain/ServiceSubtaskRes.java
@@ -121,6 +121,13 @@
    private Long sex;
    /**
     * 性别
     */
    @Excel(name = " 性别名称")
    @ApiModelProperty(value = "性别名称")
    private String sexName;
    /**
     * 年龄
     */
    @Excel(name = " 年龄 ")
@@ -447,6 +454,13 @@
    private String hospno;
    /**
     * 患者编号
     */
    @Excel(name = "患者编号(病历号)")
    @ApiModelProperty(value = "患者编号(病历号)")
    private String patno;
    /**
     * 就诊类型(1门诊  2出院)
     */
    @Excel(name = "  就诊类型(1门诊  2出院)")
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -45,11 +45,9 @@
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.ZoneId;
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
@@ -418,9 +416,74 @@
                    serviceSubtaskRes.setCurrentPreachform(serviceSubtask.getPreachform().split(",")[0]);
                }
            }
            PatMedInhosp inhosp = patMedInhospMapper.selectPatMedInhospByInhospid(serviceSubtask.getInhospid());
            if (ObjectUtils.isNotEmpty(inhosp)) {
                PatArchive patArchive = patArchiveMapper.selectPatArchiveByPatid(inhosp.getPatid());
                if (ObjectUtils.isNotEmpty(patArchive)) {
                    Map<String, String> stringStringMap = calculateAge(patArchive.getBirthdate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(), LocalDate.now());
                    serviceSubtaskRes.setAge(StringUtils.isNotEmpty(stringStringMap.get("age")) ? Long.valueOf(stringStringMap.get("age")) : null);
                    serviceSubtaskRes.setSex(patArchive.getSex());
                    serviceSubtaskRes.setSexName(patArchive.getSex() != null ? (patArchive.getSex() == 1 ? "男" : "女") : null);
                }
                serviceSubtaskRes.setHospno(inhosp.getInhospno());
                serviceSubtaskRes.setPatno(inhosp.getPatno());
            }
            serviceSubtaskResList.add(serviceSubtaskRes);
        }
        return serviceSubtaskResList;
    }
    public Map<String, String> calculateAge(LocalDate birthdate, LocalDate today) {
        if (birthdate == null || today.isBefore(birthdate)) {
            return null;
        }
        Map<String, String> ageMap = new HashMap<>();
        Period period = Period.between(birthdate, today);
        long totalDays = ChronoUnit.DAYS.between(birthdate, today);
        long totalMonths = ChronoUnit.MONTHS.between(birthdate, today);
        int years = period.getYears();
        int months = period.getMonths();
        int days = period.getDays();
        String ageUnit;
        Integer age;
        String ageUnit2 = null;
        Integer age2 = null;
        if (totalDays < 90) {
            // 小于 1 个月,按天计算
            ageUnit = "天";
            age = (int) totalDays;
            ageMap.put("age", age != null ? age.toString() : null);
            ageMap.put("ageUnit", ageUnit);
            ageMap.put("age2", null);
            ageMap.put("ageUnit2", null);
        } else if (totalMonths < 36) {
            // 小于 1 年,按月 + 天计算
            ageUnit = "月";
            age = (int) totalMonths;
            ageUnit2 = "天";
            age2 = days;
            ageMap.put("age", age != null ? age.toString() : null);
            ageMap.put("ageUnit", ageUnit);
            ageMap.put("age2", age2 != null ? age2.toString() : null);
            ageMap.put("ageUnit2", ageUnit2);
        } else {
            // 大于 1 年,按年 + 月计算
            ageUnit = "岁";
            age = years;
            ageUnit2 = "月";
            age2 = months;
            ageMap.put("age", age != null ? age.toString() : null);
            ageMap.put("ageUnit", ageUnit);
            ageMap.put("age2", age2 != null ? age2.toString() : null);
            ageMap.put("ageUnit2", ageUnit2);
        }
        return ageMap;
    }
    @Override
@@ -4564,9 +4627,9 @@
    }
    @Override
    public List<ServiceSubtask> gethelibraryCountHyperlink(HeLibraryCountVO heLibraryCountVO){
    public List<ServiceSubtask> gethelibraryCountHyperlink(HeLibraryCountVO heLibraryCountVO) {
        String hyperLinkInfoType = heLibraryCountVO.getHyperLinkInfoType();
        if(StringUtils.isNotEmpty(hyperLinkInfoType)){
        if (StringUtils.isNotEmpty(hyperLinkInfoType)) {
            heLibraryCountVO.setSendstate(null);
            heLibraryCountVO.setIsFinished(null);
            switch (hyperLinkInfoType) {
@@ -4789,19 +4852,19 @@
        }
    }
    public String scanGenerateSubtask(ServiceTask serviceTaskVo){
    public String scanGenerateSubtask(ServiceTask serviceTaskVo) {
        String content = "";
        String ip = localIP;
        ServiceTask serviceTask = new ServiceTask();
        serviceTask = serviceTaskService.selectServiceTaskByTaskid(serviceTaskVo.getTaskid());
        if(ObjectUtils.isNotEmpty(serviceTask)){
        if (ObjectUtils.isNotEmpty(serviceTask)) {
            try {
                ServiceTaskdept serviceTaskdept = new ServiceTaskdept();
                if(ObjectUtils.isNotEmpty(serviceTaskVo.getDeptcode())){
                if (ObjectUtils.isNotEmpty(serviceTaskVo.getDeptcode())) {
                    serviceTaskdept.setDeptType("1");
                    serviceTaskdept.setDeptCode(serviceTask.getDeptcode());
                }
                if(ObjectUtils.isNotEmpty(serviceTaskVo.getLeavehospitaldistrictcode())){
                if (ObjectUtils.isNotEmpty(serviceTaskVo.getLeavehospitaldistrictcode())) {
                    serviceTaskdept.setDeptType("2");
                    serviceTaskdept.setDeptCode(serviceTaskVo.getLeavehospitaldistrictcode());
                }
@@ -4818,9 +4881,7 @@
                    ServiceSubtask serviceSubtask = boxedServiceSubtask(serviceTask, patArchive);
                    int i = serviceSubtaskMapper.insertServiceSubtask(serviceSubtask);
                    //根据生成外链
                    if (ObjectUtils.isNotEmpty(serviceSubtask.getTaskid()) &&
                            ObjectUtils.isNotEmpty(serviceSubtask.getPatid())
                            && ObjectUtils.isNotEmpty(serviceSubtask.getId())) {
                    if (ObjectUtils.isNotEmpty(serviceSubtask.getTaskid()) && ObjectUtils.isNotEmpty(serviceSubtask.getPatid()) && ObjectUtils.isNotEmpty(serviceSubtask.getId())) {
                        RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample();
                        String taskId = rsaPublicKeyExample.encryptedData(serviceSubtask.getTaskid().toString(), pub_key);
                        String patid = rsaPublicKeyExample.encryptedData(serviceSubtask.getPatid().toString(), pub_key);