Commit 432607b1 authored by jiaorz's avatar jiaorz

修改支付宝支付方式

parent 60ccb41c
...@@ -19,10 +19,18 @@ import com.google.common.collect.Lists; ...@@ -19,10 +19,18 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.xxfc.platform.vehicle.common.CustomIllegalParamException; import com.xxfc.platform.vehicle.common.CustomIllegalParamException;
import com.xxfc.platform.vehicle.common.RestResponse; import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.constant.*; import com.xxfc.platform.vehicle.constant.ConstantType;
import com.xxfc.platform.vehicle.constant.RedisKey;
import com.xxfc.platform.vehicle.constant.ResCode.ResCode; import com.xxfc.platform.vehicle.constant.ResCode.ResCode;
import com.xxfc.platform.vehicle.entity.*; import com.xxfc.platform.vehicle.constant.VehicleBookRecordStatus;
import com.xxfc.platform.vehicle.mapper.*; import com.xxfc.platform.vehicle.constant.VehicleStatus;
import com.xxfc.platform.vehicle.entity.BranchCompany;
import com.xxfc.platform.vehicle.entity.Vehicle;
import com.xxfc.platform.vehicle.entity.VehicleBookInfo;
import com.xxfc.platform.vehicle.entity.VehicleBookRecord;
import com.xxfc.platform.vehicle.mapper.BookRecordAccItemMapper;
import com.xxfc.platform.vehicle.mapper.VehicleBookInfoMapper;
import com.xxfc.platform.vehicle.mapper.VehicleMapper;
import com.xxfc.platform.vehicle.pojo.*; import com.xxfc.platform.vehicle.pojo.*;
import com.xxfc.platform.vehicle.pojo.dto.VehiclePlanDto; import com.xxfc.platform.vehicle.pojo.dto.VehiclePlanDto;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -56,8 +64,6 @@ import java.util.*; ...@@ -56,8 +64,6 @@ import java.util.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.github.wxiaoqi.security.auth.common.constatns.CommonConstants.DATA_ALL_FALSE;
@Service @Service
@Slf4j @Slf4j
public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserRestInterface { public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserRestInterface {
...@@ -1278,12 +1284,23 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR ...@@ -1278,12 +1284,23 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
return ObjectRestResponse.createFailedResult(235, "token失效"); return ObjectRestResponse.createFailedResult(235, "token失效");
} }
List<Integer> companyList = Lists.newArrayList(); List<Integer> companyList = Lists.newArrayList();
if(DATA_ALL_FALSE.equals(userDTO.getDataAll())) { //不能获取全部数据 List<BranchCompany> branchCompany = branchCompanyBiz.getListByUser(userDTO);
companyList = dataCompany(userDTO.getDataZone(), userDTO.getDataCompany()); companyList = branchCompany.stream().map(BranchCompany::getId).collect(Collectors.toList());
}
if(vehiclePlanDto.getParkBranchCompanyId() != null) { if(vehiclePlanDto.getParkBranchCompanyId() != null) {
companyList.add(vehiclePlanDto.getParkBranchCompanyId()); if(companyList.size() > 0) {
if(companyList.contains(vehiclePlanDto.getParkBranchCompanyId())) {
companyList.clear();
companyList.add(vehiclePlanDto.getParkBranchCompanyId());
} else {
return ObjectRestResponse.succ();
}
} else {
companyList.add(vehiclePlanDto.getParkBranchCompanyId());
}
} }
log.info("用户权限公司ID: companyList = {}", companyList);
vehiclePlanDto.setCompanyIds(companyList); vehiclePlanDto.setCompanyIds(companyList);
Query query = new Query(vehiclePlanDto); Query query = new Query(vehiclePlanDto);
PageDataVO<VehicleAndModelInfoVo> pageDataVO = PageDataVO.pageInfo(query, () -> mapper.getVehicle(query.getSuper())); PageDataVO<VehicleAndModelInfoVo> pageDataVO = PageDataVO.pageInfo(query, () -> mapper.getVehicle(query.getSuper()));
......
...@@ -112,9 +112,18 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic ...@@ -112,9 +112,18 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic
List<Integer> companyList = Lists.newArrayList(); List<Integer> companyList = Lists.newArrayList();
if(DATA_ALL_FALSE.equals(userDTO.getDataAll())) { //不能获取全部数据 if(DATA_ALL_FALSE.equals(userDTO.getDataAll())) { //不能获取全部数据
companyList = dataCompany(userDTO.getDataZone(), userDTO.getDataCompany()); companyList = dataCompany(userDTO.getDataZone(), userDTO.getDataCompany());
} if(vehicleBookRecordQueryVo.getCompanyId() != null) {
if(vehicleBookRecordQueryVo.getUserCompany() != null) { if(companyList.contains(vehicleBookRecordQueryVo.getCompanyId())) { //如果权限中有这个公司就允许查询, 否则就直接返回空
companyList.add(vehicleBookRecordQueryVo.getUserCompany()); companyList.clear();
companyList.add(vehicleBookRecordQueryVo.getCompanyId());
} else {
return RestResponse.suc();
}
}
} else {
if(vehicleBookRecordQueryVo.getCompanyId() != null) {
companyList.add(vehicleBookRecordQueryVo.getCompanyId());
}
} }
vehicleBookRecordQueryVo.setCompanyIds(companyList); vehicleBookRecordQueryVo.setCompanyIds(companyList);
Query query = new Query(vehicleBookRecordQueryVo); Query query = new Query(vehicleBookRecordQueryVo);
...@@ -136,10 +145,20 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic ...@@ -136,10 +145,20 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic
List<Integer> companyList = Lists.newArrayList(); List<Integer> companyList = Lists.newArrayList();
if(DATA_ALL_FALSE.equals(userDTO.getDataAll())) { //不能获取全部数据 if(DATA_ALL_FALSE.equals(userDTO.getDataAll())) { //不能获取全部数据
companyList = dataCompany(userDTO.getDataZone(), userDTO.getDataCompany()); companyList = dataCompany(userDTO.getDataZone(), userDTO.getDataCompany());
if(vehicleBookRecordQueryVo.getCompanyId() != null) {
if(companyList.contains(vehicleBookRecordQueryVo.getCompanyId())) { //如果权限中有这个公司就允许查询, 否则就直接返回空
companyList.clear();
companyList.add(vehicleBookRecordQueryVo.getCompanyId());
} else {
return RestResponse.suc();
}
}
} else {
if(vehicleBookRecordQueryVo.getCompanyId() != null) {
companyList.add(vehicleBookRecordQueryVo.getCompanyId());
}
} }
if(vehicleBookRecordQueryVo.getCompanyId() != null) {
companyList.add(vehicleBookRecordQueryVo.getCompanyId());
}
vehicleBookRecordQueryVo.setCompanyIds(companyList); vehicleBookRecordQueryVo.setCompanyIds(companyList);
Query query = new Query(vehicleBookRecordQueryVo); Query query = new Query(vehicleBookRecordQueryVo);
PageDataVO<VehicleBookRecordVo> pageDataVO = PageDataVO.pageInfo(query, () -> mapper.getBookRecordInfo(query.getSuper())); PageDataVO<VehicleBookRecordVo> pageDataVO = PageDataVO.pageInfo(query, () -> mapper.getBookRecordInfo(query.getSuper()));
......
...@@ -402,7 +402,7 @@ ...@@ -402,7 +402,7 @@
</foreach> </foreach>
</if> </if>
and v1.status between 1 and 2 and v1.status between 1 and 2 and v1.book_user != -2
</where> </where>
order by create_time DESC order by create_time DESC
...@@ -440,6 +440,7 @@ ...@@ -440,6 +440,7 @@
<if test="status != null"> <if test="status != null">
and v1.status = #{status} and v1.status = #{status}
</if> </if>
and v1.book_user != -2
</where> </where>
group by v1.id group by v1.id
order by create_time DESC order by create_time DESC
......
...@@ -475,7 +475,9 @@ ...@@ -475,7 +475,9 @@
#{id} #{id}
</foreach> </foreach>
</if> </if>
and is_del != 1
</where> </where>
ORDER BY parkCompanyName
</select> </select>
<select id="countVehicleByParam" parameterType="com.xxfc.platform.vehicle.pojo.dto.VehiclePlanDto" <select id="countVehicleByParam" parameterType="com.xxfc.platform.vehicle.pojo.dto.VehiclePlanDto"
......
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