Commit dc7c171f authored by hezhen's avatar hezhen

Merge branch 'dev' of http://113.105.137.151:22280/youjj/cloud-platform into dev

parents 9c7100a2 1c1f1dfa
......@@ -5,6 +5,7 @@ import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.CommonBaseController;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.vehicle.entity.VehicleModel;
import com.xxfc.platform.vehicle.feign.VehicleFeign;
import com.xxfc.platform.vehicle.pojo.VModelDetailVO;
......@@ -52,9 +53,10 @@ public class VehicleModelController extends CommonBaseController {
* @return
*/
@ApiOperation("车型列表")
@PostMapping(value = "/findVehicleModelPage")
@GetMapping(value = "/findVehicleModelPage")
@IgnoreUserToken
public ObjectRestResponse<VehicleModelVo> findVehicleModelPageUnauthfind(@RequestBody VehicleModelQueryCondition vmqc) {
return vehicleFeign.findVehicleModelPageUnauthfind(vmqc);
public ObjectRestResponse<PageDataVO<VehicleModelVo>> findVehicleModelPageUnauthfind(VehicleModelQueryCondition vmqc) {
ObjectRestResponse<PageDataVO<VehicleModelVo>> objectRestResponse = vehicleFeign.findVehicleModelPageUnauthfind(vmqc);
return objectRestResponse;
}
}
......@@ -2,6 +2,7 @@ package com.xxfc.platform.vehicle.feign;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.vo.GoodDataVO;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.entity.*;
import com.xxfc.platform.vehicle.pojo.*;
......@@ -133,5 +134,5 @@ public interface VehicleFeign {
ObjectRestResponse<VModelDetailVO> detailByParam(@RequestParam("vehicleModel") Map<String, Object> vehicleModel);
@PostMapping("/vehicleModel/app/unauth/findVehicleModelPage")
public ObjectRestResponse<VehicleModelVo> findVehicleModelPageUnauthfind(@RequestBody VehicleModelQueryCondition vmqc);
public ObjectRestResponse<PageDataVO<VehicleModelVo>> findVehicleModelPageUnauthfind(@RequestBody VehicleModelQueryCondition vmqc);
}
......@@ -170,14 +170,20 @@ public class VehicleActiveService {
break;
}
List<VehicleBookRecordVo> vehicleBookRecordVos = vehicleBookRecordBiz.selectByVehicleId(vehicleId);
if(vehicleBookRecordVos != null && vehicleBookRecordVos.size() > 0 && vehicleBookRecordVos.get(0).getVehicleDepartureLogVo() != null && vehicleBookRecordVos.get(0).getVehicleDepartureLogVo().getState() != 1) {
stringBuilder.append("中,使用人:");
stringBuilder.append(vehicleBookRecordVos.get(0).getVehicleUsername());
stringBuilder.append(" 使用人电话:");
stringBuilder.append(vehicleBookRecordVos.get(0).getVehicleUserPhone());
} else {
stringBuilder.append(", 请联系管理员修改车辆状态为正常状态");
if(vehicleBookRecordVos != null && vehicleBookRecordVos.size() > 0) {
Iterator<VehicleBookRecordVo> iterator = vehicleBookRecordVos.iterator();
while (iterator.hasNext()) {
VehicleBookRecordVo vehicleBookRecordVo = iterator.next();
if (vehicleBookRecordVo.getVehicleDepartureLogVo() != null && vehicleBookRecordVo.getVehicleDepartureLogVo().getState() != 1 ) { //已经出车
stringBuilder.append("中,使用人:");
stringBuilder.append(vehicleBookRecordVo.getVehicleUsername());
stringBuilder.append(" 使用人电话:");
stringBuilder.append(vehicleBookRecordVo.getVehicleUserPhone());
return stringBuilder.toString();
}
}
}
stringBuilder.append(", 请联系管理员修改车辆状态为正常状态");
return stringBuilder.toString();
}
......@@ -314,7 +320,7 @@ public class VehicleActiveService {
Iterator<VehicleBookRecordVo> iterator = list.iterator();
while (iterator.hasNext()) {
VehicleBookRecordVo vehicleBookRecordVo = iterator.next();
if(vehicleBookRecordVo.getVehicleDepartureLogVo() == null && (vehicleBookRecordVo.getBookEndDate().getTime() - new Date().getTime()) < 0) {
if(vehicleBookRecordVo.getVehicleDepartureLogVo() == null && vehicleBookRecordVo.getBookEndDate().getTime() - new Date().getTime() < 0) {
iterator.remove();
}
}
......
......@@ -46,12 +46,10 @@ public class VehicleJobHandler extends IJobHandler {
List<String> existVehicleIds = vehicleBiz.findExistVehicleIds();
Dictionary dictionary = thirdFeign.findDictionaryByTypeAndCode(DIC_VEHICLE_TYPE, DIC_VEHICLE_CODE);
LocalDate date = LocalDate.now();
date = date.plusMonths(Integer.valueOf(dictionary.getDetail()));
int year = date.getYear();
int nowMonth = date.getMonthValue();
int betweenMonth = Integer.valueOf(dictionary.getDetail()).intValue();
int month = nowMonth + betweenMonth> 12 ? (betweenMonth + nowMonth) - 12 : nowMonth + betweenMonth;
year = month > nowMonth ? year : year + 1;
String yearAndMonth = String.format("%d-%s", year, month>=10?month:"0"+month);
int month = date.getMonthValue();
String yearAndMonth = String.format("%d-%02d", year,month);
XxlJobLogger.log("----查询到的车型ids:【{}】",existVehicleIds);
if (CollectionUtils.isNotEmpty(existVehicleIds)) {
List<VehicleBookInfo> bookInfos = existVehicleIds.stream().map(vehicleId -> {
......
......@@ -11,6 +11,7 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.vo.GoodDataVO;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.vehicle.biz.VehicleCataBiz;
import com.xxfc.platform.vehicle.biz.VehicleModelBiz;
import com.xxfc.platform.vehicle.biz.VehiclePlatCataBiz;
......@@ -133,7 +134,7 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
@ApiOperation("车型列表")
@PostMapping(value = "/app/unauth/findVehicleModelPage")
@IgnoreUserToken
public ObjectRestResponse<VehicleModelVo> findVehicleModelPageUnauthfind(
public ObjectRestResponse<PageDataVO<VehicleModelVo>> findVehicleModelPageUnauthfind(
@RequestBody @ApiParam("查询条件") VehicleModelQueryCondition vmqc, HttpServletRequest request) {
if (vmqc.getIsDel() == null) {
vmqc.setIsDel(0);
......
......@@ -380,7 +380,7 @@
</select>
<select id="selectByVehicleId" parameterType="java.lang.String"
resultType="com.xxfc.platform.vehicle.pojo.VehicleBookRecordVo">
resultMap="searchBookRecord">
SELECT v1.*,bc2.name retCompanyName from vehicle_book_record v1
LEFT JOIN branch_company bc2 on v1.ret_company = bc2.id
where v1.vehicle_id = #{vehicleId} and v1.status BETWEEN 1 and 2
......
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