Commit 1c83a3f95fef6d8d648c45260a85b9941d941530
1 parent
786ff9db
app养护计划明细提交
Showing
15 changed files
with
296 additions
and
129 deletions
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainplan/vo/MaintainPlanCommitDetailRespVO.java
| ... | ... | @@ -32,7 +32,6 @@ public class MaintainPlanCommitDetailRespVO { |
| 32 | 32 | @ExcelProperty("业务线: yl-园林;wy-物业:sz-市政") |
| 33 | 33 | private String busiLine; |
| 34 | 34 | |
| 35 | - | |
| 36 | 35 | @Schema(description = "养护类型:2001:浇水;2002:施肥;2003:有害生物防治;2004:修剪;2005:中耕除草;2006:打孔梳草;2007:绿地保洁;2008:园林废弃物收集运输 ;2009:补植;3001:绿地巡视;", example = "24742") |
| 37 | 36 | @ExcelProperty("养护类型") |
| 38 | 37 | private Integer planTypeId; |
| ... | ... | @@ -41,6 +40,9 @@ public class MaintainPlanCommitDetailRespVO { |
| 41 | 40 | @ExcelProperty("备注") |
| 42 | 41 | private String remark; |
| 43 | 42 | |
| 43 | + @Schema(description = "总完成百分比", example = "98.00") | |
| 44 | + private Double totalFinishPercent; | |
| 45 | + | |
| 44 | 46 | @Schema(description = "本次完成百分比", example = "98.00") |
| 45 | 47 | @ExcelProperty("本次完成百分比") |
| 46 | 48 | private Double finishPercent; | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainplan/vo/MaintainPlanCommitSaveReqVO.java
| ... | ... | @@ -10,37 +10,16 @@ import jakarta.validation.constraints.*; |
| 10 | 10 | @Data |
| 11 | 11 | public class MaintainPlanCommitSaveReqVO { |
| 12 | 12 | |
| 13 | - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26945") | |
| 14 | - private Long id; | |
| 15 | - | |
| 16 | - @Schema(description = "批次号", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 17 | - @NotEmpty(message = "批次号不能为空") | |
| 18 | - private String batchNo; | |
| 19 | 13 | |
| 20 | 14 | @Schema(description = "计划编码", requiredMode = Schema.RequiredMode.REQUIRED) |
| 21 | 15 | @NotEmpty(message = "计划编码不能为空") |
| 22 | 16 | private String planNo; |
| 23 | 17 | |
| 24 | - @Schema(description = "业务线: yl-园林;wy-物业:sz-市政", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 25 | - @NotEmpty(message = "业务线: yl-园林;wy-物业:sz-市政不能为空") | |
| 26 | - private String busiLine; | |
| 27 | 18 | |
| 28 | 19 | @Schema(description = "提交次序号", requiredMode = Schema.RequiredMode.REQUIRED) |
| 29 | 20 | @NotNull(message = "提交次序号不能为空") |
| 30 | 21 | private Integer sortNum; |
| 31 | 22 | |
| 32 | - @Schema(description = "归属(一级部门id)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2759") | |
| 33 | - @NotNull(message = "归属(一级部门id)不能为空") | |
| 34 | - private Long companyId; | |
| 35 | - | |
| 36 | - @Schema(description = "部门ID(道路负责部门id)", requiredMode = Schema.RequiredMode.REQUIRED, example = "29117") | |
| 37 | - @NotNull(message = "部门ID(道路负责部门id)不能为空") | |
| 38 | - private Long deptId; | |
| 39 | - | |
| 40 | - @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12084") | |
| 41 | - @NotNull(message = "道路ID不能为空") | |
| 42 | - private Long roadId; | |
| 43 | - | |
| 44 | 23 | @Schema(description = "本次完成百分比", requiredMode = Schema.RequiredMode.REQUIRED) |
| 45 | 24 | @NotNull(message = "本次完成百分比不能为空") |
| 46 | 25 | private Double finishPercent; | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/inspectionplan/vo/AppInspectionPlanCommitSaveReqVO.java
| ... | ... | @@ -5,7 +5,6 @@ import jakarta.validation.constraints.NotEmpty; |
| 5 | 5 | import jakarta.validation.constraints.NotNull; |
| 6 | 6 | import lombok.Data; |
| 7 | 7 | |
| 8 | -import java.time.LocalDate; | |
| 9 | 8 | import java.util.List; |
| 10 | 9 | |
| 11 | 10 | @Schema(description = "APP管理 - 巡检计划提交明细新增/修改 Request VO") |
| ... | ... | @@ -40,7 +39,6 @@ public class AppInspectionPlanCommitSaveReqVO { |
| 40 | 39 | private String transWorkNo; |
| 41 | 40 | |
| 42 | 41 | @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你猜") |
| 43 | - @NotEmpty(message = "备注不能为空") | |
| 44 | 42 | private String remark; |
| 45 | 43 | |
| 46 | 44 | } |
| 47 | 45 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/maintainplan/AppMaintainPlanCommitController.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.app.maintainplan; | |
| 2 | + | |
| 3 | +import com.zteits.urbanops.framework.common.pojo.CommonResult; | |
| 4 | +import com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo.MaintainPlanCommitDetailRespVO; | |
| 5 | +import com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanCommitSaveReqVO; | |
| 6 | +import com.zteits.urbanops.module.garden.service.maintainplan.MaintainPlanCommitService; | |
| 7 | +import io.swagger.v3.oas.annotations.Operation; | |
| 8 | +import io.swagger.v3.oas.annotations.Parameter; | |
| 9 | +import io.swagger.v3.oas.annotations.tags.Tag; | |
| 10 | +import jakarta.annotation.Resource; | |
| 11 | +import jakarta.validation.Valid; | |
| 12 | +import org.springframework.validation.annotation.Validated; | |
| 13 | +import org.springframework.web.bind.annotation.*; | |
| 14 | + | |
| 15 | +import java.util.List; | |
| 16 | + | |
| 17 | +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; | |
| 18 | + | |
| 19 | +@Tag(name = "管理后台 - 养护计划提交明细") | |
| 20 | +@RestController | |
| 21 | +@RequestMapping("/app/garden/maintain-plan-commit") | |
| 22 | +@Validated | |
| 23 | +public class AppMaintainPlanCommitController { | |
| 24 | + | |
| 25 | + @Resource | |
| 26 | + private MaintainPlanCommitService maintainPlanCommitService; | |
| 27 | + | |
| 28 | + @PostMapping("/create") | |
| 29 | + @Operation(summary = "创建养护计划明细") | |
| 30 | + //@PreAuthorize("@ss.hasPermission('app:garden:maintain-plan-commit:create')") | |
| 31 | + public CommonResult<Long> appCreateMaintainPlanCommit(@Valid @RequestBody AppMaintainPlanCommitSaveReqVO createReqVO) { | |
| 32 | + return success(maintainPlanCommitService.appCreateMaintainPlanCommit(createReqVO)); | |
| 33 | + } | |
| 34 | + | |
| 35 | + @GetMapping("/get/plan-no") | |
| 36 | + @Operation(summary = "获取养护计划-共同处理人明细") | |
| 37 | + @Parameter(name = "plan_no", description = "计划编号", required = true, example = "1024") | |
| 38 | + //@PreAuthorize("@ss.hasPermission('app:garden:maintain-plan-commit:query')") | |
| 39 | + public CommonResult<List<MaintainPlanCommitDetailRespVO>> getMaintainPlanCommitDetailByPlanNo(@RequestParam("plan_no") String planNo) { | |
| 40 | + return success( maintainPlanCommitService.getMaintainPlanCommitDetailByPlanNo(planNo)); | |
| 41 | + } | |
| 42 | + | |
| 43 | +} | |
| 0 | 44 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/maintainplan/AppMaintainPlanController.java
| 1 | 1 | package com.zteits.urbanops.module.garden.controller.app.maintainplan; |
| 2 | 2 | |
| 3 | -import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; | |
| 4 | 3 | import com.zteits.urbanops.framework.common.pojo.CommonResult; |
| 5 | -import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 6 | 4 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 7 | -import com.zteits.urbanops.framework.common.util.object.BeanUtils; | |
| 8 | -import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; | |
| 9 | -import com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo.MaintainPlanPageReqVO; | |
| 10 | -import com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo.MaintainPlanRespVO; | |
| 11 | -import com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo.MaintainPlanSaveReqVO; | |
| 12 | -import com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo.MaintainPlanUpdateReqVO; | |
| 13 | 5 | import com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPagePlanTypeReqVO; |
| 14 | 6 | import com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPagePlanTypeRespVO; |
| 15 | 7 | import com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPageRoadReqVO; |
| 16 | 8 | import com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPageRoadRespVO; |
| 17 | -import com.zteits.urbanops.module.garden.dal.dataobject.maintainplan.MaintainPlanDO; | |
| 18 | 9 | import com.zteits.urbanops.module.garden.service.maintainplan.MaintainPlanService; |
| 19 | 10 | import io.swagger.v3.oas.annotations.Operation; |
| 20 | -import io.swagger.v3.oas.annotations.Parameter; | |
| 21 | -import io.swagger.v3.oas.annotations.media.Schema; | |
| 22 | 11 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 23 | 12 | import jakarta.annotation.Resource; |
| 24 | -import jakarta.servlet.http.HttpServletResponse; | |
| 25 | 13 | import jakarta.validation.Valid; |
| 26 | -import jakarta.validation.constraints.NotBlank; | |
| 27 | -import jakarta.validation.constraints.NotNull; | |
| 28 | 14 | import lombok.extern.slf4j.Slf4j; |
| 29 | -import org.springframework.security.access.prepost.PreAuthorize; | |
| 30 | 15 | import org.springframework.validation.annotation.Validated; |
| 31 | -import org.springframework.web.bind.annotation.*; | |
| 16 | +import org.springframework.web.bind.annotation.GetMapping; | |
| 17 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 18 | +import org.springframework.web.bind.annotation.RestController; | |
| 32 | 19 | |
| 33 | -import java.io.IOException; | |
| 34 | -import java.util.List; | |
| 35 | - | |
| 36 | -import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.EXPORT; | |
| 37 | -import static com.zteits.urbanops.framework.common.pojo.CommonResult.error; | |
| 38 | 20 | import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; |
| 39 | -import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.PLAN_RATE_VALUE_ERROR; | |
| 40 | 21 | |
| 41 | 22 | @Tag(name = "APP管理 - 养护计划汇总") |
| 42 | 23 | @RestController | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/maintainplan/AppMaintainPlanDetailController.java
| 1 | 1 | package com.zteits.urbanops.module.garden.controller.app.maintainplan; |
| 2 | 2 | |
| 3 | -import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; | |
| 4 | 3 | import com.zteits.urbanops.framework.common.pojo.CommonResult; |
| 5 | -import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 6 | -import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 7 | -import com.zteits.urbanops.framework.common.util.object.BeanUtils; | |
| 8 | -import com.zteits.urbanops.framework.excel.core.util.ExcelUtils; | |
| 9 | -import com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo.MaintainPlanDetailPageReqVO; | |
| 10 | -import com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo.MaintainPlanDetailRespVO; | |
| 11 | -import com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo.MaintainPlanDetailSaveReqVO; | |
| 12 | 4 | import com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanDetailRespVO; |
| 13 | -import com.zteits.urbanops.module.garden.dal.dataobject.maintainplan.MaintainPlanDetailDO; | |
| 14 | 5 | import com.zteits.urbanops.module.garden.service.maintainplan.MaintainPlanDetailService; |
| 15 | 6 | import io.swagger.v3.oas.annotations.Operation; |
| 16 | 7 | import io.swagger.v3.oas.annotations.Parameter; |
| 17 | -import io.swagger.v3.oas.annotations.media.Schema; | |
| 18 | 8 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 19 | 9 | import jakarta.annotation.Resource; |
| 20 | -import jakarta.servlet.http.HttpServletResponse; | |
| 21 | -import jakarta.validation.Valid; | |
| 22 | -import jakarta.validation.constraints.Max; | |
| 23 | -import jakarta.validation.constraints.Min; | |
| 24 | 10 | import jakarta.validation.constraints.NotNull; |
| 25 | -import org.springframework.security.access.prepost.PreAuthorize; | |
| 26 | 11 | import org.springframework.validation.annotation.Validated; |
| 27 | -import org.springframework.web.bind.annotation.*; | |
| 12 | +import org.springframework.web.bind.annotation.GetMapping; | |
| 13 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 14 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 15 | +import org.springframework.web.bind.annotation.RestController; | |
| 28 | 16 | |
| 29 | -import java.io.IOException; | |
| 30 | 17 | import java.util.List; |
| 31 | 18 | |
| 32 | -import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.EXPORT; | |
| 33 | 19 | import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; |
| 34 | 20 | |
| 35 | 21 | @Tag(name = "APP管理 - 养护计划明细") | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/maintainplan/vo/AppMaintainPlanCommitSaveReqVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.app.maintainplan.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 jakarta.validation.constraints.Size; | |
| 7 | +import lombok.Data; | |
| 8 | + | |
| 9 | +import java.util.List; | |
| 10 | + | |
| 11 | +@Schema(description = "管理后台 - 养护计划明细新增/修改 Request VO") | |
| 12 | +@Data | |
| 13 | +public class AppMaintainPlanCommitSaveReqVO { | |
| 14 | + | |
| 15 | + @Schema(description = "计划编码", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 16 | + @NotEmpty(message = "计划编码不能为空") | |
| 17 | + private String planNo; | |
| 18 | + | |
| 19 | + @Schema(description = "本次总完成百分比", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 20 | + @NotNull(message = "本次总完成百分比不能为空") | |
| 21 | + private Double totalFinishPercent; | |
| 22 | + | |
| 23 | + @Schema(description = "照片host", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 24 | + @NotEmpty(message = "照片host不能为空") | |
| 25 | + private String imgHost; | |
| 26 | + | |
| 27 | + @Schema(description = "开始照片", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 28 | + @NotEmpty(message = "开始照片不能为空") | |
| 29 | + private String beginImg; | |
| 30 | + | |
| 31 | + @Schema(description = "养护面积:单位m²", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 32 | + @NotNull(message = "养护面积:单位m²不能为空") | |
| 33 | + private Double opArea; | |
| 34 | + | |
| 35 | + @Schema(description = "操作时长", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 36 | + @NotNull(message = "操作时长不能为空") | |
| 37 | + private Double opTime; | |
| 38 | + | |
| 39 | + @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你猜") | |
| 40 | + @Size(max = 128, message = "备注长度不能超过 128 个字符") | |
| 41 | + private String remark; | |
| 42 | + | |
| 43 | + @Schema(description = "共同处理人", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 44 | + private List<AppMaintainPlanCommonUserVO> commonUserList; | |
| 45 | + | |
| 46 | + | |
| 47 | + @Data | |
| 48 | + public static class AppMaintainPlanCommonUserVO { | |
| 49 | + @Schema(description = "提交人用户", example = "19167") | |
| 50 | + private Long userId; | |
| 51 | + | |
| 52 | + @Schema(description = "提交人用户ID", example = "王五") | |
| 53 | + private String userName; | |
| 54 | + | |
| 55 | + } | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | +} | |
| 0 | 60 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/inspectionplan/InspectionPlanCommitDO.java
| ... | ... | @@ -33,6 +33,11 @@ public class InspectionPlanCommitDO extends BaseDO { |
| 33 | 33 | * 计划编码 |
| 34 | 34 | */ |
| 35 | 35 | private String planNo; |
| 36 | + | |
| 37 | + /** | |
| 38 | + * 排序号:第n次计划提交 | |
| 39 | + */ | |
| 40 | + private Integer sortNum; | |
| 36 | 41 | /** |
| 37 | 42 | * 业务线: yl-园林;wy-物业:sz-市政 |
| 38 | 43 | */ |
| ... | ... | @@ -81,14 +86,7 @@ public class InspectionPlanCommitDO extends BaseDO { |
| 81 | 86 | * 提交人 |
| 82 | 87 | */ |
| 83 | 88 | private String userName; |
| 84 | - /** | |
| 85 | - * 角色ID | |
| 86 | - */ | |
| 87 | - private Long roleId; | |
| 88 | - /** | |
| 89 | - * 角色名称 | |
| 90 | - */ | |
| 91 | - private String roleName; | |
| 89 | + | |
| 92 | 90 | /** |
| 93 | 91 | * 备注 |
| 94 | 92 | */ | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/maintainplan/MaintainPlanCommonUserDO.java
| ... | ... | @@ -24,26 +24,11 @@ public class MaintainPlanCommonUserDO extends BaseDO { |
| 24 | 24 | */ |
| 25 | 25 | @TableId |
| 26 | 26 | private Long id; |
| 27 | + | |
| 27 | 28 | /** |
| 28 | - * 批次号 | |
| 29 | - */ | |
| 30 | - private String batchNo; | |
| 31 | - /** | |
| 32 | - * 计划编码 | |
| 33 | - */ | |
| 34 | - private String planNo; | |
| 35 | - /** | |
| 36 | - * 提交次序号 | |
| 37 | - */ | |
| 38 | - private Integer sortNum; | |
| 39 | - /** | |
| 40 | - * 归属(一级部门id) | |
| 41 | - */ | |
| 42 | - private Long companyId; | |
| 43 | - /** | |
| 44 | - * 部门ID(道路负责部门id) | |
| 29 | + * 父级ID garden_maintain_plan_commit表主键ID | |
| 45 | 30 | */ |
| 46 | - private Long deptId; | |
| 31 | + private Long parentId; | |
| 47 | 32 | /** |
| 48 | 33 | * 用户ID |
| 49 | 34 | */ | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/maintainplan/MaintainPlanDetailDO.java
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/maintainplan/MaintainPlanCommonUserMapper.java
| 1 | 1 | package com.zteits.urbanops.module.garden.dal.mysql.maintainplan; |
| 2 | 2 | |
| 3 | -import java.util.*; | |
| 4 | - | |
| 5 | 3 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 6 | -import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 7 | 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.maintainplan.vo.MaintainPlanCommonUserPageReqVO; | |
| 8 | 7 | import com.zteits.urbanops.module.garden.dal.dataobject.maintainplan.MaintainPlanCommonUserDO; |
| 9 | 8 | import org.apache.ibatis.annotations.Mapper; |
| 10 | -import com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo.*; | |
| 11 | 9 | |
| 12 | 10 | /** |
| 13 | 11 | * 养护计划共同处理人 Mapper |
| ... | ... | @@ -19,11 +17,6 @@ public interface MaintainPlanCommonUserMapper extends BaseMapperX<MaintainPlanCo |
| 19 | 17 | |
| 20 | 18 | default PageResult<MaintainPlanCommonUserDO> selectPage(MaintainPlanCommonUserPageReqVO reqVO) { |
| 21 | 19 | return selectPage(reqVO, new LambdaQueryWrapperX<MaintainPlanCommonUserDO>() |
| 22 | - .eqIfPresent(MaintainPlanCommonUserDO::getBatchNo, reqVO.getBatchNo()) | |
| 23 | - .eqIfPresent(MaintainPlanCommonUserDO::getPlanNo, reqVO.getPlanNo()) | |
| 24 | - .eqIfPresent(MaintainPlanCommonUserDO::getSortNum, reqVO.getSortNum()) | |
| 25 | - .eqIfPresent(MaintainPlanCommonUserDO::getCompanyId, reqVO.getCompanyId()) | |
| 26 | - .eqIfPresent(MaintainPlanCommonUserDO::getDeptId, reqVO.getDeptId()) | |
| 27 | 20 | .eqIfPresent(MaintainPlanCommonUserDO::getUserId, reqVO.getUserId()) |
| 28 | 21 | .likeIfPresent(MaintainPlanCommonUserDO::getUserName, reqVO.getUserName()) |
| 29 | 22 | .likeIfPresent(MaintainPlanCommonUserDO::getCreatorName, reqVO.getCreatorName()) | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/inspectionplan/InspectionPlanCommitServiceImpl.java
| 1 | 1 | package com.zteits.urbanops.module.garden.service.inspectionplan; |
| 2 | 2 | |
| 3 | 3 | import com.alibaba.fastjson.JSONObject; |
| 4 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |
| 4 | 5 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| 5 | 6 | import com.baomidou.mybatisplus.core.metadata.IPage; |
| 6 | -import com.google.common.collect.Lists; | |
| 7 | 7 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 8 | 8 | import com.zteits.urbanops.framework.common.util.object.BeanUtils; |
| 9 | 9 | import com.zteits.urbanops.framework.common.util.string.StrUtils; |
| ... | ... | @@ -23,7 +23,6 @@ import com.zteits.urbanops.module.garden.dal.mysql.inspectionplan.InspectionPlan |
| 23 | 23 | import com.zteits.urbanops.module.system.api.dept.DeptApi; |
| 24 | 24 | import com.zteits.urbanops.module.system.api.dept.dto.DeptRespDTO; |
| 25 | 25 | import com.zteits.urbanops.module.system.api.permission.RoleApi; |
| 26 | -import com.zteits.urbanops.module.system.dal.dataobject.permission.RoleDO; | |
| 27 | 26 | import jakarta.annotation.Resource; |
| 28 | 27 | import org.apache.commons.lang3.StringUtils; |
| 29 | 28 | import org.springframework.stereotype.Service; |
| ... | ... | @@ -35,6 +34,9 @@ import java.time.LocalDateTime; |
| 35 | 34 | import java.util.*; |
| 36 | 35 | import java.util.stream.Collectors; |
| 37 | 36 | |
| 37 | +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 38 | +import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.INSPECTION_PLAN_NOT_EXISTS; | |
| 39 | + | |
| 38 | 40 | |
| 39 | 41 | /** |
| 40 | 42 | * 巡检计划提交明细 Service 实现类 |
| ... | ... | @@ -73,24 +75,28 @@ public class InspectionPlanCommitServiceImpl implements InspectionPlanCommitServ |
| 73 | 75 | @Transactional(rollbackFor = Exception.class) |
| 74 | 76 | @Override |
| 75 | 77 | public Long appCreateInspectionPlanCommit(AppInspectionPlanCommitSaveReqVO createReqVO) { |
| 76 | - Long userId = SecurityFrameworkUtils.getLoginUserId(); | |
| 77 | - /*1.查询计划信息*/ | |
| 78 | + /*1.查询明细*/ | |
| 79 | + InspectionPlanDetailDO inspectionPlanDetailDO = inspectionPlanDetailMapper.selectOne(InspectionPlanDetailDO::getPlanNo, createReqVO.getPlanNo()); | |
| 80 | + if(null == inspectionPlanDetailDO){ | |
| 81 | + throw exception(INSPECTION_PLAN_NOT_EXISTS); | |
| 82 | + } | |
| 83 | + | |
| 84 | + /*2.查询计划信息*/ | |
| 78 | 85 | InspectionPlanDO inspectionPlanDO = inspectionPlanMapper.selectOne(InspectionPlanDO::getBatchNo, createReqVO.getBatchNo()); |
| 79 | - InspectionPlanCommitDO inspectionPlanCommit = getInspectionPlanCommitDO(createReqVO, inspectionPlanDO); | |
| 80 | - /*2.查询角色*/ | |
| 81 | - List<RoleDO> roleList = roleApi.getRoleList(Lists.newArrayList(userId)); | |
| 82 | - if (!CollectionUtils.isEmpty(roleList)) { | |
| 83 | - inspectionPlanCommit.setRoleId(roleList.get(0).getId()); | |
| 84 | - inspectionPlanCommit.setRoleName(roleList.get(0).getName()); | |
| 85 | - }else{ | |
| 86 | - inspectionPlanCommit.setRoleId(0L); | |
| 87 | - inspectionPlanCommit.setRoleName("未知角色"); | |
| 86 | + if(null == inspectionPlanDO){ | |
| 87 | + throw exception(INSPECTION_PLAN_NOT_EXISTS); | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - /*3.插入明细*/ | |
| 90 | + InspectionPlanCommitDO inspectionPlanCommit = getInspectionPlanCommitDO(createReqVO, inspectionPlanDO); | |
| 91 | + | |
| 92 | + /*3.查询计划明细最大次数*/ | |
| 93 | + Long countNum = inspectionPlanCommitMapper.selectCount(new QueryWrapper<InspectionPlanCommitDO>().lambda() | |
| 94 | + .eq(InspectionPlanCommitDO::getPlanNo, createReqVO.getPlanNo())); | |
| 95 | + | |
| 96 | + inspectionPlanCommit.setSortNum(countNum.intValue() + 1); | |
| 97 | + /*4.插入明细*/ | |
| 91 | 98 | inspectionPlanCommitMapper.insert(inspectionPlanCommit); |
| 92 | - /*4.更新状态*/ | |
| 93 | - InspectionPlanDetailDO inspectionPlanDetailDO = inspectionPlanDetailMapper.selectOne(InspectionPlanDetailDO::getPlanNo, createReqVO.getPlanNo()); | |
| 99 | + | |
| 94 | 100 | Integer detailFinishNum = inspectionPlanDetailDO.getPlanFinishNum() + 1; |
| 95 | 101 | int detailFinishState = 1; |
| 96 | 102 | if(detailFinishNum.equals(inspectionPlanDetailDO.getPlanNum())){ | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/maintainplan/MaintainPlanCommitService.java
| 1 | 1 | package com.zteits.urbanops.module.garden.service.maintainplan; |
| 2 | 2 | |
| 3 | 3 | import java.util.*; |
| 4 | + | |
| 5 | +import com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanCommitSaveReqVO; | |
| 4 | 6 | import jakarta.validation.*; |
| 5 | 7 | import com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo.*; |
| 6 | 8 | import com.zteits.urbanops.module.garden.dal.dataobject.maintainplan.MaintainPlanCommitDO; |
| ... | ... | @@ -22,6 +24,16 @@ public interface MaintainPlanCommitService { |
| 22 | 24 | Long createMaintainPlanCommit(@Valid MaintainPlanCommitSaveReqVO createReqVO); |
| 23 | 25 | |
| 24 | 26 | /** |
| 27 | + * app-创建养护计划明细 | |
| 28 | + * | |
| 29 | + * @param createReqVO 创建信息 | |
| 30 | + * @return 编号 | |
| 31 | + */ | |
| 32 | + Long appCreateMaintainPlanCommit(@Valid AppMaintainPlanCommitSaveReqVO createReqVO); | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + /** | |
| 25 | 37 | * 更新养护计划明细 |
| 26 | 38 | * |
| 27 | 39 | * @param updateReqVO 更新信息 | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/maintainplan/MaintainPlanCommitServiceImpl.java
| 1 | 1 | package com.zteits.urbanops.module.garden.service.maintainplan; |
| 2 | 2 | |
| 3 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| 4 | +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |
| 4 | 5 | import com.baomidou.mybatisplus.core.metadata.IPage; |
| 6 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 7 | +import com.zteits.urbanops.framework.common.util.object.BeanUtils; | |
| 5 | 8 | import com.zteits.urbanops.framework.common.util.string.StrUtils; |
| 6 | 9 | import com.zteits.urbanops.framework.mybatis.core.util.MyBatisUtils; |
| 7 | 10 | import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; |
| 11 | +import com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo.*; | |
| 12 | +import com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanCommitSaveReqVO; | |
| 13 | +import com.zteits.urbanops.module.garden.dal.dataobject.maintainplan.MaintainPlanCommitDO; | |
| 8 | 14 | import com.zteits.urbanops.module.garden.dal.dataobject.maintainplan.MaintainPlanCommonUserDO; |
| 15 | +import com.zteits.urbanops.module.garden.dal.dataobject.maintainplan.MaintainPlanDO; | |
| 16 | +import com.zteits.urbanops.module.garden.dal.dataobject.maintainplan.MaintainPlanDetailDO; | |
| 17 | +import com.zteits.urbanops.module.garden.dal.mysql.maintainplan.MaintainPlanCommitMapper; | |
| 9 | 18 | import com.zteits.urbanops.module.garden.dal.mysql.maintainplan.MaintainPlanCommonUserMapper; |
| 19 | +import com.zteits.urbanops.module.garden.dal.mysql.maintainplan.MaintainPlanDetailMapper; | |
| 20 | +import com.zteits.urbanops.module.garden.dal.mysql.maintainplan.MaintainPlanMapper; | |
| 10 | 21 | import com.zteits.urbanops.module.system.api.dept.DeptApi; |
| 11 | 22 | import com.zteits.urbanops.module.system.api.dept.dto.DeptRespDTO; |
| 23 | +import jakarta.annotation.Resource; | |
| 12 | 24 | import org.apache.commons.lang3.StringUtils; |
| 13 | 25 | import org.springframework.stereotype.Service; |
| 14 | -import jakarta.annotation.Resource; | |
| 26 | +import org.springframework.transaction.annotation.Transactional; | |
| 15 | 27 | import org.springframework.util.CollectionUtils; |
| 16 | 28 | import org.springframework.validation.annotation.Validated; |
| 17 | 29 | |
| 30 | +import java.time.LocalDateTime; | |
| 18 | 31 | import java.util.*; |
| 19 | 32 | import java.util.stream.Collectors; |
| 20 | 33 | |
| 21 | -import com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo.*; | |
| 22 | -import com.zteits.urbanops.module.garden.dal.dataobject.maintainplan.MaintainPlanCommitDO; | |
| 23 | -import com.zteits.urbanops.framework.common.pojo.PageResult; | |
| 24 | -import com.zteits.urbanops.framework.common.util.object.BeanUtils; | |
| 25 | - | |
| 26 | -import com.zteits.urbanops.module.garden.dal.mysql.maintainplan.MaintainPlanCommitMapper; | |
| 34 | +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 35 | +import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.MAINTAIN_PLAN_NOT_EXISTS; | |
| 27 | 36 | |
| 28 | 37 | |
| 29 | 38 | /** |
| ... | ... | @@ -36,12 +45,18 @@ import com.zteits.urbanops.module.garden.dal.mysql.maintainplan.MaintainPlanComm |
| 36 | 45 | public class MaintainPlanCommitServiceImpl implements MaintainPlanCommitService { |
| 37 | 46 | |
| 38 | 47 | @Resource |
| 48 | + private MaintainPlanMapper maintainPlanMapper; | |
| 49 | + | |
| 50 | + @Resource | |
| 39 | 51 | private MaintainPlanCommitMapper maintainPlanCommitMapper; |
| 40 | 52 | |
| 41 | 53 | @Resource |
| 42 | 54 | private MaintainPlanCommonUserMapper maintainPlanCommonUserMapper; |
| 43 | 55 | |
| 44 | 56 | @Resource |
| 57 | + private MaintainPlanDetailMapper maintainPlanDetailMapper; | |
| 58 | + | |
| 59 | + @Resource | |
| 45 | 60 | private DeptApi deptApi; |
| 46 | 61 | |
| 47 | 62 | @Override |
| ... | ... | @@ -54,10 +69,114 @@ public class MaintainPlanCommitServiceImpl implements MaintainPlanCommitService |
| 54 | 69 | return maintainPlanCommit.getId(); |
| 55 | 70 | } |
| 56 | 71 | |
| 72 | + /** | |
| 73 | + * 创建计划明细 | |
| 74 | + * @param createReqVO 创建计划明细 | |
| 75 | + * @return 计划明细ID | |
| 76 | + */ | |
| 77 | + @Transactional(rollbackFor = Exception.class) | |
| 78 | + @Override | |
| 79 | + public Long appCreateMaintainPlanCommit(AppMaintainPlanCommitSaveReqVO createReqVO) { | |
| 80 | + LocalDateTime now = LocalDateTime.now(); | |
| 81 | + Long userId = SecurityFrameworkUtils.getLoginUserId(); | |
| 82 | + String userName = SecurityFrameworkUtils.getLoginUserNickname(); | |
| 83 | + /*1.查询明细*/ | |
| 84 | + MaintainPlanDetailDO maintainPlanDetailDO = maintainPlanDetailMapper.selectOne(MaintainPlanDetailDO::getPlanNo, createReqVO.getPlanNo()); | |
| 85 | + if(null == maintainPlanDetailDO){ | |
| 86 | + throw exception(MAINTAIN_PLAN_NOT_EXISTS); | |
| 87 | + } | |
| 88 | + | |
| 89 | + /*2.查询汇总*/ | |
| 90 | + MaintainPlanDO maintainPlanDO = maintainPlanMapper.selectOne(MaintainPlanDO::getBatchNo, maintainPlanDetailDO.getBatchNo()); | |
| 91 | + if(null == maintainPlanDO){ | |
| 92 | + throw exception(MAINTAIN_PLAN_NOT_EXISTS); | |
| 93 | + } | |
| 94 | + | |
| 95 | + /*3.查询计划明细最大次数*/ | |
| 96 | + Long countNum = maintainPlanDetailMapper.selectCount(new QueryWrapper<MaintainPlanDetailDO>().lambda() | |
| 97 | + .eq(MaintainPlanDetailDO::getPlanNo, createReqVO.getPlanNo())); | |
| 98 | + | |
| 99 | + MaintainPlanCommitDO commitDO = new MaintainPlanCommitDO(); | |
| 100 | + commitDO.setBatchNo(maintainPlanDO.getBatchNo()); | |
| 101 | + commitDO.setPlanNo(maintainPlanDetailDO.getPlanNo()); | |
| 102 | + commitDO.setBusiLine(maintainPlanDO.getBusiLine()); | |
| 103 | + commitDO.setPlanTypeId(maintainPlanDO.getPlanTypeId()); | |
| 104 | + commitDO.setSortNum(countNum.intValue() +1); | |
| 105 | + commitDO.setCompanyId(maintainPlanDO.getCompanyId()); | |
| 106 | + commitDO.setDeptId(maintainPlanDO.getDeptId()); | |
| 107 | + commitDO.setRoadId(maintainPlanDO.getRoadId()); | |
| 108 | + commitDO.setFinishPercent(createReqVO.getTotalFinishPercent() - maintainPlanDetailDO.getFinishPercent()); | |
| 109 | + commitDO.setImgHost(createReqVO.getImgHost()); | |
| 110 | + commitDO.setBeginImg(createReqVO.getBeginImg()); | |
| 111 | + commitDO.setProcessImg("[]"); | |
| 112 | + commitDO.setEndImg("[]"); | |
| 113 | + commitDO.setOpArea(createReqVO.getOpArea()); | |
| 114 | + commitDO.setOpTime(createReqVO.getOpTime()); | |
| 115 | + commitDO.setFinishTime(now); | |
| 116 | + commitDO.setUserId(userId); | |
| 117 | + commitDO.setUserName(userName); | |
| 118 | + commitDO.setRemark(createReqVO.getRemark()); | |
| 119 | + commitDO.setCreator(userId+""); | |
| 120 | + commitDO.setUserName(userName); | |
| 121 | + commitDO.setCreateTime( now); | |
| 122 | + commitDO.setUpdater(userId+""); | |
| 123 | + commitDO.setUpdateTime( now); | |
| 124 | + commitDO.setUpdaterName(userName); | |
| 125 | + maintainPlanCommitMapper.insert(commitDO); | |
| 126 | + | |
| 127 | + /*4.共同处理人*/ | |
| 128 | + if(!CollectionUtils.isEmpty(createReqVO.getCommonUserList())){ | |
| 129 | + for(AppMaintainPlanCommitSaveReqVO.AppMaintainPlanCommonUserVO commonUserReq : createReqVO.getCommonUserList()){ | |
| 130 | + MaintainPlanCommonUserDO commonUserDO = new MaintainPlanCommonUserDO(); | |
| 131 | + commonUserDO.setParentId(commitDO.getId()); | |
| 132 | + commonUserDO.setUserId(commonUserReq.getUserId()); | |
| 133 | + commonUserDO.setUserName(commonUserReq.getUserName()); | |
| 134 | + commonUserDO.setCreator(userId+""); | |
| 135 | + commonUserDO.setUserName(userName); | |
| 136 | + commonUserDO.setCreateTime( now); | |
| 137 | + commonUserDO.setUpdater(userId+""); | |
| 138 | + commonUserDO.setUpdateTime( now); | |
| 139 | + commonUserDO.setUpdaterName(userName); | |
| 140 | + maintainPlanCommonUserMapper.insert(commonUserDO); | |
| 141 | + } | |
| 142 | + } | |
| 143 | + | |
| 144 | + //完成状态 1:未完成;2:已完成 | |
| 145 | + int detailFinishState = 1; | |
| 146 | + if(createReqVO.getTotalFinishPercent().equals(100.00)){ | |
| 147 | + detailFinishState = 2; | |
| 148 | + } | |
| 149 | + | |
| 150 | + /*5.更新计划明细及计划汇总*/ | |
| 151 | + LambdaUpdateWrapper<MaintainPlanDetailDO> detailUpdateSql = new LambdaUpdateWrapper<MaintainPlanDetailDO>() | |
| 152 | + .set(MaintainPlanDetailDO::getFinishPercent, createReqVO.getTotalFinishPercent()) | |
| 153 | + .set(MaintainPlanDetailDO::getFinishState, detailFinishState) | |
| 154 | + .set(MaintainPlanDetailDO::getUpdateTime, LocalDateTime.now()) | |
| 155 | + .eq(MaintainPlanDetailDO::getPlanNo, createReqVO.getPlanNo()); | |
| 156 | + maintainPlanDetailMapper.update(detailUpdateSql); | |
| 157 | + | |
| 158 | + //完成状态 1:未完成;2:已完成 | |
| 159 | + if(detailFinishState ==2){ | |
| 160 | + int finishState =1; | |
| 161 | + if(maintainPlanDO.getPlanNum().equals(maintainPlanDO.getPlanFinishNum()+1)){ | |
| 162 | + finishState =2; | |
| 163 | + } | |
| 164 | + LambdaUpdateWrapper<MaintainPlanDO> maintainPlanDOSql = new LambdaUpdateWrapper<MaintainPlanDO>() | |
| 165 | + .set(MaintainPlanDO::getPlanFinishNum, maintainPlanDO.getPlanFinishNum()+1) | |
| 166 | + .set(MaintainPlanDO::getFinishState, finishState) | |
| 167 | + .set(MaintainPlanDO::getUpdateTime, LocalDateTime.now()) | |
| 168 | + .eq(MaintainPlanDO::getBatchNo, maintainPlanDO.getBatchNo()); | |
| 169 | + //更新计划汇总 | |
| 170 | + maintainPlanMapper.update(maintainPlanDOSql); | |
| 171 | + } | |
| 172 | + | |
| 173 | + return commitDO.getId(); | |
| 174 | + } | |
| 175 | + | |
| 57 | 176 | @Override |
| 58 | 177 | public void updateMaintainPlanCommit(MaintainPlanCommitSaveReqVO updateReqVO) { |
| 59 | 178 | // 校验存在 |
| 60 | - validateMaintainPlanCommitExists(updateReqVO.getId()); | |
| 179 | + //validateMaintainPlanCommitExists(updateReqVO.getId()); | |
| 61 | 180 | // 更新 |
| 62 | 181 | MaintainPlanCommitDO updateObj = BeanUtils.toBean(updateReqVO, MaintainPlanCommitDO.class); |
| 63 | 182 | maintainPlanCommitMapper.updateById(updateObj); |
| ... | ... | @@ -98,7 +217,14 @@ public class MaintainPlanCommitServiceImpl implements MaintainPlanCommitService |
| 98 | 217 | if (CollectionUtils.isEmpty(list)) { |
| 99 | 218 | return Collections.emptyList(); |
| 100 | 219 | } |
| 101 | - | |
| 220 | + /*2.查询明细总完成次数*/ | |
| 221 | + MaintainPlanDetailDO maintainPlanDetailDO = maintainPlanDetailMapper.selectOne(MaintainPlanDetailDO::getPlanNo, planNo); | |
| 222 | + Double totalFinishPercent; | |
| 223 | + if (maintainPlanDetailDO != null) { | |
| 224 | + totalFinishPercent = maintainPlanDetailDO.getFinishPercent(); | |
| 225 | + } else { | |
| 226 | + totalFinishPercent = 0.0; | |
| 227 | + } | |
| 102 | 228 | /*1.查询共同处理人*/ |
| 103 | 229 | list.forEach(e -> { |
| 104 | 230 | MaintainPlanCommitDetailRespVO respVO = new MaintainPlanCommitDetailRespVO(); |
| ... | ... | @@ -106,11 +232,10 @@ public class MaintainPlanCommitServiceImpl implements MaintainPlanCommitService |
| 106 | 232 | respVO.setBeginImgList(StrUtils.imgProcess(e.getBeginImg(), "")); |
| 107 | 233 | respVO.setProcessImgList(StrUtils.imgProcess(e.getProcessImg(), "")); |
| 108 | 234 | respVO.setEndImgList(StrUtils.imgProcess(e.getEndImg(), "")); |
| 109 | - | |
| 235 | + respVO.setTotalFinishPercent(totalFinishPercent); | |
| 110 | 236 | List<MaintainPlanCommonUserVO> commonUsers = new ArrayList<>(); |
| 111 | 237 | List<MaintainPlanCommonUserDO> maintainPlanCommonUserList = maintainPlanCommonUserMapper.selectList(new QueryWrapper<MaintainPlanCommonUserDO>().lambda() |
| 112 | - .eq(MaintainPlanCommonUserDO::getPlanNo, e.getPlanNo()) | |
| 113 | - .eq(MaintainPlanCommonUserDO::getSortNum, e.getSortNum()) | |
| 238 | + .eq(MaintainPlanCommonUserDO::getParentId, maintainPlanDetailDO.getId()) | |
| 114 | 239 | .eq(MaintainPlanCommonUserDO::getDeleted, 0)); |
| 115 | 240 | if (!CollectionUtils.isEmpty(maintainPlanCommonUserList)) { |
| 116 | 241 | for (MaintainPlanCommonUserDO commonUserDO : maintainPlanCommonUserList) { | ... | ... |