|
|
@ -48,6 +48,7 @@ import com.doudian.open.api.order_searchList.OrderSearchListResponse;
|
|
|
|
import com.doudian.open.api.order_searchList.data.OrderSearchListData;
|
|
|
|
import com.doudian.open.api.order_searchList.data.OrderSearchListData;
|
|
|
|
import com.doudian.open.api.order_searchList.data.ShopOrderListItem;
|
|
|
|
import com.doudian.open.api.order_searchList.data.ShopOrderListItem;
|
|
|
|
import com.doudian.open.api.order_searchList.param.OrderSearchListParam;
|
|
|
|
import com.doudian.open.api.order_searchList.param.OrderSearchListParam;
|
|
|
|
|
|
|
|
import com.doudian.open.core.AccessToken;
|
|
|
|
import com.ms.api.bo.ShopBO;
|
|
|
|
import com.ms.api.bo.ShopBO;
|
|
|
|
import com.ms.api.common.ApiResult;
|
|
|
|
import com.ms.api.common.ApiResult;
|
|
|
|
import com.ms.api.consts.AfterSaleConst;
|
|
|
|
import com.ms.api.consts.AfterSaleConst;
|
|
|
@ -334,7 +335,7 @@ public class OpOrderServiceImpl implements OpOrderService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public JSONObject rsyncOpOrderByOrderIds(String shopId, List<String> orderIds, Map<String, String> orderIdAndDdMsgOrderStatusMap
|
|
|
|
public JSONObject rsyncOpOrderByOrderIds(String shopId, List<String> orderIds, AccessToken accessToken, Map<String, String> orderIdAndDdMsgOrderStatusMap
|
|
|
|
, boolean fromDyCloud) {
|
|
|
|
, boolean fromDyCloud) {
|
|
|
|
if (ObjectUtil.isEmpty(shopId) || ObjectUtil.isEmpty(orderIds)) {
|
|
|
|
if (ObjectUtil.isEmpty(shopId) || ObjectUtil.isEmpty(orderIds)) {
|
|
|
|
throw new RuntimeException("参数错误");
|
|
|
|
throw new RuntimeException("参数错误");
|
|
|
@ -352,7 +353,7 @@ public class OpOrderServiceImpl implements OpOrderService {
|
|
|
|
if (ObjectUtil.isNull(orderRet) || !orderRet.isSuccess() || (ObjectUtil.isEmpty(orderIdAndDdMsgOrderStatusMap) && (orderIdAndDdMsgOrderStatusMap.containsKey(orderId)
|
|
|
|
if (ObjectUtil.isNull(orderRet) || !orderRet.isSuccess() || (ObjectUtil.isEmpty(orderIdAndDdMsgOrderStatusMap) && (orderIdAndDdMsgOrderStatusMap.containsKey(orderId)
|
|
|
|
&& !dyCloudOrderStatus.equals(orderIdAndDdMsgOrderStatusMap.get(orderId))))) {
|
|
|
|
&& !dyCloudOrderStatus.equals(orderIdAndDdMsgOrderStatusMap.get(orderId))))) {
|
|
|
|
log.info("start getOrderDetailFromDdV2");
|
|
|
|
log.info("start getOrderDetailFromDdV2");
|
|
|
|
orderRet = getOrderDetailFromDdV2(orderId, 1);
|
|
|
|
orderRet = getOrderDetailFromDdV2(orderId, accessToken, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!orderRet.isSuccess()) {
|
|
|
|
if (!orderRet.isSuccess()) {
|
|
|
|
orderIdAndFailReasonMap.put(orderId, String.format(" orderId:【%s】,reason:【%s】", orderId, orderRet.getMsg()));
|
|
|
|
orderIdAndFailReasonMap.put(orderId, String.format(" orderId:【%s】,reason:【%s】", orderId, orderRet.getMsg()));
|
|
|
@ -1480,14 +1481,14 @@ public class OpOrderServiceImpl implements OpOrderService {
|
|
|
|
return opOrderMapper.selectByOrderId(orderId);
|
|
|
|
return opOrderMapper.selectByOrderId(orderId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private ApiResult<ShopOrderDetail> getOrderDetailFromDdV2(String orderId, Integer isSearchable) {
|
|
|
|
private ApiResult<ShopOrderDetail> getOrderDetailFromDdV2(String orderId, AccessToken accessToken, Integer isSearchable) {
|
|
|
|
if (ObjectUtil.isEmpty(orderId) || ObjectUtil.isEmpty(isSearchable)) {
|
|
|
|
if (ObjectUtil.isEmpty(orderId) || ObjectUtil.isEmpty(isSearchable)) {
|
|
|
|
return ApiResult.fail("参数错误");
|
|
|
|
return ApiResult.fail("参数错误");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
OrderOrderDetailParam param = new OrderOrderDetailParam();
|
|
|
|
OrderOrderDetailParam param = new OrderOrderDetailParam();
|
|
|
|
param.setShopOrderId(orderId);
|
|
|
|
param.setShopOrderId(orderId);
|
|
|
|
param.setIsSearchable(isSearchable == 1);
|
|
|
|
param.setIsSearchable(isSearchable == 1);
|
|
|
|
return DdRequestUtil.orderOrderDetailRequest(param);
|
|
|
|
return DdRequestUtil.orderOrderDetailRequest(param, accessToken);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@ -1730,7 +1731,7 @@ public class OpOrderServiceImpl implements OpOrderService {
|
|
|
|
OrderOrderDetailParam param = new OrderOrderDetailParam();
|
|
|
|
OrderOrderDetailParam param = new OrderOrderDetailParam();
|
|
|
|
param.setShopOrderId(orderId);
|
|
|
|
param.setShopOrderId(orderId);
|
|
|
|
param.setIsSearchable(true);
|
|
|
|
param.setIsSearchable(true);
|
|
|
|
ApiResult<ShopOrderDetail> apiResult = DdRequestUtil.orderOrderDetailRequest(param);
|
|
|
|
ApiResult<ShopOrderDetail> apiResult = DdRequestUtil.orderOrderDetailRequest(param, null);
|
|
|
|
ShopOrderDetail shopOrderDetail = apiResult.getData();
|
|
|
|
ShopOrderDetail shopOrderDetail = apiResult.getData();
|
|
|
|
if (apiResult.isSuccess() && shopOrderDetail != null) {
|
|
|
|
if (apiResult.isSuccess() && shopOrderDetail != null) {
|
|
|
|
orderList.add(shopOrderDetail);
|
|
|
|
orderList.add(shopOrderDetail);
|
|
|
@ -2416,6 +2417,8 @@ public class OpOrderServiceImpl implements OpOrderService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
JSONObject msgData = StringUtils.isEmpty(doudianMsgInfo.getData()) ? new JSONObject() : JSONObject.parseObject(doudianMsgInfo.getData());
|
|
|
|
JSONObject msgData = StringUtils.isEmpty(doudianMsgInfo.getData()) ? new JSONObject() : JSONObject.parseObject(doudianMsgInfo.getData());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ShopBO shopInfo = shopService.getShopInfo(Long.valueOf(msgData.getString("shop_id")));
|
|
|
|
|
|
|
|
|
|
|
|
String pId = !StringUtils.isEmpty(msgData.getString("p_id")) ? msgData.getString("p_id") : msgData.getString("shop_order_id");
|
|
|
|
String pId = !StringUtils.isEmpty(msgData.getString("p_id")) ? msgData.getString("p_id") : msgData.getString("shop_order_id");
|
|
|
|
|
|
|
|
|
|
|
|
Integer tagVal = Integer.valueOf(doudianMsgInfo.getTag());
|
|
|
|
Integer tagVal = Integer.valueOf(doudianMsgInfo.getTag());
|
|
|
@ -2428,7 +2431,7 @@ public class OpOrderServiceImpl implements OpOrderService {
|
|
|
|
Map<String, String> orderIdAndDdMsgOrderStatusMap = new HashMap<>();
|
|
|
|
Map<String, String> orderIdAndDdMsgOrderStatusMap = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
|
|
log.info("start rsyncOpOrderByOrderIds");
|
|
|
|
log.info("start rsyncOpOrderByOrderIds");
|
|
|
|
JSONObject ret = rsyncOpOrderByOrderIds(msgData.getString("shop_id"), orderIds, orderIdAndDdMsgOrderStatusMap, true);
|
|
|
|
JSONObject ret = rsyncOpOrderByOrderIds(msgData.getString("shop_id"), orderIds, shopInfo.getShopAccessToken(), orderIdAndDdMsgOrderStatusMap, true);
|
|
|
|
if (ret.containsKey("orderIdAndFailReasonMap")) {
|
|
|
|
if (ret.containsKey("orderIdAndFailReasonMap")) {
|
|
|
|
Map<String, String> orderIdAndFailReasonMap = (Map<String, String>) JSON.parseObject(ret.getString("orderIdAndFailReasonMap"), Map.class);
|
|
|
|
Map<String, String> orderIdAndFailReasonMap = (Map<String, String>) JSON.parseObject(ret.getString("orderIdAndFailReasonMap"), Map.class);
|
|
|
|
if (orderIdAndFailReasonMap.containsKey(orderId)) {
|
|
|
|
if (orderIdAndFailReasonMap.containsKey(orderId)) {
|
|
|
|