Commit 021224fa by guojuxing

门店启用权重设置

parent 454329ca
......@@ -130,6 +130,17 @@ public interface StoreStrategyApiService {
ServiceResponse<Void> setStoreGroupStrategyWeight(Integer enterpriseId, int weight);
/**
* 门店启用策略:人为操作更改过门店启用状态后,门店资料更新不再执行启用状态策略
* @Title: setStoreEnableStrategyWeight

* @Description:

* @author guojuxing
* @param enterpriseId
* @param weight
1:勾选 0:不勾选
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>


*/
ServiceResponse<Void> setStoreStatusEnableStrategyWeight(Integer enterpriseId, int weight);
/**
* 获取门店分组策略权重
* @Title: getStoreGroupStrategyWeight

* @Description:
......@@ -140,6 +151,16 @@ public interface StoreStrategyApiService {
ServiceResponse<Integer> getStoreGroupStrategyWeight(Integer enterpriseId);
/**
* 获取门店启用策略:人为操作更改过门店启用状态后,门店资料更新不再执行启用状态策略
* @Title: getStoreStatusEnableStrategyWeight

* @Description:

* @author guojuxing
* @param enterpriseId

* @return com.gic.api.base.commons.ServiceResponse<java.lang.Integer>


*/
ServiceResponse<Integer> getStoreStatusEnableStrategyWeight(Integer enterpriseId);
/**
* 重置门店策略
* @Title: resetStoreGroupStrategy

* @Description:
......
......@@ -223,6 +223,12 @@ public class StoreStrategyApiServiceImpl implements StoreStrategyApiService{
}
@Override
public ServiceResponse<Void> setStoreStatusEnableStrategyWeight(Integer enterpriseId, int weight) {
RedisUtil.setCache("enterprise:store:storeStatusEnableStrategy:"+enterpriseId, weight);
return ServiceResponse.success();
}
@Override
public ServiceResponse getStoreGroupStrategyWeight(Integer enterpriseId) {
Object value = RedisUtil.getCache("enterprise:store:storeGroupStrategy:"+enterpriseId);
if(value == null){
......@@ -231,6 +237,15 @@ public class StoreStrategyApiServiceImpl implements StoreStrategyApiService{
return ServiceResponse.success(Integer.valueOf(value.toString()));
}
@Override
public ServiceResponse<Integer> getStoreStatusEnableStrategyWeight(Integer enterpriseId) {
Object value = RedisUtil.getCache("enterprise:store:storeStatusEnableStrategy:"+enterpriseId);
if(value == null){
return ServiceResponse.success(0);
}
return ServiceResponse.success(Integer.valueOf(value.toString()));
}
@Override
public ServiceResponse<String> resetStoreGroupStrategy(List<Integer> regionIdList, List<Integer> storeStatusList) {
......
......@@ -254,6 +254,24 @@ public class StoreStrategyController {
return RestResponse.success(result.getResult());
}
@RequestMapping("/update-store-status-enabble-strategy-weights")
public RestResponse setStoreStatusEnableStrategyWeight(Integer weight) {
if (weight == null) {
return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "参数错误");
}
ServiceResponse result = storeStrategyApiService.setStoreStatusEnableStrategyWeight(
UserDetailUtils.getUserDetail().getEnterpriseInfo().getEnterpriseId(), weight);
return OperationResultUtils.operationResult(result, "设置门店分组策略权重",
UserDetailUtils.getUserDetail().getEnterpriseInfo().getEnterpriseName());
}
@RequestMapping("/get-store-status-enable-strategy-weights")
public RestResponse getStoreStatusEnableStrategyWeight() {
ServiceResponse<Integer> result = storeStrategyApiService
.getStoreStatusEnableStrategyWeight(UserDetailUtils.getUserDetail().getEnterpriseInfo().getEnterpriseId());
return RestResponse.success(result.getResult());
}
private StoreStrategyDTO transferQoToDTO(StoreStrategyQO storeStrategyQO) {
StoreStrategyDTO storeStrategyDTO = EntityUtil.changeEntityNew(StoreStrategyDTO.class, storeStrategyQO);
storeStrategyDTO.setEnterpriseId(UserDetailUtils.getUserDetail().getEnterpriseInfo().getEnterpriseId());
......
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