Commit c5a21505 authored by duanruiming's avatar duanruiming

[update] 修改目录com->utc.dt

parent 126685a7
...@@ -237,7 +237,7 @@ ...@@ -237,7 +237,7 @@
<!-- <creationTime>2022-10-14T10:08:59.304+08:00</creationTime>--> <!-- <creationTime>2022-10-14T10:08:59.304+08:00</creationTime>-->
<creationTime>${maven.build.timestamp}</creationTime> <creationTime>${maven.build.timestamp}</creationTime>
<mainClass>net.wanji.com.DTApplication</mainClass> <mainClass>net.wanji.utc.dt.DTApplication</mainClass>
</container> </container>
<!--可以进行HTTP--> <!--可以进行HTTP-->
<allowInsecureRegistries>true</allowInsecureRegistries> <allowInsecureRegistries>true</allowInsecureRegistries>
......
package net.wanji.com; package net.wanji.utc.dt;
import net.wanji.com.netty.NettyClient; import net.wanji.utc.dt.netty.NettyClient;
import org.mybatis.spring.annotation.MapperScan; import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner; import org.springframework.boot.CommandLineRunner;
...@@ -13,8 +13,8 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; ...@@ -13,8 +13,8 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
* @author duanruiming * @author duanruiming
* @date 2023/05/08 13:37 * @date 2023/05/08 13:37
*/ */
@SpringBootApplication(scanBasePackages = {"net.wanji.com", "net.wanji.databus", "net.wanji.common"}) @SpringBootApplication(scanBasePackages = {"net.wanji.utc.dt", "net.wanji.databus", "net.wanji.common"})
@MapperScan(basePackages = {"net.wanji.com.mapper", "net.wanji.databus.dao.mapper"}) @MapperScan(basePackages = {"net.wanji.databus.dao.mapper"})
@EnableTransactionManagement @EnableTransactionManagement
@EnableScheduling @EnableScheduling
@SuppressWarnings("all") @SuppressWarnings("all")
......
package net.wanji.com.cache; package net.wanji.utc.dt.cache;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.wanji.common.enums.BaseEnum; import net.wanji.common.enums.BaseEnum;
......
package net.wanji.com.cache; package net.wanji.utc.dt.cache;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.wanji.com.service.controller.BeanMarkService; import net.wanji.utc.dt.service.controller.BeanMarkService;
import net.wanji.com.service.controller.ControlCommandService; import net.wanji.utc.dt.service.controller.ControlCommandService;
import net.wanji.com.service.controller.SignalStatusService; import net.wanji.utc.dt.service.controller.SignalStatusService;
import net.wanji.com.service.controller.StaticInfoService; import net.wanji.utc.dt.service.controller.StaticInfoService;
import net.wanji.com.common.enums.SignalInterfaceTypeEnum; import net.wanji.utc.dt.common.enums.SignalInterfaceTypeEnum;
import net.wanji.common.framework.spring.ServiceBeanContext; import net.wanji.common.framework.spring.ServiceBeanContext;
import org.springframework.boot.CommandLineRunner; import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
......
package net.wanji.com.cache; package net.wanji.utc.dt.cache;
import net.wanji.com.pojo.dtconvert.PhaseInfoPojo; import net.wanji.utc.dt.pojo.dtconvert.PhaseInfoPojo;
import net.wanji.com.pojo.dtconvert.PhaseStageInfoPojo; import net.wanji.utc.dt.pojo.dtconvert.PhaseStageInfoPojo;
import net.wanji.com.pojo.dtconvert.SchemeInfoPojo; import net.wanji.utc.dt.pojo.dtconvert.SchemeInfoPojo;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.HashMap; import java.util.HashMap;
......
package net.wanji.com.cache.netty; package net.wanji.utc.dt.cache.netty;
import net.wanji.com.pojo.netty.MessageResultPojo; import net.wanji.utc.dt.pojo.netty.MessageResultPojo;
import net.wanji.databus.po.CrossInfoPO; import net.wanji.databus.po.CrossInfoPO;
import java.util.HashMap; import java.util.HashMap;
......
package net.wanji.com.common.constants; package net.wanji.utc.dt.common.constants;
import net.wanji.com.util.CRC16Utils; import net.wanji.utc.dt.util.CRC16Utils;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.sql.Connection; import java.sql.Connection;
......
package net.wanji.com.common.enums; package net.wanji.utc.dt.common.enums;
import lombok.Getter; import lombok.Getter;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
......
package net.wanji.com.common.enums; package net.wanji.utc.dt.common.enums;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
......
package net.wanji.com.common.enums; package net.wanji.utc.dt.common.enums;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
......
package net.wanji.com.common.enums; package net.wanji.utc.dt.common.enums;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
......
package net.wanji.com.common.enums; package net.wanji.utc.dt.common.enums;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
......
package net.wanji.com.common.enums; package net.wanji.utc.dt.common.enums;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import net.wanji.com.service.controller.ControlCommandService; import net.wanji.utc.dt.service.controller.ControlCommandService;
import net.wanji.com.service.controller.SignalStatusService; import net.wanji.utc.dt.service.controller.SignalStatusService;
import net.wanji.com.service.controller.StaticInfoService; import net.wanji.utc.dt.service.controller.StaticInfoService;
import java.util.Objects; import java.util.Objects;
......
package net.wanji.com.config; package net.wanji.utc.dt.config;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
...@@ -21,7 +21,7 @@ public class Swagger2 { ...@@ -21,7 +21,7 @@ public class Swagger2 {
.apiInfo(apiInfo()) .apiInfo(apiInfo())
.select() .select()
//为当前包路径 //为当前包路径
.apis(RequestHandlerSelectors.basePackage("net.wanji.com.controller")) .apis(RequestHandlerSelectors.basePackage("net.wanji.utc.dt.controller"))
.paths(PathSelectors.any()) .paths(PathSelectors.any())
.build(); .build();
} }
......
package net.wanji.com.controller; package net.wanji.utc.dt.controller;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; 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.com.service.controller.ControlCommandService; import net.wanji.utc.dt.service.controller.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;
import net.wanji.common.framework.rest.JsonViewObject; import net.wanji.common.framework.rest.JsonViewObject;
......
package net.wanji.com.controller; package net.wanji.utc.dt.controller;
/** /**
* @author Kent HAN * @author Kent HAN
...@@ -10,7 +10,7 @@ import io.swagger.annotations.ApiOperation; ...@@ -10,7 +10,7 @@ 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 lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import net.wanji.com.service.controller.SignalStatusService; import net.wanji.utc.dt.service.controller.SignalStatusService;
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;
......
package net.wanji.com.controller; package net.wanji.utc.dt.controller;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; 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 lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import net.wanji.com.service.controller.StaticInfoService; import net.wanji.utc.dt.service.controller.StaticInfoService;
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;
......
package net.wanji.com.netty; package net.wanji.utc.dt.netty;
import cn.hutool.core.util.HexUtil; import cn.hutool.core.util.HexUtil;
...@@ -9,12 +9,12 @@ import io.netty.channel.nio.NioEventLoopGroup; ...@@ -9,12 +9,12 @@ import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.DatagramPacket; import io.netty.channel.socket.DatagramPacket;
import io.netty.channel.socket.nio.NioDatagramChannel; import io.netty.channel.socket.nio.NioDatagramChannel;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.wanji.com.cache.CrossInfoCache; import net.wanji.utc.dt.cache.CrossInfoCache;
import net.wanji.com.cache.netty.NettyMessageCache; import net.wanji.utc.dt.cache.netty.NettyMessageCache;
import net.wanji.com.netty.codec.MessageDecoder; import net.wanji.utc.dt.netty.codec.MessageDecoder;
import net.wanji.com.netty.codec.MessageEnCoder; import net.wanji.utc.dt.netty.codec.MessageEnCoder;
import net.wanji.com.netty.handler.NettyServerHandler; import net.wanji.utc.dt.netty.handler.NettyServerHandler;
import net.wanji.com.pojo.netty.MessageResultPojo; import net.wanji.utc.dt.pojo.netty.MessageResultPojo;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
......
package net.wanji.com.netty.codec; package net.wanji.utc.dt.netty.codec;
import cn.hutool.core.util.HexUtil; import cn.hutool.core.util.HexUtil;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
......
package net.wanji.com.netty.codec; package net.wanji.utc.dt.netty.codec;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelHandlerContext;
......
package net.wanji.com.netty.commandsign; package net.wanji.utc.dt.netty.commandsign;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
......
package net.wanji.com.netty.handler; package net.wanji.utc.dt.netty.handler;
import cn.hutool.core.util.HexUtil; import cn.hutool.core.util.HexUtil;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
...@@ -6,12 +6,12 @@ import io.netty.channel.ChannelHandlerContext; ...@@ -6,12 +6,12 @@ import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler; import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.channel.socket.DatagramPacket; import io.netty.channel.socket.DatagramPacket;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.wanji.com.cache.CrossInfoCache; import net.wanji.utc.dt.cache.CrossInfoCache;
import net.wanji.com.cache.netty.NettyMessageCache; import net.wanji.utc.dt.cache.netty.NettyMessageCache;
import net.wanji.com.netty.commandsign.CommandResultSign; import net.wanji.utc.dt.netty.commandsign.CommandResultSign;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
import net.wanji.com.netty.response.CommandResponseFactory; import net.wanji.utc.dt.netty.response.CommandResponseFactory;
import net.wanji.com.pojo.netty.MessageResultPojo; import net.wanji.utc.dt.pojo.netty.MessageResultPojo;
import net.wanji.common.framework.spring.ServiceBeanContext; import net.wanji.common.framework.spring.ServiceBeanContext;
import net.wanji.databus.po.CrossInfoPO; import net.wanji.databus.po.CrossInfoPO;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -21,8 +21,6 @@ import javax.annotation.Resource; ...@@ -21,8 +21,6 @@ import javax.annotation.Resource;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.util.Objects; import java.util.Objects;
import static net.wanji.com.common.enums.CommandResultSign.getClassNameByHexSign;
@Slf4j @Slf4j
@Component @Component
public class NettyServerHandler extends SimpleChannelInboundHandler<DatagramPacket> { public class NettyServerHandler extends SimpleChannelInboundHandler<DatagramPacket> {
...@@ -50,7 +48,7 @@ public class NettyServerHandler extends SimpleChannelInboundHandler<DatagramPack ...@@ -50,7 +48,7 @@ public class NettyServerHandler extends SimpleChannelInboundHandler<DatagramPack
log.error("返回命令标识为空hexSign: {}", hexSign); log.error("返回命令标识为空hexSign: {}", hexSign);
return; return;
} }
String className = getClassNameByHexSign(hexSign); String className = net.wanji.utc.dt.common.enums.CommandResultSign.getClassNameByHexSign(hexSign);
CommandResponseFactory commandResponseFactory = (CommandResponseFactory) ServiceBeanContext.getBean(className); CommandResponseFactory commandResponseFactory = (CommandResponseFactory) ServiceBeanContext.getBean(className);
String key = StringUtils.join("/", remote.getHostString(), ":", remote.getPort(), "/", hexSign); String key = StringUtils.join("/", remote.getHostString(), ":", remote.getPort(), "/", hexSign);
CommandPojo commandPojo = getCommandPojo(key, data); CommandPojo commandPojo = getCommandPojo(key, data);
......
package net.wanji.com.netty.response; package net.wanji.utc.dt.netty.response;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
/** /**
* @author duanruiming * @author duanruiming
......
package net.wanji.com.netty.response.impl; package net.wanji.utc.dt.netty.response.impl;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.wanji.com.cache.CrossInfoCache; import net.wanji.utc.dt.cache.CrossInfoCache;
import net.wanji.com.common.constants.Constants; import net.wanji.utc.dt.common.constants.Constants;
import net.wanji.com.netty.NettyClient; import net.wanji.utc.dt.netty.NettyClient;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
import net.wanji.com.netty.response.CommandResponseFactory; import net.wanji.utc.dt.netty.response.CommandResponseFactory;
import net.wanji.com.pojo.netty.MessageResultPojo; import net.wanji.utc.dt.pojo.netty.MessageResultPojo;
import net.wanji.databus.po.CrossInfoPO; import net.wanji.databus.po.CrossInfoPO;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
......
package net.wanji.com.netty.response.impl.get; package net.wanji.utc.dt.netty.response.impl.get;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
import net.wanji.com.netty.response.CommandResponseFactory; import net.wanji.utc.dt.netty.response.CommandResponseFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
......
package net.wanji.com.netty.response.impl.get; package net.wanji.utc.dt.netty.response.impl.get;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
import net.wanji.com.netty.response.CommandResponseFactory; import net.wanji.utc.dt.netty.response.CommandResponseFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
......
package net.wanji.com.netty.response.impl.get; package net.wanji.utc.dt.netty.response.impl.get;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
import net.wanji.com.netty.response.CommandResponseFactory; import net.wanji.utc.dt.netty.response.CommandResponseFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
......
package net.wanji.com.netty.response.impl.get; package net.wanji.utc.dt.netty.response.impl.get;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
import net.wanji.com.netty.response.CommandResponseFactory; import net.wanji.utc.dt.netty.response.CommandResponseFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
......
package net.wanji.com.netty.response.impl.get; package net.wanji.utc.dt.netty.response.impl.get;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
import net.wanji.com.netty.response.CommandResponseFactory; import net.wanji.utc.dt.netty.response.CommandResponseFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
......
package net.wanji.com.netty.response.impl.get; package net.wanji.utc.dt.netty.response.impl.get;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
import net.wanji.com.netty.response.CommandResponseFactory; import net.wanji.utc.dt.netty.response.CommandResponseFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
......
package net.wanji.com.netty.response.impl.get; package net.wanji.utc.dt.netty.response.impl.get;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
import net.wanji.com.netty.response.CommandResponseFactory; import net.wanji.utc.dt.netty.response.CommandResponseFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
......
package net.wanji.com.netty.response.impl.get; package net.wanji.utc.dt.netty.response.impl.get;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
import net.wanji.com.netty.response.CommandResponseFactory; import net.wanji.utc.dt.netty.response.CommandResponseFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
......
package net.wanji.com.netty.response.impl.get; package net.wanji.utc.dt.netty.response.impl.get;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
import net.wanji.com.netty.response.CommandResponseFactory; import net.wanji.utc.dt.netty.response.CommandResponseFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
......
package net.wanji.com.netty.response.impl.get; package net.wanji.utc.dt.netty.response.impl.get;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
import net.wanji.com.netty.response.CommandResponseFactory; import net.wanji.utc.dt.netty.response.CommandResponseFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
......
package net.wanji.com.netty.response.impl.get; package net.wanji.utc.dt.netty.response.impl.get;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
import net.wanji.com.netty.response.CommandResponseFactory; import net.wanji.utc.dt.netty.response.CommandResponseFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
......
package net.wanji.com.netty.response.impl.get; package net.wanji.utc.dt.netty.response.impl.get;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
import net.wanji.com.netty.response.CommandResponseFactory; import net.wanji.utc.dt.netty.response.CommandResponseFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
......
package net.wanji.com.netty.response.impl.get; package net.wanji.utc.dt.netty.response.impl.get;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
import net.wanji.com.netty.response.CommandResponseFactory; import net.wanji.utc.dt.netty.response.CommandResponseFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
......
package net.wanji.com.netty.response.impl.get; package net.wanji.utc.dt.netty.response.impl.get;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
import net.wanji.com.netty.response.CommandResponseFactory; import net.wanji.utc.dt.netty.response.CommandResponseFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
......
package net.wanji.com.netty.response.impl.get; package net.wanji.utc.dt.netty.response.impl.get;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
import net.wanji.com.netty.response.CommandResponseFactory; import net.wanji.utc.dt.netty.response.CommandResponseFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
......
package net.wanji.com.netty.response.impl.get; package net.wanji.utc.dt.netty.response.impl.get;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
import net.wanji.com.netty.response.CommandResponseFactory; import net.wanji.utc.dt.netty.response.CommandResponseFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
......
package net.wanji.com.netty.response.impl.set; package net.wanji.utc.dt.netty.response.impl.set;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
import net.wanji.com.netty.response.CommandResponseFactory; import net.wanji.utc.dt.netty.response.CommandResponseFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
......
package net.wanji.com.netty.response.impl.set; package net.wanji.utc.dt.netty.response.impl.set;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
import net.wanji.com.netty.response.CommandResponseFactory; import net.wanji.utc.dt.netty.response.CommandResponseFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
......
package net.wanji.com.netty.response.impl.set; package net.wanji.utc.dt.netty.response.impl.set;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
import net.wanji.com.netty.response.CommandResponseFactory; import net.wanji.utc.dt.netty.response.CommandResponseFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
......
package net.wanji.com.netty.response.impl.set; package net.wanji.utc.dt.netty.response.impl.set;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
import net.wanji.com.netty.response.CommandResponseFactory; import net.wanji.utc.dt.netty.response.CommandResponseFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
......
package net.wanji.com.netty.response.impl.set; package net.wanji.utc.dt.netty.response.impl.set;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
import net.wanji.com.netty.response.CommandResponseFactory; import net.wanji.utc.dt.netty.response.CommandResponseFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
......
package net.wanji.com.netty.response.impl.set; package net.wanji.utc.dt.netty.response.impl.set;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
import net.wanji.com.netty.response.CommandResponseFactory; import net.wanji.utc.dt.netty.response.CommandResponseFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
......
package net.wanji.com.netty.response.impl.set; package net.wanji.utc.dt.netty.response.impl.set;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
import net.wanji.com.netty.response.CommandResponseFactory; import net.wanji.utc.dt.netty.response.CommandResponseFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
......
package net.wanji.com.netty.response.impl.set; package net.wanji.utc.dt.netty.response.impl.set;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
import net.wanji.com.netty.response.CommandResponseFactory; import net.wanji.utc.dt.netty.response.CommandResponseFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
......
package net.wanji.com.netty.response.impl.set; package net.wanji.utc.dt.netty.response.impl.set;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
import net.wanji.com.netty.response.CommandResponseFactory; import net.wanji.utc.dt.netty.response.CommandResponseFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
......
package net.wanji.com.netty.response.impl.set; package net.wanji.utc.dt.netty.response.impl.set;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
import net.wanji.com.netty.response.CommandResponseFactory; import net.wanji.utc.dt.netty.response.CommandResponseFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
......
package net.wanji.com.netty.response.impl.set; package net.wanji.utc.dt.netty.response.impl.set;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
import net.wanji.com.netty.response.CommandResponseFactory; import net.wanji.utc.dt.netty.response.CommandResponseFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
......
package net.wanji.com.netty.response.impl.set; package net.wanji.utc.dt.netty.response.impl.set;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
import net.wanji.com.netty.response.CommandResponseFactory; import net.wanji.utc.dt.netty.response.CommandResponseFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
......
package net.wanji.com.netty.response.impl.set; package net.wanji.utc.dt.netty.response.impl.set;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
import net.wanji.com.netty.response.CommandResponseFactory; import net.wanji.utc.dt.netty.response.CommandResponseFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
......
package net.wanji.com.netty.response.impl.set; package net.wanji.utc.dt.netty.response.impl.set;
import net.wanji.com.netty.pojo.CommandPojo; import net.wanji.utc.dt.netty.pojo.CommandPojo;
import net.wanji.com.netty.response.CommandResponseFactory; import net.wanji.utc.dt.netty.response.CommandResponseFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
......
package net.wanji.com.pojo.dtconvert; package net.wanji.utc.dt.pojo.dtconvert;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
......
package net.wanji.com.pojo.netty; package net.wanji.utc.dt.pojo.netty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
......
package net.wanji.com.service; package net.wanji.utc.dt.service;
import lombok.NonNull; import lombok.NonNull;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
......
package net.wanji.com.service.controller; package net.wanji.utc.dt.service.controller;
/** /**
* @author duanruiming * @author duanruiming
......
package net.wanji.com.service.controller; package net.wanji.utc.dt.service.controller;
import net.wanji.common.framework.rest.JsonViewObject; import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.databus.vo.*; import net.wanji.databus.vo.*;
......
package net.wanji.com.service.controller; package net.wanji.utc.dt.service.controller;
import net.wanji.databus.po.SignalStatusLogPO; import net.wanji.databus.po.SignalStatusLogPO;
import net.wanji.databus.vo.LightsStatusVO; import net.wanji.databus.vo.LightsStatusVO;
......
package net.wanji.com.service.controller; package net.wanji.utc.dt.service.controller;
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.CrossInfoDTO;
......
package net.wanji.com.service.controller.impl; package net.wanji.utc.dt.service.controller.impl;
import cn.hutool.core.util.HexUtil; import cn.hutool.core.util.HexUtil;
import net.wanji.com.cache.CrossInfoCache;
import net.wanji.com.cache.SignalDataCache;
import net.wanji.com.common.constants.Constants;
import net.wanji.com.common.enums.ControlModelEnum;
import net.wanji.com.common.enums.ControlTypeEnum;
import net.wanji.com.common.enums.PhaseLightColorEnum;
import net.wanji.com.netty.NettyClient;
import net.wanji.com.pojo.dtconvert.*;
import net.wanji.com.pojo.netty.MessageResultPojo;
import net.wanji.com.service.controller.SignalStatusService;
import net.wanji.common.enums.BaseEnum; import net.wanji.common.enums.BaseEnum;
import net.wanji.databus.po.CrossInfoPO; import net.wanji.databus.po.CrossInfoPO;
import net.wanji.databus.po.SignalStatusLogPO; import net.wanji.databus.po.SignalStatusLogPO;
import net.wanji.databus.vo.LightsStatusVO; import net.wanji.databus.vo.LightsStatusVO;
import net.wanji.utc.dt.cache.CrossInfoCache;
import net.wanji.utc.dt.cache.SignalDataCache;
import net.wanji.utc.dt.common.constants.Constants;
import net.wanji.utc.dt.common.enums.ControlModelEnum;
import net.wanji.utc.dt.common.enums.ControlTypeEnum;
import net.wanji.utc.dt.common.enums.PhaseLightColorEnum;
import net.wanji.utc.dt.netty.NettyClient;
import net.wanji.utc.dt.pojo.dtconvert.*;
import net.wanji.utc.dt.pojo.netty.MessageResultPojo;
import net.wanji.utc.dt.service.controller.SignalStatusService;
import net.wanji.utc.dt.util.CommonUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
...@@ -218,15 +219,17 @@ public class DTSignalStatusServiceImpl implements SignalStatusService { ...@@ -218,15 +219,17 @@ public class DTSignalStatusServiceImpl implements SignalStatusService {
Map<String, Object> dirLampGroupMap = new HashMap<>(); Map<String, Object> dirLampGroupMap = new HashMap<>();
if (!CollectionUtils.isEmpty(lightsStatus)) { if (!CollectionUtils.isEmpty(lightsStatus)) {
for (int i = 0; i < lightsStatus.size(); i++) { for (int i = 0; i < lightsStatus.size(); i++) {
Map<Integer, String> turnColorMap = new HashMap<>();
String wjLightColor = PhaseLightColorEnum.getWjLightColor(lightsStatus.get(i)); String wjLightColor = PhaseLightColorEnum.getWjLightColor(lightsStatus.get(i));
List<PhaseInfoPojo> phaseInfoPojos = SignalDataCache.phaseInfoCache.get(crossId); Integer turn = CommonUtils.getTurnByLightsId(i);
if (!CollectionUtils.isEmpty(phaseInfoPojos)) { turnColorMap.put(turn, wjLightColor);
for (PhaseInfoPojo phaseInfoPojo : phaseInfoPojos) { String dir = String.valueOf(CommonUtils.getDirByLightsId(i));
if (Objects.equals(phaseInfoPojo.getLightsId(), i + 1)) { if (dirLampGroupMap.isEmpty() || Objects.isNull(dirLampGroupMap.get(dir))) {
Integer phaseId = phaseInfoPojo.getPhaseId(); dirLampGroupMap.put(dir, turnColorMap);
dirLampGroupMap.put(String.valueOf(phaseId), wjLightColor); } else {
} Map<Integer, String> currentTurnColorMap = (Map<Integer, String>) dirLampGroupMap.get(dir);
} currentTurnColorMap.put(turn, wjLightColor);
dirLampGroupMap.put(dir, currentTurnColorMap);
} }
} }
} }
......
package net.wanji.com.service.controller.impl; package net.wanji.utc.dt.service.controller.impl;
import cn.hutool.core.util.HexUtil; import cn.hutool.core.util.HexUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.wanji.com.cache.CrossInfoCache;
import net.wanji.com.cache.SignalDataCache;
import net.wanji.com.common.constants.Constants;
import net.wanji.com.common.enums.ControlModelEnum;
import net.wanji.com.netty.NettyClient;
import net.wanji.com.pojo.dtconvert.*;
import net.wanji.com.pojo.netty.MessageResultPojo;
import net.wanji.com.service.controller.StaticInfoService;
import net.wanji.common.enums.BaseEnum; import net.wanji.common.enums.BaseEnum;
import net.wanji.common.enums.DateStyle; import net.wanji.common.enums.DateStyle;
import net.wanji.common.utils.tool.DateUtil; import net.wanji.common.utils.tool.DateUtil;
...@@ -22,6 +14,14 @@ import net.wanji.databus.dto.SchemePhaseLightsDTO; ...@@ -22,6 +14,14 @@ 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.dt.cache.CrossInfoCache;
import net.wanji.utc.dt.cache.SignalDataCache;
import net.wanji.utc.dt.common.constants.Constants;
import net.wanji.utc.dt.common.enums.ControlModelEnum;
import net.wanji.utc.dt.netty.NettyClient;
import net.wanji.utc.dt.pojo.dtconvert.*;
import net.wanji.utc.dt.pojo.netty.MessageResultPojo;
import net.wanji.utc.dt.service.controller.StaticInfoService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
...@@ -168,17 +168,24 @@ public class DTStaticInfoServiceImpl implements StaticInfoService { ...@@ -168,17 +168,24 @@ public class DTStaticInfoServiceImpl implements StaticInfoService {
crossPhasePO.setPlanId(schemeId); crossPhasePO.setPlanId(schemeId);
crossPhasePO.setRingNo(1); crossPhasePO.setRingNo(1);
crossPhasePO.setGroupNo(1); crossPhasePO.setGroupNo(1);
crossPhasePO.setPhaseTime(phaseStageTime);
crossPhasePO.setControlMode(1); crossPhasePO.setControlMode(1);
crossPhasePO.setPhaseType(1); crossPhasePO.setPhaseType(1);
crossPhasePO.setPhaseTime(phaseStageTime);
PhaseInfoPojo phaseInfoPojo = PhaseInfoPojo.getPhaseInfoPojoByPhaseId(phaseId, phaseInfoPojos); PhaseInfoPojo phaseInfoPojo = PhaseInfoPojo.getPhaseInfoPojoByPhaseId(phaseId, phaseInfoPojos);
if (Objects.nonNull(phaseInfoPojo)) { if (Objects.nonNull(phaseInfoPojo)) {
crossPhasePO.setGreenTime(phaseInfoPojo.getGreenTime()); int redTime = phaseInfoPojo.getRedTime() - phaseInfoPojo.getGreenFlashTime() - phaseInfoPojo.getGreenTime();
if (phaseStageTime == 0) { // 相位阶段没有对应方案
phaseStageTime = phaseInfoPojo.getGreenTime() + phaseInfoPojo.getGreenFlashTime() + phaseInfoPojo.getYellowTime() + redTime;
}
crossPhasePO.setPhaseTime(phaseStageTime);
int greenTime = phaseStageTime - phaseInfoPojo.getYellowTime() - redTime - phaseInfoPojo.getGreenFlashTime() * 2;
if (greenTime < 0) {
greenTime = phaseInfoPojo.getGreenTime();
}
crossPhasePO.setGreenTime(greenTime);
crossPhasePO.setGreenFlashTime(phaseInfoPojo.getGreenFlashTime()); crossPhasePO.setGreenFlashTime(phaseInfoPojo.getGreenFlashTime());
crossPhasePO.setYellowFlashTime(phaseInfoPojo.getYellowFlashTime()); crossPhasePO.setYellowFlashTime(phaseInfoPojo.getYellowFlashTime() * 2);
crossPhasePO.setYellowTime(phaseInfoPojo.getYellowTime()); crossPhasePO.setYellowTime(phaseInfoPojo.getYellowTime());
crossPhasePO.setRedTime(phaseInfoPojo.getRedTime()); crossPhasePO.setRedTime(redTime);
crossPhasePO.setMinGreenTime(phaseInfoPojo.getMinGreenTime()); crossPhasePO.setMinGreenTime(phaseInfoPojo.getMinGreenTime());
crossPhasePO.setMaxGreenTime(phaseInfoPojo.getMaxGreenTime()); crossPhasePO.setMaxGreenTime(phaseInfoPojo.getMaxGreenTime());
} }
......
package net.wanji.com.service.protocol; package net.wanji.utc.dt.service.protocol;
import net.wanji.databus.po.CrossInfoPO; import net.wanji.databus.po.CrossInfoPO;
......
package net.wanji.com.service.protocol.impl.base; package net.wanji.utc.dt.service.protocol.impl.base;
import net.wanji.com.service.protocol.ProtocolConversion; import net.wanji.utc.dt.service.protocol.ProtocolConversion;
import net.wanji.databus.po.CrossInfoPO; import net.wanji.databus.po.CrossInfoPO;
/** /**
......
package net.wanji.com.service.protocol.impl.base; package net.wanji.utc.dt.service.protocol.impl.base;
import net.wanji.com.service.protocol.ProtocolConversion; import net.wanji.utc.dt.service.protocol.ProtocolConversion;
import net.wanji.databus.po.CrossInfoPO; import net.wanji.databus.po.CrossInfoPO;
/** /**
......
package net.wanji.com.service.protocol.impl.base; package net.wanji.utc.dt.service.protocol.impl.base;
import net.wanji.com.service.protocol.ProtocolConversion; import net.wanji.utc.dt.service.protocol.ProtocolConversion;
import net.wanji.databus.po.CrossInfoPO; import net.wanji.databus.po.CrossInfoPO;
/** /**
......
package net.wanji.com.service.protocol.impl.base; package net.wanji.utc.dt.service.protocol.impl.base;
import net.wanji.com.netty.NettyClient; import net.wanji.utc.dt.netty.NettyClient;
import net.wanji.com.pojo.netty.MessageResultPojo; import net.wanji.utc.dt.pojo.netty.MessageResultPojo;
import net.wanji.com.service.protocol.ProtocolConversion; import net.wanji.utc.dt.service.protocol.ProtocolConversion;
import net.wanji.databus.po.CrossInfoPO; import net.wanji.databus.po.CrossInfoPO;
/** /**
......
package net.wanji.com.service.protocol.impl.base; package net.wanji.utc.dt.service.protocol.impl.base;
import net.wanji.com.service.protocol.ProtocolConversion; import net.wanji.utc.dt.service.protocol.ProtocolConversion;
import net.wanji.databus.po.CrossInfoPO; import net.wanji.databus.po.CrossInfoPO;
/** /**
......
package net.wanji.com.service.protocol.impl.base; package net.wanji.utc.dt.service.protocol.impl.base;
import net.wanji.com.service.protocol.ProtocolConversion; import net.wanji.utc.dt.service.protocol.ProtocolConversion;
import net.wanji.databus.po.CrossInfoPO; import net.wanji.databus.po.CrossInfoPO;
/** /**
......
package net.wanji.com.service.protocol.impl.base; package net.wanji.utc.dt.service.protocol.impl.base;
import net.wanji.com.service.protocol.ProtocolConversion; import net.wanji.utc.dt.service.protocol.ProtocolConversion;
import net.wanji.databus.po.CrossInfoPO; import net.wanji.databus.po.CrossInfoPO;
/** /**
......
package net.wanji.com.service.protocol.impl.base; package net.wanji.utc.dt.service.protocol.impl.base;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.wanji.com.netty.NettyClient; import net.wanji.utc.dt.netty.NettyClient;
import net.wanji.com.pojo.netty.MessageResultPojo; import net.wanji.utc.dt.pojo.netty.MessageResultPojo;
import net.wanji.com.service.protocol.ProtocolConversion; import net.wanji.utc.dt.service.protocol.ProtocolConversion;
import net.wanji.databus.po.CrossInfoPO; import net.wanji.databus.po.CrossInfoPO;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
......
package net.wanji.com.service.protocol.impl.base; package net.wanji.utc.dt.service.protocol.impl.base;
import net.wanji.com.service.protocol.ProtocolConversion; import net.wanji.utc.dt.service.protocol.ProtocolConversion;
import net.wanji.databus.po.CrossInfoPO; import net.wanji.databus.po.CrossInfoPO;
/** /**
......
package net.wanji.com.service.protocol.impl.control; package net.wanji.utc.dt.service.protocol.impl.control;
import net.wanji.com.service.protocol.ProtocolConversion; import net.wanji.utc.dt.service.protocol.ProtocolConversion;
import net.wanji.databus.po.CrossInfoPO; import net.wanji.databus.po.CrossInfoPO;
/** /**
......
package net.wanji.com.service.protocol.impl.status; package net.wanji.utc.dt.service.protocol.impl.status;
import net.wanji.com.service.protocol.ProtocolConversion; import net.wanji.utc.dt.service.protocol.ProtocolConversion;
import net.wanji.databus.po.CrossInfoPO; import net.wanji.databus.po.CrossInfoPO;
/** /**
......
package net.wanji.com.util; package net.wanji.utc.dt.util;
import cn.hutool.core.util.HexUtil; import cn.hutool.core.util.HexUtil;
......
package net.wanji.com.util; package net.wanji.utc.dt.util;
import cn.hutool.core.util.HexUtil; import cn.hutool.core.util.HexUtil;
import freemarker.template.utility.StringUtil; import freemarker.template.utility.StringUtil;
...@@ -11,6 +11,7 @@ public class CommonUtils { ...@@ -11,6 +11,7 @@ public class CommonUtils {
/** /**
* 将数组转化为16进制字符串 * 将数组转化为16进制字符串
*
* @param array * @param array
* @return * @return
*/ */
...@@ -25,6 +26,7 @@ public class CommonUtils { ...@@ -25,6 +26,7 @@ public class CommonUtils {
/** /**
* 将时间转化为16进制 00:00 --> 061E0 * 将时间转化为16进制 00:00 --> 061E0
*
* @param time * @param time
* @return * @return
*/ */
...@@ -36,6 +38,12 @@ public class CommonUtils { ...@@ -36,6 +38,12 @@ public class CommonUtils {
return sb.append(hour).append(minute).toString(); return sb.append(hour).append(minute).toString();
} }
/**
* 将相位转化为64位数组,在转化为16位的16进制
*
* @param param
* @return
*/
public static String getBinary(Integer param) { public static String getBinary(Integer param) {
int[] array = new int[64]; int[] array = new int[64];
array[param - 1] = 1; array[param - 1] = 1;
...@@ -51,7 +59,69 @@ public class CommonUtils { ...@@ -51,7 +59,69 @@ public class CommonUtils {
return StringUtil.leftPad(resultSb.toString(), 16, "0"); return StringUtil.leftPad(resultSb.toString(), 16, "0");
} }
/**
* 将单个参数转化为4位二进制
*
* @param param
* @return
*/
public static Integer get4BinaryInteger(Integer param) {
int[] array = new int[4];
int index = param % 4;
if (param % 4 != 0) {
array[4 - index] = 1;
} else {
array[0] = 1;
}
StringBuffer sb = new StringBuffer();
for (int j = 0; j < 4; j++) {
sb.append(array[j]);
}
return Integer.parseInt(sb.toString(), 2);
}
/**
* 通过灯组编号获取灯组转向, 1 左转 2 直右 3 非机动车 4 行人
*
* @param lightId
* @return
*/
public static Integer getTurnByLightsId(Integer lightId) {
Integer turn = null;
if (lightId % 4 == 0) {
turn = 1;
}
if (lightId % 4 == 1) {
turn = 6;
}
if (lightId % 4 == 2) {
turn = 6;
}
if (lightId % 4 == 3) {
turn = 20;
}
return turn;
}
public static Integer getDirByLightsId(Integer lightsId) {
Integer dir = null;
if (lightsId < 4) {
dir = 1;
}
if (lightsId >= 4 && lightsId < 8) {
dir = 3;
}
if (lightsId >= 8 && lightsId < 12) {
dir = 5;
}
if (lightsId >= 12 && lightsId < 16) {
dir = 7;
}
return dir;
}
public static void main(String[] args) { public static void main(String[] args) {
System.err.println(getBinary(8)); System.err.println(get4BinaryInteger(4));
} }
} }
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<!-- 配置打印INFO级别日志的环境 --> <!-- 配置打印INFO级别日志的环境 -->
<springProfile name="prod"> <springProfile name="prod">
<logger name="net.wanji.com" level="info" /> <logger name="net.wanji.utc.dt" level="info" />
</springProfile> </springProfile>
<appender name="consoleLog" class="ch.qos.logback.core.ConsoleAppender"> <appender name="consoleLog" class="ch.qos.logback.core.ConsoleAppender">
......
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