From 2e9157810a85e66fc56bdc6ebef0a37c193640b9 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Mon, 28 Oct 2024 16:22:50 +0800 Subject: [PATCH] =?UTF-8?q?#app=E9=A6=96=E9=A1=B5=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/request/AccessTicketPageReqDTO.java | 3 + .../dto/request/AccessTicketTaskCountReqDTO.java | 22 +++++ .../feign/AccessTicketClientFallback.java | 10 +++ .../accessTicket/feign/IAccessTicketClient.java | 13 +++ .../accessTicket/vo/AccessTicketTaskCountVo.java | 17 ++++ .../main/controller/HydropowerController.java | 7 ++ .../main/service/HydropowerService.java | 2 + .../main/service/impl/HydropowerServiceImpl.java | 97 ++++++++++++++++++++++ .../hnac/hzims/operational/main/vo/AppTaskVo.java | 38 +++++++++ .../controller/AccessTicketController.java | 37 +++++++-- .../accessTicket/feign/AccessTicketClient.java | 15 +++- .../accessTicket/mapper/AccessTicketMapper.xml | 3 + .../accessTicket/service/AccessTicketService.java | 4 + .../service/impl/AccessTicketServiceImpl.java | 26 ++++++ 14 files changed, 286 insertions(+), 8 deletions(-) create mode 100644 hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/dto/request/AccessTicketTaskCountReqDTO.java create mode 100644 hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/vo/AccessTicketTaskCountVo.java create mode 100644 hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/vo/AppTaskVo.java diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/dto/request/AccessTicketPageReqDTO.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/dto/request/AccessTicketPageReqDTO.java index 50db863..6e898c0 100644 --- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/dto/request/AccessTicketPageReqDTO.java +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/dto/request/AccessTicketPageReqDTO.java @@ -16,4 +16,7 @@ public class AccessTicketPageReqDTO implements Serializable { @ApiModelProperty("结束时间 : YYYY-MM-DD HH:MM:SS") private String endTime; + + @ApiModelProperty("过滤未完成任务:false-全部任务 true-过滤未完成任务") + private Boolean isComplete; } \ No newline at end of file diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/dto/request/AccessTicketTaskCountReqDTO.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/dto/request/AccessTicketTaskCountReqDTO.java new file mode 100644 index 0000000..1512ff8 --- /dev/null +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/dto/request/AccessTicketTaskCountReqDTO.java @@ -0,0 +1,22 @@ +package com.hnac.hzims.ticket.accessTicket.dto.request; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @author ysj + */ +@Data +public class AccessTicketTaskCountReqDTO { + + @ApiModelProperty("开始时间 : YYYY-MM-DD HH:MM:SS") + private String startTime; + + @ApiModelProperty("结束时间 : YYYY-MM-DD HH:MM:SS") + private String endTime; + + @ApiModelProperty("过滤未完成任务:false-全部任务 true-过滤未完成任务") + private List depts; +} \ No newline at end of file diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/feign/AccessTicketClientFallback.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/feign/AccessTicketClientFallback.java index e041791..07d112f 100644 --- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/feign/AccessTicketClientFallback.java +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/feign/AccessTicketClientFallback.java @@ -1,8 +1,13 @@ package com.hnac.hzims.ticket.accessTicket.feign; import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; +import com.hnac.hzims.ticket.accessTicket.dto.request.AccessTicketTaskCountReqDTO; +import com.hnac.hzims.ticket.accessTicket.vo.AccessTicketTaskCountVo; import org.springblade.core.tool.api.R; import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; /** * @author ysj @@ -14,4 +19,9 @@ public class AccessTicketClientFallback implements IAccessTicketClient { public R listener(ProcessWorkFlowResponse processWorkFlowResponse) { return R.fail("执行失败!"); } + + @Override + public R taskCount(AccessTicketTaskCountReqDTO param) { + return R.data(new AccessTicketTaskCountVo()); + } } \ No newline at end of file diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/feign/IAccessTicketClient.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/feign/IAccessTicketClient.java index 15cb841..1357974 100644 --- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/feign/IAccessTicketClient.java +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/feign/IAccessTicketClient.java @@ -1,12 +1,19 @@ package com.hnac.hzims.ticket.accessTicket.feign; import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; +import com.hnac.hzims.ticket.accessTicket.dto.request.AccessTicketTaskCountReqDTO; +import com.hnac.hzims.ticket.accessTicket.vo.AccessTicketTaskCountVo; import com.hnac.hzims.ticket.allTicket.fegin.TicketInfoAllClientFallback; import com.hnac.hzims.ticket.constants.TicketConstants; +import org.apache.ibatis.annotations.Param; import org.springblade.core.tool.api.R; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; + +import java.util.List; /** * @author ysj @@ -21,6 +28,12 @@ public interface IAccessTicketClient { String ACCESS_TICKET_PROCESS_LISTENER = API_PREFIX + "/listener"; + String ACCESS_TICKET_TASK_COUNT = API_PREFIX + "/taskCount"; + @PostMapping(ACCESS_TICKET_PROCESS_LISTENER) R listener(@RequestBody ProcessWorkFlowResponse processWorkFlowResponse); + + + @PostMapping(ACCESS_TICKET_TASK_COUNT) + R taskCount(@RequestBody AccessTicketTaskCountReqDTO param); } \ No newline at end of file diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/vo/AccessTicketTaskCountVo.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/vo/AccessTicketTaskCountVo.java new file mode 100644 index 0000000..3922b16 --- /dev/null +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/vo/AccessTicketTaskCountVo.java @@ -0,0 +1,17 @@ +package com.hnac.hzims.ticket.accessTicket.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author ysj + */ +@Data +public class AccessTicketTaskCountVo { + + @ApiModelProperty("任务总数") + private Integer taskTotal; + + @ApiModelProperty("未完成任务数") + private Integer taskIncomplete; +} \ No newline at end of file diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/HydropowerController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/HydropowerController.java index 43bf82e..f056a1e 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/HydropowerController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/HydropowerController.java @@ -93,4 +93,11 @@ public class HydropowerController extends BladeController { public R areaDuty(@ApiParam(value = "站点机构ID") Long deptId) { return R.data(service.areaDuty(deptId)); } + + @ApiOperation("app当月日常维护、巡检、检修报单") + @GetMapping("/app/task") + @ApiOperationSupport(order = 8) + public R task(@ApiParam(value = "站点机构ID") Long deptId) { + return R.data(service.task(deptId)); + } } \ No newline at end of file diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/HydropowerService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/HydropowerService.java index b0dd028..d8af364 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/HydropowerService.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/HydropowerService.java @@ -24,4 +24,6 @@ public interface HydropowerService { List area(Long deptId); AppAreaDutyVo areaDuty(Long deptId); + + AppTaskVo task(Long deptId); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java index 1d305c2..8715d19 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java @@ -28,6 +28,9 @@ import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity; import com.hnac.hzims.operational.maintenance.service.IOperMaintenanceTaskService; import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.service.IStationService; +import com.hnac.hzims.ticket.accessTicket.dto.request.AccessTicketTaskCountReqDTO; +import com.hnac.hzims.ticket.accessTicket.feign.IAccessTicketClient; +import com.hnac.hzims.ticket.accessTicket.vo.AccessTicketTaskCountVo; import com.hnac.hzims.ticket.workTicket.feign.ITicketInfoClient; import com.hnac.hzims.ticket.workTicket.vo.TicketMonthVO; import com.hnac.hzinfo.datasearch.soe.ISoeClient; @@ -98,6 +101,8 @@ public class HydropowerServiceImpl implements HydropowerService { private final ITicketInfoClient ticketInfoClient; + private final IAccessTicketClient accessTicketClient; + private final IPlanGenertionClient planGenertionClient; private final IInspectTaskReportClient inspectTaskReportClient; @@ -1684,4 +1689,96 @@ public class HydropowerServiceImpl implements HydropowerService { } return builder.substring(0,builder.toString().length() - 1); } + + /** + * app当月日常维护、巡检、检修报单 + * @param deptId + * @return + */ + @Override + public AppTaskVo task(Long deptId) { + // 参数 + if(ObjectUtil.isEmpty(deptId)){ + deptId = Long.valueOf(AuthUtil.getDeptId()); + } + Calendar calendar = Calendar.getInstance(); + String endTime = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME); + calendar.add(Calendar.MONTH,-calendar.get(Calendar.MONTH)); + calendar.add(Calendar.DAY_OF_MONTH,-calendar.get(Calendar.DAY_OF_MONTH)); + calendar.add(Calendar.HOUR_OF_DAY,-calendar.get(Calendar.HOUR_OF_DAY)); + calendar.add(Calendar.MINUTE,-calendar.get(Calendar.MINUTE)); + calendar.add(Calendar.SECOND,-calendar.get(Calendar.SECOND)); + String startTime = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME); + List depts = Collections.singletonList(deptId); + + // 查询数据 + AppTaskVo task = new AppTaskVo(); + ThreadFactory namedThreadFactory = new ThreadFactoryBuilder().setNameFormat("month-task-pool-%d").build(); + ExecutorService pool = new ThreadPoolExecutor(3, 3, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(256), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy()); + CountDownLatch countDownLatch = new CountDownLatch(3); + // 巡检 + pool.execute(()-> { + // 查询当班巡检任务 + task.setInspectionTaskCount(0); + task.setNotInspectionTaskCount(0); + Map params = new HashMap<>(); + params.put("startDate",startTime); + params.put("endDate",endTime); + params.put("deptList",depts); + R response = inspectTaskReportClient.getDutyInspectTask(params); + if(!response.isSuccess() || ObjectUtil.isEmpty(response.getData())){ + countDownLatch.countDown(); + return; + } + // 赋值 + task.setInspectionTaskCount(response.getData().getInspectTaskSum()); + task.setInspectionTaskCount(response.getData().getNotExecuteTaskCount()); + countDownLatch.countDown(); + }); + // 维护 + pool.execute(()-> { + task.setMaintenanceTaskCount(0); + task.setNotMaintenanceTaskCount(0); + // 查询当班日常维护任务 + List list = operMaintenanceTaskService.getMaintenanceTask(startTime, endTime, depts); + if(CollectionUtil.isEmpty(list)){ + countDownLatch.countDown(); + return; + } + // 总数 + task.setMaintenanceTaskCount(list.size()); + // 完成数 + int notMaintenanceTaskCount = (int) list.stream().filter(o-> !"结束".equals(o.getFlowTaskName())).count(); + task.setNotMaintenanceTaskCount(notMaintenanceTaskCount); + countDownLatch.countDown(); + }); + + // 检修报单 + pool.execute(()-> { + task.setAccessTaskCount(0); + task.setNotAccessTaskCount(0); + AccessTicketTaskCountReqDTO param = new AccessTicketTaskCountReqDTO(); + param.setStartTime(startTime); + param.setEndTime(endTime); + param.setDepts(depts); + R access = accessTicketClient.taskCount(param); + if(!access.isSuccess() || ObjectUtil.isEmpty(access.getData())){ + countDownLatch.countDown(); + return; + } + task.setAccessTaskCount(access.getData().getTaskTotal()); + task.setNotAccessTaskCount(access.getData().getTaskIncomplete()); + countDownLatch.countDown(); + }); + // 等待所有线程执行完成 + try { + countDownLatch.await(); + } catch (InterruptedException e) { + e.printStackTrace(); + Thread.currentThread().interrupt(); + } + pool.shutdown(); + return task; + } + } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/vo/AppTaskVo.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/vo/AppTaskVo.java new file mode 100644 index 0000000..e020400 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/vo/AppTaskVo.java @@ -0,0 +1,38 @@ +package com.hnac.hzims.operational.main.vo; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.NullSerializer; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * APP首页-当班数据 + * @author ysj + */ +@Data +public class AppTaskVo { + + @ApiModelProperty("巡检任务总数") + @JsonSerialize(nullsUsing = NullSerializer.class) + private Integer inspectionTaskCount; + + @ApiModelProperty("巡检未完成数") + @JsonSerialize(nullsUsing = NullSerializer.class) + private Integer notInspectionTaskCount; + + @ApiModelProperty("日常维护任务总数") + @JsonSerialize(nullsUsing = NullSerializer.class) + private Integer maintenanceTaskCount; + + @ApiModelProperty("日常维护任务未完成数") + @JsonSerialize(nullsUsing = NullSerializer.class) + private Integer notMaintenanceTaskCount; + + @ApiModelProperty("检修报单任务总数") + @JsonSerialize(nullsUsing = NullSerializer.class) + private Integer accessTaskCount; + + @ApiModelProperty("检修报单未完成数") + @JsonSerialize(nullsUsing = NullSerializer.class) + private Integer notAccessTaskCount; +} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/controller/AccessTicketController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/controller/AccessTicketController.java index 0b067ec..3f0f4fe 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/controller/AccessTicketController.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/controller/AccessTicketController.java @@ -33,13 +33,32 @@ public class AccessTicketController extends BladeController { private final AccessTicketService accessTicketService; + + @GetMapping("/externalStartProcess") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "外部发起检修工作票流程") + public R externalStartProcess(@RequestParam("isExternal")Integer isExternal, + @RequestParam("isEmergency")Integer isEmergency, + @RequestParam("deviceCode")String deviceCode, + @RequestParam("faultDescribe")String faultDescribe, + @RequestParam(value = "imgs",required = false)List imgs, + @RequestParam(value = "videos",required = false)List videos) { + AccessTicketStartProcessReqDTO param = new AccessTicketStartProcessReqDTO(); + param.setIsExternal(isExternal); + param.setIsEmergency(isEmergency); + param.setDeviceCode(deviceCode); + param.setFaultDescribe(faultDescribe); + param.setImgs(imgs); + param.setVideos(videos); + return R.status(accessTicketService.startProcess(param)); + } + @PostMapping("/startProcess") @ApiOperationSupport(order = 1) @ApiOperation(value = "检修工作票流程开启") public R startProcess(@RequestBody AccessTicketStartProcessReqDTO param) { return R.status(accessTicketService.startProcess(param)); } - @GetMapping("/page") @ApiOperationSupport(order = 2) @@ -48,29 +67,37 @@ public class AccessTicketController extends BladeController { return R.data(accessTicketService.pageCondition(param,query)); } - @PostMapping("/detail") + @GetMapping("/list") @ApiOperationSupport(order = 3) + @ApiOperation(value = "app端任务列表") + public R> list(AccessTicketPageReqDTO param,Query query) { + param.setIsComplete(true); + return R.data(accessTicketService.pageCondition(param,query)); + } + + @PostMapping("/detail") + @ApiOperationSupport(order = 4) @ApiOperation(value = "检修工作票详情信息") public R pageCondition(@RequestBody AccessTicketDetailReqDTO param) { return R.data(accessTicketService.detail(param)); } @GetMapping(value = "/preview") - @ApiOperationSupport(order = 4) + @ApiOperationSupport(order = 5) @ApiOperation(value = "检修工作票预览") public void preview(@RequestParam("id") Long id ) { accessTicketService.preview(id); } @GetMapping("/revoke") - @ApiOperationSupport(order = 5) + @ApiOperationSupport(order = 6) @ApiOperation(value = "撤销报修") public R revoke(@RequestParam("ticketId") Long ticketId) { return R.status(accessTicketService.revoke(ticketId)); } @GetMapping("/roleQueryUser") - @ApiOperationSupport(order = 5) + @ApiOperationSupport(order = 7) @ApiOperation(value = "撤销报修") public R> roleQueryUser(@RequestParam("roleAlias") String roleAlias) { return R.data(accessTicketService.roleQueryUser(roleAlias)); diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/feign/AccessTicketClient.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/feign/AccessTicketClient.java index 3b1b95c..3286156 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/feign/AccessTicketClient.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/feign/AccessTicketClient.java @@ -1,13 +1,16 @@ package com.hnac.hzims.ticket.accessTicket.feign; import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; +import com.hnac.hzims.ticket.accessTicket.dto.request.AccessTicketTaskCountReqDTO; import com.hnac.hzims.ticket.accessTicket.service.AccessTicketService; +import com.hnac.hzims.ticket.accessTicket.vo.AccessTicketTaskCountVo; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.ibatis.annotations.Param; import org.springblade.core.tool.api.R; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import java.util.List; /** * @author ysj @@ -24,4 +27,10 @@ public class AccessTicketClient implements IAccessTicketClient { public R listener(@RequestBody ProcessWorkFlowResponse processWorkFlowResponse) { return R.status(accessTicketService.listener(processWorkFlowResponse)); } + + @Override + @PostMapping(ACCESS_TICKET_TASK_COUNT) + public R taskCount(@RequestBody AccessTicketTaskCountReqDTO param) { + return R.data(accessTicketService.taskCount(param)); + } } \ No newline at end of file diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/mapper/AccessTicketMapper.xml b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/mapper/AccessTicketMapper.xml index c4a3cec..f252660 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/mapper/AccessTicketMapper.xml +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/mapper/AccessTicketMapper.xml @@ -12,6 +12,9 @@ AND CREATE_TIME <= #{param.endTime} + + AND TASK_NAME = '流程结束' + ORDER BY CREATE_TIME DESC diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/service/AccessTicketService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/service/AccessTicketService.java index bbd6b08..fc5480f 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/service/AccessTicketService.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/service/AccessTicketService.java @@ -6,9 +6,11 @@ import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; import com.hnac.hzims.ticket.accessTicket.dto.request.AccessTicketDetailReqDTO; import com.hnac.hzims.ticket.accessTicket.dto.request.AccessTicketPageReqDTO; import com.hnac.hzims.ticket.accessTicket.dto.request.AccessTicketStartProcessReqDTO; +import com.hnac.hzims.ticket.accessTicket.dto.request.AccessTicketTaskCountReqDTO; import com.hnac.hzims.ticket.accessTicket.dto.response.AccessTicketDetailRspDTO; import com.hnac.hzims.ticket.accessTicket.dto.response.AccessTicketPageRspDTO; import com.hnac.hzims.ticket.accessTicket.entity.AccessTicketEntity; +import com.hnac.hzims.ticket.accessTicket.vo.AccessTicketTaskCountVo; import org.springblade.core.mp.support.Query; import org.springblade.system.user.entity.User; @@ -33,4 +35,6 @@ public interface AccessTicketService extends IService { void preview(Long id); List roleQueryUser(String roleAlias); + + AccessTicketTaskCountVo taskCount(AccessTicketTaskCountReqDTO param); } \ No newline at end of file diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/service/impl/AccessTicketServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/service/impl/AccessTicketServiceImpl.java index 048cc0f..01bf92b 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/service/impl/AccessTicketServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/service/impl/AccessTicketServiceImpl.java @@ -14,6 +14,7 @@ import com.hnac.hzims.ticket.accessTicket.constants.AccessTicketConstants; import com.hnac.hzims.ticket.accessTicket.dto.request.AccessTicketDetailReqDTO; import com.hnac.hzims.ticket.accessTicket.dto.request.AccessTicketPageReqDTO; import com.hnac.hzims.ticket.accessTicket.dto.request.AccessTicketStartProcessReqDTO; +import com.hnac.hzims.ticket.accessTicket.dto.request.AccessTicketTaskCountReqDTO; import com.hnac.hzims.ticket.accessTicket.dto.response.AccessTicketDetailRspDTO; import com.hnac.hzims.ticket.accessTicket.dto.response.AccessTicketPageRspDTO; import com.hnac.hzims.ticket.accessTicket.entity.AccessTicketEntity; @@ -21,6 +22,7 @@ import com.hnac.hzims.ticket.accessTicket.mapper.AccessTicketMapper; import com.hnac.hzims.ticket.accessTicket.service.AccessTicketService; import com.hnac.hzims.ticket.accessTicket.vo.AccessTicketMeasureVo; import com.hnac.hzims.ticket.accessTicket.vo.AccessTicketPreviewVo; +import com.hnac.hzims.ticket.accessTicket.vo.AccessTicketTaskCountVo; import com.hnac.hzims.ticket.utils.AsposeUtil; import com.hnac.hzims.ticket.utils.PdfUtils; import com.hnac.hzims.ticket.utils.WordUtils; @@ -485,4 +487,28 @@ public class AccessTicketServiceImpl extends ServiceImpl entitys = this.list(Wrappers.lambdaQuery() + .ge(AccessTicketEntity::getCreateTime,param.getStartTime()) + .le(AccessTicketEntity::getCreateTime,param.getEndTime()) + .in(AccessTicketEntity::getCreateDept,param.getDepts()) + ); + log.info("task_count: {}",entitys); + if(CollectionUtil.isEmpty(entitys)){ + return task; + } + task.setTaskTotal(entitys.size()); + task.setTaskIncomplete((int) entitys.stream().filter(o->!"流程结束".equals(o.getTaskName())).count()); + return task; + } } \ No newline at end of file