ruoyi-admin/src/main/java/com/ruoyi/web/controller/task/TaskUtil.java
@@ -299,7 +299,7 @@ // 添加应生成任务数量 TTemplateCount templateCount = new TTemplateCount(); templateCount.setTemplateId(detail.getId()); templateCount.setTemplateId(detail.getTemplateId()); templateCount.setTaskCount(tLocationList.size()* cycle); templateCount.setUserId(sysUser.getUserId()); templateCountService.save(templateCount); ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/TIndexController.java
@@ -363,11 +363,11 @@ } else { TDept dept = deptService.getById(sysUser.getDeptId()); if (dept != null) { if (!dept.getDeptName().equals("公司")) { users = sysUsers.stream().filter(e -> e.getDeptId() if (!dept.getDeptName().contains("公司")) { users = sysUsers.stream().filter(e -> (e.getDeptId() .equals(sysUser.getDeptId()) && e.getStatus().equals("0") && e.getDeptType() == 1).collect(Collectors.toList()); && e.getStatus().equals("0")) || e.getDeptType() == 1).collect(Collectors.toList()); } } @@ -397,8 +397,8 @@ List<TTaskDetail> status3 = taskDetails.stream().filter(e -> e.getClearStatus() == 1).collect(Collectors.toList()); List<TTaskDetail> status4 = taskDetails.stream().filter(e -> e.getClearStatus() == 2).collect(Collectors.toList()); if (!status3.isEmpty()) { BigDecimal divide = new BigDecimal(status3.size() + status4.size()) .divide(new BigDecimal(status3.size()), 2, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)); BigDecimal divide = new BigDecimal(status3.size() ) .divide(new BigDecimal(status3.size()+ status4.size()), 2, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)); res.setRate(divide); } else { res.setRate(new BigDecimal(0)); @@ -447,7 +447,6 @@ taskTodayVO.setLocationLon(tLocation.getLocationLon()); taskTodayVO.setLocationLat(tLocation.getLocationLat()); taskTodayVO.setLocationName(tLocation.getLocationName()); // todo if(StringUtils.hasLength(dto.getLon())){ Map<String, String> distance = amapApiClient.getDistance(dto.getLon() + "," + dto.getLat(), tLocation.getLocationLon() + "," + tLocation.getLocationLat(), 1); if (distance != null) { @@ -521,6 +520,8 @@ } todayTask.add(taskTodayVO); } // 将todayTask进行排序 优先根据status状态排序,优先展示未执行、超时、待整改、待确认、整改完成、已完成,然后状态一样再根据距离排序 sortTodayTasks(todayTask); res.setTodayTask(todayTask); List<TaskTomorrowVO> tomorrowTask = new ArrayList<>(); @@ -548,5 +549,17 @@ } return R.ok(res); } public static void sortTodayTasks(List<TaskTodayVO> taskList) { Map<Integer, Integer> statusOrder = new HashMap<>(); statusOrder.put(1, 0); statusOrder.put(2, 1); statusOrder.put(4, 2); statusOrder.put(3, 3); statusOrder.put(5, 4); statusOrder.put(6, 5); taskList.sort(Comparator.comparingInt((TaskTodayVO o) -> statusOrder.getOrDefault(o.getStatus(), Integer.MAX_VALUE)).thenComparing(TaskTodayVO::getDistance)); } } ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/TUserController.java
@@ -365,6 +365,7 @@ @ApiOperation(value = "获取距离最近的任务列表") @PostMapping(value = "/listAllTask") public R<List<TaskListAllVO>> listAllTask(@RequestBody AppealListDTO appealListDTO) { appealListDTO.setUserId(tokenService.getLoginUserApplet().getUserId() + ""); List<TaskListAllVO> res = appealService.listAllTask(appealListDTO); return R.ok(res); } @@ -492,7 +493,7 @@ for (SysUser sysUser : collect) { Long userRole1 = sysUserService.getUserRole(sysUser.getUserId()); SysRole sysRole1 = roleService.selectRoleById(userRole1); if (sysRole1 != null && sysRole1.getRoleName().equals("部门负责人")) { if (sysRole1 != null && sysRole1.getRoleName().contains("部门负责人")) { LeaveAuditVO tLeaveAudit = new LeaveAuditVO(); tLeaveAudit.setAvatar(sysUser.getAvatar()); tLeaveAudit.setNickName(sysUser.getNickName()); @@ -580,7 +581,7 @@ for (SysUser sysUser : collect) { Long userRole1 = sysUserService.getUserRole(sysUser.getUserId()); SysRole sysRole1 = roleService.selectRoleById(userRole1); if (sysRole1 != null && sysRole1.getRoleName().equals("部门负责人")) { if (sysRole1 != null && sysRole1.getRoleName().contains("部门负责人")) { TLeaveAudit tLeaveAudit1 = new TLeaveAudit(); tLeaveAudit1.setLeaveId(leaveDTO.getId()); tLeaveAudit1.setAuditStatus(1); ruoyi-system/src/main/resources/mapper/system/TAppealMapper.xml
@@ -110,7 +110,7 @@ t2.location_address as locationAddress, t2.location_lon as locationLon, t2.location_lat as locationLat, t3.location_icon as locatioTypeIcon, t3.location_icon as locationTypeIcon, t5.clear_status as clearStatus, t4.nick_name as patrolInspectorName, t4.phonenumber as phonenumber, ruoyi-system/src/main/resources/mapper/system/TNoticeMapper.xml
@@ -8,6 +8,6 @@ t_notice t1 where t1.user_id = #{query.userId} and t1.`disabled` = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} order by t1.create_time desc </select> </mapper>