Browse Source

Merge remote-tracking branch 'origin/master_exclusive_shop_20250718' into master_exclusive_shop_20250718

zhangqin 1 month ago
parent
commit
1e08af2a94

+ 9 - 0
fs-admin/src/main/java/com/fs/web/controller/common/CommonController.java

@@ -5,6 +5,7 @@ import javax.servlet.http.HttpServletResponse;
 
 import com.fs.common.core.domain.R;
 import com.fs.common.exception.file.OssException;
+import com.fs.common.service.ITencentCloudCosService;
 import com.fs.system.oss.CloudStorageService;
 import com.fs.system.oss.OSSFactory;
 import com.fs.web.vo.WangUploadVO;
@@ -37,6 +38,8 @@ public class CommonController
 
     @Autowired
     private ServerConfig serverConfig;
+    @Autowired
+    private ITencentCloudCosService tencentCloudCosService;
 
     /**
      * 通用下载请求
@@ -169,4 +172,10 @@ public class CommonController
         return R.ok().put("url",url);
     }
 
+    @GetMapping("/common/getTmpSecretKey")
+    public R getTmpSecretKey()
+    {
+        return tencentCloudCosService.getKeyAndCredentials();
+    }
+
 }

+ 3 - 3
fs-admin/src/main/resources/application-dev.yml

@@ -29,9 +29,9 @@ spring:
         druid:
             # 主库数据源
             master:
-                url: jdbc:mysql://139.186.77.83:3306/ylrz_his_scrm?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-                username: Rtroot
-                password: Rtroot
+                url: jdbc:mysql://172.16.0.31:3306/fs_ffhx_hospital?allowMultiQueries=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                username: root
+                password: Ylrz_1q2w3e4r5t6y
             # 从库数据源
             slave:
                 # 从数据源开关/默认关闭

+ 11 - 4
fs-service-system/src/main/java/com/fs/store/service/impl/FsStoreOrderServiceImpl.java

@@ -411,6 +411,11 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
             return R.error("订单状态不正确");
         }
 
+        Object isPaying = redisCache.getCacheObject("isPaying:" + param.getOrderId());
+        if(ObjectUtil.isNotNull(isPaying)) {
+            return R.error("支付中,请稍等...");
+        }
+
         FsUser user=userService.selectFsUserById(order.getUserId());
         if(user!=null&& StringUtils.isNotEmpty(user.getMaOpenId())){
             //已改价处理
@@ -496,6 +501,8 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
                 }
                 R process = payment.createOrder(processContext);
                 if("200".equals(String.valueOf(process.get("code")))){
+                    redisCache.setCacheObject("isPaying:"+param.getOrderId(),1,1,TimeUnit.MINUTES);
+
                     return process;
                 }
             }
@@ -3173,8 +3180,8 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
                 return R.error("此订单没有可支付的金额");
             }
 
-            String orderId=redisCache.getCacheObject("isPaying:"+order.getId());
-            if(StringUtils.isNotEmpty(orderId)&&orderId.equals(order.getId().toString())){
+            Object isPaying=redisCache.getCacheObject("isPaying:"+order.getId());
+            if(ObjectUtil.isNotNull(isPaying)){
                 return R.error("正在支付中...");
             }
 
@@ -3582,8 +3589,8 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
             return R.error("订单状态不正确");
         }
 
-        String orderId=redisCache.getCacheObject("isPaying:"+order.getId());
-        if(StringUtils.isNotEmpty(orderId)&&orderId.equals(order.getId().toString())){
+        Object isPaying =redisCache.getCacheObject("isPaying:"+order.getId());
+        if(ObjectUtil.isNotNull(isPaying)){
             return R.error("正在支付中...");
         }
         List<FsStorePayment>  payments=fsStorePaymentMapper.selectFsStorePaymentByOrder(order.getId());

+ 0 - 1
fs-user-app/src/main/java/com/fs/app/controller/StoreOrderController.java

@@ -129,7 +129,6 @@ public class StoreOrderController extends  AppBaseController {
     @Login
     @ApiOperation("支付")
     @PostMapping("/pay")
-    @RepeatSubmit(intervalTime = 3)
     public R pay(@Validated @RequestBody FsStoreOrderPayParam param)
     {
         Long orderId = param.getOrderId();

+ 4 - 2
fs-user-app/src/main/java/com/fs/app/websocket/service/WebSocketServer.java

@@ -127,6 +127,9 @@ public class WebSocketServer {
             sendMsgVo.setData(JSONObject.toJSONString(liveWatchUserVO));
             sendMsgVo.setNickName(fsUser.getNickname());
             sendMsgVo.setAvatar(fsUser.getAvatar());
+            // 广播连接消息
+            broadcastMessage(liveId, JSONObject.toJSONString(R.ok().put("data", sendMsgVo)));
+
             LiveUserFirstEntry liveUserFirstEntry = liveUserFirstEntryService.selectEntityByLiveIdUserId(liveId, userId);
             if (liveUserFirstEntry != null) {
                 // 处理第一次自己进入,第二次扫码销售进入
@@ -154,8 +157,7 @@ public class WebSocketServer {
                 liveUserFirstEntryService.insertLiveUserFirstEntry(liveUserFirstEntry);
             }
 
-            // 广播连接消息
-            broadcastMessage(liveId, JSONObject.toJSONString(R.ok().put("data", sendMsgVo)));
+
         } else {
             adminRoom.add(session);
         }