liusheng
2025-11-06 56e6e579618a13221e56cd49e72c9ac0904da95c
代码提交
已修改8个文件
154 ■■■■ 文件已修改
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SchemeAutofinshruleController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/resources/application-druid.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/resources/application-local.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java 69 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/ISchemeAutofinshruleService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/SchemeAutofinshruleServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/SysUserDeptMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SchemeAutofinshruleController.java
@@ -17,7 +17,7 @@
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.smartor.domain.SchemeAutofinshrule;
import com.smartor.domain.SchemeAutofinshrule;
import com.smartor.service.ISchemeAutofinshruleService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
ruoyi-admin/src/main/resources/application-druid.yml
@@ -24,7 +24,7 @@
        #        password: Ls@123456
        #        driver-class-name: org.postgresql.Driver
        #      高斯数据库链接
        url: jdbc:postgresql://172.20.32.115:15400/smartorwx?prepareThreshold=0
        url: jdbc:postgresql://127.0.0.1:15400/smartorwx?prepareThreshold=0
        username: shuifang
        password: Shuifang@51868
        driver-class-name: org.postgresql.Driver
ruoyi-admin/src/main/resources/application-local.yml
@@ -19,7 +19,7 @@
        #        password: csbsbxt@123
        #        driver-class-name: org.postgresql.Driver
        #      本地高斯
        url: jdbc:postgresql://192.168.100.126:5432/postgres
        url: jdbc:postgresql://127.0.0.1:5432/postgres
        username: gaussdb
        password: Ls@123456
        driver-class-name: org.postgresql.Driver
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
@@ -307,16 +307,63 @@
        user.setCreateTime(new Date());
        int rows = userMapper.insertUser(user);
        //新增用户与部门关联
        if (!CollectionUtils.isEmpty(user.getDepts())) {
            for (Long deptId : user.getDepts()) {
                SysUserDept sysUserDep = new SysUserDept();
                sysUserDep.setUserId(user.getUserId());
                sysUserDep.setDeptId(deptId);
                sysUserDep.setCreateTime(new Date());
                sysUserDep.setUpdateTime(new Date());
                sysUserDeptMapper.insertSysUserDept(sysUserDep);
//        if (!CollectionUtils.isEmpty(user.getDepts())) {
//            for (Long deptId : user.getDepts()) {
//                SysUserDept sysUserDep = new SysUserDept();
//                sysUserDep.setUserId(user.getUserId());
//                sysUserDep.setDeptId(deptId);
//                sysUserDep.setCreateTime(new Date());
//                sysUserDep.setUpdateTime(new Date());
//                sysUserDeptMapper.insertSysUserDept(sysUserDep);
//            }
//        }
        if (!CollectionUtils.isEmpty(user.getDeptCodes())) {
            for (String deptCode : user.getDeptCodes()) {
                SysDept sysDept = sysDeptMapper.selectDeptByCode(deptCode);
                if (Objects.isNull(sysDept)) {
                    log.error("部门编码不存在");
                    continue;
                }
                SysUserDept sysUserDept = new SysUserDept();
                sysUserDept.setUserId(user.getUserId());
                sysUserDept.setDeptCode(deptCode);
                sysUserDept.setDeptId(sysDept.getDeptId());
                List<SysUserDept> sysUserDepts = sysUserDeptMapper.selectSysUserDeptList(sysUserDept);
                sysUserDept.setDelFlag(0L);
                sysUserDept.setDeptType("1");
                sysUserDept.setDeptName(sysDept.getDeptName());
                sysUserDept.setUpdateTime(new Date());
                if (!CollectionUtils.isEmpty(sysUserDepts)) {
                    sysUserDeptMapper.updateSysUserDept(sysUserDept);
                    continue;
                }
                sysUserDept.setCreateTime(new Date());
                sysUserDeptMapper.insertSysUserDept(sysUserDept);
            }
        }
        if (!CollectionUtils.isEmpty(user.getWardCodes())) {
            for (String wardCode : user.getWardCodes()) {
                SysDept sysDept = sysDeptMapper.selectDeptByCode(wardCode);
                SysUserDept sysUserDept = new SysUserDept();
                sysUserDept.setUserId(user.getUserId());
                sysUserDept.setDeptCode(wardCode);
                List<SysUserDept> sysUserDepts = sysUserDeptMapper.selectSysUserDeptList(sysUserDept);
                sysUserDept.setDelFlag(0L);
                sysUserDept.setDeptType("2");
                sysUserDept.setDeptName(sysDept.getDeptName());
                sysUserDept.setUpdateTime(new Date());
                if (!CollectionUtils.isEmpty(sysUserDepts)) {
                    sysUserDeptMapper.updateSysUserDept(sysUserDept);
                    continue;
                }
                sysUserDept.setCreateTime(new Date());
                sysUserDeptMapper.insertSysUserDept(sysUserDept);
            }
        }
        // 新增用户岗位关联
        insertUserPost(user);
        // 新增用户与角色管理
@@ -380,10 +427,15 @@
        if (!CollectionUtils.isEmpty(user.getDeptCodes())) {
            for (String deptCode : user.getDeptCodes()) {
                SysDept sysDept = sysDeptMapper.selectDeptByCode(deptCode);
                if (Objects.isNull(sysDept)) {
                    log.error("部门编码不存在");
                    continue;
                }
                SysUserDept sysUserDept = new SysUserDept();
                sysUserDept.setUserId(user.getUserId());
                sysUserDept.setDeptCode(deptCode);
                sysUserDept.setDeptId(sysDept.getDeptId());
                List<SysUserDept> sysUserDepts = sysUserDeptMapper.selectSysUserDeptList(sysUserDept);
                sysUserDept.setDelFlag(0L);
                sysUserDept.setDeptType("1");
@@ -405,6 +457,7 @@
                sysUserDept.setUserId(user.getUserId());
                sysUserDept.setDeptCode(wardCode);
                List<SysUserDept> sysUserDepts = sysUserDeptMapper.selectSysUserDeptList(sysUserDept);
                sysUserDept.setDeptId(sysDept.getDeptId());
                sysUserDept.setDelFlag(0L);
                sysUserDept.setDeptType("2");
                sysUserDept.setDeptName(sysDept.getDeptName());
smartor/src/main/java/com/smartor/service/ISchemeAutofinshruleService.java
@@ -1,7 +1,7 @@
package com.smartor.service;
import java.util.List;
import com.ruoyi.smartor.domain.SchemeAutofinshrule;
import com.smartor.domain.SchemeAutofinshrule;
/**
 * 方案结案规则Service接口
smartor/src/main/java/com/smartor/service/impl/SchemeAutofinshruleServiceImpl.java
@@ -1,7 +1,7 @@
package com.smartor.service.impl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.smartor.domain.SchemeAutofinshrule;
import com.smartor.domain.SchemeAutofinshrule;
import com.smartor.mapper.SchemeAutofinshruleMapper;
import com.smartor.service.ISchemeAutofinshruleService;
import org.springframework.beans.factory.annotation.Autowired;
smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml
@@ -674,72 +674,13 @@
    </delete>
    <select id="getDeptRanking" parameterType="com.smartor.domain.PatMedReq" resultType="com.smartor.domain.PatMedRes">
        SELECT deptname, COUNT(1) AS rc
        FROM (
        <if test="mz != null">
            SELECT deptname
            FROM pat_med_outhosp
            <where>
                del_flag=0
                <if test="deptcodeList != null">
                    and deptcode in
                    <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
                        #{deptcode}
                    </foreach>
                </if>
            </where>
        </if>
        <if test="mz != null and zy != null">
            UNION ALL
        </if>
        <if test="zy != null">
            SELECT deptname
            FROM pat_med_inhosp
            <where>
                del_flag=0
                and inhospstate=0
                <if test="deptcodeList != null">
                    and deptcode in
                    <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
                        #{deptcode}
                    </foreach>
                </if>
            </where>
        </if>
        <if test="cy != null and zy != null">
            UNION ALL
            SELECT deptname
            FROM pat_med_inhosp
            <where>
                del_flag=0
                and inhospstate=1
                <if test="deptcodeList != null">
                    and deptcode in
                    <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
                        #{deptcode}
                    </foreach>
                </if>
            </where>
        </if>
        <if test="mz != null and zy != null and cy==null">
            UNION ALL
            SELECT deptname
            FROM pat_med_inhosp
            <where>
                del_flag=0
                and inhospstate=1
                <if test="deptcodeList != null">
                    and deptcode in
                    <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
                        #{deptcode}
                    </foreach>
                </if>
            </where>
        </if>
        ) AS combined
        GROUP BY deptname;
        SELECT deptname,
               count(1) AS rc
        FROM service_subtask
        WHERE finishtime >= #{startDate}
          AND finishtime &lt;= #{endDate}
          AND deptname is not null
        GROUP BY deptname
    </select>
    <select id="selectPatMedInhospCount" parameterType="com.smartor.domain.PatMedReq"
            resultType="com.smartor.domain.PatMedRes">
smartor/src/main/resources/mapper/smartor/SysUserDeptMapper.xml
@@ -176,7 +176,7 @@
               d.leader,
               d.status as dept_status
        from sys_dept d
                 left join sys_user_dept ud on d.dept_id = ud.dept_id
                 left join sys_user_dept ud on d.dept_code = ud.dept_code
        where ud.user_id = #{userId}
          and ud.del_flag = 0
          and d.del_flag = 0