Commit 53522437 authored by 夏东伟's avatar 夏东伟

网关采集

parent a6f07db4
......@@ -65,7 +65,7 @@ public class AssemblyNewEnergyJob extends QuartzJobBean {
for (String ipAddress : ipAddressList){
if (!PingIpUtils.ping(ipAddress, pingTimes, timeOut)) {
log.error("ping: {}失败, 此次同步总装新能源检测点数据操作结束!", ipAddress);
return;
continue;
}
//todo:账户, 密码需要变
String url = "smb://wanteng:wanteng@" + ipAddress + "/AN9637H/testdata@" + dateString + ".mdb";
......
......@@ -67,7 +67,7 @@ public class WheelAlignmentJob extends QuartzJobBean {
for (String ipAddress : ipAddressList){
if (!PingIpUtils.ping(ipAddress, pingTimes, timeOut)) {
log.error("ping: {}失败, 此次同步底盘四轮定位数据操作结束!", ipAddress);
return;
continue;
}
//todo:账户, 密码, 文件位置需要变 BL_Align(数据库文件)
String url;
......
package net.vtstar.zhongtong.avi.gateway.painting.domain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import net.vtstar.scada.base.gather.domain.EquipmentData;
import javax.persistence.Column;
import javax.persistence.Table;
import java.util.Date;
@Data
@ApiModel("涂装-喷涂室风机状态及报警信息")
@Table(name = "eqp_data_spray_booth_state")
public class SprayBoothStateMachine extends EquipmentData {
@Column(name = "eqp_code")
@ApiModelProperty(notes = "设备编号")
private String equipCode;
@Column(name = "pfj_error")
@ApiModelProperty(notes = "排风机故障信号")
private Integer pfjError;
@Column(name = "state")
@ApiModelProperty(notes = "排风机运行信号")
private Integer state;
@Column(name = "sfj_error")
@ApiModelProperty(notes = "送风机故障信号")
private Integer sfjError;
@Column(name = "sfcw_error")
@ApiModelProperty(notes = "送风超温信号")
private Integer sfcwError;
@Column(name = "xhsj_error")
@ApiModelProperty(notes = "循环水泵故障信号")
private Integer xhsjError;
@Column(name = "xhsgyw_error")
@ApiModelProperty(notes = "循环水高液位信号")
private Integer xhsgywError;
@Column(name = "rsj_error")
@ApiModelProperty(notes = "燃烧机故障信号")
private Integer rsjError;
@Column(name = "qtxl_error")
@ApiModelProperty(notes = "气体泄露报警信号")
private Integer qtxlError;
@Column(name = "js_error")
@ApiModelProperty(notes = "加湿故障信号")
private Integer jsError;
@Column(name = "sfcs_error")
@ApiModelProperty(notes = "送风超湿信号")
private Integer sfcsError;
@Column(name = "jt_error")
@ApiModelProperty(notes = "急停钮")
private Integer jtError;
@ApiModelProperty("时间")
@Column(name = "create_time")
private Date createTime;
private Integer status;
}
package net.vtstar.zhongtong.avi.gateway.painting.job;
import lombok.extern.slf4j.Slf4j;
import net.vtstar.scada.base.equipmgt.domain.Enum.EquipStatusEnum;
import net.vtstar.scada.base.gather.domain.EquipmentData;
import net.vtstar.scada.base.gather.job.GatherJob;
import net.vtstar.zhongtong.avi.gateway.painting.domain.SprayBoothStateMachine;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.stereotype.Component;
import java.util.Date;
/**
* 喷涂室状态数据采集JOB
*/
@Slf4j
@Component
public class SprayBoothStateMachineJob extends GatherJob {
private static final String NAME = "SPRAY_BOOTH";
@Override
protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
log.info("JobName: {}", context.getJobDetail().getKey().getName());
super.gatherByModbus(NAME, SprayBoothStateMachine.class);
}
@Override
public boolean handleObject(EquipmentData equipmentData) {
SprayBoothStateMachine data = (SprayBoothStateMachine) equipmentData;
Integer state = data.getStatus();
if (state != null && state == 0) {
return false;
}
Integer runState = data.getState();
if (null == runState){
return false;
}
if (runState == 1){
equipmentData.setEquipStatus(EquipStatusEnum.RUN);
}else {
equipmentData.setEquipStatus(EquipStatusEnum.SHUTDOWN);
}
return true;
}
@Override
public Object handleValue(String fieldName, Object value) {
return value;
}
@Override
protected void postHandle(EquipmentData equipmentData) {
((SprayBoothStateMachine)equipmentData).setCreateTime(new Date());
if (1 == ((SprayBoothStateMachine) equipmentData).getPfjError()){
//todo:创建报警记录,排风机故障信号
}
if (1 == ((SprayBoothStateMachine) equipmentData).getQtxlError()){
//todo:创建报警记录,气体泄露报警信号
}
if (1 == ((SprayBoothStateMachine) equipmentData).getRsjError()){
//todo:创建报警记录,燃烧机故障信号
}
if (1 == ((SprayBoothStateMachine) equipmentData).getSfcwError()){
//todo:创建报警记录,送风超温信号
}
if (1 == ((SprayBoothStateMachine) equipmentData).getSfjError()){
//todo:创建报警记录,送风机故障信号
}
if (1 == ((SprayBoothStateMachine) equipmentData).getXhsgywError()){
//todo:创建报警记录,循环水高液位信号
}
if (1 == ((SprayBoothStateMachine) equipmentData).getXhsjError()){
//todo:创建报警记录,循环水泵故障信号
}
if (1 == ((SprayBoothStateMachine) equipmentData).getSfcsError()){
//todo:创建报警记录,送风超湿信号
}
if (1 == ((SprayBoothStateMachine) equipmentData).getJsError()){
//todo:创建报警记录,加湿故障信号
}
if (1 == ((SprayBoothStateMachine) equipmentData).getJtError()){
//todo:创建报警记录,急停钮
}
}
}
......@@ -53,7 +53,7 @@ public class WeldingRobotMachineJob extends QuartzJobBean {
for (String ipAddress : ipAddressList) {
if (!PingIpUtils.ping(ipAddress, pingTimes, timeOut)) {
log.error("ping: {}失败, 读取焊接机器人数据操作结束!", ipAddress);
return;
continue;
}
//1.获得当天日期,2.通过日期去查询当天的开机时间和焊接时间
Calendar calendar = Calendar.getInstance();
......@@ -63,6 +63,10 @@ public class WeldingRobotMachineJob extends QuartzJobBean {
Object second = service.getSingleValue(poolKey, 1, date * 4 - 4, "Integer");
Object minute = service.getSingleValue(poolKey, 1, date * 4 - 3, "Integer");
Object hour = service.getSingleValue(poolKey, 1, date * 4 - 2, "Integer");
if (null == second || null == minute || null == hour){
log.error("读取焊接机器人数据失败! 时, 分, 秒中有空值!");
continue;
}
String turnOnTime = Integer.valueOf(hour.toString()) + "小时" + Integer.valueOf(minute.toString()) + "分" +
Integer.valueOf(second.toString()) + "秒";
Object secondWelding = service.getSingleValue(poolKey, 1, date * 4 - 4 + 300, "Integer");
......
......@@ -30,8 +30,8 @@ quartz.job.taskInfos[1].jobName=net.vtstar.zhongtong.avi.equipment.job.CleanStat
quartz.job.taskInfos[1].jobGroup=CleanStatusDataJob
quartz.job.taskInfos[1].jobDescription=\u6E05\u6D17\u8BBE\u5907\u72B6\u6001Job
#quartz.job.taskInfos[1].cronExpression=0 0 0 * * ?
quartz.job.taskInfos[1].cronExpression=0/15 * * * * ?
quartz.job.taskInfos[1].start=false
quartz.job.taskInfos[1].cronExpression=0/10 * * * * ?
quartz.job.taskInfos[1].start=true
quartz.job.taskInfos[2].jobName=net.vtstar.zhongtong.avi.equipment.job.StatisticsTimeJob
quartz.job.taskInfos[2].jobGroup=StatisticsTimeJob
......@@ -65,7 +65,7 @@ quartz.job.taskInfos[10].start=false
quartz.job.taskInfos[21].jobName=net.vtstar.zhongtong.avi.gateway.parts.job.WeldingRobotMachineJob
quartz.job.taskInfos[21].jobGroup=WeldingRobotMachineJob
quartz.job.taskInfos[21].jobDescription=\u710a\u63a5\u673a\u5668\u4ebaJob
quartz.job.taskInfos[21].cronExpression=0 0/15 * * * ?
quartz.job.taskInfos[21].cronExpression=0/5 * * * * ?
quartz.job.taskInfos[21].start=false
#焊装车间(WELDING)
......@@ -98,6 +98,13 @@ quartz.job.taskInfos[14].jobDescription=\u55b7\u6d82\u673a\u5668\u4ebaJob
quartz.job.taskInfos[14].cronExpression=0 0/15 * * * ?
quartz.job.taskInfos[14].start=false
#喷涂喷涂室
quartz.job.taskInfos[23].jobName=net.vtstar.zhongtong.avi.gateway.painting.job.SprayBoothStateMachineJob
quartz.job.taskInfos[23].jobGroup=SprayBoothStateMachineJob
quartz.job.taskInfos[23].jobDescription=\u6d82\u88c5\u55b7\u6d82\u5ba4Job
quartz.job.taskInfos[23].cronExpression=0/5 * * * * ?
quartz.job.taskInfos[23].start=false
#底盘车间(CHASSIS)
#底盘智能扭力扳手
quartz.job.taskInfos[15].jobName=net.vtstar.zhongtong.avi.gateway.chassis.job.ChassisTorqueMachineJob
......
......@@ -30,4 +30,4 @@ zt.ip.testspeedresult=10.1.25.134
zt.ip.assemblytorquewrench=10.100.172.150
zt.ip.pingtimes=2
zt.ip.timeout=1000
\ No newline at end of file
zt.ip.timeout=500
\ No newline at end of file
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