Commit 4d18526544a9f4ee3b8061c4910646f9d37ab8ab

Authored by 戈灵虎
1 parent 3a88a59b

迁移 树

Showing 20 changed files with 466 additions and 244 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/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/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&lt;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/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/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
... ...