Commit db8d0acb authored by unset's avatar unset

添加车辆信息管理数据权限

parent 265f02bf
...@@ -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;
} }
...@@ -1138,7 +1138,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR ...@@ -1138,7 +1138,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); 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");
...@@ -1163,7 +1163,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR ...@@ -1163,7 +1163,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");
...@@ -1171,11 +1171,6 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR ...@@ -1171,11 +1171,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);
......
...@@ -51,7 +51,7 @@ public class VehicleCommonPriceInfoBiz extends BaseBiz<VehicleCommonPriceInfoMap ...@@ -51,7 +51,7 @@ public class VehicleCommonPriceInfoBiz extends BaseBiz<VehicleCommonPriceInfoMap
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "车辆不存在!"); return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "车辆不存在!");
} }
vehicleCommonPriceInfo.setModelId(vehicle.getModelId()); vehicleCommonPriceInfo.setModelId(vehicle.getModelId());
setPowerData(vehicleCommonPriceInfo); 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) {//所有车辆可用
......
...@@ -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) {//所有车辆可用
......
...@@ -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) {
setPowerData(vehiclePageQueryVo); setPowerData(vehiclePageQueryVo, true);
return RestResponse.data(baseBiz.getByPageNotAllData(vehiclePageQueryVo, vehiclePageQueryVo.getDataCompanyIds())); 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) {
setPowerData(vehiclePageQueryVo); setPowerData(vehiclePageQueryVo, true);
return RestResponse.data(baseBiz.getByPageNotAllData(vehiclePageQueryVo, vehiclePageQueryVo.getDataCompanyIds())); return RestResponse.data(baseBiz.getByPageNotAllData(vehiclePageQueryVo));
} }
} }
......
...@@ -26,7 +26,7 @@ ...@@ -26,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})
...@@ -34,6 +34,25 @@ ...@@ -34,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>
......
...@@ -166,7 +166,7 @@ ...@@ -166,7 +166,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})
...@@ -174,6 +174,25 @@ ...@@ -174,6 +174,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}
...@@ -257,29 +276,6 @@ ...@@ -257,29 +276,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 &lt;= #{mRangeDateEnd} and v.maintenance_date &lt;= #{mRangeDateEnd}
</if> </if>
...@@ -310,9 +306,6 @@ ...@@ -310,9 +306,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>
...@@ -342,7 +335,7 @@ ...@@ -342,7 +335,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})
...@@ -350,6 +343,26 @@ ...@@ -350,6 +343,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}
...@@ -473,6 +486,25 @@ ...@@ -473,6 +486,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}
...@@ -512,29 +544,6 @@ ...@@ -512,29 +544,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 &lt;= #{mRangeDateEnd} and v.maintenance_date &lt;= #{mRangeDateEnd}
</if> </if>
...@@ -606,6 +615,25 @@ ...@@ -606,6 +615,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}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment