fix(ebom): 调整事务位置
This commit is contained in:
parent
be2a133e2b
commit
d4788a1d4a
|
|
@ -56,6 +56,7 @@ public class EBomImportService {
|
|||
@Resource
|
||||
private BomNewEbomChildService bomNewEbomChildService;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public List<OperationErrorMsgVO> importBom(MultipartFile file) throws IOException {
|
||||
try {
|
||||
rowNum.set(1);
|
||||
|
|
@ -89,13 +90,15 @@ public class EBomImportService {
|
|||
ebomChildService.updateEBomMaterialUse(pcs.getRight().stream().map(BomNewEbomChildEntity::getMaterialNo).collect(Collectors.toSet()));
|
||||
|
||||
return Collections.emptyList();
|
||||
} catch (Exception ex) {
|
||||
log.error("导入ebom异常", ex);
|
||||
throw ex;
|
||||
} finally {
|
||||
excelContextTL.remove();
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void save(List<BomNewEbomParentEntity> parents, List<BomNewEbomChildEntity> children) {
|
||||
private void save(List<BomNewEbomParentEntity> parents, List<BomNewEbomChildEntity> children) {
|
||||
Set<String> pMaterialNos = parents.stream().map(BomNewEbomParentEntity::getMaterialNo).collect(Collectors.toSet());
|
||||
List<BomNewEbomParentEntity> oldParents = bomNewEbomParentService.getLatestByMaterialNo(pMaterialNos);
|
||||
oldParents.forEach(p -> {
|
||||
|
|
|
|||
Loading…
Reference in New Issue