feature 1.修复已拆分已开票的数据返回sap错误信息

release
zhenghaiyang@ele-cloud.com 2 years ago
parent 34f9de750e
commit ad74101a7d
  1. 5
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/order/service/OrderProcessService.java
  2. 16
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/order/service/impl/OrderProcessServiceImpl.java
  3. 14
      order-management-consumer/src/main/java/com/dxhy/order/consumer/openapi/service/impl/AllocateInvoiceInterfaceServiceImplV3.java
  4. 3
      order-management-consumer/src/main/java/com/dxhy/order/consumer/openapi/service/impl/InterfaceServiceImplV6.java

@ -1,8 +1,8 @@
package com.dxhy.order.consumer.modules.order.service;
import com.dxhy.order.consumer.modules.order.model.bo.YwlxCountTotalBO;
import com.dxhy.order.model.OrderProcessInfo;
import com.dxhy.order.model.PageUtils;
import com.dxhy.order.consumer.modules.order.model.bo.YwlxCountTotalBO;
import java.util.List;
import java.util.Map;
@ -51,6 +51,9 @@ public interface OrderProcessService {
*/
PageUtils selectOrderInfo(Map<String, Object> map, List<String> shList, List<String> entList);
List<OrderProcessInfo> queryOrderInfo(Map map, List<String> shList, List<String> entList);
/**
* 更新开票状态
*

@ -1,22 +1,21 @@
package com.dxhy.order.consumer.modules.order.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.dxhy.order.baseservice.module.thirdservice.user.model.DeptEntity;
import com.dxhy.order.baseservice.module.thirdservice.user.service.UserInfoService;
import com.dxhy.order.constant.ConfigureConstant;
import com.dxhy.order.constant.OrderInfoEnum;
import com.dxhy.order.model.OrderInvoiceInfo;
import com.dxhy.order.model.OrderProcessInfo;
import com.dxhy.order.model.OrderProcessInfoExt;
import com.dxhy.order.model.PageUtils;
import com.dxhy.order.consumer.dao.OrderProcessInfoExtMapper;
import com.dxhy.order.consumer.dao.OrderProcessInfoMapper;
import com.dxhy.order.consumer.modules.order.model.bo.YwlxCountBO;
import com.dxhy.order.consumer.modules.order.model.bo.YwlxCountTotalBO;
import com.dxhy.order.consumer.modules.order.service.OrderProcessService;
import com.dxhy.order.invoice.module.invoice.service.OrderInvoiceInfoService;
import com.dxhy.order.model.OrderInvoiceInfo;
import com.dxhy.order.model.OrderProcessInfo;
import com.dxhy.order.model.OrderProcessInfoExt;
import com.dxhy.order.model.PageUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
@ -92,7 +91,12 @@ public class OrderProcessServiceImpl implements OrderProcessService {
return new PageUtils(pageInfo.getList(), (int) pageInfo.getTotal(), pageInfo.getPageSize(),
pageInfo.getPageNum());
}
@Override
public List<OrderProcessInfo> queryOrderInfo(Map map, List<String> shList, List<String> entList) {
return orderProcessInfoMapper.queryOrderInfo(map, shList, entList);
}
@Override
@Transactional(rollbackFor = Exception.class)
public boolean updateKpzt(String fpqqlsh, String ddzt, String kpzt, String sbyy, String sld, String sldMc, String fjh, List<String> shList) {

@ -48,6 +48,7 @@ import com.dxhy.order.utils.CommonUtils;
import com.dxhy.order.utils.DecimalCalculateUtil;
import com.dxhy.order.utils.JsonUtils;
import com.dxhy.order.utils.NsrsbhUtils;
import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
@ -57,6 +58,7 @@ import javax.annotation.Resource;
import java.io.UnsupportedEncodingException;
import java.text.DecimalFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
* 订单对外接口业务实现类-发票开具接口
@ -1244,6 +1246,18 @@ public class AllocateInvoiceInterfaceServiceImplV3 implements AllocateInvoiceInt
//校验请求流水号是否重复
if (ObjectUtil.isNotNull(selectOrderProcessInfo)) {
if (OrderInfoEnum.DATE_DELETE_STATUS_1.getKey().equals(selectOrderProcessInfo.getOrderStatus())) {
Map<String, String> map = Maps.newHashMap();
map.put("originOrderId",selectOrderProcessInfo.getOrderInfoId());
map.put("orderStatus",OrderInfoEnum.DATE_DELETE_STATUS_0.getKey());
List<OrderProcessInfo> processInfos = orderProcessService.queryOrderInfo(map, null, null);
if(processInfos != null && !processInfos.isEmpty()){
//证明是拆分的订单
List<String> invalidList = orderInvoiceInfoService.countInoviceInfo(processInfos.stream().map(OrderProcessInfo::getOrderInfoId).collect(Collectors.toList()));
if(invalidList != null && !invalidList.isEmpty() && invalidList.size() != processInfos.size()){
log.error("{}证明是拆分的订单,请求流水号已存在!订单ID为:{},流水号为:{}", LOGGER_MSG, selectOrderProcessInfo.getOrderInfoId(), ddqqlsh);
throw new OrderReceiveException(OrderInfoContentEnum.INVOICE_ERROR_CODE_010002_V3);
}
}
throw new OrderReceiveException(OrderInfoContentEnum.INVOICE_ERROR_CODE_010015_V3);
}

@ -10,9 +10,7 @@ import com.dxhy.order.consumer.constant.InterfaceNameEnum;
import com.dxhy.order.consumer.dao.InterfaceRequestDataMapper;
import com.dxhy.order.consumer.dao.OrderProcessInfoMapper;
import com.dxhy.order.consumer.model.page.PageRequestVO;
import com.dxhy.order.consumer.modules.order.controller.OrderInvoiceController;
import com.dxhy.order.consumer.modules.order.service.OrderInfoService;
import com.dxhy.order.consumer.modules.order.service.OrderProcessService;
import com.dxhy.order.consumer.openapi.protocol.po.EsOutput;
import com.dxhy.order.consumer.openapi.protocol.po.IsInput;
import com.dxhy.order.consumer.openapi.protocol.po.PoCommonRequestParam;
@ -154,6 +152,7 @@ public class InterfaceServiceImplV6 implements InterfaceServiceV6 {
poCommonResponseParam.setES_OUTPUT(esOutput);
return poCommonResponseParam;
}
//拆分或者页面逻辑删除的订单也需要重新修改流水号,否则进不来
// List<OrderProcessInfo> collect = orderProcessInfos.stream().filter(t -> "0".equals(t.getOrderStatus())).collect(Collectors.toList());
// if(collect.isEmpty()){

Loading…
Cancel
Save