Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
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
haoban3.0
haoban-manage3.0
Commits
b1c0909a
Commit
b1c0909a
authored
Aug 10, 2022
by
guojx
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-2022-08-base' into 'developer'
好办日志调整 See merge request
!204
parents
12e32a7e
7975466b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
2 deletions
+63
-2
HbLogRecordController.java
...anage/web/controller/logrecord/HbLogRecordController.java
+61
-2
dubbo-haoban-manage-web.xml
...3-web/src/main/webapp/WEB-INF/dubbo-haoban-manage-web.xml
+2
-0
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/logrecord/HbLogRecordController.java
View file @
b1c0909a
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
.
logrecord
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.api.base.commons.BasePageInfo
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.dsmongo.api.dto.DocumentResultDTO
;
import
com.gic.dsmongo.api.dto.QueryDocDTO
;
...
...
@@ -11,9 +13,13 @@ import com.gic.haoban.common.utils.AuthWebRequestUtil;
import
com.gic.haoban.manage.web.qo.logrecord.LogRecordQo
;
import
com.gic.haoban.manage.web.vo.logrecord.LogRecordTypeVO
;
import
com.gic.log.record.bean.GicLogRecordBean
;
import
com.gic.log.record.bean.OptRecordLog
;
import
com.gic.log.record.enums.OrderEnum
;
import
com.gic.log.record.service.LogSearchApiService
;
import
com.gic.log.record.util.GicLogRecordCategoryEnum
;
import
com.gic.log.record.util.GicLogRecordOptTypeEnum
;
import
com.gic.log.record.util.LogCommenUtil
;
import
com.gic.log.record.util.LogQueryWrapper
;
import
com.mongodb.BasicDBObject
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.time.DateUtils
;
...
...
@@ -35,15 +41,17 @@ public class HbLogRecordController {
private
static
final
Logger
LOGGER
=
LogManager
.
getLogger
(
HbLogRecordController
.
class
);
@Autowired
MongoOperationService
mongoOperationService
;
@Autowired
private
LogSearchApiService
logSearchApiService
;
/**
* 系统类型 0gic 1好办
*/
private
static
Integer
systemType
=
1
;
@RequestMapping
(
"/list"
)
@RequestMapping
(
"/list
-old
"
)
@ResponseBody
public
RestResponse
pageLog
(
LogRecordQo
qo
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
@RequestParam
(
defaultValue
=
"20"
)
int
pageSize
){
public
RestResponse
pageLog
Old
(
LogRecordQo
qo
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
@RequestParam
(
defaultValue
=
"20"
)
int
pageSize
){
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
String
eid
=
qo
.
getEnterpriseId
()
;
if
(
null
!=
loginUser
&&
StringUtils
.
isEmpty
(
eid
))
{
...
...
@@ -105,6 +113,57 @@ public class HbLogRecordController {
return
RestResponse
.
successResult
(
retPage
);
}
@RequestMapping
(
"/list"
)
@ResponseBody
public
RestResponse
pageLog
(
LogRecordQo
qo
,
@RequestParam
(
defaultValue
=
"1"
)
int
pageNum
,
@RequestParam
(
defaultValue
=
"20"
)
int
pageSize
){
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
String
eid
=
qo
.
getEnterpriseId
()
;
if
(
null
!=
loginUser
&&
StringUtils
.
isEmpty
(
eid
))
{
eid
=
loginUser
.
getEnterpriseId
()
;
}
//使用lambda拼装查询表达式
LogQueryWrapper
<
OptRecordLog
>
queryWrapper
=
new
LogQueryWrapper
<>();
queryWrapper
.
eq
(
OptRecordLog:
:
getEnterpriseId
,
eid
).
eq
(
OptRecordLog:
:
getStatusFlag
,
1
);
queryWrapper
.
eq
(
OptRecordLog:
:
getWxEnterpriseId
,
loginUser
.
getWxEnterpriseId
());
if
(
StringUtils
.
isNotBlank
(
qo
.
getBusinessType
()))
{
queryWrapper
.
eq
(
OptRecordLog:
:
getBusinessType
,
qo
.
getBusinessType
());
}
if
(
StringUtils
.
isNotBlank
(
qo
.
getOptType
()))
{
queryWrapper
.
eq
(
OptRecordLog:
:
getOptType
,
qo
.
getOptType
());
}
if
(
StringUtils
.
isNoneBlank
(
qo
.
getStartDate
(),
qo
.
getEndDate
()))
{
String
endDate
=
qo
.
getEndDate
()
+
" 23:59:59"
;
String
startDate
=
qo
.
getStartDate
()
+
" 00:00:00"
;
try
{
Date
startDateD
=
DateUtils
.
parseDate
(
startDate
,
"yyyy-MM-dd HH:mm:ss"
);
Date
endDateD
=
DateUtils
.
parseDate
(
endDate
,
"yyyy-MM-dd HH:mm:ss"
);
queryWrapper
.
between
(
OptRecordLog:
:
getCreateTime
,
startDateD
,
endDateD
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
if
(
null
==
loginUser
||
StringUtils
.
isBlank
(
loginUser
.
getOperationUserName
()))
{
//历史数据会刷成0.
queryWrapper
.
eq
(
OptRecordLog:
:
getYwFlag
,
0
);
}
if
(
StringUtils
.
isNotBlank
(
qo
.
getSearch
()))
{
queryWrapper
.
like
(
OptRecordLog:
:
getContent
,
qo
.
getSearch
());
}
if
(
StringUtils
.
isNotBlank
(
qo
.
getOptUser
()))
{
queryWrapper
.
eq
(
OptRecordLog:
:
getUserId
,
qo
.
getOptUser
());
}
//0:gic 1:好办 2:运维
queryWrapper
.
eq
(
OptRecordLog:
:
getSystemType
,
systemType
);
queryWrapper
.
orderBy
(
OptRecordLog:
:
getCreateTime
,
OrderEnum
.
DESC
);
BasePageInfo
basePageInfo
=
new
BasePageInfo
();
basePageInfo
.
setPageNum
(
pageNum
);
basePageInfo
.
setPageSize
(
pageSize
);
//查询接口 分页方式
ServiceResponse
<
Page
>
pageServiceResponse
=
logSearchApiService
.
queryByPage
(
queryWrapper
,
basePageInfo
);
return
RestResponse
.
successResult
(
pageServiceResponse
.
getResult
());
}
/**
* 获取 业务模块
* @return
...
...
haoban-manage3-web/src/main/webapp/WEB-INF/dubbo-haoban-manage-web.xml
View file @
b1c0909a
...
...
@@ -119,4 +119,6 @@
<dubbo:reference
id=
"mongoOperationService"
interface=
"com.gic.dsmongo.api.service.MongoOperationService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
id=
"logSearchApiService"
interface=
"com.gic.log.record.service.LogSearchApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
</beans>
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