Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-miniappserver
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 3c9d7bbb
authored
Jul 08, 2022
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化代码逻辑
1 parent
4232ef93
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
387 additions
and
232 deletions
src/main/java/cn/com/glsx/app/common/constants/Constants.java
src/main/java/cn/com/glsx/app/common/enums/ChannelEnum.java
src/main/java/cn/com/glsx/app/common/enums/TransWeekEnum.java
src/main/java/cn/com/glsx/app/common/enums/TypeConverseEunm.java → src/main/java/cn/com/glsx/app/common/enums/TypeConverseEnum.java
src/main/java/cn/com/glsx/app/modules/controller/DeviceFreqController.java
src/main/java/cn/com/glsx/app/modules/converter/DeviceFreqConverter.java
src/main/java/cn/com/glsx/app/modules/entity/DeviceFreq.java
src/main/java/cn/com/glsx/app/modules/mapper/DeviceFreqMapper.java
src/main/java/cn/com/glsx/app/modules/mapper/VehicleSharedMapper.java
src/main/java/cn/com/glsx/app/modules/model/param/AdjFreqSharedSearch.java
src/main/java/cn/com/glsx/app/modules/model/view/DeviceFreqVO.java
src/main/java/cn/com/glsx/app/modules/model/view/DeviceWorkVo.java
src/main/java/cn/com/glsx/app/modules/model/view/VehicleDeviceVO.java
src/main/java/cn/com/glsx/app/modules/service/DashboardService.java
src/main/java/cn/com/glsx/app/modules/service/DeviceFreqService.java
src/main/resources/mapper/DeviceFreqMapper.xml
src/main/resources/mapper/VehicleSharedMapper.xml
src/test/java/cn/com/glsx/app/modules/service/DeviceFreqServiceTest.java
src/test/java/cn/com/glsx/app/modules/service/mainTest.java
src/main/java/cn/com/glsx/app/common/constants/Constants.java
View file @
3c9d7bb
...
@@ -18,34 +18,11 @@ public final class Constants {
...
@@ -18,34 +18,11 @@ public final class Constants {
public
static
final
Integer
DELETE_FLAG
=
-
1
;
public
static
final
Integer
DELETE_FLAG
=
-
1
;
/**
/**
* 广汽离线设备时间:一天 单位 s/秒 注:在sql中大多是秒,在java代码中大多是毫秒
*/
public
static
final
long
OFFLINE_TIME_GQ
=
24
*
3600L
;
/**
* 其他公司 设备离线时间:三天 单位 s/秒
* 其他公司 设备离线时间:三天 单位 s/秒
*/
*/
public
static
final
long
OFFLINE_TIME_OTHER
=
3
*
24
*
3600L
;
public
static
final
long
OFFLINE_TIME_OTHER
=
3
*
24
*
3600L
;
/**
/**
* 有源在线时间点 6分钟 单位 毫秒/ms
*/
public
static
final
long
ONLINE_SOURCE_TIME
=
6
*
60
*
1000L
;
/**
* 字典表中车辆车型的type
*/
public
static
final
String
TRIALDRIVE_VEHICLE_MODEL
=
"trialdrive_vehicle_model"
;
/**
* 字典表中试驾车辆配置的type
*/
public
static
final
String
TRIALDRIVE_VEHICLE_CONFIG
=
"trialdrive_vehicle_config"
;
/**
* 同步渠道 timed_task:定时任务渠道
*/
public
static
final
String
SYNC_CHANNEL_TIMED_TASK
=
"edun_timed_task"
;
/**
* 厂商ID-博实结
* 厂商ID-博实结
*/
*/
public
static
final
String
BSJ_FACTORY_ID
=
"BSJ"
;
public
static
final
String
BSJ_FACTORY_ID
=
"BSJ"
;
...
@@ -59,94 +36,6 @@ public final class Constants {
...
@@ -59,94 +36,6 @@ public final class Constants {
public
static
final
int
ADJ_FREQ_INITIAL
=
3
;
public
static
final
int
ADJ_FREQ_INITIAL
=
3
;
/**
/**
* 过滤(开)ON
*/
public
static
final
int
FILTER_GPS_BS_ON
=
1
;
/**
* 过滤(关)OFF
*/
public
static
final
int
FILTER_GPS_BS_OFF
=
0
;
/**
* xlsx 文件拓展名
*/
public
static
final
String
XLSX_FILE_EXTENSION
=
"xlsx"
;
/**
* 定位类型 GPS
*/
public
static
final
String
POI_TYPE_GPS
=
"GPS"
;
/**
* 定位类型 基站
*/
public
static
final
String
POI_TYPE_BS
=
"基站"
;
/**
* 今天
*/
public
static
final
int
TIMETYPE_TODAY
=
1
;
/**
* 昨天
*/
public
static
final
int
TIMETYPE_YESTERDAY
=
2
;
/**
* 本周
*/
public
static
final
int
TIMETYPE_THISWEEK
=
3
;
/**
* 上周
*/
public
static
final
int
TIMETYPE_LASTWEEK
=
4
;
/**
* 本月
*/
public
static
final
int
TIMETYPE_THISMONTH
=
5
;
/**
* 上月
*/
public
static
final
int
TIMETYPE_LASTMONTH
=
6
;
/**
* 时间段
*/
public
static
final
int
TIMETYPE_SCOPE
=
7
;
/**
* 时间范围 近12小时
*/
public
static
final
int
TIMETYPE_IN_12_HOURS
=
8
;
/**
* 时间范围 近24小时
*/
public
static
final
int
TIMETYPE_IN_24_HOURS
=
9
;
/**
* 近七天
*/
public
static
final
int
TIMETYPE_IN_7_DAYS
=
10
;
/**
* 近30天
*/
public
static
final
int
TIMETYPE_IN_30_DAYS
=
11
;
/**
* 时间段 带时间
*/
public
static
final
int
TIMETYPE_SCOPE_WITH_TIME
=
12
;
/**
* 包活干返回成功码
*/
public
static
final
int
BHG_RET_CODE_SUCCESS
=
200
;
/**
* 导出最大限制
*/
public
static
final
int
MAX_EXPORT_LIMIT
=
10000
;
public
static
final
String
EMPTY_CONTENT_EXCEL
=
"--"
;
/**
* 1断电报警
* 1断电报警
*/
*/
public
final
static
Integer
ALARM_TYPE_POWER_OFF
=
1
;
public
final
static
Integer
ALARM_TYPE_POWER_OFF
=
1
;
...
@@ -154,7 +43,7 @@ public final class Constants {
...
@@ -154,7 +43,7 @@ public final class Constants {
/**
/**
* 99:光感报警
* 99:光感报警
*/
*/
public
final
static
Integer
ALARM_TYPE_LIGHT
=
99
;
public
final
static
Integer
ALARM_TYPE_LIGHT
=
99
;
/**
/**
* 低电量
* 低电量
...
...
src/main/java/cn/com/glsx/app/common/enums/ChannelEnum.java
0 → 100644
View file @
3c9d7bb
package
cn
.
com
.
glsx
.
app
.
common
.
enums
;
import
lombok.Getter
;
/**
* 操作渠道枚举类
*
* @author Yanglinlong
* @date 2022/7/8 14:01
*/
@Getter
public
enum
ChannelEnum
{
APP
(
1
,
"APP"
),
OLDTIGER
(
2
,
"PC"
),
FRMS
(
3
,
"PC"
),
NESHIELD
(
4
,
"PC"
),
MINI
(
5
,
"小程序"
);
private
final
Integer
channelInt
;
private
final
String
channelStr
;
ChannelEnum
(
Integer
channelInt
,
String
channelStr
)
{
this
.
channelInt
=
channelInt
;
this
.
channelStr
=
channelStr
;
}
public
static
String
getStrByChannelInt
(
Integer
channelInt
)
{
for
(
ChannelEnum
channelEnum
:
ChannelEnum
.
values
())
{
if
(
channelEnum
.
getChannelInt
().
equals
(
channelInt
))
{
return
channelEnum
.
getChannelStr
();
}
}
return
null
;
}
}
src/main/java/cn/com/glsx/app/common/enums/TransWeekEnum.java
0 → 100644
View file @
3c9d7bb
package
cn
.
com
.
glsx
.
app
.
common
.
enums
;
import
lombok.Getter
;
/**
* 周转换枚举类
*
* @author Yanglinlong
* @date 2022/7/8 10:45
*/
@Getter
public
enum
TransWeekEnum
{
MONDAY
(
1
,
"一、"
),
TUESDAY
(
2
,
"二、"
),
WEDNESDAY
(
3
,
"三、"
),
THURSDAY
(
4
,
"四、"
),
FRIDAY
(
5
,
"五、"
),
SATURDAY
(
6
,
"六、"
),
SUNDAY
(
7
,
"日、"
);
private
final
Integer
weekInt
;
private
final
String
weekStr
;
TransWeekEnum
(
Integer
weekInt
,
String
weekStr
)
{
this
.
weekInt
=
weekInt
;
this
.
weekStr
=
weekStr
;
}
public
static
String
getStrByWeekInt
(
Integer
weekInt
)
{
for
(
TransWeekEnum
transWeekEnum
:
TransWeekEnum
.
values
())
{
if
(
transWeekEnum
.
getWeekInt
().
equals
(
weekInt
))
{
return
transWeekEnum
.
getWeekStr
();
}
}
return
null
;
}
}
src/main/java/cn/com/glsx/app/common/enums/TypeConverseE
un
m.java
→
src/main/java/cn/com/glsx/app/common/enums/TypeConverseE
nu
m.java
View file @
3c9d7bb
...
@@ -6,7 +6,7 @@ package cn.com.glsx.app.common.enums;
...
@@ -6,7 +6,7 @@ package cn.com.glsx.app.common.enums;
* @author Yanglinlong
* @author Yanglinlong
* @date 2021/12/20 14:36
* @date 2021/12/20 14:36
*/
*/
public
class
TypeConverseE
un
m
{
public
class
TypeConverseE
nu
m
{
/**
/**
* 设备类型枚举类
* 设备类型枚举类
...
@@ -306,4 +306,110 @@ public class TypeConverseEunm {
...
@@ -306,4 +306,110 @@ public class TypeConverseEunm {
return
typeStr
;
return
typeStr
;
}
}
}
}
/**
* 调频状态枚举类
*/
public
enum
FreqStatusEnum
{
TAKE_EFFECT
(
1
,
"生效"
),
LOSE_EFFECTIVENESS
(
2
,
"关闭"
);
private
final
Integer
freqStatus
;
private
final
String
freqStatusStr
;
FreqStatusEnum
(
Integer
freqStatus
,
String
freqStatusStr
)
{
this
.
freqStatus
=
freqStatus
;
this
.
freqStatusStr
=
freqStatusStr
;
}
public
static
String
getStrByFreqStatus
(
Integer
freqStatus
)
{
for
(
FreqStatusEnum
freqStatusEnum
:
FreqStatusEnum
.
values
())
{
if
(
freqStatusEnum
.
getFreqStatus
().
equals
(
freqStatus
))
{
return
freqStatusEnum
.
getFreqStatusStr
();
}
}
return
null
;
}
public
Integer
getFreqStatus
()
{
return
freqStatus
;
}
public
String
getFreqStatusStr
()
{
return
freqStatusStr
;
}
}
/**
* 调频类型枚举类
*/
public
enum
FreqTypeEnum
{
/**
* 设备调频模式 0 追车模式;1 闹钟模式;2 星期模式;3 初始化模式
*/
CAR_CHASE_MODE
(
0
,
"追车模式"
),
ALARM_MODE
(
1
,
"闹钟模式"
),
WEEK_MODE
(
2
,
"星期模式"
),
INITIALIZATION_MODE
(
3
,
"初始化模式"
);
private
final
Integer
freqType
;
private
final
String
freqTypeStr
;
FreqTypeEnum
(
Integer
freqType
,
String
freqTypeStr
)
{
this
.
freqType
=
freqType
;
this
.
freqTypeStr
=
freqTypeStr
;
}
public
static
String
getStrByFreqType
(
Integer
freqType
)
{
for
(
FreqTypeEnum
freqTypeEnum
:
FreqTypeEnum
.
values
())
{
if
(
freqTypeEnum
.
getFreqType
().
equals
(
freqType
))
{
return
freqTypeEnum
.
getFreqTypeStr
();
}
}
return
null
;
}
public
Integer
getFreqType
()
{
return
freqType
;
}
public
String
getFreqTypeStr
()
{
return
freqTypeStr
;
}
}
/**
* 用户类型枚举类
*/
public
enum
UserTypeEnum
{
WEB
(
1
,
"WEB"
),
MINI
(
2
,
"小程序"
);
private
final
Integer
userType
;
private
final
String
userTypeStr
;
UserTypeEnum
(
Integer
userType
,
String
userTypeStr
)
{
this
.
userType
=
userType
;
this
.
userTypeStr
=
userTypeStr
;
}
public
static
String
getStrByUserType
(
Integer
userType
)
{
for
(
UserTypeEnum
userTypeEnum
:
UserTypeEnum
.
values
())
{
if
(
userTypeEnum
.
getUserType
().
equals
(
userType
))
{
return
userTypeEnum
.
getUserTypeStr
();
}
}
return
null
;
}
public
Integer
getUserType
()
{
return
userType
;
}
public
String
getUserTypeStr
()
{
return
userTypeStr
;
}
}
}
}
src/main/java/cn/com/glsx/app/modules/controller/DeviceFreqController.java
View file @
3c9d7bb
...
@@ -6,6 +6,7 @@ import cn.com.glsx.app.modules.model.param.AdjFreqSearch;
...
@@ -6,6 +6,7 @@ import cn.com.glsx.app.modules.model.param.AdjFreqSearch;
import
cn.com.glsx.app.modules.model.param.AdjFreqSharedSearch
;
import
cn.com.glsx.app.modules.model.param.AdjFreqSharedSearch
;
import
cn.com.glsx.app.modules.model.view.AdjFredDetailVO
;
import
cn.com.glsx.app.modules.model.view.AdjFredDetailVO
;
import
cn.com.glsx.app.modules.model.view.DeviceFreqVO
;
import
cn.com.glsx.app.modules.model.view.DeviceFreqVO
;
import
cn.com.glsx.app.modules.model.view.DeviceWorkVo
;
import
cn.com.glsx.app.modules.model.view.VehicleDeviceVO
;
import
cn.com.glsx.app.modules.model.view.VehicleDeviceVO
;
import
cn.com.glsx.app.modules.service.DeviceFreqService
;
import
cn.com.glsx.app.modules.service.DeviceFreqService
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
...
@@ -36,12 +37,12 @@ public class DeviceFreqController {
...
@@ -36,12 +37,12 @@ public class DeviceFreqController {
@Autowired
@Autowired
private
DeviceFreqService
deviceFreqService
;
private
DeviceFreqService
deviceFreqService
;
@ApiOperation
(
value
=
"通过设备号获取最后的生效调频"
,
response
=
DeviceWork
BO
.
class
)
@ApiOperation
(
value
=
"通过设备号获取最后的生效调频"
,
response
=
DeviceWork
Vo
.
class
)
@SysLog
(
module
=
"通过设备号获取最后的生效调频"
,
value
=
"通过设备号获取最后的生效调频"
,
action
=
OperateType
.
QUERY
)
@SysLog
(
module
=
"通过设备号获取最后的生效调频"
,
value
=
"通过设备号获取最后的生效调频"
,
action
=
OperateType
.
QUERY
)
@GetMapping
(
value
=
"/getAdjFreqBySn"
)
@GetMapping
(
value
=
"/getAdjFreqBySn"
)
public
R
getAdjFreqBySn
(
@RequestParam
String
sn
)
{
public
R
getAdjFreqBySn
(
@RequestParam
String
sn
)
{
DeviceWork
BO
deviceWorkBO
=
deviceFreqService
.
getAdjFreqBySn
(
sn
);
DeviceWork
Vo
deviceWorkVo
=
deviceFreqService
.
getAdjFreqBySn
(
sn
);
return
R
.
ok
().
data
(
deviceWork
BO
);
return
R
.
ok
().
data
(
deviceWork
Vo
);
}
}
@ApiOperation
(
value
=
"一键调频"
)
@ApiOperation
(
value
=
"一键调频"
)
...
...
src/main/java/cn/com/glsx/app/modules/converter/DeviceFreqConverter.java
View file @
3c9d7bb
package
cn
.
com
.
glsx
.
app
.
modules
.
converter
;
package
cn
.
com
.
glsx
.
app
.
modules
.
converter
;
import
cn.com.glsx.app.modules.entity.DeviceFreq
;
import
cn.com.glsx.app.modules.entity.DeviceFreq
;
import
cn.com.glsx.app.modules.entity.DevicePowerDO
;
import
cn.com.glsx.app.modules.model.view.DeviceFreqVO
;
import
cn.com.glsx.app.modules.model.DeviceWorkBO
;
import
cn.com.glsx.app.modules.model.view.DeviceWorkVo
;
import
cn.com.glsx.app.modules.model.view.LowPowerVO
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mapping
;
import
org.mapstruct.Mappings
;
import
org.mapstruct.factory.Mappers
;
import
java.util.List
;
/**
/**
* @author xiangyanlin
* @author xiangyanlin
* @date 2022/7/6
* @date 2022/7/6
*/
*/
@Mapper
@Mapper
public
interface
DeviceFreqConverter
{
public
class
DeviceFreqConverter
{
DeviceFreqConverter
INSTANCE
=
Mappers
.
getMapper
(
DeviceFreqConverter
.
class
);
/**
* 转换
*
* @param deviceFreq 源对象
* @return DeviceWorkVo
*/
public
static
DeviceWorkVo
convertToBo
(
DeviceFreq
deviceFreq
)
{
DeviceWorkVo
deviceWorkVo
=
new
DeviceWorkVo
();
deviceWorkVo
.
setSn
(
deviceFreq
.
getSn
());
deviceWorkVo
.
setType
(
deviceFreq
.
getFreqType
());
deviceWorkVo
.
setTimer
(
deviceFreq
.
getTimer
());
deviceWorkVo
.
setWeek
(
deviceFreq
.
getWeek
());
deviceWorkVo
.
setWeekTimer
(
deviceFreq
.
getWeekTimer
());
deviceWorkVo
.
setCatchingTimer
(
deviceFreq
.
getCatchingTimer
());
return
deviceWorkVo
;
}
/**
/**
* 转换
* 转换
*
*
* @param
source
源对象
* @param
deviceFreq
源对象
* @return
LowPower
VO
* @return
DeviceFreq
VO
*/
*/
@Mappings
(
@Mapping
(
source
=
"freqType"
,
target
=
"type"
))
public
static
DeviceFreqVO
convertToVo
(
DeviceFreq
deviceFreq
)
{
DeviceWorkBO
convertTo
(
DeviceFreq
source
);
DeviceFreqVO
deviceFreqVO
=
new
DeviceFreqVO
();
deviceFreqVO
.
setSn
(
deviceFreq
.
getSn
());
deviceFreqVO
.
setTimer
(
deviceFreq
.
getTimer
());
deviceFreqVO
.
setWeek
(
deviceFreq
.
getWeek
());
deviceFreqVO
.
setWeekTimer
(
deviceFreq
.
getWeekTimer
());
deviceFreqVO
.
setCatchingTimer
(
deviceFreq
.
getCatchingTimer
());
deviceFreqVO
.
setCreateTime
(
deviceFreq
.
getCreatedDate
());
return
deviceFreqVO
;
}
}
}
src/main/java/cn/com/glsx/app/modules/entity/DeviceFreq.java
View file @
3c9d7bb
...
@@ -52,7 +52,7 @@ public class DeviceFreq extends BaseEntity {
...
@@ -52,7 +52,7 @@ public class DeviceFreq extends BaseEntity {
* 追车模式下,如55
* 追车模式下,如55
*/
*/
@Column
(
name
=
"catching_timer"
)
@Column
(
name
=
"catching_timer"
)
private
Integer
catchingTimer
;
private
String
catchingTimer
;
/**
/**
* 闹钟模式下,如0355,0422
* 闹钟模式下,如0355,0422
...
@@ -73,6 +73,7 @@ public class DeviceFreq extends BaseEntity {
...
@@ -73,6 +73,7 @@ public class DeviceFreq extends BaseEntity {
/**
/**
* 是否还支持调频 默认为空,汇通设备专用字段
* 是否还支持调频 默认为空,汇通设备专用字段
*/
*/
@Column
(
name
=
"support_freq"
)
private
String
supportFreq
;
private
String
supportFreq
;
/**
/**
...
...
src/main/java/cn/com/glsx/app/modules/mapper/DeviceFreqMapper.java
View file @
3c9d7bb
...
@@ -3,7 +3,6 @@ package cn.com.glsx.app.modules.mapper;
...
@@ -3,7 +3,6 @@ package cn.com.glsx.app.modules.mapper;
import
cn.com.glsx.app.modules.entity.DeviceFreq
;
import
cn.com.glsx.app.modules.entity.DeviceFreq
;
import
cn.com.glsx.app.modules.model.param.AdjFreqSearch
;
import
cn.com.glsx.app.modules.model.param.AdjFreqSearch
;
import
cn.com.glsx.app.modules.model.view.DeviceFreqVO
;
import
cn.com.glsx.app.modules.model.view.VehicleDeviceVO
;
import
cn.com.glsx.app.modules.model.view.VehicleDeviceVO
;
import
com.glsx.plat.common.annotation.DataPerm
;
import
com.glsx.plat.common.annotation.DataPerm
;
import
com.glsx.plat.common.annotation.DataPermShare
;
import
com.glsx.plat.common.annotation.DataPermShare
;
...
@@ -31,7 +30,7 @@ public interface DeviceFreqMapper extends CommonBaseMapper<DeviceFreq> {
...
@@ -31,7 +30,7 @@ public interface DeviceFreqMapper extends CommonBaseMapper<DeviceFreq> {
* @param vehicleId 车辆Id
* @param vehicleId 车辆Id
* @return
* @return
*/
*/
List
<
DeviceFreq
VO
>
getAdjFreqInfo
(
@Param
(
"vehicleId"
)
Long
vehicleId
);
List
<
DeviceFreq
>
getAdjFreqInfo
(
@Param
(
"vehicleId"
)
Long
vehicleId
);
/**
/**
* 查询设备调频列表 获取生效的调频车辆和设备
* 查询设备调频列表 获取生效的调频车辆和设备
...
@@ -44,7 +43,7 @@ public interface DeviceFreqMapper extends CommonBaseMapper<DeviceFreq> {
...
@@ -44,7 +43,7 @@ public interface DeviceFreqMapper extends CommonBaseMapper<DeviceFreq> {
List
<
VehicleDeviceVO
>
getAdjFreqList
(
AdjFreqSearch
adjFreqSearch
);
List
<
VehicleDeviceVO
>
getAdjFreqList
(
AdjFreqSearch
adjFreqSearch
);
/**
/**
* 根据设备号获取生效调频记录
* 根据设备号获取
最后
生效调频记录
*
*
* @param sn 设备号
* @param sn 设备号
* @return
* @return
...
...
src/main/java/cn/com/glsx/app/modules/mapper/VehicleSharedMapper.java
View file @
3c9d7bb
package
cn
.
com
.
glsx
.
app
.
modules
.
mapper
;
package
cn
.
com
.
glsx
.
app
.
modules
.
mapper
;
import
cn.com.glsx.app.modules.entity.VehicleShared
;
import
cn.com.glsx.app.modules.entity.VehicleShared
;
import
cn.com.glsx.app.modules.model.param.AdjFreqSharedSearch
;
import
cn.com.glsx.app.modules.model.view.AdjFredDetailVO
;
import
cn.com.glsx.app.modules.model.view.AdjFredDetailVO
;
import
cn.com.glsx.app.modules.model.view.VehicleDeviceDTO
;
import
cn.com.glsx.app.modules.model.view.VehicleDeviceDTO
;
import
com.glsx.plat.mybatis.mapper.CommonBaseMapper
;
import
com.glsx.plat.mybatis.mapper.CommonBaseMapper
;
...
@@ -26,10 +27,10 @@ public interface VehicleSharedMapper extends CommonBaseMapper<VehicleShared> {
...
@@ -26,10 +27,10 @@ public interface VehicleSharedMapper extends CommonBaseMapper<VehicleShared> {
List
<
VehicleDeviceDTO
>
selectSharedVehicleByAccorderIdAndReceiverId
(
@Param
(
"accorderId"
)
Long
accorderId
,
@Param
(
"receiverId"
)
Long
receiverId
);
List
<
VehicleDeviceDTO
>
selectSharedVehicleByAccorderIdAndReceiverId
(
@Param
(
"accorderId"
)
Long
accorderId
,
@Param
(
"receiverId"
)
Long
receiverId
);
/**
/**
* 通过微信用户ID获取
分享的车辆
数据
* 通过微信用户ID获取
被分享的车辆调频
数据
*
*
* @param
wxUserId 微信用户ID
* @param
adjFreqSharedSearch 被分享记录查询实体类
* @return
* @return
*/
*/
List
<
AdjFredDetailVO
>
selectSharedVehicleFreqBy
WxUserId
(
@Param
(
"wxUserId"
)
Long
wxUserId
);
List
<
AdjFredDetailVO
>
selectSharedVehicleFreqBy
AccorderIdAndReceiverId
(
AdjFreqSharedSearch
adjFreqSharedSearch
);
}
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/app/modules/model/param/AdjFreqSharedSearch.java
View file @
3c9d7bb
...
@@ -5,18 +5,23 @@ import io.swagger.annotations.ApiModelProperty;
...
@@ -5,18 +5,23 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.Data
;
import
lombok.Data
;
/**
/**
*
设备调频记录详情
查询
*
被分享者用户调频记录
查询
*
*
* @author Yanglinlong
* @author Yanglinlong
* @date 2022/7/4 10:20
* @date 2022/7/4 10:20
*/
*/
@ApiModel
(
description
=
"
设备调频记录详情
查询"
)
@ApiModel
(
description
=
"
被分享者用户调频记录
查询"
)
@Data
@Data
public
class
AdjFreqSharedSearch
{
public
class
AdjFreqSharedSearch
{
/**
* 分享者用户Id
*/
@ApiModelProperty
(
"分享者用户Id"
)
private
Long
accorderId
;
/**
/**
*
搜索的关键字 工单号|车架号|设备号
*
被分享者用户Id
*/
*/
@ApiModelProperty
(
"
搜索的关键字 工单号|车架号|设备号
"
)
@ApiModelProperty
(
"
被分享者用户Id
"
)
private
Long
wxUs
erId
;
private
Long
receiv
erId
;
}
}
src/main/java/cn/com/glsx/app/modules/model/view/DeviceFreqVO.java
View file @
3c9d7bb
package
cn
.
com
.
glsx
.
app
.
modules
.
model
.
view
;
package
cn
.
com
.
glsx
.
app
.
modules
.
model
.
view
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.Date
;
/**
/**
* 设备调频
model
* 设备调频
Vo
*
*
* @author wangchao
* @author wangchao
* @date 2018/6/19
* @date 2018/6/19
*/
*/
@ApiModel
(
description
=
"设备调频
model
"
)
@ApiModel
(
description
=
"设备调频
Vo
"
)
@Data
@Data
public
class
DeviceFreqVO
{
public
class
DeviceFreqVO
{
/**
/**
* 微信用户ID
* 微信用户ID
*/
*/
@ApiModelProperty
(
"
微信
用户ID"
)
@ApiModelProperty
(
"
被分享者
用户ID"
)
private
Integer
wxUs
erId
;
private
Long
receiv
erId
;
/**
/**
* 微信用户图像
* 微信用户图像
*/
*/
@ApiModelProperty
(
"微信用户图像"
)
@ApiModelProperty
(
"微信用户图像"
)
private
String
wxA
vatar
;
private
String
a
vatar
;
/**
/**
* 设备号
* 设备号
...
@@ -32,12 +35,6 @@ public class DeviceFreqVO {
...
@@ -32,12 +35,6 @@ public class DeviceFreqVO {
private
String
sn
;
private
String
sn
;
/**
/**
* 模式 0追车模式 1闹钟模式 2星期模式 3初始化模式
*/
@ApiModelProperty
(
"模式 0追车模式 1闹钟模式 2星期模式 3初始化模式"
)
private
Integer
freqType
;
/**
* 模式 0追车模式 1闹钟模式 2星期模式 3初始化模式 根据数值转换
* 模式 0追车模式 1闹钟模式 2星期模式 3初始化模式 根据数值转换
*/
*/
@ApiModelProperty
(
"模式 0追车模式 1闹钟模式 2星期模式 3初始化模式 根据数值转换"
)
@ApiModelProperty
(
"模式 0追车模式 1闹钟模式 2星期模式 3初始化模式 根据数值转换"
)
...
@@ -71,13 +68,7 @@ public class DeviceFreqVO {
...
@@ -71,13 +68,7 @@ public class DeviceFreqVO {
* 调频渠道: 1 APP端 2 网页端 3 旧E盾 4 新E盾 5 小程序
* 调频渠道: 1 APP端 2 网页端 3 旧E盾 4 新E盾 5 小程序
*/
*/
@ApiModelProperty
(
"调频渠道: 1 APP端 2 网页端 3 旧E盾 4 新E盾 5 小程序"
)
@ApiModelProperty
(
"调频渠道: 1 APP端 2 网页端 3 旧E盾 4 新E盾 5 小程序"
)
private
Integer
channel
;
private
String
channelStr
;
/**
* 调频状态:1 生效 2 关闭
*/
@ApiModelProperty
(
"调频状态:1 生效 2 关闭"
)
private
Integer
freqStatus
;
/**
/**
* 调频操作人
* 调频操作人
...
@@ -85,11 +76,12 @@ public class DeviceFreqVO {
...
@@ -85,11 +76,12 @@ public class DeviceFreqVO {
@ApiModelProperty
(
"调频操作人"
)
@ApiModelProperty
(
"调频操作人"
)
private
String
operation
;
private
String
operation
;
/*
/*
*
*调频时间
*
调频时间
*/
*/
@ApiModelProperty
(
"调频时间"
)
@ApiModelProperty
(
"调频时间"
)
private
String
createTime
;
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createTime
;
/**
/**
* 调频模式
* 调频模式
...
@@ -102,22 +94,4 @@ public class DeviceFreqVO {
...
@@ -102,22 +94,4 @@ public class DeviceFreqVO {
*/
*/
@ApiModelProperty
(
"调频上点个数"
)
@ApiModelProperty
(
"调频上点个数"
)
private
Integer
freTotal
;
private
Integer
freTotal
;
/**
* 相差时间秒数
*/
@ApiModelProperty
(
"相差时间秒数"
)
private
Integer
diffMinuteTime
;
/**
* 相差时间分数
*/
@ApiModelProperty
(
"相差时间分数"
)
private
Integer
diffDayTime
;
/**
* 设备上点总个数
*/
@ApiModelProperty
(
"设备上点总个数"
)
private
Integer
devicePointTotal
;
}
}
src/main/java/cn/com/glsx/app/modules/model/view/DeviceWorkVo.java
0 → 100644
View file @
3c9d7bb
package
cn
.
com
.
glsx
.
app
.
modules
.
model
.
view
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* 调频model
*/
@ApiModel
(
description
=
"调频Vo"
)
@Data
public
class
DeviceWorkVo
{
/**
* 设备号
*/
@ApiModelProperty
(
"设备号"
)
private
String
sn
;
/**
* 模式 0追车模式 1闹钟模式 2星期模式
*/
@ApiModelProperty
(
"模式 0追车模式 1闹钟模式 2星期模式"
)
private
Integer
type
;
/**
* 闹钟模式 定点时间 逗号分隔
*/
@ApiModelProperty
(
"闹钟模式 定点时间 逗号分隔"
)
private
String
timer
;
/**
* 星期模式 1 周一 2 周二 3 周三 4 周四 5 周五 16 周六 7 周日
*/
@ApiModelProperty
(
"星期模式 1 周一 2 周二 3 周三 4 周四 5 周五 16 周六 7 周日"
)
private
String
week
;
/**
* 星期模式 上点时间
*/
@ApiModelProperty
(
"星期模式 上点时间"
)
private
String
weekTimer
;
/**
* 追车模式 分钟
*/
@ApiModelProperty
(
"追车模式 分钟"
)
private
String
catchingTimer
;
}
src/main/java/cn/com/glsx/app/modules/model/view/VehicleDeviceVO.java
View file @
3c9d7bb
...
@@ -41,6 +41,12 @@ public class VehicleDeviceVO {
...
@@ -41,6 +41,12 @@ public class VehicleDeviceVO {
private
String
workOrderNo
;
private
String
workOrderNo
;
/**
/**
* 分享人Id
*/
@ApiModelProperty
(
"分享人用户Id"
)
private
Long
accorderId
;
/**
* 设备信息
* 设备信息
*/
*/
@ApiModelProperty
(
"设备信息"
)
@ApiModelProperty
(
"设备信息"
)
...
...
src/main/java/cn/com/glsx/app/modules/service/DashboardService.java
View file @
3c9d7bb
...
@@ -2,7 +2,7 @@ package cn.com.glsx.app.modules.service;
...
@@ -2,7 +2,7 @@ package cn.com.glsx.app.modules.service;
import
cn.com.glsx.admin.common.util.DateUtil
;
import
cn.com.glsx.admin.common.util.DateUtil
;
import
cn.com.glsx.app.common.constants.Constants
;
import
cn.com.glsx.app.common.constants.Constants
;
import
cn.com.glsx.app.common.enums.TypeConverseE
un
m
;
import
cn.com.glsx.app.common.enums.TypeConverseE
nu
m
;
import
cn.com.glsx.app.modules.converter.DashboardConverter
;
import
cn.com.glsx.app.modules.converter.DashboardConverter
;
import
cn.com.glsx.app.modules.entity.DevicePowerDO
;
import
cn.com.glsx.app.modules.entity.DevicePowerDO
;
import
cn.com.glsx.app.modules.mapper.*
;
import
cn.com.glsx.app.modules.mapper.*
;
...
@@ -127,7 +127,7 @@ public class DashboardService extends AbstractCommonService {
...
@@ -127,7 +127,7 @@ public class DashboardService extends AbstractCommonService {
PageHelper
.
startPage
(
page
.
getPageNumber
(),
page
.
getPageSize
(),
true
);
PageHelper
.
startPage
(
page
.
getPageNumber
(),
page
.
getPageSize
(),
true
);
List
<
TrackAlarmVO
>
trackAlarmList
=
alarmTrackRecMapper
.
getTrackAlarmInfo
();
List
<
TrackAlarmVO
>
trackAlarmList
=
alarmTrackRecMapper
.
getTrackAlarmInfo
();
trackAlarmList
.
forEach
(
trackAlarmVO
->
{
trackAlarmList
.
forEach
(
trackAlarmVO
->
{
trackAlarmVO
.
setAlarmTypeStr
(
TypeConverseE
un
m
.
AlarmRecTypeEnum
.
getStrByAlarmType
(
trackAlarmVO
.
getAlarmType
()));
trackAlarmVO
.
setAlarmTypeStr
(
TypeConverseE
nu
m
.
AlarmRecTypeEnum
.
getStrByAlarmType
(
trackAlarmVO
.
getAlarmType
()));
});
});
return
new
PageInfo
<>(
trackAlarmList
);
return
new
PageInfo
<>(
trackAlarmList
);
}
}
...
...
src/main/java/cn/com/glsx/app/modules/service/DeviceFreqService.java
View file @
3c9d7bb
This diff is collapsed.
Click to expand it.
src/main/resources/mapper/DeviceFreqMapper.xml
View file @
3c9d7bb
...
@@ -33,59 +33,30 @@
...
@@ -33,59 +33,30 @@
updated_date, updated_by
updated_date, updated_by
</sql>
</sql>
<select
id=
"selectBySn"
resultType=
"
cn.com.glsx.app.modules.entity.DeviceFreq
"
>
<select
id=
"selectBySn"
resultType=
"
BaseResultMap
"
>
select
select
id ,
<include
refid=
"Base_Column_List"
/>
vehicle_id AS vehicleId,
sn,
created_date AS createdDate,
updated_date AS updatedDate,
`status`,
freq_type AS freqType,
battery_level AS batteryLevel,
channel,
catching_timer AS catchingTimer,
timer,
`week`,
week_timer AS weekTimer,
created_by AS createdBy
from t_device_freq
from t_device_freq
where sn = #{sn,jdbcType=VARCHAR}
where sn = #{sn}
and status=1 and del_flag = 0
and status=1
and del_flag = 0
</select>
</select>
<select
id=
"getAdjFreqInfo"
resultType=
"cn.com.glsx.app.modules.model.view.DeviceFreqVO"
>
<select
id=
"getAdjFreqInfo"
resultMap=
"BaseResultMap"
>
SELECT
select
LEFT(tdf.created_date, 19) AS createTime,
<include
refid=
"Base_Column_List"
/>
tdf.freq_type AS freqType,
from t_device_freq tdf
tdf.channel ,
where tdf.vehicle_id = #{vehicleId}
tcuar.user_id AS wxUserId,
and tdf.del_flag = 0
tcula.avatar AS wxAvatar,
order by tdf.id desc
IF(tdf.user_type = 1, tu.username, tcula.username) AS operation,
tdf.catching_timer AS catchingTimer,
tdf.timer ,
tdf.week ,
tdf.week_timer AS weekTimer,
tdf.sn,
tdf.`status` AS freqStatus,
TIMESTAMPDIFF(MINUTE, tdf.created_date, tdf.updated_date) AS diffMinuteTime,
TIMESTAMPDIFF(DAY, tdf.created_date, tdf.updated_date) AS diffDayTime
FROM t_device_freq tdf
LEFT JOIN t_vehicle tv ON tv.id = tdf.vehicle_id
LEFT JOIN t_user tu ON tu.id = tdf.created_by
LEFT JOIN t_cust_user_auth_rel tcuar ON tcuar.user_id = tdf.created_by and tcuar.auth_type = 'local'
LEFT JOIN t_cust_user_local_account tcula ON tcula.auth_id = tcuar.auth_id
WHERE tdf.vehicle_id = #{vehicleId}
AND tdf.del_flag = 0
AND tv.del_flag = 0
ORDER BY tdf.created_date DESC
</select>
</select>
<select
id=
"getAdjFreqList"
resultType=
"cn.com.glsx.app.modules.model.view.VehicleDeviceVO"
>
<select
id=
"getAdjFreqList"
resultType=
"cn.com.glsx.app.modules.model.view.VehicleDeviceVO"
>
select tv.id as vehicleId,
select tv.id as vehicleId,
tv.owner_name as ownerName,
tv.owner_name as ownerName,
tv.vin as vin,
tv.vin as vin,
tw.partner_order_no as workOrderNo
tw.partner_order_no as workOrderNo,
tv.created_by as accorderId
from t_vehicle tv
from t_vehicle tv
left join t_workorder tw on tw.id = tv.workorder_id
left join t_workorder tw on tw.id = tv.workorder_id
left join t_vehicle_device tvd on tvd.vehicle_id = tv.id
left join t_vehicle_device tvd on tvd.vehicle_id = tv.id
...
@@ -110,6 +81,9 @@
...
@@ -110,6 +81,9 @@
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from t_device_freq tdf
from t_device_freq tdf
where tdf.status = 1
where tdf.status = 1
and tdf.del_flag = 0
and tdf.sn = #{sn}
and tdf.sn = #{sn}
order by tdf.id desc
limit 1
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
\ No newline at end of file
src/main/resources/mapper/VehicleSharedMapper.xml
View file @
3c9d7bb
...
@@ -20,7 +20,8 @@
...
@@ -20,7 +20,8 @@
<!--
<!--
WARNING - @mbg.generated
WARNING - @mbg.generated
-->
-->
id, shared_id, accorder_id, receiver_id, content_id, del_flag, created_date, created_by, updated_date, updated_by
id, shared_id, accorder_id, receiver_id, content_id, del_flag, created_date, created_by, updated_date,
updated_by
</sql>
</sql>
<select
id=
"selectBySharedIdAndReceiverId"
resultMap=
"BaseResultMap"
>
<select
id=
"selectBySharedIdAndReceiverId"
resultMap=
"BaseResultMap"
>
...
@@ -32,7 +33,8 @@
...
@@ -32,7 +33,8 @@
and tvs.receiver_id = #{receiverId}
and tvs.receiver_id = #{receiverId}
</select>
</select>
<select
id=
"selectSharedVehicleByAccorderIdAndReceiverId"
resultType=
"cn.com.glsx.app.modules.model.view.VehicleDeviceDTO"
>
<select
id=
"selectSharedVehicleByAccorderIdAndReceiverId"
resultType=
"cn.com.glsx.app.modules.model.view.VehicleDeviceDTO"
>
select tv.id,
select tv.id,
tv.vin,
tv.vin,
tv.owner_name ownerName,
tv.owner_name ownerName,
...
@@ -55,7 +57,8 @@
...
@@ -55,7 +57,8 @@
order by tvs.created_date desc
order by tvs.created_date desc
</select>
</select>
<select
id=
"selectSharedVehicleFreqByWxUserId"
resultType=
"cn.com.glsx.app.modules.model.view.AdjFredDetailVO"
>
<select
id=
"selectSharedVehicleFreqByAccorderIdAndReceiverId"
resultType=
"cn.com.glsx.app.modules.model.view.AdjFredDetailVO"
>
select tv.id as vehicleId,
select tv.id as vehicleId,
tv.owner_name as ownerName,
tv.owner_name as ownerName,
tv.vin as vin,
tv.vin as vin,
...
@@ -68,7 +71,8 @@
...
@@ -68,7 +71,8 @@
group by tdf.vehicle_id) tdf on tdf.vehicle_id = tv.id
group by tdf.vehicle_id) tdf on tdf.vehicle_id = tv.id
where tv.del_flag = 0
where tv.del_flag = 0
and tdf.vehicle_id is not null
and tdf.vehicle_id is not null
and tvs.receiver_id = #{wxUserId}
and tvs.accorder_id = #{accorderId}
and tvs.receiver_id = #{receiverId}
</select>
</select>
<select
id=
"selectBySharedId"
resultMap=
"BaseResultMap"
>
<select
id=
"selectBySharedId"
resultMap=
"BaseResultMap"
>
...
...
src/test/java/cn/com/glsx/app/modules/service/DeviceFreqServiceTest.java
View file @
3c9d7bb
...
@@ -7,6 +7,7 @@ import cn.com.glsx.app.modules.model.param.AdjFreqSearch;
...
@@ -7,6 +7,7 @@ import cn.com.glsx.app.modules.model.param.AdjFreqSearch;
import
cn.com.glsx.app.modules.model.param.AdjFreqSharedSearch
;
import
cn.com.glsx.app.modules.model.param.AdjFreqSharedSearch
;
import
cn.com.glsx.app.modules.model.view.AdjFredDetailVO
;
import
cn.com.glsx.app.modules.model.view.AdjFredDetailVO
;
import
cn.com.glsx.app.modules.model.view.DeviceFreqVO
;
import
cn.com.glsx.app.modules.model.view.DeviceFreqVO
;
import
cn.com.glsx.app.modules.model.view.DeviceWorkVo
;
import
cn.com.glsx.app.modules.model.view.VehicleDeviceVO
;
import
cn.com.glsx.app.modules.model.view.VehicleDeviceVO
;
import
cn.com.glsx.auth.api.AuthFeignClient
;
import
cn.com.glsx.auth.api.AuthFeignClient
;
import
cn.com.glsx.auth.model.SyntheticUser
;
import
cn.com.glsx.auth.model.SyntheticUser
;
...
@@ -44,7 +45,7 @@ public class DeviceFreqServiceTest {
...
@@ -44,7 +45,7 @@ public class DeviceFreqServiceTest {
@Test
@Test
public
void
getAdjFreqBySn
()
{
public
void
getAdjFreqBySn
()
{
DeviceWork
BO
adjFreqBySn
=
deviceFreqService
.
getAdjFreqBySn
(
"75111240942"
);
DeviceWork
Vo
adjFreqBySn
=
deviceFreqService
.
getAdjFreqBySn
(
"75111240942"
);
System
.
out
.
println
(
"adjFreqBySn = "
+
JSONUtil
.
toJsonStr
(
adjFreqBySn
));
System
.
out
.
println
(
"adjFreqBySn = "
+
JSONUtil
.
toJsonStr
(
adjFreqBySn
));
}
}
...
@@ -87,7 +88,8 @@ public class DeviceFreqServiceTest {
...
@@ -87,7 +88,8 @@ public class DeviceFreqServiceTest {
@Test
@Test
public
void
adjFreqDetailsForShared
()
{
public
void
adjFreqDetailsForShared
()
{
AdjFreqSharedSearch
search
=
new
AdjFreqSharedSearch
();
AdjFreqSharedSearch
search
=
new
AdjFreqSharedSearch
();
search
.
setWxUserId
(
3L
);
search
.
setAccorderId
(
1L
);
search
.
setAccorderId
(
3L
);
List
<
AdjFredDetailVO
>
adjFreqDetailsForShared
=
deviceFreqService
.
getAdjFreqDetailsForShared
(
search
);
List
<
AdjFredDetailVO
>
adjFreqDetailsForShared
=
deviceFreqService
.
getAdjFreqDetailsForShared
(
search
);
System
.
out
.
println
(
"adjFreqDetailsForShared = "
+
JSONUtil
.
toJsonStr
(
adjFreqDetailsForShared
));
System
.
out
.
println
(
"adjFreqDetailsForShared = "
+
JSONUtil
.
toJsonStr
(
adjFreqDetailsForShared
));
}
}
...
...
src/test/java/cn/com/glsx/app/modules/service/mainTest.java
0 → 100644
View file @
3c9d7bb
package
cn
.
com
.
glsx
.
app
.
modules
.
service
;
import
cn.com.glsx.app.modules.entity.DeviceFreq
;
import
com.glsx.plat.common.utils.DateUtils
;
import
org.joda.time.Days
;
import
org.joda.time.Minutes
;
import
org.joda.time.Months
;
import
org.joda.time.Weeks
;
import
java.util.Date
;
/**
* @author Yanglinlong
* @date 2022/7/8 15:08
*/
public
class
mainTest
{
public
static
void
main
(
String
[]
args
)
{
org
.
joda
.
time
.
LocalDateTime
beginTime
=
new
org
.
joda
.
time
.
LocalDateTime
(
DateUtils
.
parse
(
"2022-07-08 15:31:01"
));
org
.
joda
.
time
.
LocalDateTime
endTime
=
new
org
.
joda
.
time
.
LocalDateTime
(
DateUtils
.
parse
(
"2022-07-08 15:22:28"
));
int
days
=
Days
.
daysBetween
(
beginTime
,
endTime
).
getDays
();
int
weeks
=
Weeks
.
weeksBetween
(
beginTime
,
endTime
).
getWeeks
();
int
months
=
Months
.
monthsBetween
(
beginTime
,
endTime
).
getMonths
();
int
minutes
=
Minutes
.
minutesBetween
(
beginTime
,
endTime
).
getMinutes
();
System
.
out
.
println
(
days
);
System
.
out
.
println
(
weeks
);
System
.
out
.
println
(
months
);
System
.
out
.
println
(
minutes
);
}
/**
* 获取两个时间的分钟差
*
* @param deviceFreq
* @return
*/
private
static
int
getDiffMinutes
(
DeviceFreq
deviceFreq
)
{
org
.
joda
.
time
.
LocalDate
beginTime
=
new
org
.
joda
.
time
.
LocalDate
(
deviceFreq
.
getCreatedDate
());
org
.
joda
.
time
.
LocalDate
endTime
=
new
org
.
joda
.
time
.
LocalDate
(
deviceFreq
.
getUpdatedDate
());
return
Minutes
.
minutesBetween
(
beginTime
,
endTime
).
getMinutes
();
}
/**
* 获取两个时间的天数差
*
* @param deviceFreq
* @return
*/
private
static
int
getDiffDays
(
DeviceFreq
deviceFreq
)
{
org
.
joda
.
time
.
LocalDate
beginTime
=
new
org
.
joda
.
time
.
LocalDate
(
deviceFreq
.
getCreatedDate
());
org
.
joda
.
time
.
LocalDate
endTime
=
new
org
.
joda
.
time
.
LocalDate
(
deviceFreq
.
getUpdatedDate
());
return
Days
.
daysBetween
(
beginTime
,
endTime
).
getDays
();
}
}
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