购方信息查不到跳过校验

release
WangQi 2 years ago
parent a90e8564f7
commit db5cc20186
  1. 40
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/manager/service/impl/InvoiceServiceImpl.java

@ -1596,25 +1596,27 @@ public class InvoiceServiceImpl implements InvoiceService {
orderInfoIdList.stream().forEach(id->{
OrderInfo orderInfo = orderInfoMapper.selectOrderInfoByOrderId(id, null);
BuyerEntity buyerEntity = buyerMapper.queryBuyerInfoByGhfIdAndEntId(orderInfo.getGhfId(), orderInfo.getEntId());
if (buyerEntity == null) {
throw new RuntimeException("结算单:"+orderInfo.getDdh()+"购方信息为空,请补全!");
}
if (OrderInfoEnum.CHECK_BANK_FLAG_YES.getKey().equals(buyerEntity.getCheckBankFlag())) {
log.info("开始校验客户信息完整");
if (StrUtil.isBlank(orderInfo.getGhfNsrsbh())) {
throw new RuntimeException("结算单:"+orderInfo.getDdh()+"购方纳税人识别号为空,请补全!");
}
if (StrUtil.isBlank(orderInfo.getGhfDz())) {
throw new RuntimeException("结算单:"+orderInfo.getDdh()+"购方地址为空,请补全!");
}
if (StrUtil.isBlank(orderInfo.getGhfDh())) {
throw new RuntimeException("结算单:"+orderInfo.getDdh()+"购方电话为空,请补全!");
}
if (StrUtil.isBlank(orderInfo.getGhfYh())) {
throw new RuntimeException("结算单:"+orderInfo.getDdh()+"购方开户行为空,请补全!");
}
if (StrUtil.isBlank(orderInfo.getGhfZh())) {
throw new RuntimeException("结算单:"+orderInfo.getDdh()+"购方银行账号为空,请补全!");
// if (buyerEntity == null) {
// throw new RuntimeException("结算单:"+orderInfo.getDdh()+"购方信息为空,请补全!");
// }
if (buyerEntity != null) {
if (OrderInfoEnum.CHECK_BANK_FLAG_YES.getKey().equals(buyerEntity.getCheckBankFlag())) {
log.info("开始校验客户信息完整");
if (StrUtil.isBlank(orderInfo.getGhfNsrsbh())) {
throw new RuntimeException("结算单:"+orderInfo.getDdh()+"购方纳税人识别号为空,请补全!");
}
if (StrUtil.isBlank(orderInfo.getGhfDz())) {
throw new RuntimeException("结算单:"+orderInfo.getDdh()+"购方地址为空,请补全!");
}
if (StrUtil.isBlank(orderInfo.getGhfDh())) {
throw new RuntimeException("结算单:"+orderInfo.getDdh()+"购方电话为空,请补全!");
}
if (StrUtil.isBlank(orderInfo.getGhfYh())) {
throw new RuntimeException("结算单:"+orderInfo.getDdh()+"购方开户行为空,请补全!");
}
if (StrUtil.isBlank(orderInfo.getGhfZh())) {
throw new RuntimeException("结算单:"+orderInfo.getDdh()+"购方银行账号为空,请补全!");
}
}
}
});

Loading…
Cancel
Save