optimize(ebom): 导入SAP优化
This commit is contained in:
parent
88aa53956b
commit
a6869a8a9a
|
|
@ -273,25 +273,22 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP {
|
|||
* @param materialNo 直发包编号
|
||||
*/
|
||||
@Override
|
||||
public void exportFromZFB(String materialNo) {
|
||||
List<BomNewPbomParentEntity> pfhbs = bomNewPbomParentService.lambdaQuery()
|
||||
public void exportFromZFB(String materialNo, String facCode) {
|
||||
BomNewPbomParentEntity pfhb = bomNewPbomParentService.lambdaQuery()
|
||||
.eq(BomNewPbomParentEntity::getMaterialNo, materialNo)
|
||||
.eq(BomNewPbomParentEntity::getFacCode, facCode)
|
||||
.ge(BomNewPbomParentEntity::getStatus, PBomStatusEnum.PUBLISH.getValue())
|
||||
.list();
|
||||
VUtils.isTure(Objects.isNull(pfhbs)).throwMessage("没有需要导入的数据");
|
||||
.one();
|
||||
VUtils.isTure(Objects.isNull(pfhb)).throwMessage("没有需要导入的数据");
|
||||
|
||||
pfhbs.forEach(pfhb -> {
|
||||
List<OperationErrorMsgVO> errorMsgVOS = export(pfhb.getRowId());
|
||||
if (CollUtil.isNotEmpty(errorMsgVOS)) {
|
||||
//如果导入SAP出错了,得将该bom提升为用户根节点,以便用户手动尝试导入到SAP去
|
||||
pfhb.setUserRootIs(1);
|
||||
pfhb.setModifyTime(LocalDateTime.now());
|
||||
}
|
||||
});
|
||||
|
||||
pfhbs.removeIf(p -> Objects.equals(p.getLastVersionIs(), 0));
|
||||
if (CollUtil.isNotEmpty(pfhbs)) {
|
||||
bomNewPbomParentService.updateBatchById(pfhbs);
|
||||
if (Objects.equals(pfhb.getLastVersionIs(), 1)) {
|
||||
bomNewPbomParentService.updateById(pfhb);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,5 +27,5 @@ public interface IBomNewPbomExportToSAP {
|
|||
* 根据直发包编号导入上级物料到SAP
|
||||
* @param materialNo 直发包编号
|
||||
*/
|
||||
void exportFromZFB(String materialNo);
|
||||
void exportFromZFB(String materialNo, String facCode);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue