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
d5850af5
Commit
d5850af5
authored
Sep 02, 2020
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master-vehicle-price' into master-vehicle-price
parents
e225f844
db8d0acb
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
205 additions
and
74 deletions
+205
-74
User.java
...n/java/com/github/wxiaoqi/security/admin/entity/User.java
+5
-4
UserFeign.java
...va/com/github/wxiaoqi/security/admin/feign/UserFeign.java
+3
-0
UserDTO.java
.../com/github/wxiaoqi/security/admin/feign/dto/UserDTO.java
+4
-1
UserRestInterface.java
.../wxiaoqi/security/admin/feign/rest/UserRestInterface.java
+18
-3
PublicController.java
.../github/wxiaoqi/security/admin/rest/PublicController.java
+34
-0
AddOrUpdateVehicleVo.java
.../com/xxfc/platform/vehicle/pojo/AddOrUpdateVehicleVo.java
+11
-0
VehiclePageQueryVo.java
...va/com/xxfc/platform/vehicle/pojo/VehiclePageQueryVo.java
+7
-1
VehicleCommonPriceDto.java
...xxfc/platform/vehicle/pojo/dto/VehicleCommonPriceDto.java
+5
-0
VehicleCommonPriceVo.java
...m/xxfc/platform/vehicle/pojo/vo/VehicleCommonPriceVo.java
+2
-0
VehicleBiz.java
...c/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
+8
-6
VehicleCommonPriceInfoBiz.java
.../xxfc/platform/vehicle/biz/VehicleCommonPriceInfoBiz.java
+2
-1
VehicleHolidayPriceInfoBiz.java
...xxfc/platform/vehicle/biz/VehicleHolidayPriceInfoBiz.java
+1
-1
VehicleController.java
...ava/com/xxfc/platform/vehicle/rest/VehicleController.java
+4
-4
AdminBranchCompanyController.java
...form/vehicle/rest/admin/AdminBranchCompanyController.java
+1
-1
VehicleCommonPriceInfoMapper.xml
...rc/main/resources/mapper/VehicleCommonPriceInfoMapper.xml
+21
-1
VehicleMapper.xml
...ehicle-server/src/main/resources/mapper/VehicleMapper.xml
+79
-51
No files found.
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/User.java
View file @
d5850af5
...
@@ -3,11 +3,9 @@ package com.github.wxiaoqi.security.admin.entity;
...
@@ -3,11 +3,9 @@ package com.github.wxiaoqi.security.admin.entity;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.*
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
@Table
(
name
=
"base_user"
)
@Table
(
name
=
"base_user"
)
@Data
@Data
...
@@ -109,5 +107,8 @@ public class User {
...
@@ -109,5 +107,8 @@ public class User {
private
String
attr8
;
private
String
attr8
;
@Transient
private
List
<
Integer
>
companyIds
;
}
}
\ No newline at end of file
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/feign/UserFeign.java
View file @
d5850af5
...
@@ -37,6 +37,9 @@ public interface UserFeign {
...
@@ -37,6 +37,9 @@ public interface UserFeign {
@RequestMapping
(
value
=
"/public/userinfo-by-token"
)
@RequestMapping
(
value
=
"/public/userinfo-by-token"
)
public
ObjectRestResponse
<
UserDTO
>
userinfoByToken
(
@RequestParam
(
"token"
)
String
token
);
public
ObjectRestResponse
<
UserDTO
>
userinfoByToken
(
@RequestParam
(
"token"
)
String
token
);
@RequestMapping
(
value
=
"/public/v2/userinfo-by-token"
)
ObjectRestResponse
<
UserDTO
>
userinfoByTokenV2
(
@RequestParam
(
"token"
)
String
token
,
@RequestParam
(
"flag"
)
boolean
flag
);
@RequestMapping
(
value
=
"/public/userinfo-by-uid"
)
@RequestMapping
(
value
=
"/public/userinfo-by-uid"
)
public
ObjectRestResponse
<
UserDTO
>
userinfoByUid
(
@RequestParam
(
"uid"
)
Integer
uid
);
public
ObjectRestResponse
<
UserDTO
>
userinfoByUid
(
@RequestParam
(
"uid"
)
Integer
uid
);
...
...
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/feign/dto/UserDTO.java
View file @
d5850af5
...
@@ -17,7 +17,10 @@ public class UserDTO extends User {
...
@@ -17,7 +17,10 @@ public class UserDTO extends User {
}
}
public
List
<
Integer
>
dataCompany2List
()
{
public
List
<
Integer
>
dataCompany2List
()
{
return
str2List
(
getDataCompany
());
if
(
getCompanyIds
()
!=
null
&&
getCompanyIds
().
size
()
>
0
){
return
getCompanyIds
();
}
return
str2List
(
getDataCompany
());
}
}
public
List
<
Integer
>
dataCorporation2List
()
{
public
List
<
Integer
>
dataCorporation2List
()
{
...
...
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/feign/rest/UserRestInterface.java
View file @
d5850af5
...
@@ -17,6 +17,8 @@ import java.util.List;
...
@@ -17,6 +17,8 @@ import java.util.List;
public
interface
UserRestInterface
{
public
interface
UserRestInterface
{
public
UserFeign
getUserFeign
();
public
UserFeign
getUserFeign
();
default
HttpServletRequest
getRequest
()
{
default
HttpServletRequest
getRequest
()
{
return
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
return
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
}
}
...
@@ -39,14 +41,22 @@ public interface UserRestInterface {
...
@@ -39,14 +41,22 @@ public interface UserRestInterface {
}
}
}
}
default
UserDTO
getAdminUserInfoV2
(
boolean
flag
)
{
if
(
getRequest
().
getHeader
(
"Authorization"
)
!=
null
)
{
return
getUserFeign
().
userinfoByTokenV2
(
getRequest
().
getHeader
(
"Authorization"
),
flag
).
getData
();
}
else
{
return
null
;
}
}
default
void
checkAdminUser
(){
default
void
checkAdminUser
(){
if
(
null
==
getAdminUserInfo
())
{
if
(
null
==
getAdminUserInfo
())
{
throw
new
BaseException
(
ResultCode
.
NOTEXIST_CODE
);
throw
new
BaseException
(
ResultCode
.
NOTEXIST_CODE
);
}
}
}
}
default
void
setPowerData
(
DataInter
dataInter
){
default
void
setPowerData
(
DataInter
dataInter
,
boolean
flag
){
UserDTO
userDTO
=
getAdminUserInfo
(
);
UserDTO
userDTO
=
getAdminUserInfo
V2
(
flag
);
if
(
userDTO
==
null
)
{
if
(
userDTO
==
null
)
{
return
;
return
;
}
}
...
@@ -58,7 +68,12 @@ public interface UserRestInterface {
...
@@ -58,7 +68,12 @@ public interface UserRestInterface {
}
else
{
}
else
{
List
<
Integer
>
dataCorporation2List
=
userDTO
.
dataCorporation2List
();
List
<
Integer
>
dataCorporation2List
=
userDTO
.
dataCorporation2List
();
if
(
dataCorporation2List
!=
null
&&
dataCorporation2List
.
size
()
>
0
){
if
(
dataCorporation2List
!=
null
&&
dataCorporation2List
.
size
()
>
0
){
dataInter
.
setDataCorporationIds
(
dataCorporation2List
);
if
(
flag
){
dataInter
.
setDataCorporationIds
(
dataCorporation2List
);
}
else
{
dataInter
.
setDataCompanyIds
(
dataCompany2List
);
}
}
else
{
}
else
{
List
<
Integer
>
ids
=
new
ArrayList
<>();
List
<
Integer
>
ids
=
new
ArrayList
<>();
ids
.
add
(
0
);
ids
.
add
(
0
);
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/PublicController.java
View file @
d5850af5
...
@@ -12,13 +12,18 @@ import com.github.wxiaoqi.security.admin.vo.UserMemberVo;
...
@@ -12,13 +12,18 @@ import com.github.wxiaoqi.security.admin.vo.UserMemberVo;
import
com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil
;
import
com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
com.xxfc.platform.vehicle.pojo.CompanySearchDTO
;
import
com.xxfc.platform.vehicle.pojo.CompanySearchVO
;
import
org.apache.commons.beanutils.BeanUtils
;
import
org.apache.commons.beanutils.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.lang.reflect.InvocationTargetException
;
import
java.lang.reflect.InvocationTargetException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
/**
* ${DESCRIPTION}
* ${DESCRIPTION}
...
@@ -51,6 +56,9 @@ public class PublicController {
...
@@ -51,6 +56,9 @@ public class PublicController {
@Autowired
@Autowired
private
AppUserRelationBiz
relationBiz
;
private
AppUserRelationBiz
relationBiz
;
@Autowired
VehicleFeign
vehicleFeign
;
@RequestMapping
(
value
=
"/userinfo-by-token"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/userinfo-by-token"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
public
@ResponseBody
ObjectRestResponse
userinfoByToken
(
String
token
)
throws
Exception
{
ObjectRestResponse
userinfoByToken
(
String
token
)
throws
Exception
{
...
@@ -65,6 +73,32 @@ public class PublicController {
...
@@ -65,6 +73,32 @@ public class PublicController {
return
new
ObjectRestResponse
<
User
>().
rel
(
true
).
data
(
user
);
return
new
ObjectRestResponse
<
User
>().
rel
(
true
).
data
(
user
);
}
}
@RequestMapping
(
value
=
"v2/userinfo-by-token"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
ObjectRestResponse
userinfoByTokenV2
(
String
token
,
boolean
flag
)
throws
Exception
{
String
username
=
userAuthUtil
.
getInfoFromToken
(
token
).
getUniqueName
();
if
(
username
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
USER_NOTEXIST_CODE
,
ResultCode
.
getMsg
(
ResultCode
.
USER_NOTEXIST_CODE
));
}
User
user
=
userBiz
.
getUserByUsername
(
username
);
if
(
user
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
USER_NOTEXIST_CODE
,
ResultCode
.
getMsg
(
ResultCode
.
USER_NOTEXIST_CODE
));
}
if
(!
flag
&&
user
.
getDataCorporation
()
!=
null
){
CompanySearchDTO
companySearchDTO
=
new
CompanySearchDTO
();
companySearchDTO
.
setCompanyIds
(
Arrays
.
asList
(
user
.
getDataCorporation
().
split
(
","
)).
parallelStream
().
map
(
s
->
Integer
.
valueOf
(
s
)).
collect
(
Collectors
.
toList
()));
ObjectRestResponse
<
List
<
CompanySearchVO
>>
restResponse
=
vehicleFeign
.
listByIds
(
companySearchDTO
);
if
(
restResponse
!=
null
){
List
<
CompanySearchVO
>
companySearchVOList
=
restResponse
.
getData
();
if
(
companySearchVOList
!=
null
&&
companySearchVOList
.
size
()
>
0
){
List
<
Integer
>
companyIds
=
companySearchVOList
.
stream
().
map
(
CompanySearchVO:
:
getId
).
distinct
().
collect
(
Collectors
.
toList
());
user
.
setCompanyIds
(
companyIds
);
}
}
}
return
new
ObjectRestResponse
<
User
>().
rel
(
true
).
data
(
user
);
}
@RequestMapping
(
value
=
"/app/userinfo-by-token"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/app/userinfo-by-token"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
public
@ResponseBody
ObjectRestResponse
userDetailByToken
(
String
token
)
throws
Exception
{
ObjectRestResponse
userDetailByToken
(
String
token
)
throws
Exception
{
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/AddOrUpdateVehicleVo.java
View file @
d5850af5
package
com
.
xxfc
.
platform
.
vehicle
.
pojo
;
package
com
.
xxfc
.
platform
.
vehicle
.
pojo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Data
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.Column
;
...
@@ -189,4 +190,14 @@ public class AddOrUpdateVehicleVo {
...
@@ -189,4 +190,14 @@ public class AddOrUpdateVehicleVo {
* 内饰:1、全新,2、9成新,3、8成新,4、7成新
* 内饰:1、全新,2、9成新,3、8成新,4、7成新
*/
*/
private
Integer
vehicleInnerStatus
;
private
Integer
vehicleInnerStatus
;
/**
* 上牌日期
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
private
Date
vehicleRegisterDate
;
private
String
registerDate
;
}
}
\ No newline at end of file
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/VehiclePageQueryVo.java
View file @
d5850af5
package
com
.
xxfc
.
platform
.
vehicle
.
pojo
;
package
com
.
xxfc
.
platform
.
vehicle
.
pojo
;
import
com.github.wxiaoqi.security.common.vo.DataInter
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
@Data
@Data
public
class
VehiclePageQueryVo
{
public
class
VehiclePageQueryVo
implements
DataInter
{
/**
/**
* 车辆编号,0-没有
* 车辆编号,0-没有
...
@@ -153,4 +155,8 @@ public class VehiclePageQueryVo {
...
@@ -153,4 +155,8 @@ public class VehiclePageQueryVo {
*/
*/
private
boolean
download
;
private
boolean
download
;
List
<
Integer
>
dataCompanyIds
;
List
<
Integer
>
dataCorporationIds
;
}
}
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/dto/VehicleCommonPriceDto.java
View file @
d5850af5
...
@@ -3,6 +3,8 @@ package com.xxfc.platform.vehicle.pojo.dto;
...
@@ -3,6 +3,8 @@ package com.xxfc.platform.vehicle.pojo.dto;
import
com.github.wxiaoqi.security.common.vo.PageParam
;
import
com.github.wxiaoqi.security.common.vo.PageParam
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.List
;
@Data
@Data
public
class
VehicleCommonPriceDto
extends
PageParam
{
public
class
VehicleCommonPriceDto
extends
PageParam
{
private
Integer
companyId
;
private
Integer
companyId
;
...
@@ -19,4 +21,7 @@ public class VehicleCommonPriceDto extends PageParam {
...
@@ -19,4 +21,7 @@ public class VehicleCommonPriceDto extends PageParam {
*/
*/
private
Integer
parkBranchCompanyId
;
private
Integer
parkBranchCompanyId
;
List
<
Integer
>
dataCompanyIds
;
List
<
Integer
>
dataCorporationIds
;
}
}
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/vo/VehicleCommonPriceVo.java
View file @
d5850af5
...
@@ -20,4 +20,6 @@ public class VehicleCommonPriceVo extends VehicleCommonPriceInfo {
...
@@ -20,4 +20,6 @@ public class VehicleCommonPriceVo extends VehicleCommonPriceInfo {
private
String
modelName
;
private
String
modelName
;
private
Integer
vehicleBodyStatus
;
private
Integer
vehicleBodyStatus
;
private
String
vehicleId
;
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
View file @
d5850af5
...
@@ -226,6 +226,9 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
...
@@ -226,6 +226,9 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
for
(
AddOrUpdateVehicleVo
addOrUpdateVehicleVo
:
addOrUpdateVehicleVoList
)
{
for
(
AddOrUpdateVehicleVo
addOrUpdateVehicleVo
:
addOrUpdateVehicleVoList
)
{
Vehicle
vehicle
=
new
Vehicle
();
Vehicle
vehicle
=
new
Vehicle
();
if
(
StringUtils
.
isNotBlank
(
addOrUpdateVehicleVo
.
getRegisterDate
()))
{
addOrUpdateVehicleVo
.
setVehicleRegisterDate
(
DateTime
.
parse
(
addOrUpdateVehicleVo
.
getRegisterDate
(),
DateTimeFormat
.
forPattern
(
"yyyy-MM-dd HH:mm:ss"
)).
toDate
());
}
BeanUtilsBean
.
getInstance
().
copyProperties
(
vehicle
,
addOrUpdateVehicleVo
);
BeanUtilsBean
.
getInstance
().
copyProperties
(
vehicle
,
addOrUpdateVehicleVo
);
if
(
addOrUpdateVehicleVo
.
getParkBranchCompanyId
()
==
null
)
{
if
(
addOrUpdateVehicleVo
.
getParkBranchCompanyId
()
==
null
)
{
...
@@ -294,6 +297,9 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
...
@@ -294,6 +297,9 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
}
}
for
(
AddOrUpdateVehicleVo
addOrUpdateVehicleVo
:
addOrUpdateVehicleVoList
)
{
for
(
AddOrUpdateVehicleVo
addOrUpdateVehicleVo
:
addOrUpdateVehicleVoList
)
{
Vehicle
vehicle
=
new
Vehicle
();
Vehicle
vehicle
=
new
Vehicle
();
if
(
StringUtils
.
isNotBlank
(
addOrUpdateVehicleVo
.
getRegisterDate
()))
{
addOrUpdateVehicleVo
.
setVehicleRegisterDate
(
DateTime
.
parse
(
addOrUpdateVehicleVo
.
getRegisterDate
(),
DateTimeFormat
.
forPattern
(
"yyyy-MM-dd HH:mm:ss"
)).
toDate
());
}
BeanUtilsBean
.
getInstance
().
copyProperties
(
vehicle
,
addOrUpdateVehicleVo
);
BeanUtilsBean
.
getInstance
().
copyProperties
(
vehicle
,
addOrUpdateVehicleVo
);
if
(
addOrUpdateVehicleVo
.
getParkBranchCompanyId
()
==
null
)
{
if
(
addOrUpdateVehicleVo
.
getParkBranchCompanyId
()
==
null
)
{
throw
new
BaseException
(
ResultCode
.
RET_COMPANY_CAN_NOT_BE_NULL
);
throw
new
BaseException
(
ResultCode
.
RET_COMPANY_CAN_NOT_BE_NULL
);
...
@@ -1133,6 +1139,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
...
@@ -1133,6 +1139,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
* @throws Exception
* @throws Exception
*/
*/
public
PageDataVO
<
ResultVehicleVo
>
getByPage
(
VehiclePageQueryVo
vehiclePageQueryVo
)
throws
Exception
{
public
PageDataVO
<
ResultVehicleVo
>
getByPage
(
VehiclePageQueryVo
vehiclePageQueryVo
)
throws
Exception
{
setPowerData
(
vehiclePageQueryVo
,
true
);
Map
<
String
,
Object
>
params
=
PropertyUtils
.
describe
(
vehiclePageQueryVo
);
Map
<
String
,
Object
>
params
=
PropertyUtils
.
describe
(
vehiclePageQueryVo
);
Integer
pageSize
=
(
Integer
)
params
.
get
(
"limit"
);
Integer
pageSize
=
(
Integer
)
params
.
get
(
"limit"
);
params
.
remove
(
"pageSize"
);
params
.
remove
(
"pageSize"
);
...
@@ -1157,7 +1164,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
...
@@ -1157,7 +1164,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
* @return
* @return
* @throws Exception
* @throws Exception
*/
*/
public
PageDataVO
<
ResultVehicleVo
>
getByPageNotAllData
(
VehiclePageQueryVo
vehiclePageQueryVo
,
List
<
Integer
>
companyList
)
throws
Exception
{
public
PageDataVO
<
ResultVehicleVo
>
getByPageNotAllData
(
VehiclePageQueryVo
vehiclePageQueryVo
)
throws
Exception
{
Map
<
String
,
Object
>
params
=
PropertyUtils
.
describe
(
vehiclePageQueryVo
);
Map
<
String
,
Object
>
params
=
PropertyUtils
.
describe
(
vehiclePageQueryVo
);
Integer
pageSize
=
(
Integer
)
params
.
get
(
"limit"
);
Integer
pageSize
=
(
Integer
)
params
.
get
(
"limit"
);
params
.
remove
(
"pageSize"
);
params
.
remove
(
"pageSize"
);
...
@@ -1165,11 +1172,6 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
...
@@ -1165,11 +1172,6 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
params
.
remove
(
"pageNo"
);
params
.
remove
(
"pageNo"
);
//处理预定日期相关参数
//处理预定日期相关参数
adjustBookedInfoParam
(
params
,
vehiclePageQueryVo
);
adjustBookedInfoParam
(
params
,
vehiclePageQueryVo
);
if
(
companyList
!=
null
&&
companyList
.
size
()
>
0
)
{
params
.
put
(
"companyList"
,
companyList
);
}
else
{
params
.
put
(
"companyList"
,
Arrays
.
asList
(-
1
));
}
PageHelper
.
startPage
(
pageNo
,
pageSize
);
PageHelper
.
startPage
(
pageNo
,
pageSize
);
List
<
ResultVehicleVo
>
vehicles
=
mapper
.
getByPageNotAllData
(
params
);
List
<
ResultVehicleVo
>
vehicles
=
mapper
.
getByPageNotAllData
(
params
);
PageInfo
<
ResultVehicleVo
>
vehiclePageInfo
=
new
PageInfo
<>(
vehicles
);
PageInfo
<
ResultVehicleVo
>
vehiclePageInfo
=
new
PageInfo
<>(
vehicles
);
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleCommonPriceInfoBiz.java
View file @
d5850af5
...
@@ -50,7 +50,8 @@ public class VehicleCommonPriceInfoBiz extends BaseBiz<VehicleCommonPriceInfoMap
...
@@ -50,7 +50,8 @@ public class VehicleCommonPriceInfoBiz extends BaseBiz<VehicleCommonPriceInfoMap
if
(
vehicle
==
null
)
{
if
(
vehicle
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"车辆不存在!"
);
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"车辆不存在!"
);
}
}
setPowerData
(
vehicleCommonPriceInfo
);
vehicleCommonPriceInfo
.
setModelId
(
vehicle
.
getModelId
());
setPowerData
(
vehicleCommonPriceInfo
,
false
);
vehicleCommonPriceInfo
.
setCompanyId
(
vehicle
.
getSubordinateBranch
());
vehicleCommonPriceInfo
.
setCompanyId
(
vehicle
.
getSubordinateBranch
());
List
<
Vehicle
>
vehicleList
=
null
;
List
<
Vehicle
>
vehicleList
=
null
;
if
(
vehicleCommonPriceInfo
.
getAllVehicleUse
()
!=
null
&&
vehicleCommonPriceInfo
.
getAllVehicleUse
()
==
1
)
{
//所有车辆可用
if
(
vehicleCommonPriceInfo
.
getAllVehicleUse
()
!=
null
&&
vehicleCommonPriceInfo
.
getAllVehicleUse
()
==
1
)
{
//所有车辆可用
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleHolidayPriceInfoBiz.java
View file @
d5850af5
...
@@ -70,7 +70,7 @@ public class VehicleHolidayPriceInfoBiz extends BaseBiz<VehicleHolidayPriceInfoM
...
@@ -70,7 +70,7 @@ public class VehicleHolidayPriceInfoBiz extends BaseBiz<VehicleHolidayPriceInfoM
if
(
vehicle
==
null
)
{
if
(
vehicle
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"车辆不存在!"
);
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"车辆不存在!"
);
}
}
setPowerData
(
vehicleHolidayPriceInfo
);
setPowerData
(
vehicleHolidayPriceInfo
,
false
);
vehicleHolidayPriceInfo
.
setCompanyId
(
vehicle
.
getSubordinateBranch
());
vehicleHolidayPriceInfo
.
setCompanyId
(
vehicle
.
getSubordinateBranch
());
List
<
Vehicle
>
vehicleList
=
null
;
List
<
Vehicle
>
vehicleList
=
null
;
if
(
vehicleHolidayPriceInfo
.
getAllVehicleUse
()
!=
null
&&
vehicleHolidayPriceInfo
.
getAllVehicleUse
()
==
1
)
{
//所有车辆可用
if
(
vehicleHolidayPriceInfo
.
getAllVehicleUse
()
!=
null
&&
vehicleHolidayPriceInfo
.
getAllVehicleUse
()
==
1
)
{
//所有车辆可用
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleController.java
View file @
d5850af5
...
@@ -148,8 +148,8 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
...
@@ -148,8 +148,8 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
UserDTO
userDTO
=
userFeign
.
userinfoByToken
(
userAuthConfig
.
getToken
(
request
)).
getData
();
UserDTO
userDTO
=
userFeign
.
userinfoByToken
(
userAuthConfig
.
getToken
(
request
)).
getData
();
if
(
userDTO
!=
null
)
{
if
(
userDTO
!=
null
)
{
if
(
userDTO
.
getDataAll
()
==
2
)
{
if
(
userDTO
.
getDataAll
()
==
2
)
{
List
<
Integer
>
companyList
=
vehicleBiz
.
dataCompany
(
userDTO
.
getDataZone
(),
userDTO
.
getDataCompany
()
);
setPowerData
(
vehiclePageQueryVo
,
true
);
return
RestResponse
.
data
(
baseBiz
.
getByPageNotAllData
(
vehiclePageQueryVo
,
companyList
));
return
RestResponse
.
data
(
baseBiz
.
getByPageNotAllData
(
vehiclePageQueryVo
));
}
}
}
}
return
RestResponse
.
data
(
baseBiz
.
getByPage
(
vehiclePageQueryVo
));
return
RestResponse
.
data
(
baseBiz
.
getByPage
(
vehiclePageQueryVo
));
...
@@ -169,8 +169,8 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
...
@@ -169,8 +169,8 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
UserDTO
userDTO
=
userFeign
.
userinfoByUid
(
uid
).
getData
();
UserDTO
userDTO
=
userFeign
.
userinfoByUid
(
uid
).
getData
();
if
(
userDTO
!=
null
)
{
if
(
userDTO
!=
null
)
{
if
(
userDTO
.
getDataAll
()
==
2
)
{
if
(
userDTO
.
getDataAll
()
==
2
)
{
List
<
Integer
>
companyList
=
vehicleBiz
.
dataCompany
(
userDTO
.
getDataZone
(),
userDTO
.
getDataCompany
()
);
setPowerData
(
vehiclePageQueryVo
,
true
);
return
RestResponse
.
data
(
baseBiz
.
getByPageNotAllData
(
vehiclePageQueryVo
,
companyList
));
return
RestResponse
.
data
(
baseBiz
.
getByPageNotAllData
(
vehiclePageQueryVo
));
}
}
}
}
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/admin/AdminBranchCompanyController.java
View file @
d5850af5
...
@@ -38,7 +38,7 @@ public class AdminBranchCompanyController extends BaseController<BranchCompanyBi
...
@@ -38,7 +38,7 @@ public class AdminBranchCompanyController extends BaseController<BranchCompanyBi
@RequestMapping
(
value
=
"/search"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/search"
,
method
=
RequestMethod
.
GET
)
public
RestResponse
<
PageDataVO
<
CompanySearchVO
>>
search
(
@Validated
CompanySearchDTO
vo
)
{
public
RestResponse
<
PageDataVO
<
CompanySearchVO
>>
search
(
@Validated
CompanySearchDTO
vo
)
{
setPowerData
(
vo
);
setPowerData
(
vo
,
false
);
return
RestResponse
.
data
(
baseBiz
.
search
(
vo
));
return
RestResponse
.
data
(
baseBiz
.
search
(
vo
));
}
}
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleCommonPriceInfoMapper.xml
View file @
d5850af5
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
<select
id=
"selectList"
resultType=
"com.xxfc.platform.vehicle.pojo.vo.VehicleCommonPriceVo"
>
<select
id=
"selectList"
resultType=
"com.xxfc.platform.vehicle.pojo.vo.VehicleCommonPriceVo"
>
SELECT
SELECT
vci.*, v.`code`,
vci.*, v.`code`,
v.id as vehicleId,
v.number_plate,
v.number_plate,
FLOOR(
FLOOR(
YEAR (NOW()) - YEAR (v.vehicle_register_date)
YEAR (NOW()) - YEAR (v.vehicle_register_date)
...
@@ -25,7 +26,7 @@
...
@@ -25,7 +26,7 @@
and vci.model_id = #{modelId}
and vci.model_id = #{modelId}
</if>
</if>
<if
test=
"subordinateBranch !=null "
>
<if
test=
"subordinateBranch !=null "
>
and (
v.park_branch_company_
id = #{subordinateBranch})
and (
bc2.
id = #{subordinateBranch})
</if>
</if>
<if
test=
"parkBranchCompanyId !=null "
>
<if
test=
"parkBranchCompanyId !=null "
>
and ( bc.id = #{parkBranchCompanyId})
and ( bc.id = #{parkBranchCompanyId})
...
@@ -33,6 +34,25 @@
...
@@ -33,6 +34,25 @@
<if
test=
"companyId !=null "
>
<if
test=
"companyId !=null "
>
and ( ci.id = #{companyId})
and ( ci.id = #{companyId})
</if>
</if>
<if
test=
"dataCorporationIds != null and dataCorporationIds.size > 0"
>
and ci.id in (
<foreach
collection=
"dataCorporationIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
)
</if>
<if
test=
"dataCompanyIds != null and dataCompanyIds.size > 0"
>
and (bc.id in (
<foreach
collection=
"dataCompanyIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
) or
bc2.id in (
<foreach
collection=
"dataCompanyIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
))
</if>
<if
test=
"numberPlate !=null and numberPlate != ''"
>
<if
test=
"numberPlate !=null and numberPlate != ''"
>
and v.number_plate like concat('%',#{numberPlate},'%')
and v.number_plate like concat('%',#{numberPlate},'%')
</if>
</if>
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleMapper.xml
View file @
d5850af5
...
@@ -169,7 +169,7 @@
...
@@ -169,7 +169,7 @@
</foreach>
</foreach>
</if>
</if>
<if
test=
"subordinateBranch !=null "
>
<if
test=
"subordinateBranch !=null "
>
and (
v.park_branch_company_
id = #{subordinateBranch})
and (
bc2.
id = #{subordinateBranch})
</if>
</if>
<if
test=
"parkBranchCompanyId !=null "
>
<if
test=
"parkBranchCompanyId !=null "
>
and ( bc.id = #{parkBranchCompanyId})
and ( bc.id = #{parkBranchCompanyId})
...
@@ -177,6 +177,25 @@
...
@@ -177,6 +177,25 @@
<if
test=
"companyId !=null "
>
<if
test=
"companyId !=null "
>
and ( ci.id = #{companyId})
and ( ci.id = #{companyId})
</if>
</if>
<if
test=
"dataCorporationIds != null and dataCorporationIds.size > 0"
>
and ci.id in (
<foreach
collection=
"dataCorporationIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
)
</if>
<if
test=
"dataCompanyIds != null and dataCompanyIds.size > 0"
>
and (bc.id in (
<foreach
collection=
"dataCompanyIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
) or
bc2.id in (
<foreach
collection=
"dataCompanyIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
))
</if>
<if
test=
" addrProvince !=null or addrCity !=null or zoneId !=null "
>
<if
test=
" addrProvince !=null or addrCity !=null or zoneId !=null "
>
<if
test=
"addrProvince !=null"
>
<if
test=
"addrProvince !=null"
>
and bc.addr_province=#{addrProvince}
and bc.addr_province=#{addrProvince}
...
@@ -260,29 +279,6 @@
...
@@ -260,29 +279,6 @@
LEFT JOIN (select * from constant where type = 2) c ON v.use_type = c.code
LEFT JOIN (select * from constant where type = 2) c ON v.use_type = c.code
where
where
v.is_del=0
v.is_del=0
<if
test=
"companyList != null"
>
and ( v.park_branch_company_id in (
<trim
suffixOverrides=
","
>
<foreach
collection=
"companyList"
item=
"companyId"
>
#{companyId},
</foreach>
</trim>
)
<!--or v.expect_destination_branch_company_id in (
<trim suffixOverrides=",">
<foreach collection="companyList" item="companyId">
#{companyId},
</foreach>
</trim>
)-->
<!-- or v.subordinate_branch in (-->
<!-- <trim suffixOverrides=",">-->
<!-- <foreach collection="companyList" item="companyId">-->
<!-- #{companyId},-->
<!-- </foreach>-->
<!-- </trim>-->
)
</if>
<if
test=
"mRangeDateEnd !=null"
>
<if
test=
"mRangeDateEnd !=null"
>
and v.maintenance_date
<
= #{mRangeDateEnd}
and v.maintenance_date
<
= #{mRangeDateEnd}
</if>
</if>
...
@@ -313,9 +309,6 @@
...
@@ -313,9 +309,6 @@
<if
test=
"vin !=null and vin != ''"
>
<if
test=
"vin !=null and vin != ''"
>
and v.vin = #{vin}
and v.vin = #{vin}
</if>
</if>
<!-- <if test="subordinateBranch !=null">-->
<!-- and v.subordinate_branch = #{subordinateBranch}-->
<!-- </if>-->
<if
test=
"code !=null"
>
<if
test=
"code !=null"
>
and v.code = #{code}
and v.code = #{code}
</if>
</if>
...
@@ -348,7 +341,7 @@
...
@@ -348,7 +341,7 @@
</foreach>
</foreach>
</if>
</if>
<if
test=
"subordinateBranch !=null "
>
<if
test=
"subordinateBranch !=null "
>
and (
v.park_branch_company_
id = #{subordinateBranch})
and (
bc2.
id = #{subordinateBranch})
</if>
</if>
<if
test=
"parkBranchCompanyId !=null "
>
<if
test=
"parkBranchCompanyId !=null "
>
and ( bc.id = #{parkBranchCompanyId})
and ( bc.id = #{parkBranchCompanyId})
...
@@ -356,6 +349,26 @@
...
@@ -356,6 +349,26 @@
<if
test=
"companyId !=null "
>
<if
test=
"companyId !=null "
>
and ( ci.id = #{companyId})
and ( ci.id = #{companyId})
</if>
</if>
<if
test=
"dataCorporationIds != null and dataCorporationIds.size > 0"
>
and ci.id in (
<foreach
collection=
"dataCorporationIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
)
</if>
<if
test=
"dataCompanyIds != null and dataCompanyIds.size > 0"
>
and (bc.id in (
<foreach
collection=
"dataCompanyIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
) or
bc2.id in (
<foreach
collection=
"dataCompanyIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
))
</if>
<if
test=
" addrProvince !=null or addrCity !=null or zoneId !=null "
>
<if
test=
" addrProvince !=null or addrCity !=null or zoneId !=null "
>
<if
test=
"addrProvince !=null"
>
<if
test=
"addrProvince !=null"
>
and bc.addr_province=#{addrProvince}
and bc.addr_province=#{addrProvince}
...
@@ -482,6 +495,25 @@
...
@@ -482,6 +495,25 @@
<if
test=
"companyId !=null "
>
<if
test=
"companyId !=null "
>
and ( ci.id = #{companyId})
and ( ci.id = #{companyId})
</if>
</if>
<if
test=
"dataCorporationIds != null and dataCorporationIds.size > 0"
>
and ci.id in (
<foreach
collection=
"dataCorporationIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
)
</if>
<if
test=
"dataCompanyIds != null and dataCompanyIds.size > 0"
>
and (bc.id in (
<foreach
collection=
"dataCompanyIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
) or
bc2.id in (
<foreach
collection=
"dataCompanyIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
))
</if>
<if
test=
" addrProvince !=null or addrCity !=null or zoneId !=null "
>
<if
test=
" addrProvince !=null or addrCity !=null or zoneId !=null "
>
<if
test=
"addrProvince !=null"
>
<if
test=
"addrProvince !=null"
>
and bc.addr_province=#{addrProvince}
and bc.addr_province=#{addrProvince}
...
@@ -521,29 +553,6 @@
...
@@ -521,29 +553,6 @@
LEFT JOIN (select * from constant where type = 2) c ON v.use_type = c.code
LEFT JOIN (select * from constant where type = 2) c ON v.use_type = c.code
where
where
v.is_del=0
v.is_del=0
<if
test=
"companyList != null"
>
and ( v.park_branch_company_id in (
<trim
suffixOverrides=
","
>
<foreach
collection=
"companyList"
item=
"companyId"
>
#{companyId},
</foreach>
</trim>
)
<!--or v.expect_destination_branch_company_id in (
<trim suffixOverrides=",">
<foreach collection="companyList" item="companyId">
#{companyId},
</foreach>
</trim>
)-->
<!-- or v.subordinate_branch in (-->
<!-- <trim suffixOverrides=",">-->
<!-- <foreach collection="companyList" item="companyId">-->
<!-- #{companyId},-->
<!-- </foreach>-->
<!-- </trim>-->
)
</if>
<if
test=
"mRangeDateEnd !=null"
>
<if
test=
"mRangeDateEnd !=null"
>
and v.maintenance_date
<
= #{mRangeDateEnd}
and v.maintenance_date
<
= #{mRangeDateEnd}
</if>
</if>
...
@@ -618,6 +627,25 @@
...
@@ -618,6 +627,25 @@
and ( v.park_branch_company_id = #{subordinateBranch} or
and ( v.park_branch_company_id = #{subordinateBranch} or
v.expect_destination_branch_company_id=#{subordinateBranch} )
v.expect_destination_branch_company_id=#{subordinateBranch} )
</if>
</if>
<if
test=
"dataCorporationIds != null and dataCorporationIds.size > 0"
>
and ci.id in (
<foreach
collection=
"dataCorporationIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
)
</if>
<if
test=
"dataCompanyIds != null and dataCompanyIds.size > 0"
>
and (bc.id in (
<foreach
collection=
"dataCompanyIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
) or
bc2.id in (
<foreach
collection=
"dataCompanyIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
))
</if>
<if
test=
" addrProvince !=null or addrCity !=null or zoneId !=null "
>
<if
test=
" addrProvince !=null or addrCity !=null or zoneId !=null "
>
<if
test=
"addrProvince !=null"
>
<if
test=
"addrProvince !=null"
>
and bc.addr_province=#{addrProvince}
and bc.addr_province=#{addrProvince}
...
...
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