材料进场从临时表删除对应的预约车辆

This commit is contained in:
guoshengxiong 2024-07-29 13:59:35 +08:00
parent 1e483fb1c1
commit bf46f8776f

View File

@ -4,10 +4,8 @@ import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.zhgd.xmgl.async.AsyncHikvision;
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
import com.zhgd.xmgl.modules.car.entity.CarInfo;
@ -30,7 +28,10 @@ import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Slf4j
@ -113,7 +114,9 @@ public class ExamTask {
flows = flows.stream().filter(f ->
carMap.get(f.getCarNumber() + ":" + f.getReserveStartTime() + ":" + f.getReserveEndTime()) != null
).collect(Collectors.toList());
carInfoApprovalFlowService.removeByIds(flows.stream().map(c -> c.getId()).collect(Collectors.toSet()));
if (flows.size() > 0) {
carInfoApprovalFlowService.removeByIds(flows.stream().map(CarInfoApprovalFlow::getId).collect(Collectors.toSet()));
}
for (CarInfo carInfo : carInfos) {
//同步海康
Project project = projectService.getProjectInfoBySn(carInfo.getProjectSn());
@ -201,7 +204,7 @@ public class ExamTask {
examNoticeService.saveBatch(noticeList);
}
private DateTime getTime(int type, int num){
private DateTime getTime(int type, int num) {
DateTime dateTime = null;
if (type == 1) {
dateTime = DateUtil.offsetHour(new Date(), num);