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
54b8274f
Commit
54b8274f
authored
Mar 25, 2022
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改车辆绑定逻辑
parent
783f02de
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
81 additions
and
1 deletion
+81
-1
UserCar.java
.../com/yeejoin/amos/boot/module/jcs/api/entity/UserCar.java
+2
-0
IUserCarService.java
...oin/amos/boot/module/jcs/api/service/IUserCarService.java
+1
-0
CommandController.java
...boot/module/command/biz/controller/CommandController.java
+7
-0
CarController.java
...ava/com/yeejoin/equipmanage/controller/CarController.java
+6
-0
JcsFeign.java
...src/main/java/com/yeejoin/equipmanage/fegin/JcsFeign.java
+10
-0
FirefightersController.java
...oot/module/jcs/biz/controller/FirefightersController.java
+33
-1
UserCarServiceImpl.java
.../boot/module/jcs/biz/service/impl/UserCarServiceImpl.java
+7
-0
jcs-1.0.0.0.xml
...ystem-jcs/src/main/resources/db/changelog/jcs-1.0.0.0.xml
+15
-0
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/entity/UserCar.java
View file @
54b8274f
...
...
@@ -28,4 +28,6 @@ public class UserCar extends BaseEntity {
private
String
carNum
;
@TableField
(
"car_id"
)
private
Long
carId
;
@TableField
(
"team_id"
)
private
String
teamId
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/service/IUserCarService.java
View file @
54b8274f
...
...
@@ -12,6 +12,7 @@ public interface IUserCarService {
UserCar
selectByAmosUserId
(
Long
id
);
UserCar
selectByCarId
(
Long
id
);
List
<
UserCar
>
selectList
();
String
selectListid
();
void
add
(
UserCar
userCar
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-command-biz/src/main/java/com/yeejoin/amos/boot/module/command/biz/controller/CommandController.java
View file @
54b8274f
...
...
@@ -1377,6 +1377,10 @@ public class CommandController extends BaseController {
map
.
put
(
"data"
,
null
);
return
ResponseHelper
.
buildResponse
(
null
);
}
if
(
teamId
==
null
){
return
ResponseHelper
.
buildResponse
(
null
);
}
ResponseModel
<
Page
<
CarInfoDto
>>
data
=
equipFeignClient
.
equipmentCarList
(
teamId
,
name
,
code
,
pageNum
,
pageSize
,
id
,
isNo
);
List
<
CarInfoDto
>
array
=
null
;
if
(
data
!=
null
&&
data
.
getResult
()!=
null
){
...
...
@@ -1422,7 +1426,10 @@ public class CommandController extends BaseController {
AgencyUserModel
agencyUserModel
=
getUserInfo
();
userCar
.
setAmosUserId
(
Long
.
valueOf
(
agencyUserModel
.
getUserId
()));
userCar
.
setAmosUserName
(
agencyUserModel
.
getRealName
());
if
(
"1"
.
equals
(
type
))
{
Firefighters
orgUsr
=
firefightersService
.
selectByAmosOrgId
(
Long
.
valueOf
(
agencyUserModel
.
getUserId
()));
userCar
.
setTeamId
(
orgUsr
.
getFireTeamId
()+
""
);
userCarService
.
add
(
userCar
);
}
else
{
userCarService
.
delete
(
userCar
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/CarController.java
View file @
54b8274f
...
...
@@ -33,6 +33,7 @@ import org.springframework.context.annotation.Lazy;
import
org.springframework.format.annotation.DateTimeFormat
;
import
org.springframework.http.*
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.client.RestTemplate
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
...
...
@@ -279,6 +280,7 @@ public class CarController extends AbstractBaseController {
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@Transactional
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"编辑车辆信息(<font color='blue'>release</font>)"
,
notes
=
"编辑车辆信息"
)
@PostMapping
(
value
=
"/update"
,
produces
=
"application/json;charset=UTF-8"
)
public
Car
updateCar
(
@ApiParam
(
value
=
"车辆对象"
,
required
=
true
)
@RequestBody
Car
car
)
{
...
...
@@ -295,6 +297,10 @@ public class CarController extends AbstractBaseController {
// Set<CarProperty> carpList = carRequest.getCarPropertyList();
// carInstance = iCarService.saveCar(getUserInfo(), carInstance, carInfo, carpList);
// saveFile(carInstance);视频图片文件后期统一处理
//用来解绑车辆
jcsFeign
.
getUserCar
(
car
.
getId
(),
car
.
getTeamId
());
EquipmentSpecificSerivceImpl
.
registerMqttTopic
(
car
.
getIotCode
(),
equipmentIotMqttReceiveConfig
);
Car
oldCar
=
iCarService
.
getById
(
car
.
getId
());
Car
car1
=
iCarService
.
updateOneById
(
car
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/fegin/JcsFeign.java
View file @
54b8274f
...
...
@@ -81,6 +81,16 @@ public interface JcsFeign {
@RequestParam
(
value
=
"type"
,
required
=
false
)
String
type
,
@RequestParam
(
value
=
"method"
,
required
=
false
)
String
method
);
@RequestMapping
(
value
=
"/firefighters/getUserCar/{carId}/{teamId}"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
void
getUserCar
(
@PathVariable
(
value
=
"carId"
)
Long
carId
,
@PathVariable
(
value
=
"teamId"
)
String
teamId
);
/**
* <pre>
* 根据值班区域ID查询当前值班人
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/FirefightersController.java
View file @
54b8274f
...
...
@@ -12,6 +12,8 @@ import com.yeejoin.amos.boot.module.common.api.core.framework.PersonIdentify;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto
;
import
com.yeejoin.amos.boot.module.common.api.enums.OrgPersonEnum
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.UserCar
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IUserCarService
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
...
...
@@ -104,7 +106,8 @@ public class FirefightersController extends BaseController {
@Value
(
"${auth-key-fire-fighters:fire_fighters_info}"
)
private
String
authKey
;
@Autowired
IUserCarService
userCarService
;
/**
* 新增消防队员
...
...
@@ -193,6 +196,27 @@ public class FirefightersController extends BaseController {
}
@TycloudOperation
(
needAuth
=
true
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/getUserCar/{carId}/{teamId}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"获取绑定车辆"
,
notes
=
"获取绑定车辆"
)
@Transactional
public
void
getUserCar
(
@PathVariable
Long
carId
,
@PathVariable
String
teamId
)
{
try
{
UserCar
userCar
=
userCarService
.
selectByCarId
(
carId
);
if
(
userCar
!=
null
&&!
userCar
.
getTeamId
().
equals
(
teamId
)){
userCarService
.
delete
(
userCar
);
}
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"系统异常"
);
}
}
/**
* 修改消防队员
*
...
...
@@ -205,6 +229,14 @@ public class FirefightersController extends BaseController {
public
ResponseModel
<
Object
>
updateByIdFirefighters
(
HttpServletRequest
request
,
@RequestBody
FirefightersInfoDto
firefighters
)
{
try
{
//判断此消防人员所属队伍是否变换,
//获取用户已绑定车辆id、
UserCar
userCar
=
userCarService
.
selectByAmosUserId
(
Long
.
valueOf
(
firefighters
.
getFirefighters
().
getAmosUserId
()));
if
(
userCar
!=
null
&&!
userCar
.
getTeamId
().
equals
(
firefighters
.
getFirefighters
().
getFireTeamId
()+
""
)){
userCarService
.
delete
(
userCar
);
}
Firefighters
firefighter
=
firefighters
.
getFirefighters
();
// BUG2168 居住地户籍所在地为空判断 bykongfm
if
(
firefighter
.
getResidenceDetails
()
!=
null
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/UserCarServiceImpl.java
View file @
54b8274f
...
...
@@ -38,6 +38,13 @@ public class UserCarServiceImpl extends BaseService<AircraftDto, UserCar, UserCa
}
@Override
public
UserCar
selectByCarId
(
Long
id
)
{
QueryWrapper
<
UserCar
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"car_id"
,
id
);
return
UserCarMapper
.
selectOne
(
queryWrapper
);
}
@Override
public
List
<
UserCar
>
selectList
()
{
return
this
.
list
();
}
...
...
amos-boot-system-jcs/src/main/resources/db/changelog/jcs-1.0.0.0.xml
View file @
54b8274f
...
...
@@ -2828,5 +2828,20 @@
</sql>
</changeSet>
<changeSet
author=
"tw"
id=
"2022-03-25"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"jc_user_car"
columnName=
"team_id"
/>
</not>
</preConditions>
<comment>
jc_user_car add column team_id 队伍id
</comment>
<sql>
ALTER TABLE jc_user_car ADD team_id varchar(100) NULL COMMENT '队伍id';
</sql>
</changeSet>
</databaseChangeLog>
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