Commit 3ed2ca6fad2522a6c7beebb260cf04e358a41000
Merge remote-tracking branch 'origin/dev' into dev
Showing
6 changed files
with
263 additions
and
11 deletions
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/maininfo/AppMainInfoController.java
| ... | ... | @@ -13,6 +13,7 @@ import com.zteits.urbanops.module.system.service.dept.DeptService; |
| 13 | 13 | import com.zteits.urbanops.module.workorder.controller.admin.maininfo.vo.AdminMainInfoRespVO; |
| 14 | 14 | import com.zteits.urbanops.module.workorder.controller.admin.maininfo.vo.MainInfoPageReqVO; |
| 15 | 15 | import com.zteits.urbanops.module.workorder.controller.app.maininfo.vo.AppMainInfoPageReqVO; |
| 16 | +import com.zteits.urbanops.module.workorder.controller.app.maininfo.vo.AppMainInfoRespVO; | |
| 16 | 17 | import com.zteits.urbanops.module.workorder.convert.maininfo.MainInfoConvert; |
| 17 | 18 | import com.zteits.urbanops.module.workorder.dal.dataobject.attachment.AttachmentDO; |
| 18 | 19 | import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO; |
| ... | ... | @@ -60,22 +61,21 @@ public class AppMainInfoController { |
| 60 | 61 | @GetMapping("/get") |
| 61 | 62 | @Operation(summary = "获得工单信息") |
| 62 | 63 | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| 63 | - public CommonResult<AdminMainInfoRespVO> getMainInfo(@RequestParam("id") Long id) { | |
| 64 | + public CommonResult<AppMainInfoRespVO> getMainInfo(@RequestParam("id") Long id) { | |
| 64 | 65 | MainInfoDO mainInfo = mainInfoService.getMainInfo(id); |
| 65 | - | |
| 66 | 66 | // 若订单号列表非空,查询附件;否则跳过 |
| 67 | - Map<String, AttachmentDO> attachmentMap = Collections.emptyMap(); | |
| 67 | + Map<String, List<String>> attachmentMap = Collections.emptyMap(); | |
| 68 | 68 | if (mainInfo != null) { |
| 69 | 69 | List<AttachmentDO> attachmentDOList = attachmentService.getAttachmentByOrderNo(Arrays.asList(mainInfo.getOrderNo())); |
| 70 | - // 构建订单号→附件对象的映射(处理重复key,取第一个对象) | |
| 71 | 70 | if (!CollectionUtils.isEmpty(attachmentDOList)) { |
| 72 | 71 | attachmentMap = attachmentDOList.stream() |
| 73 | - .filter(attachmentDO -> "01".equals(attachmentDO.getBusiType())) | |
| 74 | - .collect(Collectors.toMap( | |
| 75 | - AttachmentDO::getOrderNo, // key:订单号 | |
| 76 | - attachmentDO -> attachmentDO, // value:附件对象 | |
| 77 | - (existing, replacement) -> existing // 重复key时保留已有值 | |
| 78 | - )); | |
| 72 | + .collect(Collectors.groupingBy( | |
| 73 | + AttachmentDO::getBusiType, | |
| 74 | + Collectors.mapping( | |
| 75 | + AttachmentDO::getFileNames, | |
| 76 | + Collectors.toList() | |
| 77 | + ) | |
| 78 | + )); | |
| 79 | 79 | } |
| 80 | 80 | } |
| 81 | 81 | |
| ... | ... | @@ -95,7 +95,7 @@ public class AppMainInfoController { |
| 95 | 95 | } |
| 96 | 96 | userIds.add(mainInfo.getUserId()); |
| 97 | 97 | Map<Long, AdminUserRespDTO> userMap = adminUserApi.getUserMap(userIds); |
| 98 | - return success(MainInfoConvert.INSTANCE.buildMainInfo(mainInfo, attachmentMap, companyName, userMap)); | |
| 98 | + return success(MainInfoConvert.INSTANCE.appBuildMainInfo(mainInfo, attachmentMap, companyName, userMap)); | |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | @GetMapping("/page") | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/maininfo/vo/AppMainInfoPageReqVO.java
| ... | ... | @@ -15,6 +15,12 @@ import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YE |
| 15 | 15 | @Data |
| 16 | 16 | public class AppMainInfoPageReqVO extends PageParam { |
| 17 | 17 | |
| 18 | + @Schema(description = "搜索类型:1 位置 2 工单名称 3 情况描述 4 工单编号", example = "1") | |
| 19 | + private String type; | |
| 20 | + | |
| 21 | + @Schema(description = "搜索输入内容", example = "祭旁") | |
| 22 | + private String searchContent; | |
| 23 | + | |
| 18 | 24 | @Schema(description = "工单号") |
| 19 | 25 | private String orderNo; |
| 20 | 26 | |
| ... | ... | @@ -24,6 +30,11 @@ public class AppMainInfoPageReqVO extends PageParam { |
| 24 | 30 | @Schema(description = "审批状态", example = "2") |
| 25 | 31 | private Integer status; |
| 26 | 32 | |
| 33 | + @Schema(description = "经纬度地址") | |
| 34 | + private String lonLatAddress; | |
| 35 | + | |
| 36 | + @Schema(description = "工单描述", example = "你说的对") | |
| 37 | + private String remark; | |
| 27 | 38 | /** |
| 28 | 39 | * 时间数组:[开始时间, 结束时间] |
| 29 | 40 | * 由 beginTime 和 endTime 自动组装 | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/maininfo/vo/AppMainInfoRespVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.controller.app.maininfo.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 | + | |
| 8 | +import java.math.BigDecimal; | |
| 9 | +import java.time.LocalDateTime; | |
| 10 | +import java.util.List; | |
| 11 | +import java.util.Set; | |
| 12 | + | |
| 13 | +@Schema(description = "管理后台 - 工单信息 Response VO") | |
| 14 | +@Data | |
| 15 | +@ExcelIgnoreUnannotated | |
| 16 | +public class AppMainInfoRespVO { | |
| 17 | + | |
| 18 | + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7114") | |
| 19 | + @ExcelProperty("ID") | |
| 20 | + private Long id; | |
| 21 | + | |
| 22 | + @Schema(description = "业务线:yl 园林,wy 物业,sz 市政 ", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 23 | + @ExcelProperty("业务线:yl 园林,wy 物业,sz 市政 ") | |
| 24 | + private String busiLine; | |
| 25 | + | |
| 26 | + @Schema(description = "工单号", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 27 | + @ExcelProperty("工单号") | |
| 28 | + private String orderNo; | |
| 29 | + | |
| 30 | + @Schema(description = "工单名称", example = "张三") | |
| 31 | + @ExcelProperty("工单名称") | |
| 32 | + private String orderName; | |
| 33 | + | |
| 34 | + /** | |
| 35 | + * 工单类型 Q:快速工单,C:普通工单,O:其他工单 | |
| 36 | + */ | |
| 37 | + private String orderType; | |
| 38 | + | |
| 39 | + @Schema(description = "来源ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1828") | |
| 40 | + @ExcelProperty("来源ID 问题来源 1、巡查,2、游客居民,3、12345,4、网格 5、大区经理") | |
| 41 | + private Integer sourceId; | |
| 42 | + | |
| 43 | + @Schema(description = "来源名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") | |
| 44 | + @ExcelProperty("来源名称") | |
| 45 | + private String sourceName; | |
| 46 | + | |
| 47 | + @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21128") | |
| 48 | + @ExcelProperty("道路ID") | |
| 49 | + private Long roadId; | |
| 50 | + | |
| 51 | + @Schema(description = "道路名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") | |
| 52 | + @ExcelProperty("道路名称") | |
| 53 | + private String roadName; | |
| 54 | + | |
| 55 | + @Schema(description = "街道ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27852") | |
| 56 | + @ExcelProperty("街道ID") | |
| 57 | + private String streetId; | |
| 58 | + | |
| 59 | + @Schema(description = "街道名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") | |
| 60 | + @ExcelProperty("街道名称") | |
| 61 | + private String streetName; | |
| 62 | + | |
| 63 | + @Schema(description = "养护级别ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28278") | |
| 64 | + @ExcelProperty("养护级别ID") | |
| 65 | + private Integer curingLevelId; | |
| 66 | + | |
| 67 | + @Schema(description = "养护级别", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") | |
| 68 | + @ExcelProperty("养护级别") | |
| 69 | + private String curingLevelName; | |
| 70 | + | |
| 71 | + @Schema(description = "提交日期", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 72 | + @ExcelProperty("提交日期") | |
| 73 | + private LocalDateTime commitDate; | |
| 74 | + | |
| 75 | + @Schema(description = "希望完成时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 76 | + @ExcelProperty("希望完成时间") | |
| 77 | + private LocalDateTime expectedFinishDate; | |
| 78 | + | |
| 79 | + @Schema(description = "完成时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 80 | + @ExcelProperty("完成时间") | |
| 81 | + private LocalDateTime finishDate; | |
| 82 | + | |
| 83 | + @Schema(description = "紧急程度:1:特急;2:紧急;3:一般", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") | |
| 84 | + @ExcelProperty("紧急程度:1:特急;2:紧急;3:一般") | |
| 85 | + private Integer pressingType; | |
| 86 | + | |
| 87 | + @Schema(description = "提交用户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12757") | |
| 88 | + private Long userId; | |
| 89 | + | |
| 90 | + @Schema(description = "提交用户名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") | |
| 91 | + @ExcelProperty("提交用户名称") | |
| 92 | + private String userName; | |
| 93 | + | |
| 94 | + @Schema(description = "部门id", requiredMode = Schema.RequiredMode.REQUIRED, example = "26936") | |
| 95 | + private Long companyId; | |
| 96 | + | |
| 97 | + @Schema(description = "单位名称") | |
| 98 | + @ExcelProperty("单位名称") | |
| 99 | + private String companyName; | |
| 100 | + | |
| 101 | + @Schema(description = "经纬度类型: 1:国标; 2:百度;3:高德;4:腾讯", example = "2") | |
| 102 | + @ExcelProperty("经纬度类型: 1:国标; 2:百度;3:高德;4:腾讯") | |
| 103 | + private Integer latLonType; | |
| 104 | + | |
| 105 | + @Schema(description = "经度", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 106 | + @ExcelProperty("经度") | |
| 107 | + private BigDecimal lat; | |
| 108 | + | |
| 109 | + @Schema(description = "维度", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 110 | + @ExcelProperty("维度") | |
| 111 | + private BigDecimal lon; | |
| 112 | + | |
| 113 | + @Schema(description = "经纬度地址", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 114 | + @ExcelProperty("经纬度地址") | |
| 115 | + private String lonLatAddress; | |
| 116 | + | |
| 117 | + @Schema(description = "三方工单ID") | |
| 118 | + @ExcelProperty("三方工单ID") | |
| 119 | + private String thirdWorkNo; | |
| 120 | + | |
| 121 | + @Schema(description = "三方工单结果上报状态:1:待推送;2:推送成功;3:推送失败") | |
| 122 | + @ExcelProperty("三方工单结果上报状态:1:待推送;2:推送成功;3:推送失败") | |
| 123 | + private Integer thirdPushState; | |
| 124 | + | |
| 125 | + @Schema(description = "业务状态", example = "1") | |
| 126 | + @ExcelProperty("业务状态") | |
| 127 | + private String buzStatus; | |
| 128 | + | |
| 129 | + @Schema(description = "审批状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") | |
| 130 | + @ExcelProperty("审批状态") | |
| 131 | + private Integer status; | |
| 132 | + | |
| 133 | + @Schema(description = "流程实例的编号", example = "9184") | |
| 134 | + @ExcelProperty("流程实例的编号") | |
| 135 | + private String processInstanceId; | |
| 136 | + | |
| 137 | + @Schema(description = "工单描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对") | |
| 138 | + @ExcelProperty("工单描述") | |
| 139 | + private String remark; | |
| 140 | + | |
| 141 | + @Schema(description = "工单完成结果描述", example = "已完成") | |
| 142 | + @ExcelProperty("工单完成结果描述") | |
| 143 | + private String handleResult; | |
| 144 | + | |
| 145 | + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 146 | + @ExcelProperty("创建时间") | |
| 147 | + private LocalDateTime createTime; | |
| 148 | + | |
| 149 | + @Schema(description = "文件名称") | |
| 150 | + private List<String> fileNames; | |
| 151 | + | |
| 152 | + @Schema(description = "共同处理人") | |
| 153 | + private Set<Long> coHandlers; | |
| 154 | + @Schema(description = "共同处理人名称,多个为数组") | |
| 155 | + private List<String> coHandlersName; | |
| 156 | + | |
| 157 | + @Schema(description = "提交人电话") | |
| 158 | + private String userMobile; | |
| 159 | + | |
| 160 | + @Schema(description = "养护员") | |
| 161 | + private String workerName; | |
| 162 | + | |
| 163 | + @Schema(description = "实施人员部门id") | |
| 164 | + private Long workerCompanyId; | |
| 165 | + | |
| 166 | + @Schema(description = "处理人") | |
| 167 | + private String assigneeName; | |
| 168 | + | |
| 169 | + @Schema(description = "审批节点") | |
| 170 | + private String approvalNode; | |
| 171 | + | |
| 172 | + @Schema(description = "问题图片") | |
| 173 | + private List<String> problemsImgs; | |
| 174 | + @Schema(description = "开始图片") | |
| 175 | + private List<String> startImgs; | |
| 176 | + @Schema(description = "处理中图片") | |
| 177 | + private List<String> processingImgs; | |
| 178 | + @Schema(description = "结束图片") | |
| 179 | + private List<String> endImgs; | |
| 180 | + @Schema(description = "人员图片") | |
| 181 | + private List<String> personImgs; | |
| 182 | + @Schema(description = "物料图片") | |
| 183 | + private List<String> materialImgs; | |
| 184 | +} | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/convert/maininfo/MainInfoConvert.java
| ... | ... | @@ -6,6 +6,7 @@ import com.zteits.urbanops.framework.common.util.object.BeanUtils; |
| 6 | 6 | import com.zteits.urbanops.module.bpm.api.task.dto.BpmUserSimpleReqDTO; |
| 7 | 7 | import com.zteits.urbanops.module.system.api.user.dto.AdminUserRespDTO; |
| 8 | 8 | import com.zteits.urbanops.module.workorder.controller.admin.maininfo.vo.AdminMainInfoRespVO; |
| 9 | +import com.zteits.urbanops.module.workorder.controller.app.maininfo.vo.AppMainInfoRespVO; | |
| 9 | 10 | import com.zteits.urbanops.module.workorder.dal.dataobject.attachment.AttachmentDO; |
| 10 | 11 | import com.zteits.urbanops.module.workorder.dal.dataobject.maininfo.MainInfoDO; |
| 11 | 12 | import org.mapstruct.Mapper; |
| ... | ... | @@ -90,4 +91,36 @@ public interface MainInfoConvert { |
| 90 | 91 | } |
| 91 | 92 | return mainInfoVo; |
| 92 | 93 | } |
| 94 | + | |
| 95 | + default AppMainInfoRespVO appBuildMainInfo(MainInfoDO mainInfoDO, Map<String, List<String>> attachmentMap, String deptName, Map<Long, AdminUserRespDTO> userMap) { | |
| 96 | + AppMainInfoRespVO mainInfoVo = BeanUtils.toBean(mainInfoDO, AppMainInfoRespVO.class); | |
| 97 | + if (mainInfoDO != null) { | |
| 98 | + if (attachmentMap != null && !attachmentMap.isEmpty()){ | |
| 99 | + //01 问题图片,02 开始图片,03 进行中图片,04 已完成图片,05 人员图片:06 材料图片 | |
| 100 | + mainInfoVo.setProblemsImgs(attachmentMap.getOrDefault("01", List.of())); | |
| 101 | + mainInfoVo.setStartImgs(attachmentMap.getOrDefault("02", List.of())); | |
| 102 | + mainInfoVo.setProcessingImgs(attachmentMap.getOrDefault("03", List.of())); | |
| 103 | + mainInfoVo.setEndImgs(attachmentMap.getOrDefault("04", List.of())); | |
| 104 | + mainInfoVo.setPersonImgs(attachmentMap.getOrDefault("05", List.of())); | |
| 105 | + mainInfoVo.setMaterialImgs(attachmentMap.getOrDefault("06", List.of())); | |
| 106 | + } | |
| 107 | + mainInfoVo.setCompanyName(deptName); | |
| 108 | + if (mainInfoVo.getCoHandlers() != null && !mainInfoVo.getCoHandlers().isEmpty()) { | |
| 109 | + List<String> coHandlersNameList = Optional.ofNullable(mainInfoVo.getCoHandlers()) | |
| 110 | + .orElse(Set.of()) | |
| 111 | + .stream() | |
| 112 | + .filter(Objects::nonNull) | |
| 113 | + .map(userMap::get) | |
| 114 | + .filter(Objects::nonNull) | |
| 115 | + .map(AdminUserRespDTO::getNickname) | |
| 116 | + .filter(nickname -> nickname != null && !nickname.isEmpty()) | |
| 117 | + .collect(Collectors.toList()); | |
| 118 | + mainInfoVo.setCoHandlersName(coHandlersNameList); | |
| 119 | + }else{ | |
| 120 | + mainInfoVo.setCoHandlersName(new ArrayList<>()); | |
| 121 | + } | |
| 122 | + mainInfoVo.setUserMobile(userMap.get(mainInfoVo.getUserId()).getMobile()); | |
| 123 | + } | |
| 124 | + return mainInfoVo; | |
| 125 | + } | |
| 93 | 126 | } | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/maininfo/MainInfoMapper.java
| ... | ... | @@ -153,6 +153,8 @@ public interface MainInfoMapper extends BaseMapperX<MainInfoDO> { |
| 153 | 153 | .likeIfPresent(MainInfoDO::getOrderName, reqVO.getOrderName()) |
| 154 | 154 | .eqIfPresent(MainInfoDO::getStatus, reqVO.getStatus()) |
| 155 | 155 | .betweenIfPresent(MainInfoDO::getCreateTime, reqVO.getCreateTime()) |
| 156 | + .likeIfPresent(MainInfoDO::getLonLatAddress, reqVO.getLonLatAddress()) | |
| 157 | + .likeIfPresent(MainInfoDO::getRemark, reqVO.getRemark()) | |
| 156 | 158 | .orderByDesc(MainInfoDO::getId); |
| 157 | 159 | return selectPage(reqVO, queryWrapper); |
| 158 | 160 | } | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/maininfo/MainInfoServiceImpl.java
| ... | ... | @@ -2,6 +2,7 @@ package com.zteits.urbanops.module.workorder.service.maininfo; |
| 2 | 2 | |
| 3 | 3 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 4 | 4 | import com.zteits.urbanops.framework.common.util.object.BeanUtils; |
| 5 | +import com.zteits.urbanops.framework.common.util.object.ObjectUtils; | |
| 5 | 6 | import com.zteits.urbanops.module.workorder.controller.admin.maininfo.vo.MainInfoPageReqVO; |
| 6 | 7 | import com.zteits.urbanops.module.workorder.controller.admin.maininfo.vo.MainInfoSaveReqVO; |
| 7 | 8 | import com.zteits.urbanops.module.workorder.controller.app.maininfo.vo.AppMainInfoPageReqVO; |
| ... | ... | @@ -84,6 +85,27 @@ public class MainInfoServiceImpl implements MainInfoService { |
| 84 | 85 | } |
| 85 | 86 | |
| 86 | 87 | public PageResult<MainInfoDO> selectPageExcludeQuickOrder(AppMainInfoPageReqVO pageReqVO) { |
| 88 | + String type = pageReqVO.getType(); | |
| 89 | + String content = pageReqVO.getSearchContent(); | |
| 90 | + if (ObjectUtils.isNotAllEmpty(type)){ | |
| 91 | + if("1".equals(type)){ | |
| 92 | + if(ObjectUtils.isNotAllEmpty(content)){pageReqVO.setLonLatAddress(content);} | |
| 93 | + } else if("2".equals(type)){ | |
| 94 | + if(ObjectUtils.isNotAllEmpty(content)){pageReqVO.setOrderName(content);} | |
| 95 | + } else if("3".equals(type)){ | |
| 96 | + if(ObjectUtils.isNotAllEmpty(content)){pageReqVO.setRemark(content);} | |
| 97 | + } else if("4".equals(type)){ | |
| 98 | + if(ObjectUtils.isNotAllEmpty(content)){pageReqVO.setOrderNo(content);} | |
| 99 | + } else { | |
| 100 | + if (ObjectUtils.isNotAllEmpty(content)) { | |
| 101 | + pageReqVO.setOrderName(content); | |
| 102 | + } | |
| 103 | + } | |
| 104 | + } else {//默认是工单名称 | |
| 105 | + if (ObjectUtils.isNotAllEmpty(content)) { | |
| 106 | + pageReqVO.setOrderName(content); | |
| 107 | + } | |
| 108 | + } | |
| 87 | 109 | return mainInfoMapper.selectPageExcludeQuickOrder(pageReqVO); |
| 88 | 110 | } |
| 89 | 111 | ... | ... |