Merge remote-tracking branch 'origin/task_4631_wq' into test

# Conflicts:
#	order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/manager/service/impl/InvoiceServiceImpl.java
release
WangQi 2 years ago
commit d345caa22a
  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);
/**
* 校验购方银行账户
* @param buyerCode
* @param entId
*/
void checkBuyerCheckBankFlag(List<String> orderInfoIdList);
}

@ -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()+"购方银行账号为空,请补全!");
}
}
});
}
}

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

Loading…
Cancel
Save