Commit 205bcdf6 authored by jiaorz's avatar jiaorz

修改出车修改车辆停靠公司bug,添加车辆编号

parent 382fb61b
...@@ -33,7 +33,11 @@ public class VehicleBookRecordVo extends VehicleBookRecord { ...@@ -33,7 +33,11 @@ public class VehicleBookRecordVo extends VehicleBookRecord {
private Integer liftStatus; private Integer liftStatus;
private Integer retStatus; private Integer retStatus;
private Integer state; private Integer state;
private Integer code;
List<VehicleUpkeepItem> vehicleUpkeepItems; List<VehicleUpkeepItem> vehicleUpkeepItems;
} }
...@@ -192,10 +192,15 @@ public class VehicleActiveService { ...@@ -192,10 +192,15 @@ public class VehicleActiveService {
ResCode.VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED.getCode()); ResCode.VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED.getCode());
} }
if (Mileagerest != null && Mileagerest1 >= Mileagerest) { if (Mileagerest != null && Mileagerest1 >= Mileagerest) {
VehicleBookRecord vehicleBookRecord = null;
if(arrivalVo.getBookRecordId() != null) {
vehicleBookRecord = vehicleBookRecordBiz.selectById(arrivalVo.getBookRecordId());
updateBookRecordStatus(vehicleBookRecord, 2);
}
// 写入车辆公里数,还车分公司id // 写入车辆公里数,还车分公司id
vehicle.setMileageLastUpdate(Mileagerest1); vehicle.setMileageLastUpdate(Mileagerest1);
vehicle.setParkBranchCompanyId(arrivalVo.getArrivalBranchCompanyId()); vehicle.setParkBranchCompanyId(vehicleBookRecord.getRetCompany());
vehicle.setExpectDestinationBranchCompanyId(0); vehicle.setExpectDestinationBranchCompanyId(0);
vehicleMapper.updateByPrimaryKeySelective(vehicle); vehicleMapper.updateByPrimaryKeySelective(vehicle);
...@@ -206,11 +211,6 @@ public class VehicleActiveService { ...@@ -206,11 +211,6 @@ public class VehicleActiveService {
throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getDesc(), throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getDesc(),
ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getCode()); ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getCode());
} }
VehicleBookRecord vehicleBookRecord = null;
if(arrivalVo.getBookRecordId() != null) {
vehicleBookRecord = vehicleBookRecordBiz.selectById(arrivalVo.getBookRecordId());
updateBookRecordStatus(vehicleBookRecord, 2);
}
// 出车记录 // 出车记录
......
...@@ -400,7 +400,7 @@ ...@@ -400,7 +400,7 @@
parameterType="com.xxfc.platform.vehicle.pojo.VehicleBookRecordQueryVo"> parameterType="com.xxfc.platform.vehicle.pojo.VehicleBookRecordQueryVo">
select bc3.name parkCompanyName,bc4.name subordinateBranchName, conv(v4.booked_hour,10,2) select bc3.name parkCompanyName,bc4.name subordinateBranchName, conv(v4.booked_hour,10,2)
startHour,conv(v5.booked_hour,10,2) endHour, bc1.`name` lift_company_name, bc2.`name` ret_company_name, startHour,conv(v5.booked_hour,10,2) endHour, bc1.`name` lift_company_name, bc2.`name` ret_company_name,
v3.number_plate,v1.* v3.number_plate,v1.*,v3.code
from vehicle_book_record v1 from vehicle_book_record v1
LEFT JOIN vehicle_book_hour_info v4 on v4.book_record_id = v1.id and YEAR(v4.year_month_day) = LEFT JOIN vehicle_book_hour_info v4 on v4.book_record_id = v1.id and YEAR(v4.year_month_day) =
YEAR(v1.book_start_date) AND MONTH(v4.year_month_day) = MONTH(v1.book_start_date) AND DAY(v4.year_month_day) YEAR(v1.book_start_date) AND MONTH(v4.year_month_day) = MONTH(v1.book_start_date) AND DAY(v4.year_month_day)
...@@ -421,6 +421,9 @@ ...@@ -421,6 +421,9 @@
<if test="numberPlate != null"> <if test="numberPlate != null">
and v3.number_plate = #{numberPlate} and v3.number_plate = #{numberPlate}
</if> </if>
<if test="code != null">
and v3.code = #{code}
</if>
<if test="bookType != null"> <if test="bookType != null">
and v1.book_type = #{bookType} and v1.book_type = #{bookType}
</if> </if>
...@@ -444,7 +447,7 @@ ...@@ -444,7 +447,7 @@
<select id="getBookRecordInfo" resultMap="searchBookRecord" parameterType="java.util.Map"> <select id="getBookRecordInfo" resultMap="searchBookRecord" parameterType="java.util.Map">
select (CASE v1.lift_company WHEN #{userCompany} THEN 1 ELSE 0 end) liftStatus,(CASE v1.ret_company WHEN select (CASE v1.lift_company WHEN #{userCompany} THEN 1 ELSE 0 end) liftStatus,(CASE v1.ret_company WHEN
#{userCompany} THEN 1 ELSE 0 end) retStatus,bc4.name subordinateBranchName, bc1.`name` lift_company_name, #{userCompany} THEN 1 ELSE 0 end) retStatus,bc4.name subordinateBranchName, bc1.`name` lift_company_name,
bc2.`name` ret_company_name, v3.number_plate,v1.* bc2.`name` ret_company_name, v3.number_plate,v1.*,v3.code
from vehicle_book_record v1 from vehicle_book_record v1
LEFT JOIN branch_company bc1 ON v1.lift_company = bc1.id LEFT JOIN branch_company bc1 ON v1.lift_company = bc1.id
LEFT JOIN branch_company bc2 on v1.ret_company = bc2.id LEFT JOIN branch_company bc2 on v1.ret_company = bc2.id
...@@ -482,6 +485,9 @@ ...@@ -482,6 +485,9 @@
<if test="status != null and status == -1 "> <if test="status != null and status == -1 ">
and v4.state = 1 and v4.state = 1
</if> </if>
<if test="code != null">
and v3.code = #{code}
</if>
and v1.book_user != -2 and v1.book_user != -2
</where> </where>
group by v1.id group by v1.id
......
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