whycxzp
2022-08-12 8e252dca390a775f23b6ad621f81e39cac1b11e3
src/main/java/com/whyc/service/WorksheetMainService.java
@@ -215,10 +215,10 @@
        List<ComponentApproving> cApprovingList = main.getCApprovingList();
        //查询是否有 已生效或者已提交审批的 相同的散装件
        List<Component> existComponentList = new LinkedList<>();
        List<ComponentApproving> existCAList = cApprovingService.getList();
        List<ComponentApproving> existCAList = new LinkedList<>();
        List<Component> componentList = cService.getList();
        List<ComponentApproving> cAList = cApprovingService.getList();
        List<ComponentApproving> cAList = cApprovingService.getListByStatus(1);
        for (int i = 0; i < cApprovingList.size(); i++) {
            ComponentApproving componentApproving = cApprovingList.get(i);
            for (int j = 0; j < componentList.size(); j++) {
@@ -302,7 +302,9 @@
        }
        //散装件-审批提交
        cApprovingList.forEach(cApproving->{
            cApproving.setCreateDate(new Date());
            cApproving.setMainId(main.getId());
            cApproving.setStatus(1);
        });
        cApprovingService.insert(cApprovingList);
@@ -458,7 +460,15 @@
    }
    public WorksheetMain getLinkList(int id) {
        return mainMapper.getLinkList(id);
         //判断是哪种类型的审批,返回不同的类型 具体数据
        Integer type = getInfoById(id).getType();
        if(type.intValue() == EnumWorksheetType.ProductBom.getType()) {
            return mainMapper.getLinkList(id);
        }else if(type.intValue() == EnumWorksheetType.Component.getType()){
            return mainMapper.getLinkListWithComponents(id);
        }else{ //散装件-产品
            return mainMapper.getLinkListWithComponentProducts(id);
        }
    }
    public Response<PageInfo<WorksheetMain>> getApprovingListPage(DocUser user, int pageNum, int pageSize) {