From 53d014edd19f57125c355abe71ec5b478500e610 Mon Sep 17 00:00:00 2001 From: 无关风月 <443237572@qq.com> Date: 星期二, 05 八月 2025 09:57:40 +0800 Subject: [PATCH] 保洁巡检所有代码 --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TLocationController.java | 34 +++++++++++++++++++++++++++++++--- 1 files changed, 31 insertions(+), 3 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TLocationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TLocationController.java index 15d0200..480e887 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TLocationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TLocationController.java @@ -45,6 +45,8 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.InputStream; +import java.math.BigDecimal; +import java.math.RoundingMode; import java.net.URLEncoder; import java.util.*; import java.util.stream.Collectors; @@ -141,6 +143,9 @@ List<String> collect = list.stream().map(TTask::getId).collect(Collectors.toList()); List<LocationListTaskVO> res = new ArrayList<>(); + if (collect.isEmpty()){ + return R.ok(pageInfo); + } List<TTaskDetail> taskDetails = tTaskDetailService.list(Wrappers.lambdaQuery(TTaskDetail.class) .in(TTaskDetail::getTaskId,collect) .eq(TTaskDetail::getClearStatus, 2) @@ -269,7 +274,22 @@ @ApiOperation(value = "根据部门/项目部id查询巡检员列表 不分页") @GetMapping(value = "/listUsers") public R<List<SysUser>> listUsers(@RequestParam String id) { - List<SysUser> res = sysUserService.selectUserByDeptId(id); + List<String> strings = new ArrayList<>(); + strings.add(id); + TProjectDept projectDept = projectDeptService.getById(id); + if (projectDept!=null){ + if (projectDept.getParentId().equals("0")){ + List<String> collect = projectDeptService.lambdaQuery().eq(TProjectDept::getParentId, projectDept.getId()) + .list().stream().map(TProjectDept::getId).collect(Collectors.toList()); + strings.addAll(collect); + } + }else{ + List<String> collect = deptService.lambdaQuery().eq(TDept::getId, id) + .list().stream().map(TDept::getId).collect(Collectors.toList()); + strings.addAll(collect); + } + + List<SysUser> res = sysUserService.selectUserByDeptId(strings); return R.ok(res); } @Log(title = "新增点位", businessType = BusinessType.INSERT) @@ -373,6 +393,9 @@ for (TLocationImportExcel locationExcel : locationExcelList) { System.err.println(locationExcel); + if (locationExcel.getLocationName()==null){ + continue; + } TLocation location = new TLocation(); location.setLocationCode(locationExcel.getLocationCode()); location.setLocationName(locationExcel.getLocationName()); @@ -381,11 +404,11 @@ location.setLocationType(tLocationType.getId()); } location.setLocationAddress(locationExcel.getLocationAddress()); - String[] addressLonLat = locationExcel.getLocationAddressLonLat().split(","); + String[] addressLonLat = locationExcel.getLocationAddressLonLat().split("/"); location.setLocationLon(addressLonLat[0]); location.setLocationLat(addressLonLat[1]); location.setLocationAddressEnd(locationExcel.getLocationAddressEnd()); - String[] addressEndLonLat = locationExcel.getLocationAddressEndLonLat().split(","); + String[] addressEndLonLat = locationExcel.getLocationAddressEndLonLat().split("/"); location.setLocationLonEnd(addressEndLonLat[0]); location.setLocationLatEnd(addressEndLonLat[1]); TProjectDept projectDept = deptList.stream().filter(dept -> dept.getCode().equals(locationExcel.getDeptCode())).findFirst().orElse(null); @@ -421,5 +444,10 @@ return R.ok(); } + public static void main(String[] args) { + BigDecimal divide = new BigDecimal("-23").divide(new BigDecimal("40"),2, RoundingMode.HALF_UP); + System.err.println(divide); + } + } -- Gitblit v1.7.1