Merge branch 'develop' of http://10.0.6.99/gwall/gwall.git into develop
This commit is contained in:
@@ -0,0 +1,190 @@
|
||||
package com.nis.web.service.configuration;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.web.dao.configuration.ComplexStringCfgDao;
|
||||
import com.nis.web.service.CrudService;
|
||||
|
||||
/**
|
||||
* String相关配置事务类
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
public class ComplexStringCfgService extends CrudService<ComplexStringCfgDao,ComplexkeywordCfg> {
|
||||
@Autowired
|
||||
protected ComplexStringCfgDao complexStringCfgDao;
|
||||
/**
|
||||
*
|
||||
* addStringCfg(新增IP类配置)
|
||||
* (继承ComplexkeywordCfg这个类方可使用)
|
||||
* @param cfg
|
||||
* @return
|
||||
*int
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
|
||||
public int addStringCfg(ComplexkeywordCfg cfg){
|
||||
if(!StringUtils.isBlank(cfg.getTableName())){
|
||||
return complexStringCfgDao.insert(cfg);
|
||||
}else{
|
||||
String tableName=getTableName(cfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return 0;
|
||||
cfg.setTableName(tableName);
|
||||
logger.info("save "+tableName);
|
||||
return complexStringCfgDao.insert(cfg);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
*
|
||||
* updateStringCfg(更新IP类配置)
|
||||
* (继承ComplexkeywordCfg这个类方可使用)
|
||||
* @param cfg
|
||||
* @return
|
||||
*int
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
|
||||
public int updateStringCfg(ComplexkeywordCfg cfg){
|
||||
if(!StringUtils.isBlank(cfg.getTableName())){
|
||||
return complexStringCfgDao.updateByPrimaryKeySelective(cfg);
|
||||
}else{
|
||||
String tableName=getTableName(cfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return 0;
|
||||
cfg.setTableName(tableName);
|
||||
logger.info("update "+tableName);
|
||||
return complexStringCfgDao.updateByPrimaryKeySelective(cfg);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
*
|
||||
* auditStringCfg(审核IP类配置)
|
||||
* (继承ComplexkeywordCfg这个类方可使用)
|
||||
* @param cfg
|
||||
* @return
|
||||
*int
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
|
||||
public int auditStringCfg(ComplexkeywordCfg cfg){
|
||||
if(!StringUtils.isBlank(cfg.getTableName())){
|
||||
return complexStringCfgDao.audit(cfg);
|
||||
}else{
|
||||
String tableName=getTableName(cfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return 0;
|
||||
cfg.setTableName(tableName);
|
||||
logger.info("aduit "+tableName);
|
||||
return complexStringCfgDao.audit(cfg);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
*
|
||||
* deleteStringCfg(删除IP类配置)
|
||||
* (继承ComplexkeywordCfg这个类方可使用)
|
||||
* @param cfg
|
||||
* @return
|
||||
*int
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
|
||||
public int deleteStringCfg(ComplexkeywordCfg cfg){
|
||||
if(!StringUtils.isBlank(cfg.getTableName())){
|
||||
return complexStringCfgDao.updateValid(cfg);
|
||||
}else{
|
||||
String tableName=getTableName(cfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return 0;
|
||||
cfg.setTableName(tableName);
|
||||
logger.info("delete "+tableName);
|
||||
return complexStringCfgDao.updateValid(cfg);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
*
|
||||
* getStringCfg(根据IP与类名获取IP配置)
|
||||
* (继承ComplexkeywordCfg这个类方可使用)
|
||||
* @param clazz
|
||||
* @param id
|
||||
* @return
|
||||
*ComplexkeywordCfg
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public ComplexkeywordCfg getStringCfgById(Class<?> clazz,long id){
|
||||
String tableName=getTableName(clazz.getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return null;
|
||||
logger.info("get "+tableName);
|
||||
return complexStringCfgDao.getById(tableName, id);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* getStringCfg(根据IP与类名获取IP配置)
|
||||
* (继承ComplexkeywordCfg这个类方可使用)
|
||||
* @param clazz
|
||||
* @param id
|
||||
* @return
|
||||
*ComplexkeywordCfg
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public ComplexkeywordCfg getStringCfgById(ComplexkeywordCfg cfg){
|
||||
if(!StringUtils.isBlank(cfg.getTableName())){
|
||||
return complexStringCfgDao.get(cfg);
|
||||
}else{
|
||||
String tableName=getTableName(cfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return null;
|
||||
cfg.setTableName(tableName);
|
||||
logger.info("get "+tableName);
|
||||
return complexStringCfgDao.get(cfg);
|
||||
}
|
||||
|
||||
}
|
||||
public Integer getIsValid(ComplexkeywordCfg cfg){
|
||||
if(!StringUtils.isBlank(cfg.getTableName())){
|
||||
return complexStringCfgDao.getIsValid(cfg);
|
||||
}else{
|
||||
String tableName=getTableName(cfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return null;
|
||||
cfg.setTableName(tableName);
|
||||
return complexStringCfgDao.getIsValid(cfg);
|
||||
}
|
||||
|
||||
}
|
||||
public Integer getIsValid(String tableName, long id){
|
||||
return complexStringCfgDao.getIsValid(tableName,id);
|
||||
}
|
||||
public Integer getIsAudit(ComplexkeywordCfg cfg){
|
||||
if(!StringUtils.isBlank(cfg.getTableName())){
|
||||
return complexStringCfgDao.getIsAudit(cfg);
|
||||
}else{
|
||||
String tableName=getTableName(cfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return null;
|
||||
cfg.setTableName(tableName);
|
||||
return complexStringCfgDao.getIsAudit(cfg);
|
||||
}
|
||||
|
||||
}
|
||||
public Integer getIsAudit(String tableName, long id){
|
||||
return complexStringCfgDao.getIsAudit(tableName,id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.nis.web.service.configuration;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.nis.domain.configuration.NumBoundaryCfg;
|
||||
import com.nis.web.dao.configuration.NumCfgDao;
|
||||
import com.nis.web.service.CrudService;
|
||||
|
||||
/**
|
||||
* Num相关配置事务类
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
public class NumCfgService extends CrudService<NumCfgDao,NumBoundaryCfg> {
|
||||
@Autowired
|
||||
protected NumCfgDao numCfgDao;
|
||||
/**
|
||||
*
|
||||
* addNumCfg(新增IP类配置)
|
||||
* (继承NumBoundaryCfg这个类方可使用)
|
||||
* @param cfg
|
||||
* @return
|
||||
*int
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
|
||||
public int addNumCfg(NumBoundaryCfg cfg){
|
||||
return numCfgDao.insert(cfg);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* updateNumCfg(更新IP类配置)
|
||||
* (继承NumBoundaryCfg这个类方可使用)
|
||||
* @param cfg
|
||||
* @return
|
||||
*int
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
|
||||
public int updateNumCfg(NumBoundaryCfg cfg){
|
||||
return numCfgDao.updateByPrimaryKeySelective(cfg);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* auditNumCfg(审核IP类配置)
|
||||
* (继承NumBoundaryCfg这个类方可使用)
|
||||
* @param cfg
|
||||
* @return
|
||||
*int
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
|
||||
public int auditNumCfg(NumBoundaryCfg cfg){
|
||||
return numCfgDao.audit(cfg);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* deleteNumCfg(删除IP类配置)
|
||||
* (继承NumBoundaryCfg这个类方可使用)
|
||||
* @param cfg
|
||||
* @return
|
||||
*int
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
|
||||
public int deleteNumCfg(NumBoundaryCfg cfg){
|
||||
return numCfgDao.updateValid(cfg);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* getNumCfg(根据IP与类名获取IP配置)
|
||||
* (继承NumBoundaryCfg这个类方可使用)
|
||||
* @param clazz
|
||||
* @param id
|
||||
* @return
|
||||
*NumBoundaryCfg
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public NumBoundaryCfg getNumCfgById(long id){
|
||||
return numCfgDao.getById(id);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* getNumCfg(根据IP与类名获取IP配置)
|
||||
* (继承NumBoundaryCfg这个类方可使用)
|
||||
* @param clazz
|
||||
* @param id
|
||||
* @return
|
||||
*NumBoundaryCfg
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public NumBoundaryCfg getNumCfgById(NumBoundaryCfg cfg){
|
||||
return numCfgDao.get(cfg);
|
||||
}
|
||||
public Integer getIsValid(NumBoundaryCfg cfg){
|
||||
return numCfgDao.getIsValid(cfg);
|
||||
}
|
||||
public Integer getIsValid(long id){
|
||||
return numCfgDao.getIsValid(id);
|
||||
}
|
||||
public Integer getIsAudit(NumBoundaryCfg cfg){
|
||||
return numCfgDao.getIsAudit(cfg);
|
||||
}
|
||||
public Integer getIsAudit(long id){
|
||||
return numCfgDao.getIsAudit(id);
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.SysMenu;
|
||||
import com.nis.domain.SysUser;
|
||||
import com.nis.domain.configuration.ServiceDictInfo;
|
||||
import com.nis.util.Constants;
|
||||
@@ -23,40 +24,51 @@ public class ServiceDictInfoService extends BaseService{
|
||||
private ServiceDictInfoDao serviceDictInfoDao;
|
||||
|
||||
/**
|
||||
* 查询分类性质字典分页
|
||||
* 查询分类性质字典分页(无条件查询)
|
||||
* @param page
|
||||
* @param serviceDictInfo
|
||||
* @return
|
||||
*/
|
||||
public Page<ServiceDictInfo> findDictList(Page<ServiceDictInfo> page, ServiceDictInfo serviceDictInfo) {
|
||||
public Page<ServiceDictInfo> findTopDictList(Page<ServiceDictInfo> page, ServiceDictInfo serviceDictInfo) {
|
||||
// 设置分页参数
|
||||
serviceDictInfo.setPage(page);
|
||||
// 执行分页查询
|
||||
List<ServiceDictInfo> list = Lists.newArrayList();
|
||||
List<ServiceDictInfo> sourcelist = serviceDictInfoDao.findDictList(serviceDictInfo);
|
||||
ServiceDictInfo.sortList(list, sourcelist, 0l, true);
|
||||
page.setList(sourcelist);
|
||||
//查出顶层分页查询
|
||||
List<ServiceDictInfo> parentList = serviceDictInfoDao.findTopDictList(serviceDictInfo);
|
||||
page.setList(parentList);
|
||||
return page;
|
||||
}
|
||||
/**
|
||||
* 查询所有有效字典配置
|
||||
* @return
|
||||
*/
|
||||
public List<ServiceDictInfo> findAllDictList() {
|
||||
|
||||
return serviceDictInfoDao.findAllDictList(new ServiceDictInfo());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询标签分页
|
||||
* 查询所有的非叶子配置
|
||||
*/
|
||||
public List<ServiceDictInfo> findAllNoLeafDictList() {
|
||||
return serviceDictInfoDao.findAllNoLeafDictList();
|
||||
}
|
||||
/**
|
||||
* 查询分类性质字典分页(含条件查询)
|
||||
* @param page
|
||||
* @param serviceDictInfo
|
||||
* @return
|
||||
*/
|
||||
public Page<ServiceDictInfo> findDictMarkList(Page<ServiceDictInfo> page, ServiceDictInfo serviceDictInfo) {
|
||||
public Page<ServiceDictInfo> findDictSearchList(Page<ServiceDictInfo> page, ServiceDictInfo serviceDictInfo) {
|
||||
// 设置分页参数
|
||||
serviceDictInfo.setPage(page);
|
||||
// 执行分页查询
|
||||
List<ServiceDictInfo> list = Lists.newArrayList();
|
||||
List<ServiceDictInfo> sourcelist = serviceDictInfoDao.findDictMarkList(serviceDictInfo);
|
||||
ServiceDictInfo.sortList(list, sourcelist, 0l, true);
|
||||
page.setList(sourcelist);
|
||||
return page;
|
||||
serviceDictInfo.setPage(page);
|
||||
List<ServiceDictInfo> parentList = serviceDictInfoDao.findDictSearchList(serviceDictInfo);
|
||||
page.setList(parentList);
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询字典详细信息
|
||||
* @param serviceDictId
|
||||
@@ -99,19 +111,82 @@ public class ServiceDictInfoService extends BaseService{
|
||||
* 查询所有非叶子节点字典配置信息
|
||||
* @return
|
||||
*/
|
||||
public List<ServiceDictInfo> findAllDict() {
|
||||
/* public List<ServiceDictInfo> findAllDict() {
|
||||
|
||||
return serviceDictInfoDao.findAllDict();
|
||||
}
|
||||
}*/
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param serviceDictInfo
|
||||
*/
|
||||
public void deleteDict(ServiceDictInfo serviceDictInfo) {
|
||||
serviceDictInfo.setIsValid(0);
|
||||
serviceDictInfoDao.delete(serviceDictInfo);
|
||||
List<ServiceDictInfo> list = Lists.newArrayList();
|
||||
//找出所有下级
|
||||
//查出所有节点
|
||||
ServiceDictInfo.sortList(list, serviceDictInfoDao.findAllDictList(new ServiceDictInfo()), serviceDictInfo.getServiceDictId(), true);
|
||||
list.add(serviceDictInfo);
|
||||
for(ServiceDictInfo se:list){
|
||||
se.setIsValid(0);
|
||||
serviceDictInfoDao.delete(se);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//标签管理
|
||||
|
||||
/**
|
||||
* 查询标签分页(无条件查询)
|
||||
* @param page
|
||||
* @param serviceDictInfo
|
||||
* @return
|
||||
*/
|
||||
public Page<ServiceDictInfo> findTopDictMarkList(Page<ServiceDictInfo> page, ServiceDictInfo serviceDictInfo) {
|
||||
// 设置分页参数
|
||||
serviceDictInfo.setPage(page);
|
||||
//查出顶层分页查询
|
||||
List<ServiceDictInfo> parentList = serviceDictInfoDao.findTopDictMarkList(serviceDictInfo);
|
||||
page.setList(parentList);
|
||||
return page;
|
||||
}
|
||||
/**
|
||||
* 查询所有有效标签配置
|
||||
* @return
|
||||
*/
|
||||
public List<ServiceDictInfo> findAllDictMarkList() {
|
||||
|
||||
return serviceDictInfoDao.findAllDictMarkList(new ServiceDictInfo());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询标签字典分页(含条件查询)
|
||||
* @param page
|
||||
* @param serviceDictInfo
|
||||
* @return
|
||||
*/
|
||||
public Page<ServiceDictInfo> findDictSearchMarkList(Page<ServiceDictInfo> page, ServiceDictInfo serviceDictInfo) {
|
||||
// 设置分页参数
|
||||
serviceDictInfo.setPage(page);
|
||||
List<ServiceDictInfo> parentList = serviceDictInfoDao.findDictSearchMarkList(serviceDictInfo);
|
||||
page.setList(parentList);
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询所有的非叶子配置
|
||||
*/
|
||||
public List<ServiceDictInfo> findAllNoLeafDictMarkList() {
|
||||
return serviceDictInfoDao.findAllNoLeafDictMarkList();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* findFlDict(查找所有有效的分类)
|
||||
@@ -185,5 +260,10 @@ public class ServiceDictInfoService extends BaseService{
|
||||
public List<ServiceDictInfo> findAllLableDict() {
|
||||
return serviceDictInfoDao.findAllItemDict(Constants.ITEM_TYPE_LABEL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,190 @@
|
||||
package com.nis.web.service.configuration;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.web.dao.configuration.StringCfgDao;
|
||||
import com.nis.web.service.CrudService;
|
||||
|
||||
/**
|
||||
* String相关配置事务类
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
|
||||
@Autowired
|
||||
protected StringCfgDao stringCfgDao;
|
||||
/**
|
||||
*
|
||||
* addStringCfg(新增IP类配置)
|
||||
* (继承BaseStringCfg这个类方可使用)
|
||||
* @param baseStringCfg
|
||||
* @return
|
||||
*int
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
|
||||
public int addStringCfg(BaseStringCfg baseStringCfg){
|
||||
if(!StringUtils.isBlank(baseStringCfg.getTableName())){
|
||||
return stringCfgDao.insert(baseStringCfg);
|
||||
}else{
|
||||
String tableName=getTableName(baseStringCfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return 0;
|
||||
baseStringCfg.setTableName(tableName);
|
||||
logger.info("save "+tableName);
|
||||
return stringCfgDao.insert(baseStringCfg);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
*
|
||||
* updateStringCfg(更新IP类配置)
|
||||
* (继承BaseStringCfg这个类方可使用)
|
||||
* @param baseStringCfg
|
||||
* @return
|
||||
*int
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
|
||||
public int updateStringCfg(BaseStringCfg baseStringCfg){
|
||||
if(!StringUtils.isBlank(baseStringCfg.getTableName())){
|
||||
return stringCfgDao.updateByPrimaryKeySelective(baseStringCfg);
|
||||
}else{
|
||||
String tableName=getTableName(baseStringCfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return 0;
|
||||
baseStringCfg.setTableName(tableName);
|
||||
logger.info("update "+tableName);
|
||||
return stringCfgDao.updateByPrimaryKeySelective(baseStringCfg);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
*
|
||||
* auditStringCfg(审核IP类配置)
|
||||
* (继承BaseStringCfg这个类方可使用)
|
||||
* @param baseStringCfg
|
||||
* @return
|
||||
*int
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
|
||||
public int auditStringCfg(BaseStringCfg baseStringCfg){
|
||||
if(!StringUtils.isBlank(baseStringCfg.getTableName())){
|
||||
return stringCfgDao.audit(baseStringCfg);
|
||||
}else{
|
||||
String tableName=getTableName(baseStringCfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return 0;
|
||||
baseStringCfg.setTableName(tableName);
|
||||
logger.info("aduit "+tableName);
|
||||
return stringCfgDao.audit(baseStringCfg);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
*
|
||||
* deleteStringCfg(删除IP类配置)
|
||||
* (继承BaseStringCfg这个类方可使用)
|
||||
* @param baseStringCfg
|
||||
* @return
|
||||
*int
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
|
||||
public int deleteStringCfg(BaseStringCfg baseStringCfg){
|
||||
if(!StringUtils.isBlank(baseStringCfg.getTableName())){
|
||||
return stringCfgDao.updateValid(baseStringCfg);
|
||||
}else{
|
||||
String tableName=getTableName(baseStringCfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return 0;
|
||||
baseStringCfg.setTableName(tableName);
|
||||
logger.info("delete "+tableName);
|
||||
return stringCfgDao.updateValid(baseStringCfg);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
*
|
||||
* getStringCfg(根据IP与类名获取IP配置)
|
||||
* (继承BaseStringCfg这个类方可使用)
|
||||
* @param clazz
|
||||
* @param id
|
||||
* @return
|
||||
*BaseStringCfg
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public BaseStringCfg getStringCfgById(Class<?> clazz,long id){
|
||||
String tableName=getTableName(clazz.getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return null;
|
||||
logger.info("get "+tableName);
|
||||
return stringCfgDao.getById(tableName, id);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* getStringCfg(根据IP与类名获取IP配置)
|
||||
* (继承BaseStringCfg这个类方可使用)
|
||||
* @param clazz
|
||||
* @param id
|
||||
* @return
|
||||
*BaseStringCfg
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public BaseStringCfg getStringCfgById(BaseStringCfg baseStringCfg){
|
||||
if(!StringUtils.isBlank(baseStringCfg.getTableName())){
|
||||
return stringCfgDao.get(baseStringCfg);
|
||||
}else{
|
||||
String tableName=getTableName(baseStringCfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return null;
|
||||
baseStringCfg.setTableName(tableName);
|
||||
logger.info("get "+tableName);
|
||||
return stringCfgDao.get(baseStringCfg);
|
||||
}
|
||||
|
||||
}
|
||||
public Integer getIsValid(BaseStringCfg baseStringCfg){
|
||||
if(!StringUtils.isBlank(baseStringCfg.getTableName())){
|
||||
return stringCfgDao.getIsValid(baseStringCfg);
|
||||
}else{
|
||||
String tableName=getTableName(baseStringCfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return null;
|
||||
baseStringCfg.setTableName(tableName);
|
||||
return stringCfgDao.getIsValid(baseStringCfg);
|
||||
}
|
||||
|
||||
}
|
||||
public Integer getIsValid(String tableName, long id){
|
||||
return stringCfgDao.getIsValid(tableName,id);
|
||||
}
|
||||
public Integer getIsAudit(BaseStringCfg baseStringCfg){
|
||||
if(!StringUtils.isBlank(baseStringCfg.getTableName())){
|
||||
return stringCfgDao.getIsAudit(baseStringCfg);
|
||||
}else{
|
||||
String tableName=getTableName(baseStringCfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return null;
|
||||
baseStringCfg.setTableName(tableName);
|
||||
return stringCfgDao.getIsAudit(baseStringCfg);
|
||||
}
|
||||
|
||||
}
|
||||
public Integer getIsAudit(String tableName, long id){
|
||||
return stringCfgDao.getIsAudit(tableName,id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user