|
|
@@ -1,11 +1,14 @@
|
|
|
package com.usoftchina.saas.commons.service.impl;
|
|
|
|
|
|
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
|
|
|
import com.usoftchina.saas.commons.mapper.SysprintsetMapper;
|
|
|
import com.usoftchina.saas.commons.po.Configs;
|
|
|
import com.usoftchina.saas.commons.po.JasperResult;
|
|
|
+import com.usoftchina.saas.commons.po.Operation;
|
|
|
import com.usoftchina.saas.commons.po.SysPrintSet;
|
|
|
import com.usoftchina.saas.commons.service.ConfigsService;
|
|
|
import com.usoftchina.saas.commons.service.JasperReportService;
|
|
|
+import com.usoftchina.saas.commons.service.MessageLogService;
|
|
|
import com.usoftchina.saas.context.BaseContextHolder;
|
|
|
import com.usoftchina.saas.context.SpringContextHolder;
|
|
|
import com.usoftchina.saas.exception.BizException;
|
|
|
@@ -29,6 +32,8 @@ public class JasperReportServiceImpl implements JasperReportService{
|
|
|
private SysprintsetMapper sysprintsetMapper;
|
|
|
@Autowired
|
|
|
private ConfigsService configsService;
|
|
|
+ @Autowired
|
|
|
+ private MessageLogService messageLogService;
|
|
|
|
|
|
@Override
|
|
|
public List<SysPrintSet> getPrintSet(String caller) {
|
|
|
@@ -40,7 +45,7 @@ public class JasperReportServiceImpl implements JasperReportService{
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public JasperResult print(String caller, String reportName, Integer id, boolean isProdIO, boolean isDefault) {
|
|
|
+ public JasperResult print(String caller, String code, String reportName, Integer id, boolean isProdIO, boolean isDefault) {
|
|
|
Long companyId = BaseContextHolder.getCompanyId();
|
|
|
JasperResult result = new JasperResult();
|
|
|
SysPrintSet printSet = null;
|
|
|
@@ -71,9 +76,12 @@ public class JasperReportServiceImpl implements JasperReportService{
|
|
|
if (!StringUtils.isEmpty(printSet.getDefaultcondition())) {
|
|
|
condition += " and " + printSet.getDefaultcondition();
|
|
|
}
|
|
|
+ //日志记录
|
|
|
+ DocBaseDTO baseDTO = new DocBaseDTO(Long.valueOf(id), code, caller);
|
|
|
+ messageLogService.customizeLog(baseDTO, Operation.PRINT);
|
|
|
|
|
|
result.setReportName(printSet.getReportname());
|
|
|
- result.setTitle(printSet.getTitle());
|
|
|
+ result.setTitle(StringUtils.isEmpty(code) ? printSet.getTitle() : printSet.getTitle() + "(" + code + ")");
|
|
|
result.setPrinturl(printUrl);
|
|
|
result.setWhereCondition(condition);
|
|
|
result.setPrinttype(StringUtils.isEmpty(printSet.getPrinttype()) ? "" : printSet.getPrinttype());
|