[修改] 报告管理 操作日志 新增 修改 预览 下载 删除
This commit is contained in:
@@ -25,6 +25,7 @@ public class secrecyDDLTimer {
|
|||||||
@Autowired
|
@Autowired
|
||||||
ReportDao reportDao;
|
ReportDao reportDao;
|
||||||
|
|
||||||
|
// @Scheduled(cron="0 0 0 * * *")
|
||||||
@Scheduled(cron="0 0/10 * * * ?")
|
@Scheduled(cron="0 0/10 * * * ?")
|
||||||
public void timingOpen() {
|
public void timingOpen() {
|
||||||
log.info("**********************保密到期定时任务开始**********************");
|
log.info("**********************保密到期定时任务开始**********************");
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
package com.adc.da.report.aspect;
|
package com.adc.da.report.aspect;
|
||||||
|
|
||||||
import com.adc.da.login.util.CommonUtils;
|
import com.adc.da.login.util.CommonUtils;
|
||||||
|
import com.adc.da.login.util.UserUtils;
|
||||||
import com.adc.da.report.annotation.ReportLog;
|
import com.adc.da.report.annotation.ReportLog;
|
||||||
import com.adc.da.report.eo.LogEntity;
|
import com.adc.da.report.eo.LogEntity;
|
||||||
|
import com.adc.da.report.eo.ReportEntity;
|
||||||
import com.adc.da.report.service.ILogService;
|
import com.adc.da.report.service.ILogService;
|
||||||
import com.adc.da.report.vo.ReportVo;
|
|
||||||
import com.adc.da.sys.entity.UserEO;
|
|
||||||
import com.adc.da.util.http.ResponseMessage;
|
import com.adc.da.util.http.ResponseMessage;
|
||||||
import com.adc.da.util.utils.StringUtils;
|
import com.adc.da.util.utils.StringUtils;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -13,16 +13,14 @@ import org.aspectj.lang.ProceedingJoinPoint;
|
|||||||
import org.aspectj.lang.annotation.Around;
|
import org.aspectj.lang.annotation.Around;
|
||||||
import org.aspectj.lang.annotation.Aspect;
|
import org.aspectj.lang.annotation.Aspect;
|
||||||
import org.aspectj.lang.annotation.Pointcut;
|
import org.aspectj.lang.annotation.Pointcut;
|
||||||
import javax.annotation.Resource;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author doudxw
|
* @Author doudxw
|
||||||
@@ -64,9 +62,7 @@ public class ReportLogAspect {
|
|||||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
LogEntity entity = new LogEntity();
|
LogEntity entity = new LogEntity();
|
||||||
|
|
||||||
String account = Optional.ofNullable(CommonUtils.getUserInfo()).orElse(new UserEO()).getAccount();
|
entity.setAccount(UserUtils.getUser().getAccount());
|
||||||
account = StringUtils.isEmpty(account) ? "未知用户" : account;
|
|
||||||
entity.setAccount(account);
|
|
||||||
entity.setClassName(cs.getName());
|
entity.setClassName(cs.getName());
|
||||||
entity.setOperateTime(format.format(new Date()));
|
entity.setOperateTime(format.format(new Date()));
|
||||||
entity.setMethod(name);
|
entity.setMethod(name);
|
||||||
@@ -74,11 +70,11 @@ public class ReportLogAspect {
|
|||||||
entity.setUsid(CommonUtils.getUserId());
|
entity.setUsid(CommonUtils.getUserId());
|
||||||
//新增或者编辑操作
|
//新增或者编辑操作
|
||||||
if ("新增或编辑".equals(description)) {
|
if ("新增或编辑".equals(description)) {
|
||||||
Map<String, String> map = (Map<String, String>) returnValue.getData();
|
ReportEntity reportEntity = (ReportEntity) returnValue.getData();
|
||||||
String reportName = map.get("reportName");
|
String reportName = reportEntity.getName();
|
||||||
entity.setReportName(reportName);
|
entity.setReportName(reportName);
|
||||||
ReportVo vo = (ReportVo) args[0];
|
ReportEntity vo = (ReportEntity) args[0];
|
||||||
if (StringUtils.isNotEmpty(vo.getId())) {
|
if (StringUtils.isEmpty(vo.getId())) {
|
||||||
entity.setDescription("新增");
|
entity.setDescription("新增");
|
||||||
} else {
|
} else {
|
||||||
entity.setDescription("编辑");
|
entity.setDescription("编辑");
|
||||||
|
|||||||
+26
-4
@@ -6,9 +6,11 @@ import com.adc.da.report.annotation.ReportLog;
|
|||||||
import com.adc.da.report.dao.mysql.ReportDao;
|
import com.adc.da.report.dao.mysql.ReportDao;
|
||||||
import com.adc.da.report.dao.mysql.ReportLogBookDao;
|
import com.adc.da.report.dao.mysql.ReportLogBookDao;
|
||||||
import com.adc.da.report.eo.FileEntity;
|
import com.adc.da.report.eo.FileEntity;
|
||||||
|
import com.adc.da.report.eo.LogEntity;
|
||||||
import com.adc.da.report.eo.ReportEntity;
|
import com.adc.da.report.eo.ReportEntity;
|
||||||
import com.adc.da.report.eo.ReportLogBook;
|
import com.adc.da.report.eo.ReportLogBook;
|
||||||
import com.adc.da.report.service.IFileService;
|
import com.adc.da.report.service.IFileService;
|
||||||
|
import com.adc.da.report.service.ILogService;
|
||||||
import com.adc.da.report.service.IReportService;
|
import com.adc.da.report.service.IReportService;
|
||||||
import com.adc.da.report.util.LocalFileUtil;
|
import com.adc.da.report.util.LocalFileUtil;
|
||||||
import com.adc.da.report.util.OSSClientUtil;
|
import com.adc.da.report.util.OSSClientUtil;
|
||||||
@@ -90,6 +92,8 @@ public class ReportManageConroller {
|
|||||||
@Resource
|
@Resource
|
||||||
private WaterMarkUtil waterMarkUtil;
|
private WaterMarkUtil waterMarkUtil;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ILogService logService;
|
||||||
/**
|
/**
|
||||||
* 新增或编辑报告
|
* 新增或编辑报告
|
||||||
* 弃用
|
* 弃用
|
||||||
@@ -124,11 +128,12 @@ public class ReportManageConroller {
|
|||||||
*/
|
*/
|
||||||
@ApiOperation("新增或编辑报告")
|
@ApiOperation("新增或编辑报告")
|
||||||
@PostMapping("/saveOrUpdate")
|
@PostMapping("/saveOrUpdate")
|
||||||
// @ReportLog(description = "新增或编辑")
|
@ReportLog(description = "新增或编辑")
|
||||||
public ResponseMessage saveOrUpdate(@RequestBody ReportEntity reportEntity) throws IOException {
|
public ResponseMessage saveOrUpdate(@RequestBody ReportEntity reportEntity) throws IOException {
|
||||||
|
ReportEntity re = new ReportEntity();
|
||||||
reportService.addOrUpdate(reportEntity);
|
BeanUtils.copyProperties(reportEntity,re);
|
||||||
return Result.success();
|
reportService.addOrUpdate(re);
|
||||||
|
return Result.success(reportEntity);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 判断报告名称是否被占用
|
* 判断报告名称是否被占用
|
||||||
@@ -534,9 +539,26 @@ public class ReportManageConroller {
|
|||||||
reportLog.setUpdateTime(new Date());
|
reportLog.setUpdateTime(new Date());
|
||||||
reportLog.setUserId(UserUtils.getUserId());
|
reportLog.setUserId(UserUtils.getUserId());
|
||||||
reportLogBookDao.insert(reportLog);
|
reportLogBookDao.insert(reportLog);
|
||||||
|
|
||||||
|
//报告日志管理
|
||||||
|
ReportEntity reportEntity = reportDao.selectById(repostId);
|
||||||
|
reportLog(reportEntity.getName(),"下载");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void reportLog(String reportName,String desc){
|
||||||
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
LogEntity entity = new LogEntity();
|
||||||
|
|
||||||
|
entity.setAccount(UserUtils.getUser().getAccount());
|
||||||
|
entity.setClassName("com.adc.da.report.controller.ReportManageConroller");
|
||||||
|
entity.setOperateTime(format.format(new Date()));
|
||||||
|
entity.setMethod("downloadPic");
|
||||||
|
entity.setUsid(UserUtils.getUserId());
|
||||||
|
entity.setReportName(reportName);
|
||||||
|
entity.setDescription(desc);
|
||||||
|
logService.insert(entity);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 权限审批流程 添加报告按钮 可添加的报告
|
* 权限审批流程 添加报告按钮 可添加的报告
|
||||||
|
|||||||
@@ -118,6 +118,8 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
|
|||||||
@Resource
|
@Resource
|
||||||
private UserEODao userEODao;
|
private UserEODao userEODao;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ILogService logService;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -705,9 +707,24 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
|
|||||||
reportDetailVo.setDownPower(1);
|
reportDetailVo.setDownPower(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//报告日志管理
|
||||||
|
reportLog(reportDetailVo.getName(),"预览");
|
||||||
return Result.success(reportDetailVo);
|
return Result.success(reportDetailVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void reportLog(String reportName,String desc){
|
||||||
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
LogEntity entity = new LogEntity();
|
||||||
|
|
||||||
|
entity.setAccount(UserUtils.getUser().getAccount());
|
||||||
|
entity.setClassName("com.adc.da.report.service.impl.IReportServiceImpl");
|
||||||
|
entity.setOperateTime(format.format(new Date()));
|
||||||
|
entity.setMethod("reportDetail");
|
||||||
|
entity.setUsid(UserUtils.getUserId());
|
||||||
|
entity.setReportName(reportName);
|
||||||
|
entity.setDescription(desc);
|
||||||
|
logService.insert(entity);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 创建htmlstring
|
* 创建htmlstring
|
||||||
*
|
*
|
||||||
|
|||||||
+25
@@ -2,11 +2,14 @@ package com.adc.da.report.service.impl;
|
|||||||
|
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.adc.da.login.util.UserUtils;
|
||||||
import com.adc.da.report.dao.mysql.PowerApplyDao;
|
import com.adc.da.report.dao.mysql.PowerApplyDao;
|
||||||
import com.adc.da.report.dao.mysql.ReportDao;
|
import com.adc.da.report.dao.mysql.ReportDao;
|
||||||
import com.adc.da.report.dao.mysql.TtReportManageActDao;
|
import com.adc.da.report.dao.mysql.TtReportManageActDao;
|
||||||
|
import com.adc.da.report.eo.LogEntity;
|
||||||
import com.adc.da.report.eo.ReportEntity;
|
import com.adc.da.report.eo.ReportEntity;
|
||||||
import com.adc.da.report.eo.TtReportManageAct;
|
import com.adc.da.report.eo.TtReportManageAct;
|
||||||
|
import com.adc.da.report.service.ILogService;
|
||||||
import com.adc.da.report.service.IReportContentService;
|
import com.adc.da.report.service.IReportContentService;
|
||||||
import com.adc.da.report.service.ITtReportManageActService;
|
import com.adc.da.report.service.ITtReportManageActService;
|
||||||
import com.adc.da.report.vo.DeleteParamRequestVO;
|
import com.adc.da.report.vo.DeleteParamRequestVO;
|
||||||
@@ -22,7 +25,9 @@ import org.springframework.util.ObjectUtils;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,6 +43,9 @@ public class ITtReportManageActServiceImpl extends ServiceImpl<TtReportManageAct
|
|||||||
@Autowired
|
@Autowired
|
||||||
ReportDao reportDao;
|
ReportDao reportDao;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ILogService logService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
PowerApplyDao powerApplyDao;
|
PowerApplyDao powerApplyDao;
|
||||||
|
|
||||||
@@ -132,12 +140,14 @@ public class ITtReportManageActServiceImpl extends ServiceImpl<TtReportManageAct
|
|||||||
if (reportEntity == null){
|
if (reportEntity == null){
|
||||||
//保存报告
|
//保存报告
|
||||||
reportDao.saveReportAct(ttReportManageAct);
|
reportDao.saveReportAct(ttReportManageAct);
|
||||||
|
reportLog(ttReportManageAct.getName(),"新增");
|
||||||
}else {
|
}else {
|
||||||
//更改
|
//更改
|
||||||
ReportEntity reportEntity1 = new ReportEntity();
|
ReportEntity reportEntity1 = new ReportEntity();
|
||||||
BeanUtil.copyProperties(ttReportManageAct,reportEntity1);
|
BeanUtil.copyProperties(ttReportManageAct,reportEntity1);
|
||||||
reportEntity1.setId(ttReportManageAct.getDataId());
|
reportEntity1.setId(ttReportManageAct.getDataId());
|
||||||
reportDao.updateById(reportEntity);
|
reportDao.updateById(reportEntity);
|
||||||
|
reportLog(reportEntity.getName(),"修改");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
iReportContentService.insertReportContent(ttReportManageAct.getDataId(), ttReportManageAct.getFileId());
|
iReportContentService.insertReportContent(ttReportManageAct.getDataId(), ttReportManageAct.getFileId());
|
||||||
@@ -146,4 +156,19 @@ public class ITtReportManageActServiceImpl extends ServiceImpl<TtReportManageAct
|
|||||||
log.error("获取报告内容失败", e);
|
log.error("获取报告内容失败", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void reportLog(String reportName,String desc){
|
||||||
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
LogEntity entity = new LogEntity();
|
||||||
|
|
||||||
|
entity.setAccount(UserUtils.getUser().getAccount());
|
||||||
|
entity.setClassName("com.adc.da.report.service.impl.ITtReportManageActServiceImpl");
|
||||||
|
entity.setOperateTime(format.format(new Date()));
|
||||||
|
entity.setMethod("saveOrUpdataReport");
|
||||||
|
entity.setUsid(UserUtils.getUserId());
|
||||||
|
entity.setReportName(reportName);
|
||||||
|
entity.setDescription(desc);
|
||||||
|
logService.insert(entity);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
Binary file not shown.
BIN
Binary file not shown.
Reference in New Issue
Block a user