Browse Source

店铺加入规格, 处理商品新增规格没数据问题,药物加入规格字段

yjwang 2 tuần trước cách đây
mục cha
commit
29daf9d226

+ 4 - 0
fs-service/src/main/java/com/fs/hisStore/domain/FsPlatformProductScrm.java

@@ -610,4 +610,8 @@ public class FsPlatformProductScrm extends BaseEntity {
      */
      */
     private String storageConditions;
     private String storageConditions;
 
 
+    /**
+     * 规格
+     * **/
+    private String specification;
 }
 }

+ 5 - 0
fs-service/src/main/java/com/fs/hisStore/domain/FsStoreProductScrm.java

@@ -609,4 +609,9 @@ public class FsStoreProductScrm extends BaseEntity {
      */
      */
     private String storageConditions;
     private String storageConditions;
 
 
+    /**
+     * 规格
+     * **/
+    private String specification;
+
 }
 }

+ 8 - 0
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreProductScrmMapper.java

@@ -410,6 +410,10 @@ public interface FsStoreProductScrmMapper
             "and p.is_drug = #{maps.isDrug}" +
             "and p.is_drug = #{maps.isDrug}" +
             "</if>" +
             "</if>" +
 
 
+            "<if test = 'maps.productType != null    '> " +
+            "and p.product_type =#{maps.productType} " +
+            "</if>" +
+
             "<if test = 'maps.defaultOrder != null and maps.defaultOrder==\"desc\"  '> " +
             "<if test = 'maps.defaultOrder != null and maps.defaultOrder==\"desc\"  '> " +
             "order by p.sort desc,product_id desc" +
             "order by p.sort desc,product_id desc" +
             "</if>" +
             "</if>" +
@@ -680,6 +684,10 @@ public interface FsStoreProductScrmMapper
             "and p.is_drug = #{maps.isDrug}" +
             "and p.is_drug = #{maps.isDrug}" +
             "</if>" +
             "</if>" +
 
 
+            "<if test = 'maps.productType != null    '> " +
+            "and p.product_type =#{maps.productType} " +
+            "</if>" +
+
             "<if test = 'maps.defaultOrder != null and maps.defaultOrder==\"desc\"  '> " +
             "<if test = 'maps.defaultOrder != null and maps.defaultOrder==\"desc\"  '> " +
             "order by p.sort desc,product_id desc" +
             "order by p.sort desc,product_id desc" +
             "</if>" +
             "</if>" +

+ 5 - 0
fs-service/src/main/java/com/fs/hisStore/param/FsPlatFormProductAddEditParam.java

@@ -463,4 +463,9 @@ public class FsPlatFormProductAddEditParam {
      */
      */
     private String storageConditions;
     private String storageConditions;
 
 
+    /**
+     * 规格
+     * **/
+    private String specification;
+
 }
 }

+ 4 - 0
fs-service/src/main/java/com/fs/hisStore/param/FsStoreProductAddEditParam.java

@@ -408,5 +408,9 @@ public class FsStoreProductAddEditParam implements Serializable
      */
      */
     private String storageConditions;
     private String storageConditions;
 
 
+    /**
+     * 规格
+     * **/
+    private String specification;
 
 
 }
 }

+ 3 - 0
fs-service/src/main/java/com/fs/hisStore/param/FsStoreProductQueryParam.java

@@ -37,4 +37,7 @@ public class FsStoreProductQueryParam extends BaseQueryParam implements Serializ
     private Integer isStores;
     private Integer isStores;
 
 
     private Integer isGood;
     private Integer isGood;
+
+    //商铺类型
+    private Integer productType;
 }
 }

+ 14 - 5
fs-service/src/main/java/com/fs/hisStore/service/impl/FsPlatformProductScrmServiceImpl.java

@@ -31,6 +31,8 @@ import java.time.LocalDate;
 import java.time.format.DateTimeFormatter;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.*;
 import java.util.function.Consumer;
 import java.util.function.Consumer;
+import java.util.stream.Collectors;
+
 import com.fs.hisStore.util.FsProductUtils;
 import com.fs.hisStore.util.FsProductUtils;
 
 
 /**
 /**
@@ -309,7 +311,8 @@ public class FsPlatformProductScrmServiceImpl implements IFsPlatformProductScrmS
                     .build();
                     .build();
             List<ProductArrtDTO> items=new ArrayList<>();
             List<ProductArrtDTO> items=new ArrayList<>();
             items.add(fromatDetailDto);
             items.add(fromatDetailDto);
-            param.getValues().get(0).setSku(param.getUnitName());
+//            param.getValues().get(0).setSku(param.getUnitName());
+            param.getValues().get(0).setSku(param.getPrescribeSpec());
             addProductAttr(product.getProductId(),items, param.getValues(), storeId);
             addProductAttr(product.getProductId(),items, param.getValues(), storeId);
         } else {
         } else {
             addProductAttr(product.getProductId(), param.getItems(), param.getValues(), storeId);
             addProductAttr(product.getProductId(), param.getItems(), param.getValues(), storeId);
@@ -326,10 +329,12 @@ public class FsPlatformProductScrmServiceImpl implements IFsPlatformProductScrmS
     private void addProductAttr(Long productId, List<ProductArrtDTO> items, List<FsStoreProductAttrValueScrm> values,Long storeId){
     private void addProductAttr(Long productId, List<ProductArrtDTO> items, List<FsStoreProductAttrValueScrm> values,Long storeId){
         //清空attr
         //清空attr
         fsStoreProductAttrMapper.clear(productId);
         fsStoreProductAttrMapper.clear(productId);
-        //清空values
         //查出商品属性所有ID;
         //查出商品属性所有ID;
         List<FsStoreProductAttrValueScrm> attrValues=fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueByProductId(productId);
         List<FsStoreProductAttrValueScrm> attrValues=fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueByProductId(productId);
-        fsStoreProductAttrValueMapper.deleteFsStoreProductAttrValueByProductId(productId);
+        Map<Long,FsStoreProductAttrValueScrm> attrValueMap = null;
+        if(!attrValues.isEmpty()){
+            attrValueMap = attrValues.stream().collect(Collectors.toMap(a->a.getId(), v ->v));
+        }
         //写入attr
         //写入attr
         for(ProductArrtDTO vo:items){
         for(ProductArrtDTO vo:items){
             FsStoreProductAttrScrm attr=new FsStoreProductAttrScrm();
             FsStoreProductAttrScrm attr=new FsStoreProductAttrScrm();
@@ -348,11 +353,15 @@ public class FsPlatformProductScrmServiceImpl implements IFsPlatformProductScrmS
             if(val.getDetail()!=null){
             if(val.getDetail()!=null){
                 List<String> stringList = new ArrayList<>(val.getDetail().values());
                 List<String> stringList = new ArrayList<>(val.getDetail().values());
                 Collections.sort(stringList);
                 Collections.sort(stringList);
-                val.setSku(StrUtil.join(",",stringList));
+//                val.setSku(StrUtil.join(",",stringList));
             }
             }
             val.setProductId(productId);
             val.setProductId(productId);
             val.setStoreId(storeId);
             val.setStoreId(storeId);
-            fsStoreProductAttrValueMapper.insertFsStoreProductAttrValue(val);
+            if(attrValueMap != null && attrValueMap.containsKey(id)){
+                fsStoreProductAttrValueMapper.updateFsStoreProductAttrValue(val);
+            }else {
+                fsStoreProductAttrValueMapper.insertFsStoreProductAttrValue(val);
+            }
             if(attrValues!=null&&attrValues.size()>0){
             if(attrValues!=null&&attrValues.size()>0){
                 for(FsStoreProductAttrValueScrm attrValue:attrValues){
                 for(FsStoreProductAttrValueScrm attrValue:attrValues){
                     if(attrValue.getId().equals(id)){
                     if(attrValue.getId().equals(id)){

+ 12 - 5
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreProductScrmServiceImpl.java

@@ -622,7 +622,8 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
                     .build();
                     .build();
             List<ProductArrtDTO> items=new ArrayList<>();
             List<ProductArrtDTO> items=new ArrayList<>();
             items.add(fromatDetailDto);
             items.add(fromatDetailDto);
-            param.getValues().get(0).setSku(param.getUnitName());
+//            param.getValues().get(0).setSku(param.getUnitName());
+            param.getValues().get(0).setSku(param.getPrescribeSpec());
             addProductAttr(product.getProductId(),items, param.getValues(), storeId);
             addProductAttr(product.getProductId(),items, param.getValues(), storeId);
         } else {
         } else {
             addProductAttr(product.getProductId(), param.getItems(), param.getValues(), storeId);
             addProductAttr(product.getProductId(), param.getItems(), param.getValues(), storeId);
@@ -639,10 +640,12 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
 private void addProductAttr(Long productId, List<ProductArrtDTO> items, List<FsStoreProductAttrValueScrm> values,Long storeId){
 private void addProductAttr(Long productId, List<ProductArrtDTO> items, List<FsStoreProductAttrValueScrm> values,Long storeId){
         //清空attr
         //清空attr
         fsStoreProductAttrMapper.clear(productId);
         fsStoreProductAttrMapper.clear(productId);
-        //清空values
         //查出商品属性所有ID;
         //查出商品属性所有ID;
         List<FsStoreProductAttrValueScrm> attrValues=fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueByProductId(productId);
         List<FsStoreProductAttrValueScrm> attrValues=fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueByProductId(productId);
-        fsStoreProductAttrValueMapper.deleteFsStoreProductAttrValueByProductId(productId);
+        Map<Long,FsStoreProductAttrValueScrm> attrValueMap = null;
+        if(!attrValues.isEmpty()){
+            attrValueMap = attrValues.stream().collect(Collectors.toMap(a->a.getId(),v ->v));
+        }
         //写入attr
         //写入attr
         for(ProductArrtDTO vo:items){
         for(ProductArrtDTO vo:items){
             FsStoreProductAttrScrm attr=new FsStoreProductAttrScrm();
             FsStoreProductAttrScrm attr=new FsStoreProductAttrScrm();
@@ -661,11 +664,15 @@ private void addProductAttr(Long productId, List<ProductArrtDTO> items, List<FsS
             if(val.getDetail()!=null){
             if(val.getDetail()!=null){
                 List<String> stringList = new ArrayList<>(val.getDetail().values());
                 List<String> stringList = new ArrayList<>(val.getDetail().values());
                 Collections.sort(stringList);
                 Collections.sort(stringList);
-                val.setSku(StrUtil.join(",",stringList));
+//                val.setSku(StrUtil.join(",",stringList));
             }
             }
             val.setProductId(productId);
             val.setProductId(productId);
             val.setStoreId(storeId);
             val.setStoreId(storeId);
-            fsStoreProductAttrValueMapper.insertFsStoreProductAttrValue(val);
+            if(attrValueMap != null && attrValueMap.containsKey(id)){
+                fsStoreProductAttrValueMapper.updateFsStoreProductAttrValue(val);
+            }else {
+                fsStoreProductAttrValueMapper.insertFsStoreProductAttrValue(val);
+            }
             if(attrValues!=null&&attrValues.size()>0){
             if(attrValues!=null&&attrValues.size()>0){
                 for(FsStoreProductAttrValueScrm attrValue:attrValues){
                 for(FsStoreProductAttrValueScrm attrValue:attrValues){
                     if(attrValue.getId().equals(id)){
                     if(attrValue.getId().equals(id)){

+ 5 - 1
fs-service/src/main/resources/mapper/hisStore/FsPlatformProductScrmMapper.xml

@@ -98,6 +98,7 @@
         <result property="prodTechReqNo" column="prod_tech_req_no"/>
         <result property="prodTechReqNo" column="prod_tech_req_no"/>
         <result property="productStructure" column="product_structure"/>
         <result property="productStructure" column="product_structure"/>
         <result property="storageConditions" column="storage_conditions"/>
         <result property="storageConditions" column="storage_conditions"/>
+        <result property="specification" column="specification"/>
     </resultMap>
     </resultMap>
 
 
     <sql id="selectFsPlatFormProductVo">
     <sql id="selectFsPlatFormProductVo">
@@ -115,7 +116,7 @@
                voucher, voucher_start, voucher_end,
                voucher, voucher_start, voucher_end,
                gmp_auth, gmp_auth_start, gmp_auth_end,business_link,medical_device_code,
                gmp_auth, gmp_auth_start, gmp_auth_end,business_link,medical_device_code,
                is_business_permanent,is_license_permanent,is_certificate_permanent,is_gmp_auth_permanent, store_product_id,
                is_business_permanent,is_license_permanent,is_certificate_permanent,is_gmp_auth_permanent, store_product_id,
-               medical_reg_cert_no, registrant_info,prod_license_no,prod_tech_req_no,product_structure, storage_conditions
+               medical_reg_cert_no, registrant_info,prod_license_no,prod_tech_req_no,product_structure, storage_conditions,specification
         from fs_platform_product_scrm
         from fs_platform_product_scrm
     </sql>
     </sql>
 
 
@@ -424,6 +425,7 @@
             <if test="prodTechReqNo != null">prod_tech_req_no ,</if>
             <if test="prodTechReqNo != null">prod_tech_req_no ,</if>
             <if test="productStructure != null">product_structure ,</if>
             <if test="productStructure != null">product_structure ,</if>
             <if test="storageConditions != null">storage_conditions ,</if>
             <if test="storageConditions != null">storage_conditions ,</if>
+            <if test="specification != null">specification ,</if>
         </trim>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="productId != null and productId != ''">#{productId},</if>
             <if test="productId != null and productId != ''">#{productId},</if>
@@ -523,6 +525,7 @@
             <if test="prodTechReqNo != null">#{prodTechReqNo} ,</if>
             <if test="prodTechReqNo != null">#{prodTechReqNo} ,</if>
             <if test="productStructure != null">#{productStructure} ,</if>
             <if test="productStructure != null">#{productStructure} ,</if>
             <if test="storageConditions != null">#{storageConditions} ,</if>
             <if test="storageConditions != null">#{storageConditions} ,</if>
+            <if test="specification != null">#{specification} ,</if>
         </trim>
         </trim>
     </insert>
     </insert>
 
 
@@ -624,6 +627,7 @@
             <if test="prodTechReqNo != null and prodTechReqNo != ''"> prod_tech_req_no = #{prodTechReqNo},</if>
             <if test="prodTechReqNo != null and prodTechReqNo != ''"> prod_tech_req_no = #{prodTechReqNo},</if>
             <if test="productStructure != null">product_structure = #{productStructure},</if>
             <if test="productStructure != null">product_structure = #{productStructure},</if>
             <if test="storageConditions != null">storage_conditions = #{storageConditions},</if>
             <if test="storageConditions != null">storage_conditions = #{storageConditions},</if>
+            <if test="specification != null">specification = #{specification},</if>
         </trim>
         </trim>
         where product_id = #{productId}
         where product_id = #{productId}
     </update>
     </update>

+ 6 - 2
fs-service/src/main/resources/mapper/hisStore/FsStoreProductScrmMapper.xml

@@ -98,6 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="prodTechReqNo" column="prod_tech_req_no"/>
         <result property="prodTechReqNo" column="prod_tech_req_no"/>
         <result property="productStructure" column="product_structure"/>
         <result property="productStructure" column="product_structure"/>
         <result property="storageConditions" column="storage_conditions"/>
         <result property="storageConditions" column="storage_conditions"/>
+        <result property="specification" column="specification"/>
     </resultMap>
     </resultMap>
 
 
     <sql id="selectFsStoreProductVo">
     <sql id="selectFsStoreProductVo">
@@ -115,7 +116,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                voucher, voucher_start, voucher_end,
                voucher, voucher_start, voucher_end,
                gmp_auth, gmp_auth_start, gmp_auth_end,business_link,medical_device_code,
                gmp_auth, gmp_auth_start, gmp_auth_end,business_link,medical_device_code,
                is_business_permanent,is_license_permanent,is_certificate_permanent,is_gmp_auth_permanent,platform_product_id,
                is_business_permanent,is_license_permanent,is_certificate_permanent,is_gmp_auth_permanent,platform_product_id,
-               medical_reg_cert_no, registrant_info,prod_license_no,prod_tech_req_no,product_structure,storage_conditions
+               medical_reg_cert_no, registrant_info,prod_license_no,prod_tech_req_no,product_structure,storage_conditions,specification
                from fs_store_product_scrm
                from fs_store_product_scrm
     </sql>
     </sql>
 
 
@@ -336,7 +337,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="prodTechReqNo != null">prod_tech_req_no ,</if>
             <if test="prodTechReqNo != null">prod_tech_req_no ,</if>
             <if test="productStructure != null">product_structure ,</if>
             <if test="productStructure != null">product_structure ,</if>
             <if test="storageConditions != null">storage_conditions ,</if>
             <if test="storageConditions != null">storage_conditions ,</if>
-         </trim>
+            <if test="specification != null">specification ,</if>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="image != null and image != ''">#{image},</if>
             <if test="image != null and image != ''">#{image},</if>
             <if test="video != null and video != ''">#{video},</if>
             <if test="video != null and video != ''">#{video},</if>
@@ -434,6 +436,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="prodTechReqNo != null">#{prodTechReqNo} ,</if>
             <if test="prodTechReqNo != null">#{prodTechReqNo} ,</if>
             <if test="productStructure != null">#{productStructure} ,</if>
             <if test="productStructure != null">#{productStructure} ,</if>
             <if test="storageConditions != null">#{storageConditions} ,</if>
             <if test="storageConditions != null">#{storageConditions} ,</if>
+            <if test="specification != null">#{specification} ,</if>
          </trim>
          </trim>
     </insert>
     </insert>
 
 
@@ -535,6 +538,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="prodTechReqNo != null and prodTechReqNo != ''"> prod_tech_req_no = #{prodTechReqNo},</if>
             <if test="prodTechReqNo != null and prodTechReqNo != ''"> prod_tech_req_no = #{prodTechReqNo},</if>
             <if test="productStructure != null">product_structure = #{productStructure},</if>
             <if test="productStructure != null">product_structure = #{productStructure},</if>
             <if test="storageConditions != null">storage_conditions = #{storageConditions},</if>
             <if test="storageConditions != null">storage_conditions = #{storageConditions},</if>
+            <if test="specification != null">specification = #{specification},</if>
         </trim>
         </trim>
         where product_id = #{productId}
         where product_id = #{productId}
     </update>
     </update>

+ 61 - 61
fs-user-app/src/main/java/com/fs/app/redis/OrderExpireHandler.java

@@ -59,66 +59,66 @@ public class OrderExpireHandler {
     private IFsStoreOrderScrmService fsStoreOrderService;
     private IFsStoreOrderScrmService fsStoreOrderService;
 
 
 
 
-//    @Scheduled(fixedDelay = 60_000) // 每分钟跑一次
-//    public void handleUnpaidOrders() {
-//        // 全局锁:防止多实例同时执行任务(粒度粗,仅控制任务入口)
-//        RLock globalLock = redissonClient.getLock("order-expire-handler-global-lock");
-//        try {
-//            if (globalLock.tryLock(LOCK_WAIT_TIME, LOCK_LEASE_TIME, TimeUnit.SECONDS)) {
-//                LocalDateTime now = LocalDateTime.now();
-//                log.info("开始处理超时未支付订单,当前时间:{}", now);
-//
-//                // 获取配置时间
-//                String json = configService.selectConfigByKey("store.config");
-//                com.fs.store.config.StoreConfig config = JSONUtil.toBean(json, com.fs.store.config.StoreConfig.class);
-//                if (config == null || config.getUnPayTime() == null) {
-//                    log.error("未获取到门店配置,unPayTime为空");
-//                    return;
-//                }
-//
-//                // 查询所有待处理订单
-//                Map<String, Object> params = new HashMap<>(3);
-//                params.put("now", now);
-//                params.put("prescribeTimeoutMinutes", PRESCRIBE_TIMEOUT_MINUTES);
-//                params.put("unPayTime", config.getUnPayTime());
-//                List<FsStoreOrderScrm> orders = orderScrmMapper.selectTimeoutUnpaidOrders(params);
-//
-//                if (CollectionUtils.isEmpty(orders)) {
-//                    log.info("暂无超时未支付订单需要处理");
-//                    return;
-//                }
-//                log.info("共查询到{}个超时未支付订单,开始逐个处理", orders.size());
-//
-//                for (FsStoreOrderScrm order : orders) {
-//                    try {
-//                        processExpiredOrder(order);
-//                        log.info("订单{}处理完成,状态已更新为-3", order.getId());
-//                    } catch (Exception e) {
-//                        log.error("处理订单{}失败", order.getId(), e);
-//                        // 记录失败订单,可后续补偿
-//                        // failOrderService.recordFailOrder(order.getId(), "库存恢复失败:" + e.getMessage());
-//                    }
-//                }
-//            } else {
-//                log.warn("获取全局分布式锁失败,跳过本次订单处理");
-//            }
-//        } catch (InterruptedException e) {
-//            Thread.currentThread().interrupt();
-//            log.error("获取全局锁时线程中断", e);
-//        } finally {
-//            if (globalLock.isHeldByCurrentThread()) {
-//                globalLock.unlock();
-//            }
-//        }
-//    }
-//    @Transactional(rollbackFor = Exception.class)
-//    void processExpiredOrder(FsStoreOrderScrm order) {
-//        Long orderId = order.getId();
-//        if (orderId == null) {
-//            log.warn("订单ID为空,跳过处理");
-//            return;
-//        }
-//        fsStoreOrderService.cancelOrderReuse(order);
-//    }
+    @Scheduled(fixedDelay = 60_000) // 每分钟跑一次
+    public void handleUnpaidOrders() {
+        // 全局锁:防止多实例同时执行任务(粒度粗,仅控制任务入口)
+        RLock globalLock = redissonClient.getLock("order-expire-handler-global-lock");
+        try {
+            if (globalLock.tryLock(LOCK_WAIT_TIME, LOCK_LEASE_TIME, TimeUnit.SECONDS)) {
+                LocalDateTime now = LocalDateTime.now();
+                log.info("开始处理超时未支付订单,当前时间:{}", now);
+
+                // 获取配置时间
+                String json = configService.selectConfigByKey("store.config");
+                com.fs.store.config.StoreConfig config = JSONUtil.toBean(json, com.fs.store.config.StoreConfig.class);
+                if (config == null || config.getUnPayTime() == null) {
+                    log.error("未获取到门店配置,unPayTime为空");
+                    return;
+                }
+
+                // 查询所有待处理订单
+                Map<String, Object> params = new HashMap<>(3);
+                params.put("now", now);
+                params.put("prescribeTimeoutMinutes", PRESCRIBE_TIMEOUT_MINUTES);
+                params.put("unPayTime", config.getUnPayTime());
+                List<FsStoreOrderScrm> orders = orderScrmMapper.selectTimeoutUnpaidOrders(params);
+
+                if (CollectionUtils.isEmpty(orders)) {
+                    log.info("暂无超时未支付订单需要处理");
+                    return;
+                }
+                log.info("共查询到{}个超时未支付订单,开始逐个处理", orders.size());
+
+                for (FsStoreOrderScrm order : orders) {
+                    try {
+                        processExpiredOrder(order);
+                        log.info("订单{}处理完成,状态已更新为-3", order.getId());
+                    } catch (Exception e) {
+                        log.error("处理订单{}失败", order.getId(), e);
+                        // 记录失败订单,可后续补偿
+                        // failOrderService.recordFailOrder(order.getId(), "库存恢复失败:" + e.getMessage());
+                    }
+                }
+            } else {
+                log.warn("获取全局分布式锁失败,跳过本次订单处理");
+            }
+        } catch (InterruptedException e) {
+            Thread.currentThread().interrupt();
+            log.error("获取全局锁时线程中断", e);
+        } finally {
+            if (globalLock.isHeldByCurrentThread()) {
+                globalLock.unlock();
+            }
+        }
+    }
+    @Transactional(rollbackFor = Exception.class)
+    void processExpiredOrder(FsStoreOrderScrm order) {
+        Long orderId = order.getId();
+        if (orderId == null) {
+            log.warn("订单ID为空,跳过处理");
+            return;
+        }
+        fsStoreOrderService.cancelOrderReuse(order);
+    }
 
 
 }
 }