管道基础大数据平台系统开发-【后端】-Server
13693261870
2022-12-25 035d6d22f53b0d5e84262df7c88da9d58b119e8b
src/main/java/com/lf/server/controller/show/ApplyController.java
@@ -5,6 +5,7 @@
import com.lf.server.entity.all.ResponseMsg;
import com.lf.server.entity.ctrl.DownloadReqEntity;
import com.lf.server.entity.show.ApplyEntity;
import com.lf.server.entity.show.FlowEntity;
import com.lf.server.entity.sys.UserEntity;
import com.lf.server.helper.AesHelper;
import com.lf.server.helper.StringHelper;
@@ -78,27 +79,42 @@
    @ApiOperation(value = "分页查询申请")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "uname", value = "用户名", dataType = "String", paramType = "query", example = "员"),
            @ApiImplicitParam(name = "type", value = "类型", dataType = "Integer", paramType = "query", example = "3"),
            @ApiImplicitParam(name = "status", value = "状态", dataType = "Integer", paramType = "query", example = "0"),
            @ApiImplicitParam(name = "start", value = "开始时间", dataType = "Timestamp", paramType = "query", example = "2022-12-09 09:00:00"),
            @ApiImplicitParam(name = "end", value = "结束时间", dataType = "Timestamp", paramType = "query", example = "2022-12-25 17:00:00"),
            @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"),
            @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1")
    })
    @GetMapping(value = "/selectByPage")
    public ResponseMsg<Object> selectByPage(String uname, Integer type, Timestamp start, Timestamp end, Integer pageSize, Integer pageIndex) {
    public ResponseMsg<Object> selectByPage(String uname, Integer status, Timestamp start, Timestamp end, Integer pageSize, Integer pageIndex, HttpServletRequest req) {
        try {
            if (pageSize < 1 || pageIndex < 1) {
                return fail("每页页数或分页数小于1", null);
            }
            int count = applyService.selectCount(0);
            int count = applyService.selectCount(uname, status, start, end);
            if (count == 0) {
                return success(0, null);
            }
            List<ApplyEntity> rs = applyService.selectByPage(0, pageSize, pageSize * (pageIndex - 1));
            UserEntity ue = tokenService.getCurrentUser(req);
            List<ApplyEntity> rs = applyService.selectByPage(ue.getId(), uname, status, start, end, pageSize, pageSize * (pageIndex - 1));
            return success(count, rs);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
        }
    }
    @SysLog()
    @ApiOperation(value = "查询待审核数")
    @GetMapping(value = "/selectSubmits")
    public ResponseMsg<Object> selectSubmits(HttpServletRequest req) {
        try {
            UserEntity ue = tokenService.getCurrentUser(req);
            int rows = applyService.selectSubmits(ue.getId());
            return success(rows);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
        }
@@ -112,9 +128,9 @@
    @GetMapping(value = "/selectFlows")
    public ResponseMsg<Object> selectFlows(Integer applyId) {
        try {
            //
            List<FlowEntity> rs = applyService.selectFlows(applyId);
            return success(null);
            return success(rs);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
        }