(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,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);