Commit 683da1d48dafba578a67d1813d4aaddf6b9c3ae8
1 parent
e0bb2c5b
获取菜单
Showing
6 changed files
with
91 additions
and
4 deletions
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/inspectionplan/InspectionPlanController.java
| @@ -89,10 +89,6 @@ public class InspectionPlanController { | @@ -89,10 +89,6 @@ public class InspectionPlanController { | ||
| 89 | return success(true); | 89 | return success(true); |
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | - | ||
| 93 | - | ||
| 94 | - | ||
| 95 | - | ||
| 96 | @GetMapping("/get") | 92 | @GetMapping("/get") |
| 97 | @Operation(summary = "获得巡检计划汇总") | 93 | @Operation(summary = "获得巡检计划汇总") |
| 98 | @Parameter(name = "id", description = "编号", required = true, example = "1024") | 94 | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/road/RoadController.java
| @@ -88,6 +88,15 @@ public class RoadController { | @@ -88,6 +88,15 @@ public class RoadController { | ||
| 88 | return success(BeanUtils.toBean(pageResult, RoadRespVO.class)); | 88 | return success(BeanUtils.toBean(pageResult, RoadRespVO.class)); |
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | + @PostMapping("/list") | ||
| 92 | + @Operation(summary = "获得道路列表") | ||
| 93 | + @PreAuthorize("@ss.hasPermission('garden:road:query')") | ||
| 94 | + public CommonResult<List<RoadListRespVO>> getRoadList(@Valid RoadListReqVO reqVO) { | ||
| 95 | + List<RoadDO> roadList = roadService.getRoadList(reqVO); | ||
| 96 | + return success(BeanUtils.toBean(roadList, RoadListRespVO.class)); | ||
| 97 | + } | ||
| 98 | + | ||
| 99 | + | ||
| 91 | @GetMapping("/export-excel") | 100 | @GetMapping("/export-excel") |
| 92 | @Operation(summary = "导出道路管理 Excel") | 101 | @Operation(summary = "导出道路管理 Excel") |
| 93 | @PreAuthorize("@ss.hasPermission('garden:road:export')") | 102 | @PreAuthorize("@ss.hasPermission('garden:road:export')") |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/road/vo/RoadListReqVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.road.vo; | ||
| 2 | + | ||
| 3 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | ||
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 5 | +import jakarta.validation.constraints.NotNull; | ||
| 6 | +import lombok.Data; | ||
| 7 | +import org.springframework.format.annotation.DateTimeFormat; | ||
| 8 | + | ||
| 9 | +import java.time.LocalDateTime; | ||
| 10 | + | ||
| 11 | +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||
| 12 | + | ||
| 13 | +@Schema(description = "管理后台 - 道路管理分页 Request VO") | ||
| 14 | +@Data | ||
| 15 | +public class RoadListReqVO { | ||
| 16 | + | ||
| 17 | + @Schema(description = "道路名称", example = "赵六") | ||
| 18 | + private String roadName; | ||
| 19 | + | ||
| 20 | + @Schema(description = "养护级别: 10:特级;11:一级:12:二级;13:三级", example = "10") | ||
| 21 | + @NotNull(message = "养护级别不能为空") | ||
| 22 | + private Integer levelId; | ||
| 23 | + | ||
| 24 | + @Schema(description = "归属(一级部门id)", example = "2323") | ||
| 25 | + @NotNull(message = "归属(一级部门id)不能为空") | ||
| 26 | + private Long companyId; | ||
| 27 | + | ||
| 28 | +} | ||
| 0 | \ No newline at end of file | 29 | \ No newline at end of file |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/road/vo/RoadListRespVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.road.vo; | ||
| 2 | + | ||
| 3 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; | ||
| 4 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 5 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 6 | +import lombok.Data; | ||
| 7 | + | ||
| 8 | +import java.time.LocalDateTime; | ||
| 9 | + | ||
| 10 | +@Schema(description = "管理后台 - 道路管理 Response VO") | ||
| 11 | +@Data | ||
| 12 | +@ExcelIgnoreUnannotated | ||
| 13 | +public class RoadListRespVO { | ||
| 14 | + | ||
| 15 | + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15456") | ||
| 16 | + @ExcelProperty("ID") | ||
| 17 | + private Long id; | ||
| 18 | + | ||
| 19 | + @Schema(description = "道路名称", example = "赵六") | ||
| 20 | + @ExcelProperty("道路名称") | ||
| 21 | + private String roadName; | ||
| 22 | + | ||
| 23 | + @Schema(description = "养护级别: 10:特级;11:一级:12:二级;13:三级", requiredMode = Schema.RequiredMode.REQUIRED, example = "26337") | ||
| 24 | + @ExcelProperty("养护级别: 10:特级;11:一级:12:二级;13:三级") | ||
| 25 | + private Integer levelId; | ||
| 26 | + | ||
| 27 | + @Schema(description = "归属(一级部门id)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2323") | ||
| 28 | + @ExcelProperty("归属(一级部门id)") | ||
| 29 | + private Long companyId; | ||
| 30 | + | ||
| 31 | + @Schema(description = "部门ID(道路负责部门id)", requiredMode = Schema.RequiredMode.REQUIRED, example = "13872") | ||
| 32 | + @ExcelProperty("部门ID(道路负责部门id)") | ||
| 33 | + private Long deptId; | ||
| 34 | +} | ||
| 0 | \ No newline at end of file | 35 | \ No newline at end of file |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/road/RoadService.java
| @@ -59,4 +59,11 @@ public interface RoadService { | @@ -59,4 +59,11 @@ public interface RoadService { | ||
| 59 | */ | 59 | */ |
| 60 | PageResult<RoadDO> getRoadPage(RoadPageReqVO pageReqVO); | 60 | PageResult<RoadDO> getRoadPage(RoadPageReqVO pageReqVO); |
| 61 | 61 | ||
| 62 | + /** | ||
| 63 | + * 道路列表查询 | ||
| 64 | + * @param reqVO 入参数 | ||
| 65 | + * @return 道路列表 | ||
| 66 | + */ | ||
| 67 | + List<RoadDO> getRoadList(RoadListReqVO reqVO); | ||
| 68 | + | ||
| 62 | } | 69 | } |
| 63 | \ No newline at end of file | 70 | \ No newline at end of file |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/road/RoadServiceImpl.java
| 1 | package com.zteits.urbanops.module.garden.service.road; | 1 | package com.zteits.urbanops.module.garden.service.road; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.collection.CollUtil; | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
| 5 | +import org.apache.commons.lang3.StringUtils; | ||
| 4 | import org.springframework.stereotype.Service; | 6 | import org.springframework.stereotype.Service; |
| 5 | import jakarta.annotation.Resource; | 7 | import jakarta.annotation.Resource; |
| 6 | import org.springframework.validation.annotation.Validated; | 8 | import org.springframework.validation.annotation.Validated; |
| @@ -82,4 +84,15 @@ public class RoadServiceImpl implements RoadService { | @@ -82,4 +84,15 @@ public class RoadServiceImpl implements RoadService { | ||
| 82 | return roadMapper.selectPage(pageReqVO); | 84 | return roadMapper.selectPage(pageReqVO); |
| 83 | } | 85 | } |
| 84 | 86 | ||
| 87 | + @Override | ||
| 88 | + public List<RoadDO> getRoadList(RoadListReqVO reqVO) { | ||
| 89 | + QueryWrapper<RoadDO> sql = new QueryWrapper<>(); | ||
| 90 | + sql.select("id", "road_name", "level_id","company_id","dept_id"); | ||
| 91 | + | ||
| 92 | + sql.lambda().eq(RoadDO::getCompanyId, reqVO.getCompanyId()) | ||
| 93 | + .eq(RoadDO::getLevelId, reqVO.getLevelId()) | ||
| 94 | + .likeRight(StringUtils.isNotEmpty(reqVO.getRoadName()), RoadDO::getRoadName, reqVO.getRoadName()); | ||
| 95 | + return roadMapper.selectList(sql); | ||
| 96 | + } | ||
| 97 | + | ||
| 85 | } | 98 | } |
| 86 | \ No newline at end of file | 99 | \ No newline at end of file |