管道基础大数据平台系统开发-【后端】-Server
13693261870
2022-12-25 52288b740a2f767c0b29f84860a07f0bde634860
src/main/java/com/lf/server/controller/show/ApplyController.java
@@ -3,6 +3,7 @@
import com.lf.server.annotation.SysLog;
import com.lf.server.controller.all.BaseController;
import com.lf.server.entity.all.ResponseMsg;
import com.lf.server.entity.all.StaticData;
import com.lf.server.entity.ctrl.DownloadReqEntity;
import com.lf.server.entity.show.ApplyEntity;
import com.lf.server.entity.show.FlowEntity;
@@ -11,6 +12,7 @@
import com.lf.server.helper.StringHelper;
import com.lf.server.service.data.DownloadService;
import com.lf.server.service.show.ApplyService;
import com.lf.server.service.show.FlowService;
import com.lf.server.service.sys.TokenService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@@ -33,6 +35,9 @@
public class ApplyController extends BaseController {
    @Autowired
    ApplyService applyService;
    @Autowired
    FlowService flowService;
    @Autowired
    TokenService tokenService;
@@ -123,12 +128,12 @@
    @SysLog()
    @ApiOperation(value = "查询流程")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "数据申请ID", dataType = "Integer", paramType = "query", example = "1")
            @ApiImplicitParam(name = "applyid", value = "数据申请ID", dataType = "Integer", paramType = "query", example = "1")
    })
    @GetMapping(value = "/selectFlows")
    public ResponseMsg<Object> selectFlows(Integer id) {
    public ResponseMsg<Object> selectFlows(Integer applyid) {
        try {
            List<FlowEntity> rs = applyService.selectFlows(id);
            List<FlowEntity> rs = applyService.selectFlows(applyid);
            return success(rs);
        } catch (Exception ex) {
@@ -139,12 +144,28 @@
    @SysLog()
    @ApiOperation(value = "废弃申请")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "数据申请ID", dataType = "Integer", paramType = "query", example = "1")
            @ApiImplicitParam(name = "applyid", value = "数据申请ID", dataType = "Integer", paramType = "query", example = "1")
    })
    @GetMapping(value = "/updateForDiscard")
    public ResponseMsg<Object> updateForDiscard(Integer id) {
    public ResponseMsg<Object> updateForDiscard(Integer applyid) {
        try {
            int rows = applyService.updateForDiscard(id);
            int rows = applyService.updateForDiscard(applyid);
            return success(rows);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
        }
    }
    @SysLog()
    @ApiOperation(value = "重新提交")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "applyid", value = "数据申请ID", dataType = "Integer", paramType = "query", example = "1")
    })
    @GetMapping(value = "/updateForResubmit")
    public ResponseMsg<Object> updateForResubmit(Integer applyid) {
        try {
            int rows = applyService.updateForResubmit(applyid);
            return success(rows);
        } catch (Exception ex) {
@@ -157,6 +178,7 @@
    @ApiImplicitParams({
            @ApiImplicitParam(name = "flowId", value = "申请流程ID", dataType = "Integer", paramType = "query", example = "1")
    })
    @GetMapping(value = "/updateForSubmit")
    public ResponseMsg<Object> updateForSubmit(Integer flowId) {
        try {
@@ -171,10 +193,28 @@
    @ApiImplicitParams({
            @ApiImplicitParam(name = "flowId", value = "申请流程ID", dataType = "Integer", paramType = "query", example = "1")
    })
    @GetMapping(value = "/updateForReject")
    public ResponseMsg<Object> updateForReject(Integer flowId) {
        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("该数据申请无需要打回");
            }
            Integer rows = applyService.updateForReject(applyEntity.getId(), flowEntity.getId());
            return success(rows);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
        }