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
fd7df687
Commit
fd7df687
authored
Apr 18, 2019
by
qiankunpingtai
Browse files
异常封装之日志信息后台修改
parent
94c64dd9
Changes
18
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/jsh/erp/controller/MaterialController.java
View file @
fd7df687
...
...
@@ -68,7 +68,7 @@ public class MaterialController {
@PostMapping
(
value
=
"/batchSetEnable"
)
public
String
batchSetEnable
(
@RequestParam
(
"enabled"
)
Boolean
enabled
,
@RequestParam
(
"materialIDs"
)
String
materialIDs
,
HttpServletRequest
request
)
{
HttpServletRequest
request
)
throws
Exception
{
Map
<
String
,
Object
>
objectMap
=
new
HashMap
<
String
,
Object
>();
int
res
=
materialService
.
batchSetEnable
(
enabled
,
materialIDs
);
if
(
res
>
0
)
{
...
...
src/main/java/com/jsh/erp/controller/SerialNumberController.java
View file @
fd7df687
...
...
@@ -61,7 +61,7 @@ public class SerialNumberController {
*/
@PostMapping
(
"/serialNumber/addSerialNumber"
)
@ResponseBody
public
Object
addSerialNumber
(
@RequestParam
(
"info"
)
String
beanJson
){
public
Object
addSerialNumber
(
@RequestParam
(
"info"
)
String
beanJson
)
throws
Exception
{
JSONObject
result
=
ExceptionConstants
.
standardSuccess
();
SerialNumberEx
sne
=
JSON
.
parseObject
(
beanJson
,
SerialNumberEx
.
class
);
serialNumberService
.
addSerialNumber
(
sne
);
...
...
@@ -78,7 +78,7 @@ public class SerialNumberController {
*/
@PostMapping
(
"/serialNumber/updateSerialNumber"
)
@ResponseBody
public
Object
updateSerialNumber
(
@RequestParam
(
"info"
)
String
beanJson
){
public
Object
updateSerialNumber
(
@RequestParam
(
"info"
)
String
beanJson
)
throws
Exception
{
JSONObject
result
=
ExceptionConstants
.
standardSuccess
();
SerialNumberEx
sne
=
JSON
.
parseObject
(
beanJson
,
SerialNumberEx
.
class
);
...
...
@@ -100,7 +100,7 @@ public class SerialNumberController {
@PostMapping
(
"/serialNumber/batAddSerialNumber"
)
@ResponseBody
public
Object
batAddSerialNumber
(
@RequestParam
(
"materialName"
)
String
materialName
,
@RequestParam
(
"serialNumberPrefix"
)
String
serialNumberPrefix
,
@RequestParam
(
"batAddTotal"
)
Integer
batAddTotal
,
@RequestParam
(
"remark"
)
String
remark
){
@RequestParam
(
"batAddTotal"
)
Integer
batAddTotal
,
@RequestParam
(
"remark"
)
String
remark
)
throws
Exception
{
JSONObject
result
=
ExceptionConstants
.
standardSuccess
();
serialNumberService
.
batAddSerialNumber
(
materialName
,
serialNumberPrefix
,
batAddTotal
,
remark
);
...
...
src/main/java/com/jsh/erp/controller/SupplierController.java
View file @
fd7df687
...
...
@@ -57,7 +57,7 @@ public class SupplierController {
@PostMapping
(
value
=
"/updateAdvanceIn"
)
public
String
updateAdvanceIn
(
@RequestParam
(
"supplierId"
)
Long
supplierId
,
@RequestParam
(
"advanceIn"
)
BigDecimal
advanceIn
,
HttpServletRequest
request
)
{
HttpServletRequest
request
)
throws
Exception
{
Map
<
String
,
Object
>
objectMap
=
new
HashMap
<
String
,
Object
>();
int
res
=
supplierService
.
updateAdvanceIn
(
supplierId
,
advanceIn
);
if
(
res
>
0
)
{
...
...
@@ -221,7 +221,7 @@ public class SupplierController {
@PostMapping
(
value
=
"/batchSetEnable"
)
public
String
batchSetEnable
(
@RequestParam
(
"enabled"
)
Boolean
enabled
,
@RequestParam
(
"supplierIDs"
)
String
supplierIDs
,
HttpServletRequest
request
)
{
HttpServletRequest
request
)
throws
Exception
{
Map
<
String
,
Object
>
objectMap
=
new
HashMap
<
String
,
Object
>();
int
res
=
supplierService
.
batchSetEnable
(
enabled
,
supplierIDs
);
if
(
res
>
0
)
{
...
...
src/main/java/com/jsh/erp/controller/UserController.java
View file @
fd7df687
...
...
@@ -192,7 +192,7 @@ public class UserController {
@PostMapping
(
value
=
"/resetPwd"
)
public
String
resetPwd
(
@RequestParam
(
"id"
)
Long
id
,
HttpServletRequest
request
)
throws
NoSuchAlgorithm
Exception
{
HttpServletRequest
request
)
throws
Exception
{
Map
<
String
,
Object
>
objectMap
=
new
HashMap
<
String
,
Object
>();
String
password
=
"123456"
;
String
md5Pwd
=
Tools
.
md5Encryp
(
password
);
...
...
src/main/java/com/jsh/erp/service/log/LogComponent.java
View file @
fd7df687
...
...
@@ -19,16 +19,16 @@ public class LogComponent implements ICommonQuery {
private
LogService
logService
;
@Override
public
Object
selectOne
(
String
condition
)
{
public
Object
selectOne
(
String
condition
)
throws
Exception
{
return
null
;
}
@Override
public
List
<?>
select
(
Map
<
String
,
String
>
map
)
{
public
List
<?>
select
(
Map
<
String
,
String
>
map
)
throws
Exception
{
return
getUserList
(
map
);
}
private
List
<?>
getUserList
(
Map
<
String
,
String
>
map
)
{
private
List
<?>
getUserList
(
Map
<
String
,
String
>
map
)
throws
Exception
{
String
search
=
map
.
get
(
Constants
.
SEARCH
);
String
operation
=
StringUtil
.
getInfo
(
search
,
"operation"
);
Integer
usernameID
=
StringUtil
.
parseInteger
(
StringUtil
.
getInfo
(
search
,
"usernameID"
));
...
...
@@ -43,7 +43,7 @@ public class LogComponent implements ICommonQuery {
}
@Override
public
Long
counts
(
Map
<
String
,
String
>
map
)
{
public
Long
counts
(
Map
<
String
,
String
>
map
)
throws
Exception
{
String
search
=
map
.
get
(
Constants
.
SEARCH
);
String
operation
=
StringUtil
.
getInfo
(
search
,
"operation"
);
Integer
usernameID
=
StringUtil
.
parseInteger
(
StringUtil
.
getInfo
(
search
,
"usernameID"
));
...
...
@@ -56,27 +56,27 @@ public class LogComponent implements ICommonQuery {
}
@Override
public
int
insert
(
String
beanJson
,
HttpServletRequest
request
)
{
public
int
insert
(
String
beanJson
,
HttpServletRequest
request
)
throws
Exception
{
return
logService
.
insertLog
(
beanJson
,
request
);
}
@Override
public
int
update
(
String
beanJson
,
Long
id
)
{
public
int
update
(
String
beanJson
,
Long
id
)
throws
Exception
{
return
logService
.
updateLog
(
beanJson
,
id
);
}
@Override
public
int
delete
(
Long
id
)
{
public
int
delete
(
Long
id
)
throws
Exception
{
return
logService
.
deleteLog
(
id
);
}
@Override
public
int
batchDelete
(
String
ids
)
{
public
int
batchDelete
(
String
ids
)
throws
Exception
{
return
logService
.
batchDeleteLog
(
ids
);
}
@Override
public
int
checkIsNameExist
(
Long
id
,
String
name
)
{
public
int
checkIsNameExist
(
Long
id
,
String
name
)
throws
Exception
{
return
0
;
}
...
...
src/main/java/com/jsh/erp/service/log/LogService.java
View file @
fd7df687
...
...
@@ -2,16 +2,15 @@ package com.jsh.erp.service.log;
import
com.alibaba.fastjson.JSONObject
;
import
com.jsh.erp.constants.BusinessConstants
;
import
com.jsh.erp.constants.ExceptionConstants
;
import
com.jsh.erp.datasource.entities.Log
;
import
com.jsh.erp.datasource.entities.LogExample
;
import
com.jsh.erp.datasource.entities.User
;
import
com.jsh.erp.datasource.mappers.LogMapper
;
import
com.jsh.erp.datasource.mappers.LogMapperEx
;
import
com.jsh.erp.datasource.vo.LogVo4List
;
import
com.jsh.erp.utils.ExceptionCodeConstants
;
import
com.jsh.erp.utils.JshException
;
import
com.jsh.erp.exception.BusinessRunTimeException
;
import
com.jsh.erp.utils.StringUtil
;
import
com.jsh.erp.utils.Tools
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Service
;
...
...
@@ -19,7 +18,6 @@ import org.springframework.transaction.annotation.Transactional;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
import
java.security.NoSuchAlgorithmException
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -34,50 +32,122 @@ public class LogService {
@Resource
private
LogMapperEx
logMapperEx
;
public
Log
getLog
(
long
id
)
{
return
logMapper
.
selectByPrimaryKey
(
id
);
public
Log
getLog
(
long
id
)
throws
Exception
{
Log
result
=
null
;
try
{
result
=
logMapper
.
selectByPrimaryKey
(
id
);
}
catch
(
Exception
e
){
logger
.
error
(
"异常码[{}],异常提示[{}],异常[{}]"
,
ExceptionConstants
.
DATA_READ_FAIL_CODE
,
ExceptionConstants
.
DATA_READ_FAIL_MSG
,
e
);
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DATA_READ_FAIL_CODE
,
ExceptionConstants
.
DATA_READ_FAIL_MSG
);
}
return
result
;
}
public
List
<
Log
>
getLog
()
{
public
List
<
Log
>
getLog
()
throws
Exception
{
LogExample
example
=
new
LogExample
();
return
logMapper
.
selectByExample
(
example
);
List
<
Log
>
list
=
null
;
try
{
list
=
logMapper
.
selectByExample
(
example
);
}
catch
(
Exception
e
){
logger
.
error
(
"异常码[{}],异常提示[{}],异常[{}]"
,
ExceptionConstants
.
DATA_READ_FAIL_CODE
,
ExceptionConstants
.
DATA_READ_FAIL_MSG
,
e
);
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DATA_READ_FAIL_CODE
,
ExceptionConstants
.
DATA_READ_FAIL_MSG
);
}
return
list
;
}
public
List
<
LogVo4List
>
select
(
String
operation
,
Integer
usernameID
,
String
clientIp
,
Integer
status
,
String
beginTime
,
String
endTime
,
String
contentdetails
,
int
offset
,
int
rows
)
{
return
logMapperEx
.
selectByConditionLog
(
operation
,
usernameID
,
clientIp
,
status
,
beginTime
,
endTime
,
contentdetails
,
offset
,
rows
);
String
contentdetails
,
int
offset
,
int
rows
)
throws
Exception
{
List
<
LogVo4List
>
list
=
null
;
try
{
list
=
logMapperEx
.
selectByConditionLog
(
operation
,
usernameID
,
clientIp
,
status
,
beginTime
,
endTime
,
contentdetails
,
offset
,
rows
);
}
catch
(
Exception
e
){
logger
.
error
(
"异常码[{}],异常提示[{}],异常[{}]"
,
ExceptionConstants
.
DATA_READ_FAIL_CODE
,
ExceptionConstants
.
DATA_READ_FAIL_MSG
,
e
);
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DATA_READ_FAIL_CODE
,
ExceptionConstants
.
DATA_READ_FAIL_MSG
);
}
return
list
;
}
public
Long
countLog
(
String
operation
,
Integer
usernameID
,
String
clientIp
,
Integer
status
,
String
beginTime
,
String
endTime
,
String
contentdetails
)
{
return
logMapperEx
.
countsByLog
(
operation
,
usernameID
,
clientIp
,
status
,
beginTime
,
endTime
,
contentdetails
);
String
contentdetails
)
throws
Exception
{
Long
result
=
null
;
try
{
result
=
logMapperEx
.
countsByLog
(
operation
,
usernameID
,
clientIp
,
status
,
beginTime
,
endTime
,
contentdetails
);
}
catch
(
Exception
e
){
logger
.
error
(
"异常码[{}],异常提示[{}],异常[{}]"
,
ExceptionConstants
.
DATA_READ_FAIL_CODE
,
ExceptionConstants
.
DATA_READ_FAIL_MSG
,
e
);
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DATA_READ_FAIL_CODE
,
ExceptionConstants
.
DATA_READ_FAIL_MSG
);
}
return
result
;
}
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
insertLog
(
String
beanJson
,
HttpServletRequest
request
)
{
public
int
insertLog
(
String
beanJson
,
HttpServletRequest
request
)
throws
Exception
{
Log
log
=
JSONObject
.
parseObject
(
beanJson
,
Log
.
class
);
return
logMapper
.
insertSelective
(
log
);
int
result
=
0
;
try
{
result
=
logMapper
.
insertSelective
(
log
);
}
catch
(
Exception
e
){
logger
.
error
(
"异常码[{}],异常提示[{}],异常[{}]"
,
ExceptionConstants
.
DATA_WRITE_FAIL_CODE
,
ExceptionConstants
.
DATA_WRITE_FAIL_MSG
,
e
);
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DATA_WRITE_FAIL_CODE
,
ExceptionConstants
.
DATA_WRITE_FAIL_MSG
);
}
return
result
;
}
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
updateLog
(
String
beanJson
,
Long
id
)
{
public
int
updateLog
(
String
beanJson
,
Long
id
)
throws
Exception
{
Log
log
=
JSONObject
.
parseObject
(
beanJson
,
Log
.
class
);
log
.
setId
(
id
);
return
logMapper
.
updateByPrimaryKeySelective
(
log
);
int
result
=
0
;
try
{
result
=
logMapper
.
updateByPrimaryKeySelective
(
log
);
}
catch
(
Exception
e
){
logger
.
error
(
"异常码[{}],异常提示[{}],异常[{}]"
,
ExceptionConstants
.
DATA_WRITE_FAIL_CODE
,
ExceptionConstants
.
DATA_WRITE_FAIL_MSG
,
e
);
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DATA_WRITE_FAIL_CODE
,
ExceptionConstants
.
DATA_WRITE_FAIL_MSG
);
}
return
result
;
}
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
deleteLog
(
Long
id
)
{
return
logMapper
.
deleteByPrimaryKey
(
id
);
public
int
deleteLog
(
Long
id
)
throws
Exception
{
int
result
=
0
;
try
{
result
=
logMapper
.
deleteByPrimaryKey
(
id
);
}
catch
(
Exception
e
){
logger
.
error
(
"异常码[{}],异常提示[{}],异常[{}]"
,
ExceptionConstants
.
DATA_WRITE_FAIL_CODE
,
ExceptionConstants
.
DATA_WRITE_FAIL_MSG
,
e
);
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DATA_WRITE_FAIL_CODE
,
ExceptionConstants
.
DATA_WRITE_FAIL_MSG
);
}
return
result
;
}
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
batchDeleteLog
(
String
ids
)
{
public
int
batchDeleteLog
(
String
ids
)
throws
Exception
{
List
<
Long
>
idList
=
StringUtil
.
strToLongList
(
ids
);
LogExample
example
=
new
LogExample
();
example
.
createCriteria
().
andIdIn
(
idList
);
return
logMapper
.
deleteByExample
(
example
);
int
result
=
0
;
try
{
result
=
logMapper
.
deleteByExample
(
example
);
}
catch
(
Exception
e
){
logger
.
error
(
"异常码[{}],异常提示[{}],异常[{}]"
,
ExceptionConstants
.
DATA_WRITE_FAIL_CODE
,
ExceptionConstants
.
DATA_WRITE_FAIL_MSG
,
e
);
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DATA_WRITE_FAIL_CODE
,
ExceptionConstants
.
DATA_WRITE_FAIL_MSG
);
}
return
result
;
}
/**
...
...
@@ -85,7 +155,7 @@ public class LogService {
* @param request
* @return
*/
public
Long
getUserId
(
HttpServletRequest
request
)
{
public
Long
getUserId
(
HttpServletRequest
request
)
throws
Exception
{
Object
userInfo
=
request
.
getSession
().
getAttribute
(
"user"
);
if
(
userInfo
!=
null
)
{
User
user
=
(
User
)
userInfo
;
...
...
@@ -95,7 +165,7 @@ public class LogService {
}
}
public
String
getModule
(
String
apiName
){
public
String
getModule
(
String
apiName
)
throws
Exception
{
String
moduleName
=
null
;
switch
(
apiName
)
{
case
BusinessConstants
.
LOG_INTERFACE_NAME_USER
:
...
...
@@ -144,7 +214,7 @@ public class LogService {
return
moduleName
;
}
public
void
insertLog
(
String
apiName
,
String
type
,
HttpServletRequest
request
){
public
void
insertLog
(
String
apiName
,
String
type
,
HttpServletRequest
request
)
throws
Exception
{
Log
log
=
new
Log
();
log
.
setUserid
(
getUserId
(
request
));
log
.
setOperation
(
getModule
(
apiName
));
...
...
@@ -154,7 +224,15 @@ public class LogService {
log
.
setStatus
(
status
);
log
.
setContentdetails
(
type
+
getModule
(
apiName
));
log
.
setRemark
(
type
+
getModule
(
apiName
));
logMapper
.
insertSelective
(
log
);
try
{
logMapper
.
insertSelective
(
log
);
}
catch
(
Exception
e
){
logger
.
error
(
"异常码[{}],异常提示[{}],异常[{}]"
,
ExceptionConstants
.
DATA_WRITE_FAIL_CODE
,
ExceptionConstants
.
DATA_WRITE_FAIL_MSG
,
e
);
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DATA_WRITE_FAIL_CODE
,
ExceptionConstants
.
DATA_WRITE_FAIL_MSG
);
}
}
}
src/main/java/com/jsh/erp/service/material/MaterialService.java
View file @
fd7df687
...
...
@@ -150,7 +150,7 @@ public class MaterialService {
}
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
batchSetEnable
(
Boolean
enabled
,
String
materialIDs
)
{
public
int
batchSetEnable
(
Boolean
enabled
,
String
materialIDs
)
throws
Exception
{
logService
.
insertLog
(
BusinessConstants
.
LOG_INTERFACE_NAME_MATERIAL
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
materialIDs
).
toString
(),
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
...
...
@@ -217,7 +217,7 @@ public class MaterialService {
return
materialMapperEx
.
getMaterialEnableSerialNumberList
(
parameterMap
);
}
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
batchDeleteMaterialByIds
(
String
ids
)
{
public
int
batchDeleteMaterialByIds
(
String
ids
)
throws
Exception
{
logService
.
insertLog
(
BusinessConstants
.
LOG_INTERFACE_NAME_MATERIAL
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_DELETE
).
append
(
ids
).
toString
(),
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
...
...
src/main/java/com/jsh/erp/service/materialCategory/MaterialCategoryService.java
View file @
fd7df687
...
...
@@ -164,7 +164,7 @@ public class MaterialCategoryService {
return
materialCategoryMapperEx
.
batchDeleteMaterialCategoryByIds
(
updateDate
,
updater
,
strArray
);
}
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
editMaterialCategory
(
MaterialCategory
mc
)
{
public
int
editMaterialCategory
(
MaterialCategory
mc
)
throws
Exception
{
logService
.
insertLog
(
BusinessConstants
.
LOG_INTERFACE_NAME_MATERIAL_CATEGORY
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
mc
.
getId
()).
toString
(),
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
...
...
src/main/java/com/jsh/erp/service/materialProperty/MaterialPropertyService.java
View file @
fd7df687
...
...
@@ -84,7 +84,7 @@ public class MaterialPropertyService {
return
0
;
}
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
batchDeleteMaterialPropertyByIds
(
String
ids
)
{
public
int
batchDeleteMaterialPropertyByIds
(
String
ids
)
throws
Exception
{
logService
.
insertLog
(
BusinessConstants
.
LOG_INTERFACE_NAME_MATERIAL_PROPERTY
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_DELETE
).
append
(
ids
).
toString
(),
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
...
...
src/main/java/com/jsh/erp/service/person/PersonService.java
View file @
fd7df687
...
...
@@ -117,7 +117,7 @@ public class PersonService {
}
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
batchDeletePersonByIds
(
String
ids
)
{
public
int
batchDeletePersonByIds
(
String
ids
)
throws
Exception
{
logService
.
insertLog
(
BusinessConstants
.
LOG_INTERFACE_NAME_PERSON
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_DELETE
).
append
(
ids
).
toString
(),
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
...
...
src/main/java/com/jsh/erp/service/role/RoleService.java
View file @
fd7df687
...
...
@@ -98,7 +98,7 @@ public class RoleService {
* @return int
*/
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
batchDeleteRoleByIds
(
String
ids
)
{
public
int
batchDeleteRoleByIds
(
String
ids
)
throws
Exception
{
logService
.
insertLog
(
BusinessConstants
.
LOG_INTERFACE_NAME_SERIAL_NUMBER
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_DELETE
).
append
(
ids
).
toString
(),
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
...
...
src/main/java/com/jsh/erp/service/serialNumber/SerialNumberComponent.java
View file @
fd7df687
...
...
@@ -51,7 +51,7 @@ public class SerialNumberComponent implements ICommonQuery {
}
@Override
public
int
insert
(
String
beanJson
,
HttpServletRequest
request
)
{
public
int
insert
(
String
beanJson
,
HttpServletRequest
request
)
throws
Exception
{
return
serialNumberService
.
insertSerialNumber
(
beanJson
,
request
);
}
...
...
src/main/java/com/jsh/erp/service/serialNumber/SerialNumberService.java
View file @
fd7df687
...
...
@@ -67,7 +67,7 @@ public class SerialNumberService {
}
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
insertSerialNumber
(
String
beanJson
,
HttpServletRequest
request
)
{
public
int
insertSerialNumber
(
String
beanJson
,
HttpServletRequest
request
)
throws
Exception
{
SerialNumber
serialNumber
=
JSONObject
.
parseObject
(
beanJson
,
SerialNumber
.
class
);
logService
.
insertLog
(
BusinessConstants
.
LOG_INTERFACE_NAME_SERIAL_NUMBER
,
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
,
request
);
return
serialNumberMapper
.
insertSelective
(
serialNumber
);
...
...
@@ -169,7 +169,7 @@ public class SerialNumberService {
* 新增序列号信息
* */
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
SerialNumberEx
addSerialNumber
(
SerialNumberEx
serialNumberEx
)
{
public
SerialNumberEx
addSerialNumber
(
SerialNumberEx
serialNumberEx
)
throws
Exception
{
logService
.
insertLog
(
BusinessConstants
.
LOG_INTERFACE_NAME_SERIAL_NUMBER
,
BusinessConstants
.
LOG_OPERATION_TYPE_ADD
,
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
if
(
serialNumberEx
==
null
){
...
...
@@ -194,7 +194,7 @@ public class SerialNumberService {
return
null
;
}
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
SerialNumberEx
updateSerialNumber
(
SerialNumberEx
serialNumberEx
)
{
public
SerialNumberEx
updateSerialNumber
(
SerialNumberEx
serialNumberEx
)
throws
Exception
{
logService
.
insertLog
(
BusinessConstants
.
LOG_INTERFACE_NAME_SERIAL_NUMBER
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
serialNumberEx
.
getId
()).
toString
(),
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
...
...
@@ -351,7 +351,7 @@ public class SerialNumberService {
* @return java.lang.Object
*/
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
void
batAddSerialNumber
(
String
materialName
,
String
serialNumberPrefix
,
Integer
batAddTotal
,
String
remark
)
{
public
void
batAddSerialNumber
(
String
materialName
,
String
serialNumberPrefix
,
Integer
batAddTotal
,
String
remark
)
throws
Exception
{
logService
.
insertLog
(
BusinessConstants
.
LOG_INTERFACE_NAME_SERIAL_NUMBER
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_BATCH_ADD
).
append
(
batAddTotal
).
append
(
BusinessConstants
.
LOG_DATA_UNIT
).
toString
(),
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
...
...
@@ -401,7 +401,7 @@ public class SerialNumberService {
* @return
*/
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
batchDeleteSerialNumberByIds
(
String
ids
)
{
public
int
batchDeleteSerialNumberByIds
(
String
ids
)
throws
Exception
{
logService
.
insertLog
(
BusinessConstants
.
LOG_INTERFACE_NAME_SERIAL_NUMBER
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_DELETE
).
append
(
ids
).
toString
(),
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
...
...
src/main/java/com/jsh/erp/service/supplier/SupplierService.java
View file @
fd7df687
...
...
@@ -99,7 +99,7 @@ public class SupplierService {
}
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
updateAdvanceIn
(
Long
supplierId
,
BigDecimal
advanceIn
){
public
int
updateAdvanceIn
(
Long
supplierId
,
BigDecimal
advanceIn
)
throws
Exception
{
logService
.
insertLog
(
BusinessConstants
.
LOG_INTERFACE_NAME_SUPPLIER
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
supplierId
).
toString
(),
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
...
...
@@ -145,7 +145,7 @@ public class SupplierService {
}
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
batchSetEnable
(
Boolean
enabled
,
String
supplierIDs
)
{
public
int
batchSetEnable
(
Boolean
enabled
,
String
supplierIDs
)
throws
Exception
{
logService
.
insertLog
(
BusinessConstants
.
LOG_INTERFACE_NAME_SUPPLIER
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
supplierIDs
).
toString
(),
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
...
...
@@ -191,7 +191,7 @@ public class SupplierService {
return
info
;
}
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
batchDeleteSupplierByIds
(
String
ids
)
{
public
int
batchDeleteSupplierByIds
(
String
ids
)
throws
Exception
{
logService
.
insertLog
(
BusinessConstants
.
LOG_INTERFACE_NAME_SUPPLIER
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_DELETE
).
append
(
ids
).
toString
(),
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
...
...
src/main/java/com/jsh/erp/service/systemConfig/SystemConfigService.java
View file @
fd7df687
...
...
@@ -87,7 +87,7 @@ public class SystemConfigService {
}
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
batchDeleteSystemConfigByIds
(
String
ids
)
{
public
int
batchDeleteSystemConfigByIds
(
String
ids
)
throws
Exception
{
logService
.
insertLog
(
BusinessConstants
.
LOG_INTERFACE_NAME_SYSTEM_CONFIG
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_DELETE
).
append
(
ids
).
toString
(),
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
...
...
src/main/java/com/jsh/erp/service/unit/UnitService.java
View file @
fd7df687
...
...
@@ -94,7 +94,7 @@ public class UnitService {
return
list
.
size
();
}
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
batchDeleteUnitByIds
(
String
ids
)
{
public
int
batchDeleteUnitByIds
(
String
ids
)
throws
Exception
{
logService
.
insertLog
(
BusinessConstants
.
LOG_INTERFACE_NAME_UNIT
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_DELETE
).
append
(
ids
).
toString
(),
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
...
...
src/main/java/com/jsh/erp/service/user/UserService.java
View file @
fd7df687
...
...
@@ -114,7 +114,7 @@ public class UserService {
* @return int
*/
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
updateUserByObj
(
User
user
)
{
public
int
updateUserByObj
(
User
user
)
throws
Exception
{
logService
.
insertLog
(
BusinessConstants
.
LOG_INTERFACE_NAME_USER
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
user
.
getId
()).
toString
(),
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
...
...
@@ -130,7 +130,7 @@ public class UserService {
* @return int
*/
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
resetPwd
(
String
md5Pwd
,
Long
id
)
{
public
int
resetPwd
(
String
md5Pwd
,
Long
id
)
throws
Exception
{
logService
.
insertLog
(
BusinessConstants
.
LOG_INTERFACE_NAME_USER
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
id
).
toString
(),
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
...
...
@@ -467,7 +467,7 @@ public class UserService {
* 批量删除用户
* */
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
void
batDeleteUser
(
String
ids
)
{
public
void
batDeleteUser
(
String
ids
)
throws
Exception
{
logService
.
insertLog
(
BusinessConstants
.
LOG_INTERFACE_NAME_USER
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_DELETE
).
append
(
ids
).
toString
(),
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
...
...
src/main/java/com/jsh/erp/service/userBusiness/UserBusinessService.java
View file @
fd7df687
...
...
@@ -142,7 +142,7 @@ public class UserBusinessService {
}
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
updateBtnStr
(
Long
userBusinessId
,
String
btnStr
)
{
public
int
updateBtnStr
(
Long
userBusinessId
,
String
btnStr
)
throws
Exception
{
logService
.
insertLog
(
BusinessConstants
.
LOG_INTERFACE_NAME_USER_BUSINESS
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_EDIT
).
append
(
userBusinessId
).
toString
(),
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
...
...
@@ -171,7 +171,7 @@ public class UserBusinessService {
}
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
batchDeleteUserBusinessByIds
(
String
ids
)
{
public
int
batchDeleteUserBusinessByIds
(
String
ids
)
throws
Exception
{
logService
.
insertLog
(
BusinessConstants
.
LOG_INTERFACE_NAME_USER_BUSINESS
,
new
StringBuffer
(
BusinessConstants
.
LOG_OPERATION_TYPE_DELETE
).
append
(
ids
).
toString
(),
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
());
...
...
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