|
|
@ -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,12 +87,15 @@ 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) { |
|
|
|
log.warn("{}订单拆分接口保存失败:{}", LOGGER_MSG, e); |
|
|
|
log.warn("{}订单拆分接口保存失败:{}", LOGGER_MSG, e); |
|
|
|
return R.ok().put(OrderManagementConstant.CODE, e.getCode()).put(OrderManagementConstant.MESSAGE, e.getMessage()); |
|
|
|
return R.ok().put(OrderManagementConstant.CODE, e.getCode()).put(OrderManagementConstant.MESSAGE, e.getMessage()); |
|
|
|
|
|
|
|
} catch (RuntimeException e) { |
|
|
|
|
|
|
|
log.error("{}订单拆分接口异常,异常信息:{}", LOGGER_MSG, e); |
|
|
|
|
|
|
|
return R.error(e.getMessage()); |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("{}订单拆分接口异常,异常信息:{}", LOGGER_MSG, e); |
|
|
|
log.error("{}订单拆分接口异常,异常信息:{}", LOGGER_MSG, e); |
|
|
|
return R.error(e.getMessage()); |
|
|
|
return R.error(e.getMessage()); |
|
|
@ -155,6 +164,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); |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 拆分订单 |
|
|
|
* 拆分订单 |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -170,7 +180,12 @@ public class OrderSplitController { |
|
|
|
log.error("{}订单多金额拆分异常:{}", LOGGER_MSG, e); |
|
|
|
log.error("{}订单多金额拆分异常:{}", LOGGER_MSG, e); |
|
|
|
vo.put(OrderManagementConstant.CODE, e.getCode()).put(OrderManagementConstant.MESSAGE, e.getMessage()); |
|
|
|
vo.put(OrderManagementConstant.CODE, e.getCode()).put(OrderManagementConstant.MESSAGE, e.getMessage()); |
|
|
|
return vo; |
|
|
|
return vo; |
|
|
|
} catch (Exception e) { |
|
|
|
}catch (RuntimeException e) { |
|
|
|
|
|
|
|
log.error("{}订单拆分异常:{}", LOGGER_MSG, e); |
|
|
|
|
|
|
|
vo.put(OrderManagementConstant.CODE, OrderInfoContentEnum.RECEIVE_FAILD.getKey()); |
|
|
|
|
|
|
|
vo.put(OrderManagementConstant.MESSAGE, e.getMessage()); |
|
|
|
|
|
|
|
return vo; |
|
|
|
|
|
|
|
}catch (Exception e) { |
|
|
|
log.error("{}订单拆分异常:{}", LOGGER_MSG, e); |
|
|
|
log.error("{}订单拆分异常:{}", LOGGER_MSG, e); |
|
|
|
vo.put(OrderManagementConstant.CODE, OrderInfoContentEnum.RECEIVE_FAILD.getKey()); |
|
|
|
vo.put(OrderManagementConstant.CODE, OrderInfoContentEnum.RECEIVE_FAILD.getKey()); |
|
|
|
vo.put(OrderManagementConstant.MESSAGE, OrderInfoContentEnum.RECEIVE_FAILD.getMessage()); |
|
|
|
vo.put(OrderManagementConstant.MESSAGE, OrderInfoContentEnum.RECEIVE_FAILD.getMessage()); |
|
|
@ -208,7 +223,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()); |
|
|
@ -222,6 +237,11 @@ public class OrderSplitController { |
|
|
|
vo.put(OrderManagementConstant.CODE, e.getCode()); |
|
|
|
vo.put(OrderManagementConstant.CODE, e.getCode()); |
|
|
|
vo.put(OrderManagementConstant.MESSAGE, e.getMessage()); |
|
|
|
vo.put(OrderManagementConstant.MESSAGE, e.getMessage()); |
|
|
|
return vo; |
|
|
|
return vo; |
|
|
|
|
|
|
|
} catch (RuntimeException e) { |
|
|
|
|
|
|
|
log.error("{}订单拆分异常:{}", LOGGER_MSG, e); |
|
|
|
|
|
|
|
vo.put(OrderManagementConstant.CODE, OrderInfoContentEnum.RECEIVE_FAILD.getKey()); |
|
|
|
|
|
|
|
vo.put(OrderManagementConstant.MESSAGE, e.getMessage()); |
|
|
|
|
|
|
|
return vo; |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("{}订单拆分异常:{}", LOGGER_MSG, e); |
|
|
|
log.error("{}订单拆分异常:{}", LOGGER_MSG, e); |
|
|
|
vo.put(OrderManagementConstant.CODE, OrderInfoContentEnum.RECEIVE_FAILD.getKey()); |
|
|
|
vo.put(OrderManagementConstant.CODE, OrderInfoContentEnum.RECEIVE_FAILD.getKey()); |
|
|
|