管道基础大数据平台系统开发-【后端】-Server
13693261870
2022-12-25 0e232ec00c776bc6803116837c5eabee43f2f69a
12.25.4
已修改6个文件
61 ■■■■ 文件已修改
data/ts.sql 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/show/ApplyController.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/entity/all/StaticData.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/mapper/show/ApplyMapper.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/show/ApplyService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/show/ApplyMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
data/ts.sql
@@ -80,14 +80,20 @@
select * from lf.sys_apply;
select * from lf.sys_flow;
select a.*, b.uname, (select count(*) from lf.sys_flow c where c.applyid = a.id and c.status = 0 and c.userid = 2) isVerify
from lf.sys_apply a inner join lf.sys_user b on a.userid = b.id
where 1 = 1 and b.uname like '%员%' and a.status between 1 and 9
update lf.sys_flow set status = -1 where status = 0 and id = 2;
update lf.sys_apply set status = -1 where status between 0 and 9 and id = 1;
select * from lf.sys_apply a inner join lf.sys_flow b on a.id = b.applyid
where a.status between 0 and 9 and b.status = 0 and b.userid = 2
update lf.sys_flow set status = 0 where status = -1 and applyid = 1;
select a.*, b.uname, fn_rec_query(a.depid, 'dep') depName from lf.sys_flow a inner join lf.sys_user b on a.userid = b.id
update lf.sys_flow set status = 1 where id = 3;
update lf.sys_apply a set status = (select count(*) from lf.sys_flow b where b.status = 1 and b.applyid = a.id) where id = 1;
update lf.sys_apply set status = 10 where status = count and id = 1;
src/main/java/com/lf/server/controller/show/ApplyController.java
@@ -202,7 +202,7 @@
                return fail("找不到申请流程");
            }
            if (flowEntity.getStatus() != 0) {
                return fail("该申请流程无需要打回");
                return fail("该申请流程无需提交");
            }
            ApplyEntity applyEntity = applyService.selectById(flowEntity.getApplyid());
@@ -210,12 +210,16 @@
                return fail("找不到数据申请");
            }
            if (!(applyEntity.getStatus() >= 0 && applyEntity.getStatus() <= StaticData.NINE)) {
                return fail("该数据申请无需要打回");
                return fail("该数据申请无需打回");
            }
            //
            int rows = applyService.updateForSubmit(applyEntity.getId(), flowEntity.getId());
            applyEntity = applyService.selectById(applyEntity.getId());
            if (StaticData.TEN == applyEntity.getStatus()) {
                // 打包
            }
            return success(null);
            return success(rows);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
        }
@@ -234,7 +238,7 @@
                return fail("找不到申请流程");
            }
            if (flowEntity.getStatus() != 0) {
                return fail("该申请流程无需要打回");
                return fail("该申请流程无需打回");
            }
            ApplyEntity applyEntity = applyService.selectById(flowEntity.getApplyid());
@@ -242,7 +246,7 @@
                return fail("找不到数据申请");
            }
            if (!(applyEntity.getStatus() >= 0 && applyEntity.getStatus() <= StaticData.NINE)) {
                return fail("该数据申请无需要打回");
                return fail("该数据申请无需打回");
            }
            Integer rows = applyService.updateForReject(applyEntity.getId(), flowEntity.getId());
src/main/java/com/lf/server/entity/all/StaticData.java
@@ -25,6 +25,11 @@
    public final static int NINE = 9;
    /**
     * 数值:10
     */
    public final static int TEN = 10;
    /**
     * 数值:200
     */
    public final static int TWO_HUNDRED = 200;
src/main/java/com/lf/server/mapper/show/ApplyMapper.java
@@ -145,6 +145,15 @@
    public Integer updateForResubmit(Integer id);
    /**
     * 提交流程
     *
     * @param applyid 申请流程ID
     * @param flowId  申请流程ID
     * @return 行数
     */
    public Integer updateForSubmit(Integer applyid, Integer flowId);
    /**
     * 打回流程
     *
     * @param applyid 申请流程ID
src/main/java/com/lf/server/service/show/ApplyService.java
@@ -106,6 +106,11 @@
    }
    @Override
    public Integer updateForSubmit(Integer applyid, Integer flowId) {
        return applyMapper.updateForSubmit(applyid, flowId);
    }
    @Override
    public Integer updateForReject(Integer applyid, Integer flowId) {
        return applyMapper.updateForReject(applyid, flowId);
    }
src/main/resources/mapper/show/ApplyMapper.xml
@@ -130,16 +130,18 @@
    </update>
    <update id="updateForResubmit">
        update lf.sys_apply set status = 0 where status = -1 and id = #{id};
        update lf.sys_flow set status = 0 where status = -1 and applyid = #{id};
        update lf.sys_apply a set status = (select count(*) from lf.sys_flow b where b.status = 1 and b.applyid = a.id) where status = -1 and id = #{id};
    </update>
    <update id="updateForSubmit">
        update lf.sys_flow set status = 1 where id = #{flowId};
        update lf.sys_apply a set status = (select count(*) from lf.sys_flow b where b.status = 1 and b.applyid = a.id) where id = #{applyid};
        update lf.sys_apply set status = 10 where status = count and id = #{applyid};
    </update>
    <update id="updateForReject">
        update lf.sys_apply set status = -1 where status between 0 and 9 and id = #{applyid};
        update lf.sys_flow set status = -1 where status = 0 and id = #{flowId};
        update lf.sys_apply set status = -1 where status between 0 and 9 and id = #{applyid};
    </update>
</mapper>