This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
k18-ntcs-web-ntc/src/main/java/com/nis/web/service/configuration/IpCfgService.java

114 lines
3.0 KiB
Java
Raw Normal View History

package com.nis.web.service.configuration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
2018-02-25 18:43:20 +08:00
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;
/**
* IP相关配置事务类
* @author dell
*
*/
@Service
public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
@Autowired
protected IpCfgDao ipCfgDao;
/**
*
* addIpCfg(新增IP类配置)
* (继承BaseIpCfg这个类方可使用)
* @param baseIpCfg
* @return
*int
* @exception
* @since 1.0.0
*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public int addIpCfg(BaseIpCfg baseIpCfg){
return ipCfgDao.insert(baseIpCfg);
}
/**
*
* updateIpCfg(更新IP类配置)
* (继承BaseIpCfg这个类方可使用)
* @param baseIpCfg
* @return
*int
* @exception
* @since 1.0.0
*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public int updateIpCfg(BaseIpCfg baseIpCfg){
return ipCfgDao.updateByPrimaryKeySelective(baseIpCfg);
2018-02-25 18:43:20 +08:00
}
/**
*
* auditIpCfg(审核IP类配置)
* (继承BaseIpCfg这个类方可使用)
* @param baseIpCfg
* @return
*int
* @throws Exception
2018-02-25 18:43:20 +08:00
* @exception
* @since 1.0.0
*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
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);
}
2018-02-25 18:43:20 +08:00
}else{
return ipCfgDao.audit(baseIpCfg);
}
return 0;
2018-02-25 18:43:20 +08:00
}
/**
*
* deleteIpCfg(删除IP类配置)
* (继承BaseIpCfg这个类方可使用)
* @param baseIpCfg
* @return
*int
* @exception
* @since 1.0.0
*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
2018-02-25 18:43:20 +08:00
public int deleteIpCfg(BaseIpCfg baseIpCfg){
return ipCfgDao.updateValid(baseIpCfg);
}
/**
*
* getIpCfg(根据IP与类名获取IP配置)
* (继承BaseIpCfg这个类方可使用)
* @param clazz
* @param id
* @return
*BaseIpCfg
* @exception
* @since 1.0.0
*/
public BaseIpCfg getIpCfgById(BaseIpCfg baseIpCfg){
return ipCfgDao.getById(baseIpCfg.getTableName(), baseIpCfg.getCfgId());
2018-02-25 18:43:20 +08:00
}
public Integer getIsValid(BaseIpCfg baseIpCfg){
return ipCfgDao.getIsValid(baseIpCfg);
2018-02-25 18:43:20 +08:00
}
public Integer getIsValid(String tableName, long id){
return ipCfgDao.getIsValid(tableName,id);
}
public Integer getIsAudit(BaseIpCfg baseIpCfg){
return ipCfgDao.getIsAudit(baseIpCfg);
2018-02-25 18:43:20 +08:00
}
public Integer getIsAudit(String tableName, long id){
return ipCfgDao.getIsAudit(tableName,id);
}
}