Commit 25b55bf1 authored by zhouleilei's avatar zhouleilei

新增海信-获取设置临时方案、恢复固定配时、根据方案号获取配时方案环图、延长相位、步进

parent edb74efe
...@@ -14,11 +14,5 @@ import org.springframework.web.bind.annotation.RequestParam; ...@@ -14,11 +14,5 @@ import org.springframework.web.bind.annotation.RequestParam;
@FeignClient(name = "UtcHisenseFeignClients", url = "${utc.hisense.service.url}", @FeignClient(name = "UtcHisenseFeignClients", url = "${utc.hisense.service.url}",
configuration = FeignHisenseClientsConfig.class) configuration = FeignHisenseClientsConfig.class)
public interface UtcHisenseFeignClients extends FeignCommon { public interface UtcHisenseFeignClients extends FeignCommon {
/**
* 海信-获取方案号
*
* @return
*/
@PostMapping("/staticInfo/crossSchemeNo")
JsonViewObject getSchemeNo(@RequestParam String crossId);
} }
...@@ -2,8 +2,7 @@ package net.wanji.feign.service.common; ...@@ -2,8 +2,7 @@ package net.wanji.feign.service.common;
import net.wanji.common.framework.rest.JsonViewObject; import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.databus.bo.CrossIdBO; import net.wanji.databus.bo.CrossIdBO;
import net.wanji.databus.dto.CrossSchedulesDTO; import net.wanji.databus.dto.*;
import net.wanji.databus.dto.PlanSectionDTO;
import net.wanji.databus.po.SaveToUtcPO; import net.wanji.databus.po.SaveToUtcPO;
import net.wanji.databus.vo.*; import net.wanji.databus.vo.*;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
...@@ -20,6 +19,7 @@ public interface FeignCommon { ...@@ -20,6 +19,7 @@ public interface FeignCommon {
/** /**
* 信号机状态 * 信号机状态
*
* @return * @return
*/ */
@PostMapping("/signalStatus/runningStatusAlarm") @PostMapping("/signalStatus/runningStatusAlarm")
...@@ -106,9 +106,11 @@ public interface FeignCommon { ...@@ -106,9 +106,11 @@ public interface FeignCommon {
// 查询信号机时间 // 查询信号机时间
@PostMapping("/signalTime") @PostMapping("/signalTime")
JsonViewObject signalTime(@RequestParam String crossId); JsonViewObject signalTime(@RequestParam String crossId);
// 信号机校时 // 信号机校时
@PostMapping("/signalTiming") @PostMapping("/signalTiming")
JsonViewObject signalTiming(@RequestParam String crossCode, @RequestParam Date date); JsonViewObject signalTiming(@RequestParam String crossCode, @RequestParam Date date);
// 临时方案 // 临时方案
@PostMapping("/tempScheme") @PostMapping("/tempScheme")
JsonViewObject tempScheme(@RequestParam String crossCode, @RequestParam Integer schemeNo); JsonViewObject tempScheme(@RequestParam String crossCode, @RequestParam Integer schemeNo);
...@@ -116,5 +118,24 @@ public interface FeignCommon { ...@@ -116,5 +118,24 @@ public interface FeignCommon {
@PostMapping("/control/findPlanId") @PostMapping("/control/findPlanId")
Integer findPlanId(@RequestParam Date datetime, @RequestParam String dateStr, @RequestParam String crossId); Integer findPlanId(@RequestParam Date datetime, @RequestParam String dateStr, @RequestParam String crossId);
// 海信-获取方案号
@PostMapping("/staticInfo/crossSchemeNo")
JsonViewObject getSchemeNo(@RequestParam String crossId);
// 海信-下发临时方案
@PostMapping("/controlCommand/tempSchemeDetail")
JsonViewObject tempSchemeDetail(@RequestBody TempSchemeSendVO tempDetailVo);
// 海信-方案环图请求
@PostMapping("/staticInfo/crossSchemeRings")
JsonViewObject crossSchemeRings(@RequestBody CrossSchemeRingsDTO crossSchemeRingsDTO);
// 海信-延长相位
@PostMapping("/controlCommand/extendPhase")
JsonViewObject extendPhase(@RequestBody ExtendPhaseDTO extendPhase);
// 海信-步进相位
@PostMapping("/controlCommand/stepingPhase")
JsonViewObject stepingPhase(@RequestBody StepingPhaseDTO stepingPhaseDTO);
} }
utc.service.url=http://10.102.1.182:32000/utc 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://10.102.1.182: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
utc.service.url=http://173.17.0.1:32000/utc utc.service.url=http://173.17.0.1:32000/utc
utc.dt.service.url=http://173.17.0.1:39002/utc-dt utc.dt.service.url=http://173.17.0.1:39002/utc-dt
utc.hisense.service.url=http://173.17.0.1:39003/utc-hisense utc.hisense.service.url=http://192.168.150.1:39003/utc-hisense
control.url=http://173.17.0.1:32001/web control.url=http://173.17.0.1:32001/web
utc.service.url=http://172.17.0.1:32000/utc utc.service.url=http://172.17.0.1:32000/utc
utc.dt.service.url=http://172.17.0.1:39002/utc-dt utc.dt.service.url=http://172.17.0.1:39002/utc-dt
utc.hisense.service.url=http://172.17.0.1:39003/utc-hisense utc.hisense.service.url=http://127.0.0.1:39003/utc-hisense
control.url=http://172.17.0.1:42001/web control.url=http://172.17.0.1:42001/web
...@@ -17,12 +17,38 @@ public class HttpConstants { ...@@ -17,12 +17,38 @@ public class HttpConstants {
public static final String SYSTEMSCRIPTION_RESULT = "/systemScription/result"; public static final String SYSTEMSCRIPTION_RESULT = "/systemScription/result";
//Spot //Spot
public static final String SPOT = "Spot"; public static final String SPOT = "Spot";
//Pattern
public static final String PATTERN = "Pattern";
//Cycle
public static final String CYCLE = "Cycle";
//Offset
public static final String OFFSET = "Offset";
//Command 控制命令。1 -开始步进,0 -取消步进
public static final String COMMAND = "Command";
//Type
public static final String TYPE = "Type";
//CtrlStep 步进幅度。0 -表示顺序步进(仅支持顺序步进)
public static final String CTRLSTEP = "CtrlStep";
//Split
public static final String SPLIT = "Split";
//5.7协调状态 获取方案号 //5.7协调状态 获取方案号
public static final String MESSAGETYPE_12 = "12"; public static final String MESSAGETYPE_12 = "12";
// result = 0 失败 //5.16. 方案优化控制 - 设置临时方案
public static final String MESSAGETYPE_39 = "39";
//5.10. 手动方案控制- 恢复固定配时
public static final String MESSAGETYPE_16 = "16";
//5.15. 方案环图请求-根据方案号获取配时方案环图
public static final String MESSAGETYPE_30 = "30";
//5.12. 步进及取消控制
public static final String MESSAGETYPE_22 = "22";
// result = 0 指令下发失败
public static final String RESULT_0 = "0"; public static final String RESULT_0 = "0";
// result = 1 成功 // result = 1 指令下发成功
public static final String RESULT_1 = "1"; public static final String RESULT_1 = "1";
// result = 2 指令执行成功
public static final String RESULT_2 = "2";
// result = 3 指令执行失败
public static final String RESULT_3 = "3";
} }
...@@ -5,6 +5,9 @@ import io.swagger.annotations.ApiImplicitParam; ...@@ -5,6 +5,9 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import net.wanji.databus.dto.ExtendPhaseDTO;
import net.wanji.databus.dto.StepingPhaseDTO;
import net.wanji.databus.vo.TempSchemeSendVO;
import net.wanji.utc.hisense.service.ControlCommandService; import net.wanji.utc.hisense.service.ControlCommandService;
import net.wanji.common.annotation.aspect.AspectLog; import net.wanji.common.annotation.aspect.AspectLog;
import net.wanji.common.enums.BaseEnum; import net.wanji.common.enums.BaseEnum;
...@@ -148,8 +151,8 @@ public class ControlCommandController { ...@@ -148,8 +151,8 @@ public class ControlCommandController {
* @param crossCode * @param crossCode
* @return * @return
*/ */
@AspectLog(description = "恢复时间表-恢复路口时间表执行", operationType = BaseEnum.OperationTypeEnum.UPDATE) @AspectLog(description = "恢复时间表-恢复路口时间表执行(恢复固定配时)", operationType = BaseEnum.OperationTypeEnum.UPDATE)
@ApiOperation(value = "恢复时间表-恢复路口时间表执行", notes = "恢复时间表-恢复路口时间表执行") @ApiOperation(value = "恢复时间表-恢复路口时间表执行(恢复固定配时)", notes = "恢复时间表-恢复路口时间表执行(恢复固定配时)")
@PostMapping("/recoverSchedule") @PostMapping("/recoverSchedule")
public JsonViewObject recoverSchedule(@RequestParam String crossCode) throws Exception { public JsonViewObject recoverSchedule(@RequestParam String crossCode) throws Exception {
return controlCommandService.recoverSchedule(crossCode); return controlCommandService.recoverSchedule(crossCode);
...@@ -179,4 +182,34 @@ public class ControlCommandController { ...@@ -179,4 +182,34 @@ public class ControlCommandController {
return controlCommandService.phaseDiffSend(); return controlCommandService.phaseDiffSend();
} }
/**
* 临时方案下发
*/
@AspectLog(description = "临时方案下发", operationType = BaseEnum.OperationTypeEnum.UPDATE)
@ApiOperation(value = "临时方案下发", notes = "临时方案下发")
@PostMapping("/tempSchemeDetail")
public JsonViewObject tempSchemeDetail(@RequestBody @Validated TempSchemeSendVO tempSchemeSendVO) throws Exception{
return controlCommandService.tempSchemeDetail(tempSchemeSendVO);
}
/**
* 延长相位
*/
@AspectLog(description = "延长相位", operationType = BaseEnum.OperationTypeEnum.UPDATE)
@ApiOperation(value = "延长相位", notes = "延长相位")
@PostMapping("/extendPhase")
public JsonViewObject extendPhase(@RequestBody @Validated ExtendPhaseDTO extendPhaseDTO) throws Exception{
return controlCommandService.extendPhase(extendPhaseDTO);
}
/**
* 步进相位
*/
@AspectLog(description = "步进相位", operationType = BaseEnum.OperationTypeEnum.UPDATE)
@ApiOperation(value = "步进相位", notes = "步进相位")
@PostMapping("/stepingPhase")
public JsonViewObject stepingPhase(@RequestBody @Validated StepingPhaseDTO stepingPhaseDTO) throws Exception{
return controlCommandService.stepingPhase(stepingPhaseDTO);
}
} }
...@@ -10,11 +10,13 @@ import net.wanji.common.enums.BaseEnum; ...@@ -10,11 +10,13 @@ import net.wanji.common.enums.BaseEnum;
import net.wanji.common.framework.rest.JsonViewObject; import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.databus.dao.entity.CrossSchedulesPO; import net.wanji.databus.dao.entity.CrossSchedulesPO;
import net.wanji.databus.dto.CrossSchedulesDTO; import net.wanji.databus.dto.CrossSchedulesDTO;
import net.wanji.databus.dto.CrossSchemeRingsDTO;
import net.wanji.databus.dto.PlanSectionDTO; import net.wanji.databus.dto.PlanSectionDTO;
import net.wanji.databus.dto.SchemePhaseLightsDTO; import net.wanji.databus.dto.SchemePhaseLightsDTO;
import net.wanji.databus.vo.PlanSectionVO; import net.wanji.databus.vo.PlanSectionVO;
import net.wanji.databus.vo.SchemePhaseLightsVO; import net.wanji.databus.vo.SchemePhaseLightsVO;
import net.wanji.utc.hisense.pojo.result.CoordinationStatus; import net.wanji.utc.hisense.pojo.result.CoordinationStatus;
import net.wanji.utc.hisense.pojo.result.CrossSchemeRings;
import net.wanji.utc.hisense.service.StaticInfoService; import net.wanji.utc.hisense.service.StaticInfoService;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
...@@ -78,11 +80,11 @@ public class StaticInfoController { ...@@ -78,11 +80,11 @@ public class StaticInfoController {
} }
@AspectLog(description = "5.7协调状态-获取当前方案号", operationType = BaseEnum.OperationTypeEnum.QUERY) @AspectLog(description = "5.7协调状态-获取当前方案号", operationType = BaseEnum.OperationTypeEnum.QUERY)
@GetMapping(value = "/crossSchemeNo") @PostMapping(value = "/crossSchemeNo")
@ApiOperation(value = "5.7协调状态-获取当前方案号", notes = "协调状态-获取当前方案号", response = CrossSchedulesPO.class, @ApiOperation(value = "5.7协调状态-获取当前方案号", notes = "协调状态-获取当前方案号", response = CoordinationStatus.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON) produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@ApiResponses({ @ApiResponses({
@ApiResponse(code = 200, message = "OK", response = CrossSchedulesPO.class) @ApiResponse(code = 200, message = "OK", response = CoordinationStatus.class)
}) })
public JsonViewObject crossPlanId(@NotNull String crossId) throws Exception { public JsonViewObject crossPlanId(@NotNull String crossId) throws Exception {
CoordinationStatus coordinationStatus = staticInfoService.crossPlan(crossId); CoordinationStatus coordinationStatus = staticInfoService.crossPlan(crossId);
...@@ -93,4 +95,21 @@ public class StaticInfoController { ...@@ -93,4 +95,21 @@ public class StaticInfoController {
} }
} }
@AspectLog(description = "5.15. 方案环图请求-根据方案号获取配时方案环图", operationType = BaseEnum.OperationTypeEnum.QUERY)
@PostMapping(value = "/crossSchemeRings")
@ApiOperation(value = "5.15. 方案环图请求-根据方案号获取配时方案环图", notes = "方案环图请求-根据方案号获取配时方案环图", response = CrossSchemeRings.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = CrossSchemeRings.class)
})
public JsonViewObject crossSchemeRings(@RequestBody @Validated CrossSchemeRingsDTO crossSchemeRingsDTO) throws Exception {
CrossSchemeRings crossSchemeRings = staticInfoService.crossSchemeRings(crossSchemeRingsDTO);
if (ObjectUtils.isNotEmpty(crossSchemeRings)) {
return JsonViewObject.newInstance().success(crossSchemeRings);
} else {
return JsonViewObject.newInstance().fail("获取方案环图请求 失败");
}
}
} }
...@@ -27,7 +27,7 @@ import java.time.ZoneOffset; ...@@ -27,7 +27,7 @@ import java.time.ZoneOffset;
* @date 2024/01/08 17:33 * @date 2024/01/08 17:33
*/ */
@Slf4j @Slf4j
@Component //@Component
public class TcpClient { public class TcpClient {
private static ChannelFuture tcpChannelFuture = null; private static ChannelFuture tcpChannelFuture = null;
@Resource(name = "commonThreadPoolExecutor") @Resource(name = "commonThreadPoolExecutor")
......
package net.wanji.utc.hisense.pojo.result;
import com.alibaba.fastjson.JSONObject;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* @ClassName CrossSchemeRings
* @Description 配时方案环图
* @Author zhouleilei
* @Date 2024/11/4 20:04
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class CrossSchemeRings {
/**
* 控制点编号
*/
private String spot;
/**
* 方案号
*/
private String pattern;
/**
* 周期长,单位秒
*/
private String cycleLen;
/**
* 方案中环的个数
*/
private String ringCount;
/**
* 环中相位的顺序,i 表示环号。相位号之间用空格隔开,屏障之间用下划线”_”分隔。
*/
private JSONObject cycleList;
/**
* 相位列表
*/
private List<Phase> phaseList;
@Data
public static class Phase{
/**
* 16 个相位的红灯时间(单位秒),中间用空格隔开,不存在的相位置 0
*/
private String redTime;
/**
* 16 个相位的黄灯时间(单位秒),中间用空格隔开,不存在的相位置 0
*/
private String yellowTime;
/**
* 16 个相位的绿灯时间(单位秒),中间用空格隔开,不存在的相位置 0
*/
private String greenTime;
/**
* 16 个相位的方向,中间用空格隔开,不存在的相位置 0。每个相位由 8 字节整型值存储(最多支持 7 个放行方向)
*/
private String direction;
/**
* 16 个相位的最小绿,单位秒;最小绿表示相位绿灯时间可调整的最小值,优化控制的最小绿灯时长受该参数限制
*/
private String minGTime;
/**
* 16 个相位的最大绿,单位秒;最大绿表示相位绿灯时间可调整的最大值,优化控制暂时不受该参数限制
*/
private String maxGTime;
/**
* 16 个相位的放行方向,每个相位由 8 字节整型值存储(最多支持 7 个放行方向),每个字节表示一个放行方向
*/
private String channelDim;
/**
* 16 个相位的并发相位,相位号按位存储,每个比特位位置代表一个可并发的相位号,例 48 代表相位 5、6,192 代表相位 7、8
*/
private String concurrent;
}
}
package net.wanji.utc.hisense.service; package net.wanji.utc.hisense.service;
import net.wanji.common.framework.rest.JsonViewObject; import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.databus.dto.ExtendPhaseDTO;
import net.wanji.databus.dto.StepingPhaseDTO;
import net.wanji.databus.vo.TempSchemeSendVO;
import net.wanji.databus.vo.*; import net.wanji.databus.vo.*;
/** /**
...@@ -92,6 +95,20 @@ public interface ControlCommandService { ...@@ -92,6 +95,20 @@ public interface ControlCommandService {
/** /**
* 临时方案下发 * 临时方案下发
*/ */
JsonViewObject tempSchemeSend(SchemeSendVO schemeSendVO) throws Exception; JsonViewObject tempSchemeDetail(TempSchemeSendVO tempSchemeSendVO) throws Exception;
/**
* @Description 延长相位
* @param extendPhaseDTO
* @return
**/
JsonViewObject extendPhase(ExtendPhaseDTO extendPhaseDTO) throws Exception;
/**
* @Description 步进相位
* @param stepingPhaseDTO
* @return
**/
JsonViewObject stepingPhase(StepingPhaseDTO stepingPhaseDTO) throws Exception;
} }
package net.wanji.utc.hisense.service; package net.wanji.utc.hisense.service;
import net.wanji.databus.dao.entity.CrossSchedulesPO; import net.wanji.databus.dao.entity.CrossSchedulesPO;
import net.wanji.databus.dto.CrossInfoDTO; import net.wanji.databus.dto.*;
import net.wanji.databus.dto.CrossSchedulesDTO;
import net.wanji.databus.dto.PlanSectionDTO;
import net.wanji.databus.dto.SchemePhaseLightsDTO;
import net.wanji.databus.po.CrossInfoPO; import net.wanji.databus.po.CrossInfoPO;
import net.wanji.databus.vo.PlanSectionVO; import net.wanji.databus.vo.PlanSectionVO;
import net.wanji.databus.vo.SchemePhaseLightsVO; import net.wanji.databus.vo.SchemePhaseLightsVO;
import net.wanji.utc.hisense.pojo.result.CoordinationStatus; import net.wanji.utc.hisense.pojo.result.CoordinationStatus;
import net.wanji.utc.hisense.pojo.result.CrossSchemeRings;
import java.util.List; import java.util.List;
@SuppressWarnings("all")
public interface StaticInfoService { public interface StaticInfoService {
List<CrossInfoPO> crossBasicInfo(CrossInfoDTO crossInfoDTO) throws Exception; List<CrossInfoPO> crossBasicInfo(CrossInfoDTO crossInfoDTO) throws Exception;
...@@ -26,5 +24,11 @@ public interface StaticInfoService { ...@@ -26,5 +24,11 @@ public interface StaticInfoService {
* @Param crossId 路口编号 * @Param crossId 路口编号
**/ **/
CoordinationStatus crossPlan(String crossId) throws Exception; CoordinationStatus crossPlan(String crossId) throws Exception;
/**
* @Description : 5.15. 方案环图请求-根据方案号获取配时方案环图
* @Param crossId 路口编号
* @Param pattern 方案号
**/
CrossSchemeRings crossSchemeRings(CrossSchemeRingsDTO crossSchemeRingsDTO) throws Exception;
} }
package net.wanji.utc.hisense.service.impl; package net.wanji.utc.hisense.service.impl;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.wanji.common.utils.tool.StringUtils; import net.wanji.common.utils.tool.StringUtils;
import net.wanji.databus.dao.entity.CrossSchedulesPO; import net.wanji.databus.dao.entity.CrossSchedulesPO;
import net.wanji.databus.dto.CrossInfoDTO; import net.wanji.databus.dao.mapper.CrossInfoMapper;
import net.wanji.databus.dto.CrossSchedulesDTO; import net.wanji.databus.dto.*;
import net.wanji.databus.dto.PlanSectionDTO;
import net.wanji.databus.dto.SchemePhaseLightsDTO;
import net.wanji.databus.po.CrossInfoPO; import net.wanji.databus.po.CrossInfoPO;
import net.wanji.databus.po.CrossInfoPOExt;
import net.wanji.databus.vo.PlanSectionVO; import net.wanji.databus.vo.PlanSectionVO;
import net.wanji.databus.vo.SchemePhaseLightsVO; import net.wanji.databus.vo.SchemePhaseLightsVO;
import net.wanji.utc.hisense.common.OperationBaseDom; import net.wanji.utc.hisense.common.OperationBaseDom;
import net.wanji.utc.hisense.common.constants.HttpConstants; import net.wanji.utc.hisense.common.constants.HttpConstants;
import net.wanji.utc.hisense.pojo.result.CoordinationStatus; import net.wanji.utc.hisense.pojo.result.CoordinationStatus;
import net.wanji.utc.hisense.pojo.result.CrossSchemeRings;
import net.wanji.utc.hisense.service.StaticInfoService; import net.wanji.utc.hisense.service.StaticInfoService;
import net.wanji.utc.hisense.util.OkHttpClientUtil; import net.wanji.utc.hisense.util.OkHttpClientUtil;
import org.dom4j.Document; import org.dom4j.Document;
import org.dom4j.DocumentHelper; import org.dom4j.DocumentHelper;
import org.dom4j.Element; import org.dom4j.Element;
import org.dom4j.Node;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
...@@ -35,6 +39,8 @@ public class StaticInfoServiceImpl implements StaticInfoService { ...@@ -35,6 +39,8 @@ public class StaticInfoServiceImpl implements StaticInfoService {
@Value("${hisense.url}") @Value("${hisense.url}")
private String hisenseUrl; private String hisenseUrl;
@Resource
private CrossInfoMapper crossInfoMapper;
@Override @Override
public List<CrossInfoPO> crossBasicInfo(CrossInfoDTO crossInfoDTO) throws Exception { public List<CrossInfoPO> crossBasicInfo(CrossInfoDTO crossInfoDTO) throws Exception {
return null; return null;
...@@ -57,12 +63,13 @@ public class StaticInfoServiceImpl implements StaticInfoService { ...@@ -57,12 +63,13 @@ public class StaticInfoServiceImpl implements StaticInfoService {
@Override @Override
public CoordinationStatus crossPlan(String crossId) throws Exception { public CoordinationStatus crossPlan(String crossId) throws Exception {
CrossInfoPOExt crossInfoPOExt = crossInfoMapper.selectById(crossId);
//组装document //组装document
Document document = OperationBaseDom.generateBaseDoc(); Document document = OperationBaseDom.generateBaseDoc();
Element element = (Element) document.selectSingleNode(HttpConstants.SYSTEMSCRIPTION); Element element = (Element) document.selectSingleNode(HttpConstants.SYSTEMSCRIPTION);
element.addElement(HttpConstants.MESSAGETYPE).setText(HttpConstants.MESSAGETYPE_12); element.addElement(HttpConstants.MESSAGETYPE).setText(HttpConstants.MESSAGETYPE_12);
Element messageContent = (Element) document.selectSingleNode(HttpConstants.SYSTEMSCRIPTION_MESSAGECONTENT); Element messageContent = (Element) document.selectSingleNode(HttpConstants.SYSTEMSCRIPTION_MESSAGECONTENT);
messageContent.addElement(HttpConstants.SPOT).setText(crossId); messageContent.addElement(HttpConstants.SPOT).setText(crossInfoPOExt.getCode());
//给海信发送http请求 //给海信发送http请求
String post = OkHttpClientUtil.xmlPost(hisenseUrl, document.asXML()); String post = OkHttpClientUtil.xmlPost(hisenseUrl, document.asXML());
...@@ -93,4 +100,107 @@ public class StaticInfoServiceImpl implements StaticInfoService { ...@@ -93,4 +100,107 @@ public class StaticInfoServiceImpl implements StaticInfoService {
return null; return null;
} }
@Override
public CrossSchemeRings crossSchemeRings(CrossSchemeRingsDTO crossSchemeRingsDTO) throws Exception {
//TODO 暂时注释
// CrossInfoPOExt crossInfoPOExt = crossInfoMapper.selectById(crossId);
//组装document
Document document = OperationBaseDom.generateBaseDoc();
Element element = (Element) document.selectSingleNode(HttpConstants.SYSTEMSCRIPTION);
element.addElement(HttpConstants.MESSAGETYPE).setText(HttpConstants.MESSAGETYPE_30);
Element messageContent = (Element) document.selectSingleNode(HttpConstants.SYSTEMSCRIPTION_MESSAGECONTENT);
// messageContent.addElement(HttpConstants.SPOT).setText(crossInfoPOExt.getCode());
messageContent.addElement(HttpConstants.SPOT).setText(crossSchemeRingsDTO.getCrossId());
messageContent.addElement(HttpConstants.PATTERN).setText(crossSchemeRingsDTO.getPattern());
//给海信发送http请求
// String post = OkHttpClientUtil.xmlPost(hisenseUrl, document.asXML());
String post = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" +
"<systemScription System=\"TCIP\" Version=\"1.0\">\n" +
"<subSystem>Hisense</subSystem>\n" +
"<messageType>30</messageType>\n" +
"<isRequest>0</isRequest>\n" +
"<seq>20190806160612000678</seq>\n" +
"<needResponse>0</needResponse>\n" +
"<result>1</result>\n" +
"<flag>0</flag>\n" +
"<tStamp>1567142534</tStamp>\n" +
"<messageContent>\n" +
"<Spot>102494</Spot>\n" +
"<Pattern>1</Pattern>\n" +
"<CycleLen>138</CycleLen>\n" +
"<RingCount>3</RingCount>\n" +
"<CycleList>\n" +
"<Cycle1>1 2 3 4_</Cycle1>\n" +
"<Cycle2>5 6 7 8_</Cycle2>\n" +
"<Cycle3>9 12 10 11_</Cycle3>\n" +
"</CycleList>\n" +
"<PhaseList>\n" +
"<RedTime>0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0</RedTime>\n" +
"<YellowTime>3 3 3 3 3 3 3 3 3 3 0 0 0 0 0 0</YellowTime>\n" +
"<GreenTime>32 25 22 47 37 20 50 19 52 64 8 8 0 0 0 0</GreenTime>\n" +
"<Direction>37 17 39 19 33 21 35 23 0 0 0 0 0 0 0 0</Direction>\n" +
"<MinGTime>14 10 14 14 14 1 14 10 14 5 8 8 0 0 0 0</MinGTime>\n" +
"<MaxGTime>60 60 60 60 60 60 60 60 60 60 60 60 0 0 0 0</MaxGTime>\n" +
"<ChannelDim>28066 33 2993634 97 60194 161 98 225 10707747 10707747 236 \n" +
"236 0 0 0 0</ChannelDim>\n" +
"<Concurrent>4080 4080 4080 4080 3855 3855 3855 3855 255 255 255 255 0 0 0 \n" +
"0</Concurrent>\n" +
"</PhaseList>\n" +
"</messageContent>\n" +
"</systemScription>";
if (StringUtils.isBlank(post)){
log.error("请求 5.15.根据方案号获取配时方案环图 失败");
return null;
}
Document postResult = DocumentHelper.parseText(post);
String result = postResult.selectSingleNode(HttpConstants.SYSTEMSCRIPTION_RESULT).getText();
if (HttpConstants.RESULT_1.equals(result)){
//成功
String spot = postResult.selectSingleNode(HttpConstants.SYSTEMSCRIPTION_MESSAGECONTENT).valueOf("Spot");
String patternRest = postResult.selectSingleNode(HttpConstants.SYSTEMSCRIPTION_MESSAGECONTENT).valueOf("Pattern");
String cycleLen = postResult.selectSingleNode(HttpConstants.SYSTEMSCRIPTION_MESSAGECONTENT).valueOf("CycleLen");
String ringCount = postResult.selectSingleNode(HttpConstants.SYSTEMSCRIPTION_MESSAGECONTENT).valueOf("RingCount");
List<Element> cycleElementList = postResult.selectNodes(HttpConstants.SYSTEMSCRIPTION_MESSAGECONTENT + "/CycleList");
List<Element> phaseElementList = postResult.selectNodes(HttpConstants.SYSTEMSCRIPTION_MESSAGECONTENT + "/PhaseList");
CrossSchemeRings crossSchemeRings = new CrossSchemeRings();
crossSchemeRings.setSpot(spot);
crossSchemeRings.setPattern(patternRest);
crossSchemeRings.setRingCount(ringCount);
crossSchemeRings.setCycleLen(cycleLen);
JSONObject jsonObject = new JSONObject();
for (Element cycle : cycleElementList) {
List<Node> elements = cycle.elements();
for (Node node : elements) {
node.getName();
jsonObject.put(node.getName(), node.getText());
}
}
List<CrossSchemeRings.Phase> phaseList = new ArrayList<>();
for (Element el : phaseElementList) {
CrossSchemeRings.Phase phase = new CrossSchemeRings.Phase();
phase.setRedTime(el.valueOf("RedTime"));
phase.setYellowTime(el.valueOf("YellowTime"));
phase.setGreenTime(el.valueOf("GreenTime"));
phase.setDirection(el.valueOf("Direction"));
phase.setMinGTime(el.valueOf("MinGTime"));
phase.setMaxGTime(el.valueOf("MaxGTime"));
phase.setChannelDim(el.valueOf("ChannelDim"));
phase.setConcurrent(el.valueOf("Concurrent"));
phaseList.add(phase);
}
crossSchemeRings.setCycleList(jsonObject);
crossSchemeRings.setPhaseList(phaseList);
return crossSchemeRings;
}else {
//失败
log.error("请求 5.15. 方案环图请求 失败");
}
return null;
}
} }
spring: spring:
profiles: profiles:
active: docker active: dev
\ No newline at end of file \ No newline at end of file
...@@ -4,6 +4,7 @@ import net.wanji.common.enums.BaseEnum; ...@@ -4,6 +4,7 @@ import net.wanji.common.enums.BaseEnum;
import net.wanji.common.framework.spring.ServiceBeanContext; import net.wanji.common.framework.spring.ServiceBeanContext;
import net.wanji.feign.service.common.FeignCommon; import net.wanji.feign.service.common.FeignCommon;
import org.springframework.boot.CommandLineRunner; import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.HashMap; import java.util.HashMap;
...@@ -14,6 +15,7 @@ import java.util.Map; ...@@ -14,6 +15,7 @@ import java.util.Map;
* @date 2023/05/22 10:20 * @date 2023/05/22 10:20
*/ */
@Component @Component
@Order(1)
public class UtcFeignClientCache implements CommandLineRunner { public class UtcFeignClientCache implements CommandLineRunner {
public static final Map<String, FeignCommon> utcFeignClientsMap = new HashMap<>(); public static final Map<String, FeignCommon> utcFeignClientsMap = new HashMap<>();
......
...@@ -8,6 +8,7 @@ import lombok.extern.slf4j.Slf4j; ...@@ -8,6 +8,7 @@ import lombok.extern.slf4j.Slf4j;
import net.wanji.common.annotation.aspect.AspectLog; import net.wanji.common.annotation.aspect.AspectLog;
import net.wanji.common.enums.BaseEnum; import net.wanji.common.enums.BaseEnum;
import net.wanji.common.framework.rest.JsonViewObject; import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.databus.vo.TempSchemeSendVO;
import net.wanji.databus.po.SaveToUtcPO; import net.wanji.databus.po.SaveToUtcPO;
import net.wanji.databus.vo.*; import net.wanji.databus.vo.*;
import net.wanji.utc.service.control.ControlCommandStrategyService; import net.wanji.utc.service.control.ControlCommandStrategyService;
...@@ -214,10 +215,22 @@ public class ControlCommandController { ...@@ -214,10 +215,22 @@ public class ControlCommandController {
return controlCommandStrategyService.tempScheme(crossCode, schemeNo); return controlCommandStrategyService.tempScheme(crossCode, schemeNo);
} }
/**
* 临时方案下发
*/
@AspectLog(description = "临时方案下发", operationType = BaseEnum.OperationTypeEnum.UPDATE)
@ApiOperation(value = "临时方案下发", notes = "临时方案下发")
@PostMapping("/tempSchemeDetail")
public JsonViewObject tempSchemeDetail(@RequestBody @Validated TempSchemeSendVO tempSchemeSendVO) throws Exception{
return controlCommandStrategyService.tempSchemeDetail(tempSchemeSendVO);
}
@AspectLog(description = "下发数据到UTC", operationType = BaseEnum.OperationTypeEnum.UPDATE) @AspectLog(description = "下发数据到UTC", operationType = BaseEnum.OperationTypeEnum.UPDATE)
@ApiOperation(value = "下发数据到UTC", notes = "下发数据到UTC") @ApiOperation(value = "下发数据到UTC", notes = "下发数据到UTC")
@PostMapping("/saveToUtc") @PostMapping("/saveToUtc")
public JsonViewObject saveToUtc(@RequestBody @Validated SaveToUtcPO saveToUtcPO) throws Exception { public JsonViewObject saveToUtc(@RequestBody @Validated SaveToUtcPO saveToUtcPO) throws Exception {
return controlCommandStrategyService.saveToUtc(saveToUtcPO); return controlCommandStrategyService.saveToUtc(saveToUtcPO);
} }
} }
...@@ -133,4 +133,6 @@ public class StaticInfoController { ...@@ -133,4 +133,6 @@ public class StaticInfoController {
public JsonViewObject crossSchemeNo(@RequestParam String crossId) throws Exception { public JsonViewObject crossSchemeNo(@RequestParam String crossId) throws Exception {
return staticInfoService.crossSchemeNo(crossId); return staticInfoService.crossSchemeNo(crossId);
} }
} }
package net.wanji.utc.service.control; package net.wanji.utc.service.control;
import net.wanji.common.framework.rest.JsonViewObject; import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.databus.vo.TempSchemeSendVO;
import net.wanji.databus.vo.*; import net.wanji.databus.vo.*;
import net.wanji.utc.po.hk.request.DelBaseConfigPO; import net.wanji.utc.po.hk.request.DelBaseConfigPO;
...@@ -98,4 +99,5 @@ public interface ControlCommandService { ...@@ -98,4 +99,5 @@ public interface ControlCommandService {
JsonViewObject timing(String crossCode, Date date) throws Exception; JsonViewObject timing(String crossCode, Date date) throws Exception;
JsonViewObject tempScheme(String crossCode, Integer schemeNo) throws Exception; JsonViewObject tempScheme(String crossCode, Integer schemeNo) throws Exception;
JsonViewObject tempSchemeDetail(TempSchemeSendVO tempSchemeSendVO) throws Exception;
} }
package net.wanji.utc.service.control; package net.wanji.utc.service.control;
import net.wanji.common.framework.rest.JsonViewObject; import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.databus.vo.TempSchemeSendVO;
import net.wanji.databus.po.SaveToUtcPO; import net.wanji.databus.po.SaveToUtcPO;
import net.wanji.databus.vo.*; import net.wanji.databus.vo.*;
...@@ -97,6 +98,7 @@ public interface ControlCommandStrategyService { ...@@ -97,6 +98,7 @@ public interface ControlCommandStrategyService {
JsonViewObject timing(String crossCode, Date date) throws Exception; JsonViewObject timing(String crossCode, Date date) throws Exception;
JsonViewObject tempScheme(String crossCode, Integer schemeNo) throws Exception; JsonViewObject tempScheme(String crossCode, Integer schemeNo) throws Exception;
JsonViewObject tempSchemeDetail (TempSchemeSendVO tempSchemeSendVO) throws Exception;
JsonViewObject saveToUtc(SaveToUtcPO saveToUtcPO) throws Exception; JsonViewObject saveToUtc(SaveToUtcPO saveToUtcPO) throws Exception;
} }
...@@ -3,6 +3,7 @@ package net.wanji.utc.service.control.impl; ...@@ -3,6 +3,7 @@ package net.wanji.utc.service.control.impl;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.wanji.common.framework.rest.JsonViewObject; import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.databus.vo.TempSchemeSendVO;
import net.wanji.databus.dao.entity.*; import net.wanji.databus.dao.entity.*;
import net.wanji.databus.dao.mapper.*; import net.wanji.databus.dao.mapper.*;
import net.wanji.databus.po.BaseCrossLightsPO; import net.wanji.databus.po.BaseCrossLightsPO;
...@@ -340,6 +341,17 @@ public class ControlCommandStrategyServiceImpl implements ControlCommandStrategy ...@@ -340,6 +341,17 @@ public class ControlCommandStrategyServiceImpl implements ControlCommandStrategy
return jsonViewObject; return jsonViewObject;
} }
@Override
public JsonViewObject tempSchemeDetail(TempSchemeSendVO tempSchemeSendVO) throws Exception {
String manufacturerCode = crossInfoCache.getManufacturerCodeByCrossId(tempSchemeSendVO.getCrossCode());
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
if (StringUtils.equals(BasicEnum.ManufacturerEnum.HK.getCode(), manufacturerCode)) {
} else {
jsonViewObject = wanJiControlCommandService.tempSchemeDetail(tempSchemeSendVO);
}
return jsonViewObject;
}
@Override @Override
@Transactional @Transactional
public JsonViewObject saveToUtc(SaveToUtcPO saveToUtcPO) throws Exception { public JsonViewObject saveToUtc(SaveToUtcPO saveToUtcPO) throws Exception {
......
...@@ -8,6 +8,7 @@ import com.hikvision.artemis.sdk.ArtemisHttpUtil; ...@@ -8,6 +8,7 @@ import com.hikvision.artemis.sdk.ArtemisHttpUtil;
import com.hikvision.artemis.sdk.config.ArtemisConfig; import com.hikvision.artemis.sdk.config.ArtemisConfig;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.wanji.common.framework.rest.JsonViewObject; import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.databus.vo.TempSchemeSendVO;
import net.wanji.databus.dao.entity.CrossPhasePO; import net.wanji.databus.dao.entity.CrossPhasePO;
import net.wanji.databus.dao.entity.SetTimingPO; import net.wanji.databus.dao.entity.SetTimingPO;
import net.wanji.databus.dao.mapper.CrossInfoMapper; import net.wanji.databus.dao.mapper.CrossInfoMapper;
...@@ -554,4 +555,9 @@ public class HKControlCommandServiceImpl implements ControlCommandService { ...@@ -554,4 +555,9 @@ public class HKControlCommandServiceImpl implements ControlCommandService {
public JsonViewObject tempScheme(String crossCode, Integer schemeNo) throws Exception { public JsonViewObject tempScheme(String crossCode, Integer schemeNo) throws Exception {
return null; return null;
} }
@Override
public JsonViewObject tempSchemeDetail(TempSchemeSendVO tempSchemeSendVO) throws Exception {
return null;
}
} }
...@@ -2,6 +2,7 @@ package net.wanji.utc.service.control.impl; ...@@ -2,6 +2,7 @@ package net.wanji.utc.service.control.impl;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import net.wanji.common.framework.rest.JsonViewObject; import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.databus.vo.TempSchemeSendVO;
import net.wanji.databus.vo.*; import net.wanji.databus.vo.*;
import net.wanji.feign.service.common.FeignCommon; import net.wanji.feign.service.common.FeignCommon;
import net.wanji.utc.cache.CrossInfoCache; import net.wanji.utc.cache.CrossInfoCache;
...@@ -11,6 +12,8 @@ import net.wanji.utc.po.hk.request.DelBaseConfigPO; ...@@ -11,6 +12,8 @@ import net.wanji.utc.po.hk.request.DelBaseConfigPO;
import net.wanji.utc.service.control.ControlCommandService; import net.wanji.utc.service.control.ControlCommandService;
import net.wanji.utc.util.HttpRestUtil; import net.wanji.utc.util.HttpRestUtil;
import net.wanji.utc.util.StringUtils; import net.wanji.utc.util.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -25,6 +28,7 @@ import java.util.Objects; ...@@ -25,6 +28,7 @@ import java.util.Objects;
@RequiredArgsConstructor @RequiredArgsConstructor
public class WanJiControlCommandServiceImpl implements ControlCommandService { public class WanJiControlCommandServiceImpl implements ControlCommandService {
private static final Logger log = LoggerFactory.getLogger(WanJiControlCommandServiceImpl.class);
private final HttpRestUtil httpRestUtil; private final HttpRestUtil httpRestUtil;
@Value("url") @Value("url")
private String rpcUri; private String rpcUri;
...@@ -176,4 +180,13 @@ public class WanJiControlCommandServiceImpl implements ControlCommandService { ...@@ -176,4 +180,13 @@ public class WanJiControlCommandServiceImpl implements ControlCommandService {
} }
return jsonViewObject.fail("万集标准协议校时失败!"); return jsonViewObject.fail("万集标准协议校时失败!");
} }
@Override
public JsonViewObject tempSchemeDetail(TempSchemeSendVO tempSchemeSendVO) throws Exception {
String manufacturerIdCode = crossInfoCache.getManufacturerCodeByCrossId(tempSchemeSendVO.getCrossCode());
JsonViewObject jsonViewObject = utcFeignClientCache.getUtcFeignClientService(manufacturerIdCode).tempSchemeDetail(tempSchemeSendVO);
if (StringUtils.endsWithIgnoreCase("success", jsonViewObject.getStatus())) {
return jsonViewObject.success("下发临时方案成功!");
}
return jsonViewObject.fail("下发临时方案失败!");
}
} }
...@@ -180,7 +180,7 @@ public class WanJiCommonStaticInfoServiceImpl implements WanJiCommonStaticInfoSe ...@@ -180,7 +180,7 @@ public class WanJiCommonStaticInfoServiceImpl implements WanJiCommonStaticInfoSe
@Override @Override
public JsonViewObject crossSchemeNo(String crossId) throws Exception { public JsonViewObject crossSchemeNo(String crossId) throws Exception {
String manufacturerIdCode = crossInfoCache.getManufacturerCodeByCrossId(crossId); String manufacturerIdCode = crossInfoCache.getManufacturerCodeByCrossId(crossId);
UtcHisenseFeignClients utcFeignClientService = (UtcHisenseFeignClients)utcFeignClientCache.getUtcFeignClientService(manufacturerIdCode); FeignCommon utcFeignClientService = utcFeignClientCache.getUtcFeignClientService(manufacturerIdCode);
JsonViewObject jsonViewObject = utcFeignClientService.getSchemeNo(crossId); JsonViewObject jsonViewObject = utcFeignClientService.getSchemeNo(crossId);
if (Objects.isNull(jsonViewObject) || jsonViewObject.getCode() != 200) { if (Objects.isNull(jsonViewObject) || jsonViewObject.getCode() != 200) {
throw new Exception("获取信号机时间远程服务调用异常,异常信息" + jsonViewObject.getMessage()); throw new Exception("获取信号机时间远程服务调用异常,异常信息" + jsonViewObject.getMessage());
......
spring: spring:
profiles: profiles:
active: docker active: dev
\ No newline at end of file \ No newline at end of file
package net.wanji.databus.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
/**
* @ClassName CrossSchemeRings
* @Description 5.15. 方案环图请求
* @Author zhouleilei
* @Date 2024/11/5 10:37
*/
@Data
@Valid
@ApiModel(value="方案环图请求", description="")
public class CrossSchemeRingsDTO {
@ApiModelProperty(value = "路口ID")
@Pattern(regexp = "^[A-Za-z0-9]{11}$", message = "路口编号只能包含英文、数字,必须11个字符")
@NotNull(message = "crossId不能为空")
private String crossId;
@ApiModelProperty(value = "方案号")
@NotNull(message = "pattern 不能为空")
private String pattern;
}
package net.wanji.databus.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import org.springframework.validation.annotation.Validated;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
/**
* @ClassName ExtendPhaseDTO
* @Description 延长相位
* @Author zhouleilei
* @Date 2024/11/5 13:58
*/
@Data
@Builder
@Validated
@ApiModel(value="延长相位", description="延长相位")
public class ExtendPhaseDTO {
@ApiModelProperty(value = "路口ID")
@Pattern(regexp = "^[A-Za-z0-9]{11}$", message = "路口编号只能包含英文、数字,必须11个字符")
@NotNull(message = "crossId不能为空")
private String crossId;
@ApiModelProperty(value = "延长时间,单位:s")
@NotNull(message = "extendTime 不能为空")
private Integer extendTime;
}
package net.wanji.databus.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import org.springframework.validation.annotation.Validated;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
/**
* @ClassName StepingPhaseDTO
* @Description 步进相位
* @Version 1.0
* @Author zhouleilei
* @Date 2024/11/5 16:11
*/
@Data
@Builder
@Validated
@ApiModel(value="步进相位", description="步进相位")
public class StepingPhaseDTO {
@ApiModelProperty(value = "路口ID")
@Pattern(regexp = "^[A-Za-z0-9]{11}$", message = "路口编号只能包含英文、数字,必须11个字符")
@NotNull(message = "crossId不能为空")
private String crossId;
@ApiModelProperty(value = "跳过几个相位,跳过几个相位")
private Integer stepCount;
}
package net.wanji.databus.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
/**
* 信号机临时方案下发VO
*
* @author zhouleilei
* @date 2024/11/4 16:14:27
*/
@Data
@Builder
public class TempSchemeSendVO {
@ApiModelProperty(value = "路口编号", notes = "路口编号")
@Pattern(regexp = "^[A-Za-z0-9]{11}$", message = "路口编号只能包含英文、数字,必须11个字符")
@NotBlank(message = "路口编号不可为空")
private String crossCode;
@ApiModelProperty(value = "基础方案号", notes = "优化的基础方案号,该方案号需在信号机提前配置")
@NotBlank(message = "基础方案号")
private String pattern;
@ApiModelProperty(value = "周期长", notes = "需要优化的周期长,单位秒")
@NotBlank(message = "周期长")
private String cycle;
}
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