陈昶聿
3 小时以前 9104e047e7ef7c4504bd548711b8fdeda3abd621
【丽水】collectUser 修正
已修改3个文件
28 ■■■■■ 文件已修改
ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/CollectHISServiceImpl.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/mapper/SysDept2Mapper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/SysDeptMapper.xml 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/CollectHISServiceImpl.java
@@ -817,7 +817,12 @@
        log.info("selectDeptList的采集到的数量为:{}", sysDepts.size());
        // count = sysDept2Mapper.batchDept(sysDepts);
        for (SysDept row : sysDepts) {
            SysDept sysDeptTemp = sysDept2Mapper.selectDeptByCode(row.getDeptCode(), null);
            // 科室和病区可能共用同一个 dept_code,必须按 dept_type + orgid 精确定位,否则 selectOne 会返回多条
            if (StringUtils.isEmpty(row.getDeptCode())) {
                log.warn("selectDeptList跳过deptCode为空的记录:{}", row);
                continue;
            }
            SysDept sysDeptTemp = sysDept2Mapper.selectDeptByCodeAndType(row.getDeptCode(), row.getOrgid(), row.getDeptType());
            if (sysDeptTemp != null && sysDeptTemp.getDeptName() != null) {
                row.setDeptId(sysDeptTemp.getDeptId());
                count += sysDept2Mapper.updateDept(row);
smartor/src/main/java/com/smartor/mapper/SysDept2Mapper.java
@@ -40,6 +40,11 @@
    public SysDept selectDeptByCode(@Param("deptCode")String deptCode,@Param("orgid")String orgid);
    /**
     * 按科室编码、机构、科室类型查询(科室和病区可能使用相同编码,必须带 deptType 精确定位)
     */
    public SysDept selectDeptByCodeAndType(@Param("deptCode")String deptCode,@Param("orgid")String orgid,@Param("deptType")String deptType);
    public SysDept selectDeptByCodeAndCampus(@Param("deptCode")String deptCode,@Param("orgid")String orgid,@Param("campusid")String campusid);
    /**
smartor/src/main/resources/mapper/smartor/SysDeptMapper.xml
@@ -152,6 +152,22 @@
        <if test="orgid != null and orgid != ''">
            AND orgid = #{orgid}
        </if>
        order by d.dept_id
        limit 1
    </select>
    <select id="selectDeptByCodeAndType" resultMap="SysDeptResult">
        <include refid="selectDeptVo"/>
        where d.del_flag = '0'
        and d.dept_code = #{deptCode}
        <if test="orgid != null and orgid != ''">
            AND d.orgid = #{orgid}
        </if>
        <if test="deptType != null and deptType != ''">
            AND d.dept_type = #{deptType}
        </if>
        order by d.dept_id
        limit 1
    </select>
    <select id="selectDeptByCodeAndCampus" parameterType="string" resultMap="SysDeptResult">