parent
88486f54d7
commit
b20d556c99
@ -0,0 +1,139 @@
|
|||||||
|
package com.farm.parameter.dao.impl;
|
||||||
|
// 导入用于处理大整数的类
|
||||||
|
import java.math.BigInteger;
|
||||||
|
// 导入列表接口
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
// 导入用于资源注入的注解
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
// 导入 Hibernate 查询相关类
|
||||||
|
import org.hibernate.Query;
|
||||||
|
import org.hibernate.SQLQuery;
|
||||||
|
// 导入 Hibernate 会话相关类
|
||||||
|
import org.hibernate.Session;
|
||||||
|
import org.hibernate.SessionFactory;
|
||||||
|
// 导入 Spring 用于标记数据访问对象的注解
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
// 导入自定义的字典实体数据访问接口
|
||||||
|
import com.farm.parameter.dao.DictionaryEntityDaoInter;
|
||||||
|
// 导入自定义的独立字典实体类
|
||||||
|
import com.farm.parameter.domain.AloneDictionaryEntity;
|
||||||
|
|
||||||
|
// 使用 @Repository 注解将该类标记为 Spring 中的数据访问对象
|
||||||
|
@Repository
|
||||||
|
// 定义一个名为 DictionaryEntityDao 的类,实现 DictionaryEntityDaoInter 接口
|
||||||
|
public class DictionaryEntityDao implements DictionaryEntityDaoInter {
|
||||||
|
// 使用 @Resource 注解注入名为 "sessionFactory" 的 SessionFactory 对象
|
||||||
|
@Resource(name = "sessionFactory")
|
||||||
|
// 定义一个 SessionFactory 类型的成员变量,用于获取 Hibernate 会话
|
||||||
|
private SessionFactory sessionFatory;
|
||||||
|
|
||||||
|
// 定义一个方法,用于删除一个独立字典实体
|
||||||
|
public void deleteEntity(AloneDictionaryEntity entity) {
|
||||||
|
// 从 SessionFactory 获取当前的 Hibernate 会话
|
||||||
|
Session session = sessionFatory.getCurrentSession();
|
||||||
|
// 使用会话的 delete 方法删除指定的实体
|
||||||
|
session.delete(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 定义一个方法,用于获取所有独立字典实体的数量
|
||||||
|
public int getAllListNum() {
|
||||||
|
// 从 SessionFactory 获取当前的 Hibernate 会话
|
||||||
|
Session session = sessionFatory.getCurrentSession();
|
||||||
|
// 创建一个 SQL 查询对象,用于执行 SQL 查询语句
|
||||||
|
SQLQuery sqlquery = session
|
||||||
|
.createSQLQuery("select count(*) from alone_dictionary_entity ");
|
||||||
|
// 执行查询并获取结果列表,然后取出第一个元素并转换为 BigInteger 类型
|
||||||
|
BigInteger num = (BigInteger) sqlquery.list().get(0);
|
||||||
|
// 将 BigInteger 类型的结果转换为 int 类型并返回
|
||||||
|
return num.intValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 定义一个方法,用于根据实体的 ID 获取独立字典实体
|
||||||
|
public AloneDictionaryEntity getEntity(String id) {
|
||||||
|
// 从 SessionFactory 获取当前的 Hibernate 会话
|
||||||
|
Session session = sessionFatory.getCurrentSession();
|
||||||
|
// 使用会话的 get 方法根据实体类和 ID 获取实体对象,并将其返回
|
||||||
|
return (AloneDictionaryEntity) session.get(AloneDictionaryEntity.class,
|
||||||
|
id);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 定义一个方法,用于插入一个新的独立字典实体
|
||||||
|
public AloneDictionaryEntity insertEntity(AloneDictionaryEntity entity) {
|
||||||
|
// 从 SessionFactory 获取当前的 Hibernate 会话
|
||||||
|
Session session = sessionFatory.getCurrentSession();
|
||||||
|
// 使用会话的 save 方法保存实体对象
|
||||||
|
session.save(entity);
|
||||||
|
// 返回保存后的实体对象
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 定义一个获取 SessionFactory 的方法
|
||||||
|
public SessionFactory getSessionFatory() {
|
||||||
|
return sessionFatory;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 定义一个设置 SessionFactory 的方法
|
||||||
|
public void setSessionFatory(SessionFactory sessionFatory) {
|
||||||
|
this.sessionFatory = sessionFatory;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 定义一个方法,用于编辑一个独立字典实体
|
||||||
|
public void editEntity(AloneDictionaryEntity entity) {
|
||||||
|
// 从 SessionFactory 获取当前的 Hibernate 会话
|
||||||
|
Session session = sessionFatory.getCurrentSession();
|
||||||
|
// 使用会话的 update 方法更新实体对象
|
||||||
|
session.update(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 使用 @SuppressWarnings 注解抑制未检查类型转换的警告
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
// 重写接口中的方法,根据键查找独立字典实体列表
|
||||||
|
@Override
|
||||||
|
public List<AloneDictionaryEntity> findEntityByKey(String key) {
|
||||||
|
// 定义 HQL 查询语句
|
||||||
|
String hql = "from AloneDictionaryEntity a where a.entityindex = ?";
|
||||||
|
// 从 SessionFactory 获取当前的 Hibernate 会话
|
||||||
|
Session session = sessionFatory.getCurrentSession();
|
||||||
|
// 创建一个 HQL 查询对象
|
||||||
|
Query query = session.createQuery(hql);
|
||||||
|
// 设置查询参数
|
||||||
|
query.setString(0, key);
|
||||||
|
// 执行查询并返回结果列表
|
||||||
|
return query.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 使用 @SuppressWarnings 注解抑制未检查类型转换的警告
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
// 重写接口中的方法,根据键和排除的 ID 查找独立字典实体列表
|
||||||
|
@Override
|
||||||
|
public List<AloneDictionaryEntity> findEntityByKey(String key, String exId) {
|
||||||
|
// 定义 HQL 查询语句
|
||||||
|
String hql = "from AloneDictionaryEntity a where a.entityindex = ? and a.id != ?";
|
||||||
|
// 从 SessionFactory 获取当前的 Hibernate 会话
|
||||||
|
Session session = sessionFatory.getCurrentSession();
|
||||||
|
// 创建一个 HQL 查询对象
|
||||||
|
Query query = session.createQuery(hql);
|
||||||
|
// 设置查询参数
|
||||||
|
query.setString(0, key.trim()).setString(1, exId);
|
||||||
|
// 执行查询并返回结果列表
|
||||||
|
return query.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 使用 @SuppressWarnings 注解抑制未检查类型转换的警告
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
// 重写接口中的方法,获取所有独立字典实体列表
|
||||||
|
@Override
|
||||||
|
public List<AloneDictionaryEntity> getAllEntity() {
|
||||||
|
// 定义 HQL 查询语句
|
||||||
|
String hql = "from AloneDictionaryEntity";
|
||||||
|
// 从 SessionFactory 获取当前的 Hibernate 会话
|
||||||
|
Session session = sessionFatory.getCurrentSession();
|
||||||
|
// 创建一个 HQL 查询对象
|
||||||
|
Query query = session.createQuery(hql);
|
||||||
|
// 执行查询并返回结果列表
|
||||||
|
return query.list();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,121 @@
|
|||||||
|
// 声明该类所在的包路径
|
||||||
|
package com.farm.parameter.dao.impl;
|
||||||
|
|
||||||
|
// 导入用于处理大整数的类
|
||||||
|
import java.math.BigInteger;
|
||||||
|
// 导入列表接口
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
// 导入用于资源注入的注解
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
// 导入 Hibernate 查询相关类
|
||||||
|
import org.hibernate.Query;
|
||||||
|
import org.hibernate.SQLQuery;
|
||||||
|
// 导入 Hibernate 会话相关类
|
||||||
|
import org.hibernate.Session;
|
||||||
|
import org.hibernate.SessionFactory;
|
||||||
|
// 导入 Spring 用于标记数据访问对象的注解
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
// 导入自定义的字典类型数据访问接口
|
||||||
|
import com.farm.parameter.dao.DictionaryTypeDaoInter;
|
||||||
|
// 导入自定义的独立字典类型类
|
||||||
|
import com.farm.parameter.domain.AloneDictionaryType;
|
||||||
|
|
||||||
|
// 使用 @Repository 注解将该类标记为 Spring 中的数据访问对象
|
||||||
|
@Repository
|
||||||
|
// 定义一个名为 DictionaryTypeDao 的类,实现 DictionaryTypeDaoInter 接口
|
||||||
|
public class DictionaryTypeDao implements DictionaryTypeDaoInter {
|
||||||
|
// 使用 @Resource 注解注入名为 "sessionFactory" 的 SessionFactory 对象
|
||||||
|
@Resource(name = "sessionFactory")
|
||||||
|
// 定义一个 SessionFactory 类型的成员变量,用于获取 Hibernate 会话
|
||||||
|
private SessionFactory sessionFatory;
|
||||||
|
|
||||||
|
// 定义一个方法,用于删除一个独立字典类型实体
|
||||||
|
public void deleteEntity(AloneDictionaryType entity) {
|
||||||
|
// 从 SessionFactory 获取当前的 Hibernate 会话
|
||||||
|
Session session = sessionFatory.getCurrentSession();
|
||||||
|
// 使用会话的 delete 方法删除指定的实体
|
||||||
|
session.delete(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 重写接口中的方法,根据树编码删除相关的独立字典类型实体
|
||||||
|
@Override
|
||||||
|
public void deleteEntityByTreecode(String entityId) {
|
||||||
|
// 原本注释掉的 HQL 语句,用于更新实体状态为 '2'
|
||||||
|
//String hql = "update AloneDictionaryType a set a.state = '2' "
|
||||||
|
// + "where a.treecode like ?";
|
||||||
|
// 实际使用的 HQL 语句,用于删除树编码包含指定 entityId 的实体
|
||||||
|
String hql = "delete from AloneDictionaryType a where a.treecode like ?";
|
||||||
|
// 创建一个 HQL 查询对象
|
||||||
|
Query query = sessionFatory.getCurrentSession().createQuery(hql);
|
||||||
|
// 设置查询参数,使用 '%' 进行模糊匹配
|
||||||
|
query.setString(0, "%" + entityId + "%");
|
||||||
|
// 执行更新操作
|
||||||
|
query.executeUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 定义一个方法,用于获取所有独立字典类型实体的数量
|
||||||
|
public int getAllListNum() {
|
||||||
|
// 从 SessionFactory 获取当前的 Hibernate 会话
|
||||||
|
Session session = sessionFatory.getCurrentSession();
|
||||||
|
// 创建一个 SQL 查询对象,用于执行 SQL 查询语句
|
||||||
|
SQLQuery sqlquery = session
|
||||||
|
.createSQLQuery("select count(*) from alone_dictionary_type");
|
||||||
|
// 执行查询并获取结果列表,然后取出第一个元素并转换为 BigInteger 类型
|
||||||
|
BigInteger num = (BigInteger) sqlquery.list().get(0);
|
||||||
|
// 将 BigInteger 类型的结果转换为 int 类型并返回
|
||||||
|
return num.intValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 定义一个方法,用于根据实体的 ID 获取独立字典类型实体
|
||||||
|
public AloneDictionaryType getEntity(String id) {
|
||||||
|
// 从 SessionFactory 获取当前的 Hibernate 会话
|
||||||
|
Session session = sessionFatory.getCurrentSession();
|
||||||
|
// 使用会话的 get 方法根据实体类和 ID 获取实体对象,并将其返回
|
||||||
|
return (AloneDictionaryType) session.get(AloneDictionaryType.class, id);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 定义一个方法,用于插入一个新的独立字典类型实体
|
||||||
|
public void insertEntity(AloneDictionaryType entity) {
|
||||||
|
// 从 SessionFactory 获取当前的 Hibernate 会话
|
||||||
|
Session session = sessionFatory.getCurrentSession();
|
||||||
|
// 使用会话的 save 方法保存实体对象
|
||||||
|
session.save(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 定义一个获取 SessionFactory 的方法
|
||||||
|
public SessionFactory getSessionFatory() {
|
||||||
|
return sessionFatory;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 定义一个设置 SessionFactory 的方法
|
||||||
|
public void setSessionFatory(SessionFactory sessionFatory) {
|
||||||
|
this.sessionFatory = sessionFatory;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 定义一个方法,用于编辑一个独立字典类型实体
|
||||||
|
public void editEntity(AloneDictionaryType entity) {
|
||||||
|
// 从 SessionFactory 获取当前的 Hibernate 会话
|
||||||
|
Session session = sessionFatory.getCurrentSession();
|
||||||
|
// 使用会话的 update 方法更新实体对象
|
||||||
|
session.update(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 使用 @SuppressWarnings 注解抑制未检查类型转换的警告
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
// 重写接口中的方法,根据实体 ID 获取独立字典类型实体列表
|
||||||
|
@Override
|
||||||
|
public List<AloneDictionaryType> getListByEntityId(String entityId) {
|
||||||
|
// 从 SessionFactory 获取当前的 Hibernate 会话
|
||||||
|
Session session = sessionFatory.getCurrentSession();
|
||||||
|
// 创建一个 HQL 查询对象,并设置查询参数
|
||||||
|
Query query = session.createQuery("from AloneDictionaryType where entity=?")
|
||||||
|
.setString(0, entityId);
|
||||||
|
// 执行查询并将结果存储在列表中
|
||||||
|
List<AloneDictionaryType> list = query.list();
|
||||||
|
// 返回查询结果列表
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,142 @@
|
|||||||
|
package com.farm.parameter.dao.impl;
|
||||||
|
|
||||||
|
import java.math.BigInteger;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import org.hibernate.Query;
|
||||||
|
import org.hibernate.SQLQuery;
|
||||||
|
import org.hibernate.Session;
|
||||||
|
import org.hibernate.SessionFactory;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.farm.core.sql.result.DataResults;
|
||||||
|
import com.farm.parameter.dao.ParameterDaoInter;
|
||||||
|
import com.farm.parameter.domain.AloneParameter;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public class ParameterDao implements ParameterDaoInter {
|
||||||
|
@Resource(name = "sessionFactory")
|
||||||
|
private SessionFactory sessionFatory;
|
||||||
|
|
||||||
|
public void deleteEntity(AloneParameter entity) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
Session session = sessionFatory.getCurrentSession();
|
||||||
|
session.delete(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAllListNum() {
|
||||||
|
Session session = sessionFatory.getCurrentSession();
|
||||||
|
SQLQuery sqlquery = session.createSQLQuery("select count(*) from Alone_Parameter");
|
||||||
|
BigInteger num = (BigInteger) sqlquery.list().get(0);
|
||||||
|
return num.intValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
public AloneParameter getEntity(String id) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
Session session = sessionFatory.getCurrentSession();
|
||||||
|
return (AloneParameter) session.get(AloneParameter.class, id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void insertEntity(AloneParameter entity) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
Session session = sessionFatory.getCurrentSession();
|
||||||
|
session.save(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SessionFactory getSessionFatory() {
|
||||||
|
return sessionFatory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSessionFatory(SessionFactory sessionFatory) {
|
||||||
|
this.sessionFatory = sessionFatory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void editEntity(AloneParameter entity) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
Session session = sessionFatory.getCurrentSession();
|
||||||
|
session.update(entity);
|
||||||
|
}
|
||||||
|
// 重写接口中的方法,用于获取所有的参数实体列表
|
||||||
|
@Override
|
||||||
|
public List<AloneParameter> getAllEntity() {
|
||||||
|
// 从 SessionFactory 获取当前的 Hibernate 会话
|
||||||
|
Session session = sessionFatory.getCurrentSession();
|
||||||
|
// 创建一个 HQL 查询对象,查询所有的 AloneParameter 实体
|
||||||
|
Query sqlquery = session.createQuery("from AloneParameter");
|
||||||
|
// 抑制未检查类型转换的警告
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
// 执行查询并将结果存储在列表中
|
||||||
|
List<AloneParameter> list = sqlquery.list();
|
||||||
|
// 返回查询结果列表
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 抑制未检查类型转换的警告
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
// 重写接口中的方法,根据域类型获取参数列表,返回的是包含键值对的映射列表
|
||||||
|
@Override
|
||||||
|
public List<Map<String, Object>> getListByDomainType(String domainType) {
|
||||||
|
// 定义 SQL 查询语句,选择指定列,根据域类型筛选并按更新时间降序排序
|
||||||
|
String sql = "select a.id, a.name, a.vtype, a.rules, a.pvalue, a.comments " + "from ALONE_PARAMETER a "//
|
||||||
|
+ "where a.domain = ? " //
|
||||||
|
+ "order by a.utime desc";
|
||||||
|
// 创建一个 SQL 查询对象
|
||||||
|
SQLQuery sqlQuery = sessionFatory.getCurrentSession().createSQLQuery(sql);
|
||||||
|
// 设置查询参数,即域类型
|
||||||
|
sqlQuery.setString(0, domainType);
|
||||||
|
// 调用 DataResults 的 getMaps 方法将查询结果转换为包含键值对的映射列表并返回
|
||||||
|
return DataResults.getMaps("id, name, vtype, rules, pvalue, comments", sqlQuery.list());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 抑制未检查类型转换的警告
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
// 重写接口中的方法,根据参数键查找参数实体列表
|
||||||
|
@Override
|
||||||
|
public List<AloneParameter> findListByKey(String paramKey) {
|
||||||
|
// 定义 HQL 查询语句,根据参数键筛选
|
||||||
|
String hql = "from AloneParameter a where a.pkey = ?";
|
||||||
|
// 创建一个 HQL 查询对象
|
||||||
|
Query query = sessionFatory.getCurrentSession().createQuery(hql);
|
||||||
|
// 设置查询参数,去除参数键前后的空格
|
||||||
|
query.setString(0, paramKey.trim());
|
||||||
|
// 执行查询并返回结果列表
|
||||||
|
return query.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 抑制未检查类型转换的警告
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
// 重写接口中的方法,根据参数键查找参数实体列表,并排除指定 ID 的参数
|
||||||
|
@Override
|
||||||
|
public List<AloneParameter> findListByKeyAndExcludeParamId(String paramKey, String excludeParamId) {
|
||||||
|
// 定义 HQL 查询语句,根据参数键筛选并排除指定 ID 的参数
|
||||||
|
String hql = "from AloneParameter a where a.pkey = ? and a.id != ?";
|
||||||
|
// 创建一个 HQL 查询对象
|
||||||
|
Query query = sessionFatory.getCurrentSession().createQuery(hql);
|
||||||
|
// 设置查询参数,去除参数键前后的空格并指定排除的参数 ID
|
||||||
|
query.setString(0, paramKey.trim()).setString(1, excludeParamId);
|
||||||
|
// 执行查询并返回结果列表
|
||||||
|
return query.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 重写接口中的方法,根据参数键获取单个参数实体
|
||||||
|
@Override
|
||||||
|
public AloneParameter getEntityByKey(String key) {
|
||||||
|
// 创建一个 HQL 查询对象,根据参数键筛选
|
||||||
|
Query sqlquery = sessionFatory.getCurrentSession().createQuery("from AloneParameter where PKEY=?");
|
||||||
|
// 设置查询参数,去除参数键前后的空格
|
||||||
|
sqlquery.setString(0, key.trim());
|
||||||
|
// 抑制未检查类型转换的警告
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
// 执行查询并将结果存储在列表中
|
||||||
|
List<AloneParameter> list = sqlquery.list();
|
||||||
|
// 如果列表中有元素,返回第一个元素
|
||||||
|
if (list.size() > 0) {
|
||||||
|
return list.get(0);
|
||||||
|
} else {
|
||||||
|
// 否则返回 null
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
package com.farm.parameter.exception;
|
||||||
|
|
||||||
|
public class KeyExistException extends Exception {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static final long serialVersionUID = -6064027268304270441L;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,48 @@
|
|||||||
|
package com.farm.parameter.service;
|
||||||
|
|
||||||
|
import com.farm.core.auth.domain.LoginUser;
|
||||||
|
import com.farm.parameter.domain.AloneApplog;
|
||||||
|
|
||||||
|
|
||||||
|
/**系统日志
|
||||||
|
* @author MAC_wd
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public interface AloneApplogServiceInter {
|
||||||
|
/**
|
||||||
|
*新增实体
|
||||||
|
*
|
||||||
|
* @param entity
|
||||||
|
*/
|
||||||
|
public AloneApplog insertEntity(AloneApplog entity,LoginUser user);
|
||||||
|
/**
|
||||||
|
*修改实体
|
||||||
|
*
|
||||||
|
* @param entity
|
||||||
|
*/
|
||||||
|
public AloneApplog editEntity(AloneApplog entity,LoginUser user);
|
||||||
|
/**
|
||||||
|
*删除实体
|
||||||
|
*
|
||||||
|
* @param entity
|
||||||
|
*/
|
||||||
|
public void deleteEntity(String entity,LoginUser user);
|
||||||
|
/**
|
||||||
|
*获得实体
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public AloneApplog getEntity(String id);
|
||||||
|
|
||||||
|
/**写入日志
|
||||||
|
* @param describes 内容
|
||||||
|
* @param appuser 操作人
|
||||||
|
* @param level 日志等级
|
||||||
|
* @param method 方法
|
||||||
|
* @param classname 类
|
||||||
|
* @param ip
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public AloneApplog log(String describes,String appuser,String level,String method,String classname,String ip);
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
package com.farm.parameter.service;
|
||||||
|
|
||||||
|
import com.farm.parameter.domain.AloneDictionaryType;
|
||||||
|
import com.farm.core.auth.domain.LoginUser;
|
||||||
|
|
||||||
|
|
||||||
|
public interface DictionaryTypeServiceInter {
|
||||||
|
/**
|
||||||
|
* 通过一个键获得一个应用配置字符串值
|
||||||
|
*/
|
||||||
|
public String getConfigValue(String key);
|
||||||
|
|
||||||
|
|
||||||
|
public void deleteEntity(String entity, LoginUser user);
|
||||||
|
|
||||||
|
public AloneDictionaryType editEntity(AloneDictionaryType entity,
|
||||||
|
LoginUser user);
|
||||||
|
|
||||||
|
public AloneDictionaryType getEntity(String id);
|
||||||
|
|
||||||
|
public AloneDictionaryType insertEntity(AloneDictionaryType entity,
|
||||||
|
LoginUser user);
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in new issue