Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
4afac4ca
Commit
4afac4ca
authored
Jul 23, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
发现排序
parent
dd61298a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
40 deletions
+46
-40
VehicleWarningMsg.java
...a/com/xxfc/platform/vehicle/entity/VehicleWarningMsg.java
+2
-0
VehicleAndModelInfoVo.java
...com/xxfc/platform/vehicle/pojo/VehicleAndModelInfoVo.java
+3
-1
VehicleBiz.java
...c/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
+11
-3
VehicleWarningMsgBiz.java
...a/com/xxfc/platform/vehicle/biz/VehicleWarningMsgBiz.java
+18
-6
BaseController.java
...java/com/xxfc/platform/vehicle/common/BaseController.java
+0
-8
VehicleWarningMsgController.java
...fc/platform/vehicle/rest/VehicleWarningMsgController.java
+12
-22
No files found.
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/entity/VehicleWarningMsg.java
View file @
4afac4ca
...
...
@@ -5,6 +5,7 @@ import lombok.Data;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
java.util.Date
;
/**
...
...
@@ -12,6 +13,7 @@ import java.util.Date;
*
*/
@Data
@Table
(
name
=
"vehicle_warning_msg"
)
public
class
VehicleWarningMsg
{
@Id
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/VehicleAndModelInfoVo.java
View file @
4afac4ca
...
...
@@ -11,5 +11,7 @@ import java.util.List;
public
class
VehicleAndModelInfoVo
extends
Vehicle
{
VehicleModel
vehicleModel
;
List
<
VehicleBookRecord
>
vehicleBookRecord
;
private
String
endCompanyName
;
private
String
parkCompanyName
;
private
String
subordinateBranchName
;
private
String
destinationBranchCompanyName
;
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
View file @
4afac4ca
...
...
@@ -1090,9 +1090,17 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> {
Query
query
=
new
Query
(
vehiclePlanDto
);
PageDataVO
<
VehicleAndModelInfoVo
>
pageDataVO
=
PageDataVO
.
pageInfo
(
query
,
()
->
mapper
.
getAllVehicle
(
query
.
getSuper
()));
for
(
VehicleAndModelInfoVo
vehicleAndModelInfoVo
:
pageDataVO
.
getData
())
{
CompanyDetail
restResponse
=
branchCompanyBiz
.
getDetailById
(
vehicleAndModelInfoVo
.
getParkBranchCompanyId
());
if
(
restResponse
!=
null
)
{
vehicleAndModelInfoVo
.
setEndCompanyName
(
restResponse
.
getName
());
CompanyDetail
partCompany
=
branchCompanyBiz
.
getDetailById
(
vehicleAndModelInfoVo
.
getParkBranchCompanyId
());
if
(
partCompany
!=
null
)
{
vehicleAndModelInfoVo
.
setParkCompanyName
(
partCompany
.
getName
());
}
CompanyDetail
subCompany
=
branchCompanyBiz
.
getDetailById
(
vehicleAndModelInfoVo
.
getSubordinateBranch
());
if
(
subCompany
!=
null
)
{
vehicleAndModelInfoVo
.
setSubordinateBranchName
(
subCompany
.
getName
());
}
CompanyDetail
disCompany
=
branchCompanyBiz
.
getDetailById
(
vehicleAndModelInfoVo
.
getExpectDestinationBranchCompanyId
());
if
(
disCompany
!=
null
)
{
vehicleAndModelInfoVo
.
setDestinationBranchCompanyName
(
disCompany
.
getName
());
}
}
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleWarningMsgBiz.java
View file @
4afac4ca
package
com
.
xxfc
.
platform
.
vehicle
.
biz
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONException
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.google.common.collect.Maps
;
import
com.xxfc.platform.vehicle.common.CustomIllegalParamException
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.constant.RedisKey
;
import
com.xxfc.platform.vehicle.constant.ResCode.ResCode
;
import
com.xxfc.platform.vehicle.constant.VehicleMsgStatus
;
import
com.xxfc.platform.vehicle.constant.VehicleMsgType
;
import
com.xxfc.platform.vehicle.entity.Vehicle
;
...
...
@@ -84,14 +88,22 @@ public class VehicleWarningMsgBiz extends BaseBiz<VehicleWarningMsgMapper, Vehic
/**
* 按页查询
* @param
queryVehicleWarningMsgVo
* @param
* @return
*/
public
PageDataVO
<
VehicleWarningMsg
>
getByPage
(
QueryVehicleWarningMsgVo
queryVehicleWarningMsgVo
){
PageHelper
.
startPage
(
queryVehicleWarningMsgVo
.
getPage
(),
queryVehicleWarningMsgVo
.
getLimit
());
List
<
VehicleWarningMsg
>
vehicleWarningMsgs
=
mapper
.
getByPages
(
queryVehicleWarningMsgVo
);
PageInfo
<
VehicleWarningMsg
>
vehicleWarningMsgPageInfo
=
new
PageInfo
<>(
vehicleWarningMsgs
);
return
PageDataVO
.
pageInfo
(
vehicleWarningMsgPageInfo
);
public
RestResponse
<
PageDataVO
<
VehicleWarningMsg
>>
getByPage
(
String
queryVehicleWarningMsgVoJson
){
try
{
QueryVehicleWarningMsgVo
queryVehicleWarningMsgVo
=
JSON
.
parseObject
(
queryVehicleWarningMsgVoJson
,
QueryVehicleWarningMsgVo
.
class
);
PageHelper
.
startPage
(
queryVehicleWarningMsgVo
.
getPage
(),
queryVehicleWarningMsgVo
.
getLimit
());
List
<
VehicleWarningMsg
>
vehicleWarningMsgs
=
mapper
.
getByPages
(
queryVehicleWarningMsgVo
);
PageInfo
<
VehicleWarningMsg
>
vehicleWarningMsgPageInfo
=
new
PageInfo
<>(
vehicleWarningMsgs
);
return
RestResponse
.
data
(
PageDataVO
.
pageInfo
(
vehicleWarningMsgPageInfo
));
}
catch
(
JSONException
ex
)
{
return
RestResponse
.
code
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
());
}
catch
(
CustomIllegalParamException
ex
){
return
RestResponse
.
code
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
());
}
}
/**
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/common/BaseController.java
View file @
4afac4ca
package
com
.
xxfc
.
platform
.
vehicle
.
common
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
@Slf4j
public
class
BaseController
<
Biz
extends
BaseBiz
>
{
@Autowired
protected
HttpServletRequest
request
;
@Autowired
@Lazy
protected
Biz
baseBiz
;
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleWarningMsgController.java
View file @
4afac4ca
package
com
.
xxfc
.
platform
.
vehicle
.
rest
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONException
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.vehicle.biz.VehicleWarningMsgBiz
;
import
com.xxfc.platform.vehicle.common.BaseController
;
import
com.xxfc.platform.vehicle.common.CustomIllegalParamException
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.constant.ResCode.ResCode
;
import
com.xxfc.platform.vehicle.entity.VehicleWarningMsg
;
import
com.xxfc.platform.vehicle.pojo.AddVehicleWarningMsgVo
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.vehicle.pojo.QueryVehicleWarningMsgVo
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.HashMap
;
...
...
@@ -20,37 +15,32 @@ import java.util.Map;
@RestController
@RequestMapping
(
"/vehicleWarningMsg"
)
@IgnoreClientToken
@Slf4j
public
class
VehicleWarningMsgController
extends
BaseController
<
VehicleWarningMsgBiz
>
{
public
class
VehicleWarningMsgController
{
@Autowired
VehicleWarningMsgBiz
vehicleWarningMsgBiz
;
@RequestMapping
(
value
=
"{id}"
,
method
=
RequestMethod
.
GET
)
private
RestResponse
<
VehicleWarningMsg
>
get
(
@PathVariable
Integer
id
)
throws
Exception
{
return
RestResponse
.
codeAndData
(
RestResponse
.
SUC_CODE
,
base
Biz
.
selectById
(
id
));
return
RestResponse
.
codeAndData
(
RestResponse
.
SUC_CODE
,
vehicleWarningMsg
Biz
.
selectById
(
id
));
}
@RequestMapping
(
value
=
"page"
,
method
=
RequestMethod
.
GET
)
@IgnoreUserToken
private
RestResponse
<
PageDataVO
<
VehicleWarningMsg
>>
getByPage
(
@RequestParam
String
queryVehicleWarningMsgVoJson
)
throws
Exception
{
QueryVehicleWarningMsgVo
queryVehicleWarningMsgVo
=
null
;
try
{
queryVehicleWarningMsgVo
=
JSON
.
parseObject
(
queryVehicleWarningMsgVoJson
,
QueryVehicleWarningMsgVo
.
class
);
return
RestResponse
.
data
(
baseBiz
.
getByPage
(
queryVehicleWarningMsgVo
));
}
catch
(
JSONException
ex
)
{
return
RestResponse
.
code
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
());
}
catch
(
CustomIllegalParamException
ex
){
return
RestResponse
.
code
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
());
}
return
vehicleWarningMsgBiz
.
getByPage
(
queryVehicleWarningMsgVoJson
);
}
@RequestMapping
(
value
=
""
,
method
=
RequestMethod
.
POST
)
private
RestResponse
<
Integer
>
add
(
@RequestBody
AddVehicleWarningMsgVo
addVehicleWarningMsgVo
)
throws
Exception
{
new
RestResponse
<
Map
>().
setData
(
new
HashMap
<
String
,
Object
>());
return
base
Biz
.
add
(
addVehicleWarningMsgVo
);
return
vehicleWarningMsg
Biz
.
add
(
addVehicleWarningMsgVo
);
}
@RequestMapping
(
value
=
"deal/{id}"
,
method
=
RequestMethod
.
PUT
)
private
RestResponse
deal
(
@PathVariable
Integer
id
)
throws
Exception
{
return
base
Biz
.
deal
(
id
);
return
vehicleWarningMsg
Biz
.
deal
(
id
);
}
}
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