Bladeren bron

fix(store): 优化门店审核状态更新逻辑

- 将审核通过和拒绝的状态更新提取为独立方法调用
- 移除直接操作storeInfo对象并手动更新数据库的代码
- 统一通过approveStoreInfo方法处理不同审核结果
- 保留对未知状态的日志记录
- 避免重复的storeInfoMapper.updateById调用
Lhaibo 1 week geleden
bovenliggende
commit
6c10019b7a

+ 2 - 3
alien-store/src/main/java/shop/alien/store/service/impl/StoreInfoServiceImpl.java

@@ -2424,13 +2424,12 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
                             .eq(StoreInfo::getCreatedUserId, aiApproveStoreInfo.getUserId()).eq(StoreInfo::getStoreApplicationStatus, 0).eq(StoreInfo::getDeleteFlag, 0));
                     for (StoreInfo storeInfo : storeInfos) {
                         if ("approved".equals(data.getString("status"))) {
-                            storeInfo.setStoreApplicationStatus(1);
+                            approveStoreInfo(storeInfo.getId().toString(),1, "审核通过");
                         } else if ("rejected".equals(data.getString("status"))) {
-                            storeInfo.setStoreApplicationStatus(2);
+                            approveStoreInfo(storeInfo.getId().toString(),2, data.getString("audit_summary"));
                         } else {
                             System.out.println("未知状态");
                         }
-                        storeInfoMapper.updateById(storeInfo);
                     }
                 } else {
                     throw new RuntimeException("AI门店审核接口调用失败 code:" + jsonObject.getInteger("code"));