| | |
| | | import org.jeecg.modules.dnc.entity.*; |
| | | import org.jeecg.modules.dnc.mapper.*; |
| | | import org.jeecg.modules.dnc.service.IPermissionStreamNewService; |
| | | import org.jeecg.modules.system.entity.MdcProduction; |
| | | import org.jeecg.modules.system.service.IMdcProductionService; |
| | | import org.jeecg.modules.system.service.ISysUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | 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){ |
| | | MdcProduction mdcProduction=mdcProductionService.getById(item.getDepartId()); |
| | | if(mdcProduction!=null){ |
| | | item.setDepartId(item.getDepartId()); |
| | | } |
| | | } |
| | | if (item.getUserId()!=null){ |
| | | item.setUserId(sysUserService.getById(item.getUserId()).getUsername()); |
| | | } |
| | | }); |
| | | return path; |
| | | } |
| | | } |