Commit 8efd41762626ce0c8124121c351c7c24fab2a808
1 parent
69603c7f
巡查计划-创建提交
Showing
2 changed files
with
17 additions
and
5 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 com.baomidou.mybatisplus.annotation.FieldFill; | ||
| 4 | +import com.baomidou.mybatisplus.annotation.TableField; | ||
| 5 | +import com.fhs.core.trans.anno.Trans; | ||
| 6 | +import com.fhs.core.trans.constant.TransType; | ||
| 7 | +import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanDO; | ||
| 3 | import io.swagger.v3.oas.annotations.media.Schema; | 8 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | import lombok.*; | 9 | import lombok.*; |
| 5 | import java.time.LocalDateTime; | 10 | import java.time.LocalDateTime; |
| 6 | import cn.idev.excel.annotation.*; | 11 | import cn.idev.excel.annotation.*; |
| 12 | +import org.apache.ibatis.type.JdbcType; | ||
| 7 | 13 | ||
| 8 | @Schema(description = "管理后台 - 巡检计划汇总 Response VO") | 14 | @Schema(description = "管理后台 - 巡检计划汇总 Response VO") |
| 9 | @Data | 15 | @Data |
| @@ -86,4 +92,10 @@ public class InspectionPlanRespVO { | @@ -86,4 +92,10 @@ public class InspectionPlanRespVO { | ||
| 86 | @ExcelProperty("创建时间") | 92 | @ExcelProperty("创建时间") |
| 87 | private LocalDateTime createTime; | 93 | private LocalDateTime createTime; |
| 88 | 94 | ||
| 95 | + @Trans(type = TransType.SIMPLE, target = InspectionPlanDO.class, fields = {"creator", "creatorName"}, refs = {"creator", "creatorName"}) | ||
| 96 | + @TableField(fill = FieldFill.INSERT, jdbcType = JdbcType.VARCHAR) | ||
| 97 | + private String creator; | ||
| 98 | + | ||
| 99 | + private String creatorName; | ||
| 100 | + | ||
| 89 | } | 101 | } |
| 90 | \ No newline at end of file | 102 | \ No newline at end of file |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/inspectionplan/InspectionPlanServiceImpl.java
| @@ -62,8 +62,8 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { | @@ -62,8 +62,8 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { | ||
| 62 | //存在性校验 | 62 | //存在性校验 |
| 63 | validateInspectionPlanExists(createReqVO); | 63 | validateInspectionPlanExists(createReqVO); |
| 64 | LocalDateTime now = LocalDateTime.now(); | 64 | LocalDateTime now = LocalDateTime.now(); |
| 65 | - String userName = SecurityFrameworkUtils.getLoginUserNickname() + "(" + SecurityFrameworkUtils.getLoginUserId() + ")"; | ||
| 66 | - Integer rateValue; | 65 | + String userName = SecurityFrameworkUtils.getLoginUserId()+""; |
| 66 | + int rateValue; | ||
| 67 | if (createReqVO.getRateValue().contains("/")) { | 67 | if (createReqVO.getRateValue().contains("/")) { |
| 68 | rateValue = Integer.parseInt(createReqVO.getRateValue().split("/")[1]); | 68 | rateValue = Integer.parseInt(createReqVO.getRateValue().split("/")[1]); |
| 69 | } else { | 69 | } else { |
| @@ -95,8 +95,8 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { | @@ -95,8 +95,8 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { | ||
| 95 | inspectionPlan.setRoadId(roadReqVO.getRoadId()); | 95 | inspectionPlan.setRoadId(roadReqVO.getRoadId()); |
| 96 | inspectionPlan.setRoadName(roadReqVO.getRoadName()); | 96 | inspectionPlan.setRoadName(roadReqVO.getRoadName()); |
| 97 | //计划属性label | 97 | //计划属性label |
| 98 | - String planAttrLable = DictFrameworkUtils.parseDictDataLabel(PlanConstants.GARDEN_PLAN_ATTR_REDIS_KEY, createReqVO.getPlanAttr()); | ||
| 99 | - inspectionPlan.setPlanName(roadReqVO.getRoadName() + planAttrLable + createReqVO.getPlanNameSuffix()); | 98 | + String planAttrLabel = DictFrameworkUtils.parseDictDataLabel(PlanConstants.GARDEN_PLAN_ATTR_REDIS_KEY, createReqVO.getPlanAttr()); |
| 99 | + inspectionPlan.setPlanName(roadReqVO.getRoadName() + planAttrLabel + createReqVO.getPlanNameSuffix()); | ||
| 100 | /*1.插入巡查计划*/ | 100 | /*1.插入巡查计划*/ |
| 101 | count.addAndGet(inspectionPlanMapper.insert(inspectionPlan)); | 101 | count.addAndGet(inspectionPlanMapper.insert(inspectionPlan)); |
| 102 | /*2.插入角色*/ | 102 | /*2.插入角色*/ |
| @@ -171,7 +171,7 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { | @@ -171,7 +171,7 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { | ||
| 171 | 171 | ||
| 172 | private void validateInspectionPlanExists(InspectionPlanSaveReqVO req) { | 172 | private void validateInspectionPlanExists(InspectionPlanSaveReqVO req) { |
| 173 | Set<Long> roadIds = req.getRoadListReqVO().stream().map(InspectionPlanRoadReqVO::getRoadId).collect(Collectors.toSet()); | 173 | Set<Long> roadIds = req.getRoadListReqVO().stream().map(InspectionPlanRoadReqVO::getRoadId).collect(Collectors.toSet()); |
| 174 | - QueryWrapper<InspectionPlanDO> sql = new QueryWrapper(); | 174 | + QueryWrapper<InspectionPlanDO> sql = new QueryWrapper<>(); |
| 175 | sql.lambda().eq(InspectionPlanDO::getPlanTypeId, req.getPlanTypeId()) | 175 | sql.lambda().eq(InspectionPlanDO::getPlanTypeId, req.getPlanTypeId()) |
| 176 | .in(InspectionPlanDO::getRoadId, roadIds) | 176 | .in(InspectionPlanDO::getRoadId, roadIds) |
| 177 | .between(InspectionPlanDO::getBeginTime, req.getBeginTime(), req.getEndTime()); | 177 | .between(InspectionPlanDO::getBeginTime, req.getBeginTime(), req.getEndTime()); |