Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
haungxing 1 year ago
parent
commit
1b4e7c6d4e
  1. 15
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketInfoService.java
  2. 18
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java
  3. 1
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketCountController.java
  4. 40
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketCountServiceImpl.java
  5. 3
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/ticket/TicketCountVo.java
  6. 5
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/IWorkTicketInfoService.java
  7. 13
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java

15
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketInfoService.java

@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hnac.hzims.ticket.allTicket.vo.DoublePassRateVO;
import com.hnac.hzims.ticket.allTicket.vo.TicketInfoStatisticVO;
import com.hnac.hzims.ticket.areamonthly.vo.StandardTicketVo;
import com.hnac.hzims.ticket.areamonthly.vo.AreaMonthlyVo;
import com.hnac.hzims.ticket.areamonthly.vo.StandardTicketWithAreaVo;
import com.hnac.hzims.ticket.standardTicket.dto.StandardTicketInfoDto;
import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity;
@ -119,10 +118,12 @@ public interface IStandardTicketInfoService extends BaseService<StandardTicketIn
StandardTicketInfoVo selectDetailsById(Long ticketId);
/**
* 根据部门Id数组查询操作票数据
* @param createDept
* @param ticketType
* @return
*/
List<StandardTicketInfoEntity> selectStandardTicketByDeptIdWithTicketType(List<Long> createDept, String ticketType);
* 根据部门Id数组查询操作票数据
*
* @param createDept
* @param ticketType
* @param dateTime
* @return
*/
List<StandardTicketInfoEntity> selectStandardTicketByDeptIdWithTicketType(List<Long> createDept, String ticketType, String dateTime);
}

18
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java

@ -5,8 +5,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hnac.hzims.ticket.allTicket.entity.TicketInfoEvaluateEntity;
@ -15,7 +13,6 @@ import com.hnac.hzims.ticket.allTicket.vo.DoublePassRateVO;
import com.hnac.hzims.ticket.allTicket.vo.DoublePassVO;
import com.hnac.hzims.ticket.allTicket.vo.TicketInfoStatisticVO;
import com.hnac.hzims.ticket.areamonthly.vo.StandardTicketVo;
import com.hnac.hzims.ticket.areamonthly.vo.AreaMonthlyVo;
import com.hnac.hzims.ticket.areamonthly.vo.StandardTicketWithAreaVo;
import com.hnac.hzims.ticket.constants.DictConstants;
import com.hnac.hzims.ticket.constants.TicketConstants;
@ -401,7 +398,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
StandardTicketInfoVo standardTicketInfoVo = new StandardTicketInfoVo();
//1. 根据工作票Id查询操作票信息
StandardTicketInfoEntity standardTicketInfoEntity = baseMapper.selectById(ticketId);
BeanUtils.copyProperties(standardTicketInfoEntity,standardTicketInfoVo);
BeanUtils.copyProperties(standardTicketInfoEntity, standardTicketInfoVo);
//2. 封装vo
transFrom(standardTicketInfoVo, standardTicketInfoEntity);
@ -409,7 +406,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
//2. 根据ticketId获取安全措施信息
List<StandardTicketMeasureEntity> standardTicketMeasure = measureService.listStandardByTicketId(ticketId);
if (CollectionUtils.isNotEmpty(standardTicketMeasure)){
if (CollectionUtils.isNotEmpty(standardTicketMeasure)) {
List<StandardTicketMeasureVo> collect = standardTicketMeasure.stream().map(standardTicketMeasureEntity -> {
StandardTicketMeasureVo standardTicketMeasureVO = new StandardTicketMeasureVo();
BeanUtils.copyProperties(standardTicketMeasureEntity, standardTicketMeasureVO);
@ -423,6 +420,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
/**
* 封装Vo
*
* @param standardTicketInfoVo
* @param standardTicketInfoEntity
*/
@ -707,13 +705,15 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
*
* @param createDept
* @param ticketType
* @param dateTime
* @return
*/
@Override
public List<StandardTicketInfoEntity> selectStandardTicketByDeptIdWithTicketType(List<Long> createDept, String ticketType) {
LambdaQueryWrapper<StandardTicketInfoEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(StandardTicketInfoEntity::getTicketType,ticketType);
queryWrapper.in(StandardTicketInfoEntity::getCreateDept,createDept);
public List<StandardTicketInfoEntity> selectStandardTicketByDeptIdWithTicketType(List<Long> createDept, String ticketType, String dateTime) {
QueryWrapper<StandardTicketInfoEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(StandardTicketInfoEntity::getTicketType, ticketType);
queryWrapper.lambda().in(StandardTicketInfoEntity::getCreateDept, createDept);
queryWrapper.apply("date_format(CREATE_TIME,'%Y-%m') = {0}", dateTime);
return baseMapper.selectList(queryWrapper);
}
}

1
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketCountController.java

@ -9,6 +9,7 @@ import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.time.YearMonth;
import java.util.List;
/**

40
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketCountServiceImpl.java

@ -45,6 +45,7 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ThreadPoolExecutor;
@ -90,7 +91,6 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
//根据登录人查询所属机构及下属机构
BladeUser user = AuthUtil.getUser();
List<Long> createDept = userClient.getDataScope(user.getUserId());
System.out.println("createDept = " + createDept);
//根据月份查询统计的数据
CompletableFuture<List<TicketCount>> ticketCountsCompletableFuture = CompletableFuture.supplyAsync(() -> {
LambdaQueryWrapper<TicketCount> queryWrapper = new LambdaQueryWrapper<>();
@ -132,7 +132,8 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
}, executor);
//执行线程操作
CompletableFuture.allOf(ticketCountsCompletableFuture, oneTicketCompletableFuture, twoTicketCompletableFuture, threeTicketCompletableFuture, standardCompletableFuture).get();
CompletableFuture.allOf(ticketCountsCompletableFuture, oneTicketCompletableFuture, twoTicketCompletableFuture
, threeTicketCompletableFuture, standardCompletableFuture).get();
}
/**
@ -145,8 +146,10 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
public List<TicketCountResponseVo> selectTicketCountLlist(TicketCountVo ticketCountVo) {
//获取keyword
String keyword = ticketCountVo.getKeyword();
String dateTime = ticketCountVo.getDateTime();
QueryWrapper<TicketCount> ticketCountQueryWrapper = new QueryWrapper<>();
ticketCountQueryWrapper.like(StringUtils.isNotBlank(keyword), "dept_name", keyword);
ticketCountQueryWrapper.eq(StringUtils.isNotBlank(dateTime), "date_time", dateTime);
List<TicketCount> ticketCounts = baseMapper.selectList(ticketCountQueryWrapper);
List<TicketCountResponseVo> result = getTicketCountResponseList(ticketCounts);
return result;
@ -300,7 +303,8 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
* @return
*/
private List<TicketCount> getStandardTicketCountList(List<Long> createDept, List<TicketCount> items, String ticketType, String dateTime, BladeUser user) {
List<StandardTicketInfoEntity> ticketInfoEntities = standardTicketInfoService.selectStandardTicketByDeptIdWithTicketType(createDept, ticketType);
List<StandardTicketInfoEntity> ticketInfoEntities =
standardTicketInfoService.selectStandardTicketByDeptIdWithTicketType(createDept, ticketType,dateTime);
if (CollectionUtils.isEmpty(ticketInfoEntities)) {
return null;
}
@ -361,8 +365,13 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
* @param user
* @return
*/
private List<TicketCount> getTicketCountList(List<Long> createDept, List<TicketCount> items, String ticketType, String dateTime, BladeUser user) {
List<WorkTicketInfoEntity> ticketInfoEntities = workTicketInfoService.selectTicketByDeptIdWithTicketType(createDept, ticketType);
private List<TicketCount> getTicketCountList(List<Long> createDept,
List<TicketCount> items,
String ticketType,
String dateTime,
BladeUser user) {
List<WorkTicketInfoEntity> ticketInfoEntities =
workTicketInfoService.selectTicketByDeptIdWithTicketType(createDept, ticketType,dateTime);
if (CollectionUtils.isEmpty(ticketInfoEntities)) {
return null;
}
@ -391,16 +400,19 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
List<WorkTicketInfoEntity> values = entry.getValue();
ticketCount.setTicketType(CollectionUtils.isNotEmpty(values) ? values.get(0).getType() : ticketType);
//1. 开票数量
List<WorkTicketInfoEntity> ticketNumbers = values.stream().filter(item -> item.getFlowTaskName() != null).collect(Collectors.toList());
List<WorkTicketInfoEntity> ticketNumbers =
values.stream().filter(item -> item.getFlowTaskName() != null).collect(Collectors.toList());
ticketCount.setTicketNumber(ticketNumbers.size());
//2. 完成数量
List<WorkTicketInfoEntity> ticketCompleteNums = values.stream().filter(item -> "结束".equals(item.getFlowTaskName())).collect(Collectors.toList());
List<WorkTicketInfoEntity> ticketCompleteNums =
values.stream().filter(item -> "结束".equals(item.getFlowTaskName())).collect(Collectors.toList());
ticketCount.setTicketCompleteNum(ticketCompleteNums.size());
ticketCount.setTenantId(user.getTenantId());
ticketCount.setCreateDept(Long.valueOf(user.getDeptId()));
ticketCount.setCreateUser(user.getUserId());
//3. 延期数据量
List<WorkTicketInfoEntity> ticketDelayNums = values.stream().filter(item -> "延期".equals(item.getInput())).collect(Collectors.toList());
List<WorkTicketInfoEntity> ticketDelayNums =
values.stream().filter(item -> "延期".equals(item.getInput())).collect(Collectors.toList());
ticketCount.setTicketDelayNum(ticketDelayNums.size());
//4. 合格数量
List<Long> ticketIdList = values.stream().map(item -> item.getId()).collect(Collectors.toList());
@ -413,4 +425,16 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
}
return ticketCountList;
}
/**
* date转string
*
* @param dateTime
* @return
*/
private String getTimeString(Date dateTime) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
return sdf.format(dateTime);
}
}

3
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/ticket/TicketCountVo.java

@ -13,4 +13,7 @@ public class TicketCountVo {
private String keyword;
private String dateTime;
}

5
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/IWorkTicketInfoService.java

@ -2,7 +2,6 @@ package com.hnac.hzims.ticket.workTicket.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
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.process.WorkTicketVo;
@ -158,9 +157,11 @@ public interface IWorkTicketInfoService extends BaseService<WorkTicketInfoEntity
/**
* 根据部门Id数组查询工作票数据
*
* @param createDept
* @param ticketType
* @param dateTime
* @return
*/
List<WorkTicketInfoEntity> selectTicketByDeptIdWithTicketType(List<Long> createDept, String ticketType);
List<WorkTicketInfoEntity> selectTicketByDeptIdWithTicketType(List<Long> createDept, String ticketType, String dateTime);
}

13
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java

@ -20,14 +20,12 @@ import com.hnac.hzims.operational.maintenance.dto.OperMaintenanceTaskDTO;
import com.hnac.hzims.operational.maintenance.feign.ITaskClient;
import com.hnac.hzims.ticket.allTicket.entity.TicketInfoEvaluateEntity;
import com.hnac.hzims.ticket.allTicket.service.TicketInfoEvaluateService;
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.aspect.AroundFlow;
import com.hnac.hzims.ticket.constants.TicketConstants;
import com.hnac.hzims.ticket.twoTicket.entity.TicketInfoDanger;
import com.hnac.hzims.ticket.twoTicket.entity.WorkTicketFinish;
import com.hnac.hzims.ticket.twoTicket.enums.FlowWorkTicketConstants;
import com.hnac.hzims.ticket.twoTicket.service.TicketInfoDangerService;
import com.hnac.hzims.ticket.twoTicket.service.impl.WorkTicketFinishServiceImpl;
import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo;
@ -44,7 +42,6 @@ import com.hnac.hzims.ticket.workTicket.wrapper.WorkTicketInfoWrapper;
import com.hnac.hzims.vo.SafeCheckStatisticVO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import lombok.var;
import org.apache.commons.collections.map.HashedMap;
import org.apache.poi.ss.usermodel.Workbook;
import org.springblade.core.log.exception.ServiceException;
@ -1100,13 +1097,15 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl<WorkTicketInfoMap
*
* @param createDept
* @param ticketType
* @param dateTime
* @return
*/
@Override
public List<WorkTicketInfoEntity> selectTicketByDeptIdWithTicketType(List<Long> createDept, String ticketType) {
LambdaQueryWrapper<WorkTicketInfoEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(WorkTicketInfoEntity::getType,ticketType);
queryWrapper.in(BaseEntity::getCreateDept,createDept);
public List<WorkTicketInfoEntity> selectTicketByDeptIdWithTicketType(List<Long> createDept, String ticketType, String dateTime) {
QueryWrapper<WorkTicketInfoEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(WorkTicketInfoEntity::getType, ticketType);
queryWrapper.lambda().in(BaseEntity::getCreateDept, createDept);
queryWrapper.apply("date_format(CREATE_TIME,'%Y-%m') = {0}" , dateTime);
return baseMapper.selectList(queryWrapper);
}
}

Loading…
Cancel
Save