Commit ea166476 authored by jiaorz's avatar jiaorz

修改租車訂單地址,修改车辆预定时添加订单号

parent ef6943dc
...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON; ...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONException; import com.alibaba.fastjson.JSONException;
import com.github.wxiaoqi.security.admin.feign.UserFeign; import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.dto.UserDTO; import com.github.wxiaoqi.security.admin.feign.dto.UserDTO;
import com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken; import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken; import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.auth.client.config.UserAuthConfig; import com.github.wxiaoqi.security.auth.client.config.UserAuthConfig;
...@@ -13,17 +14,16 @@ import com.github.wxiaoqi.security.common.exception.BaseException; ...@@ -13,17 +14,16 @@ import com.github.wxiaoqi.security.common.exception.BaseException;
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.github.wxiaoqi.security.common.vo.PageDataVO; import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.xxfc.platform.vehicle.biz.VehicleBiz; import com.xxfc.platform.vehicle.biz.*;
import com.xxfc.platform.vehicle.biz.VehicleBookRecordBiz;
import com.xxfc.platform.vehicle.biz.VehiclePlatCataBiz;
import com.xxfc.platform.vehicle.biz.VehicleWarningMsgBiz;
import com.xxfc.platform.vehicle.common.BaseController; import com.xxfc.platform.vehicle.common.BaseController;
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.BookType; import com.xxfc.platform.vehicle.constant.BookType;
import com.xxfc.platform.vehicle.constant.ResCode.ResCode; import com.xxfc.platform.vehicle.constant.ResCode.ResCode;
import com.xxfc.platform.vehicle.constant.VehicleBookRecordStatus; import com.xxfc.platform.vehicle.constant.VehicleBookRecordStatus;
import com.xxfc.platform.vehicle.entity.BranchCompany;
import com.xxfc.platform.vehicle.entity.Vehicle; import com.xxfc.platform.vehicle.entity.Vehicle;
import com.xxfc.platform.vehicle.entity.VehicleBookInfo; import com.xxfc.platform.vehicle.entity.VehicleBookInfo;
import com.xxfc.platform.vehicle.entity.VehicleBookRecord; import com.xxfc.platform.vehicle.entity.VehicleBookRecord;
...@@ -46,6 +46,7 @@ import java.util.ArrayList; ...@@ -46,6 +46,7 @@ import java.util.ArrayList;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
import static com.xxfc.platform.vehicle.constant.VehicleConstant.USER_APP; import static com.xxfc.platform.vehicle.constant.VehicleConstant.USER_APP;
import static com.xxfc.platform.vehicle.constant.VehicleConstant.USER_APP_NAME; import static com.xxfc.platform.vehicle.constant.VehicleConstant.USER_APP_NAME;
...@@ -55,7 +56,7 @@ import static com.xxfc.platform.vehicle.constant.VehicleConstant.USER_APP_NAME; ...@@ -55,7 +56,7 @@ import static com.xxfc.platform.vehicle.constant.VehicleConstant.USER_APP_NAME;
@Slf4j @Slf4j
@IgnoreClientToken @IgnoreClientToken
@Api(value="车辆管理controller",tags={"车辆管理接口"}) @Api(value="车辆管理controller",tags={"车辆管理接口"})
public class VehicleController extends BaseController<VehicleBiz> { public class VehicleController extends BaseController<VehicleBiz> implements UserRestInterface {
@Autowired @Autowired
private VehicleBookRecordBiz vehicleBookRecordBiz; private VehicleBookRecordBiz vehicleBookRecordBiz;
...@@ -78,7 +79,11 @@ public class VehicleController extends BaseController<VehicleBiz> { ...@@ -78,7 +79,11 @@ public class VehicleController extends BaseController<VehicleBiz> {
@Autowired @Autowired
private VehicleJobHandler vehicleJobHandler; private VehicleJobHandler vehicleJobHandler;
@Autowired
BranchCompanyBiz branchCompanyBiz;
public UserFeign getUserFeign() {
return userFeign;
}
private static Integer MAX_DRIVING_LICENSE_SIZE = 10 * 1024 * 1024;//10M private static Integer MAX_DRIVING_LICENSE_SIZE = 10 * 1024 * 1024;//10M
public static final DateTimeFormatter DEFAULT_FORMATTER = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss"); public static final DateTimeFormatter DEFAULT_FORMATTER = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");
...@@ -450,6 +455,34 @@ public class VehicleController extends BaseController<VehicleBiz> { ...@@ -450,6 +455,34 @@ public class VehicleController extends BaseController<VehicleBiz> {
@IgnoreClientToken @IgnoreClientToken
@IgnoreUserToken @IgnoreUserToken
public ObjectRestResponse<Map<String, Object>> getVehiclePlanList(VehiclePlanDto vehiclePlanDto) { public ObjectRestResponse<Map<String, Object>> getVehiclePlanList(VehiclePlanDto vehiclePlanDto) {
UserDTO userDTO = getAdminUserInfo();
if(userDTO == null) {
return ObjectRestResponse.createFailedResult(ResultCode.RSTOKEN_EXPIRED_CODE, "token失效");
}
List<Integer> companyList = Lists.newArrayList();
List<BranchCompany> branchCompany = branchCompanyBiz.getListByUser(userDTO);
companyList = branchCompany.stream().map(BranchCompany::getId).collect(Collectors.toList());
if(vehiclePlanDto.getParkBranchCompanyId() != null) {
if(companyList.size() > 0) {
if(companyList.contains(vehiclePlanDto.getParkBranchCompanyId())) {
companyList.clear();
companyList.add(vehiclePlanDto.getParkBranchCompanyId());
} else {
return ObjectRestResponse.succ();
}
}
}
if(vehiclePlanDto.getSubordinateBranch() != null) {
if(companyList.size() > 0) {
if(companyList.contains(vehiclePlanDto.getSubordinateBranch())) {
companyList.clear();
companyList.add(vehiclePlanDto.getSubordinateBranch());
} else {
return ObjectRestResponse.succ();
}
}
}
vehiclePlanDto.setCompanyIds(companyList);
//获取列表 //获取列表
PageDataVO<VehicleAndModelInfoVo> pageDataVO = baseBiz.getAllVehicle(vehiclePlanDto); PageDataVO<VehicleAndModelInfoVo> pageDataVO = baseBiz.getAllVehicle(vehiclePlanDto);
//获取警告信息 //获取警告信息
......
...@@ -380,11 +380,11 @@ ...@@ -380,11 +380,11 @@
<if test="status != null"> <if test="status != null">
and v1.status = #{status} and v1.status = #{status}
</if> </if>
<if test="subordinateBranch != null"> <if test="companyIds != null and companyIds.size > 0">
and v1.subordinate_branch = #{subordinateBranch} v1.park_branch_company_id in
</if> <foreach collection="companyIds" item="id" open="(" separator="," close=")">
<if test="parkBranchCompanyId != null"> #{id}
and v1.park_branch_company_id = #{parkBranchCompanyId} </foreach>
</if> </if>
<if test="zoneId !=null"> <if test="zoneId !=null">
and bc2.zone_id = #{zoneId} and bc2.zone_id = #{zoneId}
...@@ -461,14 +461,11 @@ ...@@ -461,14 +461,11 @@
<if test="status != null"> <if test="status != null">
and v1.status = #{status} and v1.status = #{status}
</if> </if>
<if test="subordinateBranch != null"> <if test="companyIds != null and companyIds.size > 0">
and v1.subordinate_branch = #{subordinateBranch} v1.park_branch_company_id in
</if> <foreach collection="companyIds" item="id" open="(" separator="," close=")">
<if test="parkBranchCompanyId != null"> #{id}
and v1.park_branch_company_id = #{parkBranchCompanyId} </foreach>
</if>
<if test="zoneId !=null">
and bc1.zone_id = #{zoneId}
</if> </if>
</where> </where>
GROUP BY v1.status GROUP BY v1.status
...@@ -486,14 +483,11 @@ ...@@ -486,14 +483,11 @@
<if test="status != null"> <if test="status != null">
and v2.status = #{status} and v2.status = #{status}
</if> </if>
<if test="subordinateBranch != null"> <if test="companyIds != null and companyIds.size > 0">
and v2.subordinate_branch = #{subordinateBranch} v2.park_branch_company_id in
</if> <foreach collection="companyIds" item="id" open="(" separator="," close=")">
<if test="parkBranchCompanyId != null"> #{id}
and v2.park_branch_company_id = #{parkBranchCompanyId} </foreach>
</if>
<if test="zoneId !=null">
and bc2.zone_id = #{zoneId}
</if> </if>
</where> </where>
</select> </select>
......
...@@ -50,14 +50,11 @@ ...@@ -50,14 +50,11 @@
<if test="status != null"> <if test="status != null">
and v.status = #{status} and v.status = #{status}
</if> </if>
<if test="subordinateBranch != null"> <if test="companyIds != null and companyIds.size > 0">
and v.subordinate_branch = #{subordinateBranch} v.park_branch_company_id in
</if> <foreach collection="companyIds" item="id" open="(" separator="," close=")">
<if test="parkBranchCompanyId != null"> #{id}
and v.park_branch_company_id = #{parkBranchCompanyId} </foreach>
</if>
<if test="zoneId !=null">
and bc2.zone_id = #{zoneId}
</if> </if>
</where> </where>
</select> </select>
......
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