Commit 72daf8d1 by zhiwj

修改bug

parent 69d9c675
......@@ -27,7 +27,6 @@ import com.gic.store.dto.*;
import com.gic.store.entity.*;
import com.gic.store.service.*;
import com.gic.store.strategy.BulkUpdateStoreStrtegy;
import com.gic.store.strategy.impl.*;
import com.gic.store.utils.field.*;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -41,7 +40,11 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
......@@ -53,7 +56,6 @@ import java.util.stream.Collectors;
@SuppressWarnings("unchecked")
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
......@@ -93,14 +95,12 @@ public class StoreApiServiceImpl implements StoreApiService {
@Autowired
private StoreWidgetService storeWidgetService;
static {
storeStrtegyMap.put(1, new StoreStatusStrategyImpl());
storeStrtegyMap.put(2, new StorePhoneStategyImpl());
storeStrtegyMap.put(3, new StoreBusinessTimeStrategyImpl());
storeStrtegyMap.put(4, new StorePhotoUpdateStrategyImpl());
storeStrtegyMap.put(5, new StoreBrandUpdateStrategyImpl());
storeStrtegyMap.put(6, new StorePhotoAddStrategyImpl());
storeStrtegyMap.put(7, new StoreGroupStrategyImpl());
private Map<String, BulkUpdateStoreStrtegy> storeStrtegyMap = new ConcurrentHashMap<>();
@Autowired
public StoreApiServiceImpl(Map<String, BulkUpdateStoreStrtegy> strategyMap) {
this.storeStrtegyMap.clear();
this.storeStrtegyMap.putAll(strategyMap);
}
@Override
......@@ -718,7 +718,7 @@ public class StoreApiServiceImpl implements StoreApiService {
if (StringUtils.isBlank(storeInfoIds)) {
return ServiceResponse.success();
}
i = storeStrtegyMap.get(type).bulkUpdateStore(storeInfoIds, enterpriseId, value, storeService, operatorId, operatorName);
i = storeStrtegyMap.get(type+"").bulkUpdateStore(storeInfoIds, enterpriseId, value, storeService, operatorId, operatorName);
List<Integer> storeIdList = new ArrayList<>();
if ("all".equals(storeIds)) {
this.removeCache(enterpriseId);
......@@ -737,7 +737,7 @@ public class StoreApiServiceImpl implements StoreApiService {
}
}
} catch (Exception e) {
logger.error(e.getMessage());
logger.error("", e);
}
return ServiceResponse.success();
......
......@@ -13,7 +13,7 @@ import java.util.Collections;
import java.util.List;
import java.util.Optional;
@Component
@Component("5")
public class StoreBrandUpdateStrategyImpl implements BulkUpdateStoreStrtegy {
@Autowired
......
......@@ -16,7 +16,7 @@ import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@Component
@Component("3")
public class StoreBusinessTimeStrategyImpl implements BulkUpdateStoreStrtegy {
@Autowired
......
......@@ -11,7 +11,7 @@ import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
@Component
@Component("7")
public class StoreGroupStrategyImpl implements BulkUpdateStoreStrtegy {
@Autowired
......
......@@ -9,7 +9,7 @@ import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
@Component
@Component("2")
public class StorePhoneStategyImpl implements BulkUpdateStoreStrtegy {
@Autowired
......
......@@ -9,7 +9,7 @@ import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
@Component
@Component("6")
public class StorePhotoAddStrategyImpl implements BulkUpdateStoreStrtegy {
@Autowired
......
......@@ -8,7 +8,7 @@ import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
@Component
@Component("4")
public class StorePhotoUpdateStrategyImpl implements BulkUpdateStoreStrtegy {
@Autowired
......
......@@ -10,7 +10,7 @@ import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
@Component
@Component("1")
public class StoreStatusStrategyImpl implements BulkUpdateStoreStrtegy {
@Autowired
......@@ -18,7 +18,7 @@ public class StoreStatusStrategyImpl implements BulkUpdateStoreStrtegy {
@Override
public int bulkUpdateStore(String storeIds, Integer enterpriseId, String value, StoreService storeService, Integer operatorId, String operatorName) {
int i = storeService.bulkUpdateStoreStatus(storeIds, enterpriseId, value);
int i = storeService.bulkUpdateStoreStatus(storeIds, enterpriseId, value);
if (i > 0) {
List<Integer> storeIdList;
if ("all".equals(storeIds)) {
......
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