管道基础大数据平台系统开发-【后端】-Server
13693261870
2022-12-25 6f513913cc949f2b505176324f75f396a5d41e43
12.25.6
已修改4个文件
65 ■■■■■ 文件已修改
src/main/java/com/lf/server/controller/show/ApplyController.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/mapper/show/ApplyMapper.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/show/ApplyService.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/show/ApplyMapper.xml 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/show/ApplyController.java
@@ -147,7 +147,7 @@
            @ApiImplicitParam(name = "applyid", value = "数据申请ID", dataType = "Integer", paramType = "query", example = "1")
    })
    @GetMapping(value = "/updateForDiscard")
    public ResponseMsg<Object> updateForDiscard(Integer applyid) {
    public ResponseMsg<Object> updateForDiscard(Integer applyid, HttpServletRequest req) {
        try {
            ApplyEntity applyEntity = applyService.selectById(applyid);
            if (null == applyEntity) {
@@ -157,7 +157,8 @@
                return fail("该数据申请无法废弃");
            }
            int rows = applyService.updateForDiscard(applyid);
            UserEntity ue = tokenService.getCurrentUser(req);
            int rows = applyService.updateForDiscard(ue.getId(), applyid);
            return success(rows);
        } catch (Exception ex) {
@@ -171,7 +172,7 @@
            @ApiImplicitParam(name = "applyid", value = "数据申请ID", dataType = "Integer", paramType = "query", example = "1")
    })
    @GetMapping(value = "/updateForResubmit")
    public ResponseMsg<Object> updateForResubmit(Integer applyid) {
    public ResponseMsg<Object> updateForResubmit(Integer applyid, HttpServletRequest req) {
        try {
            ApplyEntity applyEntity = applyService.selectById(applyid);
            if (null == applyEntity) {
@@ -181,7 +182,8 @@
                return fail("该数据申请无需重新提交");
            }
            int rows = applyService.updateForResubmit(applyid);
            UserEntity ue = tokenService.getCurrentUser(req);
            int rows = applyService.updateForResubmit(ue.getId(), applyid);
            return success(rows);
        } catch (Exception ex) {
@@ -213,11 +215,11 @@
                return fail("该数据申请无需打回");
            }
            int rows = applyService.updateForSubmit(applyEntity.getId(), flowEntity.getId());
            UserEntity ue = tokenService.getCurrentUser(req);
            int rows = applyService.updateForSubmit(ue.getId(), applyEntity.getId(), flowEntity.getId());
            applyEntity = applyService.selectById(applyEntity.getId());
            if (StaticData.TEN == applyEntity.getStatus()) {
                UserEntity ue = tokenService.getCurrentUser(req);
                applyService.zipDbData(ue, applyEntity);
            }
@@ -233,7 +235,7 @@
            @ApiImplicitParam(name = "flowId", value = "申请流程ID", dataType = "Integer", paramType = "query", example = "1")
    })
    @GetMapping(value = "/updateForReject")
    public ResponseMsg<Object> updateForReject(Integer flowId) {
    public ResponseMsg<Object> updateForReject(Integer flowId, HttpServletRequest req) {
        try {
            FlowEntity flowEntity = flowService.selectById(flowId);
            if (null == flowEntity) {
@@ -251,7 +253,8 @@
                return fail("该数据申请无需打回");
            }
            Integer rows = applyService.updateForReject(applyEntity.getId(), flowEntity.getId());
            UserEntity ue = tokenService.getCurrentUser(req);
            Integer rows = applyService.updateForReject(ue.getId(), applyEntity.getId(), flowEntity.getId());
            return success(rows);
        } catch (Exception ex) {
src/main/java/com/lf/server/mapper/show/ApplyMapper.java
@@ -131,34 +131,38 @@
    /**
     * 废弃申请
     *
     * @param id 数据申请ID
     * @param userid 用户ID
     * @param id     数据申请ID
     * @return 行数
     */
    public Integer updateForDiscard(Integer id);
    public Integer updateForDiscard(Integer userid, Integer id);
    /**
     * 重新提交
     *
     * @param id 数据申请ID
     * @param userid 用户ID
     * @param id     数据申请ID
     * @return 行数
     */
    public Integer updateForResubmit(Integer id);
    public Integer updateForResubmit(Integer userid, Integer id);
    /**
     * 提交流程
     *
     * @param userid  用户ID
     * @param applyid 申请流程ID
     * @param flowId  申请流程ID
     * @return 行数
     */
    public Integer updateForSubmit(Integer applyid, Integer flowId);
    public Integer updateForSubmit(Integer userid, Integer applyid, Integer flowId);
    /**
     * 打回流程
     *
     * @param userid  用户ID
     * @param applyid 申请流程ID
     * @param flowId  申请流程ID
     * @return 行数
     */
    public Integer updateForReject(Integer applyid, Integer flowId);
    public Integer updateForReject(Integer userid, Integer applyid, Integer flowId);
}
src/main/java/com/lf/server/service/show/ApplyService.java
@@ -104,23 +104,23 @@
    }
    @Override
    public Integer updateForDiscard(Integer id) {
        return applyMapper.updateForDiscard(id);
    public Integer updateForDiscard(Integer userid, Integer id) {
        return applyMapper.updateForDiscard(userid, id);
    }
    @Override
    public Integer updateForResubmit(Integer id) {
        return applyMapper.updateForResubmit(id);
    public Integer updateForResubmit(Integer userid, Integer id) {
        return applyMapper.updateForResubmit(userid, id);
    }
    @Override
    public Integer updateForSubmit(Integer applyid, Integer flowId) {
        return applyMapper.updateForSubmit(applyid, flowId);
    public Integer updateForSubmit(Integer userid, Integer applyid, Integer flowId) {
        return applyMapper.updateForSubmit(userid, applyid, flowId);
    }
    @Override
    public Integer updateForReject(Integer applyid, Integer flowId) {
        return applyMapper.updateForReject(applyid, flowId);
    public Integer updateForReject(Integer userid, Integer applyid, Integer flowId) {
        return applyMapper.updateForReject(userid, applyid, flowId);
    }
    /**
src/main/resources/mapper/show/ApplyMapper.xml
@@ -126,22 +126,22 @@
    </update>
    <update id="updateForDiscard">
        update lf.sys_apply set status = -10 where status between -1 and 9 and id = #{id}
        update lf.sys_apply set status = -10, update_user = #{userid}, update_time = now() where status between -1 and 9 and id = #{id}
    </update>
    <update id="updateForResubmit">
        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 lf.sys_flow set status = 0, update_user = #{userid}, update_time = now() 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), update_user = #{userid}, update_time = now() 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_flow set status = 1, update_user = #{userid}, update_time = now() 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), update_user = #{userid}, update_time = now() where id = #{applyid};
        update lf.sys_apply set status = 10 where status = count and id = #{applyid};
    </update>
    <update id="updateForReject">
        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 lf.sys_flow set status = -1, update_user = #{userid}, update_time = now() where status = 0 and id = #{flowId};
        update lf.sys_apply set status = -1, update_user = #{userid}, update_time = now() where status between 0 and 9 and id = #{applyid};
    </update>
</mapper>