Commit 70b72d6e5a4453644096332aa27e52759d2b8665
1 parent
ebc559ff
养护计划明细提交
Showing
9 changed files
with
175 additions
and
12 deletions
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainplan/MaintainPlanCommitController.java
| ... | ... | @@ -79,6 +79,14 @@ public class MaintainPlanCommitController { |
| 79 | 79 | return success(BeanUtils.toBean(maintainPlanCommit, MaintainPlanCommitRespVO.class)); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | + @GetMapping("/get/plan-no") | |
| 83 | + @Operation(summary = "获取养护计划-共同处理人明细") | |
| 84 | + @Parameter(name = "plan_no", description = "计划编号", required = true, example = "1024") | |
| 85 | + @PreAuthorize("@ss.hasPermission('garden:maintain-plan-commit:query')") | |
| 86 | + public CommonResult<List<MaintainPlanCommitDetailRespVO>> getMaintainPlanCommitDetailByPlanNo(@RequestParam("plan_no") String planNo) { | |
| 87 | + return success( maintainPlanCommitService.getMaintainPlanCommitDetailByPlanNo(planNo)); | |
| 88 | + } | |
| 89 | + | |
| 82 | 90 | @GetMapping("/page") |
| 83 | 91 | @Operation(summary = "获得养护计划明细分页") |
| 84 | 92 | @PreAuthorize("@ss.hasPermission('garden:maintain-plan-commit:query')") | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainplan/vo/MaintainPlanCommitDetailRespVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo; | |
| 2 | + | |
| 3 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; | |
| 4 | +import cn.idev.excel.annotation.ExcelProperty; | |
| 5 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 6 | +import lombok.Data; | |
| 7 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 8 | + | |
| 9 | +import java.time.LocalDateTime; | |
| 10 | +import java.util.List; | |
| 11 | + | |
| 12 | +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 13 | + | |
| 14 | +@Schema(description = "管理后台 - 养护计划明细 Response VO") | |
| 15 | +@Data | |
| 16 | +@ExcelIgnoreUnannotated | |
| 17 | +public class MaintainPlanCommitDetailRespVO { | |
| 18 | + | |
| 19 | + @Schema(description = "批次号") | |
| 20 | + @ExcelProperty("批次号") | |
| 21 | + private String batchNo; | |
| 22 | + | |
| 23 | + @Schema(description = "计划编码") | |
| 24 | + @ExcelProperty("计划编码") | |
| 25 | + private String planNo; | |
| 26 | + | |
| 27 | + @Schema(description = "提交次序号") | |
| 28 | + @ExcelProperty("提交次序号") | |
| 29 | + private Integer sortNum; | |
| 30 | + | |
| 31 | + @Schema(description = "业务线: yl-园林;wy-物业:sz-市政") | |
| 32 | + @ExcelProperty("业务线: yl-园林;wy-物业:sz-市政") | |
| 33 | + private String busiLine; | |
| 34 | + | |
| 35 | + | |
| 36 | + @Schema(description = "养护类型:2001:浇水;2002:施肥;2003:有害生物防治;2004:修剪;2005:中耕除草;2006:打孔梳草;2007:绿地保洁;2008:园林废弃物收集运输 ;2009:补植;3001:绿地巡视;", example = "24742") | |
| 37 | + @ExcelProperty("养护类型") | |
| 38 | + private Integer planTypeId; | |
| 39 | + | |
| 40 | + @Schema(description = "备注", example = "你猜") | |
| 41 | + @ExcelProperty("备注") | |
| 42 | + private String remark; | |
| 43 | + | |
| 44 | + @Schema(description = "本次完成百分比", example = "98.00") | |
| 45 | + @ExcelProperty("本次完成百分比") | |
| 46 | + private Double finishPercent; | |
| 47 | + | |
| 48 | + @Schema(description = "照片host", example = "aaa") | |
| 49 | + @ExcelProperty("照片host") | |
| 50 | + private String imgHost; | |
| 51 | + | |
| 52 | + @Schema(description = "开始照片", example = "aaa") | |
| 53 | + @ExcelProperty("开始照片") | |
| 54 | + private List<String> beginImgList; | |
| 55 | + | |
| 56 | + @Schema(description = "处理中照片", example = "aaa") | |
| 57 | + @ExcelProperty("处理中照片") | |
| 58 | + private List<String> processImgList; | |
| 59 | + | |
| 60 | + @Schema(description = "结束照片", example = "aaa") | |
| 61 | + @ExcelProperty("结束照片") | |
| 62 | + private List<String> endImgList; | |
| 63 | + | |
| 64 | + @Schema(description = "养护面积:单位m²", example = "20") | |
| 65 | + @ExcelProperty("养护面积:单位m²") | |
| 66 | + private Double opArea; | |
| 67 | + /** | |
| 68 | + * 操作时长 | |
| 69 | + */ | |
| 70 | + @Schema(description = "养护面积:单位m²", example = "20") | |
| 71 | + @ExcelProperty("养护面积:单位m²") | |
| 72 | + private Double opTime; | |
| 73 | + /** | |
| 74 | + * 完成时间 | |
| 75 | + */ | |
| 76 | + @Schema(description = "完成时间") | |
| 77 | + @ExcelProperty("完成时间") | |
| 78 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 79 | + private LocalDateTime finishTime; | |
| 80 | + | |
| 81 | + @Schema(description = "共同处理人", example = "张三,莉") | |
| 82 | + private List<MaintainPlanCommonUserVO> commonUsers; | |
| 83 | + | |
| 84 | +} | |
| 0 | 85 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainplan/vo/MaintainPlanCommitPageReqVO.java
| ... | ... | @@ -27,9 +27,6 @@ public class MaintainPlanCommitPageReqVO extends PageParam { |
| 27 | 27 | @Schema(description = "业务线: yl-园林;wy-物业:sz-市政") |
| 28 | 28 | private String busiLine; |
| 29 | 29 | |
| 30 | - @Schema(description = "提交次序号") | |
| 31 | - private Integer sortNum; | |
| 32 | - | |
| 33 | 30 | @Schema(description = "归属(一级部门id)", example = "2759") |
| 34 | 31 | private Long companyId; |
| 35 | 32 | |
| ... | ... | @@ -63,6 +60,4 @@ public class MaintainPlanCommitPageReqVO extends PageParam { |
| 63 | 60 | @Schema(description = "提交人用户ID", example = "王五") |
| 64 | 61 | private String userName; |
| 65 | 62 | |
| 66 | - private List<String> busiLineList; | |
| 67 | - | |
| 68 | 63 | } |
| 69 | 64 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/maintainplan/vo/MaintainPlanCommonUserVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import lombok.Data; | |
| 5 | + | |
| 6 | +/** | |
| 7 | + * 共同处理人 | |
| 8 | + * @author 创建人:ZTEITS | |
| 9 | + * @version 创建时间:2021/5/27 | |
| 10 | + */ | |
| 11 | +@Data | |
| 12 | +public class MaintainPlanCommonUserVO { | |
| 13 | + @Schema(description = "提交人用户", example = "19167") | |
| 14 | + private Long userId; | |
| 15 | + | |
| 16 | + @Schema(description = "提交人用户ID", example = "王五") | |
| 17 | + private String userName; | |
| 18 | + | |
| 19 | +} | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/maintainplan/MaintainPlanCommitDO.java
| ... | ... | @@ -39,6 +39,10 @@ public class MaintainPlanCommitDO extends BaseDO { |
| 39 | 39 | */ |
| 40 | 40 | private String busiLine; |
| 41 | 41 | /** |
| 42 | + * 养护类型:2001:浇水;2002:施肥;2003:有害生物防治;2004:修剪;2005:中耕除草;2006:打孔梳草;2007:绿地保洁;2008:园林废弃物收集运输 ;2009:补植;3001:绿地巡视; | |
| 43 | + */ | |
| 44 | + private Integer planTypeId; | |
| 45 | + /** | |
| 42 | 46 | * 提交次序号 |
| 43 | 47 | */ |
| 44 | 48 | private Integer sortNum; | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/maintainplan/MaintainPlanCommitMapper.java
| ... | ... | @@ -8,6 +8,8 @@ import org.apache.ibatis.annotations.Mapper; |
| 8 | 8 | import com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo.*; |
| 9 | 9 | import org.apache.ibatis.annotations.Param; |
| 10 | 10 | |
| 11 | +import java.util.List; | |
| 12 | + | |
| 11 | 13 | /** |
| 12 | 14 | * 养护计划明细 Mapper |
| 13 | 15 | * |
| ... | ... | @@ -21,7 +23,7 @@ public interface MaintainPlanCommitMapper extends BaseMapperX<MaintainPlanCommit |
| 21 | 23 | * @param reqDTO 查询条件 |
| 22 | 24 | * @return 分页结果 |
| 23 | 25 | */ |
| 24 | - IPage<MaintainPlanCommitRespVO> selectForPage(@Param("page") IPage<MaintainPlanCommitRespVO> page, @Param("req") MaintainPlanCommitPageReqVO req); | |
| 26 | + IPage<MaintainPlanCommitRespVO> selectForPage(@Param("page") IPage<MaintainPlanCommitRespVO> page, @Param("req") MaintainPlanCommitPageReqVO req, @Param("busiLineList") List<String> busiLineList); | |
| 25 | 27 | |
| 26 | 28 | |
| 27 | 29 | } |
| 28 | 30 | \ No newline at end of file | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/maintainplan/MaintainPlanCommitService.java
| ... | ... | @@ -51,6 +51,14 @@ public interface MaintainPlanCommitService { |
| 51 | 51 | MaintainPlanCommitDO getMaintainPlanCommit(Long id); |
| 52 | 52 | |
| 53 | 53 | /** |
| 54 | + * 获得养护计划明细列表 | |
| 55 | + * | |
| 56 | + * @param planNo 计划编号 | |
| 57 | + * @return 养护计划明细列表 | |
| 58 | + */ | |
| 59 | + List<MaintainPlanCommitDetailRespVO> getMaintainPlanCommitDetailByPlanNo(String planNo); | |
| 60 | + | |
| 61 | + /** | |
| 54 | 62 | * 获得养护计划明细分页 |
| 55 | 63 | * |
| 56 | 64 | * @param pageReqVO 分页查询 | ... | ... |
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 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |
| 3 | 4 | import com.baomidou.mybatisplus.core.metadata.IPage; |
| 5 | +import com.zteits.urbanops.framework.common.util.string.StrUtils; | |
| 4 | 6 | import com.zteits.urbanops.framework.mybatis.core.util.MyBatisUtils; |
| 5 | 7 | import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; |
| 8 | +import com.zteits.urbanops.module.garden.dal.dataobject.maintainplan.MaintainPlanCommonUserDO; | |
| 9 | +import com.zteits.urbanops.module.garden.dal.mysql.maintainplan.MaintainPlanCommonUserMapper; | |
| 6 | 10 | import com.zteits.urbanops.module.system.api.dept.DeptApi; |
| 7 | 11 | import com.zteits.urbanops.module.system.api.dept.dto.DeptRespDTO; |
| 8 | 12 | import org.apache.commons.lang3.StringUtils; |
| ... | ... | @@ -35,6 +39,9 @@ public class MaintainPlanCommitServiceImpl implements MaintainPlanCommitService |
| 35 | 39 | private MaintainPlanCommitMapper maintainPlanCommitMapper; |
| 36 | 40 | |
| 37 | 41 | @Resource |
| 42 | + private MaintainPlanCommonUserMapper maintainPlanCommonUserMapper; | |
| 43 | + | |
| 44 | + @Resource | |
| 38 | 45 | private DeptApi deptApi; |
| 39 | 46 | |
| 40 | 47 | @Override |
| ... | ... | @@ -83,6 +90,43 @@ public class MaintainPlanCommitServiceImpl implements MaintainPlanCommitService |
| 83 | 90 | } |
| 84 | 91 | |
| 85 | 92 | @Override |
| 93 | + public List<MaintainPlanCommitDetailRespVO> getMaintainPlanCommitDetailByPlanNo(String planNo) { | |
| 94 | + List<MaintainPlanCommitDetailRespVO> respList = new ArrayList<>(); | |
| 95 | + /*1.查询处理明细*/ | |
| 96 | + List<MaintainPlanCommitDO> list = maintainPlanCommitMapper.selectList(new QueryWrapper<MaintainPlanCommitDO>().lambda() | |
| 97 | + .eq(MaintainPlanCommitDO::getPlanNo, planNo).eq(MaintainPlanCommitDO::getDeleted, 0)); | |
| 98 | + if (CollectionUtils.isEmpty(list)) { | |
| 99 | + return Collections.emptyList(); | |
| 100 | + } | |
| 101 | + | |
| 102 | + /*1.查询共同处理人*/ | |
| 103 | + list.forEach(e -> { | |
| 104 | + MaintainPlanCommitDetailRespVO respVO = new MaintainPlanCommitDetailRespVO(); | |
| 105 | + BeanUtils.copyProperties(e, respVO); | |
| 106 | + respVO.setBeginImgList(StrUtils.imgProcess(e.getBeginImg(), e.getImgHost())); | |
| 107 | + respVO.setProcessImgList(StrUtils.imgProcess(e.getProcessImg(), e.getImgHost())); | |
| 108 | + respVO.setEndImgList(StrUtils.imgProcess(e.getEndImg(), e.getImgHost())); | |
| 109 | + | |
| 110 | + List<MaintainPlanCommonUserVO> commonUsers = new ArrayList<>(); | |
| 111 | + List<MaintainPlanCommonUserDO> maintainPlanCommonUserList = maintainPlanCommonUserMapper.selectList(new QueryWrapper<MaintainPlanCommonUserDO>().lambda() | |
| 112 | + .eq(MaintainPlanCommonUserDO::getPlanNo, e.getPlanNo()) | |
| 113 | + .eq(MaintainPlanCommonUserDO::getSortNum, e.getSortNum()) | |
| 114 | + .eq(MaintainPlanCommonUserDO::getDeleted, 0)); | |
| 115 | + if (!CollectionUtils.isEmpty(maintainPlanCommonUserList)) { | |
| 116 | + for (MaintainPlanCommonUserDO commonUserDO : maintainPlanCommonUserList) { | |
| 117 | + commonUsers.add(new MaintainPlanCommonUserVO() | |
| 118 | + .setUserId(commonUserDO.getUserId()) | |
| 119 | + .setUserName(commonUserDO.getUserName())); | |
| 120 | + } | |
| 121 | + respVO.setCommonUsers(commonUsers); | |
| 122 | + } | |
| 123 | + respList.add(respVO); | |
| 124 | + }); | |
| 125 | + | |
| 126 | + return respList; | |
| 127 | + } | |
| 128 | + | |
| 129 | + @Override | |
| 86 | 130 | public PageResult<MaintainPlanCommitRespVO> getMaintainPlanCommitPage(MaintainPlanCommitPageReqVO pageReqVO) { |
| 87 | 131 | String busiLine = SecurityFrameworkUtils.getBusiLine(); |
| 88 | 132 | List<String> busiLineList = new ArrayList<>(); |
| ... | ... | @@ -93,10 +137,9 @@ public class MaintainPlanCommitServiceImpl implements MaintainPlanCommitService |
| 93 | 137 | busiLineList.addAll(Arrays.asList(busiLine.split(","))); |
| 94 | 138 | } |
| 95 | 139 | } |
| 96 | - pageReqVO.setBusiLineList(busiLineList); | |
| 97 | 140 | //分页 |
| 98 | 141 | IPage<MaintainPlanCommitRespVO> mpPage = MyBatisUtils.buildPage(pageReqVO); |
| 99 | - IPage<MaintainPlanCommitRespVO> page = maintainPlanCommitMapper.selectForPage(mpPage, pageReqVO); | |
| 142 | + IPage<MaintainPlanCommitRespVO> page = maintainPlanCommitMapper.selectForPage(mpPage, pageReqVO, busiLineList); | |
| 100 | 143 | addDataInspectionPlan(page.getRecords()); |
| 101 | 144 | // 转换返回 |
| 102 | 145 | return new PageResult<>(page.getRecords(), page.getTotal()); | ... | ... |
urbanops-module-garden/src/main/resources/mapper/maintainplan/MaintainPlanCommitMapper.xml
| ... | ... | @@ -27,7 +27,7 @@ |
| 27 | 27 | a.end_time, |
| 28 | 28 | a.company_id, |
| 29 | 29 | a.dept_id, |
| 30 | - a.finish_percent, | |
| 30 | + a.finish_percent as finishPercent, | |
| 31 | 31 | c.role_name, |
| 32 | 32 | c.finish_time, |
| 33 | 33 | c.user_name |
| ... | ... | @@ -42,7 +42,7 @@ |
| 42 | 42 | and a.plan_no = #{req.planNo} |
| 43 | 43 | </if> |
| 44 | 44 | <if test="req.planName != null and req.planName !=''"> |
| 45 | - and a.plan_name = #{req.planName} | |
| 45 | + and b.plan_name = #{req.planName} | |
| 46 | 46 | </if> |
| 47 | 47 | <if test="req.roadName != null and req.roadName !=''"> |
| 48 | 48 | AND b.road_name LIKE CONCAT(#{req.roadName},'%') |
| ... | ... | @@ -50,9 +50,9 @@ |
| 50 | 50 | <if test="req.levelId != null"> |
| 51 | 51 | and b.level_id = #{req.levelId} |
| 52 | 52 | </if> |
| 53 | - <if test="req.busiLineList != null and req.busiLineList.size() > 0"> | |
| 53 | + <if test="busiLineList != null and busiLineList.size() > 0"> | |
| 54 | 54 | AND b.busi_line IN |
| 55 | - <foreach collection="req.busiLineList" item="id" open="(" separator="," close=")"> | |
| 55 | + <foreach collection="busiLineList" item="id" open="(" separator="," close=")"> | |
| 56 | 56 | #{id} |
| 57 | 57 | </foreach> |
| 58 | 58 | </if> | ... | ... |