Commit 7dcb167603f9eed59868f951fe68204b316852b5
Merge branch 'dev' into de_wangfs_202511
Showing
25 changed files
with
625 additions
and
41 deletions
urbanops-framework/urbanops-common/src/main/java/com/zteits/urbanops/framework/common/pojo/PageParam.java
| @@ -6,6 +6,8 @@ import lombok.Data; | @@ -6,6 +6,8 @@ import lombok.Data; | ||
| 6 | import jakarta.validation.constraints.Min; | 6 | import jakarta.validation.constraints.Min; |
| 7 | import jakarta.validation.constraints.Max; | 7 | import jakarta.validation.constraints.Max; |
| 8 | import jakarta.validation.constraints.NotNull; | 8 | import jakarta.validation.constraints.NotNull; |
| 9 | +import org.springframework.util.StringUtils; | ||
| 10 | + | ||
| 9 | import java.io.Serializable; | 11 | import java.io.Serializable; |
| 10 | 12 | ||
| 11 | @Schema(description="分页参数") | 13 | @Schema(description="分页参数") |
| @@ -33,4 +35,25 @@ public class PageParam implements Serializable { | @@ -33,4 +35,25 @@ public class PageParam implements Serializable { | ||
| 33 | @Max(value = 100, message = "每页条数最大值为 100") | 35 | @Max(value = 100, message = "每页条数最大值为 100") |
| 34 | private Integer pageSize = PAGE_SIZE; | 36 | private Integer pageSize = PAGE_SIZE; |
| 35 | 37 | ||
| 38 | + /** | ||
| 39 | + * 排序字段 | ||
| 40 | + */ | ||
| 41 | + private String sortField = "id"; | ||
| 42 | + /** | ||
| 43 | + * 排序方向:asc(升序)/ desc(降序) | ||
| 44 | + */ | ||
| 45 | + private String sortOrder = "desc"; | ||
| 46 | + /** | ||
| 47 | + * isAsc=true(升序) | ||
| 48 | + */ | ||
| 49 | + private Boolean isAsc = true; | ||
| 50 | + /*执行该排序逻辑*/ | ||
| 51 | + private Boolean sortCondition = true; | ||
| 52 | + | ||
| 53 | + | ||
| 54 | + public void setSortOrder(String sortOrder) { | ||
| 55 | + this.sortOrder = StringUtils.hasText(sortOrder) ? sortOrder.trim() : "desc"; | ||
| 56 | + this.isAsc = "asc".equalsIgnoreCase(this.sortOrder); | ||
| 57 | + } | ||
| 58 | + | ||
| 36 | } | 59 | } |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/departmentcost/vo/DepartmentCostPageReqVO.java
| 1 | package com.zteits.urbanops.module.garden.controller.admin.departmentcost.vo; | 1 | package com.zteits.urbanops.module.garden.controller.admin.departmentcost.vo; |
| 2 | 2 | ||
| 3 | +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; | ||
| 4 | +import com.zteits.urbanops.module.garden.dal.dataobject.departmentcost.DepartmentCostDO; | ||
| 3 | import lombok.*; | 5 | import lombok.*; |
| 4 | import java.util.*; | 6 | import java.util.*; |
| 5 | import io.swagger.v3.oas.annotations.media.Schema; | 7 | import io.swagger.v3.oas.annotations.media.Schema; |
| @@ -45,4 +47,13 @@ public class DepartmentCostPageReqVO extends PageParam { | @@ -45,4 +47,13 @@ public class DepartmentCostPageReqVO extends PageParam { | ||
| 45 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | 47 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
| 46 | private LocalDateTime[] createTime; | 48 | private LocalDateTime[] createTime; |
| 47 | 49 | ||
| 48 | -} | ||
| 49 | \ No newline at end of file | 50 | \ No newline at end of file |
| 51 | + //对应前端排序字段 | ||
| 52 | + public static final Map<String, SFunction<DepartmentCostDO, ?>> SORT_FIELD_MAP = Map.of( | ||
| 53 | + "id", DepartmentCostDO::getId, | ||
| 54 | + "salaryMonth", DepartmentCostDO::getSalaryMonth, | ||
| 55 | + "personCount", DepartmentCostDO::getPersonCount, | ||
| 56 | + "deptTotalCost", DepartmentCostDO::getDeptTotalCost, | ||
| 57 | + "createTime", DepartmentCostDO::getCreateTime | ||
| 58 | + ); | ||
| 59 | + | ||
| 60 | +} |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/rentalmechanicalcost/vo/RentalMechanicalCostPageReqVO.java
| 1 | package com.zteits.urbanops.module.garden.controller.admin.rentalmechanicalcost.vo; | 1 | package com.zteits.urbanops.module.garden.controller.admin.rentalmechanicalcost.vo; |
| 2 | 2 | ||
| 3 | -import cn.idev.excel.annotation.ExcelProperty; | ||
| 4 | -import com.fasterxml.jackson.annotation.JsonFormat; | 3 | +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; |
| 5 | import com.zteits.urbanops.framework.common.pojo.PageParam; | 4 | import com.zteits.urbanops.framework.common.pojo.PageParam; |
| 6 | -import com.zteits.urbanops.module.garden.controller.admin.costfee.vo.TeamBizdomainRelVo; | 5 | +import com.zteits.urbanops.module.garden.dal.dataobject.rentalmechanicalcost.RentalMechanicalCostDO; |
| 7 | import io.swagger.v3.oas.annotations.media.Schema; | 6 | import io.swagger.v3.oas.annotations.media.Schema; |
| 8 | import lombok.Data; | 7 | import lombok.Data; |
| 9 | import org.springframework.format.annotation.DateTimeFormat; | 8 | import org.springframework.format.annotation.DateTimeFormat; |
| 10 | 9 | ||
| 11 | import java.math.BigDecimal; | 10 | import java.math.BigDecimal; |
| 12 | import java.time.LocalDate; | 11 | import java.time.LocalDate; |
| 13 | -import java.time.LocalDateTime; | ||
| 14 | import java.util.Date; | 12 | import java.util.Date; |
| 15 | -import java.util.List; | ||
| 16 | - | ||
| 17 | -import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY; | ||
| 18 | -import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | 13 | +import java.util.Map; |
| 19 | 14 | ||
| 20 | @Schema(description = "管理后台 - 租赁机械费用录入分页 Request VO") | 15 | @Schema(description = "管理后台 - 租赁机械费用录入分页 Request VO") |
| 21 | @Data | 16 | @Data |
| 22 | public class RentalMechanicalCostPageReqVO extends PageParam { | 17 | public class RentalMechanicalCostPageReqVO extends PageParam { |
| 23 | 18 | ||
| 19 | + private String id; | ||
| 24 | @Schema(description = "机械名称", example = "张三") | 20 | @Schema(description = "机械名称", example = "张三") |
| 25 | private String mechName; | 21 | private String mechName; |
| 26 | 22 | ||
| @@ -34,4 +30,17 @@ public class RentalMechanicalCostPageReqVO extends PageParam { | @@ -34,4 +30,17 @@ public class RentalMechanicalCostPageReqVO extends PageParam { | ||
| 34 | @Schema(description = "使用时长(天)") | 30 | @Schema(description = "使用时长(天)") |
| 35 | private Integer useDuration; | 31 | private Integer useDuration; |
| 36 | 32 | ||
| 33 | + @Schema(description = "结束日期") | ||
| 34 | + private LocalDate endUseTime; | ||
| 35 | + | ||
| 36 | + @Schema(description = "数量") | ||
| 37 | + private Integer quantity; | ||
| 38 | + | ||
| 39 | + public static final Map<String, SFunction<RentalMechanicalCostDO, ?>> SORT_FIELD_MAP = Map.of( | ||
| 40 | + "id", RentalMechanicalCostDO::getId, | ||
| 41 | + "quantity", RentalMechanicalCostDO::getQuantity, | ||
| 42 | + "useDuration", RentalMechanicalCostDO::getUseDuration, | ||
| 43 | + "startUseTime", RentalMechanicalCostDO::getStartUseTime, | ||
| 44 | + "endUseTime", RentalMechanicalCostDO::getEndUseTime | ||
| 45 | + ); | ||
| 37 | } | 46 | } |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/rentalmechanicalcost/vo/RentalMechanicalCostSaveReqVO.java
| @@ -58,11 +58,11 @@ public class RentalMechanicalCostSaveReqVO { | @@ -58,11 +58,11 @@ public class RentalMechanicalCostSaveReqVO { | ||
| 58 | private Date endUseTime; | 58 | private Date endUseTime; |
| 59 | 59 | ||
| 60 | @Schema(description = "归属公司", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") | 60 | @Schema(description = "归属公司", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") |
| 61 | - @NotEmpty(message = "归属公司不能为空") | 61 | + //@NotEmpty(message = "归属公司不能为空") |
| 62 | private String companyName; | 62 | private String companyName; |
| 63 | 63 | ||
| 64 | @Schema(description = "归属公司ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25530") | 64 | @Schema(description = "归属公司ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25530") |
| 65 | - @NotEmpty(message = "归属公司ID不能为空") | 65 | + //@NotEmpty(message = "归属公司ID不能为空") |
| 66 | private String companyId; | 66 | private String companyId; |
| 67 | 67 | ||
| 68 | @Schema(description = "部门id", example = "25446") | 68 | @Schema(description = "部门id", example = "25446") |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/wasterecord/vo/WasteRecordPageReqVO.java
| @@ -2,7 +2,9 @@ package com.zteits.urbanops.module.garden.controller.admin.wasterecord.vo; | @@ -2,7 +2,9 @@ package com.zteits.urbanops.module.garden.controller.admin.wasterecord.vo; | ||
| 2 | 2 | ||
| 3 | import cn.hutool.core.annotation.Alias; | 3 | import cn.hutool.core.annotation.Alias; |
| 4 | import cn.idev.excel.annotation.ExcelProperty; | 4 | import cn.idev.excel.annotation.ExcelProperty; |
| 5 | +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; | ||
| 5 | import com.zteits.urbanops.framework.common.pojo.PageParam; | 6 | import com.zteits.urbanops.framework.common.pojo.PageParam; |
| 7 | +import com.zteits.urbanops.module.garden.dal.dataobject.wasterecord.WasteRecordDO; | ||
| 6 | import io.swagger.v3.oas.annotations.media.Schema; | 8 | import io.swagger.v3.oas.annotations.media.Schema; |
| 7 | import lombok.Data; | 9 | import lombok.Data; |
| 8 | import org.springframework.format.annotation.DateTimeFormat; | 10 | import org.springframework.format.annotation.DateTimeFormat; |
| @@ -11,6 +13,7 @@ import java.math.BigDecimal; | @@ -11,6 +13,7 @@ import java.math.BigDecimal; | ||
| 11 | import java.time.LocalDate; | 13 | import java.time.LocalDate; |
| 12 | import java.time.LocalDateTime; | 14 | import java.time.LocalDateTime; |
| 13 | import java.util.List; | 15 | import java.util.List; |
| 16 | +import java.util.Map; | ||
| 14 | 17 | ||
| 15 | import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | 18 | import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
| 16 | 19 | ||
| @@ -61,4 +64,11 @@ public class WasteRecordPageReqVO extends PageParam { | @@ -61,4 +64,11 @@ public class WasteRecordPageReqVO extends PageParam { | ||
| 61 | @Alias("deptId") | 64 | @Alias("deptId") |
| 62 | private List<String> teamIdList; | 65 | private List<String> teamIdList; |
| 63 | 66 | ||
| 67 | + public static final Map<String, SFunction<WasteRecordDO, ?>> SORT_FIELD_MAP = Map.of( | ||
| 68 | + "id", WasteRecordDO::getId, | ||
| 69 | + "vehicleLoad", WasteRecordDO::getWasteType, | ||
| 70 | + "transportTimes", WasteRecordDO::getTransportTimes, | ||
| 71 | + "totalCost", WasteRecordDO::getTotalCost, | ||
| 72 | + "createTime", WasteRecordDO::getCreateTime | ||
| 73 | + ); | ||
| 64 | } | 74 | } |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/waterfee/vo/WaterFeePageReqVO.java
| 1 | package com.zteits.urbanops.module.garden.controller.admin.waterfee.vo; | 1 | package com.zteits.urbanops.module.garden.controller.admin.waterfee.vo; |
| 2 | 2 | ||
| 3 | -import lombok.*; | ||
| 4 | -import java.util.*; | ||
| 5 | -import io.swagger.v3.oas.annotations.media.Schema; | 3 | +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; |
| 6 | import com.zteits.urbanops.framework.common.pojo.PageParam; | 4 | import com.zteits.urbanops.framework.common.pojo.PageParam; |
| 7 | -import java.math.BigDecimal; | 5 | +import com.zteits.urbanops.module.garden.dal.dataobject.waterfee.WaterFeeDO; |
| 6 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 7 | +import lombok.Data; | ||
| 8 | import org.springframework.format.annotation.DateTimeFormat; | 8 | import org.springframework.format.annotation.DateTimeFormat; |
| 9 | + | ||
| 10 | +import java.math.BigDecimal; | ||
| 9 | import java.time.LocalDateTime; | 11 | import java.time.LocalDateTime; |
| 12 | +import java.util.Map; | ||
| 10 | 13 | ||
| 11 | import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | 14 | import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
| 12 | 15 | ||
| @@ -45,4 +48,10 @@ public class WaterFeePageReqVO extends PageParam { | @@ -45,4 +48,10 @@ public class WaterFeePageReqVO extends PageParam { | ||
| 45 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | 48 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
| 46 | private LocalDateTime[] createTime; | 49 | private LocalDateTime[] createTime; |
| 47 | 50 | ||
| 48 | -} | ||
| 49 | \ No newline at end of file | 51 | \ No newline at end of file |
| 52 | + public static final Map<String, SFunction<WaterFeeDO, ?>> SORT_FIELD_MAP = Map.of( | ||
| 53 | + "id", WaterFeeDO::getId, | ||
| 54 | + "totalFee", WaterFeeDO::getTotalFee, | ||
| 55 | + "waterUsage", WaterFeeDO::getWaterUsage, | ||
| 56 | + "createTime", WaterFeeDO::getCreateTime | ||
| 57 | + ); | ||
| 58 | +} |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/mechanicalcost/MechanicalCostDO.java
| @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.KeySequence; | @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.KeySequence; | ||
| 4 | import com.baomidou.mybatisplus.annotation.TableField; | 4 | import com.baomidou.mybatisplus.annotation.TableField; |
| 5 | import com.baomidou.mybatisplus.annotation.TableId; | 5 | import com.baomidou.mybatisplus.annotation.TableId; |
| 6 | import com.baomidou.mybatisplus.annotation.TableName; | 6 | import com.baomidou.mybatisplus.annotation.TableName; |
| 7 | +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; | ||
| 7 | import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; | 8 | import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; |
| 8 | import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; | 9 | import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; |
| 9 | import lombok.*; | 10 | import lombok.*; |
| @@ -11,6 +12,7 @@ import lombok.*; | @@ -11,6 +12,7 @@ import lombok.*; | ||
| 11 | import java.math.BigDecimal; | 12 | import java.math.BigDecimal; |
| 12 | import java.time.LocalDate; | 13 | import java.time.LocalDate; |
| 13 | import java.util.List; | 14 | import java.util.List; |
| 15 | +import java.util.Map; | ||
| 14 | 16 | ||
| 15 | /** | 17 | /** |
| 16 | * 自有机械费用录入 DO | 18 | * 自有机械费用录入 DO |
| @@ -98,5 +100,16 @@ public class MechanicalCostDO extends BaseDO { | @@ -98,5 +100,16 @@ public class MechanicalCostDO extends BaseDO { | ||
| 98 | */ | 100 | */ |
| 99 | private String remark; | 101 | private String remark; |
| 100 | 102 | ||
| 103 | + static final Map<String, SFunction<MechanicalCostDO, ?>> SORT_FIELD_MAP = Map.of( | ||
| 104 | + "id", MechanicalCostDO::getId, | ||
| 105 | + "unitPrice", MechanicalCostDO::getUnitPrice, | ||
| 106 | + "quantity", MechanicalCostDO::getQuantity, | ||
| 107 | + "licensePlate", MechanicalCostDO::getLicensePlate, | ||
| 108 | + "vehicleCategory", MechanicalCostDO::getVehicleCategory, | ||
| 109 | + "vehicleType", MechanicalCostDO::getVehicleType, | ||
| 110 | + "startUseTime", MechanicalCostDO::getStartUseTime, | ||
| 111 | + "endUseTime", MechanicalCostDO::getEndUseTime, | ||
| 112 | + "serviceLife", MechanicalCostDO::getServiceLife | ||
| 113 | + ); | ||
| 101 | 114 | ||
| 102 | } | 115 | } |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/departmentcost/DepartmentCostMapper.java
| 1 | package com.zteits.urbanops.module.garden.dal.mysql.departmentcost; | 1 | package com.zteits.urbanops.module.garden.dal.mysql.departmentcost; |
| 2 | 2 | ||
| 3 | -import java.util.*; | ||
| 4 | - | ||
| 5 | import com.zteits.urbanops.framework.common.pojo.PageResult; | 3 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 6 | -import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; | ||
| 7 | import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; | 4 | import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; |
| 5 | +import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; | ||
| 6 | +import com.zteits.urbanops.module.garden.controller.admin.departmentcost.vo.DepartmentCostPageReqVO; | ||
| 8 | import com.zteits.urbanops.module.garden.dal.dataobject.departmentcost.DepartmentCostDO; | 7 | import com.zteits.urbanops.module.garden.dal.dataobject.departmentcost.DepartmentCostDO; |
| 9 | import org.apache.ibatis.annotations.Mapper; | 8 | import org.apache.ibatis.annotations.Mapper; |
| 10 | -import com.zteits.urbanops.module.garden.controller.admin.departmentcost.vo.*; | 9 | + |
| 10 | +import java.util.List; | ||
| 11 | 11 | ||
| 12 | /** | 12 | /** |
| 13 | * 部门费用录入 Mapper | 13 | * 部门费用录入 Mapper |
| @@ -29,7 +29,10 @@ public interface DepartmentCostMapper extends BaseMapperX<DepartmentCostDO> { | @@ -29,7 +29,10 @@ public interface DepartmentCostMapper extends BaseMapperX<DepartmentCostDO> { | ||
| 29 | .eqIfPresent(DepartmentCostDO::getDeptId, reqVO.getDeptId()) | 29 | .eqIfPresent(DepartmentCostDO::getDeptId, reqVO.getDeptId()) |
| 30 | .eqIfPresent(DepartmentCostDO::getRemark, reqVO.getRemark()) | 30 | .eqIfPresent(DepartmentCostDO::getRemark, reqVO.getRemark()) |
| 31 | .betweenIfPresent(DepartmentCostDO::getCreateTime, reqVO.getCreateTime()) | 31 | .betweenIfPresent(DepartmentCostDO::getCreateTime, reqVO.getCreateTime()) |
| 32 | - .orderByDesc(DepartmentCostDO::getId)); | 32 | + .orderBy(reqVO.getSortCondition(), reqVO.getIsAsc(), |
| 33 | + DepartmentCostPageReqVO.SORT_FIELD_MAP.get(reqVO.getSortField()) | ||
| 34 | + ) | ||
| 35 | + ); | ||
| 33 | } | 36 | } |
| 34 | /** | 37 | /** |
| 35 | * 批量查询重复数据 | 38 | * 批量查询重复数据 |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/rentalmechanicalcost/RentalMechanicalCostMapper.java
| 1 | package com.zteits.urbanops.module.garden.dal.mysql.rentalmechanicalcost; | 1 | package com.zteits.urbanops.module.garden.dal.mysql.rentalmechanicalcost; |
| 2 | 2 | ||
| 3 | -import java.util.*; | ||
| 4 | - | ||
| 5 | import com.zteits.urbanops.framework.common.pojo.PageResult; | 3 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 6 | -import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; | ||
| 7 | import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; | 4 | import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; |
| 5 | +import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; | ||
| 6 | +import com.zteits.urbanops.module.garden.controller.admin.departmentcost.vo.DepartmentCostPageReqVO; | ||
| 7 | +import com.zteits.urbanops.module.garden.controller.admin.rentalmechanicalcost.vo.RentalMechanicalCostPageReqVO; | ||
| 8 | import com.zteits.urbanops.module.garden.dal.dataobject.rentalmechanicalcost.RentalMechanicalCostDO; | 8 | import com.zteits.urbanops.module.garden.dal.dataobject.rentalmechanicalcost.RentalMechanicalCostDO; |
| 9 | import org.apache.ibatis.annotations.Mapper; | 9 | import org.apache.ibatis.annotations.Mapper; |
| 10 | -import com.zteits.urbanops.module.garden.controller.admin.rentalmechanicalcost.vo.*; | ||
| 11 | 10 | ||
| 12 | /** | 11 | /** |
| 13 | * 租赁机械费用录入 Mapper | 12 | * 租赁机械费用录入 Mapper |
| @@ -36,7 +35,10 @@ public interface RentalMechanicalCostMapper extends BaseMapperX<RentalMechanical | @@ -36,7 +35,10 @@ public interface RentalMechanicalCostMapper extends BaseMapperX<RentalMechanical | ||
| 36 | //.eqIfPresent(RentalMechanicalCostDO::getRoadIds, reqVO.getRoadIds()) | 35 | //.eqIfPresent(RentalMechanicalCostDO::getRoadIds, reqVO.getRoadIds()) |
| 37 | ///.//eqIfPresent(RentalMechanicalCostDO::getRemark, reqVO.getRemark()) | 36 | ///.//eqIfPresent(RentalMechanicalCostDO::getRemark, reqVO.getRemark()) |
| 38 | //.betweenIfPresent(RentalMechanicalCostDO::getCreateTime, reqVO.getCreateTime()) | 37 | //.betweenIfPresent(RentalMechanicalCostDO::getCreateTime, reqVO.getCreateTime()) |
| 39 | - .orderByDesc(RentalMechanicalCostDO::getId)); | 38 | + .orderBy(reqVO.getSortCondition(), reqVO.getIsAsc(), |
| 39 | + RentalMechanicalCostPageReqVO.SORT_FIELD_MAP.get(reqVO.getSortField()) | ||
| 40 | + ) | ||
| 41 | + ); | ||
| 40 | } | 42 | } |
| 41 | 43 | ||
| 42 | } | 44 | } |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/wasterecord/WasteRecordMapper.java
| 1 | package com.zteits.urbanops.module.garden.dal.mysql.wasterecord; | 1 | package com.zteits.urbanops.module.garden.dal.mysql.wasterecord; |
| 2 | 2 | ||
| 3 | -import java.util.*; | ||
| 4 | - | ||
| 5 | import com.zteits.urbanops.framework.common.pojo.PageResult; | 3 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 6 | -import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; | ||
| 7 | import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; | 4 | import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; |
| 5 | +import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; | ||
| 6 | +import com.zteits.urbanops.module.garden.controller.admin.wasterecord.vo.WasteRecordPageReqVO; | ||
| 8 | import com.zteits.urbanops.module.garden.dal.dataobject.wasterecord.WasteRecordDO; | 7 | import com.zteits.urbanops.module.garden.dal.dataobject.wasterecord.WasteRecordDO; |
| 9 | import org.apache.ibatis.annotations.Mapper; | 8 | import org.apache.ibatis.annotations.Mapper; |
| 10 | -import com.zteits.urbanops.module.garden.controller.admin.wasterecord.vo.*; | ||
| 11 | 9 | ||
| 12 | /** | 10 | /** |
| 13 | * 园林废弃物录入 Mapper | 11 | * 园林废弃物录入 Mapper |
| @@ -31,7 +29,11 @@ public interface WasteRecordMapper extends BaseMapperX<WasteRecordDO> { | @@ -31,7 +29,11 @@ public interface WasteRecordMapper extends BaseMapperX<WasteRecordDO> { | ||
| 31 | .eqIfPresent(WasteRecordDO::getDeptId, reqVO.getDeptId()) | 29 | .eqIfPresent(WasteRecordDO::getDeptId, reqVO.getDeptId()) |
| 32 | .eqIfPresent(WasteRecordDO::getRemark, reqVO.getRemark()) | 30 | .eqIfPresent(WasteRecordDO::getRemark, reqVO.getRemark()) |
| 33 | .betweenIfPresent(WasteRecordDO::getCreateTime, reqVO.getCreateTime()) | 31 | .betweenIfPresent(WasteRecordDO::getCreateTime, reqVO.getCreateTime()) |
| 34 | - .orderByDesc(WasteRecordDO::getId)); | 32 | + //.orderByDesc(WasteRecordDO::getId)); |
| 33 | + .orderBy(reqVO.getSortCondition(), reqVO.getIsAsc(), | ||
| 34 | + WasteRecordPageReqVO.SORT_FIELD_MAP.get(reqVO.getSortField()) | ||
| 35 | + ) | ||
| 36 | + ); | ||
| 35 | } | 37 | } |
| 36 | 38 | ||
| 37 | } | 39 | } |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/waterfee/WaterFeeMapper.java
| 1 | package com.zteits.urbanops.module.garden.dal.mysql.waterfee; | 1 | package com.zteits.urbanops.module.garden.dal.mysql.waterfee; |
| 2 | 2 | ||
| 3 | -import java.util.*; | ||
| 4 | - | ||
| 5 | import com.zteits.urbanops.framework.common.pojo.PageResult; | 3 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 6 | -import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; | ||
| 7 | import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; | 4 | import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; |
| 5 | +import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; | ||
| 6 | +import com.zteits.urbanops.module.garden.controller.admin.waterfee.vo.WaterFeePageReqVO; | ||
| 8 | import com.zteits.urbanops.module.garden.dal.dataobject.waterfee.WaterFeeDO; | 7 | import com.zteits.urbanops.module.garden.dal.dataobject.waterfee.WaterFeeDO; |
| 9 | import org.apache.ibatis.annotations.Mapper; | 8 | import org.apache.ibatis.annotations.Mapper; |
| 10 | -import com.zteits.urbanops.module.garden.controller.admin.waterfee.vo.*; | 9 | + |
| 10 | +import java.util.List; | ||
| 11 | 11 | ||
| 12 | /** | 12 | /** |
| 13 | * 水费录入信息 Mapper | 13 | * 水费录入信息 Mapper |
| @@ -29,7 +29,11 @@ public interface WaterFeeMapper extends BaseMapperX<WaterFeeDO> { | @@ -29,7 +29,11 @@ public interface WaterFeeMapper extends BaseMapperX<WaterFeeDO> { | ||
| 29 | .eqIfPresent(WaterFeeDO::getDeptId, reqVO.getDeptId()) | 29 | .eqIfPresent(WaterFeeDO::getDeptId, reqVO.getDeptId()) |
| 30 | .eqIfPresent(WaterFeeDO::getCompanyId, reqVO.getCompanyId()) | 30 | .eqIfPresent(WaterFeeDO::getCompanyId, reqVO.getCompanyId()) |
| 31 | .betweenIfPresent(WaterFeeDO::getCreateTime, reqVO.getCreateTime()) | 31 | .betweenIfPresent(WaterFeeDO::getCreateTime, reqVO.getCreateTime()) |
| 32 | - .orderByDesc(WaterFeeDO::getId)); | 32 | + //.orderByDesc(WaterFeeDO::getId)); |
| 33 | + .orderBy(reqVO.getSortCondition(), reqVO.getIsAsc(), | ||
| 34 | + WaterFeePageReqVO.SORT_FIELD_MAP.get(reqVO.getSortField()) | ||
| 35 | + ) | ||
| 36 | + ); | ||
| 33 | } | 37 | } |
| 34 | 38 | ||
| 35 | 39 |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventory/MaterialInventoryServiceImpl.java
| @@ -142,7 +142,7 @@ public class MaterialInventoryServiceImpl implements MaterialInventoryService { | @@ -142,7 +142,7 @@ public class MaterialInventoryServiceImpl implements MaterialInventoryService { | ||
| 142 | if (outNum == null) { | 142 | if (outNum == null) { |
| 143 | throw exception0(BAD_REQUEST.getCode(),"更新库存失败:outNum为空!"); | 143 | throw exception0(BAD_REQUEST.getCode(),"更新库存失败:outNum为空!"); |
| 144 | } | 144 | } |
| 145 | - materialInventory.setOutTotalNum(materialInventory.getInventoryTotalNum() + outNum); | 145 | + materialInventory.setOutTotalNum(materialInventory.getOutTotalNum() + outNum); |
| 146 | materialInventory.setCurrentNum(materialInventory.getCurrentNum() - outNum); | 146 | materialInventory.setCurrentNum(materialInventory.getCurrentNum() - outNum); |
| 147 | return materialInventoryMapper.updateById(materialInventory); | 147 | return materialInventoryMapper.updateById(materialInventory); |
| 148 | } | 148 | } |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryout/MaterialInventoryOutServiceImpl.java
| @@ -119,7 +119,7 @@ public class MaterialInventoryOutServiceImpl implements MaterialInventoryOutServ | @@ -119,7 +119,7 @@ public class MaterialInventoryOutServiceImpl implements MaterialInventoryOutServ | ||
| 119 | 119 | ||
| 120 | //入库记录减扣 | 120 | //入库记录减扣 |
| 121 | inventory.setCurrentNum(inventory.getCurrentNum() + materialInventoryOut.getOutInventoryNum()); | 121 | inventory.setCurrentNum(inventory.getCurrentNum() + materialInventoryOut.getOutInventoryNum()); |
| 122 | - inventory.setInventoryTotalNum(inventory.getInventoryTotalNum() + materialInventoryOut.getOutInventoryNum()); | 122 | + //inventory.setInventoryTotalNum(inventory.getInventoryTotalNum() + materialInventoryOut.getOutInventoryNum()); |
| 123 | inventory.setOutTotalNum(inventory.getOutTotalNum() - materialInventoryOut.getOutInventoryNum()); | 123 | inventory.setOutTotalNum(inventory.getOutTotalNum() - materialInventoryOut.getOutInventoryNum()); |
| 124 | materialInventoryService.updateTdMaterialInventory(inventory); | 124 | materialInventoryService.updateTdMaterialInventory(inventory); |
| 125 | 125 |
urbanops-module-workorder/pom.xml
| @@ -126,6 +126,12 @@ | @@ -126,6 +126,12 @@ | ||
| 126 | <artifactId>urbanops-module-system</artifactId> | 126 | <artifactId>urbanops-module-system</artifactId> |
| 127 | <version>${revision}</version> | 127 | <version>${revision}</version> |
| 128 | </dependency> | 128 | </dependency> |
| 129 | + <dependency> | ||
| 130 | + <groupId>com.zteits.boot</groupId> | ||
| 131 | + <artifactId>urbanops-module-bpm</artifactId> | ||
| 132 | + <version>${revision}</version> | ||
| 133 | + </dependency> | ||
| 134 | + | ||
| 129 | </dependencies> | 135 | </dependencies> |
| 130 | 136 | ||
| 131 | </project> | 137 | </project> |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/api/constant/BpmCommonConstant.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.api.constant; | ||
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * @author yanhuiqing | ||
| 5 | + * @version 1.0 | ||
| 6 | + * @description: 流程业务定义key | ||
| 7 | + * @date 2025/12/3 10:35 | ||
| 8 | + */ | ||
| 9 | +public class BpmCommonConstant { | ||
| 10 | + /** | ||
| 11 | + * 园林巡检工单 流程业务key | ||
| 12 | + */ | ||
| 13 | + public static final String BPM_GARDEN_INSPECT_WO = "garden_inspect_wo"; | ||
| 14 | + /** | ||
| 15 | + * 物业巡检工单 流程业务key | ||
| 16 | + */ | ||
| 17 | + public static final String BPM_PROPERTY_INSPECT_WO = "property_inspect_wo"; | ||
| 18 | + /** | ||
| 19 | + * 市政巡检工单 流程业务key | ||
| 20 | + */ | ||
| 21 | + public static final String BPM_MUNICIPAL_INSPECT_WO = "municipal_inspect_wo"; | ||
| 22 | + /** | ||
| 23 | + * 园林问题单图片类型 | ||
| 24 | + */ | ||
| 25 | + public static final String GARDEN_INSPECT_WO_ATTACH1 = "01"; | ||
| 26 | + /** | ||
| 27 | + * 园林街道图片类型 | ||
| 28 | + */ | ||
| 29 | + public static final String GARDEN_INSPECT_WO_ATTACH2 = "02"; | ||
| 30 | + /** | ||
| 31 | + * 园林远景图片类型 | ||
| 32 | + */ | ||
| 33 | + public static final String GARDEN_INSPECT_WO_ATTACH3 = "03"; | ||
| 34 | + | ||
| 35 | +} |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/garden/BpmGardenInspectController.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.controller.admin.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.bpm.controller.admin.oa.vo.BpmOALeaveCreateReqVO; | ||
| 7 | +import com.zteits.urbanops.module.bpm.controller.admin.oa.vo.BpmOALeavePageReqVO; | ||
| 8 | +import com.zteits.urbanops.module.bpm.controller.admin.oa.vo.BpmOALeaveRespVO; | ||
| 9 | +import com.zteits.urbanops.module.bpm.dal.dataobject.oa.BpmOALeaveDO; | ||
| 10 | +import com.zteits.urbanops.module.workorder.controller.admin.garden.vo.BpmGardenWorkOrderCreateReqVo; | ||
| 11 | +import com.zteits.urbanops.module.workorder.controller.admin.garden.vo.BpmGardenWorkOrderPageReqVO; | ||
| 12 | +import com.zteits.urbanops.module.workorder.controller.admin.garden.vo.BpmGardenWorkOrderRespVO; | ||
| 13 | +import com.zteits.urbanops.module.workorder.dal.dataobject.garden.BpmGardenWorkOrderDO; | ||
| 14 | +import com.zteits.urbanops.module.workorder.service.garden.BpmGardenService; | ||
| 15 | +import io.swagger.v3.oas.annotations.Operation; | ||
| 16 | +import io.swagger.v3.oas.annotations.Parameter; | ||
| 17 | +import io.swagger.v3.oas.annotations.tags.Tag; | ||
| 18 | +import jakarta.annotation.Resource; | ||
| 19 | +import jakarta.validation.Valid; | ||
| 20 | +import org.springframework.security.access.prepost.PreAuthorize; | ||
| 21 | +import org.springframework.validation.annotation.Validated; | ||
| 22 | +import org.springframework.web.bind.annotation.*; | ||
| 23 | + | ||
| 24 | +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; | ||
| 25 | +import static com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; | ||
| 26 | + | ||
| 27 | +/** | ||
| 28 | + * @author yanhuiqing | ||
| 29 | + * @version 1.0 | ||
| 30 | + * @description: 园林巡检工单 | ||
| 31 | + * @date 2025/12/3 11:03 | ||
| 32 | + */ | ||
| 33 | +@Tag(name = "管理后台 - 园林巡检工单") | ||
| 34 | +@RestController | ||
| 35 | +@RequestMapping("/bpm/garden/inspection") | ||
| 36 | +@Validated | ||
| 37 | +public class BpmGardenInspectController { | ||
| 38 | + @Resource | ||
| 39 | + private BpmGardenService gardenService; | ||
| 40 | + | ||
| 41 | + @PostMapping("/create") | ||
| 42 | + @PreAuthorize("@ss.hasPermission('bpm:garden-inspection:create')") | ||
| 43 | + @Operation(summary = "创建请求申请") | ||
| 44 | + public CommonResult<Long> createGardenInspection(@Valid @RequestBody BpmGardenWorkOrderCreateReqVo createReqVO) { | ||
| 45 | + return success(gardenService.createWorkOrder(getLoginUserId(), createReqVO)); | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + @GetMapping("/get") | ||
| 49 | + @PreAuthorize("@ss.hasPermission('bpm:garden-inspection:query')") | ||
| 50 | + @Operation(summary = "获得园林工单申请") | ||
| 51 | + @Parameter(name = "id", description = "编号", required = true, example = "1024") | ||
| 52 | + public CommonResult<BpmGardenWorkOrderRespVO> getGardenInspection(@RequestParam("id") Long id) { | ||
| 53 | + BpmGardenWorkOrderDO gardenInspection = gardenService.getWorkOrder(id); | ||
| 54 | + return success(BeanUtils.toBean(gardenInspection, BpmGardenWorkOrderRespVO.class)); | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + @GetMapping("/page") | ||
| 58 | + @PreAuthorize("@ss.hasPermission('bpm:garden-inspection:query')") | ||
| 59 | + @Operation(summary = "获得园林巡检工单申请分页") | ||
| 60 | + public CommonResult<PageResult<BpmGardenWorkOrderRespVO>> getGardenInspectionPage(@Valid BpmGardenWorkOrderPageReqVO pageVO) { | ||
| 61 | + PageResult<BpmGardenWorkOrderDO> pageResult = gardenService.getGardenInspectionPage(getLoginUserId(), pageVO); | ||
| 62 | + return success(BeanUtils.toBean(pageResult, BpmGardenWorkOrderRespVO.class)); | ||
| 63 | + } | ||
| 64 | +} |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/garden/vo/BpmGardenWorkOrderCreateReqVo.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.controller.admin.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: 园林工单请求创建 Request VO | ||
| 17 | + * @date 2025/12/1 11:17 | ||
| 18 | + */ | ||
| 19 | +@Schema(description = "园林工单请求创建 Request VO") | ||
| 20 | +@Data | ||
| 21 | +public class BpmGardenWorkOrderCreateReqVo { | ||
| 22 | + | ||
| 23 | + @Schema(description = "业务线:yl 园林,wy 物业,sz 市政 ", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| 24 | + @NotEmpty(message = "业务线:yl 园林,wy 物业,sz 市政 不能为空") | ||
| 25 | + private String busiLine; | ||
| 26 | + | ||
| 27 | + @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21128") | ||
| 28 | + @NotNull(message = "道路ID不能为空") | ||
| 29 | + private Long roadId; | ||
| 30 | + | ||
| 31 | + @Schema(description = "上传图片", example = "9184") | ||
| 32 | + private List<String> imgs; | ||
| 33 | + @Schema(description = "街道照片", example = "9184") | ||
| 34 | + private List<String> streetImgList; | ||
| 35 | + @Schema(description = "远景照片", example = "9184") | ||
| 36 | + private List<String> longRangeImgList; | ||
| 37 | + | ||
| 38 | + @Schema(description = "工单描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对") | ||
| 39 | + @NotEmpty(message = "工单描述不能为空") | ||
| 40 | + @Length(max = 500) | ||
| 41 | + private String remark; | ||
| 42 | + | ||
| 43 | + @Schema(description = "经纬度类型: 1:国标; 2:百度;3:高德;4:腾讯", example = "2") | ||
| 44 | + private Integer latLonType; | ||
| 45 | + | ||
| 46 | + @Schema(description = "经度", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| 47 | + @NotNull(message = "经度不能为空") | ||
| 48 | + private BigDecimal lat; | ||
| 49 | + | ||
| 50 | + @Schema(description = "维度", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| 51 | + @NotNull(message = "维度不能为空") | ||
| 52 | + private BigDecimal lon; | ||
| 53 | + | ||
| 54 | + @Schema(description = "经纬度地址", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| 55 | + @NotEmpty(message = "经纬度地址不能为空") | ||
| 56 | + private String lonLatAddress; | ||
| 57 | + | ||
| 58 | + @Schema(description = "紧急程度:1:特急;2:紧急;3:一般", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") | ||
| 59 | + @NotNull(message = "紧急程度:1:特急;2:紧急;3:一般不能为空") | ||
| 60 | + private Integer pressingType; | ||
| 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/controller/admin/garden/vo/BpmGardenWorkOrderPageReqVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.controller.admin.garden.vo; | ||
| 2 | + | ||
| 3 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | ||
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 5 | +import lombok.Data; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * @author yanhuiqing | ||
| 9 | + * @version 1.0 | ||
| 10 | + * @description: 园林工单申请分页 Request VO | ||
| 11 | + * @date 2025/12/3 11:32 | ||
| 12 | + */ | ||
| 13 | +@Schema(description = "管理后台 - 园林工单申请分页 Request VO") | ||
| 14 | +@Data | ||
| 15 | +public class BpmGardenWorkOrderPageReqVO extends PageParam { | ||
| 16 | +} |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/garden/vo/BpmGardenWorkOrderRespVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.controller.admin.garden.vo; | ||
| 2 | + | ||
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | +import lombok.Data; | ||
| 5 | + | ||
| 6 | +/** | ||
| 7 | + * @author yanhuiqing | ||
| 8 | + * @version 1.0 | ||
| 9 | + * @description: 园林工单流程 Response VO | ||
| 10 | + * @date 2025/12/3 11:31 | ||
| 11 | + */ | ||
| 12 | +@Schema(description = "管理后台 - 园林工单流程 Response VO") | ||
| 13 | +@Data | ||
| 14 | +public class BpmGardenWorkOrderRespVO { | ||
| 15 | +} |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/garden/BpmGardenWorkOrderDO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.dal.dataobject.garden; | ||
| 2 | + | ||
| 3 | +import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO; | ||
| 4 | + | ||
| 5 | +/** | ||
| 6 | + * @author yanhuiqing | ||
| 7 | + * @version 1.0 | ||
| 8 | + * @description: TODO | ||
| 9 | + * @date 2025/12/1 11:34 | ||
| 10 | + */ | ||
| 11 | +public class BpmGardenWorkOrderDO extends MainInfoDO { | ||
| 12 | +} |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/maininfo/MainInfoMapper.java
| @@ -49,4 +49,36 @@ public interface MainInfoMapper extends BaseMapperX<MainInfoDO> { | @@ -49,4 +49,36 @@ public interface MainInfoMapper extends BaseMapperX<MainInfoDO> { | ||
| 49 | .orderByDesc(MainInfoDO::getId)); | 49 | .orderByDesc(MainInfoDO::getId)); |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | + default PageResult<MainInfoDO> selectPage(Long loginUserId,MainInfoPageReqVO reqVO) { | ||
| 53 | + return selectPage(reqVO, new LambdaQueryWrapperX<MainInfoDO>() | ||
| 54 | + .eqIfPresent(MainInfoDO::getBusiLine, reqVO.getBusiLine()) | ||
| 55 | + .eqIfPresent(MainInfoDO::getOrderNo, reqVO.getOrderNo()) | ||
| 56 | + .likeIfPresent(MainInfoDO::getOrderName, reqVO.getOrderName()) | ||
| 57 | + .eqIfPresent(MainInfoDO::getSourceId, reqVO.getSourceId()) | ||
| 58 | + .likeIfPresent(MainInfoDO::getSourceName, reqVO.getSourceName()) | ||
| 59 | + .eqIfPresent(MainInfoDO::getRoadId, reqVO.getRoadId()) | ||
| 60 | + .likeIfPresent(MainInfoDO::getRoadName, reqVO.getRoadName()) | ||
| 61 | + .eqIfPresent(MainInfoDO::getStreetId, reqVO.getStreetId()) | ||
| 62 | + .likeIfPresent(MainInfoDO::getStreetName, reqVO.getStreetName()) | ||
| 63 | + .eqIfPresent(MainInfoDO::getCuringLevelId, reqVO.getCuringLevelId()) | ||
| 64 | + .likeIfPresent(MainInfoDO::getCuringLevelName, reqVO.getCuringLevelName()) | ||
| 65 | + .betweenIfPresent(MainInfoDO::getCommitDate, reqVO.getCommitDate()) | ||
| 66 | + .eqIfPresent(MainInfoDO::getPressingType, reqVO.getPressingType()) | ||
| 67 | + .eqIfPresent(MainInfoDO::getUserId, loginUserId) | ||
| 68 | + .likeIfPresent(MainInfoDO::getUserName, reqVO.getUserName()) | ||
| 69 | + .eqIfPresent(MainInfoDO::getCompanyId, reqVO.getCompanyId()) | ||
| 70 | + .eqIfPresent(MainInfoDO::getLatLonType, reqVO.getLatLonType()) | ||
| 71 | + .eqIfPresent(MainInfoDO::getLat, reqVO.getLat()) | ||
| 72 | + .eqIfPresent(MainInfoDO::getLon, reqVO.getLon()) | ||
| 73 | + .eqIfPresent(MainInfoDO::getLonLatAddress, reqVO.getLonLatAddress()) | ||
| 74 | + .eqIfPresent(MainInfoDO::getThirdWorkNo, reqVO.getThirdWorkNo()) | ||
| 75 | + .eqIfPresent(MainInfoDO::getThirdPushState, reqVO.getThirdPushState()) | ||
| 76 | + .eqIfPresent(MainInfoDO::getBuzStatus, reqVO.getBuzStatus()) | ||
| 77 | + .eqIfPresent(MainInfoDO::getStatus, reqVO.getStatus()) | ||
| 78 | + .eqIfPresent(MainInfoDO::getProcessInstanceId, reqVO.getProcessInstanceId()) | ||
| 79 | + .eqIfPresent(MainInfoDO::getRemark, reqVO.getRemark()) | ||
| 80 | + .betweenIfPresent(MainInfoDO::getCreateTime, reqVO.getCreateTime()) | ||
| 81 | + .orderByDesc(MainInfoDO::getId)); | ||
| 82 | + } | ||
| 83 | + | ||
| 52 | } | 84 | } |
| 53 | \ No newline at end of file | 85 | \ No newline at end of file |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/enums/ErrorCodeConstants.java
| @@ -11,9 +11,9 @@ import com.zteits.urbanops.framework.common.exception.ErrorCode; | @@ -11,9 +11,9 @@ import com.zteits.urbanops.framework.common.exception.ErrorCode; | ||
| 11 | public interface ErrorCodeConstants { | 11 | public interface ErrorCodeConstants { |
| 12 | 12 | ||
| 13 | // ========== server 工单 1-100-001-000 ========== | 13 | // ========== server 工单 1-100-001-000 ========== |
| 14 | - ErrorCode MAIN_INFO_NOT_EXISTS = new ErrorCode(1-100-001-000, "工单信息不存在"); | 14 | + ErrorCode MAIN_INFO_NOT_EXISTS = new ErrorCode(1-900-001-000, "工单信息不存在"); |
| 15 | 15 | ||
| 16 | - ErrorCode ATTACHMENT_NOT_EXISTS = new ErrorCode(1-100-002-000, "工单附件信息不存在"); | 16 | + ErrorCode ATTACHMENT_NOT_EXISTS = new ErrorCode(1-900-001-001, "工单附件信息不存在"); |
| 17 | 17 | ||
| 18 | - ErrorCode MATERIAL_DETAIL_NOT_EXISTS = new ErrorCode(1-100-003-000, "工单耗材明细不存在"); | 18 | + ErrorCode MATERIAL_DETAIL_NOT_EXISTS = new ErrorCode(1-900-001-002, "工单耗材明细不存在"); |
| 19 | } | 19 | } |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmGardenService.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.service.garden; | ||
| 2 | + | ||
| 3 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | ||
| 4 | +import com.zteits.urbanops.module.workorder.controller.admin.garden.vo.BpmGardenWorkOrderCreateReqVo; | ||
| 5 | +import com.zteits.urbanops.module.workorder.controller.admin.garden.vo.BpmGardenWorkOrderPageReqVO; | ||
| 6 | +import com.zteits.urbanops.module.workorder.dal.dataobject.garden.BpmGardenWorkOrderDO; | ||
| 7 | +import jakarta.validation.Valid; | ||
| 8 | +/** | ||
| 9 | + * @author yanhuiqing | ||
| 10 | + * @version 1.0 | ||
| 11 | + * @description: 园林工作流 | ||
| 12 | + * @date 2025/12/1 11:13 | ||
| 13 | + */ | ||
| 14 | +public interface BpmGardenService { | ||
| 15 | + /** | ||
| 16 | + * 园林工单申请 Service 接口 | ||
| 17 | + * @param userId | ||
| 18 | + * @param createRequestVo | ||
| 19 | + * @return | ||
| 20 | + */ | ||
| 21 | + Long createWorkOrder(Long userId,@Valid BpmGardenWorkOrderCreateReqVo createRequestVo); | ||
| 22 | + | ||
| 23 | + /** | ||
| 24 | + * 更新工单申请的状态 | ||
| 25 | + * | ||
| 26 | + * @param id 编号 | ||
| 27 | + * @param status 结果 | ||
| 28 | + */ | ||
| 29 | + void updateWorkOrderStatus(Long id, Integer status); | ||
| 30 | + | ||
| 31 | + /** | ||
| 32 | + * 获得工单详情 | ||
| 33 | + * | ||
| 34 | + * @param id 编号 | ||
| 35 | + * @return 工单详情 | ||
| 36 | + */ | ||
| 37 | + BpmGardenWorkOrderDO getWorkOrder(Long id); | ||
| 38 | + | ||
| 39 | + /** | ||
| 40 | + * 获得工单分页数据 | ||
| 41 | + * @param loginUserId | ||
| 42 | + * @param pageVO | ||
| 43 | + * @return | ||
| 44 | + */ | ||
| 45 | + PageResult<BpmGardenWorkOrderDO> getGardenInspectionPage(Long loginUserId, BpmGardenWorkOrderPageReqVO pageVO); | ||
| 46 | +} |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmGardenServiceImpl.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.service.garden; | ||
| 2 | + | ||
| 3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
| 4 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | ||
| 5 | +import com.zteits.urbanops.framework.common.util.object.BeanUtils; | ||
| 6 | +import com.zteits.urbanops.framework.common.util.object.ObjectUtils; | ||
| 7 | +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.enums.task.BpmTaskStatusEnum; | ||
| 10 | +import com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant; | ||
| 11 | +import com.zteits.urbanops.module.workorder.controller.admin.garden.vo.BpmGardenWorkOrderCreateReqVo; | ||
| 12 | +import com.zteits.urbanops.module.workorder.controller.admin.garden.vo.BpmGardenWorkOrderPageReqVO; | ||
| 13 | +import com.zteits.urbanops.module.workorder.controller.admin.maininfo.vo.MainInfoPageReqVO; | ||
| 14 | +import com.zteits.urbanops.module.workorder.dal.dataobject.attachment.AttachmentDO; | ||
| 15 | +import com.zteits.urbanops.module.workorder.dal.dataobject.garden.BpmGardenWorkOrderDO; | ||
| 16 | +import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO; | ||
| 17 | +import com.zteits.urbanops.module.workorder.dal.mysql.attachment.AttachmentMapper; | ||
| 18 | +import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoMapper; | ||
| 19 | +import jakarta.annotation.Resource; | ||
| 20 | +import org.springframework.stereotype.Service; | ||
| 21 | +import org.springframework.transaction.annotation.Transactional; | ||
| 22 | +import org.springframework.validation.annotation.Validated; | ||
| 23 | + | ||
| 24 | +import java.time.LocalDateTime; | ||
| 25 | +import java.util.HashMap; | ||
| 26 | +import java.util.List; | ||
| 27 | +import java.util.Map; | ||
| 28 | + | ||
| 29 | +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; | ||
| 30 | +import static com.zteits.urbanops.module.workorder.enums.ErrorCodeConstants.MAIN_INFO_NOT_EXISTS; | ||
| 31 | + | ||
| 32 | +/** | ||
| 33 | + * @author yanhuiqing | ||
| 34 | + * @version 1.0 | ||
| 35 | + * @description: 园林工作流实现类 | ||
| 36 | + * @date 2025/12/1 11:38 | ||
| 37 | + */ | ||
| 38 | +@Service | ||
| 39 | +@Validated | ||
| 40 | +public class BpmGardenServiceImpl implements BpmGardenService{ | ||
| 41 | + | ||
| 42 | + @Resource | ||
| 43 | + private AttachmentMapper attachmentMapper; | ||
| 44 | + @Resource | ||
| 45 | + private MainInfoMapper workOrderMapper; | ||
| 46 | + @Resource | ||
| 47 | + private BpmProcessInstanceApi processInstanceApi; | ||
| 48 | + @Override | ||
| 49 | + @Transactional(rollbackFor = Exception.class) | ||
| 50 | + public Long createWorkOrder(Long userId, BpmGardenWorkOrderCreateReqVo createRequestVo) { | ||
| 51 | + List<String> imgList = createRequestVo.getImgs(); | ||
| 52 | + List<String> streetImgList = createRequestVo.getStreetImgList(); | ||
| 53 | + List<String> longRangeImgList = createRequestVo.getLongRangeImgList(); | ||
| 54 | + String isYesOrNo = createRequestVo.getIsYesOrNo(); | ||
| 55 | + // 插入 工单 | ||
| 56 | + MainInfoDO workOrder = BeanUtils.toBean(createRequestVo, MainInfoDO.class) | ||
| 57 | + .setStatus(BpmTaskStatusEnum.RUNNING.getStatus()); | ||
| 58 | + //TODO 设置其它值 需从道路表获取 | ||
| 59 | + workOrder.setStreetId("test"); | ||
| 60 | + workOrder.setBuzStatus("t1");//需给出映射关系 | ||
| 61 | + workOrder.setCommitDate(LocalDateTime.now()); | ||
| 62 | + workOrderMapper.insert(workOrder); | ||
| 63 | + | ||
| 64 | + //附件插入 | ||
| 65 | + attachmentApend(imgList,streetImgList,longRangeImgList,workOrder); | ||
| 66 | + // 发起 BPM 流程 | ||
| 67 | + Map<String, Object> processInstanceVariables = new HashMap<>(); | ||
| 68 | + processInstanceVariables.put("isYesOrNo", isYesOrNo); | ||
| 69 | + String processInstanceId = processInstanceApi.createProcessInstance(userId, | ||
| 70 | + new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(BpmCommonConstant.BPM_GARDEN_INSPECT_WO) | ||
| 71 | + .setVariables(processInstanceVariables).setBusinessKey(String.valueOf(workOrder.getId())) | ||
| 72 | + .setStartUserSelectAssignees(createRequestVo.getStartUserSelectAssignees())); | ||
| 73 | + | ||
| 74 | + // 将工作流的编号,更新到 工单中 | ||
| 75 | + workOrderMapper.updateById(new MainInfoDO().setId(workOrder.getId()).setProcessInstanceId(processInstanceId)); | ||
| 76 | + return workOrder.getId(); | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + /** | ||
| 80 | + * 附件插入 | ||
| 81 | + * @param imgList 问题照片 P1 | ||
| 82 | + * @param streetImgList 街道照片 P2 | ||
| 83 | + * @param longRangeImgList 远景照片 P3 | ||
| 84 | + * @param workOrder | ||
| 85 | + */ | ||
| 86 | + private void attachmentApend(List<String> imgList, List<String> streetImgList, List<String> longRangeImgList, MainInfoDO workOrder) { | ||
| 87 | + //问题图片 | ||
| 88 | + if(ObjectUtils.isNotAllEmpty(imgList)){ | ||
| 89 | + AttachmentDO saveDO = new AttachmentDO(); | ||
| 90 | + saveDO.setBusiLine(workOrder.getBusiLine()); | ||
| 91 | + saveDO.setBusiType(BpmCommonConstant.GARDEN_INSPECT_WO_ATTACH1); | ||
| 92 | + saveDO.setOrderNo(workOrder.getOrderNo()); | ||
| 93 | + String filePaths = String.join(",",imgList); | ||
| 94 | + saveDO.setFileNames(filePaths); | ||
| 95 | + LambdaQueryWrapper<AttachmentDO> deleteWrapper = new LambdaQueryWrapper<AttachmentDO>() | ||
| 96 | + .eq(AttachmentDO::getBusiLine, workOrder.getBusiLine()) | ||
| 97 | + .eq(AttachmentDO::getBusiType, BpmCommonConstant.GARDEN_INSPECT_WO_ATTACH1) | ||
| 98 | + .eq(AttachmentDO::getOrderNo, workOrder.getOrderNo()); | ||
| 99 | + attachmentMapper.delete(deleteWrapper); | ||
| 100 | + attachmentMapper.insert(saveDO); | ||
| 101 | + } | ||
| 102 | + //街道图片 | ||
| 103 | + if(ObjectUtils.isNotAllEmpty(streetImgList)){ | ||
| 104 | + AttachmentDO saveDO = new AttachmentDO(); | ||
| 105 | + saveDO.setBusiLine(workOrder.getBusiLine()); | ||
| 106 | + saveDO.setBusiType(BpmCommonConstant.GARDEN_INSPECT_WO_ATTACH2); | ||
| 107 | + saveDO.setOrderNo(workOrder.getOrderNo()); | ||
| 108 | + String filePaths = String.join(",",streetImgList); | ||
| 109 | + saveDO.setFileNames(filePaths); | ||
| 110 | + LambdaQueryWrapper<AttachmentDO> deleteWrapper = new LambdaQueryWrapper<AttachmentDO>() | ||
| 111 | + .eq(AttachmentDO::getBusiLine, workOrder.getBusiLine()) | ||
| 112 | + .eq(AttachmentDO::getBusiType, BpmCommonConstant.GARDEN_INSPECT_WO_ATTACH2) | ||
| 113 | + .eq(AttachmentDO::getOrderNo, workOrder.getOrderNo()); | ||
| 114 | + attachmentMapper.delete(deleteWrapper); | ||
| 115 | + attachmentMapper.insert(saveDO); | ||
| 116 | + } | ||
| 117 | + //远景图片 | ||
| 118 | + if(ObjectUtils.isNotAllEmpty(longRangeImgList)){ | ||
| 119 | + AttachmentDO saveDO = new AttachmentDO(); | ||
| 120 | + saveDO.setBusiLine(workOrder.getBusiLine()); | ||
| 121 | + saveDO.setBusiType(BpmCommonConstant.GARDEN_INSPECT_WO_ATTACH3); | ||
| 122 | + saveDO.setOrderNo(workOrder.getOrderNo()); | ||
| 123 | + String filePaths = String.join(",",longRangeImgList); | ||
| 124 | + saveDO.setFileNames(filePaths); | ||
| 125 | + LambdaQueryWrapper<AttachmentDO> deleteWrapper = new LambdaQueryWrapper<AttachmentDO>() | ||
| 126 | + .eq(AttachmentDO::getBusiLine, workOrder.getBusiLine()) | ||
| 127 | + .eq(AttachmentDO::getBusiType, BpmCommonConstant.GARDEN_INSPECT_WO_ATTACH3) | ||
| 128 | + .eq(AttachmentDO::getOrderNo, workOrder.getOrderNo()); | ||
| 129 | + attachmentMapper.delete(deleteWrapper); | ||
| 130 | + attachmentMapper.insert(saveDO); | ||
| 131 | + } | ||
| 132 | + | ||
| 133 | + | ||
| 134 | + } | ||
| 135 | + | ||
| 136 | + | ||
| 137 | + @Override | ||
| 138 | + public void updateWorkOrderStatus(Long id, Integer status) { | ||
| 139 | + validateExists(id); | ||
| 140 | + workOrderMapper.updateById(new MainInfoDO().setId(id).setStatus(status)); | ||
| 141 | + } | ||
| 142 | + private void validateExists(Long id) { | ||
| 143 | + if (workOrderMapper.selectById(id) == null) { | ||
| 144 | + throw exception(MAIN_INFO_NOT_EXISTS); | ||
| 145 | + } | ||
| 146 | + } | ||
| 147 | + | ||
| 148 | + @Override | ||
| 149 | + public BpmGardenWorkOrderDO getWorkOrder(Long id) { | ||
| 150 | + MainInfoDO workOrder = workOrderMapper.selectById(id); | ||
| 151 | + BpmGardenWorkOrderDO targetVo = BeanUtils.toBean(workOrder, BpmGardenWorkOrderDO.class); | ||
| 152 | + //TODO 定义页面展示字段在此扩展 | ||
| 153 | + return targetVo; | ||
| 154 | + } | ||
| 155 | + | ||
| 156 | + @Override | ||
| 157 | + public PageResult<BpmGardenWorkOrderDO> getGardenInspectionPage(Long loginUserId, BpmGardenWorkOrderPageReqVO pageVO) { | ||
| 158 | + MainInfoPageReqVO mainInfoPageReqVo = BeanUtils.toBean(pageVO,MainInfoPageReqVO.class); | ||
| 159 | + PageResult<MainInfoDO> pageList = workOrderMapper.selectPage(loginUserId, mainInfoPageReqVo); | ||
| 160 | + PageResult<BpmGardenWorkOrderDO> targetList = BeanUtils.toBean(pageList,BpmGardenWorkOrderDO.class); | ||
| 161 | + return targetList; | ||
| 162 | + } | ||
| 163 | +} |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/listener/BomGardenWorkOrderStatusListener.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.service.garden.BpmGardenService; | ||
| 6 | +import jakarta.annotation.Resource; | ||
| 7 | +import org.springframework.stereotype.Component; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * @author yanhuiqing | ||
| 11 | + * @version 1.0 | ||
| 12 | + * @description: 工作流状态监听类 | ||
| 13 | + * @date 2025/12/1 11:45 | ||
| 14 | + */ | ||
| 15 | +@Component | ||
| 16 | +public class BomGardenWorkOrderStatusListener extends BpmProcessInstanceStatusEventListener { | ||
| 17 | + @Resource | ||
| 18 | + private BpmGardenService gardenService; | ||
| 19 | + @Override | ||
| 20 | + protected String getProcessDefinitionKey() { | ||
| 21 | + | ||
| 22 | + return null; | ||
| 23 | + } | ||
| 24 | + | ||
| 25 | + @Override | ||
| 26 | + protected void onEvent(BpmProcessInstanceStatusEvent event) { | ||
| 27 | + gardenService.updateWorkOrderStatus(Long.parseLong(event.getBusinessKey()), event.getStatus()); | ||
| 28 | + } | ||
| 29 | +} |