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
04ef9893
Commit
04ef9893
authored
Nov 06, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.车辆实体类新增司机、手机号、最大速度阈值。
2.车辆信息新增月度里程字段。
parent
e2803cca
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
10 deletions
+22
-10
Car.java
.../main/java/com/yeejoin/equipmanage/common/entity/Car.java
+14
-8
CarServiceImpl.java
.../com/yeejoin/equipmanage/service/impl/CarServiceImpl.java
+8
-2
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/Car.java
View file @
04ef9893
...
...
@@ -116,13 +116,18 @@ public class Car extends BaseEntity {
@ApiModelProperty
(
value
=
"机构编码"
)
@TableField
(
"biz_org_code"
)
private
String
bizOrgCode
;
// 2023年11月6日 11点16分添加
@ApiModelProperty
(
value
=
"司机"
)
@TableField
(
"driver"
)
private
String
driver
;
// 2023年11月6日 11点16分添加
@ApiModelProperty
(
value
=
"联系电话"
)
@TableField
(
"phone"
)
private
String
phone
;
// 2023年11月6日 11点16分添加
@ApiModelProperty
(
value
=
"速度阈值"
)
@TableField
(
"max_speed"
)
private
Double
maxSpeed
;
@ApiModelProperty
(
value
=
"图片"
)
@TableField
(
exist
=
false
)
private
List
<
UploadFile
>
img
;
...
...
@@ -177,7 +182,6 @@ public class Car extends BaseEntity {
@TableField
(
exist
=
false
)
private
String
iotStatus
;
@TableField
(
exist
=
false
)
private
Long
categoryId
;
...
...
@@ -232,4 +236,6 @@ public class Car extends BaseEntity {
@TableField
(
exist
=
false
)
private
String
iotDeviceName
;
@TableField
(
exist
=
false
)
private
Double
monthTravel
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/CarServiceImpl.java
View file @
04ef9893
package
com
.
yeejoin
.
equipmanage
.
service
.
impl
;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.TypeReference
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
...
...
@@ -20,7 +21,6 @@ import com.yeejoin.amos.component.feign.model.FeignClientResult;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.UserOrgTreeModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.equipmanage.common.datasync.entity.FireVehicle
;
import
com.yeejoin.equipmanage.common.dto.CarFusionDto
;
...
...
@@ -1380,7 +1380,9 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements ICarS
if
(!
ObjectUtils
.
isEmpty
(
car
.
getIotCode
()))
{
Double
monthTravel
=
0.0
;
Double
totalTravel
=
0.0
;
String
currentYearAndMonth
=
DateUtil
.
format
(
new
Date
(),
"yyyy-MM"
);
LambdaQueryWrapper
<
WlCarMileage
>
wrapper
=
new
LambdaQueryWrapper
<
WlCarMileage
>();
wrapper
.
eq
(
WlCarMileage:
:
getIotCode
,
car
.
getIotCode
());
wrapper
.
ge
(
WlCarMileage:
:
getTravel
,
0.5
);
...
...
@@ -1392,9 +1394,13 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements ICarS
//判断当前车辆全程是否异常,如果时速小于阈值 则对数据进行返回 否则不予返回
if
(!
ObjectUtils
.
isEmpty
(
wl
.
getTakeTime
())
&&
!
ObjectUtils
.
isEmpty
(
wl
.
getTravel
())
&&
((
wl
.
getTravel
()
/
(
wl
.
getTakeTime
()
/
3600000.0
))
<
CAR_MAX_SPEED
))
{
totalTravel
+=
wl
.
getTravel
();
if
(
DateUtil
.
format
(
wl
.
getStartTime
(),
"yyyy-MM"
).
equals
(
currentYearAndMonth
)){
monthTravel
+=
wl
.
getTravel
();
}
}
}
car
.
setTotalTravel
(
Double
.
valueOf
(
String
.
format
(
"%.1f"
,
totalTravel
)));
car
.
setMonthTravel
(
Double
.
valueOf
(
String
.
format
(
"%.1f"
,
monthTravel
)));
WlCarMileage
last
=
iWlCarMileageService
.
getOne
(
new
LambdaQueryWrapper
<
WlCarMileage
>().
eq
(
WlCarMileage:
:
getIotCode
,
car
.
getIotCode
())
.
orderByDesc
(
WlCarMileage:
:
getEndTime
).
last
(
"limit 1"
));
...
...
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