فهرست منبع

还原多支付代码

yuhongqi 1 هفته پیش
والد
کامیت
0c916f0600

+ 6 - 0
fs-admin/src/main/java/com/fs/hisStore/task/ExpressTask.java

@@ -20,4 +20,10 @@ public class ExpressTask {
         fsStoreOrderScrmService.syncExpressToWx();
     }
 
+
+    //定时任务刷新订单结算状态
+    public void refreshOrderSettlementStatus(){
+        fsStoreOrderScrmService.refreshOrderSettlementStatus();
+    }
+
 }

+ 3 - 3
fs-service/src/main/java/com/fs/live/mapper/LiveOrderMapper.java

@@ -369,8 +369,8 @@ public interface LiveOrderMapper {
     int batchUpdateErpByOrderIds(@Param("maps")ArrayList<Map<String, String>> maps);
 
     @Select({"<script> " +
-            "select o.order_id,o.order_code,o.item_json,o.pay_price,o.status,o.delivery_id,o.finish_time  from live_order o  " +
-            "where o.is_del=0 and o.is_sys_del=0 " +
+            "select o.order_id,o.order_code,o.item_json,o.pay_price,o.status,o.delivery_sn as delivery_id,o.finish_time  from live_order o  " +
+            "where o.is_del=0 " +
             "<if test = 'maps.status != null and maps.status != \"\"     '> " +
             "and o.status =#{maps.status} " +
             "</if>" +
@@ -389,7 +389,7 @@ public interface LiveOrderMapper {
 
     @Select({"<script> " +
             "select o.*  from live_order o  " +
-            "where o.is_del=0 and o.is_sys_del=0 " +
+            "where o.is_del=0 " +
             "<if test = 'maps.status != null and maps.status != \"\"     '> " +
             "and o.status =#{maps.status} " +
             "</if>" +

+ 5 - 3
fs-service/src/main/java/com/fs/wx/order/service/ShippingService.java

@@ -1,5 +1,6 @@
 package com.fs.wx.order.service;
 
+import cn.binarywang.wx.miniapp.api.WxMaService;
 import cn.hutool.core.exceptions.ExceptionUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.http.*;
@@ -7,10 +8,12 @@ import cn.hutool.json.JSONUtil;
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fs.core.config.WxMaConfiguration;
 import com.fs.wx.order.dto.UploadShippingInfoRequest;
 import com.fs.wx.order.dto.WeChatApiConfig;
 import com.fs.wx.order.dto.WeChatApiResponse;
 import lombok.extern.slf4j.Slf4j;
+import me.chanjar.weixin.common.error.WxErrorException;
 import org.springframework.stereotype.Service;
 import org.springframework.web.util.UriComponentsBuilder;
 
@@ -30,8 +33,8 @@ public class ShippingService {
      * @param request 发货信息请求体
      * @return 微信 API 的响应
      */
-    public WeChatApiResponse uploadShippingInfo(UploadShippingInfoRequest request) {
-        WeChatAuthService weChatAuthService = WeChatAuthFactory.getWeChatAuthService(request.getAppid());
+    public WeChatApiResponse uploadShippingInfo(UploadShippingInfoRequest request) throws WxErrorException {
+        final WxMaService weChatAuthService = WxMaConfiguration.getMaService(request.getAppid());
         String accessToken = weChatAuthService.getAccessToken(false);
         if (accessToken == null) {
             log.error("获取微信 Access Token 失败");
@@ -81,7 +84,6 @@ public class ShippingService {
                     log.warn("微信接口返回业务错误: code={}, message={}", weChatApiResponse.getErrcode(), weChatApiResponse.getErrmsg());
                     if(ObjectUtil.equal(weChatApiResponse.getErrcode(),40001)) {
                         log.info("token缓存失效,清除token,等待下次执行...");
-                        weChatAuthService.clearToken();
                     }
                 }
                 return weChatApiResponse;

+ 4 - 4
fs-service/src/main/java/com/fs/wx/order/service/WeChatAuthFactory.java

@@ -14,17 +14,17 @@ import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
-@Component
-public class WeChatAuthFactory implements ApplicationContextAware, SmartInitializingSingleton {
+//@Component
+public class WeChatAuthFactory  {
     private static ApplicationContext applicationContext;
     private final static Map<String,WeChatAuthService> weChatAuthServices = new ConcurrentHashMap<>();
 
-    @Override
+
     public void setApplicationContext(@NotNull ApplicationContext applicationContext) throws BeansException {
         WeChatAuthFactory.applicationContext = applicationContext;
     }
 
-    @Override
+
     public void afterSingletonsInstantiated() {
         PaymentMiniProgramConfigMapper mapper = applicationContext.getBean(PaymentMiniProgramConfigMapper.class);
         List<PaymentMiniProgramConfig> configs = mapper.selectAll();

+ 3 - 0
fs-service/src/main/resources/mapper/live/LiveOrderMapper.xml

@@ -1067,6 +1067,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="payEndTime != null and payEndTime != ''">
                 AND o.pay_time &lt;= #{payEndTime}
             </if>
+            <if test="userPhone != null and userPhone != ''">
+                AND o.user_phone = #{userPhone}
+            </if>
         </where>
         ORDER BY o.create_time DESC
     </select>