|
|
@ -2,14 +2,17 @@ package com.hnac.hzims.ticket.standardTicket.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import cn.afterturn.easypoi.excel.entity.TemplateExportParams; |
|
|
|
import cn.afterturn.easypoi.excel.entity.TemplateExportParams; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
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.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Assert; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
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.allTicket.vo.DoublePassRateVO; |
|
|
|
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.StandardTicketVo; |
|
|
|
|
|
|
|
import com.hnac.hzims.ticket.areamonthly.vo.AreaMonthlyVo; |
|
|
|
import com.hnac.hzims.ticket.constants.TicketConstants; |
|
|
|
import com.hnac.hzims.ticket.constants.TicketConstants; |
|
|
|
import com.hnac.hzims.ticket.standardTicket.dto.StandardTicketInfoDto; |
|
|
|
import com.hnac.hzims.ticket.standardTicket.dto.StandardTicketInfoDto; |
|
|
|
import com.hnac.hzims.ticket.standardTicket.dto.StandardTicketMeasureDto; |
|
|
|
import com.hnac.hzims.ticket.standardTicket.dto.StandardTicketMeasureDto; |
|
|
@ -33,7 +36,6 @@ import org.springblade.core.log.exception.ServiceException; |
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
import org.springblade.core.mp.support.Condition; |
|
|
|
import org.springblade.core.mp.support.Condition; |
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
@ -41,6 +43,7 @@ import org.springblade.core.tool.utils.Func; |
|
|
|
import org.springblade.core.tool.utils.ObjectUtil; |
|
|
|
import org.springblade.core.tool.utils.ObjectUtil; |
|
|
|
import org.springblade.flow.core.feign.IFlowClient; |
|
|
|
import org.springblade.flow.core.feign.IFlowClient; |
|
|
|
import org.springblade.flow.core.vo.ComleteTask; |
|
|
|
import org.springblade.flow.core.vo.ComleteTask; |
|
|
|
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
@ -48,9 +51,7 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.math.RoundingMode; |
|
|
|
import java.math.RoundingMode; |
|
|
|
import java.time.LocalDate; |
|
|
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.LocalTime; |
|
|
|
|
|
|
|
import java.time.YearMonth; |
|
|
|
import java.time.YearMonth; |
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
import java.time.temporal.TemporalAdjusters; |
|
|
|
import java.time.temporal.TemporalAdjusters; |
|
|
@ -88,8 +89,8 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public R<StandardTicketInfoVO> detail(Long id) { |
|
|
|
public R<StandardTicketInfoVO> detail(Long id) { |
|
|
|
StandardTicketInfoEntity standardTicketInfoEntity = this.getById(id); |
|
|
|
StandardTicketInfoEntity standardTicketInfoEntity = this.getById(id); |
|
|
|
if(ObjectUtil.isEmpty(standardTicketInfoEntity)){ |
|
|
|
if (ObjectUtil.isEmpty(standardTicketInfoEntity)) { |
|
|
|
return R.fail(400,"未查询到相关记录"); |
|
|
|
return R.fail(400, "未查询到相关记录"); |
|
|
|
} |
|
|
|
} |
|
|
|
StandardTicketInfoVO standardTicketInfoVO = StandardTicketInfoWrapper.build().entityVO(standardTicketInfoEntity); |
|
|
|
StandardTicketInfoVO standardTicketInfoVO = StandardTicketInfoWrapper.build().entityVO(standardTicketInfoEntity); |
|
|
|
/**完善安全措施执行情况列表**/ |
|
|
|
/**完善安全措施执行情况列表**/ |
|
|
@ -104,7 +105,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke |
|
|
|
public R<IPage<StandardTicketInfoVO>> queryList(StandardTicketInfoDto req, Query query) { |
|
|
|
public R<IPage<StandardTicketInfoVO>> queryList(StandardTicketInfoDto req, Query query) { |
|
|
|
LambdaQueryWrapper<StandardTicketInfoEntity> queryWrapper = this.getQueryWrapper(req); |
|
|
|
LambdaQueryWrapper<StandardTicketInfoEntity> queryWrapper = this.getQueryWrapper(req); |
|
|
|
queryWrapper.orderByDesc(StandardTicketInfoEntity::getCreateTime); |
|
|
|
queryWrapper.orderByDesc(StandardTicketInfoEntity::getCreateTime); |
|
|
|
IPage pages = super.page(Condition.getPage(query),queryWrapper); |
|
|
|
IPage pages = super.page(Condition.getPage(query), queryWrapper); |
|
|
|
return R.data(pages.setRecords(StandardTicketInfoWrapper.build().listVO(pages.getRecords()))); |
|
|
|
return R.data(pages.setRecords(StandardTicketInfoWrapper.build().listVO(pages.getRecords()))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -117,42 +118,42 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
@Transactional |
|
|
|
public R doSave(StandardTicketInfoDto req) { |
|
|
|
public R doSave(StandardTicketInfoDto req) { |
|
|
|
if(CollectionUtil.isEmpty(req.getWorkTicketSafetyMeasureDtoList())){ |
|
|
|
if (CollectionUtil.isEmpty(req.getWorkTicketSafetyMeasureDtoList())) { |
|
|
|
return R.fail("请选择对应的安全措施"); |
|
|
|
return R.fail("请选择对应的安全措施"); |
|
|
|
} |
|
|
|
} |
|
|
|
req.setCode(this.getOperateTicketCode()); |
|
|
|
req.setCode(this.getOperateTicketCode()); |
|
|
|
req.setIssueOrderTime(LocalDateTime.now()); |
|
|
|
req.setIssueOrderTime(LocalDateTime.now()); |
|
|
|
req.setStatus(TicketConstants.StandardTicketStatusEnum.GUARDIAN_CONFIRM.getStatus()); |
|
|
|
req.setStatus(TicketConstants.StandardTicketStatusEnum.GUARDIAN_CONFIRM.getStatus()); |
|
|
|
boolean flag = this.save(req); |
|
|
|
boolean flag = this.save(req); |
|
|
|
if(!flag){ |
|
|
|
if (!flag) { |
|
|
|
return R.fail("保存标准票失败!"); |
|
|
|
return R.fail("保存标准票失败!"); |
|
|
|
} |
|
|
|
} |
|
|
|
req.getWorkTicketSafetyMeasureDtoList().forEach(standardTicketMeasureEntity -> { |
|
|
|
req.getWorkTicketSafetyMeasureDtoList().forEach(standardTicketMeasureEntity -> { |
|
|
|
standardTicketMeasureEntity.setTicketId(req.getId()); |
|
|
|
standardTicketMeasureEntity.setTicketId(req.getId()); |
|
|
|
}); |
|
|
|
}); |
|
|
|
boolean measureFlag = measureService.saveOrUpdateBatch(req.getWorkTicketSafetyMeasureDtoList()); |
|
|
|
boolean measureFlag = measureService.saveOrUpdateBatch(req.getWorkTicketSafetyMeasureDtoList()); |
|
|
|
if(!measureFlag){ |
|
|
|
if (!measureFlag) { |
|
|
|
return R.fail(400,"保存安全措施失败"); |
|
|
|
return R.fail(400, "保存安全措施失败"); |
|
|
|
} |
|
|
|
} |
|
|
|
/*开启工作流*/ |
|
|
|
/*开启工作流*/ |
|
|
|
String processInstanceId = this.startProcessInstance(standardFlowKey,req); |
|
|
|
String processInstanceId = this.startProcessInstance(standardFlowKey, req); |
|
|
|
return R.status(this.update( |
|
|
|
return R.status(this.update( |
|
|
|
Wrappers.<StandardTicketInfoEntity>lambdaUpdate() |
|
|
|
Wrappers.<StandardTicketInfoEntity>lambdaUpdate() |
|
|
|
.set(StandardTicketInfoEntity::getProcessInstanceId,processInstanceId) |
|
|
|
.set(StandardTicketInfoEntity::getProcessInstanceId, processInstanceId) |
|
|
|
.eq(StandardTicketInfoEntity::getId,req.getId()) |
|
|
|
.eq(StandardTicketInfoEntity::getId, req.getId()) |
|
|
|
)); |
|
|
|
)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public R completeTask(StandardTicketInfoDto infoDto, ComleteTask comleteTask) { |
|
|
|
public R completeTask(StandardTicketInfoDto infoDto, ComleteTask comleteTask) { |
|
|
|
/**若完成待监护人确认则设置监护人确认时间**/ |
|
|
|
/**若完成待监护人确认则设置监护人确认时间**/ |
|
|
|
if(TicketConstants.StandardTicketStatusEnum.PRINCIPAL_CONFIRM.getStatus().equals(infoDto.getStatus())){ |
|
|
|
if (TicketConstants.StandardTicketStatusEnum.PRINCIPAL_CONFIRM.getStatus().equals(infoDto.getStatus())) { |
|
|
|
infoDto.setGuardianshipTime(LocalDateTime.now()); |
|
|
|
infoDto.setGuardianshipTime(LocalDateTime.now()); |
|
|
|
infoDto.setPrincipalTime(LocalDateTime.now()); |
|
|
|
infoDto.setPrincipalTime(LocalDateTime.now()); |
|
|
|
this.updateById(infoDto); |
|
|
|
this.updateById(infoDto); |
|
|
|
} |
|
|
|
} |
|
|
|
/**若完成工作负责人确认则设置工作负责人确认时间**/ |
|
|
|
/**若完成工作负责人确认则设置工作负责人确认时间**/ |
|
|
|
else if(TicketConstants.StandardTicketStatusEnum.END.getStatus().equals(infoDto.getStatus())){ |
|
|
|
else if (TicketConstants.StandardTicketStatusEnum.END.getStatus().equals(infoDto.getStatus())) { |
|
|
|
infoDto.setPrincipalTime(LocalDateTime.now()); |
|
|
|
infoDto.setPrincipalTime(LocalDateTime.now()); |
|
|
|
this.updateById(infoDto); |
|
|
|
this.updateById(infoDto); |
|
|
|
//操作票设置默认为合格
|
|
|
|
//操作票设置默认为合格
|
|
|
@ -161,38 +162,37 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke |
|
|
|
ticketInfoEvaluateService.save(evaluateEntity); |
|
|
|
ticketInfoEvaluateService.save(evaluateEntity); |
|
|
|
} |
|
|
|
} |
|
|
|
R completeR = flowClient.completeTask(comleteTask); |
|
|
|
R completeR = flowClient.completeTask(comleteTask); |
|
|
|
if(completeR.isSuccess()){ |
|
|
|
if (completeR.isSuccess()) { |
|
|
|
throw new ServiceException(completeR.getMsg()); |
|
|
|
throw new ServiceException(completeR.getMsg()); |
|
|
|
} |
|
|
|
} |
|
|
|
return R.success("操作成功!"); |
|
|
|
return R.success("操作成功!"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void exportTicketPdf(Long id, HttpServletResponse response){ |
|
|
|
public void exportTicketPdf(Long id, HttpServletResponse response) { |
|
|
|
R<StandardTicketInfoVO> voR = this.detail(id); |
|
|
|
R<StandardTicketInfoVO> voR = this.detail(id); |
|
|
|
if(!voR.isSuccess()){ |
|
|
|
if (!voR.isSuccess()) { |
|
|
|
throw new ServiceException(voR.getMsg()); |
|
|
|
throw new ServiceException(voR.getMsg()); |
|
|
|
} |
|
|
|
} |
|
|
|
StandardTicketInfoVO infoVO = voR.getData(); |
|
|
|
StandardTicketInfoVO infoVO = voR.getData(); |
|
|
|
Map<String,Object> ticketInfoMap = new HashMap<>(); |
|
|
|
Map<String, Object> ticketInfoMap = new HashMap<>(); |
|
|
|
try { |
|
|
|
try { |
|
|
|
ticketInfoMap = PdfUtils.objectToMap(infoVO); |
|
|
|
ticketInfoMap = PdfUtils.objectToMap(infoVO); |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
catch (Exception e) { |
|
|
|
|
|
|
|
log.info("转换对象失败!"); |
|
|
|
log.info("转换对象失败!"); |
|
|
|
} |
|
|
|
} |
|
|
|
/**格式化时间**/ |
|
|
|
/**格式化时间**/ |
|
|
|
ticketInfoMap.put("startTime",DateUtil.format(infoVO.getStartTime(),TicketConstants.TICKET_DATE_PATTERN)); |
|
|
|
ticketInfoMap.put("startTime", DateUtil.format(infoVO.getStartTime(), TicketConstants.TICKET_DATE_PATTERN)); |
|
|
|
ticketInfoMap.put("endTime",DateUtil.format(infoVO.getEndTime(),TicketConstants.TICKET_DATE_PATTERN)); |
|
|
|
ticketInfoMap.put("endTime", DateUtil.format(infoVO.getEndTime(), TicketConstants.TICKET_DATE_PATTERN)); |
|
|
|
ticketInfoMap.put("issueOrderTime",DateUtil.format(infoVO.getIssueOrderTime(),TicketConstants.TICKET_DATE_PATTERN)); |
|
|
|
ticketInfoMap.put("issueOrderTime", DateUtil.format(infoVO.getIssueOrderTime(), TicketConstants.TICKET_DATE_PATTERN)); |
|
|
|
List<StandardTicketMeasureVO> measureVOList = infoVO.getStandardTicketMeasureVOList(); |
|
|
|
List<StandardTicketMeasureVO> measureVOList = infoVO.getStandardTicketMeasureVOList(); |
|
|
|
AtomicInteger index = new AtomicInteger(1); |
|
|
|
AtomicInteger index = new AtomicInteger(1); |
|
|
|
if(CollectionUtil.isNotEmpty(measureVOList)){ |
|
|
|
if (CollectionUtil.isNotEmpty(measureVOList)) { |
|
|
|
List<Map<String,Object>> measureMapList = measureVOList.stream().map(measure->{ |
|
|
|
List<Map<String, Object>> measureMapList = measureVOList.stream().map(measure -> { |
|
|
|
try { |
|
|
|
try { |
|
|
|
Map<String,Object> map = PdfUtils.objectToMap(measure); |
|
|
|
Map<String, Object> map = PdfUtils.objectToMap(measure); |
|
|
|
map.put("index",index.get()); |
|
|
|
map.put("index", index.get()); |
|
|
|
map.put("status",TicketConstants.MATTER_FINISH_STATUS.equals(measure.getStatus()) ? "√" : ""); |
|
|
|
map.put("status", TicketConstants.MATTER_FINISH_STATUS.equals(measure.getStatus()) ? "√" : ""); |
|
|
|
index.getAndIncrement(); |
|
|
|
index.getAndIncrement(); |
|
|
|
return map; |
|
|
|
return map; |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
@ -200,30 +200,30 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
ticketInfoMap.put("measureMapList",measureMapList); |
|
|
|
ticketInfoMap.put("measureMapList", measureMapList); |
|
|
|
} |
|
|
|
} |
|
|
|
//ticketInfoMap.put("stamp_image",stampImageUrl);
|
|
|
|
//ticketInfoMap.put("stamp_image",stampImageUrl);
|
|
|
|
String fileName = TicketConstants.WordFileNameEnum.getFileNameByType(infoVO.getTicketType()) + PdfUtils.XLSX_SUFFIX; |
|
|
|
String fileName = TicketConstants.WordFileNameEnum.getFileNameByType(infoVO.getTicketType()) + PdfUtils.XLSX_SUFFIX; |
|
|
|
TemplateExportParams templateExportParams = new TemplateExportParams("template/" + fileName, true); |
|
|
|
TemplateExportParams templateExportParams = new TemplateExportParams("template/" + fileName, true); |
|
|
|
Workbook workbook = null; |
|
|
|
Workbook workbook = null; |
|
|
|
try { |
|
|
|
try { |
|
|
|
workbook = ExcelUtil.getWorkbook(templateExportParams,ticketInfoMap); |
|
|
|
workbook = ExcelUtil.getWorkbook(templateExportParams, ticketInfoMap); |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
//上传xlsx至服务器
|
|
|
|
//上传xlsx至服务器
|
|
|
|
try { |
|
|
|
try { |
|
|
|
ExcelUtil.upload(workbook,xlsSavePath,infoVO.getTitle()+PdfUtils.XLSX_SUFFIX); |
|
|
|
ExcelUtil.upload(workbook, xlsSavePath, infoVO.getTitle() + PdfUtils.XLSX_SUFFIX); |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
//将xlsx文件转换为pdf并保存
|
|
|
|
//将xlsx文件转换为pdf并保存
|
|
|
|
String pdfFileName = infoVO.getTitle() + PdfUtils.PDF_SUFFIX; |
|
|
|
String pdfFileName = infoVO.getTitle() + PdfUtils.PDF_SUFFIX; |
|
|
|
String xlsFileName = infoVO.getTitle()+PdfUtils.XLSX_SUFFIX; |
|
|
|
String xlsFileName = infoVO.getTitle() + PdfUtils.XLSX_SUFFIX; |
|
|
|
PdfUtils.convertPdf(xlsSavePath, xlsFileName, pdfSavePath, pdfFileName); |
|
|
|
PdfUtils.convertPdf(xlsSavePath, xlsFileName, pdfSavePath, pdfFileName); |
|
|
|
String savePath = pdfSavePath + pdfFileName; |
|
|
|
String savePath = pdfSavePath + pdfFileName; |
|
|
|
// 设置response参数,可以打开下载页面
|
|
|
|
// 设置response参数,可以打开下载页面
|
|
|
|
PdfUtils.readPdf(response,savePath); |
|
|
|
PdfUtils.readPdf(response, savePath); |
|
|
|
//WordUtils.exportWord(wordTemplatePath, ticketInfoMap,"大隆水电站倒闸操作票模板",response);
|
|
|
|
//WordUtils.exportWord(wordTemplatePath, ticketInfoMap,"大隆水电站倒闸操作票模板",response);
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -231,18 +231,18 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke |
|
|
|
@Transactional |
|
|
|
@Transactional |
|
|
|
public R remove(Long id, String comment) { |
|
|
|
public R remove(Long id, String comment) { |
|
|
|
StandardTicketInfoEntity ticketInfoEntity = this.getById(id); |
|
|
|
StandardTicketInfoEntity ticketInfoEntity = this.getById(id); |
|
|
|
if(ObjectUtil.isEmpty(ticketInfoEntity)){ |
|
|
|
if (ObjectUtil.isEmpty(ticketInfoEntity)) { |
|
|
|
return R.fail(400,"未查找到该记录对应的操作票"); |
|
|
|
return R.fail(400, "未查找到该记录对应的操作票"); |
|
|
|
} |
|
|
|
} |
|
|
|
if(Func.isEmpty(ticketInfoEntity.getProcessInstanceId())){ |
|
|
|
if (Func.isEmpty(ticketInfoEntity.getProcessInstanceId())) { |
|
|
|
return R.fail("该操作票未开启工作流"); |
|
|
|
return R.fail("该操作票未开启工作流"); |
|
|
|
} |
|
|
|
} |
|
|
|
this.update(Wrappers.<StandardTicketInfoEntity>lambdaUpdate() |
|
|
|
this.update(Wrappers.<StandardTicketInfoEntity>lambdaUpdate() |
|
|
|
.set(StandardTicketInfoEntity::getStatus,TicketConstants.StandardTicketStatusEnum.TERMINATION.getStatus()) |
|
|
|
.set(StandardTicketInfoEntity::getStatus, TicketConstants.StandardTicketStatusEnum.TERMINATION.getStatus()) |
|
|
|
.eq(StandardTicketInfoEntity::getId,id)); |
|
|
|
.eq(StandardTicketInfoEntity::getId, id)); |
|
|
|
/**删除工作流**/ |
|
|
|
/**删除工作流**/ |
|
|
|
R r = flowClient.delProcessInstanceById(ticketInfoEntity.getProcessInstanceId(),comment); |
|
|
|
R r = flowClient.delProcessInstanceById(ticketInfoEntity.getProcessInstanceId(), comment); |
|
|
|
if(!r.isSuccess()){ |
|
|
|
if (!r.isSuccess()) { |
|
|
|
throw new ServiceException(r.getMsg()); |
|
|
|
throw new ServiceException(r.getMsg()); |
|
|
|
} |
|
|
|
} |
|
|
|
return R.success("删除成功!"); |
|
|
|
return R.success("删除成功!"); |
|
|
@ -251,6 +251,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 获取双票合格率 |
|
|
|
* 获取双票合格率 |
|
|
|
|
|
|
|
* |
|
|
|
* @param depatList |
|
|
|
* @param depatList |
|
|
|
* @param firstDateTime |
|
|
|
* @param firstDateTime |
|
|
|
* @param now |
|
|
|
* @param now |
|
|
@ -260,18 +261,18 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke |
|
|
|
public DoublePassRateVO getDoublePassRate(List<Long> depatList, LocalDateTime firstDateTime, LocalDateTime now) { |
|
|
|
public DoublePassRateVO getDoublePassRate(List<Long> depatList, LocalDateTime firstDateTime, LocalDateTime now) { |
|
|
|
DoublePassRateVO doublePassRateVO = new DoublePassRateVO(); |
|
|
|
DoublePassRateVO doublePassRateVO = new DoublePassRateVO(); |
|
|
|
// 查询操作票
|
|
|
|
// 查询操作票
|
|
|
|
List<StandardTicketInfoEntity> standardList = this.list(new LambdaQueryWrapper<StandardTicketInfoEntity>(){{ |
|
|
|
List<StandardTicketInfoEntity> standardList = this.list(new LambdaQueryWrapper<StandardTicketInfoEntity>() {{ |
|
|
|
ge(StandardTicketInfoEntity::getCreateTime,firstDateTime); |
|
|
|
ge(StandardTicketInfoEntity::getCreateTime, firstDateTime); |
|
|
|
le(StandardTicketInfoEntity::getCreateTime,now); |
|
|
|
le(StandardTicketInfoEntity::getCreateTime, now); |
|
|
|
in(StandardTicketInfoEntity::getCreateDept,depatList); |
|
|
|
in(StandardTicketInfoEntity::getCreateDept, depatList); |
|
|
|
}}); |
|
|
|
}}); |
|
|
|
// 查询工作票
|
|
|
|
// 查询工作票
|
|
|
|
List<WorkTicketInfoEntity> workList = iWorkTicketInfoService.list(new LambdaQueryWrapper<WorkTicketInfoEntity>(){{ |
|
|
|
List<WorkTicketInfoEntity> workList = iWorkTicketInfoService.list(new LambdaQueryWrapper<WorkTicketInfoEntity>() {{ |
|
|
|
ge(WorkTicketInfoEntity::getCreateTime,firstDateTime); |
|
|
|
ge(WorkTicketInfoEntity::getCreateTime, firstDateTime); |
|
|
|
le(WorkTicketInfoEntity::getCreateTime,now); |
|
|
|
le(WorkTicketInfoEntity::getCreateTime, now); |
|
|
|
in(WorkTicketInfoEntity::getCreateDept,depatList); |
|
|
|
in(WorkTicketInfoEntity::getCreateDept, depatList); |
|
|
|
}}); |
|
|
|
}}); |
|
|
|
if(CollectionUtil.isEmpty(standardList) && CollectionUtil.isEmpty(workList)){ |
|
|
|
if (CollectionUtil.isEmpty(standardList) && CollectionUtil.isEmpty(workList)) { |
|
|
|
doublePassRateVO.setDoubleTicketCount(0); |
|
|
|
doublePassRateVO.setDoubleTicketCount(0); |
|
|
|
doublePassRateVO.setDoubleTicketPassCount(0); |
|
|
|
doublePassRateVO.setDoubleTicketPassCount(0); |
|
|
|
doublePassRateVO.setDoublePassRate("0"); |
|
|
|
doublePassRateVO.setDoublePassRate("0"); |
|
|
@ -282,13 +283,13 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke |
|
|
|
standardIdList.addAll(workList.stream().map(WorkTicketInfoEntity::getId).collect(Collectors.toList())); |
|
|
|
standardIdList.addAll(workList.stream().map(WorkTicketInfoEntity::getId).collect(Collectors.toList())); |
|
|
|
doublePassRateVO.setDoubleTicketCount(standardIdList.size()); |
|
|
|
doublePassRateVO.setDoubleTicketCount(standardIdList.size()); |
|
|
|
// 查询合格评价
|
|
|
|
// 查询合格评价
|
|
|
|
List<TicketInfoEvaluateEntity> evaluateList = ticketInfoEvaluateService.list(new LambdaQueryWrapper<TicketInfoEvaluateEntity>(){{ |
|
|
|
List<TicketInfoEvaluateEntity> evaluateList = ticketInfoEvaluateService.list(new LambdaQueryWrapper<TicketInfoEvaluateEntity>() {{ |
|
|
|
ge(TicketInfoEvaluateEntity::getCreateTime,firstDateTime); |
|
|
|
ge(TicketInfoEvaluateEntity::getCreateTime, firstDateTime); |
|
|
|
le(TicketInfoEvaluateEntity::getCreateTime,now); |
|
|
|
le(TicketInfoEvaluateEntity::getCreateTime, now); |
|
|
|
in(TicketInfoEvaluateEntity::getTicketId,standardIdList); |
|
|
|
in(TicketInfoEvaluateEntity::getTicketId, standardIdList); |
|
|
|
eq(TicketInfoEvaluateEntity::getStatus,TicketConstants.TicketQualifiedEnum.Qualified.getCode()); |
|
|
|
eq(TicketInfoEvaluateEntity::getStatus, TicketConstants.TicketQualifiedEnum.Qualified.getCode()); |
|
|
|
}}); |
|
|
|
}}); |
|
|
|
if(CollectionUtil.isEmpty(evaluateList)){ |
|
|
|
if (CollectionUtil.isEmpty(evaluateList)) { |
|
|
|
doublePassRateVO.setDoubleTicketPassCount(0); |
|
|
|
doublePassRateVO.setDoubleTicketPassCount(0); |
|
|
|
doublePassRateVO.setDoublePassRate("0"); |
|
|
|
doublePassRateVO.setDoublePassRate("0"); |
|
|
|
return doublePassRateVO; |
|
|
|
return doublePassRateVO; |
|
|
@ -301,33 +302,66 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 获取首页区域当月操作票/工作票 |
|
|
|
* 获取首页区域当月操作票/工作票 |
|
|
|
|
|
|
|
* |
|
|
|
* @param list |
|
|
|
* @param list |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public R<TicketMonthVO> getOperateWorkStatistic(LocalDateTime firstDateTime,LocalDateTime endDateTime,List<Long> list) { |
|
|
|
public R<TicketMonthVO> getOperateWorkStatistic(LocalDateTime firstDateTime, LocalDateTime endDateTime, List<Long> list) { |
|
|
|
TicketMonthVO ticketMonthVO = new TicketMonthVO(); |
|
|
|
TicketMonthVO ticketMonthVO = new TicketMonthVO(); |
|
|
|
// 查询操作票
|
|
|
|
// 查询操作票
|
|
|
|
getOperateMoth(firstDateTime,endDateTime,list,ticketMonthVO); |
|
|
|
getOperateMoth(firstDateTime, endDateTime, list, ticketMonthVO); |
|
|
|
// 查询工作票
|
|
|
|
// 查询工作票
|
|
|
|
getWorkMoth(firstDateTime,endDateTime,list,ticketMonthVO); |
|
|
|
getWorkMoth(firstDateTime, endDateTime, list, ticketMonthVO); |
|
|
|
return R.data(ticketMonthVO); |
|
|
|
return R.data(ticketMonthVO); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
|
|
|
|
* 根据区域Id 分页查询 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param areaMonthly |
|
|
|
|
|
|
|
* @param searchPage |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public Page<StandardTicketVo> areaMonthlyWithOperation(AreaMonthlyVo areaMonthly, Page<StandardTicketInfoEntity> searchPage) { |
|
|
|
|
|
|
|
QueryWrapper<StandardTicketInfoEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
|
|
|
queryWrapper.eq("CREATE_DEPT", areaMonthly.getAreaId()); |
|
|
|
|
|
|
|
queryWrapper.eq(areaMonthly.getYearMonth() != null, |
|
|
|
|
|
|
|
"date_format(create_time,'%Y-%m')", areaMonthly.getYearMonth()); |
|
|
|
|
|
|
|
Page<StandardTicketInfoEntity> standardTicketInfoEntityPage = baseMapper.selectPage(searchPage, queryWrapper); |
|
|
|
|
|
|
|
//数据转换StandardTicketInfoEntity ==> StandardTicketVo
|
|
|
|
|
|
|
|
List<StandardTicketVo> standardTicketInfoVOList = new ArrayList<>(); |
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(standardTicketInfoEntityPage.getRecords())) { |
|
|
|
|
|
|
|
standardTicketInfoVOList = standardTicketInfoEntityPage.getRecords().stream().map(item -> { |
|
|
|
|
|
|
|
StandardTicketVo standardTicketVo = new StandardTicketVo(); |
|
|
|
|
|
|
|
BeanUtils.copyProperties(item, standardTicketVo); |
|
|
|
|
|
|
|
return standardTicketVo; |
|
|
|
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Page<StandardTicketVo> page = new Page<>(); |
|
|
|
|
|
|
|
page.setSize(standardTicketInfoEntityPage.getSize()); |
|
|
|
|
|
|
|
page.setCurrent(standardTicketInfoEntityPage.getCurrent()); |
|
|
|
|
|
|
|
page.setTotal(standardTicketInfoEntityPage.getTotal()); |
|
|
|
|
|
|
|
page.setRecords(standardTicketInfoVOList); |
|
|
|
|
|
|
|
return page; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 首页-当月操作票获取 |
|
|
|
* 首页-当月操作票获取 |
|
|
|
|
|
|
|
* |
|
|
|
* @param firstDateTime |
|
|
|
* @param firstDateTime |
|
|
|
* @param endDateTime |
|
|
|
* @param endDateTime |
|
|
|
* @param list |
|
|
|
* @param list |
|
|
|
* @param ticketMonthVO |
|
|
|
* @param ticketMonthVO |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void getOperateMoth(LocalDateTime firstDateTime, LocalDateTime endDateTime, List<Long> list, TicketMonthVO ticketMonthVO) { |
|
|
|
private void getOperateMoth(LocalDateTime firstDateTime, LocalDateTime endDateTime, List<Long> list, TicketMonthVO ticketMonthVO) { |
|
|
|
List<StandardTicketInfoEntity> operateList = this.list(new LambdaQueryWrapper<StandardTicketInfoEntity>(){{ |
|
|
|
List<StandardTicketInfoEntity> operateList = this.list(new LambdaQueryWrapper<StandardTicketInfoEntity>() {{ |
|
|
|
ge(StandardTicketInfoEntity::getCreateTime,firstDateTime); |
|
|
|
ge(StandardTicketInfoEntity::getCreateTime, firstDateTime); |
|
|
|
le(StandardTicketInfoEntity::getCreateTime,endDateTime); |
|
|
|
le(StandardTicketInfoEntity::getCreateTime, endDateTime); |
|
|
|
in(StandardTicketInfoEntity::getCreateDept,list); |
|
|
|
in(StandardTicketInfoEntity::getCreateDept, list); |
|
|
|
}}); |
|
|
|
}}); |
|
|
|
if(CollectionUtil.isEmpty(operateList)){ |
|
|
|
if (CollectionUtil.isEmpty(operateList)) { |
|
|
|
ticketMonthVO.setOperate(0); |
|
|
|
ticketMonthVO.setOperate(0); |
|
|
|
ticketMonthVO.setOperateQualify(0); |
|
|
|
ticketMonthVO.setOperateQualify(0); |
|
|
|
return; |
|
|
|
return; |
|
|
@ -335,11 +369,11 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke |
|
|
|
ticketMonthVO.setOperate(operateList.size()); |
|
|
|
ticketMonthVO.setOperate(operateList.size()); |
|
|
|
List<Long> operateIdList = operateList.stream().map(StandardTicketInfoEntity::getId).collect(Collectors.toList()); |
|
|
|
List<Long> operateIdList = operateList.stream().map(StandardTicketInfoEntity::getId).collect(Collectors.toList()); |
|
|
|
// 查询合格评价
|
|
|
|
// 查询合格评价
|
|
|
|
List<TicketInfoEvaluateEntity> operateQualifyList = ticketInfoEvaluateService.list(new LambdaQueryWrapper<TicketInfoEvaluateEntity>(){{ |
|
|
|
List<TicketInfoEvaluateEntity> operateQualifyList = ticketInfoEvaluateService.list(new LambdaQueryWrapper<TicketInfoEvaluateEntity>() {{ |
|
|
|
in(TicketInfoEvaluateEntity::getTicketId,operateIdList); |
|
|
|
in(TicketInfoEvaluateEntity::getTicketId, operateIdList); |
|
|
|
eq(TicketInfoEvaluateEntity::getStatus,TicketConstants.TicketQualifiedEnum.Qualified.getCode()); |
|
|
|
eq(TicketInfoEvaluateEntity::getStatus, TicketConstants.TicketQualifiedEnum.Qualified.getCode()); |
|
|
|
}}); |
|
|
|
}}); |
|
|
|
if(CollectionUtil.isEmpty(operateQualifyList)){ |
|
|
|
if (CollectionUtil.isEmpty(operateQualifyList)) { |
|
|
|
ticketMonthVO.setOperateQualify(0); |
|
|
|
ticketMonthVO.setOperateQualify(0); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -348,16 +382,17 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 首页-当月工作票获取 |
|
|
|
* 首页-当月工作票获取 |
|
|
|
|
|
|
|
* |
|
|
|
* @param list |
|
|
|
* @param list |
|
|
|
* @param ticketMonthVO |
|
|
|
* @param ticketMonthVO |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void getWorkMoth(LocalDateTime firstDateTime,LocalDateTime endDateTime,List<Long> list, TicketMonthVO ticketMonthVO) { |
|
|
|
private void getWorkMoth(LocalDateTime firstDateTime, LocalDateTime endDateTime, List<Long> list, TicketMonthVO ticketMonthVO) { |
|
|
|
List<WorkTicketInfoEntity> workList = iWorkTicketInfoService.list(new LambdaQueryWrapper<WorkTicketInfoEntity>(){{ |
|
|
|
List<WorkTicketInfoEntity> workList = iWorkTicketInfoService.list(new LambdaQueryWrapper<WorkTicketInfoEntity>() {{ |
|
|
|
ge(WorkTicketInfoEntity::getCreateTime,firstDateTime); |
|
|
|
ge(WorkTicketInfoEntity::getCreateTime, firstDateTime); |
|
|
|
le(WorkTicketInfoEntity::getCreateTime,endDateTime); |
|
|
|
le(WorkTicketInfoEntity::getCreateTime, endDateTime); |
|
|
|
in(WorkTicketInfoEntity::getCreateDept,list); |
|
|
|
in(WorkTicketInfoEntity::getCreateDept, list); |
|
|
|
}}); |
|
|
|
}}); |
|
|
|
if(CollectionUtil.isEmpty(workList)){ |
|
|
|
if (CollectionUtil.isEmpty(workList)) { |
|
|
|
ticketMonthVO.setWork(0); |
|
|
|
ticketMonthVO.setWork(0); |
|
|
|
ticketMonthVO.setWorkQualify(0); |
|
|
|
ticketMonthVO.setWorkQualify(0); |
|
|
|
return; |
|
|
|
return; |
|
|
@ -365,11 +400,11 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke |
|
|
|
ticketMonthVO.setWork(workList.size()); |
|
|
|
ticketMonthVO.setWork(workList.size()); |
|
|
|
List<Long> workIdList = workList.stream().map(WorkTicketInfoEntity::getId).collect(Collectors.toList()); |
|
|
|
List<Long> workIdList = workList.stream().map(WorkTicketInfoEntity::getId).collect(Collectors.toList()); |
|
|
|
// 查询合格评价
|
|
|
|
// 查询合格评价
|
|
|
|
List<TicketInfoEvaluateEntity> operateQualifyList = ticketInfoEvaluateService.list(new LambdaQueryWrapper<TicketInfoEvaluateEntity>(){{ |
|
|
|
List<TicketInfoEvaluateEntity> operateQualifyList = ticketInfoEvaluateService.list(new LambdaQueryWrapper<TicketInfoEvaluateEntity>() {{ |
|
|
|
in(TicketInfoEvaluateEntity::getTicketId,workIdList); |
|
|
|
in(TicketInfoEvaluateEntity::getTicketId, workIdList); |
|
|
|
eq(TicketInfoEvaluateEntity::getStatus,TicketConstants.TicketQualifiedEnum.Qualified.getCode()); |
|
|
|
eq(TicketInfoEvaluateEntity::getStatus, TicketConstants.TicketQualifiedEnum.Qualified.getCode()); |
|
|
|
}}); |
|
|
|
}}); |
|
|
|
if(CollectionUtil.isEmpty(operateQualifyList)){ |
|
|
|
if (CollectionUtil.isEmpty(operateQualifyList)) { |
|
|
|
ticketMonthVO.setOperateQualify(0); |
|
|
|
ticketMonthVO.setOperateQualify(0); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -378,63 +413,65 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 获取StandardTicketInfoEntity - LambdaQueryWrapper |
|
|
|
* 获取StandardTicketInfoEntity - LambdaQueryWrapper |
|
|
|
|
|
|
|
* |
|
|
|
* @param req |
|
|
|
* @param req |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private LambdaQueryWrapper getQueryWrapper(StandardTicketInfoDto req){ |
|
|
|
private LambdaQueryWrapper getQueryWrapper(StandardTicketInfoDto req) { |
|
|
|
LambdaQueryWrapper<StandardTicketInfoEntity> queryWrapper = new LambdaQueryWrapper(); |
|
|
|
LambdaQueryWrapper<StandardTicketInfoEntity> queryWrapper = new LambdaQueryWrapper(); |
|
|
|
if(Func.isNotEmpty(req.getCompany())){ |
|
|
|
if (Func.isNotEmpty(req.getCompany())) { |
|
|
|
queryWrapper.like(StandardTicketInfoEntity::getCompany,"%".concat(req.getCompany()).concat("%")); |
|
|
|
queryWrapper.like(StandardTicketInfoEntity::getCompany, "%".concat(req.getCompany()).concat("%")); |
|
|
|
} |
|
|
|
} |
|
|
|
if(Func.isNotEmpty(req.getStatus())){ |
|
|
|
if (Func.isNotEmpty(req.getStatus())) { |
|
|
|
queryWrapper.eq(StandardTicketInfoEntity::getStatus,req.getStatus()); |
|
|
|
queryWrapper.eq(StandardTicketInfoEntity::getStatus, req.getStatus()); |
|
|
|
} |
|
|
|
} |
|
|
|
if(Func.isNotEmpty(req.getTicketType())){ |
|
|
|
if (Func.isNotEmpty(req.getTicketType())) { |
|
|
|
queryWrapper.eq(StandardTicketInfoEntity::getTicketType,req.getTicketType()); |
|
|
|
queryWrapper.eq(StandardTicketInfoEntity::getTicketType, req.getTicketType()); |
|
|
|
} |
|
|
|
} |
|
|
|
if(Func.isNotEmpty(req.getTaskType())){ |
|
|
|
if (Func.isNotEmpty(req.getTaskType())) { |
|
|
|
queryWrapper.eq(StandardTicketInfoEntity::getTaskType,req.getTaskType()); |
|
|
|
queryWrapper.eq(StandardTicketInfoEntity::getTaskType, req.getTaskType()); |
|
|
|
} |
|
|
|
} |
|
|
|
if(Func.isNotEmpty(req.getCode())){ |
|
|
|
if (Func.isNotEmpty(req.getCode())) { |
|
|
|
queryWrapper.like(StandardTicketInfoEntity::getCode,req.getCode()); |
|
|
|
queryWrapper.like(StandardTicketInfoEntity::getCode, req.getCode()); |
|
|
|
} |
|
|
|
} |
|
|
|
if(Func.isNotEmpty(req.getIssueOrderPerson())){ |
|
|
|
if (Func.isNotEmpty(req.getIssueOrderPerson())) { |
|
|
|
queryWrapper.eq(StandardTicketInfoEntity::getIssueOrderPerson,req.getIssueOrderPerson()); |
|
|
|
queryWrapper.eq(StandardTicketInfoEntity::getIssueOrderPerson, req.getIssueOrderPerson()); |
|
|
|
} |
|
|
|
} |
|
|
|
if(Func.isNotEmpty(req.getAccessOrderPerson())){ |
|
|
|
if (Func.isNotEmpty(req.getAccessOrderPerson())) { |
|
|
|
queryWrapper.eq(StandardTicketInfoEntity::getAccessOrderPerson,req.getAccessOrderPerson()); |
|
|
|
queryWrapper.eq(StandardTicketInfoEntity::getAccessOrderPerson, req.getAccessOrderPerson()); |
|
|
|
} |
|
|
|
} |
|
|
|
if(Func.isNotEmpty(req.getAccessOrderPerson())){ |
|
|
|
if (Func.isNotEmpty(req.getAccessOrderPerson())) { |
|
|
|
queryWrapper.eq(StandardTicketInfoEntity::getAccessOrderPerson,req.getAccessOrderPerson()); |
|
|
|
queryWrapper.eq(StandardTicketInfoEntity::getAccessOrderPerson, req.getAccessOrderPerson()); |
|
|
|
} |
|
|
|
} |
|
|
|
if(Func.isNotEmpty(req.getTitle())){ |
|
|
|
if (Func.isNotEmpty(req.getTitle())) { |
|
|
|
queryWrapper.like(StandardTicketInfoEntity::getTitle,"%".concat(req.getTitle()).concat("%")); |
|
|
|
queryWrapper.like(StandardTicketInfoEntity::getTitle, "%".concat(req.getTitle()).concat("%")); |
|
|
|
} |
|
|
|
} |
|
|
|
if(Func.isNotEmpty(req.getStartTime())){ |
|
|
|
if (Func.isNotEmpty(req.getStartTime())) { |
|
|
|
queryWrapper.ge(StandardTicketInfoEntity::getCreateTime,req.getStartTime()); |
|
|
|
queryWrapper.ge(StandardTicketInfoEntity::getCreateTime, req.getStartTime()); |
|
|
|
} |
|
|
|
} |
|
|
|
if(Func.isNotEmpty(req.getEndTime())){ |
|
|
|
if (Func.isNotEmpty(req.getEndTime())) { |
|
|
|
queryWrapper.le(StandardTicketInfoEntity::getCreateTime,req.getEndTime()); |
|
|
|
queryWrapper.le(StandardTicketInfoEntity::getCreateTime, req.getEndTime()); |
|
|
|
} |
|
|
|
} |
|
|
|
if(!CollectionUtil.isEmpty(req.getDeptIds())){ |
|
|
|
if (!CollectionUtil.isEmpty(req.getDeptIds())) { |
|
|
|
queryWrapper.in(StandardTicketInfoEntity::getCreateDept,req.getDeptIds()); |
|
|
|
queryWrapper.in(StandardTicketInfoEntity::getCreateDept, req.getDeptIds()); |
|
|
|
} |
|
|
|
} |
|
|
|
return queryWrapper; |
|
|
|
return queryWrapper; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 开启标准票流程 |
|
|
|
* 开启标准票流程 |
|
|
|
|
|
|
|
* |
|
|
|
* @param processDefinitionKey 标准票流程key |
|
|
|
* @param processDefinitionKey 标准票流程key |
|
|
|
* @param entity |
|
|
|
* @param entity |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private String startProcessInstance(String processDefinitionKey, StandardTicketInfoEntity entity) { |
|
|
|
private String startProcessInstance(String processDefinitionKey, StandardTicketInfoEntity entity) { |
|
|
|
Map<String,Object> params = new HashMap<String, Object>(2) {{ |
|
|
|
Map<String, Object> params = new HashMap<String, Object>(2) {{ |
|
|
|
put("taskId", entity.getId()); |
|
|
|
put("taskId", entity.getId()); |
|
|
|
put("guardianUserIds", "taskUser_".concat(entity.getGuardian().toString())); |
|
|
|
put("guardianUserIds", "taskUser_".concat(entity.getGuardian().toString())); |
|
|
|
}}; |
|
|
|
}}; |
|
|
|
|
|
|
|
|
|
|
|
return flowClient.startProcessInstanceContainNameByKey(processDefinitionKey,"standardTicket:task:" + entity.getId(),entity.getTitle(), params) |
|
|
|
return flowClient.startProcessInstanceContainNameByKey(processDefinitionKey, "standardTicket:task:" + entity.getId(), entity.getTitle(), params) |
|
|
|
.getData() |
|
|
|
.getData() |
|
|
|
.getProcessInstanceId(); |
|
|
|
.getProcessInstanceId(); |
|
|
|
} |
|
|
|
} |
|
|
@ -443,7 +480,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke |
|
|
|
* 获取标准票编号 |
|
|
|
* 获取标准票编号 |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private String getOperateTicketCode(){ |
|
|
|
private String getOperateTicketCode() { |
|
|
|
/**获取当前时间**/ |
|
|
|
/**获取当前时间**/ |
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyMM"); |
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyMM"); |
|
|
|
YearMonth yearMonth = YearMonth.now(); |
|
|
|
YearMonth yearMonth = YearMonth.now(); |
|
|
@ -451,13 +488,13 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke |
|
|
|
LocalDateTime date = LocalDateTime.now(); |
|
|
|
LocalDateTime date = LocalDateTime.now(); |
|
|
|
LocalDateTime firstDay = date.with(TemporalAdjusters.firstDayOfMonth()).withHour(0).withMinute(0).withSecond(0); |
|
|
|
LocalDateTime firstDay = date.with(TemporalAdjusters.firstDayOfMonth()).withHour(0).withMinute(0).withSecond(0); |
|
|
|
LocalDateTime lastDay = date.with(TemporalAdjusters.lastDayOfMonth()).withHour(23).withMinute(59).withSecond(59); |
|
|
|
LocalDateTime lastDay = date.with(TemporalAdjusters.lastDayOfMonth()).withHour(23).withMinute(59).withSecond(59); |
|
|
|
log.info("当月第一天:{};当月最后一天{}",firstDay,lastDay); |
|
|
|
log.info("当月第一天:{};当月最后一天{}", firstDay, lastDay); |
|
|
|
/**获取当月工作票总条数**/ |
|
|
|
/**获取当月工作票总条数**/ |
|
|
|
List<StandardTicketInfoEntity> infoEntityList = this.list(new LambdaQueryWrapper<StandardTicketInfoEntity>(){{ |
|
|
|
List<StandardTicketInfoEntity> infoEntityList = this.list(new LambdaQueryWrapper<StandardTicketInfoEntity>() {{ |
|
|
|
ge(StandardTicketInfoEntity::getCreateTime,firstDay); |
|
|
|
ge(StandardTicketInfoEntity::getCreateTime, firstDay); |
|
|
|
le(StandardTicketInfoEntity::getCreateTime,lastDay); |
|
|
|
le(StandardTicketInfoEntity::getCreateTime, lastDay); |
|
|
|
}}); |
|
|
|
}}); |
|
|
|
if(CollectionUtil.isEmpty(infoEntityList)){ |
|
|
|
if (CollectionUtil.isEmpty(infoEntityList)) { |
|
|
|
return TicketConstants.TicketCodePreEnum.DQ_OPERATE.getPrefix().concat("-").concat(tym).concat("-001"); |
|
|
|
return TicketConstants.TicketCodePreEnum.DQ_OPERATE.getPrefix().concat("-").concat(tym).concat("-001"); |
|
|
|
} |
|
|
|
} |
|
|
|
return TicketConstants.TicketCodePreEnum.DQ_OPERATE.getPrefix().concat("-").concat(tym).concat("-").concat(String.format("%03d", infoEntityList.size())); |
|
|
|
return TicketConstants.TicketCodePreEnum.DQ_OPERATE.getPrefix().concat("-").concat(tym).concat("-").concat(String.format("%03d", infoEntityList.size())); |
|
|
@ -465,6 +502,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 根据站点获取双票数量 |
|
|
|
* 根据站点获取双票数量 |
|
|
|
|
|
|
|
* |
|
|
|
* @param stationMap |
|
|
|
* @param stationMap |
|
|
|
* @param firstDateTime |
|
|
|
* @param firstDateTime |
|
|
|
* @param now |
|
|
|
* @param now |
|
|
@ -473,24 +511,24 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke |
|
|
|
public List<DoublePassVO> getDoublePassQuantity(Map<String, String> stationMap, LocalDateTime firstDateTime, LocalDateTime now) { |
|
|
|
public List<DoublePassVO> getDoublePassQuantity(Map<String, String> stationMap, LocalDateTime firstDateTime, LocalDateTime now) { |
|
|
|
List<DoublePassVO> doublePassVOList = new ArrayList<>(); |
|
|
|
List<DoublePassVO> doublePassVOList = new ArrayList<>(); |
|
|
|
// 站点遍历
|
|
|
|
// 站点遍历
|
|
|
|
stationMap.forEach((key,value)->{ |
|
|
|
stationMap.forEach((key, value) -> { |
|
|
|
DoublePassVO doublePassVO = new DoublePassVO(); |
|
|
|
DoublePassVO doublePassVO = new DoublePassVO(); |
|
|
|
doublePassVO.setStationId(Long.valueOf(key)); |
|
|
|
doublePassVO.setStationId(Long.valueOf(key)); |
|
|
|
// 查询操作票
|
|
|
|
// 查询操作票
|
|
|
|
List<StandardTicketInfoEntity> standardList = this.list(new LambdaQueryWrapper<StandardTicketInfoEntity>(){{ |
|
|
|
List<StandardTicketInfoEntity> standardList = this.list(new LambdaQueryWrapper<StandardTicketInfoEntity>() {{ |
|
|
|
ge(StandardTicketInfoEntity::getCreateTime,firstDateTime); |
|
|
|
ge(StandardTicketInfoEntity::getCreateTime, firstDateTime); |
|
|
|
le(StandardTicketInfoEntity::getCreateTime,now); |
|
|
|
le(StandardTicketInfoEntity::getCreateTime, now); |
|
|
|
eq(StandardTicketInfoEntity::getCreateDept,value); |
|
|
|
eq(StandardTicketInfoEntity::getCreateDept, value); |
|
|
|
}}); |
|
|
|
}}); |
|
|
|
List<Long> standardIdList = standardList.stream().map(StandardTicketInfoEntity::getId).collect(Collectors.toList()); |
|
|
|
List<Long> standardIdList = standardList.stream().map(StandardTicketInfoEntity::getId).collect(Collectors.toList()); |
|
|
|
// 查询工作票
|
|
|
|
// 查询工作票
|
|
|
|
List<WorkTicketInfoEntity> workList = iWorkTicketInfoService.list(new LambdaQueryWrapper<WorkTicketInfoEntity>(){{ |
|
|
|
List<WorkTicketInfoEntity> workList = iWorkTicketInfoService.list(new LambdaQueryWrapper<WorkTicketInfoEntity>() {{ |
|
|
|
ge(WorkTicketInfoEntity::getCreateTime,firstDateTime); |
|
|
|
ge(WorkTicketInfoEntity::getCreateTime, firstDateTime); |
|
|
|
le(WorkTicketInfoEntity::getCreateTime,now); |
|
|
|
le(WorkTicketInfoEntity::getCreateTime, now); |
|
|
|
eq(WorkTicketInfoEntity::getCreateDept,value); |
|
|
|
eq(WorkTicketInfoEntity::getCreateDept, value); |
|
|
|
}}); |
|
|
|
}}); |
|
|
|
List<Long> workIdList = workList.stream().map(WorkTicketInfoEntity::getId).collect(Collectors.toList()); |
|
|
|
List<Long> workIdList = workList.stream().map(WorkTicketInfoEntity::getId).collect(Collectors.toList()); |
|
|
|
if(CollectionUtil.isEmpty(standardIdList) && CollectionUtil.isEmpty(workIdList)){ |
|
|
|
if (CollectionUtil.isEmpty(standardIdList) && CollectionUtil.isEmpty(workIdList)) { |
|
|
|
doublePassVO.setDoubleTicketCount(0); |
|
|
|
doublePassVO.setDoubleTicketCount(0); |
|
|
|
doublePassVO.setQualifiedCount(0); |
|
|
|
doublePassVO.setQualifiedCount(0); |
|
|
|
doublePassVOList.add(doublePassVO); |
|
|
|
doublePassVOList.add(doublePassVO); |
|
|
@ -499,13 +537,13 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke |
|
|
|
// 双票 = 查询操作票 + 查询工作票
|
|
|
|
// 双票 = 查询操作票 + 查询工作票
|
|
|
|
standardIdList.addAll(workIdList); |
|
|
|
standardIdList.addAll(workIdList); |
|
|
|
// 查询合格评价
|
|
|
|
// 查询合格评价
|
|
|
|
List<TicketInfoEvaluateEntity> evaluateList = ticketInfoEvaluateService.list(new LambdaQueryWrapper<TicketInfoEvaluateEntity>(){{ |
|
|
|
List<TicketInfoEvaluateEntity> evaluateList = ticketInfoEvaluateService.list(new LambdaQueryWrapper<TicketInfoEvaluateEntity>() {{ |
|
|
|
ge(TicketInfoEvaluateEntity::getCreateTime,firstDateTime); |
|
|
|
ge(TicketInfoEvaluateEntity::getCreateTime, firstDateTime); |
|
|
|
le(TicketInfoEvaluateEntity::getCreateTime,now); |
|
|
|
le(TicketInfoEvaluateEntity::getCreateTime, now); |
|
|
|
in(TicketInfoEvaluateEntity::getTicketId,standardIdList); |
|
|
|
in(TicketInfoEvaluateEntity::getTicketId, standardIdList); |
|
|
|
eq(TicketInfoEvaluateEntity::getStatus,TicketConstants.TicketQualifiedEnum.Qualified.getCode()); |
|
|
|
eq(TicketInfoEvaluateEntity::getStatus, TicketConstants.TicketQualifiedEnum.Qualified.getCode()); |
|
|
|
}}); |
|
|
|
}}); |
|
|
|
if(CollectionUtil.isEmpty(evaluateList)){ |
|
|
|
if (CollectionUtil.isEmpty(evaluateList)) { |
|
|
|
doublePassVO.setDoubleTicketCount(standardIdList.size()); |
|
|
|
doublePassVO.setDoubleTicketCount(standardIdList.size()); |
|
|
|
doublePassVO.setQualifiedCount(0); |
|
|
|
doublePassVO.setQualifiedCount(0); |
|
|
|
doublePassVOList.add(doublePassVO); |
|
|
|
doublePassVOList.add(doublePassVO); |
|
|
@ -520,6 +558,7 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 站点统计月报 - 操作票统计 |
|
|
|
* 站点统计月报 - 操作票统计 |
|
|
|
|
|
|
|
* |
|
|
|
* @param startDate 开始时间 |
|
|
|
* @param startDate 开始时间 |
|
|
|
* @param endDate 结束时间 |
|
|
|
* @param endDate 结束时间 |
|
|
|
* @param deptIdList 机构ID |
|
|
|
* @param deptIdList 机构ID |
|
|
@ -530,14 +569,14 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke |
|
|
|
TicketInfoStatisticVO result = new TicketInfoStatisticVO(); |
|
|
|
TicketInfoStatisticVO result = new TicketInfoStatisticVO(); |
|
|
|
result.setTicketInfoType("操作票"); |
|
|
|
result.setTicketInfoType("操作票"); |
|
|
|
List<OperateTicketStatisticVO> operateTicketReportStatistic = this.baseMapper.getOperateTicketReportStatistic(startDate, endDate, deptIdList); |
|
|
|
List<OperateTicketStatisticVO> operateTicketReportStatistic = this.baseMapper.getOperateTicketReportStatistic(startDate, endDate, deptIdList); |
|
|
|
if(CollectionUtil.isNotEmpty(operateTicketReportStatistic)) { |
|
|
|
if (CollectionUtil.isNotEmpty(operateTicketReportStatistic)) { |
|
|
|
//已完成数量
|
|
|
|
//已完成数量
|
|
|
|
int ticketInfoCompleteNum = operateTicketReportStatistic.stream().filter(ticket -> TicketConstants.StandardTicketStatusEnum.END.getStatus().equals(ticket.getStatus())) |
|
|
|
int ticketInfoCompleteNum = operateTicketReportStatistic.stream().filter(ticket -> TicketConstants.StandardTicketStatusEnum.END.getStatus().equals(ticket.getStatus())) |
|
|
|
.collect(Collectors.toList()).size(); |
|
|
|
.collect(Collectors.toList()).size(); |
|
|
|
//合格数量
|
|
|
|
//合格数量
|
|
|
|
int ticketInfoQualifiedNum = operateTicketReportStatistic.stream().filter(ticket -> Func.isNotEmpty(ticket.getEvaluation()) && 1 == ticket.getEvaluation().intValue()).collect(Collectors.toList()).size(); |
|
|
|
int ticketInfoQualifiedNum = operateTicketReportStatistic.stream().filter(ticket -> Func.isNotEmpty(ticket.getEvaluation()) && 1 == ticket.getEvaluation().intValue()).collect(Collectors.toList()).size(); |
|
|
|
//计算合格率
|
|
|
|
//计算合格率
|
|
|
|
double ticketInfoProportion = new BigDecimal(ticketInfoQualifiedNum / (double)operateTicketReportStatistic.size() *100) |
|
|
|
double ticketInfoProportion = new BigDecimal(ticketInfoQualifiedNum / (double) operateTicketReportStatistic.size() * 100) |
|
|
|
.setScale(2, RoundingMode.HALF_DOWN).doubleValue(); |
|
|
|
.setScale(2, RoundingMode.HALF_DOWN).doubleValue(); |
|
|
|
result = TicketInfoStatisticVO.builder() |
|
|
|
result = TicketInfoStatisticVO.builder() |
|
|
|
.ticketInfoType("操作票") |
|
|
|
.ticketInfoType("操作票") |
|
|
|