管道基础大数据平台系统开发-【后端】-Server
13693261870
2022-12-25 1f5416b81f3f9b62cf0f73e715e06340ba53182c
src/main/java/com/lf/server/controller/show/ApplyController.java
@@ -149,6 +149,14 @@
    @GetMapping(value = "/updateForDiscard")
    public ResponseMsg<Object> updateForDiscard(Integer applyid) {
        try {
            ApplyEntity applyEntity = applyService.selectById(applyid);
            if (null == applyEntity) {
                return fail("找不到数据申请");
            }
            if (!(applyEntity.getStatus() >= -1 && applyEntity.getStatus() <= StaticData.NINE)) {
                return fail("该数据申请无法废弃");
            }
            int rows = applyService.updateForDiscard(applyid);
            return success(rows);
@@ -165,6 +173,14 @@
    @GetMapping(value = "/updateForResubmit")
    public ResponseMsg<Object> updateForResubmit(Integer applyid) {
        try {
            ApplyEntity applyEntity = applyService.selectById(applyid);
            if (null == applyEntity) {
                return fail("找不到数据申请");
            }
            if (-1 != applyEntity.getStatus()) {
                return fail("该数据申请无需重新提交");
            }
            int rows = applyService.updateForResubmit(applyid);
            return success(rows);
@@ -179,10 +195,33 @@
            @ApiImplicitParam(name = "flowId", value = "申请流程ID", dataType = "Integer", paramType = "query", example = "1")
    })
    @GetMapping(value = "/updateForSubmit")
    public ResponseMsg<Object> updateForSubmit(Integer flowId) {
    public ResponseMsg<Object> updateForSubmit(Integer flowId, HttpServletRequest req) {
        try {
            FlowEntity flowEntity = flowService.selectById(flowId);
            if (null == flowEntity) {
                return fail("找不到申请流程");
            }
            if (flowEntity.getStatus() != 0) {
                return fail("该申请流程无需提交");
            }
            return success(null);
            ApplyEntity applyEntity = applyService.selectById(flowEntity.getApplyid());
            if (null == applyEntity) {
                return fail("找不到数据申请");
            }
            if (!(applyEntity.getStatus() >= 0 && applyEntity.getStatus() <= StaticData.NINE)) {
                return fail("该数据申请无需打回");
            }
            int rows = applyService.updateForSubmit(applyEntity.getId(), flowEntity.getId());
            applyEntity = applyService.selectById(applyEntity.getId());
            if (StaticData.TEN == applyEntity.getStatus()) {
                UserEntity ue = tokenService.getCurrentUser(req);
                applyService.zipDbData(ue, applyEntity);
            }
            return success(rows);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
        }
@@ -201,7 +240,7 @@
                return fail("找不到申请流程");
            }
            if (flowEntity.getStatus() != 0) {
                return fail("该申请流程无需要打回");
                return fail("该申请流程无需打回");
            }
            ApplyEntity applyEntity = applyService.selectById(flowEntity.getApplyid());
@@ -209,7 +248,7 @@
                return fail("找不到数据申请");
            }
            if (!(applyEntity.getStatus() >= 0 && applyEntity.getStatus() <= StaticData.NINE)) {
                return fail("该数据申请无需要打回");
                return fail("该数据申请无需打回");
            }
            Integer rows = applyService.updateForReject(applyEntity.getId(), flowEntity.getId());