FTP
lxw
2022-11-03 cbb0d8423b1bbe20456e42a9670abf3a4b33d38a
src/main/java/com/whyc/service/WorksheetLinkService.java
@@ -264,6 +264,15 @@
                    }
                });
                picUrlList.forEach(picUrl->{
                    String picFullName = picUrl.substring(picUrl.lastIndexOf(File.separator) + 1);
                    try {
                        FileCopyUtils.copy(new File(picUrl),new File(materialDir+File.separator+picFullName));
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                });
                //转移审批表数据到历史表/最新版本表 product_history/product_bom_history/product/product_bom
                ProductHistory productHistory = new ProductHistory();
@@ -313,7 +322,7 @@
                    bom.setThickness(approving.getThickness());
                    bom.setType(approving.getType());
                    bom.setUnit(approving.getUnit());
                    bom.setUpUserId(approving.getUpUserId());
                    //bom.setUpUserId(approving.getUpUserId());
                    bom.setVersion(nextVersion);
                    bomHistory.setProductId(productHistory.getId());
@@ -333,7 +342,7 @@
                    bomHistory.setThickness(approving.getThickness());
                    bomHistory.setType(approving.getType());
                    bomHistory.setUnit(approving.getUnit());
                    bomHistory.setUpUserId(approving.getUpUserId());
                    //bomHistory.setUpUserId(approving.getUpUserId());
                    bomHistory.setVersion(nextVersion);
                    productBomHistoryList.add(bomHistory);
@@ -349,21 +358,22 @@
                approvingList.forEach(approving->{
                    if(!existCodeList.contains(approving.getSubCode())){ //这个审批bom中的物料不在物料管理内
                        Material temp = new Material();
                        temp.setCategory(approving.getCategory());
                        //temp.setCategory(approving.getCategory());
                        temp.setCreateDate(new Date());
                        temp.setDwgUrl(approving.getDwgUrl());
                        temp.setFileUrl(approving.getFileUrl());
                        temp.setMaterial(approving.getMaterial());
                        //temp.setMaterial(approving.getMaterial());
                        temp.setNotes(approving.getNotes());
                        temp.setPictureUrl(approving.getPictureUrl());
                        temp.setProducer(approving.getProducer());
                        temp.setQuantity(approving.getQuantity());
                        //temp.setProducer(approving.getProducer());
                        //TODO quantity
                        //temp.setQuantity(approving.getQuantity());
                        temp.setStatus(1);
                        temp.setSubCode(approving.getSubCode());
                        temp.setSubModel(approving.getSubModel());
                        temp.setSubName(approving.getSubName());
                        temp.setSurfaceDetail(approving.getSurfaceDetail());
                        temp.setThickness(approving.getThickness());
                        //temp.setSurfaceDetail(approving.getSurfaceDetail());
                        //temp.setThickness(approving.getThickness());
                        temp.setType(approving.getType());
                        temp.setUnit(approving.getUnit());
                        materialList.add(temp);
@@ -463,13 +473,14 @@
                    //将物料从审批表中转移到正式表
                    approvingList.forEach(approve -> {
                        Material material = new Material();
                        material.setCategory(approve.getCategory());
                        //material.setCategory(approve.getCategory());
                        material.setSubCode(approve.getSubCode());
                        material.setSubName(approve.getSubName());
                        material.setSubModel(approve.getSubModel());
                        material.setUnit(approve.getUnit());
                        material.setQuantity(approve.getQuantity());
                        material.setProducer(approve.getProducer());
                        //TODO quantity
                        //material.setQuantity(approve.getQuantity());
                        //material.setProducer(approve.getProducer());
                        material.setNotes(approve.getNotes());
                        material.setCreateDate(new Date());
                        material.setStatus(1);
@@ -505,7 +516,7 @@
                            his.setCustomCode(approving.getCustomCode());
                            his.setSVersion(approving.getVersion());
                            his.setEVersion(approving.getVersion());
                            his.setSubCode(approving.getSubCode());
                            his.setSubMaterialId(approving.getSubMaterialId());
                            his.setQuantity(approving.getQuantity());
                            his.setMaterialId(approving.getMaterialId());
                            his.setCreateTime(new Date());