Commit b228e0d859c6b4905dac19a2f372f04b543091d5
Merge remote-tracking branch 'origin/dev' into dev
Showing
14 changed files
with
88 additions
and
59 deletions
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/inspectionplan/vo/InspectionPlanRespVO.java
| 1 | package com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo; | 1 | package com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo; |
| 2 | 2 | ||
| 3 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; | ||
| 4 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 3 | import com.fhs.core.trans.vo.VO; | 5 | import com.fhs.core.trans.vo.VO; |
| 4 | import io.swagger.v3.oas.annotations.media.Schema; | 6 | import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | -import lombok.*; | 7 | +import lombok.Data; |
| 8 | + | ||
| 9 | +import java.time.LocalDate; | ||
| 6 | import java.time.LocalDateTime; | 10 | import java.time.LocalDateTime; |
| 7 | import java.util.List; | 11 | import java.util.List; |
| 8 | 12 | ||
| 9 | -import cn.idev.excel.annotation.*; | ||
| 10 | - | ||
| 11 | @Schema(description = "管理后台 - 巡检计划汇总 Response VO") | 13 | @Schema(description = "管理后台 - 巡检计划汇总 Response VO") |
| 12 | @Data | 14 | @Data |
| 13 | @ExcelIgnoreUnannotated | 15 | @ExcelIgnoreUnannotated |
| @@ -86,11 +88,11 @@ public class InspectionPlanRespVO implements VO { | @@ -86,11 +88,11 @@ public class InspectionPlanRespVO implements VO { | ||
| 86 | 88 | ||
| 87 | @Schema(description = "开始时间") | 89 | @Schema(description = "开始时间") |
| 88 | @ExcelProperty("开始时间") | 90 | @ExcelProperty("开始时间") |
| 89 | - private LocalDateTime beginTime; | 91 | + private LocalDate beginTime; |
| 90 | 92 | ||
| 91 | @Schema(description = "开始时间") | 93 | @Schema(description = "开始时间") |
| 92 | @ExcelProperty("开始时间") | 94 | @ExcelProperty("开始时间") |
| 93 | - private LocalDateTime endTime; | 95 | + private LocalDate endTime; |
| 94 | 96 | ||
| 95 | @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对") | 97 | @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对") |
| 96 | @ExcelProperty("备注") | 98 | @ExcelProperty("备注") |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/inspectionplan/vo/InspectionPlanSaveReqVO.java
| @@ -46,7 +46,7 @@ public class InspectionPlanSaveReqVO { | @@ -46,7 +46,7 @@ public class InspectionPlanSaveReqVO { | ||
| 46 | 46 | ||
| 47 | @Schema(description = "频次值", requiredMode = Schema.RequiredMode.REQUIRED) | 47 | @Schema(description = "频次值", requiredMode = Schema.RequiredMode.REQUIRED) |
| 48 | @NotEmpty(message = "频次值不能为空") | 48 | @NotEmpty(message = "频次值不能为空") |
| 49 | - @Size(max = 6) | 49 | + @Size(max = 6 , message = "频次值长度不能大于6") |
| 50 | private String rateValue; | 50 | private String rateValue; |
| 51 | 51 | ||
| 52 | @Schema(description = "周期ID: 0:次;1:日/次;2:周/次;3:月/次;4:季/次;5:半年/次;6:年/次", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | 52 | @Schema(description = "周期ID: 0:次;1:日/次;2:周/次;3:月/次;4:季/次;5:半年/次;6:年/次", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainplan/vo/MaintainPlanPageReqVO.java
| @@ -33,6 +33,9 @@ public class MaintainPlanPageReqVO extends PageParam { | @@ -33,6 +33,9 @@ public class MaintainPlanPageReqVO extends PageParam { | ||
| 33 | @Schema(description = "归属(一级部门id)", example = "1713") | 33 | @Schema(description = "归属(一级部门id)", example = "1713") |
| 34 | private Long companyId; | 34 | private Long companyId; |
| 35 | 35 | ||
| 36 | + @Schema(description = "部门id") | ||
| 37 | + private Integer deptId; | ||
| 38 | + | ||
| 36 | @Schema(description = "道路名称", example = "王五") | 39 | @Schema(description = "道路名称", example = "王五") |
| 37 | private String roadName; | 40 | private String roadName; |
| 38 | 41 |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainplan/vo/MaintainPlanSaveReqVO.java
| @@ -46,7 +46,7 @@ public class MaintainPlanSaveReqVO { | @@ -46,7 +46,7 @@ public class MaintainPlanSaveReqVO { | ||
| 46 | 46 | ||
| 47 | @Schema(description = "频次值", requiredMode = Schema.RequiredMode.REQUIRED) | 47 | @Schema(description = "频次值", requiredMode = Schema.RequiredMode.REQUIRED) |
| 48 | @NotEmpty(message = "频次值不能为空") | 48 | @NotEmpty(message = "频次值不能为空") |
| 49 | - @Size(max = 6) | 49 | + @Size(max = 6 , message = "频次值长度不能大于6") |
| 50 | private String rateValue; | 50 | private String rateValue; |
| 51 | 51 | ||
| 52 | @Schema(description = "周期ID: 1:日/次;2:周/次;3:月/次;4:年/次;5:按次;6:季度;7:半年", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | 52 | @Schema(description = "周期ID: 1:日/次;2:周/次;3:月/次;4:年/次;5:按次;6:季度;7:半年", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/road/RoadStreetController.java
| @@ -82,10 +82,9 @@ public class RoadStreetController { | @@ -82,10 +82,9 @@ public class RoadStreetController { | ||
| 82 | 82 | ||
| 83 | @GetMapping("/list") | 83 | @GetMapping("/list") |
| 84 | @Operation(summary = "获得街道列表") | 84 | @Operation(summary = "获得街道列表") |
| 85 | - @Parameter(name = "busi_line", description = "业务线", required = true, example = "1024") | ||
| 86 | -// @PreAuthorize("@ss.hasPermission('garden:road-street:query')") | ||
| 87 | - public CommonResult<List<RoadStreetRespVO>> getRoadStreet(@RequestParam("busi_line") @NotBlank String busiLine) { | ||
| 88 | - List<RoadStreetDO> roadStreet = roadStreetService.getRoadStreetList(busiLine); | 85 | + @PreAuthorize("@ss.hasPermission('garden:road-street:query')") |
| 86 | + public CommonResult<List<RoadStreetRespVO>> getRoadStreet() { | ||
| 87 | + List<RoadStreetDO> roadStreet = roadStreetService.getRoadStreetList(null); | ||
| 89 | return success(BeanUtils.toBean(roadStreet, RoadStreetRespVO.class)); | 88 | return success(BeanUtils.toBean(roadStreet, RoadStreetRespVO.class)); |
| 90 | } | 89 | } |
| 91 | 90 |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/inspectionplan/vo/AppInspectionPlanRespVO.java
| @@ -5,7 +5,7 @@ import io.swagger.v3.oas.annotations.media.Schema; | @@ -5,7 +5,7 @@ import io.swagger.v3.oas.annotations.media.Schema; | ||
| 5 | import lombok.Data; | 5 | import lombok.Data; |
| 6 | import org.springframework.format.annotation.DateTimeFormat; | 6 | import org.springframework.format.annotation.DateTimeFormat; |
| 7 | 7 | ||
| 8 | -import java.time.LocalDateTime; | 8 | +import java.time.LocalDate; |
| 9 | 9 | ||
| 10 | import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY; | 10 | import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY; |
| 11 | 11 | ||
| @@ -37,11 +37,11 @@ public class AppInspectionPlanRespVO { | @@ -37,11 +37,11 @@ public class AppInspectionPlanRespVO { | ||
| 37 | 37 | ||
| 38 | @Schema(description = "执行开始时间") | 38 | @Schema(description = "执行开始时间") |
| 39 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) | 39 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) |
| 40 | - private LocalDateTime beginTime; | 40 | + private LocalDate beginTime; |
| 41 | 41 | ||
| 42 | @Schema(description = "执行时间") | 42 | @Schema(description = "执行时间") |
| 43 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) | 43 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) |
| 44 | - private LocalDateTime endTime; | 44 | + private LocalDate endTime; |
| 45 | 45 | ||
| 46 | @Schema(description = "完成状态 1:未完成;2:进行中;3:已完成", requiredMode = Schema.RequiredMode.REQUIRED) | 46 | @Schema(description = "完成状态 1:未完成;2:进行中;3:已完成", requiredMode = Schema.RequiredMode.REQUIRED) |
| 47 | private Integer finishState; | 47 | private Integer finishState; |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/maintainplan/vo/AppMaintainPlanPageRoadRespVO.java
| 1 | package com.zteits.urbanops.module.garden.controller.app.maintainplan.vo; | 1 | package com.zteits.urbanops.module.garden.controller.app.maintainplan.vo; |
| 2 | 2 | ||
| 3 | import cn.idev.excel.annotation.ExcelProperty; | 3 | import cn.idev.excel.annotation.ExcelProperty; |
| 4 | -import com.zteits.urbanops.framework.common.pojo.PageParam; | ||
| 5 | import io.swagger.v3.oas.annotations.media.Schema; | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | import jakarta.validation.constraints.Max; | 5 | import jakarta.validation.constraints.Max; |
| 7 | import jakarta.validation.constraints.Min; | 6 | import jakarta.validation.constraints.Min; |
| @@ -9,6 +8,7 @@ import jakarta.validation.constraints.NotNull; | @@ -9,6 +8,7 @@ import jakarta.validation.constraints.NotNull; | ||
| 9 | import lombok.Data; | 8 | import lombok.Data; |
| 10 | import org.springframework.format.annotation.DateTimeFormat; | 9 | import org.springframework.format.annotation.DateTimeFormat; |
| 11 | 10 | ||
| 11 | +import java.time.LocalDate; | ||
| 12 | import java.time.LocalDateTime; | 12 | import java.time.LocalDateTime; |
| 13 | 13 | ||
| 14 | import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY; | 14 | import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY; |
| @@ -52,10 +52,10 @@ public class AppMaintainPlanPageRoadRespVO{ | @@ -52,10 +52,10 @@ public class AppMaintainPlanPageRoadRespVO{ | ||
| 52 | 52 | ||
| 53 | @Schema(description = "执行开始时间") | 53 | @Schema(description = "执行开始时间") |
| 54 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) | 54 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) |
| 55 | - private LocalDateTime beginTime; | 55 | + private LocalDate beginTime; |
| 56 | 56 | ||
| 57 | @Schema(description = "执行时间") | 57 | @Schema(description = "执行时间") |
| 58 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) | 58 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) |
| 59 | - private LocalDateTime endTime; | 59 | + private LocalDate endTime; |
| 60 | 60 | ||
| 61 | } | 61 | } |
| 62 | \ No newline at end of file | 62 | \ No newline at end of file |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/inspectionplan/InspectionPlanDO.java
| 1 | package com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan; | 1 | package com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan; |
| 2 | 2 | ||
| 3 | -import lombok.*; | ||
| 4 | -import java.time.LocalDateTime; | ||
| 5 | -import com.baomidou.mybatisplus.annotation.*; | 3 | +import com.baomidou.mybatisplus.annotation.KeySequence; |
| 4 | +import com.baomidou.mybatisplus.annotation.TableId; | ||
| 5 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
| 6 | import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; | 6 | import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; |
| 7 | +import lombok.*; | ||
| 8 | + | ||
| 9 | +import java.time.LocalDate; | ||
| 7 | 10 | ||
| 8 | /** | 11 | /** |
| 9 | * 巡检计划汇总 DO | 12 | * 巡检计划汇总 DO |
| @@ -89,11 +92,11 @@ public class InspectionPlanDO extends BaseDO { | @@ -89,11 +92,11 @@ public class InspectionPlanDO extends BaseDO { | ||
| 89 | /** | 92 | /** |
| 90 | * 开始时间 | 93 | * 开始时间 |
| 91 | */ | 94 | */ |
| 92 | - private LocalDateTime beginTime; | 95 | + private LocalDate beginTime; |
| 93 | /** | 96 | /** |
| 94 | * 开始时间 | 97 | * 开始时间 |
| 95 | */ | 98 | */ |
| 96 | - private LocalDateTime endTime; | 99 | + private LocalDate endTime; |
| 97 | /** | 100 | /** |
| 98 | * 备注 | 101 | * 备注 |
| 99 | */ | 102 | */ |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/maintainplan/MaintainPlanInterceptMapper.java
| @@ -28,6 +28,8 @@ public interface MaintainPlanInterceptMapper extends BaseMapperX<MaintainPlanDO> | @@ -28,6 +28,8 @@ public interface MaintainPlanInterceptMapper extends BaseMapperX<MaintainPlanDO> | ||
| 28 | .likeIfPresent(MaintainPlanDO::getRoadName, reqVO.getRoadName()) | 28 | .likeIfPresent(MaintainPlanDO::getRoadName, reqVO.getRoadName()) |
| 29 | .eqIfPresent(MaintainPlanDO::getFinishState, reqVO.getFinishState()) | 29 | .eqIfPresent(MaintainPlanDO::getFinishState, reqVO.getFinishState()) |
| 30 | .eqIfPresent(MaintainPlanDO::getLevelId, reqVO.getLevelId()) | 30 | .eqIfPresent(MaintainPlanDO::getLevelId, reqVO.getLevelId()) |
| 31 | + .eqIfPresent(MaintainPlanDO::getCycleId, reqVO.getCycleId()) | ||
| 32 | + .eqIfPresent(MaintainPlanDO::getDeptId, reqVO.getDeptId()) | ||
| 31 | .betweenIfPresent(MaintainPlanDO::getBeginTime, reqVO.getBeginTime()) | 33 | .betweenIfPresent(MaintainPlanDO::getBeginTime, reqVO.getBeginTime()) |
| 32 | .betweenIfPresent(MaintainPlanDO::getEndTime, reqVO.getEndTime()) | 34 | .betweenIfPresent(MaintainPlanDO::getEndTime, reqVO.getEndTime()) |
| 33 | .eq(MaintainPlanDO::getDeleted,0) | 35 | .eq(MaintainPlanDO::getDeleted,0) |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/enums/PlanConstants.java
| @@ -17,5 +17,8 @@ public class PlanConstants { | @@ -17,5 +17,8 @@ public class PlanConstants { | ||
| 17 | /*养护类型-浇水-字典key*/ | 17 | /*养护类型-浇水-字典key*/ |
| 18 | public static final String MAINTAIN_TYPE = "maintain_type"; | 18 | public static final String MAINTAIN_TYPE = "maintain_type"; |
| 19 | 19 | ||
| 20 | + /*归属街道-字典key*/ | ||
| 21 | + public static final String STREET_BELONG = "street_belong"; | ||
| 22 | + | ||
| 20 | 23 | ||
| 21 | } | 24 | } |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/inspectionplan/InspectionPlanDetailServiceImpl.java
| @@ -9,8 +9,6 @@ import com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo.Insp | @@ -9,8 +9,6 @@ import com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo.Insp | ||
| 9 | import com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo.AppInspectionPlanDetailReqVO; | 9 | import com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo.AppInspectionPlanDetailReqVO; |
| 10 | import com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo.AppInspectionPlanDetailRespVO; | 10 | import com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo.AppInspectionPlanDetailRespVO; |
| 11 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanDetailDO; | 11 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanDetailDO; |
| 12 | -import com.zteits.urbanops.module.garden.dal.dataobject.maintainplan.MaintainPlanDO; | ||
| 13 | -import com.zteits.urbanops.module.garden.dal.dataobject.maintainplan.MaintainPlanDetailDO; | ||
| 14 | import com.zteits.urbanops.module.garden.dal.mysql.inspectionplan.InspectionPlanDetailMapper; | 12 | import com.zteits.urbanops.module.garden.dal.mysql.inspectionplan.InspectionPlanDetailMapper; |
| 15 | import com.zteits.urbanops.module.garden.dal.mysql.inspectionplan.InspectionPlanRoleMapper; | 13 | import com.zteits.urbanops.module.garden.dal.mysql.inspectionplan.InspectionPlanRoleMapper; |
| 16 | import com.zteits.urbanops.module.garden.enums.FinishStateEnum; | 14 | import com.zteits.urbanops.module.garden.enums.FinishStateEnum; |
| @@ -20,7 +18,9 @@ import org.apache.commons.lang3.StringUtils; | @@ -20,7 +18,9 @@ import org.apache.commons.lang3.StringUtils; | ||
| 20 | import org.springframework.stereotype.Service; | 18 | import org.springframework.stereotype.Service; |
| 21 | import org.springframework.validation.annotation.Validated; | 19 | import org.springframework.validation.annotation.Validated; |
| 22 | 20 | ||
| 21 | +import java.time.LocalDate; | ||
| 23 | import java.time.LocalDateTime; | 22 | import java.time.LocalDateTime; |
| 23 | +import java.time.LocalTime; | ||
| 24 | import java.util.Arrays; | 24 | import java.util.Arrays; |
| 25 | import java.util.List; | 25 | import java.util.List; |
| 26 | 26 | ||
| @@ -109,11 +109,11 @@ public class InspectionPlanDetailServiceImpl implements InspectionPlanDetailServ | @@ -109,11 +109,11 @@ public class InspectionPlanDetailServiceImpl implements InspectionPlanDetailServ | ||
| 109 | @Override | 109 | @Override |
| 110 | public void updateExpiredInspectionPlanDetails() { | 110 | public void updateExpiredInspectionPlanDetails() { |
| 111 | // 更新过期的计划明细状态为过期(3) | 111 | // 更新过期的计划明细状态为过期(3) |
| 112 | - LocalDateTime now = LocalDateTime.now(); | 112 | + LocalDateTime localDateTime = LocalDate.now().atStartOfDay(); //00:00:00 |
| 113 | LambdaUpdateWrapper<InspectionPlanDetailDO> updateWrapper = new LambdaUpdateWrapper<>(); | 113 | LambdaUpdateWrapper<InspectionPlanDetailDO> updateWrapper = new LambdaUpdateWrapper<>(); |
| 114 | - updateWrapper.lt(InspectionPlanDetailDO::getEndTime, now) | ||
| 115 | - .ne(InspectionPlanDetailDO::getFinishState, FinishStateEnum.FINISHED.getStatus()) // 排除已完成的 | ||
| 116 | - .set(InspectionPlanDetailDO::getFinishState, FinishStateEnum.EXPIRED.getStatus()); // 设置为过期状态 | 114 | + updateWrapper.lt(InspectionPlanDetailDO::getEndTime, localDateTime) |
| 115 | + .set(InspectionPlanDetailDO::getFinishState, FinishStateEnum.EXPIRED.getStatus()) // 设置为过期状态 | ||
| 116 | + .eq(InspectionPlanDetailDO::getFinishState, FinishStateEnum.NOT_FINISHED.getStatus()); | ||
| 117 | inspectionPlanDetailMapper.update(null, updateWrapper); | 117 | inspectionPlanDetailMapper.update(null, updateWrapper); |
| 118 | } | 118 | } |
| 119 | 119 |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/inspectionplan/InspectionPlanServiceImpl.java
| @@ -415,9 +415,9 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { | @@ -415,9 +415,9 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { | ||
| 415 | @Override | 415 | @Override |
| 416 | public void updateExpiredInspectionPlans() { | 416 | public void updateExpiredInspectionPlans() { |
| 417 | // 更新过期的计划状态为过期(3) | 417 | // 更新过期的计划状态为过期(3) |
| 418 | - LocalDateTime now = LocalDateTime.now(); | 418 | + LocalDate yesterday = LocalDate.now(); // 昨天日期 |
| 419 | LambdaUpdateWrapper<InspectionPlanDO> updateWrapper = new LambdaUpdateWrapper<>(); | 419 | LambdaUpdateWrapper<InspectionPlanDO> updateWrapper = new LambdaUpdateWrapper<>(); |
| 420 | - updateWrapper.lt(InspectionPlanDO::getEndTime, now) | 420 | + updateWrapper.lt(InspectionPlanDO::getEndTime, yesterday) |
| 421 | .ne(InspectionPlanDO::getFinishState, FinishStateEnum.FINISHED.getStatus()) // 排除已完成的 | 421 | .ne(InspectionPlanDO::getFinishState, FinishStateEnum.FINISHED.getStatus()) // 排除已完成的 |
| 422 | .set(InspectionPlanDO::getFinishState, FinishStateEnum.EXPIRED.getStatus()); // 设置为过期状态 | 422 | .set(InspectionPlanDO::getFinishState, FinishStateEnum.EXPIRED.getStatus()); // 设置为过期状态 |
| 423 | inspectionPlanMapper.update(null, updateWrapper); | 423 | inspectionPlanMapper.update(null, updateWrapper); |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/maintainplan/MaintainPlanDetailServiceImpl.java
| @@ -27,7 +27,9 @@ import org.springframework.stereotype.Service; | @@ -27,7 +27,9 @@ import org.springframework.stereotype.Service; | ||
| 27 | import org.springframework.util.CollectionUtils; | 27 | import org.springframework.util.CollectionUtils; |
| 28 | import org.springframework.validation.annotation.Validated; | 28 | import org.springframework.validation.annotation.Validated; |
| 29 | 29 | ||
| 30 | +import java.time.LocalDate; | ||
| 30 | import java.time.LocalDateTime; | 31 | import java.time.LocalDateTime; |
| 32 | +import java.time.LocalTime; | ||
| 31 | import java.util.Arrays; | 33 | import java.util.Arrays; |
| 32 | import java.util.Collections; | 34 | import java.util.Collections; |
| 33 | import java.util.List; | 35 | import java.util.List; |
| @@ -157,23 +159,24 @@ public class MaintainPlanDetailServiceImpl implements MaintainPlanDetailService | @@ -157,23 +159,24 @@ public class MaintainPlanDetailServiceImpl implements MaintainPlanDetailService | ||
| 157 | @Override | 159 | @Override |
| 158 | public void updateExpiredMaintainPlanDetails() { | 160 | public void updateExpiredMaintainPlanDetails() { |
| 159 | // 更新过期的计划明细状态为过期(3) | 161 | // 更新过期的计划明细状态为过期(3) |
| 160 | - LocalDateTime now = LocalDateTime.now(); | 162 | + LocalDateTime localDateTime = LocalDate.now().atStartOfDay(); //00:00:00 |
| 161 | LambdaUpdateWrapper<MaintainPlanDetailDO> updateWrapper = new LambdaUpdateWrapper<>(); | 163 | LambdaUpdateWrapper<MaintainPlanDetailDO> updateWrapper = new LambdaUpdateWrapper<>(); |
| 162 | - updateWrapper.lt(MaintainPlanDetailDO::getEndTime, now) | ||
| 163 | - .ne(MaintainPlanDetailDO::getFinishState, FinishStateEnum.FINISHED.getStatus()) // 排除已完成的 | ||
| 164 | - .set(MaintainPlanDetailDO::getFinishState, FinishStateEnum.EXPIRED.getStatus()); // 设置为过期状态 | ||
| 165 | - maintainPlanDetailMapper.update(null, updateWrapper); | 164 | + updateWrapper.lt(MaintainPlanDetailDO::getEndTime, localDateTime) |
| 165 | + .set(MaintainPlanDetailDO::getFinishState, FinishStateEnum.EXPIRED.getStatus()) // 设置为过期状态 | ||
| 166 | + .eq(MaintainPlanDetailDO::getFinishState, FinishStateEnum.NOT_FINISHED.getStatus()); | ||
| 167 | + | ||
| 168 | + maintainPlanDetailMapper.update(updateWrapper); | ||
| 166 | } | 169 | } |
| 167 | 170 | ||
| 168 | @Override | 171 | @Override |
| 169 | public void updateExpiredMaintainPlans() { | 172 | public void updateExpiredMaintainPlans() { |
| 170 | // 更新过期的计划状态为过期(3) | 173 | // 更新过期的计划状态为过期(3) |
| 171 | - LocalDateTime now = LocalDateTime.now(); | 174 | + LocalDate now = LocalDate.now(); |
| 172 | LambdaUpdateWrapper<MaintainPlanDO> updateWrapper = new LambdaUpdateWrapper<>(); | 175 | LambdaUpdateWrapper<MaintainPlanDO> updateWrapper = new LambdaUpdateWrapper<>(); |
| 173 | updateWrapper.lt(MaintainPlanDO::getEndTime, now) | 176 | updateWrapper.lt(MaintainPlanDO::getEndTime, now) |
| 174 | - .ne(MaintainPlanDO::getFinishState, FinishStateEnum.FINISHED.getStatus()) // 排除已完成的 | ||
| 175 | - .set(MaintainPlanDO::getFinishState, FinishStateEnum.EXPIRED.getStatus()); // 设置为过期状态 | ||
| 176 | - maintainPlanMapper.update(null, updateWrapper); | 177 | + .set(MaintainPlanDO::getFinishState, FinishStateEnum.EXPIRED.getStatus()) // 设置为过期状态 |
| 178 | + .eq(MaintainPlanDO::getFinishState, FinishStateEnum.NOT_FINISHED.getStatus()); | ||
| 179 | + maintainPlanMapper.update(updateWrapper); | ||
| 177 | } | 180 | } |
| 178 | 181 | ||
| 179 | } | 182 | } |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/road/RoadStreetServiceImpl.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; | ||
| 4 | -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
| 5 | -import org.springframework.stereotype.Service; | ||
| 6 | -import jakarta.annotation.Resource; | ||
| 7 | -import org.springframework.validation.annotation.Validated; | ||
| 8 | -import org.springframework.transaction.annotation.Transactional; | ||
| 9 | - | ||
| 10 | -import java.util.*; | ||
| 11 | - | ||
| 12 | -import com.zteits.urbanops.module.garden.controller.admin.road.vo.*; | ||
| 13 | -import com.zteits.urbanops.module.garden.dal.dataobject.road.RoadStreetDO; | 3 | +import com.zteits.urbanops.framework.common.biz.system.dict.DictDataCommonApi; |
| 4 | +import com.zteits.urbanops.framework.common.biz.system.dict.dto.DictDataRespDTO; | ||
| 14 | import com.zteits.urbanops.framework.common.pojo.PageResult; | 5 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 15 | -import com.zteits.urbanops.framework.common.pojo.PageParam; | ||
| 16 | import com.zteits.urbanops.framework.common.util.object.BeanUtils; | 6 | import com.zteits.urbanops.framework.common.util.object.BeanUtils; |
| 17 | - | 7 | +import com.zteits.urbanops.module.garden.controller.admin.road.vo.RoadStreetPageReqVO; |
| 8 | +import com.zteits.urbanops.module.garden.controller.admin.road.vo.RoadStreetSaveReqVO; | ||
| 9 | +import com.zteits.urbanops.module.garden.dal.dataobject.road.RoadStreetDO; | ||
| 18 | import com.zteits.urbanops.module.garden.dal.mysql.road.RoadStreetMapper; | 10 | import com.zteits.urbanops.module.garden.dal.mysql.road.RoadStreetMapper; |
| 11 | +import jakarta.annotation.Resource; | ||
| 12 | +import org.springframework.stereotype.Service; | ||
| 13 | +import org.springframework.validation.annotation.Validated; | ||
| 14 | + | ||
| 15 | +import java.util.ArrayList; | ||
| 16 | +import java.util.List; | ||
| 19 | 17 | ||
| 20 | -import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; | ||
| 21 | -import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList; | ||
| 22 | -import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.diffList; | ||
| 23 | -import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*; | 18 | +import static com.zteits.urbanops.module.garden.enums.PlanConstants.STREET_BELONG; |
| 24 | 19 | ||
| 25 | /** | 20 | /** |
| 26 | * 街道 Service 实现类 | 21 | * 街道 Service 实现类 |
| @@ -34,6 +29,9 @@ public class RoadStreetServiceImpl implements RoadStreetService { | @@ -34,6 +29,9 @@ public class RoadStreetServiceImpl implements RoadStreetService { | ||
| 34 | @Resource | 29 | @Resource |
| 35 | private RoadStreetMapper roadStreetMapper; | 30 | private RoadStreetMapper roadStreetMapper; |
| 36 | 31 | ||
| 32 | + @Resource | ||
| 33 | + private DictDataCommonApi dictDataCommonApi; | ||
| 34 | + | ||
| 37 | @Override | 35 | @Override |
| 38 | public Long createRoadStreet(RoadStreetSaveReqVO createReqVO) { | 36 | public Long createRoadStreet(RoadStreetSaveReqVO createReqVO) { |
| 39 | // 插入 | 37 | // 插入 |
| @@ -86,9 +84,25 @@ public class RoadStreetServiceImpl implements RoadStreetService { | @@ -86,9 +84,25 @@ public class RoadStreetServiceImpl implements RoadStreetService { | ||
| 86 | 84 | ||
| 87 | @Override | 85 | @Override |
| 88 | public List<RoadStreetDO> getRoadStreetList(String busiLine) { | 86 | public List<RoadStreetDO> getRoadStreetList(String busiLine) { |
| 89 | - QueryWrapper<RoadStreetDO> sql = new QueryWrapper<>(); | ||
| 90 | - sql.lambda().eq(RoadStreetDO::getBusiLine, busiLine).eq(RoadStreetDO::getDeleted,0); | ||
| 91 | - return roadStreetMapper.selectList(sql); | 87 | + List<RoadStreetDO> respList = new ArrayList<>(); |
| 88 | + //从数据字典中获取 | ||
| 89 | + List<DictDataRespDTO> dictDataList = dictDataCommonApi.getDictDataList(STREET_BELONG); | ||
| 90 | + if(org.springframework.util.CollectionUtils.isEmpty(dictDataList)){ | ||
| 91 | + return respList; | ||
| 92 | + } | ||
| 93 | + | ||
| 94 | + dictDataList.forEach(dictData -> { | ||
| 95 | + RoadStreetDO roadStreet = new RoadStreetDO(); | ||
| 96 | + roadStreet.setStreetId(dictData.getValue()); | ||
| 97 | + roadStreet.setStreetName(dictData.getLabel()); | ||
| 98 | + respList.add(roadStreet); | ||
| 99 | + }); | ||
| 100 | + | ||
| 101 | +// QueryWrapper<RoadStreetDO> sql = new QueryWrapper<>(); | ||
| 102 | +// sql.lambda().eq(RoadStreetDO::getBusiLine, busiLine).eq(RoadStreetDO::getDeleted,0); | ||
| 103 | +// return roadStreetMapper.selectList(sql); | ||
| 104 | + | ||
| 105 | + return respList; | ||
| 92 | } | 106 | } |
| 93 | 107 | ||
| 94 | } | 108 | } |
| 95 | \ No newline at end of file | 109 | \ No newline at end of file |