Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-trialdrive-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7caf606b
authored
May 10, 2022
by
向延琳
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
常驻地列表
1 parent
b52988c2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
256 additions
and
4 deletions
src/main/java/cn/com/glsx/admin/common/constants/ConstantsVehicle.java
src/main/java/cn/com/glsx/admin/modules/controller/VehicleMonitorController.java
src/main/java/cn/com/glsx/admin/modules/converter/WorkOrderVehicleConvert.java
src/main/java/cn/com/glsx/admin/modules/model/param/ResidentSearch.java
src/main/java/cn/com/glsx/admin/modules/model/vo/ResidentListVO.java
src/main/java/cn/com/glsx/admin/modules/remote/RemoteFeignResidentService.java
src/main/java/cn/com/glsx/admin/modules/service/VehicleMonitorService.java
src/main/java/cn/com/glsx/admin/modules/utils/DateUtil.java
src/main/java/cn/com/glsx/admin/common/constants/ConstantsVehicle.java
View file @
7caf606
...
@@ -41,4 +41,30 @@ public final class ConstantsVehicle {
...
@@ -41,4 +41,30 @@ public final class ConstantsVehicle {
}
}
/**
* 常驻地查询时间范围;1:一个月 2:三个月 3:半年内 4:截至到目前,5:自定义,-1测试用
*/
public
static
final
String
RESIDENT_TYPE_ONE
=
"1"
;
/**
* 常驻地查询时间范围; 2:三个月
*/
public
static
final
String
RESIDENT_TYPE_THREE
=
"2"
;
/**
* 常驻地查询时间范围; 3:半年内
*/
public
static
final
String
RESIDENT_TYPE_SIX
=
"3"
;
/**
* 常驻地查询时间范围; 4:截至到目前
*/
public
static
final
String
RESIDENT_TYPE_PRESENT
=
"4"
;
/**
* 常驻地查询时间范围;,5:自定义
*/
public
static
final
String
RESIDENT_TYPE_CUSTOM
=
"5"
;
}
}
src/main/java/cn/com/glsx/admin/modules/controller/VehicleMonitorController.java
View file @
7caf606
...
@@ -161,9 +161,9 @@ public class VehicleMonitorController {
...
@@ -161,9 +161,9 @@ public class VehicleMonitorController {
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResidentListVO
.
class
),
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResidentListVO
.
class
),
})
})
@GetMapping
(
"/residentList"
)
@GetMapping
(
"/residentList"
)
public
R
<
List
<
ResidentListVO
>>
queryResidentList
(
ResidentSearch
search
){
public
R
<
List
<
ResidentListVO
>>
queryResidentList
(
ResidentSearch
search
)
{
ResidentListVO
element
=
new
ResidentListVO
(
);
List
<
ResidentListVO
>
residentList
=
vehicleMonitorService
.
queryResidentList
(
search
);
return
R
.
ok
().
data
(
Lists
.
newArrayList
(
element
)
);
return
R
.
ok
().
data
(
residentList
);
}
}
/**
/**
...
...
src/main/java/cn/com/glsx/admin/modules/converter/WorkOrderVehicleConvert.java
0 → 100644
View file @
7caf606
package
cn
.
com
.
glsx
.
admin
.
modules
.
converter
;
import
cn.com.glsx.admin.modules.entity.VehicleDeviceWorkOrder
;
import
cn.com.glsx.admin.modules.model.export.StayPointListExport
;
import
cn.com.glsx.admin.modules.model.param.ResidentSearch
;
import
cn.com.glsx.admin.modules.model.param.StayPointSearch
;
import
cn.com.glsx.admin.modules.model.vo.ResidentListVO
;
import
cn.com.glsx.admin.modules.model.vo.StayPointListVO
;
import
cn.com.glsx.admin.modules.utils.DateUtil
;
import
cn.com.glsx.devicemonitor.api.dto.request.ResidentRequest
;
import
cn.com.glsx.devicemonitor.api.dto.request.StayPointRequest
;
import
cn.com.glsx.devicemonitor.api.dto.response.GpsLocation
;
import
cn.com.glsx.devicemonitor.api.dto.response.ResidentDTO
;
import
cn.com.glsx.devicemonitor.api.dto.response.StayPointRecordDTO
;
import
java.util.Optional
;
/**
* @author xiangyanlin
* @date 2022/5/10
*/
public
class
WorkOrderVehicleConvert
{
public
static
StayPointListVO
buildStayPointListVO
(
StayPointRecordDTO
stayPointRecordDTO
,
VehicleDeviceWorkOrder
vehicleDeviceWorkOrder
,
String
sn
)
{
StayPointListVO
stayPointListVO
=
new
StayPointListVO
();
Optional
.
ofNullable
(
vehicleDeviceWorkOrder
)
.
map
(
VehicleDeviceWorkOrder:
:
getWorkOrderNo
)
.
ifPresent
(
stayPointListVO:
:
setWorkOrderNo
);
Optional
.
ofNullable
(
vehicleDeviceWorkOrder
)
.
map
(
VehicleDeviceWorkOrder:
:
getOwnerName
)
.
ifPresent
(
stayPointListVO:
:
setOwnerName
);
Optional
.
ofNullable
(
vehicleDeviceWorkOrder
)
.
map
(
VehicleDeviceWorkOrder:
:
getOwnerName
)
.
ifPresent
(
stayPointListVO:
:
setOwnerName
);
stayPointListVO
.
setSn
(
sn
);
Optional
.
ofNullable
(
vehicleDeviceWorkOrder
)
.
map
(
VehicleDeviceWorkOrder:
:
getVin
)
.
ifPresent
(
stayPointListVO:
:
setVin
);
Optional
.
ofNullable
(
vehicleDeviceWorkOrder
)
.
map
(
VehicleDeviceWorkOrder:
:
getShopName
)
.
ifPresent
(
stayPointListVO:
:
setShopName
);
stayPointListVO
.
setBeginTime
(
stayPointRecordDTO
.
getBeginTime
());
stayPointListVO
.
setEndTime
(
stayPointRecordDTO
.
getEndTime
());
//时长
Optional
.
ofNullable
(
stayPointRecordDTO
.
getDuration
())
.
map
(
e
->
e
*
1000
)
.
map
(
Integer:
:
longValue
)
.
map
(
DateUtil:
:
normalFormatDuration
)
.
ifPresent
(
stayPointListVO:
:
setDuration
);
stayPointListVO
.
setLocationType
(
"GPS"
);
Optional
.
ofNullable
(
stayPointRecordDTO
)
.
map
(
StayPointRecordDTO:
:
getStayGps
)
.
map
(
GpsLocation:
:
getElat
)
.
ifPresent
(
stayPointListVO:
:
setElat
);
Optional
.
ofNullable
(
stayPointRecordDTO
)
.
map
(
StayPointRecordDTO:
:
getStayGps
)
.
map
(
GpsLocation:
:
getElng
)
.
ifPresent
(
stayPointListVO:
:
setElng
);
return
stayPointListVO
;
}
public
static
StayPointListExport
buildStayPointListExport
(
StayPointRecordDTO
stayPointRecordDTO
,
VehicleDeviceWorkOrder
vehicleDeviceWorkOrder
,
String
sn
,
String
address
)
{
StayPointListExport
stayPointListExport
=
new
StayPointListExport
();
Optional
.
ofNullable
(
vehicleDeviceWorkOrder
)
.
map
(
VehicleDeviceWorkOrder:
:
getWorkOrderNo
)
.
ifPresent
(
stayPointListExport:
:
setWorkOrderNo
);
Optional
.
ofNullable
(
vehicleDeviceWorkOrder
)
.
map
(
VehicleDeviceWorkOrder:
:
getOwnerName
)
.
ifPresent
(
stayPointListExport:
:
setOwnerName
);
Optional
.
ofNullable
(
vehicleDeviceWorkOrder
)
.
map
(
VehicleDeviceWorkOrder:
:
getOwnerName
)
.
ifPresent
(
stayPointListExport:
:
setOwnerName
);
stayPointListExport
.
setSn
(
sn
);
Optional
.
ofNullable
(
vehicleDeviceWorkOrder
)
.
map
(
VehicleDeviceWorkOrder:
:
getVin
)
.
ifPresent
(
stayPointListExport:
:
setVin
);
Optional
.
ofNullable
(
vehicleDeviceWorkOrder
)
.
map
(
VehicleDeviceWorkOrder:
:
getShopName
)
.
ifPresent
(
stayPointListExport:
:
setShopName
);
stayPointListExport
.
setBeginTime
(
stayPointRecordDTO
.
getBeginTime
());
stayPointListExport
.
setEndTime
(
stayPointRecordDTO
.
getEndTime
());
//时长
Optional
.
ofNullable
(
stayPointRecordDTO
.
getDuration
())
.
map
(
e
->
e
*
1000
)
.
map
(
Integer:
:
longValue
)
.
map
(
DateUtil:
:
normalFormatDuration
)
.
ifPresent
(
stayPointListExport:
:
setDuration
);
stayPointListExport
.
setLocationType
(
"GPS"
);
stayPointListExport
.
setAddress
(
address
);
return
stayPointListExport
;
}
public
static
StayPointRequest
buildStayPointRequest
(
StayPointSearch
search
)
{
StayPointRequest
request
=
new
StayPointRequest
();
request
.
setSn
(
search
.
getSn
());
request
.
setPeriodType
(
search
.
getTimes
());
request
.
setBeginTime
(
DateUtil
.
parseDateYmd
(
search
.
getStartTime
()));
request
.
setEndTime
(
DateUtil
.
parseDateYmd
(
search
.
getEndTime
()));
request
.
setMax
(
search
.
getMaxTime
());
request
.
setMin
(
search
.
getMinTime
());
return
request
;
}
public
static
ResidentRequest
buildResidentRequest
(
ResidentSearch
search
,
String
beginTime
,
String
endTime
,
Integer
locInfoType
)
{
ResidentRequest
residentRequest
=
new
ResidentRequest
();
residentRequest
.
setSn
(
search
.
getSn
());
residentRequest
.
setBeginTime
(
beginTime
);
residentRequest
.
setEndTime
(
endTime
);
residentRequest
.
setTimes
(
search
.
getTimes
());
residentRequest
.
setLocInfoType
(
locInfoType
);
return
residentRequest
;
}
public
static
ResidentListVO
buildResidentListVO
(
ResidentDTO
residentDTO
,
VehicleDeviceWorkOrder
common
)
{
ResidentListVO
residentListVO
=
new
ResidentListVO
();
Optional
.
ofNullable
(
common
)
.
map
(
VehicleDeviceWorkOrder:
:
getWorkOrderNo
)
.
ifPresent
(
residentListVO:
:
setWorkOrderNo
);
Optional
.
ofNullable
(
common
)
.
map
(
VehicleDeviceWorkOrder:
:
getOwnerName
)
.
ifPresent
(
residentListVO:
:
setOwnerName
);
Optional
.
ofNullable
(
common
)
.
map
(
VehicleDeviceWorkOrder:
:
getSn
)
.
ifPresent
(
residentListVO:
:
setSn
);
Optional
.
ofNullable
(
common
)
.
map
(
VehicleDeviceWorkOrder:
:
getVin
)
.
ifPresent
(
residentListVO:
:
setVin
);
Optional
.
ofNullable
(
common
)
.
map
(
VehicleDeviceWorkOrder:
:
getShopName
)
.
ifPresent
(
residentListVO:
:
setShopName
);
Optional
.
ofNullable
(
residentDTO
.
getTotalDuration
())
.
map
(
e
->
e
*
1000
)
.
map
(
Integer:
:
longValue
)
.
map
(
DateUtil:
:
normalFormatDuration
)
.
ifPresent
(
residentListVO:
:
setTotalDurationString
);
residentListVO
.
setTotalTimes
(
residentDTO
.
getTotalTimes
());
residentListVO
.
setLongitude
(
residentDTO
.
getLongitude
());
residentListVO
.
setLatitude
(
residentDTO
.
getLatitude
());
residentListVO
.
setBlat
(
residentDTO
.
getBlat
());
residentListVO
.
setBlng
(
residentDTO
.
getBlng
());
residentListVO
.
setElat
(
residentDTO
.
getElat
());
residentListVO
.
setElng
(
residentDTO
.
getElng
());
return
residentListVO
;
}
}
src/main/java/cn/com/glsx/admin/modules/model/param/ResidentSearch.java
View file @
7caf606
...
@@ -29,6 +29,18 @@ public class ResidentSearch implements Serializable {
...
@@ -29,6 +29,18 @@ public class ResidentSearch implements Serializable {
private
String
sn
;
private
String
sn
;
/**
/**
* 开始时间
*/
@ApiModelProperty
(
value
=
"开始时间"
)
private
String
startTime
;
/**
* 截止时间
*/
@ApiModelProperty
(
value
=
"截止时间"
)
private
String
endTime
;
/**
* 时段 1:上午(6:00~12:00)2:下午(12:00~21:00)3:夜晚(21:00~6:00)0:全天
* 时段 1:上午(6:00~12:00)2:下午(12:00~21:00)3:夜晚(21:00~6:00)0:全天
*/
*/
@ApiModelProperty
(
value
=
"时段 1:上午(6:00~12:00)2:下午(12:00~21:00)3:夜晚(21:00~6:00)0:全天"
)
@ApiModelProperty
(
value
=
"时段 1:上午(6:00~12:00)2:下午(12:00~21:00)3:夜晚(21:00~6:00)0:全天"
)
...
...
src/main/java/cn/com/glsx/admin/modules/model/vo/ResidentListVO.java
View file @
7caf606
...
@@ -64,7 +64,7 @@ public class ResidentListVO implements Serializable {
...
@@ -64,7 +64,7 @@ public class ResidentListVO implements Serializable {
* 经度
* 经度
*/
*/
@ApiModelProperty
(
value
=
"经度"
)
@ApiModelProperty
(
value
=
"经度"
)
private
String
l
ng
;
private
String
l
ongitude
;
/**
/**
* 纬度
* 纬度
...
...
src/main/java/cn/com/glsx/admin/modules/remote/RemoteFeignResidentService.java
0 → 100644
View file @
7caf606
package
cn
.
com
.
glsx
.
admin
.
modules
.
remote
;
import
cn.com.glsx.devicemonitor.api.dto.request.ResidentRequest
;
import
cn.com.glsx.devicemonitor.api.dto.response.ResidentDTO
;
import
cn.com.glsx.devicemonitor.api.feign.ResidentFeignService
;
import
com.glsx.plat.core.web.R
;
import
com.google.gson.reflect.TypeToken
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* 常驻地服务
* @author xiangyanlin
* @date 2022/5/10
*/
@Slf4j
@Service
public
class
RemoteFeignResidentService
{
@Autowired
private
ResidentFeignService
residentFeignService
;
public
List
<
ResidentDTO
>
getResidentList
(
ResidentRequest
request
)
{
R
<
List
<
ResidentDTO
>>
residentList
=
residentFeignService
.
getResidentList
(
request
);
return
residentList
.
getDataList
(
new
TypeToken
<
List
<
ResidentDTO
>>()
{
}.
getType
());
}
}
src/main/java/cn/com/glsx/admin/modules/service/VehicleMonitorService.java
View file @
7caf606
This diff is collapsed.
Click to expand it.
src/main/java/cn/com/glsx/admin/modules/utils/DateUtil.java
View file @
7caf606
...
@@ -10,6 +10,8 @@ import org.eclipse.jetty.util.StringUtil;
...
@@ -10,6 +10,8 @@ import org.eclipse.jetty.util.StringUtil;
import
java.text.DateFormat
;
import
java.text.DateFormat
;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
...
@@ -1526,6 +1528,15 @@ public class DateUtil extends org.apache.commons.lang.time.DateUtils {
...
@@ -1526,6 +1528,15 @@ public class DateUtil extends org.apache.commons.lang.time.DateUtils {
return
DurationFormatUtils
.
formatDuration
(
timestamp
,
"HH 时 mm 分 ss 秒"
);
return
DurationFormatUtils
.
formatDuration
(
timestamp
,
"HH 时 mm 分 ss 秒"
);
}
}
/**
* 获取当前时间
* @return yyyy-MM-dd HH:mm:ss
*/
public
static
String
getNowDateTimeFormat
()
{
LocalDateTime
now
=
LocalDateTime
.
now
();
return
now
.
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
));
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
// System.out.println(formatDate(getStartDateOfCurrentDay(new Date())));
// System.out.println(formatDate(getStartDateOfCurrentDay(new Date())));
System
.
out
.
println
(
getMaxDayOfCurrentMonth
());
System
.
out
.
println
(
getMaxDayOfCurrentMonth
());
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment