| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.utils.DateUtils; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.dataInterchange.api.feignClient.UPWarnMsgAdptInfoClient; |
| | |
| | | import com.ruoyi.system.service.IEnterpriseService; |
| | | import com.ruoyi.system.service.IWarnService; |
| | | import com.ruoyi.system.util.GDMapGeocodingUtil; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | List<Driver> driverList = driverService.list(new LambdaQueryWrapper<Driver>().eq(Driver::getStatus, 1)); |
| | | List<Car> carList = carService.list(); |
| | | List<Warn> warns = new ArrayList<>(); |
| | | List<Warn> updateWarns = new ArrayList<>(); |
| | | for (UPWarnMsgAdptInfoVo vo : list) { |
| | | long count = this.count(new LambdaQueryWrapper<Warn>().eq(Warn::getObjectId, vo.getInfoId())); |
| | | if(0 != count){ |
| | |
| | | warn.setObjectId(vo.getInfoId()); |
| | | warn.setVehicleNumber(vo.getVehicleNo()); |
| | | warn.setPicUrl(vo.getPicUrl()); |
| | | warns.add(warn); |
| | | } |
| | | if (warns.size() > 0) { |
| | | this.saveBatch(warns); |
| | | |
| | | List<Warn> list2 = this.list(new LambdaQueryWrapper<Warn>().eq(Warn::getObjectId, vo.getInfoId())); |
| | | |
| | | if (!list2.isEmpty()) { |
| | | Warn warn1 = list2.get(0); |
| | | // 比较2个时间大小 |
| | | String startTime = warn1.getStartTime(); |
| | | String startTime1 = warn.getStartTime(); |
| | | if (DateUtils.parseDate(startTime).getTime()>DateUtils.parseDate(startTime1).getTime()) { |
| | | warn1.setStartTime(startTime1); |
| | | warn1.setEndTime(startTime); |
| | | }else { |
| | | warn1.setEndTime(startTime1); |
| | | } |
| | | this.updateById(warn1); |
| | | }else { |
| | | this.save(warn); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 定时保存车辆id和司机id |
| | | */ |