|
|
|
@ -22,7 +22,6 @@ import com.hnac.hzims.operational.maintenance.dto.OperMaintenanceTaskDTO;
|
|
|
|
|
import com.hnac.hzims.operational.maintenance.feign.ITaskClient; |
|
|
|
|
import com.hnac.hzims.ticket.allTicket.entity.TicketInfoEvaluateEntity; |
|
|
|
|
import com.hnac.hzims.ticket.allTicket.service.TicketInfoEvaluateService; |
|
|
|
|
import com.hnac.hzims.ticket.allTicket.vo.TicketInfoEvaluateVO; |
|
|
|
|
import com.hnac.hzims.ticket.areamonthly.feign.TicketFeignClient; |
|
|
|
|
import com.hnac.hzims.ticket.areamonthly.vo.StandardTicketWithAreaVo; |
|
|
|
|
import com.hnac.hzims.ticket.areamonthly.vo.StandardWorkVo; |
|
|
|
@ -116,10 +115,14 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl<WorkTicketInfoMap
|
|
|
|
|
private final TicketInfoDangerService ticketInfoDangerService; |
|
|
|
|
private final IEmInfoClient emInfoClient; |
|
|
|
|
|
|
|
|
|
/** 生成两票编号锁 **/ |
|
|
|
|
/** |
|
|
|
|
* 生成两票编号锁 |
|
|
|
|
**/ |
|
|
|
|
private Lock lock = new ReentrantLock(); |
|
|
|
|
|
|
|
|
|
/** word模板预览导出保存路径 **/ |
|
|
|
|
/** |
|
|
|
|
* word模板预览导出保存路径 |
|
|
|
|
**/ |
|
|
|
|
@Value("${hzims.ticket.path.xlsx.savePath}") |
|
|
|
|
private String xlsSavePath; |
|
|
|
|
|
|
|
|
@ -1033,7 +1036,7 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl<WorkTicketInfoMap
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
workTicketInfo.setClassGroupMembersName(Optional.ofNullable(workTicketInfo.getClassGroupMembersManual()).filter(StringUtil::isNotBlank).orElse(workTicketInfo.getClassGroupMembersName())); |
|
|
|
|
if(Func.isNotEmpty(workTicketInfo.getClassGroupMembersManual())) { |
|
|
|
|
if (Func.isNotEmpty(workTicketInfo.getClassGroupMembersManual())) { |
|
|
|
|
workTicketInfo.setTotalPerson(workTicketInfo.getClassGroupMembersManual().split(",").length); |
|
|
|
|
} |
|
|
|
|
//负责人名称
|
|
|
|
@ -1218,6 +1221,7 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl<WorkTicketInfoMap
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 工作票-关联数据 |
|
|
|
|
* |
|
|
|
|
* @param page |
|
|
|
|
* @param business |
|
|
|
|
* @return |
|
|
|
@ -1227,17 +1231,18 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl<WorkTicketInfoMap
|
|
|
|
|
QueryWrapper<WorkTicketInfoEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
queryWrapper.ge(Func.isNotEmpty(business.getStartTime()), "works.create_time", business.getStartTime()); |
|
|
|
|
queryWrapper.le(Func.isNotEmpty(business.getEndTime()), "works.create_time", business.getEndTime()); |
|
|
|
|
queryWrapper.in(Func.isNotEmpty(business.getDeptIds()), "works.create_dept",Func.toLongList(",",business.getDeptIds())); |
|
|
|
|
queryWrapper.in(Func.isNotEmpty(business.getDeptIds()), "works.create_dept", Func.toLongList(",", business.getDeptIds())); |
|
|
|
|
queryWrapper.like(Func.isNotEmpty(business.getCode()), "works.code", business.getCode()); |
|
|
|
|
queryWrapper.eq(Func.isNotEmpty(business.getType()), "works.type", business.getType()); |
|
|
|
|
queryWrapper.eq(Func.isNotEmpty(business.getStatus()), "eva.status", business.getStatus()); |
|
|
|
|
IPage pages = this.baseMapper.pageCondition(page,queryWrapper); |
|
|
|
|
IPage pages = this.baseMapper.pageCondition(page, queryWrapper); |
|
|
|
|
pages.setRecords(WorkTicketInfoWrapper.build().listVO(pages.getRecords())); |
|
|
|
|
return pages; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<WorkTicketExportVO> exportWorkTicket(WorkTicketInfoDto req) { |
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<WorkTicketInfoEntity> lqw = this.getQueryWrapper(req); |
|
|
|
|
if (ObjectUtil.isNotEmpty(req.getCreateDept())) { |
|
|
|
|
lqw.eq(WorkTicketInfoEntity::getCreateDept, req.getCreateDept()); |
|
|
|
@ -1251,7 +1256,8 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl<WorkTicketInfoMap
|
|
|
|
|
List<WorkTicketExportVO> list = new ArrayList<>(); |
|
|
|
|
if (CollectionUtils.isNotEmpty(res)) { |
|
|
|
|
// List<WorkTicketInfoVO> workTicketInfoVOS = WorkTicketInfoWrapper.build().listVO(res);
|
|
|
|
|
list= res.parallelStream().map(workTicketInfoVO -> { |
|
|
|
|
list = res.parallelStream().map(workTicketInfoVO -> { |
|
|
|
|
try { |
|
|
|
|
WorkTicketExportVO resEntity = new WorkTicketExportVO(); |
|
|
|
|
// resEntity.setNumber(i + 1);
|
|
|
|
|
resEntity.setCompany(Optional.ofNullable(workTicketInfoVO.getCompany()).orElse("")); |
|
|
|
@ -1280,24 +1286,30 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl<WorkTicketInfoMap
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
workTicketInfoVO.setClassGroupMembersName(workTicketInfoVO.getClassGroupMembers()); |
|
|
|
|
if(Func.isNotEmpty(workTicketInfoVO.getClassGroupMembersManual())){ |
|
|
|
|
if (Func.isNotEmpty(workTicketInfoVO.getClassGroupMembersManual())) { |
|
|
|
|
workTicketInfoVO.setClassGroupMembersName(workTicketInfoVO.getClassGroupMembersManual()); |
|
|
|
|
} |
|
|
|
|
resEntity.setClassGroupMembers(Optional.ofNullable(workTicketInfoVO.getClassGroupMembersName()).orElse(workTicketInfoVO.getClassGroupMembersManual() == null ? "" : workTicketInfoVO.getClassGroupMembersManual())); |
|
|
|
|
resEntity.setCreateTime(Optional.ofNullable(DateUtil.format(workTicketInfoVO.getCreateTime(), TicketConstants.TICKET_DATE_PATTERN)).orElse("")); |
|
|
|
|
if (ObjectUtil.isNotEmpty(workTicketInfoVO.getConfirmWorkTime())) { |
|
|
|
|
resEntity.setConfirmWorkTime(Optional.ofNullable(DateUtil.format(workTicketInfoVO.getConfirmWorkTime(), TicketConstants.TICKET_DATE_PATTERN)).orElse("")); |
|
|
|
|
resEntity.setConfirmWorkTime(Optional.ofNullable(DateUtil.format(workTicketInfoVO.getPlanEndTime(), TicketConstants.TICKET_DATE_PATTERN)).orElse("")); |
|
|
|
|
} |
|
|
|
|
resEntity.setIsEvaluate("未评价"); |
|
|
|
|
if (workTicketInfoVO.getIsEvaluate() == 1) { |
|
|
|
|
if (ObjectUtil.isNotEmpty(workTicketInfoVO.getIsEvaluate())&&1==workTicketInfoVO.getIsEvaluate()) { |
|
|
|
|
TicketInfoEvaluateEntity ticketInfoEvaluateEntity = new TicketInfoEvaluateEntity(); |
|
|
|
|
ticketInfoEvaluateEntity.setTicketId(workTicketInfoVO.getId()); |
|
|
|
|
R<List<TicketInfoEvaluateVO>> ticketList = ticketFeignClient.list(ticketInfoEvaluateEntity); |
|
|
|
|
if (ticketList.isSuccess() && CollectionUtil.isNotEmpty(ticketList.getData())) { |
|
|
|
|
resEntity.setIsEvaluate(ticketList.getData().get(0).getStatus() == 1 ? "合格" : "不合格"); |
|
|
|
|
TicketInfoEvaluateEntity evaluateEntity = ticketInfoEvaluateService.getOne(new LambdaQueryWrapper<TicketInfoEvaluateEntity>() {{ |
|
|
|
|
eq(TicketInfoEvaluateEntity::getTicketId, workTicketInfoVO.getId()); |
|
|
|
|
}}.last(" limit 1")); |
|
|
|
|
if ( ObjectUtil.isNotEmpty(evaluateEntity)) { |
|
|
|
|
resEntity.setIsEvaluate(evaluateEntity.getStatus() == 1 ? "合格" : "不合格"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return resEntity; |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
System.out.println(e); |
|
|
|
|
log.error("数据转换失败,参数:"+workTicketInfoVO+"报错信息:"+e); |
|
|
|
|
return new WorkTicketExportVO(); |
|
|
|
|
} |
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
} |
|
|
|
|
return list; |
|
|
|
|