是否自动生产
This commit is contained in:
parent
ce0f11691e
commit
44d3eb78f0
|
|
@ -71,17 +71,17 @@ public class HaokaUpdateOrderSchedule {
|
|||
int pageSize = 100;
|
||||
Long total = 100L;
|
||||
|
||||
// 需要更新的订单过滤 todo:从本地查询出需要从上游同步状态的订单
|
||||
// pageReqVO.setStatus(Lists.asList(1)); // 已经完成/取消/删除的订单,不需要再从上游同步,这里过滤掉
|
||||
|
||||
while ((long) pageNo * pageSize < total) {
|
||||
pageNo += 1;
|
||||
pageReqVO.setPageNo(pageNo);
|
||||
pageReqVO.setPageSize(pageSize);
|
||||
|
||||
// 需要更新的订单过滤 todo
|
||||
// pageReqVO.setStatus(Lists.asList(1));
|
||||
|
||||
PageResult<OrdersDO> ordersPage = ordersService.getOrdersPage(pageReqVO);
|
||||
total = ordersPage.getTotal();
|
||||
for (OrdersDO ordersDO : ordersPage.getList()) {
|
||||
// 开始从上游同步订单状态,解析,并且更新本地订单状态
|
||||
updateOrderInfo(ordersDO);
|
||||
}
|
||||
}
|
||||
|
|
@ -104,9 +104,34 @@ public class HaokaUpdateOrderSchedule {
|
|||
}
|
||||
|
||||
|
||||
// 开始从上游同步订单状态,解析,并且更新本地订单状态
|
||||
private void updateOrderInfo(final OrdersDO ordersDO) {
|
||||
log.info("更新前--:{}", JSON.toJSONString(ordersDO));
|
||||
// 查询上游的订单结果
|
||||
ApiDealResp<OrderApiQueryResp> updateOrderInfo = apiDealStrategyService.getUpdateOrderInfo(ordersDO);
|
||||
// 上游是否支持查询接口 :比如联通不支持查询接口,走消息队列
|
||||
if (updateOrderInfo.getIsSupport()){
|
||||
return;
|
||||
}
|
||||
// 上游黑名单
|
||||
if (updateOrderInfo.getIsBlack()){
|
||||
|
||||
}
|
||||
// 查询成功?
|
||||
if (!updateOrderInfo.getSuccess()){
|
||||
// 不成功原因
|
||||
String msg = updateOrderInfo.getMsg();
|
||||
}
|
||||
|
||||
// 查询结果
|
||||
OrderApiQueryResp data = updateOrderInfo.getData();
|
||||
|
||||
// 订单状态
|
||||
String orderStatusCode = data.getOrderStatusCode();
|
||||
|
||||
// 订单状态描述
|
||||
String orderStatusDesc = data.getSupplierOrderStatusDesc();
|
||||
|
||||
// todo 上游更新
|
||||
ordersService.updateById(ordersDO);
|
||||
log.info("更新后--:{}", JSON.toJSONString(ordersDO));
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public class ApiDealServiceImpl implements ApiDealStrategyService {
|
|||
logVO.setHaokaSuperiorApiId(param.getSuperiorApiId());
|
||||
try {
|
||||
lock.lock(1, TimeUnit.SECONDS);
|
||||
OnSaleProductPreOrderRespVO onSaleProductPreOrder = onSaleProductService.getOnSaleProductPreOrder(param.getProductId());
|
||||
OnSaleProductPreOrderRespVO onSaleProductPreOrder = onSaleProductService.getOnSaleProductPreOrder(param.getOnSaleProductId());
|
||||
if (onSaleProductPreOrder == null) {
|
||||
String msg = "关联上级产品不存在";
|
||||
logVO.setSuccess(false);
|
||||
|
|
@ -97,7 +97,7 @@ public class ApiDealServiceImpl implements ApiDealStrategyService {
|
|||
logVO.setHaokaSuperiorApiId(param.getSuperiorApiId());
|
||||
Boolean isSupport = true;
|
||||
try {
|
||||
OnSaleProductPreOrderRespVO onSaleProductPreOrder = onSaleProductService.getOnSaleProductPreOrder(param.getProductId());
|
||||
OnSaleProductPreOrderRespVO onSaleProductPreOrder = onSaleProductService.getOnSaleProductPreOrder(param.getOnSaleProductId());
|
||||
if (onSaleProductPreOrder == null) {
|
||||
String msg = "关联上级产品不存在";
|
||||
logVO.setSuccess(false);
|
||||
|
|
|
|||
|
|
@ -31,6 +31,9 @@ public class OrderApiQueryResp extends BaseDO {
|
|||
*/
|
||||
private String supplierOrderStatusDesc;
|
||||
|
||||
/**
|
||||
* 订单状态
|
||||
*/
|
||||
private String orderStatusCode;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public class GuangZhouDxApiDealStrategy implements ApiDealStrategy {
|
|||
|
||||
@Override
|
||||
public ApiDealResp<OrderApiCreateResp> createOrder(final SuperiorApiLogSaveReqVO logVO, OrderApiCreateParam param) throws Exception {
|
||||
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getProductId());
|
||||
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getOnSaleProductId());
|
||||
if (preProduct == null) {
|
||||
return ApiDealResp.failed("商品下架或者不存在");
|
||||
}
|
||||
|
|
@ -114,7 +114,7 @@ public class GuangZhouDxApiDealStrategy implements ApiDealStrategy {
|
|||
|
||||
@Override
|
||||
public ApiDealResp<OrderApiQueryResp> queryOrder(final SuperiorApiLogSaveReqVO logVO, OrderApiQueryParam param) throws Exception {
|
||||
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getProductId());
|
||||
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getOnSaleProductId());
|
||||
if (preProduct == null) {
|
||||
return ApiDealResp.failed("商品下架或者不存在");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ public class HaiNanDxApiDealStrategy implements ApiDealStrategy {
|
|||
|
||||
@Override
|
||||
public ApiDealResp<OrderApiCreateResp> createOrder(final SuperiorApiLogSaveReqVO logVO, OrderApiCreateParam param) {
|
||||
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getProductId());
|
||||
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getOnSaleProductId());
|
||||
if (preProduct == null) {
|
||||
return ApiDealResp.failed("商品下架或者不存在");
|
||||
}
|
||||
|
|
@ -130,7 +130,7 @@ public class HaiNanDxApiDealStrategy implements ApiDealStrategy {
|
|||
|
||||
@Override
|
||||
public ApiDealResp<OrderApiQueryResp> queryOrder(final SuperiorApiLogSaveReqVO logVO, OrderApiQueryParam param) {
|
||||
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getProductId());
|
||||
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getOnSaleProductId());
|
||||
if (preProduct == null) {
|
||||
return ApiDealResp.failed("商品下架或者不存在");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ public class HuNanDxApiDealStrategy implements ApiDealStrategy {
|
|||
|
||||
@Override
|
||||
public ApiDealResp<OrderApiCreateResp> createOrder(final SuperiorApiLogSaveReqVO logVO, OrderApiCreateParam param) throws Exception {
|
||||
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getProductId());
|
||||
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getOnSaleProductId());
|
||||
if (preProduct == null) {
|
||||
return ApiDealResp.failed("商品下架或者不存在");
|
||||
}
|
||||
|
|
@ -219,7 +219,7 @@ public class HuNanDxApiDealStrategy implements ApiDealStrategy {
|
|||
@Override
|
||||
public ApiDealResp<OrderApiQueryResp> queryOrder(final SuperiorApiLogSaveReqVO logVO, OrderApiQueryParam param) {
|
||||
logVO.setHaokaSuperiorApiId(param.getSuperiorApiId());
|
||||
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getProductId());
|
||||
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getOnSaleProductId());
|
||||
if (preProduct == null) {
|
||||
return ApiDealResp.failed("商品下架或者不存在");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public class LianTongApiDealStrategy implements ApiDealStrategy {
|
|||
|
||||
@Override
|
||||
public ApiDealResp<OrderApiCreateResp> createOrder(final SuperiorApiLogSaveReqVO logVO, OrderApiCreateParam param) {
|
||||
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getProductId());
|
||||
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getOnSaleProductId());
|
||||
if (preProduct == null) {
|
||||
return ApiDealResp.failed("商品下架或者不存在");
|
||||
}
|
||||
|
|
@ -244,7 +244,7 @@ public class LianTongApiDealStrategy implements ApiDealStrategy {
|
|||
|
||||
@Override
|
||||
public ApiDealResp<OrderApiQueryResp> queryOrder(final SuperiorApiLogSaveReqVO logVO, OrderApiQueryParam param) {
|
||||
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getProductId());
|
||||
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getOnSaleProductId());
|
||||
if (preProduct == null) {
|
||||
return ApiDealResp.failed("商品下架或者不存在");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,21 +114,19 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, OrdersDO> imple
|
|||
orders.setSuperiorApiId(onSaleProductPreOrder.getSuperiorApiRespVO().getId());
|
||||
|
||||
ordersMapper.insert(orders);
|
||||
OrderApiCreateParam param = new OrderApiCreateParam();
|
||||
BeanUtils.copyProperties(orders, param);
|
||||
// apiDealStrategyService.createOrder(param);
|
||||
|
||||
|
||||
// 创建后需要发送短信
|
||||
OrdersDO ordersDO = ordersMapper.selectById(orders.getId());
|
||||
// OrdersDO ordersDO = ordersMapper.selectById(orders.getId());
|
||||
smsTaskService.sendSMS(
|
||||
ordersDO.getStatus(),
|
||||
ordersDO.getId(),
|
||||
ordersDO.getSource(),
|
||||
ordersDO.getOnSaleProductId(),
|
||||
ordersDO.getRefundStatus(),
|
||||
ordersDO.getCallStatus(),
|
||||
ordersDO.getAddressMobile(),
|
||||
ordersDO
|
||||
orders.getStatus(),
|
||||
orders.getId(),
|
||||
orders.getSource(),
|
||||
orders.getOnSaleProductId(),
|
||||
orders.getRefundStatus(),
|
||||
orders.getCallStatus(),
|
||||
orders.getAddressMobile(),
|
||||
orders
|
||||
);
|
||||
// 返回
|
||||
return orders.getId();
|
||||
|
|
|
|||
Loading…
Reference in New Issue