|
@@ -17,7 +17,6 @@ import com.fjhx.common.constant.SourceConstant;
|
|
|
import com.fjhx.common.entity.AvailableStockBo;
|
|
|
import com.fjhx.common.service.file.FtpFileService;
|
|
|
import com.fjhx.common.service.file.impl.FtpFileServiceImpl;
|
|
|
-import com.fjhx.common.utils.Assert;
|
|
|
import com.fjhx.file.entity.FileInfoVo;
|
|
|
import com.fjhx.file.utils.ObsFileUtil;
|
|
|
import com.fjhx.item.entity.product.ProcessesBo;
|
|
@@ -324,8 +323,8 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
|
|
|
|
|
|
editFtpFile(productInfoDto);
|
|
|
|
|
|
-
|
|
|
- saveOrEditRawMaterial(productInfoDto);
|
|
|
+
|
|
|
+
|
|
|
|
|
|
this.save(productInfoDto);
|
|
|
ObsFileUtil.saveFile(productInfoDto.getFileList(), productInfoDto.getId());
|
|
@@ -456,8 +455,8 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
|
|
|
productInfoDto.setCompanyId(SecurityUtils.getCompanyId());
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- saveOrEditRawMaterial(productInfoDto);
|
|
|
+
|
|
|
+
|
|
|
|
|
|
this.updateById(productInfoDto);
|
|
|
ObsFileUtil.editFile(productInfoDto.getFileList(), productInfoDto.getId());
|
|
@@ -496,35 +495,35 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- * 保存修改产品原材料
|
|
|
- */
|
|
|
- private void saveOrEditRawMaterial(ProductInfoDto productInfoDto) {
|
|
|
-
|
|
|
- if (ObjectUtil.notEqual(productInfoDto.getDefinition(), 1)) {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- Long rawMaterialId = productInfoDto.getRawMaterialId();
|
|
|
- Assert.notEmpty(rawMaterialId, "原材料Id不能为空");
|
|
|
-
|
|
|
- List<ProductBomDetail> productBomDetailList = productInfoDto.getProductBomDetailList();
|
|
|
- if (ObjectUtil.isNotEmpty(productBomDetailList)) {
|
|
|
- List<ProductBomDetail> rawMaterialList = productBomDetailList.stream()
|
|
|
- .filter(item -> ObjectUtil.equals(item.getType(), 1)).collect(Collectors.toList());
|
|
|
-
|
|
|
- if (ObjectUtil.isEmpty(rawMaterialList)) {
|
|
|
- ProductBomDetail productBomDetail = new ProductBomDetail();
|
|
|
- productBomDetail.setMaterialId(rawMaterialId);
|
|
|
- productBomDetail.setType(1);
|
|
|
- productBomDetail.setQuantity(BigDecimal.ONE);
|
|
|
- productBomDetailList.add(productBomDetail);
|
|
|
- } else {
|
|
|
- ProductBomDetail productBomDetail = rawMaterialList.get(0);
|
|
|
- productBomDetail.setMaterialId(rawMaterialId);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
@DSTransactional
|
|
|
@Override
|