luohairen
2024-12-31 0c35c75ada3bb2a0a4d2843d20445af524f0e357
调整页面赋码展示,新增一个项目中心页面展示
5个文件已修改
38 ■■■■■ 已修改文件
business/src/main/java/com/ycl/domain/query/ProjectInfoQuery.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/resources/mapper/ProjectInfoMapper.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
system/src/main/java/com/ycl/system/mapper/SysDeptMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
system/src/main/resources/mapper/system/SysDeptMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/java/com/ycl/domain/query/ProjectInfoQuery.java
@@ -49,5 +49,8 @@
    private Date projectEndTime;
    //从有没有流程判断是存储还是早期
    private String reserveOrPrevious;
    private Integer role;// 业主:0,审核:1
    private Long createBy;
    private Integer usedStatus;
}
business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java
@@ -40,6 +40,7 @@
import com.ycl.mapper.*;
import com.ycl.service.FileService;
import com.ycl.service.ProjectInfoService;
import com.ycl.system.mapper.SysDeptMapper;
import lombok.RequiredArgsConstructor;
import org.apache.commons.codec.Charsets;
import org.springframework.stereotype.Service;
@@ -88,6 +89,7 @@
    private final ProjectInvestmentFundingServiceImpl projectInvestmentFundingServiceImpl;
    private final ProjectInvestmentPolicyComplianceServiceImpl projectInvestmentPolicyComplianceServiceImpl;
    private final ProjectUnitRegistrationInfoServiceImpl projectUnitRegistrationInfoServiceImpl;
    private final SysDeptMapper sysDeptMapper;
    /**
     * 添加
@@ -227,6 +229,19 @@
            return Result.ok().data(list).total(0);
        }
        Long userId = SecurityUtils.getUserId();
        String ancestors = sysDeptMapper.selectAncestors(userId);
        String[] ancestorArr = ancestors.split(",");
        for (String ancestor : ancestorArr) {
            if ("101".equals(ancestor)) { // 业主
                query.setCreateBy(userId);
                query.setRole(0);
            }else if ("102".equals(ancestor)){ // 审批
                query.setUsedStatus(1);
                query.setRole(1);
            }
        }
        IPage<ProjectInfoVO> page = PageUtil.getPage(query, ProjectInfoVO.class);
        baseMapper.getPage(page, query);
        List<ProjectInfoVO> records = page.getRecords();
business/src/main/resources/mapper/ProjectInfoMapper.xml
@@ -105,7 +105,6 @@
        LEFT JOIN t_project_process TPP ON TPI.id = TPP.project_id and TPP.deleted = 0
        <where>
            TPI.deleted = 0
            and TPI.used_status = 2
            <if test="query.projectName !=null and query.projectName!=''">
                and TPI.project_name like concat('%',#{query.projectName},'%')
            </if>
@@ -151,9 +150,20 @@
            <if test="query.reserveOrPrevious != null and query.reserveOrPrevious == 'previous'">
                and TPP.process_ins_id is not null
            </if>
            <if test="query.projectCategory == null">
                and TPI.used_status = 2
            </if>
            <if test="query.projectCategory == 3">
                and (TPI.project_status = 'working' or TPI.project_status = 'stop')
            </if>
            <if test="query.projectCategory == 6">
                <if test="query.role == 0">
                    and TPI.create_by = #{query.createBy}
                </if>
                <if test="query.role == 1">
                    and TPI.used_status = #{query.usedStatus}
                </if>
            </if>
        </where>
        order by TPI.gmt_create
    </select>
system/src/main/java/com/ycl/system/mapper/SysDeptMapper.java
@@ -115,4 +115,6 @@
     * @return 结果
     */
    public int deleteDeptById(Long deptId);
    String selectAncestors(Long userId);
}
system/src/main/resources/mapper/system/SysDeptMapper.xml
@@ -86,6 +86,12 @@
        <include refid="selectDeptVo"/>
        where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
    </select>
    <select id="selectAncestors" resultType="java.lang.String">
        select ancestors
        from sys_user SU
        INNER JOIN sys_dept SD ON SU.dept_id = SD.dept_id
        where SU.user_id = #{userId}
    </select>
    <insert id="insertDept" parameterType="SysDept">
         insert into sys_dept(