|
|
|
@ -36,6 +36,7 @@ import com.dxhy.order.consumer.utils.TaxSpecialPolicyUtil; |
|
|
|
|
import com.dxhy.order.exception.OrderReceiveException; |
|
|
|
|
import com.dxhy.order.invoice.config.InvoiceConfig; |
|
|
|
|
import com.dxhy.order.invoice.module.fangge.service.FangGeService; |
|
|
|
|
import com.dxhy.order.invoice.module.invoice.dao.OrderInfoMapper; |
|
|
|
|
import com.dxhy.order.invoice.module.invoice.model.PageSld; |
|
|
|
|
import com.dxhy.order.invoice.module.invoice.service.InvalidInvoiceService; |
|
|
|
|
import com.dxhy.order.invoice.module.invoice.service.OrderInvoiceInfoService; |
|
|
|
@ -143,6 +144,9 @@ public class InvoiceServiceImpl implements InvoiceService { |
|
|
|
|
@Autowired |
|
|
|
|
private BuyerMapper buyerMapper; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private OrderInfoMapper orderInfoMapper; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private OrderSplitService orderSplitService; |
|
|
|
|
|
|
|
|
@ -164,28 +168,8 @@ public class InvoiceServiceImpl implements InvoiceService { |
|
|
|
|
if (StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfMc())) { |
|
|
|
|
return R.error("结算单:"+commonOrderInfo.getOrderInfo().getDdh()+"购方信息为空,请补全!"); |
|
|
|
|
} |
|
|
|
|
BuyerEntity buyerEntity = buyerMapper.queryBuyerInfoByGhfIdAndEntId(commonOrderInfo.getOrderInfo().getGhfId(), commonOrderInfo.getOrderInfo().getEntId()); |
|
|
|
|
if (buyerEntity == null) { |
|
|
|
|
return R.error("结算单:"+commonOrderInfo.getOrderInfo().getDdh()+"购方信息为空,请补全!"); |
|
|
|
|
} |
|
|
|
|
if (OrderInfoEnum.CHECK_BANK_FLAG_YES.getKey().equals(buyerEntity.getCheckBankFlag())) { |
|
|
|
|
log.info("开始校验客户信息完整"); |
|
|
|
|
if (StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfNsrsbh())) { |
|
|
|
|
return R.error("结算单:"+commonOrderInfo.getOrderInfo().getDdh()+"购方纳税人识别号为空,请补全!"); |
|
|
|
|
} |
|
|
|
|
if (StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfDz())) { |
|
|
|
|
return R.error("结算单:"+commonOrderInfo.getOrderInfo().getDdh()+"购方地址为空,请补全!"); |
|
|
|
|
} |
|
|
|
|
if (StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfDh())) { |
|
|
|
|
return R.error("结算单:"+commonOrderInfo.getOrderInfo().getDdh()+"购方电话为空,请补全!"); |
|
|
|
|
} |
|
|
|
|
if (StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfYh())) { |
|
|
|
|
return R.error("结算单:"+commonOrderInfo.getOrderInfo().getDdh()+"购方开户行为空,请补全!"); |
|
|
|
|
} |
|
|
|
|
if (StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfZh())) { |
|
|
|
|
return R.error("结算单:"+commonOrderInfo.getOrderInfo().getDdh()+"购方银行账号为空,请补全!"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
checkBuyerCheckBankFlag(Arrays.asList(commonOrderInfo.getOrderInfo().getId())); |
|
|
|
|
|
|
|
|
|
// if(StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfNsrsbh()) || StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfMc()) ){
|
|
|
|
|
// return R.error("结算单:"+commonOrderInfo.getOrderInfo().getDdh()+"购方信息为空,请补全!");
|
|
|
|
|
// }
|
|
|
|
@ -1606,4 +1590,35 @@ public class InvoiceServiceImpl implements InvoiceService { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@Transactional |
|
|
|
|
public void checkBuyerCheckBankFlag(List<String> orderInfoIdList) { |
|
|
|
|
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()+"购方银行账号为空,请补全!"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|