|
@@ -9,6 +9,7 @@ import com.dayou.service.IGlobalConfigService;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
import org.springframework.beans.factory.InitializingBean;
|
|
import org.springframework.beans.factory.InitializingBean;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -50,6 +51,8 @@ public class GlobalConfigServiceImpl extends ServiceImpl<GlobalConfigMapper, Glo
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private GlobalConfigMapper globalConfigMapper;
|
|
@Override
|
|
@Override
|
|
@SuppressWarnings("unchecked")
|
|
@SuppressWarnings("unchecked")
|
|
public Page<GlobalConfig> selectPage(Page page,GlobalConfig globalConfig){
|
|
public Page<GlobalConfig> selectPage(Page page,GlobalConfig globalConfig){
|
|
@@ -65,7 +68,7 @@ public class GlobalConfigServiceImpl extends ServiceImpl<GlobalConfigMapper, Glo
|
|
@Override
|
|
@Override
|
|
public Boolean add(GlobalConfig globalConfig){
|
|
public Boolean add(GlobalConfig globalConfig){
|
|
GlobalConfig config = this.getOne(new LambdaQueryWrapper<GlobalConfig>()
|
|
GlobalConfig config = this.getOne(new LambdaQueryWrapper<GlobalConfig>()
|
|
- .eq(GlobalConfig::getName, globalConfig.getName())
|
|
|
|
|
|
+ .eq(GlobalConfig::getKey, globalConfig.getKey())
|
|
.eq(GlobalConfig::getField, globalConfig.getField())
|
|
.eq(GlobalConfig::getField, globalConfig.getField())
|
|
.eq(BaseEntity::getDeleted, Boolean.FALSE));
|
|
.eq(BaseEntity::getDeleted, Boolean.FALSE));
|
|
|
|
|
|
@@ -88,6 +91,11 @@ public class GlobalConfigServiceImpl extends ServiceImpl<GlobalConfigMapper, Glo
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
+ public String getValue(String key, String field) {
|
|
|
|
+ return globalConfigMapper.getValueByKeyFiled(key,field);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
public void afterPropertiesSet() throws Exception {
|
|
public void afterPropertiesSet() throws Exception {
|
|
|
|
|
|
List<GlobalConfig> list = Lists.newLinkedList();
|
|
List<GlobalConfig> list = Lists.newLinkedList();
|
|
@@ -100,7 +108,7 @@ public class GlobalConfigServiceImpl extends ServiceImpl<GlobalConfigMapper, Glo
|
|
String field = c.getCode();
|
|
String field = c.getCode();
|
|
String description = c.getMsg();
|
|
String description = c.getMsg();
|
|
GlobalConfig g = new GlobalConfig();
|
|
GlobalConfig g = new GlobalConfig();
|
|
- g.setName(key);
|
|
|
|
|
|
+ g.setKey(key);
|
|
g.setField(field);
|
|
g.setField(field);
|
|
g.setDescription(description);
|
|
g.setDescription(description);
|
|
fieldList.add(g);
|
|
fieldList.add(g);
|