zhanghua
2025-02-22 5067a85bba03e5320c728b0c0ca713242beb8779
首页统计数量、金额问题、待办展示剩余时间的bug
11个文件已修改
93 ■■■■ 已修改文件
business/src/main/java/com/ycl/service/ProcessConfigInfoService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/java/com/ycl/service/impl/ProcessConfigInfoServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/java/com/ycl/service/impl/ProjectProcessServiceImpl.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/java/com/ycl/task/FlowableTask.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/resources/mapper/ProjectPlanExamineRecordMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
flowable/src/main/java/com/ycl/domain/entity/ProcessCoding.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
flowable/src/main/java/com/ycl/mapper/ProcessCodingMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
flowable/src/main/java/com/ycl/service/ProcessCodingService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
flowable/src/main/java/com/ycl/service/impl/ProcessCodingServiceImpl.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
flowable/src/main/resources/mapper/ProcessCodingMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/java/com/ycl/service/ProcessConfigInfoService.java
@@ -1,5 +1,6 @@
package com.ycl.service;
import com.ycl.domain.entity.ProcessCoding;
import com.ycl.domain.entity.ProcessConfigInfo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ycl.common.base.Result;
@@ -45,4 +46,5 @@
     * @return
     */
    Result getPage(ProcessConfigInfoQuery query);
}
business/src/main/java/com/ycl/service/impl/ProcessConfigInfoServiceImpl.java
@@ -117,4 +117,5 @@
        }
        return Result.ok().data(page.getRecords()).total(page.getTotal());
    }
}
business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java
@@ -437,7 +437,8 @@
                city.add(item);
            } else if (ImportanceTypeEnum.SHEHONG_KEY.getType().equals(item.getImportanceType())) {
                county.add(item);
            } else if (ImportanceTypeEnum.NORMAL.getType().equals(item.getImportanceType())) {
            } else // if  (ImportanceTypeEnum.NORMAL.getType().equals(item.getImportanceType()))
            {
                normal.add(item);
            }
        });
@@ -445,22 +446,22 @@
        proPhaseCountVO.add(new IndexProPhaseCountVO("储备规划阶段", reserve.size(), reserve.stream().
                filter(item -> !StringUtils.isEmpty(item.getTotalInvestment()))
                .map(item -> new BigDecimal(item.getTotalInvestment()).setScale(2, RoundingMode.HALF_UP))
                .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("100000000"), 2, RoundingMode.HALF_UP).toString(), "储"));
                .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("10000"), 2, RoundingMode.HALF_UP).toString(), "储"));
        proPhaseCountVO.add(new IndexProPhaseCountVO("项目前期阶段", previous.size(), previous.stream().
                filter(item -> !StringUtils.isEmpty(item.getTotalInvestment()))
                .map(item -> new BigDecimal(item.getTotalInvestment()).setScale(2, RoundingMode.HALF_UP))
                .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("100000000"), 2, RoundingMode.HALF_UP).toString(), "新"));
                .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("10000"), 2, RoundingMode.HALF_UP).toString(), "新"));
        proPhaseCountVO.add(new IndexProPhaseCountVO("实施阶段", implement.size(), implement.stream().
                filter(item -> !StringUtils.isEmpty(item.getTotalInvestment()))
                .map(item -> new BigDecimal(item.getTotalInvestment()).setScale(2, RoundingMode.HALF_UP))
                .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("100000000"), 2, RoundingMode.HALF_UP).toString(), "建"));
                .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("10000"), 2, RoundingMode.HALF_UP).toString(), "建"));
        proPhaseCountVO.add(new IndexProPhaseCountVO("竣工投用阶段", finish.size(), finish.stream().
                filter(item -> !StringUtils.isEmpty(item.getTotalInvestment()))
                .map(item -> new BigDecimal(item.getTotalInvestment()).setScale(2, RoundingMode.HALF_UP))
                .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("100000000"), 2, RoundingMode.HALF_UP).toString(), "竣"));
                .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("10000"), 2, RoundingMode.HALF_UP).toString(), "竣"));
        indexCountVO.setProPhaseCountVO(proPhaseCountVO);
@@ -468,22 +469,22 @@
        impTypeCountVO.add(new IndexImpTypeCountVO("一般项目", normal.size(), normal.stream().
                filter(item -> !StringUtils.isEmpty(item.getTotalInvestment()))
                .map(item -> new BigDecimal(item.getTotalInvestment()).setScale(2, RoundingMode.HALF_UP))
                .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("100000000"), 2, RoundingMode.HALF_UP).toString(), "普"));
                .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("10000"), 2, RoundingMode.HALF_UP).toString(), "普"));
        impTypeCountVO.add(new IndexImpTypeCountVO("县重点项目", county.size(), county.stream().
                filter(item -> !StringUtils.isEmpty(item.getTotalInvestment()))
                .map(item -> new BigDecimal(item.getTotalInvestment()).setScale(2, RoundingMode.HALF_UP))
                .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("100000000"), 2, RoundingMode.HALF_UP).toString(), "县"));
                .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("10000"), 2, RoundingMode.HALF_UP).toString(), "县"));
        impTypeCountVO.add(new IndexImpTypeCountVO("市重点项目", city.size(), city.stream().
                filter(item -> !StringUtils.isEmpty(item.getTotalInvestment()))
                .map(item -> new BigDecimal(item.getTotalInvestment()).setScale(2, RoundingMode.HALF_UP))
                .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("100000000"), 2, RoundingMode.HALF_UP).toString(), "市"));
                .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("10000"), 2, RoundingMode.HALF_UP).toString(), "市"));
        impTypeCountVO.add(new IndexImpTypeCountVO("省重点项目", province.size(), province.stream().
                filter(item -> !StringUtils.isEmpty(item.getTotalInvestment()))
                .map(item -> new BigDecimal(item.getTotalInvestment()).setScale(2, RoundingMode.HALF_UP))
                .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("100000000"), 2, RoundingMode.HALF_UP).toString(), "省"));
                .reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal("10000"), 2, RoundingMode.HALF_UP).toString(), "省"));
        indexCountVO.setImpTypeCountVO(impTypeCountVO);
        return indexCountVO;
    }
business/src/main/java/com/ycl/service/impl/ProjectProcessServiceImpl.java
@@ -89,6 +89,7 @@
    private final ISysDeptService deptService;
    private final ProcessLogService processLogService;
    private final ISysDictTypeService dictTypeService;
    private final ProcessConfigInfoService processConfigInfoService;
    /**
     * 分页查询
@@ -406,6 +407,20 @@
            if (processLogService.taskIsHangup(task.getId(), task.getProcessInstanceId())) {
                taskVO.setTaskStatus(TaskStatusEnum.HANGUP);
            }
            // 计算办理时间
            ProcessCoding processCoding = processCodingService.getByTaskId(task.getId());
            if (processCoding != null) {
                if (StringUtils.isNotBlank(processCoding.getOvertime())) {
                    Long overtime = getTime(processCoding.getOvertime());
                    long durationTime = ((new Date()).getTime() - processCoding.getStartTaskTime().getTime()) / 1000;
                    taskVO.setRemainingTime((overtime - durationTime) / 3600 + "小时");
                } else {
                    taskVO.setRemainingTime("-");
                }
            }
            this.distinctVo(taskVO);
            vos.add(taskVO);
        }
@@ -415,6 +430,23 @@
        result.put("taskList", vos);
    }
    private Long getTime(String timeStr) {
        Long time = null;
        if (StringUtils.isNotBlank(timeStr)) {
            String[] timeArr = timeStr.split("-");
            // 解析天数和小时数
            int days = Integer.parseInt(timeArr[0]);
            int hours = 0;
            if (timeArr.length > 1) {
                hours = Integer.parseInt(timeArr[1]);
            }
            time = (days * 24L + hours) * 3600L;
//            //分-秒
//            time= (days * 60L) + hours;
        }
        return time;
    }
    @Override
    public void getAllTodoTask(String taskName, int pageSize, int pageNum, Result result) {
        TaskQuery taskQuery = taskService.createTaskQuery()
business/src/main/java/com/ycl/task/FlowableTask.java
@@ -44,6 +44,7 @@
    private ProcessLogService processLogService;
    @Autowired
    private ProcessLogMapper processLogMapper;
    /**
     * 赋码任务
     * 两个逻辑 改项目码、改节点颜色
@@ -120,8 +121,7 @@
                String overtimeStatus = NORMAL;
                if (overtime != null && overtime !=0 && durationTime >= overtime) {
                    overtimeStatus = OVERTIME; // 如果超过办理期限
                }
                else if (overtime != null && overtime != 0 && durationTime >= (overtime - 12 * 60 * 60)) {
                } else if (overtime != null && overtime != 0 && durationTime >= (overtime - 12 * 60 * 60)) {
                    overtimeStatus = WILLOVERTIME; // 如果临期(固定超时前12小时为临期)
                }
//                else if (overtime != null && overtime != 0 && durationDay >= (overtime - 60)) {
@@ -130,6 +130,7 @@
                map.get(status).add(task.getProcessInstanceId());
                processCoding.setStatus(status);
                processCoding.setOvertimeStatus(overtimeStatus);
                processCoding.setStartTaskTime(task.getCreateTime());
                list.add(processCoding);
            } catch (Exception e) {
                log.error(e.getMessage(),"赋码时间格式有误");
business/src/main/resources/mapper/ProjectPlanExamineRecordMapper.xml
@@ -189,7 +189,7 @@
        from t_project_plan_examine_record ppe
                 LEFT JOIN t_project_plan_info ppi on ppe.project_plan_info_id = ppi.id
                 LEFT JOIN t_project_plan_record ppr on ppe.project_plan_record_id = ppr.id
                 INNER JOIN t_project_info pi on ppr.project_info_id = pi.id AND pi.deleted = 0
                 Left JOIN t_project_info pi on ppr.project_info_id = pi.id AND pi.deleted = 0
        WHERE ppe.department_user_id = #{userId} or manager_user_id = #{userId}
    </select>
flowable/src/main/java/com/ycl/domain/entity/ProcessCoding.java
@@ -5,6 +5,8 @@
import com.ycl.system.domain.base.AbsEntity;
import lombok.Data;
import java.util.Date;
/**
 *
 *
@@ -52,4 +54,7 @@
    @TableField("overtime_status")
    /** 任务超时状态 */
    private String overtimeStatus;
    @TableField("start_task_time")
    private Date startTaskTime;
}
flowable/src/main/java/com/ycl/mapper/ProcessCodingMapper.java
@@ -36,4 +36,6 @@
     * @param list
     */
    void updateBatch(@Param("list") List<ProcessCoding> list);
    List<ProcessCoding> findByTaskId(@Param("taskId") String taskId);
}
flowable/src/main/java/com/ycl/service/ProcessCodingService.java
@@ -63,4 +63,7 @@
     * @return
     */
    Result all();
    ProcessCoding getByTaskId(String id);
}
flowable/src/main/java/com/ycl/service/impl/ProcessCodingServiceImpl.java
@@ -1,6 +1,8 @@
package com.ycl.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ycl.common.base.Result;
import com.ycl.domain.entity.ProcessCoding;
@@ -32,6 +34,7 @@
    /**
     * 添加
     *
     * @param form
     * @return
     */
@@ -44,6 +47,7 @@
    /**
     * 修改
     *
     * @param form
     * @return
     */
@@ -60,6 +64,7 @@
    /**
     * 批量删除
     *
     * @param ids
     * @return
     */
@@ -71,6 +76,7 @@
    /**
     * id删除
     *
     * @param id
     * @return
     */
@@ -82,6 +88,7 @@
    /**
     * 分页查询
     *
     * @param query
     * @return
     */
@@ -94,6 +101,7 @@
    /**
     * 根据id查找
     *
     * @param id
     * @return
     */
@@ -106,6 +114,7 @@
    /**
     * 列表
     *
     * @return
     */
    @Override
@@ -116,4 +125,14 @@
                .collect(Collectors.toList());
        return Result.ok().data(vos);
    }
    @Override
    public ProcessCoding getByTaskId(String taskId) {
        List<ProcessCoding> list = baseMapper.findByTaskId(taskId);
        if (list.size() > 0) {
            return list.get(0);
        }
        return null;
    }
}
flowable/src/main/resources/mapper/ProcessCodingMapper.xml
@@ -52,6 +52,9 @@
        WHERE
            TPC.deleted = 0
    </select>
    <select id="findByTaskId" resultType="com.ycl.domain.entity.ProcessCoding">
        SELECT * from t_process_coding where task_id = #{taskId}
    </select>
    <!-- 自定义批量更新,使用前判断list是否为空 转换为sql
    update t_process_coding