lyh
2025-06-25 e756af0f5bfd1addbd5d5c145441fb34aad91a28
lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/FullHierarchyTraceService.java
@@ -6,7 +6,6 @@
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;
@@ -47,12 +46,6 @@
    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);
@@ -67,7 +60,6 @@
        completeChainWithProductInfo(chain);
        List<ProductMix> productMixList=buildFullTreePath(chain);
        chain.setTreePath(productMixList);
        chain.setPermissionStreamNewList(buildFullTreePathPermission(productMixList));
        return chain;
    }
@@ -84,7 +76,6 @@
        completeChainWithProductInfo(chain);
        List<ProductMix> productMixList=buildFullTreePath(chain);
        chain.setTreePath(productMixList);
        chain.setPermissionStreamNewList(buildFullTreePathPermission(productMixList));
        return chain;
    }
@@ -219,22 +210,4 @@
        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;
    }
}