Commit e886bb8a authored by 黄伟铭's avatar 黄伟铭

Merge remote-tracking branch 'origin/master'

parents 6879bee8 f223e189
......@@ -3,10 +3,9 @@ package net.wanji.opt.controllerv2;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.opt.po.base.CrossLaneDataHistPoExtend;
import net.wanji.opt.servicev2.CrossService;
import net.wanji.opt.synthesis.pojo.CrossRealTimeAlarmEntity;
import net.wanji.opt.synthesis.pojo.CrossStatusDisOptTimeEntity;
import net.wanji.opt.vo2.CrossBaseInfoVO;
import net.wanji.opt.vo2.CrossRealTimeAlarmVO;
import net.wanji.opt.vo2.CrossStatusDistributionVO;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -15,7 +14,9 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author zhengyifan
......@@ -29,7 +30,6 @@ public class CrossController {
@Resource
private CrossService crossService;
//@ApiOperation(value = "路口状态分布", notes = "路口状态分布", response = JsonViewObject.class, httpMethod="GET")
@GetMapping("/getCrossStatusDistribution")
@ApiOperation(httpMethod="GET",value="路口状态分布", notes="路口状态分布")
@ApiImplicitParams({
......@@ -37,7 +37,7 @@ public class CrossController {
@ApiImplicitParam(name = "groupType", value = "时间粒度 0--5分钟 1--15分钟 2--30分钟 3--60分钟", required = true, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "date", value = "日期 格式:yyyy-MM-dd", required = true, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "objectType", value = "范围 1:方向级指标 2:转向级指标 3:车道级指标 4:路口级指标", required = true, dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "directionName", value = "方向 支持 北进口;东进口;南进口;西进口", dataType = "String", defaultValue = "北进口;东进口;南进口;西进口"),
@ApiImplicitParam(name = "directionName", value = "方向 支持 北进口;东进口;南进口;西进口", dataType = "String", defaultValue = ""),
})
@ApiResponses({
......@@ -46,28 +46,38 @@ public class CrossController {
public JsonViewObject getCrossStatusDistribution(String crossID, String date, String groupType, Integer objectType, String directionName) {
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
Map<String, Object> map = new HashMap<>();
String[] dirs = directionName.split(";");
for (String dir : dirs) {
String dirName = "";
switch (dir) {
case "北进口":
dirName = "northList";
break;
case "南进口":
dirName = "southList";
break;
case "西进口":
dirName = "westList";
break;
case "东进口":
dirName = "eastList";
break;
if (directionName != null) {
String[] dirs = directionName.split(";");
for (String dir : dirs) {
String dirName = "";
switch (dir) {
case "北进口":
dirName = "northList";
break;
case "南进口":
dirName = "southList";
break;
case "西进口":
dirName = "westList";
break;
case "东进口":
dirName = "eastList";
break;
}
try {
List<CrossStatusDistributionVO> info = crossService.getCrossStatusDistribution(crossID, date, groupType, objectType, dir);
map.put(dirName, info);
} catch (Exception e) {
log.error("监测详情-路口事件详情-路口状态分布: ", e);
return jsonViewObject.fail("路口状态分布查询失败");
}
}
} else {
try {
List<CrossStatusDistributionVO> info = crossService.getCrossStatusDistribution(crossID, date, groupType, objectType, dir);
map.put(dirName, info);
List<CrossStatusDistributionVO> info = crossService.getCrossStatusDistribution(crossID, date, groupType, objectType, null);
map.put("infoList", info);
} catch (Exception e) {
log.error("监测详情-路口事件详情-路口状态分布: ", e);
return jsonViewObject.fail("路口状态分布查询失败");
......@@ -100,4 +110,23 @@ public class CrossController {
return jsonViewObject.success(result);
}
@ApiOperation(value = "路口基础信息", notes = "路口基础信息", response = JsonViewObject.class, httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "crossID", value = "路口ID", required = true, dataType = "String", paramType = "query"),
})
@GetMapping(value = "/getCrossBaseInfo")
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = CrossBaseInfoVO.class)
})
public JsonViewObject getCrossBaseInfo(String crossID) {
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
CrossBaseInfoVO result;
try {
result = crossService.getCrossBaseInfos(crossID);
} catch (Exception e) {
log.error("监测详情-路口事件详情-路口基础信息: ", e);
return jsonViewObject.fail("路口基础信息查询失败");
}
return jsonViewObject.success(result);
}
}
package net.wanji.opt.controllerv2.evaluation;
import net.wanji.common.framework.Constants;
import net.wanji.common.framework.dubbointerface.BaseDubboInterface;
import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.common.framework.rest.AbstractRestServer;
import net.wanji.common.framework.dubbointerface.BaseDubboInterface;
import net.wanji.common.framework.exception.DubboProviderException;
import net.wanji.common.framework.i18n.I18nResourceBundle;
import net.wanji.common.framework.rest.AbstractRestServer;
import net.wanji.common.framework.rest.impl.AbstractRestServerImpl;
import net.wanji.opt.servicev2.evaluation.EventInfoService;
import net.wanji.opt.entity.evaluation.EventInfo;
import net.wanji.common.framework.rest.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiImplicitParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Maps;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import javax.ws.rs.core.MediaType;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* <p>
* 交通事件信息 接口API
* </p>
* @version 1.0
* @author wangtao
* @Date 2025-03-18
*/
@RestController
@Slf4j
@RequestMapping("/event-info")
@Api(value="EventInfoController", description="交通事件信息接口", tags = "交通事件信息")
public class EventInfoController extends AbstractRestServerImpl<EventInfo> implements AbstractRestServer<EventInfo>{
@Autowired
private EventInfoService eventInfoService;
@Override
public EventInfoService getBaseDubboInterface() {
return this.eventInfoService;
}
/**
* 获取所有交通事件信息记录
*
* @return JsonViewObject
*/
@ApiOperation(value = "交通事件信息-获取所有记录", notes = "获取所有交通事件信息记录", response = EventInfo.class, produces = MediaType.APPLICATION_JSON,hidden = true)
@GetMapping(value = "/byAll", produces = MediaType.APPLICATION_JSON)
@Override
public JsonViewObject getAll() {
JsonViewObject jsonView = JsonViewObject.newInstance();
long start=System.currentTimeMillis();
try {
List<EventInfo> list = this.getBaseDubboInterface().findAll();
jsonView.success(list);
} catch (DubboProviderException e) {
jsonView.fail(I18nResourceBundle.getConstants("GET_FAILED_MSG"));
log.error("{} getAll error", this.getClass().getSimpleName(), e);
}
return jsonView;
}
@ApiOperation(value = "交通事件信息-根据开始以及结束时间查询交通事件信息", notes = "获取所有交通事件信息记录", response = EventInfo.class, produces = MediaType.APPLICATION_JSON,hidden = false)
@ApiImplicitParams({
@ApiImplicitParam(name = "startTime", value = "开始时间", required = true, dataType = "String"),
@ApiImplicitParam(name = "endTime", value = "结束时间", required = true, dataType = "String"),
@ApiImplicitParam(name = "crossId", value = "路口id", required = true, dataType = "String"),
})
@GetMapping(value = "getListByStartAndEnd")
public JsonViewObject getListByStartAndEnd(String startTime, String endTime, String crossId){
JsonViewObject jsonView = JsonViewObject.newInstance();
long start=System.currentTimeMillis();
Map<String, Object> map = new HashMap<>();
map.put("startTime",startTime);
map.put("endTime",endTime);
map.put("crossId",crossId);
try {
List<EventInfo> list = this.getBaseDubboInterface().getListByStartAndEnd(map);
jsonView.success(list);
} catch (Exception e) {
jsonView.fail(I18nResourceBundle.getConstants("GET_FAILED_MSG"));
log.error("{} getAll error", this.getClass().getSimpleName(), e);
}
return jsonView;
}
/**
* 根据id查询交通事件信息记录
*
* @param id
* @return JsonViewObject
*/
@ApiOperation(value = "交通事件信息-根据id查询记录", notes = "根据id查询交通事件信息记录", response = EventInfo.class, produces = MediaType.APPLICATION_JSON,hidden = true)
@GetMapping(value = "/{id}", produces = MediaType.APPLICATION_JSON)
@Override
public JsonViewObject getById(@PathVariable String id) {
JsonViewObject jsonView = JsonViewObject.newInstance();
long start=System.currentTimeMillis();
try {
EventInfo entity = this.getBaseDubboInterface().findById(id);
jsonView.success(entity);
} catch (DubboProviderException e) {
jsonView.fail(I18nResourceBundle.getConstants("GET_FAILED_MSG"));
log.error("AbstractRestServerImpl getById error, id:{}", id, e);
}
return jsonView;
}
@ApiOperation(value = "交通事件信息-根据条件查询记录", notes = "根据条件查询记录", consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/byCondition", produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@Override
public JsonViewObject getByWhere(@RequestBody EventInfo entity) {
return super.getByWhere(entity);
}
@ApiOperation(value = "交通事件信息-根据条件分页查询记录", notes = "根据条件分页查询记录", produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON,hidden = true)
@PostMapping(value = "/byPage", produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@ResponseBody
public JsonViewObject getPage(@RequestBody Page<EventInfo> page){
return super.getPage(page);
}
/**
* 根据id删除
*
* @param ids
* @return JsonViewObject
*/
@ApiOperation(value = "交通事件信息-根据多个id删除记录", notes = "根据多个id删除记录", response = JsonViewObject.class, produces = MediaType.APPLICATION_JSON ,hidden = true)
@ApiImplicitParams(value = {
@ApiImplicitParam(paramType = "query", name = "ids", dataType = "String", required = true, value = "多个记录id,用逗号分隔", example = "1,2")
})
@GetMapping(value = "/deleting", produces = MediaType.APPLICATION_JSON)
public JsonViewObject deleteByIds(String ids) {
return super.deleteByIds(ids);
}
/**
* 新建记录
*
* @param entity
* @return JsonViewObject
*/
@ApiOperation(value = "交通事件信息-新建记录", notes = "新建记录", response = JsonViewObject.class, produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON,hidden = true)
@PostMapping(value = "/creating", produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
public JsonViewObject save( @RequestBody EventInfo entity){
return super.save(entity);
}
/**
* 修改记录
*
* @param entity
* @return
*/
@ApiOperation(value = "交通事件信息-修改记录", notes = "修改记录", response = JsonViewObject.class, produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON,hidden = true)
@PostMapping(value = "/updating", produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
public JsonViewObject update(@RequestBody EventInfo entity){
return super.update(entity);
}
}
package net.wanji.opt.dao.mapper;
import net.wanji.databus.po.CrossDataHistPO;
import net.wanji.opt.synthesis.pojo.CrossRealTimeAlarmEntity;
import net.wanji.opt.synthesis.pojo.CrossStatusDisOptTimeEntity;
import net.wanji.opt.synthesis.pojo.StrategyCrossResultEntity;
import net.wanji.opt.synthesis.pojo.*;
import java.util.List;
import java.util.Map;
/**
* <p>
......@@ -30,4 +26,25 @@ public interface CrossMapper {
* @return
*/
List<CrossRealTimeAlarmEntity> getCrossRealTimeAlarms(String crossID, String time);
/**
* 路口方向信息
*
* @param crossID 路口ID
*/
List<CrossDirectionInfoEntity> getCrossDirectionInfo(String crossID);
/**
* 路口转向信息
*
* @param crossID 路口ID
*/
List<CrossTurnInfoEntity> getCrossTurnInfo(String crossID);
/**
* 路口车道信息
*
* @param crossID 路口ID
*/
List<CrossLaneInfoEntity> getCrossLaneInfo(String crossID);
}
package net.wanji.opt.dao.mapper.evaluation;
import net.wanji.opt.entity.evaluation.EventInfo;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import net.wanji.common.framework.mapper.BaseInterfaceMapper;
/**
* <p>
* 交通事件信息
* </p>
*
* @Author wangtao
* @Date 2025-03-18
*/
public interface EventInfoMapper extends BaseInterfaceMapper<EventInfo> {
List<EventInfo> getListByStartAndEnd(Map<String, Object> map);
}
package net.wanji.opt.entity.evaluation;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import net.wanji.common.framework.domain.TrackableEntity;
import java.util.Date;
import java.math.BigDecimal;
/**
* <p>
* 交通事件信息
* </p>
*
* @Author wangtao
* @Date 2025-03-18
*/
@Data
@ApiModel(value="EventInfo对象", description="交通事件信息")
public class EventInfo extends TrackableEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键ID")
private Long oid;
@ApiModelProperty(value = "车牌号")
private String plateNo;
@ApiModelProperty(value = "参与者类别 1:机动车 2:非机动车 3:行人")
private String objectType;
@ApiModelProperty(value = "可信度")
private Integer confidence;
@ApiModelProperty(value = "检测时间")
private Date detectTime;
@ApiModelProperty(value = "事件等级:1扣分 2 罚款 3警告 0 未知")
private Integer grade;
@ApiModelProperty(value = "事件地点描述")
private String placeDesc;
@ApiModelProperty(value = "发生地点经度")
private BigDecimal lng;
@ApiModelProperty(value = "发生地点纬度")
private BigDecimal lat;
@ApiModelProperty(value = "事件一级类别 事件一级类别 1:机动车事件 2:非机动车事件 3:行人事件")
private String category;
@ApiModelProperty(value = "二级类别")
private String type;
@ApiModelProperty(value = "事件发生时间")
@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
private Date startTime;
@ApiModelProperty(value = "事件结束时间")
@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
private Date endTime;
@ApiModelProperty(value = "事件持续时长,单位秒")
private Integer duration;
@ApiModelProperty(value = "事件来源 1:系统检测 2:接处警 3:互联网 4:交管部门 5:大脑")
private String source;
@ApiModelProperty(value = "入库时间")
private Date ruksj;
@ApiModelProperty(value = "车道id")
private String laneId;
@ApiModelProperty(value = "路段id")
private String rid;
@ApiModelProperty(value = "渠化id")
private String segmentId;
@ApiModelProperty(value = "路口id")
private String crossId;
@ApiModelProperty(value = "路口所属绿波编号")
private String greenId;
@ApiModelProperty(value = "关联的事件摄像头信息ID")
private Long cameraOid;
@ApiModelProperty(value = "事件序列号作为主键")
private String eventSerialNumber;
private String dataStatus;
@ApiModelProperty(value = "目标id")
private String globalId;
private Integer stationId;
private String eventId;
@ApiModelProperty(value = "备注")
private String remark;
private String extend;
@ApiModelProperty(value = "分区字段")
private Integer dt;
@ApiModelProperty(value = "视频地址")
private String videoUrls;
@ApiModelProperty(value = "目标具体类型")
private Integer targetType;
@ApiModelProperty(value = "告警状态 0未处理 1分析中 2优化中 3优化完 4已结束")
private Integer alarmStatus;
@ApiModelProperty(value = "优化状态 0 未优化 1-优化过 根据上面告警状态如果有2 3状态认为优化过 ")
private Integer optStatus;
@ApiModelProperty(value = "修改时间")
private Date modifyTime;
@ApiModelProperty(value = "方向 1北...8西北")
private String dir;
@ApiModelProperty(value = "事件转向")
private String turn;
@ApiModelProperty(value = "失衡指数1-10")
private Double unbalanceIndex;
@ApiModelProperty(value = "溢出指数1-10 溢出程度的刻画(没溢出:1,即将溢出:3,溢出:5,溢停:7)")
private Double spilloverIndex;
@ApiModelProperty(value = "交通指数")
private Double trafficIndex;
/*****非数据库字段*******/
private String typeName;
//用于存放日期差-分钟
private String diffTime;
}
......@@ -2,10 +2,10 @@ package net.wanji.opt.servicev2;
import net.wanji.opt.synthesis.pojo.CrossRealTimeAlarmEntity;
import net.wanji.opt.synthesis.pojo.CrossStatusDisOptTimeEntity;
import net.wanji.opt.vo2.CrossBaseInfoVO;
import net.wanji.opt.vo2.CrossStatusDistributionVO;
import java.util.List;
import java.util.Map;
/**
* <p>
......@@ -40,4 +40,11 @@ public interface CrossService {
* @return
*/
List<CrossStatusDisOptTimeEntity> getOptTimeList(String crossID);
/**
* 获取路口基础信息————方向、转向、车道信息
*/
CrossBaseInfoVO getCrossBaseInfos(String crossID);
}
package net.wanji.opt.servicev2.evaluation;
import net.wanji.opt.entity.evaluation.EventInfo;
import net.wanji.common.framework.dubbointerface.BaseDubboInterface;
import java.util.List;
import java.util.Map;
/**
* <p>
* 交通事件信息
* </p>
*
* @Author wangtao
* @Date 2025-03-18
*/
public interface EventInfoService extends BaseDubboInterface<EventInfo> {
List<EventInfo> getListByStartAndEnd(Map<String, Object> map);
}
package net.wanji.opt.servicev2.evaluation.impl;
import net.wanji.common.framework.dubbointerface.impl.BaseDubboInterfaceImpl;
import net.wanji.common.framework.exception.DubboProviderException;
import net.wanji.common.framework.mapper.BaseInterfaceMapper;
import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.opt.entity.evaluation.EventInfo;
import net.wanji.opt.servicev2.evaluation.EventInfoService;
import net.wanji.opt.dao.mapper.evaluation.EventInfoMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
* <p>
* 交通事件信息
* </p>
*
* @Author wangtao
* @Date 2025-03-18
*/
@Slf4j
@Component
@Service
public class EventInfoServiceImpl extends BaseDubboInterfaceImpl<EventInfo> implements EventInfoService {
@Resource
private EventInfoMapper eventInfoMapper;
@Override
public BaseInterfaceMapper<EventInfo> getBaseInterfaceMapper() {
return this.eventInfoMapper;
}
public List<EventInfo> getListByStartAndEnd(Map<String, Object> map){
return this.eventInfoMapper.getListByStartAndEnd(map);
}
}
......@@ -7,8 +7,8 @@ import net.wanji.opt.dao.mapper.CrossMapper;
import net.wanji.opt.dao.mapper.GreenwaveHistoryMapper;
import net.wanji.opt.po.base.CrossLaneDataHistPoExtend;
import net.wanji.opt.servicev2.CrossService;
import net.wanji.opt.synthesis.pojo.CrossRealTimeAlarmEntity;
import net.wanji.opt.synthesis.pojo.CrossStatusDisOptTimeEntity;
import net.wanji.opt.synthesis.pojo.*;
import net.wanji.opt.vo2.CrossBaseInfoVO;
import net.wanji.opt.vo2.CrossStatusDistributionVO;
import org.springframework.stereotype.Service;
......@@ -95,4 +95,26 @@ public class CrossServiceImpl implements CrossService {
public List<CrossStatusDisOptTimeEntity> getOptTimeList(String crossID) {
return crossMapper.getOptTimes(crossID);
}
/**
* 路口基础信息————方向、转向、车道信息
*
* @param crossID 路口ID
*/
@Override
public CrossBaseInfoVO getCrossBaseInfos(String crossID) {
List<CrossBaseInfoVO> crossBaseInfoVOS = new ArrayList<>();
List<CrossDirectionInfoEntity> directionInfoEntities = crossMapper.getCrossDirectionInfo(crossID);
List<CrossTurnInfoEntity> turnInfoEntities = crossMapper.getCrossTurnInfo(crossID);
List<CrossLaneInfoEntity> laneInfoEntities = crossMapper.getCrossLaneInfo(crossID);
CrossBaseInfoVO crossBaseInfoVO = new CrossBaseInfoVO();
crossBaseInfoVO.setCrossID(crossID);
crossBaseInfoVO.setDirectionInfo(directionInfoEntities);
crossBaseInfoVO.setTurnInfo(turnInfoEntities);
crossBaseInfoVO.setLaneInfo(laneInfoEntities);
return crossBaseInfoVO;
}
}
package net.wanji.opt.servicev2.implv2;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.pagehelper.PageHelper;
......@@ -19,6 +18,7 @@ import net.wanji.databus.dao.mapper.GreenwaveHistMapper;
import net.wanji.databus.po.CrossDataHistPO;
import net.wanji.databus.po.CrossSchemeRings;
import net.wanji.databus.vo.LightsStatusVO2;
import net.wanji.opt.cache.BaseCrossInfoCache;
import net.wanji.opt.common.RedisUtils;
import net.wanji.opt.common.enums.EventInfoTypeEnum;
import net.wanji.opt.common.enums.GreenBeltDirEnum;
......@@ -70,6 +70,8 @@ public class TrendServiceV2Impl implements TrendServiceV2 {
private RedisUtils redisUtil;
@Resource
private BaseCrossSchemeMapper baseCrossSchemeMapper;
@Resource
private BaseCrossInfoCache baseCrossInfoCache;
private static List<OptMonitoringVO> greenListCache = new ArrayList<>(10);
private static List<OptMonitoringVO> crossListCache = new ArrayList<>(80);
......@@ -409,10 +411,14 @@ public class TrendServiceV2Impl implements TrendServiceV2 {
for (GreenwaveCrossPO greenwaveCrossPO : greenwaveCrossPOS) {
String crossId = greenwaveCrossPO.getCrossId();
String crossName = baseCrossInfoCache.getCrossName(crossId);
GreenOptCrossOffsetVO.CrossOffsetDetail oriOffsetDetail = getOriOffsetDetail(crossId);
oriOffsetDetail.setCrossName(crossName);
oriOffsetDetails.add(oriOffsetDetail);
GreenOptCrossOffsetVO.CrossOffsetDetail curOffsetDetail = getCurOffsetDetail(crossId, oriOffsetDetail);
curOffsetDetail.setCrossName(crossName);
curOffsetDetails.add(curOffsetDetail);
}
......
package net.wanji.opt.synthesis.pojo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "CrossDirectionInfoEntity", description = "路口基础信息-方向")
public class CrossDirectionInfoEntity {
@ApiModelProperty(value = "方向")
private Integer dir;
@ApiModelProperty(value = "方向描述")
private String dirName;
}
package net.wanji.opt.synthesis.pojo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "CrossLaneInfoEntity", description = "路口车道信息")
public class CrossLaneInfoEntity {
@ApiModelProperty(value = "车道编号")
private Integer sort;
@ApiModelProperty(value = "车道方向")
private Integer dir;
@ApiModelProperty(value = "车道转向")
private Integer turn;
@ApiModelProperty(value = "车道名称")
private String LaneName;
}
package net.wanji.opt.synthesis.pojo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "CrossTurnInfoEntity", description = "路口转向信息")
public class CrossTurnInfoEntity {
@ApiModelProperty(value = "转向")
private String turn;
@ApiModelProperty(value = "转向描述")
private String turnName;
}
package net.wanji.opt.vo2;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import net.wanji.opt.synthesis.pojo.CrossDirectionInfoEntity;
import net.wanji.opt.synthesis.pojo.CrossLaneInfoEntity;
import net.wanji.opt.synthesis.pojo.CrossTurnInfoEntity;
import java.util.List;
@Data
@ApiModel(value = "CrossBaseInfoVO", description = "路口基础信息-方向 转向 车道")
public class CrossBaseInfoVO {
@ApiModelProperty(value = "路口编号")
private String crossID;
@ApiModelProperty(value = "方向信息")
private List<CrossDirectionInfoEntity> directionInfo;
@ApiModelProperty(value = "转向信息")
private List<CrossTurnInfoEntity> turnInfo;
@ApiModelProperty(value = "车道信息")
private List<CrossLaneInfoEntity> laneInfo;
}
......@@ -23,6 +23,8 @@ public class GreenOptCrossOffsetVO {
public static class CrossOffsetDetail {
@ApiModelProperty(value = "路口编号")
private String crossId;
@ApiModelProperty(value = "路口名称")
private String crossName;
@ApiModelProperty(value = "方案相位差")
private Integer offset;
@ApiModelProperty(value = "方案号")
......
......@@ -103,4 +103,83 @@
</if>
) b
</select>
<select id="getCrossDirectionInfo" parameterType="String"
resultType="net.wanji.opt.synthesis.pojo.CrossDirectionInfoEntity">
select t.dir_type dir,
(
case t.dir_type
when 1 then '北'
when 2 then '东'
when 3 then '东'
when 4 then '南'
when 5 then '南'
when 6 then '西'
when 7 then '西'
when 8 then '北'
end
) dirName
from t_base_cross_dir_info t
where 1 = 1
and t.cross_id = #{corssID}
and t.in_out_type = 1
</select>
<select id="getCrossTurnInfo" parameterType="String" resultType="net.wanji.opt.synthesis.pojo.CrossTurnInfoEntity">
select distinct t2.turn_type turn,
(
case t2.turn_type
when 'u' then '掉头'
when 'l' then '左转'
when 's' then '直行'
when 'r' then '右转'
end
) turnName
from t_base_cross_turn_info t2
where 1 = 1
and t2.cross_id = #{corssID}
</select>
<select id="getCrossLaneInfo" parameterType="String" resultType="net.wanji.opt.synthesis.pojo.CrossLaneInfoEntity">
select distinct t3.sort,
t3.dir,
t3.turn,
CONCAT(
(
case t3.dir
when 1 then '北'
when 2 then '东'
when 3 then '东'
when 4 then '南'
when 5 then '南'
when 6 then '西'
when 7 then '西'
when 8 then '北'
end
)
,
(
case t3.dir
when 1 then '左转'
when 2 then '直行'
when 3 then '右转'
when 4 then '掉头'
when 5 then '直左'
when 6 then '直右'
when 7 then '左直右'
when 8 then '左右'
when 9 then '左转掉头'
when 10 then '直行掉头'
when 11 then '右转掉头'
when 12 then '左直掉头'
when 13 then '直右掉头'
when 14 then '左直右掉头'
when 15 then '左右掉头'
end
)
, t3.sort) laneName
from t_base_lane_info t3
where 1 = 1
and t3.cross_id = #{crossID}
</select>
</mapper>
......@@ -296,7 +296,7 @@
WHERE dt = CURDATE()
AND type IN ('701', '702', '703', '707')
AND start_time <![CDATA[ < ]]> NOW()
AND IFNULL(end_time, NOW()) <![CDATA[ < ]]> NOW()
AND IFNULL(end_time, NOW()) <![CDATA[ > ]]> NOW()
GROUP BY cross_id
) latest_event ON t1.id = latest_event.cross_id
LEFT JOIN t_event_info t2
......@@ -305,7 +305,7 @@
AND t2.dt = CURDATE()
AND t2.type IN ('701', '702', '703', '707')
AND t2.start_time <![CDATA[ < ]]> NOW()
AND IFNULL(t2.end_time, NOW()) <![CDATA[ < ]]> NOW()
AND IFNULL(t2.end_time, NOW()) <![CDATA[ > ]]> NOW()
WHERE t1.is_signal = 1
ORDER BY t2.start_time DESC
</select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment