操作日志 完成

系统日志 完成
系统消息 完成
yun-zuoyi
yunhao.wang 7 years ago
parent d4deede0a9
commit 8cfa440e92

@ -36,7 +36,7 @@ public interface ILogOperateService {
* *
* @return * @return
*/ */
List<LogOperate> findLogOperateAll(); List<LogOperate> listLogOperate();
/** /**
* id * id

@ -35,7 +35,7 @@ public interface ILogSystemService {
* *
* @return * @return
*/ */
List<LogSystem> findLogSystemAll(); List<LogSystem> listLogSystem();
/** /**
* id * id

@ -35,7 +35,7 @@ public interface ISysFileService {
* *
* @return * @return
*/ */
List<SysFile> findSysFileAll(); List<SysFile> listSysFile();
/** /**
* id * id

@ -35,7 +35,7 @@ public interface ISysMessageService {
* *
* @return * @return
*/ */
List<SysMessage> findSysMessageAll(); List<SysMessage> listSysMessage();
/** /**
* id * id

@ -39,7 +39,7 @@ public class DepartmentController {
public IDepartmentService departmentService; public IDepartmentService departmentService;
@PutMapping(value = "/insert") @PostMapping(value = "/insert")
@ApiOperation(value = "添加部门", notes = "返回内容添加部门") @ApiOperation(value = "添加部门", notes = "返回内容添加部门")
public ResultBean insertDepartment(Department department) { public ResultBean insertDepartment(Department department) {
try { try {
@ -70,7 +70,6 @@ public class DepartmentController {
@ApiOperation(value = "修改部门", notes = "根据部门id修改信息") @ApiOperation(value = "修改部门", notes = "根据部门id修改信息")
public ResultBean updateDepartmentById(Department department) { public ResultBean updateDepartmentById(Department department) {
try { try {
//登陆用户 //登陆用户
SessionUser user = AuthUtil.getSessionUser(); SessionUser user = AuthUtil.getSessionUser();
@ -78,7 +77,8 @@ public class DepartmentController {
ValidatorBean.beginValid(department) ValidatorBean.beginValid(department)
.checkNotZero("id", department.getId()) .checkNotZero("id", department.getId())
.notNull("departmentName", department.getDepartmentName()) .notNull("departmentName", department.getDepartmentName())
.notNull("departmentCode", department.getDepartmentCode()); .notNull("departmentCode", department.getDepartmentCode())
.checkNotZero("organizeId",department.getOrganizeId());
//修改初始化 //修改初始化
ConvertBean.modelUpdate(department, user); ConvertBean.modelUpdate(department, user);
@ -96,7 +96,7 @@ public class DepartmentController {
@DeleteMapping(value = "/delete/{id}") @DeleteMapping(value = "/delete/{id}")
@ApiOperation(value = "删除部门", notes = "根据部门id删除信息") @ApiOperation(value = "删除部门", notes = "根据部门id删除信息")
public ResultBean deleteDepartment(String id) { public ResultBean deleteDepartment(@PathVariable("id") String id) {
try { try {
//条件验证 //条件验证
ValidatorBean.checkNotNull(id, "id为空。"); ValidatorBean.checkNotNull(id, "id为空。");
@ -168,7 +168,7 @@ public class DepartmentController {
} }
} }
@DeleteMapping(value = "/delete") @DeleteMapping(value = "/batch-delete")
@ApiOperation(value = "根据id批量删除", notes = "根据id批量删除") @ApiOperation(value = "根据id批量删除", notes = "根据id批量删除")
public ResultBean deleteDepartmentByIds(@RequestBody String[] ids) { public ResultBean deleteDepartmentByIds(@RequestBody String[] ids) {
try { try {

@ -65,4 +65,60 @@ public class EnumController {
Arrays.asList(CommonEnumUtil.USER_STATUS.values())); Arrays.asList(CommonEnumUtil.USER_STATUS.values()));
} }
@GetMapping("/log-level")
@ApiOperation(value = "日志等级", notes = "日志等级")
public ResultBean getLogLevel(){
return new ResultBean(true, "操作成功",
Arrays.asList(ImppEnumUtil.LOG_LEVEL.values()));
}
@GetMapping("/soft-type")
@ApiOperation(value = "软件类型", notes = "软件类型")
public ResultBean getSoftType(){
return new ResultBean(true, "操作成功",
Arrays.asList(CommonEnumUtil.SOFT_TYPE.values()));
}
@GetMapping("/log-type")
@ApiOperation(value = "操作日志类型", notes = "操作日志类型")
public ResultBean getLogType(){
return new ResultBean(true, "操作成功",
Arrays.asList(ImppEnumUtil.LOG_TYPE.values()));
}
@GetMapping("/user-message-status")
@ApiOperation(value = "用户消息状态", notes = "用户消息状态")
public ResultBean getUserMessageStatus(){
return new ResultBean(true, "操作成功",
Arrays.asList(ImppEnumUtil.USER_MESSAGE_STATUS.values()));
}
@GetMapping("/user-message-type")
@ApiOperation(value = "用户消息类型", notes = "用户消息类型")
public ResultBean getUserMessageType(){
return new ResultBean(true, "操作成功",
Arrays.asList(ImppEnumUtil.USER_MESSAGE_TYPE.values()));
}
@GetMapping("/tool-conn-type")
@ApiOperation(value = "硬件连接类型", notes = "硬件连接类型")
public ResultBean getToolConnType(){
return new ResultBean(true, "操作成功",
Arrays.asList(ImppEnumUtil.TOOL_CONN_TYPE.values()));
}
@GetMapping("/tool-data-type")
@ApiOperation(value = "硬件数据类型", notes = "硬件数据类型")
public ResultBean getToolDataType(){
return new ResultBean(true, "操作成功",
Arrays.asList(ImppEnumUtil.TOOL_DATA_TYPE.values()));
}
@GetMapping("/sys-param-type")
@ApiOperation(value = "系统参数类型", notes = "系统参数类型")
public ResultBean getSysParamType(){
return new ResultBean(true, "操作成功",
Arrays.asList(ImppEnumUtil.SYS_PARAM_TYPE.values()));
}
} }

@ -36,7 +36,7 @@ public class LogOperateController {
@Autowired @Autowired
private ILogOperateService logOperateService; private ILogOperateService logOperateService;
@PutMapping(value = "/insert") @PostMapping(value = "/insert")
@ApiOperation(value = "添加操作日志",notes = "添加操作日志") @ApiOperation(value = "添加操作日志",notes = "添加操作日志")
public ResultBean insertLogOperateController(LogOperate logOperate){ public ResultBean insertLogOperateController(LogOperate logOperate){
try { try {
@ -99,7 +99,7 @@ public class LogOperateController {
@ApiOperation(value = "查询全部操作日志",notes = "查询全部操作日志") @ApiOperation(value = "查询全部操作日志",notes = "查询全部操作日志")
public ResultBean findLogOperateAll(){ public ResultBean findLogOperateAll(){
try { try {
List<LogOperate> logOperateList = logOperateService.findLogOperateAll(); List<LogOperate> logOperateList = logOperateService.listLogOperate();
return ResultBean.success("查询成功") return ResultBean.success("查询成功")
.setResultList(logOperateList) .setResultList(logOperateList)
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()); .setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());

@ -36,7 +36,7 @@ public class LogSystemController {
private ILogSystemService logSystemService; private ILogSystemService logSystemService;
@PutMapping(value = "/insert") @PostMapping(value = "/insert")
@ApiOperation(value="新增系统日志",notes = "新增系统日志") @ApiOperation(value="新增系统日志",notes = "新增系统日志")
public ResultBean insertLogSystem(LogSystem logSystem) { public ResultBean insertLogSystem(LogSystem logSystem) {
try { try {
@ -96,11 +96,11 @@ public class LogSystemController {
} }
} }
@GetMapping(value = "/find-all") @GetMapping(value = "/list")
@ApiOperation(value = "查询全部系统日志",notes = "查询全部系统日志") @ApiOperation(value = "查询全部系统日志",notes = "查询全部系统日志")
public ResultBean findLogSystemAll(){ public ResultBean findLogSystemAll(){
try { try {
List<LogSystem> logSystemList = logSystemService.findLogSystemAll(); List<LogSystem> logSystemList = logSystemService.listLogSystem();
return ResultBean.success("查询成功") return ResultBean.success("查询成功")
.setResultList(logSystemList) .setResultList(logSystemList)
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()); .setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());

@ -49,7 +49,7 @@ public class PositionController {
//条件验证 //条件验证
ValidatorBean.beginValid(position) ValidatorBean.beginValid(position)
.notNull("positionName",position.getName()) .notNull("name",position.getName())
.notNull("positionCode",position.getPositionCode()); .notNull("positionCode",position.getPositionCode());
//新增初始化 //新增初始化

@ -15,10 +15,7 @@ import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
@ -39,7 +36,7 @@ public class SysFileController {
private ISysFileService sysFileService; private ISysFileService sysFileService;
@PutMapping(value = "/insert") @PostMapping(value = "/insert")
@ApiOperation(value = "添加文件资源",notes = "添加文件资源") @ApiOperation(value = "添加文件资源",notes = "添加文件资源")
public ResultBean insertSysFile(SysFile sysFile){ public ResultBean insertSysFile(SysFile sysFile){
try { try {
@ -84,11 +81,11 @@ public class SysFileController {
} }
} }
@GetMapping(value = "/find-all") @GetMapping(value = "/list")
@ApiOperation(value = "查询全部文件资源",notes = "查询全部文件资源") @ApiOperation(value = "查询全部文件资源",notes = "查询全部文件资源")
public ResultBean findSysFileAll(SysFile sysFile){ public ResultBean findSysFileAll(SysFile sysFile){
try { try {
List<SysFile> sysFileList = sysFileService.findSysFileAll(); List<SysFile> sysFileList = sysFileService.listSysFile();
return ResultBean.success("查询成功") return ResultBean.success("查询成功")
.setResultList(sysFileList) .setResultList(sysFileList)
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()); .setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());

@ -2,6 +2,7 @@ package cn.estsh.i3plus.core.apiservice.controller.busi;
import cn.estsh.i3plus.core.api.iservice.busi.ISysMessageService; import cn.estsh.i3plus.core.api.iservice.busi.ISysMessageService;
import cn.estsh.i3plus.platform.common.convert.ConvertBean; import cn.estsh.i3plus.platform.common.convert.ConvertBean;
import cn.estsh.i3plus.pojo.base.enumutil.ImppEnumUtil;
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil; import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
import cn.estsh.i3plus.pojo.platform.bean.SessionUser; import cn.estsh.i3plus.pojo.platform.bean.SessionUser;
import cn.estsh.i3plus.pojo.platform.bean.SysMessage; import cn.estsh.i3plus.pojo.platform.bean.SysMessage;
@ -35,7 +36,7 @@ public class SysMessageController {
@Autowired @Autowired
private ISysMessageService sysMessageService; private ISysMessageService sysMessageService;
@PutMapping(value = "/insert") @PostMapping(value = "/insert")
@ApiOperation(value = "新增消息",notes = "新增消息") @ApiOperation(value = "新增消息",notes = "新增消息")
public ResultBean insertSysMessage(SysMessage sysMessage){ public ResultBean insertSysMessage(SysMessage sysMessage){
try { try {
@ -46,11 +47,14 @@ public class SysMessageController {
ValidatorBean.beginValid(sysMessage) ValidatorBean.beginValid(sysMessage)
.notNull("messageTitle",sysMessage.getMessageTitle()) .notNull("messageTitle",sysMessage.getMessageTitle())
.notNull("messageContent",sysMessage.getMessageContent()) .notNull("messageContent",sysMessage.getMessageContent())
.notNull("messageSendId",sysMessage.getMessageSendId()) .checkNotZero("messageType",sysMessage.getMessageType())
.notNull("messageAcceptId",sysMessage.getMessageAcceptId()); .notNull("messageRecipientId",sysMessage.getMessageRecipientId());
// 添加初始化 // 添加初始化
ConvertBean.modelInitialize(sysMessage,user); ConvertBean.modelInitialize(sysMessage,user);
// sysMessage.setMessageSendId(user.getUser().getId());
// sysMessage.setRedSendName(user.getUser().getName());
sysMessage.setMessageStatus(ImppEnumUtil.USER_MESSAGE_STATUS.UNREAD.getValue());
// TODO 状态 status // TODO 状态 status
sysMessageService.insertSysMessage(sysMessage); sysMessageService.insertSysMessage(sysMessage);
@ -64,9 +68,9 @@ public class SysMessageController {
} }
} }
@DeleteMapping("/delete") @DeleteMapping("/delete/{id}")
@ApiOperation(value = "根据id删除消息",notes = "根据id删除消息") @ApiOperation(value = "根据id删除消息",notes = "根据id删除消息")
public ResultBean deleteSysMessageById(String id){ public ResultBean deleteSysMessageById(@PathVariable("id") String id){
try { try {
// 条件校验 // 条件校验
ValidatorBean.checkNotNull(id,"id不能为空"); ValidatorBean.checkNotNull(id,"id不能为空");
@ -93,11 +97,13 @@ public class SysMessageController {
ValidatorBean.beginValid(sysMessage) ValidatorBean.beginValid(sysMessage)
.notNull("messageTitle",sysMessage.getMessageTitle()) .notNull("messageTitle",sysMessage.getMessageTitle())
.notNull("messageContent",sysMessage.getMessageContent()) .notNull("messageContent",sysMessage.getMessageContent())
.notNull("messageSendId",sysMessage.getMessageSendId()) .checkNotZero("messageType",sysMessage.getMessageType())
.notNull("messageAcceptId",sysMessage.getMessageAcceptId()); .notNull("messageRecipientId",sysMessage.getMessageRecipientId());
// 添加初始化 // 添加初始化
ConvertBean.modelUpdate(sysMessage,user); ConvertBean.modelUpdate(sysMessage,user);
// sysMessage.setMessageSendId(user.getUser().getId());
// sysMessage.setRedSendName(user.getUser().getName());
// TODO 状态 status // TODO 状态 status
sysMessageService.updateSysMessage(sysMessage); sysMessageService.updateSysMessage(sysMessage);
@ -111,11 +117,11 @@ public class SysMessageController {
} }
} }
@GetMapping(value = "/find-all") @GetMapping(value = "/list")
@ApiOperation(value = "查询全部消息",notes = "查询全部消息") @ApiOperation(value = "查询全部消息",notes = "查询全部消息")
public ResultBean findSysConfigAll(){ public ResultBean findSysConfigAll(){
try { try {
List<SysMessage> sysMessageList = sysMessageService.findSysMessageAll(); List<SysMessage> sysMessageList = sysMessageService.listSysMessage();
return ResultBean.success("查询成功") return ResultBean.success("查询成功")
.setResultList(sysMessageList) .setResultList(sysMessageList)
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()); .setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());

@ -18,6 +18,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List; import java.util.List;
/** /**
@ -40,7 +41,7 @@ public class DepartmentServiceImpl implements IDepartmentService {
@Override @Override
public void insertDepartment(Department department) { public void insertDepartment(Department department) {
// 查询父级部门名称 // 查询父级部门名称
if (department.getParentId() != null && department.getParentId() > 0) { if (department.getParentId() != null && department.getParentId() > 0) {
LOGGER.info("部门信息 DEPARTMENT :{}", department.getParentId()); LOGGER.info("部门信息 DEPARTMENT :{}", department.getParentId());
Department parentPosition = departmentRDao.getById(department.getParentId()); Department parentPosition = departmentRDao.getById(department.getParentId());
ValidatorBean.checkNotNull(parentPosition); ValidatorBean.checkNotNull(parentPosition);
@ -49,11 +50,11 @@ public class DepartmentServiceImpl implements IDepartmentService {
} }
// 查询所属组织名称 // 查询所属组织名称
LOGGER.info("组织信息 ORGANIZE :{}", department.getOrganizeId()); LOGGER.info("组织信息 ORGANIZE :{}", department.getOrganizeId());
Organize organize = organizeRDao.getById(department.getOrganizeId()); Organize organize = organizeRDao.getById(department.getOrganizeId());
ValidatorBean.checkNotNull(organize); ValidatorBean.checkNotNull(organize);
department.setRedOrganizeName(organize.getName()); department.setRedOrganizeName(organize.getName());
// 新增部门 // 新增部门
LOGGER.info("部门信息 DEPARTMENT {}",department); LOGGER.info("部门信息 DEPARTMENT {}",department);
@ -64,7 +65,7 @@ public class DepartmentServiceImpl implements IDepartmentService {
public void deleteDepartmentById(String id) { public void deleteDepartmentById(String id) {
// 查询是否存在子级 // 查询是否存在子级
LOGGER.info("部门信息 DEPARTMENT :{}", id); LOGGER.info("部门信息 DEPARTMENT :{}", id);
if (departmentRDao.findByPropertyCount("parentId",id) > 0) { if (departmentRDao.findByPropertyCount("parentId",Long.parseLong(id)) > 0) {
throw ImppExceptionBuilder.newInstance() throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode()) .setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode()) .setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
@ -81,7 +82,7 @@ public class DepartmentServiceImpl implements IDepartmentService {
@Override @Override
public void updateDepartment(Department department) { public void updateDepartment(Department department) {
// 查询父级部门名称 // 查询父级部门名称
if (department.getParentId() != null && department.getParentId() > 0) { if (department.getParentId() != null && department.getParentId() > 0) {
LOGGER.info("部门信息 DEPARTMENT :{}", department.getParentId()); LOGGER.info("部门信息 DEPARTMENT :{}", department.getParentId());
Department parentPosition = departmentRDao.getById(department.getParentId()); Department parentPosition = departmentRDao.getById(department.getParentId());
ValidatorBean.checkNotNull(parentPosition); ValidatorBean.checkNotNull(parentPosition);
@ -90,14 +91,14 @@ public class DepartmentServiceImpl implements IDepartmentService {
} }
// 查询所属组织名称 // 查询所属组织名称
LOGGER.info("组织信息 ORGANIZE :{}", department.getOrganizeId()); LOGGER.info("组织信息 ORGANIZE organizeId:{}", department.getOrganizeId());
Organize organize = organizeRDao.getById(department.getOrganizeId()); Organize organize = organizeRDao.getById(department.getOrganizeId());
ValidatorBean.checkNotNull(organize); ValidatorBean.checkNotNull(organize);
department.setRedOrganizeName(organize.getName()); department.setRedOrganizeName(organize.getName());
// 新增部门 // 新增部门
LOGGER.info("部门信息 DEPARTMENT :{}",department); LOGGER.info("部门信息 DEPARTMENT department:{}",department);
departmentRDao.update(department); departmentRDao.update(department);
} }
@ -126,4 +127,5 @@ public class DepartmentServiceImpl implements IDepartmentService {
return new ListPager(departmentRDao.findByHqlWherePage(hqlPack + department.getOrderByParam(),pager),pager); return new ListPager(departmentRDao.findByHqlWherePage(hqlPack + department.getOrderByParam(),pager),pager);
} }
} }
} }

@ -43,9 +43,9 @@ public class LogOperateServiceImpl implements ILogOperateService {
} }
@Override @Override
public List<LogOperate> findLogOperateAll() { public List<LogOperate> listLogOperate() {
LOGGER.info("操作日志 LOG_ACTION find-all"); LOGGER.info("操作日志 LOG_ACTION list");
return logOperateRDao.findAll(); return logOperateRDao.list();
} }
@Override @Override

@ -43,9 +43,9 @@ public class LogSystemServiceImpl implements ILogSystemService {
} }
@Override @Override
public List<LogSystem> findLogSystemAll() { public List<LogSystem> listLogSystem() {
LOGGER.info("系统日志 LOG_SYSTEM find-all"); LOGGER.info("系统日志 LOG_SYSTEM list");
return logSystemRDao.findAll(); return logSystemRDao.list();
} }
@Override @Override

@ -12,10 +12,13 @@ import cn.estsh.i3plus.pojo.platform.sqlpack.CoreHqlPack;
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder; import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum; import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum;
import cn.estsh.impp.framework.boot.util.ResultBean; import cn.estsh.impp.framework.boot.util.ResultBean;
import cn.estsh.impp.framework.boot.util.ValidatorBean;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.lang.reflect.Array; import java.lang.reflect.Array;
import java.util.Arrays; import java.util.Arrays;
@ -38,9 +41,11 @@ public class PositionServiceImpl implements IPositionService {
@Override @Override
public Position insertPosition(Position position) { public Position insertPosition(Position position) {
// 查询父级岗位名称 // 查询父级岗位名称
if (position.getParentId() != null) { if (position.getParentId() != null && position.getParentId() > 0) {
LOGGER.info("岗位信息 POSITION parentId:{}", position.getParentId()); LOGGER.info("岗位信息 POSITION parentId:{}", position.getParentId());
Position parentPosition = positionRDao.getById(position.getParentId()); Position parentPosition = positionRDao.getById(position.getParentId());
ValidatorBean.checkNotNull(parentPosition);
position.setRedParentName(parentPosition.getName()); position.setRedParentName(parentPosition.getName());
} }
@ -52,9 +57,11 @@ public class PositionServiceImpl implements IPositionService {
@Override @Override
public void updatePosition(Position position) { public void updatePosition(Position position) {
// 查询父级岗位名称 // 查询父级岗位名称
if (position.getParentId() != null) { if (position.getParentId() != null && position.getParentId() > 0) {
LOGGER.info("岗位信息 POSITION parentId:{}", position.getParentId()); LOGGER.info("岗位信息 POSITION parentId:{}", position.getParentId());
Position parentPosition = positionRDao.getById(position.getParentId()); Position parentPosition = positionRDao.getById(position.getParentId());
ValidatorBean.checkNotNull(parentPosition);
position.setRedParentName(parentPosition.getName()); position.setRedParentName(parentPosition.getName());
} }
@ -67,7 +74,7 @@ public class PositionServiceImpl implements IPositionService {
public void deletePositionById(String id) { public void deletePositionById(String id) {
// 查询是否存在子级 // 查询是否存在子级
LOGGER.info("岗位信息 POSITION id:{}", id); LOGGER.info("岗位信息 POSITION id:{}", id);
long positionCount = positionRDao.findByPropertyCount("parentId",id); long positionCount = positionRDao.findByPropertyCount("parentId",Long.parseLong(id));
if (positionCount >= 1) { if (positionCount >= 1) {
throw ImppExceptionBuilder.newInstance() throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode()) .setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())

@ -43,9 +43,9 @@ public class SysFileServiceImpl implements ISysFileService {
} }
@Override @Override
public List<SysFile> findSysFileAll() { public List<SysFile> listSysFile() {
LOGGER.info("文件资源 SYS_FILE find-aLl"); LOGGER.info("文件资源 SYS_FILE list");
return sysFileRDao.findAll(); return sysFileRDao.list();
} }
@Override @Override

@ -1,8 +1,12 @@
package cn.estsh.i3plus.core.apiservice.serviceimpl.busi; package cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
import cn.estsh.i3plus.core.api.iservice.busi.ISysMessageService; import cn.estsh.i3plus.core.api.iservice.busi.ISysMessageService;
import cn.estsh.i3plus.pojo.platform.bean.Department;
import cn.estsh.i3plus.pojo.platform.bean.SysMessage; import cn.estsh.i3plus.pojo.platform.bean.SysMessage;
import cn.estsh.i3plus.pojo.platform.bean.SysUser;
import cn.estsh.i3plus.pojo.platform.repository.SysMessageRepository; import cn.estsh.i3plus.pojo.platform.repository.SysMessageRepository;
import cn.estsh.i3plus.pojo.platform.repository.SysUserRepository;
import cn.estsh.impp.framework.boot.util.ValidatorBean;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -24,8 +28,20 @@ public class SysMessageServiceImpl implements ISysMessageService {
@Autowired @Autowired
public SysMessageRepository sysMessageRDao; public SysMessageRepository sysMessageRDao;
@Autowired
public SysUserRepository sysUserRDao;
@Override @Override
public void insertSysMessage(SysMessage sysMessage) { public void insertSysMessage(SysMessage sysMessage) {
// 查询接收人名称
if (sysMessage.getMessageRecipientId() != null && sysMessage.getMessageRecipientId() > 0) {
LOGGER.info("用户信息 SYSUSER id:{}", sysMessage.getMessageRecipientId());
SysUser acceptUser = sysUserRDao.getById(sysMessage.getMessageRecipientId());
ValidatorBean.checkNotNull(acceptUser);
sysMessage.setRedMessageRecipientName(acceptUser.getName());
}
LOGGER.info("系统信息 SYS_MESSAGE :{}",sysMessage); LOGGER.info("系统信息 SYS_MESSAGE :{}",sysMessage);
sysMessageRDao.insert(sysMessage); sysMessageRDao.insert(sysMessage);
} }
@ -39,14 +55,23 @@ public class SysMessageServiceImpl implements ISysMessageService {
@Override @Override
public void updateSysMessage(SysMessage sysMessage) { public void updateSysMessage(SysMessage sysMessage) {
// 查询接收人名称
if (sysMessage.getMessageRecipientId() != null && sysMessage.getMessageRecipientId() > 0) {
LOGGER.info("用户信息 SYSUSER id:{}", sysMessage.getMessageRecipientId());
SysUser acceptUser = sysUserRDao.getById(sysMessage.getMessageRecipientId());
ValidatorBean.checkNotNull(acceptUser);
sysMessage.setRedMessageRecipientName(acceptUser.getName());
}
LOGGER.info("系统信息 SYS_MESSAGE :{}",sysMessage); LOGGER.info("系统信息 SYS_MESSAGE :{}",sysMessage);
sysMessageRDao.update(sysMessage); sysMessageRDao.update(sysMessage);
} }
@Override @Override
public List<SysMessage> findSysMessageAll() { public List<SysMessage> listSysMessage() {
LOGGER.info("系统信息 SYS_MESSAGE find-all"); LOGGER.info("系统信息 SYS_MESSAGE list");
return sysMessageRDao.findAll(); return sysMessageRDao.list();
} }
@Override @Override

Loading…
Cancel
Save