xiangpei
2025-02-22 9703dd782af4d87af8a944a054aa133a699030a4
优化、bug
4个文件已修改
30 ■■■■■ 已修改文件
business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/java/com/ycl/service/impl/ProjectProcessServiceImpl.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/resources/mapper/ProjectInfoMapper.xml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
flowable/src/main/resources/mapper/ProcessCodingMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java
@@ -117,7 +117,7 @@
            entity.setUsedStatus(ProjectConstant.PASS);
        }
        if(!checkProjectNameAndIdIsUnique(entity,null)){
            return Result.error("项目名或项目码已存在");
            return Result.error("项目重复,项目名称、项目码已存在");
        }
        baseMapper.insert(entity);
        addPlan(entity.getId()); //添加计划表
@@ -148,7 +148,6 @@
            queryWrapper.eq("project_name", entity.getProjectName());
            if (StringUtils.isNotEmpty(entity.getProjectCode())) {
                queryWrapper.or();
                queryWrapper.eq("project_code", entity.getProjectCode());
            }
@@ -195,7 +194,7 @@
            entity.setUsedStatus(ProjectConstant.PASS);
        }
        if(!checkProjectNameAndIdIsUnique(entity,form.getId())){
            return Result.error("项目名或项目码已存在");
            return Result.error("项目重复,项目名称、项目码已存在");
        }
        //更新项目信息
        baseMapper.updateById(entity);
business/src/main/java/com/ycl/service/impl/ProjectProcessServiceImpl.java
@@ -413,11 +413,18 @@
            if (processCoding != null) {
                if (StringUtils.isNotBlank(processCoding.getOvertime())) {
                    Long overtime = getTime(processCoding.getOvertime());
                    long durationTime = ((new Date()).getTime() - processCoding.getStartTaskTime().getTime()) / 1000;
                    long durationTime = 0l;
                    if (Objects.nonNull(processCoding.getStartTaskTime())) {
                        durationTime = ((new Date()).getTime() - processCoding.getStartTaskTime().getTime()) / 1000;
                    } else {
                        taskVO.setRemainingTime("未设置办理时间");
                    }
                    if (overtime > durationTime) {
                    taskVO.setRemainingTime((overtime - durationTime) / 3600 + "小时");
                } else {
                        taskVO.setRemainingTime("已超时");
                    }
                } else {
                    taskVO.setRemainingTime("-");
                }
            }
business/src/main/resources/mapper/ProjectInfoMapper.xml
@@ -187,7 +187,7 @@
        LEFT JOIN t_project_process TPP ON TPI.id = TPP.project_id and TPP.deleted = 0
        LEFT JOIN sys_dept d ON TPI.project_owner_unit = d.dept_id
        <where>
            TPI.deleted = 0
            TPI.deleted = 0 AND TPI.used_status = 2
            ${params.dataScope}
        </where>
@@ -239,11 +239,10 @@
        <id column="id" property="id"/>
    </resultMap>
    <select id="checkProjectNameAndIdIsUnique" resultMap="pInfo">
        select p.id from t_project_info p where  p.project_name =#{name}
        select p.id from t_project_info p where  p.project_name =#{name} and p.id != #{id}
        <if test="code !=null and code !=''">
            or p.project_code =#{code}
            and p.project_code =#{code}
        </if>
        having p.id != #{id}
    </select>
flowable/src/main/resources/mapper/ProcessCodingMapper.xml
@@ -77,6 +77,11 @@
                    when id=#{item.id} then #{item.overtimeStatus}
                </foreach>
            </trim>
            <trim prefix="start_task_time =case" suffix="end,"><!-- 构造case语法 末尾加上end,如果需要更新多个字段复制这个trim -->
                <foreach collection="list" item="item">
                    when id=#{item.id} then #{item.startTaskTime}
                </foreach>
            </trim>
        </trim>
        where id in
        <foreach collection="list" index="index" item="item" separator="," open="(" close=")">