Commit eeed6c73 authored by 董国亮's avatar 董国亮

修订绿波下发接口

parent 72909caa
#!/bin/bash #!/bin/bash
jarName="signal-control-service-1.0.0.jar" jarName="signal-control-service-0.2.1.jar"
NR=$(ps -ef | grep "${jarName}" | grep -v grep | wc -l) NR=$(ps -ef | grep "${jarName}" | grep -v grep | wc -l)
if [ ${NR} != 0 ] if [ ${NR} != 0 ]
...@@ -16,4 +16,4 @@ sleep 2 ...@@ -16,4 +16,4 @@ sleep 2
echo "重启Java程序进程..." echo "重启Java程序进程..."
nohup java -Xms2048m -Xmx2048m -jar -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/javaApp/heapdump.hprof -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=15115 -Djava.rmi.server.hostname=10.100.1.87 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=12345 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false signal-control-service-1.0.0.jar --spring.profiles.active=dev >/dev/null 2>&1 & nohup java -Xms2048m -Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/javaApp/heapdump.hprof -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=15115 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -jar ../lib/$jarName --spring.profiles.active=docker >/dev/null 2>&1 &
\ No newline at end of file
...@@ -14,18 +14,24 @@ import java.util.Collections; ...@@ -14,18 +14,24 @@ import java.util.Collections;
public class MybatisPlusGenerator { public class MybatisPlusGenerator {
private static final String PROJECT_PATH = System.getProperty("user.dir"); private static final String PROJECT_PATH = System.getProperty("user.dir");
private static final String OUTPUT_DIR = "signal-control-service/src/main/java"; private static final String OUTPUT_DIR = "signal-optimize-service/src/main/java";
private static final String AUTHOR = "wj"; private static final String AUTHOR = "guoliang.dong";
private static final String URL = "jdbc:mysql://106.120.201.126:14726/t_signal_control?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&sessionVariables=sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'&useSSL=false&useCursorFetch=true"; private static final String URL = "jdbc:mysql://106.120.201.126:14726/wjdit_ecosystem_db_v1.0.0?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&sessionVariables=sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'&useSSL=false&useCursorFetch=true";
private static final String DRIVER_NAME = "com.mysql.cj.jdbc.Driver"; private static final String DRIVER_NAME = "com.mysql.cj.jdbc.Driver";
private static final String USERNAME = "root"; private static final String USERNAME = "root";
private static final String PASSWORD = "Wanji300552"; private static final String PASSWORD = "Wanji300552";
private static final String[] TABLES = { private static final String[] TABLES = {
"t_base_area_info" "t_device_induces"
}; };
/**
* t_greenwave_induces
* t_greenwave_induces_hist
* t_induce_hist
* t_induce_template
*/
private static final String TEMPLATE_PATH = "/templates/mapper.xml.ftl"; private static final String TEMPLATE_PATH = "/templates/mapper.xml.ftl";
private static final String MAPPER_PATH = "signal-control-service/src/main/resources/mapper/"; private static final String MAPPER_PATH = "signal-optimize-service/src/main/resources/mapper/";
private static final String PARENT = "net.wanji.web"; private static final String PARENT = "net.wanji.opt";
public static void main(String[] args) { public static void main(String[] args) {
......
...@@ -90,6 +90,7 @@ public class GreenwaveInducesController { ...@@ -90,6 +90,7 @@ public class GreenwaveInducesController {
induceDTO.setRidDir(deviceInduces.get(0).getRidDir()); induceDTO.setRidDir(deviceInduces.get(0).getRidDir());
induceDTO.setResolutionWidth(deviceInduces.get(0).getResolutionWidth()); induceDTO.setResolutionWidth(deviceInduces.get(0).getResolutionWidth());
induceDTO.setResolutionHeight(deviceInduces.get(0).getResolutionHeight()); induceDTO.setResolutionHeight(deviceInduces.get(0).getResolutionHeight());
induceDTO.setWkt(deviceInduces.get(0).getWkt());
} }
//获取上屏状态 //获取上屏状态
induceDTO.setStatus(o.getStatus()); induceDTO.setStatus(o.getStatus());
......
package net.wanji.opt.controller.induce; package net.wanji.opt.controller.induce;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import freemarker.template.TemplateException; import freemarker.template.TemplateException;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.wanji.common.framework.Constants;
import net.wanji.common.framework.rest.JsonViewObject; import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.common.utils.tool.DateUtil;
import net.wanji.opt.entity.GreenwaveInduces;
import net.wanji.opt.entity.InduceHist;
import net.wanji.opt.entity.InduceTemplate; import net.wanji.opt.entity.InduceTemplate;
import net.wanji.opt.dto.induce.MessageParam; import net.wanji.opt.dto.induce.MessageParam;
import net.wanji.opt.service.induce.GreenwaveInducesService;
import net.wanji.opt.service.induce.InduceHistService;
import net.wanji.opt.service.induce.InduceSendService; import net.wanji.opt.service.induce.InduceSendService;
import net.wanji.opt.service.induce.InduceTemplateService; import net.wanji.opt.service.induce.InduceTemplateService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -15,8 +23,11 @@ import org.springframework.http.HttpStatus; ...@@ -15,8 +23,11 @@ import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.ws.rs.core.MediaType;
import java.io.IOException; import java.io.IOException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.Date;
import java.util.List;
@Api(value = "InduceSendController", description = "诱导屏-下发消息接口(对接易华录)") @Api(value = "InduceSendController", description = "诱导屏-下发消息接口(对接易华录)")
@RestController @RestController
...@@ -27,10 +38,16 @@ public class InduceSendController { ...@@ -27,10 +38,16 @@ public class InduceSendController {
@Autowired @Autowired
private InduceSendService induceSendService; private InduceSendService induceSendService;
@Autowired
private InduceHistService induceHistService;
@Autowired @Autowired
private InduceTemplateService induceTemplateService; private InduceTemplateService induceTemplateService;
@Autowired
private GreenwaveInducesService greenwaveInducesService;
@ApiOperation(value = "发送诱导信息", notes = "发送诱导信息", response = JsonViewObject.class, produces = MediaType.APPLICATION_JSON)
@PostMapping("/send") @PostMapping("/send")
public JsonViewObject send(@RequestBody MessageParam param) { public JsonViewObject send(@RequestBody MessageParam param) {
JsonViewObject jsonView = JsonViewObject.newInstance(); JsonViewObject jsonView = JsonViewObject.newInstance();
...@@ -39,30 +56,98 @@ public class InduceSendController { ...@@ -39,30 +56,98 @@ public class InduceSendController {
return jsonView.success(); return jsonView.success();
} catch (Exception e) { } catch (Exception e) {
log.info(e.getMessage()); log.info(e.getMessage());
return jsonView.fail("发送失败"); return jsonView.fail("发送诱导信息失败");
} }
} }
@ApiOperation(value = "按绿波带编号批量发送诱导信息", notes = "按绿波带编号批量发送诱导信息", response = JsonViewObject.class, produces = MediaType.APPLICATION_JSON)
@PostMapping("/batchSend")
public JsonViewObject batchSend(@RequestBody MessageParam param) {
JsonViewObject jsonView = JsonViewObject.newInstance();
try {
//查询绿波带信息,关联绿波路口,根据绿波路口查询关联诱导屏下发
LambdaQueryWrapper<GreenwaveInduces> greenwaveInducesQueryWrapper = new LambdaQueryWrapper<>();
greenwaveInducesQueryWrapper.eq(GreenwaveInduces::getGreenId, param.getGreenId());
List<GreenwaveInduces> greenwaveInducesList=greenwaveInducesService.list(greenwaveInducesQueryWrapper);
for(GreenwaveInduces greenwaveInduces:greenwaveInducesList)
{
LambdaQueryWrapper<InduceTemplate> induceTemplateQueryWrapper = new LambdaQueryWrapper<>();
induceTemplateQueryWrapper.eq(InduceTemplate::getEquipCode, greenwaveInduces.getEquipCode());
List<InduceTemplate> induceTemplateList=induceTemplateService.list(induceTemplateQueryWrapper);
for(InduceTemplate induceTemplate:induceTemplateList) {
param.setTemplateId(induceTemplate.getId());
param.setInduceId(greenwaveInduces.getId());
param.setEquipCode(greenwaveInduces.getEquipCode());
param.setPlayorder(induceTemplateList.size());
param.setDuration(greenwaveInduces.getDuration());
param.setStartTime(DateUtil.format(new Date(), Constants.DATE_FORMAT.E_DATE_FORMAT_SECOND));
param.setEndTime(DateUtil.format(System.currentTimeMillis() + 1000 * 30, Constants.DATE_FORMAT.E_DATE_FORMAT_SECOND));
induceSendService.send(param);
}
}
return jsonView.success();
} catch (Exception e) {
log.info(e.getMessage());
return jsonView.fail("批量发布诱导信息失败");
}
}
/**
* 获取诱导发布图片
*/
@ApiOperation(value = "根据设备编号获取诱导发布图片", notes = "根据设备编号获取诱导发布图片")
@GetMapping(value = "/fileCode")
public ResponseEntity<byte[]> ftpFileByCode(@RequestParam("equipCode") String equipCode) {
// 根据 equipCode 获取文件名
LambdaQueryWrapper<InduceHist> InduceHistQueryWrapper = new LambdaQueryWrapper<>();
InduceHistQueryWrapper.eq(InduceHist::getEquipCode, equipCode);
InduceHistQueryWrapper.orderByDesc(InduceHist::getCreateTime);
InduceHist pictureFile = this.induceHistService.getOne(InduceHistQueryWrapper,false);
if (pictureFile == null) {
return ResponseEntity.status(HttpStatus.OK)
.body("无效的文件ID".getBytes(StandardCharsets.UTF_8));
}
try {
// 获取ftp服务器图片
byte[] imageBytes = this.induceSendService.downloadImage(pictureFile.getFilePath());
if (imageBytes != null && imageBytes.length > 0) {
// 设置响应头
HttpHeaders headers = new HttpHeaders();
headers.set("Content-Type", "image/jpeg"); // 图片类型
headers.set("Content-Length", String.valueOf(imageBytes.length)); // 设置内容长度
headers.set("Content-Disposition", "inline; filename=\"" + pictureFile.getSourceId() + ".bmp\""); // 设置文件名
// 返回响应
return new ResponseEntity<>(imageBytes, headers, HttpStatus.OK);
} else {
return ResponseEntity.status(HttpStatus.OK)
.body("未查询到对应文件".getBytes(StandardCharsets.UTF_8));
}
} catch (IOException e) {
log.error("ftp文件下载失败: ", e.getMessage());
return ResponseEntity.status(HttpStatus.OK)
.body("程序查询错误请联系管理员".getBytes(StandardCharsets.UTF_8));
}
}
/** /**
* 获取ftp图片 * 获取ftp图片
*/ */
@GetMapping(value = "/file") @GetMapping(value = "/file")
public ResponseEntity<byte[]> ftpFile(@RequestParam("fileId") Long fileId) { public ResponseEntity<byte[]> ftpFile(@RequestParam("fileId") Long fileId) {
// 根据 fileId 获取文件名 // 根据 fileId 获取文件名
InduceTemplate pictureFile = this.induceTemplateService.getById(fileId); InduceHist pictureFile = this.induceHistService.getById(fileId);
if (pictureFile == null) { if (pictureFile == null) {
return ResponseEntity.status(HttpStatus.OK) return ResponseEntity.status(HttpStatus.OK)
.body("无效的文件ID".getBytes(StandardCharsets.UTF_8)); .body("无效的文件ID".getBytes(StandardCharsets.UTF_8));
} }
try { try {
// 获取ftp服务器图片 // 获取ftp服务器图片
byte[] imageBytes = this.induceSendService.downloadImage(pictureFile.getFileName()); byte[] imageBytes = this.induceSendService.downloadImage(pictureFile.getFilePath());
if (imageBytes != null && imageBytes.length > 0) { if (imageBytes != null && imageBytes.length > 0) {
// 设置响应头 // 设置响应头
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
headers.set("Content-Type", "image/jpeg"); // 图片类型 headers.set("Content-Type", "image/jpeg"); // 图片类型
headers.set("Content-Length", String.valueOf(imageBytes.length)); // 设置内容长度 headers.set("Content-Length", String.valueOf(imageBytes.length)); // 设置内容长度
headers.set("Content-Disposition", "inline; filename=\"" + pictureFile.getFileName() + "\""); // 设置文件名 headers.set("Content-Disposition", "inline; filename=\"" + pictureFile.getSourceId() + ".bmp\""); // 设置文件名
// 返回响应 // 返回响应
return new ResponseEntity<>(imageBytes, headers, HttpStatus.OK); return new ResponseEntity<>(imageBytes, headers, HttpStatus.OK);
} else { } else {
......
...@@ -3,10 +3,15 @@ package net.wanji.opt.dao.mapper; ...@@ -3,10 +3,15 @@ package net.wanji.opt.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import net.wanji.opt.po.StrategyGreenOptHistEntity; import net.wanji.opt.po.StrategyGreenOptHistEntity;
import java.util.List;
/** /**
* @author duanruiming * @author duanruiming
* @date 2024/11/19 18:02 * @date 2024/11/19 18:02
* @description 神思推送绿波时序图信息 * @description 神思推送绿波时序图信息
*/ */
public interface StrategyGreenOptHistMapper extends BaseMapper<StrategyGreenOptHistEntity> { public interface StrategyGreenOptHistMapper extends BaseMapper<StrategyGreenOptHistEntity> {
List<StrategyGreenOptHistEntity> selectByGreenId(String greenId);
} }
package net.wanji.opt.dao.mapper.trend; package net.wanji.opt.dao.mapper.trend;
//import com.baomidou.dynamic.datasource.annotation.DS;
import net.wanji.opt.po.trend.EventAlarmPO; import net.wanji.opt.po.trend.EventAlarmPO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; //import org.springframework.stereotype.Repository;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@Repository //@Repository
//@DS("webService")
public interface EventAlarmMapper { public interface EventAlarmMapper {
List<EventAlarmPO> selectByTodayTime(@Param("todayTime") Date todayTime); List<EventAlarmPO> selectByTodayTime(@Param("todayTime") Date todayTime);
} }
\ No newline at end of file
...@@ -33,6 +33,8 @@ public class InduceDTO { ...@@ -33,6 +33,8 @@ public class InduceDTO {
@ApiModelProperty(name = "屏幕分辨率高度") @ApiModelProperty(name = "屏幕分辨率高度")
private BigDecimal resolutionHeight; private BigDecimal resolutionHeight;
@ApiModelProperty(name = "设备坐标")
private String wkt;
@ApiModelProperty(name = "关联绿波信息") @ApiModelProperty(name = "关联绿波信息")
private List<GreenwaveDTO> greenwaveList; private List<GreenwaveDTO> greenwaveList;
......
...@@ -39,7 +39,7 @@ public class MessageParam { ...@@ -39,7 +39,7 @@ public class MessageParam {
// private MultipartFile file; // private MultipartFile file;
@ApiModelProperty(value = "开始时间,格式 2024-11-07 00:00:00") @ApiModelProperty(value = "开始时间,格式 2024-11-07 00:00:00")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private String starTtime=""; private String startTime="";
@ApiModelProperty(value = "结束时间,格式 2024-11-07 00:00:00") @ApiModelProperty(value = "结束时间,格式 2024-11-07 00:00:00")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
......
...@@ -76,6 +76,18 @@ public class GreenwaveInduces implements Serializable { ...@@ -76,6 +76,18 @@ public class GreenwaveInduces implements Serializable {
@TableField("status") @TableField("status")
private Integer status; private Integer status;
/**
* 节目顺序号 顺着往下排
*/
@TableField("playorder")
private Integer playorder;
/**
* 为每一屏的停留时间
*/
@TableField("duration")
private Integer duration;
/** /**
* 创建时间 * 创建时间
*/ */
......
...@@ -105,17 +105,7 @@ public class GreenwaveInducesHist implements Serializable { ...@@ -105,17 +105,7 @@ public class GreenwaveInducesHist implements Serializable {
@TableField("control_opt_times") @TableField("control_opt_times")
private String controlOptTimes; private String controlOptTimes;
/**
* 节目顺序号 顺着往下排
*/
@TableField("playorder")
private Integer playorder;
/**
* 为每一屏的停留时间
*/
@TableField("duration")
private Integer duration;
} }
package net.wanji.opt.po.trend; package net.wanji.opt.po.trend;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Id;
import java.util.Date; import java.util.Date;
@Data @Data
@EqualsAndHashCode(callSuper = false)
@TableName("t_event_data")
@ApiModel(value = "EventAlarmPO", description = "交通事件表")
public class EventAlarmPO { public class EventAlarmPO {
/** 主键 */ /** 主键 */
@Id @Id
......
package net.wanji.opt.service.induce.impl; package net.wanji.opt.service.induce.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import freemarker.template.Configuration; import freemarker.template.Configuration;
import freemarker.template.Template; import freemarker.template.Template;
import freemarker.template.TemplateException; import freemarker.template.TemplateException;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.wanji.opt.entity.DeviceInduces;
import net.wanji.opt.entity.GreenwaveInduces; import net.wanji.opt.entity.GreenwaveInduces;
import net.wanji.opt.entity.InduceHist; import net.wanji.opt.entity.InduceHist;
import net.wanji.opt.entity.InduceTemplate; import net.wanji.opt.entity.InduceTemplate;
import net.wanji.opt.dto.induce.MessageParam; import net.wanji.opt.dto.induce.MessageParam;
import net.wanji.opt.service.DeviceInducesService;
import net.wanji.opt.service.induce.*; import net.wanji.opt.service.induce.*;
import org.apache.commons.net.ftp.FTP; import org.apache.commons.net.ftp.FTP;
import org.apache.commons.net.ftp.FTPClient; import org.apache.commons.net.ftp.FTPClient;
...@@ -44,6 +47,9 @@ public class InduceSendServiceImpl implements InduceSendService { ...@@ -44,6 +47,9 @@ public class InduceSendServiceImpl implements InduceSendService {
@Autowired @Autowired
private GreenwaveInducesService greenwaveInducesService; private GreenwaveInducesService greenwaveInducesService;
@Autowired
private DeviceInducesService deviceInducesService;
@Autowired @Autowired
private Configuration freemarkerConfig; private Configuration freemarkerConfig;
...@@ -78,16 +84,22 @@ public class InduceSendServiceImpl implements InduceSendService { ...@@ -78,16 +84,22 @@ public class InduceSendServiceImpl implements InduceSendService {
GreenwaveInduces greenwaveinduces=greenwaveInducesService.getById(param.getInduceId()); GreenwaveInduces greenwaveinduces=greenwaveInducesService.getById(param.getInduceId());
// 读取图片模板参数 // 读取图片模板参数
InduceTemplate induceTemplate = induceTemplateService.getById(param.getTemplateId()); InduceTemplate induceTemplate = induceTemplateService.getById(param.getTemplateId());
if(param.getFlg()==1) {
LambdaQueryWrapper<DeviceInduces> deviceQueryWrapper = new LambdaQueryWrapper<>();
deviceQueryWrapper.eq(DeviceInduces::getEquipCode, induceTemplate.getEquipCode());
DeviceInduces deviceInduces = deviceInducesService.getOne(deviceQueryWrapper);
param.setResolutionWidth(deviceInduces.getResolutionWidth().intValue());
param.setResolutionHeight(deviceInduces.getResolutionHeight().intValue());
}
// 获取图片字节数组 // 获取图片字节数组
byte[] imageBytes = induceTemplate.getFileContent(); byte[] imageBytes = induceTemplate.getFileContent();
if (imageBytes != null || imageBytes.length > 0) { if (imageBytes != null || imageBytes.length > 0) {
// 将字节数组转换为字节对象 // 将字节数组转换为字节对象
BufferedImage image = ImageIO.read(new ByteArrayInputStream(imageBytes)); BufferedImage image = ImageIO.read(new ByteArrayInputStream(imageBytes));
// 修改图像中文字 // 修改图像中文字
addTextToImage(image, param.getContents(), induceTemplate.getTextX(), induceTemplate.getTextY(), induceTemplate.getTextSize(), induceTemplate.getTextSign()); addTextToImage(image, param.getContents(), induceTemplate.getTextX(), induceTemplate.getTextY(), induceTemplate.getTextSize(), induceTemplate.getTextSign());
// 测试阶段保存图片到本地 // 测试阶段保存图片到本地
//ImageIO.write(image, "bmp", new File("/Users/shen/Desktop/" + pictureFile.getFileName())); //ImageIO.write(image, "bmp", new File("D:\\tmp\\" + induceTemplate.getFileName()));
// 上传文件至ftp // 上传文件至ftp
if (param.getFlg() == 1) { if (param.getFlg() == 1) {
String dirName=LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")); String dirName=LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd"));
...@@ -95,6 +107,7 @@ public class InduceSendServiceImpl implements InduceSendService { ...@@ -95,6 +107,7 @@ public class InduceSendServiceImpl implements InduceSendService {
String filePath = uploadFile(image,dirName, fileName); String filePath = uploadFile(image,dirName, fileName);
param.setFtpPath(filePath); param.setFtpPath(filePath);
induceHist.setFilePath(PATH + dirName+"/"+fileName); induceHist.setFilePath(PATH + dirName+"/"+fileName);
greenwaveinduces.setSourceId(PATH + dirName+"/"+fileName);
} }
log.info("上传文件至ftp-filePath:{}", param.getFtpPath()); log.info("上传文件至ftp-filePath:{}", param.getFtpPath());
// //如果已发布,则调用下屏服务 // //如果已发布,则调用下屏服务
...@@ -121,25 +134,23 @@ public class InduceSendServiceImpl implements InduceSendService { ...@@ -121,25 +134,23 @@ public class InduceSendServiceImpl implements InduceSendService {
// 可以去掉反斜杠 // 可以去掉反斜杠
// message = message.replace("\\", ""); // message = message.replace("\\", "");
// 创建MessageProperties并设置内容类型 // 创建MessageProperties并设置内容类型
MessageProperties messageProperties = new MessageProperties(); // MessageProperties messageProperties = new MessageProperties();
messageProperties.setContentType("text/plain"); // 设置内容类型为text/plain // messageProperties.setContentType("text/plain"); // 设置内容类型为text/plain
// 创建Message并设置内容 // 创建Message并设置内容
Message messageSend = new Message(message.getBytes(), messageProperties); // Message messageSend = new Message(message.getBytes(), messageProperties);
rabbitTemplate.convertAndSend("",queueName, messageSend); //rabbitTemplate.convertAndSend("",queueName, message);
log.info("mqtt发送信息-topic:{},queueName:{},message:{}", queueName, messageSend); log.info("mqtt发送信息-topic:{},queueName:{},message:{}", queueName, message);
//1、增加下发记录log 2、计数 3、标记已发布状体 //1、增加下发记录log 2、计数 3、标记已发布状体
induceHist.setEquipCode(induceTemplate.getEquipCode()); induceHist.setEquipCode(induceTemplate.getEquipCode());
induceHist.setGreenId(param.getGreenId()); induceHist.setGreenId(param.getGreenId());
induceHistService.save(induceHist); induceHistService.save(induceHist);
//保存旅游诱导状态信息 //保存诱导状态信息
greenwaveinduces.setInducesCount(Objects.isNull(greenwaveinduces.getInducesCount()) ? 0 : greenwaveinduces.getInducesCount()+1); greenwaveinduces.setInducesCount(Objects.isNull(greenwaveinduces.getInducesCount()) ? 0 : greenwaveinduces.getInducesCount()+1);
greenwaveinduces.setStatus(1); greenwaveinduces.setStatus(1);
greenwaveinduces.setSourceId(messageId);
greenwaveInducesService.saveOrUpdate(greenwaveinduces); greenwaveInducesService.saveOrUpdate(greenwaveinduces);
} }
} }
@Override @Override
public String uploadFile(BufferedImage image,String directoryName, String fileName) { public String uploadFile(BufferedImage image,String directoryName, String fileName) {
ByteArrayInputStream inputStream = null; ByteArrayInputStream inputStream = null;
......
#!/bin/bash
jarName="signal-control-service-0.2.1.jar"
NR=$(ps -ef | grep "${jarName}" | grep -v grep | wc -l)
if [ ${NR} != 0 ]
then
ps -ef | grep -v grep | grep "${jarName}" |
while read u p o
do
echo "结束Java程序进程..."
kill -9 $p
done
fi
sleep 2
echo "重启Java程序进程..."
nohup java -Xms2048m -Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/javaApp/heapdump.hprof -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=15115 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -jar ../lib/$jarName --spring.profiles.active=docker >/dev/null 2>&1 &
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<systemtype>VMS</systemtype> <systemtype>VMS</systemtype>
<messagetype>CONTROL</messagetype> <messagetype>CONTROL</messagetype>
<!--token--> <!--token-->
<sourceIP>${sourceid}</sourceIP> <sourceIP>${sourceId}</sourceIP>
<targetIP></targetIP> <targetIP></targetIP>
<user></user> <user></user>
<password></password> <password></password>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<tasktype>deletelistandfile</tasktype> <tasktype>deletelistandfile</tasktype>
<taskdetail> <taskdetail>
<!--屏体ID 由现场提供--> <!--屏体ID 由现场提供-->
<ledid>${vmsid}</ledid> <ledid>${equipCode}</ledid>
</taskdetail> </taskdetail>
<!--节目类型 TFM 路况 TFMH 独占 TAM 交通事件--> <!--节目类型 TFM 路况 TFMH 独占 TAM 交通事件-->
<senderinfo>${type}</senderinfo> <senderinfo>${type}</senderinfo>
......
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