Commit 677f14fb6679af91e74601bf8e09af694cc0212c
1 parent
d58a0f8d
refactor(garden): 移除巡检与养护计划中的临时计划校验逻辑
- 注释掉 InspectionPlanController 中的临时计划次数值校验代码 - 注释掉 MaintainPlanController 中的临时计划次数值校验代码 - 调整包导入顺序,优化代码结构可读性 - 统一静态资源导入方式,提升代码整洁度
Showing
2 changed files
with
57 additions
and
64 deletions
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/inspectionplan/InspectionPlanController.java
| 1 | 1 | package com.zteits.urbanops.module.garden.controller.admin.inspectionplan; |
| 2 | 2 | |
| 3 | -import com.zteits.urbanops.module.garden.util.StringValidateUtil; | |
| 3 | +import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; | |
| 4 | +import com.zteits.urbanops.framework.common.pojo.CommonResult; | |
| 5 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 6 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 7 | +import com.zteits.urbanops.framework.common.util.object.BeanUtils; | |
| 8 | +import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; | |
| 9 | +import com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo.InspectionPlanPageReqVO; | |
| 10 | +import com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo.InspectionPlanRespVO; | |
| 11 | +import com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo.InspectionPlanSaveReqVO; | |
| 12 | +import com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo.InspectionPlanUpdateReqVO; | |
| 13 | +import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanDO; | |
| 14 | +import com.zteits.urbanops.module.garden.service.inspectionplan.InspectionPlanService; | |
| 15 | +import io.swagger.v3.oas.annotations.Operation; | |
| 16 | +import io.swagger.v3.oas.annotations.Parameter; | |
| 17 | +import io.swagger.v3.oas.annotations.tags.Tag; | |
| 18 | +import jakarta.annotation.Resource; | |
| 19 | +import jakarta.servlet.http.HttpServletResponse; | |
| 20 | +import jakarta.validation.Valid; | |
| 4 | 21 | import jakarta.validation.constraints.NotBlank; |
| 5 | 22 | import lombok.extern.slf4j.Slf4j; |
| 6 | -import org.springframework.web.bind.annotation.*; | |
| 7 | -import jakarta.annotation.Resource; | |
| 8 | -import org.springframework.validation.annotation.Validated; | |
| 9 | 23 | import org.springframework.security.access.prepost.PreAuthorize; |
| 10 | -import io.swagger.v3.oas.annotations.tags.Tag; | |
| 11 | -import io.swagger.v3.oas.annotations.Parameter; | |
| 12 | -import io.swagger.v3.oas.annotations.Operation; | |
| 24 | +import org.springframework.validation.annotation.Validated; | |
| 25 | +import org.springframework.web.bind.annotation.*; | |
| 13 | 26 | |
| 14 | -import jakarta.validation.*; | |
| 15 | -import jakarta.servlet.http.*; | |
| 16 | -import java.util.*; | |
| 17 | 27 | import java.io.IOException; |
| 28 | +import java.util.List; | |
| 18 | 29 | |
| 19 | -import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 20 | -import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 21 | -import com.zteits.urbanops.framework.common.pojo.CommonResult; | |
| 22 | -import com.zteits.urbanops.framework.common.util.object.BeanUtils; | |
| 23 | - | |
| 24 | -import static com.alibaba.druid.util.FnvHash.Constants.LOG; | |
| 30 | +import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.EXPORT; | |
| 25 | 31 | import static com.zteits.urbanops.framework.common.pojo.CommonResult.error; |
| 26 | 32 | import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; |
| 27 | - | |
| 28 | -import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; | |
| 29 | - | |
| 30 | -import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; | |
| 31 | -import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; | |
| 32 | 33 | import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.PLAN_RATE_VALUE_ERROR; |
| 33 | -import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.PLAN_RATE_VALUE_INTEGER_ERROR; | |
| 34 | - | |
| 35 | -import com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo.*; | |
| 36 | -import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanDO; | |
| 37 | -import com.zteits.urbanops.module.garden.service.inspectionplan.InspectionPlanService; | |
| 38 | 34 | |
| 39 | 35 | @Tag(name = "管理后台 - 巡检计划汇总") |
| 40 | 36 | @RestController |
| ... | ... | @@ -54,12 +50,12 @@ public class InspectionPlanController { |
| 54 | 50 | log.warn("次数值范围:1-10或者分数格式:1/3, rateValue={}", createReqVO.getRateValue()); |
| 55 | 51 | return error(PLAN_RATE_VALUE_ERROR); |
| 56 | 52 | } |
| 57 | - //临时计划 | |
| 58 | - if(createReqVO.getPlanAttr().equals(2)){ | |
| 59 | - if(!StringValidateUtil.isValidNumberStr(createReqVO.getRateValue())){ | |
| 60 | - return error(PLAN_RATE_VALUE_INTEGER_ERROR); | |
| 61 | - } | |
| 62 | - } | |
| 53 | +// //临时计划 | |
| 54 | +// if(createReqVO.getPlanAttr().equals(2)){ | |
| 55 | +// if(!StringValidateUtil.isValidNumberStr(createReqVO.getRateValue())){ | |
| 56 | +// return error(PLAN_RATE_VALUE_INTEGER_ERROR); | |
| 57 | +// } | |
| 58 | +// } | |
| 63 | 59 | |
| 64 | 60 | return inspectionPlanService.createInspectionPlan(createReqVO); |
| 65 | 61 | } |
| ... | ... | @@ -138,4 +134,4 @@ public class InspectionPlanController { |
| 138 | 134 | list); |
| 139 | 135 | } |
| 140 | 136 | |
| 141 | -} | |
| 142 | 137 | \ No newline at end of file |
| 138 | +} | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainplan/MaintainPlanController.java
| 1 | 1 | package com.zteits.urbanops.module.garden.controller.admin.maintainplan; |
| 2 | 2 | |
| 3 | -import com.zteits.urbanops.module.garden.util.StringValidateUtil; | |
| 3 | +import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; | |
| 4 | +import com.zteits.urbanops.framework.common.pojo.CommonResult; | |
| 5 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 6 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 7 | +import com.zteits.urbanops.framework.common.util.object.BeanUtils; | |
| 8 | +import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; | |
| 9 | +import com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo.MaintainPlanPageReqVO; | |
| 10 | +import com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo.MaintainPlanRespVO; | |
| 11 | +import com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo.MaintainPlanSaveReqVO; | |
| 12 | +import com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo.MaintainPlanUpdateReqVO; | |
| 13 | +import com.zteits.urbanops.module.garden.dal.dataobject.maintainplan.MaintainPlanDO; | |
| 14 | +import com.zteits.urbanops.module.garden.service.maintainplan.MaintainPlanService; | |
| 15 | +import io.swagger.v3.oas.annotations.Operation; | |
| 16 | +import io.swagger.v3.oas.annotations.Parameter; | |
| 17 | +import io.swagger.v3.oas.annotations.tags.Tag; | |
| 18 | +import jakarta.annotation.Resource; | |
| 19 | +import jakarta.servlet.http.HttpServletResponse; | |
| 20 | +import jakarta.validation.Valid; | |
| 4 | 21 | import jakarta.validation.constraints.NotBlank; |
| 5 | 22 | import lombok.extern.slf4j.Slf4j; |
| 6 | -import org.springframework.web.bind.annotation.*; | |
| 7 | -import jakarta.annotation.Resource; | |
| 8 | -import org.springframework.validation.annotation.Validated; | |
| 9 | 23 | import org.springframework.security.access.prepost.PreAuthorize; |
| 10 | -import io.swagger.v3.oas.annotations.tags.Tag; | |
| 11 | -import io.swagger.v3.oas.annotations.Parameter; | |
| 12 | -import io.swagger.v3.oas.annotations.Operation; | |
| 24 | +import org.springframework.validation.annotation.Validated; | |
| 25 | +import org.springframework.web.bind.annotation.*; | |
| 13 | 26 | |
| 14 | -import jakarta.validation.*; | |
| 15 | -import jakarta.servlet.http.*; | |
| 16 | -import java.util.*; | |
| 17 | 27 | import java.io.IOException; |
| 28 | +import java.util.List; | |
| 18 | 29 | |
| 19 | -import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 20 | -import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 21 | -import com.zteits.urbanops.framework.common.pojo.CommonResult; | |
| 22 | -import com.zteits.urbanops.framework.common.util.object.BeanUtils; | |
| 23 | - | |
| 30 | +import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.EXPORT; | |
| 24 | 31 | import static com.zteits.urbanops.framework.common.pojo.CommonResult.error; |
| 25 | 32 | import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; |
| 26 | - | |
| 27 | -import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; | |
| 28 | - | |
| 29 | -import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; | |
| 30 | -import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; | |
| 31 | 33 | import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.PLAN_RATE_VALUE_ERROR; |
| 32 | -import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.PLAN_RATE_VALUE_INTEGER_ERROR; | |
| 33 | - | |
| 34 | -import com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo.*; | |
| 35 | -import com.zteits.urbanops.module.garden.dal.dataobject.maintainplan.MaintainPlanDO; | |
| 36 | -import com.zteits.urbanops.module.garden.service.maintainplan.MaintainPlanService; | |
| 37 | 34 | |
| 38 | 35 | @Tag(name = "管理后台 - 养护计划汇总") |
| 39 | 36 | @RestController |
| ... | ... | @@ -54,11 +51,11 @@ public class MaintainPlanController { |
| 54 | 51 | return error(PLAN_RATE_VALUE_ERROR); |
| 55 | 52 | } |
| 56 | 53 | //临时计划 |
| 57 | - if(createReqVO.getPlanAttr().equals(2)){ | |
| 58 | - if(!StringValidateUtil.isValidNumberStr(createReqVO.getRateValue())){ | |
| 59 | - return error(PLAN_RATE_VALUE_INTEGER_ERROR); | |
| 60 | - } | |
| 61 | - } | |
| 54 | +// if(createReqVO.getPlanAttr().equals(2)){ | |
| 55 | +// if(!StringValidateUtil.isValidNumberStr(createReqVO.getRateValue())){ | |
| 56 | +// return error(PLAN_RATE_VALUE_INTEGER_ERROR); | |
| 57 | +// } | |
| 58 | +// } | |
| 62 | 59 | |
| 63 | 60 | return maintainPlanService.createMaintainPlan(createReqVO); |
| 64 | 61 | } |
| ... | ... | @@ -137,4 +134,4 @@ public class MaintainPlanController { |
| 137 | 134 | list); |
| 138 | 135 | } |
| 139 | 136 | |
| 140 | -} | |
| 141 | 137 | \ No newline at end of file |
| 138 | +} | ... | ... |