基础业务CRUD
parent
90e8b2b608
commit
2c35b0065e
@ -0,0 +1,56 @@
|
|||||||
|
package cn.estsh.i3plus.core.api.iservice.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
||||||
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||||
|
import cn.estsh.i3plus.pojo.platform.bean.Department;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : 部门业务服务接口
|
||||||
|
* @Reference :
|
||||||
|
* @Author : yunhao
|
||||||
|
* @Date : 2018-10-24 20:39
|
||||||
|
* @Modify :
|
||||||
|
**/
|
||||||
|
public interface IDepartmentService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加部门
|
||||||
|
* @param department
|
||||||
|
*/
|
||||||
|
void insertDepartment(Department department);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id删除部门
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
void deleteDepartmentById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改部门信息
|
||||||
|
* @param department
|
||||||
|
*/
|
||||||
|
void updateDepartment(Department department);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部部门
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<Department> findDepartmentAll();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询部门
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Department getDepartmentById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按条件分页查询部门信息
|
||||||
|
* @param department
|
||||||
|
* @param pager
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
ListPager<Department> findDepartmentByPager(Department department, Pager pager);
|
||||||
|
}
|
@ -0,0 +1,47 @@
|
|||||||
|
package cn.estsh.i3plus.core.api.iservice.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.platform.bean.LogOperate;
|
||||||
|
import cn.estsh.i3plus.pojo.platform.bean.LogOperate;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : 操作日志服务接口
|
||||||
|
* @Reference :
|
||||||
|
* @Author : yunhao
|
||||||
|
* @Date : 2018-10-25 13:49
|
||||||
|
* @Modify :
|
||||||
|
**/
|
||||||
|
public interface ILogOperateService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加操作日志
|
||||||
|
* @param logOperate
|
||||||
|
*/
|
||||||
|
void insertLogOperate(LogOperate logOperate);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除操作日志
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
void deleteLogOperateById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改操作日志
|
||||||
|
* @param logOperate
|
||||||
|
*/
|
||||||
|
void updateLogOperate(LogOperate logOperate);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查找所有操作日志
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<LogOperate> findLogOperateAll();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查找操作日志
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
LogOperate getLogOperateById(String id);
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
package cn.estsh.i3plus.core.api.iservice.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.platform.bean.LogSystem;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : 系统日志服务接口
|
||||||
|
* @Reference :
|
||||||
|
* @Author : yunhao
|
||||||
|
* @Date : 2018-10-25 10:36
|
||||||
|
* @Modify :
|
||||||
|
**/
|
||||||
|
public interface ILogSystemService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加系统日志
|
||||||
|
* @param logSystem
|
||||||
|
*/
|
||||||
|
void insertLogSystem(LogSystem logSystem);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除日志
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
void deleteLogSystemById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加系统日志
|
||||||
|
* @param logSystem
|
||||||
|
*/
|
||||||
|
void updateLogSystem(LogSystem logSystem);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部日志
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<LogSystem> findLogSystemAll();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询系统日志
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
LogSystem getLogSystemById(String id);
|
||||||
|
}
|
@ -0,0 +1,69 @@
|
|||||||
|
package cn.estsh.i3plus.core.api.iservice.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
||||||
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||||
|
import cn.estsh.i3plus.pojo.platform.bean.Position;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : 岗位服务接口
|
||||||
|
* @Reference :
|
||||||
|
* @Author : yunhao
|
||||||
|
* @Date : 2018-10-19 16:36
|
||||||
|
* @Modify :
|
||||||
|
**/
|
||||||
|
public interface IPositionService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改数据
|
||||||
|
*
|
||||||
|
* @param position
|
||||||
|
*/
|
||||||
|
void updatePosition(Position position);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据Key 删除数据
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
void deletePositionById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增数据
|
||||||
|
*
|
||||||
|
* @param position
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Position insertPosition(Position position);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有数据
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List findPositionAll();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据Key 数据
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Position getPositionById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据岗位信息进行查找
|
||||||
|
* @param position
|
||||||
|
* @param pager
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
ListPager findPositionByPager(Position position, Pager pager);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id批量删除岗位
|
||||||
|
* @param ids id数组
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
void deletePositionByIds(String[] ids);
|
||||||
|
}
|
@ -0,0 +1,45 @@
|
|||||||
|
package cn.estsh.i3plus.core.api.iservice.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.platform.bean.SysConfig;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : 系统参数服务接口
|
||||||
|
* @Reference :
|
||||||
|
* @Author : yunhao
|
||||||
|
* @Date : 2018-10-25 9:21
|
||||||
|
* @Modify :
|
||||||
|
**/
|
||||||
|
public interface ISysConfigService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加系统参数
|
||||||
|
* @param sysConfig
|
||||||
|
*/
|
||||||
|
void insertSysConfig(SysConfig sysConfig);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除系统参数
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
void deleteSysConfigById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改系统参数
|
||||||
|
* @param sysConfig
|
||||||
|
*/
|
||||||
|
void updateSysConfig(SysConfig sysConfig);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部系统参数
|
||||||
|
*/
|
||||||
|
List<SysConfig> findSysConfigAll();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询系统参数
|
||||||
|
* @param Id
|
||||||
|
*/
|
||||||
|
SysConfig getSysConfigById(String Id);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
package cn.estsh.i3plus.core.api.iservice.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.platform.bean.SysFile;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : 文件资源服务服务接口
|
||||||
|
* @Reference :
|
||||||
|
* @Author : yunhao
|
||||||
|
* @Date : 2018-10-25 16:20
|
||||||
|
* @Modify :
|
||||||
|
**/
|
||||||
|
public interface ISysFileService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加文件资源信息
|
||||||
|
* @param sysFile
|
||||||
|
*/
|
||||||
|
void insertSysFile(SysFile sysFile);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除文件资源小新
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
void deleteSysFileById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改文件资源信息
|
||||||
|
* @param sysFile
|
||||||
|
*/
|
||||||
|
void updateSysFile(SysFile sysFile);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部文件资源信息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<SysFile> findSysFileAll();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询文件资源信息
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
SysFile getSysFileById(String id);
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
package cn.estsh.i3plus.core.api.iservice.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.platform.bean.SysMessage;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : 消息业务服务接口
|
||||||
|
* @Reference :
|
||||||
|
* @Author : yunhao
|
||||||
|
* @Date : 2018-10-25 17:10
|
||||||
|
* @Modify :
|
||||||
|
**/
|
||||||
|
public interface ISysMessageService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加消息
|
||||||
|
* @param sysMessage
|
||||||
|
*/
|
||||||
|
void insertSysMessage(SysMessage sysMessage);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除消息
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
void deleteSysMessageById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改消息
|
||||||
|
* @param sysMessage
|
||||||
|
*/
|
||||||
|
void updateSysMessage(SysMessage sysMessage);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部信息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<SysMessage> findSysMessageAll();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询消息
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
SysMessage getSysMessageById(String id);
|
||||||
|
}
|
@ -0,0 +1,47 @@
|
|||||||
|
package cn.estsh.i3plus.core.api.iservice.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.platform.bean.Tool;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : 硬件服务接口
|
||||||
|
* @Reference :
|
||||||
|
* @Author : yunhao
|
||||||
|
* @Date : 2018-10-25 20:20
|
||||||
|
* @Modify :
|
||||||
|
**/
|
||||||
|
public interface IToolService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加硬件
|
||||||
|
* @param tool
|
||||||
|
*/
|
||||||
|
void insertTool(Tool tool);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除硬件
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
void deleteToolById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改硬件
|
||||||
|
* @param tool
|
||||||
|
*/
|
||||||
|
void updateTool(Tool tool);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查找全部硬件
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<Tool> findToolAll();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查找硬件
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Tool getToolById(String id);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,129 @@
|
|||||||
|
package cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.core.api.iservice.busi.IDepartmentService;
|
||||||
|
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
||||||
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||||
|
import cn.estsh.i3plus.pojo.base.common.PagerHelper;
|
||||||
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
||||||
|
import cn.estsh.i3plus.pojo.platform.bean.Department;
|
||||||
|
import cn.estsh.i3plus.pojo.platform.bean.Organize;
|
||||||
|
import cn.estsh.i3plus.pojo.platform.repository.DepartmentRepository;
|
||||||
|
import cn.estsh.i3plus.pojo.platform.repository.OrganizeRepository;
|
||||||
|
import cn.estsh.i3plus.pojo.platform.sqlpack.CoreHqlPack;
|
||||||
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
||||||
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum;
|
||||||
|
import cn.estsh.impp.framework.boot.util.ValidatorBean;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : 部门服务接口实现
|
||||||
|
* @Reference :
|
||||||
|
* @Author : yunhao
|
||||||
|
* @Date : 2018-10-24 20:47
|
||||||
|
* @Modify :
|
||||||
|
**/
|
||||||
|
@Service
|
||||||
|
public class DepartmentServiceImpl implements IDepartmentService {
|
||||||
|
public static final Logger LOGGER = LoggerFactory.getLogger(DepartmentServiceImpl.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DepartmentRepository departmentRDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private OrganizeRepository organizeRDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insertDepartment(Department department) {
|
||||||
|
// 查询父级部门名称
|
||||||
|
if (department.getParentId() != null && department.getParentId() > 0) {
|
||||||
|
LOGGER.info("部门信息 DEPARTMENT :{}", department.getParentId());
|
||||||
|
Department parentPosition = departmentRDao.getById(department.getParentId());
|
||||||
|
ValidatorBean.checkNotNull(parentPosition);
|
||||||
|
|
||||||
|
department.setRedParentName(parentPosition.getDepartmentName());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询所属组织名称
|
||||||
|
LOGGER.info("组织信息 ORGANIZE :{}", department.getOrganizeId());
|
||||||
|
Organize organize = organizeRDao.getById(department.getOrganizeId());
|
||||||
|
ValidatorBean.checkNotNull(organize);
|
||||||
|
|
||||||
|
department.setRedOrganizeName(organize.getName());
|
||||||
|
|
||||||
|
// 新增部门
|
||||||
|
LOGGER.info("部门信息 DEPARTMENT {}",department);
|
||||||
|
departmentRDao.insert(department);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteDepartmentById(String id) {
|
||||||
|
// 查询是否存在子级
|
||||||
|
LOGGER.info("部门信息 DEPARTMENT :{}", id);
|
||||||
|
if (departmentRDao.findByPropertyCount("parentId",id) > 0) {
|
||||||
|
throw ImppExceptionBuilder.newInstance()
|
||||||
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
||||||
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
||||||
|
.setErrorDetail("存在子节点无法删除!")
|
||||||
|
.setErrorSolution("请重新操作")
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除部门
|
||||||
|
LOGGER.info("部门信息 DEPARTMENT :{}", id);
|
||||||
|
departmentRDao.deleteById(Long.parseLong(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateDepartment(Department department) {
|
||||||
|
// 查询父级部门名称
|
||||||
|
if (department.getParentId() != null && department.getParentId() > 0) {
|
||||||
|
LOGGER.info("部门信息 DEPARTMENT :{}", department.getParentId());
|
||||||
|
Department parentPosition = departmentRDao.getById(department.getParentId());
|
||||||
|
ValidatorBean.checkNotNull(parentPosition);
|
||||||
|
|
||||||
|
department.setRedParentName(parentPosition.getDepartmentName());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询所属组织名称
|
||||||
|
LOGGER.info("组织信息 ORGANIZE :{}", department.getOrganizeId());
|
||||||
|
Organize organize = organizeRDao.getById(department.getOrganizeId());
|
||||||
|
ValidatorBean.checkNotNull(organize);
|
||||||
|
|
||||||
|
department.setRedOrganizeName(organize.getName());
|
||||||
|
|
||||||
|
// 新增部门
|
||||||
|
LOGGER.info("部门信息 DEPARTMENT :{}",department);
|
||||||
|
departmentRDao.update(department);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Department> findDepartmentAll() {
|
||||||
|
LOGGER.info("部门信息 DEPARTMENT findAll");
|
||||||
|
return departmentRDao.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Department getDepartmentById(String id) {
|
||||||
|
LOGGER.info("部门信息 DEPARTMENT id:{}",id);
|
||||||
|
return departmentRDao.getById(Long.parseLong(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ListPager<Department> findDepartmentByPager(Department department, Pager pager) {
|
||||||
|
if (department == null) {
|
||||||
|
pager = PagerHelper.getPager(pager, departmentRDao.listCount());
|
||||||
|
// TODO 分页日志格式 排序
|
||||||
|
return new ListPager(departmentRDao.listPager(pager),pager);
|
||||||
|
} else {
|
||||||
|
String hqlPack = CoreHqlPack.packHqlPosition(department);
|
||||||
|
pager = PagerHelper.getPager(pager, departmentRDao.findByHqlWhereCount(hqlPack));
|
||||||
|
// TODO 分页日志格式 排序
|
||||||
|
return new ListPager(departmentRDao.findByHqlWherePage(hqlPack + department.getOrderByParam(),pager),pager);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,56 @@
|
|||||||
|
package cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.core.api.iservice.busi.ILogOperateService;
|
||||||
|
import cn.estsh.i3plus.pojo.platform.bean.LogOperate;
|
||||||
|
import cn.estsh.i3plus.pojo.platform.repository.LogOperateRepository;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : 操作日志服务接口实现
|
||||||
|
* @Reference :
|
||||||
|
* @Author : yunhao
|
||||||
|
* @Date : 2018-10-25 13:54
|
||||||
|
* @Modify :
|
||||||
|
**/
|
||||||
|
@Service
|
||||||
|
public class LogOperateServiceImpl implements ILogOperateService {
|
||||||
|
public static final Logger LOGGER = LoggerFactory.getLogger(LogOperateServiceImpl.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public LogOperateRepository logOperateRDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insertLogOperate(LogOperate logOperate) {
|
||||||
|
LOGGER.info("操作日志 LOG_ACTION :{}",logOperate);
|
||||||
|
logOperateRDao.insert(logOperate);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteLogOperateById(String id) {
|
||||||
|
LOGGER.info("操作日志 LOG_ACTION id:{}",id);
|
||||||
|
logOperateRDao.deleteById(Long.parseLong(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateLogOperate(LogOperate logOperate) {
|
||||||
|
LOGGER.info("操作日志 LOG_ACTION :{}",logOperate);
|
||||||
|
logOperateRDao.update(logOperate);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<LogOperate> findLogOperateAll() {
|
||||||
|
LOGGER.info("操作日志 LOG_ACTION find-all");
|
||||||
|
return logOperateRDao.findAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LogOperate getLogOperateById(String id) {
|
||||||
|
LOGGER.info("操作日志 LOG_ACTION id:{}",id);
|
||||||
|
return logOperateRDao.getById(Long.parseLong(id));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,56 @@
|
|||||||
|
package cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.core.api.iservice.busi.ILogSystemService;
|
||||||
|
import cn.estsh.i3plus.pojo.platform.bean.LogSystem;
|
||||||
|
import cn.estsh.i3plus.pojo.platform.repository.LogSystemRepository;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : 系统日志服务接口实现
|
||||||
|
* @Reference :
|
||||||
|
* @Author : yunhao
|
||||||
|
* @Date : 2018-10-25 10:41
|
||||||
|
* @Modify :
|
||||||
|
**/
|
||||||
|
@Service
|
||||||
|
public class LogSystemServiceImpl implements ILogSystemService {
|
||||||
|
public static final Logger LOGGER = LoggerFactory.getLogger(LogSystemServiceImpl.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private LogSystemRepository logSystemRDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insertLogSystem(LogSystem logSystem) {
|
||||||
|
LOGGER.info("系统日志 SYS_SYSTEM {}",logSystem);
|
||||||
|
logSystemRDao.insert(logSystem);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteLogSystemById(String id) {
|
||||||
|
LOGGER.info("系统日志 SYS_SYSTEM id:{}",id);
|
||||||
|
logSystemRDao.deleteById(Long.parseLong(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateLogSystem(LogSystem logSystem) {
|
||||||
|
LOGGER.info("系统日志 SYS_SYSTEM {}",logSystem);
|
||||||
|
logSystemRDao.update(logSystem);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<LogSystem> findLogSystemAll() {
|
||||||
|
LOGGER.info("系统日志 LOG_SYSTEM find-all");
|
||||||
|
return logSystemRDao.findAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LogSystem getLogSystemById(String id) {
|
||||||
|
LOGGER.info("系统日志 LOG_SYSTEM id:{}",id);
|
||||||
|
return logSystemRDao.getById(Long.parseLong(id));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,126 @@
|
|||||||
|
package cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.core.api.iservice.busi.IPositionService;
|
||||||
|
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
||||||
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||||
|
import cn.estsh.i3plus.pojo.base.common.PagerHelper;
|
||||||
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
||||||
|
import cn.estsh.i3plus.pojo.base.tool.HqlPack;
|
||||||
|
import cn.estsh.i3plus.pojo.platform.bean.Position;
|
||||||
|
import cn.estsh.i3plus.pojo.platform.repository.PositionRepository;
|
||||||
|
import cn.estsh.i3plus.pojo.platform.sqlpack.CoreHqlPack;
|
||||||
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
||||||
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum;
|
||||||
|
import cn.estsh.impp.framework.boot.util.ResultBean;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.lang.reflect.Array;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : 岗位服务接口实现
|
||||||
|
* @Reference :
|
||||||
|
* @Author : yunhao
|
||||||
|
* @Date : 2018-10-19 16:36
|
||||||
|
* @Modify :
|
||||||
|
**/
|
||||||
|
@Service
|
||||||
|
public class PositionServiceImpl implements IPositionService {
|
||||||
|
public static final Logger LOGGER = LoggerFactory.getLogger(PositionServiceImpl.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PositionRepository positionRDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Position insertPosition(Position position) {
|
||||||
|
// 查询父级岗位名称
|
||||||
|
if (position.getParentId() != null) {
|
||||||
|
LOGGER.info("岗位信息 POSITION parentId:{}", position.getParentId());
|
||||||
|
Position parentPosition = positionRDao.getById(position.getParentId());
|
||||||
|
position.setRedParentName(parentPosition.getPositionName());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加岗位
|
||||||
|
LOGGER.info("岗位信息 POSITION position:{}", position);
|
||||||
|
return positionRDao.insert(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updatePosition(Position position) {
|
||||||
|
// 查询父级岗位名称
|
||||||
|
if (position.getParentId() != null) {
|
||||||
|
LOGGER.info("岗位信息 POSITION parentId:{}", position.getParentId());
|
||||||
|
Position parentPosition = positionRDao.getById(position.getParentId());
|
||||||
|
position.setRedParentName(parentPosition.getPositionName());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改岗位信息
|
||||||
|
LOGGER.info("岗位信息 POSITION position:{}", position);
|
||||||
|
positionRDao.update(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deletePositionById(String id) {
|
||||||
|
// 查询是否存在子级
|
||||||
|
LOGGER.info("岗位信息 POSITION id:{}", id);
|
||||||
|
long positionCount = positionRDao.findByPropertyCount("parentId",id);
|
||||||
|
if (positionCount >= 1) {
|
||||||
|
throw ImppExceptionBuilder.newInstance()
|
||||||
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
||||||
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
||||||
|
.setErrorDetail("存在子节点无法删除!")
|
||||||
|
.setErrorSolution("请重新操作")
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除岗位信息
|
||||||
|
LOGGER.info("岗位信息 POSITION id:{}", id);
|
||||||
|
positionRDao.deleteById(Long.parseLong(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List findPositionAll() {
|
||||||
|
LOGGER.info("岗位信息 find-all");
|
||||||
|
return positionRDao.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Position getPositionById(String id) {
|
||||||
|
LOGGER.info("岗位信息 根据Id查询岗位信息 id:{}", id);
|
||||||
|
return positionRDao.getById(Long.parseLong(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ListPager findPositionByPager(Position position, Pager pager) {
|
||||||
|
if (position == null) {
|
||||||
|
pager = PagerHelper.getPager(pager, positionRDao.listCount());
|
||||||
|
return new ListPager(positionRDao.listPager(pager),pager);
|
||||||
|
} else {
|
||||||
|
String hqlPack = CoreHqlPack.packHqlPosition(position);
|
||||||
|
pager = PagerHelper.getPager(pager, positionRDao.findByHqlWhereCount(hqlPack));
|
||||||
|
return new ListPager(positionRDao.findByHqlWherePage(hqlPack + position.getOrderByParam(),pager),pager);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deletePositionByIds(String[] ids) {
|
||||||
|
long positionCount = positionRDao.findByHqlCount(CoreHqlPack.packHqlIds("id",ids));
|
||||||
|
if (positionCount >= 1) {
|
||||||
|
throw ImppExceptionBuilder.newInstance()
|
||||||
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
||||||
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
||||||
|
.setErrorDetail("存在子节点无法删除!")
|
||||||
|
.setErrorSolution("请重新操作")
|
||||||
|
.build();
|
||||||
|
}else {
|
||||||
|
for(String idStr : ids){
|
||||||
|
positionRDao.deleteById(Long.parseLong(idStr));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,56 @@
|
|||||||
|
package cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.core.api.iservice.busi.ISysConfigService;
|
||||||
|
import cn.estsh.i3plus.pojo.platform.bean.SysConfig;
|
||||||
|
import cn.estsh.i3plus.pojo.platform.repository.SysConfigRepository;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : 系统参数服务接口实现
|
||||||
|
* @Reference :
|
||||||
|
* @Author : yunhao
|
||||||
|
* @Date : 2018-10-25 9:25
|
||||||
|
* @Modify :
|
||||||
|
**/
|
||||||
|
@Service
|
||||||
|
public class SysConfigServiceImpl implements ISysConfigService {
|
||||||
|
public static final Logger LOGGER = LoggerFactory.getLogger(SysConfigServiceImpl.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysConfigRepository SysConfigRDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insertSysConfig(SysConfig sysConfig) {
|
||||||
|
LOGGER.info("系统参数 SYS_CONFIG :{}",sysConfig);
|
||||||
|
SysConfigRDao.insert(sysConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteSysConfigById(String id) {
|
||||||
|
LOGGER.info("系统参数 SYS_CONFIG :{}",id);
|
||||||
|
SysConfigRDao.deleteById(Long.parseLong(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateSysConfig(SysConfig sysConfig) {
|
||||||
|
LOGGER.info("系统参数 SYS_CONFIG :{}",sysConfig);
|
||||||
|
SysConfigRDao.update(sysConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SysConfig> findSysConfigAll() {
|
||||||
|
LOGGER.info("系统参数 SYS_CONFIG find-all");
|
||||||
|
return SysConfigRDao.findAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SysConfig getSysConfigById(String Id) {
|
||||||
|
LOGGER.info("系统参数 SYS_CONFIG id:{}",Id);
|
||||||
|
return SysConfigRDao.getById(Long.parseLong(Id));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,56 @@
|
|||||||
|
package cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.core.api.iservice.busi.ISysFileService;
|
||||||
|
import cn.estsh.i3plus.pojo.platform.bean.SysFile;
|
||||||
|
import cn.estsh.i3plus.pojo.platform.repository.SysFileRepository;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : 文件资源服务接口
|
||||||
|
* @Reference :
|
||||||
|
* @Author : yunhao
|
||||||
|
* @Date : 2018-10-25 16:28
|
||||||
|
* @Modify :
|
||||||
|
**/
|
||||||
|
@Service
|
||||||
|
public class SysFileServiceImpl implements ISysFileService {
|
||||||
|
public static final Logger LOGGER = LoggerFactory.getLogger(SysFileServiceImpl.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public SysFileRepository sysFileRDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insertSysFile(SysFile sysFile) {
|
||||||
|
LOGGER.info("文件资源 SYS_FILE :{}",sysFile);
|
||||||
|
sysFileRDao.insert(sysFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteSysFileById(String id) {
|
||||||
|
LOGGER.info("文件资源 SYS_FILE id:{}",id);
|
||||||
|
sysFileRDao.deleteById(Long.parseLong(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateSysFile(SysFile sysFile) {
|
||||||
|
LOGGER.info("文件资源 SYS_FILE :{}",sysFile);
|
||||||
|
sysFileRDao.update(sysFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SysFile> findSysFileAll() {
|
||||||
|
LOGGER.info("文件资源 SYS_FILE find-aLl");
|
||||||
|
return sysFileRDao.findAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SysFile getSysFileById(String id) {
|
||||||
|
LOGGER.info("文件资源 SYS_FILE id:{}",id);
|
||||||
|
return sysFileRDao.getById(Long.parseLong(id));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,57 @@
|
|||||||
|
package cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.core.api.iservice.busi.ISysMessageService;
|
||||||
|
import cn.estsh.i3plus.pojo.platform.bean.SysMessage;
|
||||||
|
import cn.estsh.i3plus.pojo.platform.repository.SysMessageRepository;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : 消息服务接口实现
|
||||||
|
* @Reference :
|
||||||
|
* @Author : yunhao
|
||||||
|
* @Date : 2018-10-25 18:02
|
||||||
|
* @Modify :
|
||||||
|
**/
|
||||||
|
@Service
|
||||||
|
public class SysMessageServiceImpl implements ISysMessageService {
|
||||||
|
public static final Logger LOGGER = LoggerFactory.getLogger(SysMessageServiceImpl.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public SysMessageRepository sysMessageRDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insertSysMessage(SysMessage sysMessage) {
|
||||||
|
LOGGER.info("系统信息 SYS_MESSAGE :{}",sysMessage);
|
||||||
|
sysMessageRDao.insert(sysMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteSysMessageById(String id) {
|
||||||
|
LOGGER.info("系统信息 SYS_MESSAGE id:{}",id);
|
||||||
|
sysMessageRDao.deleteById(Long.parseLong(id));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateSysMessage(SysMessage sysMessage) {
|
||||||
|
LOGGER.info("系统信息 SYS_MESSAGE :{}",sysMessage);
|
||||||
|
sysMessageRDao.update(sysMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SysMessage> findSysMessageAll() {
|
||||||
|
LOGGER.info("系统信息 SYS_MESSAGE find-all");
|
||||||
|
return sysMessageRDao.findAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SysMessage getSysMessageById(String id) {
|
||||||
|
LOGGER.info("系统信息 SYS_MESSAGE id:{}",id);
|
||||||
|
return sysMessageRDao.getById(Long.parseLong(id));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,56 @@
|
|||||||
|
package cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.core.api.iservice.busi.IToolService;
|
||||||
|
import cn.estsh.i3plus.pojo.platform.bean.Tool;
|
||||||
|
import cn.estsh.i3plus.pojo.platform.repository.ToolRepository;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : 硬件服务接口实现
|
||||||
|
* @Reference :
|
||||||
|
* @Author : yunhao
|
||||||
|
* @Date : 2018-10-25 20:29
|
||||||
|
* @Modify :
|
||||||
|
**/
|
||||||
|
@Service
|
||||||
|
public class ToolServiceImpl implements IToolService {
|
||||||
|
public static final Logger LOGGER = LoggerFactory.getLogger(ToolServiceImpl.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ToolRepository toolRDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insertTool(Tool tool) {
|
||||||
|
LOGGER.info("硬件 TOOL :{}",tool);
|
||||||
|
toolRDao.insert(tool);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteToolById(String id) {
|
||||||
|
LOGGER.info("硬件 TOOL id:{}",id);
|
||||||
|
toolRDao.deleteById(Long.parseLong(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateTool(Tool tool) {
|
||||||
|
LOGGER.info("硬件 TOOL :{}",tool);
|
||||||
|
toolRDao.update(tool);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Tool> findToolAll() {
|
||||||
|
LOGGER.info("硬件 TOOL find-all");
|
||||||
|
return toolRDao.findAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Tool getToolById(String id) {
|
||||||
|
LOGGER.info("硬件 TOOL id:{}",id);
|
||||||
|
return toolRDao.getById(Long.parseLong(id));
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue