Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
manager
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
reyun
manager
Commits
7a07d01c
Commit
7a07d01c
authored
Feb 02, 2018
by
manxiaoqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
app排序
parent
ba2cdf81
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
44 additions
and
15 deletions
+44
-15
workspace.xml
.idea/workspace.xml
+0
-0
ContractController.java
src/main/java/common/controller/ContractController.java
+20
-8
UserLogController.java
src/main/java/common/controller/UserLogController.java
+4
-2
UserLogRepository.java
src/main/java/common/repository/UserLogRepository.java
+2
-2
UserLogService.java
src/main/java/common/service/UserLogService.java
+2
-1
UserLogServiceImpl.java
src/main/java/common/service/impl/UserLogServiceImpl.java
+16
-2
No files found.
.idea/workspace.xml
View file @
7a07d01c
This diff is collapsed.
Click to expand it.
src/main/java/common/controller/ContractController.java
View file @
7a07d01c
...
...
@@ -186,20 +186,29 @@ public class ContractController {
@RequestMapping
(
value
=
"update"
,
method
=
RequestMethod
.
PUT
)
@ResponseBody
public
ResultModel
update
(
@CurrentAccount
User
loginAccount
,
@RequestBody
Contract
contract
)
{
return
ResultModel
.
OK
(
service
.
update
(
loginAccount
,
contract
));
public
ResultModel
update
(
@CurrentAccount
User
loginAccount
,
@RequestBody
Contract
contract
,
HttpServletRequest
request
)
{
Contract
contract1
=
service
.
update
(
loginAccount
,
contract
);
NewUserLogThread
userlog
=
new
NewUserLogThread
(
loginAccount
.
getEmail
(),
loginAccount
.
getName
(),
OperateObjectTypeEnum
.
CUSTOMER
.
getKey
(),
contract
.
getContractCode
(),
"修改合同"
,
""
,
contract1
.
toString
(),
request
);
userlog
.
start
();
return
ResultModel
.
OK
(
contract1
);
}
@RequestMapping
(
value
=
"pay"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
ResultModel
pay
(
@CurrentAccount
User
loginAccount
,
@RequestBody
ContractMoney
contract
)
{
return
ResultModel
.
OK
(
service
.
pay
(
loginAccount
,
contract
));
public
ResultModel
pay
(
@CurrentAccount
User
loginAccount
,
@RequestBody
ContractMoney
contract
,
HttpServletRequest
request
)
{
ContractMoney
contract1
=
service
.
pay
(
loginAccount
,
contract
);
NewUserLogThread
userlog
=
new
NewUserLogThread
(
loginAccount
.
getEmail
(),
loginAccount
.
getName
(),
OperateObjectTypeEnum
.
CUSTOMER
.
getKey
(),
contract
.
getContractCode
(),
"收款开票"
,
""
,
contract1
.
toString
(),
request
);
userlog
.
start
();
return
ResultModel
.
OK
(
contract1
);
}
@RequestMapping
(
value
=
"change"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
ResultModel
change
(
@CurrentAccount
User
loginAccount
,
@RequestBody
ContractChange
contract
)
{
return
ResultModel
.
OK
(
service
.
change
(
loginAccount
,
contract
));
public
ResultModel
change
(
@CurrentAccount
User
loginAccount
,
@RequestBody
ContractChange
contract
,
HttpServletRequest
request
)
{
Contract
contract1
=
service
.
change
(
loginAccount
,
contract
);
NewUserLogThread
userlog
=
new
NewUserLogThread
(
loginAccount
.
getEmail
(),
loginAccount
.
getName
(),
OperateObjectTypeEnum
.
CUSTOMER
.
getKey
(),
contract
.
getContractCode
(),
"修改套餐"
,
""
,
contract1
.
toString
(),
request
);
userlog
.
start
();
return
ResultModel
.
OK
(
contract1
);
}
@RequestMapping
(
value
=
"find/pay"
,
method
=
RequestMethod
.
GET
)
...
...
@@ -218,8 +227,11 @@ public class ContractController {
@RequestMapping
(
value
=
"update/pay"
,
method
=
RequestMethod
.
PUT
)
@ResponseBody
public
ResultModel
updatePay
(
@CurrentAccount
User
loginAccount
,
@RequestBody
ContractMoney
contract
)
{
return
ResultModel
.
OK
(
service
.
updatePay
(
loginAccount
,
contract
));
public
ResultModel
updatePay
(
@CurrentAccount
User
loginAccount
,
@RequestBody
ContractMoney
contract
,
HttpServletRequest
request
)
{
Contract
contract1
=
service
.
updatePay
(
loginAccount
,
contract
);
NewUserLogThread
userlog
=
new
NewUserLogThread
(
loginAccount
.
getEmail
(),
loginAccount
.
getName
(),
OperateObjectTypeEnum
.
CUSTOMER
.
getKey
(),
contract
.
getContractCode
(),
"修改收款开票"
,
""
,
service
.
updatePay
(
loginAccount
,
contract
).
toString
(),
request
);
userlog
.
start
();
return
ResultModel
.
OK
(
contract1
);
}
@RequestMapping
(
value
=
"find/payall"
,
method
=
RequestMethod
.
GET
)
...
...
src/main/java/common/controller/UserLogController.java
View file @
7a07d01c
package
common
.
controller
;
import
common.model.User
;
import
common.model.UserLog
;
import
common.service.UserLogService
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -8,6 +9,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
security.annotation.CurrentAccount
;
import
util.ResultModel
;
import
java.util.List
;
...
...
@@ -24,7 +26,7 @@ public class UserLogController
///api/userlog/list?startDate=2017-12-26&endDate=2017-12-27
@RequestMapping
(
value
=
"list"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
ResultModel
findByDS
(
@RequestParam
String
startDate
,
@RequestParam
String
endDate
)
{
return
ResultModel
.
OK
(
userLogService
.
findUserLog
(
startDate
,
endDate
));
public
ResultModel
findByDS
(
@
CurrentAccount
User
user
,
@
RequestParam
String
startDate
,
@RequestParam
String
endDate
)
{
return
ResultModel
.
OK
(
userLogService
.
findUserLog
(
user
,
startDate
,
endDate
));
}
}
src/main/java/common/repository/UserLogRepository.java
View file @
7a07d01c
...
...
@@ -11,6 +11,6 @@ import java.util.List;
*/
public
interface
UserLogRepository
extends
JpaRepository
<
UserLog
,
Long
>
{
@Query
(
value
=
"select * from user_log where substr(operate_time, 1, 10)>=?1 and substr(operate_time, 1, 10)<=?2"
,
nativeQuery
=
true
)
List
<
UserLog
>
findByOperateTime
(
String
startDate
,
String
endDate
);
@Query
(
value
=
"select * from user_log where substr(operate_time, 1, 10)>=?1 and substr(operate_time, 1, 10)<=?2
and opera_account in ?3
"
,
nativeQuery
=
true
)
List
<
UserLog
>
findByOperateTime
(
String
startDate
,
String
endDate
,
List
<
String
>
emails
);
}
src/main/java/common/service/UserLogService.java
View file @
7a07d01c
package
common
.
service
;
import
common.model.User
;
import
common.model.UserLog
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
...
...
@@ -11,5 +12,5 @@ import java.util.List;
*/
public
interface
UserLogService
{
List
<
UserLog
>
findUserLog
(
String
startDate
,
String
endDate
);
List
<
UserLog
>
findUserLog
(
User
user
,
String
startDate
,
String
endDate
);
}
src/main/java/common/service/impl/UserLogServiceImpl.java
View file @
7a07d01c
package
common
.
service
.
impl
;
import
common.model.User
;
import
common.model.UserLog
;
import
common.repository.UserLogRepository
;
import
common.service.UserLogService
;
import
common.service.UserService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.stereotype.Service
;
import
util.StringUtil
;
import
util.ValidateUtil
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
javax.persistence.criteria.CriteriaQuery
;
...
...
@@ -25,11 +28,22 @@ public class UserLogServiceImpl implements UserLogService
{
@Autowired
UserLogRepository
userLogRepository
;
@Autowired
UserService
userService
;
@Override
public
List
<
UserLog
>
findUserLog
(
String
startDate
,
String
endDate
)
public
List
<
UserLog
>
findUserLog
(
User
user
,
String
startDate
,
String
endDate
)
{
return
userLogRepository
.
findByOperateTime
(
startDate
,
endDate
);
List
<
User
>
allSons
=
userService
.
findAllSons
(
user
.
getId
());
List
<
String
>
emailList
=
new
ArrayList
<>();
emailList
.
add
(
user
.
getEmail
());
if
(
ValidateUtil
.
isValid
(
allSons
)){
for
(
User
u
:
allSons
){
emailList
.
add
(
u
.
getEmail
());
}
}
return
userLogRepository
.
findByOperateTime
(
startDate
,
endDate
,
emailList
);
}
}
Write
Preview
Markdown
is supported
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