Commit b0aaaf05 authored by zhoushiguang's avatar zhoushiguang

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	signal-optimize-service/src/main/resources/bootstrap-dev.yaml
parents 9b741610 47017e84
...@@ -69,6 +69,38 @@ ...@@ -69,6 +69,38 @@
<elastic-data-version>2.6.3</elastic-data-version> <elastic-data-version>2.6.3</elastic-data-version>
</properties> </properties>
<!--部署私服配置-->
<distributionManagement>
<repository>
<id>releases</id>
<url>http://106.120.201.126:14729/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<url>http://106.120.201.126:14729/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
<!--maven仓库配置-->
<repositories>
<repository>
<id>releases</id>
<url>http://106.120.201.126:14729/repository/maven-public/</url>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</releases>
</repository>
<repository>
<id>snapshots</id>
<url>http://106.120.201.126:14729/repository/maven-public/</url>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</releases>
</repository>
</repositories>
<!-- 依赖声明 --> <!-- 依赖声明 -->
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
......
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
<dependency> <dependency>
<groupId>net.wanji</groupId> <groupId>net.wanji</groupId>
<artifactId>wj-databus</artifactId> <artifactId>wj-databus</artifactId>
<version>0.0.1</version> <version>0.0.3</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<dependency> <dependency>
<groupId>net.wanji</groupId> <groupId>net.wanji</groupId>
<artifactId>wj-databus</artifactId> <artifactId>wj-databus</artifactId>
<version>0.0.1</version> <version>0.0.3</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.wanji</groupId> <groupId>net.wanji</groupId>
......
...@@ -2,3 +2,4 @@ utc.service.url=http://10.102.1.182:32000/utc ...@@ -2,3 +2,4 @@ utc.service.url=http://10.102.1.182:32000/utc
utc.dt.service.url=http://10.102.1.182:39002/utc-dt utc.dt.service.url=http://10.102.1.182:39002/utc-dt
utc.hisense.service.url=http://127.0.0.1:39003/utc-hisense utc.hisense.service.url=http://127.0.0.1:39003/utc-hisense
control.url=http://10.102.1.182:32001/web control.url=http://10.102.1.182:32001/web
ehualu.url=http://173.0.0.1:30015
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<dependency> <dependency>
<groupId>net.wanji</groupId> <groupId>net.wanji</groupId>
<artifactId>wj-databus</artifactId> <artifactId>wj-databus</artifactId>
<version>0.0.1</version> <version>0.0.3</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
......
package net.wanji.opt.common.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import net.wanji.common.utils.tool.StringUtils;
/**
* @author duanruiming
* @date 2024/12/03 19:14
*/
@Getter
@AllArgsConstructor
public enum GreenBeltDirEnum {
E2W("e2w", "东向西"),
W2E("w2e", "西向东"),
N2S("n2s", "北向南"),
S2N("s2n", "南向北");
private String code;
private String desc;
public static String getDesc(String code) {
for (GreenBeltDirEnum dirEnum : GreenBeltDirEnum.values()) {
if (StringUtils.equalsIgnoreCase(code, dirEnum.getCode())) {
return dirEnum.getDesc();
}
}
return "";
}
}
...@@ -6,10 +6,12 @@ import com.alibaba.fastjson.JSONObject; ...@@ -6,10 +6,12 @@ import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.wanji.common.framework.Constants;
import net.wanji.common.framework.i18n.I18nResourceBundle; import net.wanji.common.framework.i18n.I18nResourceBundle;
import net.wanji.common.framework.rest.JsonViewObject; import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.common.framework.rest.Page; import net.wanji.common.framework.rest.Page;
import net.wanji.common.framework.rest.ValidationGroups; import net.wanji.common.framework.rest.ValidationGroups;
import net.wanji.common.utils.tool.DateUtil;
import net.wanji.common.utils.tool.StringUtils; import net.wanji.common.utils.tool.StringUtils;
import net.wanji.databus.dao.entity.GreenwaveInfoPO; import net.wanji.databus.dao.entity.GreenwaveInfoPO;
import net.wanji.databus.dao.mapper.GreenwaveInfoMapper; import net.wanji.databus.dao.mapper.GreenwaveInfoMapper;
...@@ -31,6 +33,7 @@ import javax.annotation.Resource; ...@@ -31,6 +33,7 @@ import javax.annotation.Resource;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.ws.rs.QueryParam; import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
import java.text.ParseException;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -115,7 +118,17 @@ public class GreenwaveInducesController { ...@@ -115,7 +118,17 @@ public class GreenwaveInducesController {
greenwaveDTO.setStrategyId(m.getStrategyId()); greenwaveDTO.setStrategyId(m.getStrategyId());
greenwaveDTO.setStrategyName(m.getStrategyName()); greenwaveDTO.setStrategyName(m.getStrategyName());
greenwaveDTO.setDir(m.getDir()); greenwaveDTO.setDir(m.getDir());
greenwaveDTO.setControlOptTimes(m.getControlOptTimes()); if(Objects.nonNull(m.getControlOptTimes()) && m.getControlOptTimes().split("\\|").length>0) {
try {
String startTime = DateUtil.format(DateUtil.parse(m.getControlOptTimes().split("\\|")[0], Constants.DATE_FORMAT.E_DATE_FORMAT_SECOND), Constants.DATE_FORMAT.E_DATE_FORMAT_TIME);
String endTime = DateUtil.format(DateUtil.parse(m.getControlOptTimes().split("\\|")[1], Constants.DATE_FORMAT.E_DATE_FORMAT_SECOND), Constants.DATE_FORMAT.E_DATE_FORMAT_TIME);
greenwaveDTO.setControlOptTimes(startTime.substring(0,startTime.lastIndexOf(":00"))+"-"+endTime.substring(0,endTime.lastIndexOf(":00")));
}catch (ParseException ex){ex.printStackTrace();
greenwaveDTO.setControlOptTimes(m.getControlOptTimes());
}
}else {
greenwaveDTO.setControlOptTimes(m.getControlOptTimes());
}
greenwaveList.add(greenwaveDTO); greenwaveList.add(greenwaveDTO);
}); });
induceDTO.setGreenwaveList(greenwaveList); induceDTO.setGreenwaveList(greenwaveList);
...@@ -185,7 +198,17 @@ public class GreenwaveInducesController { ...@@ -185,7 +198,17 @@ public class GreenwaveInducesController {
greenwaveDTO.setStrategyId(m.getStrategyId()); greenwaveDTO.setStrategyId(m.getStrategyId());
greenwaveDTO.setStrategyName(m.getStrategyName()); greenwaveDTO.setStrategyName(m.getStrategyName());
greenwaveDTO.setDir(m.getDir()); greenwaveDTO.setDir(m.getDir());
greenwaveDTO.setControlOptTimes(m.getControlOptTimes()); if(Objects.nonNull(m.getControlOptTimes()) && m.getControlOptTimes().split("\\|").length>0) {
try {
String startTime = DateUtil.format(DateUtil.parse(m.getControlOptTimes().split("\\|")[0], Constants.DATE_FORMAT.E_DATE_FORMAT_SECOND), Constants.DATE_FORMAT.E_DATE_FORMAT_TIME);
String endTime = DateUtil.format(DateUtil.parse(m.getControlOptTimes().split("\\|")[1], Constants.DATE_FORMAT.E_DATE_FORMAT_SECOND), Constants.DATE_FORMAT.E_DATE_FORMAT_TIME);
greenwaveDTO.setControlOptTimes(startTime.substring(0,startTime.lastIndexOf(":00"))+"-"+endTime.substring(0,endTime.lastIndexOf(":00")));
}catch (ParseException ex){ex.printStackTrace();
greenwaveDTO.setControlOptTimes(m.getControlOptTimes());
}
}else {
greenwaveDTO.setControlOptTimes(m.getControlOptTimes());
}
greenwaveList.add(greenwaveDTO); greenwaveList.add(greenwaveDTO);
}); });
induceDTO.setGreenwaveList(greenwaveList); induceDTO.setGreenwaveList(greenwaveList);
......
...@@ -10,13 +10,11 @@ import net.wanji.common.framework.Constants; ...@@ -10,13 +10,11 @@ import net.wanji.common.framework.Constants;
import net.wanji.common.framework.rest.JsonViewObject; import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.common.utils.tool.DateUtil; import net.wanji.common.utils.tool.DateUtil;
import net.wanji.opt.entity.GreenwaveInduces; import net.wanji.opt.entity.GreenwaveInduces;
import net.wanji.opt.entity.GreenwaveInducesHist;
import net.wanji.opt.entity.InduceHist; import net.wanji.opt.entity.InduceHist;
import net.wanji.opt.entity.InduceTemplate; import net.wanji.opt.entity.InduceTemplate;
import net.wanji.opt.dto.induce.MessageParam; import net.wanji.opt.dto.induce.MessageParam;
import net.wanji.opt.service.induce.GreenwaveInducesService; import net.wanji.opt.service.induce.*;
import net.wanji.opt.service.induce.InduceHistService;
import net.wanji.opt.service.induce.InduceSendService;
import net.wanji.opt.service.induce.InduceTemplateService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
...@@ -48,11 +46,26 @@ public class InduceSendController { ...@@ -48,11 +46,26 @@ public class InduceSendController {
@Autowired @Autowired
private GreenwaveInducesService greenwaveInducesService; private GreenwaveInducesService greenwaveInducesService;
@Autowired
private GreenwaveInducesHistService greenwaveInducesHistService;
@ApiOperation(value = "发送诱导信息", notes = "发送诱导信息", response = JsonViewObject.class, produces = MediaType.APPLICATION_JSON) @ApiOperation(value = "发送诱导信息", notes = "发送诱导信息", response = JsonViewObject.class, produces = MediaType.APPLICATION_JSON)
@PostMapping("/send") @PostMapping("/send")
public JsonViewObject send(@RequestBody MessageParam param) { public JsonViewObject send(@RequestBody MessageParam param) {
JsonViewObject jsonView = JsonViewObject.newInstance(); JsonViewObject jsonView = JsonViewObject.newInstance();
try { try {
if(Objects.nonNull(param.getGreenId())) {
LambdaQueryWrapper<GreenwaveInducesHist> greenwaveInducesHistQueryWrapper = new LambdaQueryWrapper<>();
greenwaveInducesHistQueryWrapper.eq(GreenwaveInducesHist::getGreenId, param.getGreenId());
List<GreenwaveInducesHist> greenwaveInducesHistList = greenwaveInducesHistService.list(greenwaveInducesHistQueryWrapper);
if (Objects.nonNull(greenwaveInducesHistList) && greenwaveInducesHistList.size() > 0 && Objects.nonNull(greenwaveInducesHistList.get(0).getControlOptTimes()) && greenwaveInducesHistList.get(0).getControlOptTimes().split("|").length > 0 && DateUtil.isBetween(new Date(), DateUtil.parse(greenwaveInducesHistList.get(0).getControlOptTimes().split("\\|")[0], Constants.DATE_FORMAT.E_DATE_FORMAT_SECOND), DateUtil.parse(greenwaveInducesHistList.get(0).getControlOptTimes().split("\\|")[1], Constants.DATE_FORMAT.E_DATE_FORMAT_SECOND))) {
param.setStartTime(greenwaveInducesHistList.get(0).getControlOptTimes().split("\\|")[0]);
param.setEndTime(greenwaveInducesHistList.get(0).getControlOptTimes().split("\\|")[1]);
} else {
param.setStartTime(DateUtil.format(new Date(), Constants.DATE_FORMAT.E_DATE_FORMAT_SECOND));
param.setEndTime(DateUtil.format(System.currentTimeMillis() + 1000 * 60, Constants.DATE_FORMAT.E_DATE_FORMAT_SECOND));
}
}
induceSendService.send(param); induceSendService.send(param);
return jsonView.success(); return jsonView.success();
} catch (Exception e) { } catch (Exception e) {
...@@ -70,6 +83,11 @@ public class InduceSendController { ...@@ -70,6 +83,11 @@ public class InduceSendController {
LambdaQueryWrapper<GreenwaveInduces> greenwaveInducesQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<GreenwaveInduces> greenwaveInducesQueryWrapper = new LambdaQueryWrapper<>();
greenwaveInducesQueryWrapper.eq(GreenwaveInduces::getGreenId, param.getGreenId()); greenwaveInducesQueryWrapper.eq(GreenwaveInduces::getGreenId, param.getGreenId());
List<GreenwaveInduces> greenwaveInducesList=greenwaveInducesService.list(greenwaveInducesQueryWrapper); List<GreenwaveInduces> greenwaveInducesList=greenwaveInducesService.list(greenwaveInducesQueryWrapper);
LambdaQueryWrapper<GreenwaveInducesHist> greenwaveInducesHistQueryWrapper = new LambdaQueryWrapper<>();
greenwaveInducesHistQueryWrapper.eq(GreenwaveInducesHist::getGreenId, param.getGreenId());
List<GreenwaveInducesHist> greenwaveInducesHistList=greenwaveInducesHistService.list(greenwaveInducesHistQueryWrapper);
for(GreenwaveInduces greenwaveInduces:greenwaveInducesList) for(GreenwaveInduces greenwaveInduces:greenwaveInducesList)
{ {
LambdaQueryWrapper<InduceTemplate> induceTemplateQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<InduceTemplate> induceTemplateQueryWrapper = new LambdaQueryWrapper<>();
...@@ -81,8 +99,13 @@ public class InduceSendController { ...@@ -81,8 +99,13 @@ public class InduceSendController {
param.setEquipCode(greenwaveInduces.getEquipCode()); param.setEquipCode(greenwaveInduces.getEquipCode());
param.setPlayorder(induceTemplateList.size()); param.setPlayorder(induceTemplateList.size());
param.setDuration(greenwaveInduces.getDuration()); param.setDuration(greenwaveInduces.getDuration());
param.setStartTime(DateUtil.format(new Date(), Constants.DATE_FORMAT.E_DATE_FORMAT_SECOND)); if (Objects.nonNull(greenwaveInducesHistList) && greenwaveInducesHistList.size() > 0 && Objects.nonNull(greenwaveInducesHistList.get(0).getControlOptTimes()) && greenwaveInducesHistList.get(0).getControlOptTimes().split("\\|").length > 0 && DateUtil.isBetween(new Date(), DateUtil.parse(greenwaveInducesHistList.get(0).getControlOptTimes().split("\\|")[0], Constants.DATE_FORMAT.E_DATE_FORMAT_SECOND), DateUtil.parse(greenwaveInducesHistList.get(0).getControlOptTimes().split("\\|")[1], Constants.DATE_FORMAT.E_DATE_FORMAT_SECOND))) {
param.setEndTime(DateUtil.format(System.currentTimeMillis() + 1000 * 30, Constants.DATE_FORMAT.E_DATE_FORMAT_SECOND)); param.setStartTime(greenwaveInducesHistList.get(0).getControlOptTimes().split("\\|")[0]);
param.setEndTime(greenwaveInducesHistList.get(0).getControlOptTimes().split("\\|")[1]);
} else {
param.setStartTime(DateUtil.format(new Date(), Constants.DATE_FORMAT.E_DATE_FORMAT_SECOND));
param.setEndTime(DateUtil.format(System.currentTimeMillis() + 1000 * 60, Constants.DATE_FORMAT.E_DATE_FORMAT_SECOND));
}
induceSendService.send(param); induceSendService.send(param);
} }
} }
......
...@@ -8,16 +8,14 @@ import net.wanji.common.framework.rest.JsonViewObject; ...@@ -8,16 +8,14 @@ import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.databus.bo.CrossIdBO; import net.wanji.databus.bo.CrossIdBO;
import net.wanji.databus.po.CrossDataRealtimePO; import net.wanji.databus.po.CrossDataRealtimePO;
import net.wanji.databus.po.CrossDirDataRealtimePO; import net.wanji.databus.po.CrossDirDataRealtimePO;
import net.wanji.databus.po.TBaseCrossInfo;
import net.wanji.opt.dto.strategy.AddOrUpdateSceneDTO; import net.wanji.opt.dto.strategy.AddOrUpdateSceneDTO;
import net.wanji.opt.service.CrossIndexService; import net.wanji.opt.service.CrossIndexService;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
import java.util.Date; import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
...@@ -32,6 +30,17 @@ public class CrossIndexController { ...@@ -32,6 +30,17 @@ public class CrossIndexController {
@Resource @Resource
private CrossIndexService crossIndexService; private CrossIndexService crossIndexService;
@ApiOperation(value = "路口信息查询", notes = "路口信息查询", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@GetMapping(value = "/crossInfoList")
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = TBaseCrossInfo.class),
})
public JsonViewObject crossInfoList() {
List<TBaseCrossInfo> baseCrossInfoPOS = crossIndexService.crossInfoList();
return JsonViewObject.newInstance().success(baseCrossInfoPOS);
}
@ApiOperation(value = "路口方向指标", notes = "路口方向指标", response = JsonViewObject.class, @ApiOperation(value = "路口方向指标", notes = "路口方向指标", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON) produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/crossDirIndex", @PostMapping(value = "/crossDirIndex",
......
package net.wanji.opt.controller.signalopt; package net.wanji.opt.controller.signalopt;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.opt.dto.strategy.AddOrUpdateSceneDTO;
import net.wanji.opt.service.signalopt.GreenBeltInfoService;
import net.wanji.opt.vo.GreenBeltFlowStopTimeVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.ws.rs.core.MediaType;
import java.util.List;
/** /**
* @author duanruiming * @author duanruiming
* @date 2024/11/28 16:03 * @date 2024/11/28 16:03
*/ */
@Api(value = "CrossIndexController", description = "路口指标控制器") @Api(value = "CrossIndexController", description = "路口指标控制器")
@RequestMapping("/crossIndex") @RequestMapping("/greenBelt")
@RestController @RestController
public class GreenBeltController { public class GreenBeltController {
@Resource
private GreenBeltInfoService greenBeltInfoService;
@ApiOperation(value = "绿波协调方向路口流量停车次数", notes = "绿波协调方向路口流量停车次数", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@GetMapping(value = "/greenBeltCrossDetailHist")
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = AddOrUpdateSceneDTO.class),
})
public JsonViewObject greenBeltCrossDetailHist(Integer greenId) {
List<GreenBeltFlowStopTimeVO> greenBeltFlowStopTimeVOS = greenBeltInfoService.greenBeltCrossDetailHist(greenId);
return JsonViewObject.newInstance().success(greenBeltFlowStopTimeVOS);
}
} }
package net.wanji.opt.dto.induce;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@NoArgsConstructor
@Data
public class GreenwaveDirDTO {
@ApiModelProperty(name = "当前策略")
private Integer strategyId;
@ApiModelProperty(name = "策略名称")
private String strategyName;
@ApiModelProperty(name = "绿波方向:1 南向北 2 西向东 3 北向南 4 东向西")
private Integer dir;
@ApiModelProperty(name = "推荐最小速度")
private Double minSpeed;
@ApiModelProperty(name = "推荐最大速度")
private Double maxSpeed;
@ApiModelProperty(name = "执行时段")
private String controlOptTimes;
@ApiModelProperty(name = "诱导屏列表")
private List<InduceDTO> induceList;
}
...@@ -25,26 +25,8 @@ public class GreenwaveInducesDTO { ...@@ -25,26 +25,8 @@ public class GreenwaveInducesDTO {
@ApiModelProperty(name = "发布状态") @ApiModelProperty(name = "发布状态")
private Integer status ; private Integer status ;
@ApiModelProperty(name = "当前策略") @ApiModelProperty(name="绿波方向")
private Integer strategyId; private List<GreenwaveDirDTO> greenwaveDirList;
@ApiModelProperty(name = "策略名称")
private String strategyName;
@ApiModelProperty(name = "绿波方向:1 南向北 2 西向东 3 北向南 4 东向西")
private Integer dir;
@ApiModelProperty(name = "推荐最小速度")
private Double minSpeed;
@ApiModelProperty(name = "推荐最大速度")
private Double maxSpeed;
@ApiModelProperty(name = "执行时段")
private String controlOptTimes;
@ApiModelProperty(name = "诱导屏列表")
private List<InduceDTO> induceList;
@ApiModelProperty(name = "绿波带坐标") @ApiModelProperty(name = "绿波带坐标")
private String wkt; private String wkt;
......
...@@ -97,7 +97,7 @@ public class GreenwaveInducesHist implements Serializable { ...@@ -97,7 +97,7 @@ public class GreenwaveInducesHist implements Serializable {
* 0 未发布 1 已发布 * 0 未发布 1 已发布
*/ */
@TableField("status") @TableField("status")
private Integer status; private Integer status=0;
/** /**
* 执行时段 * 执行时段
......
...@@ -54,6 +54,12 @@ public class InduceHist implements Serializable { ...@@ -54,6 +54,12 @@ public class InduceHist implements Serializable {
@TableField("file_path") @TableField("file_path")
private String filePath; private String filePath;
/**
* 建议速度
*/
@TableField("induce_speed")
private String induceSpeed;
/** /**
* 创建时间 * 创建时间
*/ */
......
...@@ -3,7 +3,9 @@ package net.wanji.opt.service; ...@@ -3,7 +3,9 @@ package net.wanji.opt.service;
import net.wanji.databus.bo.CrossIdBO; import net.wanji.databus.bo.CrossIdBO;
import net.wanji.databus.po.CrossDataRealtimePO; import net.wanji.databus.po.CrossDataRealtimePO;
import net.wanji.databus.po.CrossDirDataRealtimePO; import net.wanji.databus.po.CrossDirDataRealtimePO;
import net.wanji.databus.po.TBaseCrossInfo;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
...@@ -12,5 +14,8 @@ import java.util.Map; ...@@ -12,5 +14,8 @@ import java.util.Map;
*/ */
public interface CrossIndexService { public interface CrossIndexService {
Map<Integer, CrossDirDataRealtimePO> crossDirIndex(CrossIdBO crossIdBO); Map<Integer, CrossDirDataRealtimePO> crossDirIndex(CrossIdBO crossIdBO);
CrossDataRealtimePO crossIndex(CrossIdBO crossIdBO); CrossDataRealtimePO crossIndex(CrossIdBO crossIdBO);
List<TBaseCrossInfo> crossInfoList();
} }
package net.wanji.opt.service;
import net.wanji.opt.vo.GreenBeltInfoVO;
/**
* @author duanruiming
* @date 2024/11/19 18:07
*/
public interface GreenBeltInfoService {
/**
* 数据转换
* @param message
* @return
* @throws Exception
*/
GreenBeltInfoVO convertData(String message) throws Exception;
/**
* 存储
* @param infoVO
* @throws Exception
*/
void save(GreenBeltInfoVO infoVO) throws Exception;
}
package net.wanji.opt.service.impl; package net.wanji.opt.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.wanji.databus.bo.CrossIdBO; import net.wanji.databus.bo.CrossIdBO;
import net.wanji.databus.dao.mapper.BaseCrossInfoMapper;
import net.wanji.databus.dao.mapper.CrossDataRealtimeMapper; import net.wanji.databus.dao.mapper.CrossDataRealtimeMapper;
import net.wanji.databus.dao.mapper.CrossDirDataRealtimeMapper; import net.wanji.databus.dao.mapper.CrossDirDataRealtimeMapper;
import net.wanji.databus.po.CrossDataRealtimePO; import net.wanji.databus.po.CrossDataRealtimePO;
import net.wanji.databus.po.CrossDirDataRealtimePO; import net.wanji.databus.po.CrossDirDataRealtimePO;
import net.wanji.databus.po.TBaseCrossInfo;
import net.wanji.opt.service.CrossIndexService; import net.wanji.opt.service.CrossIndexService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
...@@ -27,6 +30,8 @@ public class CrossIndexServiceImpl implements CrossIndexService { ...@@ -27,6 +30,8 @@ public class CrossIndexServiceImpl implements CrossIndexService {
private CrossDirDataRealtimeMapper crossDirDataRealtimeMapper; private CrossDirDataRealtimeMapper crossDirDataRealtimeMapper;
@Resource @Resource
private CrossDataRealtimeMapper crossDataRealtimeMapper; private CrossDataRealtimeMapper crossDataRealtimeMapper;
@Resource
private BaseCrossInfoMapper baseCrossInfoMapper;
@Override @Override
public Map<Integer, CrossDirDataRealtimePO> crossDirIndex(CrossIdBO crossIdBO) { public Map<Integer, CrossDirDataRealtimePO> crossDirIndex(CrossIdBO crossIdBO) {
...@@ -46,4 +51,13 @@ public class CrossIndexServiceImpl implements CrossIndexService { ...@@ -46,4 +51,13 @@ public class CrossIndexServiceImpl implements CrossIndexService {
CrossDataRealtimePO crossDataRealtimePO = crossDataRealtimeMapper.selectByCrossId(crossIdBO.getCrossId()); CrossDataRealtimePO crossDataRealtimePO = crossDataRealtimeMapper.selectByCrossId(crossIdBO.getCrossId());
return crossDataRealtimePO; return crossDataRealtimePO;
} }
@Override
public List<TBaseCrossInfo> crossInfoList() {
LambdaQueryWrapper<TBaseCrossInfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TBaseCrossInfo::getIsSignal, 1);
List<TBaseCrossInfo> baseCrossInfoPOS = baseCrossInfoMapper.selectList(queryWrapper);
return baseCrossInfoPOS;
}
} }
...@@ -490,7 +490,7 @@ public class RunningEvaluateServiceImpl implements RunningEvaluateService { ...@@ -490,7 +490,7 @@ public class RunningEvaluateServiceImpl implements RunningEvaluateService {
crossMetrics.setDelayTime(delayTimeSum / size); crossMetrics.setDelayTime(delayTimeSum / size);
crossMetrics.setEffusionRate(effusionRateSum / size); crossMetrics.setEffusionRate(effusionRateSum / size);
crossMetrics.setEmptyPhase(emptyPhaseSum); crossMetrics.setEmptyPhase(emptyPhaseSum);
Date currentDate = dtoList.get(0).getStartTime(); Date currentDate = dtoList.get(dtoList.size() - 1).getStartTime();
Calendar instance = Calendar.getInstance(); Calendar instance = Calendar.getInstance();
instance.setTime(currentDate); instance.setTime(currentDate);
instance.set(Calendar.HOUR_OF_DAY, Integer.parseInt(section.substring(0, 2))); instance.set(Calendar.HOUR_OF_DAY, Integer.parseInt(section.substring(0, 2)));
......
...@@ -208,11 +208,13 @@ public class TrendServiceImpl implements TrendService { ...@@ -208,11 +208,13 @@ public class TrendServiceImpl implements TrendService {
Double speed = 0.0; Double speed = 0.0;
Double trafficIndex = 1.0; Double trafficIndex = 1.0;
int travelTime = 0; int travelTime = 0;
Integer stopTimes = 0;
GreenwaveListVO wDirVo = new GreenwaveListVO(); GreenwaveListVO wDirVo = new GreenwaveListVO();
for (GreenwaveListVO greenwaveListVO : value) { for (GreenwaveListVO greenwaveListVO : value) {
speed += greenwaveListVO.getSpeed() == null ? 0.0 : greenwaveListVO.getSpeed(); speed += greenwaveListVO.getSpeed() == null ? 0.0 : greenwaveListVO.getSpeed();
trafficIndex += greenwaveListVO.getTrafficIndex() == null ? 0.0 : greenwaveListVO.getTrafficIndex(); trafficIndex += greenwaveListVO.getTrafficIndex() == null ? 0.0 : greenwaveListVO.getTrafficIndex();
travelTime += greenwaveListVO.getTravelTime(); travelTime += greenwaveListVO.getTravelTime();
stopTimes += greenwaveListVO.getStopTimes() == null ? 0 : greenwaveListVO.getStopTimes();
wDirVo.setId(greenId); wDirVo.setId(greenId);
wDirVo.setName(greenwaveListVO.getName()); wDirVo.setName(greenwaveListVO.getName());
wDirVo.setWkt(greenwaveListVO.getWkt()); wDirVo.setWkt(greenwaveListVO.getWkt());
...@@ -222,6 +224,7 @@ public class TrendServiceImpl implements TrendService { ...@@ -222,6 +224,7 @@ public class TrendServiceImpl implements TrendService {
wDirVo.setInfoStatus(greenwaveListVO.getInfoStatus()); wDirVo.setInfoStatus(greenwaveListVO.getInfoStatus());
} }
wDirVo.setSpeed(speed / 2); wDirVo.setSpeed(speed / 2);
wDirVo.setStopTimes((int) (stopTimes / 2));
wDirVo.setTrafficIndex(trafficIndex / 2 < 1 ? 1 : trafficIndex / 2); wDirVo.setTrafficIndex(trafficIndex / 2 < 1 ? 1 : trafficIndex / 2);
wDirVo.setTravelTime(travelTime / 2); wDirVo.setTravelTime(travelTime / 2);
greenwaveListVOList.add(wDirVo); greenwaveListVOList.add(wDirVo);
...@@ -1756,7 +1759,7 @@ public class TrendServiceImpl implements TrendService { ...@@ -1756,7 +1759,7 @@ public class TrendServiceImpl implements TrendService {
AbnormalCrossListVO abnormalCrossListVO = new AbnormalCrossListVO(); AbnormalCrossListVO abnormalCrossListVO = new AbnormalCrossListVO();
// 如果路口编号为空,态势监测页面默认展示拥堵指数第一的路口排队长度数据 // 如果路口编号为空,态势监测页面默认展示拥堵指数第一的路口排队长度数据
if (StringUtils.isBlank(crossId)) { if (StringUtils.isBlank(crossId)) {
Optional<AbnormalCrossListVO> max = signalCrossRealTimeList.stream().max(Comparator.comparingDouble(AbnormalCrossListVO::getCongestionIndex)); Optional<AbnormalCrossListVO> max = signalCrossRealTimeList.stream().max(Comparator.comparingDouble(AbnormalCrossListVO::getTrafficIndex));
if (max.isPresent()) { if (max.isPresent()) {
abnormalCrossListVO = max.get(); abnormalCrossListVO = max.get();
} }
...@@ -1769,7 +1772,7 @@ public class TrendServiceImpl implements TrendService { ...@@ -1769,7 +1772,7 @@ public class TrendServiceImpl implements TrendService {
// 查询当前拥堵指数最大,历史表中一个小时以内数据 // 查询当前拥堵指数最大,历史表中一个小时以内数据
LambdaQueryWrapper<CrossDirDataHistPO> histQuery = new LambdaQueryWrapper<>(); LambdaQueryWrapper<CrossDirDataHistPO> histQuery = new LambdaQueryWrapper<>();
histQuery.eq(CrossDirDataHistPO::getCrossId, abnormalCrossListVO.getId()) histQuery.eq(CrossDirDataHistPO::getCrossId, abnormalCrossListVO.getId())
.between(CrossDirDataHistPO::getBatchTime, abnormalCrossListVO.getBatchTime() - 86400, abnormalCrossListVO.getBatchTime()); .between(CrossDirDataHistPO::getBatchTime, abnormalCrossListVO.getBatchTime() - 3600 * 2, abnormalCrossListVO.getBatchTime());
List<CrossDirDataHistPO> histPOS = crossDirDataHistMapper.selectList(histQuery); List<CrossDirDataHistPO> histPOS = crossDirDataHistMapper.selectList(histQuery);
if (!CollectionUtils.isEmpty(histPOS)) { if (!CollectionUtils.isEmpty(histPOS)) {
Map<Integer, List<CrossDirDataHistPO>> map = histPOS.stream().collect(Collectors.groupingBy(CrossDirDataHistPO::getBatchTime)); Map<Integer, List<CrossDirDataHistPO>> map = histPOS.stream().collect(Collectors.groupingBy(CrossDirDataHistPO::getBatchTime));
......
...@@ -113,6 +113,9 @@ public class InduceSendServiceImpl implements InduceSendService { ...@@ -113,6 +113,9 @@ public class InduceSendServiceImpl implements InduceSendService {
String filePath = uploadFile(image,dirName, fileName); String filePath = uploadFile(image,dirName, fileName);
param.setFtpPath(filePath); param.setFtpPath(filePath);
induceHist.setFilePath(PATH + dirName+"/"+fileName); induceHist.setFilePath(PATH + dirName+"/"+fileName);
if(Objects.nonNull(param.getContents()) && param.getContents().length>0) {
induceHist.setInduceSpeed(param.getContents()[0]);
}
if(Objects.nonNull(greenwaveinduces)) { if(Objects.nonNull(greenwaveinduces)) {
greenwaveinduces.setSourceId(PATH + dirName + "/" + fileName); greenwaveinduces.setSourceId(PATH + dirName + "/" + fileName);
} }
...@@ -146,7 +149,8 @@ public class InduceSendServiceImpl implements InduceSendService { ...@@ -146,7 +149,8 @@ public class InduceSendServiceImpl implements InduceSendService {
// messageProperties.setContentType("text/plain"); // 设置内容类型为text/plain // messageProperties.setContentType("text/plain"); // 设置内容类型为text/plain
// 创建Message并设置内容 // 创建Message并设置内容
// Message messageSend = new Message(message.getBytes(), messageProperties); // Message messageSend = new Message(message.getBytes(), messageProperties);
if(sending) { if(sending)
{
rabbitTemplate.convertAndSend("", queueName, message); rabbitTemplate.convertAndSend("", queueName, message);
} }
log.info("mqtt发送信息-topic:{},queueName:{},message:{}", queueName, message); log.info("mqtt发送信息-topic:{},queueName:{},message:{}", queueName, message);
...@@ -293,15 +297,23 @@ public class InduceSendServiceImpl implements InduceSendService { ...@@ -293,15 +297,23 @@ public class InduceSendServiceImpl implements InduceSendService {
g.drawString(text[0], x, y); g.drawString(text[0], x, y);
} else { // 纵向 } else { // 纵向
// 字体高度的70% // 字体高度的70%
int verticalSpacing = (int) (textHeight * 0.7); int verticalSpacing = (int) (textHeight * 0.95);
// 逐个字符绘制文字 // 逐个字符绘制文字
for (int i = 0; i < text.length; i++) { if(text[0].split("-").length==2) {
if (i == 0) { g.drawString(" "+text[0].split("-")[0], x, y);
g.drawString(text[i], x, y); g.drawString(" |", x, y + (1 * verticalSpacing));
} else { g.drawString(" "+text[0].split("-")[1].replace("km/h",""), x, y + (2 * verticalSpacing));
g.drawString(text[i], x, y + (i * verticalSpacing)); g.drawString("km/h", x, y + (3 * verticalSpacing));
} }else{
g.drawString(text[0], x, y);
} }
// for (int i = 0; i < text[0].split("-")[1]; i++) {
// if (i%2 == 0) {
// g.drawString(text[i], x, y);
// } else {
// g.drawString(text[i], x, y + (i * verticalSpacing));
// }
// }
} }
// 释放资源 // 释放资源
g.dispose(); g.dispose();
......
package net.wanji.opt.service.signalopt;
import net.wanji.opt.vo.GreenBeltFlowStopTimeVO;
import java.util.List;
/**
* @author duanruiming
* @date 2024/11/19 18:07
*/
public interface GreenBeltInfoService {
List<GreenBeltFlowStopTimeVO> greenBeltCrossDetailHist(Integer greenId);
}
package net.wanji.opt.service.signalopt.impl;
import net.wanji.databus.dao.mapper.CrossDataHistMapper;
import net.wanji.databus.dao.mapper.GreenwaveInfoMapper;
import net.wanji.databus.po.CrossDataHistPO;
import net.wanji.opt.service.signalopt.GreenBeltInfoService;
import net.wanji.opt.vo.GreenBeltFlowStopTimeVO;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.ZoneOffset;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author duanruiming
* @date 2024/12/02 13:42
*/
@Service
public class GreenBeltServiceImpl implements GreenBeltInfoService {
@Resource
private GreenwaveInfoMapper greenwaveInfoMapper;
@Resource
private CrossDataHistMapper crossDataHistMapper;
@Override
public List<GreenBeltFlowStopTimeVO> greenBeltCrossDetailHist(Integer greenId) {
List<String> crossIds = greenwaveInfoMapper.selectCrossIdsById(greenId);
long currentTimeMillis = System.currentTimeMillis();
int startSecond = (int) (currentTimeMillis / 1000 - 3600);
int endSecond = (int) (currentTimeMillis / 1000);
List<CrossDataHistPO> crossDataHistPOS = crossDataHistMapper.selectByCrossIdsAndTimestamp(crossIds, startSecond , endSecond);
if (!CollectionUtils.isEmpty(crossDataHistPOS)) {
List<GreenBeltFlowStopTimeVO> results = new ArrayList<>();
Map<Date, List<CrossDataHistPO>> startTimeMap = crossDataHistPOS.stream().collect(Collectors.groupingBy(CrossDataHistPO::getStartTime));
for (Map.Entry<Date, List<CrossDataHistPO>> entry : startTimeMap.entrySet()) {
GreenBeltFlowStopTimeVO greenBeltFlowStopTimeVO = new GreenBeltFlowStopTimeVO();
Date startDate = entry.getKey();
List<GreenBeltFlowStopTimeVO.FlowStopTimeDetail> crossList = new ArrayList<>();
greenBeltFlowStopTimeVO.setStartTime(startDate);
List<CrossDataHistPO> value = entry.getValue();
if (!CollectionUtils.isEmpty(value)) {
for (CrossDataHistPO crossDataHistPO : value) {
GreenBeltFlowStopTimeVO.FlowStopTimeDetail flowStopTimeDetail = new GreenBeltFlowStopTimeVO.FlowStopTimeDetail();
flowStopTimeDetail.setFlow(crossDataHistPO.getFlow());
flowStopTimeDetail.setStopTimes(crossDataHistPO.getStopTimes());
flowStopTimeDetail.setCrossId(crossDataHistPO.getCrossId());
// todo 先删除,后续通过路口距离/速度计算 距离通过卫博发送数据
flowStopTimeDetail.setTravelTime(0.0);
crossList.add(flowStopTimeDetail);
}
}
greenBeltFlowStopTimeVO.setDetailList(crossList);
results.add(greenBeltFlowStopTimeVO);
}
Collections.sort(results, Comparator.comparing(GreenBeltFlowStopTimeVO::getStartTime));
return results;
}
return Collections.EMPTY_LIST;
}
}
...@@ -5,12 +5,10 @@ import io.swagger.annotations.ApiOperation; ...@@ -5,12 +5,10 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponses;
import net.wanji.common.framework.rest.JsonViewObject; import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.opt.dao.mapper.SynthesisOptimizeLogInfoMapper;
import net.wanji.opt.synthesis.pojo.StrategyControlDataEntity; import net.wanji.opt.synthesis.pojo.StrategyControlDataEntity;
import net.wanji.opt.synthesis.pojo.StrategyControlDetailList; import net.wanji.opt.synthesis.pojo.StrategyControlDetailList;
import net.wanji.opt.synthesis.pojo.StrategyControlVO; import net.wanji.opt.synthesis.pojo.vo.StrategyControlVO;
import net.wanji.opt.synthesis.pojo.StrategyFactoryEntity; import net.wanji.opt.synthesis.pojo.StrategyFactoryEntity;
import net.wanji.opt.synthesis.pojo.request.StrategyHistReq;
import net.wanji.opt.synthesis.service.StrategyControlService; import net.wanji.opt.synthesis.service.StrategyControlService;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -30,8 +28,6 @@ public class StrategyControlController { ...@@ -30,8 +28,6 @@ public class StrategyControlController {
@Resource @Resource
private StrategyControlService strategyControlService; private StrategyControlService strategyControlService;
@Resource
SynthesisOptimizeLogInfoMapper synthesisOptimizeLogInfoMapper;
@ApiOperation(value = "策略控制信息操作", notes = "策略控制信息操作", @ApiOperation(value = "策略控制信息操作", notes = "策略控制信息操作",
response = JsonViewObject.class, response = JsonViewObject.class,
...@@ -81,7 +77,18 @@ public class StrategyControlController { ...@@ -81,7 +77,18 @@ public class StrategyControlController {
} }
@ApiOperation(value = "路网优化监测", notes = "路网优化监测", @ApiOperation(value = "AI优化次数优化时长", notes = "路网优化检测-AI优化次数优化时长",
response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@GetMapping(value = "/strategyOptTimes")
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = StrategyControlDataEntity.class),
})
public JsonViewObject strategyOptTimes() throws Exception {
return strategyControlService.strategyOptTimes();
}
@ApiOperation(value = "路网优化监测-接口干线列表", notes = "路网优化监测-AI路口-AI干线",
response = JsonViewObject.class, response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON) produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@GetMapping(value = "/crossOptInfoList") @GetMapping(value = "/crossOptInfoList")
......
...@@ -5,21 +5,26 @@ import io.swagger.annotations.ApiOperation; ...@@ -5,21 +5,26 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponses;
import net.wanji.common.framework.rest.JsonViewObject; import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.opt.synthesis.pojo.vo.GreenBeltAreaIndexVO;
import net.wanji.opt.synthesis.service.impl.StrategyGreenBeltServiceImpl; import net.wanji.opt.synthesis.service.impl.StrategyGreenBeltServiceImpl;
import net.wanji.opt.vo.GreenBeltChartVO; import net.wanji.opt.vo.GreenBeltChartVO;
import net.wanji.opt.vo.GreenBeltInfoVO; import net.wanji.opt.vo.GreenBeltInfoVO;
import org.springframework.web.bind.annotation.*; import net.wanji.opt.vo.GreenBeltStopTimesQueueLengthVO;
import net.wanji.opt.vo.HotspotCrossVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
import java.util.Date; import java.util.List;
/** /**
* @author duanruiming * @author duanruiming
* @date 2024/11/19 20:10 * @date 2024/11/19 20:10
* @description 神思推送绿波时序图 * @description 神思推送绿波时序图
*/ */
@Api(value = "StrategyGreenBeltController", description = "策略绿波带") @Api(value = "StrategyGreenBeltController", description = "策略绿波带弹窗")
@RequestMapping("/strategyBelt") @RequestMapping("/strategyBelt")
@RestController @RestController
public class StrategyGreenBeltController { public class StrategyGreenBeltController {
...@@ -38,4 +43,27 @@ public class StrategyGreenBeltController { ...@@ -38,4 +43,27 @@ public class StrategyGreenBeltController {
return JsonViewObject.newInstance().success(greenBeltChartVO); return JsonViewObject.newInstance().success(greenBeltChartVO);
} }
@ApiOperation(value = "绿波停车次数排队长度", notes = "绿波停车次数排队长度", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@GetMapping(value = "/greenBeltStopTimeQueueLength")
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = HotspotCrossVO.class),
})
public JsonViewObject greenBeltStopTimeQueueLength(Integer greenId) throws Exception {
List<GreenBeltStopTimesQueueLengthVO> results = strategyGreenBeltService.greenBeltStopTimeQueueLength(greenId);
return JsonViewObject.newInstance().success(results);
}
@ApiOperation(value = "绿波子区指标", notes = "绿波子区指标", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@GetMapping(value = "/greenBeltAreaIndex")
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = HotspotCrossVO.class),
})
public JsonViewObject greenBeltAreaIndex(Integer greenId) throws Exception {
GreenBeltAreaIndexVO result = strategyGreenBeltService.greenBeltAreaIndex(greenId);
return JsonViewObject.newInstance().success(result);
}
} }
package net.wanji.opt.synthesis.pojo.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author duanruiming
* @date 2024/12/03 18:59
*/
@Data
@ApiModel("绿波干线子区返回参数")
public class GreenBeltAreaIndexVO {
@ApiModelProperty("子区状态")
private Integer status;
@ApiModelProperty("优化策略")
private String strategyName;
@ApiModelProperty("绿波方向详情")
private List<DirDetail> dirDetail;
@Data
public static class DirDetail {
@ApiModelProperty("绿波名称")
private String dirName;
@ApiModelProperty("行程时间")
private Integer travelTime;
@ApiModelProperty("停车次数")
private Double StopTimes;
}
}
package net.wanji.opt.synthesis.pojo; package net.wanji.opt.synthesis.pojo.vo;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
......
package net.wanji.opt.synthesis.pojo; package net.wanji.opt.synthesis.pojo.vo;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
......
package net.wanji.opt.synthesis.pojo; package net.wanji.opt.synthesis.pojo.vo;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import lombok.Data; import lombok.Data;
import net.wanji.opt.synthesis.pojo.vo.StrategyControlDataVO;
import java.util.List; import java.util.List;
......
package net.wanji.opt.synthesis.pojo.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author duanruiming
* @date 2024/12/04 13:58
*/
@Data
@ApiModel("AI优化次数优化时长返回实体")
public class StrategyOptTimesVO {
@ApiModelProperty("优化次数")
private Integer count;
@ApiModelProperty("优化时长")
private Integer times;
}
...@@ -3,9 +3,8 @@ package net.wanji.opt.synthesis.service; ...@@ -3,9 +3,8 @@ package net.wanji.opt.synthesis.service;
import net.wanji.common.framework.rest.JsonViewObject; import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.opt.synthesis.pojo.StrategyControlDataEntity; import net.wanji.opt.synthesis.pojo.StrategyControlDataEntity;
import net.wanji.opt.synthesis.pojo.StrategyControlDetailList; import net.wanji.opt.synthesis.pojo.StrategyControlDetailList;
import net.wanji.opt.synthesis.pojo.StrategyControlVO; import net.wanji.opt.synthesis.pojo.vo.StrategyControlVO;
import net.wanji.opt.synthesis.pojo.StrategyFactoryEntity; import net.wanji.opt.synthesis.pojo.StrategyFactoryEntity;
import net.wanji.opt.synthesis.pojo.request.StrategyHistReq;
/** /**
* @author duanruiming * @author duanruiming
...@@ -16,6 +15,7 @@ public interface StrategyControlService { ...@@ -16,6 +15,7 @@ public interface StrategyControlService {
JsonViewObject strategyInfoPageList(StrategyControlDataEntity entity) throws Exception; JsonViewObject strategyInfoPageList(StrategyControlDataEntity entity) throws Exception;
JsonViewObject crossStrategyInfoList(Integer type) throws Exception; JsonViewObject crossStrategyInfoList(Integer type) throws Exception;
JsonViewObject strategyOptTimes() throws Exception;
JsonViewObject crossStrategyHistList() throws Exception; JsonViewObject crossStrategyHistList() throws Exception;
JsonViewObject crossOptInfoList(Integer type) throws Exception; JsonViewObject crossOptInfoList(Integer type) throws Exception;
......
package net.wanji.opt.synthesis.service; package net.wanji.opt.synthesis.service;
import net.wanji.opt.synthesis.pojo.vo.GreenBeltAreaIndexVO;
import net.wanji.opt.vo.GreenBeltChartVO; import net.wanji.opt.vo.GreenBeltChartVO;
import net.wanji.opt.vo.GreenBeltStopTimesQueueLengthVO;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* @author duanruiming * @author duanruiming
...@@ -11,4 +14,6 @@ import java.util.Date; ...@@ -11,4 +14,6 @@ import java.util.Date;
public interface StrategyGreenBeltService { public interface StrategyGreenBeltService {
GreenBeltChartVO selectChart(Integer greenId, Date queryDate); GreenBeltChartVO selectChart(Integer greenId, Date queryDate);
List<GreenBeltStopTimesQueueLengthVO> greenBeltStopTimeQueueLength(Integer greenId);
GreenBeltAreaIndexVO greenBeltAreaIndex(Integer greenId);
} }
package net.wanji.opt.synthesis.service.impl; package net.wanji.opt.synthesis.service.impl;
import com.alibaba.excel.util.DateUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.wanji.common.utils.tool.JacksonUtils; import net.wanji.common.utils.tool.JacksonUtils;
import net.wanji.databus.dao.entity.GreenwaveHistPO;
import net.wanji.databus.dao.entity.GreenwaveRealtimePO;
import net.wanji.databus.dao.mapper.GreenwaveHistMapper;
import net.wanji.databus.dao.mapper.GreenwaveRealtimeMapper;
import net.wanji.opt.common.enums.GreenBeltDirEnum;
import net.wanji.opt.dao.mapper.StrategyGreenOptHistMapper; import net.wanji.opt.dao.mapper.StrategyGreenOptHistMapper;
import net.wanji.opt.po.StrategyGreenOptHistEntity; import net.wanji.opt.po.StrategyGreenOptHistEntity;
import net.wanji.opt.synthesis.pojo.vo.GreenBeltAreaIndexVO;
import net.wanji.opt.synthesis.service.StrategyGreenBeltService; import net.wanji.opt.synthesis.service.StrategyGreenBeltService;
import net.wanji.opt.vo.GreenBeltChartVO; import net.wanji.opt.vo.GreenBeltChartVO;
import net.wanji.opt.vo.GreenBeltInfoVO; import net.wanji.opt.vo.GreenBeltInfoVO;
import net.wanji.opt.vo.GreenBeltStopTimesQueueLengthVO;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
...@@ -28,6 +37,63 @@ public class StrategyGreenBeltServiceImpl implements StrategyGreenBeltService { ...@@ -28,6 +37,63 @@ public class StrategyGreenBeltServiceImpl implements StrategyGreenBeltService {
@Resource @Resource
StrategyGreenOptHistMapper strategyGreenOptHistMapper; StrategyGreenOptHistMapper strategyGreenOptHistMapper;
@Resource
GreenwaveHistMapper greenwaveHistMapper;
@Resource
GreenwaveRealtimeMapper greenwaveRealtimeMapper;
@Override
public GreenBeltAreaIndexVO greenBeltAreaIndex(Integer greenId) {
LambdaQueryWrapper<GreenwaveRealtimePO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(GreenwaveRealtimePO::getGreenId, greenId);
List<GreenwaveRealtimePO> realtimePOS = greenwaveRealtimeMapper.selectList(queryWrapper);
GreenBeltAreaIndexVO greenBeltAreaIndexVO = new GreenBeltAreaIndexVO();
Integer status = 1;
if (!CollectionUtils.isEmpty(realtimePOS)) {
List<GreenBeltAreaIndexVO.DirDetail> dirDetails = new ArrayList<>();
for (GreenwaveRealtimePO realtimePO : realtimePOS) {
GreenBeltAreaIndexVO.DirDetail dirDetail = new GreenBeltAreaIndexVO.DirDetail();
String roadDirection = realtimePO.getRoadDirection();
dirDetail.setDirName(GreenBeltDirEnum.getDesc(roadDirection));
dirDetail.setTravelTime(realtimePO.getTrvalTime());
dirDetail.setStopTimes(realtimePO.getStopTimes());
status = status >= realtimePO.getStatus() ? status : realtimePO.getStatus();
dirDetails.add(dirDetail);
}
greenBeltAreaIndexVO.setDirDetail(dirDetails);
greenBeltAreaIndexVO.setStatus(status);
greenBeltAreaIndexVO.setStrategyName("绿波带");
}
return greenBeltAreaIndexVO;
}
@Override
public List<GreenBeltStopTimesQueueLengthVO> greenBeltStopTimeQueueLength(Integer greenId) {
long currentTimeMillis = System.currentTimeMillis();
LambdaQueryWrapper<GreenwaveHistPO> queryWrapper = new LambdaQueryWrapper();
queryWrapper.eq(GreenwaveHistPO::getGreenId, greenId);
// 查询两个小时之前的
Integer startTime = (int) (currentTimeMillis / 1000) - 3600 * 2;
queryWrapper.ge(GreenwaveHistPO::getStartTime, new Date(startTime * 1000L));
List<GreenwaveHistPO> greenwaveHistPOS = greenwaveHistMapper.selectList(queryWrapper);
List<GreenBeltStopTimesQueueLengthVO> results = new ArrayList<>();
if (!CollectionUtils.isEmpty(greenwaveHistPOS)) {
for (GreenwaveHistPO greenwaveHistPO : greenwaveHistPOS) {
GreenBeltStopTimesQueueLengthVO vo = new GreenBeltStopTimesQueueLengthVO();
vo.setGreenId(greenwaveHistPO.getGreenId());
vo.setTimeStamp(greenwaveHistPO.getStartTime());
vo.setHourMinute(DateUtils.format(greenwaveHistPO.getStartTime(), "HH:mm"));
vo.setStopTimes(greenwaveHistPO.getStopTimes());
vo.setCordQueueRatio(greenwaveHistPO.getCordQueueRatio() * 100);
vo.setTravelTime(greenwaveHistPO.getTrvalTime());
results.add(vo);
}
}
List<GreenBeltStopTimesQueueLengthVO> distincts = results.stream().distinct().collect(Collectors.toList());
return distincts;
}
@Override @Override
public GreenBeltChartVO selectChart(Integer greenId, Date queryDate) { public GreenBeltChartVO selectChart(Integer greenId, Date queryDate) {
...@@ -98,6 +164,8 @@ public class StrategyGreenBeltServiceImpl implements StrategyGreenBeltService { ...@@ -98,6 +164,8 @@ public class StrategyGreenBeltServiceImpl implements StrategyGreenBeltService {
Map<String, Double> backDistanceMap = new TreeMap<>(); Map<String, Double> backDistanceMap = new TreeMap<>();
String decideSpeed = ""; String decideSpeed = "";
String backDecideSpeed = ""; String backDecideSpeed = "";
String travelTime = "";
String backtravelTime = "";
// 处理绿波时序图数据 // 处理绿波时序图数据
List<GreenBeltInfoVO.DirGreenDetail> dirGreenDetails = greenBeltInfoVO.getDirGreenDetails(); List<GreenBeltInfoVO.DirGreenDetail> dirGreenDetails = greenBeltInfoVO.getDirGreenDetails();
Double greenWidthTime = 0.0; Double greenWidthTime = 0.0;
...@@ -111,6 +179,8 @@ public class StrategyGreenBeltServiceImpl implements StrategyGreenBeltService { ...@@ -111,6 +179,8 @@ public class StrategyGreenBeltServiceImpl implements StrategyGreenBeltService {
List<GreenBeltInfoVO.CrossGreenDetail> list = dirGreenDetail.getCrossGreenDetailList(); List<GreenBeltInfoVO.CrossGreenDetail> list = dirGreenDetail.getCrossGreenDetailList();
getaDouble(crossRedTimesMap, crossGreenStartMap, distanceMap, cycle, list); getaDouble(crossRedTimesMap, crossGreenStartMap, distanceMap, cycle, list);
decideSpeed = String.join("~", String.valueOf(dirGreenDetail.getMinSpeed()), String.valueOf(dirGreenDetail.getMaxSpeed())); decideSpeed = String.join("~", String.valueOf(dirGreenDetail.getMinSpeed()), String.valueOf(dirGreenDetail.getMaxSpeed()));
List<Double> travelTimeList = list.stream().map(GreenBeltInfoVO.CrossGreenDetail::getTravelTime).collect(Collectors.toList());
travelTime = mapper.writeValueAsString(travelTimeList);
} }
if (dirType == 0) { if (dirType == 0) {
backDecideSpeed = String.join("~", String.valueOf(dirGreenDetail.getMinSpeed()), String.valueOf(dirGreenDetail.getMaxSpeed())); backDecideSpeed = String.join("~", String.valueOf(dirGreenDetail.getMinSpeed()), String.valueOf(dirGreenDetail.getMaxSpeed()));
...@@ -118,7 +188,8 @@ public class StrategyGreenBeltServiceImpl implements StrategyGreenBeltService { ...@@ -118,7 +188,8 @@ public class StrategyGreenBeltServiceImpl implements StrategyGreenBeltService {
List<GreenBeltInfoVO.CrossGreenDetail> list = dirGreenDetail.getCrossGreenDetailList(); List<GreenBeltInfoVO.CrossGreenDetail> list = dirGreenDetail.getCrossGreenDetailList();
Collections.reverse(list); Collections.reverse(list);
getaDouble(backCrossRedTimesMap, backCrossGreenStartMap, backDistanceMap, cycle, list); getaDouble(backCrossRedTimesMap, backCrossGreenStartMap, backDistanceMap, cycle, list);
List<Double> travelTimeList = list.stream().map(GreenBeltInfoVO.CrossGreenDetail::getTravelTime).collect(Collectors.toList());
backtravelTime = mapper.writeValueAsString(travelTimeList);
} }
} }
} }
...@@ -132,6 +203,8 @@ public class StrategyGreenBeltServiceImpl implements StrategyGreenBeltService { ...@@ -132,6 +203,8 @@ public class StrategyGreenBeltServiceImpl implements StrategyGreenBeltService {
greenBeltChartVO.setDistanceMap(mapper.writeValueAsString(distanceMap)); greenBeltChartVO.setDistanceMap(mapper.writeValueAsString(distanceMap));
greenBeltChartVO.setDecideSpeed(decideSpeed.concat("km/h")); greenBeltChartVO.setDecideSpeed(decideSpeed.concat("km/h"));
greenBeltChartVO.setBackDecideSpeed(backDecideSpeed.concat("km/h")); greenBeltChartVO.setBackDecideSpeed(backDecideSpeed.concat("km/h"));
greenBeltChartVO.setTravelTime(travelTime);
greenBeltChartVO.setBackTravelTime(backtravelTime);
return greenBeltChartVO; return greenBeltChartVO;
} }
......
...@@ -43,6 +43,8 @@ public class GreenBeltChartVO { ...@@ -43,6 +43,8 @@ public class GreenBeltChartVO {
private Double BackGreenWidthTime; private Double BackGreenWidthTime;
private String decideSpeed; private String decideSpeed;
private String backDecideSpeed; private String backDecideSpeed;
private String travelTime;
private String backTravelTime;
@JsonCreator @JsonCreator
public GreenBeltChartVO(){ public GreenBeltChartVO(){
......
package net.wanji.opt.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @author duanruiming
* @date 2024/12/02 13:47
*/
@Data
@ApiModel(value = "绿波带历史流量停车次数")
public class GreenBeltFlowStopTimeVO {
@ApiModelProperty("时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "HH:mm", timezone = "GMT+8")
private Date startTime;
@ApiModelProperty("流量停车次数列表")
private List<FlowStopTimeDetail> detailList;
@Data
public static class FlowStopTimeDetail {
@ApiModelProperty("路口编号")
private String crossId;
@ApiModelProperty("流量")
private Integer flow;
@ApiModelProperty("停车次数")
private Double stopTimes;
@ApiModelProperty("行程时间")
private Double travelTime;
}
}
package net.wanji.opt.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author duanruiming
* @date 2024/12/03 13:58
*/
@Data
@ApiModel(value = "重点路口监测实体", description = "重点路口监测实体")
public class GreenBeltStopTimesQueueLengthVO {
@ApiModelProperty("绿波编号")
private Integer greenId;
@ApiModelProperty("时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date timeStamp;
@ApiModelProperty("时间分钟")
private String hourMinute;
@ApiModelProperty("绿波方向")
private String roadDirection;
@ApiModelProperty("停车次数")
private Double stopTimes;
@ApiModelProperty("空间占比")
private Double cordQueueRatio;
@ApiModelProperty("行程时间")
private Integer travelTime;
}
spring: spring:
application:
# dubbo启动需要程序名称
name: signal-optimize-service
cloud: cloud:
nacos: nacos:
config: config:
server-addr: 37.12.182.29:8848 server-addr: 173.17.0.1:8848
file-extension: yaml file-extension: yaml
group: signal group: signal
namespace: signal namespace: signal
username: nacos username: nacos
password: nacos password: nacos
application:
# dubbo启动需要程序名称
name: signal-optimize-service
main: main:
allow-circular-references: true allow-circular-references: true
\ No newline at end of file
...@@ -4,4 +4,8 @@ ...@@ -4,4 +4,8 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="net.wanji.opt.dao.mapper.StrategyGreenOptHistMapper"> <mapper namespace="net.wanji.opt.dao.mapper.StrategyGreenOptHistMapper">
<select id="selectByGreenId" resultType="net.wanji.opt.po.StrategyGreenOptHistEntity" parameterType="String" >
select * from t_strategy_green_opt_hist where `green_id` = #{greenId} and TIMESTAMPDIFF(SECOND,`control_time`, now()) &lt; `control_duration` order by create_time desc limit 2;
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
<dependency> <dependency>
<groupId>net.wanji</groupId> <groupId>net.wanji</groupId>
<artifactId>wj-databus</artifactId> <artifactId>wj-databus</artifactId>
<version>0.0.1</version> <version>0.0.3</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
......
...@@ -21,7 +21,7 @@ public class VNtcipTimeBaseScheduleView { ...@@ -21,7 +21,7 @@ public class VNtcipTimeBaseScheduleView {
@TableField("NTIMEBASESCHEDULEDAY") @TableField("NTIMEBASESCHEDULEDAY")
private Integer nTimeBaseScheduleDay; private Integer nTimeBaseScheduleDay;
@TableField("NTIMEBASESCHEDULEDATE") @TableField("NTIMEBASESCHEDULEDATE")
private Integer nTimeBaseScheduleDate; private Long nTimeBaseScheduleDate;
@TableField("NTIMEBASESCHEDULEDAYPLAN") @TableField("NTIMEBASESCHEDULEDAYPLAN")
private Integer nTimeBaseScheduleDayPlan; private Integer nTimeBaseScheduleDayPlan;
} }
...@@ -369,7 +369,7 @@ public class ControlCommandServiceImpl implements ControlCommandService { ...@@ -369,7 +369,7 @@ public class ControlCommandServiceImpl implements ControlCommandService {
optResult = 2; optResult = 2;
} }
//方案优化记录 //方案优化记录
crossSchemeOptLog(tempSchemeSendVO, tempSchemeSendVO.getSplit(), optResult); crossSchemeOptLogBak(tempSchemeSendVO, tempSchemeSendVO.getSplit(), optResult);
return jsonViewObject; return jsonViewObject;
} }
......
...@@ -639,11 +639,11 @@ public class StaticInfoServiceImpl implements StaticInfoService { ...@@ -639,11 +639,11 @@ public class StaticInfoServiceImpl implements StaticInfoService {
// 星期 // 星期
Integer hisenseWeek = vNtcipTimeBaseScheduleView.getNTimeBaseScheduleDay(); Integer hisenseWeek = vNtcipTimeBaseScheduleView.getNTimeBaseScheduleDay();
// 日期 2147483647 // 日期 2147483647
Integer hisenseDays = vNtcipTimeBaseScheduleView.getNTimeBaseScheduleDate(); Long hisenseDays = vNtcipTimeBaseScheduleView.getNTimeBaseScheduleDate();
// 时段表号 // 时段表号
Integer hisensePlanId = vNtcipTimeBaseScheduleView.getNTimeBaseScheduleDayPlan(); Integer hisensePlanId = vNtcipTimeBaseScheduleView.getNTimeBaseScheduleDayPlan();
String monthsStr = ScheduleUtil.getSchedule(hisenseMonth.longValue(), 1); String monthsStr = ScheduleUtil.getSchedule(hisenseMonth.longValue(), 1);
String daysStr = ScheduleUtil.getSchedule(hisenseDays.longValue(), 2); String daysStr = ScheduleUtil.getSchedule(hisenseDays, 2);
String weekStr = ScheduleUtil.getSchedule(hisenseWeek.longValue(), 3); String weekStr = ScheduleUtil.getSchedule(hisenseWeek.longValue(), 3);
if (StringUtils.isNotBlank(weekStr)) { if (StringUtils.isNotBlank(weekStr)) {
String[] weekSplit = weekStr.split(","); String[] weekSplit = weekStr.split(",");
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
<dependency> <dependency>
<groupId>net.wanji</groupId> <groupId>net.wanji</groupId>
<artifactId>wj-databus</artifactId> <artifactId>wj-databus</artifactId>
<version>0.0.1</version> <version>0.0.3</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
...@@ -278,6 +278,157 @@ ...@@ -278,6 +278,157 @@
</executions> </executions>
</plugin> </plugin>
<!-- mvn clean package -Dmaven.test.skip=true jib:build -DsendCredentialsOverHttp=true -->
<!-- 使用jib 无需深入学习docker, 无需编写Dockerfile -->
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>2.5.2</version>
<!-- 将jib与mvn构建的生命周期绑定 -->
<executions>
<execution>
<id>build-image</id>
<phase>install</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
<configuration>
<!--from节点用来设置镜像的基础镜像,相当于Docerkfile中的FROM关键字-->
<from>
<!--使用harbor上的openjdk镜像-->
<image>${harbor.ip.port}/xinkong/openjdk:8-alpine3.9</image>
<!--harbor服务器的登录信息-->
<auth>
<username>admin</username>
<password>Wanji300552</password>
</auth>
</from>
<to>
<image>${harbor.ip.port}/xinkong/${artifactId}:${version}</image>
<auth>
<username>admin</username>
<password>Wanji300552</password>
</auth>
</to>
<container>
<!--配置jvm虚拟机参数-->
<jvmFlags>
<jvmFlag>-Xms512m</jvmFlag>
<jvmFlag>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=15119</jvmFlag>
</jvmFlags>
<!--配置使用的时区-->
<environment>
<TZ>Asia/Shanghai</TZ>
<spring.profiles.active>dev</spring.profiles.active>
</environment>
<!--要暴露的端口-->
<ports>
<port>39003</port>
<port>15119</port>
<port>5050</port>
</ports>
<!-- <creationTime>2022-10-14T10:08:59.304+08:00</creationTime>-->
<creationTime>${maven.build.timestamp}</creationTime>
<mainClass>net.wanji.utc.hisense.HisenseApplication</mainClass>
</container>
<!--可以进行HTTP-->
<allowInsecureRegistries>true</allowInsecureRegistries>
</configuration>
</plugin>
<!-- maven 打包方式-->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<!--<version>2.6</version>-->
<executions>
<!--将启动脚本复制到指定目录-->
<execution>
<id>copy-bin</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.parent.basedir}/assembly/${project.name}/bin</outputDirectory>
<resources>
<resource>
<directory>src/main/bin</directory>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
<!--将配置文件复制到指定目录-->
<execution>
<id>copy-configs</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.parent.basedir}/assembly/${project.name}/resources
</outputDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>**/bin/*</exclude>
</excludes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<!--将依赖jar包复制到lib目录-->
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.parent.basedir}/assembly/${project.name}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<!--指定生成jar包目录-->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<!--<classpathPrefix>lib/</classpathPrefix>-->
<classpathPrefix></classpathPrefix>
<mainClass> net.wanji.utc.UtcApplication</mainClass>
</manifest>
<manifestEntries>
<Class-Path>../resources/</Class-Path>
</manifestEntries>
</archive>
<excludes>
<exclude>*.**</exclude>
<exclude>*/*.xml</exclude>
<!--<exclude>configs/**/**</exclude>-->
</excludes>
<outputDirectory>${project.parent.basedir}/assembly/${project.name}/lib</outputDirectory>
<classesDirectory>
</classesDirectory>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>
......
...@@ -13,6 +13,7 @@ import net.wanji.databus.po.CrossInfoPO; ...@@ -13,6 +13,7 @@ import net.wanji.databus.po.CrossInfoPO;
import net.wanji.databus.po.ManufacturerInfoPO; import net.wanji.databus.po.ManufacturerInfoPO;
import net.wanji.databus.vo.LightsStatusVO; import net.wanji.databus.vo.LightsStatusVO;
import net.wanji.databus.vo.LightsStatusVO2; import net.wanji.databus.vo.LightsStatusVO2;
import net.wanji.feign.service.EHualuFeignClients;
import net.wanji.feign.service.UtcDTFeignClients; import net.wanji.feign.service.UtcDTFeignClients;
import net.wanji.feign.service.UtcHisenseFeignClients; import net.wanji.feign.service.UtcHisenseFeignClients;
import net.wanji.utc.common.constant.Constants; import net.wanji.utc.common.constant.Constants;
...@@ -78,6 +79,9 @@ public class SignalStatusTask { ...@@ -78,6 +79,9 @@ public class SignalStatusTask {
@Qualifier("net.wanji.feign.service.UtcHisenseFeignClients") @Qualifier("net.wanji.feign.service.UtcHisenseFeignClients")
@Autowired @Autowired
private UtcHisenseFeignClients utcHisenseFeignClients; private UtcHisenseFeignClients utcHisenseFeignClients;
@Qualifier("net.wanji.feign.service.EHualuFeignClients")
@Autowired
private EHualuFeignClients eHualuFeignClients;
private static final ConcurrentHashMap<String, List<LightsStatusVO2>> produceListMap = new ConcurrentHashMap<>(); private static final ConcurrentHashMap<String, List<LightsStatusVO2>> produceListMap = new ConcurrentHashMap<>();
...@@ -174,6 +178,11 @@ public class SignalStatusTask { ...@@ -174,6 +178,11 @@ public class SignalStatusTask {
return mapper.convertValue(jsonViewObject.getContent(), new TypeReference<List<LightsStatusVO>>() { return mapper.convertValue(jsonViewObject.getContent(), new TypeReference<List<LightsStatusVO>>() {
}); });
} }
if (StringUtils.endsWithIgnoreCase(BasicEnum.ManufacturerEnum.EHULU.getCode(), manufacturerInfoPO.getCode())) {
JsonViewObject jsonViewObject = eHualuFeignClients.lightStatus(crossId);
return mapper.convertValue(jsonViewObject.getContent(), new TypeReference<List<LightsStatusVO>>() {
});
}
if (StringUtils.endsWithIgnoreCase("STATIC", manufacturerInfoPO.getCode())) { if (StringUtils.endsWithIgnoreCase("STATIC", manufacturerInfoPO.getCode())) {
LightsStatusVO lightsStatusVO = SignalStatus4StaticSchemeTask.currentCrossLightStatusCache.get(crossId); LightsStatusVO lightsStatusVO = SignalStatus4StaticSchemeTask.currentCrossLightStatusCache.get(crossId);
List<LightsStatusVO> lightsStatusVOS = new ArrayList<>(); List<LightsStatusVO> lightsStatusVOS = new ArrayList<>();
...@@ -198,6 +207,9 @@ public class SignalStatusTask { ...@@ -198,6 +207,9 @@ public class SignalStatusTask {
Map<String, Object> dirLampGroupMap = lightsStatusVO.getDirLampGroupMap(); Map<String, Object> dirLampGroupMap = lightsStatusVO.getDirLampGroupMap();
List<LightsStatusVO2.DirInfo> dirList = new ArrayList<>(); List<LightsStatusVO2.DirInfo> dirList = new ArrayList<>();
Map<String, Object> phaseMap = lightsStatusVO.getPhaseMap(); Map<String, Object> phaseMap = lightsStatusVO.getPhaseMap();
if (Objects.isNull(phaseMap) || phaseMap.isEmpty()) {
continue;
}
for (Map.Entry<String, Object> groupEntry : dirLampGroupMap.entrySet()) { for (Map.Entry<String, Object> groupEntry : dirLampGroupMap.entrySet()) {
LightsStatusVO2.DirInfo dirInfo = new LightsStatusVO2.DirInfo(); LightsStatusVO2.DirInfo dirInfo = new LightsStatusVO2.DirInfo();
String dir = groupEntry.getKey(); String dir = groupEntry.getKey();
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>net.wanji</groupId> <groupId>net.wanji</groupId>
<artifactId>wj-databus</artifactId> <artifactId>wj-databus</artifactId>
<version>0.0.1</version> <version>0.0.3</version>
<name>wj-databus</name> <name>wj-databus</name>
<description>wj-databus</description> <description>wj-databus</description>
......
...@@ -35,6 +35,8 @@ public class CrossSchedulesPO { ...@@ -35,6 +35,8 @@ public class CrossSchedulesPO {
/** 星期:1周一;2周二,3周三,4周四,5周五,6周六,7周日,0特殊日期 */ /** 星期:1周一;2周二,3周三,4周四,5周五,6周六,7周日,0特殊日期 */
@ApiModelProperty(value = "星期:1周一",notes = "2周二,3周三,4周四,5周五,6周六,7周日,0特殊日期") @ApiModelProperty(value = "星期:1周一",notes = "2周二,3周三,4周四,5周五,6周六,7周日,0特殊日期")
private Integer week ; private Integer week ;
@ApiModelProperty(value = "", notes = "预留,字符串形式星期")
private String weeks;
/** 特殊日期 */ /** 特殊日期 */
@ApiModelProperty(value = "特殊日期",notes = "") @ApiModelProperty(value = "特殊日期",notes = "")
private Date specialDate ; private Date specialDate ;
......
package net.wanji.databus.dao.entity; package net.wanji.databus.dao.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -9,10 +11,13 @@ import lombok.Data; ...@@ -9,10 +11,13 @@ import lombok.Data;
*/ */
@Data @Data
@TableName("t_greenwave_hist")
public class GreenwaveHistPO extends GreenwaveRealtimePO{ public class GreenwaveHistPO extends GreenwaveRealtimePO{
@ApiModelProperty(value = "绿波名称") @ApiModelProperty(value = "绿波名称")
@TableField(exist = false)
private String greenwaveName; private String greenwaveName;
@ApiModelProperty(value = "协调方向:0正向;1反向;2双向") @ApiModelProperty(value = "协调方向:0正向;1反向;2双向")
@TableField(exist = false)
private Integer dir; private Integer dir;
} }
package net.wanji.databus.dao.entity; package net.wanji.databus.dao.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
@Data @Data
@JsonIgnoreProperties(ignoreUnknown = true)
@TableName("t_greenwave_realtime")
public class GreenwaveRealtimePO { public class GreenwaveRealtimePO {
/** 绿波ID */ /** 绿波ID */
@ApiModelProperty(name = "id",notes = "") @ApiModelProperty(name = "id",notes = "")
...@@ -56,6 +63,7 @@ public class GreenwaveRealtimePO { ...@@ -56,6 +63,7 @@ public class GreenwaveRealtimePO {
private Double uncoordinatePhaseQueue ; private Double uncoordinatePhaseQueue ;
/** 创建时间 */ /** 创建时间 */
@ApiModelProperty(name = "数据时间",notes = "") @ApiModelProperty(name = "数据时间",notes = "")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date startTime ; private Date startTime ;
/** 创建时间 */ /** 创建时间 */
@ApiModelProperty(name = "创建时间",notes = "") @ApiModelProperty(name = "创建时间",notes = "")
...@@ -63,4 +71,30 @@ public class GreenwaveRealtimePO { ...@@ -63,4 +71,30 @@ public class GreenwaveRealtimePO {
/** 修改时间 */ /** 修改时间 */
@ApiModelProperty(name = "修改时间",notes = "") @ApiModelProperty(name = "修改时间",notes = "")
private Date gmtModified ; private Date gmtModified ;
/** add 20241123 适配神思数据 */
@ApiModelProperty(value = "执行策略 失衡 2拥堵 3溢出 4死锁 5 空放", notes = "")
private Integer strategy;
@ApiModelProperty(value = "策略执行持续时间;单位:s", notes = "")
private Integer strategyDuration;
@ApiModelProperty(value = "优化执行次数", notes = "")
private Integer optimizeCount;
@ApiModelProperty(value = "优化时长,单位秒", notes = "")
private Integer optimizeSeconds;
@ApiModelProperty(value = "绿波带宽,单位秒", notes = "")
private Integer greenWaveWidth;
@ApiModelProperty(value = "协调方向 0正向 1反向 2双向", notes = "")
private Integer direction;
@ApiModelProperty(value = "方案周期,单位秒", notes = "")
private Integer planCycle;
@ApiModelProperty(value = "方推荐速度上限 km/h", notes = "")
private Integer speedHigh;
@ApiModelProperty(value = "推荐速度下限 km/h", notes = "")
@JsonProperty("speedLow")
private Integer speedDown;
@ApiModelProperty(value = "推荐速度下限 km/h", notes = "")
private String roadDirection;
@ApiModelProperty(value = "饱和度", notes = "")
private Integer sturation;
@ApiModelProperty(name = "采集时间(10位时间戳)",notes = "")
public Integer batchTime ;
} }
package net.wanji.databus.dao.mapper; package net.wanji.databus.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import net.wanji.databus.dao.entity.GreenwaveHistPO; import net.wanji.databus.dao.entity.GreenwaveHistPO;
import net.wanji.databus.dao.entity.GreenwaveHistPOExt; import net.wanji.databus.dao.entity.GreenwaveHistPOExt;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -13,7 +14,7 @@ import java.util.List; ...@@ -13,7 +14,7 @@ import java.util.List;
* @date 2022/10/31 11:03 * @date 2022/10/31 11:03
*/ */
@Repository @Repository
public interface GreenwaveHistMapper { public interface GreenwaveHistMapper extends BaseMapper<GreenwaveHistPO> {
List<GreenwaveHistPOExt> selectRunMonitor(Date nowTime); List<GreenwaveHistPOExt> selectRunMonitor(Date nowTime);
List<GreenwaveHistPO> selectByTimeSection(String startTimeStr, String endTimeStr); List<GreenwaveHistPO> selectByTimeSection(String startTimeStr, String endTimeStr);
......
...@@ -5,6 +5,7 @@ import net.wanji.databus.vo.GreenwaveListVO; ...@@ -5,6 +5,7 @@ import net.wanji.databus.vo.GreenwaveListVO;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 态势监测-绿波基础信息 * 态势监测-绿波基础信息
...@@ -23,4 +24,6 @@ public interface GreenwaveInfoMapper { ...@@ -23,4 +24,6 @@ public interface GreenwaveInfoMapper {
List<GreenwaveInfoPO> selectAll(); List<GreenwaveInfoPO> selectAll();
GreenwaveInfoPO selectByName(String greenwaveName); GreenwaveInfoPO selectByName(String greenwaveName);
List<GreenwaveInfoPO> findByMap(Map params);
} }
package net.wanji.databus.dao.mapper; package net.wanji.databus.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import feign.Param; import feign.Param;
import net.wanji.databus.dao.entity.GreenwaveRealtimePO; import net.wanji.databus.dao.entity.GreenwaveRealtimePO;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.Collection;
import java.util.List; import java.util.List;
/** /**
...@@ -11,10 +13,12 @@ import java.util.List; ...@@ -11,10 +13,12 @@ import java.util.List;
* @date 2022/10/31 11:03 * @date 2022/10/31 11:03
*/ */
@Repository @Repository
public interface GreenwaveRealtimeMapper { public interface GreenwaveRealtimeMapper extends BaseMapper<GreenwaveRealtimePO> {
GreenwaveRealtimePO selectById(Integer id); GreenwaveRealtimePO selectById(Integer id);
int insertBatch(@Param("list") List<GreenwaveRealtimePO> list); int insertBatch(@Param("list") List<GreenwaveRealtimePO> list);
int deleteOne(@Param("greenId") Integer greenId); int deleteOne(@Param("greenId") Integer greenId);
void deleteBatch(@Param("list") Collection<Integer> greenIds);
} }
...@@ -2,9 +2,11 @@ package net.wanji.databus.po; ...@@ -2,9 +2,11 @@ package net.wanji.databus.po;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.omg.CORBA.UNKNOWN;
import java.util.Date; import java.util.Date;
...@@ -190,4 +192,19 @@ public class CrossDataRealtimePO { ...@@ -190,4 +192,19 @@ public class CrossDataRealtimePO {
private double timeOccupancy; private double timeOccupancy;
@ApiModelProperty(value = "空间占有率", notes = "平均空间密度(长度占比)") @ApiModelProperty(value = "空间占有率", notes = "平均空间密度(长度占比)")
private double vehicleLengthRatioMean; private double vehicleLengthRatioMean;
/** add 20241123 适配神思数据 */
@ApiModelProperty(value = "执行策略 失衡 2拥堵 3溢出 4死锁 5 空放", notes = "")
private Integer strategy;
@ApiModelProperty(value = "策略执行持续时间;单位:s", notes = "")
@TableField("strategy_duration")
private Integer strategyDuration;
@ApiModelProperty(value = "优化执行次数", notes = "")
@TableField("optimize_count")
private Integer optimizeCount;
@ApiModelProperty(value = "优化时长,单位秒", notes = "")
@TableField("optimize_seconds")
private Integer optimizeSeconds;
@ApiModelProperty(value = "是否空放 0否 1是", notes = "")
@TableField("empty_pass")
private Integer emptyPass;
} }
...@@ -50,6 +50,8 @@ public class AbnormalCrossListVO { ...@@ -50,6 +50,8 @@ public class AbnormalCrossListVO {
private Integer isSpillover; private Integer isSpillover;
@ApiModelProperty(value = "是否拥堵:0否;1是") @ApiModelProperty(value = "是否拥堵:0否;1是")
private Integer isCongestion; private Integer isCongestion;
@ApiModelProperty(value = "交通指数")
private Double trafficIndex;
@ApiModelProperty(value = "拥堵指数") @ApiModelProperty(value = "拥堵指数")
private Double congestionIndex; private Double congestionIndex;
@ApiModelProperty(value = "失衡指数") @ApiModelProperty(value = "失衡指数")
......
...@@ -42,6 +42,8 @@ public class GreenwaveListVO { ...@@ -42,6 +42,8 @@ public class GreenwaveListVO {
@ApiModelProperty(value = "行程速度") @ApiModelProperty(value = "行程速度")
@JsonSerialize(using = DoubleToTwoDecimalPlacesSerializer.class) @JsonSerialize(using = DoubleToTwoDecimalPlacesSerializer.class)
private Double speed; private Double speed;
@ApiModelProperty(value = "停车次数")
private Integer stopTimes;
@ApiModelProperty(value = "路口列表") @ApiModelProperty(value = "路口列表")
private List<CrossListElement> crossList; private List<CrossListElement> crossList;
......
...@@ -233,6 +233,7 @@ ...@@ -233,6 +233,7 @@
AND schedules.`week` = #{week} AND schedules.`week` = #{week}
AND DATE_FORMAT( NOW(), '%H:%i' ) BETWEEN DATE_FORMAT( CAST( section.start_time AS TIME ), '%H:%i' ) AND DATE_FORMAT( NOW(), '%H:%i' ) BETWEEN DATE_FORMAT( CAST( section.start_time AS TIME ), '%H:%i' )
AND DATE_FORMAT( CAST( section.end_time AS TIME ), '%H:%i' ) AND DATE_FORMAT( CAST( section.end_time AS TIME ), '%H:%i' )
ORDER BY DATE_FORMAT( CAST( section.end_time AS TIME ), '%H:%i' ) ASC LIMIT 1
</select> </select>
......
...@@ -45,6 +45,12 @@ ...@@ -45,6 +45,12 @@
<result column="traffic_flow_C" property="trafficFlowC"></result> <result column="traffic_flow_C" property="trafficFlowC"></result>
<result column="vehicle_length_ratio_mean" property="vehicleLengthRatioMean"></result> <result column="vehicle_length_ratio_mean" property="vehicleLengthRatioMean"></result>
<result column="time_occupancy" property="timeOccupancy"></result> <result column="time_occupancy" property="timeOccupancy"></result>
<!-- add 20241123 适配神思数据 -->
<result column="strategy" property="strategy"></result>
<result column="strategy_duration" property="strategyDuration"></result>
<result column="optimize_count" property="optimizeCount"></result>
<result column="optimize_seconds" property="optimizeSeconds"></result>
<result column="empty_pass" property="emptyPass"></result>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
...@@ -53,7 +59,8 @@ ...@@ -53,7 +59,8 @@
flow, flow_rate, speed, queue_length, stop_times, delay_time, sturation, batch_time, gmt_create, gmt_modified, flow, flow_rate, speed, queue_length, stop_times, delay_time, sturation, batch_time, gmt_create, gmt_modified,
clear_rate,load_balance,not_clear_car_nums,green_light_efficiency,effusion_rate, clear_rate,load_balance,not_clear_car_nums,green_light_efficiency,effusion_rate,
no_stop_rate,one_stop_rate,two_stop_rate,three_stop_rate,non_motor_flow,v_85, no_stop_rate,one_stop_rate,two_stop_rate,three_stop_rate,non_motor_flow,v_85,
traffic_flow_A,traffic_flow_B,traffic_flow_C,vehicle_length_ratio_mean,time_occupancy traffic_flow_A,traffic_flow_B,traffic_flow_C,vehicle_length_ratio_mean,time_occupancy,
strategy, strategy_duration, optimize_count, optimize_seconds, empty_pass
</sql> </sql>
<insert id="insertBatch" parameterType="net.wanji.databus.po.CrossDataHistPO"> <insert id="insertBatch" parameterType="net.wanji.databus.po.CrossDataHistPO">
...@@ -67,7 +74,9 @@ ...@@ -67,7 +74,9 @@
#{entity.clearRate},#{entity.loadBalance},#{entity.notClearCarNums},#{entity.greenLightEfficiency},#{entity.effusionRate}, #{entity.clearRate},#{entity.loadBalance},#{entity.notClearCarNums},#{entity.greenLightEfficiency},#{entity.effusionRate},
#{entity.noStopRate},#{entity.oneStopRate},#{entity.twoStopRate},#{entity.threeStopRate}, #{entity.noStopRate},#{entity.oneStopRate},#{entity.twoStopRate},#{entity.threeStopRate},
#{entity.nonMotorFlow},#{entity.v85},#{entity.trafficFlowA},#{entity.trafficFlowB}, #{entity.nonMotorFlow},#{entity.v85},#{entity.trafficFlowA},#{entity.trafficFlowB},
#{entity.trafficFlowC},#{entity.vehicleLengthRatioMean},#{entity.timeOccupancy}) #{entity.trafficFlowC},#{entity.vehicleLengthRatioMean},#{entity.timeOccupancy},
#{entity.strategy}, #{entity.strategyDuration}, #{entity.optimizeCount}, #{entity.optimizeSeconds}, #{entity.emptyPass}
)
</foreach> </foreach>
</insert> </insert>
......
...@@ -45,6 +45,12 @@ ...@@ -45,6 +45,12 @@
<result column="traffic_flow_C" property="trafficFlowC"></result> <result column="traffic_flow_C" property="trafficFlowC"></result>
<result column="vehicle_length_ratio_mean" property="vehicleLengthRatioMean"></result> <result column="vehicle_length_ratio_mean" property="vehicleLengthRatioMean"></result>
<result column="time_occupancy" property="timeOccupancy"></result> <result column="time_occupancy" property="timeOccupancy"></result>
<!-- add 20241123 适配神思数据 -->
<result column="strategy_duration" property="strategyDuration"></result>
<result column="optimize_count" property="optimizeCount"></result>
<result column="optimize_seconds" property="optimizeSeconds"></result>
<result column="empty_pass" property="emptyPass"></result>
<result column="strategy" property="strategy"></result>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
...@@ -53,7 +59,8 @@ ...@@ -53,7 +59,8 @@
queue_length,stop_times,delay_time,sturation,batch_time,gmt_create,gmt_modified,clear_rate,end_time, queue_length,stop_times,delay_time,sturation,batch_time,gmt_create,gmt_modified,clear_rate,end_time,
load_balance,not_clear_car_nums,green_light_efficiency,effusion_rate, load_balance,not_clear_car_nums,green_light_efficiency,effusion_rate,
no_stop_rate,one_stop_rate,two_stop_rate,three_stop_rate,non_motor_flow,v_85, no_stop_rate,one_stop_rate,two_stop_rate,three_stop_rate,non_motor_flow,v_85,
traffic_flow_A,traffic_flow_B,traffic_flow_C,vehicle_length_ratio_mean,time_occupancy traffic_flow_A,traffic_flow_B,traffic_flow_C,vehicle_length_ratio_mean,time_occupancy,
strategy, strategy_duration, optimize_count, optimize_seconds, empty_pass
</sql> </sql>
<insert id="insertBatch" parameterType="net.wanji.databus.po.CrossDataRealtimePO"> <insert id="insertBatch" parameterType="net.wanji.databus.po.CrossDataRealtimePO">
...@@ -67,7 +74,9 @@ ...@@ -67,7 +74,9 @@
#{entity.clearRate},#{entity.endTime},#{entity.loadBalance},#{entity.notClearCarNums},#{entity.greenLightEfficiency},#{entity.effusionRate}, #{entity.clearRate},#{entity.endTime},#{entity.loadBalance},#{entity.notClearCarNums},#{entity.greenLightEfficiency},#{entity.effusionRate},
#{entity.noStopRate},#{entity.oneStopRate},#{entity.twoStopRate},#{entity.threeStopRate}, #{entity.noStopRate},#{entity.oneStopRate},#{entity.twoStopRate},#{entity.threeStopRate},
#{entity.nonMotorFlow},#{entity.v85},#{entity.trafficFlowA},#{entity.trafficFlowB},#{entity.trafficFlowC}, #{entity.nonMotorFlow},#{entity.v85},#{entity.trafficFlowA},#{entity.trafficFlowB},#{entity.trafficFlowC},
#{entity.vehicleLengthRatioMean},#{entity.timeOccupancy}) #{entity.vehicleLengthRatioMean},#{entity.timeOccupancy},
#{entity.strategy}, #{entity.strategyDuration}, #{entity.optimizeCount}, #{entity.optimizeSeconds}, #{entity.emptyPass}
)
</foreach> </foreach>
</insert> </insert>
...@@ -84,7 +93,7 @@ ...@@ -84,7 +93,7 @@
select select
t2.id, t2.name, t2.is_signal, t1.unbalance_dirs, t1.congestion_dirs, t1.spillover_dirs, t1.status as realtimeStatus, t2.id, t2.name, t2.is_signal, t1.unbalance_dirs, t1.congestion_dirs, t1.spillover_dirs, t1.status as realtimeStatus,
t1.start_time, t1.duration, t2.location as locationStr, t1.is_unbalance, t1.is_spillover, t1.is_congestion, t1.start_time, t1.duration, t2.location as locationStr, t1.is_unbalance, t1.is_spillover, t1.is_congestion,
t1.congestion_index, t1.unbalance_index, t1.spillover_index, t1.batch_time t1.congestion_index, t1.unbalance_index, t1.spillover_index, t1.batch_time, t1.traffic_index
from t_cross_data_realtime t1 JOIN t_base_cross_info t2 from t_cross_data_realtime t1 JOIN t_base_cross_info t2
on t1.cross_id = t2.id on t1.cross_id = t2.id
<where> <where>
......
...@@ -11,14 +11,18 @@ ...@@ -11,14 +11,18 @@
<result property="specialDate" column="special_date"/> <result property="specialDate" column="special_date"/>
<result property="gmtCreate" column="gmt_create"/> <result property="gmtCreate" column="gmt_create"/>
<result property="gmtModified" column="gmt_modified"/> <result property="gmtModified" column="gmt_modified"/>
<result property="months" column="months"/>
<result property="weeks" column="weeks"/>
<result property="days" column="days"/>
</resultMap> </resultMap>
<!-- 批量新增数据 --> <!-- 批量新增数据 -->
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true"> <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into t_cross_schedules(id,schedule_no,name,cross_id,plan_id,week,special_date) insert into t_cross_schedules(id,schedule_no,name,cross_id,plan_id,week,special_date,months,weeks,days)
values values
<foreach collection="entities" item="entity" separator=","> <foreach collection="entities" item="entity" separator=",">
(#{entity.id},#{entity.scheduleNo},#{entity.name},#{entity.crossId},#{entity.planId},#{entity.week},#{entity.specialDate}) (#{entity.id},#{entity.scheduleNo},#{entity.name},#{entity.crossId},#{entity.planId},#{entity.week},
#{entity.specialDate},#{entity.months},#{entity.weeks},#{entity.days})
</foreach> </foreach>
</insert> </insert>
...@@ -29,7 +33,7 @@ ...@@ -29,7 +33,7 @@
<select id="selectByCrossIds" resultMap="BaseResultMap"> <select id="selectByCrossIds" resultMap="BaseResultMap">
select select
id,schedule_no,name,cross_id,plan_id,week,special_date,gmt_create,gmt_modified id,schedule_no,name,cross_id,plan_id,week,special_date,gmt_create,gmt_modified,months,weeks,days
from t_cross_schedules from t_cross_schedules
where cross_id in where cross_id in
<foreach collection="crossIds" item="crossId" separator="," open="(" close=")"> <foreach collection="crossIds" item="crossId" separator="," open="(" close=")">
......
...@@ -21,11 +21,21 @@ ...@@ -21,11 +21,21 @@
<result property="startTime" column="start_time"/> <result property="startTime" column="start_time"/>
<result property="gmtCreate" column="gmt_create"/> <result property="gmtCreate" column="gmt_create"/>
<result property="gmtModified" column="gmt_modified"/> <result property="gmtModified" column="gmt_modified"/>
<!-- add 20241123 适配神思数据 -->
<result column="strategy" property="strategy"></result>
<result column="strategy_duration" property="strategyDuration"></result>
<result column="optimize_count" property="optimizeCount"></result>
<result column="optimize_seconds" property="optimizeSeconds"></result>
<result column="empty_pass" property="emptyPass"></result>
<result column="batch_time" property="batchTime"></result>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, green_id, status,type,traffic_index,speed,trval_time,stop_times,queue_length,cong_rate,delay_time,nopark_pass_rate, id, green_id, status,type,traffic_index,speed,trval_time,stop_times,queue_length,cong_rate,delay_time,nopark_pass_rate,
cord_reliability,cord_queue_ratio,uncoordinate_phase_queue, start_time, gmt_create,gmt_modified cord_reliability,cord_queue_ratio,uncoordinate_phase_queue, start_time, gmt_create,gmt_modified,
strategy, strategy_duration, optimize_count, optimize_seconds,
green_wave_width, direction, plan_cycle, speed_high, speed_down, road_direction, sturation, batch_time
</sql> </sql>
<select id="selectRunMonitor" resultType="net.wanji.databus.dao.entity.GreenwaveHistPOExt"> <select id="selectRunMonitor" resultType="net.wanji.databus.dao.entity.GreenwaveHistPOExt">
...@@ -82,7 +92,11 @@ ...@@ -82,7 +92,11 @@
(#{entity.id}, #{entity.greenId}, #{entity.status}, #{entity.type}, #{entity.trafficIndex},#{entity.speed}, (#{entity.id}, #{entity.greenId}, #{entity.status}, #{entity.type}, #{entity.trafficIndex},#{entity.speed},
#{entity.trvalTime}, #{entity.stopTimes}, #{entity.queueLength}, #{entity.congRate}, #{entity.trvalTime}, #{entity.stopTimes}, #{entity.queueLength}, #{entity.congRate},
#{entity.delayTime}, #{entity.noparkPassRate}, #{entity.cordReliability}, #{entity.cordQueueRatio}, #{entity.delayTime}, #{entity.noparkPassRate}, #{entity.cordReliability}, #{entity.cordQueueRatio},
#{entity.uncoordinatePhaseQueue}, #{entity.startTime}, #{entity.gmtCreate}, #{entity.gmtModified}) #{entity.uncoordinatePhaseQueue}, #{entity.startTime}, #{entity.gmtCreate}, #{entity.gmtModified},
#{entity.strategy}, #{entity.strategyDuration}, #{entity.optimizeCount}, #{entity.optimizeSeconds},
#{entity.greenWaveWidth}, #{entity.direction}, #{entity.planCycle}, #{entity.speedHigh},
#{entity.speedDown}, #{entity.roadDirection}, #{entity.sturation}, #{entity.batchTime}
)
</foreach> </foreach>
</insert> </insert>
......
...@@ -48,4 +48,13 @@ ...@@ -48,4 +48,13 @@
where name = #{greenwaveName} where name = #{greenwaveName}
</select> </select>
<select id="findByMap" resultType="net.wanji.databus.dao.entity.GreenwaveInfoPO" parameterType="java.util.Map">
SELECT <include refid="Base_Column_List"></include>
FROM t_greenwave_info WHERE 1=1
<if test="keyword != null and keyword != ''">
AND ( locate(#{keyword,jdbcType=VARCHAR}, `name`)>0 )
</if>
</select>
</mapper> </mapper>
...@@ -21,11 +21,28 @@ ...@@ -21,11 +21,28 @@
<result property="startTime" column="start_time"/> <result property="startTime" column="start_time"/>
<result property="gmtCreate" column="gmt_create"/> <result property="gmtCreate" column="gmt_create"/>
<result property="gmtModified" column="gmt_modified"/> <result property="gmtModified" column="gmt_modified"/>
<!-- add 20241123 适配神思数据 -->
<result column="strategy" property="strategy"></result>
<result column="strategy_duration" property="strategyDuration"></result>
<result column="optimize_count" property="optimizeCount"></result>
<result column="optimize_seconds" property="optimizeSeconds"></result>
<result column="green_wave_width" property="greenWaveWidth"></result>
<result column="direction" property="direction"></result>
<result column="plan_cycle" property="planCycle"></result>
<result column="speed_high" property="speedHigh"></result>
<result column="speed_down" property="speedDown"></result>
<result column="road_direction" property="roadDirection"></result>
<result column="sturation" property="sturation"></result>
<result column="batch_time" property="batchTime"></result>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, green_id, status,type,traffic_index,speed,trval_time,stop_times,queue_length,cong_rate,delay_time,nopark_pass_rate, id, green_id, status,type,traffic_index,speed,trval_time,stop_times,queue_length,cong_rate,delay_time,nopark_pass_rate,
cord_reliability, cord_queue_ratio, uncoordinate_phase_queue, start_time, gmt_create,gmt_modified cord_reliability, cord_queue_ratio, uncoordinate_phase_queue, start_time, gmt_create,gmt_modified,
strategy, strategy_duration, optimize_count, optimize_seconds,
green_wave_width, direction, plan_cycle, speed_high, speed_down, road_direction, sturation, batch_time
</sql> </sql>
<select id="selectById" resultType="net.wanji.databus.dao.entity.GreenwaveRealtimePO"> <select id="selectById" resultType="net.wanji.databus.dao.entity.GreenwaveRealtimePO">
...@@ -43,7 +60,11 @@ ...@@ -43,7 +60,11 @@
(#{entity.id}, #{entity.greenId}, #{entity.status}, #{entity.type}, #{entity.trafficIndex}, #{entity.speed}, (#{entity.id}, #{entity.greenId}, #{entity.status}, #{entity.type}, #{entity.trafficIndex}, #{entity.speed},
#{entity.trvalTime}, #{entity.stopTimes}, #{entity.queueLength}, #{entity.congRate}, #{entity.trvalTime}, #{entity.stopTimes}, #{entity.queueLength}, #{entity.congRate},
#{entity.delayTime}, #{entity.noparkPassRate}, #{entity.cordReliability}, #{entity.cordQueueRatio}, #{entity.delayTime}, #{entity.noparkPassRate}, #{entity.cordReliability}, #{entity.cordQueueRatio},
#{entity.uncoordinatePhaseQueue}, #{entity.startTime}, #{entity.gmtCreate}, #{entity.gmtModified}) #{entity.uncoordinatePhaseQueue}, #{entity.startTime}, #{entity.gmtCreate}, #{entity.gmtModified},
#{entity.strategy}, #{entity.strategyDuration}, #{entity.optimizeCount}, #{entity.optimizeSeconds},
#{entity.greenWaveWidth}, #{entity.direction}, #{entity.planCycle}, #{entity.speedHigh},
#{entity.speedDown}, #{entity.roadDirection}, #{entity.sturation}, #{entity.batchTime}
)
</foreach> </foreach>
</insert> </insert>
...@@ -56,4 +77,12 @@ ...@@ -56,4 +77,12 @@
</where> </where>
</delete> </delete>
<delete id="deleteBatch" parameterType="String">
delete from t_greenwave_realtime
where green_id in
<foreach collection="list" item="greenId" separator="," open="(" close=")">
#{greenId}
</foreach>
</delete>
</mapper> </mapper>
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