825af37b2729564e8f8d6e7bce310405f1346bc3.svn-base
3.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/**
* Copyright © 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
*/
package com.thinkgem.jeesite.modules.reg.service.qjxt;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Date;
import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.reg.entity.qjxt.Interfacelog;
import com.thinkgem.jeesite.modules.reg.dao.qjxt.InterfacelogDao;
/**
* 权籍系统接口日志信息管理Service
* @author xuyg
* @version 2018-11-12
*/
@Service
@Transactional(readOnly = true)
public class InterfacelogService extends CrudService<InterfacelogDao, Interfacelog> {
public Interfacelog get(String id) {
return super.get(id);
}
public List<Interfacelog> findList(Interfacelog interfacelog) {
return super.findList(interfacelog);
}
public Page<Interfacelog> findPage(Page<Interfacelog> page, Interfacelog interfacelog) {
return super.findPage(page, interfacelog);
}
@Transactional(readOnly = false)
public void save(Interfacelog interfacelog) {
super.save(interfacelog);
}
@Transactional(readOnly = false)
public void delete(Interfacelog interfacelog) {
super.delete(interfacelog);
}
public void saveUsByProperty(String url,String requser,String reqparameter,String resparameter,Exception exception){
Interfacelog loginfo = new Interfacelog();
loginfo.setUrl(url);
loginfo.setRequser(requser);
loginfo.setResuser("不动产信息登记平台");
loginfo.setCreatedate(new Date());
loginfo.setReqparameter(reqparameter);
loginfo.setResparameter(resparameter);
String stackTrace="";
if(exception != null){
try {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
exception.printStackTrace(pw);
stackTrace=sw.toString();
sw.close();
pw.close();
} catch (Exception e2) {
e2.printStackTrace();
}
}
/**
if(stackTrace.length()>4000){
stackTrace = stackTrace.substring(0, 3000);
}
**/
loginfo.setStackTrace(stackTrace.toString());
save(loginfo);
}
public void saveAskByProperty(String url,String resuser,String reqparameter,String resparameter,Exception exception){
Interfacelog log = new Interfacelog();
log.setUrl(url);
log.setRequser("不动产信息登记平台");
log.setResuser(resuser);
log.setCreatedate(new Date());
log.setReqparameter(reqparameter);
log.setResparameter(resparameter);
String stackTrace="";
if(exception != null){
try {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
exception.printStackTrace(pw);
stackTrace=sw.toString();
sw.close();
pw.close();
} catch (Exception e2) {
e2.printStackTrace();
}
}
/**
if(stackTrace.length()>4000){
stackTrace = stackTrace.substring(0, 3000);
}
**/
log.setStackTrace(stackTrace.toString());
save(log);
}
}