广州市综治平台后端
xusd
2 days ago c490640493f04e2ed0fc5c4c8fbc92ebdd4d5380
dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/controller/web/CaseTaskWebController.java
@@ -387,6 +387,107 @@
    }
    /**
     * 设置请求参数
     * */
    private void setRequestParam(Map<String, Object> terms) {
        String caseType = request.getParameter("caseType");
        if (StringUtils.isNotBlank(caseType)){
            terms.put("caseType", caseType);
        }
        String plaintiffs = request.getParameter("plaintiffs");
        if (StringUtils.isNotBlank(plaintiffs)){
            terms.put("plaintiffs", plaintiffs);
        }
        String defendants = request.getParameter("defendants");
        if (StringUtils.isNotBlank(defendants)){
            terms.put("defendants", defendants);
        }
        String canal = request.getParameter("canal");
        if (StringUtils.isNotBlank(canal)){
            terms.put("canal", canal);
        }
        String caseStatus = request.getParameter("caseStatus");
        if (StringUtils.isNotBlank(caseStatus)){
            terms.put("caseStatus", caseStatus);
        }
        String caseLevel = request.getParameter("caseLevel");
        if (StringUtils.isNotBlank(caseLevel)){
            terms.put("caseLevel", caseLevel);
        }
        String mediResult = request.getParameter("mediResult");
        if (StringUtils.isNotBlank(mediResult)){
            terms.put("mediResult", mediResult);
        }
        String handleTimeStart = request.getParameter("handleTimeStart");
        String handleTimeEnd = request.getParameter("handleTimeEnd");
        if (StringUtils.isNotBlank(handleTimeStart) && StringUtils.isNotBlank(handleTimeEnd)){
            terms.put("handleTimeStart", handleTimeStart);
            terms.put("handleTimeEnd", handleTimeEnd);
        }
    }
    /**
     * web端-工作台-查询全部待办任务
     *
     * @param page      页码
     * @param size      每页数量
     * @param status    状态,1:待分派,2:已分派
     * @param sortType  排序方式(1:正序;2:倒序)
     * @param sortColmn 排序字段(1:流转时间;2:分派时限/分派时间;3:事项等级;4:督办次数)
     * @return
     * @url {ctx}/api/web/caseTask/pageMyTaskAll
     */
    @GetMapping("/pageMyTaskAll")
    public Object pageMyTaskAll(@RequestParam(value = "page") int page, @RequestParam(value = "size") int size,
                                @RequestParam(value = "status") int status, @CurrentUser String userId,
                                @RequestParam(value = "sortType") int sortType, @RequestParam(value = "sortColmn") int sortColmn) {
        try {
            // 条件
            Map<String, Object> terms = Maps.newHashMap();
            CtUserDTO loginUser = custClient.clientGetUserAll(userId);
            terms.put("candeUnitId", loginUser.getUnitId());
            terms.put("status", status);
            String partyName = request.getParameter("partyName");
            if (StringUtils.isNotBlank(partyName)){
                terms.put("partyName", partyName);
            }
            setRequestParam(terms);
            // 排序
            Sort sort = Sort.by(Sort.Direction.DESC, "t1.create_time");;
            PageRequest pageRequest = PageRequest.of(page - 1, size, sort);
            return ReturnSucUtils.getRepInfo(service.pageMyTaskAll(pageRequest, terms));
        } catch (Exception e) {
            log.error("Controller接口[CaseTaskWebController.pageMyTaskAll]请求异常:"+e, e);
            return ReturnFailUtils.getRepInfo();
        }
    }
    /**
     * web端-工作台-已办数量统计
     * @url {ctx}/api/web/caseTask/countYbTaskAll
     */
    @GetMapping("/countYbTaskAll")
    public Object countYbTaskAll(@RequestParam(value = "status") int status,@CurrentUser String userId) {
        try {
            // 条件
            Map<String, Object> terms = Maps.newHashMap();
            String partyName = request.getParameter("partyName");
            if (StringUtils.isNotBlank(partyName)){
                terms.put("partyName", partyName);
            }
            setRequestParam(terms);
            CtUserDTO loginUser = custClient.clientGetUserAll(userId);
            terms.put("candeUnitId", loginUser.getUnitId());
            terms.put("status", status);
            return ReturnSucUtils.getRepInfo(service.countYbTaskAll(terms));
        } catch (Exception e) {
            log.error("Controller接口[CaseTaskWebController.countYbTaskAll]请求异常:"+e, e);
            return ReturnFailUtils.getRepInfo();
        }
    }
    /**
     * web端-工作台-查询待办任务-分派任务
     *
     * @param page      页码
@@ -424,12 +525,20 @@
                terms.put("partyName", partyName);
            }
            CtUserDTO loginUser = custClient.clientGetUserAll(userId);
            CtUnitDTO unitById = custClient.getUnitById(loginUser.getUnitId());
            //如果是政法委,赋予综治中心查看案件的权限,政法委不接收案子处理,只负责指导,所以可以直接赋予
            if (201 == unitById.getUnitType()) {
                CtUnitDTO bjZzzx = custClient.getBjZzzx(unitById.getId());
                if (bjZzzx != null)
                    loginUser.setUnitId(bjZzzx.getId());
            }
            if (status == 1) {
                terms.put("candeUnitId", loginUser.getUnitId());
            } else {
                terms.put("handleUnitId", loginUser.getUnitId());
            }
            terms.put("status", status);
            setRequestParam(terms);
            // 排序
            Sort sort = null;
            String sortName = null;
@@ -513,6 +622,13 @@
                terms.put("partyName", partyName);
            }
            CtUserDTO loginUser = custClient.clientGetUserAll(userId);
            CtUnitDTO unitById = custClient.getUnitById(loginUser.getUnitId());
            //如果是政法委,赋予综治中心查看案件的权限,政法委不接收案子处理,只负责指导,所以可以直接赋予
            if (201 == unitById.getUnitType()) {
                CtUnitDTO bjZzzx = custClient.getBjZzzx(unitById.getId());
                if (bjZzzx != null)
                    loginUser.setUnitId(bjZzzx.getId());
            }
            if (status == 1) {
                terms.put("candeUnitId", loginUser.getUnitId());
            } else {
@@ -659,7 +775,15 @@
            if (StringUtils.isNotBlank(partyName)) {
                terms.put("partyName", partyName);
            }
            setRequestParam(terms);
            CtUserDTO loginUser = custClient.clientGetUserAll(userId);
            CtUnitDTO unitById = custClient.getUnitById(loginUser.getUnitId());
            //如果是政法委,赋予综治中心查看案件的权限,政法委不接收案子处理,只负责指导,所以可以直接赋予
            if (201 == unitById.getUnitType()) {
                CtUnitDTO bjZzzx = custClient.getBjZzzx(unitById.getId());
                if (bjZzzx != null)
                    loginUser.setUnitId(bjZzzx.getId());
            }
            // 不予受理,查询case_dismiss表
            if (status == 3) {
                terms.put("disUnitId", loginUser.getUnitId());
@@ -710,14 +834,21 @@
            }
            terms.put("caseTaskType", caseTaskType);
            CtUserDTO loginUser = custClient.clientGetUserAll(userId);
            CtUnitDTO unitById = custClient.getUnitById(loginUser.getUnitId());
            //如果是政法委,赋予综治中心查看案件的权限,政法委不接收案子处理,只负责指导,所以可以直接赋予
            if (201 == unitById.getUnitType()) {
                CtUnitDTO bjZzzx = custClient.getBjZzzx(unitById.getId());
                if (bjZzzx != null)
                    loginUser.setUnitId(bjZzzx.getId());
            }
            terms.put("candeUnitId", loginUser.getUnitId());
            String mediatorType = request.getParameter("mediatorType");
            if(ObjectUtils.isNotEmpty(mediatorType)){
            if (ObjectUtils.isNotEmpty(mediatorType)) {
                terms.put("mediatorType", mediatorType);
                terms.put("mediatorId", loginUser.getId());
            }
            setRequestParam(terms);
            // 排序
            Sort sort = null;
            String sortName = null;
@@ -791,6 +922,13 @@
                terms.put("partyName", partyName);
            }
            CtUserDTO loginUser = custClient.clientGetUserAll(userId);
            CtUnitDTO unitById = custClient.getUnitById(loginUser.getUnitId());
            //如果是政法委,赋予综治中心查看案件的权限,政法委不接收案子处理,只负责指导,所以可以直接赋予
            if (201 == unitById.getUnitType()) {
                CtUnitDTO bjZzzx = custClient.getBjZzzx(unitById.getId());
                if (bjZzzx != null)
                    loginUser.setUnitId(bjZzzx.getId());
            }
            if (caseTaskType == 1) {
                terms.put("applyUnitId", loginUser.getUnitId());
            } else {
@@ -880,6 +1018,7 @@
            if (StringUtils.isNotBlank(partyName)) {
                terms.put("partyName", partyName);
            }
            setRequestParam(terms);
            Sort sort = null;
            String sortName = null;
            switch (type) {
@@ -939,6 +1078,13 @@
            }
            PageRequest pageRequest = PageRequest.of(page - 1, size, sort);
            CtUserDTO loginUser = custClient.clientGetUserAll(userId);
            CtUnitDTO unitById = custClient.getUnitById(loginUser.getUnitId());
            //如果是政法委,赋予综治中心查看案件的权限,政法委不接收案子处理,只负责指导,所以可以直接赋予
            if (201 == unitById.getUnitType()) {
                CtUnitDTO bjZzzx = custClient.getBjZzzx(unitById.getId());
                if (bjZzzx != null)
                    loginUser.setUnitId(bjZzzx.getId());
            }
            terms.put("auditUnitId", loginUser.getUnitId());
            terms.put("applyStatus", status);
            return ReturnSucUtils.getRepInfo(service.pageMyTaskSh(pageRequest, type, terms));
@@ -1017,6 +1163,13 @@
            }
            PageRequest pageRequest = PageRequest.of(page - 1, size, sort);
            CtUserDTO loginUser = custClient.clientGetUserAll(userId);
            CtUnitDTO unitById = custClient.getUnitById(loginUser.getUnitId());
            //如果是政法委,赋予综治中心查看案件的权限,政法委不接收案子处理,只负责指导,所以可以直接赋予
            if (201 == unitById.getUnitType()) {
                CtUnitDTO bjZzzx = custClient.getBjZzzx(unitById.getId());
                if (bjZzzx != null)
                    loginUser.setUnitId(bjZzzx.getId());
            }
            terms.put("applyUnitId", loginUser.getUnitId());
            return ReturnSucUtils.getRepInfo(service.pageMyTaskShWSQD(pageRequest, terms));
        } catch (Exception e) {
@@ -1055,6 +1208,7 @@
            }
            Sort sort = null;
            String sortName = null;
            setRequestParam(terms);
            switch (sortColmn) {
                case 1:
                    sortName = "t1.sup_time";
@@ -1091,6 +1245,13 @@
            }
            PageRequest pageRequest = PageRequest.of(page - 1, size, sort);
            CtUserDTO loginUser = custClient.clientGetUserAll(userId);
            CtUnitDTO unitById = custClient.getUnitById(loginUser.getUnitId());
            //如果是政法委,赋予综治中心查看案件的权限,政法委不接收案子处理,只负责指导,所以可以直接赋予
            if (201 == unitById.getUnitType()) {
                CtUnitDTO bjZzzx = custClient.getBjZzzx(unitById.getId());
                if (bjZzzx != null)
                    loginUser.setUnitId(bjZzzx.getId());
            }
            Page<FrontPageListDTO> frontPageListDTOPage = null;
            if (StringUtils.isNotBlank(loginUser.getUnitId())) {
                terms.put("type", status);
@@ -1341,6 +1502,13 @@
            }
            CtUserDTO loginUser = custClient.clientGetUserAll(userId);
            CtUnitDTO unitById = custClient.getUnitById(loginUser.getUnitId());
            //如果是政法委,赋予综治中心查看案件的权限,政法委不接收案子处理,只负责指导,所以可以直接赋予
            if (201 == unitById.getUnitType()) {
                CtUnitDTO bjZzzx = custClient.getBjZzzx(unitById.getId());
                if (bjZzzx != null)
                    loginUser.setUnitId(bjZzzx.getId());
            }
            terms.put("handleUnitId", loginUser.getUnitId());
            // 排序
            Sort sort = null;
@@ -1488,22 +1656,23 @@
    /**
     * 测试接口
     * @url {ctx}/api/web/caseTask/test
     *
     * @return Object
     * @url {ctx}/api/web/caseTask/test
     */
    @GetMapping("/test")
    public Object test(@RequestParam(value = "caseId") String caseId,
                              @RequestParam(value = "oldTaskId") String oldTaskId, @RequestParam(value = "newTaskId") String newTaskId,
                              @RequestParam(value = "oldProcess") String oldProcess,@RequestParam(value = "newProcess") String newProcess,
                       @RequestParam(value = "oldTaskId") String oldTaskId, @RequestParam(value = "newTaskId") String newTaskId,
                       @RequestParam(value = "oldProcess") String oldProcess, @RequestParam(value = "newProcess") String newProcess,
                       @RequestParam(value = "ownerIds") String ownerIds, @RequestParam(value = "userId") String userId,
                       @RequestParam(value = "handleStatus") String handleStatus) {
        try {
            CaseTask oldTask = null;
            if(StringUtils.isNotBlank(oldTaskId)){
            if (StringUtils.isNotBlank(oldTaskId)) {
                oldTask = service.getById(oldTaskId);
            }
            CaseTask newTask = null;
            if(StringUtils.isNotBlank(newTaskId)){
            if (StringUtils.isNotBlank(newTaskId)) {
                newTask = service.getById(newTaskId);
            }
            List<String> ownerIdList = Arrays.asList(ownerIds.split(","));