Commit 56b4b783 authored by libin's avatar libin

Merge branch 'order_received_statistics' into dev

# Conflicts:
#	xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/constant/DictionaryKey.java
#	xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/biz/DictionaryBiz.java
#	xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBookRecordBiz.java
#	xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleDepartureService.java
#	xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/mapper/VehicleDepartureLogMapper.java
#	xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleDepartureController.java
#	xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleDepartureLogMapper.xml
parents 82294f58 7c4fcab7
......@@ -16,7 +16,7 @@ public enum BookType {
BOOKING(7,"预约中"),
DISABLE(8,"禁用"),
CUSTOMER_APPLY(9, "客户用车"),
OTHER(10, "其他"),
OTHER(10, "其他"),
DISPATCH(11, "调度")
;
/**
......
......@@ -225,7 +225,7 @@ public class BranchCompanyStockService {
//文件存放路径
String filePath = baseUploadPath + realFileRelPath;
//将文件写入指定位置
// FileUtils.copyInputStreamToFile(file.getInputStream(), new File(filePath));
FileUtils.copyInputStreamToFile(file.getInputStream(), new File(filePath));
return RestResponse.suc(realFileRelPath);
}
......
......@@ -176,7 +176,7 @@ public class CampsiteBiz extends BaseBiz<CampsiteMapper, Campsite> {
//文件存放路径
String filePath = baseUploadPath + realFileRelPath;
//将文件写入指定位置
// FileUtils.copyInputStreamToFile(file.getInputStream(), new File(filePath));
FileUtils.copyInputStreamToFile(file.getInputStream(), new File(filePath));
return RestResponse.suc(realFileRelPath);
}
......
......@@ -249,7 +249,7 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic
}
if (vehicleBookRecordVo.getBookUser() != null) {
UserDTO userDTO = userFeign.userinfoByUid(vehicleBookRecordVo.getBookUser()).getData();
if(userDTO != null) {
if (userDTO != null) {
BranchCompany branchCompany = branchCompanyBiz.getById(userDTO.getCompanyId());
if (branchCompany != null) {
vehicleBookRecordVo.setUserCompanyName(branchCompany.getName());
......
......@@ -201,7 +201,7 @@ public class BranchCompanyController extends BaseController<BranchCompanyBiz> {
}
@GetMapping("/findByAreaId")
public List<Integer> findCompanyIdsByAreaId(@RequestParam(value = "areaId",required = false) Integer areaId){
public List<Integer> findCompanyIdsByAreaId(@RequestParam(value = "areaId") Integer areaId){
return baseBiz.selectCompanyIdsByAreaId(areaId);
}
......
......@@ -618,10 +618,4 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
public List<String> findbyPlateNumberAndVehicleCod(@RequestParam(value = "plateNumber",required = false) String plateNumber,@RequestParam(value = "vehicleCode",required = false) String vehicleCode){
return vehicleBiz.findbyPlateNumberAndVehicleCod(plateNumber,vehicleCode);
}
@GetMapping("/app/unauth/findDictionaryMaps")
@IgnoreUserToken
public ObjectRestResponse findbyDictionaryMaps(@RequestParam(value = "plateNumber",required = false) String plateNumber,@RequestParam(value = "vehicleCode",required = false) String vehicleCode){
return vehicleBookRecordBiz.getOrderDetail();
}
}
......@@ -9,6 +9,8 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.order.pojo.order.OrderPageVO;
import com.xxfc.platform.universal.entity.Dictionary;
import com.xxfc.platform.universal.feign.ThirdFeign;
import com.xxfc.platform.order.pojo.order.OrderPageVO;
import com.xxfc.platform.universal.entity.Dictionary;
import com.xxfc.platform.vehicle.biz.VehicleBiz;
import com.xxfc.platform.vehicle.biz.VehicleDepartureService;
import com.xxfc.platform.vehicle.common.RestResponse;
......@@ -20,6 +22,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
import java.util.Map;
import static com.xxfc.platform.universal.constant.DictionaryKey.RESERVE;
import static com.xxfc.platform.universal.constant.DictionaryKey.VEHICE_ORDER;
......
......@@ -88,21 +88,15 @@
<select id="selectVoAll" resultMap="searchBookRecord">
select vehicle_departure_log.*,vehicle.number_plate,bc2.actual_end_date,bc2.actual_start_date,bc2.book_start_date,bc2.book_end_date,
/* IFNULL(DATEDIFF(vehicle_departure_log.arrival_time,vehicle_departure_log.departure_time),0)*/
CONCAT(IFNULL(floor((unix_timestamp(vehicle_departure_log.arrival_time) -
unix_timestamp(vehicle_departure_log.departure_time)) / 86400),0),'天',
IFNULL(floor(IF((unix_timestamp(vehicle_departure_log.arrival_time) -
unix_timestamp(vehicle_departure_log.departure_time))>86400,(unix_timestamp(vehicle_departure_log.arrival_time)
- unix_timestamp(vehicle_departure_log.departure_time)) MOD
86400/3600,(unix_timestamp(vehicle_departure_log.arrival_time) -
unix_timestamp(vehicle_departure_log.departure_time))/3600)),0),'小时')
CONCAT(IFNULL(floor((unix_timestamp(vehicle_departure_log.arrival_time) - unix_timestamp(vehicle_departure_log.departure_time)) / 86400),0),'天',
IFNULL(floor(IF((unix_timestamp(vehicle_departure_log.arrival_time) - unix_timestamp(vehicle_departure_log.departure_time))>86400,(unix_timestamp(vehicle_departure_log.arrival_time)
- unix_timestamp(vehicle_departure_log.departure_time)) MOD 86400/3600,(unix_timestamp(vehicle_departure_log.arrival_time) - unix_timestamp(vehicle_departure_log.departure_time))/3600)),0),'小时')
as departureDay,bc.name as departureName,bc1.name as arrivalName,
IF((IFNULL(vehicle_departure_log.mileage_end,0)-IFNULL(vehicle_departure_log.mileage_start,0))>0,IFNULL(vehicle_departure_log.mileage_end,0)-IFNULL(vehicle_departure_log.mileage_start,0),0)
as mileage
IF((IFNULL(vehicle_departure_log.mileage_end,0)-IFNULL(vehicle_departure_log.mileage_start,0))>0,IFNULL(vehicle_departure_log.mileage_end,0)-IFNULL(vehicle_departure_log.mileage_start,0),0) as mileage
from vehicle_departure_log
left join vehicle on vehicle_departure_log.vehicle_id = vehicle.id
LEFT JOIN branch_company bc ON vehicle_departure_log.departure_branch_company_id = bc.id
LEFT JOIN branch_company bc1 ON vehicle_departure_log.arrival_branch_company_id = bc1.id
LEFT JOIN vehicle_book_record bc2 ON vehicle_departure_log.book_record_id = bc2.id
<trim prefix="where">
1=1
<if test="numberPlate != null and numberPlate != ''">
......@@ -113,44 +107,32 @@
vehicle_departure_log.departure_time &gt;= str_to_date(#{startTime}, '%Y-%m-%d %H')
</if>
<if test="endTime != null and endTime != ''">
and vehicle_departure_log.arrival_time &gt;= str_to_date(#{endTime}, '%Y-%m-%d %H')
and vehicle_departure_log.arrival_time &gt;= str_to_date(#{endTime}, '%Y-%m-%d %H')
</if>
<if test="code!=null">
and vehicle.code=#{code}
and vehicle.code=#{code}
</if>
<if test="zoneId!=null">
and bc.zone_id=#{zoneId}
and bc.zone_id=#{zoneId}
</if>
<if test="departureId!=null">
and vehicle_departure_log.departure_branch_company_id=#{departureId}
</if>
<if test="use!=null">
and bc2.book_type=#{use}
</if>
<if test="arrivalBranchCompanyId!=null">
and vehicle_departure_log.arrival_branch_company_id=#{arrivalBranchCompanyId}
and vehicle_departure_log.departure_branch_company_id=#{departureId}
</if>
</trim>
order by create_time desc
</select>
<select id="selectVoAllNotAllData" resultMap="searchBookRecord">
select vehicle_departure_log.*,vehicle.number_plate,bc2.actual_end_date,bc2.actual_start_date,bc2.book_start_date,bc2.book_end_date,
<select id="selectVoAllNotAllData" resultType="com.xxfc.platform.vehicle.pojo.VehicleDepartureLogVo">
select vehicle_departure_log.*,vehicle.number_plate,
/*IFNULL(DATEDIFF(vehicle_departure_log.arrival_time,vehicle_departure_log.departure_time),0)*/
CONCAT(IFNULL(floor((unix_timestamp(vehicle_departure_log.arrival_time) -
unix_timestamp(vehicle_departure_log.departure_time)) / 86400),0),'天',
IFNULL(floor(IF((unix_timestamp(vehicle_departure_log.arrival_time) -
unix_timestamp(vehicle_departure_log.departure_time))>86400,(unix_timestamp(vehicle_departure_log.arrival_time)
- unix_timestamp(vehicle_departure_log.departure_time)) MOD
86400/3600,(unix_timestamp(vehicle_departure_log.arrival_time) -
unix_timestamp(vehicle_departure_log.departure_time))/3600)),0),'小时')
CONCAT(IFNULL(floor((unix_timestamp(vehicle_departure_log.arrival_time) - unix_timestamp(vehicle_departure_log.departure_time)) / 86400),0),'天',
IFNULL(floor(IF((unix_timestamp(vehicle_departure_log.arrival_time) - unix_timestamp(vehicle_departure_log.departure_time))>86400,(unix_timestamp(vehicle_departure_log.arrival_time)
- unix_timestamp(vehicle_departure_log.departure_time)) MOD 86400/3600,(unix_timestamp(vehicle_departure_log.arrival_time) - unix_timestamp(vehicle_departure_log.departure_time))/3600)),0),'小时')
as departureDay,bc.name as departureName,bc1.name as arrivalName,
IF((IFNULL(vehicle_departure_log.mileage_end,0)-IFNULL(vehicle_departure_log.mileage_start,0))>0,IFNULL(vehicle_departure_log.mileage_end,0)-IFNULL(vehicle_departure_log.mileage_start,0),0)
as mileage
IF((IFNULL(vehicle_departure_log.mileage_end,0)-IFNULL(vehicle_departure_log.mileage_start,0))>0,IFNULL(vehicle_departure_log.mileage_end,0)-IFNULL(vehicle_departure_log.mileage_start,0),0) as mileage
from vehicle_departure_log
left join vehicle on vehicle_departure_log.vehicle_id = vehicle.id
LEFT JOIN branch_company bc ON vehicle_departure_log.departure_branch_company_id = bc.id
LEFT JOIN branch_company bc1 ON vehicle_departure_log.arrival_branch_company_id = bc1.id
LEFT JOIN vehicle_book_record bc2 ON vehicle_departure_log.book_record_id = bc2.id
<trim prefix="where" suffixOverrides="and">
<if test="numberPlate != null and numberPlate != ''">
vehicle.number_plate = #{numberPlate} and
......@@ -180,24 +162,18 @@
</if>
<if test="endTime != null and endTime != ''">
and vehicle_departure_log.arrival_time >= str_to_date(#{endTime}, '%Y-%m-%d %H')
and vehicle_departure_log.arrival_time >= str_to_date(#{endTime}, '%Y-%m-%d %H')
or TO_DAYS(vehicle_departure_log.arrival_time)=TO_DAYS(str_to_date(#{endTime}, '%Y-%m-%d %H'))
or vehicle_departure_log.arrival_time is null
</if>
<if test="code!=null">
and vehicle.code=#{code}
and vehicle.code=#{code}
</if>
<if test="zoneId!=null">
and bc.zone_id=#{zoneId}
and bc.zone_id=#{zoneId}
</if>
<if test="departureId!=null">
and vehicle_departure_log.departure_branch_company_id=#{departureId}
</if>
<if test="use!=null">
and bc2.book_type=#{use}
</if>
<if test="arrivalBranchCompanyId!=null">
and vehicle_departure_log.arrival_branch_company_id=#{arrivalBranchCompanyId}
and vehicle_departure_log.departure_branch_company_id=#{departureId}
</if>
</trim>
order by create_time desc
......
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