Commit 78b37697 by huangjinxin

fix:工作队工程师关联关系处理

1 parent 4315a6f4
package com.dituhui.pea.order.service.impl;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import com.dituhui.pea.common.BusinessException;
import com.dituhui.pea.common.Result;
import com.dituhui.pea.order.common.DateUtils;
......@@ -17,10 +18,7 @@ import com.dituhui.pea.order.dto.BusinessTeamDetailDTO;
import com.dituhui.pea.order.dto.BusinessTeamUpdateDTO;
import com.dituhui.pea.order.dto.BusinessTeamWarehousesDTO;
import com.dituhui.pea.order.dto.BusinessTeamsDTO;
import com.dituhui.pea.order.entity.OrgGroupEntity;
import com.dituhui.pea.order.entity.OrgTeamEngineerEntity;
import com.dituhui.pea.order.entity.OrgTeamEntity;
import com.dituhui.pea.order.entity.OrgWarehouseInfoEntity;
import com.dituhui.pea.order.entity.*;
import com.dituhui.pea.order.service.BusinessTeamService;
import com.dituhui.pea.order.service.CommonService;
import lombok.extern.slf4j.Slf4j;
......@@ -81,9 +79,14 @@ public class BusinessTeamServiceImpl implements BusinessTeamService {
page = orgTeamDao.findAllByGroupId(req.getLevelValue(), pageable);
}
for (OrgTeamEntity e : page.getContent()) {
List<String> engineers = orgTeamEngineerDao.findAllByTeamId(e.getTeamId()).stream().map(e2 -> {
return engineerInfoDao.getByEngineerCode(e2.getEngineerCode()).getName();
}).collect(Collectors.toList());
List<String> engineers = new ArrayList<>();
for (OrgTeamEngineerEntity e2 : orgTeamEngineerDao.findAllByTeamId(e.getTeamId())) {
EngineerInfoEntity infoEntity = engineerInfoDao.getByEngineerCode(e2.getEngineerCode());
if (ObjectUtil.isNull(infoEntity)) {
continue;
}
engineers.add(infoEntity.getName());
}
BusinessTeamsDTO.Content content = new BusinessTeamsDTO.Content();
content.setTeamId(e.getTeamId()).setTeamName(e.getTeamName());
content.setWorkdays(String.join("、", getWorkdaysChinese(e.getWorkdays())));
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!