(1)maat配置转换0.0.1版本jar提交,获取编译id可用,审核,取消审核部分报错,待凯歌修复完成测试通过之后更新版本。

(2)基础类配置精简后台代码,加入了从maat转换工具获取编译ID。审核,取消审核目前不可用,等jar包修复完成继续调整。
(3)编译ID字段改为int类型
(4)多域类配置后台提交。查询采用查一张主表,根据主表中的编译ID分开查其他表的方式关联。界面功能尚在调整。
This commit is contained in:
wangxin
2018-03-26 14:43:58 +08:00
parent bb8cd7be79
commit 9d50205d5f
38 changed files with 2392 additions and 905 deletions

View File

@@ -1,11 +1,11 @@
package com.nis.web.service.configuration;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.nis.domain.configuration.ComplexkeywordCfg;
import com.nis.util.Constants;
import com.nis.web.dao.configuration.ComplexStringCfgDao;
import com.nis.web.service.CrudService;
@@ -30,17 +30,7 @@ public class ComplexStringCfgService extends CrudService<ComplexStringCfgDao,Com
*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.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);
}
return complexStringCfgDao.insert(cfg);
}
/**
*
@@ -54,17 +44,7 @@ public class ComplexStringCfgService extends CrudService<ComplexStringCfgDao,Com
*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.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);
}
}
/**
*
@@ -73,22 +53,21 @@ public class ComplexStringCfgService extends CrudService<ComplexStringCfgDao,Com
* @param cfg
* @return
*int
* @throws Exception
* @exception
* @since 1.0.0
*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public int auditStringCfg(ComplexkeywordCfg cfg){
if(!StringUtils.isBlank(cfg.getTableName())){
return complexStringCfgDao.audit(cfg);
public int auditStringCfg(ComplexkeywordCfg sendCfg,ComplexkeywordCfg cfg) throws Exception{
if(Constants.AUDIT_NOT_YES==cfg.getIsAudit().intValue()||
Constants.AUDIT_YES==cfg.getIsAudit().intValue()){//审核通过,取消审核通过需要发到maat
if(sendToMaatConvertor(cfg.getIsAudit(),null,sendCfg)){
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);
}
return 0;
}
/**
*
@@ -102,36 +81,8 @@ public class ComplexStringCfgService extends CrudService<ComplexStringCfgDao,Com
*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.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);
}
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配置)
@@ -144,44 +95,16 @@ public class ComplexStringCfgService extends CrudService<ComplexStringCfgDao,Com
* @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);
}
return complexStringCfgDao.getById(cfg.getTableName(),cfg.getCfgId());
}
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);
}
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);
}
return complexStringCfgDao.getIsAudit(cfg);
}
public Integer getIsAudit(String tableName, long id){
return complexStringCfgDao.getIsAudit(tableName,id);

View File

@@ -1,12 +1,11 @@
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.BaseIpCfg;
import com.nis.util.Constants;
import com.nis.web.dao.configuration.IpCfgDao;
import com.nis.web.service.CrudService;
@@ -31,17 +30,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public int addIpCfg(BaseIpCfg baseIpCfg){
if(!StringUtils.isBlank(baseIpCfg.getTableName())){
return ipCfgDao.insert(baseIpCfg);
}else{
String tableName=getTableName(baseIpCfg.getClass().getSimpleName());
if(StringUtils.isBlank(tableName))
return 0;
baseIpCfg.setTableName(tableName);
logger.info("save "+tableName);
return ipCfgDao.insert(baseIpCfg);
}
return ipCfgDao.insert(baseIpCfg);
}
/**
*
@@ -55,17 +44,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public int updateIpCfg(BaseIpCfg baseIpCfg){
if(!StringUtils.isBlank(baseIpCfg.getTableName())){
return ipCfgDao.updateByPrimaryKeySelective(baseIpCfg);
}else{
String tableName=getTableName(baseIpCfg.getClass().getSimpleName());
if(StringUtils.isBlank(tableName))
return 0;
baseIpCfg.setTableName(tableName);
logger.info("update "+tableName);
return ipCfgDao.updateByPrimaryKeySelective(baseIpCfg);
}
return ipCfgDao.updateByPrimaryKeySelective(baseIpCfg);
}
/**
*
@@ -74,22 +53,22 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
* @param baseIpCfg
* @return
*int
* @throws Exception
* @exception
* @since 1.0.0
*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public int auditIpCfg(BaseIpCfg baseIpCfg){
if(!StringUtils.isBlank(baseIpCfg.getTableName())){
return ipCfgDao.audit(baseIpCfg);
public int auditIpCfg(BaseIpCfg sendCfg,BaseIpCfg baseIpCfg) throws Exception{
if(Constants.AUDIT_NOT_YES==baseIpCfg.getIsAudit().intValue()||
Constants.AUDIT_YES==baseIpCfg.getIsAudit().intValue()){//审核通过,取消审核通过需要发到maat
if(sendToMaatConvertor(baseIpCfg.getIsAudit(),null,sendCfg)){
return ipCfgDao.audit(baseIpCfg);
}
}else{
String tableName=getTableName(baseIpCfg.getClass().getSimpleName());
if(StringUtils.isBlank(tableName))
return 0;
baseIpCfg.setTableName(tableName);
logger.info("aduit "+tableName);
return ipCfgDao.audit(baseIpCfg);
}
return 0;
}
/**
*
@@ -103,36 +82,8 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public int deleteIpCfg(BaseIpCfg baseIpCfg){
if(!StringUtils.isBlank(baseIpCfg.getTableName())){
return ipCfgDao.updateValid(baseIpCfg);
}else{
String tableName=getTableName(baseIpCfg.getClass().getSimpleName());
if(StringUtils.isBlank(tableName))
return 0;
baseIpCfg.setTableName(tableName);
logger.info("delete "+tableName);
return ipCfgDao.updateValid(baseIpCfg);
}
return ipCfgDao.updateValid(baseIpCfg);
}
/**
*
* getIpCfg(根据IP与类名获取IP配置)
* (继承BaseIpCfg这个类方可使用)
* @param clazz
* @param id
* @return
*BaseIpCfg
* @exception
* @since 1.0.0
*/
public BaseIpCfg getIpCfgById(Class<?> clazz,long id){
String tableName=getTableName(clazz.getSimpleName());
if(StringUtils.isBlank(tableName))
return null;
logger.info("get "+tableName);
return ipCfgDao.getById(tableName, id);
}
/**
*
* getIpCfg(根据IP与类名获取IP配置)
@@ -145,44 +96,16 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
* @since 1.0.0
*/
public BaseIpCfg getIpCfgById(BaseIpCfg baseIpCfg){
if(!StringUtils.isBlank(baseIpCfg.getTableName())){
return ipCfgDao.get(baseIpCfg);
}else{
String tableName=getTableName(baseIpCfg.getClass().getSimpleName());
if(StringUtils.isBlank(tableName))
return null;
baseIpCfg.setTableName(tableName);
logger.info("get "+tableName);
return ipCfgDao.get(baseIpCfg);
}
return ipCfgDao.getById(baseIpCfg.getTableName(), baseIpCfg.getCfgId());
}
public Integer getIsValid(BaseIpCfg baseIpCfg){
if(!StringUtils.isBlank(baseIpCfg.getTableName())){
return ipCfgDao.getIsValid(baseIpCfg);
}else{
String tableName=getTableName(baseIpCfg.getClass().getSimpleName());
if(StringUtils.isBlank(tableName))
return null;
baseIpCfg.setTableName(tableName);
return ipCfgDao.getIsValid(baseIpCfg);
}
return ipCfgDao.getIsValid(baseIpCfg);
}
public Integer getIsValid(String tableName, long id){
return ipCfgDao.getIsValid(tableName,id);
}
public Integer getIsAudit(BaseIpCfg baseIpCfg){
if(!StringUtils.isBlank(baseIpCfg.getTableName())){
return ipCfgDao.getIsAudit(baseIpCfg);
}else{
String tableName=getTableName(baseIpCfg.getClass().getSimpleName());
if(StringUtils.isBlank(tableName))
return null;
baseIpCfg.setTableName(tableName);
return ipCfgDao.getIsAudit(baseIpCfg);
}
return ipCfgDao.getIsAudit(baseIpCfg);
}
public Integer getIsAudit(String tableName, long id){
return ipCfgDao.getIsAudit(tableName,id);

View File

@@ -0,0 +1,168 @@
package com.nis.web.service.configuration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.nis.domain.Page;
import com.nis.domain.configuration.BaseIpCfg;
import com.nis.domain.configuration.BaseStringCfg;
import com.nis.domain.configuration.ComplexkeywordCfg;
import com.nis.domain.configuration.MultipleCfg;
import com.nis.domain.configuration.MultipleSearchCfg;
import com.nis.domain.configuration.NumBoundaryCfg;
import com.nis.web.dao.configuration.ComplexStringCfgDao;
import com.nis.web.dao.configuration.IpCfgDao;
import com.nis.web.dao.configuration.MultipleCfgDao;
import com.nis.web.dao.configuration.NumCfgDao;
import com.nis.web.dao.configuration.StringCfgDao;
import com.nis.web.service.CrudService;
/**
* 多域相关配置事务类
* @author dell
*
*/
@Service
public class MultipleCfgService extends CrudService<MultipleCfgDao,MultipleSearchCfg> {
@Autowired
protected MultipleCfgDao multipleCfgDao;
@Autowired
protected IpCfgDao ipCfgDao;
@Autowired
protected StringCfgDao stringCfgDao;
@Autowired
protected ComplexStringCfgDao complexStringCfgDao;
@Autowired
protected NumCfgDao numCfgDao;
/**
*
* addStringCfg(新增IP类配置)
* (继承ComplexkeywordCfg这个类方可使用)
* @param cfg
* @return
*int
* @exception
* @since 1.0.0
*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public int addCfg(MultipleCfg cfg){
if(cfg==null) return 0;
if(cfg.getIpCfg()!=null){
for(BaseIpCfg _cfg:cfg.getIpCfg().values()){
ipCfgDao.insert(_cfg);
}
}
if(cfg.getStringCfg()!=null){
for(BaseStringCfg _cfg:cfg.getStringCfg().values()){
stringCfgDao.insert(_cfg);
}
}
if(cfg.getNumCfg()!=null){
for(NumBoundaryCfg _cfg:cfg.getNumCfg().values()){
numCfgDao.insert(_cfg);
}
}
if(cfg.getComplexCfg()!=null){
for(ComplexkeywordCfg _cfg:cfg.getComplexCfg().values()){
complexStringCfgDao.insert(_cfg);
}
}
return 1;
}
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public int updateCfg(MultipleCfg cfg){
if(cfg==null) return 0;
if(cfg.getIpCfg()!=null){
for(BaseIpCfg _cfg:cfg.getIpCfg().values()){
ipCfgDao.updateByPrimaryKeySelective(_cfg);
}
}
if(cfg.getStringCfg()!=null){
for(BaseStringCfg _cfg:cfg.getStringCfg().values()){
stringCfgDao.updateByPrimaryKeySelective(_cfg);
}
}
if(cfg.getNumCfg()!=null){
for(NumBoundaryCfg _cfg:cfg.getNumCfg().values()){
numCfgDao.updateByPrimaryKeySelective(_cfg);
}
}
if(cfg.getComplexCfg()!=null){
for(ComplexkeywordCfg _cfg:cfg.getComplexCfg().values()){
complexStringCfgDao.updateByPrimaryKeySelective(_cfg);
}
}
return 1;
}
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public int deleteCfg(MultipleCfg cfg){
if(cfg==null) return 0;
if(cfg.getIpCfg()!=null){
for(BaseIpCfg _cfg:cfg.getIpCfg().values()){
ipCfgDao.deleteByCompileId(_cfg);
}
}
if(cfg.getStringCfg()!=null){
for(BaseStringCfg _cfg:cfg.getStringCfg().values()){
stringCfgDao.deleteByCompileId(_cfg);
}
}
if(cfg.getNumCfg()!=null){
for(NumBoundaryCfg _cfg:cfg.getNumCfg().values()){
numCfgDao.deleteByCompileId(_cfg);
}
}
if(cfg.getComplexCfg()!=null){
for(ComplexkeywordCfg _cfg:cfg.getComplexCfg().values()){
complexStringCfgDao.deleteByCompileId(_cfg);
}
}
return 1;
}
/**
*
* auditCfg(这里用一句话描述这个方法的作用)
* (这里描述这个方法适用条件 可选)
* @param cfg
* @return
*int
* @exception
* @since 1.0.0
*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public int auditCfg(MultipleCfg cfg){
if(cfg==null) return 0;
if(cfg.getIpCfg()!=null){
for(BaseIpCfg _cfg:cfg.getIpCfg().values()){
ipCfgDao.audit(_cfg);
}
}
if(cfg.getStringCfg()!=null){
for(BaseStringCfg _cfg:cfg.getStringCfg().values()){
stringCfgDao.audit(_cfg);
}
}
if(cfg.getNumCfg()!=null){
for(NumBoundaryCfg _cfg:cfg.getNumCfg().values()){
numCfgDao.audit(_cfg);
}
}
if(cfg.getComplexCfg()!=null){
for(ComplexkeywordCfg _cfg:cfg.getComplexCfg().values()){
complexStringCfgDao.audit(_cfg);
}
}
return 1;
}
/**
* 由于mysql不支持full join并且考虑mysql的性能问题这里分别从各个基础表里查询数据再拼接
*/
@Override
public Page<MultipleSearchCfg> findPage(Page<MultipleSearchCfg> page, MultipleSearchCfg entity) {
return super.findPage(page, entity);
}
}

View File

@@ -5,6 +5,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.nis.domain.configuration.NumBoundaryCfg;
import com.nis.util.Constants;
import com.nis.web.dao.configuration.NumCfgDao;
import com.nis.web.service.CrudService;
@@ -52,12 +53,21 @@ public class NumCfgService extends CrudService<NumCfgDao,NumBoundaryCfg> {
* @param cfg
* @return
*int
* @throws Exception
* @exception
* @since 1.0.0
*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public int auditNumCfg(NumBoundaryCfg cfg){
return numCfgDao.audit(cfg);
public int auditNumCfg(NumBoundaryCfg sendCfg,NumBoundaryCfg cfg) throws Exception{
if(Constants.AUDIT_NOT_YES==cfg.getIsAudit().intValue()||
Constants.AUDIT_YES==cfg.getIsAudit().intValue()){//审核通过,取消审核通过需要发到maat
if(sendToMaatConvertor(cfg.getIsAudit(),null,sendCfg)){
return numCfgDao.audit(cfg);
}
}else{
return numCfgDao.audit(cfg);
}
return 0;
}
/**
*
@@ -99,7 +109,7 @@ public class NumCfgService extends CrudService<NumCfgDao,NumBoundaryCfg> {
* @since 1.0.0
*/
public NumBoundaryCfg getNumCfgById(NumBoundaryCfg cfg){
return numCfgDao.get(cfg);
return numCfgDao.getById(cfg.getCfgId());
}
public Integer getIsValid(NumBoundaryCfg cfg){
return numCfgDao.getIsValid(cfg);

View File

@@ -1,12 +1,11 @@
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.util.Constants;
import com.nis.web.dao.configuration.StringCfgDao;
import com.nis.web.service.CrudService;
@@ -31,17 +30,7 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.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);
}
return stringCfgDao.insert(baseStringCfg);
}
/**
*
@@ -55,17 +44,7 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.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);
}
return stringCfgDao.updateByPrimaryKeySelective(baseStringCfg);
}
/**
*
@@ -74,22 +53,21 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
* @param baseStringCfg
* @return
*int
* @throws Exception
* @exception
* @since 1.0.0
*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public int auditStringCfg(BaseStringCfg baseStringCfg){
if(!StringUtils.isBlank(baseStringCfg.getTableName())){
return stringCfgDao.audit(baseStringCfg);
public int auditStringCfg(BaseStringCfg sendCfg,BaseStringCfg baseStringCfg) throws Exception{
if(Constants.AUDIT_NOT_YES==baseStringCfg.getIsAudit().intValue()||
Constants.AUDIT_YES==baseStringCfg.getIsAudit().intValue()){//审核通过,取消审核通过需要发到maat
if(sendToMaatConvertor(baseStringCfg.getIsAudit(),null,sendCfg)){
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);
}
return 0;
}
/**
*
@@ -103,36 +81,8 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.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);
}
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配置)
@@ -145,44 +95,16 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
* @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);
}
return stringCfgDao.getById(baseStringCfg.getTableName(), baseStringCfg.getCfgId());
}
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);
}
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);
}
return stringCfgDao.getIsAudit(baseStringCfg);
}
public Integer getIsAudit(String tableName, long id){
return stringCfgDao.getIsAudit(tableName,id);