diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java index f2e9ca6..7940416 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java @@ -249,7 +249,7 @@ public class OperationTicketServiceImpl implements OperationTicketService { businessMessageDTO.setTenantId("200000"); //您有一张工作票待审批,工作内容:*****,审批环节:*****; String countent = - "您有一张工作票待审批,工作内容:".concat(standardTicketInfoEntity.getTitle()) + "您有一张操作票待审批,工作内容:".concat(standardTicketInfoEntity.getTitle()) .concat(",审批环节:") .concat(response.getTaskName()); businessMessageDTO.setContent(countent); diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java index eb971a1..54e263f 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java @@ -36,6 +36,7 @@ import com.hnac.hzims.ticket.workTicket.service.IWorkTicketInfoService; import com.hnac.hzims.ticket.workTicket.vo.TicketMonthVO; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.apache.poi.ss.usermodel.Workbook; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.base.BaseServiceImpl; @@ -112,6 +113,10 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl queryWrapper = this.getQueryWrapper(req); queryWrapper.eq(Func.isNotEmpty(req.getCreateDept()), StandardTicketInfoEntity::getCreateDept, req.getCreateDept()); queryWrapper.orderByDesc(StandardTicketInfoEntity::getCreateTime); + //操作票已完成的数量 + if (StringUtils.isNoneBlank(req.getFlowTaskName())) { + queryWrapper.eq(StandardTicketInfoEntity::getFlowTaskName, req.getFlowTaskName()); + } IPage pages = super.page(Condition.getPage(query), queryWrapper); return R.data(pages.setRecords(StandardTicketInfoWrapper.build().listVO(pages.getRecords()))); } @@ -144,11 +149,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpllambdaUpdate() - .set(StandardTicketInfoEntity::getProcessInstanceId, processInstanceId) - .eq(StandardTicketInfoEntity::getId, req.getId()) - )); + return R.status(this.update(Wrappers.lambdaUpdate().set(StandardTicketInfoEntity::getProcessInstanceId, processInstanceId).eq(StandardTicketInfoEntity::getId, req.getId()))); } @Override @@ -244,9 +245,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpllambdaUpdate() - .set(StandardTicketInfoEntity::getStatus, TicketConstants.StandardTicketStatusEnum.TERMINATION.getStatus()) - .eq(StandardTicketInfoEntity::getId, id)); + this.update(Wrappers.lambdaUpdate().set(StandardTicketInfoEntity::getStatus, TicketConstants.StandardTicketStatusEnum.TERMINATION.getStatus()).eq(StandardTicketInfoEntity::getId, id)); /**删除工作流**/ R r = flowClient.delProcessInstanceById(ticketInfoEntity.getProcessInstanceId(), comment); if (!r.isSuccess()) { @@ -335,23 +334,18 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); //开票来源 - queryWrapper.eq(Func.isNotEmpty(areaVo.getTaskType()), "sti.task_type", - areaVo.getTaskType()); + queryWrapper.eq(Func.isNotEmpty(areaVo.getTaskType()), "sti.task_type", areaVo.getTaskType()); //编号 queryWrapper.like(Func.isNotEmpty(areaVo.getCode()), "sti.code", areaVo.getCode()); //状态 - queryWrapper.eq(Func.isNotEmpty(areaVo.getStatus()), "sti.status", - areaVo.getStatus()); + queryWrapper.eq(Func.isNotEmpty(areaVo.getStatus()), "sti.status", areaVo.getStatus()); //开始时间 - queryWrapper.lt(Func.isNotEmpty(areaVo.getStartTime()), "sti.create_time", - areaVo.getStartTime()); + queryWrapper.lt(Func.isNotEmpty(areaVo.getStartTime()), "sti.create_time", areaVo.getStartTime()); //结束时间 - queryWrapper.le(Func.isNotEmpty(areaVo.getEndTime()), "sti.create_time", - areaVo.getEndTime()); + queryWrapper.le(Func.isNotEmpty(areaVo.getEndTime()), "sti.create_time", areaVo.getEndTime()); queryWrapper.eq("sti.CREATE_DEPT", areaVo.getAreaId()); - queryWrapper.eq(areaVo.getYearMonth() != null, - "date_format(sti.create_time,'%Y-%m')", areaVo.getYearMonth()); + queryWrapper.eq(areaVo.getYearMonth() != null, "date_format(sti.create_time,'%Y-%m')", areaVo.getYearMonth()); // queryWrapper.eq("tie.status",1); Page standardTicketInfoEntityPage = baseMapper.selectPages(searchPage, queryWrapper); @@ -450,8 +444,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl ticketInfoEvaluateEntityLambdaQueryWrapper = new LambdaQueryWrapper<>(); ticketInfoEvaluateEntityLambdaQueryWrapper.eq(TicketInfoEvaluateEntity::getTicketId, item.getId()); - ticketInfoEvaluateEntityLambdaQueryWrapper.eq(TicketInfoEvaluateEntity::getStatus, - TicketConstants.TicketQualifiedEnum.Qualified.getCode()); + ticketInfoEvaluateEntityLambdaQueryWrapper.eq(TicketInfoEvaluateEntity::getStatus, TicketConstants.TicketQualifiedEnum.Qualified.getCode()); int count = ticketInfoEvaluateService.count(ticketInfoEvaluateEntityLambdaQueryWrapper); return count > 0; } @@ -580,9 +573,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl operateTicketReportStatistic = this.baseMapper.getOperateTicketReportStatistic(startDate, endDate, deptIdList); if (CollectionUtil.isNotEmpty(operateTicketReportStatistic)) { //已完成数量 - int ticketInfoCompleteNum = operateTicketReportStatistic.stream().filter(ticket -> TicketConstants.StandardTicketStatusEnum.END.getStatus().equals(ticket.getStatus())) - .collect(Collectors.toList()).size(); + int ticketInfoCompleteNum = operateTicketReportStatistic.stream().filter(ticket -> TicketConstants.StandardTicketStatusEnum.END.getStatus().equals(ticket.getStatus())).collect(Collectors.toList()).size(); //合格数量 int ticketInfoQualifiedNum = operateTicketReportStatistic.stream().filter(ticket -> Func.isNotEmpty(ticket.getEvaluation()) && 1 == ticket.getEvaluation().intValue()).collect(Collectors.toList()).size(); //计算合格率 - double ticketInfoProportion = new BigDecimal(ticketInfoQualifiedNum / (double) operateTicketReportStatistic.size() * 100) - .setScale(2, RoundingMode.HALF_DOWN).doubleValue(); - result = TicketInfoStatisticVO.builder() - .ticketInfoType("操作票") - .ticketInfoNumber(operateTicketReportStatistic.size()) - .ticketInfoCompleteNum(ticketInfoCompleteNum) - .ticketInfoQualifiedNum(ticketInfoQualifiedNum) - .ticketInfoStartNum(operateTicketReportStatistic.size() - ticketInfoCompleteNum) - .ticketInfoProportion(ticketInfoProportion) - .build(); + double ticketInfoProportion = new BigDecimal(ticketInfoQualifiedNum / (double) operateTicketReportStatistic.size() * 100).setScale(2, RoundingMode.HALF_DOWN).doubleValue(); + result = TicketInfoStatisticVO.builder().ticketInfoType("操作票").ticketInfoNumber(operateTicketReportStatistic.size()).ticketInfoCompleteNum(ticketInfoCompleteNum).ticketInfoQualifiedNum(ticketInfoQualifiedNum).ticketInfoStartNum(operateTicketReportStatistic.size() - ticketInfoCompleteNum).ticketInfoProportion(ticketInfoProportion).build(); } return result; } @@ -712,7 +694,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl selectStandardTicketByDeptIdWithTicketType(List createDept, String ticketType, String dateTime) { QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.lambda().eq(StandardTicketInfoEntity::getTicketType, ticketType); - if (CollectionUtils.isNotEmpty(createDept)){ + if (CollectionUtils.isNotEmpty(createDept)) { queryWrapper.lambda().in(StandardTicketInfoEntity::getCreateDept, createDept); } queryWrapper.apply("date_format(CREATE_TIME,'%Y-%m') = {0}", dateTime); diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java index e1333c2..d153b8d 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java @@ -242,7 +242,10 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl pages = this.page(Condition.getPage(query), lqw); //数据转换