提交 53522437 编辑于 作者: 夏东伟's avatar 夏东伟
浏览文件

网关采集

上级 a6f07db4
加载中
加载中
加载中
加载中
+1 −1
原始行号 差异行号 差异行
@@ -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";
+1 −1
原始行号 差异行号 差异行
@@ -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;
+71 −0
原始行号 差异行号 差异行
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;

}
+89 −0
原始行号 差异行号 差异行
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:创建报警记录,急停钮
        }

    }
}
+5 −1
原始行号 差异行号 差异行
@@ -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");
加载中