Commit 2bdf9782 by 陶光胜

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-store into developer

parents 40dc3c08 3c776c97
......@@ -31,6 +31,7 @@ import org.apache.logging.log4j.Logger;
import org.redisson.api.RKeys;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -47,6 +48,8 @@ import java.util.stream.Collectors;
public class StoreApiServiceImpl implements StoreApiService {
private static final Logger logger = LogManager.getLogger(StoreApiServiceImpl.class);
private static Map<Integer, BulkUpdateStoreStrtegy> storeStrtegyMap = new HashMap<>();
@Value("${storeExpiredTime}")
private Long storeExpiredTime;
@Autowired
private StoreService storeService;
@Autowired
......@@ -151,7 +154,7 @@ public class StoreApiServiceImpl implements StoreApiService {
storeBusinessTimeService.editStoreBusinessTime(storeDTO.getEnterpriseId(), storeDTO.getStoreInfoId(), storeDTO.getBusinessTimeList(), delBusinessTimes);
// 更新缓存
refreshCache(storeDTO.getEnterpriseId(), storeDTO.getStoreInfoId());
refreshCache(storeDTO.getEnterpriseId(), storeDTO.getStoreId());
return ServiceResponse.success();
}
......@@ -160,7 +163,7 @@ public class StoreApiServiceImpl implements StoreApiService {
return null;
}
List<TabStoreBrand> storeBrandList = storeBrandService.listStoreBrandByIds(brandIds);
if (CollectionUtils.isNotEmpty(storeBrandList) || brandIds.split(GlobalInfo.FLAG_COMMA).length > storeBrandList.size()) {
if (CollectionUtils.isEmpty(storeBrandList) || brandIds.split(GlobalInfo.FLAG_COMMA).length > storeBrandList.size()) {
return "品牌不存在";
}
return null;
......@@ -192,7 +195,7 @@ public class StoreApiServiceImpl implements StoreApiService {
* @return
*/
private String getGroup(StoreDTO storeDTO) {
if (Integer.valueOf(1) == storeStrategyApiService.getStoreGroupStrategyWeight(storeDTO.getEnterpriseId()).getResult() && storeDTO.getIsEditStoreGroup() == 1) {
if (storeDTO.getIsEditStoreGroup() == 1 || Integer.valueOf(0).equals(storeStrategyApiService.getStoreGroupStrategyWeight(storeDTO.getEnterpriseId()).getResult())) {
// 不启用分组策略
if (storeDTO.getStoreGroupId() == null) {
// 取 未分类 分组
......@@ -355,7 +358,7 @@ public class StoreApiServiceImpl implements StoreApiService {
return ServiceResponse.failure(ErrorCode.NOTEXISTS.getCode(), ErrorCode.NOTEXISTS.getMsg());
}
// todo 修改门店缓存时间
RedisUtil.setCache(key, storeDTO, 1L, TimeUnit.HOURS);
RedisUtil.setCache(key, storeDTO, storeExpiredTime, TimeUnit.HOURS);
}
return ServiceResponse.success(storeDTO);
}
......
dubbo.registry.file=gic-store-service
\ No newline at end of file
dubbo.registry.file=gic-store-service
# 门店详情过期时间 单位:小时
storeExpiredTime=1
\ No newline at end of file
......@@ -2,26 +2,18 @@ package com.gic.store.web.controller;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.GlobalInfo;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.utils.UserDetailUtils;
import com.gic.store.dto.ClerkDTO;
import com.gic.store.dto.ClerkSearchDTO;
import com.gic.store.service.ClerkApiService;
import com.gic.store.web.qo.PageQO;
import com.gic.store.web.qo.clerk.ClerkQO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* @author zhiwj
* @date 2019/7/16
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment