|
|
@ -395,7 +395,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas |
|
|
|
} |
|
|
|
List<EasOutInBillDto> easBills = new ArrayList<>(); |
|
|
|
List<EasOutInBillDto> srmBills = new ArrayList<>(); |
|
|
|
//明细行自动审核
|
|
|
|
//对单个明细行的自动审核
|
|
|
|
if (!isDetail) { |
|
|
|
List<EasBillDetailDto> easBillDetailList = easOutInBillDetailMapper.queryDetailList(ids); |
|
|
|
if (CollectionUtils.isEmpty(easBillDetailList)) { |
|
|
@ -423,14 +423,14 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas |
|
|
|
srmBills.add(easOutInBillDto); |
|
|
|
} |
|
|
|
} else { |
|
|
|
//所有主表
|
|
|
|
//对单据头的审核
|
|
|
|
List<EasOutInBillDto> easOutInBillList = easOutInBillMapper.queryBillList(ids); |
|
|
|
//所有明细表
|
|
|
|
List<EasOutInBillDetailDto> easOutInBillDetailList = easOutInBillDetailMapper.queryBillDetailList(ids); |
|
|
|
// long count = easOutInBillDetailList.stream().filter(r -> r.getQty().compareTo(BigDecimal.ZERO) == 0).count();
|
|
|
|
// if (count == easOutInBillDetailList.size()) {
|
|
|
|
// throw new BadRequestException("该单据无任何出入库操作,请检查");
|
|
|
|
// }
|
|
|
|
long count = easOutInBillDetailList.stream().filter(r -> r.getQty().compareTo(BigDecimal.ZERO) == 0).count(); |
|
|
|
if (count == easOutInBillDetailList.size()) { |
|
|
|
throw new BadRequestException("该单据无任何出入库操作,请检查"); |
|
|
|
} |
|
|
|
//报文组合
|
|
|
|
if (CollectionUtils.isNotEmpty(easOutInBillList)) { |
|
|
|
easOutInBillList.forEach(b -> { |
|
|
@ -509,6 +509,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas |
|
|
|
/** |
|
|
|
* Eas多个单据审核 |
|
|
|
*/ |
|
|
|
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) |
|
|
|
public void syncEasAuditBills(List<EasOutInBillDto> bills) { |
|
|
|
for (EasOutInBillDto bill : bills) { |
|
|
|
try { |
|
|
@ -519,7 +520,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas |
|
|
|
updateBills(bill); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("推送Eas单据失败,单据号为:[" + bill.getBillId() + "]异常原因:" + e.toString()); |
|
|
|
throw new BadRequestException(e.toString()); |
|
|
|
//throw new BadRequestException(e.toString());
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -527,6 +528,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas |
|
|
|
/** |
|
|
|
* Srm多个单据审核 |
|
|
|
*/ |
|
|
|
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) |
|
|
|
public void syncSrmAuditBills(List<EasOutInBillDto> bills) { |
|
|
|
for (EasOutInBillDto bill : bills) { |
|
|
|
try { |
|
|
@ -535,7 +537,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas |
|
|
|
updateBills(bill); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("推送Eas单据失败,单据号为:[" + bill.getBillId() + "]异常原因:" + e.toString()); |
|
|
|
throw new BadRequestException(e.toString()); |
|
|
|
//throw new BadRequestException(e.toString());
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|