| | |
| | | his.setEnabled(-1); |
| | | phService.insertAndUpdateEnabled(his); |
| | | //phService.insert(his); |
| | | // -> product 现有产品和产品bom不需要插入,但是要做删除原来的旧版本 |
| | | // -> product 现有产品和产品bom需要插入,version默认为-1,同时要做删除原来的旧版本 |
| | | product.setId(his.getId()); |
| | | product.setCreateTime(date); |
| | | product.setVersion(1); |
| | | //deleteAndInsert(product); |
| | | delete(product); |
| | | product.setVersion(-1); |
| | | deleteAndInsert(product); |
| | | // -> bom |
| | | /*bomList.forEach(bom-> { |
| | | bomList.forEach(bom-> { |
| | | bom.setProductId(product.getId()); |
| | | bom.setSubVersion(1); |
| | | }); |
| | | pbService.insertBatch(bomList);*/ |
| | | pbService.insertBatch(bomList); |
| | | // -> bom_his |
| | | List<ProductBomHistory> bomHistoryList = new LinkedList<>(); |
| | | bomList.forEach(bom->{ |
| | |
| | | |
| | | productHistory.setEnabled(-1); |
| | | phService.insertAndUpdateEnabled(productHistory); |
| | | // -> product 现有产品和产品bom不需要插入,但是要做删除原来的旧版本 |
| | | // -> product 现有产品和产品bom需要插入,version默认为-1,同时要做删除原来的旧版本 |
| | | product.setId(productHistory.getId()); |
| | | product.setCreateTime(date); |
| | | product.setVersion(nextVersion); |
| | | //deleteAndInsert(product); |
| | | delete(product); |
| | | product.setVersion(-1); |
| | | deleteAndInsert(product); |
| | | // -> product_bom |
| | | /*List<ProductBom> productBomList = new LinkedList<>(); |
| | | List<ProductBom> productBomList = new LinkedList<>(); |
| | | bomMaterialList.forEach(bomMaterial -> { |
| | | ProductBom bom = new ProductBom(); |
| | | bom.setProductId(product.getId()); |
| | |
| | | |
| | | productBomList.add(bom); |
| | | }); |
| | | pbService.insertBatch(productBomList);*/ |
| | | pbService.insertBatch(productBomList); |
| | | // -> product_bom_history |
| | | List<ProductBomHistory> bomHistoryList = new LinkedList<>(); |
| | | bomMaterialList.forEach(bomMaterial -> { |