Commit 01154fcaa5861654069e9af2632b70558a6e6608
1 parent
e86c4eda
工单管理代码提交
Showing
9 changed files
with
76 additions
and
19 deletions
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/garden/BpmGardenInspectController.java
| ... | ... | @@ -3,11 +3,7 @@ package com.zteits.urbanops.module.workorder.controller.admin.garden; |
| 3 | 3 | import com.zteits.urbanops.framework.common.pojo.CommonResult; |
| 4 | 4 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 5 | 5 | import com.zteits.urbanops.framework.common.util.object.BeanUtils; |
| 6 | -import com.zteits.urbanops.module.bpm.controller.admin.oa.vo.BpmOALeaveCreateReqVO; | |
| 7 | -import com.zteits.urbanops.module.bpm.controller.admin.oa.vo.BpmOALeavePageReqVO; | |
| 8 | -import com.zteits.urbanops.module.bpm.controller.admin.oa.vo.BpmOALeaveRespVO; | |
| 9 | -import com.zteits.urbanops.module.bpm.dal.dataobject.oa.BpmOALeaveDO; | |
| 10 | -import com.zteits.urbanops.module.workorder.controller.admin.garden.vo.BpmGardenWorkOrderCreateReqVo; | |
| 6 | +import com.zteits.urbanops.module.workorder.controller.admin.garden.vo.BpmGardenWorkOrderCreateReqVO; | |
| 11 | 7 | import com.zteits.urbanops.module.workorder.controller.admin.garden.vo.BpmGardenWorkOrderPageReqVO; |
| 12 | 8 | import com.zteits.urbanops.module.workorder.controller.admin.garden.vo.BpmGardenWorkOrderRespVO; |
| 13 | 9 | import com.zteits.urbanops.module.workorder.dal.dataobject.garden.BpmGardenWorkOrderDO; |
| ... | ... | @@ -41,7 +37,7 @@ public class BpmGardenInspectController { |
| 41 | 37 | @PostMapping("/create") |
| 42 | 38 | @PreAuthorize("@ss.hasPermission('bpm:garden-inspection:create')") |
| 43 | 39 | @Operation(summary = "创建请求申请") |
| 44 | - public CommonResult<Long> createGardenInspection(@Valid @RequestBody BpmGardenWorkOrderCreateReqVo createReqVO) { | |
| 40 | + public CommonResult<Long> createGardenInspection(@Valid @RequestBody BpmGardenWorkOrderCreateReqVO createReqVO) { | |
| 45 | 41 | return success(gardenService.createWorkOrder(getLoginUserId(), createReqVO)); |
| 46 | 42 | } |
| 47 | 43 | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/garden/vo/BpmGardenWorkOrderCreateReqVo.java renamed to urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/garden/vo/BpmGardenWorkOrderCreateReqVO.java
| ... | ... | @@ -18,7 +18,7 @@ import java.util.Map; |
| 18 | 18 | */ |
| 19 | 19 | @Schema(description = "园林工单请求创建 Request VO") |
| 20 | 20 | @Data |
| 21 | -public class BpmGardenWorkOrderCreateReqVo { | |
| 21 | +public class BpmGardenWorkOrderCreateReqVO { | |
| 22 | 22 | |
| 23 | 23 | @Schema(description = "业务线:yl 园林,wy 物业,sz 市政 ", requiredMode = Schema.RequiredMode.REQUIRED) |
| 24 | 24 | @NotEmpty(message = "业务线:yl 园林,wy 物业,sz 市政 不能为空") | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/AppGardenWorkOrderController.java
| ... | ... | @@ -5,7 +5,9 @@ import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 5 | 5 | import com.zteits.urbanops.framework.common.util.object.BeanUtils; |
| 6 | 6 | import com.zteits.urbanops.module.workorder.controller.admin.garden.vo.BpmGardenWorkOrderPageReqVO; |
| 7 | 7 | import com.zteits.urbanops.module.workorder.controller.admin.garden.vo.BpmGardenWorkOrderRespVO; |
| 8 | +import com.zteits.urbanops.module.workorder.controller.app.garden.vo.AppGardenWorkOrderPageReqVO; | |
| 8 | 9 | import com.zteits.urbanops.module.workorder.controller.app.garden.vo.AppGardenWorkOrderReqVO; |
| 10 | +import com.zteits.urbanops.module.workorder.controller.app.garden.vo.AppGardenWorkOrderRespVO; | |
| 9 | 11 | import com.zteits.urbanops.module.workorder.dal.dataobject.garden.BpmGardenWorkOrderDO; |
| 10 | 12 | import com.zteits.urbanops.module.workorder.service.garden.BpmGardenService; |
| 11 | 13 | import io.swagger.v3.oas.annotations.Operation; |
| ... | ... | @@ -27,36 +29,40 @@ import static com.zteits.urbanops.framework.security.core.util.SecurityFramework |
| 27 | 29 | */ |
| 28 | 30 | @Tag(name = "APP - 园林工单bpm") |
| 29 | 31 | @RestController |
| 30 | -@RequestMapping("/app/garden/workorder") | |
| 32 | +@RequestMapping("/bpm/garden/workorder") | |
| 31 | 33 | public class AppGardenWorkOrderController { |
| 32 | 34 | @Resource |
| 33 | 35 | private BpmGardenService gardenService; |
| 34 | 36 | |
| 35 | 37 | @PostMapping("/create") |
| 38 | + //@PreAuthorize("@ss.hasPermission('bpm:garden-workorder:create')") | |
| 36 | 39 | @Operation(summary = "app-创建工单信息") |
| 37 | 40 | public CommonResult<Long> createMainInfo(@Valid @RequestBody AppGardenWorkOrderReqVO createReqVO) { |
| 38 | 41 | return success(gardenService.createWorkOrder(createReqVO)); |
| 39 | 42 | } |
| 40 | 43 | |
| 41 | 44 | @PostMapping("/createQuick") |
| 45 | + //@PreAuthorize("@ss.hasPermission('bpm:garden-workorder:create')") | |
| 42 | 46 | @Operation(summary = "app-创建快速工单信息") |
| 43 | 47 | public CommonResult<Long> createMainInfoQuick(@Valid @RequestBody AppGardenWorkOrderReqVO createReqVO) { |
| 44 | 48 | return success(gardenService.createWorkOrderQuick(createReqVO)); |
| 45 | 49 | } |
| 46 | 50 | |
| 47 | 51 | @GetMapping("/get") |
| 52 | + //@PreAuthorize("@ss.hasPermission('bpm:garden-workorder:query')") | |
| 48 | 53 | @Operation(summary = "app-获得工单详情") |
| 49 | 54 | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| 50 | - public CommonResult<BpmGardenWorkOrderRespVO> getGardenInspection(@RequestParam("id") Long id) { | |
| 55 | + public CommonResult<AppGardenWorkOrderRespVO> getGardenInspection(@RequestParam("id") Long id) { | |
| 51 | 56 | BpmGardenWorkOrderDO gardenInspection = gardenService.getWorkOrder(id); |
| 52 | - return success(BeanUtils.toBean(gardenInspection, BpmGardenWorkOrderRespVO.class)); | |
| 57 | + return success(BeanUtils.toBean(gardenInspection, AppGardenWorkOrderRespVO.class)); | |
| 53 | 58 | } |
| 54 | 59 | |
| 55 | 60 | @GetMapping("/page") |
| 61 | + //@PreAuthorize("@ss.hasPermission('bpm:garden-workorder:query')") | |
| 56 | 62 | @Operation(summary = "app-获得园林巡检工单申请分页") |
| 57 | - public CommonResult<PageResult<BpmGardenWorkOrderRespVO>> getGardenInspectionPage(@Valid BpmGardenWorkOrderPageReqVO pageVO) { | |
| 63 | + public CommonResult<PageResult<AppGardenWorkOrderRespVO>> getGardenInspectionPage(@Valid AppGardenWorkOrderPageReqVO pageVO) { | |
| 58 | 64 | PageResult<BpmGardenWorkOrderDO> pageResult = gardenService.getGardenInspectionPage(getLoginUserId(), pageVO); |
| 59 | - return success(BeanUtils.toBean(pageResult, BpmGardenWorkOrderRespVO.class)); | |
| 65 | + return success(BeanUtils.toBean(pageResult, AppGardenWorkOrderRespVO.class)); | |
| 60 | 66 | } |
| 61 | 67 | |
| 62 | 68 | } | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/vo/AppGardenWorkOrderPageReqVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.controller.app.garden.vo; | |
| 2 | + | |
| 3 | +import com.zteits.urbanops.framework.common.pojo.PageParam; | |
| 4 | +import com.zteits.urbanops.module.workorder.controller.admin.maininfo.vo.MainInfoPageReqVO; | |
| 5 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 6 | +import lombok.Data; | |
| 7 | + | |
| 8 | +/** | |
| 9 | + * @author yanhuiqing | |
| 10 | + * @version 1.0 | |
| 11 | + * @description: TODO | |
| 12 | + * @date 2025/12/9 20:21 | |
| 13 | + */ | |
| 14 | +@Schema(description = "管理后台 - 工单信息分页 Request VO") | |
| 15 | +@Data | |
| 16 | +public class AppGardenWorkOrderPageReqVO extends MainInfoPageReqVO { | |
| 17 | +} | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/vo/AppGardenWorkOrderReqVO.java
| ... | ... | @@ -36,7 +36,7 @@ public class AppGardenWorkOrderReqVO { |
| 36 | 36 | @Length(max = 500) |
| 37 | 37 | private String remark; |
| 38 | 38 | |
| 39 | - @NotEmpty(message = "经纬度类型") | |
| 39 | + | |
| 40 | 40 | @Schema(description = "经纬度类型: 1:国标; 2:百度;3:高德;4:腾讯", example = "2") |
| 41 | 41 | private Integer latLonType; |
| 42 | 42 | |
| ... | ... | @@ -59,7 +59,7 @@ public class AppGardenWorkOrderReqVO { |
| 59 | 59 | @Schema(description = "工单名称", example = "绿地卫生") |
| 60 | 60 | private String orderName; |
| 61 | 61 | |
| 62 | - @Schema(description = "来源ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 62 | + @Schema(description = "来源ID 工单来源 1、巡查,2、游客居民,3、12345,4、网格", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 63 | 63 | //@NotNull(message = "来源ID不能为空") |
| 64 | 64 | private Integer sourceId; |
| 65 | 65 | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/vo/AppGardenWorkOrderRespVO.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.workorder.controller.app.garden.vo; | |
| 2 | + | |
| 3 | +import com.zteits.urbanops.module.workorder.controller.admin.maininfo.vo.MainInfoRespVO; | |
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 5 | +import lombok.Data; | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * @author yanhuiqing | |
| 9 | + * @version 1.0 | |
| 10 | + * @description: TODO | |
| 11 | + * @date 2025/12/9 20:18 | |
| 12 | + */ | |
| 13 | +@Schema(description = "APP - 园林工单流程 Response VO") | |
| 14 | +@Data | |
| 15 | +public class AppGardenWorkOrderRespVO extends MainInfoRespVO { | |
| 16 | +} | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmGardenService.java
| 1 | 1 | package com.zteits.urbanops.module.workorder.service.garden; |
| 2 | 2 | |
| 3 | 3 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 4 | -import com.zteits.urbanops.module.workorder.controller.admin.garden.vo.BpmGardenWorkOrderCreateReqVo; | |
| 4 | +import com.zteits.urbanops.module.workorder.controller.admin.garden.vo.BpmGardenWorkOrderCreateReqVO; | |
| 5 | 5 | import com.zteits.urbanops.module.workorder.controller.admin.garden.vo.BpmGardenWorkOrderPageReqVO; |
| 6 | +import com.zteits.urbanops.module.workorder.controller.app.garden.vo.AppGardenWorkOrderPageReqVO; | |
| 6 | 7 | import com.zteits.urbanops.module.workorder.controller.app.garden.vo.AppGardenWorkOrderReqVO; |
| 7 | 8 | import com.zteits.urbanops.module.workorder.dal.dataobject.garden.BpmGardenWorkOrderDO; |
| 8 | 9 | import jakarta.validation.Valid; |
| ... | ... | @@ -25,7 +26,7 @@ public interface BpmGardenService { |
| 25 | 26 | * @param createRequestVo |
| 26 | 27 | * @return |
| 27 | 28 | */ |
| 28 | - Long createWorkOrder(Long userId,@Valid BpmGardenWorkOrderCreateReqVo createRequestVo); | |
| 29 | + Long createWorkOrder(Long userId,@Valid BpmGardenWorkOrderCreateReqVO createRequestVo); | |
| 29 | 30 | |
| 30 | 31 | /** |
| 31 | 32 | * 更新工单申请的状态 |
| ... | ... | @@ -49,6 +50,14 @@ public interface BpmGardenService { |
| 49 | 50 | * @param pageVO |
| 50 | 51 | * @return |
| 51 | 52 | */ |
| 53 | + PageResult<BpmGardenWorkOrderDO> getGardenInspectionPage(Long loginUserId, AppGardenWorkOrderPageReqVO pageVO); | |
| 54 | + | |
| 55 | + /** | |
| 56 | + * 获得工单分页数据 | |
| 57 | + * @param loginUserId | |
| 58 | + * @param pageVO | |
| 59 | + * @return | |
| 60 | + */ | |
| 52 | 61 | PageResult<BpmGardenWorkOrderDO> getGardenInspectionPage(Long loginUserId, BpmGardenWorkOrderPageReqVO pageVO); |
| 53 | 62 | |
| 54 | 63 | /** | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmGardenServiceImpl.java
| ... | ... | @@ -8,12 +8,12 @@ import com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils; |
| 8 | 8 | import com.zteits.urbanops.module.bpm.api.task.BpmProcessInstanceApi; |
| 9 | 9 | import com.zteits.urbanops.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO; |
| 10 | 10 | import com.zteits.urbanops.module.bpm.enums.task.BpmTaskStatusEnum; |
| 11 | -import com.zteits.urbanops.module.bpm.service.task.BpmProcessInstanceService; | |
| 12 | 11 | import com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant; |
| 13 | 12 | import com.zteits.urbanops.module.workorder.api.workorder.WorkOrderApi; |
| 14 | -import com.zteits.urbanops.module.workorder.controller.admin.garden.vo.BpmGardenWorkOrderCreateReqVo; | |
| 13 | +import com.zteits.urbanops.module.workorder.controller.admin.garden.vo.BpmGardenWorkOrderCreateReqVO; | |
| 15 | 14 | import com.zteits.urbanops.module.workorder.controller.admin.garden.vo.BpmGardenWorkOrderPageReqVO; |
| 16 | 15 | import com.zteits.urbanops.module.workorder.controller.admin.maininfo.vo.MainInfoPageReqVO; |
| 16 | +import com.zteits.urbanops.module.workorder.controller.app.garden.vo.AppGardenWorkOrderPageReqVO; | |
| 17 | 17 | import com.zteits.urbanops.module.workorder.controller.app.garden.vo.AppGardenWorkOrderReqVO; |
| 18 | 18 | import com.zteits.urbanops.module.workorder.dal.dataobject.attachment.AttachmentDO; |
| 19 | 19 | import com.zteits.urbanops.module.workorder.dal.dataobject.garden.BpmGardenWorkOrderDO; |
| ... | ... | @@ -71,6 +71,8 @@ public class BpmGardenServiceImpl implements BpmGardenService{ |
| 71 | 71 | workOrder.setOrderName("园林工单"); |
| 72 | 72 | workOrder.setCompanyId(SecurityFrameworkUtils.getCompanyId()); |
| 73 | 73 | workOrder.setBusiLine(SecurityFrameworkUtils.getBusiLine()); |
| 74 | + workOrder.setUserId(SecurityFrameworkUtils.getLoginUserId()); | |
| 75 | + workOrder.setUserName(SecurityFrameworkUtils.getLoginUserNickname()); | |
| 74 | 76 | workOrderMapper.insert(workOrder); |
| 75 | 77 | |
| 76 | 78 | //附件插入 |
| ... | ... | @@ -119,7 +121,7 @@ public class BpmGardenServiceImpl implements BpmGardenService{ |
| 119 | 121 | |
| 120 | 122 | @Override |
| 121 | 123 | @Transactional(rollbackFor = Exception.class) |
| 122 | - public Long createWorkOrder(Long userId, BpmGardenWorkOrderCreateReqVo createRequestVo) { | |
| 124 | + public Long createWorkOrder(Long userId, BpmGardenWorkOrderCreateReqVO createRequestVo) { | |
| 123 | 125 | List<String> imgList = createRequestVo.getImgs(); |
| 124 | 126 | List<String> streetImgList = createRequestVo.getStreetImgList(); |
| 125 | 127 | List<String> longRangeImgList = createRequestVo.getLongRangeImgList(); |
| ... | ... | @@ -238,5 +240,13 @@ public class BpmGardenServiceImpl implements BpmGardenService{ |
| 238 | 240 | return targetList; |
| 239 | 241 | } |
| 240 | 242 | |
| 243 | + @Override | |
| 244 | + public PageResult<BpmGardenWorkOrderDO> getGardenInspectionPage(Long loginUserId, AppGardenWorkOrderPageReqVO pageVO) { | |
| 245 | + MainInfoPageReqVO mainInfoPageReqVo = BeanUtils.toBean(pageVO,MainInfoPageReqVO.class); | |
| 246 | + PageResult<MainInfoDO> pageList = workOrderMapper.selectPage(loginUserId, mainInfoPageReqVo); | |
| 247 | + PageResult<BpmGardenWorkOrderDO> targetList = BeanUtils.toBean(pageList,BpmGardenWorkOrderDO.class); | |
| 248 | + return targetList; | |
| 249 | + } | |
| 250 | + | |
| 241 | 251 | |
| 242 | 252 | } | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/listener/BpmQuickProcessTaskAutoCompleteListener.java
| ... | ... | @@ -5,6 +5,7 @@ import com.zteits.urbanops.module.bpm.api.event.BpmProcessInstanceStatusEventLis |
| 5 | 5 | import com.zteits.urbanops.module.workorder.api.constant.BpmCommonConstant; |
| 6 | 6 | import com.zteits.urbanops.module.workorder.service.garden.BpmGardenService; |
| 7 | 7 | import jakarta.annotation.Resource; |
| 8 | +import lombok.extern.slf4j.Slf4j; | |
| 8 | 9 | import org.flowable.common.engine.api.delegate.event.FlowableEngineEntityEvent; |
| 9 | 10 | import org.springframework.stereotype.Component; |
| 10 | 11 | |
| ... | ... | @@ -15,6 +16,7 @@ import org.springframework.stereotype.Component; |
| 15 | 16 | * @date 2025/12/6 14:00 |
| 16 | 17 | */ |
| 17 | 18 | @Component |
| 19 | +@Slf4j | |
| 18 | 20 | public class BpmQuickProcessTaskAutoCompleteListener extends BpmProcessInstanceStatusEventListener { |
| 19 | 21 | @Resource |
| 20 | 22 | private BpmGardenService gardenService; |
| ... | ... | @@ -25,6 +27,7 @@ public class BpmQuickProcessTaskAutoCompleteListener extends BpmProcessInstanceS |
| 25 | 27 | |
| 26 | 28 | @Override |
| 27 | 29 | protected void onEvent(BpmProcessInstanceStatusEvent event) { |
| 30 | + log.info("业务ID:"+event.getBusinessKey()+",业务状态"+event.getStatus()); | |
| 28 | 31 | gardenService.updateWorkOrderStatus(Long.parseLong(event.getBusinessKey()), event.getStatus()); |
| 29 | 32 | |
| 30 | 33 | } | ... | ... |