Commit 17967f8f492f04e59ffb74186cae5cf69b3bf6b8
1 parent
bab40751
app养护计划明细提交
Showing
11 changed files
with
14 additions
and
26 deletions
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/inspectionplan/InspectionPlanController.java
| ... | ... | @@ -54,8 +54,8 @@ public class InspectionPlanController { |
| 54 | 54 | log.warn("次数值范围:1-10或者分数格式:1/3, rateValue={}", createReqVO.getRateValue()); |
| 55 | 55 | return error(PLAN_RATE_VALUE_ERROR); |
| 56 | 56 | } |
| 57 | - //3002 临时计划 | |
| 58 | - if(createReqVO.getPlanTypeId().equals(3002)){ | |
| 57 | + //临时计划 | |
| 58 | + if(createReqVO.getPlanAttr().equals(2)){ | |
| 59 | 59 | if(!StringValidateUtil.isValidNumberStr(createReqVO.getRateValue())){ |
| 60 | 60 | return error(PLAN_RATE_VALUE_INTEGER_ERROR); |
| 61 | 61 | } | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/inspectionplan/vo/InspectionPlanSaveReqVO.java
| ... | ... | @@ -36,7 +36,7 @@ public class InspectionPlanSaveReqVO { |
| 36 | 36 | |
| 37 | 37 | @Schema(description = "道路信息", requiredMode = Schema.RequiredMode.REQUIRED, example = "[{\"deptId\":11,\"roadId\":1,\"roadName\":\"测试\"}]") |
| 38 | 38 | @NotNull |
| 39 | - @Size(min = 1) | |
| 39 | + @Size(min = 1, message = "道路信息不能为空") | |
| 40 | 40 | @Valid |
| 41 | 41 | private List<InspectionPlanRoadReqVO> roadListReqVO; |
| 42 | 42 | |
| ... | ... | @@ -50,8 +50,6 @@ public class InspectionPlanSaveReqVO { |
| 50 | 50 | |
| 51 | 51 | @Schema(description = "周期ID: 1:日/次;2:周/次;3:月/次;4:年/次", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| 52 | 52 | @NotNull(message = "周期ID: 1:日/次;2:周/次;3:月/次;4:年/次不能为空") |
| 53 | - @Min(1) | |
| 54 | - @Max(4) | |
| 55 | 53 | private Integer cycleId; |
| 56 | 54 | |
| 57 | 55 | @Schema(description = "开始时间") | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainplan/MaintainPlanController.java
| ... | ... | @@ -53,9 +53,8 @@ public class MaintainPlanController { |
| 53 | 53 | log.warn("次数值范围:1-10或者分数格式:1/3, rateValue={}", createReqVO.getRateValue()); |
| 54 | 54 | return error(PLAN_RATE_VALUE_ERROR); |
| 55 | 55 | } |
| 56 | - | |
| 57 | - //3002 临时计划 | |
| 58 | - if(createReqVO.getPlanTypeId().equals(20010)){ | |
| 56 | + //临时计划 | |
| 57 | + if(createReqVO.getPlanAttr().equals(2)){ | |
| 59 | 58 | if(!StringValidateUtil.isValidNumberStr(createReqVO.getRateValue())){ |
| 60 | 59 | return error(PLAN_RATE_VALUE_INTEGER_ERROR); |
| 61 | 60 | } | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainplan/vo/MaintainPlanSaveReqVO.java
| ... | ... | @@ -36,7 +36,7 @@ public class MaintainPlanSaveReqVO { |
| 36 | 36 | |
| 37 | 37 | @Schema(description = "道路信息", requiredMode = Schema.RequiredMode.REQUIRED, example = "[{\"deptId\":11,\"roadId\":1,\"roadName\":\"测试\"}]") |
| 38 | 38 | @NotNull |
| 39 | - @Size(min = 1) | |
| 39 | + @Size(min = 1, message = "道路信息不能为空") | |
| 40 | 40 | @Valid |
| 41 | 41 | private List<MaintainPlanRoadReqVO> roadListReqVO; |
| 42 | 42 | |
| ... | ... | @@ -50,8 +50,6 @@ public class MaintainPlanSaveReqVO { |
| 50 | 50 | |
| 51 | 51 | @Schema(description = "周期ID: 1:日/次;2:周/次;3:月/次;4:年/次", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| 52 | 52 | @NotNull(message = "周期ID: 1:日/次;2:周/次;3:月/次;4:年/次不能为空") |
| 53 | - @Min(1) | |
| 54 | - @Max(4) | |
| 55 | 53 | private Integer cycleId; |
| 56 | 54 | |
| 57 | 55 | @Schema(description = "开始时间") | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/maintainplan/AppMaintainPlanCommitController.java
| ... | ... | @@ -9,6 +9,7 @@ import io.swagger.v3.oas.annotations.Parameter; |
| 9 | 9 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 10 | 10 | import jakarta.annotation.Resource; |
| 11 | 11 | import jakarta.validation.Valid; |
| 12 | +import jakarta.validation.constraints.NotBlank; | |
| 12 | 13 | import org.springframework.validation.annotation.Validated; |
| 13 | 14 | import org.springframework.web.bind.annotation.*; |
| 14 | 15 | |
| ... | ... | @@ -36,7 +37,7 @@ public class AppMaintainPlanCommitController { |
| 36 | 37 | @Operation(summary = "获取养护计划-共同处理人明细") |
| 37 | 38 | @Parameter(name = "plan_no", description = "计划编号", required = true, example = "1024") |
| 38 | 39 | //@PreAuthorize("@ss.hasPermission('app:garden:maintain-plan-commit:query')") |
| 39 | - public CommonResult<List<MaintainPlanCommitDetailRespVO>> getMaintainPlanCommitDetailByPlanNo(@RequestParam("plan_no") String planNo) { | |
| 40 | + public CommonResult<List<MaintainPlanCommitDetailRespVO>> getMaintainPlanCommitDetailByPlanNo(@RequestParam("plan_no") @NotBlank String planNo) { | |
| 40 | 41 | return success( maintainPlanCommitService.getMaintainPlanCommitDetailByPlanNo(planNo)); |
| 41 | 42 | } |
| 42 | 43 | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/maintainplan/vo/AppMaintainPlanCommitSaveReqVO.java
| ... | ... | @@ -28,14 +28,6 @@ public class AppMaintainPlanCommitSaveReqVO { |
| 28 | 28 | @NotEmpty(message = "开始照片不能为空") |
| 29 | 29 | private String beginImg; |
| 30 | 30 | |
| 31 | - @Schema(description = "养护面积:单位m²", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 32 | - @NotNull(message = "养护面积:单位m²不能为空") | |
| 33 | - private Double opArea; | |
| 34 | - | |
| 35 | - @Schema(description = "操作时长", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 36 | - @NotNull(message = "操作时长不能为空") | |
| 37 | - private Double opTime; | |
| 38 | - | |
| 39 | 31 | @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你猜") |
| 40 | 32 | @Size(max = 128, message = "备注长度不能超过 128 个字符") |
| 41 | 33 | private String remark; | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/enums/ErrorCodeConstants.java
| ... | ... | @@ -97,7 +97,7 @@ public interface ErrorCodeConstants { |
| 97 | 97 | ErrorCode PLAN_RATE_NOT_EXISTS = new ErrorCode(1-100-007-002, "未配置计划频次"); |
| 98 | 98 | ErrorCode PLAN_RATE_DETAIL_EXISTS = new ErrorCode(1-100-007-003, "计划频次已存在"); |
| 99 | 99 | ErrorCode PLAN_RATE_VALUE_ERROR = new ErrorCode(1-100-007-004, "次数值范围:1-10或者分数格式:1/3"); |
| 100 | - ErrorCode PLAN_RATE_VALUE_INTEGER_ERROR = new ErrorCode(1-100-007-005, "临时计划-次数值范围:1-20的整数"); | |
| 100 | + ErrorCode PLAN_RATE_VALUE_INTEGER_ERROR = new ErrorCode(1-100-007-005, "临时计划-次数值范围:1-10的整数"); | |
| 101 | 101 | |
| 102 | 102 | ErrorCode MATERIAL_TYPE_NOT_EXISTS = new ErrorCode(1-100-004-001, "物料类型不存在"); |
| 103 | 103 | ErrorCode MATERIAL_TYPE_MANAGER_NOT_EXISTS = new ErrorCode(1-100-004-002, "耗材类别管理不存在"); | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/inspectionplan/InspectionPlanServiceImpl.java
| ... | ... | @@ -99,7 +99,7 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { |
| 99 | 99 | //计算计划次数 |
| 100 | 100 | int planNum; |
| 101 | 101 | //临时计划 |
| 102 | - if (createReqVO.getPlanTypeId().equals(3002)) { | |
| 102 | + if (createReqVO.getPlanAttr().equals(2)) { | |
| 103 | 103 | calculate = new ArrayList<>(); |
| 104 | 104 | PeriodResult periodResult = new PeriodResult(createReqVO.getBeginTime(), createReqVO.getEndTime(), Integer.parseInt(createReqVO.getRateValue())); |
| 105 | 105 | calculate.add(periodResult); | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/maintainplan/MaintainPlanCommitServiceImpl.java
| ... | ... | @@ -110,8 +110,8 @@ public class MaintainPlanCommitServiceImpl implements MaintainPlanCommitService |
| 110 | 110 | commitDO.setBeginImg(createReqVO.getBeginImg()); |
| 111 | 111 | commitDO.setProcessImg("[]"); |
| 112 | 112 | commitDO.setEndImg("[]"); |
| 113 | - commitDO.setOpArea(createReqVO.getOpArea()); | |
| 114 | - commitDO.setOpTime(createReqVO.getOpTime()); | |
| 113 | + commitDO.setOpArea(0.0); | |
| 114 | + commitDO.setOpTime(0.0); | |
| 115 | 115 | commitDO.setFinishTime(now); |
| 116 | 116 | commitDO.setUserId(userId); |
| 117 | 117 | commitDO.setUserName(userName); | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/maintainplan/MaintainPlanServiceImpl.java
| ... | ... | @@ -106,7 +106,7 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { |
| 106 | 106 | //计算计划次数 |
| 107 | 107 | int planNum; |
| 108 | 108 | //临时计划比较特殊 |
| 109 | - if (createReqVO.getPlanTypeId().equals(20010)) { | |
| 109 | + if (createReqVO.getPlanAttr().equals(2)) { | |
| 110 | 110 | calculate = new ArrayList<>(); |
| 111 | 111 | PeriodResult periodResult = new PeriodResult(createReqVO.getBeginTime(), createReqVO.getEndTime(), Integer.parseInt(createReqVO.getRateValue())); |
| 112 | 112 | calculate.add(periodResult); | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/util/StringValidateUtil.java
| ... | ... | @@ -107,7 +107,7 @@ public class StringValidateUtil { |
| 107 | 107 | // 3. 转换为数字并校验范围 |
| 108 | 108 | try { |
| 109 | 109 | int number = Integer.parseInt(str); |
| 110 | - return number >= 1 && number <= 20; | |
| 110 | + return number >= 1 && number <= 10; | |
| 111 | 111 | } catch (NumberFormatException e) { |
| 112 | 112 | // 理论上不会走到这里(已通过正则校验),兜底处理 |
| 113 | 113 | return false; | ... | ... |