查询可使用抽取方案省分
This commit is contained in:
@ -54,5 +54,17 @@ public class BizFuncSwitchConfigController{
|
||||
|
||||
return BaseResponse.success(bizFuncSwitchConfig);
|
||||
}
|
||||
/**
|
||||
* 查询数据
|
||||
*
|
||||
* @param
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("查询可使用抽取方案省分")
|
||||
@GetMapping("/getAuthByProvince")
|
||||
public BaseResponse<Boolean> getAuthByProvince(@PathVariable String province){
|
||||
return BaseResponse.success(ibizFuncSwitchConfigService.getAuthByProvince(province));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -13,4 +13,8 @@ public interface IBizFuncSwitchConfigService extends IService<BizFuncSwitchConfi
|
||||
|
||||
|
||||
Integer selectByType(String type);
|
||||
|
||||
String getValueByKey(String key);
|
||||
|
||||
Boolean getAuthByProvince(String province);
|
||||
}
|
||||
|
@ -1,11 +1,18 @@
|
||||
package com.chinaunicom.mall.ebtp.extend.funcswitch.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
|
||||
import com.chinaunicom.mall.ebtp.extend.funcswitch.dao.BizFuncSwitchConfigMapper;
|
||||
import com.chinaunicom.mall.ebtp.extend.funcswitch.entity.BizFuncSwitchConfig;
|
||||
import com.chinaunicom.mall.ebtp.extend.funcswitch.service.IBizFuncSwitchConfigService;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 对数据表 biz_func_switch_config 操作的 serviceImpl
|
||||
* @auto.generated
|
||||
@ -21,4 +28,20 @@ public class BizFuncSwitchConfigServiceImpl extends ServiceImpl<BizFuncSwitchCon
|
||||
public Integer selectByType(String type){
|
||||
return funcSwitchConfigMapper.selectByType(type);
|
||||
}
|
||||
@Override
|
||||
public String getValueByKey(String key){
|
||||
return funcSwitchConfigMapper.getValueByKey(key);
|
||||
}
|
||||
@Override
|
||||
public Boolean getAuthByProvince(String province){
|
||||
String active =funcSwitchConfigMapper.getValueByKey("extractAuthProvince");
|
||||
if(StringUtils.isBlank(active)){
|
||||
return true;
|
||||
}
|
||||
List<String> provinceAuthList= Arrays.asList(active.split(","));
|
||||
if(provinceAuthList.contains(province)){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user