kimi
2020-03-31 74472c9d22dddcb41383794caf0011043b20f817
src/main/java/com/highdatas/mdm/controller/MaintainController.java
@@ -15,6 +15,7 @@
import com.highdatas.mdm.pojo.Result;
import com.highdatas.mdm.service.*;
import com.highdatas.mdm.util.Constant;
import com.highdatas.mdm.util.DbUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -47,6 +48,8 @@
    IFlowsService  flowsService;
    @Autowired
    IMaintainFieldService maintainFieldService;
    @Autowired
    IMasterAuthorService masterAuthorService;
    @RequestMapping(value = "/get/{id}", method = RequestMethod.GET)
    public Result get(@PathVariable String id) {
@@ -61,19 +64,20 @@
    public Result unSubmit(@PathVariable String tableName, @PathVariable Integer pageNo, HttpServletRequest request) throws UnsupportedEncodingException {
        String pageSize = request.getParameter("pageSize");
        String whereSegment = request.getParameter("whereSegment");
        TUser user = DbUtils.getUser(request);
        if (StringUtils.isEmpty(whereSegment)) {
            whereSegment = Constant.WHERE_DEFAULT;
        }else  {
            whereSegment = URLDecoder.decode(whereSegment, "UTF-8");
        }
        return maintainService.getUnSubmitData(tableName, pageNo, pageSize, whereSegment);
        return maintainService.getUnSubmitData(user, tableName, pageNo, pageSize, whereSegment);
    }
    @RequestMapping(value = "{tableName}/unflow/{pageNo}", method = RequestMethod.GET)
    public Result unflow(@PathVariable String tableName, @PathVariable Integer pageNo, HttpServletRequest request) throws UnsupportedEncodingException {
        String pageSize = request.getParameter("pageSize");
        String whereSegment = request.getParameter("whereSegment");
        TUser user = DbUtils.getUser(request);
        if (StringUtils.isEmpty(whereSegment)) {
            whereSegment = Constant.WHERE_DEFAULT;
@@ -81,9 +85,9 @@
            whereSegment = URLDecoder.decode(whereSegment, "UTF-8");
        }
        if (StringUtils.isEmpty(pageSize)) {
            return maintainService.getInvalidVerionData(tableName, whereSegment, pageNo, null);
            return maintainService.getInvalidVerionData(user, tableName, whereSegment, pageNo, null);
        } else {
            return maintainService.getInvalidVerionData(tableName, whereSegment, pageNo, Integer.valueOf(pageSize));
            return maintainService.getInvalidVerionData(user, tableName, whereSegment, pageNo, Integer.valueOf(pageSize));
        }
    }
@@ -106,7 +110,10 @@
            if (StringUtils.isEmpty(flowId)) {
                continue;
            }
            boolean author = masterAuthorService.checkMaintainAuthor(userId, maintain.getId());
            if (!author) {
                continue;
            }
            Flows flows = flowsService.selectById(maintain.getFlowId());
            if (flows.getStatus().equals(ActivitiStatus.close)) {
                continue;
@@ -220,13 +227,14 @@
    public Result setFlowId(@RequestParam String flowId,@PathVariable Integer pageNo, HttpServletRequest request) {
        String whereSegment = request.getParameter("whereSegment");
        String pageSize = request.getParameter("pageSize");
        TUser user = DbUtils.getUser(request);
        if (StringUtils.isEmpty(whereSegment)) {
            whereSegment = Constant.WHERE_DEFAULT;
        }
        if (StringUtils.isEmpty(pageSize)) {
            return maintainService.tempDataByVersionByFlow(flowId, whereSegment, pageNo, null);
            return maintainService.tempDataByVersionByFlow(user, flowId, whereSegment, pageNo, null);
        }
        return maintainService.tempDataByVersionByFlow(flowId, whereSegment, pageNo, Integer.valueOf(pageSize));
        return maintainService.tempDataByVersionByFlow(user, flowId, whereSegment, pageNo, Integer.valueOf(pageSize));
    }