|
|
|
@ -16,6 +16,8 @@ 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.model.BuyerEntity; |
|
|
|
|
import com.dxhy.order.baseservice.module.buyer.service.BuyerService; |
|
|
|
|
import com.dxhy.order.baseservice.module.taxclass.dao.TaxClassCodeMapper; |
|
|
|
|
import com.dxhy.order.baseservice.module.taxclass.model.TaxClassCodeEntity; |
|
|
|
|
import com.dxhy.order.baseservice.module.thirdservice.redis.service.RedisService; |
|
|
|
|
import com.dxhy.order.baseservice.module.thirdservice.simsback.service.SimsBackService; |
|
|
|
|
import com.dxhy.order.baseservice.module.thirdservice.user.service.UserInfoService; |
|
|
|
@ -127,6 +129,9 @@ public class InvoiceServiceImpl implements InvoiceService { |
|
|
|
|
@Resource |
|
|
|
|
private RuleSplitService ruleSplitService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private TaxClassCodeMapper taxClassCodeMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@Transactional |
|
|
|
@ -134,6 +139,29 @@ public class InvoiceServiceImpl implements InvoiceService { |
|
|
|
|
List<PageInvoiceItem> pageInvoiceItemList = pageInvoiceReq.getPageInvoiceItemList(); |
|
|
|
|
//查询数据列表
|
|
|
|
|
List<CommonOrderInfo> commonOrderInfos = orderInfoService.batchQueryOrderInfoByOrderIdsAndNsrsbh(pageInvoiceItemList); |
|
|
|
|
//购方是否为空、税编是否为空校验、成品油混开校验
|
|
|
|
|
for(CommonOrderInfo commonOrderInfo:commonOrderInfos){ |
|
|
|
|
if(StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfNsrsbh()) || StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfMc()) ){ |
|
|
|
|
return R.error("结算单:"+commonOrderInfo.getOrderInfo().getDdh()+"购方信息为空,请补全!"); |
|
|
|
|
} |
|
|
|
|
String cpy = ""; |
|
|
|
|
for(OrderItemInfo orderItemInfo: commonOrderInfo.getOrderItemInfo()){ |
|
|
|
|
if(StrUtil.isBlank(orderItemInfo.getSpbm())){ |
|
|
|
|
return R.error("结算单:"+commonOrderInfo.getOrderInfo().getDdh()+"第"+orderItemInfo.getSphxh()+"行商品税编为空,请补全!"); |
|
|
|
|
}else { |
|
|
|
|
TaxClassCodeEntity taxClassCodeEntity = taxClassCodeMapper.selectTaxClassCodeBySpbm(orderItemInfo.getSpbm()); |
|
|
|
|
if(StrUtil.isNotBlank(cpy)){ |
|
|
|
|
if(!cpy.equals(taxClassCodeEntity.getCpy())){ |
|
|
|
|
return R.error("结算单:"+commonOrderInfo.getOrderInfo().getDdh()+"成品油和非成品油税编不能混开,请做手动拆分处理!"); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
cpy = taxClassCodeEntity.getCpy(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//客户冻结状态校验、确认智能赋码、单价误差校验
|
|
|
|
|
List<Map<String,String>> consumerList = new ArrayList<>(); |
|
|
|
|
List<Map<String,String>> confirmList = new ArrayList<>(); |
|
|
|
|
List<Map<String,String>> djOverflowList = new ArrayList<>(); |
|
|
|
|