Commit 7f297997a0f057ded5e501a70be0c3e0d1cb5a77
Merge remote-tracking branch 'origin/de_wangfs_202511' into de_wangfs_202511
Showing
18 changed files
with
645 additions
and
491 deletions
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/inspectionplan/vo/InspectionPlanCommitPageReqVO.java
| ... | ... | @@ -3,6 +3,8 @@ package com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo; |
| 3 | 3 | import lombok.*; |
| 4 | 4 | |
| 5 | 5 | import java.time.LocalDate; |
| 6 | +import java.util.List; | |
| 7 | + | |
| 6 | 8 | import io.swagger.v3.oas.annotations.media.Schema; |
| 7 | 9 | import com.zteits.urbanops.framework.common.pojo.PageParam; |
| 8 | 10 | import org.springframework.format.annotation.DateTimeFormat; |
| ... | ... | @@ -35,9 +37,12 @@ public class InspectionPlanCommitPageReqVO extends PageParam { |
| 35 | 37 | @Schema(description = "部门ID(道路负责部门id)", example = "2714") |
| 36 | 38 | private Long deptId; |
| 37 | 39 | |
| 38 | - @Schema(description = "道路ID", example = "12917") | |
| 40 | + @Schema(description = "道路", example = "12917") | |
| 39 | 41 | private String roadName; |
| 40 | 42 | |
| 43 | + @Schema(description = "角色名称", example = "12917") | |
| 44 | + private String roleName; | |
| 45 | + | |
| 41 | 46 | @Schema(description = "养护级别: 10:特级;11:一级:12:二级;13:三级", example = "10") |
| 42 | 47 | private Integer levelId; |
| 43 | 48 | |
| ... | ... | @@ -56,4 +61,6 @@ public class InspectionPlanCommitPageReqVO extends PageParam { |
| 56 | 61 | |
| 57 | 62 | @Schema(description = "备注", example = "你猜") |
| 58 | 63 | private String remark; |
| 64 | + | |
| 65 | + private List<String> busiLineList; | |
| 59 | 66 | } |
| 60 | 67 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/oldtrees/vo/OldtreesRespVO.java
| 1 | 1 | package com.zteits.urbanops.module.garden.controller.admin.oldtrees.vo; |
| 2 | 2 | |
| 3 | +import com.baomidou.mybatisplus.annotation.TableField; | |
| 4 | +import com.fhs.core.trans.anno.Trans; | |
| 5 | +import com.fhs.core.trans.constant.TransType; | |
| 6 | +import com.zteits.urbanops.module.system.dal.dataobject.dept.DeptDO; | |
| 3 | 7 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | 8 | import lombok.*; |
| 5 | 9 | import java.util.*; |
| ... | ... | @@ -33,9 +37,12 @@ public class OldtreesRespVO { |
| 33 | 37 | private String location; |
| 34 | 38 | |
| 35 | 39 | @Schema(description = "养护单位") |
| 36 | - @ExcelProperty("养护单位") | |
| 37 | 40 | private String maintainunit; |
| 38 | 41 | |
| 42 | + @Schema(description = "养护单位名称") | |
| 43 | + @ExcelProperty("养护单位") | |
| 44 | + private String maintainUnitName; | |
| 45 | + | |
| 39 | 46 | @Schema(description = "权属分类--数据字典:专业绿地和单位(居住区)") |
| 40 | 47 | @ExcelProperty("权属分类--数据字典:专业绿地和单位(居住区)") |
| 41 | 48 | private String oldtreeownership; |
| ... | ... | @@ -180,4 +187,8 @@ public class OldtreesRespVO { |
| 180 | 187 | @ExcelProperty("部门id") |
| 181 | 188 | private Long deptId; |
| 182 | 189 | |
| 190 | + private List<String> treeImgList; | |
| 191 | + | |
| 192 | + private List<String> nameplatephotoList; | |
| 193 | + | |
| 183 | 194 | } |
| 184 | 195 | \ No newline at end of file | ... | ... |
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; | |
| 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 OldtreesChangeLogRespVO { | |
| 14 | - | |
| 15 | - @Schema(description = "id", example = "148") | |
| 16 | - @ExcelProperty("id") | |
| 17 | - private String id; | |
| 18 | - | |
| 19 | - @Schema(description = "garden_oldtrees 的主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "32596") | |
| 20 | - @ExcelProperty("garden_oldtrees 的主键") | |
| 21 | - private String oldtreeid; | |
| 22 | - | |
| 23 | - @Schema(description = "编号") | |
| 24 | - @ExcelProperty("编号") | |
| 25 | - private String famoustreenumber; | |
| 26 | - | |
| 27 | - @Schema(description = "级别--数据字典:一级、两级") | |
| 28 | - @ExcelProperty("级别--数据字典:一级、两级") | |
| 29 | - private String treelevel; | |
| 30 | - | |
| 31 | - @Schema(description = "树种", example = "2") | |
| 32 | - @ExcelProperty("树种") | |
| 33 | - private String treetype; | |
| 34 | - | |
| 35 | - @Schema(description = "所在地") | |
| 36 | - @ExcelProperty("所在地") | |
| 37 | - private String location; | |
| 38 | - | |
| 39 | - @Schema(description = "养护单位") | |
| 40 | - @ExcelProperty("养护单位") | |
| 41 | - private String maintainunit; | |
| 42 | - | |
| 43 | - @Schema(description = "权属分类--数据字典:专业绿地和单位(居住区)") | |
| 44 | - @ExcelProperty("权属分类--数据字典:专业绿地和单位(居住区)") | |
| 45 | - private String oldtreeownership; | |
| 46 | - | |
| 47 | - @Schema(description = "生长地点") | |
| 48 | - @ExcelProperty("生长地点") | |
| 49 | - private String growlocation; | |
| 50 | - | |
| 51 | - @Schema(description = "拉丁名", example = "张三") | |
| 52 | - @ExcelProperty("拉丁名") | |
| 53 | - private String latinname; | |
| 54 | - | |
| 55 | - @Schema(description = "树高") | |
| 56 | - @ExcelProperty("树高") | |
| 57 | - private String treeheight; | |
| 58 | - | |
| 59 | - @Schema(description = "估测树龄") | |
| 60 | - @ExcelProperty("估测树龄") | |
| 61 | - private String estimationtreeage; | |
| 62 | - | |
| 63 | - @Schema(description = "胸径") | |
| 64 | - @ExcelProperty("胸径") | |
| 65 | - private String dbh; | |
| 66 | - | |
| 67 | - @Schema(description = "经度") | |
| 68 | - @ExcelProperty("经度") | |
| 69 | - private String longitude; | |
| 70 | - | |
| 71 | - @Schema(description = "纬度") | |
| 72 | - @ExcelProperty("纬度") | |
| 73 | - private String latitude; | |
| 74 | - | |
| 75 | - @Schema(description = "冠幅东西") | |
| 76 | - @ExcelProperty("冠幅东西") | |
| 77 | - private String canopyeastwest; | |
| 78 | - | |
| 79 | - @Schema(description = "冠幅南北") | |
| 80 | - @ExcelProperty("冠幅南北") | |
| 81 | - private String canopysouthnorth; | |
| 82 | - | |
| 83 | - @Schema(description = "管护责任单位") | |
| 84 | - @ExcelProperty("管护责任单位") | |
| 85 | - private String managedutyunit; | |
| 86 | - | |
| 87 | - @Schema(description = "干周") | |
| 88 | - @ExcelProperty("干周") | |
| 89 | - private String weekday; | |
| 90 | - | |
| 91 | - @Schema(description = "生长势--数据字典:正常,衰弱,濒危,死亡") | |
| 92 | - @ExcelProperty("生长势--数据字典:正常,衰弱,濒危,死亡") | |
| 93 | - private String growthvigor; | |
| 94 | - | |
| 95 | - @Schema(description = "生长环境") | |
| 96 | - @ExcelProperty("生长环境") | |
| 97 | - private String growthenvironment; | |
| 98 | - | |
| 99 | - @Schema(description = "古树照片一") | |
| 100 | - @ExcelProperty("古树照片一") | |
| 101 | - private String treephotoone; | |
| 102 | - | |
| 103 | - @Schema(description = "春季养护管理措施") | |
| 104 | - @ExcelProperty("春季养护管理措施") | |
| 105 | - private String springmaintenance; | |
| 106 | - | |
| 107 | - @Schema(description = "夏季养护管理措施") | |
| 108 | - @ExcelProperty("夏季养护管理措施") | |
| 109 | - private String summermaintenance; | |
| 110 | - | |
| 111 | - @Schema(description = "秋季养护管理措施") | |
| 112 | - @ExcelProperty("秋季养护管理措施") | |
| 113 | - private String autumnmaintenance; | |
| 114 | - | |
| 115 | - @Schema(description = "冬季养护管理措施") | |
| 116 | - @ExcelProperty("冬季养护管理措施") | |
| 117 | - private String wintermaintenance; | |
| 118 | - | |
| 119 | - @Schema(description = "年度") | |
| 120 | - @ExcelProperty("年度") | |
| 121 | - private String annual; | |
| 122 | - | |
| 123 | - @Schema(description = "养护记录备注", example = "你说的对") | |
| 124 | - @ExcelProperty("养护记录备注") | |
| 125 | - private String curingremark; | |
| 126 | - | |
| 127 | - @Schema(description = "古树照片二") | |
| 128 | - @ExcelProperty("古树照片二") | |
| 129 | - private String treephototwo; | |
| 130 | - | |
| 131 | - @Schema(description = "古树照片三") | |
| 132 | - @ExcelProperty("古树照片三") | |
| 133 | - private String treephotothree; | |
| 134 | - | |
| 135 | - @Schema(description = "古树铭牌照片") | |
| 136 | - @ExcelProperty("古树铭牌照片") | |
| 137 | - private String nameplatephoto; | |
| 138 | - | |
| 139 | - @Schema(description = "数据状态(已更新、未更新)") | |
| 140 | - @ExcelProperty("数据状态(已更新、未更新)") | |
| 141 | - private String datastate; | |
| 142 | - | |
| 143 | - @Schema(description = "养护员工--作业队下派古树时选择的派发员工") | |
| 144 | - @ExcelProperty("养护员工--作业队下派古树时选择的派发员工") | |
| 145 | - private String curingstaff; | |
| 146 | - | |
| 147 | - @Schema(description = "状态(驳回/确认)") | |
| 148 | - @ExcelProperty("状态(驳回/确认)") | |
| 149 | - private String state; | |
| 150 | - | |
| 151 | - @Schema(description = "平台驳回状态(平台驳回)") | |
| 152 | - @ExcelProperty("平台驳回状态(平台驳回)") | |
| 153 | - private String platformstate; | |
| 154 | - | |
| 155 | - @Schema(description = "所属街道") | |
| 156 | - @ExcelProperty("所属街道") | |
| 157 | - private String street; | |
| 158 | - | |
| 159 | - @Schema(description = "负责人姓名", example = "芋艿") | |
| 160 | - @ExcelProperty("负责人姓名") | |
| 161 | - private String responsibleusername; | |
| 162 | - | |
| 163 | - @Schema(description = "负责人电话") | |
| 164 | - @ExcelProperty("负责人电话") | |
| 165 | - private String responsibleuserphone; | |
| 166 | - | |
| 167 | - @Schema(description = "创建者") | |
| 168 | - @ExcelProperty("创建者") | |
| 169 | - private String createby; | |
| 170 | - | |
| 171 | - @Schema(description = "创建时间") | |
| 172 | - @ExcelProperty("创建时间") | |
| 173 | - private LocalDateTime createtime; | |
| 174 | - | |
| 175 | - @Schema(description = "更新者") | |
| 176 | - @ExcelProperty("更新者") | |
| 177 | - private String updateby; | |
| 178 | - | |
| 179 | - @Schema(description = "更新时间") | |
| 180 | - @ExcelProperty("更新时间") | |
| 181 | - private String updatetime; | |
| 182 | - | |
| 183 | -} | |
| 184 | 1 | \ No newline at end of file |
| 2 | +package com.zteits.urbanops.module.garden.controller.admin.oldtreeschangelog.vo; | |
| 3 | + | |
| 4 | +import com.baomidou.mybatisplus.annotation.TableField; | |
| 5 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 6 | +import lombok.*; | |
| 7 | +import java.util.*; | |
| 8 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 9 | +import java.time.LocalDateTime; | |
| 10 | +import cn.idev.excel.annotation.*; | |
| 11 | + | |
| 12 | +@Schema(description = "管理后台 - 古树名木修改记录 Response VO") | |
| 13 | +@Data | |
| 14 | +@ExcelIgnoreUnannotated | |
| 15 | +public class OldtreesChangeLogRespVO { | |
| 16 | + | |
| 17 | + @Schema(description = "id", example = "148") | |
| 18 | + @ExcelProperty("id") | |
| 19 | + private String id; | |
| 20 | + | |
| 21 | + @Schema(description = "garden_oldtrees 的主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "32596") | |
| 22 | + @ExcelProperty("garden_oldtrees 的主键") | |
| 23 | + private String oldtreeid; | |
| 24 | + | |
| 25 | + @Schema(description = "编号") | |
| 26 | + @ExcelProperty("编号") | |
| 27 | + private String famoustreenumber; | |
| 28 | + | |
| 29 | + @Schema(description = "级别--数据字典:一级、两级") | |
| 30 | + @ExcelProperty("级别--数据字典:一级、两级") | |
| 31 | + private String treelevel; | |
| 32 | + | |
| 33 | + @Schema(description = "树种", example = "2") | |
| 34 | + @ExcelProperty("树种") | |
| 35 | + private String treetype; | |
| 36 | + | |
| 37 | + @Schema(description = "所在地") | |
| 38 | + @ExcelProperty("所在地") | |
| 39 | + private String location; | |
| 40 | + | |
| 41 | + @Schema(description = "养护单位") | |
| 42 | + @ExcelProperty("养护单位") | |
| 43 | + private String maintainunit; | |
| 44 | + | |
| 45 | + @Schema(description = "权属分类--数据字典:专业绿地和单位(居住区)") | |
| 46 | + @ExcelProperty("权属分类--数据字典:专业绿地和单位(居住区)") | |
| 47 | + private String oldtreeownership; | |
| 48 | + | |
| 49 | + @Schema(description = "生长地点") | |
| 50 | + @ExcelProperty("生长地点") | |
| 51 | + private String growlocation; | |
| 52 | + | |
| 53 | + @Schema(description = "拉丁名", example = "张三") | |
| 54 | + @ExcelProperty("拉丁名") | |
| 55 | + private String latinname; | |
| 56 | + | |
| 57 | + @Schema(description = "树高") | |
| 58 | + @ExcelProperty("树高") | |
| 59 | + private String treeheight; | |
| 60 | + | |
| 61 | + @Schema(description = "估测树龄") | |
| 62 | + @ExcelProperty("估测树龄") | |
| 63 | + private String estimationtreeage; | |
| 64 | + | |
| 65 | + @Schema(description = "胸径") | |
| 66 | + @ExcelProperty("胸径") | |
| 67 | + private String dbh; | |
| 68 | + | |
| 69 | + @Schema(description = "经度") | |
| 70 | + @ExcelProperty("经度") | |
| 71 | + private String longitude; | |
| 72 | + | |
| 73 | + @Schema(description = "纬度") | |
| 74 | + @ExcelProperty("纬度") | |
| 75 | + private String latitude; | |
| 76 | + | |
| 77 | + @Schema(description = "冠幅东西") | |
| 78 | + @ExcelProperty("冠幅东西") | |
| 79 | + private String canopyeastwest; | |
| 80 | + | |
| 81 | + @Schema(description = "冠幅南北") | |
| 82 | + @ExcelProperty("冠幅南北") | |
| 83 | + private String canopysouthnorth; | |
| 84 | + | |
| 85 | + @Schema(description = "管护责任单位") | |
| 86 | + @ExcelProperty("管护责任单位") | |
| 87 | + private String managedutyunit; | |
| 88 | + | |
| 89 | + @Schema(description = "干周") | |
| 90 | + @ExcelProperty("干周") | |
| 91 | + private String weekday; | |
| 92 | + | |
| 93 | + @Schema(description = "生长势--数据字典:正常,衰弱,濒危,死亡") | |
| 94 | + @ExcelProperty("生长势--数据字典:正常,衰弱,濒危,死亡") | |
| 95 | + private String growthvigor; | |
| 96 | + | |
| 97 | + @Schema(description = "生长环境") | |
| 98 | + @ExcelProperty("生长环境") | |
| 99 | + private String growthenvironment; | |
| 100 | + | |
| 101 | + @Schema(description = "古树照片一") | |
| 102 | + @ExcelProperty("古树照片一") | |
| 103 | + private String treephotoone; | |
| 104 | + | |
| 105 | + @Schema(description = "春季养护管理措施") | |
| 106 | + @ExcelProperty("春季养护管理措施") | |
| 107 | + private String springmaintenance; | |
| 108 | + | |
| 109 | + @Schema(description = "夏季养护管理措施") | |
| 110 | + @ExcelProperty("夏季养护管理措施") | |
| 111 | + private String summermaintenance; | |
| 112 | + | |
| 113 | + @Schema(description = "秋季养护管理措施") | |
| 114 | + @ExcelProperty("秋季养护管理措施") | |
| 115 | + private String autumnmaintenance; | |
| 116 | + | |
| 117 | + @Schema(description = "冬季养护管理措施") | |
| 118 | + @ExcelProperty("冬季养护管理措施") | |
| 119 | + private String wintermaintenance; | |
| 120 | + | |
| 121 | + @Schema(description = "年度") | |
| 122 | + @ExcelProperty("年度") | |
| 123 | + private String annual; | |
| 124 | + | |
| 125 | + @Schema(description = "养护记录备注", example = "你说的对") | |
| 126 | + @ExcelProperty("养护记录备注") | |
| 127 | + private String curingremark; | |
| 128 | + | |
| 129 | + @Schema(description = "古树照片二") | |
| 130 | + @ExcelProperty("古树照片二") | |
| 131 | + private String treephototwo; | |
| 132 | + | |
| 133 | + @Schema(description = "古树照片三") | |
| 134 | + @ExcelProperty("古树照片三") | |
| 135 | + private String treephotothree; | |
| 136 | + | |
| 137 | + @Schema(description = "古树铭牌照片") | |
| 138 | + @ExcelProperty("古树铭牌照片") | |
| 139 | + private String nameplatephoto; | |
| 140 | + | |
| 141 | + @Schema(description = "数据状态(已更新、未更新)") | |
| 142 | + @ExcelProperty("数据状态(已更新、未更新)") | |
| 143 | + private String datastate; | |
| 144 | + | |
| 145 | + @Schema(description = "养护员工--作业队下派古树时选择的派发员工") | |
| 146 | + @ExcelProperty("养护员工--作业队下派古树时选择的派发员工") | |
| 147 | + private String curingstaff; | |
| 148 | + | |
| 149 | + @Schema(description = "状态(驳回/确认)") | |
| 150 | + @ExcelProperty("状态(驳回/确认)") | |
| 151 | + private String state; | |
| 152 | + | |
| 153 | + @Schema(description = "平台驳回状态(平台驳回)") | |
| 154 | + @ExcelProperty("平台驳回状态(平台驳回)") | |
| 155 | + private String platformstate; | |
| 156 | + | |
| 157 | + @Schema(description = "所属街道") | |
| 158 | + @ExcelProperty("所属街道") | |
| 159 | + private String street; | |
| 160 | + | |
| 161 | + @Schema(description = "负责人姓名", example = "芋艿") | |
| 162 | + @ExcelProperty("负责人姓名") | |
| 163 | + private String responsibleusername; | |
| 164 | + | |
| 165 | + @Schema(description = "负责人电话") | |
| 166 | + @ExcelProperty("负责人电话") | |
| 167 | + private String responsibleuserphone; | |
| 168 | + | |
| 169 | + @Schema(description = "创建者") | |
| 170 | + @ExcelProperty("创建者") | |
| 171 | + private String createby; | |
| 172 | + | |
| 173 | + @Schema(description = "创建时间") | |
| 174 | + @ExcelProperty("创建时间") | |
| 175 | + private LocalDateTime createtime; | |
| 176 | + | |
| 177 | + @Schema(description = "更新者") | |
| 178 | + @ExcelProperty("更新者") | |
| 179 | + private String updateby; | |
| 180 | + | |
| 181 | + @Schema(description = "更新时间") | |
| 182 | + @ExcelProperty("更新时间") | |
| 183 | + private String updatetime; | |
| 184 | + | |
| 185 | + private List<String> treeImgList; | |
| 186 | + | |
| 187 | + private List<String> nameplatephotoList; | |
| 188 | + | |
| 189 | +} | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/road/vo/RoadSaveReqVO.java
| ... | ... | @@ -90,11 +90,9 @@ public class RoadSaveReqVO { |
| 90 | 90 | private Long deptId; |
| 91 | 91 | |
| 92 | 92 | @Schema(description = "创建者", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") |
| 93 | - @NotEmpty(message = "创建者不能为空") | |
| 94 | 93 | private String creatorName; |
| 95 | 94 | |
| 96 | 95 | @Schema(description = "更新者", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") |
| 97 | - @NotEmpty(message = "更新者不能为空") | |
| 98 | 96 | private String updaterName; |
| 99 | 97 | |
| 100 | -} | |
| 101 | 98 | \ No newline at end of file |
| 99 | +} | ... | ... |
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; | |
| 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 TreeRespVO { | |
| 14 | - | |
| 15 | - @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "28236") | |
| 16 | - @ExcelProperty("id") | |
| 17 | - private Long id; | |
| 18 | - | |
| 19 | - @Schema(description = "编号") | |
| 20 | - @ExcelProperty("编号") | |
| 21 | - private String treenumber; | |
| 22 | - | |
| 23 | - @Schema(description = "拉丁名", example = "李四") | |
| 24 | - @ExcelProperty("拉丁名") | |
| 25 | - private String latinname; | |
| 26 | - | |
| 27 | - @Schema(description = "树种", example = "2") | |
| 28 | - @ExcelProperty("树种") | |
| 29 | - private String treetype; | |
| 30 | - | |
| 31 | - @Schema(description = "树高") | |
| 32 | - @ExcelProperty("树高") | |
| 33 | - private String treeheight; | |
| 34 | - | |
| 35 | - @Schema(description = "冠幅") | |
| 36 | - @ExcelProperty("冠幅") | |
| 37 | - private String canopy; | |
| 38 | - | |
| 39 | - @Schema(description = "胸径") | |
| 40 | - @ExcelProperty("胸径") | |
| 41 | - private String dbh; | |
| 42 | - | |
| 43 | - @Schema(description = "生长势--数据字典:正常,衰弱,濒危,死亡") | |
| 44 | - @ExcelProperty("生长势--数据字典:正常,衰弱,濒危,死亡") | |
| 45 | - private String growthvigor; | |
| 46 | - | |
| 47 | - @Schema(description = "级别--数据字典:一级、两级") | |
| 48 | - @ExcelProperty("级别--数据字典:一级、两级") | |
| 49 | - private String treelevel; | |
| 50 | - | |
| 51 | - @Schema(description = "经度") | |
| 52 | - @ExcelProperty("经度") | |
| 53 | - private String longitude; | |
| 54 | - | |
| 55 | - @Schema(description = "纬度") | |
| 56 | - @ExcelProperty("纬度") | |
| 57 | - private String latitude; | |
| 58 | - | |
| 59 | - @Schema(description = "所在地") | |
| 60 | - @ExcelProperty("所在地") | |
| 61 | - private String location; | |
| 62 | - | |
| 63 | - @Schema(description = "养护单位") | |
| 64 | - @ExcelProperty("养护单位") | |
| 65 | - private String maintainunit; | |
| 66 | - | |
| 67 | - @Schema(description = "管护单位") | |
| 68 | - @ExcelProperty("管护单位") | |
| 69 | - private String managedutyunit; | |
| 70 | - | |
| 71 | - @Schema(description = "道路id") | |
| 72 | - @ExcelProperty("道路id") | |
| 73 | - private Long road; | |
| 74 | - | |
| 75 | - @Schema(description = "所属街道") | |
| 76 | - @ExcelProperty("所属街道") | |
| 77 | - private String street; | |
| 78 | - | |
| 79 | - @Schema(description = "权属分类--数据字典:专业绿地和单位(居住区)") | |
| 80 | - @ExcelProperty("权属分类--数据字典:专业绿地和单位(居住区)") | |
| 81 | - private String oldtreeownership; | |
| 82 | - | |
| 83 | - @Schema(description = "数据状态(已更新、未更新)") | |
| 84 | - @ExcelProperty("数据状态(已更新、未更新)") | |
| 85 | - private String datastate; | |
| 86 | - | |
| 87 | - @Schema(description = "估测树龄") | |
| 88 | - @ExcelProperty("估测树龄") | |
| 89 | - private String estimationtreeage; | |
| 90 | - | |
| 91 | - @Schema(description = "冠幅东西") | |
| 92 | - @ExcelProperty("冠幅东西") | |
| 93 | - private String canopyeastwest; | |
| 94 | - | |
| 95 | - @Schema(description = "冠幅南北") | |
| 96 | - @ExcelProperty("冠幅南北") | |
| 97 | - private String canopysouthnorth; | |
| 98 | - | |
| 99 | - @Schema(description = "干周") | |
| 100 | - @ExcelProperty("干周") | |
| 101 | - private String weekday; | |
| 102 | - | |
| 103 | - @Schema(description = "生长地点") | |
| 104 | - @ExcelProperty("生长地点") | |
| 105 | - private String growlocation; | |
| 106 | - | |
| 107 | - @Schema(description = "生长环境") | |
| 108 | - @ExcelProperty("生长环境") | |
| 109 | - private String growthenvironment; | |
| 110 | - | |
| 111 | - @Schema(description = "树木照片一") | |
| 112 | - @ExcelProperty("树木照片一") | |
| 113 | - private String treephotoone; | |
| 114 | - | |
| 115 | - @Schema(description = "古树照片二") | |
| 116 | - @ExcelProperty("古树照片二") | |
| 117 | - private String treephototwo; | |
| 118 | - | |
| 119 | - @Schema(description = "古树照片三") | |
| 120 | - @ExcelProperty("古树照片三") | |
| 121 | - private String treephotothree; | |
| 122 | - | |
| 123 | - @Schema(description = "古树照片四") | |
| 124 | - @ExcelProperty("古树照片四") | |
| 125 | - private String treephotofour; | |
| 126 | - | |
| 127 | - @Schema(description = "古树照片五") | |
| 128 | - @ExcelProperty("古树照片五") | |
| 129 | - private String treephotofive; | |
| 130 | - | |
| 131 | - @Schema(description = "创建者") | |
| 132 | - @ExcelProperty("创建者") | |
| 133 | - private String createby; | |
| 134 | - | |
| 135 | - @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 136 | - @ExcelProperty("创建时间") | |
| 137 | - private LocalDateTime createtime; | |
| 138 | - | |
| 139 | - @Schema(description = "更新者") | |
| 140 | - @ExcelProperty("更新者") | |
| 141 | - private String updateby; | |
| 142 | - | |
| 143 | - @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 144 | - @ExcelProperty("更新时间") | |
| 145 | - private LocalDateTime updatetime; | |
| 146 | - | |
| 147 | - @Schema(description = "备注", example = "你说的对") | |
| 148 | - @ExcelProperty("备注") | |
| 149 | - private String remark; | |
| 150 | - | |
| 151 | - @Schema(description = "部门id", requiredMode = Schema.RequiredMode.REQUIRED, example = "17101") | |
| 152 | - @ExcelProperty("部门id") | |
| 153 | - private Long deptId; | |
| 154 | - | |
| 155 | -} | |
| 156 | 1 | \ No newline at end of file |
| 2 | +package com.zteits.urbanops.module.garden.controller.admin.tree.vo; | |
| 3 | + | |
| 4 | +import com.baomidou.mybatisplus.annotation.TableField; | |
| 5 | +import com.fhs.core.trans.anno.Trans; | |
| 6 | +import com.fhs.core.trans.constant.TransType; | |
| 7 | +import com.zteits.urbanops.module.system.dal.dataobject.dept.DeptDO; | |
| 8 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 9 | +import lombok.*; | |
| 10 | +import java.util.*; | |
| 11 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 12 | +import java.time.LocalDateTime; | |
| 13 | +import cn.idev.excel.annotation.*; | |
| 14 | + | |
| 15 | +@Schema(description = "管理后台 - 一树一档案 Response VO") | |
| 16 | +@Data | |
| 17 | +@ExcelIgnoreUnannotated | |
| 18 | +public class TreeRespVO { | |
| 19 | + | |
| 20 | + @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "28236") | |
| 21 | + @ExcelProperty("id") | |
| 22 | + private Long id; | |
| 23 | + | |
| 24 | + @Schema(description = "编号") | |
| 25 | + @ExcelProperty("编号") | |
| 26 | + private String treenumber; | |
| 27 | + | |
| 28 | + @Schema(description = "拉丁名", example = "李四") | |
| 29 | + @ExcelProperty("拉丁名") | |
| 30 | + private String latinname; | |
| 31 | + | |
| 32 | + @Schema(description = "树种", example = "2") | |
| 33 | + @ExcelProperty("树种") | |
| 34 | + private String treetype; | |
| 35 | + | |
| 36 | + @Schema(description = "树高") | |
| 37 | + @ExcelProperty("树高") | |
| 38 | + private String treeheight; | |
| 39 | + | |
| 40 | + @Schema(description = "冠幅") | |
| 41 | + @ExcelProperty("冠幅") | |
| 42 | + private String canopy; | |
| 43 | + | |
| 44 | + @Schema(description = "胸径") | |
| 45 | + @ExcelProperty("胸径") | |
| 46 | + private String dbh; | |
| 47 | + | |
| 48 | + @Schema(description = "生长势--数据字典:正常,衰弱,濒危,死亡") | |
| 49 | + @ExcelProperty("生长势--数据字典:正常,衰弱,濒危,死亡") | |
| 50 | + private String growthvigor; | |
| 51 | + | |
| 52 | + @Schema(description = "级别--数据字典:一级、两级") | |
| 53 | + @ExcelProperty("级别--数据字典:一级、两级") | |
| 54 | + private String treelevel; | |
| 55 | + | |
| 56 | + @Schema(description = "经度") | |
| 57 | + @ExcelProperty("经度") | |
| 58 | + private String longitude; | |
| 59 | + | |
| 60 | + @Schema(description = "纬度") | |
| 61 | + @ExcelProperty("纬度") | |
| 62 | + private String latitude; | |
| 63 | + | |
| 64 | + @Schema(description = "所在地") | |
| 65 | + @ExcelProperty("所在地") | |
| 66 | + private String location; | |
| 67 | + | |
| 68 | + @Schema(description = "养护单位") | |
| 69 | + @Trans(type = TransType.SIMPLE, targetClassName = "com.zteits.urbanops.module.system.dal.dataobject.dept.DeptDO", | |
| 70 | + key = "id", fields = "name", ref = "maintainUnitName") | |
| 71 | + private String maintainunit; | |
| 72 | + | |
| 73 | + @Schema(description = "养护单位名称") | |
| 74 | + @ExcelProperty("养护单位") | |
| 75 | + private String maintainUnitName; | |
| 76 | + | |
| 77 | + @Schema(description = "管护单位") | |
| 78 | + @ExcelProperty("管护单位") | |
| 79 | + private String managedutyunit; | |
| 80 | + | |
| 81 | + @Schema(description = "道路id") | |
| 82 | + @ExcelProperty("道路id") | |
| 83 | + private Long road; | |
| 84 | + | |
| 85 | + @Schema(description = "所属街道") | |
| 86 | + @ExcelProperty("所属街道") | |
| 87 | + private String street; | |
| 88 | + | |
| 89 | + @Schema(description = "权属分类--数据字典:专业绿地和单位(居住区)") | |
| 90 | + @ExcelProperty("权属分类--数据字典:专业绿地和单位(居住区)") | |
| 91 | + private String oldtreeownership; | |
| 92 | + | |
| 93 | + @Schema(description = "数据状态(已更新、未更新)") | |
| 94 | + @ExcelProperty("数据状态(已更新、未更新)") | |
| 95 | + private String datastate; | |
| 96 | + | |
| 97 | + @Schema(description = "估测树龄") | |
| 98 | + @ExcelProperty("估测树龄") | |
| 99 | + private String estimationtreeage; | |
| 100 | + | |
| 101 | + @Schema(description = "冠幅东西") | |
| 102 | + @ExcelProperty("冠幅东西") | |
| 103 | + private String canopyeastwest; | |
| 104 | + | |
| 105 | + @Schema(description = "冠幅南北") | |
| 106 | + @ExcelProperty("冠幅南北") | |
| 107 | + private String canopysouthnorth; | |
| 108 | + | |
| 109 | + @Schema(description = "干周") | |
| 110 | + @ExcelProperty("干周") | |
| 111 | + private String weekday; | |
| 112 | + | |
| 113 | + @Schema(description = "生长地点") | |
| 114 | + @ExcelProperty("生长地点") | |
| 115 | + private String growlocation; | |
| 116 | + | |
| 117 | + @Schema(description = "生长环境") | |
| 118 | + @ExcelProperty("生长环境") | |
| 119 | + private String growthenvironment; | |
| 120 | + | |
| 121 | + @Schema(description = "树木照片一") | |
| 122 | + @ExcelProperty("树木照片一") | |
| 123 | + private String treephotoone; | |
| 124 | + | |
| 125 | + @Schema(description = "古树照片二") | |
| 126 | + @ExcelProperty("古树照片二") | |
| 127 | + private String treephototwo; | |
| 128 | + | |
| 129 | + @Schema(description = "古树照片三") | |
| 130 | + @ExcelProperty("古树照片三") | |
| 131 | + private String treephotothree; | |
| 132 | + | |
| 133 | + @Schema(description = "古树照片四") | |
| 134 | + @ExcelProperty("古树照片四") | |
| 135 | + private String treephotofour; | |
| 136 | + | |
| 137 | + @Schema(description = "古树照片五") | |
| 138 | + @ExcelProperty("古树照片五") | |
| 139 | + private String treephotofive; | |
| 140 | + | |
| 141 | + @Schema(description = "创建者") | |
| 142 | + @ExcelProperty("创建者") | |
| 143 | + private String createby; | |
| 144 | + | |
| 145 | + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 146 | + @ExcelProperty("创建时间") | |
| 147 | + private LocalDateTime createtime; | |
| 148 | + | |
| 149 | + @Schema(description = "更新者") | |
| 150 | + @ExcelProperty("更新者") | |
| 151 | + private String updateby; | |
| 152 | + | |
| 153 | + @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 154 | + @ExcelProperty("更新时间") | |
| 155 | + private LocalDateTime updatetime; | |
| 156 | + | |
| 157 | + @Schema(description = "备注", example = "你说的对") | |
| 158 | + @ExcelProperty("备注") | |
| 159 | + private String remark; | |
| 160 | + | |
| 161 | + @Schema(description = "部门id", requiredMode = Schema.RequiredMode.REQUIRED, example = "17101") | |
| 162 | + @ExcelProperty("部门id") | |
| 163 | + private Long deptId; | |
| 164 | + | |
| 165 | + private List<String> treeImgList; | |
| 166 | + | |
| 167 | + private List<String> treeImgListFile; | |
| 168 | + | |
| 169 | +} | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/oldtrees/OldtreesDO.java
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/inspectionplan/InspectionPlanCommitMapper.java
| ... | ... | @@ -22,7 +22,7 @@ public interface InspectionPlanCommitMapper extends BaseMapperX<InspectionPlanCo |
| 22 | 22 | * @param reqDTO 查询条件 |
| 23 | 23 | * @return 分页结果 |
| 24 | 24 | */ |
| 25 | - IPage<InspectionPlanCommitRespVO> selectForPage(IPage<InspectionPlanCommitRespVO> page, @Param("req") InspectionPlanCommitPageReqVO reqDTO, @Param("busiLineList") List<String> busiLineList); | |
| 25 | + IPage<InspectionPlanCommitRespVO> selectForPage(@Param("page") IPage<InspectionPlanCommitRespVO> page, @Param("req") InspectionPlanCommitPageReqVO reqDTO); | |
| 26 | 26 | |
| 27 | 27 | |
| 28 | 28 | } |
| 29 | 29 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/oldtrees/OldtreesMapper.java
| ... | ... | @@ -5,9 +5,12 @@ import java.util.*; |
| 5 | 5 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 6 | 6 | import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 7 | 7 | import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; |
| 8 | +import com.zteits.urbanops.framework.mybatis.core.query.MPJLambdaWrapperX; | |
| 8 | 9 | import com.zteits.urbanops.module.garden.dal.dataobject.oldtrees.OldtreesDO; |
| 10 | +import com.zteits.urbanops.module.system.dal.dataobject.dept.DeptDO; | |
| 9 | 11 | import org.apache.ibatis.annotations.Mapper; |
| 10 | 12 | import com.zteits.urbanops.module.garden.controller.admin.oldtrees.vo.*; |
| 13 | +import org.springframework.util.ObjectUtils; | |
| 11 | 14 | |
| 12 | 15 | /** |
| 13 | 16 | * 古树名木 Mapper |
| ... | ... | @@ -18,7 +21,10 @@ import com.zteits.urbanops.module.garden.controller.admin.oldtrees.vo.*; |
| 18 | 21 | public interface OldtreesMapper extends BaseMapperX<OldtreesDO> { |
| 19 | 22 | |
| 20 | 23 | default PageResult<OldtreesDO> selectPage(OldtreesPageReqVO reqVO) { |
| 21 | - return selectPage(reqVO, new LambdaQueryWrapperX<OldtreesDO>() | |
| 24 | + MPJLambdaWrapperX<OldtreesDO> wrapper = new MPJLambdaWrapperX<OldtreesDO>() | |
| 25 | + .selectAs(DeptDO::getName, OldtreesDO::getMaintainunit) | |
| 26 | + .selectAll(OldtreesDO.class) | |
| 27 | + .leftJoin(DeptDO.class, DeptDO::getId, OldtreesDO::getMaintainunit) | |
| 22 | 28 | .eqIfPresent(OldtreesDO::getFamoustreenumber, reqVO.getFamoustreenumber()) |
| 23 | 29 | .eqIfPresent(OldtreesDO::getTreelevel, reqVO.getTreelevel()) |
| 24 | 30 | .eqIfPresent(OldtreesDO::getTreetype, reqVO.getTreetype()) |
| ... | ... | @@ -60,7 +66,9 @@ public interface OldtreesMapper extends BaseMapperX<OldtreesDO> { |
| 60 | 66 | .eqIfPresent(OldtreesDO::getUpdateby, reqVO.getUpdateby()) |
| 61 | 67 | .betweenIfPresent(OldtreesDO::getUpdatetime, reqVO.getUpdatetime()) |
| 62 | 68 | .eqIfPresent(OldtreesDO::getDeptId, reqVO.getDeptId()) |
| 63 | - .orderByDesc(OldtreesDO::getId)); | |
| 69 | + .orderByDesc(OldtreesDO::getCreatetime); | |
| 70 | + | |
| 71 | + return selectJoinPage(reqVO, OldtreesDO.class, wrapper); | |
| 64 | 72 | } |
| 65 | 73 | |
| 66 | 74 | default OldtreesDO selectByFamoustreenumber(String famoustreenumber) { | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/oldtreeschangelog/OldtreesChangeLogMapper.java
| ... | ... | @@ -5,7 +5,9 @@ import java.util.*; |
| 5 | 5 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 6 | 6 | import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 7 | 7 | import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; |
| 8 | +import com.zteits.urbanops.framework.mybatis.core.query.MPJLambdaWrapperX; | |
| 8 | 9 | import com.zteits.urbanops.module.garden.dal.dataobject.oldtreeschangelog.OldtreesChangeLogDO; |
| 10 | +import com.zteits.urbanops.module.system.dal.dataobject.dept.DeptDO; | |
| 9 | 11 | import org.apache.ibatis.annotations.Mapper; |
| 10 | 12 | import com.zteits.urbanops.module.garden.controller.admin.oldtreeschangelog.vo.*; |
| 11 | 13 | |
| ... | ... | @@ -18,8 +20,11 @@ import com.zteits.urbanops.module.garden.controller.admin.oldtreeschangelog.vo.* |
| 18 | 20 | public interface OldtreesChangeLogMapper extends BaseMapperX<OldtreesChangeLogDO> { |
| 19 | 21 | |
| 20 | 22 | default PageResult<OldtreesChangeLogDO> selectPage(OldtreesChangeLogPageReqVO reqVO) { |
| 21 | - return selectPage(reqVO, new LambdaQueryWrapperX<OldtreesChangeLogDO>() | |
| 22 | - .eqIfPresent(OldtreesChangeLogDO::getOldtreeid, reqVO.getOldtreeid()) | |
| 23 | + | |
| 24 | + MPJLambdaWrapperX<OldtreesChangeLogDO> wrapper = new MPJLambdaWrapperX<OldtreesChangeLogDO>() | |
| 25 | + .selectAs(DeptDO::getName, OldtreesChangeLogDO::getMaintainunit) | |
| 26 | + .selectAll(OldtreesChangeLogDO.class) | |
| 27 | + .leftJoin(DeptDO.class, DeptDO::getId, OldtreesChangeLogDO::getMaintainunit) | |
| 23 | 28 | .eqIfPresent(OldtreesChangeLogDO::getFamoustreenumber, reqVO.getFamoustreenumber()) |
| 24 | 29 | .eqIfPresent(OldtreesChangeLogDO::getTreelevel, reqVO.getTreelevel()) |
| 25 | 30 | .eqIfPresent(OldtreesChangeLogDO::getTreetype, reqVO.getTreetype()) |
| ... | ... | @@ -60,7 +65,10 @@ public interface OldtreesChangeLogMapper extends BaseMapperX<OldtreesChangeLogDO |
| 60 | 65 | .betweenIfPresent(OldtreesChangeLogDO::getCreatetime, reqVO.getCreatetime()) |
| 61 | 66 | .eqIfPresent(OldtreesChangeLogDO::getUpdateby, reqVO.getUpdateby()) |
| 62 | 67 | .betweenIfPresent(OldtreesChangeLogDO::getUpdatetime, reqVO.getUpdatetime()) |
| 63 | - .orderByDesc(OldtreesChangeLogDO::getId)); | |
| 68 | + .orderByDesc(OldtreesChangeLogDO::getCreatetime); | |
| 69 | + | |
| 70 | + return selectJoinPage(reqVO, OldtreesChangeLogDO.class, wrapper); | |
| 71 | + | |
| 64 | 72 | } |
| 65 | 73 | |
| 66 | 74 | } |
| 67 | 75 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/tree/TreeMapper.java
| ... | ... | @@ -5,7 +5,9 @@ import java.util.*; |
| 5 | 5 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 6 | 6 | import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 7 | 7 | import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; |
| 8 | +import com.zteits.urbanops.framework.mybatis.core.query.MPJLambdaWrapperX; | |
| 8 | 9 | import com.zteits.urbanops.module.garden.dal.dataobject.tree.TreeDO; |
| 10 | +import com.zteits.urbanops.module.system.dal.dataobject.dept.DeptDO; | |
| 9 | 11 | import org.apache.ibatis.annotations.Mapper; |
| 10 | 12 | import com.zteits.urbanops.module.garden.controller.admin.tree.vo.*; |
| 11 | 13 | |
| ... | ... | @@ -18,7 +20,11 @@ import com.zteits.urbanops.module.garden.controller.admin.tree.vo.*; |
| 18 | 20 | public interface TreeMapper extends BaseMapperX<TreeDO> { |
| 19 | 21 | |
| 20 | 22 | default PageResult<TreeDO> selectPage(TreePageReqVO reqVO) { |
| 21 | - return selectPage(reqVO, new LambdaQueryWrapperX<TreeDO>() | |
| 23 | + | |
| 24 | + MPJLambdaWrapperX<TreeDO> wrapper = new MPJLambdaWrapperX<TreeDO>() | |
| 25 | + .selectAs(DeptDO::getName, TreeDO::getMaintainunit) | |
| 26 | + .selectAll(TreeDO.class) | |
| 27 | + .leftJoin(DeptDO.class, DeptDO::getId, TreeDO::getMaintainunit) | |
| 22 | 28 | .eqIfPresent(TreeDO::getTreenumber, reqVO.getTreenumber()) |
| 23 | 29 | .likeIfPresent(TreeDO::getLatinname, reqVO.getLatinname()) |
| 24 | 30 | .eqIfPresent(TreeDO::getTreetype, reqVO.getTreetype()) |
| ... | ... | @@ -48,12 +54,13 @@ public interface TreeMapper extends BaseMapperX<TreeDO> { |
| 48 | 54 | .eqIfPresent(TreeDO::getTreephotofour, reqVO.getTreephotofour()) |
| 49 | 55 | .eqIfPresent(TreeDO::getTreephotofive, reqVO.getTreephotofive()) |
| 50 | 56 | .eqIfPresent(TreeDO::getCreateby, reqVO.getCreateby()) |
| 51 | - .betweenIfPresent(TreeDO::getCreatetime, reqVO.getCreatetime()) | |
| 52 | 57 | .eqIfPresent(TreeDO::getUpdateby, reqVO.getUpdateby()) |
| 53 | 58 | .betweenIfPresent(TreeDO::getUpdatetime, reqVO.getUpdatetime()) |
| 54 | 59 | .eqIfPresent(TreeDO::getRemark, reqVO.getRemark()) |
| 55 | 60 | .eqIfPresent(TreeDO::getDeptId, reqVO.getDeptId()) |
| 56 | - .orderByDesc(TreeDO::getId)); | |
| 61 | + .orderByDesc(TreeDO::getId); | |
| 62 | + | |
| 63 | + return selectJoinPage(reqVO, TreeDO.class, wrapper); | |
| 57 | 64 | } |
| 58 | 65 | |
| 59 | 66 | default TreeDO selectByTreeNumber(String treeNumber) { | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/treechangelog/TreeChangeLogMapper.java
| ... | ... | @@ -5,7 +5,9 @@ import java.util.*; |
| 5 | 5 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 6 | 6 | import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 7 | 7 | import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; |
| 8 | +import com.zteits.urbanops.framework.mybatis.core.query.MPJLambdaWrapperX; | |
| 8 | 9 | import com.zteits.urbanops.module.garden.dal.dataobject.treechangelog.TreeChangeLogDO; |
| 10 | +import com.zteits.urbanops.module.system.dal.dataobject.dept.DeptDO; | |
| 9 | 11 | import org.apache.ibatis.annotations.Mapper; |
| 10 | 12 | import com.zteits.urbanops.module.garden.controller.admin.treechangelog.vo.*; |
| 11 | 13 | |
| ... | ... | @@ -18,7 +20,11 @@ import com.zteits.urbanops.module.garden.controller.admin.treechangelog.vo.*; |
| 18 | 20 | public interface TreeChangeLogMapper extends BaseMapperX<TreeChangeLogDO> { |
| 19 | 21 | |
| 20 | 22 | default PageResult<TreeChangeLogDO> selectPage(TreeChangeLogPageReqVO reqVO) { |
| 21 | - return selectPage(reqVO, new LambdaQueryWrapperX<TreeChangeLogDO>() | |
| 23 | + | |
| 24 | + MPJLambdaWrapperX<TreeChangeLogDO> wrapper = new MPJLambdaWrapperX<TreeChangeLogDO>() | |
| 25 | + .selectAs(DeptDO::getName, TreeChangeLogDO::getMaintainunit) | |
| 26 | + .selectAll(TreeChangeLogDO.class) | |
| 27 | + .leftJoin(DeptDO.class, DeptDO::getId, TreeChangeLogDO::getMaintainunit) | |
| 22 | 28 | .eqIfPresent(TreeChangeLogDO::getTreeid, reqVO.getTreeid()) |
| 23 | 29 | .eqIfPresent(TreeChangeLogDO::getTreenumber, reqVO.getTreenumber()) |
| 24 | 30 | .likeIfPresent(TreeChangeLogDO::getLatinname, reqVO.getLatinname()) |
| ... | ... | @@ -53,7 +59,10 @@ public interface TreeChangeLogMapper extends BaseMapperX<TreeChangeLogDO> { |
| 53 | 59 | .eqIfPresent(TreeChangeLogDO::getUpdateby, reqVO.getUpdateby()) |
| 54 | 60 | .betweenIfPresent(TreeChangeLogDO::getUpdatetime, reqVO.getUpdatetime()) |
| 55 | 61 | .eqIfPresent(TreeChangeLogDO::getRemark, reqVO.getRemark()) |
| 56 | - .orderByDesc(TreeChangeLogDO::getId)); | |
| 62 | + .orderByDesc(TreeChangeLogDO::getId); | |
| 63 | + | |
| 64 | + return selectJoinPage(reqVO, TreeChangeLogDO.class, wrapper); | |
| 65 | + | |
| 57 | 66 | } |
| 58 | 67 | |
| 59 | 68 | } |
| 60 | 69 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/inspectionplan/InspectionPlanCommitServiceImpl.java
| ... | ... | @@ -87,9 +87,10 @@ public class InspectionPlanCommitServiceImpl implements InspectionPlanCommitServ |
| 87 | 87 | busiLineList.addAll(Arrays.asList(busiLine.split(","))); |
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | + pageReqVO.setBusiLineList(busiLineList); | |
| 90 | 91 | //分页 |
| 91 | 92 | IPage<InspectionPlanCommitRespVO> mpPage = MyBatisUtils.buildPage(pageReqVO); |
| 92 | - IPage<InspectionPlanCommitRespVO> page = inspectionPlanCommitMapper.selectForPage(mpPage, pageReqVO, busiLineList); | |
| 93 | + IPage<InspectionPlanCommitRespVO> page = inspectionPlanCommitMapper.selectForPage(mpPage, pageReqVO); | |
| 93 | 94 | // 转换返回 |
| 94 | 95 | return new PageResult<>(imgProcess(page.getRecords()), page.getTotal()); |
| 95 | 96 | } | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/inspectionplan/InspectionPlanServiceImpl.java
| ... | ... | @@ -13,7 +13,8 @@ import com.zteits.urbanops.module.garden.dal.mysql.inspectionplan.InspectionPlan |
| 13 | 13 | import com.zteits.urbanops.module.garden.dal.mysql.inspectionplan.InspectionPlanRoleMapper; |
| 14 | 14 | import com.zteits.urbanops.module.garden.enums.FinishStateEnum; |
| 15 | 15 | import com.zteits.urbanops.module.garden.enums.PlanConstants; |
| 16 | -import com.zteits.urbanops.module.garden.util.TimeIntervalCalculatorUtil; | |
| 16 | +import com.zteits.urbanops.module.garden.util.timeinterval.PeriodResult; | |
| 17 | +import com.zteits.urbanops.module.garden.util.timeinterval.TimeIntervalFrequencyUtil; | |
| 17 | 18 | import com.zteits.urbanops.module.system.api.dept.DeptApi; |
| 18 | 19 | import com.zteits.urbanops.module.system.api.dept.dto.DeptRespDTO; |
| 19 | 20 | import com.zteits.urbanops.module.system.api.permission.RoleApi; |
| ... | ... | @@ -26,7 +27,6 @@ import org.springframework.transaction.annotation.Transactional; |
| 26 | 27 | import org.springframework.util.CollectionUtils; |
| 27 | 28 | import org.springframework.validation.annotation.Validated; |
| 28 | 29 | |
| 29 | -import java.time.LocalDate; | |
| 30 | 30 | import java.time.LocalDateTime; |
| 31 | 31 | import java.time.format.DateTimeFormatter; |
| 32 | 32 | import java.util.*; |
| ... | ... | @@ -78,20 +78,20 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { |
| 78 | 78 | LocalDateTime now = LocalDateTime.now(); |
| 79 | 79 | String userId = SecurityFrameworkUtils.getLoginUserId() + ""; |
| 80 | 80 | String userName = SecurityFrameworkUtils.getLoginUserNickname(); |
| 81 | - int rateValue; | |
| 81 | + String rateValue; | |
| 82 | 82 | if (createReqVO.getRateValue().contains("/")) { |
| 83 | - rateValue = Integer.parseInt(createReqVO.getRateValue().split("/")[1]); | |
| 83 | + rateValue = createReqVO.getRateValue().trim(); | |
| 84 | 84 | } else { |
| 85 | - rateValue = Integer.parseInt(createReqVO.getRateValue()); | |
| 85 | + rateValue = createReqVO.getRateValue().trim()+"/1"; | |
| 86 | 86 | } |
| 87 | 87 | //计算开始和计算时间 在间隔周期下每天的次数 |
| 88 | - List<String> betweenDayList = TimeIntervalCalculatorUtil.calculateIntervals(createReqVO.getBeginTime(), createReqVO.getEndTime(), createReqVO.getCycleId(), rateValue); | |
| 89 | - if (CollectionUtils.isEmpty(betweenDayList)) { | |
| 88 | + List<PeriodResult> calculate = TimeIntervalFrequencyUtil.calculate(createReqVO.getBeginTime().toString(), createReqVO.getEndTime().toString(), rateValue, createReqVO.getCycleId()); | |
| 89 | + if (CollectionUtils.isEmpty(calculate)) { | |
| 90 | 90 | log.warn("获取两个时间之间间隔天数错误"); |
| 91 | 91 | return CommonResult.error(INSPECTION_CYCLE_ERROR); |
| 92 | 92 | } |
| 93 | 93 | //计算计划次数 |
| 94 | - Integer planNum = betweenDayList.size(); | |
| 94 | + Integer planNum = calculate.size(); | |
| 95 | 95 | |
| 96 | 96 | |
| 97 | 97 | //巡检计划list |
| ... | ... | @@ -139,13 +139,12 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { |
| 139 | 139 | }); |
| 140 | 140 | /*3.插入巡查计划明细*/ |
| 141 | 141 | |
| 142 | - for (int i = 0; i < betweenDayList.size(); i++) { | |
| 143 | - String[] dateStr = betweenDayList.get(i).split("/"); | |
| 142 | + for (PeriodResult periodResult : calculate) { | |
| 144 | 143 | InspectionPlanDetailDO entity = getInspectionPlanDetailDO(batchNo, createReqVO, roadReqVO, now); |
| 145 | 144 | ThreadUtil.sleep(2); |
| 146 | - entity.setSortNum(i + 1); | |
| 147 | - entity.setBeginTime(LocalDateTime.parse(dateStr[0], DateTimeFormatter.ofPattern("yyyy-MM-dd 00:00:00"))); | |
| 148 | - entity.setEndTime(LocalDateTime.parse(dateStr[1], DateTimeFormatter.ofPattern("yyyy-MM-dd 23:59:59"))); | |
| 145 | + entity.setSortNum(periodResult.getCount()); | |
| 146 | + entity.setBeginTime(LocalDateTime.parse(periodResult.getStart() + " 00:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); | |
| 147 | + entity.setEndTime(LocalDateTime.parse(periodResult.getEnd() + " 23:59:59", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); | |
| 149 | 148 | detailDOList.add(entity); |
| 150 | 149 | } |
| 151 | 150 | }); |
| ... | ... | @@ -179,6 +178,7 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { |
| 179 | 178 | return entity; |
| 180 | 179 | } |
| 181 | 180 | |
| 181 | + | |
| 182 | 182 | @Override |
| 183 | 183 | public void updateInspectionPlan(InspectionPlanUpdateReqVO updateReqVO) { |
| 184 | 184 | // 校验存在 | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/maintainplan/MaintainPlanServiceImpl.java
| ... | ... | @@ -5,9 +5,9 @@ import cn.hutool.core.thread.ThreadUtil; |
| 5 | 5 | import cn.hutool.core.util.RandomUtil; |
| 6 | 6 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| 7 | 7 | import com.zteits.urbanops.framework.common.pojo.CommonResult; |
| 8 | -import com.zteits.urbanops.framework.common.util.collection.CollectionUtils; | |
| 9 | 8 | import com.zteits.urbanops.framework.dict.core.DictFrameworkUtils; |
| 10 | 9 | import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; |
| 10 | +import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanDetailDO; | |
| 11 | 11 | import com.zteits.urbanops.module.garden.dal.dataobject.maintainplan.MaintainPlanDetailDO; |
| 12 | 12 | import com.zteits.urbanops.module.garden.dal.dataobject.maintainplan.MaintainPlanRoleDO; |
| 13 | 13 | import com.zteits.urbanops.module.garden.dal.mysql.maintainplan.MaintainPlanDetailMapper; |
| ... | ... | @@ -15,7 +15,8 @@ import com.zteits.urbanops.module.garden.dal.mysql.maintainplan.MaintainPlanInte |
| 15 | 15 | import com.zteits.urbanops.module.garden.dal.mysql.maintainplan.MaintainPlanRoleMapper; |
| 16 | 16 | import com.zteits.urbanops.module.garden.enums.FinishStateEnum; |
| 17 | 17 | import com.zteits.urbanops.module.garden.enums.PlanConstants; |
| 18 | -import com.zteits.urbanops.module.garden.util.TimeIntervalCalculatorUtil; | |
| 18 | +import com.zteits.urbanops.module.garden.util.timeinterval.PeriodResult; | |
| 19 | +import com.zteits.urbanops.module.garden.util.timeinterval.TimeIntervalFrequencyUtil; | |
| 19 | 20 | import com.zteits.urbanops.module.system.api.dept.DeptApi; |
| 20 | 21 | import com.zteits.urbanops.module.system.api.dept.dto.DeptRespDTO; |
| 21 | 22 | import com.zteits.urbanops.module.system.api.permission.RoleApi; |
| ... | ... | @@ -24,13 +25,12 @@ import jodd.util.StringUtil; |
| 24 | 25 | import lombok.extern.slf4j.Slf4j; |
| 25 | 26 | import org.springframework.stereotype.Service; |
| 26 | 27 | import jakarta.annotation.Resource; |
| 28 | +import org.springframework.util.CollectionUtils; | |
| 27 | 29 | import org.springframework.validation.annotation.Validated; |
| 28 | 30 | |
| 29 | -import java.time.LocalDate; | |
| 30 | 31 | import java.time.LocalDateTime; |
| 31 | 32 | import java.time.format.DateTimeFormatter; |
| 32 | 33 | import java.util.*; |
| 33 | -import java.util.concurrent.atomic.AtomicInteger; | |
| 34 | 34 | import java.util.stream.Collectors; |
| 35 | 35 | |
| 36 | 36 | import com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo.*; |
| ... | ... | @@ -81,20 +81,21 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { |
| 81 | 81 | LocalDateTime now = LocalDateTime.now(); |
| 82 | 82 | String userId = SecurityFrameworkUtils.getLoginUserId()+""; |
| 83 | 83 | String userName = SecurityFrameworkUtils.getLoginUserNickname(); |
| 84 | - int rateValue; | |
| 84 | + String rateValue; | |
| 85 | 85 | if (createReqVO.getRateValue().contains("/")) { |
| 86 | - rateValue = Integer.parseInt(createReqVO.getRateValue().split("/")[1]); | |
| 86 | + rateValue = createReqVO.getRateValue().trim(); | |
| 87 | 87 | } else { |
| 88 | - rateValue = Integer.parseInt(createReqVO.getRateValue()); | |
| 88 | + rateValue = createReqVO.getRateValue().trim()+"/1"; | |
| 89 | 89 | } |
| 90 | 90 | //计算开始和计算时间 在间隔周期下每天的次数 |
| 91 | - List<String> betweenDayList = TimeIntervalCalculatorUtil.calculateIntervals(createReqVO.getBeginTime(), createReqVO.getEndTime(), createReqVO.getCycleId(), rateValue); | |
| 92 | - if (CollectionUtils.isAnyEmpty(betweenDayList)) { | |
| 91 | + //计算开始和计算时间 在间隔周期下每天的次数 | |
| 92 | + List<PeriodResult> calculate = TimeIntervalFrequencyUtil.calculate(createReqVO.getBeginTime().toString(), createReqVO.getEndTime().toString(), rateValue, createReqVO.getCycleId()); | |
| 93 | + if (CollectionUtils.isEmpty(calculate)) { | |
| 93 | 94 | log.warn("获取两个时间之间间隔天数错误"); |
| 94 | 95 | return CommonResult.error(INSPECTION_CYCLE_ERROR); |
| 95 | 96 | } |
| 96 | 97 | //计算计划次数 |
| 97 | - Integer planNum = betweenDayList.size(); | |
| 98 | + Integer planNum = calculate.size(); | |
| 98 | 99 | |
| 99 | 100 | |
| 100 | 101 | //巡检计划list |
| ... | ... | @@ -141,14 +142,12 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { |
| 141 | 142 | roleList.add(maintainPlanRoleDO); |
| 142 | 143 | }); |
| 143 | 144 | /*3.插入巡查计划明细*/ |
| 144 | - | |
| 145 | - for (int i = 0; i < betweenDayList.size(); i++) { | |
| 146 | - String[] dateStr = betweenDayList.get(i).split("/"); | |
| 145 | + for (PeriodResult periodResult : calculate) { | |
| 147 | 146 | MaintainPlanDetailDO entity = getMaintainPlanDetailDO(batchNo, createReqVO, roadReqVO, now); |
| 148 | 147 | ThreadUtil.sleep(2); |
| 149 | - entity.setSortNum(i+1); | |
| 150 | - entity.setBeginTime(LocalDateTime.parse(dateStr[0], DateTimeFormatter.ofPattern("yyyy-MM-dd 00:00:00"))); | |
| 151 | - entity.setEndTime(LocalDateTime.parse(dateStr[1], DateTimeFormatter.ofPattern("yyyy-MM-dd 23:59:59"))); | |
| 148 | + entity.setSortNum(periodResult.getCount()); | |
| 149 | + entity.setBeginTime(LocalDateTime.parse(periodResult.getStart() + " 00:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); | |
| 150 | + entity.setEndTime(LocalDateTime.parse(periodResult.getEnd() + " 23:59:59", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); | |
| 152 | 151 | detailDOList.add(entity); |
| 153 | 152 | } |
| 154 | 153 | }); | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/util/TimeIntervalCalculatorUtil.java deleted
| 1 | -package com.zteits.urbanops.module.garden.util; | |
| 2 | - | |
| 3 | - | |
| 4 | -import java.time.LocalDate; | |
| 5 | -import java.util.ArrayList; | |
| 6 | -import java.util.List; | |
| 7 | - | |
| 8 | -import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 9 | -import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.INSPECTION_CYCLE_ID_ERROR; | |
| 10 | - | |
| 11 | -public class TimeIntervalCalculatorUtil { | |
| 12 | - enum IntervalUnit { | |
| 13 | - DAY, WEEK, MONTH, YEAR | |
| 14 | - } | |
| 15 | - | |
| 16 | - public static void main(String[] args) { | |
| 17 | - | |
| 18 | - System.out.println("请输入开始日期(yyyy-MM-dd):"); | |
| 19 | - LocalDate startDate = LocalDate.of(2025,10,1); | |
| 20 | - | |
| 21 | - System.out.println("请输入结束日期(yyyy-MM-dd):"); | |
| 22 | - LocalDate endDate = LocalDate.of(2025,10,7); | |
| 23 | - | |
| 24 | - System.out.println("请选择间隔单位(1.天 2.周 3.月 4.年):"); | |
| 25 | - IntervalUnit unit = IntervalUnit.DAY; | |
| 26 | - | |
| 27 | - System.out.println("请输入间隔数量(如2表示每2天/周/月/年):"); | |
| 28 | - int intervalCount =2; | |
| 29 | - | |
| 30 | - List<String> intervals = calculateIntervals(startDate, endDate, 1, intervalCount); | |
| 31 | - | |
| 32 | - System.out.println("\n执行周期:"); | |
| 33 | - intervals.forEach(System.out::println); | |
| 34 | - } | |
| 35 | - | |
| 36 | - /** | |
| 37 | - * 执行次数计算 | |
| 38 | - * @param start | |
| 39 | - * @param end | |
| 40 | - * @param cycleId 1:日/次;2:周/次;3:月/次;4:年/次 | |
| 41 | - * @param intervalCount | |
| 42 | - * @return | |
| 43 | - */ | |
| 44 | - public static List<String> calculateIntervals(LocalDate start, LocalDate end, Integer cycleId, int intervalCount) { | |
| 45 | - List<String> intervals = new ArrayList<>(); | |
| 46 | - LocalDate currentStart = start; | |
| 47 | - IntervalUnit unit = getIntervalUnit(cycleId); | |
| 48 | - | |
| 49 | - while (currentStart.isBefore(end) || currentStart.isEqual(end)) { | |
| 50 | - LocalDate currentEnd = calculateEndDate(currentStart, end, unit, intervalCount); | |
| 51 | - intervals.add(currentStart + "/" + currentEnd); | |
| 52 | - currentStart = currentEnd.plusDays(1); | |
| 53 | - } | |
| 54 | - | |
| 55 | - return intervals; | |
| 56 | - } | |
| 57 | - | |
| 58 | - private static LocalDate calculateEndDate(LocalDate currentStart, LocalDate endDate, | |
| 59 | - IntervalUnit unit, int intervalCount) { | |
| 60 | - switch (unit) { | |
| 61 | - case DAY: | |
| 62 | - LocalDate dayEnd = currentStart.plusDays(intervalCount - 1); | |
| 63 | - return dayEnd.isAfter(endDate) ? endDate : dayEnd; | |
| 64 | - case WEEK: | |
| 65 | - LocalDate weekEnd = currentStart.plusDays(7 * intervalCount - 1); | |
| 66 | - return weekEnd.isAfter(endDate) ? endDate : weekEnd; | |
| 67 | - case MONTH: | |
| 68 | - LocalDate monthEnd = currentStart.plusMonths(intervalCount) | |
| 69 | - .withDayOfMonth(1).minusDays(1); | |
| 70 | - return monthEnd.isAfter(endDate) ? endDate : monthEnd; | |
| 71 | - case YEAR: | |
| 72 | - LocalDate yearEnd = currentStart.plusYears(intervalCount) | |
| 73 | - .withDayOfYear(1).minusDays(1); | |
| 74 | - return yearEnd.isAfter(endDate) ? endDate : yearEnd; | |
| 75 | - default: | |
| 76 | - return endDate; | |
| 77 | - } | |
| 78 | - } | |
| 79 | - | |
| 80 | - /** | |
| 81 | - * 转换枚举 | |
| 82 | - * @param cycleId 1:日/次;2:周/次;3:月/次;4:年/次 | |
| 83 | - * @return | |
| 84 | - */ | |
| 85 | - public static IntervalUnit getIntervalUnit(Integer cycleId) { | |
| 86 | - switch (cycleId) { | |
| 87 | - case 1: | |
| 88 | - return IntervalUnit.DAY; | |
| 89 | - case 2: | |
| 90 | - return IntervalUnit.WEEK; | |
| 91 | - case 3: | |
| 92 | - return IntervalUnit.MONTH; | |
| 93 | - case 4: | |
| 94 | - return IntervalUnit.YEAR; | |
| 95 | - default: | |
| 96 | - throw exception(INSPECTION_CYCLE_ID_ERROR); | |
| 97 | - } | |
| 98 | - } | |
| 99 | - | |
| 100 | -} |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/util/timeinterval/PeriodResult.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.util.timeinterval; | |
| 2 | + | |
| 3 | +import lombok.Data; | |
| 4 | + | |
| 5 | +import java.time.LocalDate; | |
| 6 | +import java.time.format.DateTimeFormatter; | |
| 7 | + | |
| 8 | +@Data | |
| 9 | +public class PeriodResult { | |
| 10 | + private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd"); | |
| 11 | + | |
| 12 | + /** | |
| 13 | + * 开始时间 | |
| 14 | + */ | |
| 15 | + private final String start; | |
| 16 | + /** | |
| 17 | + * 结束时间 | |
| 18 | + */ | |
| 19 | + private final String end; | |
| 20 | + /** | |
| 21 | + * 执行次数 | |
| 22 | + */ | |
| 23 | + private final int count; | |
| 24 | + | |
| 25 | + public PeriodResult(LocalDate start, LocalDate end, int count) { | |
| 26 | + this.start = start.format(FORMATTER); | |
| 27 | + this.end = end.format(FORMATTER); | |
| 28 | + this.count = count; | |
| 29 | + } | |
| 30 | + | |
| 31 | + @Override | |
| 32 | + public String toString() { | |
| 33 | + return start + " " + end + " " + count + "次"; | |
| 34 | + } | |
| 35 | +} | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/util/timeinterval/TimeIntervalFrequencyUtil.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.util.timeinterval; | |
| 2 | + | |
| 3 | +import java.time.LocalDate; | |
| 4 | +import java.time.format.DateTimeFormatter; | |
| 5 | +import java.util.ArrayList; | |
| 6 | +import java.util.Collections; | |
| 7 | +import java.util.List; | |
| 8 | + | |
| 9 | +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 10 | +import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.INSPECTION_CYCLE_ID_ERROR; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 时间区间拆分+频次计算工具类 | |
| 14 | + * 支持:按日/周/月/年拆分,区间临界点重叠,动态计算每个区间的执行频次 | |
| 15 | + */ | |
| 16 | +public class TimeIntervalFrequencyUtil { | |
| 17 | + | |
| 18 | + private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd"); | |
| 19 | + | |
| 20 | + public enum IntervalUnit { | |
| 21 | + DAY, WEEK, MONTH, YEAR; | |
| 22 | + } | |
| 23 | + | |
| 24 | + /** | |
| 25 | + * 转换枚举 | |
| 26 | + * @param cycleId 1:日/次;2:周/次;3:月/次;4:年/次 | |
| 27 | + * @return | |
| 28 | + */ | |
| 29 | + public static IntervalUnit getIntervalUnit(Integer cycleId) { | |
| 30 | + switch (cycleId) { | |
| 31 | + case 1: | |
| 32 | + return IntervalUnit.DAY; | |
| 33 | + case 2: | |
| 34 | + return IntervalUnit.WEEK; | |
| 35 | + case 3: | |
| 36 | + return IntervalUnit.MONTH; | |
| 37 | + case 4: | |
| 38 | + return IntervalUnit.YEAR; | |
| 39 | + default: | |
| 40 | + throw exception(INSPECTION_CYCLE_ID_ERROR); | |
| 41 | + } | |
| 42 | + } | |
| 43 | + | |
| 44 | + /** | |
| 45 | + * 计算时间段划分结果 | |
| 46 | + * | |
| 47 | + * @param startStr 开始日期 (yyyy-MM-dd) | |
| 48 | + * @param endStr 结束日期 (yyyy-MM-dd) | |
| 49 | + * @param freq 频次值,格式 "x/y" | |
| 50 | + * @param cycleId cycleId 1:日/次;2:周/次;3:月/次;4:年/次 | |
| 51 | + * @return 划分结果列表 | |
| 52 | + */ | |
| 53 | + public static List<PeriodResult> calculate(String startStr, String endStr, String freq, Integer cycleId) { | |
| 54 | + LocalDate start = LocalDate.parse(startStr, FORMATTER); | |
| 55 | + LocalDate end = LocalDate.parse(endStr, FORMATTER); | |
| 56 | + | |
| 57 | + if (start.isAfter(end)) { | |
| 58 | + return Collections.emptyList(); | |
| 59 | + } | |
| 60 | + | |
| 61 | + String[] parts = freq.split("/", 2); | |
| 62 | + if (parts.length != 2) { | |
| 63 | + throw new IllegalArgumentException("频次值格式错误,应为 'x/y': " + freq); | |
| 64 | + } | |
| 65 | + int x = Integer.parseInt(parts[0]); | |
| 66 | + int y = Integer.parseInt(parts[1]); | |
| 67 | + | |
| 68 | + IntervalUnit unit = getIntervalUnit(cycleId); | |
| 69 | + | |
| 70 | + List<PeriodResult> results = new ArrayList<>(); | |
| 71 | + LocalDate currentStart = start; | |
| 72 | + | |
| 73 | + while (!currentStart.isAfter(end)) { | |
| 74 | + // 计算当前周期的理论结束日期(包含 y 个单位) | |
| 75 | + LocalDate periodEnd = calculatePeriodEnd(currentStart, y, unit); | |
| 76 | + | |
| 77 | + // 实际段结束 = min(periodEnd, end) | |
| 78 | + LocalDate segEnd = periodEnd.isAfter(end) ? end : periodEnd; | |
| 79 | + | |
| 80 | + results.add(new PeriodResult(currentStart, segEnd, x)); | |
| 81 | + | |
| 82 | + // 下一段从当前段结束的第二天开始 | |
| 83 | + LocalDate nextStart = segEnd.plusDays(1); | |
| 84 | + | |
| 85 | + // 如果已经超过总结束时间,则终止 | |
| 86 | + if (nextStart.isAfter(end)) { | |
| 87 | + break; | |
| 88 | + } | |
| 89 | + | |
| 90 | + currentStart = nextStart; | |
| 91 | + } | |
| 92 | + | |
| 93 | + return results; | |
| 94 | + } | |
| 95 | + | |
| 96 | + /** | |
| 97 | + * 计算从 start 开始,经过 y 个单位周期后的结束日期(包含) | |
| 98 | + */ | |
| 99 | + private static LocalDate calculatePeriodEnd(LocalDate start, int y, IntervalUnit unit) { | |
| 100 | + switch (unit) { | |
| 101 | + case DAY: | |
| 102 | + return start.plusDays(y - 1); // 包含 y 天:start 到 start+y-1 | |
| 103 | + case WEEK: | |
| 104 | + return start.plusDays((long) y * 7 - 1); // y周 = y*7天,减1得包含结束 | |
| 105 | + case MONTH: | |
| 106 | + return addMonthsSafely(start, y).minusDays(1); | |
| 107 | + case YEAR: | |
| 108 | + return start.plusYears(y).minusDays(1); | |
| 109 | + default: | |
| 110 | + throw new UnsupportedOperationException("未支持的单位: " + unit); | |
| 111 | + } | |
| 112 | + } | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + /** | |
| 117 | + * 安全地加上 y 个月(避免3月31日+1月变成异常) | |
| 118 | + * 这里使用 Java 8+ 的 plusMonths 自动调整规则 | |
| 119 | + */ | |
| 120 | + private static LocalDate addMonthsSafely(LocalDate date, int months) { | |
| 121 | + return date.plusMonths(months); | |
| 122 | + // Java 会自动处理:如 1月31日 +1月 → 2月28/29日(不会抛异常) | |
| 123 | + } | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + // ====================== 测试用例 ====================== | |
| 129 | + //cycleId 1:日/次;2:周/次;3:月/次;4:年/次 | |
| 130 | + public static void main(String[] args) { | |
| 131 | + System.out.println("=== 示例1:每3天一次,按日 ==="); | |
| 132 | + List<PeriodResult> r1 = calculate("2025-01-01", "2025-01-07", "1/3", 1); | |
| 133 | + r1.forEach(System.out::println); | |
| 134 | + | |
| 135 | + System.out.println("\n=== 示例2:每3周一次(21天),按周 ==="); | |
| 136 | + List<PeriodResult> r2 = calculate("2025-01-01", "2025-02-01", "1/3", 2); | |
| 137 | + r2.forEach(System.out::println); | |
| 138 | + | |
| 139 | + System.out.println("\n=== 示例3:每2个月一次,按月 ==="); | |
| 140 | + List<PeriodResult> r3 = calculate("2025-01-01", "2025-12-31", "1/2", 3); | |
| 141 | + r3.forEach(System.out::println); | |
| 142 | + | |
| 143 | + System.out.println("\n=== 示例4:每3年一次,按年 ==="); | |
| 144 | + List<PeriodResult> r4 = calculate("2025-01-01", "2035-06-01", "1/3", 3); | |
| 145 | + r4.forEach(System.out::println); | |
| 146 | + | |
| 147 | + System.out.println("\n=== 示例5:每2天2次,按日 ==="); | |
| 148 | + List<PeriodResult> r5 = calculate("2025-01-01", "2025-01-05", "2/2", 1); | |
| 149 | + r5.forEach(System.out::println); | |
| 150 | + | |
| 151 | + System.out.println("\n=== 示例5:每2年1次,按年 ==="); | |
| 152 | + List<PeriodResult> r6 = calculate("2025-01-01", "2028-01-05", "1/2", 4); | |
| 153 | + r6.forEach(System.out::println); | |
| 154 | + } | |
| 155 | +} | |
| 0 | 156 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/resources/mapper/inspectionplan/InspectionPlanCommitMapper.xml
| ... | ... | @@ -9,7 +9,7 @@ |
| 9 | 9 | 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ |
| 10 | 10 | --> |
| 11 | 11 | <!-- 复杂联表分页查询 --> |
| 12 | - <select id="selectForPage" resultType="com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo.InspectionPlanCommitRespVO"> | |
| 12 | + <select id="selectForPage" resultType="com.zteits.urbanops.module.garden.controller.admin.inspectionplan.vo.InspectionPlanCommitRespVO"> | |
| 13 | 13 | SELECT |
| 14 | 14 | a.plan_no, |
| 15 | 15 | b.plan_name, |
| ... | ... | @@ -44,9 +44,9 @@ |
| 44 | 44 | <if test="req.planName != null and req.planName !=''"> |
| 45 | 45 | AND b.plan_name LIKE CONCAT(#{req.planName},'%') |
| 46 | 46 | </if> |
| 47 | - <if test="busiLineList != null and busiLineList.size() > 0"> | |
| 47 | + <if test="req.busiLineList != null and req.busiLineList.size() > 0"> | |
| 48 | 48 | AND a.busi_line IN |
| 49 | - <foreach collection="busiLineList" item="id" open="(" separator="," close=")"> | |
| 49 | + <foreach collection="req.busiLineList" item="id" open="(" separator="," close=")"> | |
| 50 | 50 | #{id} |
| 51 | 51 | </foreach> |
| 52 | 52 | </if> |
| ... | ... | @@ -64,9 +64,8 @@ |
| 64 | 64 | AND b.road_name LIKE CONCAT(#{req.roadName},'%') |
| 65 | 65 | </if> |
| 66 | 66 | <if test="req.roleName != null and req.roleName !=''"> |
| 67 | - AND a.role_name LIKE CONCAT(#{req.roleName},'%') | |
| 67 | + AND a.role_name LIKE CONCAT(#{roleName},'%') | |
| 68 | 68 | </if> |
| 69 | - | |
| 70 | 69 | <if test="req.companyId != null"> |
| 71 | 70 | and b.company_id = #{req.companyId} |
| 72 | 71 | </if> |
| ... | ... | @@ -77,7 +76,7 @@ |
| 77 | 76 | AND a.user_name LIKE CONCAT('%', #{req.userName},'%') |
| 78 | 77 | </if> |
| 79 | 78 | <if test="req.transState != null"> |
| 80 | - and a.inspection_state = #{req.transState} | |
| 79 | + and a.trans_state = #{req.transState} | |
| 81 | 80 | </if> |
| 82 | 81 | <if test="req.finishTime != null"> |
| 83 | 82 | AND DATE_FORMAT(a.finish_time, '%Y-%m-%d') = #{req.finishTime} | ... | ... |