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 | 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 | 8 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | 9 | import lombok.*; |
| 5 | 10 | import java.time.LocalDateTime; |
| 6 | 11 | import cn.idev.excel.annotation.*; |
| 12 | +import org.apache.ibatis.type.JdbcType; | |
| 7 | 13 | |
| 8 | 14 | @Schema(description = "管理后台 - 巡检计划汇总 Response VO") |
| 9 | 15 | @Data |
| ... | ... | @@ -86,4 +92,10 @@ public class InspectionPlanRespVO { |
| 86 | 92 | @ExcelProperty("创建时间") |
| 87 | 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 | 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 | 62 | //存在性校验 |
| 63 | 63 | validateInspectionPlanExists(createReqVO); |
| 64 | 64 | LocalDateTime now = LocalDateTime.now(); |
| 65 | - String userName = SecurityFrameworkUtils.getLoginUserNickname() + "(" + SecurityFrameworkUtils.getLoginUserId() + ")"; | |
| 66 | - Integer rateValue; | |
| 65 | + String userName = SecurityFrameworkUtils.getLoginUserId()+""; | |
| 66 | + int rateValue; | |
| 67 | 67 | if (createReqVO.getRateValue().contains("/")) { |
| 68 | 68 | rateValue = Integer.parseInt(createReqVO.getRateValue().split("/")[1]); |
| 69 | 69 | } else { |
| ... | ... | @@ -95,8 +95,8 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { |
| 95 | 95 | inspectionPlan.setRoadId(roadReqVO.getRoadId()); |
| 96 | 96 | inspectionPlan.setRoadName(roadReqVO.getRoadName()); |
| 97 | 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 | 100 | /*1.插入巡查计划*/ |
| 101 | 101 | count.addAndGet(inspectionPlanMapper.insert(inspectionPlan)); |
| 102 | 102 | /*2.插入角色*/ |
| ... | ... | @@ -171,7 +171,7 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { |
| 171 | 171 | |
| 172 | 172 | private void validateInspectionPlanExists(InspectionPlanSaveReqVO req) { |
| 173 | 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 | 175 | sql.lambda().eq(InspectionPlanDO::getPlanTypeId, req.getPlanTypeId()) |
| 176 | 176 | .in(InspectionPlanDO::getRoadId, roadIds) |
| 177 | 177 | .between(InspectionPlanDO::getBeginTime, req.getBeginTime(), req.getEndTime()); | ... | ... |