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
bf0af5f1
Commit
bf0af5f1
authored
Aug 31, 2020
by
unset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改车辆价格权限问题
parent
e93f7d62
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
45 additions
and
16 deletions
+45
-16
VehicleBiz.java
...c/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
+4
-6
VehicleCommonPriceInfoBiz.java
.../xxfc/platform/vehicle/biz/VehicleCommonPriceInfoBiz.java
+8
-3
VehicleHolidayPriceInfoBiz.java
...xxfc/platform/vehicle/biz/VehicleHolidayPriceInfoBiz.java
+15
-4
VehicleMapper.java
.../java/com/xxfc/platform/vehicle/mapper/VehicleMapper.java
+2
-0
VehicleCommonPriceInfoController.java
...atform/vehicle/rest/VehicleCommonPriceInfoController.java
+1
-1
VehicleCommonPriceInfoMapper.xml
...rc/main/resources/mapper/VehicleCommonPriceInfoMapper.xml
+2
-2
VehicleMapper.xml
...ehicle-server/src/main/resources/mapper/VehicleMapper.xml
+13
-0
No files found.
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
View file @
bf0af5f1
...
...
@@ -1402,16 +1402,14 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
* @return
*/
public
List
<
Vehicle
>
getAllVehicleByCompanyId
(
Integer
companyId
,
Integer
modelId
)
{
Example
example
=
new
Example
(
Vehicle
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
if
(
companyId
!=
null
)
{
criteria
.
andEqualTo
(
"subordinateBranch
"
,
companyId
);
param
.
put
(
"companyId
"
,
companyId
);
}
if
(
modelId
!=
null
)
{
criteria
.
andEqualTo
(
"modelId"
,
modelId
);
param
.
put
(
"modelId"
,
modelId
);
}
criteria
.
andEqualTo
(
"isDel"
,
0
);
return
mapper
.
selectByExample
(
example
);
return
mapper
.
getAllVehicleByParam
(
param
);
}
public
ObjectRestResponse
<
PageDataVO
<
VehicleAndModelInfoVo
>>
getVehicle
(
VehiclePlanDto
vehiclePlanDto
)
{
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleCommonPriceInfoBiz.java
View file @
bf0af5f1
...
...
@@ -3,6 +3,7 @@ package com.xxfc.platform.vehicle.biz;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.dto.UserDTO
;
import
com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
...
...
@@ -49,13 +50,17 @@ public class VehicleCommonPriceInfoBiz extends BaseBiz<VehicleCommonPriceInfoMap
if
(
vehicle
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"车辆不存在!"
);
}
UserDTO
userDTO
=
getAdminUserInfo
();
if
(
userDTO
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
RSTOKEN_EXPIRED_CODE
,
ResultCode
.
getMsg
(
ResultCode
.
RSTOKEN_EXPIRED_CODE
));
}
vehicleCommonPriceInfo
.
setCompanyId
(
vehicle
.
getSubordinateBranch
());
List
<
Vehicle
>
vehicleList
=
null
;
if
(
vehicleCommonPriceInfo
.
getAllVehicleUse
()
!=
null
&&
vehicleCommonPriceInfo
.
getAllVehicleUse
()
==
1
)
{
//所有车辆可用
vehicleList
=
vehicleBiz
.
getAllVehicleByCompanyId
(
vehicle
.
getSubordinateBranch
(),
null
);
vehicleList
=
vehicleBiz
.
getAllVehicleByCompanyId
(
userDTO
.
getCompanyId
(),
null
);
}
if
(
vehicleCommonPriceInfo
.
getAllModelUse
()
!=
null
&&
vehicleCommonPriceInfo
.
getAllModelUse
()
==
1
)
{
//
所有
车型可用
vehicleList
=
vehicleBiz
.
getAllVehicleByCompanyId
(
vehicle
.
getSubordinateBranch
(),
null
);
if
(
vehicleCommonPriceInfo
.
getAllModelUse
()
!=
null
&&
vehicleCommonPriceInfo
.
getAllModelUse
()
==
1
)
{
//
同
车型可用
vehicleList
=
vehicleBiz
.
getAllVehicleByCompanyId
(
userDTO
.
getCompanyId
(),
vehicle
.
getModelId
()
);
}
if
(
vehicleList
==
null
||
vehicleList
.
size
()
<=
0
)
{
//单个车辆可用
VehicleCommonPriceInfo
oldValue
=
getByVehicleId
(
vehicleCommonPriceInfo
.
getVehicleId
());
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleHolidayPriceInfoBiz.java
View file @
bf0af5f1
...
...
@@ -4,6 +4,8 @@ import cn.hutool.core.collection.CollUtil;
import
cn.hutool.core.date.DateUtil
;
import
com.github.wxiaoqi.security.admin.entity.BaseUserMember
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.dto.UserDTO
;
import
com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
...
...
@@ -33,7 +35,7 @@ import java.util.*;
*/
@Service
@Slf4j
public
class
VehicleHolidayPriceInfoBiz
extends
BaseBiz
<
VehicleHolidayPriceInfoMapper
,
VehicleHolidayPriceInfo
>
{
public
class
VehicleHolidayPriceInfoBiz
extends
BaseBiz
<
VehicleHolidayPriceInfoMapper
,
VehicleHolidayPriceInfo
>
implements
UserRestInterface
{
private
static
final
Integer
DEFAULT_DISCOUNT
=
100
;
private
static
final
Integer
DEFAULT_FREE_DAYS
=
1
;
private
static
final
Integer
DEFAULT_MEMBER_LEVEL
=
0
;
...
...
@@ -56,6 +58,11 @@ public class VehicleHolidayPriceInfoBiz extends BaseBiz<VehicleHolidayPriceInfoM
@Autowired
VehicleCommonPriceInfoBiz
vehicleCommonPriceInfoBiz
;
@Override
public
UserFeign
getUserFeign
()
{
return
userFeign
;
}
public
ObjectRestResponse
addOrUpdate
(
VehicleHolidayPriceInfo
vehicleHolidayPriceInfo
)
{
if
(
vehicleHolidayPriceInfo
==
null
)
{
return
ObjectRestResponse
.
paramIsEmpty
();
...
...
@@ -64,13 +71,17 @@ public class VehicleHolidayPriceInfoBiz extends BaseBiz<VehicleHolidayPriceInfoM
if
(
vehicle
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"车辆不存在!"
);
}
UserDTO
userDTO
=
getAdminUserInfo
();
if
(
userDTO
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
RSTOKEN_EXPIRED_CODE
,
ResultCode
.
getMsg
(
ResultCode
.
RSTOKEN_EXPIRED_CODE
));
}
vehicleHolidayPriceInfo
.
setCompanyId
(
vehicle
.
getSubordinateBranch
());
List
<
Vehicle
>
vehicleList
=
null
;
if
(
vehicleHolidayPriceInfo
.
getAllVehicleUse
()
!=
null
&&
vehicleHolidayPriceInfo
.
getAllVehicleUse
()
==
1
)
{
//所有车辆可用
vehicleList
=
vehicleBiz
.
getAllVehicleByCompanyId
(
vehicle
.
getSubordinateBranch
(),
null
);
vehicleList
=
vehicleBiz
.
getAllVehicleByCompanyId
(
userDTO
.
getCompanyId
(),
null
);
}
if
(
vehicleHolidayPriceInfo
.
getAllModelUse
()
!=
null
&&
vehicleHolidayPriceInfo
.
getAllModelUse
()
==
1
)
{
//
所有
车型可用
vehicleList
=
vehicleBiz
.
getAllVehicleByCompanyId
(
vehicle
.
getSubordinateBranch
(),
null
);
if
(
vehicleHolidayPriceInfo
.
getAllModelUse
()
!=
null
&&
vehicleHolidayPriceInfo
.
getAllModelUse
()
==
1
)
{
//
同
车型可用
vehicleList
=
vehicleBiz
.
getAllVehicleByCompanyId
(
userDTO
.
getCompanyId
(),
vehicle
.
getModelId
()
);
}
if
(
vehicleList
==
null
||
vehicleList
.
size
()
<=
0
)
{
//单个车辆可用
deleteAllVehiclePrice
(
vehicleHolidayPriceInfo
.
getVehicleId
(),
vehicleHolidayPriceInfo
.
getFestivalId
());
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/mapper/VehicleMapper.java
View file @
bf0af5f1
...
...
@@ -55,4 +55,6 @@ public interface VehicleMapper extends Mapper<Vehicle> {
List
<
String
>
findExistVehicleIds
();
List
<
BranchCompanyVehicleCountVo
>
getAllVehicleInfo
();
List
<
Vehicle
>
getAllVehicleByParam
(
Map
<
String
,
Object
>
param
);
}
\ No newline at end of file
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleCommonPriceInfoController.java
View file @
bf0af5f1
...
...
@@ -9,7 +9,7 @@ import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping
(
"vehicleCommonPriceInfo"
)
public
class
VehicleCommonPriceInfoController
extends
BaseController
<
VehicleCommonPriceInfoBiz
,
VehicleCommonPriceInfo
>
{
public
class
VehicleCommonPriceInfoController
extends
BaseController
<
VehicleCommonPriceInfoBiz
,
VehicleCommonPriceInfo
>{
@PostMapping
(
value
=
"/admin/addOrUpdate"
)
public
ObjectRestResponse
saveOrUpdate
(
@RequestBody
VehicleCommonPriceInfo
vehicleCommonPriceInfo
)
{
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleCommonPriceInfoMapper.xml
View file @
bf0af5f1
...
...
@@ -33,8 +33,8 @@
<if
test=
"companyId !=null "
>
and ( ci.id = #{companyId})
</if>
<if
test=
"numberPlate !=
null
"
>
and v.number_plate
= #{numberPlate}
<if
test=
"numberPlate !=
null and numberPlate != ''
"
>
and v.number_plate
like concat('%',#{numberPlate},'%')
</if>
and v.is_del = 0
</where>
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleMapper.xml
View file @
bf0af5f1
...
...
@@ -762,6 +762,19 @@
ORDER BY parkCompanyName
</select>
<select
id=
"getAllVehicleByParam"
resultType=
"com.xxfc.platform.vehicle.entity.Vehicle"
>
select * from vehicle v
LEFT JOIN branch_company bc2 ON v1.subordinate_branch = bc2.id
LEFT JOIN company_info ci on ci.id = bc2.company_id
where v.is_del != 1
<if
test=
"modelId != null and modelId != ''"
>
and v.model_id = #{modelId}
</if>
<if
test=
"companyId != null and companyId != ''"
>
and ci.id = #{companyId}
</if>
</select>
<select
id=
"countVehicleByParam"
parameterType=
"com.xxfc.platform.vehicle.pojo.dto.VehiclePlanDto"
resultType=
"com.xxfc.platform.vehicle.pojo.VehicleCountVo"
>
SELECT count(*) total ,
...
...
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