|
@@ -18,6 +18,7 @@ import com.fuint.common.service.*;
|
|
|
import com.fuint.common.util.*;
|
|
|
import com.fuint.framework.exception.BusinessCheckException;
|
|
|
import com.fuint.framework.web.ResponseObject;
|
|
|
+import com.fuint.repository.mapper.MtUploadShippingLogMapper;
|
|
|
import com.fuint.repository.model.*;
|
|
|
import com.fuint.utils.QRCodeUtil;
|
|
|
import com.fuint.utils.StringUtil;
|
|
@@ -64,6 +65,8 @@ public class WeixinServiceImpl implements WeixinService {
|
|
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(WeixinServiceImpl.class);
|
|
|
|
|
|
+ private MtUploadShippingLogMapper uploadShippingLogMapper;
|
|
|
+
|
|
|
/**
|
|
|
* 订单服务接口
|
|
|
* */
|
|
@@ -1019,7 +1022,7 @@ public class WeixinServiceImpl implements WeixinService {
|
|
|
throw new BusinessCheckException("上传发货信息失败,会员的openId不能为空!");
|
|
|
}
|
|
|
// 是否是微信小程序订单 && 微信支付
|
|
|
- if (orderInfo != null && !orderInfo.getPlatform().equals(PlatformTypeEnum.MP_WEIXIN.getCode()) || !orderInfo.getPayType().equals(PayTypeEnum.JSAPI.name())) {
|
|
|
+ if (orderInfo != null && orderInfo.getPlatform().equals(PlatformTypeEnum.MP_WEIXIN.getCode()) || orderInfo.getPayType().equals(PayTypeEnum.JSAPI.name())) {
|
|
|
String url = "https://api.weixin.qq.com/wxa/sec/order/upload_shipping_info?access_token=" + getAccessToken(orderInfo.getMerchantId(), true, true);
|
|
|
|
|
|
// 获取微信支付配置
|
|
@@ -1065,8 +1068,16 @@ public class WeixinServiceImpl implements WeixinService {
|
|
|
String response = HttpRESTDataClient.requestPostBody(url, reqJson);
|
|
|
logger.info("微信上传发货信息接口参数:{},返回:{}", reqJson, response);
|
|
|
JSONObject data = (JSONObject) JSONObject.parse(response);
|
|
|
+
|
|
|
if (data.get("errcode").toString().equals("0")) {
|
|
|
logger.info("微信上传发货信息接口成功,订单号:", orderSn);
|
|
|
+ MtUploadShippingLog mtUploadShippingLog = new MtUploadShippingLog();
|
|
|
+ mtUploadShippingLog.setMerchantId(orderInfo.getMerchantId());
|
|
|
+ mtUploadShippingLog.setStoreId(orderInfo.getStoreId());
|
|
|
+ mtUploadShippingLog.setOrderId(orderInfo.getId());
|
|
|
+ mtUploadShippingLog.setOrderSn(orderSn);
|
|
|
+ mtUploadShippingLog.setStatus(StatusEnum.ENABLED.getKey());
|
|
|
+ uploadShippingLogMapper.insert(mtUploadShippingLog);
|
|
|
} else {
|
|
|
logger.error("微信上传发货信息接口失败,订单号:", orderSn);
|
|
|
}
|