This commit is contained in:
parent
17e37de2b3
commit
b7070ea28c
|
|
@ -27,11 +27,11 @@ public class OnSaleProductPreOrderRespVO {
|
||||||
@ExcelProperty("产品")
|
@ExcelProperty("产品")
|
||||||
private Long parentProductId;
|
private Long parentProductId;
|
||||||
|
|
||||||
private SuperiorProductConfigRespVO superiorProductConfigRespVO;
|
private SuperiorProductConfigRespVO superiorProductConfigRespVO;
|
||||||
|
|
||||||
private SuperiorApiRespVO superiorApiRespVO;
|
private SuperiorApiRespVO superiorApiRespVO;
|
||||||
|
|
||||||
private ApiFrom apiFrom;
|
private ApiFrom apiFrom;
|
||||||
|
|
||||||
@ExcelIgnore
|
@ExcelIgnore
|
||||||
@Schema(description = "产品", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "产品", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,18 @@ public class OrdersRespVO {
|
||||||
@ExcelProperty("产品ID")
|
@ExcelProperty("产品ID")
|
||||||
private Long productId;
|
private Long productId;
|
||||||
|
|
||||||
|
@Schema(description = "在售商品ID")
|
||||||
|
@ExcelProperty("在售商品ID")
|
||||||
|
private Long onSaleProductId;
|
||||||
|
|
||||||
|
@Schema(description = "上游接口ID")
|
||||||
|
@ExcelProperty("上游接口ID")
|
||||||
|
private Long superiorApiId;
|
||||||
|
|
||||||
|
@Schema(description = "产品上游接口配置ID")
|
||||||
|
@ExcelProperty("产品上游接口配置ID")
|
||||||
|
private Long superiorProductConfigId;
|
||||||
|
|
||||||
@Schema(description = "产品编码")
|
@Schema(description = "产品编码")
|
||||||
@ExcelProperty("产品编码")
|
@ExcelProperty("产品编码")
|
||||||
private String productSku;
|
private String productSku;
|
||||||
|
|
@ -280,4 +292,4 @@ public class OrdersRespVO {
|
||||||
@Schema(description = "身份证人脸")
|
@Schema(description = "身份证人脸")
|
||||||
private String face;
|
private String face;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,8 @@
|
||||||
package cn.iocoder.yudao.module.haoka.controller.admin.orders.vo;
|
package cn.iocoder.yudao.module.haoka.controller.admin.orders.vo;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.Data;
|
||||||
import java.util.*;
|
|
||||||
import jakarta.validation.constraints.*;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 订单新增/修改 Request VO")
|
@Schema(description = "管理后台 - 订单新增/修改 Request VO")
|
||||||
|
|
@ -41,6 +39,15 @@ public class OrdersSaveReqVO {
|
||||||
@Schema(description = "产品ID", example = "24383")
|
@Schema(description = "产品ID", example = "24383")
|
||||||
private Long productId;
|
private Long productId;
|
||||||
|
|
||||||
|
@Schema(description = "在售商品ID")
|
||||||
|
private Long onSaleProductId;
|
||||||
|
|
||||||
|
@Schema(description = "上游接口ID")
|
||||||
|
private Long superiorApiId;
|
||||||
|
|
||||||
|
@Schema(description = "产品上游接口配置ID")
|
||||||
|
private Long superiorProductConfigId;
|
||||||
|
|
||||||
@Schema(description = "产品编码")
|
@Schema(description = "产品编码")
|
||||||
private String productSku;
|
private String productSku;
|
||||||
|
|
||||||
|
|
@ -196,4 +203,4 @@ public class OrdersSaveReqVO {
|
||||||
@Schema(description = "订单联系状态码")
|
@Schema(description = "订单联系状态码")
|
||||||
private Long callStatus;
|
private Long callStatus;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package cn.iocoder.yudao.module.haoka.dal.dataobject.orders;
|
package cn.iocoder.yudao.module.haoka.dal.dataobject.orders;
|
||||||
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
@ -10,6 +11,7 @@ import java.time.LocalDateTime;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
|
||||||
|
|
@ -59,7 +61,7 @@ public class OrdersDO extends BaseDO {
|
||||||
private Long shareId;
|
private Long shareId;
|
||||||
/**
|
/**
|
||||||
* 订单来源
|
* 订单来源
|
||||||
*
|
* <p>
|
||||||
* 枚举 {@link TODO haoka_order_channel 对应的类}
|
* 枚举 {@link TODO haoka_order_channel 对应的类}
|
||||||
*/
|
*/
|
||||||
private String source;
|
private String source;
|
||||||
|
|
@ -71,6 +73,18 @@ public class OrdersDO extends BaseDO {
|
||||||
* 产品ID
|
* 产品ID
|
||||||
*/
|
*/
|
||||||
private Long productId;
|
private Long productId;
|
||||||
|
/**
|
||||||
|
* 在售商品ID
|
||||||
|
*/
|
||||||
|
private Long onSaleProductId;
|
||||||
|
/**
|
||||||
|
* 上游接口ID
|
||||||
|
*/
|
||||||
|
private Long superiorApiId;
|
||||||
|
/**
|
||||||
|
* 产品上游接口配置ID
|
||||||
|
*/
|
||||||
|
private Long superiorProductConfigId;
|
||||||
/**
|
/**
|
||||||
* 产品编码
|
* 产品编码
|
||||||
*/
|
*/
|
||||||
|
|
@ -141,7 +155,7 @@ public class OrdersDO extends BaseDO {
|
||||||
private String addressProvince;
|
private String addressProvince;
|
||||||
/**
|
/**
|
||||||
* 交易状态
|
* 交易状态
|
||||||
*
|
* <p>
|
||||||
* 枚举 {@link TODO pay_refund_status 对应的类}
|
* 枚举 {@link TODO pay_refund_status 对应的类}
|
||||||
*/
|
*/
|
||||||
private String refundStatus;
|
private String refundStatus;
|
||||||
|
|
@ -151,7 +165,7 @@ public class OrdersDO extends BaseDO {
|
||||||
private String addressCity;
|
private String addressCity;
|
||||||
/**
|
/**
|
||||||
* 激活状态
|
* 激活状态
|
||||||
*
|
* <p>
|
||||||
* 枚举 {@link TODO haoka_order_active_status 对应的类}
|
* 枚举 {@link TODO haoka_order_active_status 对应的类}
|
||||||
*/
|
*/
|
||||||
private String activeStatus;
|
private String activeStatus;
|
||||||
|
|
@ -229,7 +243,7 @@ public class OrdersDO extends BaseDO {
|
||||||
private String town;
|
private String town;
|
||||||
/**
|
/**
|
||||||
* 订单状态
|
* 订单状态
|
||||||
*
|
* <p>
|
||||||
* 枚举 {@link TODO haoka_order_status 对应的类}
|
* 枚举 {@link TODO haoka_order_status 对应的类}
|
||||||
*/
|
*/
|
||||||
private Long status;
|
private Long status;
|
||||||
|
|
@ -239,7 +253,7 @@ public class OrdersDO extends BaseDO {
|
||||||
private String trackingCompany;
|
private String trackingCompany;
|
||||||
/**
|
/**
|
||||||
* 标旗
|
* 标旗
|
||||||
*
|
* <p>
|
||||||
* 枚举 {@link TODO haoka_order_flag 对应的类}
|
* 枚举 {@link TODO haoka_order_flag 对应的类}
|
||||||
*/
|
*/
|
||||||
private Long flag;
|
private Long flag;
|
||||||
|
|
@ -308,4 +322,4 @@ public class OrdersDO extends BaseDO {
|
||||||
*/
|
*/
|
||||||
private Integer isUrgent;
|
private Integer isUrgent;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,10 @@ import cn.iocoder.yudao.module.haoka.api.liantong.util.StringUtils;
|
||||||
import cn.iocoder.yudao.module.haoka.controller.admin.onsaleproduct.vo.OnSaleProductPreOrderRespVO;
|
import cn.iocoder.yudao.module.haoka.controller.admin.onsaleproduct.vo.OnSaleProductPreOrderRespVO;
|
||||||
import cn.iocoder.yudao.module.haoka.controller.admin.superiorapilog.vo.SuperiorApiLogSaveReqVO;
|
import cn.iocoder.yudao.module.haoka.controller.admin.superiorapilog.vo.SuperiorApiLogSaveReqVO;
|
||||||
import cn.iocoder.yudao.module.haoka.dal.dataobject.orders.OrdersDO;
|
import cn.iocoder.yudao.module.haoka.dal.dataobject.orders.OrdersDO;
|
||||||
|
import cn.iocoder.yudao.module.haoka.dal.dataobject.superiorapi.SuperiorApiDO;
|
||||||
import cn.iocoder.yudao.module.haoka.service.api.models.*;
|
import cn.iocoder.yudao.module.haoka.service.api.models.*;
|
||||||
import cn.iocoder.yudao.module.haoka.service.onsaleproduct.OnSaleProductService;
|
import cn.iocoder.yudao.module.haoka.service.onsaleproduct.OnSaleProductService;
|
||||||
|
import cn.iocoder.yudao.module.haoka.service.superiorapi.SuperiorApiService;
|
||||||
import cn.iocoder.yudao.module.haoka.service.superiorapilog.SuperiorApiLogService;
|
import cn.iocoder.yudao.module.haoka.service.superiorapilog.SuperiorApiLogService;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
@ -24,12 +26,14 @@ public class ApiDealServiceImpl implements ApiDealStrategyService {
|
||||||
@Resource
|
@Resource
|
||||||
protected SuperiorApiLogService superiorApiLogService;
|
protected SuperiorApiLogService superiorApiLogService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SuperiorApiService superiorApiService;
|
||||||
@Override
|
@Override
|
||||||
public ApiDealResp<OrderApiCreateResp> createOrder(final SuperiorApiLogSaveReqVO logVO, OrderApiCreateParam param) {
|
public ApiDealResp<OrderApiCreateResp> createOrder(final SuperiorApiLogSaveReqVO logVO, OrderApiCreateParam param) {
|
||||||
logVO.setApiType(1);
|
logVO.setApiType(1);
|
||||||
logVO.setHaokaOrderId(param.getId());
|
logVO.setHaokaOrderId(param.getId());
|
||||||
logVO.setHaokaProductId(param.getProductId());
|
logVO.setHaokaProductId(param.getProductId());
|
||||||
|
logVO.setHaokaSuperiorApiId(param.getSuperiorApiId());
|
||||||
try {
|
try {
|
||||||
OnSaleProductPreOrderRespVO onSaleProductPreOrder = onSaleProductService.getOnSaleProductPreOrder(param.getProductId());
|
OnSaleProductPreOrderRespVO onSaleProductPreOrder = onSaleProductService.getOnSaleProductPreOrder(param.getProductId());
|
||||||
if (onSaleProductPreOrder == null) {
|
if (onSaleProductPreOrder == null) {
|
||||||
|
|
@ -38,17 +42,15 @@ public class ApiDealServiceImpl implements ApiDealStrategyService {
|
||||||
logVO.setErrorInfo(msg);
|
logVO.setErrorInfo(msg);
|
||||||
return ApiDealResp.failed(msg);
|
return ApiDealResp.failed(msg);
|
||||||
}
|
}
|
||||||
logVO.setHaokaSuperiorApiId(onSaleProductPreOrder.getApiFrom().getId());
|
SuperiorApiDO superiorApi = superiorApiService.getSuperiorApi(param.getSuperiorApiId());
|
||||||
ApiFrom apiFrom = onSaleProductPreOrder.getApiFrom();
|
if (superiorApi == null) {
|
||||||
if (apiFrom == null) {
|
String msg = "关联上游接口不存在";
|
||||||
String msg = "产品上游接口不存在";
|
|
||||||
logVO.setSuccess(false);
|
logVO.setSuccess(false);
|
||||||
logVO.setErrorInfo(msg);
|
logVO.setErrorInfo(msg);
|
||||||
return ApiDealResp.failed(msg);
|
return ApiDealResp.failed(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ApiDealStrategy apiDealStrategy = this.getApiDealStrategy(superiorApi.getApiFrom());
|
||||||
ApiDealStrategy apiDealStrategy = this.getApiDealStrategy(onSaleProductPreOrder.getSuperiorApiRespVO().getApiFrom());
|
|
||||||
if (apiDealStrategy == null) {
|
if (apiDealStrategy == null) {
|
||||||
String msg = "NoneService";
|
String msg = "NoneService";
|
||||||
logVO.setSuccess(false);
|
logVO.setSuccess(false);
|
||||||
|
|
@ -80,6 +82,7 @@ public class ApiDealServiceImpl implements ApiDealStrategyService {
|
||||||
logVO.setApiType(2);
|
logVO.setApiType(2);
|
||||||
logVO.setHaokaOrderId(param.getId());
|
logVO.setHaokaOrderId(param.getId());
|
||||||
logVO.setHaokaProductId(param.getProductId());
|
logVO.setHaokaProductId(param.getProductId());
|
||||||
|
logVO.setHaokaSuperiorApiId(param.getSuperiorApiId());
|
||||||
Boolean isSupport = true;
|
Boolean isSupport = true;
|
||||||
try {
|
try {
|
||||||
OnSaleProductPreOrderRespVO onSaleProductPreOrder = onSaleProductService.getOnSaleProductPreOrder(param.getProductId());
|
OnSaleProductPreOrderRespVO onSaleProductPreOrder = onSaleProductService.getOnSaleProductPreOrder(param.getProductId());
|
||||||
|
|
@ -89,15 +92,15 @@ public class ApiDealServiceImpl implements ApiDealStrategyService {
|
||||||
logVO.setErrorInfo(msg);
|
logVO.setErrorInfo(msg);
|
||||||
return ApiDealResp.failed(msg);
|
return ApiDealResp.failed(msg);
|
||||||
}
|
}
|
||||||
logVO.setHaokaSuperiorApiId(onSaleProductPreOrder.getApiFrom().getId());
|
|
||||||
ApiFrom apiFrom = onSaleProductPreOrder.getApiFrom();
|
SuperiorApiDO superiorApi = superiorApiService.getSuperiorApi(param.getSuperiorApiId());
|
||||||
if (apiFrom == null) {
|
if (superiorApi == null) {
|
||||||
String msg = "产品上游接口不存在";
|
String msg = "关联上游接口不存在";
|
||||||
logVO.setSuccess(false);
|
logVO.setSuccess(false);
|
||||||
logVO.setErrorInfo(msg);
|
logVO.setErrorInfo(msg);
|
||||||
return ApiDealResp.failed(msg);
|
return ApiDealResp.failed(msg);
|
||||||
}
|
}
|
||||||
ApiDealStrategy apiDealStrategy = this.getApiDealStrategy(onSaleProductPreOrder.getSuperiorApiRespVO().getApiFrom());
|
ApiDealStrategy apiDealStrategy = this.getApiDealStrategy(superiorApi.getApiFrom());
|
||||||
if (apiDealStrategy == null) {
|
if (apiDealStrategy == null) {
|
||||||
logVO.setSuccess(false);
|
logVO.setSuccess(false);
|
||||||
String noneService = "NoneService";
|
String noneService = "NoneService";
|
||||||
|
|
|
||||||
|
|
@ -62,4 +62,17 @@ public class OrderApiCreateParam {
|
||||||
*/
|
*/
|
||||||
private String address;
|
private String address;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在售商品ID
|
||||||
|
*/
|
||||||
|
private Long onSaleProductId;
|
||||||
|
/**
|
||||||
|
* 上游接口ID
|
||||||
|
*/
|
||||||
|
private Long superiorApiId;
|
||||||
|
/**
|
||||||
|
* 产品上游接口配置ID
|
||||||
|
*/
|
||||||
|
private Long superiorProductConfigId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,4 +27,18 @@ public class OrderApiQueryParam {
|
||||||
* 实际生产号码
|
* 实际生产号码
|
||||||
*/
|
*/
|
||||||
private String planMobileProduced;
|
private String planMobileProduced;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在售商品ID
|
||||||
|
*/
|
||||||
|
private Long onSaleProductId;
|
||||||
|
/**
|
||||||
|
* 上游接口ID
|
||||||
|
*/
|
||||||
|
private Long superiorApiId;
|
||||||
|
/**
|
||||||
|
* 产品上游接口配置ID
|
||||||
|
*/
|
||||||
|
private Long superiorProductConfigId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,13 @@ import cn.iocoder.yudao.module.haoka.controller.admin.onsaleproduct.vo.OnSalePro
|
||||||
import cn.iocoder.yudao.module.haoka.controller.admin.superiorapi.vo.SuperiorApiRespVO;
|
import cn.iocoder.yudao.module.haoka.controller.admin.superiorapi.vo.SuperiorApiRespVO;
|
||||||
import cn.iocoder.yudao.module.haoka.controller.admin.superiorapilog.vo.SuperiorApiLogSaveReqVO;
|
import cn.iocoder.yudao.module.haoka.controller.admin.superiorapilog.vo.SuperiorApiLogSaveReqVO;
|
||||||
import cn.iocoder.yudao.module.haoka.controller.admin.superiorproductconfig.vo.SuperiorProductConfigRespVO;
|
import cn.iocoder.yudao.module.haoka.controller.admin.superiorproductconfig.vo.SuperiorProductConfigRespVO;
|
||||||
|
import cn.iocoder.yudao.module.haoka.dal.dataobject.superiorapi.SuperiorApiDO;
|
||||||
|
import cn.iocoder.yudao.module.haoka.dal.dataobject.superiorproductconfig.SuperiorProductConfigDO;
|
||||||
import cn.iocoder.yudao.module.haoka.service.api.*;
|
import cn.iocoder.yudao.module.haoka.service.api.*;
|
||||||
import cn.iocoder.yudao.module.haoka.service.api.models.*;
|
import cn.iocoder.yudao.module.haoka.service.api.models.*;
|
||||||
import cn.iocoder.yudao.module.haoka.service.onsaleproduct.OnSaleProductService;
|
import cn.iocoder.yudao.module.haoka.service.onsaleproduct.OnSaleProductService;
|
||||||
|
import cn.iocoder.yudao.module.haoka.service.superiorapi.SuperiorApiService;
|
||||||
|
import cn.iocoder.yudao.module.haoka.service.superiorproductconfig.SuperiorProductConfigService;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
@ -31,7 +35,10 @@ public class GuangZhouDxApiDealStrategy implements ApiDealStrategy {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private OnSaleProductService onSaleProductService;
|
private OnSaleProductService onSaleProductService;
|
||||||
|
@Resource
|
||||||
|
private SuperiorApiService superiorApiService;
|
||||||
|
@Resource
|
||||||
|
private SuperiorProductConfigService superiorProductConfigService;
|
||||||
|
|
||||||
private LianTongArea getAddress(String code) {
|
private LianTongArea getAddress(String code) {
|
||||||
return LianTongAreaUtils.getArea(code);
|
return LianTongAreaUtils.getArea(code);
|
||||||
|
|
@ -39,14 +46,18 @@ public class GuangZhouDxApiDealStrategy implements ApiDealStrategy {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ApiDealResp<OrderApiCreateResp> createOrder(final SuperiorApiLogSaveReqVO logVO, OrderApiCreateParam param) throws Exception {
|
public ApiDealResp<OrderApiCreateResp> createOrder(final SuperiorApiLogSaveReqVO logVO, OrderApiCreateParam param) throws Exception {
|
||||||
|
|
||||||
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getProductId());
|
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getProductId());
|
||||||
if (preProduct == null) {
|
if (preProduct == null) {
|
||||||
return ApiDealResp.failed("商品下架或者不存在");
|
return ApiDealResp.failed("商品下架或者不存在");
|
||||||
}
|
}
|
||||||
Long haokaSuperiorApiId = preProduct.getSuperiorApiRespVO().getId();
|
SuperiorApiDO superiorApi = superiorApiService.getSuperiorApi(param.getSuperiorApiId());
|
||||||
logVO.setHaokaSuperiorApiId(haokaSuperiorApiId);
|
final SuperiorProductConfigDO skuConfigVO = superiorProductConfigService.getById(param.getSuperiorProductConfigId());
|
||||||
final SuperiorProductConfigRespVO skuConfigVO = preProduct.getSuperiorProductConfigRespVO();
|
if (skuConfigVO == null) {
|
||||||
|
return ApiDealResp.failed("商品对接上游配置不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
Long haokaSuperiorApiId = superiorApi.getId();
|
||||||
|
|
||||||
final GdOrderCreateRequestParam createParam = new GdOrderCreateRequestParam();
|
final GdOrderCreateRequestParam createParam = new GdOrderCreateRequestParam();
|
||||||
|
|
||||||
createParam.setUserName(param.getIdCardName());
|
createParam.setUserName(param.getIdCardName());
|
||||||
|
|
@ -107,8 +118,13 @@ public class GuangZhouDxApiDealStrategy implements ApiDealStrategy {
|
||||||
if (preProduct == null) {
|
if (preProduct == null) {
|
||||||
return ApiDealResp.failed("商品下架或者不存在");
|
return ApiDealResp.failed("商品下架或者不存在");
|
||||||
}
|
}
|
||||||
Long haokaSuperiorApiId = preProduct.getSuperiorApiRespVO().getId();
|
SuperiorApiDO superiorApi = superiorApiService.getSuperiorApi(param.getSuperiorApiId());
|
||||||
logVO.setHaokaSuperiorApiId(haokaSuperiorApiId);
|
final SuperiorProductConfigDO skuConfigVO = superiorProductConfigService.getById(param.getSuperiorProductConfigId());
|
||||||
|
if (skuConfigVO == null) {
|
||||||
|
return ApiDealResp.failed("商品对接上游配置不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
Long haokaSuperiorApiId = superiorApi.getId();
|
||||||
GdOrderQueryRequestParam queryParam = new GdOrderQueryRequestParam();
|
GdOrderQueryRequestParam queryParam = new GdOrderQueryRequestParam();
|
||||||
|
|
||||||
queryParam.setOrderCode(param.getSupplierOrderId());
|
queryParam.setOrderCode(param.getSupplierOrderId());
|
||||||
|
|
@ -193,11 +209,7 @@ public class GuangZhouDxApiDealStrategy implements ApiDealStrategy {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
orderApiQueryResp.setData(responseInfo);
|
orderApiQueryResp.setData(responseInfo);
|
||||||
return ApiDealResp.ok(orderApiQueryResp);
|
return ApiDealResp.ok(orderApiQueryResp);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,14 @@ import cn.iocoder.yudao.module.haoka.controller.admin.address.vo.AddressVo;
|
||||||
import cn.iocoder.yudao.module.haoka.controller.admin.onsaleproduct.vo.OnSaleProductPreOrderRespVO;
|
import cn.iocoder.yudao.module.haoka.controller.admin.onsaleproduct.vo.OnSaleProductPreOrderRespVO;
|
||||||
import cn.iocoder.yudao.module.haoka.controller.admin.superiorapilog.vo.SuperiorApiLogSaveReqVO;
|
import cn.iocoder.yudao.module.haoka.controller.admin.superiorapilog.vo.SuperiorApiLogSaveReqVO;
|
||||||
import cn.iocoder.yudao.module.haoka.controller.admin.superiorproductconfig.vo.SuperiorProductConfigRespVO;
|
import cn.iocoder.yudao.module.haoka.controller.admin.superiorproductconfig.vo.SuperiorProductConfigRespVO;
|
||||||
|
import cn.iocoder.yudao.module.haoka.dal.dataobject.superiorapi.SuperiorApiDO;
|
||||||
|
import cn.iocoder.yudao.module.haoka.dal.dataobject.superiorproductconfig.SuperiorProductConfigDO;
|
||||||
import cn.iocoder.yudao.module.haoka.service.address.HaoKaAddressService;
|
import cn.iocoder.yudao.module.haoka.service.address.HaoKaAddressService;
|
||||||
import cn.iocoder.yudao.module.haoka.service.api.*;
|
import cn.iocoder.yudao.module.haoka.service.api.*;
|
||||||
import cn.iocoder.yudao.module.haoka.service.api.models.*;
|
import cn.iocoder.yudao.module.haoka.service.api.models.*;
|
||||||
import cn.iocoder.yudao.module.haoka.service.onsaleproduct.OnSaleProductService;
|
import cn.iocoder.yudao.module.haoka.service.onsaleproduct.OnSaleProductService;
|
||||||
|
import cn.iocoder.yudao.module.haoka.service.superiorapi.SuperiorApiService;
|
||||||
|
import cn.iocoder.yudao.module.haoka.service.superiorproductconfig.SuperiorProductConfigService;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
@ -34,7 +38,10 @@ public class HaiNanDxApiDealStrategy implements ApiDealStrategy {
|
||||||
@Resource
|
@Resource
|
||||||
private HaoKaAddressService haoKaAddressService;
|
private HaoKaAddressService haoKaAddressService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SuperiorApiService superiorApiService;
|
||||||
|
@Resource
|
||||||
|
private SuperiorProductConfigService superiorProductConfigService;
|
||||||
|
|
||||||
private AddressVo getAddress(String code) {
|
private AddressVo getAddress(String code) {
|
||||||
return haoKaAddressService.getAddress(code);
|
return haoKaAddressService.getAddress(code);
|
||||||
|
|
@ -42,17 +49,19 @@ public class HaiNanDxApiDealStrategy implements ApiDealStrategy {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ApiDealResp<OrderApiCreateResp> createOrder(final SuperiorApiLogSaveReqVO logVO, OrderApiCreateParam param) {
|
public ApiDealResp<OrderApiCreateResp> createOrder(final SuperiorApiLogSaveReqVO logVO, OrderApiCreateParam param) {
|
||||||
|
|
||||||
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getProductId());
|
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getProductId());
|
||||||
|
|
||||||
Long haokaSuperiorApiId = preProduct.getSuperiorApiRespVO().getId();
|
|
||||||
logVO.setHaokaSuperiorApiId(haokaSuperiorApiId);
|
|
||||||
|
|
||||||
if (preProduct == null) {
|
if (preProduct == null) {
|
||||||
return ApiDealResp.failed("商品下架或者不存在");
|
return ApiDealResp.failed("商品下架或者不存在");
|
||||||
}
|
}
|
||||||
|
SuperiorApiDO superiorApi = superiorApiService.getSuperiorApi(param.getSuperiorApiId());
|
||||||
|
final SuperiorProductConfigDO skuConfigVO = superiorProductConfigService.getById(param.getSuperiorProductConfigId());
|
||||||
|
if (skuConfigVO == null) {
|
||||||
|
return ApiDealResp.failed("商品对接上游配置不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
Long haokaSuperiorApiId = superiorApi.getId();
|
||||||
String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
|
String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
|
||||||
final SuperiorProductConfigRespVO skuConfigVO = preProduct.getSuperiorProductConfigRespVO();
|
|
||||||
|
|
||||||
HaiNanDianXinApi.SynOrderInfoRequest createParam = new HaiNanDianXinApi.SynOrderInfoRequest();
|
HaiNanDianXinApi.SynOrderInfoRequest createParam = new HaiNanDianXinApi.SynOrderInfoRequest();
|
||||||
createParam.setOrderDate(format);
|
createParam.setOrderDate(format);
|
||||||
|
|
@ -122,9 +131,16 @@ public class HaiNanDxApiDealStrategy implements ApiDealStrategy {
|
||||||
@Override
|
@Override
|
||||||
public ApiDealResp<OrderApiQueryResp> queryOrder(final SuperiorApiLogSaveReqVO logVO, OrderApiQueryParam param) {
|
public ApiDealResp<OrderApiQueryResp> queryOrder(final SuperiorApiLogSaveReqVO logVO, OrderApiQueryParam param) {
|
||||||
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getProductId());
|
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getProductId());
|
||||||
|
if (preProduct == null) {
|
||||||
|
return ApiDealResp.failed("商品下架或者不存在");
|
||||||
|
}
|
||||||
|
SuperiorApiDO superiorApi = superiorApiService.getSuperiorApi(param.getSuperiorApiId());
|
||||||
|
final SuperiorProductConfigDO skuConfigVO = superiorProductConfigService.getById(param.getSuperiorProductConfigId());
|
||||||
|
if (skuConfigVO == null) {
|
||||||
|
return ApiDealResp.failed("商品对接上游配置不存在");
|
||||||
|
}
|
||||||
|
|
||||||
Long haokaSuperiorApiId = preProduct.getSuperiorApiRespVO().getId();
|
Long haokaSuperiorApiId = superiorApi.getId();
|
||||||
logVO.setHaokaSuperiorApiId(haokaSuperiorApiId);
|
|
||||||
try {
|
try {
|
||||||
HaiNanDianXinApi.QueryOrderInfoRequest queryParam = new HaiNanDianXinApi.QueryOrderInfoRequest();
|
HaiNanDianXinApi.QueryOrderInfoRequest queryParam = new HaiNanDianXinApi.QueryOrderInfoRequest();
|
||||||
queryParam.setQueryType("1");
|
queryParam.setQueryType("1");
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,14 @@ import cn.iocoder.yudao.module.haoka.controller.admin.onsaleproduct.vo.OnSalePro
|
||||||
import cn.iocoder.yudao.module.haoka.controller.admin.superiorapi.vo.SuperiorApiRespVO;
|
import cn.iocoder.yudao.module.haoka.controller.admin.superiorapi.vo.SuperiorApiRespVO;
|
||||||
import cn.iocoder.yudao.module.haoka.controller.admin.superiorapilog.vo.SuperiorApiLogSaveReqVO;
|
import cn.iocoder.yudao.module.haoka.controller.admin.superiorapilog.vo.SuperiorApiLogSaveReqVO;
|
||||||
import cn.iocoder.yudao.module.haoka.controller.admin.superiorproductconfig.vo.SuperiorProductConfigRespVO;
|
import cn.iocoder.yudao.module.haoka.controller.admin.superiorproductconfig.vo.SuperiorProductConfigRespVO;
|
||||||
|
import cn.iocoder.yudao.module.haoka.dal.dataobject.superiorapi.SuperiorApiDO;
|
||||||
|
import cn.iocoder.yudao.module.haoka.dal.dataobject.superiorproductconfig.SuperiorProductConfigDO;
|
||||||
import cn.iocoder.yudao.module.haoka.service.address.HaoKaAddressService;
|
import cn.iocoder.yudao.module.haoka.service.address.HaoKaAddressService;
|
||||||
import cn.iocoder.yudao.module.haoka.service.api.*;
|
import cn.iocoder.yudao.module.haoka.service.api.*;
|
||||||
import cn.iocoder.yudao.module.haoka.service.api.models.*;
|
import cn.iocoder.yudao.module.haoka.service.api.models.*;
|
||||||
import cn.iocoder.yudao.module.haoka.service.onsaleproduct.OnSaleProductService;
|
import cn.iocoder.yudao.module.haoka.service.onsaleproduct.OnSaleProductService;
|
||||||
|
import cn.iocoder.yudao.module.haoka.service.superiorapi.SuperiorApiService;
|
||||||
|
import cn.iocoder.yudao.module.haoka.service.superiorproductconfig.SuperiorProductConfigService;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
|
@ -34,6 +38,11 @@ public class HuNanDxApiDealStrategy implements ApiDealStrategy {
|
||||||
@Resource
|
@Resource
|
||||||
private HaoKaAddressService haoKaAddressService;
|
private HaoKaAddressService haoKaAddressService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SuperiorApiService superiorApiService;
|
||||||
|
@Resource
|
||||||
|
private SuperiorProductConfigService superiorProductConfigService;
|
||||||
|
|
||||||
private AddressVo getAddress(String code) {
|
private AddressVo getAddress(String code) {
|
||||||
return haoKaAddressService.getAddress(code);
|
return haoKaAddressService.getAddress(code);
|
||||||
}
|
}
|
||||||
|
|
@ -41,14 +50,20 @@ public class HuNanDxApiDealStrategy implements ApiDealStrategy {
|
||||||
@Override
|
@Override
|
||||||
public ApiDealResp<OrderApiCreateResp> createOrder(final SuperiorApiLogSaveReqVO logVO, OrderApiCreateParam param) throws Exception {
|
public ApiDealResp<OrderApiCreateResp> createOrder(final SuperiorApiLogSaveReqVO logVO, OrderApiCreateParam param) throws Exception {
|
||||||
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getProductId());
|
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getProductId());
|
||||||
Long haokaSuperiorApiId = preProduct.getSuperiorApiRespVO().getId();
|
|
||||||
|
|
||||||
if (preProduct == null) {
|
if (preProduct == null) {
|
||||||
return ApiDealResp.failed("商品下架或者不存在");
|
return ApiDealResp.failed("商品下架或者不存在");
|
||||||
}
|
}
|
||||||
String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
|
SuperiorApiDO superiorApi = superiorApiService.getSuperiorApi(param.getSuperiorApiId());
|
||||||
final SuperiorProductConfigRespVO skuConfigVO = preProduct.getSuperiorProductConfigRespVO();
|
final SuperiorProductConfigDO skuConfigVO = superiorProductConfigService.getById(param.getSuperiorProductConfigId());
|
||||||
|
if (skuConfigVO == null) {
|
||||||
|
return ApiDealResp.failed("商品对接上游配置不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
Long haokaSuperiorApiId = superiorApi.getId();
|
||||||
|
logVO.setHaokaSuperiorApiId(haokaSuperiorApiId);
|
||||||
|
|
||||||
|
|
||||||
|
String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
|
||||||
|
|
||||||
// 0、占用号码 lianTongZhanHao
|
// 0、占用号码 lianTongZhanHao
|
||||||
// 1、提交资料 lianTongSubmitUserInfo
|
// 1、提交资料 lianTongSubmitUserInfo
|
||||||
|
|
@ -203,8 +218,19 @@ public class HuNanDxApiDealStrategy implements ApiDealStrategy {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ApiDealResp<OrderApiQueryResp> queryOrder(final SuperiorApiLogSaveReqVO logVO, OrderApiQueryParam param) {
|
public ApiDealResp<OrderApiQueryResp> queryOrder(final SuperiorApiLogSaveReqVO logVO, OrderApiQueryParam param) {
|
||||||
|
logVO.setHaokaSuperiorApiId(param.getSuperiorApiId());
|
||||||
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getProductId());
|
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getProductId());
|
||||||
Long haokaSuperiorApiId = preProduct.getSuperiorApiRespVO().getId();
|
if (preProduct == null) {
|
||||||
|
return ApiDealResp.failed("商品下架或者不存在");
|
||||||
|
}
|
||||||
|
SuperiorApiDO superiorApi = superiorApiService.getSuperiorApi(param.getSuperiorApiId());
|
||||||
|
final SuperiorProductConfigDO skuConfigVO = superiorProductConfigService.getById(param.getSuperiorProductConfigId());
|
||||||
|
if (skuConfigVO == null) {
|
||||||
|
return ApiDealResp.failed("商品对接上游配置不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
Long haokaSuperiorApiId = superiorApi.getId();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
HaiNanDxInfo.QueryOrderParam queryParam = new HaiNanDxInfo.QueryOrderParam();
|
HaiNanDxInfo.QueryOrderParam queryParam = new HaiNanDxInfo.QueryOrderParam();
|
||||||
queryParam.setOutId(param.getId().toString());
|
queryParam.setOutId(param.getId().toString());
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,13 @@ import cn.iocoder.yudao.module.haoka.api.liantong.util.StringUtils;
|
||||||
import cn.iocoder.yudao.module.haoka.controller.admin.onsaleproduct.vo.OnSaleProductPreOrderRespVO;
|
import cn.iocoder.yudao.module.haoka.controller.admin.onsaleproduct.vo.OnSaleProductPreOrderRespVO;
|
||||||
import cn.iocoder.yudao.module.haoka.controller.admin.superiorapilog.vo.SuperiorApiLogSaveReqVO;
|
import cn.iocoder.yudao.module.haoka.controller.admin.superiorapilog.vo.SuperiorApiLogSaveReqVO;
|
||||||
import cn.iocoder.yudao.module.haoka.controller.admin.superiorproductconfig.vo.SuperiorProductConfigRespVO;
|
import cn.iocoder.yudao.module.haoka.controller.admin.superiorproductconfig.vo.SuperiorProductConfigRespVO;
|
||||||
|
import cn.iocoder.yudao.module.haoka.dal.dataobject.superiorapi.SuperiorApiDO;
|
||||||
|
import cn.iocoder.yudao.module.haoka.dal.dataobject.superiorproductconfig.SuperiorProductConfigDO;
|
||||||
import cn.iocoder.yudao.module.haoka.service.api.*;
|
import cn.iocoder.yudao.module.haoka.service.api.*;
|
||||||
import cn.iocoder.yudao.module.haoka.service.api.models.*;
|
import cn.iocoder.yudao.module.haoka.service.api.models.*;
|
||||||
import cn.iocoder.yudao.module.haoka.service.onsaleproduct.OnSaleProductService;
|
import cn.iocoder.yudao.module.haoka.service.onsaleproduct.OnSaleProductService;
|
||||||
|
import cn.iocoder.yudao.module.haoka.service.superiorapi.SuperiorApiService;
|
||||||
|
import cn.iocoder.yudao.module.haoka.service.superiorproductconfig.SuperiorProductConfigService;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
|
@ -36,6 +40,11 @@ public class LianTongApiDealStrategy implements ApiDealStrategy {
|
||||||
@Resource
|
@Resource
|
||||||
private OnSaleProductService onSaleProductService;
|
private OnSaleProductService onSaleProductService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SuperiorApiService superiorApiService;
|
||||||
|
@Resource
|
||||||
|
private SuperiorProductConfigService superiorProductConfigService;
|
||||||
|
|
||||||
private LianTongArea getAddress(String code) {
|
private LianTongArea getAddress(String code) {
|
||||||
return LianTongAreaUtils.getArea(code);
|
return LianTongAreaUtils.getArea(code);
|
||||||
}
|
}
|
||||||
|
|
@ -46,11 +55,13 @@ public class LianTongApiDealStrategy implements ApiDealStrategy {
|
||||||
if (preProduct == null) {
|
if (preProduct == null) {
|
||||||
return ApiDealResp.failed("商品下架或者不存在");
|
return ApiDealResp.failed("商品下架或者不存在");
|
||||||
}
|
}
|
||||||
Long haokaSuperiorApiId = preProduct.getSuperiorApiRespVO().getId();
|
SuperiorApiDO superiorApi = superiorApiService.getSuperiorApi(param.getSuperiorApiId());
|
||||||
logVO.setHaokaSuperiorApiId(haokaSuperiorApiId);
|
final SuperiorProductConfigDO skuConfigVO = superiorProductConfigService.getById(param.getSuperiorProductConfigId());
|
||||||
|
if (skuConfigVO == null) {
|
||||||
|
return ApiDealResp.failed("商品对接上游配置不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
Long haokaSuperiorApiId = superiorApi.getId();
|
||||||
final SuperiorProductConfigRespVO skuConfigVO = preProduct.getSuperiorProductConfigRespVO();
|
|
||||||
|
|
||||||
String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
|
String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
|
||||||
|
|
||||||
|
|
@ -114,7 +125,7 @@ public class LianTongApiDealStrategy implements ApiDealStrategy {
|
||||||
|
|
||||||
// 2、提交预订单 得到token lianTongPreOrderSync
|
// 2、提交预订单 得到token lianTongPreOrderSync
|
||||||
KingPreOrderSyncRequest preOrder = new KingPreOrderSyncRequest();
|
KingPreOrderSyncRequest preOrder = new KingPreOrderSyncRequest();
|
||||||
preOrder.setGoodsId(preProduct.getSuperiorProductConfigRespVO().getSuperiorCode());
|
preOrder.setGoodsId(skuConfigVO.getSuperiorCode());
|
||||||
preOrder.setOrderId(param.getId().toString());
|
preOrder.setOrderId(param.getId().toString());
|
||||||
preOrder.setCertName(param.getIdCardName());
|
preOrder.setCertName(param.getIdCardName());
|
||||||
preOrder.setCertNo(param.getIdCardNum());
|
preOrder.setCertNo(param.getIdCardNum());
|
||||||
|
|
@ -173,7 +184,7 @@ public class LianTongApiDealStrategy implements ApiDealStrategy {
|
||||||
syncV2.setCityCode(numAddress.getPhoneCityCode());
|
syncV2.setCityCode(numAddress.getPhoneCityCode());
|
||||||
syncV2.setCreateTime(format);
|
syncV2.setCreateTime(format);
|
||||||
syncV2.setPhoneNum(param.getPlanMobile());
|
syncV2.setPhoneNum(param.getPlanMobile());
|
||||||
syncV2.setGoodsId(preProduct.getSuperiorProductConfigRespVO().getSuperiorCode());
|
syncV2.setGoodsId(skuConfigVO.getSuperiorCode());
|
||||||
|
|
||||||
String body = preOrderResponse.getBody();
|
String body = preOrderResponse.getBody();
|
||||||
if (StringUtils.isNotEmpty(body)) {
|
if (StringUtils.isNotEmpty(body)) {
|
||||||
|
|
@ -181,7 +192,7 @@ public class LianTongApiDealStrategy implements ApiDealStrategy {
|
||||||
syncV2.setToken(jsonObject.getString("token"));
|
syncV2.setToken(jsonObject.getString("token"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (skuConfigVO != null && StringUtils.isNotEmpty(skuConfigVO.getConfig())) {
|
if (StringUtils.isNotEmpty(skuConfigVO.getConfig())) {
|
||||||
String config = skuConfigVO.getConfig();
|
String config = skuConfigVO.getConfig();
|
||||||
JSONObject configs = JSON.parseObject(config);
|
JSONObject configs = JSON.parseObject(config);
|
||||||
{
|
{
|
||||||
|
|
@ -237,7 +248,7 @@ public class LianTongApiDealStrategy implements ApiDealStrategy {
|
||||||
if (preProduct == null) {
|
if (preProduct == null) {
|
||||||
return ApiDealResp.failed("商品下架或者不存在");
|
return ApiDealResp.failed("商品下架或者不存在");
|
||||||
}
|
}
|
||||||
Long haokaSuperiorApiId = preProduct.getSuperiorApiRespVO().getId();
|
Long haokaSuperiorApiId = param.getSuperiorApiId();
|
||||||
logVO.setHaokaSuperiorApiId(haokaSuperiorApiId);
|
logVO.setHaokaSuperiorApiId(haokaSuperiorApiId);
|
||||||
|
|
||||||
return ApiDealResp.ontSupport("联通不支持查询订单接口,须参照回调接口");
|
return ApiDealResp.ontSupport("联通不支持查询订单接口,须参照回调接口");
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ import static cn.iocoder.yudao.module.haoka.enums.ErrorCodeConstants.*;
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@Validated
|
@Validated
|
||||||
public class OrdersServiceImpl extends ServiceImpl<OrdersMapper,OrdersDO> implements OrdersService {
|
public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, OrdersDO> implements OrdersService {
|
||||||
@Resource
|
@Resource
|
||||||
private OrdersMapper ordersMapper;
|
private OrdersMapper ordersMapper;
|
||||||
@Resource
|
@Resource
|
||||||
|
|
@ -50,14 +50,17 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersMapper,OrdersDO> implem
|
||||||
// 插入
|
// 插入
|
||||||
OrdersDO orders = BeanUtils.toBean(createReqVO, OrdersDO.class);
|
OrdersDO orders = BeanUtils.toBean(createReqVO, OrdersDO.class);
|
||||||
orders.setId(SnowflakeId.generate());
|
orders.setId(SnowflakeId.generate());
|
||||||
// 注入产品生产方式
|
// 注入产品生产方式 记录初始产品+接口相关信息
|
||||||
Long productId = createReqVO.getProductId();
|
OnSaleProductPreOrderRespVO onSaleProductPreOrder = onSaleProductService.getOnSaleProductPreOrder(createReqVO.getOnSaleProductId());
|
||||||
Integer autoType = onSaleProductService.getOnSaleProductPreOrder(productId).getParentProduct().getAutoType();
|
orders.setAutoType(onSaleProductPreOrder.getParentProduct().getAutoType());
|
||||||
orders.setAutoType(autoType);
|
orders.setOnSaleProductId(onSaleProductPreOrder.getId());
|
||||||
ordersMapper.insert(orders);
|
orders.setProducerId(onSaleProductPreOrder.getParentProduct().getId());
|
||||||
|
orders.setSuperiorProductConfigId(onSaleProductPreOrder.getSuperiorProductConfigRespVO().getId());
|
||||||
|
orders.setSuperiorApiId(onSaleProductPreOrder.getSuperiorApiRespVO().getId());
|
||||||
|
|
||||||
|
ordersMapper.insert(orders);
|
||||||
OrderApiCreateParam param = new OrderApiCreateParam();
|
OrderApiCreateParam param = new OrderApiCreateParam();
|
||||||
BeanUtils.copyProperties(orders,param);
|
BeanUtils.copyProperties(orders, param);
|
||||||
apiDealStrategyService.createOrder(param);
|
apiDealStrategyService.createOrder(param);
|
||||||
// 返回
|
// 返回
|
||||||
return orders.getId();
|
return orders.getId();
|
||||||
|
|
@ -66,11 +69,22 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersMapper,OrdersDO> implem
|
||||||
@Override
|
@Override
|
||||||
public void updateOrders(OrdersSaveReqVO updateReqVO) {
|
public void updateOrders(OrdersSaveReqVO updateReqVO) {
|
||||||
// 校验存在
|
// 校验存在
|
||||||
validateOrdersExists(updateReqVO.getId());
|
|
||||||
// 更新
|
// 更新
|
||||||
|
OrdersDO oldOrderDo = ordersMapper.selectById(updateReqVO.getId());
|
||||||
|
if (oldOrderDo == null) {
|
||||||
|
throw exception(ORDERS_NOT_EXISTS);
|
||||||
|
}
|
||||||
OrdersDO updateObj = BeanUtils.toBean(updateReqVO, OrdersDO.class);
|
OrdersDO updateObj = BeanUtils.toBean(updateReqVO, OrdersDO.class);
|
||||||
|
|
||||||
|
// 保证下面字段信息不会变化
|
||||||
|
updateObj.setOnSaleProductId(oldOrderDo.getOnSaleProductId());
|
||||||
|
updateObj.setProducerId(oldOrderDo.getProducerId());
|
||||||
|
updateObj.setSuperiorProductConfigId(oldOrderDo.getSuperiorProductConfigId());
|
||||||
|
updateObj.setSuperiorApiId(oldOrderDo.getSuperiorApiId());
|
||||||
|
|
||||||
ordersMapper.updateById(updateObj);
|
ordersMapper.updateById(updateObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void auditOrders(OrdersSaveReqVO updateReqVO) {
|
public void auditOrders(OrdersSaveReqVO updateReqVO) {
|
||||||
// 校验存在
|
// 校验存在
|
||||||
|
|
@ -84,16 +98,16 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersMapper,OrdersDO> implem
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* 调用运营商产生订单
|
* 调用运营商产生订单
|
||||||
|
*
|
||||||
* @param ordersDO
|
* @param ordersDO
|
||||||
*/
|
*/
|
||||||
private void createOrder(OrdersDO ordersDO) {
|
private void createOrder(OrdersDO ordersDO) {
|
||||||
Long status = ordersDO.getStatus();
|
Long status = ordersDO.getStatus();
|
||||||
if(ObjectUtil.equals(status,450)){
|
if (ObjectUtil.equals(status, 450)) {
|
||||||
// 进入审核流程且下单
|
// 进入审核流程且下单
|
||||||
OrderApiCreateParam param = new OrderApiCreateParam();
|
OrderApiCreateParam param = new OrderApiCreateParam();
|
||||||
BeanUtils.copyProperties(ordersDO,param);
|
BeanUtils.copyProperties(ordersDO, param);
|
||||||
ApiDealResp<OrderApiCreateResp> orderResponse = apiDealStrategyService.createOrder(param);
|
ApiDealResp<OrderApiCreateResp> orderResponse = apiDealStrategyService.createOrder(param);
|
||||||
// 是否是是上游黑名单 如果是 存本地黑名单
|
// 是否是是上游黑名单 如果是 存本地黑名单
|
||||||
Boolean isBlack = orderResponse.getIsBlack();
|
Boolean isBlack = orderResponse.getIsBlack();
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
-- 订单新增参数
|
||||||
|
delete from haoka_orders;
|
||||||
|
ALTER TABLE haoka_orders
|
||||||
|
ADD COLUMN on_sale_product_id bigint(20) NOT NULL COMMENT '在售商品ID' AFTER auto_type,
|
||||||
|
ADD COLUMN superior_api_id bigint(20) NOT NULL COMMENT '上游接口ID' AFTER on_sale_product_id,
|
||||||
|
ADD COLUMN superior_product_config_id bigint(20) NOT NULL COMMENT '产品-接口配置' AFTER superior_api_id;
|
||||||
Loading…
Reference in New Issue