Commit 48358682 authored by 周健威's avatar 周健威

Merge branch 'base-modify' into dev

parents 0720af48 67920f16
...@@ -41,6 +41,7 @@ import org.springframework.stereotype.Service; ...@@ -41,6 +41,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.TimeZone; import java.util.TimeZone;
...@@ -169,7 +170,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> { ...@@ -169,7 +170,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> {
ids.add(Integer.parseInt(orderPageVo.getOrderTourDetail().getTourUserIds())); ids.add(Integer.parseInt(orderPageVo.getOrderTourDetail().getTourUserIds()));
} }
List<AppUserVo> list = userFeign.getByUserIds(ids).getData(); List<AppUserVo> list = userFeign.getByUserIds(ids).getData();
orderPageVo.getOrderTourDetail().setUserVoList(list == null || list.size() <= 0 ? null : list); orderPageVo.getOrderTourDetail().setUserVoList(list == null || list.size() <= 0 ? new ArrayList<>() : list);
} }
//设置保留金 //设置保留金
Map<String, Dictionary> dictionaryMap = thirdFeign.dictionaryGetAll4Map().getData(); Map<String, Dictionary> dictionaryMap = thirdFeign.dictionaryGetAll4Map().getData();
...@@ -259,7 +260,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> { ...@@ -259,7 +260,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> {
ids.add(Integer.parseInt(orderPageVo.getOrderTourDetail().getTourUserIds())); ids.add(Integer.parseInt(orderPageVo.getOrderTourDetail().getTourUserIds()));
} }
List<AppUserVo> list = userFeign.getByUserIds(ids).getData(); List<AppUserVo> list = userFeign.getByUserIds(ids).getData();
orderPageVo.getOrderTourDetail().setUserVoList(list == null || list.size() <= 0 ? null : list); orderPageVo.getOrderTourDetail().setUserVoList(list == null || list.size() <= 0 ? new ArrayList<>() : list);
} }
//设置保留金 //设置保留金
Map<String, Dictionary> dictionaryMap = thirdFeign.dictionaryGetAll4Map().getData(); Map<String, Dictionary> dictionaryMap = thirdFeign.dictionaryGetAll4Map().getData();
......
...@@ -29,6 +29,7 @@ public enum ResCode { ...@@ -29,6 +29,7 @@ public enum ResCode {
VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE(104003,"车辆未出车"), VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE(104003,"车辆未出车"),
VEHICLE_BOOK_RECORD_IS_NOT_EXIST(104004, "预约记录不存在"), VEHICLE_BOOK_RECORD_IS_NOT_EXIST(104004, "预约记录不存在"),
VEHICLE_UNBOOK_FAIL(104005, "取消预定失败!"),
BRANCH_COMPANY_UNEXIST(105001, "分公司信息不存在"), BRANCH_COMPANY_UNEXIST(105001, "分公司信息不存在"),
BRANCH_COMPANY_STOCK_EXISTED(105002, "分公司股权信息已存在"), BRANCH_COMPANY_STOCK_EXISTED(105002, "分公司股权信息已存在"),
......
...@@ -103,4 +103,9 @@ public class BookVehicleVO { ...@@ -103,4 +103,9 @@ public class BookVehicleVO {
private String upkeepIds; private String upkeepIds;
private String orderNo; private String orderNo;
/**
* 订单状态
*/
private Integer status;
} }
\ No newline at end of file
...@@ -14,9 +14,6 @@ public class CompanyDetail extends BranchCompany { ...@@ -14,9 +14,6 @@ public class CompanyDetail extends BranchCompany {
StringBuilder detailAddrStr = new StringBuilder(""); StringBuilder detailAddrStr = new StringBuilder("");
if(null != this.getSysRegions() && this.getSysRegions().size() > 0) { if(null != this.getSysRegions() && this.getSysRegions().size() > 0) {
for(SysRegion sysRegion : this.getSysRegions()) { for(SysRegion sysRegion : this.getSysRegions()) {
// if(0 != detailAddrStr.length()) {
//
// }
String name = sysRegion.getName() String name = sysRegion.getName()
.replace("省", "") .replace("省", "")
.replace("市", "") .replace("市", "")
...@@ -27,7 +24,9 @@ public class CompanyDetail extends BranchCompany { ...@@ -27,7 +24,9 @@ public class CompanyDetail extends BranchCompany {
} }
} }
} }
if(this.getAddrDetail().contains(detailAddrStr)) {
return this.getAddrDetail();
}
detailAddrStr.append(this.getAddrDetail()); detailAddrStr.append(this.getAddrDetail());
return detailAddrStr.toString(); return detailAddrStr.toString();
} }
......
...@@ -29,4 +29,6 @@ public class QueryVehicleWarningMsgVo { ...@@ -29,4 +29,6 @@ public class QueryVehicleWarningMsgVo {
private Integer page; private Integer page;
private Integer limit; private Integer limit;
private Integer colorType;
} }
...@@ -56,7 +56,7 @@ public class VehicleActiveService { ...@@ -56,7 +56,7 @@ public class VehicleActiveService {
ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getCode()); ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getCode());
} }
if (!vehicle.getStatus().equals(VehicleStatus.NORMAL.getCode())) { if (!vehicle.getStatus().equals(VehicleStatus.NORMAL.getCode())) {
throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_DISABLE.getDesc(), throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_DISABLE.getDesc() + ", 车辆状态是:" + getVehicleStatus(vehicle.getStatus(), vehicle.getId()),
ResCode.VEHICLE_DEPARTURE_VEHICLE_DISABLE.getCode()); ResCode.VEHICLE_DEPARTURE_VEHICLE_DISABLE.getCode());
} }
Integer MileageLift=vehicle.getMileageLastUpdate(); Integer MileageLift=vehicle.getMileageLastUpdate();
...@@ -75,8 +75,8 @@ public class VehicleActiveService { ...@@ -75,8 +75,8 @@ public class VehicleActiveService {
int result = vehicleMapper.updateStatusByIdAndStatus(departureVo.getVehicleId(), VehicleStatus.DEPARTURE.getCode(), int result = vehicleMapper.updateStatusByIdAndStatus(departureVo.getVehicleId(), VehicleStatus.DEPARTURE.getCode(),
VehicleStatus.NORMAL.getCode()); VehicleStatus.NORMAL.getCode());
if (result == 0) { if (!vehicle.getStatus().equals(VehicleStatus.NORMAL.getCode())) {
throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_DISABLE.getDesc(), throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_DISABLE.getDesc() + ", 车辆状态是:" + getVehicleStatus(vehicle.getStatus(), vehicle.getId()),
ResCode.VEHICLE_DEPARTURE_VEHICLE_DISABLE.getCode()); ResCode.VEHICLE_DEPARTURE_VEHICLE_DISABLE.getCode());
} }
//修改预约记录状态 //修改预约记录状态
...@@ -117,10 +117,35 @@ public class VehicleActiveService { ...@@ -117,10 +117,35 @@ public class VehicleActiveService {
throw new BaseException(ResCode.VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED.getDesc(), throw new BaseException(ResCode.VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED.getDesc(),
ResCode.VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED.getCode()); ResCode.VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED.getCode());
} }
}
public String getVehicleStatus(Integer status, String vehicleId) {
StringBuilder stringBuilder = new StringBuilder();
switch (status) {
case 1:
stringBuilder.append("正常运行");
break;
case 2:
stringBuilder.append("维修");
break;
case 3:
stringBuilder.append("报废");
break;
case 4:
stringBuilder.append("出车");
break;
case 5:
stringBuilder.append("保养");
break;
}
List<VehicleBookRecordVo> vehicleBookRecordVos = vehicleBookRecordBiz.selectByVehicleId(vehicleId);
if(vehicleBookRecordVos != null && vehicleBookRecordVos.size() > 0) {
stringBuilder.append("中,使用人:");
stringBuilder.append(vehicleBookRecordVos.get(0).getVehicleUsername());
stringBuilder.append(" 使用人电话:");
stringBuilder.append(vehicleBookRecordVos.get(0).getVehicleUserPhone());
}
return stringBuilder.toString();
} }
@Transactional @Transactional
...@@ -131,7 +156,7 @@ public class VehicleActiveService { ...@@ -131,7 +156,7 @@ public class VehicleActiveService {
ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getCode()); ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getCode());
} }
if (!vehicle.getStatus().equals(VehicleStatus.DEPARTURE.getCode())) { if (!vehicle.getStatus().equals(VehicleStatus.DEPARTURE.getCode())) {
throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getDesc(), throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getDesc() + ", 车辆状态是:" + getVehicleStatus(vehicle.getStatus(), vehicle.getId()),
ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getCode()); ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getCode());
} }
Integer Mileagerest = vehicle.getMileageLastUpdate(); Integer Mileagerest = vehicle.getMileageLastUpdate();
......
...@@ -31,7 +31,7 @@ public class VehicleBookHourInfoBiz extends BaseBiz<VehicleBookHourInfoMapper, V ...@@ -31,7 +31,7 @@ public class VehicleBookHourInfoBiz extends BaseBiz<VehicleBookHourInfoMapper, V
public static final DateTimeFormatter DEFAULT_DATE_TIME_FORMATTER = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss"); public static final DateTimeFormatter DEFAULT_DATE_TIME_FORMATTER = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");
public static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormat.forPattern("yyyy-MM-dd"); public static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormat.forPattern("yyyy-MM-dd");
public static Map<String, Integer> getPredictableHours(String bookStartDate, String bookEndDate) { public Map<String, Integer> getPredictableHours(String bookStartDate, String bookEndDate) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date startDate = null; Date startDate = null;
Date endDate = null; Date endDate = null;
...@@ -68,12 +68,14 @@ public class VehicleBookHourInfoBiz extends BaseBiz<VehicleBookHourInfoMapper, V ...@@ -68,12 +68,14 @@ public class VehicleBookHourInfoBiz extends BaseBiz<VehicleBookHourInfoMapper, V
endPredictableHour |= 1 << (curentHour); endPredictableHour |= 1 << (curentHour);
} }
} }
if(DateTime.parse(bookStartDate, DEFAULT_DATE_TIME_FORMATTER).toString(DATE_TIME_FORMATTER).equals(DateTime.parse(bookEndDate, DEFAULT_DATE_TIME_FORMATTER).toString(DATE_TIME_FORMATTER))) {//同一天预定
predictableHours.put(DateTime.parse(bookStartDate, DEFAULT_DATE_TIME_FORMATTER).toString(DATE_TIME_FORMATTER), startPredictableHour); predictableHours.put(DateTime.parse(bookStartDate, DEFAULT_DATE_TIME_FORMATTER).toString(DATE_TIME_FORMATTER), startPredictableHour & endPredictableHour);
predictableHours.put(DateTime.parse(bookEndDate, DEFAULT_DATE_TIME_FORMATTER).toString(DATE_TIME_FORMATTER), endPredictableHour); } else {
predictableHours.put(DateTime.parse(bookStartDate, DEFAULT_DATE_TIME_FORMATTER).toString(DATE_TIME_FORMATTER), startPredictableHour);
predictableHours.put(DateTime.parse(bookEndDate, DEFAULT_DATE_TIME_FORMATTER).toString(DATE_TIME_FORMATTER), endPredictableHour);
}
DateTime startDay = DateTime.parse(DateTime.parse(bookStartDate, DEFAULT_DATE_TIME_FORMATTER).toString(DATE_TIME_FORMATTER), DATE_TIME_FORMATTER); DateTime startDay = DateTime.parse(DateTime.parse(bookStartDate, DEFAULT_DATE_TIME_FORMATTER).toString(DATE_TIME_FORMATTER), DATE_TIME_FORMATTER);
DateTime endDay = DateTime.parse(DateTime.parse(bookEndDate, DEFAULT_DATE_TIME_FORMATTER).toString(DATE_TIME_FORMATTER), DATE_TIME_FORMATTER); DateTime endDay = DateTime.parse(DateTime.parse(bookEndDate, DEFAULT_DATE_TIME_FORMATTER).toString(DATE_TIME_FORMATTER), DATE_TIME_FORMATTER);
if(endDay.getDayOfMonth() - startDay.getDayOfMonth() >1){ // if(endDay.getDayOfMonth() - startDay.getDayOfMonth() >1){ //
for (DateTime curDate = startDay.plusDays(1); curDate.compareTo(endDay) < 0; curDate = curDate.plusDays(1)) { for (DateTime curDate = startDay.plusDays(1); curDate.compareTo(endDay) < 0; curDate = curDate.plusDays(1)) {
String curDateStr = curDate.toString(DATE_TIME_FORMATTER); String curDateStr = curDate.toString(DATE_TIME_FORMATTER);
...@@ -143,18 +145,9 @@ public class VehicleBookHourInfoBiz extends BaseBiz<VehicleBookHourInfoMapper, V ...@@ -143,18 +145,9 @@ public class VehicleBookHourInfoBiz extends BaseBiz<VehicleBookHourInfoMapper, V
} }
public static void main(String[] args) throws Exception{ public static void main(String[] args) throws Exception{
String result = Integer.toBinaryString(16777200); int b = 16744448;
String newString = new StringBuilder(result).reverse().toString(); Integer a = b | 31;
int i=newString.length()-result.replace("1", "").length(); System.out.println(a);
System.out.println(i);
Map<String, Integer> map = getPredictableHours("2019-07-28 00:00:00","2019-07-29 00:00:00");
for (Map.Entry<String, Integer> entry : map.entrySet()) {
log.info(entry.getKey());
log.info(entry.getValue() + "");
}
} }
} }
...@@ -299,7 +299,9 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic ...@@ -299,7 +299,9 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic
return PageDataVO.pageInfo(vehiclePageInfo); return PageDataVO.pageInfo(vehiclePageInfo);
} }
public List<VehicleBookRecordVo> selectByVehicleId(String vehicleId) {
return mapper.selectByVehicleId(vehicleId);
}
/** /**
......
...@@ -30,7 +30,7 @@ public interface VehicleBookRecordMapper extends Mapper<VehicleBookRecord> { ...@@ -30,7 +30,7 @@ public interface VehicleBookRecordMapper extends Mapper<VehicleBookRecord> {
public List<VehicleRecordInfoVo> getByParam(Map<String, Object> params); public List<VehicleRecordInfoVo> getByParam(Map<String, Object> params);
public List<VehicleBookRecord> getByVehicleId(String vehicleId); public List<VehicleBookRecordVo> selectByVehicleId(String vehicleId);
public List<VehicleBookRecordVo> getBookRecord(VehicleBookRecordQueryVo vehicleBookRecordQueryVo); public List<VehicleBookRecordVo> getBookRecord(VehicleBookRecordQueryVo vehicleBookRecordQueryVo);
......
...@@ -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");
...@@ -213,6 +218,7 @@ public class VehicleController extends BaseController<VehicleBiz> { ...@@ -213,6 +218,7 @@ public class VehicleController extends BaseController<VehicleBiz> {
public RestResponse<Integer> applyVehicle(@RequestBody BookVehicleVO bookVehicleVo) throws Exception { public RestResponse<Integer> applyVehicle(@RequestBody BookVehicleVO bookVehicleVo) throws Exception {
Integer operatorId = Integer.parseInt(BaseContextHandler.getUserID()); Integer operatorId = Integer.parseInt(BaseContextHandler.getUserID());
String userName = BaseContextHandler.getName(); String userName = BaseContextHandler.getName();
bookVehicleVo.setStatus(VehicleBookRecordStatus.APPLY.getCode());
baseBiz.applyVehicle(operatorId, bookVehicleVo, userName); baseBiz.applyVehicle(operatorId, bookVehicleVo, userName);
return RestResponse.suc(); return RestResponse.suc();
} }
...@@ -228,7 +234,8 @@ public class VehicleController extends BaseController<VehicleBiz> { ...@@ -228,7 +234,8 @@ public class VehicleController extends BaseController<VehicleBiz> {
public RestResponse<Integer> applyForVehicle(@RequestBody BookVehicleVO bookVehicleVo) throws Exception { public RestResponse<Integer> applyForVehicle(@RequestBody BookVehicleVO bookVehicleVo) throws Exception {
Integer operatorId = Integer.parseInt(BaseContextHandler.getUserID()); Integer operatorId = Integer.parseInt(BaseContextHandler.getUserID());
String userName = BaseContextHandler.getName(); String userName = BaseContextHandler.getName();
baseBiz.applyForVehicle(operatorId, bookVehicleVo, userName); bookVehicleVo.setStatus(VehicleBookRecordStatus.APPLY.getCode());
baseBiz.applyVehicle(operatorId, bookVehicleVo, userName);
return RestResponse.suc(); return RestResponse.suc();
} }
...@@ -450,6 +457,34 @@ public class VehicleController extends BaseController<VehicleBiz> { ...@@ -450,6 +457,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);
//获取警告信息 //获取警告信息
......
...@@ -367,11 +367,9 @@ ...@@ -367,11 +367,9 @@
</select> </select>
<select id="getByVehicleId" parameterType="java.lang.String" <select id="getByVehicleId" parameterType="java.lang.String"
resultType="com.xxfc.platform.vehicle.pojo.VehicleBookRecordVo"> resultType="com.xxfc.platform.vehicle.pojo.VehicleBookRecordVo">
SELECT v1.*, conv(v2.booked_hour,10,2) startHour,conv(v3.booked_hour,10,2) endHour,bc2.name retCompanyName from vehicle_book_record v1 SELECT v1.*,bc2.name retCompanyName from vehicle_book_record v1
LEFT JOIN vehicle_book_hour_info v2 on v2.book_record_id = v1.id and YEAR(v2.year_month_day) = YEAR(v1.book_start_date) AND MONTH(v2.year_month_day) = MONTH(v1.book_start_date) AND DAY(v2.year_month_day) =DAY(v1.book_start_date) LEFT JOIN branch_company bc2 on v1.ret_company = bc2.id
LEFT JOIN vehicle_book_hour_info v3 on v3.book_record_id = v1.id and YEAR(v3.year_month_day) = YEAR(v1.book_end_date) AND MONTH(v3.year_month_day) = MONTH(v1.book_end_date) AND DAY(v3.year_month_day) =DAY(v1.book_end_date) where v1.vehicle_id = #{vehicleId} and v1.status BETWEEN 1 and 2
LEFT JOIN branch_company bc2 on v1.ret_company = bc2.id
where v1.vehicle_id = #{vehicleId} and v1.status BETWEEN 1 and 2 and v1.book_end_date
</select> </select>
<select id="getByParam" parameterType="java.util.Map" resultMap="getVehicleMap"> <select id="getByParam" parameterType="java.util.Map" resultMap="getVehicleMap">
select v1.* from vehicle_book_record v1 select v1.* from vehicle_book_record v1
......
...@@ -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}
...@@ -397,7 +397,7 @@ ...@@ -397,7 +397,7 @@
select v1.*,bc3.name parkCompanyName from vehicle v1 select v1.*,bc3.name parkCompanyName from vehicle v1
LEFT JOIN branch_company bc3 ON v1.park_branch_company_id = bc3.id LEFT JOIN branch_company bc3 ON v1.park_branch_company_id = bc3.id
<where> <where>
<if test="numberPlate != null"> <if test="numberPlate != null and numberPlate != ''">
and v1.number_plate = #{numberPlate} and v1.number_plate = #{numberPlate}
</if> </if>
<if test="companyIds != null and companyIds.size > 0"> <if test="companyIds != null and companyIds.size > 0">
...@@ -455,20 +455,17 @@ ...@@ -455,20 +455,17 @@
<if test="startTime != null"> <if test="startTime != null">
and v1.create_time between #{startTime} and #{endTime} and v1.create_time between #{startTime} and #{endTime}
</if> </if>
<if test="numberPlate != null"> <if test="numberPlate != null and numberPlate != ''">
and v1.number_plate = #{numberPlate} and v1.number_plate = #{numberPlate}
</if> </if>
<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
...@@ -480,20 +477,17 @@ ...@@ -480,20 +477,17 @@
<if test="startTime != null"> <if test="startTime != null">
and v2.create_time between #{startTime} and #{endTime} and v2.create_time between #{startTime} and #{endTime}
</if> </if>
<if test="numberPlate != null"> <if test="numberPlate != null and numberPlate != ''">
and v2.number_plate = #{numberPlate} and v2.number_plate = #{numberPlate}
</if> </if>
<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>
......
...@@ -44,20 +44,17 @@ ...@@ -44,20 +44,17 @@
<if test="startTime != null"> <if test="startTime != null">
and w.create_time between #{startTime} and #{endTime} and w.create_time between #{startTime} and #{endTime}
</if> </if>
<if test="numberPlate != null"> <if test="numberPlate != null and numberPlate != ''">
and v.number_plate = #{numberPlate} and v.number_plate = #{numberPlate}
</if> </if>
<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>
...@@ -76,6 +73,12 @@ ...@@ -76,6 +73,12 @@
<if test="numberPlate != null and numberPlate != '' "> <if test="numberPlate != null and numberPlate != '' ">
and number_plate = #{numberPlate} and number_plate = #{numberPlate}
</if> </if>
<if test="type != null">
and type = #{type}
</if>
<if test="colorType != null">
and color_type = #{colorType}
</if>
</select> </select>
</mapper> </mapper>
\ No newline at end of file
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