更新物料行

This commit is contained in:
jing's 2023-12-26 16:15:24 +08:00
parent 4f4ecc74c7
commit 55f80f8ed5
4 changed files with 60 additions and 0 deletions

View File

@ -268,6 +268,19 @@ public class EbomApi extends BaseApi {
}
@PostMapping("changeMaterial")
@ApiOperation("更新物料行")
public ResultVO<List<BomNewEbomParentVO>> changeMaterial(@RequestBody BomNewEBomChangeDTO dto) {
if ( dto.getParent() ==null || CollectionUtil.isEmpty(dto.getDatas()) ) {
return ResultVO.error(STATE.Error, "");
}
return ResultVO.success(bomNewEbomParentService.changeMaterial(dto));
}
@GetMapping("delete")

View File

@ -0,0 +1,18 @@
package com.nflg.product.bomnew.pojo.dto;
import com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class BomNewEBomChangeDTO {
@ApiModelProperty("查询物料列表")
private List<BomNewEbomParentVO> datas;
@ApiModelProperty("上层")
private BomNewEbomParentVO parent;
}

View File

@ -1161,4 +1161,26 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
}
/**
* 变更物料
*/
public List<BomNewEbomParentVO> changeMaterial(BomNewEBomChangeDTO dto){
List<BomNewEbomParentVO> parentChild=dto.getDatas();
materialMainService.intiMaterialInfo(parentChild );
List<BomNewEbomParentVO> checkBom=new ArrayList<>();
checkBom.add(dto.getParent());
checkBom.addAll(dto.getDatas());
CheckEBomException checkEBomException=new CheckEBomException(checkBom);
checkEBomException.checkException();
return dto.getDatas();
}
}

View File

@ -69,6 +69,13 @@ public class CheckEBomException {
}
public void initException( String ... ignorePropertyList) {
SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(allBomDetail,ignorePropertyList);
checkException();
}
public void checkException(){
for (BomNewEbomParentVO vo : allBomDetail) {