|
|
|
@ -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<TicketCountMapper, T
|
|
|
|
|
//获取keyword
|
|
|
|
|
String keyword = ticketCountVo.getKeyword(); |
|
|
|
|
String dateTime = ticketCountVo.getDateTime(); |
|
|
|
|
String deptId = ticketCountVo.getDeptId(); |
|
|
|
|
QueryWrapper<TicketCount> 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<TicketCount> ticketCounts = baseMapper.selectList(ticketCountQueryWrapper); |
|
|
|
|
List<TicketCountResponseVo> result = getTicketCountResponseList(ticketCounts); |
|
|
|
|
return result; |
|
|
|
@ -330,6 +333,8 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
|
|
|
|
|
ticketCountResponseVo.setFourTicketProportionNum(this.getCount(ticketCount.getTicketProportionNum())); |
|
|
|
|
ticketCountResponseVo.setFourTicketCompleteNum(this.getCount(ticketCount.getTicketCompleteNum())); |
|
|
|
|
ticketCountResponseVo.setFourTicketDelayNum(this.getCount(ticketCount.getTicketDelayNum())); |
|
|
|
|
ticketCountResponseVo.setFourPercentPassTicket(ticketCount.getPercentPassTicket()); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ("6".equals(ticketCount.getTicketType())) { |
|
|
|
@ -337,6 +342,9 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
|
|
|
|
|
ticketCountResponseVo.setOneTicketProportionNum(this.getCount(ticketCount.getTicketProportionNum())); |
|
|
|
|
ticketCountResponseVo.setOneTicketCompleteNum(this.getCount(ticketCount.getTicketCompleteNum())); |
|
|
|
|
ticketCountResponseVo.setOneTicketDelayNum(this.getCount(ticketCount.getTicketDelayNum())); |
|
|
|
|
ticketCountResponseVo.setOneInvalidatedTicketNumNum(this.getCount(ticketCount.getInvalidatedTicketNum())); |
|
|
|
|
ticketCountResponseVo.setOneWrongTicketNum(this.getCount(ticketCount.getWrongTicketNum())); |
|
|
|
|
ticketCountResponseVo.setOnePercentPassTicket(ticketCount.getPercentPassTicket()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -345,6 +353,9 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
|
|
|
|
|
ticketCountResponseVo.setTwoTicketProportionNum(this.getCount(ticketCount.getTicketProportionNum())); |
|
|
|
|
ticketCountResponseVo.setTwoTicketCompleteNum(this.getCount(ticketCount.getTicketCompleteNum())); |
|
|
|
|
ticketCountResponseVo.setTwoTicketDelayNum(this.getCount(ticketCount.getTicketDelayNum())); |
|
|
|
|
ticketCountResponseVo.setTwoInvalidatedTicketNumNum(this.getCount(ticketCount.getInvalidatedTicketNum())); |
|
|
|
|
ticketCountResponseVo.setTwoWrongTicketNum(this.getCount(ticketCount.getWrongTicketNum())); |
|
|
|
|
ticketCountResponseVo.setTwoPercentPassTicket(ticketCount.getPercentPassTicket()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -353,6 +364,9 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
|
|
|
|
|
ticketCountResponseVo.setThreeTicketProportionNum(this.getCount(ticketCount.getTicketProportionNum())); |
|
|
|
|
ticketCountResponseVo.setThreeTicketCompleteNum(this.getCount(ticketCount.getTicketCompleteNum())); |
|
|
|
|
ticketCountResponseVo.setThreeTicketDelayNum(this.getCount(ticketCount.getTicketDelayNum())); |
|
|
|
|
ticketCountResponseVo.setThreeInvalidatedTicketNumNum(this.getCount(ticketCount.getInvalidatedTicketNum())); |
|
|
|
|
ticketCountResponseVo.setThreeWrongTicketNum(this.getCount(ticketCount.getWrongTicketNum())); |
|
|
|
|
ticketCountResponseVo.setThreePercentPassTicket(ticketCount.getPercentPassTicket()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -382,7 +396,8 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
//根据站点分组
|
|
|
|
|
Map<Long, List<StandardTicketInfoEntity>> createDeptTickets = ticketInfoEntities.stream().collect(Collectors.groupingBy(StandardTicketInfoEntity::getCreateDept)); |
|
|
|
|
Map<String, List<StandardTicketInfoEntity>> createDeptTickets = |
|
|
|
|
ticketInfoEntities.stream().collect(Collectors.groupingBy(StandardTicketInfoEntity::getSignageCode)); |
|
|
|
|
//获取 操作票的id,删除
|
|
|
|
|
if (CollectionUtils.isNotEmpty(items)) { |
|
|
|
|
List<Long> collect = |
|
|
|
@ -391,19 +406,19 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
|
|
|
|
|
baseMapper.deleteBatchIds(collect); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
Set<Map.Entry<Long, List<StandardTicketInfoEntity>>> entries = createDeptTickets.entrySet(); |
|
|
|
|
Set<Map.Entry<String, List<StandardTicketInfoEntity>>> entries = createDeptTickets.entrySet(); |
|
|
|
|
List<TicketCount> ticketCountList = new ArrayList<>(); |
|
|
|
|
for (Map.Entry<Long, List<StandardTicketInfoEntity>> entry : entries) { |
|
|
|
|
for (Map.Entry<String, List<StandardTicketInfoEntity>> 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<String> deptName = systemClient.getDeptName(entry.getKey()); |
|
|
|
|
R<String> 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<TicketCountMapper, T
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
//根据站点分组
|
|
|
|
|
Map<Long, List<WorkTicketInfoEntity>> createDeptTickets = ticketInfoEntities.stream().collect(Collectors.groupingBy(BaseEntity::getCreateDept)); |
|
|
|
|
Map<String, List<WorkTicketInfoEntity>> createDeptTickets = |
|
|
|
|
ticketInfoEntities.stream().collect(Collectors.groupingBy(WorkTicketInfoEntity::getSignageCode)); |
|
|
|
|
if (CollectionUtils.isNotEmpty(items)) { |
|
|
|
|
//获取工作票的id,删除
|
|
|
|
|
List<Long> collect = |
|
|
|
@ -461,17 +477,17 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
|
|
|
|
|
baseMapper.deleteBatchIds(collect); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
Set<Map.Entry<Long, List<WorkTicketInfoEntity>>> entries = createDeptTickets.entrySet(); |
|
|
|
|
Set<Map.Entry<String, List<WorkTicketInfoEntity>>> entries = createDeptTickets.entrySet(); |
|
|
|
|
|
|
|
|
|
List<TicketCount> ticketCountList = new ArrayList<>(); |
|
|
|
|
for (Map.Entry<Long, List<WorkTicketInfoEntity>> entry : entries) { |
|
|
|
|
for (Map.Entry<String, List<WorkTicketInfoEntity>> 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<String> deptName = systemClient.getDeptName(entry.getKey()); |
|
|
|
|
R<String> 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<TicketCountMapper, T
|
|
|
|
|
evaluateEntityLambdaQueryWrapper.eq(BaseEntity::getStatus, 1); |
|
|
|
|
List<TicketInfoEvaluateEntity> evaluateEntities = ticketInfoEvaluateService.list(evaluateEntityLambdaQueryWrapper); |
|
|
|
|
ticketCount.setTicketProportionNum(evaluateEntities.size()); |
|
|
|
|
|
|
|
|
|
//5.废弃数量
|
|
|
|
|
List<WorkTicketInfoEntity> invalidatedTicketNums = |
|
|
|
|
values.stream().filter(item -> "废弃".equals(item.getFlowTaskName())).collect(Collectors.toList()); |
|
|
|
|
ticketCount.setInvalidatedTicketNum(invalidatedTicketNums.size()); |
|
|
|
|
|
|
|
|
|
//6.错票数量
|
|
|
|
|
List<WorkTicketInfoEntity> 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; |
|
|
|
|