Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
yang_shj 1 year ago
parent
commit
1ea5b12db8
  1. 2
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/SysLogMapper.xml
  2. 5
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/SysLogServiceImpl.java
  3. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyRecController.java
  4. 5
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/IStandardTicketInfoService.java
  5. 1
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/OperationTicketService.java
  6. 61
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java
  7. 17
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketCountController.java
  8. 14
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/handler/TicketCountSheetWriteHandler.java
  9. 78
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketCountServiceImpl.java
  10. 48
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/ticket/StandardTicketCountQueryVo.java
  11. 11
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/ticket/TicketCountQueryVo.java
  12. 38
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/ticket/TicketCountResponseVo.java
  13. 4
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/IWorkTicketInfoService.java
  14. 77
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java

2
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/mapper/SysLogMapper.xml

@ -17,6 +17,7 @@
from hzims_sys_log
where is_deleted = 0
and to_days(operation_time) = to_days(now())
and tenant_id = '200000'
group by module_name;
</select>
<select id="statisticsTitleByModuleName"
@ -25,6 +26,7 @@
from hzims_sys_log
<where>
module_name = #{statisticsVo.moduleName}
and tenant_id = '200000'
<if test="statisticsVo.createTime != null">
and operation_time &gt;= #{statisticsVo.createTime}
</if>

5
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/systemlog/service/impl/SysLogServiceImpl.java

@ -67,10 +67,9 @@ public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> impleme
}
/**
* 日志查询接口
*
* @param sysLog
* @return
*/
@ -122,7 +121,7 @@ public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> impleme
queryWrapper.eq("date_format(operation_time,'%Y-%m')", dateCalculated);
}
queryWrapper.lambda().eq(SysLog::getTenantId, "200000");
queryWrapper.lambda().orderByDesc(SysLog::getOperationTime);
return queryWrapper;

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyRecController.java

@ -137,7 +137,8 @@ public class ImsDutyRecController extends BladeController {
@GetMapping("/getTheCurrentDuty")
@ApiOperationSupport(order = 10)
@ApiOperation(value = "获取当前值班班组")
@OperationAnnotation(title = "交接班管理",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,action
@OperationAnnotation(moduleName = "值班管理",title = "交接班管理",operatorType = OperatorType.MOBILE,businessType =
BusinessType.GENCODE,action
= "获取当前值班班组")
public R<ImsDutyRecVO> getTheCurrentDuty(@ApiParam(value = "机构ID") Long deptId){
if(null == deptId){

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

@ -9,7 +9,8 @@ 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.ticket.StandardTicketCountQueryVo;
import com.hnac.hzims.ticket.twoTicket.vo.ticket.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;
@ -136,5 +137,5 @@ public interface IStandardTicketInfoService extends BaseService<StandardTicketIn
* @param ticketCountQueryVo
* @return
*/
IPage<StandardTicketInfoEntity> listByOperationTicketWithKeyword(Page<StandardTicketInfoEntity> entityPage, TicketCountQueryVo ticketCountQueryVo);
IPage<StandardTicketInfoVO> listByOperationTicketWithKeyword(Page<StandardTicketInfoEntity> entityPage, StandardTicketCountQueryVo ticketCountQueryVo);
}

1
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/OperationTicketService.java

@ -2,7 +2,6 @@ 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;

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

@ -5,6 +5,7 @@ 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.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hnac.hzims.ticket.allTicket.entity.TicketInfoEvaluateEntity;
@ -27,7 +28,8 @@ 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.ticket.StandardTicketCountQueryVo;
import com.hnac.hzims.ticket.twoTicket.vo.ticket.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;
@ -35,6 +37,7 @@ import com.hnac.hzims.ticket.utils.PdfUtils;
import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity;
import com.hnac.hzims.ticket.workTicket.service.IWorkTicketInfoService;
import com.hnac.hzims.ticket.workTicket.vo.TicketMonthVO;
import com.hnac.hzims.ticket.workTicket.vo.WorkTicketInfoVO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@ -45,6 +48,8 @@ import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.DateUtil;
@ -55,6 +60,7 @@ import org.springblade.flow.core.vo.ComleteTask;
import org.springblade.system.cache.DictCache;
import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@ -84,6 +90,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
private final IStandardTicketMeasureService measureService;
private final IWorkTicketInfoService iWorkTicketInfoService;
private final TicketInfoEvaluateService ticketInfoEvaluateService;
private final IUserClient userClient;
@Value("${hzims.ticket.path.xlsx.savePath}")
@ -712,36 +719,60 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
* @return
*/
@Override
public IPage<StandardTicketInfoEntity> listByOperationTicketWithKeyword(Page<StandardTicketInfoEntity> entityPage, TicketCountQueryVo ticketCountQueryVo) {
public IPage<StandardTicketInfoVO> listByOperationTicketWithKeyword(Page<StandardTicketInfoEntity> entityPage,
StandardTicketCountQueryVo ticketCountQueryVo) {
String flowTaskName = ticketCountQueryVo.getFlowTaskName();
String dateTime = ticketCountQueryVo.getDateTime();
String type = ticketCountQueryVo.getType();
QueryWrapper<StandardTicketInfoEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(StringUtils.isNotBlank(type), StandardTicketInfoEntity::getTicketType, type);
Long deptId = ticketCountQueryVo.getDeptId();
BladeUser bladeUser = AuthUtil.getUser();
List<Long> createDept = userClient.getDataScope(bladeUser.getUserId());
StandardTicketInfoDto standardTicketInfoDto = new StandardTicketInfoDto();
BeanUtils.copyProperties(ticketCountQueryVo, standardTicketInfoDto);
LambdaQueryWrapper<StandardTicketInfoEntity> queryWrapper = this.getQueryWrapper(standardTicketInfoDto);
queryWrapper.eq(StringUtils.isNotBlank(type), StandardTicketInfoEntity::getTicketType, type);
queryWrapper.eq(ObjectUtils.isNotEmpty(deptId), StandardTicketInfoEntity::getSignageCode, deptId);
if (ticketCountQueryVo.getCreateDept() == null) {
queryWrapper.in(CollectionUtils.isNotEmpty(createDept), BaseEntity::getCreateDept, createDept);
} else {
queryWrapper.in(BaseEntity::getCreateDept, ticketCountQueryVo.getCreateDept());
}
if (StringUtils.isNotEmpty(flowTaskName)) {
if ("开票".equals(flowTaskName)) {
queryWrapper.lambda().isNotNull(StandardTicketInfoEntity::getFlowTaskName);
queryWrapper.isNotNull(StandardTicketInfoEntity::getFlowTaskName);
} else {
queryWrapper.lambda().eq(StandardTicketInfoEntity::getFlowTaskName, flowTaskName);
queryWrapper.eq(StandardTicketInfoEntity::getFlowTaskName, flowTaskName);
}
}
if (StringUtils.isNotBlank(dateTime)) {
queryWrapper.apply("date_format(create_time,'%Y-%m') = {0}", dateTime);
}
String qualified = ticketCountQueryVo.getQualified();
if (StringUtils.isNoneBlank(qualified) && "合格".equals(qualified)) {
List<StandardTicketInfoEntity> workTicketInfoEntities = baseMapper.selectList(null);
List<StandardTicketInfoEntity> workTicketInfoEntities = baseMapper.selectList(queryWrapper);
List<Long> ticketIdList = workTicketInfoEntities.stream().map(BaseEntity::getId).collect(Collectors.toList());
if (CollectionUtils.isEmpty(ticketIdList)) {
return new Page<StandardTicketInfoVO>();
}
LambdaQueryWrapper<TicketInfoEvaluateEntity> evaluateEntityLambdaQueryWrapper = new LambdaQueryWrapper<>();
evaluateEntityLambdaQueryWrapper.in(TicketInfoEvaluateEntity::getTicketId, ticketIdList);
evaluateEntityLambdaQueryWrapper.eq(BaseEntity::getStatus, 1);
List<TicketInfoEvaluateEntity> evaluateEntities = ticketInfoEvaluateService.list(evaluateEntityLambdaQueryWrapper);
List<Long> idList =
evaluateEntities.stream().map(TicketInfoEvaluateEntity::getTicketId).collect(Collectors.toList());
queryWrapper.lambda().in(BaseEntity::getId, idList);
List<Long> idList = evaluateEntities.stream().map(TicketInfoEvaluateEntity::getTicketId).collect(Collectors.toList());
if (CollectionUtils.isEmpty(idList)) {
return new Page<StandardTicketInfoVO>();
}
if (StringUtils.isNotBlank(dateTime)) {
queryWrapper.apply("date_format(create_time,'%Y-%m') = {0}", dateTime);
queryWrapper.in(BaseEntity::getId, idList);
}
return baseMapper.selectPages(entityPage,queryWrapper);
queryWrapper.orderByDesc(StandardTicketInfoEntity::getCreateTime);
queryWrapper.orderByDesc(BaseEntity::getCreateTime);
Page<StandardTicketInfoEntity> entityPage1 = baseMapper.selectPage(entityPage, queryWrapper);
IPage<StandardTicketInfoVO> page = new Page<>(entityPage1.getCurrent(), entityPage1.getSize(), entityPage1.getTotal());
page.setRecords(StandardTicketInfoWrapper.build().listVO(entityPage1.getRecords()));
return page;
}
}

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

@ -1,24 +1,23 @@
package com.hnac.hzims.ticket.twoTicket.controller;
import cn.hutool.http.server.HttpServerResponse;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.standardTicket.vo.StandardTicketInfoVO;
import com.hnac.hzims.ticket.twoTicket.service.TicketCountService;
import com.hnac.hzims.ticket.twoTicket.vo.TicketCountQueryVo;
import com.hnac.hzims.ticket.twoTicket.vo.ticket.StandardTicketCountQueryVo;
import com.hnac.hzims.ticket.twoTicket.vo.ticket.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 com.hnac.hzims.ticket.workTicket.vo.WorkTicketInfoVO;
import lombok.RequiredArgsConstructor;
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;
/**
@ -82,12 +81,12 @@ public class TicketCountController {
* 查看工作票
*/
@GetMapping("/listByTicketWithKeyword/{page}/{size}")
public R listByTicketWithKeyword(
public R<IPage<WorkTicketInfoVO>> listByTicketWithKeyword(
@PathVariable Long page,
@PathVariable Long size,
TicketCountQueryVo ticketCountQueryVo) {
Page<WorkTicketInfoEntity> entityPage = new Page<>(page,size);
IPage<WorkTicketInfoEntity> workTicketInfoEntities =
IPage<WorkTicketInfoVO> workTicketInfoEntities =
workTicketService.listByTicketWithKeyword(entityPage,ticketCountQueryVo);
return R.data(workTicketInfoEntities);
}
@ -100,9 +99,9 @@ public class TicketCountController {
public R listByOperationTicketWithKeyword(
@PathVariable Long page,
@PathVariable Long size,
TicketCountQueryVo ticketCountQueryVo) {
StandardTicketCountQueryVo ticketCountQueryVo) {
Page<StandardTicketInfoEntity> entityPage = new Page<>(page,size);
IPage<StandardTicketInfoEntity> ticketInfoEntities =
IPage<StandardTicketInfoVO> ticketInfoEntities =
standardTicketInfoService.listByOperationTicketWithKeyword(entityPage,ticketCountQueryVo);
return R.data(ticketInfoEntities);
}

14
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/handler/TicketCountSheetWriteHandler.java

@ -42,10 +42,10 @@ public class TicketCountSheetWriteHandler implements SheetWriteHandler {
CellStyle headerStyle = createHeadCellStyle(workbook);
Sheet sheet = workbook.getSheetAt(0);
sheet.addMergedRegion(new CellRangeAddress(0, 1, 0, 0));
sheet.addMergedRegion(new CellRangeAddress(0, 0, 1, 4));
sheet.addMergedRegion(new CellRangeAddress(0, 0, 5, 8));
sheet.addMergedRegion(new CellRangeAddress(0, 0, 9, 12));
sheet.addMergedRegion(new CellRangeAddress(0, 0, 13, 15));
sheet.addMergedRegion(new CellRangeAddress(0, 0, 1, 7));
sheet.addMergedRegion(new CellRangeAddress(0, 0, 8, 14));
sheet.addMergedRegion(new CellRangeAddress(0, 0, 15, 21));
sheet.addMergedRegion(new CellRangeAddress(0, 0, 22, 25));
sheet.setHorizontallyCenter(true);
sheet.setVerticallyCenter(true);
sheet.setDefaultRowHeight((short) 20);
@ -62,16 +62,16 @@ public class TicketCountSheetWriteHandler implements SheetWriteHandler {
cell.setCellStyle(headerStyle);
Cell cell1 = row1.createCell(5);
Cell cell1 = row1.createCell(8);
cell1.setCellValue("第二种工作票");
cell1.setCellStyle(headerStyle);
Cell cell2 = row1.createCell(9);
Cell cell2 = row1.createCell(15);
cell2.setCellValue("机械工作票");
cell2.setCellStyle(headerStyle);
Cell cell3 = row1.createCell(13);
Cell cell3 = row1.createCell(22);
cell3.setCellValue("倒闸操作票");
cell3.setCellStyle(headerStyle);
}

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

@ -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()) +
"%";
if (CollectionUtils.isNotEmpty(evaluateEntities)) {
String percentPassTicketNum = (1 / evaluateEntities.size()) == 0 ? "0%" :
(1 / evaluateEntities.size()) + "%";
ticketCount.setPercentPassTicket(percentPassTicketNum);
}
ticketCountList.add(ticketCount);
}
return ticketCountList;

48
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/ticket/StandardTicketCountQueryVo.java

@ -0,0 +1,48 @@
package com.hnac.hzims.ticket.twoTicket.vo.ticket;
import com.hnac.hzims.ticket.standardTicket.dto.StandardTicketInfoDto;
import lombok.Data;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/7/25 9:10
*/
@Data
public class StandardTicketCountQueryVo extends StandardTicketInfoDto {
/**
* 票据类型
*/
private String type;
/**
* 延期
*/
private String input;
/**
* 结束 作废
*/
private String flowTaskName;
/**
* 合格
*/
private String qualified;
/**
* 时间
*/
private String dateTime;
/**
* 站点Id
*/
private Long deptId;
}

11
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/TicketCountQueryVo.java → hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/ticket/TicketCountQueryVo.java

@ -1,5 +1,6 @@
package com.hnac.hzims.ticket.twoTicket.vo;
package com.hnac.hzims.ticket.twoTicket.vo.ticket;
import com.hnac.hzims.ticket.workTicket.dto.WorkTicketInfoDto;
import lombok.Data;
/**
@ -9,7 +10,7 @@ import lombok.Data;
* @Date 2023/7/24 8:32
*/
@Data
public class TicketCountQueryVo {
public class TicketCountQueryVo extends WorkTicketInfoDto {
/**
* 票据类型
@ -37,4 +38,10 @@ public class TicketCountQueryVo {
* 时间
*/
private String dateTime;
/**
* 站点id
*/
private Long deptId;
}

38
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/ticket/TicketCountResponseVo.java

@ -117,7 +117,7 @@ public class TicketCountResponseVo {
* 第二种工作票延期数量
*/
@ColumnWidth(14)
@ExcelProperty(value = "延期数量", index = 11)
@ExcelProperty(value = "延期数量", index = 12)
private Integer twoTicketDelayNum = 0;
@ -125,16 +125,15 @@ public class TicketCountResponseVo {
* 第二种工作票合格数量
*/
@ColumnWidth(14)
@ExcelProperty(value = "合格数量", index = 12)
@ExcelProperty(value = "合格数量", index = 13)
private Integer twoTicketProportionNum = 0;
/**
* 第二种工作票合格率
*/
@ColumnWidth(14)
@ExcelProperty(value = "合格率", index = 13)
@ExcelProperty(value = "合格率", index = 14)
private String twoPercentPassTicket = "0";
@ -142,7 +141,7 @@ public class TicketCountResponseVo {
* 水力机械工作票开票数量
*/
@ColumnWidth(14)
@ExcelProperty(value = "开票数量", index = 14)
@ExcelProperty(value = "开票数量", index = 15)
private Integer threeTicketNumber = 0;
@ -150,14 +149,14 @@ public class TicketCountResponseVo {
* 水力机械工作票完成数量
*/
@ColumnWidth(14)
@ExcelProperty(value = "完成数量", index = 15)
@ExcelProperty(value = "完成数量", index = 16)
private Integer threeTicketCompleteNum = 0;
/**
* 水力机械工作票错票数量
*/
@ColumnWidth(14)
@ExcelProperty(value = "错票数量", index = 16)
@ExcelProperty(value = "错票数量", index = 17)
private Integer threeWrongTicketNum = 0;
@ -165,7 +164,7 @@ public class TicketCountResponseVo {
* 水力机械工作废票数量
*/
@ColumnWidth(14)
@ExcelProperty(value = "废票数量", index = 17)
@ExcelProperty(value = "废票数量", index = 18)
private Integer threeInvalidatedTicketNumNum = 0;
@ -173,7 +172,7 @@ public class TicketCountResponseVo {
* 水力机械工作票延期数量
*/
@ColumnWidth(14)
@ExcelProperty(value = "延期数量", index = 18)
@ExcelProperty(value = "延期数量", index = 19)
private Integer threeTicketDelayNum = 0;
@ -181,7 +180,7 @@ public class TicketCountResponseVo {
* 水力机械工作票合格数量
*/
@ColumnWidth(14)
@ExcelProperty(value = "合格数量", index = 19)
@ExcelProperty(value = "合格数量", index = 20)
private Integer threeTicketProportionNum = 0;
@ -189,16 +188,15 @@ public class TicketCountResponseVo {
* 水力机械工作票票合格率
*/
@ColumnWidth(14)
@ExcelProperty(value = "合格率", index = 20)
@ExcelProperty(value = "合格率", index = 21)
private String threePercentPassTicket = "0";
/**
* 操作票开票数量
*/
@ColumnWidth(14)
@ExcelProperty(value = "开票数量", index = 21)
@ExcelProperty(value = "开票数量", index = 22)
private Integer fourTicketNumber = 0;
@ -206,7 +204,7 @@ public class TicketCountResponseVo {
* 操作票开票完成数量
*/
@ColumnWidth(14)
@ExcelProperty(value = "完成数量", index = 22)
@ExcelProperty(value = "完成数量", index = 23)
private Integer fourTicketCompleteNum = 0;
@ -221,17 +219,23 @@ public class TicketCountResponseVo {
* 操作票作票合格数量
*/
@ColumnWidth(14)
@ExcelProperty(value = "合格数量", index = 23)
@ExcelProperty(value = "合格数量", index = 24)
private Integer fourTicketProportionNum = 0;
/**
* 操作票合格率
*/
@ColumnWidth(14)
@ExcelProperty(value = "合格数量", index = 24)
@ExcelProperty(value = "合格", index = 25)
private String fourPercentPassTicket = "0";
/**
* 机构名称
*/
@ExcelIgnore
private Long deptId;
}

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

@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.ticket.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;
@ -177,5 +177,5 @@ public interface IWorkTicketInfoService extends BaseService<WorkTicketInfoEntity
* @param ticketCountQueryVo
* @return
*/
IPage<WorkTicketInfoEntity> listByTicketWithKeyword(Page<WorkTicketInfoEntity> entityPage, TicketCountQueryVo ticketCountQueryVo);
IPage<WorkTicketInfoVO> listByTicketWithKeyword(Page<WorkTicketInfoEntity> entityPage, TicketCountQueryVo ticketCountQueryVo);
}

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

@ -30,7 +30,7 @@ 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.ticket.TicketCountQueryVo;
import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo;
import com.hnac.hzims.ticket.utils.ExcelUtil;
import com.hnac.hzims.ticket.workTicket.dto.*;
@ -53,6 +53,7 @@ import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.*;
@ -1021,8 +1022,7 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl<WorkTicketInfoMap
//成员信息
if (workTicketInfo.getClassGroupMembersName() == null) {
workTicketInfo.setClassGroupMembersName(sb.toString().endsWith(",") ?
sb.toString().substring(0, sb.length() - 1) : sb.toString());
workTicketInfo.setClassGroupMembersName(sb.toString().endsWith(",") ? sb.toString().substring(0, sb.length() - 1) : sb.toString());
}
}
@ -1063,28 +1063,22 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl<WorkTicketInfoMap
//6.工作开始时间和结束时间
List<WorkTicketOperateTimeEntity> workTicketOperateTimeEntities =
workTicketOperateTimeService.selectByTicketId(ticketId);
List<WorkTicketOperateTimeEntity> workTicketOperateTimeEntities = workTicketOperateTimeService.selectByTicketId(ticketId);
if (CollectionUtils.isNotEmpty(workTicketOperateTimeEntities)) {
workTicketVo.setWorkTicketOperateTimeEntities(workTicketOperateTimeEntities);
}
//7. 工作票负责人变更
WorkTicketPrincipalChangeEntity workTicketPrincipalChangeEntity =
workTicketPrincipalChangeService.selectByTicketId(ticketId);
WorkTicketPrincipalChangeEntity workTicketPrincipalChangeEntity = workTicketPrincipalChangeService.selectByTicketId(ticketId);
if (ObjectUtils.isNotEmpty(workTicketPrincipalChangeEntity)) {
//原负责人
if (workTicketPrincipalChangeEntity.getInitialPrincipal() != null) {
workTicketPrincipalChangeEntity.setInitialPrincipalName(
UserCache.getUser(workTicketPrincipalChangeEntity.getInitialPrincipal()).getName()
);
workTicketPrincipalChangeEntity.setInitialPrincipalName(UserCache.getUser(workTicketPrincipalChangeEntity.getInitialPrincipal()).getName());
}
//变更负责人
if (workTicketPrincipalChangeEntity.getChangePrincipal() != null) {
workTicketPrincipalChangeEntity.setChangePrincipalName(
UserCache.getUser(workTicketPrincipalChangeEntity.getChangePrincipal()).getName()
);
workTicketPrincipalChangeEntity.setChangePrincipalName(UserCache.getUser(workTicketPrincipalChangeEntity.getChangePrincipal()).getName());
}
workTicketVo.setWorkTicketPrincipalChange(workTicketPrincipalChangeEntity);
@ -1139,7 +1133,7 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl<WorkTicketInfoMap
* @return
*/
@Override
public IPage<WorkTicketInfoEntity> listByTicketWithKeyword(Page<WorkTicketInfoEntity> entityPage, TicketCountQueryVo ticketCountQueryVo) {
public IPage<WorkTicketInfoVO> listByTicketWithKeyword(Page<WorkTicketInfoEntity> entityPage, TicketCountQueryVo ticketCountQueryVo) {
//延期
String input = ticketCountQueryVo.getInput();
//开票 结束 作废
@ -1150,36 +1144,65 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl<WorkTicketInfoMap
String type = ticketCountQueryVo.getType();
String dateTime = ticketCountQueryVo.getDateTime();
//查询
QueryWrapper<WorkTicketInfoEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(StringUtils.isNotBlank(type), WorkTicketInfoEntity::getType,
type);
queryWrapper.lambda().eq(StringUtils.isNotEmpty(input), WorkTicketInfoEntity::getInput, input);
Long deptId = ticketCountQueryVo.getDeptId();
BladeUser bladeUser = AuthUtil.getUser();
List<Long> createDept = userClient.getDataScope(bladeUser.getUserId());
//查询
WorkTicketInfoDto workTicketInfoDto = new WorkTicketInfoDto();
BeanUtils.copyProperties(ticketCountQueryVo, workTicketInfoDto);
LambdaQueryWrapper<WorkTicketInfoEntity> queryWrapper = this.getQueryWrapper(workTicketInfoDto);
queryWrapper.eq(StringUtils.isNotBlank(type), WorkTicketInfoEntity::getType, type);
queryWrapper.eq(StringUtils.isNotEmpty(input), WorkTicketInfoEntity::getInput, input);
queryWrapper.eq(ObjectUtils.isNotEmpty(deptId), WorkTicketInfoEntity::getSignageCode, deptId);
if (ticketCountQueryVo.getCreateDept() == null) {
queryWrapper.in(CollectionUtils.isNotEmpty(createDept), BaseEntity::getCreateDept, createDept);
} else {
queryWrapper.in(BaseEntity::getCreateDept, ticketCountQueryVo.getCreateDept());
}
if (StringUtils.isNotEmpty(flowTaskName)) {
if ("开票".equals(flowTaskName)) {
queryWrapper.lambda().isNotNull(WorkTicketInfoEntity::getFlowTaskName);
queryWrapper.isNotNull(WorkTicketInfoEntity::getFlowTaskName);
} else {
queryWrapper.lambda().eq(WorkTicketInfoEntity::getFlowTaskName, flowTaskName);
queryWrapper.eq(WorkTicketInfoEntity::getFlowTaskName, flowTaskName);
}
}
if (StringUtils.isNotBlank(dateTime)) {
queryWrapper.apply("date_format(create_time,'%Y-%m') = {0}", dateTime);
}
//合格
if (StringUtils.isNoneBlank(qualified) && "合格".equals(qualified)) {
List<WorkTicketInfoEntity> workTicketInfoEntities = baseMapper.selectList(null);
List<WorkTicketInfoEntity> workTicketInfoEntities = baseMapper.selectList(queryWrapper);
List<Long> ticketIdList = workTicketInfoEntities.stream().map(BaseEntity::getId).collect(Collectors.toList());
if (CollectionUtils.isEmpty(ticketIdList)) {
return new Page<WorkTicketInfoVO>();
}
LambdaQueryWrapper<TicketInfoEvaluateEntity> evaluateEntityLambdaQueryWrapper = new LambdaQueryWrapper<>();
evaluateEntityLambdaQueryWrapper.in(TicketInfoEvaluateEntity::getTicketId, ticketIdList);
evaluateEntityLambdaQueryWrapper.eq(BaseEntity::getStatus, 1);
List<TicketInfoEvaluateEntity> evaluateEntities = ticketInfoEvaluateService.list(evaluateEntityLambdaQueryWrapper);
List<Long> idList =
evaluateEntities.stream().map(TicketInfoEvaluateEntity::getTicketId).collect(Collectors.toList());
queryWrapper.lambda().in(BaseEntity::getId, idList);
List<Long> idList = evaluateEntities.stream().map(TicketInfoEvaluateEntity::getTicketId).collect(Collectors.toList());
if (CollectionUtils.isEmpty(idList)) {
return new Page<WorkTicketInfoVO>();
}
queryWrapper.in(BaseEntity::getId, idList);
}
return baseMapper.selectPages(entityPage,queryWrapper);
queryWrapper.orderByDesc(BaseEntity::getCreateTime);
Page<WorkTicketInfoEntity> pages = this.page(entityPage, queryWrapper);
//数据转换
IPage<WorkTicketInfoVO> workTicketInfoVOIPage = new Page<>(pages.getCurrent(), pages.getSize());
workTicketInfoVOIPage.setRecords(WorkTicketInfoWrapper.build().listVO(pages.getRecords()));
workTicketInfoVOIPage.setPages(pages.getPages());
workTicketInfoVOIPage.setTotal(pages.getTotal());
//获取创建人
workTicketInfoVOIPage.getRecords().forEach(item -> {
User user = UserCache.getUser(item.getCreateUser());
if (user != null) {
item.setCreateUserName(user.getName());
}
});
return workTicketInfoVOIPage;
}
}

Loading…
Cancel
Save