|
|
|
@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
|
|
|
|
import com.hnac.hzims.common.logs.utils.StringUtils; |
|
|
|
|
import com.hnac.hzims.operational.station.entity.StationEntity; |
|
|
|
|
import com.hnac.hzims.operational.station.feign.IStationClient; |
|
|
|
|
import com.hnac.hzims.ticket.allTicket.entity.TicketInfoEvaluateEntity; |
|
|
|
|
import com.hnac.hzims.ticket.allTicket.service.TicketInfoEvaluateService; |
|
|
|
|
import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity; |
|
|
|
@ -80,6 +82,8 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
|
|
|
|
|
|
|
|
|
|
private final IStandardTicketInfoService standardTicketInfoService; |
|
|
|
|
|
|
|
|
|
private final IStationClient stationClient; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 两票生成月报统计 |
|
|
|
@ -291,26 +295,26 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
|
|
|
|
|
*/ |
|
|
|
|
private List<TicketCountResponseVo> getTicketCountResponseList(List<TicketCount> ticketCounts) { |
|
|
|
|
//先判断在存储
|
|
|
|
|
Map<String, TicketCountResponseVo> map = new HashMap<>(); |
|
|
|
|
Map<Long, TicketCountResponseVo> map = new HashMap<>(); |
|
|
|
|
for (TicketCount ticketCount : ticketCounts) { |
|
|
|
|
String deptName = ticketCount.getDeptName(); |
|
|
|
|
if (map.containsKey(deptName)) { |
|
|
|
|
TicketCountResponseVo ticketCountResponseVo = map.get(deptName); |
|
|
|
|
Long deptId = ticketCount.getDeptId(); |
|
|
|
|
if (map.containsKey(deptId)) { |
|
|
|
|
TicketCountResponseVo ticketCountResponseVo = map.get(deptId); |
|
|
|
|
isExistsTicket(ticketCount, ticketCountResponseVo); |
|
|
|
|
map.put(deptName, ticketCountResponseVo); |
|
|
|
|
map.put(deptId, ticketCountResponseVo); |
|
|
|
|
} else { |
|
|
|
|
TicketCountResponseVo ticketCountResponseVo = new TicketCountResponseVo(); |
|
|
|
|
isExistsTicket(ticketCount, ticketCountResponseVo); |
|
|
|
|
map.put(deptName, ticketCountResponseVo); |
|
|
|
|
map.put(deptId, ticketCountResponseVo); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//map遍历
|
|
|
|
|
List<TicketCountResponseVo> result = new ArrayList<>(); |
|
|
|
|
if (MapUtils.isNotEmpty(map)) { |
|
|
|
|
Set<Map.Entry<String, TicketCountResponseVo>> entries = map.entrySet(); |
|
|
|
|
for (Map.Entry<String, TicketCountResponseVo> entry : entries) { |
|
|
|
|
Set<Map.Entry<Long, TicketCountResponseVo>> entries = map.entrySet(); |
|
|
|
|
for (Map.Entry<Long, TicketCountResponseVo> entry : entries) { |
|
|
|
|
TicketCountResponseVo value = entry.getValue(); |
|
|
|
|
value.setDeptName(entry.getKey()); |
|
|
|
|
value.setDeptId(entry.getKey()); |
|
|
|
|
result.add(value); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -328,12 +332,13 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
|
|
|
|
|
private void isExistsTicket(TicketCount ticketCount, TicketCountResponseVo ticketCountResponseVo) { |
|
|
|
|
String deptName = ticketCount.getDeptName(); |
|
|
|
|
ticketCountResponseVo.setDeptName(deptName); |
|
|
|
|
ticketCountResponseVo.setDeptId(ticketCount.getDeptId()); |
|
|
|
|
if ("3".equals(ticketCount.getTicketType())) { |
|
|
|
|
ticketCountResponseVo.setFourTicketNumber(this.getCount(ticketCount.getTicketNumber())); |
|
|
|
|
ticketCountResponseVo.setFourTicketProportionNum(this.getCount(ticketCount.getTicketProportionNum())); |
|
|
|
|
ticketCountResponseVo.setFourTicketCompleteNum(this.getCount(ticketCount.getTicketCompleteNum())); |
|
|
|
|
ticketCountResponseVo.setFourTicketDelayNum(this.getCount(ticketCount.getTicketDelayNum())); |
|
|
|
|
ticketCountResponseVo.setFourPercentPassTicket(ticketCount.getPercentPassTicket()); |
|
|
|
|
ticketCountResponseVo.setFourPercentPassTicket(this.getCountV2(ticketCount.getPercentPassTicket())); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -344,7 +349,7 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
|
|
|
|
|
ticketCountResponseVo.setOneTicketDelayNum(this.getCount(ticketCount.getTicketDelayNum())); |
|
|
|
|
ticketCountResponseVo.setOneInvalidatedTicketNumNum(this.getCount(ticketCount.getInvalidatedTicketNum())); |
|
|
|
|
ticketCountResponseVo.setOneWrongTicketNum(this.getCount(ticketCount.getWrongTicketNum())); |
|
|
|
|
ticketCountResponseVo.setOnePercentPassTicket(ticketCount.getPercentPassTicket()); |
|
|
|
|
ticketCountResponseVo.setOnePercentPassTicket(this.getCountV2(ticketCount.getPercentPassTicket())); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -355,7 +360,7 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
|
|
|
|
|
ticketCountResponseVo.setTwoTicketDelayNum(this.getCount(ticketCount.getTicketDelayNum())); |
|
|
|
|
ticketCountResponseVo.setTwoInvalidatedTicketNumNum(this.getCount(ticketCount.getInvalidatedTicketNum())); |
|
|
|
|
ticketCountResponseVo.setTwoWrongTicketNum(this.getCount(ticketCount.getWrongTicketNum())); |
|
|
|
|
ticketCountResponseVo.setTwoPercentPassTicket(ticketCount.getPercentPassTicket()); |
|
|
|
|
ticketCountResponseVo.setTwoPercentPassTicket(this.getCountV2(ticketCount.getPercentPassTicket())); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -366,7 +371,7 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
|
|
|
|
|
ticketCountResponseVo.setThreeTicketDelayNum(this.getCount(ticketCount.getTicketDelayNum())); |
|
|
|
|
ticketCountResponseVo.setThreeInvalidatedTicketNumNum(this.getCount(ticketCount.getInvalidatedTicketNum())); |
|
|
|
|
ticketCountResponseVo.setThreeWrongTicketNum(this.getCount(ticketCount.getWrongTicketNum())); |
|
|
|
|
ticketCountResponseVo.setThreePercentPassTicket(ticketCount.getPercentPassTicket()); |
|
|
|
|
ticketCountResponseVo.setThreePercentPassTicket(this.getCountV2(ticketCount.getPercentPassTicket())); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -380,6 +385,13 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 验证是否为null |
|
|
|
|
*/ |
|
|
|
|
private String getCountV2(String count) { |
|
|
|
|
return count == null ? "0%" : count; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 统计操作票功能 |
|
|
|
|
* |
|
|
|
|
* @param createDept 所属机构及下属机构 |
|
|
|
@ -397,7 +409,7 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
|
|
|
|
|
} |
|
|
|
|
//根据站点分组
|
|
|
|
|
Map<String, List<StandardTicketInfoEntity>> createDeptTickets = |
|
|
|
|
ticketInfoEntities.stream().collect(Collectors.groupingBy(StandardTicketInfoEntity::getSignageCode)); |
|
|
|
|
ticketInfoEntities.stream().filter(item -> item.getSignageCode() != null).collect(Collectors.groupingBy(StandardTicketInfoEntity::getSignageCode)); |
|
|
|
|
//获取 操作票的id,删除
|
|
|
|
|
if (CollectionUtils.isNotEmpty(items)) { |
|
|
|
|
List<Long> collect = |
|
|
|
@ -418,9 +430,12 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
|
|
|
|
|
if (ObjectUtils.isNotEmpty(entry.getKey())) { |
|
|
|
|
ticketCount.setDeptId(NumberUtils.toLong(entry.getKey())); |
|
|
|
|
//根据id获取部门名称
|
|
|
|
|
R<String> deptName = systemClient.getDeptName(NumberUtils.toLong(entry.getKey())); |
|
|
|
|
if (deptName.isSuccess()) { |
|
|
|
|
ticketCount.setDeptName(deptName.getData() == null ? "" : deptName.getData()); |
|
|
|
|
StationEntity stationEntity = new StationEntity(); |
|
|
|
|
stationEntity.setCode(entry.getKey()); |
|
|
|
|
R<StationEntity> stationClientOne = stationClient.getOne(stationEntity); |
|
|
|
|
if (stationClientOne.isSuccess()) { |
|
|
|
|
StationEntity data = stationClientOne.getData(); |
|
|
|
|
ticketCount.setDeptName(data.getName() == null ? "" : data.getName()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
List<StandardTicketInfoEntity> values = entry.getValue(); |
|
|
|
@ -440,6 +455,15 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
|
|
|
|
|
evaluateEntityLambdaQueryWrapper.eq(BaseEntity::getStatus, 1); |
|
|
|
|
List<TicketInfoEvaluateEntity> evaluateEntities = ticketInfoEvaluateService.list(evaluateEntityLambdaQueryWrapper); |
|
|
|
|
ticketCount.setTicketProportionNum(evaluateEntities.size()); |
|
|
|
|
|
|
|
|
|
//7.合格率
|
|
|
|
|
if (CollectionUtils.isNotEmpty(evaluateEntities)) { |
|
|
|
|
String percentPassTicketNum = (1 / evaluateEntities.size()) == 0 ? "0" : (1 / evaluateEntities.size()) + |
|
|
|
|
"%"; |
|
|
|
|
ticketCount.setPercentPassTicket(percentPassTicketNum); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ticketCountList.add(ticketCount); |
|
|
|
|
} |
|
|
|
|
return ticketCountList; |
|
|
|
@ -468,7 +492,7 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
|
|
|
|
|
} |
|
|
|
|
//根据站点分组
|
|
|
|
|
Map<String, List<WorkTicketInfoEntity>> createDeptTickets = |
|
|
|
|
ticketInfoEntities.stream().collect(Collectors.groupingBy(WorkTicketInfoEntity::getSignageCode)); |
|
|
|
|
ticketInfoEntities.stream().filter(item -> item.getSignageCode() != null).collect(Collectors.groupingBy(WorkTicketInfoEntity::getSignageCode)); |
|
|
|
|
if (CollectionUtils.isNotEmpty(items)) { |
|
|
|
|
//获取工作票的id,删除
|
|
|
|
|
List<Long> collect = |
|
|
|
@ -487,9 +511,12 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
|
|
|
|
|
if (ObjectUtils.isNotEmpty(entry.getKey())) { |
|
|
|
|
ticketCount.setDeptId(NumberUtils.toLong(entry.getKey())); |
|
|
|
|
//根据id获取部门名称
|
|
|
|
|
R<String> deptName = systemClient.getDeptName(NumberUtils.toLong(entry.getKey())); |
|
|
|
|
if (deptName.isSuccess()) { |
|
|
|
|
ticketCount.setDeptName(deptName.getData() == null ? "" : deptName.getData()); |
|
|
|
|
StationEntity stationEntity = new StationEntity(); |
|
|
|
|
stationEntity.setCode(entry.getKey()); |
|
|
|
|
R<StationEntity> stationClientOne = stationClient.getOne(stationEntity); |
|
|
|
|
if (stationClientOne.isSuccess()) { |
|
|
|
|
StationEntity data = stationClientOne.getData(); |
|
|
|
|
ticketCount.setDeptName(data.getName() == null ? "" : data.getName()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
List<WorkTicketInfoEntity> values = entry.getValue(); |
|
|
|
@ -519,7 +546,7 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
|
|
|
|
|
|
|
|
|
|
//5.废弃数量
|
|
|
|
|
List<WorkTicketInfoEntity> invalidatedTicketNums = |
|
|
|
|
values.stream().filter(item -> "废弃".equals(item.getFlowTaskName())).collect(Collectors.toList()); |
|
|
|
|
values.stream().filter(item -> "废票".equals(item.getFlowTaskName())).collect(Collectors.toList()); |
|
|
|
|
ticketCount.setInvalidatedTicketNum(invalidatedTicketNums.size()); |
|
|
|
|
|
|
|
|
|
//6.错票数量
|
|
|
|
@ -528,9 +555,12 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
|
|
|
|
|
ticketCount.setWrongTicketNum(wrongTicketNums.size()); |
|
|
|
|
|
|
|
|
|
//7.合格率
|
|
|
|
|
String percentPassTicketNum = (1 / evaluateEntities.size()) == 0 ? "0" : (1 / evaluateEntities.size()) + |
|
|
|
|
"%"; |
|
|
|
|
ticketCount.setPercentPassTicket(percentPassTicketNum); |
|
|
|
|
if (CollectionUtils.isNotEmpty(evaluateEntities)) { |
|
|
|
|
String percentPassTicketNum = (1 / evaluateEntities.size()) == 0 ? "0%" : |
|
|
|
|
(1 / evaluateEntities.size()) + "%"; |
|
|
|
|
ticketCount.setPercentPassTicket(percentPassTicketNum); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ticketCountList.add(ticketCount); |
|
|
|
|
} |
|
|
|
|
return ticketCountList; |
|
|
|
|