Browse Source

两票生成月报生成修改

zhongwei
段飞宇 1 year ago
parent
commit
6b022b9da4
  1. 5
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketInfoService.java
  2. 14
      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

5
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.DoublePassRateVO;
import com.hnac.hzims.ticket.allTicket.vo.TicketInfoStatisticVO; import com.hnac.hzims.ticket.allTicket.vo.TicketInfoStatisticVO;
import com.hnac.hzims.ticket.areamonthly.vo.StandardTicketVo; 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.areamonthly.vo.StandardTicketWithAreaVo;
import com.hnac.hzims.ticket.standardTicket.dto.StandardTicketInfoDto; import com.hnac.hzims.ticket.standardTicket.dto.StandardTicketInfoDto;
import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity; import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity;
@ -120,9 +119,11 @@ public interface IStandardTicketInfoService extends BaseService<StandardTicketIn
/** /**
* 根据部门Id数组查询操作票数据 * 根据部门Id数组查询操作票数据
*
* @param createDept * @param createDept
* @param ticketType * @param ticketType
* @param dateTime
* @return * @return
*/ */
List<StandardTicketInfoEntity> selectStandardTicketByDeptIdWithTicketType(List<Long> createDept, String ticketType); List<StandardTicketInfoEntity> selectStandardTicketByDeptIdWithTicketType(List<Long> createDept, String ticketType, String dateTime);
} }

14
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.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; 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.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hnac.hzims.ticket.allTicket.entity.TicketInfoEvaluateEntity; 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.DoublePassVO;
import com.hnac.hzims.ticket.allTicket.vo.TicketInfoStatisticVO; import com.hnac.hzims.ticket.allTicket.vo.TicketInfoStatisticVO;
import com.hnac.hzims.ticket.areamonthly.vo.StandardTicketVo; 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.areamonthly.vo.StandardTicketWithAreaVo;
import com.hnac.hzims.ticket.constants.DictConstants; import com.hnac.hzims.ticket.constants.DictConstants;
import com.hnac.hzims.ticket.constants.TicketConstants; import com.hnac.hzims.ticket.constants.TicketConstants;
@ -423,6 +420,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
/** /**
* 封装Vo * 封装Vo
*
* @param standardTicketInfoVo * @param standardTicketInfoVo
* @param standardTicketInfoEntity * @param standardTicketInfoEntity
*/ */
@ -707,13 +705,15 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
* *
* @param createDept * @param createDept
* @param ticketType * @param ticketType
* @param dateTime
* @return * @return
*/ */
@Override @Override
public List<StandardTicketInfoEntity> selectStandardTicketByDeptIdWithTicketType(List<Long> createDept, String ticketType) { public List<StandardTicketInfoEntity> selectStandardTicketByDeptIdWithTicketType(List<Long> createDept, String ticketType, String dateTime) {
LambdaQueryWrapper<StandardTicketInfoEntity> queryWrapper = new LambdaQueryWrapper<>(); QueryWrapper<StandardTicketInfoEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(StandardTicketInfoEntity::getTicketType,ticketType); queryWrapper.lambda().eq(StandardTicketInfoEntity::getTicketType, ticketType);
queryWrapper.in(StandardTicketInfoEntity::getCreateDept,createDept); queryWrapper.lambda().in(StandardTicketInfoEntity::getCreateDept, createDept);
queryWrapper.apply("date_format(CREATE_TIME,'%Y-%m') = {0}", dateTime);
return baseMapper.selectList(queryWrapper); 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 org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.time.YearMonth;
import java.util.List; 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.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.ThreadPoolExecutor;
@ -90,7 +91,6 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
//根据登录人查询所属机构及下属机构 //根据登录人查询所属机构及下属机构
BladeUser user = AuthUtil.getUser(); BladeUser user = AuthUtil.getUser();
List<Long> createDept = userClient.getDataScope(user.getUserId()); List<Long> createDept = userClient.getDataScope(user.getUserId());
System.out.println("createDept = " + createDept);
//根据月份查询统计的数据 //根据月份查询统计的数据
CompletableFuture<List<TicketCount>> ticketCountsCompletableFuture = CompletableFuture.supplyAsync(() -> { CompletableFuture<List<TicketCount>> ticketCountsCompletableFuture = CompletableFuture.supplyAsync(() -> {
LambdaQueryWrapper<TicketCount> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TicketCount> queryWrapper = new LambdaQueryWrapper<>();
@ -132,7 +132,8 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
}, executor); }, 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) { public List<TicketCountResponseVo> selectTicketCountLlist(TicketCountVo ticketCountVo) {
//获取keyword //获取keyword
String keyword = ticketCountVo.getKeyword(); String keyword = ticketCountVo.getKeyword();
String dateTime = ticketCountVo.getDateTime();
QueryWrapper<TicketCount> ticketCountQueryWrapper = new QueryWrapper<>(); QueryWrapper<TicketCount> ticketCountQueryWrapper = new QueryWrapper<>();
ticketCountQueryWrapper.like(StringUtils.isNotBlank(keyword), "dept_name", keyword); ticketCountQueryWrapper.like(StringUtils.isNotBlank(keyword), "dept_name", keyword);
ticketCountQueryWrapper.eq(StringUtils.isNotBlank(dateTime), "date_time", dateTime);
List<TicketCount> ticketCounts = baseMapper.selectList(ticketCountQueryWrapper); List<TicketCount> ticketCounts = baseMapper.selectList(ticketCountQueryWrapper);
List<TicketCountResponseVo> result = getTicketCountResponseList(ticketCounts); List<TicketCountResponseVo> result = getTicketCountResponseList(ticketCounts);
return result; return result;
@ -300,7 +303,8 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
* @return * @return
*/ */
private List<TicketCount> getStandardTicketCountList(List<Long> createDept, List<TicketCount> items, String ticketType, String dateTime, BladeUser user) { 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)) { if (CollectionUtils.isEmpty(ticketInfoEntities)) {
return null; return null;
} }
@ -361,8 +365,13 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
* @param user * @param user
* @return * @return
*/ */
private List<TicketCount> getTicketCountList(List<Long> createDept, List<TicketCount> items, String ticketType, String dateTime, BladeUser user) { private List<TicketCount> getTicketCountList(List<Long> createDept,
List<WorkTicketInfoEntity> ticketInfoEntities = workTicketInfoService.selectTicketByDeptIdWithTicketType(createDept, ticketType); List<TicketCount> items,
String ticketType,
String dateTime,
BladeUser user) {
List<WorkTicketInfoEntity> ticketInfoEntities =
workTicketInfoService.selectTicketByDeptIdWithTicketType(createDept, ticketType,dateTime);
if (CollectionUtils.isEmpty(ticketInfoEntities)) { if (CollectionUtils.isEmpty(ticketInfoEntities)) {
return null; return null;
} }
@ -391,16 +400,19 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
List<WorkTicketInfoEntity> values = entry.getValue(); List<WorkTicketInfoEntity> values = entry.getValue();
ticketCount.setTicketType(CollectionUtils.isNotEmpty(values) ? values.get(0).getType() : ticketType); ticketCount.setTicketType(CollectionUtils.isNotEmpty(values) ? values.get(0).getType() : ticketType);
//1. 开票数量 //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()); ticketCount.setTicketNumber(ticketNumbers.size());
//2. 完成数量 //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.setTicketCompleteNum(ticketCompleteNums.size());
ticketCount.setTenantId(user.getTenantId()); ticketCount.setTenantId(user.getTenantId());
ticketCount.setCreateDept(Long.valueOf(user.getDeptId())); ticketCount.setCreateDept(Long.valueOf(user.getDeptId()));
ticketCount.setCreateUser(user.getUserId()); ticketCount.setCreateUser(user.getUserId());
//3. 延期数据量 //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()); ticketCount.setTicketDelayNum(ticketDelayNums.size());
//4. 合格数量 //4. 合格数量
List<Long> ticketIdList = values.stream().map(item -> item.getId()).collect(Collectors.toList()); 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; 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 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.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.StandardTicketWithAreaVo;
import com.hnac.hzims.ticket.areamonthly.vo.StandardWorkVo; import com.hnac.hzims.ticket.areamonthly.vo.StandardWorkVo;
import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo; import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo;
@ -158,9 +157,11 @@ public interface IWorkTicketInfoService extends BaseService<WorkTicketInfoEntity
/** /**
* 根据部门Id数组查询工作票数据 * 根据部门Id数组查询工作票数据
*
* @param createDept * @param createDept
* @param ticketType * @param ticketType
* @param dateTime
* @return * @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.operational.maintenance.feign.ITaskClient;
import com.hnac.hzims.ticket.allTicket.entity.TicketInfoEvaluateEntity; import com.hnac.hzims.ticket.allTicket.entity.TicketInfoEvaluateEntity;
import com.hnac.hzims.ticket.allTicket.service.TicketInfoEvaluateService; 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.StandardTicketWithAreaVo;
import com.hnac.hzims.ticket.areamonthly.vo.StandardWorkVo; import com.hnac.hzims.ticket.areamonthly.vo.StandardWorkVo;
import com.hnac.hzims.ticket.aspect.AroundFlow; import com.hnac.hzims.ticket.aspect.AroundFlow;
import com.hnac.hzims.ticket.constants.TicketConstants; import com.hnac.hzims.ticket.constants.TicketConstants;
import com.hnac.hzims.ticket.twoTicket.entity.TicketInfoDanger; import com.hnac.hzims.ticket.twoTicket.entity.TicketInfoDanger;
import com.hnac.hzims.ticket.twoTicket.entity.WorkTicketFinish; 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.TicketInfoDangerService;
import com.hnac.hzims.ticket.twoTicket.service.impl.WorkTicketFinishServiceImpl; import com.hnac.hzims.ticket.twoTicket.service.impl.WorkTicketFinishServiceImpl;
import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo; 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 com.hnac.hzims.vo.SafeCheckStatisticVO;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import lombok.var;
import org.apache.commons.collections.map.HashedMap; import org.apache.commons.collections.map.HashedMap;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;
@ -1100,13 +1097,15 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl<WorkTicketInfoMap
* *
* @param createDept * @param createDept
* @param ticketType * @param ticketType
* @param dateTime
* @return * @return
*/ */
@Override @Override
public List<WorkTicketInfoEntity> selectTicketByDeptIdWithTicketType(List<Long> createDept, String ticketType) { public List<WorkTicketInfoEntity> selectTicketByDeptIdWithTicketType(List<Long> createDept, String ticketType, String dateTime) {
LambdaQueryWrapper<WorkTicketInfoEntity> queryWrapper = new LambdaQueryWrapper<>(); QueryWrapper<WorkTicketInfoEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(WorkTicketInfoEntity::getType,ticketType); queryWrapper.lambda().eq(WorkTicketInfoEntity::getType, ticketType);
queryWrapper.in(BaseEntity::getCreateDept,createDept); queryWrapper.lambda().in(BaseEntity::getCreateDept, createDept);
queryWrapper.apply("date_format(CREATE_TIME,'%Y-%m') = {0}" , dateTime);
return baseMapper.selectList(queryWrapper); return baseMapper.selectList(queryWrapper);
} }
} }

Loading…
Cancel
Save