|
|
|
@ -14,6 +14,7 @@ import com.dxhy.order.baseservice.module.base.model.RuleSplitEntity; |
|
|
|
|
import com.dxhy.order.baseservice.module.base.service.BaseService; |
|
|
|
|
import com.dxhy.order.baseservice.module.base.service.DrawerInfoService; |
|
|
|
|
import com.dxhy.order.baseservice.module.base.service.RuleSplitService; |
|
|
|
|
import com.dxhy.order.baseservice.module.buyer.dao.BuyerMapper; |
|
|
|
|
import com.dxhy.order.baseservice.module.buyer.model.BuyerEntity; |
|
|
|
|
import com.dxhy.order.baseservice.module.buyer.service.BuyerService; |
|
|
|
|
import com.dxhy.order.baseservice.module.taxclass.dao.TaxClassCodeMapper; |
|
|
|
@ -46,6 +47,7 @@ import com.dxhy.order.utils.JsonUtils; |
|
|
|
|
import com.dxhy.order.utils.NsrsbhUtils; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
@ -132,6 +134,9 @@ public class InvoiceServiceImpl implements InvoiceService { |
|
|
|
|
@Resource |
|
|
|
|
private TaxClassCodeMapper taxClassCodeMapper; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private BuyerMapper buyerMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@Transactional |
|
|
|
@ -141,9 +146,34 @@ public class InvoiceServiceImpl implements InvoiceService { |
|
|
|
|
List<CommonOrderInfo> commonOrderInfos = orderInfoService.batchQueryOrderInfoByOrderIdsAndNsrsbh(pageInvoiceItemList); |
|
|
|
|
//购方是否为空、税编是否为空校验、成品油校验
|
|
|
|
|
for(CommonOrderInfo commonOrderInfo:commonOrderInfos){ |
|
|
|
|
if(StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfNsrsbh()) || StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfMc()) ){ |
|
|
|
|
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.equals(buyerEntity.getCheckBankFlag())) { |
|
|
|
|
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()+"购方银行账号为空,请补全!"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// if(StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfNsrsbh()) || StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfMc()) ){
|
|
|
|
|
// return R.error("结算单:"+commonOrderInfo.getOrderInfo().getDdh()+"购方信息为空,请补全!");
|
|
|
|
|
// }
|
|
|
|
|
String cpy = ""; |
|
|
|
|
String kcp = baseServiceConfig.getKcp(); |
|
|
|
|
boolean kcpMark = kcp.contains(commonOrderInfo.getOrderItemInfo().get(0).getSpbm()); |
|
|
|
|