no message
parent
1719717807
commit
c7ba5be2b9
|
|
@ -60,7 +60,6 @@ public class AppRun {
|
||||||
springApplication.addListeners(new ApplicationPidFileWriter());
|
springApplication.addListeners(new ApplicationPidFileWriter());
|
||||||
springApplication.addListeners(new MyApiDictListener());
|
springApplication.addListeners(new MyApiDictListener());
|
||||||
springApplication.run(args);
|
springApplication.run(args);
|
||||||
log.info(JSONUtil.toJsonStr(LicenseValidate.getSystem_price()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,6 @@ public class NettyServerBoot {
|
||||||
serverBootstrap.bind(nettyProperties.getPort()).sync();
|
serverBootstrap.bind(nettyProperties.getPort()).sync();
|
||||||
// 备用端口
|
// 备用端口
|
||||||
serverBootstrap.bind(nettyProperties.getPortSalve()).sync();
|
serverBootstrap.bind(nettyProperties.getPortSalve()).sync();
|
||||||
log.info("启动Netty: {},{}", nettyProperties.getPort(), nettyProperties.getPortSalve());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -46,7 +45,6 @@ public class NettyServerBoot {
|
||||||
*/
|
*/
|
||||||
@PreDestroy
|
@PreDestroy
|
||||||
public void close() {
|
public void close() {
|
||||||
log.info("关闭Netty");
|
|
||||||
boosGroup.shutdownGracefully();
|
boosGroup.shutdownGracefully();
|
||||||
workerGroup.shutdownGracefully();
|
workerGroup.shutdownGracefully();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -176,10 +176,8 @@ public class NettyUtils {
|
||||||
//000100000006010600060000
|
//000100000006010600060000
|
||||||
|
|
||||||
if("000000000006010300010008".equals(sendStr)){
|
if("000000000006010300010008".equals(sendStr)){
|
||||||
log.info("回写心跳,执行一次"+sendStr);
|
|
||||||
ReawriteToClient(lamp_log_id,sendStr,channel,mark);
|
ReawriteToClient(lamp_log_id,sendStr,channel,mark);
|
||||||
}else{
|
}else{
|
||||||
log.info("其他数据,执行两次"+sendStr);
|
|
||||||
ReawriteToClient(lamp_log_id,sendStr,channel,mark);
|
ReawriteToClient(lamp_log_id,sendStr,channel,mark);
|
||||||
try{
|
try{
|
||||||
Thread.sleep(100);
|
Thread.sleep(100);
|
||||||
|
|
@ -213,12 +211,10 @@ public class NettyUtils {
|
||||||
sb.append("【").append(mark).append("】");
|
sb.append("【").append(mark).append("】");
|
||||||
}
|
}
|
||||||
if (future.isSuccess()) {
|
if (future.isSuccess()) {
|
||||||
log.info(sb.toString()+"回写成功"+sendStr);
|
|
||||||
if (lamp_log_id!=null){
|
if (lamp_log_id!=null){
|
||||||
redisUtils.set(String.valueOf(lamp_log_id),sb.toString()+"回写成功"+sendStr);
|
redisUtils.set(String.valueOf(lamp_log_id),sb.toString()+"回写成功"+sendStr);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.error(sb.toString()+"回写失败"+sendStr);
|
|
||||||
if (lamp_log_id!=null){
|
if (lamp_log_id!=null){
|
||||||
redisUtils.set(String.valueOf(lamp_log_id),sb.toString()+"回写失败"+sendStr);
|
redisUtils.set(String.valueOf(lamp_log_id),sb.toString()+"回写失败"+sendStr);
|
||||||
}
|
}
|
||||||
|
|
@ -227,7 +223,6 @@ public class NettyUtils {
|
||||||
});
|
});
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
log.error("调用通用writeToClient()异常"+e.getMessage());
|
|
||||||
if (lamp_log_id!=null){
|
if (lamp_log_id!=null){
|
||||||
redisUtils.set(String.valueOf(lamp_log_id), "调用通用writeToClient()异常"+e.getMessage());
|
redisUtils.set(String.valueOf(lamp_log_id), "调用通用writeToClient()异常"+e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,10 +52,8 @@ public class ServerListenerHandler extends SimpleChannelInboundHandler<String> {
|
||||||
@Override
|
@Override
|
||||||
public void handlerAdded(ChannelHandlerContext ctx) {
|
public void handlerAdded(ChannelHandlerContext ctx) {
|
||||||
String ip =((InetSocketAddress)ctx.channel().remoteAddress()).getAddress().getHostAddress();
|
String ip =((InetSocketAddress)ctx.channel().remoteAddress()).getAddress().getHostAddress();
|
||||||
log.info("有新的连接:[{}]", ip);
|
|
||||||
Channel lastClient=NettyUtils.getChannel(ip);
|
Channel lastClient=NettyUtils.getChannel(ip);
|
||||||
if(lastClient!=null){
|
if(lastClient!=null){
|
||||||
log.info("当前IP有旧的连接,移除旧的的连接:[{}]", ip);
|
|
||||||
clients.remove(lastClient);
|
clients.remove(lastClient);
|
||||||
}
|
}
|
||||||
clients.add(ctx.channel());
|
clients.add(ctx.channel());
|
||||||
|
|
@ -108,7 +106,6 @@ public class ServerListenerHandler extends SimpleChannelInboundHandler<String> {
|
||||||
NettyUtils.writeToClient(null,buff.toString(),ctx.channel(),"读取设备状态");
|
NettyUtils.writeToClient(null,buff.toString(),ctx.channel(),"读取设备状态");
|
||||||
}
|
}
|
||||||
|
|
||||||
log.info("心跳内容" + content);
|
|
||||||
String bt1=content.substring(16,18);
|
String bt1=content.substring(16,18);
|
||||||
String bt2=content.substring(18,20);
|
String bt2=content.substring(18,20);
|
||||||
String bt3=content.substring(20,22);
|
String bt3=content.substring(20,22);
|
||||||
|
|
@ -137,11 +134,9 @@ public class ServerListenerHandler extends SimpleChannelInboundHandler<String> {
|
||||||
|
|
||||||
|
|
||||||
public void ClickButton(RedisUtils redisUtils,String content,String ip,String ButtonCode,String LightCode){
|
public void ClickButton(RedisUtils redisUtils,String content,String ip,String ButtonCode,String LightCode){
|
||||||
log.info(ButtonCode+"按钮 被按下");
|
|
||||||
//读取bt_key
|
//读取bt_key
|
||||||
String bt_key="TCP"+ip+ButtonCode;
|
String bt_key="TCP"+ip+ButtonCode;
|
||||||
if ((Boolean) redisUtils.get(bt_key,false)) {
|
if ((Boolean) redisUtils.get(bt_key,false)) {
|
||||||
log.error("{}正在执行...",bt_key);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//写入key 为Tue
|
//写入key 为Tue
|
||||||
|
|
@ -157,18 +152,14 @@ public class ServerListenerHandler extends SimpleChannelInboundHandler<String> {
|
||||||
lampLog.setRequestContent(content);
|
lampLog.setRequestContent(content);
|
||||||
lampLog.setReturnState(ButtonCode+"被按下");
|
lampLog.setReturnState(ButtonCode+"被按下");
|
||||||
//获取盒子号
|
//获取盒子号
|
||||||
log.info("ButtonBoxCode:"+ip + ButtonCode+"====");
|
|
||||||
Object buttonBoxCode = redisUtils.hget("ButtonBoxCode", ip + ButtonCode,"")+"";
|
Object buttonBoxCode = redisUtils.hget("ButtonBoxCode", ip + ButtonCode,"")+"";
|
||||||
if ("".equals(buttonBoxCode)){
|
if ("".equals(buttonBoxCode)){
|
||||||
log.info("ButtonBoxCode为空:"+ip + ButtonCode+"====");
|
|
||||||
List<Box> boxAllData = bean1.getBoxAllData();
|
List<Box> boxAllData = bean1.getBoxAllData();
|
||||||
for (Box box:boxAllData){
|
for (Box box:boxAllData){
|
||||||
redisUtils.hset("ButtonBoxCode",box.getIP()+box.getLampCode(),box.getCode(),60);
|
redisUtils.hset("ButtonBoxCode",box.getIP()+box.getLampCode(),box.getCode(),60);
|
||||||
}
|
}
|
||||||
lampLog.setButtonBox(redisUtils.hget("ButtonBoxCode", ip + ButtonCode,"")+"");
|
lampLog.setButtonBox(redisUtils.hget("ButtonBoxCode", ip + ButtonCode,"")+"");
|
||||||
log.info("ButtonBoxCode重新从redis获取:"+ip + ButtonCode+"====lampLog"+lampLog.getButtonBox()+"是否正确");
|
|
||||||
}else {
|
}else {
|
||||||
log.info("ButtonBoxCode不为空:"+buttonBoxCode.toString()+"====");
|
|
||||||
lampLog.setButtonBox(buttonBoxCode.toString());
|
lampLog.setButtonBox(buttonBoxCode.toString());
|
||||||
}
|
}
|
||||||
lampLog.setOperationType("自动");
|
lampLog.setOperationType("自动");
|
||||||
|
|
@ -204,7 +195,6 @@ public class ServerListenerHandler extends SimpleChannelInboundHandler<String> {
|
||||||
String ip =((InetSocketAddress)ctx.channel().remoteAddress()).getAddress().getHostAddress();
|
String ip =((InetSocketAddress)ctx.channel().remoteAddress()).getAddress().getHostAddress();
|
||||||
|
|
||||||
clients.remove(ctx.channel());
|
clients.remove(ctx.channel());
|
||||||
log.info("设备下线了:{}", ip);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -216,7 +206,6 @@ public class ServerListenerHandler extends SimpleChannelInboundHandler<String> {
|
||||||
@Override
|
@Override
|
||||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
|
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
|
||||||
// 打印异常
|
// 打印异常
|
||||||
log.info("异常:{}", cause.getMessage());
|
|
||||||
// 关闭连接
|
// 关闭连接
|
||||||
ctx.close();
|
ctx.close();
|
||||||
clients.remove(ctx.channel());
|
clients.remove(ctx.channel());
|
||||||
|
|
@ -224,7 +213,6 @@ public class ServerListenerHandler extends SimpleChannelInboundHandler<String> {
|
||||||
|
|
||||||
//按钮1 的业务
|
//按钮1 的业务
|
||||||
public ResponseEntity<Object> buttonService(String buttonBoxCode){
|
public ResponseEntity<Object> buttonService(String buttonBoxCode){
|
||||||
log.info("WMS按钮"+buttonBoxCode+"的业务......");
|
|
||||||
BoxServiceImpl bsi = SpringContextHolder.getBean(BoxServiceImpl.class);
|
BoxServiceImpl bsi = SpringContextHolder.getBean(BoxServiceImpl.class);
|
||||||
BoxMapper bm= SpringContextHolder.getBean(BoxMapper.class);
|
BoxMapper bm= SpringContextHolder.getBean(BoxMapper.class);
|
||||||
BoxQueryCriteria bqc=new BoxQueryCriteria();
|
BoxQueryCriteria bqc=new BoxQueryCriteria();
|
||||||
|
|
@ -233,7 +221,6 @@ public class ServerListenerHandler extends SimpleChannelInboundHandler<String> {
|
||||||
if(bds.size()>0){
|
if(bds.size()>0){
|
||||||
BoxDto b=bds.get(0);
|
BoxDto b=bds.get(0);
|
||||||
try {
|
try {
|
||||||
log.info("进来WMS按钮的业务......");
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log log_data=new Log();
|
Log log_data=new Log();
|
||||||
log_data.setRequestIp(b.getIP());
|
log_data.setRequestIp(b.getIP());
|
||||||
|
|
@ -243,7 +230,6 @@ public class ServerListenerHandler extends SimpleChannelInboundHandler<String> {
|
||||||
log_data.setReturnData(e.getMessage());
|
log_data.setReturnData(e.getMessage());
|
||||||
LogServiceImpl lsi = SpringContextHolder.getBean(LogServiceImpl.class);
|
LogServiceImpl lsi = SpringContextHolder.getBean(LogServiceImpl.class);
|
||||||
lsi.saveLog(log_data);
|
lsi.saveLog(log_data);
|
||||||
log.error("灯日志"+e.getMessage());
|
|
||||||
Box box=bm.toEntity(b);
|
Box box=bm.toEntity(b);
|
||||||
box.setLampStatus("0");
|
box.setLampStatus("0");
|
||||||
bsi.update(box);
|
bsi.update(box);
|
||||||
|
|
|
||||||
|
|
@ -279,7 +279,6 @@ public class PointController {
|
||||||
point.setEnabled(Boolean.parseBoolean(enabled));
|
point.setEnabled(Boolean.parseBoolean(enabled));
|
||||||
pointService.update(point);
|
pointService.update(point);
|
||||||
}
|
}
|
||||||
log.info(smallArea + "小库区批量调整存储类型为" + description + "状态为" + Boolean.parseBoolean(enabled));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//批量调整库区
|
//批量调整库区
|
||||||
|
|
@ -291,7 +290,6 @@ public class PointController {
|
||||||
point.setEnabled(Boolean.parseBoolean(enabled));
|
point.setEnabled(Boolean.parseBoolean(enabled));
|
||||||
pointService.update(point);
|
pointService.update(point);
|
||||||
}
|
}
|
||||||
log.info(smallArea + "小库区批量调整库区为" + area.getName() + "状态为" + Boolean.parseBoolean(enabled));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
return successRequest("调整成功!", "");
|
return successRequest("调整成功!", "");
|
||||||
|
|
|
||||||
|
|
@ -353,7 +353,7 @@ public class AgvTaskServiceImpl implements AgvTaskService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendAgvTask(AgvTask agvTask, String json) {
|
private void sendAgvTask(AgvTask agvTask, String json) {
|
||||||
/*String resultJson = HttpPostUtil.sendPostReq(UrlApi.submitMission(), json);
|
String resultJson = HttpPostUtil.sendPostReq(UrlApi.submitMission(), json);
|
||||||
if (StringUtils.isEmpty(resultJson)) {
|
if (StringUtils.isEmpty(resultJson)) {
|
||||||
throw new RuntimeException("AGV返回信息:下发任务接口调用失败!");
|
throw new RuntimeException("AGV返回信息:下发任务接口调用失败!");
|
||||||
}
|
}
|
||||||
|
|
@ -363,10 +363,8 @@ public class AgvTaskServiceImpl implements AgvTaskService {
|
||||||
}
|
}
|
||||||
|
|
||||||
String code = resulObject.getString("code");
|
String code = resulObject.getString("code");
|
||||||
String message = resulObject.getString("message");*/
|
String message = resulObject.getString("message");
|
||||||
String resultJson = null;
|
|
||||||
String code = "0";
|
|
||||||
String message = null;
|
|
||||||
if (!"0".equals(code)) {
|
if (!"0".equals(code)) {
|
||||||
throw new RuntimeException("AGV返回信息:" + message);
|
throw new RuntimeException("AGV返回信息:" + message);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@ public class LicenseValidate {
|
||||||
public static LicenseCheck getKey_price() throws Exception{
|
public static LicenseCheck getKey_price() throws Exception{
|
||||||
//读取本地文件
|
//读取本地文件
|
||||||
FileProperties properties= SpringContextHolder.getBean(FileProperties.class);
|
FileProperties properties= SpringContextHolder.getBean(FileProperties.class);
|
||||||
log.info(properties.getPath().getPath());
|
|
||||||
String result="";
|
String result="";
|
||||||
try{
|
try{
|
||||||
FileReader fileReader = new FileReader(properties.getPath().getPath()+"key/"+"license.key");
|
FileReader fileReader = new FileReader(properties.getPath().getPath()+"key/"+"license.key");
|
||||||
|
|
@ -41,9 +40,7 @@ public class LicenseValidate {
|
||||||
throw new BadRequestException("License不存在,请上传License");
|
throw new BadRequestException("License不存在,请上传License");
|
||||||
}
|
}
|
||||||
|
|
||||||
log.error(result);
|
|
||||||
String rsaResult= RsaUtils.decryptByPublicKey(RsaProperties.licenseKey,result);
|
String rsaResult= RsaUtils.decryptByPublicKey(RsaProperties.licenseKey,result);
|
||||||
log.error("------------------------解密完成-----------------------");
|
|
||||||
LicenseCheck key_price = JSONUtil.toBean(rsaResult, LicenseCheck.class);
|
LicenseCheck key_price = JSONUtil.toBean(rsaResult, LicenseCheck.class);
|
||||||
return key_price;
|
return key_price;
|
||||||
}
|
}
|
||||||
|
|
@ -163,7 +160,6 @@ public class LicenseValidate {
|
||||||
}
|
}
|
||||||
|
|
||||||
FileProperties properties= SpringContextHolder.getBean(FileProperties.class);
|
FileProperties properties= SpringContextHolder.getBean(FileProperties.class);
|
||||||
log.info(properties.getPath().getPath());
|
|
||||||
|
|
||||||
FileWriter writer = new FileWriter(properties.getPath().getPath()+"key/"+"license.key");
|
FileWriter writer = new FileWriter(properties.getPath().getPath()+"key/"+"license.key");
|
||||||
writer.write(license_code);
|
writer.write(license_code);
|
||||||
|
|
@ -223,7 +219,6 @@ public class LicenseValidate {
|
||||||
|
|
||||||
long betweenDay = DateUtil.between(licenseCheck_date, F_creationTime, DateUnit.DAY);
|
long betweenDay = DateUtil.between(licenseCheck_date, F_creationTime, DateUnit.DAY);
|
||||||
long betweenDay2 = DateUtil.between(licenseCheck_date, F_lastModifiedTime, DateUnit.DAY);
|
long betweenDay2 = DateUtil.between(licenseCheck_date, F_lastModifiedTime, DateUnit.DAY);
|
||||||
log.info(betweenDay+"-------------"+betweenDay2);
|
|
||||||
if(betweenDay==0&&betweenDay2==0){
|
if(betweenDay==0&&betweenDay2==0){
|
||||||
//文件时间校验通过,不需要重新生成
|
//文件时间校验通过,不需要重新生成
|
||||||
System.out.println("------------------------文件时间校验通过,不需要重新生成-----------------------");
|
System.out.println("------------------------文件时间校验通过,不需要重新生成-----------------------");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue