shenyijian
2024-06-27 b1e84b26d0b0f254d5e000092ce9f0ef56a1304c
湖北水库:施工:管理员查询所有上报
8 files modified
102 ■■■■■ changed files
skjcmanager/skjcmanager-service-api/skjcmanager-sm-api/src/main/java/cn/gistack/sm/sg/DO/SgGxRoleDO.java 2 ●●● patch | view | raw | blame | history
skjcmanager/skjcmanager-service-api/skjcmanager-sm-api/src/main/java/cn/gistack/sm/sg/DTO/ProjectSearchDTO.java 2 ●●●●● patch | view | raw | blame | history
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/controller/SgProgressReportController.java 18 ●●●●● patch | view | raw | blame | history
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/mapper/SgProgressReportMapper.java 2 ●●●●● patch | view | raw | blame | history
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/mapper/SgProgressReportMapper.xml 31 ●●●●● patch | view | raw | blame | history
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/service/SgProgressReportService.java 6 ●●●●● patch | view | raw | blame | history
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/service/impl/SgGxStepServiceImpl.java 6 ●●●● patch | view | raw | blame | history
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/service/impl/SgProgressReportServiceImpl.java 35 ●●●● patch | view | raw | blame | history
skjcmanager/skjcmanager-service-api/skjcmanager-sm-api/src/main/java/cn/gistack/sm/sg/DO/SgGxRoleDO.java
@@ -39,7 +39,7 @@
    /**
     * 角色id
     */
    private Long roleId;
    private String roleId;
    /**
     * 角色审核顺序
skjcmanager/skjcmanager-service-api/skjcmanager-sm-api/src/main/java/cn/gistack/sm/sg/DTO/ProjectSearchDTO.java
@@ -29,4 +29,6 @@
    private Integer status;
    private Long reportPerson;
    private List<Long> projectIds;
    private String startTime;
    private String endTime;
}
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/controller/SgProgressReportController.java
@@ -41,6 +41,15 @@
    }
    /**
     * 分页列表查询(所有数据,管理员用)
     */
    @GetMapping(value = "/page_all")
    public R queryPageListAll(ProjectSearchDTO searchDTO, Query query) {
        IPage<SgProgressReportVO> page = sgProgressReportService.queryPageListAll(Condition.getPage(query), searchDTO);
        return R.data(page);
    }
    /**
     * 新增上报
     */
    @PostMapping(value = "/add")
@@ -96,6 +105,15 @@
    }
    /**
     * 待办列表统计(APP、web共用)
     */
    @GetMapping(value = "/approval_count_all")
    public R countListAll(ProjectSearchDTO searchDTO) {
        Map<String,Long> map= sgProgressReportService.countListAll( searchDTO);
        return R.data(map);
    }
    /**
     * 待办列表统计(APP)
     */
    @GetMapping(value = "/approval_count")
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/mapper/SgProgressReportMapper.java
@@ -35,4 +35,6 @@
    List<SgProgressReportVO> statusCount(@Param("dto") ProjectSearchDTO searchDTO);
    List<Map<String, Object>> getUserByIds(@Param("ids") List<Long> ids);
    List<SgProgressReportVO> queryPageListAll(@Param("page") IPage<SgProgressReportVO> page, @Param("dto") ProjectSearchDTO searchDTO);
}
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/mapper/SgProgressReportMapper.xml
@@ -26,6 +26,35 @@
            and report.report_user = #{dto.reportPerson}
        </if>
    </select>
    <select id="queryPageListAll" resultType="cn.gistack.sm.sg.VO.SgProgressReportVO">
        SELECT
        report.*,
        de.device_name,
        de.device_type,
        dict."DICT_VALUE" as typeName
        FROM
        ywxt.SG_PROGRESS_REPORT report
        LEFT JOIN ywxt.sg_device de ON report.gx_device_id = de.id
        left join YWXT."BLADE_DICT_BIZ" as dict  on de.device_type=dict.DICT_KEY  and dict.CODE='SG_DEVICE_TYPE'
        where 1=1 and report."STATUS" != 4
        <if test="dto.projectName != null and dto.projectName != ''">
            and report.PROGRAM_NAME like CONCAT(CONCAT('%',#{dto.projectName}),'%')
        </if>
        <if test="dto.deviceName != null and dto.deviceName != ''">
            and de.device_name like CONCAT(CONCAT('%', #{dto.deviceName}), '%')
        </if>
        <if test="dto.status != null ">
            and report.status = #{dto.status}
        </if>
        <if test="dto.startTime != null and dto.startTime != ''">
            and report.create_time &gt;= #{dto.startTime}
        </if>
        <if test="dto.endTime != null and dto.endTime != ''">
            and report.create_time &lt;= #{dto.endTime}
        </if>
    </select>
    <select id="queryById" resultType="cn.gistack.sm.sg.VO.SgProgressReportVO">
        select * from  SG_PROGRESS_REPORT report where id = #{id}
    </select>
@@ -49,7 +78,7 @@
        left join YWXT."BLADE_DICT_BIZ" as dict  on de.device_type=dict.DICT_KEY  and dict.CODE='SG_DEVICE_TYPE'
        LEFT JOIN ywxt.sg_report_user userR ON report.id = userR.report_id
        WHERE
        1 = 1
        1 = 1 and report."STATUS" != 4
       <!-- AND userR.is_his = 0 -->
        <if test="dto.projectName != null and dto.projectName != ''">
            and report.PROGRAM_NAME like CONCAT(CONCAT('%',#{dto.projectName}),'%')
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/service/SgProgressReportService.java
@@ -22,6 +22,8 @@
    IPage<SgProgressReportVO> queryPageList(IPage<SgProgressReportVO> page, ProjectSearchDTO searchDTO);
    IPage<SgProgressReportVO> queryPageListAll(IPage<SgProgressReportVO> page, ProjectSearchDTO searchDTO);
    void add(SgProgressReportDO sgProgressReportDO);
    SgProgressReportVO detail(String id);
@@ -34,6 +36,8 @@
    Map<String, Long> countList(ProjectSearchDTO searchDTO);
    Map<String, Long> countListAll(ProjectSearchDTO searchDTO);
    Map<String, Long> statusCount(ProjectSearchDTO searchDTO);
    boolean checkStep(Long deviceId, Long stepId);
@@ -41,4 +45,6 @@
    IPage<SgProgressReportVO> progressPage(IPage<SgProgressReportVO> page, ProjectSearchDTO searchDTO);
    String getDeviceReport(Long deviceId, Long stepId);
}
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/service/impl/SgGxStepServiceImpl.java
@@ -104,7 +104,7 @@
            SgGxRoleDO sgGxRoleDO=new SgGxRoleDO();
            sgGxRoleDO.setGxDeviceType(sgGxRoleVO.getGxDeviceType());
            sgGxRoleDO.setGxStepId(sgGxRoleVO.getGxStepId());
            sgGxRoleDO.setRoleId(Long.valueOf(roleIds.get(i)));
            sgGxRoleDO.setRoleId(roleIds.get(i));
            sgGxRoleDO.setSgOrder(sgGxRoleVO.getOrders().get(i));
            sgGxRoles.add(sgGxRoleDO);
        }
@@ -120,7 +120,7 @@
@Transactional
public void updateSgGxRole(SgGxRoleVO sgGxRoleVO){
        String gxStepId = sgGxRoleVO.getGxStepId();
        List<SgProgressReportDO> reportDOS = new LambdaQueryChainWrapper<>(sgProgressReportMapper).eq(s -> s.getGxStepId(), gxStepId).list();
        List<SgProgressReportDO> reportDOS = new LambdaQueryChainWrapper<>(sgProgressReportMapper).eq(SgProgressReportDO::getGxStepId, gxStepId).list();
        List<SgGxRoleDO> list = new LambdaQueryChainWrapper<>(sgGxRoleMapper).eq(SgGxRoleDO::getGxStepId, gxStepId).orderByAsc(SgGxRoleDO::getSgOrder).list();
        List<String> roles = list.stream().map(SgGxRoleDO::getRoleId).map(Object::toString).collect(Collectors.toList());
        List<Integer> orders  = list.stream().map(SgGxRoleDO::getSgOrder).collect(Collectors.toList());
@@ -151,7 +151,7 @@
        SgGxRoleDO sgGxRoleDO=new SgGxRoleDO();
        sgGxRoleDO.setGxDeviceType(sgGxRoleVO.getGxDeviceType());
        sgGxRoleDO.setGxStepId(sgGxRoleVO.getGxStepId());
        sgGxRoleDO.setRoleId(Long.valueOf(roleIds.get(i)));
        sgGxRoleDO.setRoleId(roleIds.get(i));
        sgGxRoleDO.setSgOrder(sgGxRoleVO.getOrders().get(i));
        sgGxRoles.add(sgGxRoleDO);
    }
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/service/impl/SgProgressReportServiceImpl.java
@@ -7,6 +7,7 @@
import cn.gistack.sm.sg.VO.SgStepReportVO;
import cn.gistack.sm.sg.mapper.*;
import cn.gistack.sm.sg.service.SgProgressReportService;
import cn.hutool.http.useragent.UserAgentUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
@@ -64,10 +65,19 @@
        List<SgProgressReportVO> list = sgProgressReportMapper.queryPageList(page,searchDTO);
        return page.setRecords(list);
    }
    @Override
    public IPage<SgProgressReportVO> queryPageListAll(IPage<SgProgressReportVO> page, ProjectSearchDTO searchDTO) {
        List<SgProgressReportVO> list = sgProgressReportMapper.queryPageListAll(page,searchDTO);
        return page.setRecords(list);
    }
    @Override
    @Transactional
    public void add(SgProgressReportDO sgProgressReportDO) {
        //如果为草稿状态,单纯插入
        if(sgProgressReportDO.getStatus()==4){
            sgProgressReportMapper.insert(sgProgressReportDO);
            return;
        }
        Date now = DateUtil.now();
        sgProgressReportDO.setReportTime(now);
        sgProgressReportDO.setCreateTime(now);
@@ -76,7 +86,7 @@
        SgGxStepDO sgGxStepDO = sgGxStepMapper.selectById(gxStepId);
        List<SgGxStepDO> list = sgGxStepMapper.selectByGxInfoId(sgGxStepDO.getGxInfoId());
        QueryWrapper<SgProgressReportDO> wrapper = new QueryWrapper<>();
        wrapper.eq("gx_step_id", gxStepId).eq("gx_device_id",gxDeviceId);
        wrapper.eq("gx_step_id", gxStepId).eq("gx_device_id",gxDeviceId).ne("status",4);
        List<SgProgressReportDO> sgProgressReportDOS = sgProgressReportMapper.selectList(wrapper);
        if ( sgProgressReportDOS!=null && sgProgressReportDOS.size()>0){
            throw new ServiceException("此工序已存在审批!");
@@ -86,6 +96,7 @@
                QueryWrapper<SgProgressReportDO> wrapper1 = new QueryWrapper<>();
                wrapper1.eq("gx_step_id", gxStepDO.getId());
                wrapper1.eq("gx_device_id",gxDeviceId);
                wrapper1.ne("status",4);
                SgProgressReportDO one = sgProgressReportMapper.selectOne(wrapper1);
                if (one == null || one.getStatus() != 2) {
                    throw new ServiceException("请先完成" + gxStepDO.getGxStepName() + "的审批!");
@@ -314,6 +325,19 @@
    }
    @Override
    public Map<String, Long> countListAll(ProjectSearchDTO searchDTO) {
        List<SgProgressReportVO> list = sgProgressReportMapper.queryPageListAll(null, searchDTO);
        List<SgProgressReportVO> pending = list.stream().filter(s -> s.getStatus() == 0).collect(Collectors.toList());
        List<SgProgressReportVO> over = list.stream().filter(s -> s.getStatus() == 1||s.getStatus()==2).collect(Collectors.toList());
        List<SgProgressReportVO> reject = list.stream().filter(s -> s.getStatus() == 3).collect(Collectors.toList());
        Map<String, Long> map = new HashMap<>();
        map.put("pending", (long) pending.size());
        map.put("over", (long) over.size());
        map.put("reject", (long) reject.size());
        return map;
    }
    @Override
    public Map<String, Long> statusCount(ProjectSearchDTO searchDTO) {
        List<SgProgressReportVO> list = sgProgressReportMapper.statusCount(searchDTO);
        Map<String, Long> map  = new HashMap<>();
@@ -321,11 +345,13 @@
        List<SgProgressReportVO> progress = list.stream().filter(s -> s.getStatus() == 1).collect(Collectors.toList());
        List<SgProgressReportVO> over = list.stream().filter(s -> s.getStatus() == 2).collect(Collectors.toList());
        List<SgProgressReportVO> reject = list.stream().filter(s -> s.getStatus() == 3).collect(Collectors.toList());
        List<SgProgressReportVO> draft = list.stream().filter(s -> s.getStatus() == 4).collect(Collectors.toList());
        map.put("all", (long) list.size());
        map.put("pending", (long) pending.size());
        map.put("progress", (long) progress.size());
        map.put("over", (long) over.size());
        map.put("reject", (long) reject.size());
        map.put("draft", (long) draft.size());
        return map;
    }
@@ -334,7 +360,7 @@
        SgGxStepDO sgGxStepDO = sgGxStepMapper.selectById(gxStepId);
        List<SgGxStepDO> list = sgGxStepMapper.selectByGxInfoId(sgGxStepDO.getGxInfoId());
        QueryWrapper<SgProgressReportDO> wrapper = new QueryWrapper<>();
        wrapper.eq("gx_step_id", gxStepId).eq("gx_device_id",gxDeviceId);
        wrapper.eq("gx_step_id", gxStepId).eq("gx_device_id",gxDeviceId).ne("status",4);
        List<SgProgressReportDO> sgProgressReportDOS = sgProgressReportMapper.selectList(wrapper);
        if ( sgProgressReportDOS!=null && sgProgressReportDOS.size()>0){
            return false;
@@ -344,6 +370,7 @@
                QueryWrapper<SgProgressReportDO> wrapper1 = new QueryWrapper<>();
                wrapper1.eq("gx_step_id", gxStepDO.getId());
                wrapper1.eq("gx_device_id", gxDeviceId);
                wrapper1.ne("status",4);
                SgProgressReportDO one = sgProgressReportMapper.selectOne(wrapper1);
                if (one == null || one.getStatus() != 2) {
                    return false;
@@ -364,7 +391,7 @@
    @Override
    public String getDeviceReport(Long gxDeviceId, Long gxStepId) {
        QueryWrapper<SgProgressReportDO> wrapper = new QueryWrapper<>();
        wrapper.eq("gx_device_id",gxDeviceId);
        wrapper.eq("gx_device_id",gxDeviceId).ne("status",4);
        if (gxStepId!=null){
            wrapper.eq("gx_step_id",gxStepId);
        }