Commit 9f88780a904091b9297f2215d880c2c9cd51022f
Merge remote-tracking branch 'origin/dev' into dev
Showing
43 changed files
with
459 additions
and
89 deletions
urbanops-module-api/urbanops-module-garden-api/src/main/java/com/zteits/urbanops/module/garden/api/road/RoadApi.java
| @@ -10,5 +10,5 @@ import java.util.List; | @@ -10,5 +10,5 @@ import java.util.List; | ||
| 10 | public interface RoadApi { | 10 | public interface RoadApi { |
| 11 | List<RoadRespDTO> getRoadInfoBy(RoadReqDTO reqDTO); | 11 | List<RoadRespDTO> getRoadInfoBy(RoadReqDTO reqDTO); |
| 12 | 12 | ||
| 13 | - RoadStreetRespDTO getRoadInfoById(Long id); | 13 | + RoadStreetRespDTO getRoadInfoById(String id); |
| 14 | } | 14 | } |
urbanops-module-api/urbanops-module-garden-api/src/main/java/com/zteits/urbanops/module/garden/dto/road/RoadStreetRespDTO.java
| @@ -12,7 +12,7 @@ import lombok.Data; | @@ -12,7 +12,7 @@ import lombok.Data; | ||
| 12 | @Data | 12 | @Data |
| 13 | public class RoadStreetRespDTO { | 13 | public class RoadStreetRespDTO { |
| 14 | 14 | ||
| 15 | - private Long id; | 15 | + private String id; |
| 16 | 16 | ||
| 17 | private String roadName; | 17 | private String roadName; |
| 18 | 18 | ||
| @@ -28,4 +28,8 @@ public class RoadStreetRespDTO { | @@ -28,4 +28,8 @@ public class RoadStreetRespDTO { | ||
| 28 | private Integer levelId; | 28 | private Integer levelId; |
| 29 | 29 | ||
| 30 | private Long companyId; | 30 | private Long companyId; |
| 31 | + /** | ||
| 32 | + * 道路负责部门 | ||
| 33 | + */ | ||
| 34 | + private Long deptId; | ||
| 31 | } | 35 | } |
urbanops-module-api/urbanops-module-workorder-api/src/main/java/com/zteits/urbanops/module/workorder/api/WorkOrderApi.java
| @@ -33,7 +33,7 @@ public interface WorkOrderApi { | @@ -33,7 +33,7 @@ public interface WorkOrderApi { | ||
| 33 | * @param busiLine | 33 | * @param busiLine |
| 34 | * @return | 34 | * @return |
| 35 | */ | 35 | */ |
| 36 | - public List<AdminUserRespVO> getUserByRoadIdAndRoleCode(Long roadId, String roleCode, String busiLine); | 36 | + public List<AdminUserRespVO> getUserByRoadIdAndRoleCode(String roadId, String roleCode, String busiLine); |
| 37 | 37 | ||
| 38 | /** | 38 | /** |
| 39 | * 创建工单API | 39 | * 创建工单API |
urbanops-module-api/urbanops-module-workorder-api/src/main/java/com/zteits/urbanops/module/workorder/dto/AppGardenWorkOrderAIReqVO.java
| @@ -23,7 +23,7 @@ public class AppGardenWorkOrderAIReqVO { | @@ -23,7 +23,7 @@ public class AppGardenWorkOrderAIReqVO { | ||
| 23 | 23 | ||
| 24 | @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21128") | 24 | @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21128") |
| 25 | @NotNull(message = "道路ID不能为空") | 25 | @NotNull(message = "道路ID不能为空") |
| 26 | - private Long roadId; | 26 | + private String roadId; |
| 27 | 27 | ||
| 28 | /** | 28 | /** |
| 29 | * 工单类型 Q:快速工单,C:普通工单,O:其他工单 | 29 | * 工单类型 Q:快速工单,C:普通工单,O:其他工单 |
| @@ -63,7 +63,7 @@ public class AppGardenWorkOrderAIReqVO { | @@ -63,7 +63,7 @@ public class AppGardenWorkOrderAIReqVO { | ||
| 63 | @Schema(description = "工单名称", example = "绿地卫生") | 63 | @Schema(description = "工单名称", example = "绿地卫生") |
| 64 | private String orderName; | 64 | private String orderName; |
| 65 | 65 | ||
| 66 | - @Schema(description = "来源ID 工单来源 1、巡查,2、游客居民,3、12345,4、网格", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | 66 | + @Schema(description = "来源ID 工单来源 1、巡查,2、游客居民,3、12345,4、网格,5 大区经理,6 AI", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| 67 | //@NotNull(message = "来源ID不能为空") | 67 | //@NotNull(message = "来源ID不能为空") |
| 68 | private Integer sourceId; | 68 | private Integer sourceId; |
| 69 | 69 | ||
| @@ -81,6 +81,12 @@ public class AppGardenWorkOrderAIReqVO { | @@ -81,6 +81,12 @@ public class AppGardenWorkOrderAIReqVO { | ||
| 81 | @Schema(description = "工单业务线", example = "yl") | 81 | @Schema(description = "工单业务线", example = "yl") |
| 82 | private String busiLine; | 82 | private String busiLine; |
| 83 | 83 | ||
| 84 | + @Schema(description = "工单来源编码", example = "axcbng") | ||
| 85 | + private String woSourceId; | ||
| 86 | + | ||
| 87 | + @Schema(description = "工单来源名称", example = "摄像头") | ||
| 88 | + private String woSourceName; | ||
| 89 | + | ||
| 84 | 90 | ||
| 85 | 91 | ||
| 86 | } | 92 | } |
urbanops-module-api/urbanops-module-workorder-api/src/main/java/com/zteits/urbanops/module/workorder/dto/AppGardenWorkOrderInspectorReqVO.java
| @@ -23,7 +23,7 @@ public class AppGardenWorkOrderInspectorReqVO { | @@ -23,7 +23,7 @@ public class AppGardenWorkOrderInspectorReqVO { | ||
| 23 | 23 | ||
| 24 | @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21128") | 24 | @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21128") |
| 25 | @NotNull(message = "道路ID不能为空") | 25 | @NotNull(message = "道路ID不能为空") |
| 26 | - private Long roadId; | 26 | + private String roadId; |
| 27 | 27 | ||
| 28 | /** | 28 | /** |
| 29 | * 工单类型 Q:快速工单,C:普通工单,O:其他工单 | 29 | * 工单类型 Q:快速工单,C:普通工单,O:其他工单 |
urbanops-module-api/urbanops-module-workorder-api/src/main/java/com/zteits/urbanops/module/workorder/dto/AppGardenWorkOrderReqVO.java
| @@ -24,7 +24,7 @@ public class AppGardenWorkOrderReqVO { | @@ -24,7 +24,7 @@ public class AppGardenWorkOrderReqVO { | ||
| 24 | 24 | ||
| 25 | @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21128") | 25 | @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21128") |
| 26 | @NotNull(message = "道路ID不能为空") | 26 | @NotNull(message = "道路ID不能为空") |
| 27 | - private Long roadId; | 27 | + private String roadId; |
| 28 | 28 | ||
| 29 | /** | 29 | /** |
| 30 | * 工单类型 Q:快速工单,C:普通工单,O:其他工单 | 30 | * 工单类型 Q:快速工单,C:普通工单,O:其他工单 |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/api/road/RoadApiImpl.java
| @@ -62,8 +62,10 @@ public class RoadApiImpl implements RoadApi { | @@ -62,8 +62,10 @@ public class RoadApiImpl implements RoadApi { | ||
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | @Override | 64 | @Override |
| 65 | - public RoadStreetRespDTO getRoadInfoById(Long id) { | ||
| 66 | - RoadRespVO roadRespVO = roadService.getUniqueRoad(id); | ||
| 67 | - return BeanUtils.toBean(roadRespVO, RoadStreetRespDTO.class); | 65 | + public RoadStreetRespDTO getRoadInfoById(String id) { |
| 66 | + RoadRespVO roadRespVO = roadService.getUniqueRoad(Long.parseLong(id)); | ||
| 67 | + RoadStreetRespDTO targetVO = BeanUtils.toBean(roadRespVO, RoadStreetRespDTO.class); | ||
| 68 | + targetVO.setId(roadRespVO.getId().toString()); | ||
| 69 | + return targetVO; | ||
| 68 | } | 70 | } |
| 69 | } | 71 | } |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/convert/AppGardenWorkOrderConvert.java
| @@ -17,7 +17,7 @@ public interface AppGardenWorkOrderConvert { | @@ -17,7 +17,7 @@ public interface AppGardenWorkOrderConvert { | ||
| 17 | 17 | ||
| 18 | default AppGardenWorkOrderReqVO buildAppGardenWorkOrderReqVO(AppInspectionPlanCommitSaveReqVO createReqVO, InspectionPlanDO inspectionPlanDO, RoadDO roadDO, String planNo ) { | 18 | default AppGardenWorkOrderReqVO buildAppGardenWorkOrderReqVO(AppInspectionPlanCommitSaveReqVO createReqVO, InspectionPlanDO inspectionPlanDO, RoadDO roadDO, String planNo ) { |
| 19 | AppGardenWorkOrderReqVO orderReqVO = new AppGardenWorkOrderReqVO(); | 19 | AppGardenWorkOrderReqVO orderReqVO = new AppGardenWorkOrderReqVO(); |
| 20 | - orderReqVO.setRoadId(inspectionPlanDO.getRoadId()); | 20 | + orderReqVO.setRoadId(inspectionPlanDO.getRoadId().toString()); |
| 21 | orderReqVO.setRoadName(inspectionPlanDO.getRoadName()); | 21 | orderReqVO.setRoadName(inspectionPlanDO.getRoadName()); |
| 22 | orderReqVO.setProblemsImgs(createReqVO.getImgList()); | 22 | orderReqVO.setProblemsImgs(createReqVO.getImgList()); |
| 23 | orderReqVO.setRemark(createReqVO.getRemark()); | 23 | orderReqVO.setRemark(createReqVO.getRemark()); |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/api/constant/BpmCommonConstant.java
| @@ -171,9 +171,14 @@ public class BpmCommonConstant { | @@ -171,9 +171,14 @@ public class BpmCommonConstant { | ||
| 171 | * 大区经理 角色编码 | 171 | * 大区经理 角色编码 |
| 172 | */ | 172 | */ |
| 173 | public static final String REGIONAL_MANAGER = "regional_manager"; | 173 | public static final String REGIONAL_MANAGER = "regional_manager"; |
| 174 | - | 174 | + /** |
| 175 | + * 督察员 角色编码 | ||
| 176 | + */ | ||
| 175 | public static final String INSPECTOR_GLOBAL = "Inspector_global"; | 177 | public static final String INSPECTOR_GLOBAL = "Inspector_global"; |
| 176 | - | 178 | + /** |
| 179 | + * ai 工单派发人 | ||
| 180 | + */ | ||
| 181 | + public static final String AI_DISPATCHER = "AI_dispatcher"; | ||
| 177 | /*养护级别-字典key*/ | 182 | /*养护级别-字典key*/ |
| 178 | public static final String CONSERVE_LEVEL = "conserve_level"; | 183 | public static final String CONSERVE_LEVEL = "conserve_level"; |
| 179 | //--------------------------------------------------------------------------------- | 184 | //--------------------------------------------------------------------------------- |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/api/workorder/WorkOrderApiImpl.java
| @@ -67,7 +67,7 @@ public class WorkOrderApiImpl implements WorkOrderApi { | @@ -67,7 +67,7 @@ public class WorkOrderApiImpl implements WorkOrderApi { | ||
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | @Override | 69 | @Override |
| 70 | - public List<AdminUserRespVO> getUserByRoadIdAndRoleCode(Long roadId, String roleCode, String busiLine) { | 70 | + public List<AdminUserRespVO> getUserByRoadIdAndRoleCode(String roadId, String roleCode, String busiLine) { |
| 71 | if(ObjectUtils.isEmpty(roadId) || ObjectUtils.isEmpty(roleCode) || ObjectUtils.isEmpty(busiLine)){ | 71 | if(ObjectUtils.isEmpty(roadId) || ObjectUtils.isEmpty(roleCode) || ObjectUtils.isEmpty(busiLine)){ |
| 72 | throw exception0(BAD_REQUEST.getCode(),"param:roadId,roleCode,busiLine 不能为空!"); | 72 | throw exception0(BAD_REQUEST.getCode(),"param:roadId,roleCode,busiLine 不能为空!"); |
| 73 | } | 73 | } |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/config/StringArrayTypeHandler.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.config; | ||
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * @Classname StringArrayTypeHandler | ||
| 5 | + * @Description | ||
| 6 | + * @Date 2025/6/11 14:47 | ||
| 7 | + * @Created by wangqian | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +import com.fasterxml.jackson.databind.ObjectMapper; | ||
| 11 | +import org.apache.ibatis.type.BaseTypeHandler; | ||
| 12 | +import org.apache.ibatis.type.JdbcType; | ||
| 13 | +import org.apache.ibatis.type.MappedJdbcTypes; | ||
| 14 | +import org.apache.ibatis.type.MappedTypes; | ||
| 15 | + | ||
| 16 | +import java.sql.CallableStatement; | ||
| 17 | +import java.sql.PreparedStatement; | ||
| 18 | +import java.sql.ResultSet; | ||
| 19 | +import java.sql.SQLException; | ||
| 20 | + | ||
| 21 | +/** | ||
| 22 | + * MyBatis 类型处理器,用于处理 JSON 格式的字符串数组与 Java String[] 之间的转换 | ||
| 23 | + */ | ||
| 24 | +@MappedTypes(String[].class) | ||
| 25 | +@MappedJdbcTypes({JdbcType.VARCHAR, JdbcType.LONGVARCHAR, JdbcType.OTHER}) | ||
| 26 | +public class StringArrayTypeHandler extends BaseTypeHandler<String[]> { | ||
| 27 | + | ||
| 28 | + private static final ObjectMapper objectMapper = new ObjectMapper(); | ||
| 29 | + | ||
| 30 | + @Override | ||
| 31 | + public void setNonNullParameter(PreparedStatement ps, int i, String[] parameter, JdbcType jdbcType) throws SQLException { | ||
| 32 | + try { | ||
| 33 | + // 将 String[] 转换为 JSON 字符串 | ||
| 34 | + String json = objectMapper.writeValueAsString(parameter); | ||
| 35 | + ps.setString(i, json); | ||
| 36 | + } catch (Exception e) { | ||
| 37 | + throw new SQLException("Error converting String[] to JSON: " + e.getMessage(), e); | ||
| 38 | + } | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + @Override | ||
| 42 | + public String[] getNullableResult(ResultSet rs, String columnName) throws SQLException { | ||
| 43 | + return parseJson(rs.getString(columnName)); | ||
| 44 | + } | ||
| 45 | + | ||
| 46 | + @Override | ||
| 47 | + public String[] getNullableResult(ResultSet rs, int columnIndex) throws SQLException { | ||
| 48 | + return parseJson(rs.getString(columnIndex)); | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + @Override | ||
| 52 | + public String[] getNullableResult(CallableStatement cs, int columnIndex) throws SQLException { | ||
| 53 | + return parseJson(cs.getString(columnIndex)); | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + /** | ||
| 57 | + * 将 JSON 字符串解析为 String[] | ||
| 58 | + */ | ||
| 59 | + private String[] parseJson(String json) { | ||
| 60 | + if (json == null || json.isEmpty()) { | ||
| 61 | + return new String[0]; | ||
| 62 | + } | ||
| 63 | + try { | ||
| 64 | + // 将 JSON 字符串转换为 String[] | ||
| 65 | + return objectMapper.readValue(json, String[].class); | ||
| 66 | + } catch (Exception e) { | ||
| 67 | + throw new RuntimeException("Error converting JSON to String[]: " + e.getMessage(), e); | ||
| 68 | + } | ||
| 69 | + } | ||
| 70 | +} |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventinfo/EventInfoController.java
| @@ -69,8 +69,8 @@ public class EventInfoController { | @@ -69,8 +69,8 @@ public class EventInfoController { | ||
| 69 | @PutMapping("/end") | 69 | @PutMapping("/end") |
| 70 | @Operation(summary = "结束工单事件") | 70 | @Operation(summary = "结束工单事件") |
| 71 | @PreAuthorize("@ss.hasPermission('workorder:event-info:end')") | 71 | @PreAuthorize("@ss.hasPermission('workorder:event-info:end')") |
| 72 | - public CommonResult<Boolean> endEventInfo(@Valid @RequestParam("id") Long id) { | ||
| 73 | - eventInfoService.endEventInfo(id); | 72 | + public CommonResult<Boolean> endEventInfo(@Valid @RequestParam("id") Long[] ids) { |
| 73 | + eventInfoService.endEventInfo(ids); | ||
| 74 | return success(true); | 74 | return success(true); |
| 75 | } | 75 | } |
| 76 | 76 |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventinfo/vo/EventInfoPageReqVO.java
| @@ -50,7 +50,7 @@ public class EventInfoPageReqVO extends PageParam { | @@ -50,7 +50,7 @@ public class EventInfoPageReqVO extends PageParam { | ||
| 50 | private String lonLatAddress; | 50 | private String lonLatAddress; |
| 51 | 51 | ||
| 52 | @Schema(description = "用户提交照片") | 52 | @Schema(description = "用户提交照片") |
| 53 | - private String confrimImgs; | 53 | + private String[] confrimImgs; |
| 54 | 54 | ||
| 55 | @Schema(description = "事件状态", example = "1") | 55 | @Schema(description = "事件状态", example = "1") |
| 56 | private Integer eventStatus; | 56 | private Integer eventStatus; |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventinfo/vo/EventInfoRespVO.java
| @@ -63,7 +63,7 @@ public class EventInfoRespVO { | @@ -63,7 +63,7 @@ public class EventInfoRespVO { | ||
| 63 | 63 | ||
| 64 | @Schema(description = "用户提交照片", requiredMode = Schema.RequiredMode.REQUIRED) | 64 | @Schema(description = "用户提交照片", requiredMode = Schema.RequiredMode.REQUIRED) |
| 65 | @ExcelProperty("用户提交照片") | 65 | @ExcelProperty("用户提交照片") |
| 66 | - private String confrimImgs; | 66 | + private String[] confrimImgs; |
| 67 | 67 | ||
| 68 | @Schema(description = "事件状态", example = "1") | 68 | @Schema(description = "事件状态", example = "1") |
| 69 | @ExcelProperty("事件状态") | 69 | @ExcelProperty("事件状态") |
| @@ -81,6 +81,8 @@ public class EventInfoRespVO { | @@ -81,6 +81,8 @@ public class EventInfoRespVO { | ||
| 81 | @ExcelProperty("创建人") | 81 | @ExcelProperty("创建人") |
| 82 | private String creator; | 82 | private String creator; |
| 83 | 83 | ||
| 84 | + private String ender; | ||
| 85 | + | ||
| 84 | 86 | ||
| 85 | 87 | ||
| 86 | } | 88 | } |
| 87 | \ No newline at end of file | 89 | \ No newline at end of file |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/eventinfo/vo/EventInfoSaveReqVO.java
| @@ -33,6 +33,16 @@ public class EventInfoSaveReqVO { | @@ -33,6 +33,16 @@ public class EventInfoSaveReqVO { | ||
| 33 | @Schema(description = "提交时间") | 33 | @Schema(description = "提交时间") |
| 34 | private LocalDateTime commitDate; | 34 | private LocalDateTime commitDate; |
| 35 | 35 | ||
| 36 | + /** | ||
| 37 | + * 事件设备 | ||
| 38 | + */ | ||
| 39 | + private String eventDevice; | ||
| 40 | + | ||
| 41 | + /** | ||
| 42 | + * 事件设备编码 | ||
| 43 | + */ | ||
| 44 | + private String eventDeviceCode; | ||
| 45 | + | ||
| 36 | @Schema(description = "完成时间") | 46 | @Schema(description = "完成时间") |
| 37 | private LocalDateTime finishDate; | 47 | private LocalDateTime finishDate; |
| 38 | 48 |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/garden/vo/BpmGardenTaskAssignReqVO.java
| @@ -28,7 +28,7 @@ public class BpmGardenTaskAssignReqVO { | @@ -28,7 +28,7 @@ public class BpmGardenTaskAssignReqVO { | ||
| 28 | 28 | ||
| 29 | @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21128") | 29 | @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21128") |
| 30 | @NotNull(message = "道路ID不能为空") | 30 | @NotNull(message = "道路ID不能为空") |
| 31 | - private Long roadId; | 31 | + private String roadId; |
| 32 | 32 | ||
| 33 | @Schema(description = "道路名称", example = "测试道路") | 33 | @Schema(description = "道路名称", example = "测试道路") |
| 34 | private String roadName; | 34 | private String roadName; |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/eventinfo/AppEventInfoController.java
| @@ -73,8 +73,10 @@ public class AppEventInfoController { | @@ -73,8 +73,10 @@ public class AppEventInfoController { | ||
| 73 | vo.setConfrimImgs(createReqVO.getUserConfrimImgs()); | 73 | vo.setConfrimImgs(createReqVO.getUserConfrimImgs()); |
| 74 | vo.setCommitDate(LocalDateTime.now()); | 74 | vo.setCommitDate(LocalDateTime.now()); |
| 75 | vo.setEvetName(createReqVO.getProblemName()); | 75 | vo.setEvetName(createReqVO.getProblemName()); |
| 76 | + vo.setEventDeviceCode(createReqVO.getDeviceCode()); | ||
| 77 | + vo.setEventDevice(createReqVO.getDevice()); | ||
| 76 | vo.setLatLonType(3); | 78 | vo.setLatLonType(3); |
| 77 | - vo.setCreator("设备"); | 79 | + vo.setCreator(createReqVO.getDeviceCode()); |
| 78 | vo.setRemark(createReqVO.getUserConfrimRemark()); | 80 | vo.setRemark(createReqVO.getUserConfrimRemark()); |
| 79 | // 调用高德API根据经纬度查询地址 | 81 | // 调用高德API根据经纬度查询地址 |
| 80 | if (createReqVO.getUserConfrimLat() != null && createReqVO.getUserConfrimLon() != null) { | 82 | if (createReqVO.getUserConfrimLat() != null && createReqVO.getUserConfrimLon() != null) { |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/aop/AIBuzStatusUpdateAspect.java
| @@ -132,6 +132,7 @@ public class AIBuzStatusUpdateAspect { | @@ -132,6 +132,7 @@ public class AIBuzStatusUpdateAspect { | ||
| 132 | if(null == roadStreetRespDTO){ | 132 | if(null == roadStreetRespDTO){ |
| 133 | throw exception(APP_WORK_ROAD_NOT_EXISTS); | 133 | throw exception(APP_WORK_ROAD_NOT_EXISTS); |
| 134 | } | 134 | } |
| 135 | + targeVO.setWorkerCompanyId(roadStreetRespDTO.getDeptId());//道路负责部门id | ||
| 135 | targeVO.setStreetId(roadStreetRespDTO.getStreetId()); | 136 | targeVO.setStreetId(roadStreetRespDTO.getStreetId()); |
| 136 | targeVO.setStreetName(roadStreetRespDTO.getStreetName()); | 137 | targeVO.setStreetName(roadStreetRespDTO.getStreetName()); |
| 137 | targeVO.setBuzStatus(ORDER_STATUS_INIT);//工单业务初始化状态 后续操作状态 见 OperateTypeEnum | 138 | targeVO.setBuzStatus(ORDER_STATUS_INIT);//工单业务初始化状态 后续操作状态 见 OperateTypeEnum |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/aop/BuzStatusUpdateAspect.java
| @@ -33,6 +33,7 @@ import static com.zteits.urbanops.framework.common.exception.util.ServiceExcepti | @@ -33,6 +33,7 @@ import static com.zteits.urbanops.framework.common.exception.util.ServiceExcepti | ||
| 33 | import static com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant.CONSERVE_LEVEL; | 33 | import static com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant.CONSERVE_LEVEL; |
| 34 | import static com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant.ORDER_STATUS_INIT; | 34 | import static com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant.ORDER_STATUS_INIT; |
| 35 | import static com.zteits.urbanops.module.workorder.enums.ErrorCodeConstants.APP_WORKER_LEVEL_ID_NOT_EXISTS; | 35 | import static com.zteits.urbanops.module.workorder.enums.ErrorCodeConstants.APP_WORKER_LEVEL_ID_NOT_EXISTS; |
| 36 | +import static com.zteits.urbanops.module.workorder.enums.ErrorCodeConstants.APP_WORK_ROAD_NOT_EXISTS; | ||
| 36 | 37 | ||
| 37 | /** | 38 | /** |
| 38 | * 类描述:切面更新工单表业务状态 | 39 | * 类描述:切面更新工单表业务状态 |
| @@ -122,6 +123,9 @@ public class BuzStatusUpdateAspect { | @@ -122,6 +123,9 @@ public class BuzStatusUpdateAspect { | ||
| 122 | //重新发起需更新表单数据 | 123 | //重新发起需更新表单数据 |
| 123 | if(OperateTypeEnum.YL_INSPECTOR_START_RELAUNCH.getCode().equals(operateType.getCode())){ | 124 | if(OperateTypeEnum.YL_INSPECTOR_START_RELAUNCH.getCode().equals(operateType.getCode())){ |
| 124 | RoadStreetRespDTO roadStreetRespDTO = roadApi.getRoadInfoById(reqVO.getRoadId()); | 125 | RoadStreetRespDTO roadStreetRespDTO = roadApi.getRoadInfoById(reqVO.getRoadId()); |
| 126 | + if(null == roadStreetRespDTO){ | ||
| 127 | + throw exception(APP_WORK_ROAD_NOT_EXISTS); | ||
| 128 | + } | ||
| 125 | targeVO = BeanUtils.toBean(reqVO,MainInfoDO.class); | 129 | targeVO = BeanUtils.toBean(reqVO,MainInfoDO.class); |
| 126 | targeVO.setId(reqVO.getWorkerDataId()); | 130 | targeVO.setId(reqVO.getWorkerDataId()); |
| 127 | 131 | ||
| @@ -131,6 +135,7 @@ public class BuzStatusUpdateAspect { | @@ -131,6 +135,7 @@ public class BuzStatusUpdateAspect { | ||
| 131 | targeVO.setOrderNo(dbData.getOrderNo()); | 135 | targeVO.setOrderNo(dbData.getOrderNo()); |
| 132 | targeVO.setStreetId(roadStreetRespDTO.getStreetId()); | 136 | targeVO.setStreetId(roadStreetRespDTO.getStreetId()); |
| 133 | targeVO.setStreetName(roadStreetRespDTO.getStreetName()); | 137 | targeVO.setStreetName(roadStreetRespDTO.getStreetName()); |
| 138 | + targeVO.setWorkerCompanyId(roadStreetRespDTO.getDeptId());//道路负责部门id | ||
| 134 | DictDataRespDTO dictData = dictDataCommonApi.getDictData(CONSERVE_LEVEL, roadStreetRespDTO.getLevelId().toString()); | 139 | DictDataRespDTO dictData = dictDataCommonApi.getDictData(CONSERVE_LEVEL, roadStreetRespDTO.getLevelId().toString()); |
| 135 | if(null == dictData){ | 140 | if(null == dictData){ |
| 136 | throw exception(APP_WORKER_LEVEL_ID_NOT_EXISTS); | 141 | throw exception(APP_WORKER_LEVEL_ID_NOT_EXISTS); |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/aop/InspectorBuzStatusUpdateAspect.java
| @@ -104,6 +104,7 @@ public class InspectorBuzStatusUpdateAspect { | @@ -104,6 +104,7 @@ public class InspectorBuzStatusUpdateAspect { | ||
| 104 | } | 104 | } |
| 105 | targeVO.setStreetId(roadStreetRespDTO.getStreetId()); | 105 | targeVO.setStreetId(roadStreetRespDTO.getStreetId()); |
| 106 | targeVO.setStreetName(roadStreetRespDTO.getStreetName()); | 106 | targeVO.setStreetName(roadStreetRespDTO.getStreetName()); |
| 107 | + targeVO.setWorkerCompanyId(roadStreetRespDTO.getDeptId());//道路负责部门id | ||
| 107 | DictDataRespDTO dictData = dictDataCommonApi.getDictData(CONSERVE_LEVEL, roadStreetRespDTO.getLevelId().toString()); | 108 | DictDataRespDTO dictData = dictDataCommonApi.getDictData(CONSERVE_LEVEL, roadStreetRespDTO.getLevelId().toString()); |
| 108 | if(null == dictData){ | 109 | if(null == dictData){ |
| 109 | throw exception(APP_WORKER_LEVEL_ID_NOT_EXISTS); | 110 | throw exception(APP_WORKER_LEVEL_ID_NOT_EXISTS); |
| @@ -116,6 +117,14 @@ public class InspectorBuzStatusUpdateAspect { | @@ -116,6 +117,14 @@ public class InspectorBuzStatusUpdateAspect { | ||
| 116 | targeVO.setRoadId(reqVO.getRoadId()); | 117 | targeVO.setRoadId(reqVO.getRoadId()); |
| 117 | targeVO.setPressingType(reqVO.getPressingType()); | 118 | targeVO.setPressingType(reqVO.getPressingType()); |
| 118 | targeVO.setExpectedFinishDate(reqVO.getExpectedFinishDate()); | 119 | targeVO.setExpectedFinishDate(reqVO.getExpectedFinishDate()); |
| 120 | + if(!dbData.getBusiLine().equals(reqVO.getBusiLine())){//如果前端业务线和数据库不一致 | ||
| 121 | + //删除原来的 | ||
| 122 | + gardenService.deleteAttachement(BpmCommonConstant.PROBLEM_IMG_GROUP,targeVO.getOrderNo(),dbData.getBusiLine()); | ||
| 123 | + } | ||
| 124 | + List<String> problemsImgs = reqVO.getProblemsImgs(); | ||
| 125 | + if(ObjectUtils.isNotAllEmpty(problemsImgs) && problemsImgs.size()>0){ | ||
| 126 | + gardenService.attachmentInsertOrUpdate(problemsImgs,BpmCommonConstant.PROBLEM_IMG_GROUP,targeVO); | ||
| 127 | + } | ||
| 119 | } | 128 | } |
| 120 | 129 | ||
| 121 | //大区经理退回 | 130 | //大区经理退回 |
| @@ -131,6 +140,7 @@ public class InspectorBuzStatusUpdateAspect { | @@ -131,6 +140,7 @@ public class InspectorBuzStatusUpdateAspect { | ||
| 131 | if(null == roadStreetRespDTO){ | 140 | if(null == roadStreetRespDTO){ |
| 132 | throw exception(APP_WORK_ROAD_NOT_EXISTS); | 141 | throw exception(APP_WORK_ROAD_NOT_EXISTS); |
| 133 | } | 142 | } |
| 143 | + targeVO.setWorkerCompanyId(roadStreetRespDTO.getDeptId());//道路负责部门id | ||
| 134 | targeVO.setStreetId(roadStreetRespDTO.getStreetId()); | 144 | targeVO.setStreetId(roadStreetRespDTO.getStreetId()); |
| 135 | targeVO.setStreetName(roadStreetRespDTO.getStreetName()); | 145 | targeVO.setStreetName(roadStreetRespDTO.getStreetName()); |
| 136 | targeVO.setBuzStatus(ORDER_STATUS_INIT);//工单业务初始化状态 后续操作状态 见 OperateTypeEnum | 146 | targeVO.setBuzStatus(ORDER_STATUS_INIT);//工单业务初始化状态 后续操作状态 见 OperateTypeEnum |
| @@ -150,7 +160,7 @@ public class InspectorBuzStatusUpdateAspect { | @@ -150,7 +160,7 @@ public class InspectorBuzStatusUpdateAspect { | ||
| 150 | targeVO.setWoSourceName(roleList.get(0).getName()); | 160 | targeVO.setWoSourceName(roleList.get(0).getName()); |
| 151 | String busiLine = reqVO.getBusiLine(); | 161 | String busiLine = reqVO.getBusiLine(); |
| 152 | if(StringUtil.isEmpty(busiLine)){ | 162 | if(StringUtil.isEmpty(busiLine)){ |
| 153 | - busiLine = SecurityFrameworkUtils.getBusiLine(); | 163 | + busiLine = dbData.getBusiLine(); |
| 154 | } | 164 | } |
| 155 | targeVO.setBusiLine(busiLine); | 165 | targeVO.setBusiLine(busiLine); |
| 156 | targeVO.setUserId(SecurityFrameworkUtils.getLoginUserId()); | 166 | targeVO.setUserId(SecurityFrameworkUtils.getLoginUserId()); |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/aop/UniversalBuzStatusUpdateAspect.java
| @@ -98,6 +98,7 @@ public class UniversalBuzStatusUpdateAspect { | @@ -98,6 +98,7 @@ public class UniversalBuzStatusUpdateAspect { | ||
| 98 | if(null == roadStreetRespDTO){ | 98 | if(null == roadStreetRespDTO){ |
| 99 | throw exception(APP_WORK_ROAD_NOT_EXISTS); | 99 | throw exception(APP_WORK_ROAD_NOT_EXISTS); |
| 100 | } | 100 | } |
| 101 | + targeVO.setWorkerCompanyId(roadStreetRespDTO.getDeptId());//道路负责部门id | ||
| 101 | targeVO.setStreetId(roadStreetRespDTO.getStreetId()); | 102 | targeVO.setStreetId(roadStreetRespDTO.getStreetId()); |
| 102 | targeVO.setStreetName(roadStreetRespDTO.getStreetName()); | 103 | targeVO.setStreetName(roadStreetRespDTO.getStreetName()); |
| 103 | DictDataRespDTO dictData = dictDataCommonApi.getDictData(CONSERVE_LEVEL, roadStreetRespDTO.getLevelId().toString()); | 104 | DictDataRespDTO dictData = dictDataCommonApi.getDictData(CONSERVE_LEVEL, roadStreetRespDTO.getLevelId().toString()); |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/vo/common/AppUniversalApprovalReqVO.java
| @@ -90,7 +90,7 @@ public class AppUniversalApprovalReqVO { | @@ -90,7 +90,7 @@ public class AppUniversalApprovalReqVO { | ||
| 90 | //-------------------------重新发起需提交表单数据------------------------ | 90 | //-------------------------重新发起需提交表单数据------------------------ |
| 91 | @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21128") | 91 | @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21128") |
| 92 | @NotNull(message = "道路ID不能为空", groups = RelaunchGroup.class) | 92 | @NotNull(message = "道路ID不能为空", groups = RelaunchGroup.class) |
| 93 | - private Long roadId; | 93 | + private String roadId; |
| 94 | 94 | ||
| 95 | @Schema(description = "道路名称", example = "测试道路") | 95 | @Schema(description = "道路名称", example = "测试道路") |
| 96 | private String roadName; | 96 | private String roadName; |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/vo/task/AppGardenTaskInspectorApproveReqVO.java
| @@ -40,7 +40,7 @@ public class AppGardenTaskInspectorApproveReqVO { | @@ -40,7 +40,7 @@ public class AppGardenTaskInspectorApproveReqVO { | ||
| 40 | 40 | ||
| 41 | @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21128") | 41 | @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21128") |
| 42 | @NotNull(message = "道路ID不能为空", groups = RelaunchGroup.class) | 42 | @NotNull(message = "道路ID不能为空", groups = RelaunchGroup.class) |
| 43 | - private Long roadId; | 43 | + private String roadId; |
| 44 | 44 | ||
| 45 | @Schema(description = "道路名称", example = "测试道路") | 45 | @Schema(description = "道路名称", example = "测试道路") |
| 46 | private String roadName; | 46 | private String roadName; |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/vo/task/AppGardenTaskRegionMgrApproveReqVO.java
| @@ -40,7 +40,7 @@ public class AppGardenTaskRegionMgrApproveReqVO { | @@ -40,7 +40,7 @@ public class AppGardenTaskRegionMgrApproveReqVO { | ||
| 40 | 40 | ||
| 41 | @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21128") | 41 | @Schema(description = "道路ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21128") |
| 42 | @NotNull(message = "道路ID不能为空") | 42 | @NotNull(message = "道路ID不能为空") |
| 43 | - private Long roadId; | 43 | + private String roadId; |
| 44 | 44 | ||
| 45 | @Schema(description = "道路名称", example = "测试道路") | 45 | @Schema(description = "道路名称", example = "测试道路") |
| 46 | private String roadName; | 46 | private String roadName; |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/eventinfo/EventInfoDO.java
| 1 | package com.zteits.urbanops.module.workorder.dal.dataobject.eventinfo; | 1 | package com.zteits.urbanops.module.workorder.dal.dataobject.eventinfo; |
| 2 | 2 | ||
| 3 | +import com.zteits.urbanops.module.workorder.config.StringArrayTypeHandler; | ||
| 3 | import lombok.*; | 4 | import lombok.*; |
| 4 | import java.util.*; | 5 | import java.util.*; |
| 5 | import java.time.LocalDateTime; | 6 | import java.time.LocalDateTime; |
| @@ -16,7 +17,7 @@ import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; | @@ -16,7 +17,7 @@ import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO; | ||
| 16 | * | 17 | * |
| 17 | * @author 超级管理员 | 18 | * @author 超级管理员 |
| 18 | */ | 19 | */ |
| 19 | -@TableName("workorder_event_info") | 20 | +@TableName(value = "workorder_event_info", autoResultMap = true) |
| 20 | @KeySequence("workorder_event_info_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | 21 | @KeySequence("workorder_event_info_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 |
| 21 | @Data | 22 | @Data |
| 22 | @EqualsAndHashCode(callSuper = true) | 23 | @EqualsAndHashCode(callSuper = true) |
| @@ -80,7 +81,8 @@ public class EventInfoDO extends BaseDO { | @@ -80,7 +81,8 @@ public class EventInfoDO extends BaseDO { | ||
| 80 | /** | 81 | /** |
| 81 | * 用户提交照片 | 82 | * 用户提交照片 |
| 82 | */ | 83 | */ |
| 83 | - private String confrimImgs; | 84 | + @TableField(typeHandler = StringArrayTypeHandler.class) |
| 85 | + private String[] confrimImgs; | ||
| 84 | /** | 86 | /** |
| 85 | * 事件状态 | 87 | * 事件状态 |
| 86 | */ | 88 | */ |
| @@ -90,5 +92,7 @@ public class EventInfoDO extends BaseDO { | @@ -90,5 +92,7 @@ public class EventInfoDO extends BaseDO { | ||
| 90 | */ | 92 | */ |
| 91 | private String remark; | 93 | private String remark; |
| 92 | 94 | ||
| 95 | + private String ender; | ||
| 96 | + | ||
| 93 | 97 | ||
| 94 | } | 98 | } |
| 95 | \ No newline at end of file | 99 | \ No newline at end of file |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/maininfo/MainInfoDO.java
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/dataobject/maininfo/MainInfoExtDO.java
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/eventinfo/EventInfoMapper.java
| 1 | package com.zteits.urbanops.module.workorder.dal.mysql.eventinfo; | 1 | package com.zteits.urbanops.module.workorder.dal.mysql.eventinfo; |
| 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.framework.security.core.util.SecurityFrameworkUtils; | ||
| 7 | +import com.zteits.urbanops.module.workorder.controller.admin.eventinfo.vo.EventInfoPageReqVO; | ||
| 8 | import com.zteits.urbanops.module.workorder.dal.dataobject.eventinfo.EventInfoDO; | 8 | import com.zteits.urbanops.module.workorder.dal.dataobject.eventinfo.EventInfoDO; |
| 9 | +import com.zteits.urbanops.module.workorder.enums.EventStatusEnum; | ||
| 9 | import org.apache.ibatis.annotations.Mapper; | 10 | import org.apache.ibatis.annotations.Mapper; |
| 10 | -import com.zteits.urbanops.module.workorder.controller.admin.eventinfo.vo.*; | 11 | + |
| 12 | +import java.time.LocalDateTime; | ||
| 11 | 13 | ||
| 12 | /** | 14 | /** |
| 13 | * 工单事件 Mapper | 15 | * 工单事件 Mapper |
| @@ -37,4 +39,10 @@ public interface EventInfoMapper extends BaseMapperX<EventInfoDO> { | @@ -37,4 +39,10 @@ public interface EventInfoMapper extends BaseMapperX<EventInfoDO> { | ||
| 37 | .orderByDesc(EventInfoDO::getId)); | 39 | .orderByDesc(EventInfoDO::getId)); |
| 38 | } | 40 | } |
| 39 | 41 | ||
| 42 | + default void updateByIds(Long[] ids) { | ||
| 43 | + update(new EventInfoDO() | ||
| 44 | + .setEnder(SecurityFrameworkUtils.getLoginUserNickname()) | ||
| 45 | + .setFinishDate(LocalDateTime.now()) | ||
| 46 | + .setEventStatus(EventStatusEnum.FINISHED.getCode()), new LambdaQueryWrapperX<EventInfoDO>().in(EventInfoDO::getId, ids)); | ||
| 47 | + } | ||
| 40 | } | 48 | } |
| 41 | \ No newline at end of file | 49 | \ No newline at end of file |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/maininfo/MainInfoExtMapper.java
| @@ -725,11 +725,11 @@ public interface MainInfoExtMapper extends BaseMapperX<MainInfoDO> { | @@ -725,11 +725,11 @@ public interface MainInfoExtMapper extends BaseMapperX<MainInfoDO> { | ||
| 725 | @Result(column = "avatar", property = "avatar") | 725 | @Result(column = "avatar", property = "avatar") |
| 726 | }) | 726 | }) |
| 727 | @DataPermission(enable = false) | 727 | @DataPermission(enable = false) |
| 728 | - IPage<AdminUserRespDTO> getUserByRoadIdAndRoleCodeIPage(IPage<AdminUserRespDTO> page,@NonNull @Param("roadId") Long roadId, | 728 | + IPage<AdminUserRespDTO> getUserByRoadIdAndRoleCodeIPage(IPage<AdminUserRespDTO> page,@NonNull @Param("roadId") String roadId, |
| 729 | @NonNull @Param("roleCode") String roleCode, | 729 | @NonNull @Param("roleCode") String roleCode, |
| 730 | @NonNull @Param("busiLine") String busiLine); | 730 | @NonNull @Param("busiLine") String busiLine); |
| 731 | @DataPermission(enable = false) | 731 | @DataPermission(enable = false) |
| 732 | - default PageResult<AdminUserRespDTO> getUserByRoadIdAndRoleCodePage(PageParam pageParam,@NonNull @Param("roadId") Long roadId, | 732 | + default PageResult<AdminUserRespDTO> getUserByRoadIdAndRoleCodePage(PageParam pageParam,@NonNull @Param("roadId") String roadId, |
| 733 | @NonNull @Param("roleCode") String roleCode, | 733 | @NonNull @Param("roleCode") String roleCode, |
| 734 | @NonNull @Param("busiLine") String busiLine){ | 734 | @NonNull @Param("busiLine") String busiLine){ |
| 735 | IPage<AdminUserRespDTO> mpPage = MyBatisUtils.buildPage(pageParam); | 735 | IPage<AdminUserRespDTO> mpPage = MyBatisUtils.buildPage(pageParam); |
| @@ -739,7 +739,7 @@ public interface MainInfoExtMapper extends BaseMapperX<MainInfoDO> { | @@ -739,7 +739,7 @@ public interface MainInfoExtMapper extends BaseMapperX<MainInfoDO> { | ||
| 739 | } | 739 | } |
| 740 | 740 | ||
| 741 | @DataPermission(enable = false) | 741 | @DataPermission(enable = false) |
| 742 | - default List<AdminUserRespDTO> getUserByRoadIdAndRoleCode(@NonNull @Param("roadId") Long roadId, | 742 | + default List<AdminUserRespDTO> getUserByRoadIdAndRoleCode(@NonNull @Param("roadId") String roadId, |
| 743 | @NonNull @Param("roleCode") String roleCode, | 743 | @NonNull @Param("roleCode") String roleCode, |
| 744 | @NonNull @Param("busiLine") String busiLine){ | 744 | @NonNull @Param("busiLine") String busiLine){ |
| 745 | // 创建一个“不分页”的Page对象(size=Integer.MAX_VALUE,查询所有数据) | 745 | // 创建一个“不分页”的Page对象(size=Integer.MAX_VALUE,查询所有数据) |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/enums/ErrorCodeConstants.java
| @@ -44,13 +44,18 @@ public interface ErrorCodeConstants { | @@ -44,13 +44,18 @@ public interface ErrorCodeConstants { | ||
| 44 | ErrorCode APP_REGIONMGR_USER_ROLE_ERROR = new ErrorCode(1-900-002-007, "该登录人不是 大区经理,无法发起流程!"); | 44 | ErrorCode APP_REGIONMGR_USER_ROLE_ERROR = new ErrorCode(1-900-002-007, "该登录人不是 大区经理,无法发起流程!"); |
| 45 | 45 | ||
| 46 | ErrorCode EVENT_INFO_NOT_EXISTS = new ErrorCode(1-900-003-001, "工单事件不存在"); | 46 | ErrorCode EVENT_INFO_NOT_EXISTS = new ErrorCode(1-900-003-001, "工单事件不存在"); |
| 47 | + ErrorCode EVENT_WORK_ORDER_CREATE_FAILED = new ErrorCode(1-900-003-002, "事件工单创建失败:{}"); | ||
| 47 | 48 | ||
| 48 | ErrorCode EVENT_MAPPING_INFO_NOT_EXISTS = new ErrorCode(1-900-004-001, "工单事件映射不存在"); | 49 | ErrorCode EVENT_MAPPING_INFO_NOT_EXISTS = new ErrorCode(1-900-004-001, "工单事件映射不存在"); |
| 49 | 50 | ||
| 50 | ErrorCode APP_INSPECTOR_USER_ROLE_ERROR = new ErrorCode(1-900-004-001, "该登录人不是 全域督查员,无法发起流程!"); | 51 | ErrorCode APP_INSPECTOR_USER_ROLE_ERROR = new ErrorCode(1-900-004-001, "该登录人不是 全域督查员,无法发起流程!"); |
| 51 | 52 | ||
| 52 | - ErrorCode APP_WORK_INSPECTOR_ROLE_ILLEGLE = new ErrorCode(1-900-004-00, "该登录人即是 大区经理 角色,又是 全域督察员,无法发起流程!"); | 53 | + ErrorCode APP_WORK_INSPECTOR_ROLE_ILLEGLE = new ErrorCode(1-900-004-003, "该登录人即是 大区经理 角色,又是 全域督察员,无法发起流程!"); |
| 53 | 54 | ||
| 54 | - ErrorCode APP_WORK_ROAD_NOT_EXISTS = new ErrorCode(1-900-004-001, "道路信息不存在"); | 55 | + ErrorCode APP_WORK_ROAD_NOT_EXISTS = new ErrorCode(1-900-004-002, "道路信息不存在"); |
| 56 | + | ||
| 57 | + ErrorCode APP_AI_USER_ROLE_ERROR = new ErrorCode(1-900-004-004, "该登录人不是 AI工单派发人员,无法发起流程!"); | ||
| 58 | + | ||
| 59 | + ErrorCode APP_WORK_AI_ROLE_ILLEGLE = new ErrorCode(1-900-004-005, "该登录人即是 大区经理 角色,又是 AI工单派发人员,无法发起流程!"); | ||
| 55 | } | 60 | } |
| 56 | 61 |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/framework/datapermission/config/OrderDataPermissionConfiguration.java
| @@ -9,7 +9,7 @@ import org.springframework.context.annotation.Configuration; | @@ -9,7 +9,7 @@ import org.springframework.context.annotation.Configuration; | ||
| 9 | * 订单模块的数据权限配置 | 9 | * 订单模块的数据权限配置 |
| 10 | * 每个模块独立配置,互不影响 | 10 | * 每个模块独立配置,互不影响 |
| 11 | */ | 11 | */ |
| 12 | -@Configuration(proxyBeanMethods = false) | 12 | +//@Configuration(proxyBeanMethods = false) |
| 13 | public class OrderDataPermissionConfiguration { | 13 | public class OrderDataPermissionConfiguration { |
| 14 | 14 | ||
| 15 | /** | 15 | /** |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/eventinfo/EventInfoService.java
| @@ -64,8 +64,10 @@ public interface EventInfoService { | @@ -64,8 +64,10 @@ public interface EventInfoService { | ||
| 64 | * | 64 | * |
| 65 | * @param id 工单事件编号 | 65 | * @param id 工单事件编号 |
| 66 | */ | 66 | */ |
| 67 | - void endEventInfo(@Valid Long id); | 67 | + void endEventInfo(@Valid Long[] ids); |
| 68 | 68 | ||
| 69 | void createEventOrderInfo(@Valid EventOrderInfoSaveReqVO createReqVO); | 69 | void createEventOrderInfo(@Valid EventOrderInfoSaveReqVO createReqVO); |
| 70 | 70 | ||
| 71 | + boolean bpmAiCallBack(String orderId,Integer status); | ||
| 72 | + | ||
| 71 | } | 73 | } |
| 72 | \ No newline at end of file | 74 | \ No newline at end of file |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/eventinfo/EventInfoServiceImpl.java
| 1 | package com.zteits.urbanops.module.workorder.service.eventinfo; | 1 | package com.zteits.urbanops.module.workorder.service.eventinfo; |
| 2 | 2 | ||
| 3 | -import cn.hutool.core.collection.CollUtil; | 3 | +import com.alibaba.fastjson.JSON; |
| 4 | +import com.zteits.urbanops.framework.common.exception.ErrorCode; | ||
| 5 | +import com.zteits.urbanops.framework.common.pojo.PageResult; | ||
| 6 | +import com.zteits.urbanops.framework.common.util.object.BeanUtils; | ||
| 7 | +import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; | ||
| 8 | +import com.zteits.urbanops.module.bpm.enums.task.BpmTaskStatusEnum; | ||
| 9 | +import com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant; | ||
| 10 | +import com.zteits.urbanops.module.workorder.controller.admin.eventinfo.vo.EventInfoPageReqVO; | ||
| 11 | +import com.zteits.urbanops.module.workorder.controller.admin.eventinfo.vo.EventInfoSaveReqVO; | ||
| 12 | +import com.zteits.urbanops.module.workorder.controller.admin.eventinfo.vo.EventOrderInfoSaveReqVO; | ||
| 13 | +import com.zteits.urbanops.module.workorder.dal.dataobject.eventinfo.EventInfoDO; | ||
| 14 | +import com.zteits.urbanops.module.workorder.dal.dataobject.eventmappinginfo.EventMappingInfoDO; | ||
| 15 | +import com.zteits.urbanops.module.workorder.dal.mysql.eventinfo.EventInfoMapper; | ||
| 16 | +import com.zteits.urbanops.module.workorder.dal.mysql.eventmappinginfo.EventMappingInfoMapper; | ||
| 17 | +import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderAIReqVO; | ||
| 18 | +import com.zteits.urbanops.module.workorder.enums.EventSourceEnum; | ||
| 4 | import com.zteits.urbanops.module.workorder.enums.EventStatusEnum; | 19 | import com.zteits.urbanops.module.workorder.enums.EventStatusEnum; |
| 20 | +import com.zteits.urbanops.module.workorder.service.garden.BpmAIService; | ||
| 21 | +import lombok.RequiredArgsConstructor; | ||
| 22 | +import lombok.extern.slf4j.Slf4j; | ||
| 5 | import org.springframework.stereotype.Service; | 23 | import org.springframework.stereotype.Service; |
| 6 | -import jakarta.annotation.Resource; | ||
| 7 | -import org.springframework.validation.annotation.Validated; | ||
| 8 | import org.springframework.transaction.annotation.Transactional; | 24 | import org.springframework.transaction.annotation.Transactional; |
| 25 | +import org.springframework.util.ObjectUtils; | ||
| 26 | +import org.springframework.validation.annotation.Validated; | ||
| 9 | 27 | ||
| 10 | -import java.util.*; | ||
| 11 | -import com.zteits.urbanops.module.workorder.controller.admin.eventinfo.vo.*; | ||
| 12 | -import com.zteits.urbanops.module.workorder.dal.dataobject.eventinfo.EventInfoDO; | ||
| 13 | -import com.zteits.urbanops.framework.common.pojo.PageResult; | ||
| 14 | -import com.zteits.urbanops.framework.common.pojo.PageParam; | ||
| 15 | -import com.zteits.urbanops.framework.common.util.object.BeanUtils; | ||
| 16 | - | ||
| 17 | -import com.zteits.urbanops.module.workorder.dal.mysql.eventinfo.EventInfoMapper; | 28 | +import java.time.LocalDateTime; |
| 29 | +import java.util.ArrayList; | ||
| 30 | +import java.util.Arrays; | ||
| 31 | +import java.util.List; | ||
| 18 | 32 | ||
| 19 | import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; | 33 | import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 20 | -import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList; | ||
| 21 | -import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.diffList; | ||
| 22 | -import static com.zteits.urbanops.module.workorder.enums.ErrorCodeConstants.*; | 34 | +import static com.zteits.urbanops.module.workorder.enums.ErrorCodeConstants.EVENT_INFO_NOT_EXISTS; |
| 35 | +import static com.zteits.urbanops.module.workorder.enums.ErrorCodeConstants.EVENT_WORK_ORDER_CREATE_FAILED; | ||
| 23 | 36 | ||
| 24 | /** | 37 | /** |
| 25 | * 工单事件 Service 实现类 | 38 | * 工单事件 Service 实现类 |
| @@ -28,10 +41,16 @@ import static com.zteits.urbanops.module.workorder.enums.ErrorCodeConstants.*; | @@ -28,10 +41,16 @@ import static com.zteits.urbanops.module.workorder.enums.ErrorCodeConstants.*; | ||
| 28 | */ | 41 | */ |
| 29 | @Service | 42 | @Service |
| 30 | @Validated | 43 | @Validated |
| 44 | +@RequiredArgsConstructor | ||
| 45 | +@Slf4j | ||
| 31 | public class EventInfoServiceImpl implements EventInfoService { | 46 | public class EventInfoServiceImpl implements EventInfoService { |
| 32 | 47 | ||
| 33 | - @Resource | ||
| 34 | - private EventInfoMapper eventInfoMapper; | 48 | + private final EventInfoMapper eventInfoMapper; |
| 49 | + | ||
| 50 | + private final BpmAIService bpmAIService; | ||
| 51 | + | ||
| 52 | + private final EventMappingInfoMapper eventMappingInfoMapper; | ||
| 53 | + | ||
| 35 | 54 | ||
| 36 | @Override | 55 | @Override |
| 37 | public Long createEventInfo(EventInfoSaveReqVO createReqVO) { | 56 | public Long createEventInfo(EventInfoSaveReqVO createReqVO) { |
| @@ -61,10 +80,10 @@ public class EventInfoServiceImpl implements EventInfoService { | @@ -61,10 +80,10 @@ public class EventInfoServiceImpl implements EventInfoService { | ||
| 61 | } | 80 | } |
| 62 | 81 | ||
| 63 | @Override | 82 | @Override |
| 64 | - public void deleteEventInfoListByIds(List<Long> ids) { | 83 | + public void deleteEventInfoListByIds(List<Long> ids) { |
| 65 | // 删除 | 84 | // 删除 |
| 66 | eventInfoMapper.deleteByIds(ids); | 85 | eventInfoMapper.deleteByIds(ids); |
| 67 | - } | 86 | + } |
| 68 | 87 | ||
| 69 | 88 | ||
| 70 | private void validateEventInfoExists(Long id) { | 89 | private void validateEventInfoExists(Long id) { |
| @@ -84,19 +103,148 @@ public class EventInfoServiceImpl implements EventInfoService { | @@ -84,19 +103,148 @@ public class EventInfoServiceImpl implements EventInfoService { | ||
| 84 | } | 103 | } |
| 85 | 104 | ||
| 86 | @Override | 105 | @Override |
| 87 | - public void endEventInfo(Long id) { | ||
| 88 | - // 校验存在 | ||
| 89 | - validateEventInfoExists(id); | ||
| 90 | - // 更新 | ||
| 91 | - EventInfoDO updateObj = new EventInfoDO(); | ||
| 92 | - updateObj.setId(id); | ||
| 93 | - updateObj.setEventStatus(EventStatusEnum.FINISHED.getCode()); | ||
| 94 | - eventInfoMapper.updateById(updateObj); | 106 | + public void endEventInfo(Long[] ids) { |
| 107 | + | ||
| 108 | + eventInfoMapper.updateByIds(ids); | ||
| 95 | } | 109 | } |
| 96 | 110 | ||
| 97 | @Override | 111 | @Override |
| 112 | + @Transactional(rollbackFor = Exception.class) | ||
| 98 | public void createEventOrderInfo(EventOrderInfoSaveReqVO createReqVO) { | 113 | public void createEventOrderInfo(EventOrderInfoSaveReqVO createReqVO) { |
| 99 | - //TODO @lesan:工单事件工单创建 | 114 | + |
| 115 | + EventInfoDO eventInfo = eventInfoMapper.selectById(createReqVO.getId()); | ||
| 116 | + if (!ObjectUtils.isEmpty(eventInfo)) { | ||
| 117 | + SecurityUserInfo userInfo = getCurrentUserInfo(); | ||
| 118 | + | ||
| 119 | + // 创建AI工单 | ||
| 120 | + Long orderId = createAIWorkOrder(eventInfo, createReqVO); | ||
| 121 | + | ||
| 122 | + // 更新事件状态 | ||
| 123 | + updateEventInfoStatus(eventInfo, userInfo.userId); | ||
| 124 | + | ||
| 125 | + // 创建事件映射信息 | ||
| 126 | + createEventMappingInfo(eventInfo, orderId, createReqVO, userInfo); | ||
| 127 | + } | ||
| 128 | + } | ||
| 129 | + | ||
| 130 | + @Override | ||
| 131 | + public boolean bpmAiCallBack(String orderId, Integer status) { | ||
| 132 | + EventMappingInfoDO mappingInfoDO = eventMappingInfoMapper.selectOne(EventMappingInfoDO::getOrderNo, orderId); | ||
| 133 | + if (ObjectUtils.isEmpty(mappingInfoDO)) { | ||
| 134 | + throw exception(EVENT_INFO_NOT_EXISTS); | ||
| 135 | + } | ||
| 136 | + mappingInfoDO.setStatus(status); | ||
| 137 | + mappingInfoDO.setUpdateTime(LocalDateTime.now()); | ||
| 138 | + mappingInfoDO.setUpdater(String.valueOf(SecurityFrameworkUtils.getLoginUserId())); | ||
| 139 | + mappingInfoDO.setFinishDate(LocalDateTime.now()); | ||
| 140 | + eventMappingInfoMapper.updateById(mappingInfoDO); | ||
| 141 | + return true; | ||
| 142 | + } | ||
| 143 | + | ||
| 144 | + /** | ||
| 145 | + * 获取当前用户信息 | ||
| 146 | + */ | ||
| 147 | + private SecurityUserInfo getCurrentUserInfo() { | ||
| 148 | + Long currentUserId = SecurityFrameworkUtils.getLoginUserId(); | ||
| 149 | + Long companyId = SecurityFrameworkUtils.getCompanyId(); | ||
| 150 | + Long deptId = SecurityFrameworkUtils.getDeptId(); | ||
| 151 | + String userNickname = SecurityFrameworkUtils.getLoginUserNickname(); | ||
| 152 | + | ||
| 153 | + // 检查用户信息是否获取成功 | ||
| 154 | + if (currentUserId == null) { | ||
| 155 | + throw exception(new ErrorCode(1_004_001_000, "用户不存在")); | ||
| 156 | + } | ||
| 157 | + | ||
| 158 | + return new SecurityUserInfo(currentUserId, companyId, deptId, userNickname); | ||
| 159 | + } | ||
| 160 | + | ||
| 161 | + /** | ||
| 162 | + * 创建AI工单 | ||
| 163 | + */ | ||
| 164 | + private Long createAIWorkOrder(EventInfoDO eventInfo, EventOrderInfoSaveReqVO createReqVO) { | ||
| 165 | + AppGardenWorkOrderAIReqVO aiReqVO = new AppGardenWorkOrderAIReqVO(); | ||
| 166 | + aiReqVO.setBusiLine(createReqVO.getBusiLine()) | ||
| 167 | + .setLon(eventInfo.getLon()) | ||
| 168 | + .setLat(eventInfo.getLat()) | ||
| 169 | + .setOrderName(eventInfo.getEvetName()) | ||
| 170 | + .setOrderType(BpmCommonConstant.ORDER_TYPE_C) | ||
| 171 | + .setExpectedFinishDate(createReqVO.getExpectedFinishDate()) | ||
| 172 | + .setLatLonType(3) | ||
| 173 | + .setLonLatAddress(eventInfo.getLonLatAddress()) | ||
| 174 | + .setPressingType(createReqVO.getPressingType()) | ||
| 175 | + // 处理可能为null的数组,避免Arrays.asList抛出异常 | ||
| 176 | + .setProblemsImgs(eventInfo.getConfrimImgs() != null ? Arrays.asList(eventInfo.getConfrimImgs()) : new ArrayList<>()) | ||
| 177 | + .setRemark(eventInfo.getRemark()) | ||
| 178 | + .setRoadId(createReqVO.getRoadId()) | ||
| 179 | + .setRoadName(createReqVO.getRoadName()) | ||
| 180 | + .setSourceId(EventSourceEnum.AI.getCode()) | ||
| 181 | + .setWoSourceId(eventInfo.getEventDeviceCode()) | ||
| 182 | + .setWoSourceName(eventInfo.getEventDevice()) | ||
| 183 | + .setThirdWorkNo(eventInfo.getEventNo()) | ||
| 184 | + .setSourceName(eventInfo.getEventDevice()); | ||
| 185 | + | ||
| 186 | + Long orderId; | ||
| 187 | + try { | ||
| 188 | + log.info("[createAIWorkOrder][创建AI工单]:{}", JSON.toJSONString(aiReqVO)); | ||
| 189 | + orderId = bpmAIService.createWorkOrder(aiReqVO); | ||
| 190 | + log.info("[createAIWorkOrder][创建AI工单结果]:{}", orderId); | ||
| 191 | + } catch (Exception e) { | ||
| 192 | + log.error("[createAIWorkOrder][创建AI工单时发生异常]", e); | ||
| 193 | + throw exception(EVENT_WORK_ORDER_CREATE_FAILED, e.getMessage()); | ||
| 194 | + } | ||
| 195 | + | ||
| 196 | + return orderId; | ||
| 197 | + } | ||
| 198 | + | ||
| 199 | + /** | ||
| 200 | + * 更新事件状态 | ||
| 201 | + */ | ||
| 202 | + private void updateEventInfoStatus(EventInfoDO eventInfo, Long userId) { | ||
| 203 | + eventInfo.setEventStatus(EventStatusEnum.ORDER.getCode()); | ||
| 204 | + eventInfo.setUpdater(String.valueOf(userId)) | ||
| 205 | + .setUpdateTime(LocalDateTime.now()); | ||
| 206 | + eventInfoMapper.updateById(eventInfo); | ||
| 207 | + } | ||
| 208 | + | ||
| 209 | + /** | ||
| 210 | + * 创建事件映射信息 | ||
| 211 | + */ | ||
| 212 | + private void createEventMappingInfo(EventInfoDO eventInfo, Long orderId, EventOrderInfoSaveReqVO createReqVO, SecurityUserInfo userInfo) { | ||
| 213 | + EventMappingInfoDO mappingInfoDO = new EventMappingInfoDO(); | ||
| 214 | + mappingInfoDO.setEventNo(eventInfo.getEventNo()) | ||
| 215 | + .setOrderNo(String.valueOf(orderId)) | ||
| 216 | + .setBusiLine(createReqVO.getBusiLine()) | ||
| 217 | + .setCommitDate(LocalDateTime.now()) | ||
| 218 | + .setCompanyId(userInfo.companyId) | ||
| 219 | + .setDeptId(userInfo.deptId) | ||
| 220 | + .setExpectedFinishDate(createReqVO.getExpectedFinishDate()) | ||
| 221 | + .setPressingType(createReqVO.getPressingType()) | ||
| 222 | + .setRoadId(createReqVO.getRoadId()) | ||
| 223 | + .setRoadName(createReqVO.getRoadName()) | ||
| 224 | + .setUserId(userInfo.userId) | ||
| 225 | + .setUserName(userInfo.userNickname) | ||
| 226 | + .setStatus(BpmTaskStatusEnum.RUNNING.getStatus()) | ||
| 227 | + .setCreator(String.valueOf(userInfo.userId)) | ||
| 228 | + .setCreateTime(LocalDateTime.now()); | ||
| 229 | + | ||
| 230 | + eventMappingInfoMapper.insert(mappingInfoDO); | ||
| 231 | + } | ||
| 232 | + | ||
| 233 | + /** | ||
| 234 | + * 安全用户信息封装类 | ||
| 235 | + */ | ||
| 236 | + private static class SecurityUserInfo { | ||
| 237 | + final Long userId; | ||
| 238 | + final Long companyId; | ||
| 239 | + final Long deptId; | ||
| 240 | + final String userNickname; | ||
| 241 | + | ||
| 242 | + SecurityUserInfo(Long userId, Long companyId, Long deptId, String userNickname) { | ||
| 243 | + this.userId = userId; | ||
| 244 | + this.companyId = companyId; | ||
| 245 | + this.deptId = deptId; | ||
| 246 | + this.userNickname = userNickname; | ||
| 247 | + } | ||
| 100 | } | 248 | } |
| 101 | 249 | ||
| 102 | } | 250 | } |
| 103 | \ No newline at end of file | 251 | \ No newline at end of file |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmAIService.java
| @@ -20,7 +20,7 @@ import jakarta.validation.Valid; | @@ -20,7 +20,7 @@ import jakarta.validation.Valid; | ||
| 20 | public interface BpmAIService { | 20 | public interface BpmAIService { |
| 21 | 21 | ||
| 22 | /** | 22 | /** |
| 23 | - * 全域督察员工单申请 app service 接口 | 23 | + * AI工单申请 app service 接口 |
| 24 | * @param createRequestVo | 24 | * @param createRequestVo |
| 25 | * @return | 25 | * @return |
| 26 | */ | 26 | */ |
| @@ -50,5 +50,5 @@ public interface BpmAIService { | @@ -50,5 +50,5 @@ public interface BpmAIService { | ||
| 50 | * @param roadId | 50 | * @param roadId |
| 51 | * @return | 51 | * @return |
| 52 | */ | 52 | */ |
| 53 | - boolean isSanhaiByRoadId(Long roadId); | 53 | + boolean isSanhaiByRoadId(String roadId); |
| 54 | } | 54 | } |
| 55 | \ No newline at end of file | 55 | \ No newline at end of file |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmAIServiceImpl.java
| @@ -110,12 +110,12 @@ public class BpmAIServiceImpl implements BpmAIService{ | @@ -110,12 +110,12 @@ public class BpmAIServiceImpl implements BpmAIService{ | ||
| 110 | throw exception(APP_USER_ROLE_NOT_EXISTS); | 110 | throw exception(APP_USER_ROLE_NOT_EXISTS); |
| 111 | } | 111 | } |
| 112 | 112 | ||
| 113 | - if(!RoleListUtils.containsCode(roleList,INSPECTOR_GLOBAL)){ | ||
| 114 | - throw exception(APP_INSPECTOR_USER_ROLE_ERROR); | 113 | + if(!RoleListUtils.containsCode(roleList,AI_DISPATCHER)){ |
| 114 | + throw exception(APP_AI_USER_ROLE_ERROR); | ||
| 115 | } | 115 | } |
| 116 | //校验人员不能有 双重角色 | 116 | //校验人员不能有 双重角色 |
| 117 | - if(RoleListUtils.containsBothCodes(roleList, REGIONAL_MANAGER, INSPECTOR_GLOBAL)){ | ||
| 118 | - throw exception(APP_WORK_INSPECTOR_ROLE_ILLEGLE); | 117 | + if(RoleListUtils.containsBothCodes(roleList, REGIONAL_MANAGER, AI_DISPATCHER)){ |
| 118 | + throw exception(APP_WORK_AI_ROLE_ILLEGLE); | ||
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | List<String> problemsImgsList = createRequestVo.getProblemsImgs(); | 121 | List<String> problemsImgsList = createRequestVo.getProblemsImgs(); |
| @@ -125,6 +125,7 @@ public class BpmAIServiceImpl implements BpmAIService{ | @@ -125,6 +125,7 @@ public class BpmAIServiceImpl implements BpmAIService{ | ||
| 125 | if(null == roadStreetRespDTO){ | 125 | if(null == roadStreetRespDTO){ |
| 126 | throw exception(APP_WORK_ROAD_NOT_EXISTS); | 126 | throw exception(APP_WORK_ROAD_NOT_EXISTS); |
| 127 | } | 127 | } |
| 128 | + workOrder.setWorkerCompanyId(roadStreetRespDTO.getDeptId());//道路负责部门id | ||
| 128 | workOrder.setStreetId(roadStreetRespDTO.getStreetId()); | 129 | workOrder.setStreetId(roadStreetRespDTO.getStreetId()); |
| 129 | workOrder.setStreetName(roadStreetRespDTO.getStreetName()); | 130 | workOrder.setStreetName(roadStreetRespDTO.getStreetName()); |
| 130 | workOrder.setBuzStatus(ORDER_STATUS_INIT);//工单业务初始化状态 后续操作状态 见 OperateTypeEnum | 131 | workOrder.setBuzStatus(ORDER_STATUS_INIT);//工单业务初始化状态 后续操作状态 见 OperateTypeEnum |
| @@ -146,10 +147,27 @@ public class BpmAIServiceImpl implements BpmAIService{ | @@ -146,10 +147,27 @@ public class BpmAIServiceImpl implements BpmAIService{ | ||
| 146 | workOrder.setCompanyId(SecurityFrameworkUtils.getCompanyId()); | 147 | workOrder.setCompanyId(SecurityFrameworkUtils.getCompanyId()); |
| 147 | 148 | ||
| 148 | workOrder.setDeptId(SecurityFrameworkUtils.getDeptId()); | 149 | workOrder.setDeptId(SecurityFrameworkUtils.getDeptId()); |
| 149 | - workOrder.setSourceId(EventSourceEnum.AI.getCode()); | ||
| 150 | - workOrder.setSourceName(EventSourceEnum.AI.getDesc()); | ||
| 151 | - workOrder.setWoSourceId(roleList.get(0).getCode()); | ||
| 152 | - workOrder.setWoSourceName(roleList.get(0).getName()); | 150 | + |
| 151 | + Integer sourceId = createRequestVo.getSourceId(); | ||
| 152 | + String sourceName = createRequestVo.getSourceName(); | ||
| 153 | + if(!ObjectUtils.isNotAllEmpty(sourceId)){ | ||
| 154 | + sourceId = EventSourceEnum.AI.getCode(); | ||
| 155 | + } | ||
| 156 | + if(StringUtil.isEmpty(sourceName)){ | ||
| 157 | + sourceName = EventSourceEnum.AI.getDesc(); | ||
| 158 | + } | ||
| 159 | + workOrder.setSourceId(sourceId); | ||
| 160 | + workOrder.setSourceName(sourceName); | ||
| 161 | + String wsourceId = createRequestVo.getWoSourceId(); | ||
| 162 | + String wsourceName = createRequestVo.getWoSourceName(); | ||
| 163 | + if(StringUtil.isEmpty(wsourceId)){ | ||
| 164 | + wsourceId = roleList.get(0).getCode(); | ||
| 165 | + } | ||
| 166 | + if(StringUtil.isEmpty(wsourceName)){ | ||
| 167 | + wsourceName = roleList.get(0).getCode(); | ||
| 168 | + } | ||
| 169 | + workOrder.setWoSourceId(wsourceId); | ||
| 170 | + workOrder.setWoSourceName(wsourceName); | ||
| 153 | String busiLine = createRequestVo.getBusiLine(); | 171 | String busiLine = createRequestVo.getBusiLine(); |
| 154 | if(StringUtil.isEmpty(busiLine)){ | 172 | if(StringUtil.isEmpty(busiLine)){ |
| 155 | busiLine = SecurityFrameworkUtils.getBusiLine(); | 173 | busiLine = SecurityFrameworkUtils.getBusiLine(); |
| @@ -224,7 +242,7 @@ public class BpmAIServiceImpl implements BpmAIService{ | @@ -224,7 +242,7 @@ public class BpmAIServiceImpl implements BpmAIService{ | ||
| 224 | //String busiLine = (String)processInstanceVariables.get(BPM_COMMON_PROD_BUSILINE); | 242 | //String busiLine = (String)processInstanceVariables.get(BPM_COMMON_PROD_BUSILINE); |
| 225 | //Long roadId = (Long) processInstanceVariables.get(BPM_COMMON_PROD_ROADID); | 243 | //Long roadId = (Long) processInstanceVariables.get(BPM_COMMON_PROD_ROADID); |
| 226 | String busiLine = reqVO.getBusiLine(); | 244 | String busiLine = reqVO.getBusiLine(); |
| 227 | - Long roadId = reqVO.getRoadId(); | 245 | + String roadId = reqVO.getRoadId(); |
| 228 | String roleCode = BusiLineTeamLeaderRoleCodeEnum.getByCode(busiLine).getRoleCode(); | 246 | String roleCode = BusiLineTeamLeaderRoleCodeEnum.getByCode(busiLine).getRoleCode(); |
| 229 | 247 | ||
| 230 | if(StringUtil.isEmpty(roleCode)){// 找不到 默认为园林组长的角色 | 248 | if(StringUtil.isEmpty(roleCode)){// 找不到 默认为园林组长的角色 |
| @@ -293,7 +311,7 @@ public class BpmAIServiceImpl implements BpmAIService{ | @@ -293,7 +311,7 @@ public class BpmAIServiceImpl implements BpmAIService{ | ||
| 293 | } | 311 | } |
| 294 | 312 | ||
| 295 | @Override | 313 | @Override |
| 296 | - public boolean isSanhaiByRoadId(Long roadId) { | 314 | + public boolean isSanhaiByRoadId(String roadId) { |
| 297 | RoadStreetRespDTO roadStreetRespDTO = roadApi.getRoadInfoById(roadId); | 315 | RoadStreetRespDTO roadStreetRespDTO = roadApi.getRoadInfoById(roadId); |
| 298 | if(null == roadStreetRespDTO){ | 316 | if(null == roadStreetRespDTO){ |
| 299 | throw exception(APP_WORK_ROAD_NOT_EXISTS); | 317 | throw exception(APP_WORK_ROAD_NOT_EXISTS); |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmGardenService.java
| @@ -208,7 +208,7 @@ public interface BpmGardenService { | @@ -208,7 +208,7 @@ public interface BpmGardenService { | ||
| 208 | * @param busiLine | 208 | * @param busiLine |
| 209 | * @return | 209 | * @return |
| 210 | */ | 210 | */ |
| 211 | - public PageResult<AdminUserRespDTO> getUserByRoadIdAndRoleCode(PageParam param,Long roadId,String roleCode,String busiLine); | 211 | + public PageResult<AdminUserRespDTO> getUserByRoadIdAndRoleCode(PageParam param,String roadId,String roleCode,String busiLine); |
| 212 | 212 | ||
| 213 | /** | 213 | /** |
| 214 | * 附件更新通用方法 | 214 | * 附件更新通用方法 |
| @@ -218,4 +218,11 @@ public interface BpmGardenService { | @@ -218,4 +218,11 @@ public interface BpmGardenService { | ||
| 218 | */ | 218 | */ |
| 219 | public void attachmentInsertOrUpdate(List<String> imgList, String type, MainInfoDO workOrder); | 219 | public void attachmentInsertOrUpdate(List<String> imgList, String type, MainInfoDO workOrder); |
| 220 | 220 | ||
| 221 | + /** | ||
| 222 | + * 删除附件表 | ||
| 223 | + * @param type | ||
| 224 | + * @param orderNo | ||
| 225 | + * @param busiLine | ||
| 226 | + */ | ||
| 227 | + public void deleteAttachement(String type,String orderNo,String busiLine); | ||
| 221 | } | 228 | } |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmGardenServiceImpl.java
| @@ -52,6 +52,7 @@ import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderReqVO; | @@ -52,6 +52,7 @@ import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderReqVO; | ||
| 52 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderRespVO; | 52 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderRespVO; |
| 53 | import com.zteits.urbanops.module.workorder.enums.BusiLineTeamLeaderRoleCodeEnum; | 53 | import com.zteits.urbanops.module.workorder.enums.BusiLineTeamLeaderRoleCodeEnum; |
| 54 | import com.zteits.urbanops.module.workorder.enums.BusiLineWorkerRoleCodeEnum; | 54 | import com.zteits.urbanops.module.workorder.enums.BusiLineWorkerRoleCodeEnum; |
| 55 | +import com.zteits.urbanops.module.workorder.enums.EventSourceEnum; | ||
| 55 | import com.zteits.urbanops.module.workorder.util.TaskNodeUtils; | 56 | import com.zteits.urbanops.module.workorder.util.TaskNodeUtils; |
| 56 | import jakarta.annotation.Resource; | 57 | import jakarta.annotation.Resource; |
| 57 | import jodd.util.StringUtil; | 58 | import jodd.util.StringUtil; |
| @@ -279,7 +280,8 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | @@ -279,7 +280,8 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | ||
| 279 | workerOrder.setCoHandlers(reqVO.getCoHandlers()); | 280 | workerOrder.setCoHandlers(reqVO.getCoHandlers()); |
| 280 | workerOrder.setWorkerId(SecurityFrameworkUtils.getLoginUserId()); | 281 | workerOrder.setWorkerId(SecurityFrameworkUtils.getLoginUserId()); |
| 281 | workerOrder.setWorkerName(SecurityFrameworkUtils.getLoginUserNickname()); | 282 | workerOrder.setWorkerName(SecurityFrameworkUtils.getLoginUserNickname()); |
| 282 | - workerOrder.setWorkerCompanyId(SecurityFrameworkUtils.getCompanyId()); | 283 | + //取消登录人 改为创建或分配时的道路负责人部门 |
| 284 | + //workerOrder.setWorkerCompanyId(SecurityFrameworkUtils.getCompanyId()); | ||
| 283 | workOrderMapper.updateById(workerOrder); | 285 | workOrderMapper.updateById(workerOrder); |
| 284 | 286 | ||
| 285 | if(ObjectUtils.isNotAllEmpty(id) && ObjectUtils.isNotAllEmpty(problemsImgs) && problemsImgs.size()>0){ | 287 | if(ObjectUtils.isNotAllEmpty(id) && ObjectUtils.isNotAllEmpty(problemsImgs) && problemsImgs.size()>0){ |
| @@ -569,7 +571,7 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | @@ -569,7 +571,7 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | ||
| 569 | MainInfoDO workOrder = BeanUtils.toBean(createRequestVo, MainInfoDO.class) | 571 | MainInfoDO workOrder = BeanUtils.toBean(createRequestVo, MainInfoDO.class) |
| 570 | .setStatus(BpmTaskStatusEnum.RUNNING.getStatus()); | 572 | .setStatus(BpmTaskStatusEnum.RUNNING.getStatus()); |
| 571 | RoadStreetRespDTO roadStreetRespDTO = roadApi.getRoadInfoById(createRequestVo.getRoadId()); | 573 | RoadStreetRespDTO roadStreetRespDTO = roadApi.getRoadInfoById(createRequestVo.getRoadId()); |
| 572 | - | 574 | + workOrder.setWorkerCompanyId(roadStreetRespDTO.getDeptId());//道路负责部门id |
| 573 | workOrder.setStreetId(roadStreetRespDTO.getStreetId()); | 575 | workOrder.setStreetId(roadStreetRespDTO.getStreetId()); |
| 574 | workOrder.setStreetName(roadStreetRespDTO.getStreetName()); | 576 | workOrder.setStreetName(roadStreetRespDTO.getStreetName()); |
| 575 | workOrder.setBuzStatus(ORDER_STATUS_INIT);//工单业务初始化状态 后续操作状态 见 OperateTypeEnum | 577 | workOrder.setBuzStatus(ORDER_STATUS_INIT);//工单业务初始化状态 后续操作状态 见 OperateTypeEnum |
| @@ -595,6 +597,16 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | @@ -595,6 +597,16 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | ||
| 595 | if(null == roleList || roleList.size()==0){ | 597 | if(null == roleList || roleList.size()==0){ |
| 596 | throw exception(APP_USER_ROLE_NOT_EXISTS); | 598 | throw exception(APP_USER_ROLE_NOT_EXISTS); |
| 597 | } | 599 | } |
| 600 | + Integer sourceId = createRequestVo.getSourceId(); | ||
| 601 | + String sourceName = createRequestVo.getSourceName(); | ||
| 602 | + if(!ObjectUtils.isNotAllEmpty(sourceId)){ | ||
| 603 | + sourceId = EventSourceEnum.PATROL.getCode(); | ||
| 604 | + } | ||
| 605 | + if(StringUtil.isEmpty(sourceName)){ | ||
| 606 | + sourceName = EventSourceEnum.PATROL.getDesc(); | ||
| 607 | + } | ||
| 608 | + workOrder.setSourceId(sourceId); | ||
| 609 | + workOrder.setSourceName(sourceName); | ||
| 598 | workOrder.setWoSourceId(roleList.get(0).getCode()); | 610 | workOrder.setWoSourceId(roleList.get(0).getCode()); |
| 599 | workOrder.setWoSourceName(roleList.get(0).getName()); | 611 | workOrder.setWoSourceName(roleList.get(0).getName()); |
| 600 | String busiLine = createRequestVo.getBusiLine(); | 612 | String busiLine = createRequestVo.getBusiLine(); |
| @@ -677,6 +689,16 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | @@ -677,6 +689,16 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | ||
| 677 | } | 689 | } |
| 678 | } | 690 | } |
| 679 | 691 | ||
| 692 | + public void deleteAttachement(String type,String orderNo,String busiLine){ | ||
| 693 | + LambdaQueryWrapper<AttachmentDO> deleteWrapper = new LambdaQueryWrapper<AttachmentDO>() | ||
| 694 | + .eq(AttachmentDO::getBusiType, type) | ||
| 695 | + .eq(AttachmentDO::getOrderNo, orderNo); | ||
| 696 | + if(StringUtil.isNotEmpty(busiLine)){// 全域巡查员 发起的工单 业务线有可能为空 | ||
| 697 | + deleteWrapper.eq(AttachmentDO::getBusiLine, busiLine); | ||
| 698 | + } | ||
| 699 | + attachmentMapper.delete(deleteWrapper); | ||
| 700 | + } | ||
| 701 | + | ||
| 680 | 702 | ||
| 681 | @Override | 703 | @Override |
| 682 | public void updateWorkOrderStatus(Long id, Integer status) { | 704 | public void updateWorkOrderStatus(Long id, Integer status) { |
| @@ -751,7 +773,7 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | @@ -751,7 +773,7 @@ public class BpmGardenServiceImpl implements BpmGardenService{ | ||
| 751 | } | 773 | } |
| 752 | 774 | ||
| 753 | @Override | 775 | @Override |
| 754 | - public PageResult<AdminUserRespDTO> getUserByRoadIdAndRoleCode(PageParam param,Long roadId, String roleCode, String busiLine) { | 776 | + public PageResult<AdminUserRespDTO> getUserByRoadIdAndRoleCode(PageParam param,String roadId, String roleCode, String busiLine) { |
| 755 | if(org.springframework.util.ObjectUtils.isEmpty(roadId) || org.springframework.util.ObjectUtils.isEmpty(roleCode) || org.springframework.util.ObjectUtils.isEmpty(busiLine)){ | 777 | if(org.springframework.util.ObjectUtils.isEmpty(roadId) || org.springframework.util.ObjectUtils.isEmpty(roleCode) || org.springframework.util.ObjectUtils.isEmpty(busiLine)){ |
| 756 | throw exception0(BAD_REQUEST.getCode(),"param:roadId,roleCode,busiLine 不能为空!"); | 778 | throw exception0(BAD_REQUEST.getCode(),"param:roadId,roleCode,busiLine 不能为空!"); |
| 757 | } | 779 | } |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmInspectorService.java
| @@ -51,5 +51,5 @@ public interface BpmInspectorService { | @@ -51,5 +51,5 @@ public interface BpmInspectorService { | ||
| 51 | * @param roadId | 51 | * @param roadId |
| 52 | * @return | 52 | * @return |
| 53 | */ | 53 | */ |
| 54 | - boolean isSanhaiByRoadId(Long roadId); | 54 | + boolean isSanhaiByRoadId(String roadId); |
| 55 | } | 55 | } |
| 56 | \ No newline at end of file | 56 | \ No newline at end of file |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmInspectorServiceImpl.java
| @@ -31,6 +31,7 @@ import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoMapper; | @@ -31,6 +31,7 @@ import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoMapper; | ||
| 31 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderInspectorReqVO; | 31 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderInspectorReqVO; |
| 32 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderUniversalReqVO; | 32 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderUniversalReqVO; |
| 33 | import com.zteits.urbanops.module.workorder.enums.BusiLineTeamLeaderRoleCodeEnum; | 33 | import com.zteits.urbanops.module.workorder.enums.BusiLineTeamLeaderRoleCodeEnum; |
| 34 | +import com.zteits.urbanops.module.workorder.enums.EventSourceEnum; | ||
| 34 | import com.zteits.urbanops.module.workorder.util.RoleListUtils; | 35 | import com.zteits.urbanops.module.workorder.util.RoleListUtils; |
| 35 | import jakarta.annotation.Resource; | 36 | import jakarta.annotation.Resource; |
| 36 | import jodd.util.StringUtil; | 37 | import jodd.util.StringUtil; |
| @@ -125,6 +126,7 @@ public class BpmInspectorServiceImpl implements BpmInspectorService{ | @@ -125,6 +126,7 @@ public class BpmInspectorServiceImpl implements BpmInspectorService{ | ||
| 125 | if(null == roadStreetRespDTO){ | 126 | if(null == roadStreetRespDTO){ |
| 126 | throw exception(APP_WORK_ROAD_NOT_EXISTS); | 127 | throw exception(APP_WORK_ROAD_NOT_EXISTS); |
| 127 | } | 128 | } |
| 129 | + workOrder.setWorkerCompanyId(roadStreetRespDTO.getDeptId());//道路负责部门id | ||
| 128 | workOrder.setStreetId(roadStreetRespDTO.getStreetId()); | 130 | workOrder.setStreetId(roadStreetRespDTO.getStreetId()); |
| 129 | workOrder.setStreetName(roadStreetRespDTO.getStreetName()); | 131 | workOrder.setStreetName(roadStreetRespDTO.getStreetName()); |
| 130 | workOrder.setBuzStatus(ORDER_STATUS_INIT);//工单业务初始化状态 后续操作状态 见 OperateTypeEnum | 132 | workOrder.setBuzStatus(ORDER_STATUS_INIT);//工单业务初始化状态 后续操作状态 见 OperateTypeEnum |
| @@ -146,6 +148,16 @@ public class BpmInspectorServiceImpl implements BpmInspectorService{ | @@ -146,6 +148,16 @@ public class BpmInspectorServiceImpl implements BpmInspectorService{ | ||
| 146 | workOrder.setCompanyId(SecurityFrameworkUtils.getCompanyId()); | 148 | workOrder.setCompanyId(SecurityFrameworkUtils.getCompanyId()); |
| 147 | 149 | ||
| 148 | workOrder.setDeptId(SecurityFrameworkUtils.getDeptId()); | 150 | workOrder.setDeptId(SecurityFrameworkUtils.getDeptId()); |
| 151 | + Integer sourceId = createRequestVo.getSourceId(); | ||
| 152 | + String sourceName = createRequestVo.getSourceName(); | ||
| 153 | + if(!ObjectUtils.isNotAllEmpty(sourceId)){ | ||
| 154 | + sourceId = EventSourceEnum.PATROL.getCode(); | ||
| 155 | + } | ||
| 156 | + if(StringUtil.isEmpty(sourceName)){ | ||
| 157 | + sourceName = EventSourceEnum.PATROL.getDesc(); | ||
| 158 | + } | ||
| 159 | + workOrder.setSourceId(sourceId); | ||
| 160 | + workOrder.setSourceName(sourceName); | ||
| 149 | workOrder.setWoSourceId(roleList.get(0).getCode()); | 161 | workOrder.setWoSourceId(roleList.get(0).getCode()); |
| 150 | workOrder.setWoSourceName(roleList.get(0).getName()); | 162 | workOrder.setWoSourceName(roleList.get(0).getName()); |
| 151 | String busiLine = createRequestVo.getBusiLine(); | 163 | String busiLine = createRequestVo.getBusiLine(); |
| @@ -222,7 +234,7 @@ public class BpmInspectorServiceImpl implements BpmInspectorService{ | @@ -222,7 +234,7 @@ public class BpmInspectorServiceImpl implements BpmInspectorService{ | ||
| 222 | //String busiLine = (String)processInstanceVariables.get(BPM_COMMON_PROD_BUSILINE); | 234 | //String busiLine = (String)processInstanceVariables.get(BPM_COMMON_PROD_BUSILINE); |
| 223 | //Long roadId = (Long) processInstanceVariables.get(BPM_COMMON_PROD_ROADID); | 235 | //Long roadId = (Long) processInstanceVariables.get(BPM_COMMON_PROD_ROADID); |
| 224 | String busiLine = reqVO.getBusiLine(); | 236 | String busiLine = reqVO.getBusiLine(); |
| 225 | - Long roadId = reqVO.getRoadId(); | 237 | + String roadId = reqVO.getRoadId(); |
| 226 | String roleCode = BusiLineTeamLeaderRoleCodeEnum.getByCode(busiLine).getRoleCode(); | 238 | String roleCode = BusiLineTeamLeaderRoleCodeEnum.getByCode(busiLine).getRoleCode(); |
| 227 | 239 | ||
| 228 | if(StringUtil.isEmpty(roleCode)){// 找不到 默认为园林组长的角色 | 240 | if(StringUtil.isEmpty(roleCode)){// 找不到 默认为园林组长的角色 |
| @@ -291,7 +303,7 @@ public class BpmInspectorServiceImpl implements BpmInspectorService{ | @@ -291,7 +303,7 @@ public class BpmInspectorServiceImpl implements BpmInspectorService{ | ||
| 291 | } | 303 | } |
| 292 | 304 | ||
| 293 | @Override | 305 | @Override |
| 294 | - public boolean isSanhaiByRoadId(Long roadId) { | 306 | + public boolean isSanhaiByRoadId(String roadId) { |
| 295 | RoadStreetRespDTO roadStreetRespDTO = roadApi.getRoadInfoById(roadId); | 307 | RoadStreetRespDTO roadStreetRespDTO = roadApi.getRoadInfoById(roadId); |
| 296 | if(null == roadStreetRespDTO){ | 308 | if(null == roadStreetRespDTO){ |
| 297 | throw exception(APP_WORK_ROAD_NOT_EXISTS); | 309 | throw exception(APP_WORK_ROAD_NOT_EXISTS); |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmRegionMgrServiceImpl.java
| @@ -25,6 +25,7 @@ import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoExtMapper | @@ -25,6 +25,7 @@ import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoExtMapper | ||
| 25 | import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoMapper; | 25 | import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoMapper; |
| 26 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderReqVO; | 26 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderReqVO; |
| 27 | import com.zteits.urbanops.module.workorder.enums.BusiLineTeamLeaderRoleCodeEnum; | 27 | import com.zteits.urbanops.module.workorder.enums.BusiLineTeamLeaderRoleCodeEnum; |
| 28 | +import com.zteits.urbanops.module.workorder.enums.EventSourceEnum; | ||
| 28 | import com.zteits.urbanops.module.workorder.util.RoleListUtils; | 29 | import com.zteits.urbanops.module.workorder.util.RoleListUtils; |
| 29 | import jakarta.annotation.Resource; | 30 | import jakarta.annotation.Resource; |
| 30 | import jodd.util.StringUtil; | 31 | import jodd.util.StringUtil; |
| @@ -108,6 +109,7 @@ public class BpmRegionMgrServiceImpl implements BpmRegionMgrService{ | @@ -108,6 +109,7 @@ public class BpmRegionMgrServiceImpl implements BpmRegionMgrService{ | ||
| 108 | if(null == roadStreetRespDTO){ | 109 | if(null == roadStreetRespDTO){ |
| 109 | throw exception(APP_WORK_ROAD_NOT_EXISTS); | 110 | throw exception(APP_WORK_ROAD_NOT_EXISTS); |
| 110 | } | 111 | } |
| 112 | + workOrder.setWorkerCompanyId(roadStreetRespDTO.getDeptId());//道路负责部门id | ||
| 111 | workOrder.setStreetId(roadStreetRespDTO.getStreetId()); | 113 | workOrder.setStreetId(roadStreetRespDTO.getStreetId()); |
| 112 | workOrder.setStreetName(roadStreetRespDTO.getStreetName()); | 114 | workOrder.setStreetName(roadStreetRespDTO.getStreetName()); |
| 113 | workOrder.setBuzStatus(ORDER_STATUS_INIT);//工单业务初始化状态 后续操作状态 见 OperateTypeEnum | 115 | workOrder.setBuzStatus(ORDER_STATUS_INIT);//工单业务初始化状态 后续操作状态 见 OperateTypeEnum |
| @@ -136,6 +138,16 @@ public class BpmRegionMgrServiceImpl implements BpmRegionMgrService{ | @@ -136,6 +138,16 @@ public class BpmRegionMgrServiceImpl implements BpmRegionMgrService{ | ||
| 136 | if(!RoleListUtils.containsCode(roleList,REGIONAL_MANAGER)){ | 138 | if(!RoleListUtils.containsCode(roleList,REGIONAL_MANAGER)){ |
| 137 | throw exception(APP_REGIONMGR_USER_ROLE_ERROR); | 139 | throw exception(APP_REGIONMGR_USER_ROLE_ERROR); |
| 138 | } | 140 | } |
| 141 | + Integer sourceId = createRequestVo.getSourceId(); | ||
| 142 | + String sourceName = createRequestVo.getSourceName(); | ||
| 143 | + if(!ObjectUtils.isNotAllEmpty(sourceId)){ | ||
| 144 | + sourceId = EventSourceEnum.REGION.getCode(); | ||
| 145 | + } | ||
| 146 | + if(StringUtil.isEmpty(sourceName)){ | ||
| 147 | + sourceName = EventSourceEnum.REGION.getDesc(); | ||
| 148 | + } | ||
| 149 | + workOrder.setSourceId(sourceId); | ||
| 150 | + workOrder.setSourceName(sourceName); | ||
| 139 | workOrder.setWoSourceId(roleList.get(0).getCode()); | 151 | workOrder.setWoSourceId(roleList.get(0).getCode()); |
| 140 | workOrder.setWoSourceName(roleList.get(0).getName()); | 152 | workOrder.setWoSourceName(roleList.get(0).getName()); |
| 141 | String busiLine = createRequestVo.getBusiLine(); | 153 | String busiLine = createRequestVo.getBusiLine(); |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmUniversalServiceImpl.java
| @@ -31,6 +31,7 @@ import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoMapper; | @@ -31,6 +31,7 @@ import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoMapper; | ||
| 31 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderReqVO; | 31 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderReqVO; |
| 32 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderUniversalReqVO; | 32 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderUniversalReqVO; |
| 33 | import com.zteits.urbanops.module.workorder.enums.BusiLineTeamLeaderRoleCodeEnum; | 33 | import com.zteits.urbanops.module.workorder.enums.BusiLineTeamLeaderRoleCodeEnum; |
| 34 | +import com.zteits.urbanops.module.workorder.enums.EventSourceEnum; | ||
| 34 | import com.zteits.urbanops.module.workorder.util.RoleListUtils; | 35 | import com.zteits.urbanops.module.workorder.util.RoleListUtils; |
| 35 | import jakarta.annotation.Resource; | 36 | import jakarta.annotation.Resource; |
| 36 | import jodd.util.StringUtil; | 37 | import jodd.util.StringUtil; |
| @@ -135,7 +136,16 @@ public class BpmUniversalServiceImpl implements BpmUniversalService{ | @@ -135,7 +136,16 @@ public class BpmUniversalServiceImpl implements BpmUniversalService{ | ||
| 135 | if(RoleListUtils.containsBothCodes(roleList, REGIONAL_MANAGER, PARTROL_GLOBAL)){ | 136 | if(RoleListUtils.containsBothCodes(roleList, REGIONAL_MANAGER, PARTROL_GLOBAL)){ |
| 136 | throw exception(APP_WORK_ORADER_ROLE_ILLEGLE); | 137 | throw exception(APP_WORK_ORADER_ROLE_ILLEGLE); |
| 137 | } | 138 | } |
| 138 | - | 139 | + Integer sourceId = createRequestVo.getSourceId(); |
| 140 | + String sourceName = createRequestVo.getSourceName(); | ||
| 141 | + if(!ObjectUtils.isNotAllEmpty(sourceId)){ | ||
| 142 | + sourceId = EventSourceEnum.PATROL.getCode(); | ||
| 143 | + } | ||
| 144 | + if(StringUtil.isEmpty(sourceName)){ | ||
| 145 | + sourceName = EventSourceEnum.PATROL.getDesc(); | ||
| 146 | + } | ||
| 147 | + workOrder.setSourceId(sourceId); | ||
| 148 | + workOrder.setSourceName(sourceName); | ||
| 139 | workOrder.setWoSourceId(roleList.get(0).getCode()); | 149 | workOrder.setWoSourceId(roleList.get(0).getCode()); |
| 140 | workOrder.setWoSourceName(roleList.get(0).getName()); | 150 | workOrder.setWoSourceName(roleList.get(0).getName()); |
| 141 | workOrder.setUserId(SecurityFrameworkUtils.getLoginUserId()); | 151 | workOrder.setUserId(SecurityFrameworkUtils.getLoginUserId()); |
| @@ -186,7 +196,7 @@ public class BpmUniversalServiceImpl implements BpmUniversalService{ | @@ -186,7 +196,7 @@ public class BpmUniversalServiceImpl implements BpmUniversalService{ | ||
| 186 | //String busiLine = (String)processInstanceVariables.get(BPM_COMMON_PROD_BUSILINE); | 196 | //String busiLine = (String)processInstanceVariables.get(BPM_COMMON_PROD_BUSILINE); |
| 187 | //Long roadId = (Long) processInstanceVariables.get(BPM_COMMON_PROD_ROADID); | 197 | //Long roadId = (Long) processInstanceVariables.get(BPM_COMMON_PROD_ROADID); |
| 188 | String busiLine = reqVO.getBusiLine(); | 198 | String busiLine = reqVO.getBusiLine(); |
| 189 | - Long roadId = reqVO.getRoadId(); | 199 | + String roadId = reqVO.getRoadId(); |
| 190 | String roleCode = BusiLineTeamLeaderRoleCodeEnum.getByCode(busiLine).getRoleCode(); | 200 | String roleCode = BusiLineTeamLeaderRoleCodeEnum.getByCode(busiLine).getRoleCode(); |
| 191 | 201 | ||
| 192 | if(StringUtil.isEmpty(roleCode)){// 找不到 默认为园林组长的角色 | 202 | if(StringUtil.isEmpty(roleCode)){// 找不到 默认为园林组长的角色 |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/el/YlTaskAssignService.java
| @@ -29,7 +29,7 @@ public class YlTaskAssignService { | @@ -29,7 +29,7 @@ public class YlTaskAssignService { | ||
| 29 | 29 | ||
| 30 | @Resource | 30 | @Resource |
| 31 | private MainInfoExtMapper workOrderExtMapper; | 31 | private MainInfoExtMapper workOrderExtMapper; |
| 32 | - public Long getInitiatorApproverByBusiness(Long roadId,String roleCode,String busiLine) { | 32 | + public Long getInitiatorApproverByBusiness(String roadId,String roleCode,String busiLine) { |
| 33 | List<AdminUserRespDTO> userList = workOrderExtMapper.getUserByRoadIdAndRoleCode(roadId,roleCode,busiLine); | 33 | List<AdminUserRespDTO> userList = workOrderExtMapper.getUserByRoadIdAndRoleCode(roadId,roleCode,busiLine); |
| 34 | if(null != userList && userList.size() > 0){ | 34 | if(null != userList && userList.size() > 0){ |
| 35 | return userList.get(0).getId(); | 35 | return userList.get(0).getId(); |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/listener/BpmProcessTaskAutoCompleteAIListener.java
| @@ -3,6 +3,7 @@ package com.zteits.urbanops.module.workorder.service.garden.listener; | @@ -3,6 +3,7 @@ package com.zteits.urbanops.module.workorder.service.garden.listener; | ||
| 3 | import com.zteits.urbanops.module.bpm.api.event.BpmProcessInstanceStatusEvent; | 3 | import com.zteits.urbanops.module.bpm.api.event.BpmProcessInstanceStatusEvent; |
| 4 | import com.zteits.urbanops.module.bpm.api.event.BpmProcessInstanceStatusEventListener; | 4 | import com.zteits.urbanops.module.bpm.api.event.BpmProcessInstanceStatusEventListener; |
| 5 | import com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant; | 5 | import com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant; |
| 6 | +import com.zteits.urbanops.module.workorder.service.eventinfo.EventInfoService; | ||
| 6 | import com.zteits.urbanops.module.workorder.service.garden.BpmGardenService; | 7 | import com.zteits.urbanops.module.workorder.service.garden.BpmGardenService; |
| 7 | import jakarta.annotation.Resource; | 8 | import jakarta.annotation.Resource; |
| 8 | import lombok.extern.slf4j.Slf4j; | 9 | import lombok.extern.slf4j.Slf4j; |
| @@ -19,6 +20,8 @@ import org.springframework.stereotype.Component; | @@ -19,6 +20,8 @@ import org.springframework.stereotype.Component; | ||
| 19 | public class BpmProcessTaskAutoCompleteAIListener extends BpmProcessInstanceStatusEventListener { | 20 | public class BpmProcessTaskAutoCompleteAIListener extends BpmProcessInstanceStatusEventListener { |
| 20 | @Resource | 21 | @Resource |
| 21 | private BpmGardenService gardenService; | 22 | private BpmGardenService gardenService; |
| 23 | + @Resource | ||
| 24 | + private EventInfoService eventService; | ||
| 22 | @Override | 25 | @Override |
| 23 | protected String getProcessDefinitionKey() { | 26 | protected String getProcessDefinitionKey() { |
| 24 | 27 | ||
| @@ -30,6 +33,7 @@ public class BpmProcessTaskAutoCompleteAIListener extends BpmProcessInstanceStat | @@ -30,6 +33,7 @@ public class BpmProcessTaskAutoCompleteAIListener extends BpmProcessInstanceStat | ||
| 30 | protected void onEvent(BpmProcessInstanceStatusEvent event) { | 33 | protected void onEvent(BpmProcessInstanceStatusEvent event) { |
| 31 | log.info("业务ID:"+event.getBusinessKey()+",业务状态"+event.getStatus()); | 34 | log.info("业务ID:"+event.getBusinessKey()+",业务状态"+event.getStatus()); |
| 32 | gardenService.updateWorkOrderStatus(Long.parseLong(event.getBusinessKey()), event.getStatus()); | 35 | gardenService.updateWorkOrderStatus(Long.parseLong(event.getBusinessKey()), event.getStatus()); |
| 33 | - | 36 | + log.info("更新事件表状态,业务ID:"+event.getBusinessKey()+",业务状态"+event.getStatus()); |
| 37 | + eventService.bpmAiCallBack(event.getBusinessKey(),event.getStatus()); | ||
| 34 | } | 38 | } |
| 35 | } | 39 | } |