Commit 0d0a20af624a3b3a2381db1fb85234fbcbc1fe07
Merge remote-tracking branch 'origin/dev' into dev
Showing
33 changed files
with
621 additions
and
292 deletions
.vscode/settings.json
| 1 | 1 | { |
| 2 | 2 | "java.compile.nullAnalysis.mode": "automatic", |
| 3 | - "java.configuration.updateBuildConfiguration": "automatic" | |
| 3 | + "java.configuration.updateBuildConfiguration": "automatic", | |
| 4 | + "codingcopilot.enableCompletionLanguage": {}, | |
| 5 | + "java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx8G -Xms100m -Xlog:disable" | |
| 4 | 6 | } |
| 5 | 7 | \ No newline at end of file | ... | ... |
urbanops-framework/urbanops-common/src/main/java/com/zteits/urbanops/framework/common/biz/infra/logger/dto/ApiAccessLogCreateReqDTO.java
| ... | ... | @@ -2,6 +2,7 @@ package com.zteits.urbanops.framework.common.biz.infra.logger.dto; |
| 2 | 2 | |
| 3 | 3 | import jakarta.validation.constraints.NotNull; |
| 4 | 4 | import lombok.Data; |
| 5 | +import lombok.experimental.Accessors; | |
| 5 | 6 | |
| 6 | 7 | import java.time.LocalDateTime; |
| 7 | 8 | |
| ... | ... | @@ -11,6 +12,7 @@ import java.time.LocalDateTime; |
| 11 | 12 | * @author ZIEITS |
| 12 | 13 | */ |
| 13 | 14 | @Data |
| 15 | +@Accessors(chain = true) | |
| 14 | 16 | public class ApiAccessLogCreateReqDTO { |
| 15 | 17 | |
| 16 | 18 | /** | ... | ... |
urbanops-framework/urbanops-common/src/main/java/com/zteits/urbanops/framework/common/util/json/databind/LocalDateTimeStringSerializer.java
0 → 100644
| 1 | +package com.zteits.urbanops.framework.common.util.json.databind; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.core.JsonGenerator; | |
| 4 | +import com.fasterxml.jackson.databind.JsonSerializer; | |
| 5 | +import com.fasterxml.jackson.databind.SerializerProvider; | |
| 6 | + | |
| 7 | +import java.io.IOException; | |
| 8 | +import java.time.LocalDateTime; | |
| 9 | +import java.time.format.DateTimeFormatter; | |
| 10 | + | |
| 11 | +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 将 {@link LocalDateTime} 序列化为 {@code yyyy-MM-dd HH:mm:ss} 字符串 | |
| 15 | + */ | |
| 16 | +public class LocalDateTimeStringSerializer extends JsonSerializer<LocalDateTime> { | |
| 17 | + | |
| 18 | + private static final DateTimeFormatter FORMATTER = | |
| 19 | + DateTimeFormatter.ofPattern(FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND); | |
| 20 | + | |
| 21 | + @Override | |
| 22 | + public void serialize(LocalDateTime value, JsonGenerator gen, SerializerProvider serializers) throws IOException { | |
| 23 | + if (value == null) { | |
| 24 | + gen.writeNull(); | |
| 25 | + return; | |
| 26 | + } | |
| 27 | + gen.writeString(FORMATTER.format(value)); | |
| 28 | + } | |
| 29 | +} | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/inspectionplan/vo/InspectionPlanSaveReqVO.java
| ... | ... | @@ -15,6 +15,7 @@ import jakarta.validation.constraints.*; |
| 15 | 15 | public class InspectionPlanSaveReqVO { |
| 16 | 16 | |
| 17 | 17 | @Schema(description = "计划名称后缀", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "张三") |
| 18 | + @Size(max = 15) | |
| 18 | 19 | private String planNameSuffix; |
| 19 | 20 | |
| 20 | 21 | @Schema(description = "业务线: yl-园林;wy-物业:sz-市政", requiredMode = Schema.RequiredMode.REQUIRED) | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainplan/MaintainPlanController.java
| ... | ... | @@ -48,7 +48,7 @@ public class MaintainPlanController { |
| 48 | 48 | @PreAuthorize("@ss.hasPermission('garden:maintain-plan:create')") |
| 49 | 49 | public CommonResult<Integer> createMaintainPlan(@Valid @RequestBody MaintainPlanSaveReqVO createReqVO) { |
| 50 | 50 | if(!createReqVO.verify()){ |
| 51 | - log.warn("次数值范围:1-20或者分数格式:1/3, rateValue={}", createReqVO.getRateValue()); | |
| 51 | + log.warn("次数值范围:1-10或者分数格式:1/3, rateValue={}", createReqVO.getRateValue()); | |
| 52 | 52 | return error(PLAN_RATE_VALUE_ERROR); |
| 53 | 53 | } |
| 54 | 54 | return maintainPlanService.createMaintainPlan(createReqVO); |
| ... | ... | @@ -57,7 +57,7 @@ public class MaintainPlanController { |
| 57 | 57 | @PutMapping("/update") |
| 58 | 58 | @Operation(summary = "更新养护计划汇总") |
| 59 | 59 | @PreAuthorize("@ss.hasPermission('garden:maintain-plan:update')") |
| 60 | - public CommonResult<Boolean> updateMaintainPlan(@Valid @RequestBody MaintainPlanSaveReqVO updateReqVO) { | |
| 60 | + public CommonResult<Boolean> updateMaintainPlan(@Valid @RequestBody MaintainPlanUpdateReqVO updateReqVO) { | |
| 61 | 61 | maintainPlanService.updateMaintainPlan(updateReqVO); |
| 62 | 62 | return success(true); |
| 63 | 63 | } | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainplan/vo/MaintainPlanSaveReqVO.java
| 1 | 1 | package com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo; |
| 2 | 2 | |
| 3 | +import com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo.InspectionPlanRoadReqVO; | |
| 3 | 4 | import com.zteits.urbanops.module.garden.util.StringValidateUtil; |
| 4 | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | 6 | import jakarta.validation.Valid; |
| ... | ... | @@ -14,21 +15,22 @@ import jakarta.validation.constraints.*; |
| 14 | 15 | public class MaintainPlanSaveReqVO { |
| 15 | 16 | |
| 16 | 17 | @Schema(description = "计划名称后缀", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "张三") |
| 18 | + @Size(max = 15) | |
| 17 | 19 | private String planNameSuffix; |
| 18 | 20 | |
| 19 | 21 | @Schema(description = "业务线: yl-园林;wy-物业:sz-市政", requiredMode = Schema.RequiredMode.REQUIRED) |
| 20 | 22 | @NotEmpty(message = "业务线: yl-园林;wy-物业:sz-市政不能为空") |
| 21 | 23 | private String busiLine; |
| 22 | 24 | |
| 23 | - @Schema(description = "计划属性:1:标准计划;2:临时计划", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 25 | + @Schema(description = "计划属性:1:标准计划;2:临时计划", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 24 | 26 | @NotNull(message = "计划属性:1:标准计划;2:临时计划不能为空") |
| 25 | 27 | private Integer planAttr; |
| 26 | 28 | |
| 27 | - @Schema(description = "养护类型:2001:浇水;2002:施肥;2003:有害生物防治;2004:修剪;2005:中耕除草;2006:打孔梳草;2007:绿地保洁;2008:园林废弃物收集运输 ;2009:补植;3001:绿地巡视;", requiredMode = Schema.RequiredMode.REQUIRED, example = "7439") | |
| 29 | + @Schema(description = "养护类型:2001:浇水;2002:施肥;2003:有害生物防治;2004:修剪;2005:中耕除草;2006:打孔梳草;2007:绿地保洁;2008:园林废弃物收集运输 ;2009:补植;3001:绿地巡视;", requiredMode = Schema.RequiredMode.REQUIRED, example = "24742") | |
| 28 | 30 | @NotNull(message = "养护类型:2001:浇水;2002:施肥;2003:有害生物防治;2004:修剪;2005:中耕除草;2006:打孔梳草;2007:绿地保洁;2008:园林废弃物收集运输 ;2009:补植;3001:绿地巡视;不能为空") |
| 29 | 31 | private Integer planTypeId; |
| 30 | 32 | |
| 31 | - @Schema(description = "归属(一级部门id)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1713") | |
| 33 | + @Schema(description = "归属(一级部门id)", requiredMode = Schema.RequiredMode.REQUIRED, example = "20800") | |
| 32 | 34 | @NotNull(message = "归属(一级部门id)不能为空") |
| 33 | 35 | private Long companyId; |
| 34 | 36 | |
| ... | ... | @@ -38,8 +40,7 @@ public class MaintainPlanSaveReqVO { |
| 38 | 40 | @Valid |
| 39 | 41 | private List<MaintainPlanRoadReqVO> roadListReqVO; |
| 40 | 42 | |
| 41 | - | |
| 42 | - @Schema(description = "养护级别: 10:特级;11:一级:12:二级;13:三级", requiredMode = Schema.RequiredMode.REQUIRED, example = "16420") | |
| 43 | + @Schema(description = "养护级别: 10:特级;11:一级:12:二级;13:三级", requiredMode = Schema.RequiredMode.REQUIRED, example = "8588") | |
| 43 | 44 | @NotNull(message = "养护级别: 10:特级;11:一级:12:二级;13:三级不能为空") |
| 44 | 45 | private Integer levelId; |
| 45 | 46 | |
| ... | ... | @@ -47,8 +48,10 @@ public class MaintainPlanSaveReqVO { |
| 47 | 48 | @NotEmpty(message = "频次值不能为空") |
| 48 | 49 | private String rateValue; |
| 49 | 50 | |
| 50 | - @Schema(description = "周期ID: 1:日/次;2:周/次;3:月/次;4:年/次", requiredMode = Schema.RequiredMode.REQUIRED, example = "28220") | |
| 51 | + @Schema(description = "周期ID: 1:日/次;2:周/次;3:月/次;4:年/次", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 51 | 52 | @NotNull(message = "周期ID: 1:日/次;2:周/次;3:月/次;4:年/次不能为空") |
| 53 | + @Min(1) | |
| 54 | + @Max(4) | |
| 52 | 55 | private Integer cycleId; |
| 53 | 56 | |
| 54 | 57 | @Schema(description = "开始时间") |
| ... | ... | @@ -57,7 +60,7 @@ public class MaintainPlanSaveReqVO { |
| 57 | 60 | @Schema(description = "开始时间") |
| 58 | 61 | private LocalDate endTime; |
| 59 | 62 | |
| 60 | - @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你猜") | |
| 63 | + @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对") | |
| 61 | 64 | private String remark; |
| 62 | 65 | |
| 63 | 66 | @NotNull(message = "角色Ids不能为空") | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainplan/vo/MaintainPlanUpdateReqVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo; | |
| 2 | + | |
| 3 | +import com.zteits.urbanops.module.garden.util.StringValidateUtil; | |
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 5 | +import jakarta.validation.Valid; | |
| 6 | +import jakarta.validation.constraints.*; | |
| 7 | +import lombok.Data; | |
| 8 | + | |
| 9 | +import java.time.LocalDate; | |
| 10 | +import java.time.LocalDateTime; | |
| 11 | +import java.util.List; | |
| 12 | +import java.util.Set; | |
| 13 | + | |
| 14 | +@Schema(description = "管理后台 - 养护计划汇总新增/修改 Request VO") | |
| 15 | +@Data | |
| 16 | +public class MaintainPlanUpdateReqVO { | |
| 17 | + | |
| 18 | + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10938") | |
| 19 | + private Long id; | |
| 20 | + | |
| 21 | + | |
| 22 | + @Schema(description = "业务线: yl-园林;wy-物业:sz-市政", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 23 | + @NotEmpty(message = "业务线: yl-园林;wy-物业:sz-市政不能为空") | |
| 24 | + private String busiLine; | |
| 25 | + | |
| 26 | + @Schema(description = "计划属性:1:标准计划;2:临时计划", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 27 | + @NotNull(message = "计划属性:1:标准计划;2:临时计划不能为空") | |
| 28 | + private Integer planAttr; | |
| 29 | + | |
| 30 | + @Schema(description = "养护类型:2001:浇水;2002:施肥;2003:有害生物防治;2004:修剪;2005:中耕除草;2006:打孔梳草;2007:绿地保洁;2008:园林废弃物收集运输 ;2009:补植;3001:绿地巡视;", requiredMode = Schema.RequiredMode.REQUIRED, example = "24742") | |
| 31 | + @NotNull(message = "养护类型:2001:浇水;2002:施肥;2003:有害生物防治;2004:修剪;2005:中耕除草;2006:打孔梳草;2007:绿地保洁;2008:园林废弃物收集运输 ;2009:补植;3001:绿地巡视;不能为空") | |
| 32 | + private Integer planTypeId; | |
| 33 | + | |
| 34 | + @Schema(description = "归属(一级部门id)", requiredMode = Schema.RequiredMode.REQUIRED, example = "20800") | |
| 35 | + @NotNull(message = "归属(一级部门id)不能为空") | |
| 36 | + private Long companyId; | |
| 37 | + | |
| 38 | + @Schema(description = "部门ID(道路负责部门id)", requiredMode = Schema.RequiredMode.REQUIRED, example = "16445") | |
| 39 | + @NotNull(message = "部门ID(道路负责部门id)不能为空") | |
| 40 | + private Long deptId; | |
| 41 | + | |
| 42 | + @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15557") | |
| 43 | + @NotNull(message = "道路ID不能为空") | |
| 44 | + private Long roadId; | |
| 45 | + | |
| 46 | + @Schema(description = "道路名称", example = "赵六") | |
| 47 | + private String roadName; | |
| 48 | + | |
| 49 | + @Schema(description = "养护级别: 10:特级;11:一级:12:二级;13:三级", requiredMode = Schema.RequiredMode.REQUIRED, example = "8588") | |
| 50 | + @NotNull(message = "养护级别: 10:特级;11:一级:12:二级;13:三级不能为空") | |
| 51 | + private Integer levelId; | |
| 52 | + | |
| 53 | + @Schema(description = "周期ID: 1:日/次;2:周/次;3:月/次;4:年/次", requiredMode = Schema.RequiredMode.REQUIRED, example = "6415") | |
| 54 | + @NotNull(message = "周期ID: 1:日/次;2:周/次;3:月/次;4:年/次不能为空") | |
| 55 | + private Integer cycleId; | |
| 56 | + | |
| 57 | + @Schema(description = "计划次数", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 58 | + @NotNull(message = "计划次数不能为空") | |
| 59 | + private Integer planNum; | |
| 60 | + | |
| 61 | + @Schema(description = "已完成次数", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 62 | + @NotNull(message = "已完成次数不能为空") | |
| 63 | + private Integer planFinishNum; | |
| 64 | + | |
| 65 | + @Schema(description = "完成状态 1:未完成;2:已完成", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 66 | + @NotNull(message = "完成状态 1:未完成;2:已完成不能为空") | |
| 67 | + private Integer finishState; | |
| 68 | + | |
| 69 | + @Schema(description = "开始时间") | |
| 70 | + private LocalDateTime beginTime; | |
| 71 | + | |
| 72 | + @Schema(description = "开始时间") | |
| 73 | + private LocalDateTime endTime; | |
| 74 | + | |
| 75 | + @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对") | |
| 76 | + @NotEmpty(message = "备注不能为空") | |
| 77 | + private String remark; | |
| 78 | +} | |
| 0 | 79 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/oldtrees/OldtreesController.java
| 1 | 1 | package com.zteits.urbanops.module.garden.controller.admin.oldtrees; |
| 2 | 2 | |
| 3 | +import com.fhs.core.trans.anno.TransMethodResult; | |
| 3 | 4 | import com.zteits.urbanops.framework.dict.core.DictFrameworkUtils; |
| 4 | 5 | import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; |
| 5 | 6 | import org.apache.catalina.security.SecurityUtil; |
| ... | ... | @@ -94,6 +95,7 @@ public class OldtreesController { |
| 94 | 95 | @Operation(summary = "获取古树台账详细信息") |
| 95 | 96 | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| 96 | 97 | @PreAuthorize("@ss.hasPermission('garden:oldtrees:query')") |
| 98 | + @TransMethodResult | |
| 97 | 99 | public CommonResult<OldtreesRespVO> getOldtrees(@RequestParam("id") String id) { |
| 98 | 100 | OldtreesDO oldtrees = oldtreesService.getOldtrees(id); |
| 99 | 101 | return success(BeanUtils.toBean(oldtrees, OldtreesRespVO.class)); |
| ... | ... | @@ -125,20 +127,18 @@ public class OldtreesController { |
| 125 | 127 | |
| 126 | 128 | private void fillDictData(List<OldtreesDO> list) { |
| 127 | 129 | for (OldtreesDO gardenTree : list) { |
| 128 | - String maintainUnit = DictFrameworkUtils.parseDictDataValue("maintain_unit", gardenTree.getMaintainunit()); | |
| 129 | - gardenTree.setMaintainunit(maintainUnit); | |
| 130 | 130 | |
| 131 | - String street = DictFrameworkUtils.parseDictDataValue("street_belong", gardenTree.getStreet()); | |
| 131 | + String street = DictFrameworkUtils.parseDictDataLabel("street_belong", gardenTree.getStreet()); | |
| 132 | 132 | gardenTree.setStreet(street); |
| 133 | 133 | |
| 134 | - String ownership = DictFrameworkUtils.parseDictDataValue("tree_ownership", gardenTree.getOldtreeownership()); | |
| 134 | + String ownership = DictFrameworkUtils.parseDictDataLabel("tree_ownership", gardenTree.getOldtreeownership()); | |
| 135 | 135 | gardenTree.setOldtreeownership(ownership); |
| 136 | 136 | |
| 137 | - String growthVigor = DictFrameworkUtils.parseDictDataValue("growth_vigor", gardenTree.getGrowthvigor()); | |
| 137 | + String growthVigor = DictFrameworkUtils.parseDictDataLabel("growth_vigor", gardenTree.getGrowthvigor()); | |
| 138 | 138 | gardenTree.setGrowthvigor(growthVigor); |
| 139 | - String treeLevel = DictFrameworkUtils.parseDictDataValue("tree_level", gardenTree.getTreelevel()); | |
| 139 | + String treeLevel = DictFrameworkUtils.parseDictDataLabel("tree_level", gardenTree.getTreelevel()); | |
| 140 | 140 | gardenTree.setTreelevel(treeLevel); |
| 141 | - String dataState = DictFrameworkUtils.parseDictDataValue("data_state", gardenTree.getDatastate()); | |
| 141 | + String dataState = DictFrameworkUtils.parseDictDataLabel("data_state", gardenTree.getDatastate()); | |
| 142 | 142 | gardenTree.setDatastate(dataState); |
| 143 | 143 | } |
| 144 | 144 | } | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/oldtrees/vo/OldtreesPageReqVO.java
| 1 | 1 | package com.zteits.urbanops.module.garden.controller.admin.oldtrees.vo; |
| 2 | 2 | |
| 3 | +import com.fhs.core.trans.anno.Trans; | |
| 4 | +import com.fhs.core.trans.constant.TransType; | |
| 5 | +import com.zteits.urbanops.module.system.dal.dataobject.dept.DeptDO; | |
| 3 | 6 | import lombok.*; |
| 4 | 7 | import java.util.*; |
| 5 | 8 | import io.swagger.v3.oas.annotations.media.Schema; | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/oldtrees/vo/OldtreesRespVO.java
| 1 | 1 | package com.zteits.urbanops.module.garden.controller.admin.oldtrees.vo; |
| 2 | 2 | |
| 3 | 3 | import com.baomidou.mybatisplus.annotation.TableField; |
| 4 | +import com.fasterxml.jackson.annotation.JsonFormat; | |
| 5 | +import com.fasterxml.jackson.databind.annotation.JsonSerialize; | |
| 4 | 6 | import com.fhs.core.trans.anno.Trans; |
| 5 | 7 | import com.fhs.core.trans.constant.TransType; |
| 8 | +import com.zteits.urbanops.framework.common.util.json.databind.LocalDateTimeStringSerializer; | |
| 6 | 9 | import com.zteits.urbanops.module.system.dal.dataobject.dept.DeptDO; |
| 10 | +import com.zteits.urbanops.module.system.dal.dataobject.user.AdminUserDO; | |
| 7 | 11 | import io.swagger.v3.oas.annotations.media.Schema; |
| 8 | 12 | import lombok.*; |
| 9 | 13 | import java.util.*; |
| ... | ... | @@ -11,13 +15,16 @@ import org.springframework.format.annotation.DateTimeFormat; |
| 11 | 15 | import java.time.LocalDateTime; |
| 12 | 16 | import cn.idev.excel.annotation.*; |
| 13 | 17 | |
| 18 | +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 19 | +import static com.zteits.urbanops.framework.common.util.date.DateUtils.TIME_ZONE_DEFAULT; | |
| 20 | + | |
| 14 | 21 | @Schema(description = "管理后台 - 古树名木 Response VO") |
| 15 | 22 | @Data |
| 16 | 23 | @ExcelIgnoreUnannotated |
| 17 | 24 | public class OldtreesRespVO { |
| 18 | 25 | |
| 19 | 26 | @Schema(description = "id", example = "4258") |
| 20 | - @ExcelProperty("id") | |
| 27 | +// @ExcelProperty("id") | |
| 21 | 28 | private String id; |
| 22 | 29 | |
| 23 | 30 | @Schema(description = "编号") |
| ... | ... | @@ -25,7 +32,7 @@ public class OldtreesRespVO { |
| 25 | 32 | private String famoustreenumber; |
| 26 | 33 | |
| 27 | 34 | @Schema(description = "级别--数据字典:一级、两级") |
| 28 | - @ExcelProperty("级别--数据字典:一级、两级") | |
| 35 | + @ExcelProperty("级别") | |
| 29 | 36 | private String treelevel; |
| 30 | 37 | |
| 31 | 38 | @Schema(description = "树种", example = "2") |
| ... | ... | @@ -37,14 +44,11 @@ public class OldtreesRespVO { |
| 37 | 44 | private String location; |
| 38 | 45 | |
| 39 | 46 | @Schema(description = "养护单位") |
| 40 | - private String maintainunit; | |
| 41 | - | |
| 42 | - @Schema(description = "养护单位名称") | |
| 43 | 47 | @ExcelProperty("养护单位") |
| 44 | - private String maintainUnitName; | |
| 48 | + private String maintainunit; | |
| 45 | 49 | |
| 46 | 50 | @Schema(description = "权属分类--数据字典:专业绿地和单位(居住区)") |
| 47 | - @ExcelProperty("权属分类--数据字典:专业绿地和单位(居住区)") | |
| 51 | + @ExcelProperty("权属分类") | |
| 48 | 52 | private String oldtreeownership; |
| 49 | 53 | |
| 50 | 54 | @Schema(description = "生长地点") |
| ... | ... | @@ -92,7 +96,7 @@ public class OldtreesRespVO { |
| 92 | 96 | private String weekday; |
| 93 | 97 | |
| 94 | 98 | @Schema(description = "生长势--数据字典:正常,衰弱,濒危,死亡") |
| 95 | - @ExcelProperty("生长势--数据字典:正常,衰弱,濒危,死亡") | |
| 99 | +// @ExcelProperty("生长势--数据字典:正常,衰弱,濒危,死亡") | |
| 96 | 100 | private String growthvigor; |
| 97 | 101 | |
| 98 | 102 | @Schema(description = "生长环境") |
| ... | ... | @@ -104,27 +108,27 @@ public class OldtreesRespVO { |
| 104 | 108 | private String treephotoone; |
| 105 | 109 | |
| 106 | 110 | @Schema(description = "春季养护管理措施") |
| 107 | - @ExcelProperty("春季养护管理措施") | |
| 111 | +// @ExcelProperty("春季养护管理措施") | |
| 108 | 112 | private String springmaintenance; |
| 109 | 113 | |
| 110 | 114 | @Schema(description = "夏季养护管理措施") |
| 111 | - @ExcelProperty("夏季养护管理措施") | |
| 115 | +// @ExcelProperty("夏季养护管理措施") | |
| 112 | 116 | private String summermaintenance; |
| 113 | 117 | |
| 114 | 118 | @Schema(description = "秋季养护管理措施") |
| 115 | - @ExcelProperty("秋季养护管理措施") | |
| 119 | +// @ExcelProperty("秋季养护管理措施") | |
| 116 | 120 | private String autumnmaintenance; |
| 117 | 121 | |
| 118 | 122 | @Schema(description = "冬季养护管理措施") |
| 119 | - @ExcelProperty("冬季养护管理措施") | |
| 123 | +// @ExcelProperty("冬季养护管理措施") | |
| 120 | 124 | private String wintermaintenance; |
| 121 | 125 | |
| 122 | 126 | @Schema(description = "年度") |
| 123 | - @ExcelProperty("年度") | |
| 127 | +// @ExcelProperty("年度") | |
| 124 | 128 | private String annual; |
| 125 | 129 | |
| 126 | 130 | @Schema(description = "养护记录备注", example = "随便") |
| 127 | - @ExcelProperty("养护记录备注") | |
| 131 | +// @ExcelProperty("养护记录备注") | |
| 128 | 132 | private String curingremark; |
| 129 | 133 | |
| 130 | 134 | @Schema(description = "古树照片二") |
| ... | ... | @@ -140,19 +144,19 @@ public class OldtreesRespVO { |
| 140 | 144 | private String nameplatephoto; |
| 141 | 145 | |
| 142 | 146 | @Schema(description = "数据状态(已更新、未更新)") |
| 143 | - @ExcelProperty("数据状态(已更新、未更新)") | |
| 147 | +// @ExcelProperty("数据状态(已更新、未更新)") | |
| 144 | 148 | private String datastate; |
| 145 | 149 | |
| 146 | 150 | @Schema(description = "养护员工--作业队下派古树时选择的派发员工") |
| 147 | - @ExcelProperty("养护员工--作业队下派古树时选择的派发员工") | |
| 151 | +// @ExcelProperty("养护员工--作业队下派古树时选择的派发员工") | |
| 148 | 152 | private String curingstaff; |
| 149 | 153 | |
| 150 | 154 | @Schema(description = "状态(驳回/确认)") |
| 151 | - @ExcelProperty("状态(驳回/确认)") | |
| 155 | +// @ExcelProperty("状态(驳回/确认)") | |
| 152 | 156 | private String state; |
| 153 | 157 | |
| 154 | 158 | @Schema(description = "平台驳回状态(平台驳回)") |
| 155 | - @ExcelProperty("平台驳回状态(平台驳回)") | |
| 159 | +// @ExcelProperty("平台驳回状态(平台驳回)") | |
| 156 | 160 | private String platformstate; |
| 157 | 161 | |
| 158 | 162 | @Schema(description = "所属街道") |
| ... | ... | @@ -160,31 +164,43 @@ public class OldtreesRespVO { |
| 160 | 164 | private String street; |
| 161 | 165 | |
| 162 | 166 | @Schema(description = "责任人姓名", example = "赵六") |
| 163 | - @ExcelProperty("责任人姓名") | |
| 167 | +// @ExcelProperty("责任人姓名") | |
| 164 | 168 | private String responsibleusername; |
| 165 | 169 | |
| 166 | 170 | @Schema(description = "责任人电话") |
| 167 | - @ExcelProperty("责任人电话") | |
| 171 | +// @ExcelProperty("责任人电话") | |
| 168 | 172 | private String responsibleuserphone; |
| 169 | 173 | |
| 174 | + @Trans(type = TransType.SIMPLE, target = AdminUserDO.class, fields = "nickname", ref = "createbyName") | |
| 175 | + private Long createby; | |
| 176 | + | |
| 170 | 177 | @Schema(description = "创建者") |
| 171 | - @ExcelProperty("创建者") | |
| 172 | - private String createby; | |
| 178 | +// @ExcelProperty("创建者") | |
| 179 | + private String createbyName; | |
| 173 | 180 | |
| 174 | 181 | @Schema(description = "创建时间") |
| 175 | - @ExcelProperty("创建时间") | |
| 182 | +// @ExcelProperty("创建时间") | |
| 183 | + @JsonSerialize(using = LocalDateTimeStringSerializer.class) | |
| 184 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 185 | + @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) | |
| 176 | 186 | private LocalDateTime createtime; |
| 177 | 187 | |
| 188 | + @Trans(type = TransType.SIMPLE, target = AdminUserDO.class, fields = "nickname", ref = "updatebyName") | |
| 189 | + private Long updateby; | |
| 190 | + | |
| 178 | 191 | @Schema(description = "更新者") |
| 179 | - @ExcelProperty("更新者") | |
| 180 | - private String updateby; | |
| 192 | +// @ExcelProperty("更新者") | |
| 193 | + private String updatebyName; | |
| 181 | 194 | |
| 182 | 195 | @Schema(description = "更新时间") |
| 183 | - @ExcelProperty("更新时间") | |
| 184 | - private String updatetime; | |
| 196 | +// @ExcelProperty("更新时间") | |
| 197 | + @JsonSerialize(using = LocalDateTimeStringSerializer.class) | |
| 198 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 199 | + @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) | |
| 200 | + private LocalDateTime updatetime; | |
| 185 | 201 | |
| 186 | 202 | @Schema(description = "部门id", requiredMode = Schema.RequiredMode.REQUIRED, example = "20245") |
| 187 | - @ExcelProperty("部门id") | |
| 203 | +// @ExcelProperty("部门id") | |
| 188 | 204 | private Long deptId; |
| 189 | 205 | |
| 190 | 206 | private List<String> treeImgList; | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/oldtrees/vo/OldtreesSaveReqVO.java
| 1 | 1 | package com.zteits.urbanops.module.garden.controller.admin.oldtrees.vo; |
| 2 | 2 | |
| 3 | +import com.baomidou.mybatisplus.annotation.TableField; | |
| 4 | +import com.zteits.urbanops.module.garden.dal.dataobject.oldtrees.OldtreesDO; | |
| 3 | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | 6 | import lombok.*; |
| 5 | 7 | import java.util.*; |
| 6 | 8 | import jakarta.validation.constraints.*; |
| 7 | 9 | import org.springframework.format.annotation.DateTimeFormat; |
| 10 | +import org.springframework.util.CollectionUtils; | |
| 11 | +import org.springframework.util.StringUtils; | |
| 12 | + | |
| 8 | 13 | import java.time.LocalDateTime; |
| 9 | 14 | |
| 10 | 15 | @Schema(description = "管理后台 - 古树名木新增/修改 Request VO") |
| ... | ... | @@ -141,4 +146,46 @@ public class OldtreesSaveReqVO { |
| 141 | 146 | |
| 142 | 147 | private List<String> nameplatephotoList; |
| 143 | 148 | |
| 149 | + | |
| 150 | + public OldtreesSaveReqVO imgToDomain(){ | |
| 151 | + if (!CollectionUtils.isEmpty(treeImgList)) { | |
| 152 | + if (treeImgList.size() > 0) { | |
| 153 | + this.treephotoone = treeImgList.get(0); | |
| 154 | + } | |
| 155 | + if (treeImgList.size() > 1) { | |
| 156 | + this.treephototwo = treeImgList.get(1); | |
| 157 | + } | |
| 158 | + if (treeImgList.size() > 2) { | |
| 159 | + this.treephotothree = treeImgList.get(2); | |
| 160 | + } | |
| 161 | + } | |
| 162 | + if (!CollectionUtils.isEmpty(nameplatephotoList)) { | |
| 163 | + if (nameplatephotoList.size() > 0) { | |
| 164 | + this.nameplatephoto = nameplatephotoList.get(0); | |
| 165 | + } | |
| 166 | + } | |
| 167 | + return this; | |
| 168 | + } | |
| 169 | + public OldtreesSaveReqVO domainToImg(){ | |
| 170 | + if (CollectionUtils.isEmpty(treeImgList)) { | |
| 171 | + treeImgList = new ArrayList<>(); | |
| 172 | + } | |
| 173 | + if (CollectionUtils.isEmpty(nameplatephotoList)) { | |
| 174 | + nameplatephotoList = new ArrayList<>(); | |
| 175 | + } | |
| 176 | + if (!StringUtils.isEmpty(treephotoone)) { | |
| 177 | + treeImgList.add(treephotoone); | |
| 178 | + } | |
| 179 | + if (!StringUtils.isEmpty(treephototwo)) { | |
| 180 | + treeImgList.add(treephototwo); | |
| 181 | + } | |
| 182 | + if (!StringUtils.isEmpty(treephotothree)) { | |
| 183 | + treeImgList.add(treephotothree); | |
| 184 | + } | |
| 185 | + if (!StringUtils.isEmpty(nameplatephoto)) { | |
| 186 | + nameplatephotoList.add(nameplatephoto); | |
| 187 | + } | |
| 188 | + return this; | |
| 189 | + } | |
| 190 | + | |
| 144 | 191 | } |
| 145 | 192 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/oldtreeschangelog/OldtreesChangeLogController.java
| ... | ... | @@ -8,7 +8,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; |
| 8 | 8 | import io.swagger.v3.oas.annotations.Parameter; |
| 9 | 9 | import io.swagger.v3.oas.annotations.Operation; |
| 10 | 10 | |
| 11 | -import jakarta.validation.constraints.*; | |
| 12 | 11 | import jakarta.validation.*; |
| 13 | 12 | import jakarta.servlet.http.*; |
| 14 | 13 | import java.util.*; |
| ... | ... | @@ -23,6 +22,7 @@ import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; |
| 23 | 22 | import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; |
| 24 | 23 | |
| 25 | 24 | import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; |
| 25 | +import com.fhs.core.trans.anno.TransMethodResult; | |
| 26 | 26 | import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; |
| 27 | 27 | |
| 28 | 28 | import com.zteits.urbanops.module.garden.controller.admin.oldtreeschangelog.vo.*; |
| ... | ... | @@ -75,6 +75,7 @@ public class OldtreesChangeLogController { |
| 75 | 75 | @Operation(summary = "获得古树名木修改记录") |
| 76 | 76 | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| 77 | 77 | @PreAuthorize("@ss.hasPermission('garden:oldtrees-change-log:query')") |
| 78 | + @TransMethodResult | |
| 78 | 79 | public CommonResult<OldtreesChangeLogRespVO> getOldtreesChangeLog(@RequestParam("id") String id) { |
| 79 | 80 | OldtreesChangeLogDO oldtreesChangeLog = oldtreesChangeLogService.getOldtreesChangeLog(id); |
| 80 | 81 | return success(BeanUtils.toBean(oldtreesChangeLog, OldtreesChangeLogRespVO.class)); |
| ... | ... | @@ -83,6 +84,7 @@ public class OldtreesChangeLogController { |
| 83 | 84 | @GetMapping({"/page","/list"}) |
| 84 | 85 | @Operation(summary = "查询古树名木修改记录列表") |
| 85 | 86 | @PreAuthorize("@ss.hasPermission('garden:oldtrees-change-log:query')") |
| 87 | + @TransMethodResult | |
| 86 | 88 | public CommonResult<PageResult<OldtreesChangeLogRespVO>> getOldtreesChangeLogPage(@Valid OldtreesChangeLogPageReqVO pageReqVO) { |
| 87 | 89 | PageResult<OldtreesChangeLogDO> pageResult = oldtreesChangeLogService.getOldtreesChangeLogPage(pageReqVO); |
| 88 | 90 | return success(BeanUtils.toBean(pageResult, OldtreesChangeLogRespVO.class)); | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/oldtreeschangelog/vo/OldtreesChangeLogRespVO.java
| 1 | 1 | package com.zteits.urbanops.module.garden.controller.admin.oldtreeschangelog.vo; |
| 2 | 2 | |
| 3 | -import com.baomidou.mybatisplus.annotation.TableField; | |
| 3 | +import com.fasterxml.jackson.annotation.JsonFormat; | |
| 4 | +import com.fasterxml.jackson.databind.annotation.JsonSerialize; | |
| 5 | +import com.fhs.core.trans.anno.Trans; | |
| 6 | +import com.fhs.core.trans.constant.TransType; | |
| 7 | +import com.fhs.core.trans.vo.VO; | |
| 8 | +import com.zteits.urbanops.module.system.dal.dataobject.dept.DeptDO; | |
| 9 | +import com.zteits.urbanops.module.system.dal.dataobject.user.AdminUserDO; | |
| 4 | 10 | import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | 11 | import lombok.*; |
| 6 | 12 | import java.util.*; |
| 7 | 13 | import org.springframework.format.annotation.DateTimeFormat; |
| 8 | 14 | import java.time.LocalDateTime; |
| 9 | 15 | import cn.idev.excel.annotation.*; |
| 16 | +import com.zteits.urbanops.framework.common.util.json.databind.LocalDateTimeStringSerializer; | |
| 17 | + | |
| 18 | +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 19 | +import static com.zteits.urbanops.framework.common.util.date.DateUtils.TIME_ZONE_DEFAULT; | |
| 10 | 20 | |
| 11 | 21 | @Schema(description = "管理后台 - 古树名木修改记录 Response VO") |
| 12 | 22 | @Data |
| 13 | 23 | @ExcelIgnoreUnannotated |
| 14 | -public class OldtreesChangeLogRespVO { | |
| 24 | +public class OldtreesChangeLogRespVO implements VO { | |
| 15 | 25 | |
| 16 | 26 | @Schema(description = "id", example = "148") |
| 17 | 27 | @ExcelProperty("id") |
| ... | ... | @@ -39,6 +49,7 @@ public class OldtreesChangeLogRespVO { |
| 39 | 49 | |
| 40 | 50 | @Schema(description = "养护单位") |
| 41 | 51 | @ExcelProperty("养护单位") |
| 52 | + @Trans(type = TransType.SIMPLE, target = DeptDO.class, fields = "name",ref = "maintainunit") | |
| 42 | 53 | private String maintainunit; |
| 43 | 54 | |
| 44 | 55 | @Schema(description = "权属分类--数据字典:专业绿地和单位(居住区)") |
| ... | ... | @@ -165,21 +176,33 @@ public class OldtreesChangeLogRespVO { |
| 165 | 176 | @ExcelProperty("负责人电话") |
| 166 | 177 | private String responsibleuserphone; |
| 167 | 178 | |
| 179 | + @Trans(type = TransType.SIMPLE, target = AdminUserDO.class, fields = "nickname", ref = "createbyName") | |
| 180 | + private Long createby; | |
| 181 | + | |
| 168 | 182 | @Schema(description = "创建者") |
| 169 | 183 | @ExcelProperty("创建者") |
| 170 | - private String createby; | |
| 184 | + private String createbyName; | |
| 171 | 185 | |
| 172 | 186 | @Schema(description = "创建时间") |
| 173 | 187 | @ExcelProperty("创建时间") |
| 188 | + @JsonSerialize(using = LocalDateTimeStringSerializer.class) | |
| 189 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 190 | + @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) | |
| 174 | 191 | private LocalDateTime createtime; |
| 175 | 192 | |
| 193 | + @Trans(type = TransType.SIMPLE, target = AdminUserDO.class, fields = "nickname", ref = "updatebyName") | |
| 194 | + private Long updateby; | |
| 195 | + | |
| 176 | 196 | @Schema(description = "更新者") |
| 177 | 197 | @ExcelProperty("更新者") |
| 178 | - private String updateby; | |
| 198 | + private String updatebyName; | |
| 179 | 199 | |
| 180 | 200 | @Schema(description = "更新时间") |
| 181 | 201 | @ExcelProperty("更新时间") |
| 182 | - private String updatetime; | |
| 202 | + @JsonSerialize(using = LocalDateTimeStringSerializer.class) | |
| 203 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 204 | + @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) | |
| 205 | + private LocalDateTime updatetime; | |
| 183 | 206 | |
| 184 | 207 | private List<String> treeImgList; |
| 185 | 208 | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/road/RoadController.java
| ... | ... | @@ -75,8 +75,7 @@ public class RoadController { |
| 75 | 75 | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| 76 | 76 | @PreAuthorize("@ss.hasPermission('garden:road:query')") |
| 77 | 77 | public CommonResult<RoadRespVO> getRoad(@RequestParam("id") Long id) { |
| 78 | - RoadDO road = roadService.getRoad(id); | |
| 79 | - return success(BeanUtils.toBean(road, RoadRespVO.class)); | |
| 78 | + return success(roadService.getRoad(id)); | |
| 80 | 79 | } |
| 81 | 80 | |
| 82 | 81 | @GetMapping("/page") | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/road/vo/RoadSaveReqVO.java
| ... | ... | @@ -11,7 +11,8 @@ public class RoadSaveReqVO { |
| 11 | 11 | |
| 12 | 12 | |
| 13 | 13 | @Schema(description = "道路名称", example = "赵六") |
| 14 | - @Length(max = 128) | |
| 14 | + @NotEmpty(message = "道路名称不能为空") | |
| 15 | + @Size(min=2, max = 128, message = "道路名称长度") | |
| 15 | 16 | private String roadName; |
| 16 | 17 | |
| 17 | 18 | @Schema(description = "街道ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11139") |
| ... | ... | @@ -31,6 +32,7 @@ public class RoadSaveReqVO { |
| 31 | 32 | private Integer levelId; |
| 32 | 33 | |
| 33 | 34 | @Schema(description = "道路属性") |
| 35 | + @Size(min=2, max = 50) | |
| 34 | 36 | private String roadAttr; |
| 35 | 37 | |
| 36 | 38 | @Schema(description = "道路方位 W-西 E-东 N-北 S-南 参考字典roadDirection", requiredMode = Schema.RequiredMode.REQUIRED) |
| ... | ... | @@ -39,18 +41,22 @@ public class RoadSaveReqVO { |
| 39 | 41 | |
| 40 | 42 | @Schema(description = "行道树绿化面积", requiredMode = Schema.RequiredMode.REQUIRED) |
| 41 | 43 | @NotEmpty(message = "行道树绿化面积不能为空") |
| 44 | + @Size(min=2, max = 50) | |
| 42 | 45 | private String greenBeltTreeArea; |
| 43 | 46 | |
| 44 | 47 | @Schema(description = "绿化带面积", requiredMode = Schema.RequiredMode.REQUIRED) |
| 45 | 48 | @NotEmpty(message = "绿化带面积不能为空") |
| 49 | + @Size(min=2, max = 50) | |
| 46 | 50 | private String greenBeltArea; |
| 47 | 51 | |
| 48 | 52 | @Schema(description = "总绿化带面积", requiredMode = Schema.RequiredMode.REQUIRED) |
| 49 | 53 | @NotEmpty(message = "总绿化带面积不能为空") |
| 54 | + @Size(min=2, max = 50) | |
| 50 | 55 | private String totalArea; |
| 51 | 56 | |
| 52 | 57 | @Schema(description = "行道树(棵)面积", requiredMode = Schema.RequiredMode.REQUIRED) |
| 53 | 58 | @NotEmpty(message = "行道树(棵)面积不能为空") |
| 59 | + @Size(min=2, max = 50) | |
| 54 | 60 | private String treeArea; |
| 55 | 61 | |
| 56 | 62 | @Schema(description = "起点经度", requiredMode = Schema.RequiredMode.REQUIRED) | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/tree/TreeController.java
| 1 | 1 | package com.zteits.urbanops.module.garden.controller.admin.tree; |
| 2 | 2 | |
| 3 | +import com.fhs.core.trans.anno.TransMethodResult; | |
| 3 | 4 | import com.zteits.urbanops.framework.dict.core.DictFrameworkUtils; |
| 4 | 5 | import com.zteits.urbanops.framework.security.core.LoginUser; |
| 5 | 6 | import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; |
| ... | ... | @@ -89,6 +90,7 @@ public class TreeController { |
| 89 | 90 | @Operation(summary = "获得一树一档案") |
| 90 | 91 | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| 91 | 92 | @PreAuthorize("@ss.hasPermission('garden:tree:query')") |
| 93 | + @TransMethodResult | |
| 92 | 94 | public CommonResult<TreeRespVO> getTree(@RequestParam("id") Long id) { |
| 93 | 95 | TreeDO tree = treeService.getTree(id); |
| 94 | 96 | return success(BeanUtils.toBean(tree, TreeRespVO.class)); |
| ... | ... | @@ -142,20 +144,17 @@ public class TreeController { |
| 142 | 144 | |
| 143 | 145 | private void fillDictData(List<TreeDO> list) { |
| 144 | 146 | for (TreeDO gardenTree : list) { |
| 145 | - String maintainUnit = DictFrameworkUtils.parseDictDataValue("maintain_unit", gardenTree.getMaintainunit()); | |
| 146 | - gardenTree.setMaintainunit(maintainUnit); | |
| 147 | - | |
| 148 | - String street = DictFrameworkUtils.parseDictDataValue("street_belong", gardenTree.getStreet()); | |
| 147 | + String street = DictFrameworkUtils.parseDictDataLabel("street_belong", gardenTree.getStreet()); | |
| 149 | 148 | gardenTree.setStreet(street); |
| 150 | 149 | |
| 151 | - String ownership = DictFrameworkUtils.parseDictDataValue("tree_ownership", gardenTree.getOldtreeownership()); | |
| 150 | + String ownership = DictFrameworkUtils.parseDictDataLabel("tree_ownership", gardenTree.getOldtreeownership()); | |
| 152 | 151 | gardenTree.setOldtreeownership(ownership); |
| 153 | 152 | |
| 154 | - String growthVigor = DictFrameworkUtils.parseDictDataValue("growth_vigor", gardenTree.getGrowthvigor()); | |
| 153 | + String growthVigor = DictFrameworkUtils.parseDictDataLabel("growth_vigor", gardenTree.getGrowthvigor()); | |
| 155 | 154 | gardenTree.setGrowthvigor(growthVigor); |
| 156 | - String treeLevel = DictFrameworkUtils.parseDictDataValue("tree_level", gardenTree.getTreelevel()); | |
| 155 | + String treeLevel = DictFrameworkUtils.parseDictDataLabel("tree_level", gardenTree.getTreelevel()); | |
| 157 | 156 | gardenTree.setTreelevel(treeLevel); |
| 158 | - String dataState = DictFrameworkUtils.parseDictDataValue("data_state", gardenTree.getDatastate()); | |
| 157 | + String dataState = DictFrameworkUtils.parseDictDataLabel("data_state", gardenTree.getDatastate()); | |
| 159 | 158 | gardenTree.setDatastate(dataState); |
| 160 | 159 | } |
| 161 | 160 | } | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/tree/vo/TreeRespVO.java
| 1 | 1 | package com.zteits.urbanops.module.garden.controller.admin.tree.vo; |
| 2 | 2 | |
| 3 | 3 | import com.baomidou.mybatisplus.annotation.TableField; |
| 4 | +import com.fasterxml.jackson.annotation.JsonFormat; | |
| 5 | +import com.fasterxml.jackson.databind.annotation.JsonSerialize; | |
| 4 | 6 | import com.fhs.core.trans.anno.Trans; |
| 5 | 7 | import com.fhs.core.trans.constant.TransType; |
| 8 | +import com.zteits.urbanops.framework.common.util.json.databind.LocalDateTimeStringSerializer; | |
| 6 | 9 | import com.zteits.urbanops.module.system.dal.dataobject.dept.DeptDO; |
| 10 | +import com.zteits.urbanops.module.system.dal.dataobject.user.AdminUserDO; | |
| 7 | 11 | import io.swagger.v3.oas.annotations.media.Schema; |
| 8 | 12 | import lombok.*; |
| 9 | 13 | import java.util.*; |
| ... | ... | @@ -11,13 +15,16 @@ import org.springframework.format.annotation.DateTimeFormat; |
| 11 | 15 | import java.time.LocalDateTime; |
| 12 | 16 | import cn.idev.excel.annotation.*; |
| 13 | 17 | |
| 18 | +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 19 | +import static com.zteits.urbanops.framework.common.util.date.DateUtils.TIME_ZONE_DEFAULT; | |
| 20 | + | |
| 14 | 21 | @Schema(description = "管理后台 - 一树一档案 Response VO") |
| 15 | 22 | @Data |
| 16 | 23 | @ExcelIgnoreUnannotated |
| 17 | 24 | public class TreeRespVO { |
| 18 | 25 | |
| 19 | 26 | @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "28236") |
| 20 | - @ExcelProperty("id") | |
| 27 | +// @ExcelProperty("id") | |
| 21 | 28 | private Long id; |
| 22 | 29 | |
| 23 | 30 | @Schema(description = "编号") |
| ... | ... | @@ -37,7 +44,7 @@ public class TreeRespVO { |
| 37 | 44 | private String treeheight; |
| 38 | 45 | |
| 39 | 46 | @Schema(description = "冠幅") |
| 40 | - @ExcelProperty("冠幅") | |
| 47 | +// @ExcelProperty("冠幅") | |
| 41 | 48 | private String canopy; |
| 42 | 49 | |
| 43 | 50 | @Schema(description = "胸径") |
| ... | ... | @@ -45,11 +52,11 @@ public class TreeRespVO { |
| 45 | 52 | private String dbh; |
| 46 | 53 | |
| 47 | 54 | @Schema(description = "生长势--数据字典:正常,衰弱,濒危,死亡") |
| 48 | - @ExcelProperty("生长势--数据字典:正常,衰弱,濒危,死亡") | |
| 55 | + @ExcelProperty("生长势") | |
| 49 | 56 | private String growthvigor; |
| 50 | 57 | |
| 51 | 58 | @Schema(description = "级别--数据字典:一级、两级") |
| 52 | - @ExcelProperty("级别--数据字典:一级、两级") | |
| 59 | + @ExcelProperty("级别") | |
| 53 | 60 | private String treelevel; |
| 54 | 61 | |
| 55 | 62 | @Schema(description = "经度") |
| ... | ... | @@ -61,24 +68,19 @@ public class TreeRespVO { |
| 61 | 68 | private String latitude; |
| 62 | 69 | |
| 63 | 70 | @Schema(description = "所在地") |
| 64 | - @ExcelProperty("所在地") | |
| 71 | +// @ExcelProperty("所在地") | |
| 65 | 72 | private String location; |
| 66 | 73 | |
| 67 | 74 | @Schema(description = "养护单位") |
| 68 | - @Trans(type = TransType.SIMPLE, targetClassName = "com.zteits.urbanops.module.system.dal.dataobject.dept.DeptDO", | |
| 69 | - key = "id", fields = "name", ref = "maintainUnitName") | |
| 70 | - private String maintainunit; | |
| 71 | - | |
| 72 | - @Schema(description = "养护单位名称") | |
| 73 | 75 | @ExcelProperty("养护单位") |
| 74 | - private String maintainUnitName; | |
| 76 | + private String maintainunit; | |
| 75 | 77 | |
| 76 | 78 | @Schema(description = "管护单位") |
| 77 | 79 | @ExcelProperty("管护单位") |
| 78 | 80 | private String managedutyunit; |
| 79 | 81 | |
| 80 | 82 | @Schema(description = "道路id") |
| 81 | - @ExcelProperty("道路id") | |
| 83 | +// @ExcelProperty("道路id") | |
| 82 | 84 | private Long road; |
| 83 | 85 | |
| 84 | 86 | @Schema(description = "所属街道") |
| ... | ... | @@ -86,11 +88,11 @@ public class TreeRespVO { |
| 86 | 88 | private String street; |
| 87 | 89 | |
| 88 | 90 | @Schema(description = "权属分类--数据字典:专业绿地和单位(居住区)") |
| 89 | - @ExcelProperty("权属分类--数据字典:专业绿地和单位(居住区)") | |
| 91 | + @ExcelProperty("权属分类") | |
| 90 | 92 | private String oldtreeownership; |
| 91 | 93 | |
| 92 | 94 | @Schema(description = "数据状态(已更新、未更新)") |
| 93 | - @ExcelProperty("数据状态(已更新、未更新)") | |
| 95 | +// @ExcelProperty("数据状态(已更新、未更新)") | |
| 94 | 96 | private String datastate; |
| 95 | 97 | |
| 96 | 98 | @Schema(description = "估测树龄") |
| ... | ... | @@ -137,28 +139,40 @@ public class TreeRespVO { |
| 137 | 139 | @ExcelProperty("古树照片五") |
| 138 | 140 | private String treephotofive; |
| 139 | 141 | |
| 140 | - @Schema(description = "创建者") | |
| 141 | - @ExcelProperty("创建者") | |
| 142 | - private String createby; | |
| 142 | + @Trans(type = TransType.SIMPLE, target = AdminUserDO.class, fields = "nickname", ref = "createbyName") | |
| 143 | + private Long createby; | |
| 143 | 144 | |
| 144 | - @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 145 | - @ExcelProperty("创建时间") | |
| 145 | + @Schema(description = "创建者") | |
| 146 | +// @ExcelProperty("创建者") | |
| 147 | + private String createbyName; | |
| 148 | + | |
| 149 | + @Schema(description = "创建时间") | |
| 150 | +// @ExcelProperty("创建时间") | |
| 151 | + @JsonSerialize(using = LocalDateTimeStringSerializer.class) | |
| 152 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 153 | + @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) | |
| 146 | 154 | private LocalDateTime createtime; |
| 147 | 155 | |
| 148 | - @Schema(description = "更新者") | |
| 149 | - @ExcelProperty("更新者") | |
| 150 | - private String updateby; | |
| 156 | + @Trans(type = TransType.SIMPLE, target = AdminUserDO.class, fields = "nickname", ref = "updatebyName") | |
| 157 | + private Long updateby; | |
| 151 | 158 | |
| 152 | - @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 153 | - @ExcelProperty("更新时间") | |
| 159 | + @Schema(description = "更新者") | |
| 160 | +// @ExcelProperty("更新者") | |
| 161 | + private String updatebyName; | |
| 162 | + | |
| 163 | + @Schema(description = "更新时间") | |
| 164 | +// @ExcelProperty("更新时间") | |
| 165 | + @JsonSerialize(using = LocalDateTimeStringSerializer.class) | |
| 166 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 167 | + @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) | |
| 154 | 168 | private LocalDateTime updatetime; |
| 155 | 169 | |
| 156 | 170 | @Schema(description = "备注", example = "你说的对") |
| 157 | - @ExcelProperty("备注") | |
| 171 | +// @ExcelProperty("备注") | |
| 158 | 172 | private String remark; |
| 159 | 173 | |
| 160 | 174 | @Schema(description = "部门id", requiredMode = Schema.RequiredMode.REQUIRED, example = "17101") |
| 161 | - @ExcelProperty("部门id") | |
| 175 | +// @ExcelProperty("部门id") | |
| 162 | 176 | private Long deptId; |
| 163 | 177 | |
| 164 | 178 | private List<String> treeImgList; | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/tree/vo/TreeSaveReqVO.java
| 1 | 1 | package com.zteits.urbanops.module.garden.controller.admin.tree.vo; |
| 2 | 2 | |
| 3 | +import com.zteits.urbanops.module.garden.dal.dataobject.tree.TreeDO; | |
| 3 | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | 5 | import lombok.*; |
| 5 | 6 | import java.util.*; |
| 6 | 7 | import jakarta.validation.constraints.*; |
| 7 | 8 | import org.springframework.format.annotation.DateTimeFormat; |
| 9 | +import org.springframework.util.CollectionUtils; | |
| 10 | +import org.springframework.util.StringUtils; | |
| 11 | + | |
| 8 | 12 | import java.time.LocalDateTime; |
| 9 | 13 | |
| 10 | 14 | @Schema(description = "管理后台 - 一树一档案新增/修改 Request VO") |
| ... | ... | @@ -121,5 +125,47 @@ public class TreeSaveReqVO { |
| 121 | 125 | |
| 122 | 126 | private List<String> treeImgList; |
| 123 | 127 | |
| 128 | + public TreeSaveReqVO imgToDomain(){ | |
| 129 | + if (!CollectionUtils.isEmpty(treeImgList)) { | |
| 130 | + if (treeImgList.size() > 0) { | |
| 131 | + this.treephotoone = treeImgList.get(0); | |
| 132 | + } | |
| 133 | + if (treeImgList.size() > 1) { | |
| 134 | + this.treephototwo = treeImgList.get(1); | |
| 135 | + } | |
| 136 | + if (treeImgList.size() > 2) { | |
| 137 | + this.treephotothree = treeImgList.get(2); | |
| 138 | + } | |
| 139 | + if (treeImgList.size() > 3) { | |
| 140 | + this.treephotofour = treeImgList.get(3); | |
| 141 | + } | |
| 142 | + if (treeImgList.size() > 4) { | |
| 143 | + this.treephotofive = treeImgList.get(4); | |
| 144 | + } | |
| 145 | + } | |
| 146 | + return this; | |
| 147 | + } | |
| 148 | + public TreeSaveReqVO domainToImg(){ | |
| 149 | + if (CollectionUtils.isEmpty(treeImgList)) { | |
| 150 | + treeImgList = new ArrayList<>(); | |
| 151 | + } | |
| 152 | + if (!StringUtils.isEmpty(treephotoone)) { | |
| 153 | + treeImgList.add(treephotoone); | |
| 154 | + } | |
| 155 | + if (!StringUtils.isEmpty(treephototwo)) { | |
| 156 | + treeImgList.add(treephototwo); | |
| 157 | + } | |
| 158 | + if (!StringUtils.isEmpty(treephotothree)) { | |
| 159 | + treeImgList.add(treephotothree); | |
| 160 | + } | |
| 161 | + if (!StringUtils.isEmpty(treephotofour)) { | |
| 162 | + treeImgList.add(treephotofour); | |
| 163 | + } | |
| 164 | + if (!StringUtils.isEmpty(treephotofive)) { | |
| 165 | + treeImgList.add(treephotofive); | |
| 166 | + } | |
| 167 | + return this; | |
| 168 | + } | |
| 169 | + | |
| 124 | 170 | |
| 125 | 171 | } |
| 126 | 172 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/treechangelog/TreeChangeLogController.java
| 1 | 1 | package com.zteits.urbanops.module.garden.controller.admin.treechangelog; |
| 2 | 2 | |
| 3 | +import com.fhs.core.trans.anno.TransMethodResult; | |
| 3 | 4 | import org.springframework.web.bind.annotation.*; |
| 4 | 5 | import jakarta.annotation.Resource; |
| 5 | 6 | import org.springframework.validation.annotation.Validated; |
| ... | ... | @@ -75,6 +76,7 @@ public class TreeChangeLogController { |
| 75 | 76 | @Operation(summary = "获得一树一档案修改记录") |
| 76 | 77 | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| 77 | 78 | @PreAuthorize("@ss.hasPermission('garden:tree-change-log:query')") |
| 79 | + @TransMethodResult | |
| 78 | 80 | public CommonResult<TreeChangeLogRespVO> getTreeChangeLog(@RequestParam("id") Long id) { |
| 79 | 81 | TreeChangeLogDO treeChangeLog = treeChangeLogService.getTreeChangeLog(id); |
| 80 | 82 | return success(BeanUtils.toBean(treeChangeLog, TreeChangeLogRespVO.class)); | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/treechangelog/vo/TreeChangeLogRespVO.java
| 1 | -package com.zteits.urbanops.module.garden.controller.admin.treechangelog.vo; | |
| 2 | - | |
| 3 | -import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | -import lombok.*; | |
| 5 | -import java.util.*; | |
| 6 | -import org.springframework.format.annotation.DateTimeFormat; | |
| 7 | -import java.time.LocalDateTime; | |
| 8 | -import cn.idev.excel.annotation.*; | |
| 9 | - | |
| 10 | -@Schema(description = "管理后台 - 一树一档案修改记录 Response VO") | |
| 11 | -@Data | |
| 12 | -@ExcelIgnoreUnannotated | |
| 13 | -public class TreeChangeLogRespVO { | |
| 14 | - | |
| 15 | - @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "3528") | |
| 16 | - @ExcelProperty("id") | |
| 17 | - private Long id; | |
| 18 | - | |
| 19 | - @Schema(description = "garden_tree 的主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "26527") | |
| 20 | - @ExcelProperty("garden_tree 的主键") | |
| 21 | - private Long treeid; | |
| 22 | - | |
| 23 | - @Schema(description = "编号") | |
| 24 | - @ExcelProperty("编号") | |
| 25 | - private String treenumber; | |
| 26 | - | |
| 27 | - @Schema(description = "拉丁名", example = "赵六") | |
| 28 | - @ExcelProperty("拉丁名") | |
| 29 | - private String latinname; | |
| 30 | - | |
| 31 | - @Schema(description = "树种", example = "1") | |
| 32 | - @ExcelProperty("树种") | |
| 33 | - private String treetype; | |
| 34 | - | |
| 35 | - @Schema(description = "树高") | |
| 36 | - @ExcelProperty("树高") | |
| 37 | - private String treeheight; | |
| 38 | - | |
| 39 | - @Schema(description = "冠幅") | |
| 40 | - @ExcelProperty("冠幅") | |
| 41 | - private String canopy; | |
| 42 | - | |
| 43 | - @Schema(description = "胸径") | |
| 44 | - @ExcelProperty("胸径") | |
| 45 | - private String dbh; | |
| 46 | - | |
| 47 | - @Schema(description = "生长势--数据字典:正常,衰弱,濒危,死亡") | |
| 48 | - @ExcelProperty("生长势--数据字典:正常,衰弱,濒危,死亡") | |
| 49 | - private String growthvigor; | |
| 50 | - | |
| 51 | - @Schema(description = "级别--数据字典:一级、两级") | |
| 52 | - @ExcelProperty("级别--数据字典:一级、两级") | |
| 53 | - private String treelevel; | |
| 54 | - | |
| 55 | - @Schema(description = "经度") | |
| 56 | - @ExcelProperty("经度") | |
| 57 | - private String longitude; | |
| 58 | - | |
| 59 | - @Schema(description = "纬度") | |
| 60 | - @ExcelProperty("纬度") | |
| 61 | - private String latitude; | |
| 62 | - | |
| 63 | - @Schema(description = "所在地") | |
| 64 | - @ExcelProperty("所在地") | |
| 65 | - private String location; | |
| 66 | - | |
| 67 | - @Schema(description = "养护单位") | |
| 68 | - @ExcelProperty("养护单位") | |
| 69 | - private String maintainunit; | |
| 70 | - | |
| 71 | - @Schema(description = "管护单位") | |
| 72 | - @ExcelProperty("管护单位") | |
| 73 | - private String managedutyunit; | |
| 74 | - | |
| 75 | - @Schema(description = "道路id") | |
| 76 | - @ExcelProperty("道路id") | |
| 77 | - private Long road; | |
| 78 | - | |
| 79 | - @Schema(description = "所属街道") | |
| 80 | - @ExcelProperty("所属街道") | |
| 81 | - private String street; | |
| 82 | - | |
| 83 | - @Schema(description = "权属分类--数据字典:专业绿地和单位(居住区)") | |
| 84 | - @ExcelProperty("权属分类--数据字典:专业绿地和单位(居住区)") | |
| 85 | - private String oldtreeownership; | |
| 86 | - | |
| 87 | - @Schema(description = "数据状态(已更新、未更新)") | |
| 88 | - @ExcelProperty("数据状态(已更新、未更新)") | |
| 89 | - private String datastate; | |
| 90 | - | |
| 91 | - @Schema(description = "估测树龄") | |
| 92 | - @ExcelProperty("估测树龄") | |
| 93 | - private String estimationtreeage; | |
| 94 | - | |
| 95 | - @Schema(description = "冠幅东西") | |
| 96 | - @ExcelProperty("冠幅东西") | |
| 97 | - private String canopyeastwest; | |
| 98 | - | |
| 99 | - @Schema(description = "冠幅南北") | |
| 100 | - @ExcelProperty("冠幅南北") | |
| 101 | - private String canopysouthnorth; | |
| 102 | - | |
| 103 | - @Schema(description = "干周") | |
| 104 | - @ExcelProperty("干周") | |
| 105 | - private String weekday; | |
| 106 | - | |
| 107 | - @Schema(description = "生长地点") | |
| 108 | - @ExcelProperty("生长地点") | |
| 109 | - private String growlocation; | |
| 110 | - | |
| 111 | - @Schema(description = "生长环境") | |
| 112 | - @ExcelProperty("生长环境") | |
| 113 | - private String growthenvironment; | |
| 114 | - | |
| 115 | - @Schema(description = "树木照片一") | |
| 116 | - @ExcelProperty("树木照片一") | |
| 117 | - private String treephotoone; | |
| 118 | - | |
| 119 | - @Schema(description = "古树照片二") | |
| 120 | - @ExcelProperty("古树照片二") | |
| 121 | - private String treephototwo; | |
| 122 | - | |
| 123 | - @Schema(description = "古树照片三") | |
| 124 | - @ExcelProperty("古树照片三") | |
| 125 | - private String treephotothree; | |
| 126 | - | |
| 127 | - @Schema(description = "古树照片四") | |
| 128 | - @ExcelProperty("古树照片四") | |
| 129 | - private String treephotofour; | |
| 130 | - | |
| 131 | - @Schema(description = "古树照片五") | |
| 132 | - @ExcelProperty("古树照片五") | |
| 133 | - private String treephotofive; | |
| 134 | - | |
| 135 | - @Schema(description = "创建者") | |
| 136 | - @ExcelProperty("创建者") | |
| 137 | - private String createby; | |
| 138 | - | |
| 139 | - @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 140 | - @ExcelProperty("创建时间") | |
| 141 | - private LocalDateTime createtime; | |
| 142 | - | |
| 143 | - @Schema(description = "更新者") | |
| 144 | - @ExcelProperty("更新者") | |
| 145 | - private String updateby; | |
| 146 | - | |
| 147 | - @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 148 | - @ExcelProperty("更新时间") | |
| 149 | - private LocalDateTime updatetime; | |
| 150 | - | |
| 151 | - @Schema(description = "备注", example = "你猜") | |
| 152 | - @ExcelProperty("备注") | |
| 153 | - private String remark; | |
| 154 | - | |
| 155 | -} | |
| 156 | 1 | \ No newline at end of file |
| 2 | +package com.zteits.urbanops.module.garden.controller.admin.treechangelog.vo; | |
| 3 | + | |
| 4 | +import com.fasterxml.jackson.annotation.JsonFormat; | |
| 5 | +import com.fasterxml.jackson.databind.annotation.JsonSerialize; | |
| 6 | +import com.fhs.core.trans.anno.Trans; | |
| 7 | +import com.fhs.core.trans.constant.TransType; | |
| 8 | +import com.zteits.urbanops.framework.common.util.json.databind.LocalDateTimeStringSerializer; | |
| 9 | +import com.zteits.urbanops.module.system.dal.dataobject.dept.DeptDO; | |
| 10 | +import com.zteits.urbanops.module.system.dal.dataobject.user.AdminUserDO; | |
| 11 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 12 | +import lombok.*; | |
| 13 | +import java.util.*; | |
| 14 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 15 | +import java.time.LocalDateTime; | |
| 16 | +import cn.idev.excel.annotation.*; | |
| 17 | + | |
| 18 | +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 19 | +import static com.zteits.urbanops.framework.common.util.date.DateUtils.TIME_ZONE_DEFAULT; | |
| 20 | + | |
| 21 | +@Schema(description = "管理后台 - 一树一档案修改记录 Response VO") | |
| 22 | +@Data | |
| 23 | +@ExcelIgnoreUnannotated | |
| 24 | +public class TreeChangeLogRespVO { | |
| 25 | + | |
| 26 | + @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "3528") | |
| 27 | + @ExcelProperty("id") | |
| 28 | + private Long id; | |
| 29 | + | |
| 30 | + @Schema(description = "garden_tree 的主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "26527") | |
| 31 | + @ExcelProperty("garden_tree 的主键") | |
| 32 | + private Long treeid; | |
| 33 | + | |
| 34 | + @Schema(description = "编号") | |
| 35 | + @ExcelProperty("编号") | |
| 36 | + private String treenumber; | |
| 37 | + | |
| 38 | + @Schema(description = "拉丁名", example = "赵六") | |
| 39 | + @ExcelProperty("拉丁名") | |
| 40 | + private String latinname; | |
| 41 | + | |
| 42 | + @Schema(description = "树种", example = "1") | |
| 43 | + @ExcelProperty("树种") | |
| 44 | + private String treetype; | |
| 45 | + | |
| 46 | + @Schema(description = "树高") | |
| 47 | + @ExcelProperty("树高") | |
| 48 | + private String treeheight; | |
| 49 | + | |
| 50 | + @Schema(description = "冠幅") | |
| 51 | + @ExcelProperty("冠幅") | |
| 52 | + private String canopy; | |
| 53 | + | |
| 54 | + @Schema(description = "胸径") | |
| 55 | + @ExcelProperty("胸径") | |
| 56 | + private String dbh; | |
| 57 | + | |
| 58 | + @Schema(description = "生长势--数据字典:正常,衰弱,濒危,死亡") | |
| 59 | + @ExcelProperty("生长势--数据字典:正常,衰弱,濒危,死亡") | |
| 60 | + private String growthvigor; | |
| 61 | + | |
| 62 | + @Schema(description = "级别--数据字典:一级、两级") | |
| 63 | + @ExcelProperty("级别--数据字典:一级、两级") | |
| 64 | + private String treelevel; | |
| 65 | + | |
| 66 | + @Schema(description = "经度") | |
| 67 | + @ExcelProperty("经度") | |
| 68 | + private String longitude; | |
| 69 | + | |
| 70 | + @Schema(description = "纬度") | |
| 71 | + @ExcelProperty("纬度") | |
| 72 | + private String latitude; | |
| 73 | + | |
| 74 | + @Schema(description = "所在地") | |
| 75 | + @ExcelProperty("所在地") | |
| 76 | + private String location; | |
| 77 | + | |
| 78 | + @Schema(description = "养护单位") | |
| 79 | + @ExcelProperty("养护单位") | |
| 80 | + @Trans(type = TransType.SIMPLE, target = DeptDO.class, fields = "name",ref = "maintainunit") | |
| 81 | + private String maintainunit; | |
| 82 | + | |
| 83 | + @Schema(description = "管护单位") | |
| 84 | + @ExcelProperty("管护单位") | |
| 85 | + private String managedutyunit; | |
| 86 | + | |
| 87 | + @Schema(description = "道路id") | |
| 88 | + @ExcelProperty("道路id") | |
| 89 | + private Long road; | |
| 90 | + | |
| 91 | + @Schema(description = "所属街道") | |
| 92 | + @ExcelProperty("所属街道") | |
| 93 | + private String street; | |
| 94 | + | |
| 95 | + @Schema(description = "权属分类--数据字典:专业绿地和单位(居住区)") | |
| 96 | + @ExcelProperty("权属分类--数据字典:专业绿地和单位(居住区)") | |
| 97 | + private String oldtreeownership; | |
| 98 | + | |
| 99 | + @Schema(description = "数据状态(已更新、未更新)") | |
| 100 | + @ExcelProperty("数据状态(已更新、未更新)") | |
| 101 | + private String datastate; | |
| 102 | + | |
| 103 | + @Schema(description = "估测树龄") | |
| 104 | + @ExcelProperty("估测树龄") | |
| 105 | + private String estimationtreeage; | |
| 106 | + | |
| 107 | + @Schema(description = "冠幅东西") | |
| 108 | + @ExcelProperty("冠幅东西") | |
| 109 | + private String canopyeastwest; | |
| 110 | + | |
| 111 | + @Schema(description = "冠幅南北") | |
| 112 | + @ExcelProperty("冠幅南北") | |
| 113 | + private String canopysouthnorth; | |
| 114 | + | |
| 115 | + @Schema(description = "干周") | |
| 116 | + @ExcelProperty("干周") | |
| 117 | + private String weekday; | |
| 118 | + | |
| 119 | + @Schema(description = "生长地点") | |
| 120 | + @ExcelProperty("生长地点") | |
| 121 | + private String growlocation; | |
| 122 | + | |
| 123 | + @Schema(description = "生长环境") | |
| 124 | + @ExcelProperty("生长环境") | |
| 125 | + private String growthenvironment; | |
| 126 | + | |
| 127 | + @Schema(description = "树木照片一") | |
| 128 | + @ExcelProperty("树木照片一") | |
| 129 | + private String treephotoone; | |
| 130 | + | |
| 131 | + @Schema(description = "古树照片二") | |
| 132 | + @ExcelProperty("古树照片二") | |
| 133 | + private String treephototwo; | |
| 134 | + | |
| 135 | + @Schema(description = "古树照片三") | |
| 136 | + @ExcelProperty("古树照片三") | |
| 137 | + private String treephotothree; | |
| 138 | + | |
| 139 | + @Schema(description = "古树照片四") | |
| 140 | + @ExcelProperty("古树照片四") | |
| 141 | + private String treephotofour; | |
| 142 | + | |
| 143 | + @Schema(description = "古树照片五") | |
| 144 | + @ExcelProperty("古树照片五") | |
| 145 | + private String treephotofive; | |
| 146 | + | |
| 147 | + @Trans(type = TransType.SIMPLE, target = AdminUserDO.class, fields = "nickname", ref = "createbyName") | |
| 148 | + private Long createby; | |
| 149 | + | |
| 150 | + @Schema(description = "创建者") | |
| 151 | + @ExcelProperty("创建者") | |
| 152 | + private String createbyName; | |
| 153 | + | |
| 154 | + @Schema(description = "创建时间") | |
| 155 | + @ExcelProperty("创建时间") | |
| 156 | + @JsonSerialize(using = LocalDateTimeStringSerializer.class) | |
| 157 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 158 | + @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) | |
| 159 | + private LocalDateTime createtime; | |
| 160 | + | |
| 161 | + @Trans(type = TransType.SIMPLE, target = AdminUserDO.class, fields = "nickname", ref = "updatebyName") | |
| 162 | + private Long updateby; | |
| 163 | + | |
| 164 | + @Schema(description = "更新者") | |
| 165 | + @ExcelProperty("更新者") | |
| 166 | + private String updatebyName; | |
| 167 | + | |
| 168 | + @Schema(description = "更新时间") | |
| 169 | + @ExcelProperty("更新时间") | |
| 170 | + @JsonSerialize(using = LocalDateTimeStringSerializer.class) | |
| 171 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 172 | + @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) | |
| 173 | + private LocalDateTime updatetime; | |
| 174 | + | |
| 175 | + @Schema(description = "备注", example = "你猜") | |
| 176 | + @ExcelProperty("备注") | |
| 177 | + private String remark; | |
| 178 | + | |
| 179 | + private List<String> treeImgList; | |
| 180 | + | |
| 181 | + private List<String> nameplatephotoList; | |
| 182 | + | |
| 183 | +} | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/oldtreeschangelog/OldtreesChangeLogDO.java
| ... | ... | @@ -5,6 +5,7 @@ import java.util.*; |
| 5 | 5 | import java.time.LocalDateTime; |
| 6 | 6 | import com.baomidou.mybatisplus.annotation.*; |
| 7 | 7 | import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; |
| 8 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 8 | 9 | import org.springframework.util.CollectionUtils; |
| 9 | 10 | import org.springframework.util.StringUtils; |
| 10 | 11 | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/oldtreeschangelog/OldtreesChangeLogMapper.java
| ... | ... | @@ -25,6 +25,7 @@ public interface OldtreesChangeLogMapper extends BaseMapperX<OldtreesChangeLogDO |
| 25 | 25 | .selectAs(DeptDO::getName, OldtreesChangeLogDO::getMaintainunit) |
| 26 | 26 | .selectAll(OldtreesChangeLogDO.class) |
| 27 | 27 | .leftJoin(DeptDO.class, DeptDO::getId, OldtreesChangeLogDO::getMaintainunit) |
| 28 | + .eqIfPresent(OldtreesChangeLogDO::getOldtreeid, reqVO.getOldtreeid()) | |
| 28 | 29 | .eqIfPresent(OldtreesChangeLogDO::getFamoustreenumber, reqVO.getFamoustreenumber()) |
| 29 | 30 | .eqIfPresent(OldtreesChangeLogDO::getTreelevel, reqVO.getTreelevel()) |
| 30 | 31 | .eqIfPresent(OldtreesChangeLogDO::getTreetype, reqVO.getTreetype()) | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/inspectionplan/InspectionPlanServiceImpl.java
| ... | ... | @@ -138,7 +138,6 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { |
| 138 | 138 | roleList.add(inspectionPlanRoleDO); |
| 139 | 139 | }); |
| 140 | 140 | /*3.插入巡查计划明细*/ |
| 141 | - | |
| 142 | 141 | for (PeriodResult periodResult : calculate) { |
| 143 | 142 | InspectionPlanDetailDO entity = getInspectionPlanDetailDO(batchNo, createReqVO, roadReqVO, now); |
| 144 | 143 | ThreadUtil.sleep(2); | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/maintainplan/MaintainPlanService.java
| ... | ... | @@ -29,7 +29,7 @@ public interface MaintainPlanService { |
| 29 | 29 | * |
| 30 | 30 | * @param updateReqVO 更新信息 |
| 31 | 31 | */ |
| 32 | - void updateMaintainPlan(@Valid MaintainPlanSaveReqVO updateReqVO); | |
| 32 | + void updateMaintainPlan(@Valid MaintainPlanUpdateReqVO updateReqVO); | |
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * 删除养护计划汇总 | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/maintainplan/MaintainPlanServiceImpl.java
| ... | ... | @@ -7,7 +7,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| 7 | 7 | import com.zteits.urbanops.framework.common.pojo.CommonResult; |
| 8 | 8 | import com.zteits.urbanops.framework.dict.core.DictFrameworkUtils; |
| 9 | 9 | import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; |
| 10 | +import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanDO; | |
| 10 | 11 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanDetailDO; |
| 12 | +import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanRoleDO; | |
| 11 | 13 | import com.zteits.urbanops.module.garden.dal.dataobject.maintainplan.MaintainPlanDetailDO; |
| 12 | 14 | import com.zteits.urbanops.module.garden.dal.dataobject.maintainplan.MaintainPlanRoleDO; |
| 13 | 15 | import com.zteits.urbanops.module.garden.dal.mysql.maintainplan.MaintainPlanDetailMapper; |
| ... | ... | @@ -71,24 +73,20 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { |
| 71 | 73 | @Resource |
| 72 | 74 | private RoleApi roleApi; |
| 73 | 75 | |
| 74 | - @Resource | |
| 75 | - private MaintainPlanRoleMapper MaintainPlanRoleMapper; | |
| 76 | - | |
| 77 | 76 | @Override |
| 78 | 77 | public CommonResult<Integer> createMaintainPlan(MaintainPlanSaveReqVO createReqVO) { |
| 79 | 78 | //存在性校验 |
| 80 | 79 | validateMaintainPlanExists(createReqVO); |
| 81 | 80 | LocalDateTime now = LocalDateTime.now(); |
| 82 | - String userId = SecurityFrameworkUtils.getLoginUserId()+""; | |
| 81 | + String userId = SecurityFrameworkUtils.getLoginUserId() + ""; | |
| 83 | 82 | String userName = SecurityFrameworkUtils.getLoginUserNickname(); |
| 84 | 83 | String rateValue; |
| 85 | 84 | if (createReqVO.getRateValue().contains("/")) { |
| 86 | 85 | rateValue = createReqVO.getRateValue().trim(); |
| 87 | 86 | } else { |
| 88 | - rateValue = createReqVO.getRateValue().trim()+"/1"; | |
| 87 | + rateValue = createReqVO.getRateValue().trim() + "/1"; | |
| 89 | 88 | } |
| 90 | 89 | //计算开始和计算时间 在间隔周期下每天的次数 |
| 91 | - //计算开始和计算时间 在间隔周期下每天的次数 | |
| 92 | 90 | List<PeriodResult> calculate = TimeIntervalFrequencyUtil.calculate(createReqVO.getBeginTime().toString(), createReqVO.getEndTime().toString(), rateValue, createReqVO.getCycleId()); |
| 93 | 91 | if (CollectionUtils.isEmpty(calculate)) { |
| 94 | 92 | log.warn("获取两个时间之间间隔天数错误"); |
| ... | ... | @@ -96,8 +94,6 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { |
| 96 | 94 | } |
| 97 | 95 | //计算计划次数 |
| 98 | 96 | Integer planNum = calculate.size(); |
| 99 | - | |
| 100 | - | |
| 101 | 97 | //巡检计划list |
| 102 | 98 | List<MaintainPlanDO> maintainPlanList = new ArrayList<>(); |
| 103 | 99 | //角色列表 |
| ... | ... | @@ -107,7 +103,7 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { |
| 107 | 103 | //按照道路创建计划 |
| 108 | 104 | createReqVO.getRoadListReqVO().forEach(roadReqVO -> { |
| 109 | 105 | MaintainPlanDO maintainPlan = BeanUtils.toBean(createReqVO, MaintainPlanDO.class); |
| 110 | - String batchNo = "BN" + System.currentTimeMillis() + RandomUtil.randomInt(10000)+roadReqVO.getRoadId(); | |
| 106 | + String batchNo = "BN" + System.currentTimeMillis() + RandomUtil.randomInt(10000) + roadReqVO.getRoadId(); | |
| 111 | 107 | maintainPlan.setBatchNo(batchNo); |
| 112 | 108 | maintainPlan.setPlanFinishNum(0); |
| 113 | 109 | maintainPlan.setFinishState(FinishStateEnum.NOT_FINISHED.getStatus()); |
| ... | ... | @@ -124,8 +120,8 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { |
| 124 | 120 | maintainPlan.setRoadName(roadReqVO.getRoadName()); |
| 125 | 121 | //计划属性label |
| 126 | 122 | String planAttrLabel = DictFrameworkUtils.parseDictDataLabel(PlanConstants.GARDEN_PLAN_ATTR_REDIS_KEY, createReqVO.getPlanAttr()); |
| 127 | - String planTypeIdLabel = DictFrameworkUtils.parseDictDataLabel(PlanConstants.MAINTAIN_TYPE, createReqVO.getPlanTypeId()); | |
| 128 | - String planNameSuffix = StringUtil.isNotEmpty(createReqVO.getPlanNameSuffix()) ? createReqVO.getPlanNameSuffix() :""; | |
| 123 | + String planTypeIdLabel = DictFrameworkUtils.parseDictDataLabel(PlanConstants.INSPECTION_MAINTAIN_TYPE, createReqVO.getPlanTypeId()); | |
| 124 | + String planNameSuffix = StringUtil.isNotEmpty(createReqVO.getPlanNameSuffix()) ? createReqVO.getPlanNameSuffix() : ""; | |
| 129 | 125 | maintainPlan.setPlanName(roadReqVO.getRoadName() + planAttrLabel + planTypeIdLabel + planNameSuffix); |
| 130 | 126 | maintainPlanList.add(maintainPlan); |
| 131 | 127 | /*2.插入角色*/ |
| ... | ... | @@ -162,11 +158,11 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { |
| 162 | 158 | |
| 163 | 159 | private MaintainPlanDetailDO getMaintainPlanDetailDO(String batchNo, MaintainPlanSaveReqVO saveReqVO, |
| 164 | 160 | MaintainPlanRoadReqVO roadReqVO, LocalDateTime now) { |
| 165 | - String userId = SecurityFrameworkUtils.getLoginUserId()+""; | |
| 161 | + String userId = SecurityFrameworkUtils.getLoginUserId() + ""; | |
| 166 | 162 | String userName = SecurityFrameworkUtils.getLoginUserNickname(); |
| 167 | 163 | MaintainPlanDetailDO entity = new MaintainPlanDetailDO(); |
| 168 | 164 | entity.setBatchNo(batchNo); |
| 169 | - entity.setPlanNo("Y" + DateUtil.format(new Date(), "yyyyMMddHHmmssSSS") + RandomUtil.randomInt(1000)); | |
| 165 | + entity.setPlanNo("Y" + System.currentTimeMillis() + RandomUtil.randomInt(1000)); | |
| 170 | 166 | entity.setBusiLine(saveReqVO.getBusiLine()); |
| 171 | 167 | entity.setCompanyId(saveReqVO.getCompanyId()); |
| 172 | 168 | entity.setDeptId(roadReqVO.getDeptId()); |
| ... | ... | @@ -182,34 +178,41 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { |
| 182 | 178 | } |
| 183 | 179 | |
| 184 | 180 | @Override |
| 185 | - public void updateMaintainPlan(MaintainPlanSaveReqVO updateReqVO) { | |
| 181 | + public void updateMaintainPlan(MaintainPlanUpdateReqVO updateReqVO) { | |
| 186 | 182 | // 校验存在 |
| 187 | - //validateMaintainPlanExists(updateReqVO.getId()); | |
| 183 | + validateMaintainPlanExists(updateReqVO.getId()); | |
| 188 | 184 | // 更新 |
| 189 | 185 | MaintainPlanDO updateObj = BeanUtils.toBean(updateReqVO, MaintainPlanDO.class); |
| 190 | 186 | maintainPlanMapper.updateById(updateObj); |
| 191 | 187 | } |
| 192 | 188 | |
| 189 | + private void validateMaintainPlanExists(Long id) { | |
| 190 | + if (maintainPlanMapper.selectById(id) == null) { | |
| 191 | + throw exception(INSPECTION_PLAN_NOT_EXISTS); | |
| 192 | + } | |
| 193 | + } | |
| 194 | + | |
| 195 | + | |
| 193 | 196 | @Override |
| 194 | 197 | public void deleteMaintainPlan(Long id) { |
| 195 | 198 | // 校验存在 |
| 196 | - //validateMaintainPlanExists(id); | |
| 199 | + validateMaintainPlanExists(id); | |
| 197 | 200 | // 删除 |
| 198 | 201 | maintainPlanMapper.deleteById(id); |
| 199 | 202 | } |
| 200 | 203 | |
| 201 | 204 | @Override |
| 202 | - public void deleteMaintainPlanListByIds(List<Long> ids) { | |
| 205 | + public void deleteMaintainPlanListByIds(List<Long> ids) { | |
| 203 | 206 | // 删除 |
| 204 | 207 | maintainPlanMapper.deleteByIds(ids); |
| 205 | - } | |
| 208 | + } | |
| 206 | 209 | |
| 207 | 210 | |
| 208 | 211 | private void validateMaintainPlanExists(MaintainPlanSaveReqVO req) { |
| 209 | 212 | Set<Long> roadIds = req.getRoadListReqVO().stream().map(MaintainPlanRoadReqVO::getRoadId).collect(Collectors.toSet()); |
| 210 | - Long count =0L; | |
| 213 | + Long count = 0L; | |
| 211 | 214 | //标准计划 |
| 212 | - if(req.getPlanAttr().equals(1)){ | |
| 215 | + if (req.getPlanAttr().equals(1)) { | |
| 213 | 216 | QueryWrapper<MaintainPlanDO> sql = new QueryWrapper<>(); |
| 214 | 217 | sql.lambda().eq(MaintainPlanDO::getPlanTypeId, req.getPlanTypeId()) |
| 215 | 218 | .in(MaintainPlanDO::getRoadId, roadIds) |
| ... | ... | @@ -217,7 +220,7 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { |
| 217 | 220 | .ge(MaintainPlanDO::getEndTime, req.getBeginTime()); // end_time >= startTime |
| 218 | 221 | |
| 219 | 222 | count = maintainPlanMapper.selectCount(sql); |
| 220 | - }else{ | |
| 223 | + } else { | |
| 221 | 224 | QueryWrapper<MaintainPlanDO> sql = new QueryWrapper<>(); |
| 222 | 225 | sql.lambda().eq(MaintainPlanDO::getPlanTypeId, req.getPlanTypeId()) |
| 223 | 226 | .in(MaintainPlanDO::getRoadId, roadIds) |
| ... | ... | @@ -248,11 +251,12 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { |
| 248 | 251 | |
| 249 | 252 | /** |
| 250 | 253 | * 回填部门/公司/角色 |
| 254 | + * | |
| 251 | 255 | * @param list 分页对象 |
| 252 | 256 | */ |
| 253 | - private void addDataInspectionPlan(List<MaintainPlanRespVO> list ){ | |
| 254 | - if(org.springframework.util.CollectionUtils.isEmpty(list)){ | |
| 255 | - return ; | |
| 257 | + private void addDataInspectionPlan(List<MaintainPlanRespVO> list) { | |
| 258 | + if (org.springframework.util.CollectionUtils.isEmpty(list)) { | |
| 259 | + return; | |
| 256 | 260 | } |
| 257 | 261 | |
| 258 | 262 | //公司 |
| ... | ... | @@ -264,22 +268,22 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { |
| 264 | 268 | Map<Long, DeptRespDTO> deptMap = deptApi.getDeptMap(deptIds); |
| 265 | 269 | |
| 266 | 270 | list.forEach(plan -> { |
| 267 | - DeptRespDTO dept = deptMap.get(plan.getDeptId()); | |
| 271 | + DeptRespDTO dept = deptMap.get(plan.getDeptId()); | |
| 268 | 272 | if (dept != null) { |
| 269 | 273 | plan.setDeptName(dept.getName()); |
| 270 | 274 | |
| 271 | 275 | } |
| 272 | - DeptRespDTO company = deptMap.get(plan.getCompanyId()); | |
| 273 | - if(company != null){ | |
| 276 | + DeptRespDTO company = deptMap.get(plan.getCompanyId()); | |
| 277 | + if (company != null) { | |
| 274 | 278 | plan.setCompanyName(company.getName()); |
| 275 | 279 | } |
| 276 | 280 | List<MaintainPlanRoleDO> roleList = maintainPlanRoleMapper.selectList(new QueryWrapper<MaintainPlanRoleDO>().lambda() |
| 277 | 281 | .eq(MaintainPlanRoleDO::getBatchNo, plan.getBatchNo())); |
| 278 | 282 | |
| 279 | 283 | Set<Long> roleIds = roleList.stream().map(MaintainPlanRoleDO::getRoleId).collect(Collectors.toSet()); |
| 280 | - if(!org.springframework.util.CollectionUtils.isEmpty(roleIds)){ | |
| 284 | + if (!org.springframework.util.CollectionUtils.isEmpty(roleIds)) { | |
| 281 | 285 | List<RoleDO> roles = roleApi.getRoleList(roleIds); |
| 282 | - if(!org.springframework.util.CollectionUtils.isEmpty(roles)){ | |
| 286 | + if (!org.springframework.util.CollectionUtils.isEmpty(roles)) { | |
| 283 | 287 | plan.setRoleNameList(roles.stream().map(RoleDO::getName).collect(Collectors.toList())); |
| 284 | 288 | } |
| 285 | 289 | } |
| ... | ... | @@ -290,7 +294,7 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { |
| 290 | 294 | @Override |
| 291 | 295 | public void deleteInspectionPlanByBatchNo(String batchNo) { |
| 292 | 296 | MaintainPlanDO inspectionPlanDO = maintainPlanMapper.selectOne(MaintainPlanDO::getBatchNo, batchNo); |
| 293 | - if(inspectionPlanDO !=null && inspectionPlanDO.getPlanFinishNum() >0){ | |
| 297 | + if (inspectionPlanDO != null && inspectionPlanDO.getPlanFinishNum() > 0) { | |
| 294 | 298 | throw exception(INSPECTION_PLAN_NOT_ALLOW_DELETE); |
| 295 | 299 | } |
| 296 | 300 | maintainPlanMapper.deleteByBatchNo(batchNo); |
| ... | ... | @@ -301,7 +305,7 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { |
| 301 | 305 | @Override |
| 302 | 306 | public void stopPlanInspectionPlan(String batchNo) { |
| 303 | 307 | maintainPlanMapper.delete(MaintainPlanDO::getBatchNo, batchNo); |
| 304 | - maintainPlanDetailMapper.delete(MaintainPlanDetailDO::getBatchNo,batchNo); | |
| 308 | + maintainPlanDetailMapper.delete(MaintainPlanDetailDO::getBatchNo, batchNo); | |
| 305 | 309 | maintainPlanRoleMapper.delete(MaintainPlanRoleDO::getBatchNo, batchNo); |
| 306 | 310 | } |
| 307 | 311 | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/oldtrees/OldtreesServiceImpl.java
| ... | ... | @@ -44,13 +44,12 @@ public class OldtreesServiceImpl implements OldtreesService { |
| 44 | 44 | |
| 45 | 45 | @Override |
| 46 | 46 | public String createOldtrees(OldtreesSaveReqVO createReqVO) { |
| 47 | + | |
| 48 | + createReqVO.imgToDomain(); | |
| 49 | + | |
| 47 | 50 | // 插入 |
| 48 | 51 | OldtreesDO oldtrees = BeanUtils.toBean(createReqVO, OldtreesDO.class); |
| 49 | 52 | |
| 50 | - if (!ObjectUtils.isEmpty(oldtrees)) { | |
| 51 | - oldtrees.imgToDomain(); | |
| 52 | - } | |
| 53 | - | |
| 54 | 53 | String id = oldtrees.getId(); |
| 55 | 54 | if (!StringUtils.hasText(id)) { |
| 56 | 55 | id = UUID.randomUUID().toString().replace("-", ""); |
| ... | ... | @@ -66,6 +65,7 @@ public class OldtreesServiceImpl implements OldtreesService { |
| 66 | 65 | |
| 67 | 66 | OldtreesChangeLogDO changeLog = new OldtreesChangeLogDO(); |
| 68 | 67 | BeanUtils.copyProperties(createReqVO, changeLog); |
| 68 | + changeLog.setId(id); | |
| 69 | 69 | changeLog.setOldtreeid(id); |
| 70 | 70 | changeLog.setCreateby(createReqVO.getCreateby()); |
| 71 | 71 | changeLog.setCreatetime(createReqVO.getCreatetime()); |
| ... | ... | @@ -79,6 +79,8 @@ public class OldtreesServiceImpl implements OldtreesService { |
| 79 | 79 | |
| 80 | 80 | @Override |
| 81 | 81 | public void updateOldtrees(OldtreesSaveReqVO updateReqVO) { |
| 82 | + | |
| 83 | + updateReqVO.imgToDomain(); | |
| 82 | 84 | // 校验存在 |
| 83 | 85 | OldtreesDO dbOlderTree = validateOldtreesExists(updateReqVO.getId()); |
| 84 | 86 | |
| ... | ... | @@ -93,10 +95,9 @@ public class OldtreesServiceImpl implements OldtreesService { |
| 93 | 95 | // 更新 |
| 94 | 96 | OldtreesDO updateObj = BeanUtils.toBean(updateReqVO, OldtreesDO.class); |
| 95 | 97 | |
| 96 | - updateObj.imgToDomain(); | |
| 97 | - | |
| 98 | 98 | OldtreesChangeLogDO changeLog = new OldtreesChangeLogDO(); |
| 99 | 99 | org.springframework.beans.BeanUtils.copyProperties(updateReqVO, changeLog); |
| 100 | + changeLog.setId(updateReqVO.getId()); | |
| 100 | 101 | changeLog.setOldtreeid(updateReqVO.getId()); |
| 101 | 102 | changeLog.setCreateby(updateReqVO.getUpdateby()); |
| 102 | 103 | changeLog.setCreatetime(LocalDateTime.now()); | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/oldtreeschangelog/OldtreesChangeLogServiceImpl.java
| ... | ... | @@ -3,6 +3,7 @@ package com.zteits.urbanops.module.garden.service.oldtreeschangelog; |
| 3 | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | 4 | import org.springframework.stereotype.Service; |
| 5 | 5 | import jakarta.annotation.Resource; |
| 6 | +import org.springframework.util.ObjectUtils; | |
| 6 | 7 | import org.springframework.validation.annotation.Validated; |
| 7 | 8 | import org.springframework.transaction.annotation.Transactional; |
| 8 | 9 | |
| ... | ... | @@ -74,7 +75,11 @@ public class OldtreesChangeLogServiceImpl implements OldtreesChangeLogService { |
| 74 | 75 | |
| 75 | 76 | @Override |
| 76 | 77 | public OldtreesChangeLogDO getOldtreesChangeLog(String id) { |
| 77 | - return oldtreesChangeLogMapper.selectById(id); | |
| 78 | + OldtreesChangeLogDO oldtreesChangeLogDO = oldtreesChangeLogMapper.selectById(id); | |
| 79 | + if (!ObjectUtils.isEmpty(oldtreesChangeLogDO)) { | |
| 80 | + oldtreesChangeLogDO.domainToImg(); | |
| 81 | + } | |
| 82 | + return oldtreesChangeLogDO; | |
| 78 | 83 | } |
| 79 | 84 | |
| 80 | 85 | @Override | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/road/RoadService.java
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/road/RoadServiceImpl.java
| ... | ... | @@ -97,8 +97,13 @@ public class RoadServiceImpl implements RoadService { |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | @Override |
| 100 | - public RoadDO getRoad(Long id) { | |
| 101 | - return roadMapper.selectById(id); | |
| 100 | + public RoadRespVO getRoad(Long id) { | |
| 101 | + RoadDO roadDO = roadMapper.selectById(id); | |
| 102 | + RoadRespVO respVO = BeanUtils.toBean(roadDO, RoadRespVO.class); | |
| 103 | + List<RoadRespVO> list = new ArrayList<>(); | |
| 104 | + list.add(respVO); | |
| 105 | + addDataInspectionPlan(list); | |
| 106 | + return respVO; | |
| 102 | 107 | } |
| 103 | 108 | |
| 104 | 109 | @Override | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/tree/TreeServiceImpl.java
| ... | ... | @@ -67,13 +67,10 @@ public class TreeServiceImpl implements TreeService { |
| 67 | 67 | |
| 68 | 68 | @Override |
| 69 | 69 | public Long createTree(TreeSaveReqVO createReqVO) { |
| 70 | + createReqVO.imgToDomain(); | |
| 70 | 71 | // 插入 |
| 71 | 72 | TreeDO tree = BeanUtils.toBean(createReqVO, TreeDO.class); |
| 72 | 73 | |
| 73 | - if (!ObjectUtils.isEmpty(tree)) { | |
| 74 | - tree.imgToDomain(); | |
| 75 | - } | |
| 76 | - | |
| 77 | 74 | TreeDO treeDO = treeMapper.selectByTreeNumber(createReqVO.getTreenumber()); |
| 78 | 75 | if (!ObjectUtils.isEmpty(treeDO)) { |
| 79 | 76 | throw exception(TREE_NUMBER_EXISTS); |
| ... | ... | @@ -109,6 +106,7 @@ public class TreeServiceImpl implements TreeService { |
| 109 | 106 | |
| 110 | 107 | @Override |
| 111 | 108 | public void updateTree(TreeSaveReqVO updateReqVO) { |
| 109 | + updateReqVO.imgToDomain(); | |
| 112 | 110 | // 校验存在 |
| 113 | 111 | TreeDO dbTree = validateTreeExists(updateReqVO.getId()); |
| 114 | 112 | if (!ObjectUtils.isEmpty(dbTree) && !dbTree.getTreenumber().equals(updateReqVO.getTreenumber())) { |
| ... | ... | @@ -120,7 +118,6 @@ public class TreeServiceImpl implements TreeService { |
| 120 | 118 | |
| 121 | 119 | // 更新 |
| 122 | 120 | TreeDO updateObj = BeanUtils.toBean(updateReqVO, TreeDO.class); |
| 123 | - updateObj.imgToDomain(); | |
| 124 | 121 | |
| 125 | 122 | if (ObjectUtils.isEmpty(updateReqVO.getStreet())) { |
| 126 | 123 | Long road = updateReqVO.getRoad(); | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/treechangelog/TreeChangeLogServiceImpl.java
| ... | ... | @@ -3,6 +3,7 @@ package com.zteits.urbanops.module.garden.service.treechangelog; |
| 3 | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | 4 | import org.springframework.stereotype.Service; |
| 5 | 5 | import jakarta.annotation.Resource; |
| 6 | +import org.springframework.util.ObjectUtils; | |
| 6 | 7 | import org.springframework.validation.annotation.Validated; |
| 7 | 8 | import org.springframework.transaction.annotation.Transactional; |
| 8 | 9 | |
| ... | ... | @@ -74,7 +75,11 @@ public class TreeChangeLogServiceImpl implements TreeChangeLogService { |
| 74 | 75 | |
| 75 | 76 | @Override |
| 76 | 77 | public TreeChangeLogDO getTreeChangeLog(Long id) { |
| 77 | - return treeChangeLogMapper.selectById(id); | |
| 78 | + TreeChangeLogDO treeChangeLog = treeChangeLogMapper.selectById(id); | |
| 79 | + if (!ObjectUtils.isEmpty(treeChangeLog)) { | |
| 80 | + treeChangeLog.domainToImg(); | |
| 81 | + } | |
| 82 | + return treeChangeLog; | |
| 78 | 83 | } |
| 79 | 84 | |
| 80 | 85 | @Override | ... | ... |
urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/api/user/AdminUserApi.java
| ... | ... | @@ -2,6 +2,7 @@ package com.zteits.urbanops.module.system.api.user; |
| 2 | 2 | |
| 3 | 3 | import com.zteits.urbanops.framework.common.util.collection.CollectionUtils; |
| 4 | 4 | import com.zteits.urbanops.module.system.api.user.dto.AdminUserRespDTO; |
| 5 | +import com.zteits.urbanops.module.system.controller.admin.user.vo.user.DictDataRespVO; | |
| 5 | 6 | |
| 6 | 7 | import java.util.Collection; |
| 7 | 8 | import java.util.Collections; |
| ... | ... | @@ -86,4 +87,9 @@ public interface AdminUserApi { |
| 86 | 87 | */ |
| 87 | 88 | void validateUserList(Collection<Long> ids); |
| 88 | 89 | |
| 90 | + /** | |
| 91 | + * 获取登录人业务线列表 | |
| 92 | + * @return 业务线列表 | |
| 93 | + */ | |
| 94 | + List<DictDataRespVO> getLoginBusiLine(); | |
| 89 | 95 | } | ... | ... |
urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/api/user/AdminUserApiImpl.java
| ... | ... | @@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjUtil; |
| 5 | 5 | import com.zteits.urbanops.framework.common.util.object.BeanUtils; |
| 6 | 6 | import com.zteits.urbanops.framework.datapermission.core.util.DataPermissionUtils; |
| 7 | 7 | import com.zteits.urbanops.module.system.api.user.dto.AdminUserRespDTO; |
| 8 | +import com.zteits.urbanops.module.system.controller.admin.user.vo.user.DictDataRespVO; | |
| 8 | 9 | import com.zteits.urbanops.module.system.dal.dataobject.dept.DeptDO; |
| 9 | 10 | import com.zteits.urbanops.module.system.dal.dataobject.user.AdminUserDO; |
| 10 | 11 | import com.zteits.urbanops.module.system.service.dept.DeptService; |
| ... | ... | @@ -83,4 +84,9 @@ public class AdminUserApiImpl implements AdminUserApi { |
| 83 | 84 | userService.validateUserList(ids); |
| 84 | 85 | } |
| 85 | 86 | |
| 87 | + @Override | |
| 88 | + public List<DictDataRespVO> getLoginBusiLine() { | |
| 89 | + return userService.getLoginBusiLine(); | |
| 90 | + } | |
| 91 | + | |
| 86 | 92 | } | ... | ... |