task4631 开票申请单详情接口增加是否校验客户信息字段

release
WangQi 2 years ago
parent 8c82c95c8e
commit d9a5e8f070
  1. 7
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/manager/service/InvoiceService.java
  2. 59
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/manager/service/impl/InvoiceServiceImpl.java
  3. 11
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/order/controller/OrderSplitController.java

@ -109,4 +109,11 @@ public interface InvoiceService {
*/ */
R invalidAndReInvoice(Map mapList); R invalidAndReInvoice(Map mapList);
/**
* 校验购方银行账户
* @param buyerCode
* @param entId
*/
void checkBuyerCheckBankFlag(List<String> orderInfoIdList);
} }

@ -33,6 +33,7 @@ import com.dxhy.order.consumer.utils.TaxSpecialPolicyUtil;
import com.dxhy.order.exception.OrderReceiveException; import com.dxhy.order.exception.OrderReceiveException;
import com.dxhy.order.invoice.config.InvoiceConfig; import com.dxhy.order.invoice.config.InvoiceConfig;
import com.dxhy.order.invoice.module.fangge.service.FangGeService; 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.model.PageSld;
import com.dxhy.order.invoice.module.invoice.service.InvalidInvoiceService; import com.dxhy.order.invoice.module.invoice.service.InvalidInvoiceService;
import com.dxhy.order.invoice.module.invoice.service.OrderInvoiceInfoService; import com.dxhy.order.invoice.module.invoice.service.OrderInvoiceInfoService;
@ -137,6 +138,9 @@ public class InvoiceServiceImpl implements InvoiceService {
@Autowired @Autowired
private BuyerMapper buyerMapper; private BuyerMapper buyerMapper;
@Autowired
private OrderInfoMapper orderInfoMapper;
@Override @Override
@Transactional @Transactional
@ -149,28 +153,8 @@ public class InvoiceServiceImpl implements InvoiceService {
if (StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfMc())) { if (StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfMc())) {
return R.error("结算单:"+commonOrderInfo.getOrderInfo().getDdh()+"购方信息为空,请补全!"); return R.error("结算单:"+commonOrderInfo.getOrderInfo().getDdh()+"购方信息为空,请补全!");
} }
BuyerEntity buyerEntity = buyerMapper.queryBuyerInfoByGhfIdAndEntId(commonOrderInfo.getOrderInfo().getGhfId(), commonOrderInfo.getOrderInfo().getEntId()); checkBuyerCheckBankFlag(Arrays.asList(commonOrderInfo.getOrderInfo().getId()));
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()+"购方银行账号为空,请补全!");
}
}
// if(StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfNsrsbh()) || StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfMc()) ){ // if(StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfNsrsbh()) || StrUtil.isBlank(commonOrderInfo.getOrderInfo().getGhfMc()) ){
// return R.error("结算单:"+commonOrderInfo.getOrderInfo().getDdh()+"购方信息为空,请补全!"); // return R.error("结算单:"+commonOrderInfo.getOrderInfo().getDdh()+"购方信息为空,请补全!");
// } // }
@ -1536,4 +1520,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()+"购方银行账号为空,请补全!");
}
}
});
}
} }

@ -5,6 +5,7 @@ import com.dxhy.order.constant.ConfigureConstant;
import com.dxhy.order.constant.OrderInfoContentEnum; import com.dxhy.order.constant.OrderInfoContentEnum;
import com.dxhy.order.constant.OrderInfoEnum; import com.dxhy.order.constant.OrderInfoEnum;
import com.dxhy.order.constant.OrderManagementConstant; import com.dxhy.order.constant.OrderManagementConstant;
import com.dxhy.order.consumer.modules.manager.service.InvoiceService;
import com.dxhy.order.exception.OrderReceiveException; import com.dxhy.order.exception.OrderReceiveException;
import com.dxhy.order.model.CommonOrderInfo; import com.dxhy.order.model.CommonOrderInfo;
import com.dxhy.order.model.OrderProcessInfo; import com.dxhy.order.model.OrderProcessInfo;
@ -23,11 +24,13 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -52,6 +55,9 @@ public class OrderSplitController {
@Resource @Resource
private OrderProcessService orderProcessService; private OrderProcessService orderProcessService;
@Autowired
private InvoiceService invoiceService;
/** /**
* 根据开票项目拆分订单接口,对应前端-单据管理-单据详情-明细行拆分功能 * 根据开票项目拆分订单接口,对应前端-单据管理-单据详情-明细行拆分功能
@ -81,7 +87,7 @@ public class OrderSplitController {
if (!ConfigureConstant.STRING_0000.equals(r.get(OrderManagementConstant.CODE))) { if (!ConfigureConstant.STRING_0000.equals(r.get(OrderManagementConstant.CODE))) {
return r; return r;
} }
invoiceService.checkBuyerCheckBankFlag(orderIds);
orderSplitService.saveOrderSplitOrder(commonList); orderSplitService.saveOrderSplitOrder(commonList);
return R.ok(); return R.ok();
} catch (OrderReceiveException e) { } catch (OrderReceiveException e) {
@ -155,6 +161,7 @@ public class OrderSplitController {
if (!ConfigureConstant.STRING_0000.equals(r.get(OrderManagementConstant.CODE))) { if (!ConfigureConstant.STRING_0000.equals(r.get(OrderManagementConstant.CODE))) {
return r; return r;
} }
invoiceService.checkBuyerCheckBankFlag(orderIds);
/** /**
* 拆分订单 * 拆分订单
*/ */
@ -208,7 +215,7 @@ public class OrderSplitController {
log.error("{},请求税号为空!", LOGGER_MSG); log.error("{},请求税号为空!", LOGGER_MSG);
return R.error(OrderInfoContentEnum.TAXCODE_ISNULL); return R.error(OrderInfoContentEnum.TAXCODE_ISNULL);
} }
invoiceService.checkBuyerCheckBankFlag(Arrays.asList(orderId));
List<String> shList = NsrsbhUtils.transShListByXhfNsrsbh(xhfNsrsbh); List<String> shList = NsrsbhUtils.transShListByXhfNsrsbh(xhfNsrsbh);
OrderSplitConfig config = new OrderSplitConfig(); OrderSplitConfig config = new OrderSplitConfig();
config.setSplitType(OrderSplitEnum.ORDER_SPLIT_TYPE_3.getKey()); config.setSplitType(OrderSplitEnum.ORDER_SPLIT_TYPE_3.getKey());

Loading…
Cancel
Save