| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | |
| | | import com.moral.api.config.Interceptor.UserHelper; |
| | | import com.moral.api.entity.*; |
| | | import com.moral.api.mapper.DailyMapper; |
| | | import com.moral.api.mapper.HistorySecondCruiserMapper; |
| | | import com.moral.api.mapper.SpecialDeviceMapper; |
| | | import com.moral.api.mapper.SysDictTypeMapper; |
| | | import com.moral.api.pojo.bo.ExcelBO; |
| | | import com.moral.api.pojo.dto.historySecondCruiser.HistorySecondCruiserListDTO; |
| | | import com.moral.api.pojo.dto.historySecondCruiser.HistorySecondCruiserResultCountDTO; |
| | |
| | | import com.moral.api.service.SpecialDeviceHistoryService; |
| | | import com.moral.api.service.SpecialDeviceService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.moral.api.service.SysAreaService; |
| | | import com.moral.api.service.SysDictTypeService; |
| | | import com.moral.constant.Constants; |
| | | |
| | |
| | | import com.moral.util.FileUtils; |
| | | import com.moral.util.GeodesyUtils; |
| | | import com.moral.util.TokenUtils; |
| | | |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.File; |
| | | import java.math.BigDecimal; |
| | | import java.text.ParseException; |
| | |
| | | |
| | | @Autowired |
| | | RedisTemplate redisTemplate; |
| | | |
| | | @Autowired |
| | | private SysAreaService sysAreaService; |
| | | |
| | | private final static Double dis = 50d; |
| | | |
| | |
| | | String type = params.get("type").toString(); |
| | | String code = params.get("code").toString(); |
| | | String area = params.get("area").toString(); |
| | | String mac = params.get("mac").toString(); |
| | | rsMap.put("area",area); |
| | | rsMap.put("mac",mac.substring(9)); |
| | | String value = JSON.toJSONString(rsMap); |
| | | |
| | | String mac = params.get("mac").toString(); |
| | | QueryWrapper<TbDaily> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("mac",mac); |
| | | queryWrapper.likeRight("time",time1.substring(0,10)); |
| | |
| | | |
| | | /** |
| | | * 下载走航车日报 |
| | | * @param id |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @Override |
| | | public DailyVo loadDaily(Integer id) { |
| | | public List<DailyVo> loadDaily(List<Integer> ids) { |
| | | ArrayList<DailyVo> dailyVos = new ArrayList<>(); |
| | | for (Integer id : ids) { |
| | | ArrayList<String> rsList = new ArrayList<>(); |
| | | DailyVo dailyVo = new DailyVo(); |
| | | TbDaily tbDaily = dailyMapper.selectById(id); |
| | | |
| | | SysArea areaByCode = sysAreaService.getAreaByCode(Integer.parseInt(tbDaily.getCode())); |
| | | if (tbDaily==null){ |
| | | return null; |
| | | continue; |
| | | } |
| | | String images = tbDaily.getImages(); |
| | | if (!ObjectUtils.isEmpty(images)){ |
| | |
| | | } |
| | | String value = tbDaily.getValue(); |
| | | Map map = JSON.parseObject(value, Map.class); |
| | | List<String> list = (List<String>) map.get("time"); |
| | | String join = String.join("-", list); |
| | | map.put("time",join); |
| | | dailyVo.setCode(map); |
| | | return dailyVo; |
| | | dailyVo.setName(areaByCode.getAreaName()); |
| | | dailyVo.setType(tbDaily.getType().equals("car")?"走航车":"无人机"); |
| | | dailyVos.add(dailyVo); |
| | | } |
| | | return dailyVos; |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | Object mac = params.get("mac"); |
| | | if (!ObjectUtils.isEmpty(mac)){ |
| | | String MAC = mac.toString(); |
| | | String[] split = mac.toString().split(","); |
| | | List<String> list = Arrays.asList(split); |
| | | List<String> macList = new ArrayList<>(new TreeSet<>(list)); |
| | | QueryWrapper<TbDaily> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("type",type).eq("code",code).eq("mac",MAC); |
| | | queryWrapper.eq("type",type).eq("code",code).in("mac",macList); |
| | | queryWrapper.between("time",startTime,endTime); |
| | | List<TbDaily> dailies = dailyMapper.selectList(queryWrapper); |
| | | for (TbDaily daily : dailies) { |