|
|
@@ -1,39 +1,31 @@
|
|
|
package com.yami.shop.service.hb.impl;
|
|
|
|
|
|
-import cn.hutool.core.lang.Snowflake;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.google.gson.internal.LinkedTreeMap;
|
|
|
import com.yami.shop.bean.dto.hb.*;
|
|
|
-import com.yami.shop.bean.enums.*;
|
|
|
+import com.yami.shop.bean.enums.OrderStatus;
|
|
|
+import com.yami.shop.bean.enums.ReturnMoneyStsType;
|
|
|
import com.yami.shop.bean.model.*;
|
|
|
import com.yami.shop.bean.param.OrderRefundParam;
|
|
|
import com.yami.shop.bean.vo.OrderRefundSkuVo;
|
|
|
-import com.yami.shop.common.config.Constant;
|
|
|
-import com.yami.shop.common.exception.GlobalException;
|
|
|
-import com.yami.shop.common.util.Arith;
|
|
|
-import com.yami.shop.common.util.CommonUtils;
|
|
|
+import com.yami.shop.common.util.HttpUtil;
|
|
|
import com.yami.shop.common.util.hb.HBR;
|
|
|
import com.yami.shop.dao.*;
|
|
|
-import com.yami.shop.service.*;
|
|
|
+import com.yami.shop.service.OrderRefundService;
|
|
|
+import com.yami.shop.service.OrderService;
|
|
|
+import com.yami.shop.service.UserAddrOrderService;
|
|
|
+import com.yami.shop.service.UserService;
|
|
|
import com.yami.shop.service.hb.IHBOrderService;
|
|
|
-import com.yami.shop.utils.CullenUtils;
|
|
|
import com.yami.shop.utils.HBSignUtil;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
|
-import javax.validation.Valid;
|
|
|
-import java.time.Instant;
|
|
|
-import java.time.LocalDate;
|
|
|
-import java.time.ZoneId;
|
|
|
import java.util.*;
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
import static com.yami.shop.common.util.HttpUtil.post;
|
|
|
|
|
|
@@ -61,7 +53,7 @@ public class HBOrderService implements IHBOrderService {
|
|
|
private final OrderRefundService orderRefundService;
|
|
|
private final OrderService orderService;
|
|
|
private final OrderRefundSkuMapper orderRefundSkuMapper;
|
|
|
-
|
|
|
+ private final String smBaseUrl = "http://47.109.84.152:8081/smqjh-oms";
|
|
|
|
|
|
public HBR addHBGoods(JSONObject hbRequest) {
|
|
|
try {
|
|
|
@@ -195,7 +187,6 @@ public class HBOrderService implements IHBOrderService {
|
|
|
}
|
|
|
orderMapper.updateById(order);
|
|
|
|
|
|
-
|
|
|
//取消订单
|
|
|
if (operatorType == 60) {
|
|
|
log.info("取消订单{}", channelOrderId);
|
|
|
@@ -280,6 +271,14 @@ public class HBOrderService implements IHBOrderService {
|
|
|
if (order.getHbOrderStatus() == 80) {
|
|
|
changeOrderStatus(channelOrderId, OrderStatus.SUCCESS.value());
|
|
|
}
|
|
|
+
|
|
|
+ //TODO 市民请集合海博状态通知
|
|
|
+ if (order.getOrderType().equals(4)){
|
|
|
+ Map<Object, Object> map = new LinkedTreeMap<>();
|
|
|
+ map.put("orderNumber", channelOrderId);
|
|
|
+ map.put("hbOrderStatus", operatorType);
|
|
|
+ HttpUtil.post(smBaseUrl+"/api/v1/order/updateHbOrderStatus",map);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -294,6 +293,15 @@ public class HBOrderService implements IHBOrderService {
|
|
|
order.setDvyFlowId(body.getString("carrierNo"));
|
|
|
order.setUpdateTime(new Date(changeTime));
|
|
|
orderMapper.updateById(order);
|
|
|
+
|
|
|
+ //TODO 市民请集合 物流状态推送
|
|
|
+ if (order.getOrderType().equals(4)) {
|
|
|
+ Map<Object, Object> map = new LinkedTreeMap<>();
|
|
|
+ map.put("orderNumber", channelOrderId);
|
|
|
+ map.put("logisticStatus", logisticStatus);
|
|
|
+ map.put("dvyFlowId", body.getString("carrierNo"));
|
|
|
+ HttpUtil.post(smBaseUrl + "/api/v1/order/updateHbLogisticStatus", map);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -515,5 +523,4 @@ public class HBOrderService implements IHBOrderService {
|
|
|
log.info("海博查询系统订单详情返回数据:{}", JSONObject.toJSONString(createOrderRequest));
|
|
|
return HBR.success(createOrderRequest);
|
|
|
}
|
|
|
-
|
|
|
}
|