From 51831372d555f98fb188b796a0ec6d48a0d6762e Mon Sep 17 00:00:00 2001 From: yitonglei Date: Wed, 11 May 2022 10:14:00 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=96=B0=E5=A2=9E=E4=BA=86=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=B8=A3=E5=9C=9F=E8=BD=A6=E8=BD=A8=E8=BF=B9=E5=B9=B6?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=92=8C=E6=A0=B9=E6=8D=AE=E7=BB=8F=E7=BA=AC?= =?UTF-8?q?=E5=BA=A6=E3=80=81=E5=8D=8A=E5=BE=84=E6=9F=A5=E8=AF=A2=E7=AC=A6?= =?UTF-8?q?=E5=90=88=E6=9D=A1=E4=BB=B6=E7=9A=84=E6=B8=A3=E5=9C=9F=E8=BD=A6?= =?UTF-8?q?=E8=BD=A8=E8=BF=B9=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../monitormanage/controller/Controller.java | 125 +++++++--- .../monitormanage/entity/PassengerFlow.java | 30 +++ .../monitormanage/entity/TrailSanitation.java | 45 ++++ .../mapper/PassengerFlowlMapper.java | 12 + .../mapper/TrailSanitationMapper.java | 12 + .../monitormanage/service/MonitorService.java | 8 +- .../service/PassengerFlowService.java | 213 ++++++++++++++++++ .../service/TrailSanitationService.java | 49 ++++ .../resources/mapper/PassengerFlowlMapper.xml | 17 ++ .../mapper/TrailSanitationMapper.xml | 18 ++ 10 files changed, 492 insertions(+), 37 deletions(-) diff --git a/src/main/java/com/hisense/monitormanage/controller/Controller.java b/src/main/java/com/hisense/monitormanage/controller/Controller.java index 71f6350..bb6b8df 100644 --- a/src/main/java/com/hisense/monitormanage/controller/Controller.java +++ b/src/main/java/com/hisense/monitormanage/controller/Controller.java @@ -7,12 +7,16 @@ import com.hisense.monitormanage.dto.ScenicCameraDto; import com.hisense.monitormanage.entity.*; import com.hisense.monitormanage.mapper.*; import com.hisense.monitormanage.service.MonitorService; +import com.hisense.monitormanage.service.PassengerFlowService; import com.hisense.monitormanage.service.SedimentTrailService; +import com.hisense.monitormanage.service.TrailSanitationService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; +import java.time.Clock; +import java.time.LocalDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -42,6 +46,12 @@ public class Controller { @Autowired private CameraOrgenizationMapper cameraOrgenMapper; + @Autowired + private PassengerFlowService passengerFlowService; + + @Autowired + private TrailSanitationService trailSanitationService; + @RequestMapping("all") public Object all(){ List projects = projectMapper.selectList(null); @@ -107,23 +117,6 @@ public class Controller { return success; - } - - /** - * 根据channelId查询摄像头详细信息 - * @param channelId - * @return - */ - @RequestMapping("selectByChannelId") - public Result selectByChannelId(String channelId){ - - List list = cameraChannelMapper.selectByChannelId(channelId); - - Result success = Result.success(list); - - return success; - - } /** @@ -218,21 +211,26 @@ public class Controller { return success; } - - //根据用户已输入的文字请求输入建议信息 - //text:用户输入的文字信息,必填 - //maxSuggestions:最大建议数量,0~10,默认2 - @RequestMapping("suggest") - public Result suggest( - @RequestParam(value ="text") String text, - @RequestParam(value = "maxSuggestions",required = false,defaultValue = "2") Integer maxSuggestions + //查询视频点播巡检结果,只取异常的 + @RequestMapping("listChannelPlayStates") + public Result listChannelPlayStates( + @RequestParam(value="page",required = false,defaultValue = "1") Integer page, + @RequestParam(value="pageSize",required = false,defaultValue = "20") String pageSize ){ - Map map = new HashMap<>(); - map.put("text",text); - map.put("maxSuggestions",maxSuggestions); - return monitorService.suggest(map); - } + Map condition = new HashMap<>(); + LocalDateTime localDateTime = LocalDateTime.now(Clock.systemUTC()); + LocalDateTime startTime = localDateTime.minusDays(7); + condition.put("diagnoseResultState",0); + condition.put("startTime",startTime.toString()); + condition.put("endTime",localDateTime.toString()); + + Map map = new HashMap<>(); + map.put("condition",condition); + map.put("page",page); + map.put("pageSize",pageSize); + return monitorService.listChannelPlayStates(map); + } //道路统计数据与排名 @RequestMapping("roadData") @@ -283,13 +281,19 @@ public class Controller { //获取渣土车轨迹并保存到t_trail_sediment @RequestMapping(value = "saveResCatalogApplyZTYS") - public boolean resCatalogApplyZTYS(){ - return sedimentTrailService.batchSaveSedimentTrail(); + public Result resCatalogApplyZTYS(){ + + boolean result = sedimentTrailService.batchSaveSedimentTrail(); + if(result){ + return Result.success(); + }else{ + return Result.error(String.valueOf(result)); + } } //根据输入的经纬度和查询的半径(米)时间查询范围内的渣土车轨迹信息 @RequestMapping(value = "listSedimentTrailByPoints") - public List listSedimentTrailByPoints( + public Result listSedimentTrailByPoints( @RequestParam(value="longitude") double longitude, @RequestParam(value="latitude") double latitude, @RequestParam(value="raidus") Integer raidus, @@ -297,7 +301,60 @@ public class Controller { @RequestParam(value = "end") String end ){ System.out.println("listSedimentTrailByPoints......"); - return sedimentTrailService.listSedimentTrailByPoints(longitude,latitude,raidus,start,end); + List list = sedimentTrailService.listSedimentTrailByPoints(longitude,latitude,raidus,start,end); + return Result.success(list); } + @RequestMapping("passengerFlow") + public List passengerFlow(){ + List list = passengerFlowService.passengerFlow(); + return list; + } + //获取实时客流并保存到表t_passenger_flow + @RequestMapping("savePassengerFlow") + public Result savePassengerFlow(){ + List list = passengerFlowService.passengerFlow(); + boolean result = passengerFlowService.savePassengerFlow(list); + if(result){ + return Result.success(); + }else{ + return Result.error(String.valueOf(result)); + } + } + + //根据输入的经纬度和查询的半径(米)和hourId查询游客总数 + @RequestMapping("getPassengerNum") + public Result getPassengerNum( + @RequestParam(value="longitude") double longitude, + @RequestParam(value="latitude") double latitude, + @RequestParam(value="raidus") Integer raidus, + @RequestParam(value="timeId") String timeId + ){ + return Result.success(String.valueOf(passengerFlowService.passengerNums(longitude,latitude,raidus,timeId))); + } + + //查询并保存环卫车轨迹到表t_trail_sanitation + @RequestMapping("saveTrailSanitation") + public Result saveTrailSanitation(){ + boolean result = trailSanitationService.saveTrailSanitation(); + if(result){ + return Result.success(); + }else{ + return Result.error(String.valueOf(result)); + } + } + + //根据输入的经纬度和查询的半径(米)时间查询范围内的环卫车轨迹信息 + @RequestMapping(value = "listTrailSanitationByPoints") + public Result listTrailSanitationByPoints( + @RequestParam(value="longitude") double longitude, + @RequestParam(value="latitude") double latitude, + @RequestParam(value="raidus") Integer raidus, + @RequestParam(value="start") String start, + @RequestParam(value = "end") String end + ){ + System.out.println("listTrailSanitationByPoints......"); + List list = trailSanitationService.listSedimentTrailByPoints(longitude,latitude,raidus,start,end); + return Result.success(list); + } } diff --git a/src/main/java/com/hisense/monitormanage/entity/PassengerFlow.java b/src/main/java/com/hisense/monitormanage/entity/PassengerFlow.java index e69de29..fdebebd 100644 --- a/src/main/java/com/hisense/monitormanage/entity/PassengerFlow.java +++ b/src/main/java/com/hisense/monitormanage/entity/PassengerFlow.java @@ -0,0 +1,30 @@ +package com.hisense.monitormanage.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author admin + * @version 1.0.0 + * @ClassName PassengerFlow.java + * @Description 实时客流 + * @createTime 2022年05月10日 14:25:00 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@TableName("t_passenger_flow") +public class PassengerFlow { + @TableId + private Integer id; + private String hourId; + private String timeId; + private double longitude; + private double latitude; + private Integer allNums; + private Integer localNums; + private Integer nonlocalNums; +} diff --git a/src/main/java/com/hisense/monitormanage/entity/TrailSanitation.java b/src/main/java/com/hisense/monitormanage/entity/TrailSanitation.java index e69de29..6b4dd7f 100644 --- a/src/main/java/com/hisense/monitormanage/entity/TrailSanitation.java +++ b/src/main/java/com/hisense/monitormanage/entity/TrailSanitation.java @@ -0,0 +1,45 @@ +package com.hisense.monitormanage.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDateTime; + +/** + * @author admin + * @version 1.0.0 + * @ClassName TrailSanitation.java + * @Description 环卫车轨迹类 + * @createTime 2022年05月10日 16:29:00 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@TableName("t_trail_sanitation") +public class TrailSanitation { + @TableId + private Integer id; + private String simkh; + private String cph; + private String wz; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime fssj; + private double jd; + private double wd; + private double sd; + private Integer fx; + private String zt; + private double yl; + private double lc; + private double yl2; + private Integer sfzx; + private Integer xh; + private String bjzt; + private double gd; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private LocalDateTime updatetime; +} diff --git a/src/main/java/com/hisense/monitormanage/mapper/PassengerFlowlMapper.java b/src/main/java/com/hisense/monitormanage/mapper/PassengerFlowlMapper.java index e69de29..9daa332 100644 --- a/src/main/java/com/hisense/monitormanage/mapper/PassengerFlowlMapper.java +++ b/src/main/java/com/hisense/monitormanage/mapper/PassengerFlowlMapper.java @@ -0,0 +1,12 @@ +package com.hisense.monitormanage.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hisense.monitormanage.entity.PassengerFlow; + +import java.util.List; +import java.util.Map; + +public interface PassengerFlowlMapper extends BaseMapper { + void batchSave(List list); +} diff --git a/src/main/java/com/hisense/monitormanage/mapper/TrailSanitationMapper.java b/src/main/java/com/hisense/monitormanage/mapper/TrailSanitationMapper.java index e69de29..b42ee93 100644 --- a/src/main/java/com/hisense/monitormanage/mapper/TrailSanitationMapper.java +++ b/src/main/java/com/hisense/monitormanage/mapper/TrailSanitationMapper.java @@ -0,0 +1,12 @@ +package com.hisense.monitormanage.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hisense.monitormanage.entity.TrailSanitation; + +import java.util.List; +import java.util.Map; + +public interface TrailSanitationMapper extends BaseMapper { + public void batchaSave(List list); +} diff --git a/src/main/java/com/hisense/monitormanage/service/MonitorService.java b/src/main/java/com/hisense/monitormanage/service/MonitorService.java index 560d7d7..fe96641 100644 --- a/src/main/java/com/hisense/monitormanage/service/MonitorService.java +++ b/src/main/java/com/hisense/monitormanage/service/MonitorService.java @@ -4,6 +4,7 @@ import cn.hutool.core.collection.ListUtil; import cn.hutool.crypto.SecureUtil; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.google.common.collect.Lists; import com.hisense.monitormanage.entity.*; import com.hisense.monitormanage.mapper.*; import lombok.extern.log4j.Log4j2; @@ -423,7 +424,7 @@ public class MonitorService { } //查询视频点播巡检结果 - public void listChannelPlayStates(Map map){ + public Result listChannelPlayStates(Map map){ String url = monitorDomain + "/nms/api/channel/play/list"; HttpHeaders headers = new HttpHeaders(); headers.add("X-Subject-Token",token); @@ -441,11 +442,12 @@ public class MonitorService { thisPage = nextPage; } List list = JSONObject.parseArray(JSONObject.toJSONString(jsonArray),Map.class); - List> listMap = ListUtil.partition(list,500); + + List> listMap = Lists.partition(list,500); for(List ll:listMap){ cameraChannelMapper.updateState(ll); } - + return Result.success(); } //道路统计数据与排名 diff --git a/src/main/java/com/hisense/monitormanage/service/PassengerFlowService.java b/src/main/java/com/hisense/monitormanage/service/PassengerFlowService.java index e69de29..a6487ca 100644 --- a/src/main/java/com/hisense/monitormanage/service/PassengerFlowService.java +++ b/src/main/java/com/hisense/monitormanage/service/PassengerFlowService.java @@ -0,0 +1,213 @@ +package com.hisense.monitormanage.service; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.google.common.collect.Lists; +import com.hisense.monitormanage.entity.PassengerFlow; +import com.hisense.monitormanage.mapper.PassengerFlowlMapper; +import com.hisense.monitormanage.utils.LongLatUtil; +import lombok.extern.log4j.Log4j2; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.ResponseEntity; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.DigestUtils; +import org.springframework.web.client.RestTemplate; + +import java.nio.charset.StandardCharsets; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author admin + * @version 1.0.0 + * @ClassName PassengerFlowService.java + * @Description 实时客流service + * @createTime 2022年05月10日 14:45:00 + */ +@Service +@Log4j2 +public class PassengerFlowService { + @Autowired + private PassengerFlowlMapper passengerFlowMapper; + @Autowired + private RestTemplate restTemplate; + + //实时客流相关参数 + @Value("202204141052331249fcc8-046") + private String APIKEY; + @Value("apitest") + private String appId; + @Value("7eb78b134e0310904d46039ccea20c32") + private String appSecret; + + /** + * 实时客流 + * @param + * @return List + */ + public List passengerFlow(){ + //JSONObject map = new JSONObject(); + Map map = new HashMap<>(); + //MultiValueMap map = new LinkedMultiValueMap<>(); + DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyyMMddHHmmss"); + + LocalDateTime dateNow = LocalDateTime.now(); + String timeStamp = dateNow.format(dateTimeFormatter1);//yyyyMMddHHmmss + String[] tt = this.minusMinutesStr(dateNow,180); + + String url = "http://15.72.158.72:8081/getway/api/Proxy/HandleByKey/1249fcc8-0466-4897-87b4-d2111a9baf4f"; + map.put("APIKEY",APIKEY); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("appId",appId); + //安全认证 MD5(appId+”-”+timeStamp+”-”+ appSecret) + String code = appId+"-"+timeStamp+"-"+ appSecret; + String md5Str = DigestUtils.md5DigestAsHex(code.getBytes(StandardCharsets.UTF_8)); + jsonObject.put("mac",md5Str); + jsonObject.put("timeStamp",timeStamp); + jsonObject.put("hourId",tt[1]); + jsonObject.put("timeId",tt[0]); + //jsonObject.put("apiType","***"); + JSONObject para = new JSONObject(); + para.put("data",JSONObject.toJSONString(jsonObject)); + map.put("ParamJson",para); + + System.out.println("multimap->"+map.toString()); + ResponseEntity responseEntity; + List list = new ArrayList<>(); + try{ + responseEntity = restTemplate.postForEntity(url,map,String.class); + //System.out.println(responseEntity.getStatusCodeValue()); + if(responseEntity.getStatusCodeValue() == 200){ + String result = responseEntity.getBody(); + //System.out.println("passengerFlow ->"+result); + JSONObject jsonResult = JSONObject.parseObject(result); + System.out.println(jsonResult.keySet().toString()); + if(jsonResult.getIntValue("code") == 0){ + JSONArray jsonArray = jsonResult.getJSONArray("result"); + list = JSONObject.parseArray(JSONObject.toJSONString(jsonArray),Map.class); + } + } + } catch (Exception e){ + log.error("[passengerFlow] Exception:"+e.getMessage()); + } + return list; + } + @Scheduled(cron = "0 30 11-23/1 * * ? ") + //11:30 到晚上11:30 + public void passengerFlowSchedule(){ + //JSONObject map = new JSONObject(); + Map map = new HashMap<>(); + //MultiValueMap map = new LinkedMultiValueMap<>(); + DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyyMMddHHmmss"); + + LocalDateTime dateNow = LocalDateTime.now(); + String timeStamp = dateNow.format(dateTimeFormatter1);//yyyyMMddHHmmss + String[] tt = this.minusMinutesStr(dateNow,180); + + String url = "http://15.72.158.72:8081/getway/api/Proxy/HandleByKey/1249fcc8-0466-4897-87b4-d2111a9baf4f"; + map.put("APIKEY",APIKEY); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("appId",appId); + //安全认证 MD5(appId+”-”+timeStamp+”-”+ appSecret) + String code = appId+"-"+timeStamp+"-"+ appSecret; + String md5Str = DigestUtils.md5DigestAsHex(code.getBytes(StandardCharsets.UTF_8)); + jsonObject.put("mac",md5Str); + jsonObject.put("timeStamp",timeStamp); + jsonObject.put("hourId",tt[1]); + jsonObject.put("timeId",tt[0]); + //jsonObject.put("apiType","***"); + JSONObject para = new JSONObject(); + para.put("data",JSONObject.toJSONString(jsonObject)); + map.put("ParamJson",para); + + System.out.println("multimap->"+map.toString()); + ResponseEntity responseEntity; + List list = new ArrayList<>(); + try{ + responseEntity = restTemplate.postForEntity(url,map,String.class); + //System.out.println(responseEntity.getStatusCodeValue()); + if(responseEntity.getStatusCodeValue() == 200){ + String result = responseEntity.getBody(); + //System.out.println("passengerFlow ->"+result); + JSONObject jsonResult = JSONObject.parseObject(result); + System.out.println(jsonResult.keySet().toString()); + if(jsonResult.getIntValue("code") == 0){ + JSONArray jsonArray = jsonResult.getJSONArray("result"); + list = JSONObject.parseArray(JSONObject.toJSONString(jsonArray),Map.class); + List> lists = Lists.partition(list,200); + lists.forEach(ll ->passengerFlowMapper.batchSave(ll)); + } + } + } catch (Exception e){ + log.error("[passengerFlowSchedule] Exception:"+e.getMessage()); + } + + } + //保存实时客流 + @Transactional(rollbackFor = Exception.class) + public boolean savePassengerFlow(List maps){ + List> lists = Lists.partition(maps,200); + try{ + lists.forEach(list ->passengerFlowMapper.batchSave(list)); + return true; + }catch (Exception e){ + log.error("[savePassengerFlow] Exception:"+e.getMessage()); + return false; + } + } + + //根据半径,一个经纬度和hour_id查询游客总数 + public Integer passengerNums(double longitude, double latitude, Integer raidus,String timeId){ + double[] points = LongLatUtil.getAround(longitude,latitude,raidus); + QueryWrapper wrapper = new QueryWrapper<>(); + + + wrapper.eq("time_id",timeId).between("longitude",points[0],points[2]).between("latitude",points[1],points[3]); + int count = 0; + try{ + List list = passengerFlowMapper.selectList(wrapper); + for(PassengerFlow p:list){ + count+=p.getAllNums(); + } + }catch (Exception e){ + log.error("[passengerNums] Exception:"+e.getMessage()); + return count; + } + return count; + } + + + //当前时间减去固定的分钟数,然后分钟取30 + private String[] minusMinutesStr(LocalDateTime datetime,long minutes){ + String t1,t2;//t1 yyyyMMddHHmm t2 yyyyMMddHH + LocalDateTime minus = datetime.minus(minutes, ChronoUnit.MINUTES); + DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyyMMddHHmm"); + DateTimeFormatter dateTimeFormatter2 = DateTimeFormatter.ofPattern("yyyyMMddHH"); + String time1 = minus.format(dateTimeFormatter); + System.out.println(time1); + String mm = time1.substring(time1.length() -2,time1.length()); + System.out.println(mm); + if(0 < Integer.parseInt(mm) &&Integer.parseInt(mm)<30){ + t1 = time1.substring(0,time1.length() -2)+"30"; + }else if(Integer.parseInt(mm)>30){ + LocalDateTime lastHour = LocalDateTime.parse(time1,dateTimeFormatter).plus(1,ChronoUnit.HOURS); + t1 = lastHour.format(dateTimeFormatter2)+"00"; + }else{ + t1 = time1; + } + + t2 = t1.substring(0,t1.length()-2); + System.out.println("t1->"+t1+"...t2->"+t2); + return new String[]{t1,t2}; + + } +} diff --git a/src/main/java/com/hisense/monitormanage/service/TrailSanitationService.java b/src/main/java/com/hisense/monitormanage/service/TrailSanitationService.java index e69de29..b1b7657 100644 --- a/src/main/java/com/hisense/monitormanage/service/TrailSanitationService.java +++ b/src/main/java/com/hisense/monitormanage/service/TrailSanitationService.java @@ -0,0 +1,49 @@ +package com.hisense.monitormanage.service; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.google.common.collect.Lists; +import com.hisense.monitormanage.entity.SedimentTrail; +import com.hisense.monitormanage.entity.TrailSanitation; +import com.hisense.monitormanage.mapper.TrailSanitationMapper; +import com.hisense.monitormanage.utils.LongLatUtil; +import lombok.extern.log4j.Log4j2; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +@Service +@Log4j2 +public class TrailSanitationService { + @Autowired + private TrailSanitationMapper trailSanitationMapper; + @Autowired + private MonitorService monitorService; + + public boolean saveTrailSanitation(){ + boolean result = false; + try{ + List list = monitorService.resCatalogApplyHJWS(); + List> lists = Lists.partition(list,200); + lists.forEach(l->trailSanitationMapper.batchaSave(l)); + result = true; + }catch (Exception e){ + log.error("[saveTrailSanitation] Exception:",e.getMessage()); + } + return result; + } + + /** + * 根据输入的经纬度和查询的半径(米)查询范围内的环卫车轨迹信息 + * @param longitude(经度) latitude(纬度) raidus(米) start(时间) end(时间) + * + */ + public List listSedimentTrailByPoints(double longitude, double latitude, Integer raidus, String start, String end){ + double[] points = LongLatUtil.getAround(longitude,latitude,raidus); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.between("fssj",start,end).between("jd",points[0],points[2]).between("wd",points[1],points[3]); + return trailSanitationMapper.selectList(wrapper); + } + +} diff --git a/src/main/resources/mapper/PassengerFlowlMapper.xml b/src/main/resources/mapper/PassengerFlowlMapper.xml index e69de29..dfe3d36 100644 --- a/src/main/resources/mapper/PassengerFlowlMapper.xml +++ b/src/main/resources/mapper/PassengerFlowlMapper.xml @@ -0,0 +1,17 @@ + + + + + + INSERT INTO t_passenger_flow + (hour_id,time_id,longitude,latitude,all_nums,local_nums,nonlocal_nums) + VALUES + + ( + #{item.hour_id},#{item.time_id},#{item.longitude},#{item.latitude},#{item.all_nums}, + #{item.local_nums},#{item.nonlocal_nums} + ) + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/TrailSanitationMapper.xml b/src/main/resources/mapper/TrailSanitationMapper.xml index e69de29..c8ea157 100644 --- a/src/main/resources/mapper/TrailSanitationMapper.xml +++ b/src/main/resources/mapper/TrailSanitationMapper.xml @@ -0,0 +1,18 @@ + + + + + + INSERT INTO t_trail_sanitation + (simkh,cph,fssj,jd,wd,sd,fx,zt,yl,lc,sfzx,bjzt,gd,updatetime) + VALUES + + ( + #{item.SIMKH},#{item.CPH},#{item.FSSJ},#{item.JD},#{item.WD}, + #{item.SD},#{item.FX},#{item.ZT},#{item.YL},#{item.LC}, + #{item.SFZX},#{item.BJZT},#{item.GD},#{item.updatetime} + ) + + + + \ No newline at end of file