Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
项目统一框架
amos-boot-biz
Commits
ebdab5ea
Commit
ebdab5ea
authored
Aug 19, 2021
by
李腾威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
日常管理-警情填报优化
parent
5506c269
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
49 deletions
+3
-49
AlertCalledController.java
...boot/module/tzs/biz/controller/AlertCalledController.java
+3
-49
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/AlertCalledController.java
View file @
ebdab5ea
...
@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...
@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil
;
import
com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlarmStatisticsDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlarmStatisticsDto
;
...
@@ -45,14 +44,11 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
...
@@ -45,14 +44,11 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.lang.reflect.Field
;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.LinkedHashMap
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Stream
;
/**
/**
* 警情接警填报记录
* 警情接警填报记录
...
@@ -257,64 +253,22 @@ public class AlertCalledController extends BaseController {
...
@@ -257,64 +253,22 @@ public class AlertCalledController extends BaseController {
}
}
page
=
iAlertCalledService
.
page
(
pageBean
,
alertCalledQueryWrapper
);
page
=
iAlertCalledService
.
page
(
pageBean
,
alertCalledQueryWrapper
);
IPage
<
AlertCalledDto
>
calledVoIPage
=
AlertBeanDtoVoUtils
.
alertCalledIPageDto
(
page
);
IPage
<
AlertCalledDto
>
calledVoIPage
=
AlertBeanDtoVoUtils
.
alertCalledIPageDto
(
page
);
calledVoIPage
.
getRecords
().
stream
().
forEach
(
e
->{
//e.setAlertAddress(e.getAddress());
});
return
ResponseHelper
.
buildResponse
(
calledVoIPage
);
return
ResponseHelper
.
buildResponse
(
calledVoIPage
);
}
}
private
QueryWrapper
<
AlertCalled
>
setQueryWrapper
(
QueryWrapper
<
AlertCalled
>
queryWrapper
,
AlertCalled
alertCalled
,
String
sort
){
private
QueryWrapper
<
AlertCalled
>
setQueryWrapper
(
QueryWrapper
<
AlertCalled
>
queryWrapper
,
AlertCalled
alertCalled
,
String
sort
){
Class
<?
extends
AlertCalled
>
aClass
=
alertCalled
.
getClass
();
queryWrapper
.
eq
(
"is_delete"
,
0
);
queryWrapper
.
eq
(
"is_delete"
,
0
);
if
(
sort
!=
null
)
{
queryWrapper
.
orderByDesc
(
"call_time"
);
// String[] date= sort.split(",");
// if(date[1].equals("ascend")) {
// queryWrapper.orderByAsc(RedisKey.humpToLine(date[0]));
// }else {
// queryWrapper.orderByDesc(RedisKey.humpToLine(date[0]));
// }
}
else
{
queryWrapper
.
orderByDesc
(
"call_time"
);
}
if
(
alertCalled
.
getCallTimeStart
()
!=
null
&&
alertCalled
.
getCallTimeEnd
()
!=
null
)
{
if
(
alertCalled
.
getCallTimeStart
()
!=
null
&&
alertCalled
.
getCallTimeEnd
()
!=
null
)
{
queryWrapper
.
between
(
"call_time"
,
alertCalled
.
getCallTimeStart
(),
alertCalled
.
getCallTimeEnd
());
queryWrapper
.
between
(
"call_time"
,
DateUtils
.
stampToDate
(
System
.
currentTimeMillis
(),
DateUtils
.
DATE_PATTERN
),
DateUtils
.
stampToDate
(
DateUtils
.
dateAddDays
(
new
Date
(),
1
).
getTime
(),
DateUtils
.
DATE_PATTERN
));
}
}
if
(
alertCalled
.
getIsFatherAlert
())
{
// 0:接警;1:处警
if
(
alertCalled
.
getIsFatherAlert
())
{
// 0:接警;1:处警
queryWrapper
.
isNull
(
"father_alert"
);
queryWrapper
.
isNull
(
"father_alert"
);
}
}
Stream
<
Field
>
fieldStream
=
Arrays
.
stream
(
aClass
.
getDeclaredFields
()).
filter
(
field
->
{
String
name
=
NameUtils
.
camel2Underline
(
field
.
getName
());
return
!(
"IS_FATHER_ALERT"
.
equals
(
name
));
});
fieldStream
.
forEach
(
field
->
{
try
{
field
.
setAccessible
(
true
);
Object
o
=
field
.
get
(
alertCalled
);
if
(
o
!=
null
&&
!
"serialVersionUID"
.
equals
(
field
.
getName
()))
{
Class
<?>
type
=
field
.
getType
();
String
name
=
NameUtils
.
camel2Underline
(
field
.
getName
());
if
(
type
.
equals
(
Integer
.
class
))
{
Integer
fileValue
=
(
Integer
)
field
.
get
(
alertCalled
);
queryWrapper
.
eq
(
name
,
fileValue
);
}
else
if
(
type
.
equals
(
String
.
class
))
{
String
fileValue
=
(
String
)
field
.
get
(
alertCalled
);
queryWrapper
.
eq
(
name
,
fileValue
);
}
else
if
(
type
.
equals
(
Boolean
.
class
))
{
Boolean
fileValue
=
(
Boolean
)
field
.
get
(
alertCalled
);
queryWrapper
.
eq
(
name
,
fileValue
);
}
else
if
(
type
.
equals
(
Long
.
class
)
||
"long"
.
equals
(
type
.
toString
()))
{
Long
fileValue
=
(
Long
)
field
.
get
(
alertCalled
);
queryWrapper
.
eq
(
name
,
fileValue
);
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"系统异常"
);
}
});
return
queryWrapper
;
return
queryWrapper
;
}
}
...
...
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