From 20667c6a6a6141aace7dbc3bb3d6496efed62fa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B5=E9=A3=9E=E5=AE=87?= <2684146481@qq.com> Date: Mon, 24 Jul 2023 16:56:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=A4=E7=A5=A8=E7=BB=9F=E8=AE=A1=E5=88=86?= =?UTF-8?q?=E6=9E=90=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/StatisticsServiceImpl.java | 6 +- .../hzims/middle/systemlog/vo/StatisticsVo.java | 6 +- .../service/IStandardTicketInfoService.java | 9 ++ .../service/OperationTicketService.java | 5 + .../impl/StandardTicketInfoServiceImpl.java | 37 +++++++ .../controller/TicketCountController.java | 38 ++++++- .../hzims/ticket/twoTicket/entity/TicketCount.java | 17 +++- .../service/impl/TicketCountServiceImpl.java | 51 ++++++++-- .../service/impl/TicketProcessServiceImpl.java | 8 +- .../ticket/twoTicket/vo/TicketCountQueryVo.java | 34 +++++++ .../twoTicket/vo/ticket/TicketCountResponseVo.java | 112 ++++++++++++++++++--- .../ticket/twoTicket/vo/ticket/TicketCountVo.java | 3 + .../workTicket/service/IWorkTicketInfoService.java | 9 ++ .../service/impl/WorkTicketInfoServiceImpl.java | 53 +++++++++- .../ticket/src/main/resources/db/2.0.2.sql | 1 + .../ticket/src/main/resources/db/2.0.3.sql | 18 ++++ .../ticket/src/main/resources/db/2.0.4.sql | 2 + 17 files changed, 371 insertions(+), 38 deletions(-) create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/TicketCountQueryVo.java create mode 100644 hzims-service/ticket/src/main/resources/db/2.0.2.sql create mode 100644 hzims-service/ticket/src/main/resources/db/2.0.3.sql create mode 100644 hzims-service/ticket/src/main/resources/db/2.0.4.sql diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/StatisticsServiceImpl.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/StatisticsServiceImpl.java index e6c9baa..6c0b0eb 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/StatisticsServiceImpl.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/StatisticsServiceImpl.java @@ -13,6 +13,7 @@ import com.hnac.hzims.middle.systemlog.vo.StatisticsVo; import com.hnac.hzims.middle.systemlog.vo.SysLogStatisticsVo; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import org.apache.xmlbeans.StringEnumAbstractBase; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -91,6 +92,9 @@ public class StatisticsServiceImpl extends ServiceImpl selectPage(Page page1, StatisticsVo statistics) { - return baseMapper.selectPages(page1,statistics); + statistics.setCreateTime(statistics.getCreateTime().substring(0, 10)); + statistics.setEndTime(statistics.getEndTime().substring(0, 10)); + return baseMapper.selectPages(page1, statistics); } + } diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/vo/StatisticsVo.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/vo/StatisticsVo.java index c681256..9d3cdfa 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/vo/StatisticsVo.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/vo/StatisticsVo.java @@ -20,7 +20,7 @@ public class StatisticsVo { /** * key */ - public String keyword; + private String keyword; /** @@ -34,7 +34,7 @@ public class StatisticsVo { * 开始时间 */ //@JsonFormat(pattern="yyyy-MM-dd",shape = JsonFormat.Shape.STRING) - @DateTimeFormat(pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private String createTime; /** @@ -42,7 +42,7 @@ public class StatisticsVo { * */ //@JsonFormat(pattern="yyyy-MM-dd",shape = JsonFormat.Shape.STRING) - @DateTimeFormat(pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private String endTime; } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketInfoService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketInfoService.java index 9ba86e3..99267e8 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketInfoService.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketInfoService.java @@ -9,6 +9,7 @@ import com.hnac.hzims.ticket.areamonthly.vo.StandardTicketWithAreaVo; import com.hnac.hzims.ticket.standardTicket.dto.StandardTicketInfoDto; import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity; import com.hnac.hzims.ticket.standardTicket.vo.StandardTicketInfoVO; +import com.hnac.hzims.ticket.twoTicket.vo.TicketCountQueryVo; import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketInfoVo; import com.hnac.hzims.ticket.workTicket.vo.TicketMonthVO; import org.springblade.core.mp.base.BaseService; @@ -126,4 +127,12 @@ public interface IStandardTicketInfoService extends BaseService selectStandardTicketByDeptIdWithTicketType(List createDept, String ticketType, String dateTime); + + + /** + * 查看操作票 + * @param ticketCountQueryVo + * @return + */ + List listByOperationTicketWithKeyword(TicketCountQueryVo ticketCountQueryVo); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/OperationTicketService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/OperationTicketService.java index 4d5df20..d2c2a7c 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/OperationTicketService.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/OperationTicketService.java @@ -2,6 +2,7 @@ package com.hnac.hzims.ticket.standardTicket.service; import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; +import com.hnac.hzims.ticket.twoTicket.vo.TicketCountQueryVo; import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketInfoVo; import javax.servlet.http.HttpServletResponse; @@ -36,4 +37,8 @@ public interface OperationTicketService { * @param response 扩展 ServletResponse 接口以在发送响应时提供特定于 HTTP 的功能。例如,它具有访问HTTP标头和cookie的方法。 */ void newPreview(Long ticketId, Integer status, HttpServletResponse response); + + + + } 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 54e263f..2e0cf6e 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 @@ -27,6 +27,7 @@ import com.hnac.hzims.ticket.standardTicket.vo.OperateTicketStatisticVO; import com.hnac.hzims.ticket.standardTicket.vo.StandardTicketInfoVO; import com.hnac.hzims.ticket.standardTicket.vo.StandardTicketMeasureVO; import com.hnac.hzims.ticket.standardTicket.wrapper.StandardTicketInfoWrapper; +import com.hnac.hzims.ticket.twoTicket.vo.TicketCountQueryVo; import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketInfoVo; import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketMeasureVo; import com.hnac.hzims.ticket.utils.ExcelUtil; @@ -39,6 +40,7 @@ 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.BaseEntity; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.support.BladePage; import org.springblade.core.mp.support.Condition; @@ -700,4 +702,39 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl listByOperationTicketWithKeyword(TicketCountQueryVo ticketCountQueryVo) { + String flowTaskName = ticketCountQueryVo.getFlowTaskName(); + String type = ticketCountQueryVo.getType(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(StringUtils.isNotBlank(type), StandardTicketInfoEntity::getTicketType, type); + if (StringUtils.isNotEmpty(flowTaskName)) { + if ("开票".equals(flowTaskName)) { + queryWrapper.lambda().isNotNull(StandardTicketInfoEntity::getFlowTaskName); + } else { + queryWrapper.lambda().eq(StandardTicketInfoEntity::getFlowTaskName, flowTaskName); + } + } + String qualified = ticketCountQueryVo.getQualified(); + if (StringUtils.isNoneBlank(qualified) && "合格".equals(qualified)) { + List workTicketInfoEntities = baseMapper.selectList(null); + List ticketIdList = workTicketInfoEntities.stream().map(BaseEntity::getId).collect(Collectors.toList()); + LambdaQueryWrapper evaluateEntityLambdaQueryWrapper = new LambdaQueryWrapper<>(); + evaluateEntityLambdaQueryWrapper.in(TicketInfoEvaluateEntity::getTicketId, ticketIdList); + evaluateEntityLambdaQueryWrapper.eq(BaseEntity::getStatus, 1); + List evaluateEntities = ticketInfoEvaluateService.list(evaluateEntityLambdaQueryWrapper); + List idList = + evaluateEntities.stream().map(TicketInfoEvaluateEntity::getTicketId).collect(Collectors.toList()); + queryWrapper.lambda().in(BaseEntity::getId, idList); + } + return baseMapper.selectList(queryWrapper); + } } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketCountController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketCountController.java index f757ac2..d8c653b 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketCountController.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketCountController.java @@ -1,9 +1,16 @@ package com.hnac.hzims.ticket.twoTicket.controller; import cn.hutool.http.server.HttpServerResponse; +import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity; +import com.hnac.hzims.ticket.standardTicket.service.IStandardTicketInfoService; +import com.hnac.hzims.ticket.standardTicket.service.OperationTicketService; +import com.hnac.hzims.ticket.twoTicket.service.IFirstWorkTicketService; import com.hnac.hzims.ticket.twoTicket.service.TicketCountService; +import com.hnac.hzims.ticket.twoTicket.vo.TicketCountQueryVo; import com.hnac.hzims.ticket.twoTicket.vo.ticket.TicketCountResponseVo; import com.hnac.hzims.ticket.twoTicket.vo.ticket.TicketCountVo; +import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; +import com.hnac.hzims.ticket.workTicket.service.IWorkTicketInfoService; import lombok.RequiredArgsConstructor; import org.springblade.core.tool.api.R; import org.springframework.web.bind.annotation.*; @@ -28,6 +35,12 @@ public class TicketCountController { private final TicketCountService ticketCountService; + private final IWorkTicketInfoService workTicketService; + + + private final IStandardTicketInfoService standardTicketInfoService; + + /** * 两票生成月报统计 * @@ -53,13 +66,36 @@ public class TicketCountController { /** * 两票统计分析导出 + * * @param dateTime 月份 */ @GetMapping("/export") public R export(String dateTime, HttpServletResponse response) { - ticketCountService.exportTicketCount(dateTime,response); + ticketCountService.exportTicketCount(dateTime, response); return R.success("导出成功"); } + /** + * 查看工作票 + */ + @GetMapping("/listByTicketWithKeyword") + public R listByTicketWithKeyword(TicketCountQueryVo ticketCountQueryVo) { + List workTicketInfoEntities = + workTicketService.listByTicketWithKeyword(ticketCountQueryVo); + return R.data(workTicketInfoEntities); + } + + + /** + * 查看操作票 + */ + @GetMapping("/listByOperationTicketWithKeyword") + public R listByOperationTicketWithKeyword(TicketCountQueryVo ticketCountQueryVo) { + List ticketInfoEntities = + standardTicketInfoService.listByOperationTicketWithKeyword(ticketCountQueryVo); + return R.data(ticketInfoEntities); + } + + } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/entity/TicketCount.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/entity/TicketCount.java index ca2f54c..8ace440 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/entity/TicketCount.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/entity/TicketCount.java @@ -23,7 +23,7 @@ import java.time.YearMonth; @Accessors(chain = true) @EqualsAndHashCode @TableName("hzims_ticket_count") -public class TicketCount extends TenantEntity implements Serializable { +public class TicketCount extends TenantEntity implements Serializable { /** @@ -73,4 +73,19 @@ public class TicketCount extends TenantEntity implements Serializable { */ private Integer ticketProportionNum; + /** + * 废票数量 + */ + private Integer invalidatedTicketNum; + + /** + * 错票数量 + */ + private Integer wrongTicketNum; + + /** + * 合格率 + */ + private String percentPassTicket; + } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketCountServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketCountServiceImpl.java index 950a486..f7eb744 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketCountServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketCountServiceImpl.java @@ -27,6 +27,7 @@ import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.math.NumberUtils; import org.apache.poi.ss.usermodel.BorderStyle; import org.apache.poi.ss.usermodel.HorizontalAlignment; import org.apache.poi.ss.usermodel.VerticalAlignment; @@ -149,9 +150,11 @@ public class TicketCountServiceImpl extends BaseServiceImpl ticketCountQueryWrapper = new QueryWrapper<>(); ticketCountQueryWrapper.like(StringUtils.isNotBlank(keyword), "dept_name", keyword); ticketCountQueryWrapper.eq(StringUtils.isNotBlank(dateTime), "date_time", dateTime); + ticketCountQueryWrapper.eq(StringUtils.isNotBlank(deptId), "dept_id", deptId); List ticketCounts = baseMapper.selectList(ticketCountQueryWrapper); List result = getTicketCountResponseList(ticketCounts); return result; @@ -330,6 +333,8 @@ public class TicketCountServiceImpl extends BaseServiceImpl> createDeptTickets = ticketInfoEntities.stream().collect(Collectors.groupingBy(StandardTicketInfoEntity::getCreateDept)); + Map> createDeptTickets = + ticketInfoEntities.stream().collect(Collectors.groupingBy(StandardTicketInfoEntity::getSignageCode)); //获取 操作票的id,删除 if (CollectionUtils.isNotEmpty(items)) { List collect = @@ -391,19 +406,19 @@ public class TicketCountServiceImpl extends BaseServiceImpl>> entries = createDeptTickets.entrySet(); + Set>> entries = createDeptTickets.entrySet(); List ticketCountList = new ArrayList<>(); - for (Map.Entry> entry : entries) { + for (Map.Entry> entry : entries) { TicketCount ticketCount = new TicketCount(); ticketCount.setDateTime(dateTime); - ticketCount.setDeptId(entry.getKey()); ticketCount.setTenantId(user.getTenantId()); ticketCount.setCreateDept(Long.valueOf(user.getDeptId())); ticketCount.setCreateUser(user.getUserId()); log.info("getStandardTicketCountList entry.getKey() ================================================> " + entry.getKey()); if (ObjectUtils.isNotEmpty(entry.getKey())) { + ticketCount.setDeptId(NumberUtils.toLong(entry.getKey())); //根据id获取部门名称 - R deptName = systemClient.getDeptName(entry.getKey()); + R deptName = systemClient.getDeptName(NumberUtils.toLong(entry.getKey())); if (deptName.isSuccess()) { ticketCount.setDeptName(deptName.getData() == null ? "" : deptName.getData()); } @@ -452,7 +467,8 @@ public class TicketCountServiceImpl extends BaseServiceImpl> createDeptTickets = ticketInfoEntities.stream().collect(Collectors.groupingBy(BaseEntity::getCreateDept)); + Map> createDeptTickets = + ticketInfoEntities.stream().collect(Collectors.groupingBy(WorkTicketInfoEntity::getSignageCode)); if (CollectionUtils.isNotEmpty(items)) { //获取工作票的id,删除 List collect = @@ -461,17 +477,17 @@ public class TicketCountServiceImpl extends BaseServiceImpl>> entries = createDeptTickets.entrySet(); + Set>> entries = createDeptTickets.entrySet(); List ticketCountList = new ArrayList<>(); - for (Map.Entry> entry : entries) { + for (Map.Entry> entry : entries) { TicketCount ticketCount = new TicketCount(); - ticketCount.setDeptId(entry.getKey()); ticketCount.setDateTime(dateTime); log.info("getTicketCountList entry.getKey() ================================================> " + entry.getKey()); if (ObjectUtils.isNotEmpty(entry.getKey())) { + ticketCount.setDeptId(NumberUtils.toLong(entry.getKey())); //根据id获取部门名称 - R deptName = systemClient.getDeptName(entry.getKey()); + R deptName = systemClient.getDeptName(NumberUtils.toLong(entry.getKey())); if (deptName.isSuccess()) { ticketCount.setDeptName(deptName.getData() == null ? "" : deptName.getData()); } @@ -500,6 +516,21 @@ public class TicketCountServiceImpl extends BaseServiceImpl evaluateEntities = ticketInfoEvaluateService.list(evaluateEntityLambdaQueryWrapper); ticketCount.setTicketProportionNum(evaluateEntities.size()); + + //5.废弃数量 + List invalidatedTicketNums = + values.stream().filter(item -> "废弃".equals(item.getFlowTaskName())).collect(Collectors.toList()); + ticketCount.setInvalidatedTicketNum(invalidatedTicketNums.size()); + + //6.错票数量 + List wrongTicketNums = + values.stream().filter(item -> "错票".equals(item.getFlowTaskName())).collect(Collectors.toList()); + ticketCount.setWrongTicketNum(wrongTicketNums.size()); + + //7.合格率 + String percentPassTicketNum = (1 / evaluateEntities.size()) == 0 ? "0" : (1 / evaluateEntities.size()) + + "%"; + ticketCount.setPercentPassTicket(percentPassTicketNum); ticketCountList.add(ticketCount); } return ticketCountList; diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java index 9598773..4ca47ff 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java @@ -537,8 +537,8 @@ public class TicketProcessServiceImpl implements TicketProcessService { //如果签发人为false if (workTicket.getSignFlag() != null) { if (!workTicket.getSignFlag()) { - workTicket.setFlowDescription("作废"); - workTicket.setFlowTaskName("作废"); + workTicket.setFlowDescription("errancy"); + workTicket.setFlowTaskName("errancy"); workTicket.setNextStepOperator(" "); workTicket.setStepOperator(" "); } @@ -548,8 +548,8 @@ public class TicketProcessServiceImpl implements TicketProcessService { //运行人员false if (workTicket.getRecieveFlag() != null) { if (!workTicket.getRecieveFlag()) { - workTicket.setFlowDescription("作废"); - workTicket.setFlowTaskName("作废"); + workTicket.setFlowDescription("errancy"); + workTicket.setFlowTaskName("errancy"); workTicket.setNextStepOperator(" "); workTicket.setStepOperator(" "); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/TicketCountQueryVo.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/TicketCountQueryVo.java new file mode 100644 index 0000000..a32e8dc --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/TicketCountQueryVo.java @@ -0,0 +1,34 @@ +package com.hnac.hzims.ticket.twoTicket.vo; + +import lombok.Data; + +/** + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/7/24 8:32 + */ +@Data +public class TicketCountQueryVo { + + /** + * 票据类型 + */ + private String type; + + + /** + * 延期 + */ + private String input; + + /** + * 结束 作废 + */ + private String flowTaskName; + + /** + * 合格 + */ + private String qualified; +} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/ticket/TicketCountResponseVo.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/ticket/TicketCountResponseVo.java index c9c1b8e..2016ea6 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/ticket/TicketCountResponseVo.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/ticket/TicketCountResponseVo.java @@ -23,7 +23,7 @@ public class TicketCountResponseVo { * 站点名称 */ @ColumnWidth(20) - @ExcelProperty(value = "站点",index = 0) + @ExcelProperty(value = "站点", index = 0) private String deptName; @@ -31,7 +31,7 @@ public class TicketCountResponseVo { * 第一种工作票开票数量 */ @ColumnWidth(14) - @ExcelProperty(value = "开票数量",index = 1) + @ExcelProperty(value = "开票数量", index = 1) private Integer oneTicketNumber = 0; @@ -39,15 +39,31 @@ public class TicketCountResponseVo { * 第一种工作票完成数量 */ @ColumnWidth(14) - @ExcelProperty(value = "完成数量",index = 2) + @ExcelProperty(value = "完成数量", index = 2) private Integer oneTicketCompleteNum = 0; /** + * 第一种工作票错票数量 + */ + @ColumnWidth(14) + @ExcelProperty(value = "错票数量", index = 3) + private Integer oneWrongTicketNum = 0; + + + /** + * 第一种工作票废票数量 + */ + @ColumnWidth(14) + @ExcelProperty(value = "废票数量", index = 4) + private Integer oneInvalidatedTicketNumNum = 0; + + + /** * 第一种工作票延期数量 */ @ColumnWidth(14) - @ExcelProperty(value = "延期数量",index = 3) + @ExcelProperty(value = "延期数量", index = 5) private Integer oneTicketDelayNum = 0; @@ -55,15 +71,22 @@ public class TicketCountResponseVo { * 第一种工作票合格数量 */ @ColumnWidth(14) - @ExcelProperty(value = "合格数量",index = 4) + @ExcelProperty(value = "合格数量", index = 6) private Integer oneTicketProportionNum = 0; /** + * 第一种工作票合格率 + */ + @ColumnWidth(14) + @ExcelProperty(value = "合格率", index = 7) + private String onePercentPassTicket = "0"; + + /** * 第二种工作票开票数量 */ @ColumnWidth(14) - @ExcelProperty(value = "开票数量",index = 5) + @ExcelProperty(value = "开票数量", index = 8) private Integer twoTicketNumber = 0; @@ -71,15 +94,30 @@ public class TicketCountResponseVo { * 第二种工作票完成数量 */ @ColumnWidth(14) - @ExcelProperty(value = "完成数量",index = 6) + @ExcelProperty(value = "完成数量", index = 9) private Integer twoTicketCompleteNum = 0; /** + * 第二种工作票错票数量 + */ + @ColumnWidth(14) + @ExcelProperty(value = "错票数量", index = 10) + private Integer twoWrongTicketNum = 0; + + /** + * 第二种工作票废票数量 + */ + @ColumnWidth(14) + @ExcelProperty(value = "废票数量", index = 11) + private Integer twoInvalidatedTicketNumNum = 0; + + + /** * 第二种工作票延期数量 */ @ColumnWidth(14) - @ExcelProperty(value = "延期数量",index = 7) + @ExcelProperty(value = "延期数量", index = 11) private Integer twoTicketDelayNum = 0; @@ -87,15 +125,24 @@ public class TicketCountResponseVo { * 第二种工作票合格数量 */ @ColumnWidth(14) - @ExcelProperty(value = "合格数量",index = 8) + @ExcelProperty(value = "合格数量", index = 12) private Integer twoTicketProportionNum = 0; + + /** + * 第二种工作票合格率 + */ + @ColumnWidth(14) + @ExcelProperty(value = "合格率", index = 13) + private String twoPercentPassTicket = "0"; + + /** * 水力机械工作票开票数量 */ @ColumnWidth(14) - @ExcelProperty(value = "开票数量",index = 9) + @ExcelProperty(value = "开票数量", index = 14) private Integer threeTicketNumber = 0; @@ -103,15 +150,30 @@ public class TicketCountResponseVo { * 水力机械工作票完成数量 */ @ColumnWidth(14) - @ExcelProperty(value = "完成数量",index = 10) + @ExcelProperty(value = "完成数量", index = 15) private Integer threeTicketCompleteNum = 0; + /** + *水力机械工作票错票数量 + */ + @ColumnWidth(14) + @ExcelProperty(value = "错票数量", index = 16) + private Integer threeWrongTicketNum = 0; + + + /** + * 水力机械工作废票数量 + */ + @ColumnWidth(14) + @ExcelProperty(value = "废票数量", index = 17) + private Integer threeInvalidatedTicketNumNum = 0; + /** * 水力机械工作票延期数量 */ @ColumnWidth(14) - @ExcelProperty(value = "延期数量",index = 11) + @ExcelProperty(value = "延期数量", index = 18) private Integer threeTicketDelayNum = 0; @@ -119,15 +181,24 @@ public class TicketCountResponseVo { * 水力机械工作票合格数量 */ @ColumnWidth(14) - @ExcelProperty(value = "合格数量",index = 12) + @ExcelProperty(value = "合格数量", index = 19) private Integer threeTicketProportionNum = 0; /** + *水力机械工作票票合格率 + */ + @ColumnWidth(14) + @ExcelProperty(value = "合格率", index = 20) + private String threePercentPassTicket = "0"; + + + + /** * 操作票开票数量 */ @ColumnWidth(14) - @ExcelProperty(value = "开票数量",index = 13) + @ExcelProperty(value = "开票数量", index = 21) private Integer fourTicketNumber = 0; @@ -135,7 +206,7 @@ public class TicketCountResponseVo { * 操作票开票完成数量 */ @ColumnWidth(14) - @ExcelProperty(value = "完成数量",index = 14) + @ExcelProperty(value = "完成数量", index = 22) private Integer fourTicketCompleteNum = 0; @@ -150,8 +221,17 @@ public class TicketCountResponseVo { * 操作票作票合格数量 */ @ColumnWidth(14) - @ExcelProperty(value = "合格数量",index = 15) + @ExcelProperty(value = "合格数量", index = 23) private Integer fourTicketProportionNum = 0; + + /** + * 操作票合格率 + */ + @ColumnWidth(14) + @ExcelProperty(value = "合格数量", index = 24) + private String fourPercentPassTicket = "0"; + + } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/ticket/TicketCountVo.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/ticket/TicketCountVo.java index 451ca92..2f95f57 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/ticket/TicketCountVo.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/ticket/TicketCountVo.java @@ -16,4 +16,7 @@ public class TicketCountVo { private String dateTime; + + + private String deptId; } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/IWorkTicketInfoService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/IWorkTicketInfoService.java index 270f7ba..a95c59f 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/IWorkTicketInfoService.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/IWorkTicketInfoService.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.hnac.hzims.ticket.areamonthly.vo.AreaMonthlyVo; import com.hnac.hzims.ticket.areamonthly.vo.StandardTicketWithAreaVo; import com.hnac.hzims.ticket.areamonthly.vo.StandardWorkVo; +import com.hnac.hzims.ticket.twoTicket.vo.TicketCountQueryVo; import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo; import com.hnac.hzims.ticket.workTicket.dto.TicketAccessTaskDto; import com.hnac.hzims.ticket.workTicket.dto.WorkTicketInfoDto; @@ -168,4 +169,12 @@ public interface IWorkTicketInfoService extends BaseService selectTicketByDeptIdWithTicketType(List createDept, String ticketType, String dateTime); List getWorkTicketBill(String emCode, String startTime, String endTime); + + + /** + * 查看工作票 + * @param ticketCountQueryVo + * @return + */ + List listByTicketWithKeyword(TicketCountQueryVo ticketCountQueryVo); } 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 8e86e7e..8c04835 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 @@ -26,10 +26,12 @@ import com.hnac.hzims.ticket.areamonthly.vo.StandardTicketWithAreaVo; import com.hnac.hzims.ticket.areamonthly.vo.StandardWorkVo; import com.hnac.hzims.ticket.aspect.AroundFlow; import com.hnac.hzims.ticket.constants.TicketConstants; +import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity; import com.hnac.hzims.ticket.twoTicket.entity.TicketInfoDanger; import com.hnac.hzims.ticket.twoTicket.entity.WorkTicketFinish; import com.hnac.hzims.ticket.twoTicket.service.TicketInfoDangerService; import com.hnac.hzims.ticket.twoTicket.service.impl.WorkTicketFinishServiceImpl; +import com.hnac.hzims.ticket.twoTicket.vo.TicketCountQueryVo; import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo; import com.hnac.hzims.ticket.utils.ExcelUtil; import com.hnac.hzims.ticket.workTicket.dto.*; @@ -247,7 +249,7 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl pages = this.page(Condition.getPage(query), lqw); @@ -1114,7 +1116,7 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl workTicketBillList = baseMapper.getWorkTicketBill(emInfo.getPath(), startTime, endTime); return workTicketBillList; } + + + /** + * 查看工作票 + * + * @param ticketCountQueryVo + * @return + */ + @Override + public List listByTicketWithKeyword(TicketCountQueryVo ticketCountQueryVo) { + //延期 + String input = ticketCountQueryVo.getInput(); + //开票 结束 作废 + String flowTaskName = ticketCountQueryVo.getFlowTaskName(); + //合格 + String qualified = ticketCountQueryVo.getQualified(); + + String type = ticketCountQueryVo.getType(); + //查询 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(StringUtils.isNotBlank(type), WorkTicketInfoEntity::getType, + type); + queryWrapper.lambda().eq(StringUtils.isNotEmpty(input), WorkTicketInfoEntity::getInput, input); + + if (StringUtils.isNotEmpty(flowTaskName)) { + if ("开票".equals(flowTaskName)) { + queryWrapper.lambda().isNotNull(WorkTicketInfoEntity::getFlowTaskName); + } else { + queryWrapper.lambda().eq(WorkTicketInfoEntity::getFlowTaskName, flowTaskName); + } + } + + + //合格 + if (StringUtils.isNoneBlank(qualified) && "合格".equals(qualified)) { + List workTicketInfoEntities = baseMapper.selectList(null); + List ticketIdList = workTicketInfoEntities.stream().map(BaseEntity::getId).collect(Collectors.toList()); + LambdaQueryWrapper evaluateEntityLambdaQueryWrapper = new LambdaQueryWrapper<>(); + evaluateEntityLambdaQueryWrapper.in(TicketInfoEvaluateEntity::getTicketId, ticketIdList); + evaluateEntityLambdaQueryWrapper.eq(BaseEntity::getStatus, 1); + List evaluateEntities = ticketInfoEvaluateService.list(evaluateEntityLambdaQueryWrapper); + List idList = + evaluateEntities.stream().map(TicketInfoEvaluateEntity::getTicketId).collect(Collectors.toList()); + queryWrapper.lambda().in(BaseEntity::getId, idList); + } + return baseMapper.selectList(queryWrapper); + } } diff --git a/hzims-service/ticket/src/main/resources/db/2.0.2.sql b/hzims-service/ticket/src/main/resources/db/2.0.2.sql new file mode 100644 index 0000000..85fa2b4 --- /dev/null +++ b/hzims-service/ticket/src/main/resources/db/2.0.2.sql @@ -0,0 +1 @@ +alter table hzims_ticket_count add invalidated_ticket_num int null comment '废票数量'; diff --git a/hzims-service/ticket/src/main/resources/db/2.0.3.sql b/hzims-service/ticket/src/main/resources/db/2.0.3.sql new file mode 100644 index 0000000..8f9af75 --- /dev/null +++ b/hzims-service/ticket/src/main/resources/db/2.0.3.sql @@ -0,0 +1,18 @@ +# 工作票更新 +update hzims_work_ticket_info set flow_task_name = '签发' where status = 1; +update hzims_work_ticket_info set flow_task_name = '收到工作票' where status = 2; +update hzims_work_ticket_info set flow_task_name = '许可人许可' where status = 3; +update hzims_work_ticket_info set flow_task_name = '确认条件具备' where status = 4; +update hzims_work_ticket_info set flow_task_name = '工作负责人确认工作' where status = 5; +update hzims_work_ticket_info set flow_task_name = '许可人确认工作结束' where status = 6; +update hzims_work_ticket_info set flow_task_name = '工作票终结' where status = 7; +update hzims_work_ticket_info set flow_task_name = '许可人延期确认' where status = 9; +update hzims_work_ticket_info set flow_task_name = '负责人延期确认' where status = 10; +update hzims_work_ticket_info set flow_task_name = '作废' where status = 11; +update hzims_work_ticket_info set flow_task_name = '逾期' where status = 12; +# 操作票更新 +update hzims_standard_ticket_info set flow_task_name = '待监护人确认' where status = 1; +update hzims_standard_ticket_info set flow_task_name = '待值班负责人确认' where status = 2; +update hzims_standard_ticket_info set flow_task_name = '结束' where status = 3; +update hzims_standard_ticket_info set flow_task_name = '终止' where status = 4; + diff --git a/hzims-service/ticket/src/main/resources/db/2.0.4.sql b/hzims-service/ticket/src/main/resources/db/2.0.4.sql new file mode 100644 index 0000000..58fafc0 --- /dev/null +++ b/hzims-service/ticket/src/main/resources/db/2.0.4.sql @@ -0,0 +1,2 @@ +alter table hzims_ticket_count add wrong_ticket_num int null comment '错票数量'; +alter table hzims_ticket_count add percent_pass_ticket varchar(50) null comment '合格率'; \ No newline at end of file