Commit 612dd071b6889597ab0a0498adc75c09198ec30d
Merge remote-tracking branch 'origin/dev' into dev
Showing
35 changed files
with
847 additions
and
282 deletions
.vscode/settings.json
| 1 | { | 1 | { |
| 2 | "java.compile.nullAnalysis.mode": "automatic", | 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 | \ No newline at end of file | 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,6 +2,7 @@ package com.zteits.urbanops.framework.common.biz.infra.logger.dto; | ||
| 2 | 2 | ||
| 3 | import jakarta.validation.constraints.NotNull; | 3 | import jakarta.validation.constraints.NotNull; |
| 4 | import lombok.Data; | 4 | import lombok.Data; |
| 5 | +import lombok.experimental.Accessors; | ||
| 5 | 6 | ||
| 6 | import java.time.LocalDateTime; | 7 | import java.time.LocalDateTime; |
| 7 | 8 | ||
| @@ -11,6 +12,7 @@ import java.time.LocalDateTime; | @@ -11,6 +12,7 @@ import java.time.LocalDateTime; | ||
| 11 | * @author ZIEITS | 12 | * @author ZIEITS |
| 12 | */ | 13 | */ |
| 13 | @Data | 14 | @Data |
| 15 | +@Accessors(chain = true) | ||
| 14 | public class ApiAccessLogCreateReqDTO { | 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/costfee/vo/MechanicalCostImport.java
| @@ -86,12 +86,10 @@ public class MechanicalCostImport { | @@ -86,12 +86,10 @@ public class MechanicalCostImport { | ||
| 86 | private Long serviceLife; | 86 | private Long serviceLife; |
| 87 | 87 | ||
| 88 | /** 状态(0正常 1停用) */ | 88 | /** 状态(0正常 1停用) */ |
| 89 | - @ExcelProperty(index = 10) | ||
| 90 | - @NotNull(message = "当前状态不能为空") | ||
| 91 | - @Min(value = 0, message = "状态只能为0(在用)或1(报废)") | ||
| 92 | - @Max(value = 1, message = "状态只能为0(在用)或1(报废)") | ||
| 93 | private Long status; | 89 | private Long status; |
| 94 | 90 | ||
| 91 | + @ExcelProperty(index = 10) | ||
| 92 | + @NotNull(message = "当前状态不能为空") | ||
| 95 | private String statusTxt; | 93 | private String statusTxt; |
| 96 | 94 | ||
| 97 | /** 归属公司 */ | 95 | /** 归属公司 */ |
| @@ -110,27 +108,55 @@ public class MechanicalCostImport { | @@ -110,27 +108,55 @@ public class MechanicalCostImport { | ||
| 110 | private String remark; | 108 | private String remark; |
| 111 | 109 | ||
| 112 | 110 | ||
| 113 | - // 设置status时自动更新statusTxt | 111 | + /** |
| 112 | + * 1. 修改 statusTxt(文本状态)时,自动同步 status(数字状态) | ||
| 113 | + * 支持 Excel 导入的文本值:“在用”“正常”→0;“报废”“停用”→1;其他→默认未知状态 | ||
| 114 | + */ | ||
| 115 | + public void setStatusTxt(String statusTxt) { | ||
| 116 | + this.statusTxt = statusTxt; // 先赋值文本状态 | ||
| 117 | + this.status = parseStatusFromTxt(statusTxt); // 同步数字状态 | ||
| 118 | + } | ||
| 119 | + | ||
| 120 | + /** | ||
| 121 | + * 2. 修改 status(数字状态)时,自动同步 statusTxt(文本状态) | ||
| 122 | + * 保持双向联动:改数字→更文本,改文本→更数字 | ||
| 123 | + */ | ||
| 114 | public void setStatus(Long status) { | 124 | public void setStatus(Long status) { |
| 115 | - this.status = status; | ||
| 116 | - updateStatusTxt(); | 125 | + this.status = status; // 先赋值数字状态 |
| 126 | + this.statusTxt = parseTxtFromStatus(status); // 同步文本状态 | ||
| 117 | } | 127 | } |
| 118 | 128 | ||
| 119 | - private void updateStatusTxt() { | ||
| 120 | - if (status == null) { | ||
| 121 | - statusTxt = null; | ||
| 122 | - return; | 129 | + /** |
| 130 | + * 辅助方法:将状态文本转为数字状态 | ||
| 131 | + */ | ||
| 132 | + private Long parseStatusFromTxt(String statusTxt) { | ||
| 133 | + if (statusTxt == null || statusTxt.trim().isEmpty()) { | ||
| 134 | + this.statusTxt = "未知状态"; // 空文本兜底 | ||
| 135 | + return null; | ||
| 123 | } | 136 | } |
| 137 | + String trimmedTxt = statusTxt.trim(); | ||
| 138 | + // 支持多文本映射(兼容 Excel 中可能的不同写法) | ||
| 139 | + return switch (trimmedTxt) { | ||
| 140 | + case "在用", "正常", "0" -> 0L; | ||
| 141 | + case "报废", "停用", "1" -> 1L; | ||
| 142 | + default -> { | ||
| 143 | + this.statusTxt = "未知状态"; // 非法文本兜底 | ||
| 144 | + yield null; // 非法状态返回 null,后续可做校验 | ||
| 145 | + } | ||
| 146 | + }; | ||
| 147 | + } | ||
| 124 | 148 | ||
| 125 | - switch (status.intValue()) { | ||
| 126 | - case 0: | ||
| 127 | - statusTxt = "在用"; | ||
| 128 | - break; | ||
| 129 | - case 1: | ||
| 130 | - statusTxt = "报废"; | ||
| 131 | - break; | ||
| 132 | - default: | ||
| 133 | - statusTxt = "未知状态"; | 149 | + /** |
| 150 | + * 辅助方法:将数字状态转为文本状态 | ||
| 151 | + */ | ||
| 152 | + private String parseTxtFromStatus(Long status) { | ||
| 153 | + if (status == null) { | ||
| 154 | + return "未知状态"; | ||
| 134 | } | 155 | } |
| 156 | + return switch (status.intValue()) { | ||
| 157 | + case 0 -> "在用"; | ||
| 158 | + case 1 -> "报废"; | ||
| 159 | + default -> "未知状态"; | ||
| 160 | + }; | ||
| 135 | } | 161 | } |
| 136 | } | 162 | } |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/oldtrees/OldtreesController.java
| 1 | package com.zteits.urbanops.module.garden.controller.admin.oldtrees; | 1 | package com.zteits.urbanops.module.garden.controller.admin.oldtrees; |
| 2 | 2 | ||
| 3 | +import com.fhs.core.trans.anno.TransMethodResult; | ||
| 3 | import com.zteits.urbanops.framework.dict.core.DictFrameworkUtils; | 4 | import com.zteits.urbanops.framework.dict.core.DictFrameworkUtils; |
| 4 | import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; | 5 | import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; |
| 5 | import org.apache.catalina.security.SecurityUtil; | 6 | import org.apache.catalina.security.SecurityUtil; |
| @@ -94,6 +95,7 @@ public class OldtreesController { | @@ -94,6 +95,7 @@ public class OldtreesController { | ||
| 94 | @Operation(summary = "获取古树台账详细信息") | 95 | @Operation(summary = "获取古树台账详细信息") |
| 95 | @Parameter(name = "id", description = "编号", required = true, example = "1024") | 96 | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| 96 | @PreAuthorize("@ss.hasPermission('garden:oldtrees:query')") | 97 | @PreAuthorize("@ss.hasPermission('garden:oldtrees:query')") |
| 98 | + @TransMethodResult | ||
| 97 | public CommonResult<OldtreesRespVO> getOldtrees(@RequestParam("id") String id) { | 99 | public CommonResult<OldtreesRespVO> getOldtrees(@RequestParam("id") String id) { |
| 98 | OldtreesDO oldtrees = oldtreesService.getOldtrees(id); | 100 | OldtreesDO oldtrees = oldtreesService.getOldtrees(id); |
| 99 | return success(BeanUtils.toBean(oldtrees, OldtreesRespVO.class)); | 101 | return success(BeanUtils.toBean(oldtrees, OldtreesRespVO.class)); |
| @@ -125,20 +127,18 @@ public class OldtreesController { | @@ -125,20 +127,18 @@ public class OldtreesController { | ||
| 125 | 127 | ||
| 126 | private void fillDictData(List<OldtreesDO> list) { | 128 | private void fillDictData(List<OldtreesDO> list) { |
| 127 | for (OldtreesDO gardenTree : list) { | 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 | gardenTree.setStreet(street); | 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 | gardenTree.setOldtreeownership(ownership); | 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 | gardenTree.setGrowthvigor(growthVigor); | 138 | gardenTree.setGrowthvigor(growthVigor); |
| 139 | - String treeLevel = DictFrameworkUtils.parseDictDataValue("tree_level", gardenTree.getTreelevel()); | 139 | + String treeLevel = DictFrameworkUtils.parseDictDataLabel("tree_level", gardenTree.getTreelevel()); |
| 140 | gardenTree.setTreelevel(treeLevel); | 140 | gardenTree.setTreelevel(treeLevel); |
| 141 | - String dataState = DictFrameworkUtils.parseDictDataValue("data_state", gardenTree.getDatastate()); | 141 | + String dataState = DictFrameworkUtils.parseDictDataLabel("data_state", gardenTree.getDatastate()); |
| 142 | gardenTree.setDatastate(dataState); | 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 | package com.zteits.urbanops.module.garden.controller.admin.oldtrees.vo; | 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 | import lombok.*; | 6 | import lombok.*; |
| 4 | import java.util.*; | 7 | import java.util.*; |
| 5 | import io.swagger.v3.oas.annotations.media.Schema; | 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 | package com.zteits.urbanops.module.garden.controller.admin.oldtrees.vo; | 1 | package com.zteits.urbanops.module.garden.controller.admin.oldtrees.vo; |
| 2 | 2 | ||
| 3 | import com.baomidou.mybatisplus.annotation.TableField; | 3 | import com.baomidou.mybatisplus.annotation.TableField; |
| 4 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 5 | +import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
| 4 | import com.fhs.core.trans.anno.Trans; | 6 | import com.fhs.core.trans.anno.Trans; |
| 5 | import com.fhs.core.trans.constant.TransType; | 7 | import com.fhs.core.trans.constant.TransType; |
| 8 | +import com.zteits.urbanops.framework.common.util.json.databind.LocalDateTimeStringSerializer; | ||
| 6 | import com.zteits.urbanops.module.system.dal.dataobject.dept.DeptDO; | 9 | import com.zteits.urbanops.module.system.dal.dataobject.dept.DeptDO; |
| 10 | +import com.zteits.urbanops.module.system.dal.dataobject.user.AdminUserDO; | ||
| 7 | import io.swagger.v3.oas.annotations.media.Schema; | 11 | import io.swagger.v3.oas.annotations.media.Schema; |
| 8 | import lombok.*; | 12 | import lombok.*; |
| 9 | import java.util.*; | 13 | import java.util.*; |
| @@ -11,13 +15,16 @@ import org.springframework.format.annotation.DateTimeFormat; | @@ -11,13 +15,16 @@ import org.springframework.format.annotation.DateTimeFormat; | ||
| 11 | import java.time.LocalDateTime; | 15 | import java.time.LocalDateTime; |
| 12 | import cn.idev.excel.annotation.*; | 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 | @Schema(description = "管理后台 - 古树名木 Response VO") | 21 | @Schema(description = "管理后台 - 古树名木 Response VO") |
| 15 | @Data | 22 | @Data |
| 16 | @ExcelIgnoreUnannotated | 23 | @ExcelIgnoreUnannotated |
| 17 | public class OldtreesRespVO { | 24 | public class OldtreesRespVO { |
| 18 | 25 | ||
| 19 | @Schema(description = "id", example = "4258") | 26 | @Schema(description = "id", example = "4258") |
| 20 | - @ExcelProperty("id") | 27 | +// @ExcelProperty("id") |
| 21 | private String id; | 28 | private String id; |
| 22 | 29 | ||
| 23 | @Schema(description = "编号") | 30 | @Schema(description = "编号") |
| @@ -25,7 +32,7 @@ public class OldtreesRespVO { | @@ -25,7 +32,7 @@ public class OldtreesRespVO { | ||
| 25 | private String famoustreenumber; | 32 | private String famoustreenumber; |
| 26 | 33 | ||
| 27 | @Schema(description = "级别--数据字典:一级、两级") | 34 | @Schema(description = "级别--数据字典:一级、两级") |
| 28 | - @ExcelProperty("级别--数据字典:一级、两级") | 35 | + @ExcelProperty("级别") |
| 29 | private String treelevel; | 36 | private String treelevel; |
| 30 | 37 | ||
| 31 | @Schema(description = "树种", example = "2") | 38 | @Schema(description = "树种", example = "2") |
| @@ -37,14 +44,11 @@ public class OldtreesRespVO { | @@ -37,14 +44,11 @@ public class OldtreesRespVO { | ||
| 37 | private String location; | 44 | private String location; |
| 38 | 45 | ||
| 39 | @Schema(description = "养护单位") | 46 | @Schema(description = "养护单位") |
| 40 | - private String maintainunit; | ||
| 41 | - | ||
| 42 | - @Schema(description = "养护单位名称") | ||
| 43 | @ExcelProperty("养护单位") | 47 | @ExcelProperty("养护单位") |
| 44 | - private String maintainUnitName; | 48 | + private String maintainunit; |
| 45 | 49 | ||
| 46 | @Schema(description = "权属分类--数据字典:专业绿地和单位(居住区)") | 50 | @Schema(description = "权属分类--数据字典:专业绿地和单位(居住区)") |
| 47 | - @ExcelProperty("权属分类--数据字典:专业绿地和单位(居住区)") | 51 | + @ExcelProperty("权属分类") |
| 48 | private String oldtreeownership; | 52 | private String oldtreeownership; |
| 49 | 53 | ||
| 50 | @Schema(description = "生长地点") | 54 | @Schema(description = "生长地点") |
| @@ -92,7 +96,7 @@ public class OldtreesRespVO { | @@ -92,7 +96,7 @@ public class OldtreesRespVO { | ||
| 92 | private String weekday; | 96 | private String weekday; |
| 93 | 97 | ||
| 94 | @Schema(description = "生长势--数据字典:正常,衰弱,濒危,死亡") | 98 | @Schema(description = "生长势--数据字典:正常,衰弱,濒危,死亡") |
| 95 | - @ExcelProperty("生长势--数据字典:正常,衰弱,濒危,死亡") | 99 | +// @ExcelProperty("生长势--数据字典:正常,衰弱,濒危,死亡") |
| 96 | private String growthvigor; | 100 | private String growthvigor; |
| 97 | 101 | ||
| 98 | @Schema(description = "生长环境") | 102 | @Schema(description = "生长环境") |
| @@ -104,27 +108,27 @@ public class OldtreesRespVO { | @@ -104,27 +108,27 @@ public class OldtreesRespVO { | ||
| 104 | private String treephotoone; | 108 | private String treephotoone; |
| 105 | 109 | ||
| 106 | @Schema(description = "春季养护管理措施") | 110 | @Schema(description = "春季养护管理措施") |
| 107 | - @ExcelProperty("春季养护管理措施") | 111 | +// @ExcelProperty("春季养护管理措施") |
| 108 | private String springmaintenance; | 112 | private String springmaintenance; |
| 109 | 113 | ||
| 110 | @Schema(description = "夏季养护管理措施") | 114 | @Schema(description = "夏季养护管理措施") |
| 111 | - @ExcelProperty("夏季养护管理措施") | 115 | +// @ExcelProperty("夏季养护管理措施") |
| 112 | private String summermaintenance; | 116 | private String summermaintenance; |
| 113 | 117 | ||
| 114 | @Schema(description = "秋季养护管理措施") | 118 | @Schema(description = "秋季养护管理措施") |
| 115 | - @ExcelProperty("秋季养护管理措施") | 119 | +// @ExcelProperty("秋季养护管理措施") |
| 116 | private String autumnmaintenance; | 120 | private String autumnmaintenance; |
| 117 | 121 | ||
| 118 | @Schema(description = "冬季养护管理措施") | 122 | @Schema(description = "冬季养护管理措施") |
| 119 | - @ExcelProperty("冬季养护管理措施") | 123 | +// @ExcelProperty("冬季养护管理措施") |
| 120 | private String wintermaintenance; | 124 | private String wintermaintenance; |
| 121 | 125 | ||
| 122 | @Schema(description = "年度") | 126 | @Schema(description = "年度") |
| 123 | - @ExcelProperty("年度") | 127 | +// @ExcelProperty("年度") |
| 124 | private String annual; | 128 | private String annual; |
| 125 | 129 | ||
| 126 | @Schema(description = "养护记录备注", example = "随便") | 130 | @Schema(description = "养护记录备注", example = "随便") |
| 127 | - @ExcelProperty("养护记录备注") | 131 | +// @ExcelProperty("养护记录备注") |
| 128 | private String curingremark; | 132 | private String curingremark; |
| 129 | 133 | ||
| 130 | @Schema(description = "古树照片二") | 134 | @Schema(description = "古树照片二") |
| @@ -140,19 +144,19 @@ public class OldtreesRespVO { | @@ -140,19 +144,19 @@ public class OldtreesRespVO { | ||
| 140 | private String nameplatephoto; | 144 | private String nameplatephoto; |
| 141 | 145 | ||
| 142 | @Schema(description = "数据状态(已更新、未更新)") | 146 | @Schema(description = "数据状态(已更新、未更新)") |
| 143 | - @ExcelProperty("数据状态(已更新、未更新)") | 147 | +// @ExcelProperty("数据状态(已更新、未更新)") |
| 144 | private String datastate; | 148 | private String datastate; |
| 145 | 149 | ||
| 146 | @Schema(description = "养护员工--作业队下派古树时选择的派发员工") | 150 | @Schema(description = "养护员工--作业队下派古树时选择的派发员工") |
| 147 | - @ExcelProperty("养护员工--作业队下派古树时选择的派发员工") | 151 | +// @ExcelProperty("养护员工--作业队下派古树时选择的派发员工") |
| 148 | private String curingstaff; | 152 | private String curingstaff; |
| 149 | 153 | ||
| 150 | @Schema(description = "状态(驳回/确认)") | 154 | @Schema(description = "状态(驳回/确认)") |
| 151 | - @ExcelProperty("状态(驳回/确认)") | 155 | +// @ExcelProperty("状态(驳回/确认)") |
| 152 | private String state; | 156 | private String state; |
| 153 | 157 | ||
| 154 | @Schema(description = "平台驳回状态(平台驳回)") | 158 | @Schema(description = "平台驳回状态(平台驳回)") |
| 155 | - @ExcelProperty("平台驳回状态(平台驳回)") | 159 | +// @ExcelProperty("平台驳回状态(平台驳回)") |
| 156 | private String platformstate; | 160 | private String platformstate; |
| 157 | 161 | ||
| 158 | @Schema(description = "所属街道") | 162 | @Schema(description = "所属街道") |
| @@ -160,31 +164,43 @@ public class OldtreesRespVO { | @@ -160,31 +164,43 @@ public class OldtreesRespVO { | ||
| 160 | private String street; | 164 | private String street; |
| 161 | 165 | ||
| 162 | @Schema(description = "责任人姓名", example = "赵六") | 166 | @Schema(description = "责任人姓名", example = "赵六") |
| 163 | - @ExcelProperty("责任人姓名") | 167 | +// @ExcelProperty("责任人姓名") |
| 164 | private String responsibleusername; | 168 | private String responsibleusername; |
| 165 | 169 | ||
| 166 | @Schema(description = "责任人电话") | 170 | @Schema(description = "责任人电话") |
| 167 | - @ExcelProperty("责任人电话") | 171 | +// @ExcelProperty("责任人电话") |
| 168 | private String responsibleuserphone; | 172 | private String responsibleuserphone; |
| 169 | 173 | ||
| 174 | + @Trans(type = TransType.SIMPLE, target = AdminUserDO.class, fields = "nickname", ref = "createbyName") | ||
| 175 | + private Long createby; | ||
| 176 | + | ||
| 170 | @Schema(description = "创建者") | 177 | @Schema(description = "创建者") |
| 171 | - @ExcelProperty("创建者") | ||
| 172 | - private String createby; | 178 | +// @ExcelProperty("创建者") |
| 179 | + private String createbyName; | ||
| 173 | 180 | ||
| 174 | @Schema(description = "创建时间") | 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 | private LocalDateTime createtime; | 186 | private LocalDateTime createtime; |
| 177 | 187 | ||
| 188 | + @Trans(type = TransType.SIMPLE, target = AdminUserDO.class, fields = "nickname", ref = "updatebyName") | ||
| 189 | + private Long updateby; | ||
| 190 | + | ||
| 178 | @Schema(description = "更新者") | 191 | @Schema(description = "更新者") |
| 179 | - @ExcelProperty("更新者") | ||
| 180 | - private String updateby; | 192 | +// @ExcelProperty("更新者") |
| 193 | + private String updatebyName; | ||
| 181 | 194 | ||
| 182 | @Schema(description = "更新时间") | 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 | @Schema(description = "部门id", requiredMode = Schema.RequiredMode.REQUIRED, example = "20245") | 202 | @Schema(description = "部门id", requiredMode = Schema.RequiredMode.REQUIRED, example = "20245") |
| 187 | - @ExcelProperty("部门id") | 203 | +// @ExcelProperty("部门id") |
| 188 | private Long deptId; | 204 | private Long deptId; |
| 189 | 205 | ||
| 190 | private List<String> treeImgList; | 206 | private List<String> treeImgList; |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/oldtrees/vo/OldtreesSaveReqVO.java
| 1 | package com.zteits.urbanops.module.garden.controller.admin.oldtrees.vo; | 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 | import io.swagger.v3.oas.annotations.media.Schema; | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | import lombok.*; | 6 | import lombok.*; |
| 5 | import java.util.*; | 7 | import java.util.*; |
| 6 | import jakarta.validation.constraints.*; | 8 | import jakarta.validation.constraints.*; |
| 7 | import org.springframework.format.annotation.DateTimeFormat; | 9 | import org.springframework.format.annotation.DateTimeFormat; |
| 10 | +import org.springframework.util.CollectionUtils; | ||
| 11 | +import org.springframework.util.StringUtils; | ||
| 12 | + | ||
| 8 | import java.time.LocalDateTime; | 13 | import java.time.LocalDateTime; |
| 9 | 14 | ||
| 10 | @Schema(description = "管理后台 - 古树名木新增/修改 Request VO") | 15 | @Schema(description = "管理后台 - 古树名木新增/修改 Request VO") |
| @@ -141,4 +146,46 @@ public class OldtreesSaveReqVO { | @@ -141,4 +146,46 @@ public class OldtreesSaveReqVO { | ||
| 141 | 146 | ||
| 142 | private List<String> nameplatephotoList; | 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 | \ No newline at end of file | 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,7 +8,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; | ||
| 8 | import io.swagger.v3.oas.annotations.Parameter; | 8 | import io.swagger.v3.oas.annotations.Parameter; |
| 9 | import io.swagger.v3.oas.annotations.Operation; | 9 | import io.swagger.v3.oas.annotations.Operation; |
| 10 | 10 | ||
| 11 | -import jakarta.validation.constraints.*; | ||
| 12 | import jakarta.validation.*; | 11 | import jakarta.validation.*; |
| 13 | import jakarta.servlet.http.*; | 12 | import jakarta.servlet.http.*; |
| 14 | import java.util.*; | 13 | import java.util.*; |
| @@ -23,6 +22,7 @@ import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; | @@ -23,6 +22,7 @@ import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; | ||
| 23 | import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; | 22 | import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; |
| 24 | 23 | ||
| 25 | import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; | 24 | import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; |
| 25 | +import com.fhs.core.trans.anno.TransMethodResult; | ||
| 26 | import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; | 26 | import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*; |
| 27 | 27 | ||
| 28 | import com.zteits.urbanops.module.garden.controller.admin.oldtreeschangelog.vo.*; | 28 | import com.zteits.urbanops.module.garden.controller.admin.oldtreeschangelog.vo.*; |
| @@ -75,6 +75,7 @@ public class OldtreesChangeLogController { | @@ -75,6 +75,7 @@ public class OldtreesChangeLogController { | ||
| 75 | @Operation(summary = "获得古树名木修改记录") | 75 | @Operation(summary = "获得古树名木修改记录") |
| 76 | @Parameter(name = "id", description = "编号", required = true, example = "1024") | 76 | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| 77 | @PreAuthorize("@ss.hasPermission('garden:oldtrees-change-log:query')") | 77 | @PreAuthorize("@ss.hasPermission('garden:oldtrees-change-log:query')") |
| 78 | + @TransMethodResult | ||
| 78 | public CommonResult<OldtreesChangeLogRespVO> getOldtreesChangeLog(@RequestParam("id") String id) { | 79 | public CommonResult<OldtreesChangeLogRespVO> getOldtreesChangeLog(@RequestParam("id") String id) { |
| 79 | OldtreesChangeLogDO oldtreesChangeLog = oldtreesChangeLogService.getOldtreesChangeLog(id); | 80 | OldtreesChangeLogDO oldtreesChangeLog = oldtreesChangeLogService.getOldtreesChangeLog(id); |
| 80 | return success(BeanUtils.toBean(oldtreesChangeLog, OldtreesChangeLogRespVO.class)); | 81 | return success(BeanUtils.toBean(oldtreesChangeLog, OldtreesChangeLogRespVO.class)); |
| @@ -83,6 +84,7 @@ public class OldtreesChangeLogController { | @@ -83,6 +84,7 @@ public class OldtreesChangeLogController { | ||
| 83 | @GetMapping({"/page","/list"}) | 84 | @GetMapping({"/page","/list"}) |
| 84 | @Operation(summary = "查询古树名木修改记录列表") | 85 | @Operation(summary = "查询古树名木修改记录列表") |
| 85 | @PreAuthorize("@ss.hasPermission('garden:oldtrees-change-log:query')") | 86 | @PreAuthorize("@ss.hasPermission('garden:oldtrees-change-log:query')") |
| 87 | + @TransMethodResult | ||
| 86 | public CommonResult<PageResult<OldtreesChangeLogRespVO>> getOldtreesChangeLogPage(@Valid OldtreesChangeLogPageReqVO pageReqVO) { | 88 | public CommonResult<PageResult<OldtreesChangeLogRespVO>> getOldtreesChangeLogPage(@Valid OldtreesChangeLogPageReqVO pageReqVO) { |
| 87 | PageResult<OldtreesChangeLogDO> pageResult = oldtreesChangeLogService.getOldtreesChangeLogPage(pageReqVO); | 89 | PageResult<OldtreesChangeLogDO> pageResult = oldtreesChangeLogService.getOldtreesChangeLogPage(pageReqVO); |
| 88 | return success(BeanUtils.toBean(pageResult, OldtreesChangeLogRespVO.class)); | 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 | package com.zteits.urbanops.module.garden.controller.admin.oldtreeschangelog.vo; | 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 | import io.swagger.v3.oas.annotations.media.Schema; | 10 | import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | import lombok.*; | 11 | import lombok.*; |
| 6 | import java.util.*; | 12 | import java.util.*; |
| 7 | import org.springframework.format.annotation.DateTimeFormat; | 13 | import org.springframework.format.annotation.DateTimeFormat; |
| 8 | import java.time.LocalDateTime; | 14 | import java.time.LocalDateTime; |
| 9 | import cn.idev.excel.annotation.*; | 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 | @Schema(description = "管理后台 - 古树名木修改记录 Response VO") | 21 | @Schema(description = "管理后台 - 古树名木修改记录 Response VO") |
| 12 | @Data | 22 | @Data |
| 13 | @ExcelIgnoreUnannotated | 23 | @ExcelIgnoreUnannotated |
| 14 | -public class OldtreesChangeLogRespVO { | 24 | +public class OldtreesChangeLogRespVO implements VO { |
| 15 | 25 | ||
| 16 | @Schema(description = "id", example = "148") | 26 | @Schema(description = "id", example = "148") |
| 17 | @ExcelProperty("id") | 27 | @ExcelProperty("id") |
| @@ -39,6 +49,7 @@ public class OldtreesChangeLogRespVO { | @@ -39,6 +49,7 @@ public class OldtreesChangeLogRespVO { | ||
| 39 | 49 | ||
| 40 | @Schema(description = "养护单位") | 50 | @Schema(description = "养护单位") |
| 41 | @ExcelProperty("养护单位") | 51 | @ExcelProperty("养护单位") |
| 52 | + @Trans(type = TransType.SIMPLE, target = DeptDO.class, fields = "name",ref = "maintainunit") | ||
| 42 | private String maintainunit; | 53 | private String maintainunit; |
| 43 | 54 | ||
| 44 | @Schema(description = "权属分类--数据字典:专业绿地和单位(居住区)") | 55 | @Schema(description = "权属分类--数据字典:专业绿地和单位(居住区)") |
| @@ -165,21 +176,33 @@ public class OldtreesChangeLogRespVO { | @@ -165,21 +176,33 @@ public class OldtreesChangeLogRespVO { | ||
| 165 | @ExcelProperty("负责人电话") | 176 | @ExcelProperty("负责人电话") |
| 166 | private String responsibleuserphone; | 177 | private String responsibleuserphone; |
| 167 | 178 | ||
| 179 | + @Trans(type = TransType.SIMPLE, target = AdminUserDO.class, fields = "nickname", ref = "createbyName") | ||
| 180 | + private Long createby; | ||
| 181 | + | ||
| 168 | @Schema(description = "创建者") | 182 | @Schema(description = "创建者") |
| 169 | @ExcelProperty("创建者") | 183 | @ExcelProperty("创建者") |
| 170 | - private String createby; | 184 | + private String createbyName; |
| 171 | 185 | ||
| 172 | @Schema(description = "创建时间") | 186 | @Schema(description = "创建时间") |
| 173 | @ExcelProperty("创建时间") | 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 | private LocalDateTime createtime; | 191 | private LocalDateTime createtime; |
| 175 | 192 | ||
| 193 | + @Trans(type = TransType.SIMPLE, target = AdminUserDO.class, fields = "nickname", ref = "updatebyName") | ||
| 194 | + private Long updateby; | ||
| 195 | + | ||
| 176 | @Schema(description = "更新者") | 196 | @Schema(description = "更新者") |
| 177 | @ExcelProperty("更新者") | 197 | @ExcelProperty("更新者") |
| 178 | - private String updateby; | 198 | + private String updatebyName; |
| 179 | 199 | ||
| 180 | @Schema(description = "更新时间") | 200 | @Schema(description = "更新时间") |
| 181 | @ExcelProperty("更新时间") | 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 | private List<String> treeImgList; | 207 | private List<String> treeImgList; |
| 185 | 208 |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/tree/TreeController.java
| 1 | package com.zteits.urbanops.module.garden.controller.admin.tree; | 1 | package com.zteits.urbanops.module.garden.controller.admin.tree; |
| 2 | 2 | ||
| 3 | +import com.fhs.core.trans.anno.TransMethodResult; | ||
| 3 | import com.zteits.urbanops.framework.dict.core.DictFrameworkUtils; | 4 | import com.zteits.urbanops.framework.dict.core.DictFrameworkUtils; |
| 4 | import com.zteits.urbanops.framework.security.core.LoginUser; | 5 | import com.zteits.urbanops.framework.security.core.LoginUser; |
| 5 | import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; | 6 | import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; |
| @@ -89,6 +90,7 @@ public class TreeController { | @@ -89,6 +90,7 @@ public class TreeController { | ||
| 89 | @Operation(summary = "获得一树一档案") | 90 | @Operation(summary = "获得一树一档案") |
| 90 | @Parameter(name = "id", description = "编号", required = true, example = "1024") | 91 | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| 91 | @PreAuthorize("@ss.hasPermission('garden:tree:query')") | 92 | @PreAuthorize("@ss.hasPermission('garden:tree:query')") |
| 93 | + @TransMethodResult | ||
| 92 | public CommonResult<TreeRespVO> getTree(@RequestParam("id") Long id) { | 94 | public CommonResult<TreeRespVO> getTree(@RequestParam("id") Long id) { |
| 93 | TreeDO tree = treeService.getTree(id); | 95 | TreeDO tree = treeService.getTree(id); |
| 94 | return success(BeanUtils.toBean(tree, TreeRespVO.class)); | 96 | return success(BeanUtils.toBean(tree, TreeRespVO.class)); |
| @@ -142,20 +144,17 @@ public class TreeController { | @@ -142,20 +144,17 @@ public class TreeController { | ||
| 142 | 144 | ||
| 143 | private void fillDictData(List<TreeDO> list) { | 145 | private void fillDictData(List<TreeDO> list) { |
| 144 | for (TreeDO gardenTree : list) { | 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 | gardenTree.setStreet(street); | 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 | gardenTree.setOldtreeownership(ownership); | 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 | gardenTree.setGrowthvigor(growthVigor); | 154 | gardenTree.setGrowthvigor(growthVigor); |
| 156 | - String treeLevel = DictFrameworkUtils.parseDictDataValue("tree_level", gardenTree.getTreelevel()); | 155 | + String treeLevel = DictFrameworkUtils.parseDictDataLabel("tree_level", gardenTree.getTreelevel()); |
| 157 | gardenTree.setTreelevel(treeLevel); | 156 | gardenTree.setTreelevel(treeLevel); |
| 158 | - String dataState = DictFrameworkUtils.parseDictDataValue("data_state", gardenTree.getDatastate()); | 157 | + String dataState = DictFrameworkUtils.parseDictDataLabel("data_state", gardenTree.getDatastate()); |
| 159 | gardenTree.setDatastate(dataState); | 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 | package com.zteits.urbanops.module.garden.controller.admin.tree.vo; | 1 | package com.zteits.urbanops.module.garden.controller.admin.tree.vo; |
| 2 | 2 | ||
| 3 | import com.baomidou.mybatisplus.annotation.TableField; | 3 | import com.baomidou.mybatisplus.annotation.TableField; |
| 4 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 5 | +import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
| 4 | import com.fhs.core.trans.anno.Trans; | 6 | import com.fhs.core.trans.anno.Trans; |
| 5 | import com.fhs.core.trans.constant.TransType; | 7 | import com.fhs.core.trans.constant.TransType; |
| 8 | +import com.zteits.urbanops.framework.common.util.json.databind.LocalDateTimeStringSerializer; | ||
| 6 | import com.zteits.urbanops.module.system.dal.dataobject.dept.DeptDO; | 9 | import com.zteits.urbanops.module.system.dal.dataobject.dept.DeptDO; |
| 10 | +import com.zteits.urbanops.module.system.dal.dataobject.user.AdminUserDO; | ||
| 7 | import io.swagger.v3.oas.annotations.media.Schema; | 11 | import io.swagger.v3.oas.annotations.media.Schema; |
| 8 | import lombok.*; | 12 | import lombok.*; |
| 9 | import java.util.*; | 13 | import java.util.*; |
| @@ -11,13 +15,16 @@ import org.springframework.format.annotation.DateTimeFormat; | @@ -11,13 +15,16 @@ import org.springframework.format.annotation.DateTimeFormat; | ||
| 11 | import java.time.LocalDateTime; | 15 | import java.time.LocalDateTime; |
| 12 | import cn.idev.excel.annotation.*; | 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 | @Schema(description = "管理后台 - 一树一档案 Response VO") | 21 | @Schema(description = "管理后台 - 一树一档案 Response VO") |
| 15 | @Data | 22 | @Data |
| 16 | @ExcelIgnoreUnannotated | 23 | @ExcelIgnoreUnannotated |
| 17 | public class TreeRespVO { | 24 | public class TreeRespVO { |
| 18 | 25 | ||
| 19 | @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "28236") | 26 | @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "28236") |
| 20 | - @ExcelProperty("id") | 27 | +// @ExcelProperty("id") |
| 21 | private Long id; | 28 | private Long id; |
| 22 | 29 | ||
| 23 | @Schema(description = "编号") | 30 | @Schema(description = "编号") |
| @@ -37,7 +44,7 @@ public class TreeRespVO { | @@ -37,7 +44,7 @@ public class TreeRespVO { | ||
| 37 | private String treeheight; | 44 | private String treeheight; |
| 38 | 45 | ||
| 39 | @Schema(description = "冠幅") | 46 | @Schema(description = "冠幅") |
| 40 | - @ExcelProperty("冠幅") | 47 | +// @ExcelProperty("冠幅") |
| 41 | private String canopy; | 48 | private String canopy; |
| 42 | 49 | ||
| 43 | @Schema(description = "胸径") | 50 | @Schema(description = "胸径") |
| @@ -45,11 +52,11 @@ public class TreeRespVO { | @@ -45,11 +52,11 @@ public class TreeRespVO { | ||
| 45 | private String dbh; | 52 | private String dbh; |
| 46 | 53 | ||
| 47 | @Schema(description = "生长势--数据字典:正常,衰弱,濒危,死亡") | 54 | @Schema(description = "生长势--数据字典:正常,衰弱,濒危,死亡") |
| 48 | - @ExcelProperty("生长势--数据字典:正常,衰弱,濒危,死亡") | 55 | + @ExcelProperty("生长势") |
| 49 | private String growthvigor; | 56 | private String growthvigor; |
| 50 | 57 | ||
| 51 | @Schema(description = "级别--数据字典:一级、两级") | 58 | @Schema(description = "级别--数据字典:一级、两级") |
| 52 | - @ExcelProperty("级别--数据字典:一级、两级") | 59 | + @ExcelProperty("级别") |
| 53 | private String treelevel; | 60 | private String treelevel; |
| 54 | 61 | ||
| 55 | @Schema(description = "经度") | 62 | @Schema(description = "经度") |
| @@ -61,24 +68,19 @@ public class TreeRespVO { | @@ -61,24 +68,19 @@ public class TreeRespVO { | ||
| 61 | private String latitude; | 68 | private String latitude; |
| 62 | 69 | ||
| 63 | @Schema(description = "所在地") | 70 | @Schema(description = "所在地") |
| 64 | - @ExcelProperty("所在地") | 71 | +// @ExcelProperty("所在地") |
| 65 | private String location; | 72 | private String location; |
| 66 | 73 | ||
| 67 | @Schema(description = "养护单位") | 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 | @ExcelProperty("养护单位") | 75 | @ExcelProperty("养护单位") |
| 74 | - private String maintainUnitName; | 76 | + private String maintainunit; |
| 75 | 77 | ||
| 76 | @Schema(description = "管护单位") | 78 | @Schema(description = "管护单位") |
| 77 | @ExcelProperty("管护单位") | 79 | @ExcelProperty("管护单位") |
| 78 | private String managedutyunit; | 80 | private String managedutyunit; |
| 79 | 81 | ||
| 80 | @Schema(description = "道路id") | 82 | @Schema(description = "道路id") |
| 81 | - @ExcelProperty("道路id") | 83 | +// @ExcelProperty("道路id") |
| 82 | private Long road; | 84 | private Long road; |
| 83 | 85 | ||
| 84 | @Schema(description = "所属街道") | 86 | @Schema(description = "所属街道") |
| @@ -86,11 +88,11 @@ public class TreeRespVO { | @@ -86,11 +88,11 @@ public class TreeRespVO { | ||
| 86 | private String street; | 88 | private String street; |
| 87 | 89 | ||
| 88 | @Schema(description = "权属分类--数据字典:专业绿地和单位(居住区)") | 90 | @Schema(description = "权属分类--数据字典:专业绿地和单位(居住区)") |
| 89 | - @ExcelProperty("权属分类--数据字典:专业绿地和单位(居住区)") | 91 | + @ExcelProperty("权属分类") |
| 90 | private String oldtreeownership; | 92 | private String oldtreeownership; |
| 91 | 93 | ||
| 92 | @Schema(description = "数据状态(已更新、未更新)") | 94 | @Schema(description = "数据状态(已更新、未更新)") |
| 93 | - @ExcelProperty("数据状态(已更新、未更新)") | 95 | +// @ExcelProperty("数据状态(已更新、未更新)") |
| 94 | private String datastate; | 96 | private String datastate; |
| 95 | 97 | ||
| 96 | @Schema(description = "估测树龄") | 98 | @Schema(description = "估测树龄") |
| @@ -137,28 +139,40 @@ public class TreeRespVO { | @@ -137,28 +139,40 @@ public class TreeRespVO { | ||
| 137 | @ExcelProperty("古树照片五") | 139 | @ExcelProperty("古树照片五") |
| 138 | private String treephotofive; | 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 | private LocalDateTime createtime; | 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 | private LocalDateTime updatetime; | 168 | private LocalDateTime updatetime; |
| 155 | 169 | ||
| 156 | @Schema(description = "备注", example = "你说的对") | 170 | @Schema(description = "备注", example = "你说的对") |
| 157 | - @ExcelProperty("备注") | 171 | +// @ExcelProperty("备注") |
| 158 | private String remark; | 172 | private String remark; |
| 159 | 173 | ||
| 160 | @Schema(description = "部门id", requiredMode = Schema.RequiredMode.REQUIRED, example = "17101") | 174 | @Schema(description = "部门id", requiredMode = Schema.RequiredMode.REQUIRED, example = "17101") |
| 161 | - @ExcelProperty("部门id") | 175 | +// @ExcelProperty("部门id") |
| 162 | private Long deptId; | 176 | private Long deptId; |
| 163 | 177 | ||
| 164 | private List<String> treeImgList; | 178 | private List<String> treeImgList; |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/tree/vo/TreeSaveReqVO.java
| 1 | package com.zteits.urbanops.module.garden.controller.admin.tree.vo; | 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 | import io.swagger.v3.oas.annotations.media.Schema; | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | import lombok.*; | 5 | import lombok.*; |
| 5 | import java.util.*; | 6 | import java.util.*; |
| 6 | import jakarta.validation.constraints.*; | 7 | import jakarta.validation.constraints.*; |
| 7 | import org.springframework.format.annotation.DateTimeFormat; | 8 | import org.springframework.format.annotation.DateTimeFormat; |
| 9 | +import org.springframework.util.CollectionUtils; | ||
| 10 | +import org.springframework.util.StringUtils; | ||
| 11 | + | ||
| 8 | import java.time.LocalDateTime; | 12 | import java.time.LocalDateTime; |
| 9 | 13 | ||
| 10 | @Schema(description = "管理后台 - 一树一档案新增/修改 Request VO") | 14 | @Schema(description = "管理后台 - 一树一档案新增/修改 Request VO") |
| @@ -121,5 +125,47 @@ public class TreeSaveReqVO { | @@ -121,5 +125,47 @@ public class TreeSaveReqVO { | ||
| 121 | 125 | ||
| 122 | private List<String> treeImgList; | 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 | \ No newline at end of file | 172 | \ No newline at end of file |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/treechangelog/TreeChangeLogController.java
| 1 | package com.zteits.urbanops.module.garden.controller.admin.treechangelog; | 1 | package com.zteits.urbanops.module.garden.controller.admin.treechangelog; |
| 2 | 2 | ||
| 3 | +import com.fhs.core.trans.anno.TransMethodResult; | ||
| 3 | import org.springframework.web.bind.annotation.*; | 4 | import org.springframework.web.bind.annotation.*; |
| 4 | import jakarta.annotation.Resource; | 5 | import jakarta.annotation.Resource; |
| 5 | import org.springframework.validation.annotation.Validated; | 6 | import org.springframework.validation.annotation.Validated; |
| @@ -75,6 +76,7 @@ public class TreeChangeLogController { | @@ -75,6 +76,7 @@ public class TreeChangeLogController { | ||
| 75 | @Operation(summary = "获得一树一档案修改记录") | 76 | @Operation(summary = "获得一树一档案修改记录") |
| 76 | @Parameter(name = "id", description = "编号", required = true, example = "1024") | 77 | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| 77 | @PreAuthorize("@ss.hasPermission('garden:tree-change-log:query')") | 78 | @PreAuthorize("@ss.hasPermission('garden:tree-change-log:query')") |
| 79 | + @TransMethodResult | ||
| 78 | public CommonResult<TreeChangeLogRespVO> getTreeChangeLog(@RequestParam("id") Long id) { | 80 | public CommonResult<TreeChangeLogRespVO> getTreeChangeLog(@RequestParam("id") Long id) { |
| 79 | TreeChangeLogDO treeChangeLog = treeChangeLogService.getTreeChangeLog(id); | 81 | TreeChangeLogDO treeChangeLog = treeChangeLogService.getTreeChangeLog(id); |
| 80 | return success(BeanUtils.toBean(treeChangeLog, TreeChangeLogRespVO.class)); | 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 | \ No newline at end of file | 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,6 +5,7 @@ import java.util.*; | ||
| 5 | import java.time.LocalDateTime; | 5 | import java.time.LocalDateTime; |
| 6 | import com.baomidou.mybatisplus.annotation.*; | 6 | import com.baomidou.mybatisplus.annotation.*; |
| 7 | import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; | 7 | import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; |
| 8 | +import org.springframework.format.annotation.DateTimeFormat; | ||
| 8 | import org.springframework.util.CollectionUtils; | 9 | import org.springframework.util.CollectionUtils; |
| 9 | import org.springframework.util.StringUtils; | 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,6 +25,7 @@ public interface OldtreesChangeLogMapper extends BaseMapperX<OldtreesChangeLogDO | ||
| 25 | .selectAs(DeptDO::getName, OldtreesChangeLogDO::getMaintainunit) | 25 | .selectAs(DeptDO::getName, OldtreesChangeLogDO::getMaintainunit) |
| 26 | .selectAll(OldtreesChangeLogDO.class) | 26 | .selectAll(OldtreesChangeLogDO.class) |
| 27 | .leftJoin(DeptDO.class, DeptDO::getId, OldtreesChangeLogDO::getMaintainunit) | 27 | .leftJoin(DeptDO.class, DeptDO::getId, OldtreesChangeLogDO::getMaintainunit) |
| 28 | + .eqIfPresent(OldtreesChangeLogDO::getOldtreeid, reqVO.getOldtreeid()) | ||
| 28 | .eqIfPresent(OldtreesChangeLogDO::getFamoustreenumber, reqVO.getFamoustreenumber()) | 29 | .eqIfPresent(OldtreesChangeLogDO::getFamoustreenumber, reqVO.getFamoustreenumber()) |
| 29 | .eqIfPresent(OldtreesChangeLogDO::getTreelevel, reqVO.getTreelevel()) | 30 | .eqIfPresent(OldtreesChangeLogDO::getTreelevel, reqVO.getTreelevel()) |
| 30 | .eqIfPresent(OldtreesChangeLogDO::getTreetype, reqVO.getTreetype()) | 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,13 +44,12 @@ public class OldtreesServiceImpl implements OldtreesService { | ||
| 44 | 44 | ||
| 45 | @Override | 45 | @Override |
| 46 | public String createOldtrees(OldtreesSaveReqVO createReqVO) { | 46 | public String createOldtrees(OldtreesSaveReqVO createReqVO) { |
| 47 | + | ||
| 48 | + createReqVO.imgToDomain(); | ||
| 49 | + | ||
| 47 | // 插入 | 50 | // 插入 |
| 48 | OldtreesDO oldtrees = BeanUtils.toBean(createReqVO, OldtreesDO.class); | 51 | OldtreesDO oldtrees = BeanUtils.toBean(createReqVO, OldtreesDO.class); |
| 49 | 52 | ||
| 50 | - if (!ObjectUtils.isEmpty(oldtrees)) { | ||
| 51 | - oldtrees.imgToDomain(); | ||
| 52 | - } | ||
| 53 | - | ||
| 54 | String id = oldtrees.getId(); | 53 | String id = oldtrees.getId(); |
| 55 | if (!StringUtils.hasText(id)) { | 54 | if (!StringUtils.hasText(id)) { |
| 56 | id = UUID.randomUUID().toString().replace("-", ""); | 55 | id = UUID.randomUUID().toString().replace("-", ""); |
| @@ -66,6 +65,7 @@ public class OldtreesServiceImpl implements OldtreesService { | @@ -66,6 +65,7 @@ public class OldtreesServiceImpl implements OldtreesService { | ||
| 66 | 65 | ||
| 67 | OldtreesChangeLogDO changeLog = new OldtreesChangeLogDO(); | 66 | OldtreesChangeLogDO changeLog = new OldtreesChangeLogDO(); |
| 68 | BeanUtils.copyProperties(createReqVO, changeLog); | 67 | BeanUtils.copyProperties(createReqVO, changeLog); |
| 68 | + changeLog.setId(id); | ||
| 69 | changeLog.setOldtreeid(id); | 69 | changeLog.setOldtreeid(id); |
| 70 | changeLog.setCreateby(createReqVO.getCreateby()); | 70 | changeLog.setCreateby(createReqVO.getCreateby()); |
| 71 | changeLog.setCreatetime(createReqVO.getCreatetime()); | 71 | changeLog.setCreatetime(createReqVO.getCreatetime()); |
| @@ -79,6 +79,8 @@ public class OldtreesServiceImpl implements OldtreesService { | @@ -79,6 +79,8 @@ public class OldtreesServiceImpl implements OldtreesService { | ||
| 79 | 79 | ||
| 80 | @Override | 80 | @Override |
| 81 | public void updateOldtrees(OldtreesSaveReqVO updateReqVO) { | 81 | public void updateOldtrees(OldtreesSaveReqVO updateReqVO) { |
| 82 | + | ||
| 83 | + updateReqVO.imgToDomain(); | ||
| 82 | // 校验存在 | 84 | // 校验存在 |
| 83 | OldtreesDO dbOlderTree = validateOldtreesExists(updateReqVO.getId()); | 85 | OldtreesDO dbOlderTree = validateOldtreesExists(updateReqVO.getId()); |
| 84 | 86 | ||
| @@ -93,10 +95,9 @@ public class OldtreesServiceImpl implements OldtreesService { | @@ -93,10 +95,9 @@ public class OldtreesServiceImpl implements OldtreesService { | ||
| 93 | // 更新 | 95 | // 更新 |
| 94 | OldtreesDO updateObj = BeanUtils.toBean(updateReqVO, OldtreesDO.class); | 96 | OldtreesDO updateObj = BeanUtils.toBean(updateReqVO, OldtreesDO.class); |
| 95 | 97 | ||
| 96 | - updateObj.imgToDomain(); | ||
| 97 | - | ||
| 98 | OldtreesChangeLogDO changeLog = new OldtreesChangeLogDO(); | 98 | OldtreesChangeLogDO changeLog = new OldtreesChangeLogDO(); |
| 99 | org.springframework.beans.BeanUtils.copyProperties(updateReqVO, changeLog); | 99 | org.springframework.beans.BeanUtils.copyProperties(updateReqVO, changeLog); |
| 100 | + changeLog.setId(updateReqVO.getId()); | ||
| 100 | changeLog.setOldtreeid(updateReqVO.getId()); | 101 | changeLog.setOldtreeid(updateReqVO.getId()); |
| 101 | changeLog.setCreateby(updateReqVO.getUpdateby()); | 102 | changeLog.setCreateby(updateReqVO.getUpdateby()); |
| 102 | changeLog.setCreatetime(LocalDateTime.now()); | 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,6 +3,7 @@ package com.zteits.urbanops.module.garden.service.oldtreeschangelog; | ||
| 3 | import cn.hutool.core.collection.CollUtil; | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | import org.springframework.stereotype.Service; | 4 | import org.springframework.stereotype.Service; |
| 5 | import jakarta.annotation.Resource; | 5 | import jakarta.annotation.Resource; |
| 6 | +import org.springframework.util.ObjectUtils; | ||
| 6 | import org.springframework.validation.annotation.Validated; | 7 | import org.springframework.validation.annotation.Validated; |
| 7 | import org.springframework.transaction.annotation.Transactional; | 8 | import org.springframework.transaction.annotation.Transactional; |
| 8 | 9 | ||
| @@ -74,7 +75,11 @@ public class OldtreesChangeLogServiceImpl implements OldtreesChangeLogService { | @@ -74,7 +75,11 @@ public class OldtreesChangeLogServiceImpl implements OldtreesChangeLogService { | ||
| 74 | 75 | ||
| 75 | @Override | 76 | @Override |
| 76 | public OldtreesChangeLogDO getOldtreesChangeLog(String id) { | 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 | @Override | 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,13 +67,10 @@ public class TreeServiceImpl implements TreeService { | ||
| 67 | 67 | ||
| 68 | @Override | 68 | @Override |
| 69 | public Long createTree(TreeSaveReqVO createReqVO) { | 69 | public Long createTree(TreeSaveReqVO createReqVO) { |
| 70 | + createReqVO.imgToDomain(); | ||
| 70 | // 插入 | 71 | // 插入 |
| 71 | TreeDO tree = BeanUtils.toBean(createReqVO, TreeDO.class); | 72 | TreeDO tree = BeanUtils.toBean(createReqVO, TreeDO.class); |
| 72 | 73 | ||
| 73 | - if (!ObjectUtils.isEmpty(tree)) { | ||
| 74 | - tree.imgToDomain(); | ||
| 75 | - } | ||
| 76 | - | ||
| 77 | TreeDO treeDO = treeMapper.selectByTreeNumber(createReqVO.getTreenumber()); | 74 | TreeDO treeDO = treeMapper.selectByTreeNumber(createReqVO.getTreenumber()); |
| 78 | if (!ObjectUtils.isEmpty(treeDO)) { | 75 | if (!ObjectUtils.isEmpty(treeDO)) { |
| 79 | throw exception(TREE_NUMBER_EXISTS); | 76 | throw exception(TREE_NUMBER_EXISTS); |
| @@ -109,6 +106,7 @@ public class TreeServiceImpl implements TreeService { | @@ -109,6 +106,7 @@ public class TreeServiceImpl implements TreeService { | ||
| 109 | 106 | ||
| 110 | @Override | 107 | @Override |
| 111 | public void updateTree(TreeSaveReqVO updateReqVO) { | 108 | public void updateTree(TreeSaveReqVO updateReqVO) { |
| 109 | + updateReqVO.imgToDomain(); | ||
| 112 | // 校验存在 | 110 | // 校验存在 |
| 113 | TreeDO dbTree = validateTreeExists(updateReqVO.getId()); | 111 | TreeDO dbTree = validateTreeExists(updateReqVO.getId()); |
| 114 | if (!ObjectUtils.isEmpty(dbTree) && !dbTree.getTreenumber().equals(updateReqVO.getTreenumber())) { | 112 | if (!ObjectUtils.isEmpty(dbTree) && !dbTree.getTreenumber().equals(updateReqVO.getTreenumber())) { |
| @@ -120,7 +118,6 @@ public class TreeServiceImpl implements TreeService { | @@ -120,7 +118,6 @@ public class TreeServiceImpl implements TreeService { | ||
| 120 | 118 | ||
| 121 | // 更新 | 119 | // 更新 |
| 122 | TreeDO updateObj = BeanUtils.toBean(updateReqVO, TreeDO.class); | 120 | TreeDO updateObj = BeanUtils.toBean(updateReqVO, TreeDO.class); |
| 123 | - updateObj.imgToDomain(); | ||
| 124 | 121 | ||
| 125 | if (ObjectUtils.isEmpty(updateReqVO.getStreet())) { | 122 | if (ObjectUtils.isEmpty(updateReqVO.getStreet())) { |
| 126 | Long road = updateReqVO.getRoad(); | 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,6 +3,7 @@ package com.zteits.urbanops.module.garden.service.treechangelog; | ||
| 3 | import cn.hutool.core.collection.CollUtil; | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | import org.springframework.stereotype.Service; | 4 | import org.springframework.stereotype.Service; |
| 5 | import jakarta.annotation.Resource; | 5 | import jakarta.annotation.Resource; |
| 6 | +import org.springframework.util.ObjectUtils; | ||
| 6 | import org.springframework.validation.annotation.Validated; | 7 | import org.springframework.validation.annotation.Validated; |
| 7 | import org.springframework.transaction.annotation.Transactional; | 8 | import org.springframework.transaction.annotation.Transactional; |
| 8 | 9 | ||
| @@ -74,7 +75,11 @@ public class TreeChangeLogServiceImpl implements TreeChangeLogService { | @@ -74,7 +75,11 @@ public class TreeChangeLogServiceImpl implements TreeChangeLogService { | ||
| 74 | 75 | ||
| 75 | @Override | 76 | @Override |
| 76 | public TreeChangeLogDO getTreeChangeLog(Long id) { | 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 | @Override | 85 | @Override |
urbanops-module-garden/src/main/resources/mapper/departmentcost/DepartmentCostMapper.xml
| @@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
| 4 | 4 | ||
| 5 | <select id="selectDuplicateIds" resultType="java.lang.Long"> | 5 | <select id="selectDuplicateIds" resultType="java.lang.Long"> |
| 6 | SELECT id | 6 | SELECT id |
| 7 | - FROM td_department_cost | 7 | + FROM garden_department_cost |
| 8 | WHERE | 8 | WHERE |
| 9 | <foreach collection="keyList" item="key" separator="OR"> | 9 | <foreach collection="keyList" item="key" separator="OR"> |
| 10 | (salary_month = #{key.salaryMonth} AND expense_name = #{key.expenseName} and company_id=#{key.companyId}) | 10 | (salary_month = #{key.salaryMonth} AND expense_name = #{key.expenseName} and company_id=#{key.companyId}) |
urbanops-module-gloabl/src/main/resources/mapper/mechanicalcost/MechanicalCostMapper.xml renamed to urbanops-module-garden/src/main/resources/mapper/mechanicalcost/MechanicalCostMapper.xml
| @@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
| 4 | 4 | ||
| 5 | <select id="selectDuplicateIds" resultType="java.lang.Long"> | 5 | <select id="selectDuplicateIds" resultType="java.lang.Long"> |
| 6 | SELECT id | 6 | SELECT id |
| 7 | - FROM td_mechanical_cost | 7 | + FROM garden_mechanical_cost |
| 8 | WHERE | 8 | WHERE |
| 9 | <foreach collection="keyList" item="key" separator="OR"> | 9 | <foreach collection="keyList" item="key" separator="OR"> |
| 10 | mech_code =#{key.mechCode} | 10 | mech_code =#{key.mechCode} |
urbanops-module-garden/src/main/resources/mapper/personalcost/PersonalCostMapper.xml
| @@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
| 4 | 4 | ||
| 5 | <select id="selectDuplicateIds" resultType="java.lang.Long"> | 5 | <select id="selectDuplicateIds" resultType="java.lang.Long"> |
| 6 | SELECT id | 6 | SELECT id |
| 7 | - FROM td_personal_cost | 7 | + FROM garden_personal_cost |
| 8 | WHERE | 8 | WHERE |
| 9 | <foreach collection="keyList" item="key" separator="OR"> | 9 | <foreach collection="keyList" item="key" separator="OR"> |
| 10 | (salary_month = #{key.salaryMonth} AND name = #{key.name}) | 10 | (salary_month = #{key.salaryMonth} AND name = #{key.name}) |
urbanops-module-garden/src/main/resources/mapper/teambizdomainrel/TeamBizdomainRelMapper.xml deleted
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
| 3 | -<mapper namespace="com.zteits.urbanops.module.garden.dal.mysql.teambizdomainrel.TeamBizdomainRelMapper"> | ||
| 4 | - | ||
| 5 | - <!-- | ||
| 6 | - 一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 | ||
| 7 | - 无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。 | ||
| 8 | - 代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 | ||
| 9 | - 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ | ||
| 10 | - --> | ||
| 11 | - | ||
| 12 | -</mapper> | ||
| 13 | \ No newline at end of file | 0 | \ No newline at end of file |
urbanops-module-garden/src/main/resources/mapper/waterfee/WaterFeeMapper.xml
| @@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
| 5 | 5 | ||
| 6 | <select id="selectDuplicateIds" resultType="java.lang.Long"> | 6 | <select id="selectDuplicateIds" resultType="java.lang.Long"> |
| 7 | SELECT id | 7 | SELECT id |
| 8 | - FROM td_water_fee | 8 | + FROM garden_water_fee |
| 9 | WHERE | 9 | WHERE |
| 10 | <foreach collection="keyList" item="key" separator="OR"> | 10 | <foreach collection="keyList" item="key" separator="OR"> |
| 11 | (fee_month = #{key.feeMonth} AND meter_code = #{key.meterCode}) | 11 | (fee_month = #{key.feeMonth} AND meter_code = #{key.meterCode}) |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/api/constant/BpmCommonConstant.java
| @@ -8,6 +8,10 @@ package com.zteits.urbanops.module.workorder.api.constant; | @@ -8,6 +8,10 @@ package com.zteits.urbanops.module.workorder.api.constant; | ||
| 8 | */ | 8 | */ |
| 9 | public class BpmCommonConstant { | 9 | public class BpmCommonConstant { |
| 10 | /** | 10 | /** |
| 11 | + * 通用快速流程 | ||
| 12 | + */ | ||
| 13 | + public static final String COMMON_QUICK_PROCESS = "common_quick_process"; | ||
| 14 | + /** | ||
| 11 | * 园林巡检工单 流程业务key | 15 | * 园林巡检工单 流程业务key |
| 12 | */ | 16 | */ |
| 13 | public static final String BPM_GARDEN_INSPECT_WO = "garden_inspect_wo"; | 17 | public static final String BPM_GARDEN_INSPECT_WO = "garden_inspect_wo"; |
| @@ -31,5 +35,13 @@ public class BpmCommonConstant { | @@ -31,5 +35,13 @@ public class BpmCommonConstant { | ||
| 31 | * 园林远景图片类型 | 35 | * 园林远景图片类型 |
| 32 | */ | 36 | */ |
| 33 | public static final String GARDEN_INSPECT_WO_ATTACH3 = "03"; | 37 | public static final String GARDEN_INSPECT_WO_ATTACH3 = "03"; |
| 38 | + /** | ||
| 39 | + * 园林工单编号前缀 | ||
| 40 | + */ | ||
| 41 | + public static final String WORK_ORDER_PREFFIX_GARDEN = "GWO"; | ||
| 42 | + /** | ||
| 43 | + * 快速工单编号前缀 | ||
| 44 | + */ | ||
| 45 | + public static final String WORK_ORDER_PREFFIX_QUICK = "QWO"; | ||
| 34 | 46 | ||
| 35 | } | 47 | } |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/api/workorder/WorkOrderApi.java
0 → 100644
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/api/workorder/WorkOrderApiImpl.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.api.workorder; | ||
| 2 | + | ||
| 3 | +import com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant; | ||
| 4 | +import org.springframework.stereotype.Service; | ||
| 5 | +import org.springframework.util.ObjectUtils; | ||
| 6 | + | ||
| 7 | +import java.time.LocalDateTime; | ||
| 8 | +import java.time.format.DateTimeFormatter; | ||
| 9 | +import java.util.concurrent.atomic.AtomicInteger; | ||
| 10 | + | ||
| 11 | +/** | ||
| 12 | + * @author yanhuiqing | ||
| 13 | + * @version 1.0 | ||
| 14 | + * @description: 工单对外api | ||
| 15 | + * @date 2025/12/5 17:21 | ||
| 16 | + */ | ||
| 17 | +@Service | ||
| 18 | +public class WorkOrderApiImpl implements WorkOrderApi{ | ||
| 19 | + | ||
| 20 | + private static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern("yyyyMMddHHmmss"); | ||
| 21 | + private static final AtomicInteger counter = new AtomicInteger(1); | ||
| 22 | + | ||
| 23 | + @Override | ||
| 24 | + public String generateWONum(String prefix) { | ||
| 25 | + if (ObjectUtils.isEmpty(prefix)) { | ||
| 26 | + prefix = BpmCommonConstant.WORK_ORDER_PREFFIX_GARDEN; | ||
| 27 | + } | ||
| 28 | + String dateStr = LocalDateTime.now().format(DATE_FORMAT); | ||
| 29 | + int seqNum = counter.getAndIncrement(); | ||
| 30 | + if(seqNum>999){ | ||
| 31 | + synchronized (counter) { | ||
| 32 | + if (counter.intValue() > 999) { | ||
| 33 | + counter.set(1); | ||
| 34 | + } | ||
| 35 | + seqNum = counter.getAndIncrement(); | ||
| 36 | + } | ||
| 37 | + } | ||
| 38 | + return String.format("%s%03d_%s", prefix, seqNum,dateStr); | ||
| 39 | + } | ||
| 40 | +} |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/AppGardenWorkOrderController.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.controller.app.garden; | ||
| 2 | + | ||
| 3 | +import com.zteits.urbanops.framework.common.pojo.CommonResult; | ||
| 4 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | ||
| 5 | +import com.zteits.urbanops.framework.common.util.object.BeanUtils; | ||
| 6 | +import com.zteits.urbanops.module.workorder.controller.admin.garden.vo.BpmGardenWorkOrderPageReqVO; | ||
| 7 | +import com.zteits.urbanops.module.workorder.controller.admin.garden.vo.BpmGardenWorkOrderRespVO; | ||
| 8 | +import com.zteits.urbanops.module.workorder.controller.app.garden.vo.AppGardenWorkOrderReqVO; | ||
| 9 | +import com.zteits.urbanops.module.workorder.dal.dataobject.garden.BpmGardenWorkOrderDO; | ||
| 10 | +import com.zteits.urbanops.module.workorder.service.garden.BpmGardenService; | ||
| 11 | +import io.swagger.v3.oas.annotations.Operation; | ||
| 12 | +import io.swagger.v3.oas.annotations.Parameter; | ||
| 13 | +import io.swagger.v3.oas.annotations.tags.Tag; | ||
| 14 | +import jakarta.annotation.Resource; | ||
| 15 | +import jakarta.validation.Valid; | ||
| 16 | +import org.springframework.security.access.prepost.PreAuthorize; | ||
| 17 | +import org.springframework.web.bind.annotation.*; | ||
| 18 | + | ||
| 19 | +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; | ||
| 20 | +import static com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; | ||
| 21 | + | ||
| 22 | +/** | ||
| 23 | + * @author yanhuiqing | ||
| 24 | + * @version 1.0 | ||
| 25 | + * @description: app端 园林工单请求入口 | ||
| 26 | + * @date 2025/12/6 10:07 | ||
| 27 | + */ | ||
| 28 | +@Tag(name = "APP - 园林工单bpm") | ||
| 29 | +@RestController | ||
| 30 | +@RequestMapping("/app/garden/workorder") | ||
| 31 | +public class AppGardenWorkOrderController { | ||
| 32 | + @Resource | ||
| 33 | + private BpmGardenService gardenService; | ||
| 34 | + | ||
| 35 | + @PostMapping("/create") | ||
| 36 | + @Operation(summary = "app-创建工单信息") | ||
| 37 | + public CommonResult<Long> createMainInfo(@Valid @RequestBody AppGardenWorkOrderReqVO createReqVO) { | ||
| 38 | + return success(gardenService.createWorkOrder(createReqVO)); | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + @PostMapping("/createQuick") | ||
| 42 | + @Operation(summary = "app-创建快速工单信息") | ||
| 43 | + public CommonResult<Long> createMainInfoQuick(@Valid @RequestBody AppGardenWorkOrderReqVO createReqVO) { | ||
| 44 | + return success(gardenService.createWorkOrderQuick(createReqVO)); | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + @GetMapping("/get") | ||
| 48 | + @Operation(summary = "app-获得工单详情") | ||
| 49 | + @Parameter(name = "id", description = "编号", required = true, example = "1024") | ||
| 50 | + public CommonResult<BpmGardenWorkOrderRespVO> getGardenInspection(@RequestParam("id") Long id) { | ||
| 51 | + BpmGardenWorkOrderDO gardenInspection = gardenService.getWorkOrder(id); | ||
| 52 | + return success(BeanUtils.toBean(gardenInspection, BpmGardenWorkOrderRespVO.class)); | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + @GetMapping("/page") | ||
| 56 | + @Operation(summary = "app-获得园林巡检工单申请分页") | ||
| 57 | + public CommonResult<PageResult<BpmGardenWorkOrderRespVO>> getGardenInspectionPage(@Valid BpmGardenWorkOrderPageReqVO pageVO) { | ||
| 58 | + PageResult<BpmGardenWorkOrderDO> pageResult = gardenService.getGardenInspectionPage(getLoginUserId(), pageVO); | ||
| 59 | + return success(BeanUtils.toBean(pageResult, BpmGardenWorkOrderRespVO.class)); | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | +} |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/vo/AppGardenWorkOrderReqVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.controller.app.garden.vo; | ||
| 2 | + | ||
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | +import jakarta.validation.constraints.NotEmpty; | ||
| 5 | +import jakarta.validation.constraints.NotNull; | ||
| 6 | +import lombok.Data; | ||
| 7 | +import org.hibernate.validator.constraints.Length; | ||
| 8 | + | ||
| 9 | +import java.math.BigDecimal; | ||
| 10 | +import java.util.List; | ||
| 11 | +import java.util.Map; | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * @author yanhuiqing | ||
| 15 | + * @version 1.0 | ||
| 16 | + * @description: app端请求参数 | ||
| 17 | + * @date 2025/12/6 10:17 | ||
| 18 | + */ | ||
| 19 | +@Schema(description = "APP-园林工单请求创建 Request VO") | ||
| 20 | +@Data | ||
| 21 | +public class AppGardenWorkOrderReqVO { | ||
| 22 | + | ||
| 23 | + | ||
| 24 | + @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21128") | ||
| 25 | + @NotNull(message = "道路ID不能为空") | ||
| 26 | + private Long roadId; | ||
| 27 | + | ||
| 28 | + @Schema(description = "问题图片", example = "9184") | ||
| 29 | + private List<String> imgs; | ||
| 30 | + | ||
| 31 | + @Schema(description = "处理完成照片", example = "9184") | ||
| 32 | + private List<String> longRangeImgList; | ||
| 33 | + | ||
| 34 | + @Schema(description = "工单描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对") | ||
| 35 | + @NotEmpty(message = "工单描述不能为空") | ||
| 36 | + @Length(max = 500) | ||
| 37 | + private String remark; | ||
| 38 | + | ||
| 39 | + @NotEmpty(message = "经纬度类型") | ||
| 40 | + @Schema(description = "经纬度类型: 1:国标; 2:百度;3:高德;4:腾讯", example = "2") | ||
| 41 | + private Integer latLonType; | ||
| 42 | + | ||
| 43 | + @Schema(description = "经度", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| 44 | + @NotNull(message = "经度不能为空") | ||
| 45 | + private BigDecimal lat; | ||
| 46 | + | ||
| 47 | + @Schema(description = "维度", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| 48 | + @NotNull(message = "维度不能为空") | ||
| 49 | + private BigDecimal lon; | ||
| 50 | + | ||
| 51 | + @Schema(description = "经纬度地址", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| 52 | + @NotEmpty(message = "经纬度地址不能为空") | ||
| 53 | + private String lonLatAddress; | ||
| 54 | + | ||
| 55 | + @Schema(description = "紧急程度:1:特急;2:紧急;3:一般", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") | ||
| 56 | + @NotNull(message = "紧急程度:1:特急;2:紧急;3:一般不能为空") | ||
| 57 | + private Integer pressingType; | ||
| 58 | + | ||
| 59 | + @Schema(description = "工单名称", example = "绿地卫生") | ||
| 60 | + private String orderName; | ||
| 61 | + | ||
| 62 | + @Schema(description = "来源ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | ||
| 63 | + //@NotNull(message = "来源ID不能为空") | ||
| 64 | + private Integer sourceId; | ||
| 65 | + | ||
| 66 | + @Schema(description = "来源名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "园林") | ||
| 67 | + //@NotEmpty(message = "来源名称不能为空") | ||
| 68 | + private String sourceName; | ||
| 69 | + | ||
| 70 | + @Schema(description = "三方工单ID") | ||
| 71 | + private String thirdWorkNo; | ||
| 72 | + | ||
| 73 | + /* @Schema(description = "发起人自选审批人 Map", example = "{taskKey1: [1, 2]}") | ||
| 74 | + private Map<String, List<Long>> startUserSelectAssignees; | ||
| 75 | + | ||
| 76 | + @Schema(description = "是否需要养护人员修复,'0' 是,'1' 否") | ||
| 77 | + private String isYesOrNo;*/ | ||
| 78 | + | ||
| 79 | + | ||
| 80 | +} |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmGardenService.java
| @@ -3,6 +3,7 @@ package com.zteits.urbanops.module.workorder.service.garden; | @@ -3,6 +3,7 @@ package com.zteits.urbanops.module.workorder.service.garden; | ||
| 3 | import com.zteits.urbanops.framework.common.pojo.PageResult; | 3 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 4 | import com.zteits.urbanops.module.workorder.controller.admin.garden.vo.BpmGardenWorkOrderCreateReqVo; | 4 | import com.zteits.urbanops.module.workorder.controller.admin.garden.vo.BpmGardenWorkOrderCreateReqVo; |
| 5 | import com.zteits.urbanops.module.workorder.controller.admin.garden.vo.BpmGardenWorkOrderPageReqVO; | 5 | import com.zteits.urbanops.module.workorder.controller.admin.garden.vo.BpmGardenWorkOrderPageReqVO; |
| 6 | +import com.zteits.urbanops.module.workorder.controller.app.garden.vo.AppGardenWorkOrderReqVO; | ||
| 6 | import com.zteits.urbanops.module.workorder.dal.dataobject.garden.BpmGardenWorkOrderDO; | 7 | import com.zteits.urbanops.module.workorder.dal.dataobject.garden.BpmGardenWorkOrderDO; |
| 7 | import jakarta.validation.Valid; | 8 | import jakarta.validation.Valid; |
| 8 | /** | 9 | /** |
| @@ -13,6 +14,12 @@ import jakarta.validation.Valid; | @@ -13,6 +14,12 @@ import jakarta.validation.Valid; | ||
| 13 | */ | 14 | */ |
| 14 | public interface BpmGardenService { | 15 | public interface BpmGardenService { |
| 15 | /** | 16 | /** |
| 17 | + * 园林工单申请 app service 接口 | ||
| 18 | + * @param createRequestVo | ||
| 19 | + * @return | ||
| 20 | + */ | ||
| 21 | + Long createWorkOrder(@Valid AppGardenWorkOrderReqVO createRequestVo); | ||
| 22 | + /** | ||
| 16 | * 园林工单申请 Service 接口 | 23 | * 园林工单申请 Service 接口 |
| 17 | * @param userId | 24 | * @param userId |
| 18 | * @param createRequestVo | 25 | * @param createRequestVo |
| @@ -43,4 +50,11 @@ public interface BpmGardenService { | @@ -43,4 +50,11 @@ public interface BpmGardenService { | ||
| 43 | * @return | 50 | * @return |
| 44 | */ | 51 | */ |
| 45 | PageResult<BpmGardenWorkOrderDO> getGardenInspectionPage(Long loginUserId, BpmGardenWorkOrderPageReqVO pageVO); | 52 | PageResult<BpmGardenWorkOrderDO> getGardenInspectionPage(Long loginUserId, BpmGardenWorkOrderPageReqVO pageVO); |
| 53 | + | ||
| 54 | + /** | ||
| 55 | + * 快速流程 | ||
| 56 | + * @param createReqVO | ||
| 57 | + * @return | ||
| 58 | + */ | ||
| 59 | + Long createWorkOrderQuick(@Valid AppGardenWorkOrderReqVO createReqVO); | ||
| 46 | } | 60 | } |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmGardenServiceImpl.java
| @@ -4,13 +4,17 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | @@ -4,13 +4,17 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
| 4 | import com.zteits.urbanops.framework.common.pojo.PageResult; | 4 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 5 | import com.zteits.urbanops.framework.common.util.object.BeanUtils; | 5 | import com.zteits.urbanops.framework.common.util.object.BeanUtils; |
| 6 | import com.zteits.urbanops.framework.common.util.object.ObjectUtils; | 6 | import com.zteits.urbanops.framework.common.util.object.ObjectUtils; |
| 7 | +import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; | ||
| 7 | import com.zteits.urbanops.module.bpm.api.task.BpmProcessInstanceApi; | 8 | import com.zteits.urbanops.module.bpm.api.task.BpmProcessInstanceApi; |
| 8 | import com.zteits.urbanops.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO; | 9 | import com.zteits.urbanops.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO; |
| 9 | import com.zteits.urbanops.module.bpm.enums.task.BpmTaskStatusEnum; | 10 | import com.zteits.urbanops.module.bpm.enums.task.BpmTaskStatusEnum; |
| 11 | +import com.zteits.urbanops.module.bpm.service.task.BpmProcessInstanceService; | ||
| 10 | import com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant; | 12 | import com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant; |
| 13 | +import com.zteits.urbanops.module.workorder.api.workorder.WorkOrderApi; | ||
| 11 | import com.zteits.urbanops.module.workorder.controller.admin.garden.vo.BpmGardenWorkOrderCreateReqVo; | 14 | import com.zteits.urbanops.module.workorder.controller.admin.garden.vo.BpmGardenWorkOrderCreateReqVo; |
| 12 | import com.zteits.urbanops.module.workorder.controller.admin.garden.vo.BpmGardenWorkOrderPageReqVO; | 15 | import com.zteits.urbanops.module.workorder.controller.admin.garden.vo.BpmGardenWorkOrderPageReqVO; |
| 13 | import com.zteits.urbanops.module.workorder.controller.admin.maininfo.vo.MainInfoPageReqVO; | 16 | import com.zteits.urbanops.module.workorder.controller.admin.maininfo.vo.MainInfoPageReqVO; |
| 17 | +import com.zteits.urbanops.module.workorder.controller.app.garden.vo.AppGardenWorkOrderReqVO; | ||
| 14 | import com.zteits.urbanops.module.workorder.dal.dataobject.attachment.AttachmentDO; | 18 | import com.zteits.urbanops.module.workorder.dal.dataobject.attachment.AttachmentDO; |
| 15 | import com.zteits.urbanops.module.workorder.dal.dataobject.garden.BpmGardenWorkOrderDO; | 19 | import com.zteits.urbanops.module.workorder.dal.dataobject.garden.BpmGardenWorkOrderDO; |
| 16 | import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO; | 20 | import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO; |
| @@ -45,6 +49,74 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | @@ -45,6 +49,74 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | ||
| 45 | private MainInfoMapper workOrderMapper; | 49 | private MainInfoMapper workOrderMapper; |
| 46 | @Resource | 50 | @Resource |
| 47 | private BpmProcessInstanceApi processInstanceApi; | 51 | private BpmProcessInstanceApi processInstanceApi; |
| 52 | + @Resource | ||
| 53 | + private WorkOrderApi workOrderApi; | ||
| 54 | + | ||
| 55 | + @Override | ||
| 56 | + @Transactional(rollbackFor = Exception.class) | ||
| 57 | + public Long createWorkOrderQuick(AppGardenWorkOrderReqVO createRequestVo) { | ||
| 58 | + | ||
| 59 | + List<String> imgList = createRequestVo.getImgs(); | ||
| 60 | + //List<String> streetImgList = createRequestVo.getStreetImgList(); | ||
| 61 | + List<String> longRangeImgList = createRequestVo.getLongRangeImgList(); | ||
| 62 | + // 插入 工单 | ||
| 63 | + MainInfoDO workOrder = BeanUtils.toBean(createRequestVo, MainInfoDO.class) | ||
| 64 | + .setStatus(BpmTaskStatusEnum.RUNNING.getStatus()); | ||
| 65 | + //TODO 设置其它值 需从道路表获取 | ||
| 66 | + workOrder.setStreetId("test"); | ||
| 67 | + workOrder.setBuzStatus("t1");//需给出映射关系 | ||
| 68 | + workOrder.setCommitDate(LocalDateTime.now()); | ||
| 69 | + String workOrderNum = workOrderApi.generateWONum(BpmCommonConstant.WORK_ORDER_PREFFIX_QUICK); | ||
| 70 | + workOrder.setOrderNo(workOrderNum); | ||
| 71 | + workOrder.setOrderName("园林工单"); | ||
| 72 | + workOrder.setCompanyId(SecurityFrameworkUtils.getCompanyId()); | ||
| 73 | + workOrder.setBusiLine(SecurityFrameworkUtils.getBusiLine()); | ||
| 74 | + workOrderMapper.insert(workOrder); | ||
| 75 | + | ||
| 76 | + //附件插入 | ||
| 77 | + attachmentApend(imgList,null,longRangeImgList,workOrder); | ||
| 78 | + // 发起 BPM 流程 | ||
| 79 | + Map<String, Object> processInstanceVariables = new HashMap<>(); | ||
| 80 | + processInstanceVariables.put("workOrder", workOrder); | ||
| 81 | + processInstanceVariables.put("imgList", imgList); | ||
| 82 | + processInstanceVariables.put("longRangeImgList", longRangeImgList); | ||
| 83 | + String processInstanceId = processInstanceApi.createProcessInstance(SecurityFrameworkUtils.getLoginUserId(), | ||
| 84 | + new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(BpmCommonConstant.COMMON_QUICK_PROCESS) | ||
| 85 | + .setVariables(processInstanceVariables).setBusinessKey(String.valueOf(workOrder.getId()))); | ||
| 86 | + | ||
| 87 | + // 将工作流的编号,更新到 工单中 | ||
| 88 | + workOrderMapper.updateById(new MainInfoDO().setId(workOrder.getId()).setProcessInstanceId(processInstanceId)); | ||
| 89 | + return workOrder.getId(); | ||
| 90 | + } | ||
| 91 | + | ||
| 92 | + @Override | ||
| 93 | + @Transactional(rollbackFor = Exception.class) | ||
| 94 | + public Long createWorkOrder(AppGardenWorkOrderReqVO createRequestVo) { | ||
| 95 | + List<String> imgList = createRequestVo.getImgs(); | ||
| 96 | + //List<String> streetImgList = createRequestVo.getStreetImgList(); | ||
| 97 | + List<String> longRangeImgList = createRequestVo.getLongRangeImgList(); | ||
| 98 | + | ||
| 99 | + MainInfoDO workOrder = BeanUtils.toBean(createRequestVo, MainInfoDO.class) | ||
| 100 | + .setStatus(BpmTaskStatusEnum.NOT_START.getStatus()); | ||
| 101 | + //TODO 设置其它值 需从道路表获取 | ||
| 102 | + workOrder.setStreetId("test"); | ||
| 103 | + //workOrder.setBuzStatus("t1");//需给出映射关系 | ||
| 104 | + //workOrder.setCommitDate(LocalDateTime.now()); | ||
| 105 | + workOrder.setCompanyId(SecurityFrameworkUtils.getCompanyId()); | ||
| 106 | + workOrder.setBusiLine(SecurityFrameworkUtils.getBusiLine()); | ||
| 107 | + String workOrderNum = workOrderApi.generateWONum(BpmCommonConstant.WORK_ORDER_PREFFIX_GARDEN); | ||
| 108 | + workOrder.setOrderNo(workOrderNum); | ||
| 109 | + //workOrder.setOrderName("园林工单"); | ||
| 110 | + Long userId = com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId(); | ||
| 111 | + String nickname = com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils.getLoginUserNickname(); | ||
| 112 | + workOrder.setUserId(userId); | ||
| 113 | + workOrder.setUserName(nickname); | ||
| 114 | + workOrderMapper.insert(workOrder); | ||
| 115 | + //附件插入 | ||
| 116 | + attachmentApend(imgList,null,longRangeImgList,workOrder); | ||
| 117 | + return workOrder.getId(); | ||
| 118 | + } | ||
| 119 | + | ||
| 48 | @Override | 120 | @Override |
| 49 | @Transactional(rollbackFor = Exception.class) | 121 | @Transactional(rollbackFor = Exception.class) |
| 50 | public Long createWorkOrder(Long userId, BpmGardenWorkOrderCreateReqVo createRequestVo) { | 122 | public Long createWorkOrder(Long userId, BpmGardenWorkOrderCreateReqVo createRequestVo) { |
| @@ -59,6 +131,11 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | @@ -59,6 +131,11 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | ||
| 59 | workOrder.setStreetId("test"); | 131 | workOrder.setStreetId("test"); |
| 60 | workOrder.setBuzStatus("t1");//需给出映射关系 | 132 | workOrder.setBuzStatus("t1");//需给出映射关系 |
| 61 | workOrder.setCommitDate(LocalDateTime.now()); | 133 | workOrder.setCommitDate(LocalDateTime.now()); |
| 134 | + String workOrderNum = workOrderApi.generateWONum(BpmCommonConstant.WORK_ORDER_PREFFIX_GARDEN); | ||
| 135 | + workOrder.setOrderNo(workOrderNum); | ||
| 136 | + workOrder.setOrderName("园林工单"); | ||
| 137 | + workOrder.setCompanyId(SecurityFrameworkUtils.getCompanyId()); | ||
| 138 | + workOrder.setBusiLine(SecurityFrameworkUtils.getBusiLine()); | ||
| 62 | workOrderMapper.insert(workOrder); | 139 | workOrderMapper.insert(workOrder); |
| 63 | 140 | ||
| 64 | //附件插入 | 141 | //附件插入 |
| @@ -160,4 +237,6 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | @@ -160,4 +237,6 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | ||
| 160 | PageResult<BpmGardenWorkOrderDO> targetList = BeanUtils.toBean(pageList,BpmGardenWorkOrderDO.class); | 237 | PageResult<BpmGardenWorkOrderDO> targetList = BeanUtils.toBean(pageList,BpmGardenWorkOrderDO.class); |
| 161 | return targetList; | 238 | return targetList; |
| 162 | } | 239 | } |
| 240 | + | ||
| 241 | + | ||
| 163 | } | 242 | } |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/listener/BomGardenWorkOrderStatusListener.java renamed to urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/listener/BpmGardenWorkOrderStatusListener.java
| @@ -2,6 +2,7 @@ package com.zteits.urbanops.module.workorder.service.garden.listener; | @@ -2,6 +2,7 @@ package com.zteits.urbanops.module.workorder.service.garden.listener; | ||
| 2 | 2 | ||
| 3 | import com.zteits.urbanops.module.bpm.api.event.BpmProcessInstanceStatusEvent; | 3 | import com.zteits.urbanops.module.bpm.api.event.BpmProcessInstanceStatusEvent; |
| 4 | import com.zteits.urbanops.module.bpm.api.event.BpmProcessInstanceStatusEventListener; | 4 | import com.zteits.urbanops.module.bpm.api.event.BpmProcessInstanceStatusEventListener; |
| 5 | +import com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant; | ||
| 5 | import com.zteits.urbanops.module.workorder.service.garden.BpmGardenService; | 6 | import com.zteits.urbanops.module.workorder.service.garden.BpmGardenService; |
| 6 | import jakarta.annotation.Resource; | 7 | import jakarta.annotation.Resource; |
| 7 | import org.springframework.stereotype.Component; | 8 | import org.springframework.stereotype.Component; |
| @@ -13,13 +14,13 @@ import org.springframework.stereotype.Component; | @@ -13,13 +14,13 @@ import org.springframework.stereotype.Component; | ||
| 13 | * @date 2025/12/1 11:45 | 14 | * @date 2025/12/1 11:45 |
| 14 | */ | 15 | */ |
| 15 | @Component | 16 | @Component |
| 16 | -public class BomGardenWorkOrderStatusListener extends BpmProcessInstanceStatusEventListener { | 17 | +public class BpmGardenWorkOrderStatusListener extends BpmProcessInstanceStatusEventListener { |
| 17 | @Resource | 18 | @Resource |
| 18 | private BpmGardenService gardenService; | 19 | private BpmGardenService gardenService; |
| 19 | @Override | 20 | @Override |
| 20 | protected String getProcessDefinitionKey() { | 21 | protected String getProcessDefinitionKey() { |
| 21 | 22 | ||
| 22 | - return null; | 23 | + return BpmCommonConstant.BPM_GARDEN_INSPECT_WO; |
| 23 | } | 24 | } |
| 24 | 25 | ||
| 25 | @Override | 26 | @Override |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/listener/BpmQuickProcessTaskAutoCompleteListener.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.service.garden.listener; | ||
| 2 | + | ||
| 3 | +import com.zteits.urbanops.module.bpm.api.event.BpmProcessInstanceStatusEvent; | ||
| 4 | +import com.zteits.urbanops.module.bpm.api.event.BpmProcessInstanceStatusEventListener; | ||
| 5 | +import com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant; | ||
| 6 | +import com.zteits.urbanops.module.workorder.service.garden.BpmGardenService; | ||
| 7 | +import jakarta.annotation.Resource; | ||
| 8 | +import org.flowable.common.engine.api.delegate.event.FlowableEngineEntityEvent; | ||
| 9 | +import org.springframework.stereotype.Component; | ||
| 10 | + | ||
| 11 | +/** | ||
| 12 | + * @author yanhuiqing | ||
| 13 | + * @version 1.0 | ||
| 14 | + * @description: 快速处理流程的任务自动完成监听器 | ||
| 15 | + * @date 2025/12/6 14:00 | ||
| 16 | + */ | ||
| 17 | +@Component | ||
| 18 | +public class BpmQuickProcessTaskAutoCompleteListener extends BpmProcessInstanceStatusEventListener { | ||
| 19 | + @Resource | ||
| 20 | + private BpmGardenService gardenService; | ||
| 21 | + @Override | ||
| 22 | + protected String getProcessDefinitionKey() { | ||
| 23 | + return BpmCommonConstant.COMMON_QUICK_PROCESS; | ||
| 24 | + } | ||
| 25 | + | ||
| 26 | + @Override | ||
| 27 | + protected void onEvent(BpmProcessInstanceStatusEvent event) { | ||
| 28 | + gardenService.updateWorkOrderStatus(Long.parseLong(event.getBusinessKey()), event.getStatus()); | ||
| 29 | + | ||
| 30 | + } | ||
| 31 | +} |