| | |
| | | private CutterMapper cutterMapper; |
| | | @Autowired |
| | | private GuideCardBatchMapper guideCardBatchMapper; |
| | | @Autowired |
| | | private IPermissionStreamNewService permissionStreamNewService; |
| | | @Autowired |
| | | private ISysUserService sysUserService; |
| | | @Autowired |
| | | private IMdcProductionService mdcProductionService; |
| | | |
| | | public ProcessTraceChain traceFromProcess(DocRelative docRelative) { |
| | | ProcessTraceChain chain = initChainWithDocInfo(docRelative); |
| | |
| | | completeChainWithProductInfo(chain); |
| | | List<ProductMix> productMixList=buildFullTreePath(chain); |
| | | chain.setTreePath(productMixList); |
| | | chain.setPermissionStreamNewList(buildFullTreePathPermission(productMixList)); |
| | | return chain; |
| | | } |
| | | |
| | |
| | | completeChainWithProductInfo(chain); |
| | | List<ProductMix> productMixList=buildFullTreePath(chain); |
| | | chain.setTreePath(productMixList); |
| | | chain.setPermissionStreamNewList(buildFullTreePathPermission(productMixList)); |
| | | return chain; |
| | | } |
| | | |
| | |
| | | return path; |
| | | } |
| | | |
| | | private List<PermissionStreamNew> buildFullTreePathPermission(List<ProductMix> productMixList) { |
| | | List<Long> ids=productMixList.stream().map(ProductMix::getId).collect(Collectors.toList()); |
| | | List<PermissionStreamNew> path = permissionStreamNewService |
| | | .list(new QueryWrapper<PermissionStreamNew>().in("business_id",ids) |
| | | .eq("delete_flag",0)); |
| | | path.forEach(item->{ |
| | | if (item.getDepartId()!=null){ |
| | | item.setDepartId(mdcProductionService.getById(item.getDepartId()).getOrgCode()); |
| | | } |
| | | if (item.getUserId()!=null){ |
| | | item.setUserId(sysUserService.getById(item.getUserId()).getUsername()); |
| | | } |
| | | }); |
| | | return path; |
| | | } |
| | | } |