车辆
This commit is contained in:
@ -135,7 +135,7 @@ public class DemoTest {
|
|||||||
log.info("执行定时任务:同步 {}至{} 计划详情到施工产值", lastMonday, lastSunday);
|
log.info("执行定时任务:同步 {}至{} 计划详情到施工产值", lastMonday, lastSunday);
|
||||||
Boolean synced = progressPlanDetailService.syncPlanDetail2ConstructionValue(lastMonday, lastSunday, null);*/
|
Boolean synced = progressPlanDetailService.syncPlanDetail2ConstructionValue(lastMonday, lastSunday, null);*/
|
||||||
LocalDate start = LocalDate.of(2024, 1, 1); // 起始时间(2024-01-01)
|
LocalDate start = LocalDate.of(2024, 1, 1); // 起始时间(2024-01-01)
|
||||||
LocalDate end = LocalDate.of(2025, 10, 20); // 截止时间(2025-09-15)
|
LocalDate end = LocalDate.of(2025, 10, 27); // 截止时间(2025-09-15)
|
||||||
|
|
||||||
// 如果起始不是周一,调整到当周的周一
|
// 如果起始不是周一,调整到当周的周一
|
||||||
if (start.getDayOfWeek() != DayOfWeek.MONDAY) {
|
if (start.getDayOfWeek() != DayOfWeek.MONDAY) {
|
||||||
@ -150,12 +150,18 @@ public class DemoTest {
|
|||||||
System.out.println(monday + " ~ " + sunday);
|
System.out.println(monday + " ~ " + sunday);
|
||||||
log.info("执行定时任务:同步 {}至{} 计划详情到施工产值", monday, sunday);
|
log.info("执行定时任务:同步 {}至{} 计划详情到施工产值", monday, sunday);
|
||||||
// Boolean synced = progressPlanDetailService.syncPlanDetail2ConstructionValue(start, now, null);
|
// Boolean synced = progressPlanDetailService.syncPlanDetail2ConstructionValue(start, now, null);
|
||||||
|
List<BusProject> list = projectService.lambdaQuery()
|
||||||
|
.eq(BusProject::getPId, 1968506669544656898L)
|
||||||
|
.list();
|
||||||
|
List<Long> list1 = new ArrayList<>(list.stream().map(BusProject::getId).toList());
|
||||||
|
list1.add(1968506669544656898L);
|
||||||
// 获取范围时间内的计划详情
|
// 获取范围时间内的计划详情
|
||||||
List<PgsProgressPlanDetail> planDetailList = progressPlanDetailService.lambdaQuery()
|
List<PgsProgressPlanDetail> planDetailList = progressPlanDetailService.lambdaQuery()
|
||||||
|
.in(PgsProgressPlanDetail::getProjectId, list1)
|
||||||
.ge(PgsProgressPlanDetail::getDate, monday)
|
.ge(PgsProgressPlanDetail::getDate, monday)
|
||||||
.le(PgsProgressPlanDetail::getDate, sunday)
|
.le(PgsProgressPlanDetail::getDate, sunday)
|
||||||
.ne(PgsProgressPlanDetail::getFinishedNumber, BigDecimal.ZERO)
|
.ne(PgsProgressPlanDetail::getFinishedNumber, BigDecimal.ZERO)
|
||||||
// .eq(PgsProgressPlanDetail::getStatus, "1")
|
.eq(PgsProgressPlanDetail::getStatus, "1")
|
||||||
.list();
|
.list();
|
||||||
if (CollUtil.isEmpty(planDetailList)) {
|
if (CollUtil.isEmpty(planDetailList)) {
|
||||||
// 下一周
|
// 下一周
|
||||||
|
|||||||
@ -84,8 +84,8 @@ public class VehVehicleTripController extends BaseController {
|
|||||||
@Log(title = "车辆出行记录", businessType = BusinessType.INSERT)
|
@Log(title = "车辆出行记录", businessType = BusinessType.INSERT)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PostMapping()
|
@PostMapping()
|
||||||
public R<Void> add(@Validated @RequestBody VehVehicleTripCreateReq req) {
|
public R<Long> add(@Validated @RequestBody VehVehicleTripCreateReq req) {
|
||||||
return toAjax(vehVehicleTripService.insertByBo(req));
|
return R.ok(vehVehicleTripService.insertByBo(req));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -66,8 +66,8 @@ public class VehVehicleTripAppController extends BaseController {
|
|||||||
@Log(title = "车辆出行记录", businessType = BusinessType.INSERT)
|
@Log(title = "车辆出行记录", businessType = BusinessType.INSERT)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PostMapping()
|
@PostMapping()
|
||||||
public R<Void> add(@Validated @RequestBody VehVehicleTripCreateReq req) {
|
public R<Long> add(@Validated @RequestBody VehVehicleTripCreateReq req) {
|
||||||
return toAjax(vehicleTripService.insertByBo(req));
|
return R.ok(vehicleTripService.insertByBo(req));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -66,7 +66,7 @@ public interface IVehVehicleTripService extends IService<VehVehicleTrip> {
|
|||||||
* @param req 车辆出行记录
|
* @param req 车辆出行记录
|
||||||
* @return 是否新增成功
|
* @return 是否新增成功
|
||||||
*/
|
*/
|
||||||
Boolean insertByBo(VehVehicleTripCreateReq req);
|
Long insertByBo(VehVehicleTripCreateReq req);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改车辆出行记录
|
* 修改车辆出行记录
|
||||||
|
|||||||
@ -211,7 +211,7 @@ public class VehVehicleTripServiceImpl extends ServiceImpl<VehVehicleTripMapper,
|
|||||||
* @return 是否新增成功
|
* @return 是否新增成功
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean insertByBo(VehVehicleTripCreateReq req) {
|
public Long insertByBo(VehVehicleTripCreateReq req) {
|
||||||
VehVehicleTrip trip = new VehVehicleTrip();
|
VehVehicleTrip trip = new VehVehicleTrip();
|
||||||
BeanUtils.copyProperties(req, trip);
|
BeanUtils.copyProperties(req, trip);
|
||||||
validEntityBeforeSave(trip);
|
validEntityBeforeSave(trip);
|
||||||
@ -234,10 +234,12 @@ public class VehVehicleTripServiceImpl extends ServiceImpl<VehVehicleTripMapper,
|
|||||||
throw new ServiceException("修改车辆状态失败");
|
throw new ServiceException("修改车辆状态失败");
|
||||||
}
|
}
|
||||||
trip.setPlateNumber(vehicle.getPlateNumber());
|
trip.setPlateNumber(vehicle.getPlateNumber());
|
||||||
return this.save(trip);
|
this.save(trip);
|
||||||
|
return trip.getId();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return this.save(trip);
|
this.save(trip);
|
||||||
|
return trip.getId();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user