fix 店铺统计的bug
This commit is contained in:
parent
6df346f3f7
commit
ecaebfe229
@ -137,9 +137,8 @@
|
||||
<artifactId>javacv</artifactId>
|
||||
<version>1.5.6</version>
|
||||
</dependency>
|
||||
<!-- 引入常用windows和linux平台 其他平台用到时在引入 -->
|
||||
|
||||
<!-- JavaCV库 -->
|
||||
<!-- JavaCV库 -->
|
||||
<dependency>
|
||||
<groupId>org.bytedeco</groupId>
|
||||
<artifactId>javacv-platform</artifactId>
|
||||
@ -152,25 +151,6 @@
|
||||
<version>4.4-1.5.6</version>
|
||||
</dependency>
|
||||
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.bytedeco</groupId>-->
|
||||
<!-- <artifactId>ffmpeg</artifactId>-->
|
||||
<!-- <version>4.4-1.5.6</version>-->
|
||||
<!-- <classifier>windows-x86_64</classifier>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.bytedeco</groupId>-->
|
||||
<!-- <artifactId>ffmpeg</artifactId>-->
|
||||
<!-- <version>4.4-1.5.6</version>-->
|
||||
<!-- <classifier>linux-x86_64</classifier>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <!– 添加 macOS 平台支持 –>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.bytedeco</groupId>-->
|
||||
<!-- <artifactId>ffmpeg</artifactId>-->
|
||||
<!-- <version>4.4-1.5.6</version>-->
|
||||
<!-- <classifier>macosx-x86_64</classifier>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- rabbitMQ消息队列 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
||||
@ -103,15 +103,24 @@ public class ShopStoreAnalyticsServiceImpl extends BaseServiceImpl<ShopStoreAnal
|
||||
@Override
|
||||
public boolean saveProductAnalyticsNum(Integer store_id) {
|
||||
|
||||
ShopStoreAnalytics analytics = new ShopStoreAnalytics();
|
||||
long store_product_new_num = shopProductBaseService.getProductNum(StateCode.PRODUCT_STATE_NORMAL, store_id, -30, null);
|
||||
long store_product_num = shopProductBaseService.getProductNum(StateCode.PRODUCT_STATE_NORMAL, store_id, null, null);
|
||||
|
||||
ShopStoreAnalytics analytics = new ShopStoreAnalytics();
|
||||
analytics.setStore_id(store_id);
|
||||
analytics.setStore_product_new_num(store_product_new_num);
|
||||
analytics.setStore_product_num(store_product_num);
|
||||
|
||||
return saveOrUpdate(analytics);
|
||||
// 先尝试查询是否存在记录
|
||||
ShopStoreAnalytics existingAnalytics = getById(store_id);
|
||||
|
||||
if (existingAnalytics != null) {
|
||||
// 如果记录存在,使用updateById更新
|
||||
return updateById(analytics);
|
||||
} else {
|
||||
// 如果记录不存在,使用insert插入
|
||||
return save(analytics);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -3046,17 +3046,17 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
params.put("countyId", countyId);
|
||||
params.put("userLng", userLng);
|
||||
params.put("userLat", userLat);
|
||||
List<Integer> storeCategoryIds=new ArrayList<>();
|
||||
List<Integer> storeCategoryIds = new ArrayList<>();
|
||||
QueryWrapper<ShopBaseStoreCategory> storeCategoryQueryWrapper = new QueryWrapper<>();
|
||||
storeCategoryQueryWrapper.eq("store_category_parent_id",storeCategoryId);
|
||||
List<ShopBaseStoreCategory> shopBaseStoreCategories= shopBaseStoreCategoryService.list(storeCategoryQueryWrapper);
|
||||
if(!shopBaseStoreCategories.isEmpty()){
|
||||
storeCategoryQueryWrapper.eq("store_category_parent_id", storeCategoryId);
|
||||
List<ShopBaseStoreCategory> shopBaseStoreCategories = shopBaseStoreCategoryService.list(storeCategoryQueryWrapper);
|
||||
if (!shopBaseStoreCategories.isEmpty()) {
|
||||
storeCategoryIds.add(storeCategoryId);
|
||||
shopBaseStoreCategories.forEach(shopBaseStoreCategory -> {
|
||||
storeCategoryIds.add(shopBaseStoreCategory.getStore_category_id());
|
||||
});
|
||||
params.put("storeCategoryIds", storeCategoryIds);
|
||||
}else {
|
||||
} else {
|
||||
params.put("storeCategoryId", storeCategoryId);
|
||||
}
|
||||
|
||||
@ -3333,12 +3333,9 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
// 注意:关联店铺到用户,给用户增加店铺管理员权限
|
||||
initStoreExtraInfo(userId, storeId);
|
||||
|
||||
// 更改店铺Id
|
||||
// 更改店铺Id和状态
|
||||
shopMchEntryService.updateMerchEntryStoreId(shopMchEntry.getId(), storeId);
|
||||
|
||||
// 初始化同城配送默认设置
|
||||
// storeSameCityTransportBaseService.initDefaultSameCityTransport(storeId);
|
||||
|
||||
// 立即创建顺丰店铺,附带初始化同城配送默认设置
|
||||
String[] areaNames = StrUtil.isNotBlank(shopMchEntry.getStore_area()) ? shopMchEntry.getStore_area().split("/") : new String[0];
|
||||
String cityName = areaNames.length > 0 ? areaNames[areaNames.length - 1] : shopMchEntry.getStore_area().replace("/", "");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user