Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
5168a11b
Commit
5168a11b
authored
Jun 09, 2020
by
季圣华
Browse files
优化日志模块
parent
b6f79820
Changes
22
Show whitespace changes
Inline
Side-by-side
src/main/java/com/jsh/erp/constants/BusinessConstants.java
View file @
5168a11b
...
@@ -141,9 +141,9 @@ public class BusinessConstants {
...
@@ -141,9 +141,9 @@ public class BusinessConstants {
* */
* */
public
static
final
String
LOG_OPERATION_TYPE_ADD
=
"新增"
;
public
static
final
String
LOG_OPERATION_TYPE_ADD
=
"新增"
;
public
static
final
String
LOG_OPERATION_TYPE_BATCH_ADD
=
"批量新增"
;
public
static
final
String
LOG_OPERATION_TYPE_BATCH_ADD
=
"批量新增"
;
public
static
final
String
LOG_OPERATION_TYPE_EDIT
=
"修改
,id:
"
;
public
static
final
String
LOG_OPERATION_TYPE_EDIT
=
"修改"
;
public
static
final
String
LOG_OPERATION_TYPE_DELETE
=
"删除
,id:
"
;
public
static
final
String
LOG_OPERATION_TYPE_DELETE
=
"删除"
;
public
static
final
String
LOG_OPERATION_TYPE_LOGIN
=
"登录
,id:
"
;
public
static
final
String
LOG_OPERATION_TYPE_LOGIN
=
"登录"
;
public
static
final
String
LOG_OPERATION_TYPE_IMPORT
=
"导入"
;
public
static
final
String
LOG_OPERATION_TYPE_IMPORT
=
"导入"
;
/**
/**
...
...
src/main/java/com/jsh/erp/controller/UserController.java
View file @
5168a11b
...
@@ -144,7 +144,7 @@ public class UserController {
...
@@ -144,7 +144,7 @@ public class UserController {
}
}
}
}
logService
.
insertLog
(
"用户"
,
logService
.
insertLog
(
"用户"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_LOGIN
).
append
(
user
.
get
Id
()).
toString
(),
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_LOGIN
).
append
(
user
.
get
LoginName
()).
toString
(),
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
src/main/java/com/jsh/erp/service/account/AccountService.java
View file @
5168a11b
...
@@ -120,7 +120,8 @@ public class AccountService {
...
@@ -120,7 +120,8 @@ public class AccountService {
int
result
=
0
;
int
result
=
0
;
try
{
try
{
result
=
accountMapper
.
insertSelective
(
account
);
result
=
accountMapper
.
insertSelective
(
account
);
logService
.
insertLog
(
"账户"
,
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
,
request
);
logService
.
insertLog
(
"账户"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
).
append
(
account
.
getName
()).
toString
(),
request
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
}
}
...
@@ -135,7 +136,7 @@ public class AccountService {
...
@@ -135,7 +136,7 @@ public class AccountService {
try
{
try
{
result
=
accountMapper
.
updateByPrimaryKeySelective
(
account
);
result
=
accountMapper
.
updateByPrimaryKeySelective
(
account
);
logService
.
insertLog
(
"账户"
,
logService
.
insertLog
(
"账户"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
id
).
toString
(),
request
);
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
account
.
getName
()
).
toString
(),
request
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
}
}
...
...
src/main/java/com/jsh/erp/service/accountHead/AccountHeadService.java
View file @
5168a11b
...
@@ -105,7 +105,8 @@ public class AccountHeadService {
...
@@ -105,7 +105,8 @@ public class AccountHeadService {
int
result
=
0
;
int
result
=
0
;
try
{
try
{
result
=
accountHeadMapper
.
insertSelective
(
accountHead
);
result
=
accountHeadMapper
.
insertSelective
(
accountHead
);
logService
.
insertLog
(
"财务"
,
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
,
request
);
logService
.
insertLog
(
"财务"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
).
append
(
accountHead
.
getBillno
()).
toString
(),
request
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
}
}
...
@@ -120,7 +121,7 @@ public class AccountHeadService {
...
@@ -120,7 +121,7 @@ public class AccountHeadService {
try
{
try
{
result
=
accountHeadMapper
.
updateByPrimaryKeySelective
(
accountHead
);
result
=
accountHeadMapper
.
updateByPrimaryKeySelective
(
accountHead
);
logService
.
insertLog
(
"财务"
,
logService
.
insertLog
(
"财务"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
id
).
toString
(),
request
);
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
accountHead
.
getBillno
()
).
toString
(),
request
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
}
}
...
@@ -131,9 +132,10 @@ public class AccountHeadService {
...
@@ -131,9 +132,10 @@ public class AccountHeadService {
public
int
deleteAccountHead
(
Long
id
,
HttpServletRequest
request
)
throws
Exception
{
public
int
deleteAccountHead
(
Long
id
,
HttpServletRequest
request
)
throws
Exception
{
int
result
=
0
;
int
result
=
0
;
try
{
try
{
AccountHead
accountHead
=
accountHeadMapper
.
selectByPrimaryKey
(
id
);
result
=
accountHeadMapper
.
deleteByPrimaryKey
(
id
);
result
=
accountHeadMapper
.
deleteByPrimaryKey
(
id
);
logService
.
insertLog
(
"财务"
,
logService
.
insertLog
(
"财务"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_DELETE
).
append
(
id
).
toString
(),
request
);
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_DELETE
).
append
(
accountHead
.
getBillno
()
).
toString
(),
request
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
}
}
...
...
src/main/java/com/jsh/erp/service/depot/DepotService.java
View file @
5168a11b
...
@@ -103,7 +103,8 @@ public class DepotService {
...
@@ -103,7 +103,8 @@ public class DepotService {
int
result
=
0
;
int
result
=
0
;
try
{
try
{
result
=
depotMapper
.
insertSelective
(
depot
);
result
=
depotMapper
.
insertSelective
(
depot
);
logService
.
insertLog
(
"仓库"
,
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
,
request
);
logService
.
insertLog
(
"仓库"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
).
append
(
depot
.
getName
()).
toString
(),
request
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
}
}
...
@@ -118,7 +119,7 @@ public class DepotService {
...
@@ -118,7 +119,7 @@ public class DepotService {
try
{
try
{
result
=
depotMapper
.
updateByPrimaryKeySelective
(
depot
);
result
=
depotMapper
.
updateByPrimaryKeySelective
(
depot
);
logService
.
insertLog
(
"仓库"
,
logService
.
insertLog
(
"仓库"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
i
d
).
toString
(),
request
);
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
d
epot
.
getName
()
).
toString
(),
request
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
}
}
...
@@ -129,9 +130,10 @@ public class DepotService {
...
@@ -129,9 +130,10 @@ public class DepotService {
public
int
deleteDepot
(
Long
id
,
HttpServletRequest
request
)
throws
Exception
{
public
int
deleteDepot
(
Long
id
,
HttpServletRequest
request
)
throws
Exception
{
int
result
=
0
;
int
result
=
0
;
try
{
try
{
Depot
depot
=
depotMapper
.
selectByPrimaryKey
(
id
);
result
=
depotMapper
.
deleteByPrimaryKey
(
id
);
result
=
depotMapper
.
deleteByPrimaryKey
(
id
);
logService
.
insertLog
(
"仓库"
,
logService
.
insertLog
(
"仓库"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_DELETE
).
append
(
i
d
).
toString
(),
request
);
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_DELETE
).
append
(
d
epot
.
getName
()
).
toString
(),
request
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
}
}
...
...
src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java
View file @
5168a11b
...
@@ -223,9 +223,6 @@ public class DepotHeadService {
...
@@ -223,9 +223,6 @@ public class DepotHeadService {
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
batchSetStatus
(
String
status
,
String
depotHeadIDs
)
throws
Exception
{
public
int
batchSetStatus
(
String
status
,
String
depotHeadIDs
)
throws
Exception
{
logService
.
insertLog
(
"单据"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
depotHeadIDs
).
toString
(),
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
List
<
Long
>
ids
=
StringUtil
.
strToLongList
(
depotHeadIDs
);
List
<
Long
>
ids
=
StringUtil
.
strToLongList
(
depotHeadIDs
);
DepotHead
depotHead
=
new
DepotHead
();
DepotHead
depotHead
=
new
DepotHead
();
depotHead
.
setStatus
(
status
);
depotHead
.
setStatus
(
status
);
...
@@ -237,6 +234,9 @@ public class DepotHeadService {
...
@@ -237,6 +234,9 @@ public class DepotHeadService {
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
}
}
logService
.
insertLog
(
"单据"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
depotHeadIDs
).
toString
(),
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
return
result
;
return
result
;
}
}
/**
/**
...
@@ -456,9 +456,6 @@ public class DepotHeadService {
...
@@ -456,9 +456,6 @@ public class DepotHeadService {
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
void
addDepotHeadAndDetail
(
String
beanJson
,
String
inserted
,
String
deleted
,
String
updated
,
Long
tenantId
,
public
void
addDepotHeadAndDetail
(
String
beanJson
,
String
inserted
,
String
deleted
,
String
updated
,
Long
tenantId
,
HttpServletRequest
request
)
throws
Exception
{
HttpServletRequest
request
)
throws
Exception
{
logService
.
insertLog
(
"单据"
,
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
,
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
/**处理单据主表数据*/
/**处理单据主表数据*/
DepotHead
depotHead
=
JSONObject
.
parseObject
(
beanJson
,
DepotHead
.
class
);
DepotHead
depotHead
=
JSONObject
.
parseObject
(
beanJson
,
DepotHead
.
class
);
//判断用户是否已经登录过,登录过不再处理
//判断用户是否已经登录过,登录过不再处理
...
@@ -499,6 +496,9 @@ public class DepotHeadService {
...
@@ -499,6 +496,9 @@ public class DepotHeadService {
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
}
}
}
}
logService
.
insertLog
(
"单据"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
).
append
(
depotHead
.
getNumber
()).
toString
(),
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
}
}
/**
/**
...
@@ -516,9 +516,6 @@ public class DepotHeadService {
...
@@ -516,9 +516,6 @@ public class DepotHeadService {
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
void
updateDepotHeadAndDetail
(
Long
id
,
String
beanJson
,
String
inserted
,
String
deleted
,
String
updated
,
public
void
updateDepotHeadAndDetail
(
Long
id
,
String
beanJson
,
String
inserted
,
String
deleted
,
String
updated
,
BigDecimal
preTotalPrice
,
Long
tenantId
,
HttpServletRequest
request
)
throws
Exception
{
BigDecimal
preTotalPrice
,
Long
tenantId
,
HttpServletRequest
request
)
throws
Exception
{
logService
.
insertLog
(
"单据"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
id
).
toString
(),
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
/**更新单据主表信息*/
/**更新单据主表信息*/
DepotHead
depotHead
=
JSONObject
.
parseObject
(
beanJson
,
DepotHead
.
class
);
DepotHead
depotHead
=
JSONObject
.
parseObject
(
beanJson
,
DepotHead
.
class
);
//判断用户是否已经登录过,登录过不再处理
//判断用户是否已经登录过,登录过不再处理
...
@@ -538,6 +535,9 @@ public class DepotHeadService {
...
@@ -538,6 +535,9 @@ public class DepotHeadService {
}
}
/**入库和出库处理单据子表信息*/
/**入库和出库处理单据子表信息*/
depotItemService
.
saveDetials
(
inserted
,
deleted
,
updated
,
depotHead
.
getId
(),
tenantId
,
request
);
depotItemService
.
saveDetials
(
inserted
,
deleted
,
updated
,
depotHead
.
getId
(),
tenantId
,
request
);
logService
.
insertLog
(
"单据"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
depotHead
.
getNumber
()).
toString
(),
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
}
}
/**
/**
...
@@ -547,9 +547,6 @@ public class DepotHeadService {
...
@@ -547,9 +547,6 @@ public class DepotHeadService {
*/
*/
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
void
deleteDepotHeadAndDetail
(
Long
id
)
throws
Exception
{
public
void
deleteDepotHeadAndDetail
(
Long
id
)
throws
Exception
{
logService
.
insertLog
(
"单据"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_DELETE
).
append
(
id
).
toString
(),
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
//查询单据主表信息
//查询单据主表信息
DepotHead
depotHead
=
getDepotHead
(
id
);
DepotHead
depotHead
=
getDepotHead
(
id
);
User
userInfo
=
userService
.
getCurrentUser
();
User
userInfo
=
userService
.
getCurrentUser
();
...
@@ -581,6 +578,9 @@ public class DepotHeadService {
...
@@ -581,6 +578,9 @@ public class DepotHeadService {
/**删除单据主表信息*/
/**删除单据主表信息*/
batchDeleteDepotHeadByIds
(
id
.
toString
());
batchDeleteDepotHeadByIds
(
id
.
toString
());
logService
.
insertLog
(
"单据"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_DELETE
).
append
(
depotHead
.
getNumber
()).
toString
(),
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
}
}
/**
/**
...
...
src/main/java/com/jsh/erp/service/functions/FunctionsService.java
View file @
5168a11b
...
@@ -97,13 +97,13 @@ public class FunctionsService {
...
@@ -97,13 +97,13 @@ public class FunctionsService {
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
updateFunctions
(
String
beanJson
,
Long
id
,
HttpServletRequest
request
)
throws
Exception
{
public
int
updateFunctions
(
String
beanJson
,
Long
id
,
HttpServletRequest
request
)
throws
Exception
{
Functions
depot
=
JSONObject
.
parseObject
(
beanJson
,
Functions
.
class
);
Functions
functions
=
JSONObject
.
parseObject
(
beanJson
,
Functions
.
class
);
depot
.
setId
(
id
);
functions
.
setId
(
id
);
int
result
=
0
;
int
result
=
0
;
try
{
try
{
result
=
functionsMapper
.
updateByPrimaryKeySelective
(
depot
);
result
=
functionsMapper
.
updateByPrimaryKeySelective
(
functions
);
logService
.
insertLog
(
"功能"
,
logService
.
insertLog
(
"功能"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
id
).
toString
(),
request
);
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
functions
.
getName
()
).
toString
(),
request
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
}
}
...
...
src/main/java/com/jsh/erp/service/inOutItem/InOutItemService.java
View file @
5168a11b
...
@@ -85,11 +85,12 @@ public class InOutItemService {
...
@@ -85,11 +85,12 @@ public class InOutItemService {
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
insertInOutItem
(
String
beanJson
,
HttpServletRequest
request
)
throws
Exception
{
public
int
insertInOutItem
(
String
beanJson
,
HttpServletRequest
request
)
throws
Exception
{
InOutItem
depot
=
JSONObject
.
parseObject
(
beanJson
,
InOutItem
.
class
);
InOutItem
inOutItem
=
JSONObject
.
parseObject
(
beanJson
,
InOutItem
.
class
);
int
result
=
0
;
int
result
=
0
;
try
{
try
{
result
=
inOutItemMapper
.
insertSelective
(
depot
);
result
=
inOutItemMapper
.
insertSelective
(
inOutItem
);
logService
.
insertLog
(
"收支项目"
,
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
,
request
);
logService
.
insertLog
(
"收支项目"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
).
append
(
inOutItem
.
getName
()).
toString
(),
request
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
}
}
...
@@ -98,13 +99,13 @@ public class InOutItemService {
...
@@ -98,13 +99,13 @@ public class InOutItemService {
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
updateInOutItem
(
String
beanJson
,
Long
id
,
HttpServletRequest
request
)
throws
Exception
{
public
int
updateInOutItem
(
String
beanJson
,
Long
id
,
HttpServletRequest
request
)
throws
Exception
{
InOutItem
depot
=
JSONObject
.
parseObject
(
beanJson
,
InOutItem
.
class
);
InOutItem
inOutItem
=
JSONObject
.
parseObject
(
beanJson
,
InOutItem
.
class
);
depot
.
setId
(
id
);
inOutItem
.
setId
(
id
);
int
result
=
0
;
int
result
=
0
;
try
{
try
{
result
=
inOutItemMapper
.
updateByPrimaryKeySelective
(
depot
);
result
=
inOutItemMapper
.
updateByPrimaryKeySelective
(
inOutItem
);
logService
.
insertLog
(
"收支项目"
,
logService
.
insertLog
(
"收支项目"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
i
d
).
toString
(),
request
);
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
i
nOutItem
.
getName
()
).
toString
(),
request
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
}
}
...
...
src/main/java/com/jsh/erp/service/log/LogService.java
View file @
5168a11b
...
@@ -148,7 +148,7 @@ public class LogService {
...
@@ -148,7 +148,7 @@ public class LogService {
}
}
}
}
public
void
insertLog
(
String
moduleName
,
String
type
,
HttpServletRequest
request
)
throws
Exception
{
public
void
insertLog
(
String
moduleName
,
String
content
,
HttpServletRequest
request
)
throws
Exception
{
try
{
try
{
Long
userId
=
getUserId
(
request
);
Long
userId
=
getUserId
(
request
);
if
(
userId
!=
null
)
{
if
(
userId
!=
null
)
{
...
@@ -159,7 +159,7 @@ public class LogService {
...
@@ -159,7 +159,7 @@ public class LogService {
log
.
setCreatetime
(
new
Date
());
log
.
setCreatetime
(
new
Date
());
Byte
status
=
0
;
Byte
status
=
0
;
log
.
setStatus
(
status
);
log
.
setStatus
(
status
);
log
.
setContentdetails
(
type
+
moduleName
);
log
.
setContentdetails
(
content
);
logMapper
.
insertSelective
(
log
);
logMapper
.
insertSelective
(
log
);
}
}
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
...
...
src/main/java/com/jsh/erp/service/material/MaterialService.java
View file @
5168a11b
...
@@ -162,7 +162,8 @@ public class MaterialService {
...
@@ -162,7 +162,8 @@ public class MaterialService {
}
}
}
}
}
}
logService
.
insertLog
(
"商品"
,
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
,
request
);
logService
.
insertLog
(
"商品"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
).
append
(
m
.
getName
()).
toString
(),
request
);
return
1
;
return
1
;
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
...
@@ -197,7 +198,7 @@ public class MaterialService {
...
@@ -197,7 +198,7 @@ public class MaterialService {
}
}
}
}
logService
.
insertLog
(
"商品"
,
logService
.
insertLog
(
"商品"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
id
).
toString
(),
request
);
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
material
.
getName
()
).
toString
(),
request
);
return
1
;
return
1
;
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
...
...
src/main/java/com/jsh/erp/service/materialCategory/MaterialCategoryService.java
View file @
5168a11b
...
@@ -118,7 +118,8 @@ public class MaterialCategoryService {
...
@@ -118,7 +118,8 @@ public class MaterialCategoryService {
int
result
=
0
;
int
result
=
0
;
try
{
try
{
result
=
materialCategoryMapper
.
insertSelective
(
materialCategory
);
result
=
materialCategoryMapper
.
insertSelective
(
materialCategory
);
logService
.
insertLog
(
"商品类型"
,
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
,
request
);
logService
.
insertLog
(
"商品类型"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
).
append
(
materialCategory
.
getName
()).
toString
(),
request
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
}
}
...
@@ -133,7 +134,7 @@ public class MaterialCategoryService {
...
@@ -133,7 +134,7 @@ public class MaterialCategoryService {
try
{
try
{
result
=
materialCategoryMapper
.
updateByPrimaryKeySelective
(
materialCategory
);
result
=
materialCategoryMapper
.
updateByPrimaryKeySelective
(
materialCategory
);
logService
.
insertLog
(
"商品类型"
,
logService
.
insertLog
(
"商品类型"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
id
).
toString
(),
request
);
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
materialCategory
.
getName
()
).
toString
(),
request
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
}
}
...
...
src/main/java/com/jsh/erp/service/materialProperty/MaterialPropertyService.java
View file @
5168a11b
...
@@ -87,7 +87,8 @@ public class MaterialPropertyService {
...
@@ -87,7 +87,8 @@ public class MaterialPropertyService {
int
result
=
0
;
int
result
=
0
;
try
{
try
{
result
=
materialPropertyMapper
.
insertSelective
(
materialProperty
);
result
=
materialPropertyMapper
.
insertSelective
(
materialProperty
);
logService
.
insertLog
(
"商品属性"
,
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
,
request
);
logService
.
insertLog
(
"商品属性"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
).
append
(
materialProperty
.
getNativename
()).
toString
(),
request
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
}
}
...
@@ -102,7 +103,7 @@ public class MaterialPropertyService {
...
@@ -102,7 +103,7 @@ public class MaterialPropertyService {
try
{
try
{
result
=
materialPropertyMapper
.
updateByPrimaryKeySelective
(
materialProperty
);
result
=
materialPropertyMapper
.
updateByPrimaryKeySelective
(
materialProperty
);
logService
.
insertLog
(
"商品属性"
,
logService
.
insertLog
(
"商品属性"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
id
).
toString
(),
request
);
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
materialProperty
.
getNativename
()
).
toString
(),
request
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
}
}
...
...
src/main/java/com/jsh/erp/service/msg/MsgService.java
View file @
5168a11b
...
@@ -102,7 +102,8 @@ public class MsgService {
...
@@ -102,7 +102,8 @@ public class MsgService {
int
result
=
0
;
int
result
=
0
;
try
{
try
{
result
=
msgMapper
.
insertSelective
(
msg
);
result
=
msgMapper
.
insertSelective
(
msg
);
logService
.
insertLog
(
"消息"
,
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
,
request
);
logService
.
insertLog
(
"消息"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
).
append
(
msg
.
getMsgTitle
()).
toString
(),
request
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
logger
.
error
(
"异常码[{}],异常提示[{}],异常[{}]"
,
logger
.
error
(
"异常码[{}],异常提示[{}],异常[{}]"
,
ExceptionConstants
.
DATA_WRITE_FAIL_CODE
,
ExceptionConstants
.
DATA_WRITE_FAIL_MSG
,
e
);
ExceptionConstants
.
DATA_WRITE_FAIL_CODE
,
ExceptionConstants
.
DATA_WRITE_FAIL_MSG
,
e
);
...
@@ -120,7 +121,7 @@ public class MsgService {
...
@@ -120,7 +121,7 @@ public class MsgService {
try
{
try
{
result
=
msgMapper
.
updateByPrimaryKeySelective
(
msg
);
result
=
msgMapper
.
updateByPrimaryKeySelective
(
msg
);
logService
.
insertLog
(
"消息"
,
logService
.
insertLog
(
"消息"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
id
).
toString
(),
request
);
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
msg
.
getMsgTitle
()
).
toString
(),
request
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
logger
.
error
(
"异常码[{}],异常提示[{}],异常[{}]"
,
logger
.
error
(
"异常码[{}],异常提示[{}],异常[{}]"
,
ExceptionConstants
.
DATA_WRITE_FAIL_CODE
,
ExceptionConstants
.
DATA_WRITE_FAIL_MSG
,
e
);
ExceptionConstants
.
DATA_WRITE_FAIL_CODE
,
ExceptionConstants
.
DATA_WRITE_FAIL_MSG
,
e
);
...
...
src/main/java/com/jsh/erp/service/organization/OrganizationService.java
View file @
5168a11b
...
@@ -56,7 +56,8 @@ public class OrganizationService {
...
@@ -56,7 +56,8 @@ public class OrganizationService {
int
result
=
0
;
int
result
=
0
;
try
{
try
{
result
=
organizationMapper
.
insertSelective
(
organization
);
result
=
organizationMapper
.
insertSelective
(
organization
);
logService
.
insertLog
(
"机构"
,
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
,
request
);
logService
.
insertLog
(
"机构"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
).
append
(
organization
.
getOrgFullName
()).
toString
(),
request
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
}
}
...
@@ -70,7 +71,7 @@ public class OrganizationService {
...
@@ -70,7 +71,7 @@ public class OrganizationService {
try
{
try
{
result
=
organizationMapper
.
updateByPrimaryKeySelective
(
organization
);
result
=
organizationMapper
.
updateByPrimaryKeySelective
(
organization
);
logService
.
insertLog
(
"机构"
,
logService
.
insertLog
(
"机构"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
id
).
toString
(),
request
);
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
organization
.
getOrgFullName
()
).
toString
(),
request
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
}
}
...
...
src/main/java/com/jsh/erp/service/person/PersonService.java
View file @
5168a11b
...
@@ -92,7 +92,8 @@ public class PersonService {
...
@@ -92,7 +92,8 @@ public class PersonService {
int
result
=
0
;
int
result
=
0
;
try
{
try
{
result
=
personMapper
.
insertSelective
(
person
);
result
=
personMapper
.
insertSelective
(
person
);
logService
.
insertLog
(
"经手人"
,
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
,
request
);
logService
.
insertLog
(
"经手人"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
).
append
(
person
.
getName
()).
toString
(),
request
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
}
}
...
@@ -107,7 +108,7 @@ public class PersonService {
...
@@ -107,7 +108,7 @@ public class PersonService {
try
{
try
{
result
=
personMapper
.
updateByPrimaryKeySelective
(
person
);
result
=
personMapper
.
updateByPrimaryKeySelective
(
person
);
logService
.
insertLog
(
"经手人"
,
logService
.
insertLog
(
"经手人"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
id
).
toString
(),
request
);
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
person
.
getName
()
).
toString
(),
request
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
}
}
...
...
src/main/java/com/jsh/erp/service/role/RoleService.java
View file @
5168a11b
...
@@ -86,7 +86,8 @@ public class RoleService {
...
@@ -86,7 +86,8 @@ public class RoleService {
int
result
=
0
;
int
result
=
0
;
try
{
try
{
result
=
roleMapper
.
insertSelective
(
role
);
result
=
roleMapper
.
insertSelective
(
role
);
logService
.
insertLog
(
"角色"
,
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
,
request
);
logService
.
insertLog
(
"角色"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
).
append
(
role
.
getName
()).
toString
(),
request
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
}
}
...
@@ -101,7 +102,7 @@ public class RoleService {
...
@@ -101,7 +102,7 @@ public class RoleService {
try
{
try
{
result
=
roleMapper
.
updateByPrimaryKeySelective
(
role
);
result
=
roleMapper
.
updateByPrimaryKeySelective
(
role
);
logService
.
insertLog
(
"角色"
,
logService
.
insertLog
(
"角色"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
id
).
toString
(),
request
);
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
role
.
getName
()
).
toString
(),
request
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
}
}
...
...
src/main/java/com/jsh/erp/service/serialNumber/SerialNumberService.java
View file @
5168a11b
...
@@ -94,11 +94,11 @@ public class SerialNumberService {
...
@@ -94,11 +94,11 @@ public class SerialNumberService {
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
insertSerialNumber
(
String
beanJson
,
HttpServletRequest
request
)
throws
Exception
{
public
int
insertSerialNumber
(
String
beanJson
,
HttpServletRequest
request
)
throws
Exception
{
SerialNumber
serialNumber
=
JSONObject
.
parseObject
(
beanJson
,
SerialNumber
.
class
);
SerialNumber
serialNumber
=
JSONObject
.
parseObject
(
beanJson
,
SerialNumber
.
class
);
logService
.
insertLog
(
"序列号"
,
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
,
request
);
int
result
=
0
;
int
result
=
0
;
try
{
try
{
result
=
serialNumberMapper
.
insertSelective
(
serialNumber
);
result
=
serialNumberMapper
.
insertSelective
(
serialNumber
);
logService
.
insertLog
(
"序列号"
,
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
,
request
);
logService
.
insertLog
(
"序列号"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
).
append
(
serialNumber
.
getSerialNumber
()).
toString
(),
request
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
}
}
...
@@ -113,7 +113,7 @@ public class SerialNumberService {
...
@@ -113,7 +113,7 @@ public class SerialNumberService {
try
{
try
{
result
=
serialNumberMapper
.
updateByPrimaryKeySelective
(
serialNumber
);
result
=
serialNumberMapper
.
updateByPrimaryKeySelective
(
serialNumber
);
logService
.
insertLog
(
"序列号"
,
logService
.
insertLog
(
"序列号"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
id
).
toString
(),
request
);
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
serialNumber
.
getSerialNumber
()
).
toString
(),
request
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
}
}
...
...
src/main/java/com/jsh/erp/service/supplier/SupplierService.java
View file @
5168a11b
...
@@ -133,7 +133,8 @@ public class SupplierService {
...
@@ -133,7 +133,8 @@ public class SupplierService {
int
result
=
0
;
int
result
=
0
;
try
{
try
{
result
=
supplierMapper
.
insertSelective
(
supplier
);
result
=
supplierMapper
.
insertSelective
(
supplier
);
logService
.
insertLog
(
"商家"
,
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
,
request
);
logService
.
insertLog
(
"商家"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
).
append
(
supplier
.
getSupplier
()).
toString
(),
request
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
}
}
...
@@ -154,7 +155,7 @@ public class SupplierService {
...
@@ -154,7 +155,7 @@ public class SupplierService {
try
{
try
{
result
=
supplierMapper
.
updateByPrimaryKeySelective
(
supplier
);
result
=
supplierMapper
.
updateByPrimaryKeySelective
(
supplier
);
logService
.
insertLog
(
"商家"
,
logService
.
insertLog
(
"商家"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
id
).
toString
(),
request
);
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
supplier
.
getSupplier
()
).
toString
(),
request
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
}
}
...
...
src/main/java/com/jsh/erp/service/systemConfig/SystemConfigService.java
View file @
5168a11b
...
@@ -87,7 +87,8 @@ public class SystemConfigService {
...
@@ -87,7 +87,8 @@ public class SystemConfigService {
int
result
=
0
;
int
result
=
0
;
try
{
try
{
result
=
systemConfigMapper
.
insertSelective
(
systemConfig
);
result
=
systemConfigMapper
.
insertSelective
(
systemConfig
);
logService
.
insertLog
(
"系统配置"
,
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
,
request
);
logService
.
insertLog
(
"系统配置"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
).
append
(
systemConfig
.
getCompanyName
()).
toString
(),
request
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
}
}
...
@@ -102,7 +103,7 @@ public class SystemConfigService {
...
@@ -102,7 +103,7 @@ public class SystemConfigService {
try
{
try
{
result
=
systemConfigMapper
.
updateByPrimaryKeySelective
(
systemConfig
);
result
=
systemConfigMapper
.
updateByPrimaryKeySelective
(
systemConfig
);
logService
.
insertLog
(
"系统配置"
,
logService
.
insertLog
(
"系统配置"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
id
).
toString
(),
request
);
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
systemConfig
.
getCompanyName
()
).
toString
(),
request
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
}
}
...
...
src/main/java/com/jsh/erp/service/unit/UnitService.java
View file @
5168a11b
...
@@ -89,7 +89,8 @@ public class UnitService {
...
@@ -89,7 +89,8 @@ public class UnitService {
int
result
=
0
;
int
result
=
0
;
try
{
try
{
result
=
unitMapper
.
insertSelective
(
unit
);
result
=
unitMapper
.
insertSelective
(
unit
);
logService
.
insertLog
(
"计量单位"
,
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
,
request
);
logService
.
insertLog
(
"计量单位"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
).
append
(
unit
.
getUname
()).
toString
(),
request
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
}
}
...
@@ -104,7 +105,7 @@ public class UnitService {
...
@@ -104,7 +105,7 @@ public class UnitService {
try
{
try
{
result
=
unitMapper
.
updateByPrimaryKeySelective
(
unit
);
result
=
unitMapper
.
updateByPrimaryKeySelective
(
unit
);
logService
.
insertLog
(
"计量单位"
,
logService
.
insertLog
(
"计量单位"
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
id
).
toString
(),
request
);
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
unit
.
getUname
()
).
toString
(),
request
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
writeFail
(
logger
,
e
);
JshException
.
writeFail
(
logger
,
e
);
}
}
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment