|
|
|
@ -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,53 +1256,60 @@ 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 -> { |
|
|
|
|
WorkTicketExportVO resEntity = new WorkTicketExportVO(); |
|
|
|
|
list = res.parallelStream().map(workTicketInfoVO -> { |
|
|
|
|
try { |
|
|
|
|
WorkTicketExportVO resEntity = new WorkTicketExportVO(); |
|
|
|
|
// resEntity.setNumber(i + 1);
|
|
|
|
|
resEntity.setCompany(Optional.ofNullable(workTicketInfoVO.getCompany()).orElse("")); |
|
|
|
|
resEntity.setType(Optional.ofNullable(DictCache.getValue(TicketConstants.TICKET_TYPE, workTicketInfoVO.getType())).orElse("")); |
|
|
|
|
resEntity.setCode(Optional.ofNullable(workTicketInfoVO.getCode()).orElse("")); |
|
|
|
|
resEntity.setWorkContent(Optional.ofNullable(workTicketInfoVO.getWorkContent()).orElse("")); |
|
|
|
|
if (ObjectUtil.isNotEmpty(workTicketInfoVO.getSigner())) { |
|
|
|
|
User user = UserCache.getUser(workTicketInfoVO.getSigner()); |
|
|
|
|
if (ObjectUtil.isNotEmpty(user)) { |
|
|
|
|
resEntity.setSigner(user.getName()); |
|
|
|
|
resEntity.setCompany(Optional.ofNullable(workTicketInfoVO.getCompany()).orElse("")); |
|
|
|
|
resEntity.setType(Optional.ofNullable(DictCache.getValue(TicketConstants.TICKET_TYPE, workTicketInfoVO.getType())).orElse("")); |
|
|
|
|
resEntity.setCode(Optional.ofNullable(workTicketInfoVO.getCode()).orElse("")); |
|
|
|
|
resEntity.setWorkContent(Optional.ofNullable(workTicketInfoVO.getWorkContent()).orElse("")); |
|
|
|
|
if (ObjectUtil.isNotEmpty(workTicketInfoVO.getSigner())) { |
|
|
|
|
User user = UserCache.getUser(workTicketInfoVO.getSigner()); |
|
|
|
|
if (ObjectUtil.isNotEmpty(user)) { |
|
|
|
|
resEntity.setSigner(user.getName()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//负责人-线上和线下
|
|
|
|
|
if (Func.isEmpty(workTicketInfoVO.getPrincipal())) { |
|
|
|
|
resEntity.setPrincipal(workTicketInfoVO.getPrincipalManual()); |
|
|
|
|
} else { |
|
|
|
|
User principal = UserCache.getUser(workTicketInfoVO.getPrincipal()); |
|
|
|
|
if (ObjectUtil.isNotEmpty(principal)) { |
|
|
|
|
resEntity.setPrincipal(principal.getName()); |
|
|
|
|
//负责人-线上和线下
|
|
|
|
|
if (Func.isEmpty(workTicketInfoVO.getPrincipal())) { |
|
|
|
|
resEntity.setPrincipal(workTicketInfoVO.getPrincipalManual()); |
|
|
|
|
} else { |
|
|
|
|
User principal = UserCache.getUser(workTicketInfoVO.getPrincipal()); |
|
|
|
|
if (ObjectUtil.isNotEmpty(principal)) { |
|
|
|
|
resEntity.setPrincipal(principal.getName()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (ObjectUtil.isNotEmpty(workTicketInfoVO.getLicensor())) { |
|
|
|
|
User user = UserCache.getUser(workTicketInfoVO.getLicensor()); |
|
|
|
|
if (ObjectUtil.isNotEmpty(user)) { |
|
|
|
|
resEntity.setLicensor(user.getName()); |
|
|
|
|
if (ObjectUtil.isNotEmpty(workTicketInfoVO.getLicensor())) { |
|
|
|
|
User user = UserCache.getUser(workTicketInfoVO.getLicensor()); |
|
|
|
|
if (ObjectUtil.isNotEmpty(user)) { |
|
|
|
|
resEntity.setLicensor(user.getName()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
workTicketInfoVO.setClassGroupMembersName(workTicketInfoVO.getClassGroupMembers()); |
|
|
|
|
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.setIsEvaluate("未评价"); |
|
|
|
|
if (workTicketInfoVO.getIsEvaluate() == 1) { |
|
|
|
|
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 ? "合格" : "不合格"); |
|
|
|
|
workTicketInfoVO.setClassGroupMembersName(workTicketInfoVO.getClassGroupMembers()); |
|
|
|
|
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.getPlanEndTime(), TicketConstants.TICKET_DATE_PATTERN)).orElse("")); |
|
|
|
|
} |
|
|
|
|
resEntity.setIsEvaluate("未评价"); |
|
|
|
|
if (ObjectUtil.isNotEmpty(workTicketInfoVO.getIsEvaluate())&&1==workTicketInfoVO.getIsEvaluate()) { |
|
|
|
|
TicketInfoEvaluateEntity ticketInfoEvaluateEntity = new TicketInfoEvaluateEntity(); |
|
|
|
|
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(); |
|
|
|
|
} |
|
|
|
|
return resEntity; |
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
} |
|
|
|
|
return list; |
|
|
|
|