陈昶聿
8 天以前 fc1f48f6cb2736bf03b7750563e5d9830d6fd4ba
Merge remote-tracking branch 'origin/smartor_ls_261103' into smartor_ls_261103

# Conflicts:
# ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceOutPathController.java
已修改12个文件
250 ■■■■■ 文件已修改
ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/SmsController.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceOutPathController.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/resources/application.yml 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-task/src/main/java/com/ruoyi/task/controller/ServiceSubtaskController.java 155 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-task/src/main/java/com/ruoyi/task/domain/ServiceOutPath.java 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-task/src/main/java/com/ruoyi/task/service/impl/ServiceOutPathServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-task/src/main/java/com/ruoyi/task/service/impl/ServiceSubtaskServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-task/src/main/resources/mapper/task/ServiceOutPathMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java
@@ -344,7 +344,7 @@
                        iServiceOutPathService.insertServiceOutPath(serviceOutPath);
//                                sendMagParam.setUrl(ip + ":" + req_path + "/followvisit/particty?param1=" + taskId + "&param2=" + patid + "&param5=false");
                        //转成16进制
                        String format = String.format("%03X", serviceOutPath.getId());
                        String format = ShortCode.encode(serviceOutPath.getId());
                        serviceOutPath.setRadix(format);
                        serviceOutPath.setUpdateTime(new Date());
                        serviceOutPath.setUrl(ip + ":" + req_path + "/sf?p=" + format);
@@ -380,7 +380,7 @@
                        serviceOutPath.setDeptName(serviceSubtask.getLeaveldeptname());
                        serviceOutPath.setWardName(serviceSubtask.getLeavehospitaldistrictname());
                        iServiceOutPathService.insertServiceOutPath(serviceOutPath);
                        String format = String.format("%03X", serviceOutPath.getId());
                        String format = ShortCode.encode(serviceOutPath.getId());
                        serviceOutPath.setRadix(format);
                        serviceOutPath.setUpdateTime(new Date());
                        serviceOutPath.setUrl(StringUtils.isNotEmpty(req_path) ? ip + ":" + req_path + "/wt?p=" + format : ip + "/wt?p=" + format);
@@ -421,7 +421,7 @@
                        serviceOutPath.setWardName(serviceSubtask.getLeavehospitaldistrictname());
                        iServiceOutPathService.insertServiceOutPath(serviceOutPath);
                        String url = "";
                        String format = String.format("%03X", serviceOutPath.getId());
                        String format = ShortCode.encode(serviceOutPath.getId());
                        //需要通过模板ID去判断要发的内容是宣教还是通知
                        // ⚠️ 与 RyTask 同口径:**刻意不**为 TemplateModuleDisabledException 降级 ——
                        // 模板模块关闭时宣教内容取不到、短信确实发不出去,外层 try-catch 如实记失败
@@ -522,7 +522,7 @@
                        serviceOutPath.setDeptName(serviceSubtask.getLeaveldeptname());
                        serviceOutPath.setWardName(serviceSubtask.getLeavehospitaldistrictname());
                        iServiceOutPathService.insertServiceOutPath(serviceOutPath);
                        String format = String.format("%03X", serviceOutPath.getId());
                        String format = ShortCode.encode(serviceOutPath.getId());
                        serviceOutPath.setRadix(format);
                        serviceOutPath.setUpdateTime(new Date());
                        url = ip + ":" + req_path + "/sf?p=" + format;
@@ -542,7 +542,7 @@
                        serviceOutPath.setDeptName(serviceSubtask.getLeaveldeptname());
                        serviceOutPath.setWardName(serviceSubtask.getLeavehospitaldistrictname());
                        iServiceOutPathService.insertServiceOutPath(serviceOutPath);
                        String format = String.format("%03X", serviceOutPath.getId());
                        String format = ShortCode.encode(serviceOutPath.getId());
                        url = StringUtils.isNotEmpty(req_path) ? ip + ":" + req_path + "/wt?p=" + format : ip + "/wt?p=" + format;
                        //如果type是语音随访的话(说明补偿发送方式中有电话随访的方式,这里的外链就地址只能用/sf)
@@ -567,7 +567,7 @@
                        serviceOutPath.setWardName(serviceSubtask.getLeavehospitaldistrictname());
                        serviceOutPath.setOrgid(serviceSubtask.getOrgid());
                        iServiceOutPathService.insertServiceOutPath(serviceOutPath);
                        String format = String.format("%03X", serviceOutPath.getId());
                        String format = ShortCode.encode(serviceOutPath.getId());
                        //需要通过模板ID去判断要发的内容是宣教还是通知
//                        HeLibrary heLibrary = templateFacade.findHeLibraryById(serviceSubtask.getLibtemplateid());
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/SmsController.java
@@ -8,6 +8,7 @@
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.RSAPublicKeyExample;
import com.ruoyi.common.utils.ShortCode;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.sms.SmsUtils;
import com.ruoyi.message.SendResult;
@@ -122,7 +123,7 @@
            String patid = rsaPublicKeyExample.encryptedData(vo.getPatId().toString(), pub_key);
            String subId = rsaPublicKeyExample.encryptedData(vo.getSubId().toString(), pub_key);
            Integer radix = iServiceOutPathService.selectAutoId();
            String format = String.format("%03X", radix);
            String format = ShortCode.encode(radix.longValue());
            ServiceOutPath serviceOutPath = new ServiceOutPath();
            serviceOutPath.setParam1(taskId);
            serviceOutPath.setParam2(patid);
@@ -174,7 +175,7 @@
            String patid = rsaPublicKeyExample.encryptedData(vo.getPatId().toString(), pub_key);
            String subId = rsaPublicKeyExample.encryptedData(vo.getSubId().toString(), pub_key);
            Integer radix = iServiceOutPathService.selectAutoId();
            String format = String.format("%03X", radix);
            String format = ShortCode.encode(radix.longValue());
            ServiceOutPath serviceOutPath = new ServiceOutPath();
            serviceOutPath.setParam1(taskId);
            serviceOutPath.setParam2(patid);
@@ -210,7 +211,7 @@
            String patid = rsaPublicKeyExample.encryptedData(vo.getPatId().toString(), pub_key);
            String subId = rsaPublicKeyExample.encryptedData(vo.getSubId().toString(), pub_key);
            Integer radix = iServiceOutPathService.selectAutoId();
            String format = String.format("%03X", radix);
            String format = ShortCode.encode(radix.longValue());
            ServiceOutPath serviceOutPath = new ServiceOutPath();
            serviceOutPath.setParam1(taskId);
            serviceOutPath.setParam2(patid);
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceOutPathController.java
@@ -8,6 +8,7 @@
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.RSAPublicKeyExample;
import com.ruoyi.common.utils.ShortCode;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.smartor.domain.BaseOrganization;
@@ -17,7 +18,6 @@
import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
@@ -69,16 +69,35 @@
    }
    /**
     * param就是进制
     * 外链落地页取任务信息(患者短信里的 {@code /wt?p=XXXXXX},匿名访问,不能加登录态鉴权)。
     *
     * @param param
     * @return
     * <p>短码有两种形态,都要认:
     * <ul>
     *   <li><b>6 位 base62</b>(本次改造后)—— 由 {@link ShortCode} 对主键做带密钥双射得到,
     *       不可枚举;先反解出主键再按 id 查,这样即便 {@code radix} 列被截断或没落库也能查到;</li>
     *   <li><b>3~5 位十六进制</b>(历史链接)—— 直接按 {@code radix} 列查,保证已发出的短信还能打开。</li>
     * </ul>
     *
     * @param param 短码(旧称"进制")
     * @return 任务信息;短码无效时 data 为 null
     */
    @PostMapping("/getInfoByParam")
    public AjaxResult param(@Param("param") String param) {
        ServiceOutPath serviceOutPath = new ServiceOutPath();
        serviceOutPath.setRadix(param);
        List<ServiceOutPath> list = serviceOutPathService.selectServiceOutPathList(serviceOutPath);
    public AjaxResult param(@RequestParam(value = "param", required = false) String param) {
        if (StringUtils.isEmpty(param)) {
            return success(null);
        }
        List<ServiceOutPath> list = null;
        Long id = ShortCode.decode(param);
        if (id != null) {
            ServiceOutPath byId = new ServiceOutPath();
            byId.setId(id);
            list = serviceOutPathService.selectServiceOutPathList(byId);
        }
        if (CollectionUtils.isEmpty(list)) {
            ServiceOutPath byRadix = new ServiceOutPath();
            byRadix.setRadix(param);
            list = serviceOutPathService.selectServiceOutPathList(byRadix);
        }
        if (CollectionUtils.isNotEmpty(list)) {
            ServiceOutPath serviceOutPath1 = list.get(0);
            serviceOutPath1.setId(null);
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
@@ -148,6 +148,10 @@
        }
        String redirectUrl = path + "/#/loginSSO?token=" + loginToken + "&orgid=" + orgid + "&campusid=" + campusid + "&orgname=null&ZuHuID=null&deptCode=null";
        if (active.equals("sltd")) {
            //省立同德不能带“#”
            redirectUrl = path + "/loginSSO?token=" + loginToken + "&orgid=" + orgid + "&campusid=" + campusid + "&orgname=null&ZuHuID=null&deptCode=null";
        }
        log.info("【SSO登录】重定向地址:{}", redirectUrl);
        return buildRedirect(redirectUrl);
    }
ruoyi-admin/src/main/resources/application.yml
@@ -15,6 +15,13 @@
  # 验证码类型 math 数组计算 char 字符验证
  captchaType: math
# 外链短码(/wt?p=XXXXXX 里那 6 位)的加密密钥
# 短码 = 带密钥双射(service_out_path.id),密钥只在服务端参与计算,不出现在链接里。
# ⚠️ 上线后不要修改:改了之后已发出的 6 位短链无法反解,只能靠 service_out_path.radix 兜底,
#    而该列一旦窄于 6 位就会被截断,等于那批链接失效。
shortcode:
  secret: smartor-outpath-shortcode-2026
#  开发环境配置
server:
  # 服务器的HTTP端口,默认为8080
@@ -78,7 +85,7 @@
    # 国际化资源文件路径
    basename: i18n/messages
  profiles:
    active: druid
    active: sltd
  # 文件上传
  servlet:
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
@@ -112,6 +112,8 @@
                // 静态资源,可匿名访问
//                .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**","/getDept/*","/SSOLogin/**").permitAll().antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
                .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**","/getDept/*","/SSOLogin/**","/system/dict/data/typeout/*").permitAll().antMatchers( "/druid/**").permitAll()
                // 免登录随访统计页(public/html/sfstat.html)使用的匿名接口
                .antMatchers("/smartor/serviceSubtask/publicSfStatistics", "/smartor/serviceSubtask/publicSfStatisticsOptions", "/smartor/serviceSubtask/publicContinueNerseCount").permitAll()
                .antMatchers("/smartor/organization/list").permitAll()
                // 除上面外的所有请求全部需要鉴权认证
                .anyRequest().authenticated().and().headers().frameOptions().disable();
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
@@ -1399,7 +1399,7 @@
                    serviceOutPath.setOrgid(serviceSubtask.getOrgid());
                    iServiceOutPathService.insertServiceOutPath(serviceOutPath);
                    String url = "";
                    String format = String.format("%03X", serviceOutPath.getId());
                    String format = ShortCode.encode(serviceOutPath.getId());
                    //先判断一下发的是不是宣教
                    log.info("serviceSubtask.getType的值为:{}", serviceSubtask.getType());
                    if (!"3".equals(serviceSubtask.getType())) {
@@ -1542,7 +1542,7 @@
                    serviceOutPath.setCreateTime(new Date());
                    serviceOutPath.setOrgid(serviceSubtask.getOrgid());
                    iServiceOutPathService.insertServiceOutPath(serviceOutPath);
                    String format = String.format("%03X", serviceOutPath.getId());
                    String format = ShortCode.encode(serviceOutPath.getId());
                    serviceOutPath.setRadix(format);
                    serviceOutPath.setUpdateTime(new Date());
                    serviceOutPath.setUrl(url);
ruoyi-task/src/main/java/com/ruoyi/task/controller/ServiceSubtaskController.java
@@ -3,10 +3,12 @@
import com.alibaba.fastjson.JSON;
import com.github.pagehelper.ISelect;
import com.ruoyi.common.annotation.AddOrgId;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.entity.SysUserDept;
import com.ruoyi.common.core.domain.model.LoginUser;
@@ -64,6 +66,7 @@
import com.ruoyi.task.domain.VO.TransferDeptVO;
import com.ruoyi.task.domain.ServiceSubtaskExport;
import com.ruoyi.system.service.ISysConfigService;
import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.system.service.ISysUserDeptService;
/**
@@ -111,6 +114,9 @@
    @Autowired
    private ISysConfigService sysConfigService;
    @Autowired
    private ISysDeptService sysDeptService;
    /**
     * 任务运维触发能力。
@@ -595,6 +601,155 @@
        return getDataTable4(CollectionUtils.isEmpty(sfStatistics) ? sfStatistics.size() : 0, serviceSubtaskService.getSfStatistics(serviceSubtaskCountReq));
    }
    // =====================================================================================
    // 免登录随访统计(供 public/html/sfstat.html 独立页面使用,@Anonymous 即 SecurityConfig 的 permitAll)
    // 口径与 /getSfStatistics 完全一致,区别只有两点:
    //   1. 不依赖登录用户,orgid / campusid 由请求体显式传入;
    //   2. 未指定病区(科室)时,取该机构(院区)下的全部病区(科室),而非当前登录用户的权限范围。
    // =====================================================================================
    /**
     * 免登录:随访统计(首次 / 再次)
     */
    @Anonymous
    @PostMapping("/publicSfStatistics")
    public Map<String, Object> publicSfStatistics(@RequestBody ServiceSubtaskCountReq serviceSubtaskCountReq) {
        if (CollectionUtils.isEmpty(serviceSubtaskCountReq.getServiceType())) {
            return error("服务类型不能为空");
        }
        if (StringUtils.isEmpty(serviceSubtaskCountReq.getOrgid())) {
            return error("缺少机构参数 orgid");
        }
        Integer statisticaltype = serviceSubtaskCountReq.getStatisticaltype();
        if (statisticaltype != null && statisticaltype == 1) {
            List<String> wardCodes = isAllSelected(serviceSubtaskCountReq.getLeavehospitaldistrictcodes())
                    ? listDeptCodesByType(serviceSubtaskCountReq.getOrgid(), serviceSubtaskCountReq.getCampusid(), "2")
                    : serviceSubtaskCountReq.getLeavehospitaldistrictcodes();
            if (CollectionUtils.isEmpty(wardCodes)) {
                return getDataTable4(0, new ArrayList<>());
            }
            serviceSubtaskCountReq.setLeavehospitaldistrictcodes(wardCodes);
            serviceSubtaskCountReq.setDeptcodes(null);
        } else if (statisticaltype != null && statisticaltype == 2) {
            List<String> deptCodes = isAllSelected(serviceSubtaskCountReq.getDeptcodes())
                    ? listDeptCodesByType(serviceSubtaskCountReq.getOrgid(), serviceSubtaskCountReq.getCampusid(), "1")
                    : serviceSubtaskCountReq.getDeptcodes();
            if (CollectionUtils.isEmpty(deptCodes)) {
                return getDataTable4(0, new ArrayList<>());
            }
            serviceSubtaskCountReq.setDeptcodes(deptCodes);
            serviceSubtaskCountReq.setLeavehospitaldistrictcodes(null);
        }
        String followUpCountStyle = sysConfigService.selectConfigByKey("followUpCountStyle", serviceSubtaskCountReq.getOrgid());
        if (ObjectUtils.isNotEmpty(followUpCountStyle)) {
            serviceSubtaskCountReq.setFollowUpCountStyle(followUpCountStyle);
        } else {
            serviceSubtaskCountReq.setFollowUpCountStyle("1");
        }
        if (serviceSubtaskCountReq.getRateDay() == null) {
            serviceSubtaskCountReq.setRateDay(7);
        }
        serviceSubtaskCountReq.setPageNum(null);
        serviceSubtaskCountReq.setPageSize(null);
        List<ServiceSubtaskStatistic> sfStatistics = serviceSubtaskService.getSfStatistics(serviceSubtaskCountReq);
        return getDataTable4(CollectionUtils.isEmpty(sfStatistics) ? 0 : sfStatistics.size(), sfStatistics);
    }
    /**
     * 免登录:随访统计筛选项(病区列表 / 科室列表)
     *
     * @param orgid    机构ID,必填
     * @param campusid 院区ID,可为空;为空时取该机构全部院区
     */
    @Anonymous
    @GetMapping("/publicSfStatisticsOptions")    public AjaxResult publicSfStatisticsOptions(@RequestParam(value = "orgid", required = false) String orgid,
                                                @RequestParam(value = "campusid", required = false) String campusid) {
        if (StringUtils.isEmpty(orgid)) {
            return error("缺少机构参数 orgid");
        }
        Map<String, Object> result = new LinkedHashMap<>();
        result.put("orgid", orgid);
        result.put("campusid", campusid);
        result.put("wards", listDepts(orgid, campusid, "2"));
        result.put("depts", listDepts(orgid, campusid, "1"));
        return success(result);
    }
    /**
     * 免登录:延续护理统计(口径与 /getContinueNerseCount 一致,orgid / campusid 由请求体传入)
     */
    @Anonymous
    @PostMapping("/publicContinueNerseCount")
    public AjaxResult publicContinueNerseCount(@RequestBody ServiceSubtaskCotinueCountVO serviceSubtaskCotinueCountVO) {
        if (StringUtils.isEmpty(serviceSubtaskCotinueCountVO.getOrgid())) {
            return error("缺少机构参数 orgid");
        }
        List<String> districts = serviceSubtaskCotinueCountVO.getLeavehospitaldistrictcodes();
        List<String> depts = serviceSubtaskCotinueCountVO.getDeptcodes();
        boolean hasDistrict = !CollectionUtils.isEmpty(districts) && !districts.contains("all");
        boolean hasDept = !CollectionUtils.isEmpty(depts) && !depts.contains("all");
        if (hasDistrict && hasDept) {
            return error("病区Code集合与科室Code集合互斥,不能同时传入");
        }
        if (!hasDistrict && !hasDept) {
            // 未指定病区/科室:按该机构(院区)下全部病区统计
            List<String> wardCodes = listDeptCodesByType(serviceSubtaskCotinueCountVO.getOrgid(),
                    serviceSubtaskCotinueCountVO.getCampusid(), "2");
            if (CollectionUtils.isEmpty(wardCodes)) {
                return success(new LinkedHashMap<>());
            }
            serviceSubtaskCotinueCountVO.setLeavehospitaldistrictcodes(wardCodes);
            serviceSubtaskCotinueCountVO.setDeptcodes(null);
        } else if (hasDistrict) {
            serviceSubtaskCotinueCountVO.setDeptcodes(null);
        } else {
            serviceSubtaskCotinueCountVO.setLeavehospitaldistrictcodes(null);
        }
        return success(serviceSubtaskService.getContinueNurseCount(serviceSubtaskCotinueCountVO));
    }
    /**
     * 前端未选择具体病区/科室(或选择了 all)时,视为“全部”
     */
    private boolean isAllSelected(List<String> codes) {
        return CollectionUtils.isEmpty(codes) || codes.contains("all");
    }
    private List<String> listDeptCodesByType(String orgid, String campusid, String deptType) {
        List<String> codes = new ArrayList<>();
        for (Map<String, String> item : listDepts(orgid, campusid, deptType)) {
            codes.add(item.get("code"));
        }
        return codes;
    }
    /**
     * 查询机构(院区)下指定类型的部门:deptType=2 病区,deptType=1 科室
     */
    private List<Map<String, String>> listDepts(String orgid, String campusid, String deptType) {
        List<Map<String, String>> result = new ArrayList<>();
        SysDept query = new SysDept();
        query.setOrgid(orgid);
        query.setDeptType(deptType);
        if (StringUtils.isNotEmpty(campusid) && !"all".equalsIgnoreCase(campusid)) {
            query.setCampusid(campusid);
        }
        List<SysDept> depts = sysDeptService.selectSysDeptList(query);
        if (CollectionUtils.isEmpty(depts)) {
            return result;
        }
        for (SysDept dept : depts) {
            if (StringUtils.isEmpty(dept.getDeptCode())) {
                continue;
            }
            Map<String, String> item = new LinkedHashMap<>();
            item.put("code", dept.getDeptCode());
            item.put("name", dept.getDeptName());
            result.add(item);
        }
        return result;
    }
    /**
     * 获取专病随访统计比例
     */
ruoyi-task/src/main/java/com/ruoyi/task/domain/ServiceOutPath.java
@@ -83,8 +83,8 @@
    @ApiModelProperty(value = "科室名称")
    private String deptName;
    @ApiModelProperty(value = "病人信息")
    private PatArchive patArchive;
//    @ApiModelProperty(value = "病人信息")
//    private PatArchive patArchive;
    /**
ruoyi-task/src/main/java/com/ruoyi/task/service/impl/ServiceOutPathServiceImpl.java
@@ -2,6 +2,7 @@
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.RSAPublicKeyExample;
import com.ruoyi.common.utils.ShortCode;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@@ -94,8 +95,8 @@
        sop.setDeptName(serviceTask.getDeptname());
        sop.setWardName(serviceTask.getLeavehospitaldistrictname());
        serviceOutPathMapper.insertServiceOutPath(sop);
        //转成16进制并回写radix和updateTime
        serviceOutPath.setRadix(String.format("%03X", sop.getId()));
        // 生成 6 位 base62 短码(带密钥双射,不可枚举)并回写 radix 和 updateTime
        serviceOutPath.setRadix(ShortCode.encode(sop.getId()));
        serviceOutPath.setUrl(StringUtils.isNotEmpty(req_path) ? localIP + ":" + req_path + "/wt?p=" + sop.getRadix() : localIP + "/wt?p=" + sop.getRadix());
        serviceOutPathMapper.updateServiceOutPath(serviceOutPath);
        return serviceOutPath.getUrl();
ruoyi-task/src/main/java/com/ruoyi/task/service/impl/ServiceSubtaskServiceImpl.java
@@ -913,7 +913,7 @@
            serviceOutPath.setSubId(serviceSubtask1.getId());
            List<ServiceOutPath> serviceOutPaths = serviceOutPathMapper.selectServiceOutPathList(serviceOutPath);
            if (CollectionUtils.isNotEmpty(serviceOutPaths))
                format = String.format("%03X", serviceOutPaths.get(0).getId());
                format = ShortCode.encode(serviceOutPaths.get(0).getId());
            else format = getOutPath(serviceSubtask1, rsaPublicKeyExample);
            serviceSubtask = serviceSubtask1;
        } else {
@@ -965,7 +965,7 @@
        serviceOutPath.setSubId(serviceSubtask.getId());
        iServiceOutPathService.insertServiceOutPath(serviceOutPath);
        //转成16进制
        format = String.format("%03X", serviceOutPath.getId());
        format = ShortCode.encode(serviceOutPath.getId());
        serviceOutPath.setRadix(format);
        serviceOutPath.setUpdateTime(new Date());
        iServiceOutPathService.updateServiceOutPath(serviceOutPath);
@@ -5128,7 +5128,7 @@
        serviceOutPath.setCreateTime(new Date());
        serviceOutPath.setOrgid(serviceSubtask.getOrgid());
        iServiceOutPathService.insertServiceOutPath(serviceOutPath);
        String format = String.format("%03X", serviceOutPath.getId());
        String format = ShortCode.encode(serviceOutPath.getId());
        String url = "";
        SendMagParam sendMagParam = new SendMagParam();
        sendMagParam.setType("4");
@@ -5212,7 +5212,7 @@
            serviceOutPath.setCreateTime(new Date());
            serviceOutPath.setOrgid(serviceSubtask.getOrgid());
            iServiceOutPathService.insertServiceOutPath(serviceOutPath);
            String format = String.format("%03X", serviceOutPath.getId());
            String format = ShortCode.encode(serviceOutPath.getId());
            serviceOutPath.setRadix(format);
            serviceOutPath.setUpdateTime(new Date());
            serviceOutPath.setUrl(url);
@@ -5427,7 +5427,7 @@
                        serviceOutPath.setCreateTime(new Date());
                        serviceOutPath.setOrgid(serviceTask.getOrgid());
                        iServiceOutPathService.insertServiceOutPath(serviceOutPath);
                        String format = String.format("%03X", serviceOutPath.getId());
                        String format = ShortCode.encode(serviceOutPath.getId());
                        serviceOutPath.setRadix(format);
                        serviceOutPath.setUpdateTime(new Date());
                        String url = StringUtils.isNotEmpty(req_path) ? ip + ":" + req_path + "/wt?p=" + format : ip + "/wt?p=" + format;
ruoyi-task/src/main/resources/mapper/task/ServiceOutPathMapper.xml
@@ -55,6 +55,9 @@
        <include refid="selectServiceOutPathVo"/>
        where 1=1
        and del_flag = 0
        <if test="id != null">
            and id = #{id}
        </if>
        <if test="param1 != null ">
            and param1 = #{param1}
        </if>