Commit 875480d23f38c393c40705a8247ca6450221ef4a

Authored by 房远帅
1 parent 61aab9a8

采购计划:选择分厂

... ... @@ -18,6 +18,8 @@ import com.lframework.starter.web.inner.entity.SysDept;
18 18 import com.lframework.starter.web.inner.service.system.SysDeptService;
19 19 import com.lframework.starter.web.core.components.resp.PageResult;
20 20 import com.lframework.starter.web.core.utils.PageResultUtil;
  21 +import com.lframework.xingyun.basedata.entity.Workshop;
  22 +import com.lframework.xingyun.basedata.service.workshop.WorkshopService;
21 23 import com.lframework.xingyun.sc.bo.procurement.GetProcurementPlanBo;
22 24 import com.lframework.xingyun.sc.procurement.entity.ProcurementPlan;
23 25 import com.lframework.xingyun.sc.procurement.entity.ProcurementPlanLine;
... ... @@ -45,14 +47,16 @@ import org.springframework.beans.factory.annotation.Autowired;
45 47 import org.springframework.stereotype.Service;
46 48 import org.springframework.transaction.annotation.Transactional;
47 49
  50 +import javax.annotation.Resource;
  51 +
48 52 @Service
49 53 public class ProcurementPlanServiceImpl extends BaseMpServiceImpl<ProcurementPlanMapper, ProcurementPlan>
50 54 implements ProcurementPlanService {
51 55
52 56 @Autowired
53 57 private ProcurementPlanLineService procurementPlanLineService;
54   - @Autowired
55   - private SysDeptService sysDeptService;
  58 + @Resource
  59 + private WorkshopService workshopService;
56 60
57 61 @Override
58 62 public PageResult<ProcurementPlan> query(Integer pageIndex, Integer pageSize,
... ... @@ -268,11 +272,11 @@ public class ProcurementPlanServiceImpl extends BaseMpServiceImpl<ProcurementPla
268 272 .distinct()
269 273 .collect(Collectors.toList());
270 274 Map<String, String> deptId2CodeMap = new HashMap<>();
271   - List<SysDept> deptList = sysDeptService.listByIds(workshopIds);
272   - if (CollectionUtil.isNotEmpty(deptList)) {
273   - deptId2CodeMap = deptList.stream()
  275 + List<Workshop> workshopList = workshopService.listByIds(workshopIds);
  276 + if (CollectionUtil.isNotEmpty(workshopList)) {
  277 + deptId2CodeMap = workshopList.stream()
274 278 .filter(d -> StringUtil.isNotBlank(d.getCode()))
275   - .collect(Collectors.toMap(SysDept::getId, SysDept::getCode, (v1, v2) -> v1));
  279 + .collect(Collectors.toMap(Workshop::getId, Workshop::getCode, (v1, v2) -> v1));
276 280 }
277 281
278 282 // 分厂顺序:yfc(01) / efc(02) / sfc(03) / ztfc(04)
... ...