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

AVI调试

parent beba65cf
......@@ -27,7 +27,7 @@ import java.util.Date;
@Data
@Search(code = "PAINTSHOP_STATION")
@Table(name = "paintshop_station")
public class PaintshopStation implements Serializable {
public class PaintshopStation {
@Id
private Long id;
......
......@@ -54,4 +54,7 @@ public class RuntimeRecord {
@ApiModelProperty(notes = "创建时间")
@Column(name = "create_time")
private Date createTime;
@Column(name = "group_code")
private String groupCode;
}
......@@ -81,6 +81,9 @@ public class StatisticsTimeJob extends QuartzJobBean {
runtimeRecord.setTotalRuntime(total.add(hours));
runtimeRecord.setMachineId(info.getId());
runtimeRecord.setWorkshopCode(info.getWorkshopCode());
if("POLISHING_ROOM".equals(info.getEquipType())){
runtimeRecord.setGroupCode("1");
}
runtimeRecordMapper.insert(runtimeRecord);
}
}
......
......@@ -66,13 +66,21 @@ public class EquipmentService {
public List<Map<String, Object>> findRealTimeData(JSONObject pageFilter) {
PageHelper.startPage(pageFilter.getIntValue("pageNum"), pageFilter.getIntValue("pageSize"));
Class searchCode = classNameCache.get(pageFilter.getString("searchCode"), Class.class);
String searchCode = pageFilter.getString("searchCode");
Class searchCodeClazz = classNameCache.get(searchCode, Class.class);
if(searchCode == null){
return new ArrayList<>();
}
if ("POLISHING_ROOM".equals(searchCode)){
return dataMapper.findJoin(searchService.pageFilter2Filter(pageFilter, new WhereFilter(){{
addFilter("status", Operation.IS, "null");
addFilter("group_code", Operation.EQUAL, "1");
}}), searchCodeClazz);
}
return dataMapper.findJoin(searchService.pageFilter2Filter(pageFilter, new WhereFilter(){{
addFilter("status", Operation.EQUAL_GREATER_THAN, 1);
}}), searchCode);
}}), searchCodeClazz);
}
public void orderExport(JSONObject pageFilter, HttpServletResponse response) throws IOException {
......
......@@ -58,6 +58,7 @@ public class RunRecordService {
PageHelper.startPage(pageFilter.getIntValue("pageNum"), pageFilter.getIntValue("pageSize"));
List<RuntimeRecord> list = runtimeRecordMapper.findList(searchService.pageFilter2Filter(pageFilter, new WhereFilter() {{
addJoin(RuntimeRecord.class, "machine_id", EquipInfo.class, "id");
addFilter(RuntimeRecord.class,"group_code", Operation.IS, "null");
}}), RuntimeRecord.class);
list.stream().forEach(runtimeRecord -> {
switch (runtimeRecord.getWorkshopCode()){
......@@ -173,6 +174,9 @@ public class RunRecordService {
if (null == warningMap.get(faultString)){
faultRecord.setEndTime(new Date());
faultRecordMapper.update(faultRecord);
}else{
faultRecord.setBeginTime(new Date());
faultRecordMapper.update(faultRecord);
}
}
}
......
......@@ -20,6 +20,7 @@ import java.util.Date;
@Table(name = "eqp_data_rectification_out")
public class ElectrophoresisMachine extends EquipmentData {
@Show(label = "设备编号")
@Column(name = "eqp_code")
@ApiModelProperty(notes = "设备编号")
private String equipCode;
......
package net.vtstar.zhongtong.avi.equipment.domain;
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 net.vtstar.user.search.JoinColumn;
import net.vtstar.user.search.Search;
import net.vtstar.zhongtong.avi.equipment.domain.EquipInfo;
import net.vtstar.zhongtong.avi.global.web.Show;
import net.vtstar.zhongtong.avi.global.web.domain.enums.FieldType;
import javax.persistence.Column;
import javax.persistence.Id;
......@@ -12,46 +16,39 @@ import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Author: xiadongwei
* @Date: 2019/9/20 17:29
*/
@ApiModel("设备报警")
@Data
@Search(code = "MACHINE_RUNTIME_RECORD")
@Table(name = "equip_warning_record")
public class EquipmentWarningRecord {
@Search(code = "POLISHING_ROOM")
@ApiModel("涂装-打磨室风机运行时间")
@Table(name = "machine_runtime_record")
public class PolishingRoomMachine{
@Id
private Long id;
@ApiModelProperty(notes = "车间")
@Column(name = "workshop_code")
@Search
private String workshopCode;
@ApiModelProperty(notes = "设备ID")
@Column(name = "machine_id")
private Long machineId;
@Show(label = "设备编号")
@ApiModelProperty(notes = "设备编号")
@JoinColumn(tableName = EquipInfo.class, name = "equip_code")
private String equipCode;
@Show(label = "设备编号")
@ApiModelProperty(notes = "设备名称")
@JoinColumn(tableName = EquipInfo.class, name = "alias")
@Search
private String alias;
@Show(label = "当班运行时间(h)")
@ApiModelProperty(notes = "当前运行时间")
@Column(name = "current_runtime")
private BigDecimal currentRuntime;
@ApiModelProperty(notes = "累计运行时间")
@Column(name = "total_runtime")
private BigDecimal totalRuntime;
@Show(label = "更新时间")
@ApiModelProperty(notes = "创建时间")
@Column(name = "create_time")
private Date createTime;
}
......@@ -14,7 +14,6 @@ import javax.persistence.Table;
import java.util.Date;
@Data
@Search(code = "POLISHING_ROOM")
@ApiModel("涂装-打磨室风机状态及报警信息")
@Table(name = "eqp_data_polishing_booth_state")
public class PolishingRoomStateMachine extends EquipmentData {
......
......@@ -25,16 +25,21 @@ public class VocMachine extends EquipmentData {
@Search
private String equipCode;
@Show(label = "北VOC浓度")
@Show(label = "北进口VOC浓度")
@Column(name = "concentration1")
@ApiModelProperty(notes = "VOC浓度")
private Float concentration1;
@Show(label = "南VOC浓度")
@Show(label = "南进口VOC浓度")
@Column(name = "concentration2")
@ApiModelProperty(notes = "VOC浓度")
private Float concentration2;
@Show(label = "出口VOC浓度")
@Column(name = "concentration3")
@ApiModelProperty(notes = "VOC浓度")
private Float concentration3;
@Search
@Show(label = "采集时间",dataType = FieldType.DATETIME)
@ApiModelProperty("时间")
......
package net.vtstar.zhongtong.avi.gateway.painting.job;
import lombok.extern.slf4j.Slf4j;
import net.vtstar.user.mybatis.provider.Operation;
import net.vtstar.user.mybatis.provider.WhereFilter;
import net.vtstar.utils.CollecUtils;
import net.vtstar.utils.DateUtils;
import net.vtstar.zhongtong.avi.gateway.painting.domain.ElectrophoresisMachine;
import net.vtstar.zhongtong.avi.gateway.painting.mapper.ElectrophoresisMapper;
import net.vtstar.zhongtong.avi.global.constant.Constant;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.scheduling.quartz.QuartzJobBean;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
* 电泳空中行车时间数据采集JOB
*/
@Slf4j
@Component
public class ElectrophoresisMachineJob extends QuartzJobBean {
private static final String NAME = "VEHICLE_ELECTROPHORESIS_OUTPUT";
public static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy:MM:dd");
public static final List<String> eqpNoList = Arrays.asList("预脱脂", "脱脂", "水洗1", "水洗2", "表调", "磷化", "水洗3", "水洗4", "纯水洗1",
"电泳转移槽", "电泳槽", "UF1", "UF2", "纯水洗2");
@Resource(name = "redisTemplate")
protected ValueOperations valueOperations;
@Autowired
private ElectrophoresisMapper mapper;
@Override
protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
String today = dateFormat.format(new Date());
String areaKey = Constant.BUS_SIZE_OUT + "2" + ":" + today;
Integer size = (Integer) valueOperations.get(areaKey);
if (null == size) {
size = 1;
}
String eqpNo = eqpNoList.get((int)(Math.random() * 14));
String startOfDay = DateUtils.parseDateToString(DateUtils.getStartOfDay(0, new Date()), "yyyy-MM-dd HH:mm:ss");
String endOfDay = DateUtils.parseDateToString(DateUtils.getEndOfDay(0, new Date()), "yyyy-MM-dd HH:mm:ss");
List<ElectrophoresisMachine> list = mapper.findList(new WhereFilter() {{
addFilter("eqp_code", Operation.EQUAL, eqpNo);
addFilter("create_time", Operation.EQUAL_GREATER_THAN, startOfDay);
addFilter("create_time", Operation.EQUAL_LESS_THAN, endOfDay);
}}, ElectrophoresisMachine.class);
if (CollecUtils.isEmpty(list)){
ElectrophoresisMachine machine = new ElectrophoresisMachine();
machine.setEquipCode(eqpNo);
machine.setUpTime(new BigDecimal(size * 2));
machine.setDownTime(new BigDecimal(size * 2.5));
machine.setEntryTime(new BigDecimal(size * 1.5));
machine.setTranslationTime(new BigDecimal(size * 2));
machine.setCreateTime(new Date());
mapper.insert(machine);
}else {
ElectrophoresisMachine machine = list.get(0);
machine.setUpTime(machine.getUpTime().add(new BigDecimal(0.5)));
machine.setDownTime(machine.getDownTime().add(new BigDecimal(1)));
machine.setEntryTime(machine.getEntryTime().add(new BigDecimal(0.4)));
machine.setTranslationTime(machine.getTranslationTime().add(new BigDecimal(0.8)));
machine.setCreateTime(new Date());
mapper.update(machine);
}
}
}
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.PolishingRoomStateMachine;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.stereotype.Component;
import java.util.Date;
/**
* 打磨室风机数据采集JOB
*/
@Slf4j
@Component
public class PolishingRoomStateJob extends GatherJob {
private static final String NAME = "POLISHING_ROOM";
@Override
protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
log.info("JobName: {}", context.getJobDetail().getKey().getName());
super.gatherByModbus(NAME, PolishingRoomStateMachine.class);
}
@Override
public boolean handleObject(EquipmentData equipmentData) {
PolishingRoomStateMachine data = (PolishingRoomStateMachine) equipmentData;
String state = data.getStatus();
if (state == null || "0".equals(state)) {
return false;
}
if(null != data.getState() && data.getState() == 1){
equipmentData.setEquipStatus(EquipStatusEnum.RUN);
}else{
equipmentData.setEquipStatus(EquipStatusEnum.ALARM);
}
return true;
}
@Override
public Object handleValue(String fieldName, Object value) {
Integer valueInt = Integer.valueOf(value.toString());
return (valueInt & 0x01);
}
@Override
protected void postHandle(EquipmentData equipmentData) {
((PolishingRoomStateMachine)equipmentData).setCreateTime(new Date());
}
}
......@@ -74,6 +74,7 @@ public class RotaryRollerBedMachineJob extends QuartzJobBean {
machine.setRunNumPainting1(Integer.valueOf(testValueOperations.get(keyP1).toString()));
machine.setRunNumPainting2(Integer.valueOf(testValueOperations.get(keyP2).toString()));
machine.setRunNumChassis(Integer.valueOf(testValueOperations.get(keyC).toString()));
machine.setCreateTime(new Date());
mapper.update(machine);
}
......
......@@ -3,11 +3,10 @@ package net.vtstar.zhongtong.avi.gateway.painting.listener;
import com.jnrsmcu.sdk.netdevice.NodeData;
import com.jnrsmcu.sdk.netdevice.RSServer;
import com.jnrsmcu.sdk.netdevice.RealTimeData;
import net.vtstar.user.mybatis.provider.Operation;
import net.vtstar.user.mybatis.provider.WhereFilter;
import net.vtstar.utils.CollecUtils;
import net.vtstar.zhongtong.avi.gateway.painting.domain.SprayBoothMachine;
import net.vtstar.zhongtong.avi.gateway.painting.mapper.SprayBoothMapper;
import net.vtstar.zhongtong.avi.utils.EquipDataUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
......@@ -105,14 +104,15 @@ public class SprayBoothListener implements CommandLineRunner {
return;
}
SprayBoothMachine sprayBoothMachine = list.get(0);
Object value = valueOperations.get("喷涂室:" + sprayBoothMachine.getEquipCode());
String key = EquipDataUtil.getSprayValueKey(sprayBoothMachine.getEquipCode());
Object value = valueOperations.get(key);
if (value == null){
valueOperations.set("喷涂室:" + sprayBoothMachine.getEquipCode(), sprayBoothMachine.getCreateTime().getTime());
valueOperations.set(key, sprayBoothMachine.getCreateTime().getTime());
}else{
long time = sprayBoothMachine.getCreateTime().getTime() - Long.valueOf(value.toString());
if (time > 5 * 60 * 1000){
mapper.insertList(list);
valueOperations.set("喷涂室:" + sprayBoothMachine.getEquipCode(), sprayBoothMachine.getCreateTime().getTime());
valueOperations.set(key, sprayBoothMachine.getCreateTime().getTime());
}
}
}
......
package net.vtstar.zhongtong.avi.gateway.painting.mapper;
import net.vtstar.user.mybatis.BaseMapper;
import net.vtstar.zhongtong.avi.gateway.painting.domain.ElectrophoresisMachine;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ElectrophoresisMapper extends BaseMapper<ElectrophoresisMachine> {
}
......@@ -79,7 +79,21 @@ public class WeldingRobotMachineJob extends QuartzJobBean {
String weldingTime = Integer.valueOf(hourWelding.toString()) + "小时" + Integer.valueOf(minuteWelding.toString()) + "分" +
Integer.valueOf(secondWelding.toString()) + "秒";
WeldingRobotMachine machine = new WeldingRobotMachine();
machine.setEquipCode("焊接机器人" + ipAddress.split("\\.")[3]);
machine.setEquipCode("焊接机器人");
switch (ipAddress){
case "10.1.25.186":
machine.setAlias("1203438");
break;
case "10.1.25.187":
machine.setAlias("1203440");
break;
case "10.1.25.188":
machine.setAlias("1203441");
break;
case "10.1.25.189":
machine.setAlias("1203439");
break;
}
machine.setTurnOnTime(turnOnTime);
machine.setWeldingTime(weldingTime);
machine.setCreateTime(new Date());
......
......@@ -6,8 +6,6 @@ import org.springframework.context.annotation.Primary;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer;
import org.springframework.data.redis.serializer.RedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
@Configuration
......@@ -21,8 +19,8 @@ public class RedisConfig {
redisTemplate.setKeySerializer(new StringRedisSerializer());
redisTemplate.setValueSerializer(new GenericJackson2JsonRedisSerializer());
redisTemplate.setHashKeySerializer(RedisSerializer.string());
redisTemplate.setHashValueSerializer(RedisSerializer.string());
redisTemplate.setHashKeySerializer(new StringRedisSerializer());
redisTemplate.setHashValueSerializer(new GenericJackson2JsonRedisSerializer());
redisTemplate.afterPropertiesSet();
return redisTemplate;
......
......@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -91,10 +92,16 @@ public class LedController {
Map<String, Object> map = datas.get(0);
vocVO.setSouthCONC(new BigDecimal(map.get("concentration2").toString()));
vocVO.setNorthCONC(new BigDecimal(map.get("concentration1").toString()));
vocVO.setExitCONC(new BigDecimal(5));
vocVO.setExitCONC(new BigDecimal(map.get("concentration3").toString()));
}
//TODO: voc进出口浓度 真实数据
return Return.success(vocVO);
}
@ApiOperation(value = "当前本地时间请求")
@GetMapping(value = "/currentTime")
private Return getCurrentTime() {
return Return.success(new Date());
}
}
......@@ -89,13 +89,13 @@ public class LedService {
List<WorkRoom> room = new ArrayList<>();
List<String> eqpCodeList = new ArrayList<>();
if (ledNo.equals("5")) {
eqpCodeList = Arrays.asList("中涂喷漆室349", "中涂喷漆室350");
eqpCodeList = Arrays.asList("中涂喷漆室349", "中涂喷漆室350", "中途烘干室351", "中途烘干室352", "工位电泳烘干室302", "工位电泳烘干室303", "腻子烘干室336", "腻子烘干室335", "腻子烘干室377");
}
if (ledNo.equals("6")) {
eqpCodeList = Arrays.asList("彩条喷漆室365", "彩条喷漆室367", "彩条喷漆室369", "彩条喷漆室371");
eqpCodeList = Arrays.asList("彩条喷漆室365", "彩条喷漆室367", "彩条喷漆室369", "彩条喷漆室371", "彩条烘干室366", "彩条烘干室368", "彩条烘干室370", "彩条烘干室372");
}
if (ledNo.equals("7")) {
eqpCodeList = Arrays.asList("罩光喷漆室374", "面漆喷漆室359", "面漆喷漆室361", "面漆喷漆室363");
eqpCodeList = Arrays.asList("罩光喷漆室374", "面漆喷漆室359", "面漆喷漆室361", "面漆喷漆室363", "面漆烘干室360", "面漆烘干室362", "面漆烘干室364", "罩光漆烘干室373");
}
String startOfDay = DateUtils.parseDateToString(DateUtils.getStartOfDay(0), "yyyy-MM-dd HH:mm:ss");
String endOfDay = DateUtils.parseDateToString(DateUtils.getEndOfDay(0), "yyyy-MM-dd HH:mm:ss");
......
......@@ -57,7 +57,7 @@ public class Vehicle {
@Column(name = "sequence")
@ApiModelProperty(notes = "上下顺序")
private Date sequence;
private Integer sequence;
@ApiModelProperty("当前绑定滑撬")
private Skid skid;
......
package net.vtstar.zhongtong.avi.monitoring.job;
import com.alibaba.fastjson.JSONObject;
import io.netty.buffer.ByteBuf;
import lombok.extern.slf4j.Slf4j;
import net.vtstar.protocol.modbus.tcp.netty.packet.ModbusResponse;
import net.vtstar.protocol.modbus.tcp.netty.service.ModbusTemplate;
import net.vtstar.protocol.modbus.tcp.netty.utils.NettyUtils;
import net.vtstar.protocol.modbus.tcp.netty.utils.PoolKey;
import net.vtstar.scada.base.equipmgt.domain.*;
......@@ -12,7 +10,6 @@ import net.vtstar.scada.base.equipmgt.service.EquipInfoService;
import net.vtstar.scada.base.gather.job.GatherJob;
import net.vtstar.scada.base.global.service.ModbusService;
import net.vtstar.zhongtong.avi.equipment.domain.PaintshopStation;
import net.vtstar.zhongtong.avi.equipment.mapper.PaintshopStationMapper;
import net.vtstar.zhongtong.avi.global.constant.Constant;
import net.vtstar.zhongtong.avi.monitoring.domain.Skid;
import net.vtstar.zhongtong.avi.monitoring.domain.Vehicle;
......@@ -25,19 +22,18 @@ import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.Cache;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.ListOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import javax.validation.constraints.NotNull;
import java.util.*;
import java.util.stream.Collectors;
@Slf4j
@Component
//@DisallowConcurrentExecution
public class AVIMonitorJob extends GatherJob {
private static final String EQUIPMENT_TYPE = "PLC";
......@@ -45,8 +41,6 @@ public class AVIMonitorJob extends GatherJob {
@Autowired
private EquipInfoService equipInfoService;
@Autowired
private PaintshopStationMapper stationMapper;
@Autowired
private ModbusService modbusService;
@Autowired
private StationPassInfoService passInfoService;
......@@ -58,17 +52,18 @@ public class AVIMonitorJob extends GatherJob {
@Resource(name = "laneStationCache")
private Cache laneStationCache;
@Resource(name = "redisTemplate")
protected HashOperations hashOperations;
protected HashOperations<String, String, PaintshopStation> hashOperations;
@Resource(name = "redisTemplate")
private ValueOperations valueOperations;
@Resource(name = "redisTemplate")
private ListOperations listOperations;
@Resource(name = "redisTemplate")
private RedisTemplate redisTemplate;
@Override
protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
log.info("-------------------------------");
log.info("AVIMonitorJob start");
List<EquipInfo> equipInfoList = equipInfoService.getEquipInfoList(EQUIPMENT_TYPE);
if (CollectionUtils.isEmpty(equipInfoList)) {
return;
......@@ -83,6 +78,9 @@ public class AVIMonitorJob extends GatherJob {
}
for (EquipCommunication communication : commList) {
EquipDataChannel dataChannel = communication.getDataChannel();
if (null != dataChannel.getEquipCode() && !dataChannel.getEquipCode().startsWith(EQUIPMENT_TYPE)){
continue;
}
String ip = dataChannel.getIp();
Integer port = dataChannel.getPort();
PoolKey poolKey = NettyUtils.wrapPoolKey(ip, port);
......@@ -123,16 +121,21 @@ public class AVIMonitorJob extends GatherJob {
}
} catch (Exception e) {
log.error("读取失败。ip{}, 端口{}, slave{}, start{}, size{}", poolKey.getHost(), poolKey.getPort(), slaveId, start, quantity);
continue;
return;
}
if (null == response) {
log.error("读取失败! response 为空!");
continue;
return;
}
if (!response.isSuccess()){
log.error("读取失败! response isSuccess 为 false!");
return;
}
ByteBuf body = response.getBody();
if (null == body) {
log.error("response.body is null!!");
continue;
//若出现一次读取错误, 则将本次读取结束, 必须保证读取到所有的工位旋转情况
return;
}
int length = body.readableBytes();
byte[] bytes = new byte[length];
......@@ -186,58 +189,54 @@ public class AVIMonitorJob extends GatherJob {
station.setTurnR(state == 1 ? true : false);
}
valueOperations.set(Constant.STATION_PREFIX + stationCode, station);
} else if (fieldName.startsWith("warning")) {
String[] split = fieldName.split(":");
String areaNo = split[1];
String warningCode = split[2];
if ((state & (0x01 << offset)) == 0) {
state = 0;
} else {
state = 1;
}
valueOperations.set(Constant.WARNING_PREFIX + areaNo + ":" + warningCode, state);
}
}
}
}
}
if (CollectionUtils.isEmpty(stations)) {
if (CollectionUtils.isEmpty(stations) || stations.size() != 144) {
log.error("没有维护工位信息!");
return;
}
List<Vehicle> vehicles = new ArrayList<>();
Set<String> veKeys = redisTemplate.keys(Constant.VEHICLE_PREFIX + ":*");
Set<String> veKeys = redisTemplate.keys(Constant.VEHICLE_PREFIX + "*");
for (String veKey : veKeys) {
Vehicle ve = (Vehicle) valueOperations.get(Constant.VEHICLE_PREFIX + veKey);
Vehicle ve = (Vehicle) valueOperations.get(veKey);
if (null == ve) {
ve = vehicleCache.get(veKey, Vehicle.class);
ve = vehicleCache.get(veKey.split(":")[1], Vehicle.class);
}
if (null == ve){
log.error("平移车:{} 未在到缓存中!", veKey);
continue;
}
if (ve.getState() == false){
if (null != ve.getState() && ve.getState() == false){
vehicles.add(ve);
}
}
Map<String, List<Vehicle>> veMap = vehicles.stream().filter(a -> a.getState() != false).collect(Collectors.groupingBy(Vehicle::getLane));
Map<String, List<Vehicle>> veMap = vehicles.stream().collect(Collectors.groupingBy(Vehicle::getLane));
Map<String, List<PaintshopStation>> listMap = stations.stream().filter(a -> false != a.getTurnR() || false != a.getTurnF()).
Map<String, List<PaintshopStation>> listMap = stations.stream().filter(a -> false != a.getTurnR() || false != a.getTurnF()).
collect(Collectors.groupingBy(PaintshopStation::getVehicleLaneCode));
for (Map.Entry<String, List<Vehicle>> ve : veMap.entrySet()) {
String key = ve.getKey();
if (Integer.valueOf(key) > 4){
continue;
}
List<PaintshopStation> landStations = listMap.get(key);
if (null == landStations){
landStations = new ArrayList<>();
}
List<Vehicle> value = ve.getValue();
List<PaintshopStation> turnStation = new ArrayList<>();
List<PaintshopStation> landStations = listMap.get(key);
for (PaintshopStation landStation : landStations) {
//获得 西侧加正转=下车 西+反=上 东+反=下 东+正=上
if (landStation.getTurnF() && landStation.getDirection().equals(Direction.WEST)) {
if (landStation.getTurnF() && Direction.WEST.equals(landStation.getDirection())) {
turnStation.add(landStation);
}
if (landStation.getTurnR() || landStation.getDirection().equals(Direction.EAST)) {
if (landStation.getTurnR() && Direction.EAST.equals(landStation.getDirection())) {
turnStation.add(landStation);
}
}
......@@ -246,13 +245,13 @@ public class AVIMonitorJob extends GatherJob {
Map<String, PaintshopStation> entries = hashOperations.entries(Constant.STATION_OUT_PREFIX + key);
for (PaintshopStation station : turnStation) {
//若当前工位已进车的方式旋转, 且之前一分钟内没有进过车, 则此工位可再次进车
if (station.getInTime() != null && ((System.currentTimeMillis() - station.getInTime().getTime()) > 60 * 1000)){
if (station.getInTime() == null || ((System.currentTimeMillis() - station.getInTime().getTime()) > 60 * 1000)){
entries.put(station.getCode(), station);
}
}
if (CollectionUtils.isEmpty(entries)) {
stationSize = turnStation.size();
if (!CollectionUtils.isEmpty(entries)) {
stationSize = entries.size();
}
//TODO: 临时校验错误, 每条平移车道存在其旋转工位数, 若超过此值, 则按照当前下车数进行依次下车, 多余旋转工位舍弃;
int maxStationSize = 0;
......@@ -273,8 +272,9 @@ public class AVIMonitorJob extends GatherJob {
//若平移车下车信号与与工位下车信号不等,存入工位信息返回
if (value.size() != stationSize && stationSize <= maxStationSize) {
hashOperations.putAll(Constant.STATION_OUT_PREFIX + key, entries);
log.error("当前旋转的工位数量为: " + stationSize);
log.error("当前车道: {}旋转的工位数量为: {}", key, stationSize);
} else {
log.error("--------------开始下车逻辑------------------");
value.sort(Comparator.comparing(v -> v.getSequence()));
List<PaintshopStation> collect = entries.values().stream().sorted(Comparator.comparing(e -> e.getVehicleLaneCode())).collect(Collectors.toList());
for (int i = 0; i < value.size(); i++) {
......@@ -283,6 +283,12 @@ public class AVIMonitorJob extends GatherJob {
Vehicle vehicle = value.get(i);
PaintshopStation station = collect.get(i);
Skid skid = vehicle.getSkid();
//TODO: 若平移车上车时找不到对应的滑撬, 则skid为空, 下车时不做处理
if (null == skid){
log.error("平移车上车时找不到对应的滑撬: {}", vehicle.getMqttPrefix());
continue;
}
log.error("平移车: {} 下车到工位:{}", vehicle.getMqttPrefix(), station.getCode());
Long laneId = station.getLaneId();
List<PaintshopStation> lands = new ArrayList<>();
......@@ -297,11 +303,14 @@ public class AVIMonitorJob extends GatherJob {
PaintshopStation start = lands.get(0);
PaintshopStation end = lands.get(lands.size() - 1);
//下车时, 记录进去车道的开始时间, 并将记录ID绑定在工位上
Long passInfoId = passInfoService.createPassInfo(station.getWorkOrderNo(), station.getSkid().getRfid(), station.getAreaName(), station.getLandNo());
Long passInfoId = 0L;
if (null != skid){
passInfoId = passInfoService.createPassInfo(skid.getWorkOrderNo(), skid.getRfid(), station.getAreaName(), station.getLandNo());
}
if (start.getCode().equals(station.getCode())) {
for (int j = lands.size() - 1; j > 0; j--) {
PaintshopStation tem = lands.get(j);
PaintshopStation tem2 = lands.get(j + 1);
PaintshopStation tem2 = lands.get(j - 1);
if (tem.getSkid() != null) {
tem2.setSkid(tem.getSkid());
tem2.setState(StationState.USE);
......@@ -313,7 +322,9 @@ public class AVIMonitorJob extends GatherJob {
start.setSkid(skid);
start.setState(StationState.USE);
start.setInTime(new Date());
start.setPassInfoId(passInfoId);
if (passInfoId != 0L){
start.setPassInfoId(passInfoId);
}
} else if (end.getCode().equals(station.getCode())) {
for (int j = 0; j < lands.size() - 1; j++) {
......@@ -330,7 +341,9 @@ public class AVIMonitorJob extends GatherJob {
end.setState(StationState.USE);
end.setSkid(skid);
end.setInTime(new Date());
end.setPassInfoId(passInfoId);
if (passInfoId != 0L){
end.setPassInfoId(passInfoId);
}
}
String today = RfidMessageHandler.dateFormat.format(new Date());
......@@ -339,7 +352,7 @@ public class AVIMonitorJob extends GatherJob {
String areaKey = Constant.BUS_SIZE_IN + areaCode + ":" + today;
Integer size = (Integer) valueOperations.get(areaKey);
if (null == size) {
size = 0;
size = 1;
} else {
size++;
}
......@@ -354,8 +367,9 @@ public class AVIMonitorJob extends GatherJob {
vehicle.setSkid(null);
vehicle.setCurrentRfid(null);
vehicle.setState(null);
valueOperations.set(Constant.VEHICLE_PREFIX + vehicle.getCode(), value);
valueOperations.set(Constant.VEHICLE_PREFIX + vehicle.getCode().replace("ZT/translation/", "").replace("/data/all", "").trim(), vehicle);
}
log.error("-------------下车逻辑结束------------------");
}
}
}
......
package net.vtstar.zhongtong.avi.monitoring.job;
import io.netty.buffer.ByteBuf;
import lombok.extern.slf4j.Slf4j;
import net.vtstar.protocol.modbus.tcp.netty.packet.ModbusResponse;
import net.vtstar.protocol.modbus.tcp.netty.utils.NettyUtils;
import net.vtstar.protocol.modbus.tcp.netty.utils.PoolKey;
import net.vtstar.scada.base.equipmgt.domain.*;
import net.vtstar.scada.base.equipmgt.service.EquipInfoService;
import net.vtstar.scada.base.gather.job.GatherJob;
import net.vtstar.scada.base.global.service.ModbusService;
import net.vtstar.zhongtong.avi.equipment.domain.PaintshopStation;
import net.vtstar.zhongtong.avi.global.constant.Constant;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@Slf4j
@Component
public class AviWarningJob extends GatherJob {
private static final String EQUIPMENT_TYPE = "PLC";
@Autowired
private EquipInfoService equipInfoService;
@Autowired
private ModbusService modbusService;
@Resource(name = "redisTemplate")
private ValueOperations valueOperations;
@Override
protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
log.info("-------------------------------");
log.info("AVIMonitorJob start");
List<EquipInfo> equipInfoList = equipInfoService.getEquipInfoList(EQUIPMENT_TYPE);
if (CollectionUtils.isEmpty(equipInfoList)) {
return;
}
//处理工位正反转用
List<PaintshopStation> stations = new ArrayList<>();
for (EquipInfo equipInfo : equipInfoList) {
List<EquipCommunication> commList = equipInfoService.getCommunicationListByEquipType(equipInfo.getEquipCode(), 1);
if (CollectionUtils.isEmpty(commList)) {
return;
}
for (EquipCommunication communication : commList) {
EquipDataChannel dataChannel = communication.getDataChannel();
if (null != dataChannel.getEquipCode() && dataChannel.getEquipCode().startsWith(EQUIPMENT_TYPE)) {
continue;
}
String ip = dataChannel.getIp();
Integer port = dataChannel.getPort();
PoolKey poolKey = NettyUtils.wrapPoolKey(ip, port);
Integer slaveId = dataChannel.getNo();
EquipDataTemplate template = communication.getDataTemplate();
if (template == null) {
log.info("无法获取设备的数据模板,设备编号:{}", dataChannel.getEquipCode());
continue;
}
List<EquipDataTemplateItem> templateItemList = template.getTemplateItemList();
if (CollectionUtils.isEmpty(templateItemList)) {
log.info("无法获取数据模板的条目,设备编号:{},模板名称:{}", dataChannel.getEquipCode(), template.getName());
continue;
}
Map<Integer, List<EquipDataTemplateItem>> listMap = modbusService.groupByFuntionCode(templateItemList);
for (Map.Entry<Integer, List<EquipDataTemplateItem>> entry : listMap.entrySet()) {
List<EquipDataTemplateItem> value = entry.getValue();
if (CollectionUtils.isEmpty(value)) {
continue;
}
Integer start = value.get(0).getAddress();
Integer end = value.get(value.size() - 1).getAddress();
Integer size = value.get(value.size() - 1).getLength();
Integer quantity = end + size - start;
ModbusResponse response = null;
Integer functionCode = entry.getKey();
try {
if (1 == functionCode) {
response = modbusService.readCoilRegister(slaveId, poolKey, start, quantity);
} else if (2 == functionCode) {
response = modbusService.readInputDiscretes(slaveId, poolKey, start, quantity);
} else if (3 == functionCode) {
response = modbusService.readMultipleRegister(slaveId, poolKey, start, quantity);
} else if (4 == functionCode) {
response = modbusService.readInputRegister(slaveId, poolKey, start, quantity);
}
} catch (Exception e) {
log.error("读取失败。ip{}, 端口{}, slave{}, start{}, size{}", poolKey.getHost(), poolKey.getPort(), slaveId, start, quantity);
continue;
}
if (null == response) {
log.error("读取失败! response 为空!");
continue;
}
ByteBuf body = response.getBody();
if (null == body) {
log.error("response.body is null!!");
continue;
}
int length = body.readableBytes();
byte[] bytes = new byte[length];
body.getBytes(body.readerIndex(), bytes);
log.info("读取读取数据。ip{}, 端口{}, slave{}, start{}, size{}", poolKey.getHost(), poolKey.getPort(), slaveId, start, quantity);
log.info("data:{}", Arrays.toString(bytes));
for (EquipDataTemplateItem templateItem : value) {
Integer address = templateItem.getAddress();
int quality = address - start;
int register = quality / 8;
int offset = quality % 8;
byte state = bytes[register];
String fieldName = templateItem.getFieldName();
if (fieldName.startsWith("warning")) {
String[] split = fieldName.split(":");
String areaNo = split[1];
String warningCode = split[2];
if ((state & (0x01 << offset)) == 0) {
state = 0;
} else {
state = 1;
}
valueOperations.set(Constant.WARNING_PREFIX + areaNo + ":" + warningCode, state);
}
}
}
}
}
}
}
\ No newline at end of file
......@@ -66,13 +66,16 @@ public class RedisToCacheJob extends GatherJob {
String[] split = s.split(":");
String warningCode = split[2];
Warning warning = warningCache.get(warningCode, Warning.class);
warning.setEquipName(warning.getName().split(" ")[0]);
warning.setTime(new SimpleDateFormat("HH:mm").format(new Date()));
warnings.add(warning);
}
}
warningCache.put(Constant.LED_PREFIX + key, warnings);
list.addAll(warnings);
warningCache.put(Constant.LED_PREFIX + "ALL", warnings);
}
log.error("当前检测到异常报警: {}条", list.size());
warningCache.put(Constant.LED_PREFIX + "ALL", list);
runRecordService.refreshWarning(list);
//处理进出车信息
Set<String> keys = redisTemplate.keys(Constant.STATION_PREFIX + "*");
......
......@@ -73,11 +73,9 @@ public class ReadDataToCacheRunner implements CommandLineRunner {
@Override
public void run(String... args) throws Exception {
List<Warning> warnings = warningMapper.findList(new WhereFilter() {
{
addOrderBy("warning", "id", OrderBy.ASC);
}
}, Warning.class);
List<Warning> warnings = warningMapper.findList(new WhereFilter() {{
addOrderBy("warning", "id", OrderBy.ASC);
}}, Warning.class);
for (Warning warning : warnings) {
warningCache.put(warning.getCode(), warning);
}
......@@ -97,7 +95,7 @@ public class ReadDataToCacheRunner implements CommandLineRunner {
}}, PaintshopStation.class);
//todo: 初始化工位信息
for (int i = 0; i < stations.size(); i++) {
/*for (int i = 0; i < stations.size(); i++) {
PaintshopStation station = stations.get(i);
if (i % 5 == 0) {
station.setBusType(ProductionType.OWN);
......@@ -108,10 +106,8 @@ public class ReadDataToCacheRunner implements CommandLineRunner {
station.setState(StationState.FREE);
}
station.setState(StationState.FREE);
valueOperations.set(Constant.STATION_PREFIX + station.getCode(),station);
}
valueOperations.set(Constant.STATION_PREFIX + station.getCode(), station);
}*/
for (PaintshopStation station : stations) {
......@@ -135,10 +131,7 @@ public class ReadDataToCacheRunner implements CommandLineRunner {
}
List<Vehicle> vehicles = vehicleMapper.findList(new WhereFilter(), Vehicle.class);
for (
Vehicle vehicle : vehicles)
{
for (Vehicle vehicle : vehicles) {
vehicleCache.put(vehicle.getMqttPrefix(), vehicle);
}
......@@ -156,10 +149,7 @@ public class ReadDataToCacheRunner implements CommandLineRunner {
List<PaintshopArea> list = areaMapper.findList(new WhereFilter(), PaintshopArea.class);
webStationCache.put("stationList", list);
for (
PaintshopArea area : list)
{
for (PaintshopArea area : list) {
stationCache.put(Constant.AREA_PREFIX + area.getCode(), area);
}
}
......
package net.vtstar.zhongtong.avi.monitoring.service;
import net.vtstar.utils.DateUtils;
import net.vtstar.zhongtong.avi.equipment.domain.PaintshopStation;
import net.vtstar.zhongtong.avi.monitoring.domain.StationPassInfo;
import net.vtstar.zhongtong.avi.monitoring.mapper.StationPassInfoMapper;
......@@ -45,15 +46,9 @@ public class StationPassInfoService {
}
passInfo.setOutTime(new Date());
passInfoMapper.update(passInfo);
String sql = "INSERT INTO 'VEHICLE_PASSING_INFO' ('WONo', 'RFID', 'StationNo', 'AreaNo', 'InTime', 'OutTime', 'Status') VALUES ('"
+ passInfo.getVIN() + "', '"
+ passInfo.getRfid() + "', '"
+ passInfo.getStationNo() + "', '"
+ passInfo.getAreaNo() + "', '"
+ passInfo.getInTime() + "', '"
+ passInfo.getOutTime() + "', '"
+ 1 + "', '"
+ "');";
mesSqlServerJdbcTemplate.update(sql);
String sql = "INSERT INTO VEHICLE_PASSING_INFO VALUES (?,?,?,?,?,?,?)";
mesSqlServerJdbcTemplate.update(sql, new Object[]{passInfo.getVIN(), passInfo.getRfid(), passInfo.getAreaNo(),
passInfo.getStationNo(), DateUtils.parseDateToString(passInfo.getInTime(), "yyyy-MM-dd HH:mm:ss"),
DateUtils.parseDateToString(passInfo.getOutTime(), "yyyy-MM-dd HH:mm:ss"), 1});
}
}
......@@ -92,6 +92,9 @@ public class RfidMessageHandler extends AbstractTesterMessageHandler {
JSONObject json = JSONObject.parseObject(payload.toString());
String id = json.getString("ID");
if (null == id){
id = json.getString("TID");
}
Integer state = json.getIntValue("State");
if (StringUtil.isNullOrEmpty(id)) {
return;
......@@ -107,7 +110,6 @@ public class RfidMessageHandler extends AbstractTesterMessageHandler {
String vehicleCode = headers.get(MqttConstants.MSG_HEADER_KEY_EQUIPMENTNUMBER, String.class);
log.info(vehicleCode + "______" + json.toJSONString() + " code:" + vehicleCode);
listOperations.rightPush("rfid:log:" + vehicleCode, messageBO);
if (id.startsWith("A61A")) {
log.error("过滤掉乱发信息!:{},平移车:{}", id, vehicleCode);
......@@ -117,6 +119,9 @@ public class RfidMessageHandler extends AbstractTesterMessageHandler {
Skid skid = (Skid) valueOperations.get(Constant.SKID_PREFIX + id);
//若是焊装车间进车,绑定滑撬与车身关系
if (state == 1 && (vehicleCode.equals(Constant.HANZHUANG_VEHICLE1_RFID) || vehicleCode.equals(Constant.HANZHUANG_VEHICLE2_RFID))) {
//记录焊装上车的信息
listOperations.rightPush("rfid:log:" + vehicleCode, messageBO);
String busNo = (String) valueOperations.get(Constant.HANZHUANG_VEHICLE_BUSNO_KEY + vehicleCode);
String workOrderNo = (String) valueOperations.get(Constant.HANZHUANG_VEHICLE_WORKNO_KEY + vehicleCode);
if (null == busNo) {
......@@ -136,15 +141,20 @@ public class RfidMessageHandler extends AbstractTesterMessageHandler {
Integer size = (Integer) valueOperations.get(key);
if (null == size) {
size = 1;
}else {
size ++;
}
//TODO: size是否需要++
valueOperations.set(key, size);
String keyW = EquipDataUtil.getTestValueKey("ROTARY_ROLLER_BED_C");
testValueOperations.set(keyW, null == testValueOperations.get(keyW) ? 0 : ((int)testValueOperations.get(keyW)) + 1);
return;
}
if (null == skid) {
//todo: 因PDA未使用, 暂不做此逻辑判断
/*if (null == skid) {
log.error("无滑撬信息! :" + vehicleCode);
return;
}
}*/
Vehicle vehicle = (Vehicle) valueOperations.get(Constant.VEHICLE_PREFIX + vehicleCode);
if (null == vehicle) {
......@@ -160,18 +170,31 @@ public class RfidMessageHandler extends AbstractTesterMessageHandler {
long l = (date.getTime() - occurTime.getTime()) / 1000;
if (l < 60) {
log.error("{} 平移车发生重发现象 ,滑撬id {}", vehicleCode, id);
vehicle.setOccurTime(date);
valueOperations.set(Constant.VEHICLE_PREFIX + vehicleCode, vehicle);
return;
}
}
}
}
//平移车过车信息
listOperations.rightPush("rfid:log:" + vehicleCode, messageBO);
if (state == 0) {
vehicle.setState(false);
vehicle.setOccurTime(new Date());
valueOperations.set(Constant.VEHICLE_PREFIX + vehicleCode, vehicle);
return;
}
//TODO: 若上车时, 发现此滑撬号未被绑定过, 则有两种情况: 漏读/系统启动前就上线的
if (null == skid){
skid = new Skid();
skid.setRfid(id);
skid.setBusNo("123456");
skid.setWorkOrderNo("TZ0010051107_0011");
skid.setBusType(ProductionType.OWN);
valueOperations.set(Constant.SKID_PREFIX + id, skid);
}
vehicle.setState(true);
vehicle.setOccurTime(date);
vehicle.setCurrentRfid(id);
......@@ -192,6 +215,10 @@ public class RfidMessageHandler extends AbstractTesterMessageHandler {
if (StationState.FREE.equals(value.getState())) {
continue;
}
//TODO: 因当前环境中存在未上线的滑撬, 所以skid有可能为空
if(null == value.getSkid()){
continue;
}
if (id.equals(value.getSkid().getRfid())) {
List<PaintshopStation> lands = new ArrayList<>();
List<PaintshopStation> temStation = laneStationCache.get(value.getLaneId(), ArrayList.class);
......@@ -209,7 +236,7 @@ public class RfidMessageHandler extends AbstractTesterMessageHandler {
vehicle.setSkid(start.getSkid());
vehicle.setCurrentRfid(start.getSkid().getRfid());
for (int j = 1; j < lands.size() - 1; j++) {
for (int j = 1; j < lands.size() - 2; j++) {
PaintshopStation tem = lands.get(j);
PaintshopStation tem2 = lands.get(j - 1);
if (tem.getSkid() != null) {
......@@ -225,7 +252,7 @@ public class RfidMessageHandler extends AbstractTesterMessageHandler {
}
} else if (end.getCode().equals(value.getCode())) {
vehicle.setSkid(end.getSkid());
vehicle.setCurrentRfid(start.getSkid().getRfid());
vehicle.setCurrentRfid(end.getSkid().getRfid());
for (int j = lands.size() - 2; j >= 0; j--) {
PaintshopStation tem = lands.get(j);
......@@ -245,7 +272,7 @@ public class RfidMessageHandler extends AbstractTesterMessageHandler {
//TODO: 记录过站信息
String areaCode = value.getAreaId().toString();
String areaKey = Constant.BUS_SIZE_IN + areaCode + ":" + today;
String areaKey = Constant.BUS_SIZE_OUT + areaCode + ":" + today;
Integer size = (Integer) valueOperations.get(areaKey);
if (null == size) {
size = 1;
......@@ -257,13 +284,15 @@ public class RfidMessageHandler extends AbstractTesterMessageHandler {
for (PaintshopStation land : lands) {
valueOperations.set(Constant.STATION_PREFIX + land.getCode(), land);
}
valueOperations.set(Constant.VEHICLE_PREFIX + vehicle.getCode(), vehicle);
valueOperations.set(Constant.VEHICLE_PREFIX + vehicleCode, vehicle);
return;
}
}
}
valueOperations.set(Constant.VEHICLE_PREFIX + vehicleCode, vehicle);
//若为涂装首工位上车, 且为焊装刚刚过来的, 此时无法从工位列表中找到滑撬信息, 所以单独处理
if (vehicleCode.equals(Constant.TUZHUANG_VEHICLE1_RFID)){
valueOperations.set(Constant.VEHICLE_PREFIX + vehicle.getCode(), vehicle);
valueOperations.set(Constant.VEHICLE_PREFIX + vehicleCode, vehicle);
String keyW = EquipDataUtil.getTestValueKey("ROTARY_ROLLER_BED_P1");
testValueOperations.set(keyW, null == testValueOperations.get(keyW) ? 0 : ((int)testValueOperations.get(keyW)) + 1);
}
......@@ -271,10 +300,6 @@ public class RfidMessageHandler extends AbstractTesterMessageHandler {
String keyW = EquipDataUtil.getTestValueKey("ROTARY_ROLLER_BED_P2");
testValueOperations.set(keyW, null == testValueOperations.get(keyW) ? 0 : ((int)testValueOperations.get(keyW)) + 1);
}
if (vehicleCode.equals("rfid68") || vehicleCode.equals("rfid69")){
String keyW = EquipDataUtil.getTestValueKey("ROTARY_ROLLER_BED_C");
testValueOperations.set(keyW, null == testValueOperations.get(keyW) ? 0 : ((int)testValueOperations.get(keyW)) + 1);
}
// // TODO: 2019-11-02 获得正反转信息,以及相邻的工位
// Integer land = vehicle.getLane();
......
......@@ -86,6 +86,7 @@ public class MesWorkOrderJob extends QuartzJobBean {
for (MesWorkOrderInfo info : query){
List<MesWorkOrderInfo> orderNo = mapper.findList(new WhereFilter() {{
addFilter("work_order_no", Operation.EQUAL, info.getWorkOrderNo());
addFilter("status", Operation.EQUAL, 4);
}}, MesWorkOrderInfo.class);
if (CollecUtils.isEmpty(orderNo)){
mapper.insert(info);
......
......@@ -16,4 +16,16 @@ public class EquipDataUtil {
.append(equipCode)
.toString();
}
/**
* 喷涂室数据
* @param equipCode
* @return
*/
public static String getSprayValueKey(String equipCode) {
return new StringBuilder()
.append("spray:tem:")
.append(equipCode)
.toString();
}
}
......@@ -127,6 +127,13 @@ quartz.job.taskInfos[28].jobDescription=\u70d8\u5e72\u5ba4Job
quartz.job.taskInfos[28].cronExpression=0 0/1 * * * ?
quartz.job.taskInfos[28].start=true
#打磨室
quartz.job.taskInfos[38].jobName=net.vtstar.zhongtong.avi.gateway.painting.job.PolishingRoomStateJob
quartz.job.taskInfos[38].jobGroup=PolishingRoomStateJob
quartz.job.taskInfos[38].jobDescription=\u6253\u78e8\u5ba4Job
quartz.job.taskInfos[38].cronExpression=0 0/1 * * * ?
quartz.job.taskInfos[38].start=true
#VOC处理平台
quartz.job.taskInfos[27].jobName=net.vtstar.zhongtong.avi.gateway.painting.job.VocMachineJob
quartz.job.taskInfos[27].jobGroup=VocMachineJob
......@@ -155,6 +162,13 @@ quartz.job.taskInfos[31].jobDescription=\u7535\u6cf3\u6574\u6d41Job
quartz.job.taskInfos[31].cronExpression=0 0/5 * * * ?
quartz.job.taskInfos[31].start=true
#电泳
quartz.job.taskInfos[39].jobName=net.vtstar.zhongtong.avi.gateway.painting.job.ElectrophoresisMachineJob
quartz.job.taskInfos[39].jobGroup=ElectrophoresisMachineJob
quartz.job.taskInfos[39].jobDescription=\u7535\u6cf3\u6574\u6d41Job
quartz.job.taskInfos[39].cronExpression=0 0/1 * * * ?
quartz.job.taskInfos[39].start=true
#底盘车间(CHASSIS)
#底盘智能扭力扳手
quartz.job.taskInfos[15].jobName=net.vtstar.zhongtong.avi.gateway.chassis.job.ChassisTorqueMachineJob
......@@ -270,11 +284,18 @@ quartz.job.taskInfos[24].jobDescription=\u76d1\u63a7\u0041\u0056\u0049Job
quartz.job.taskInfos[24].cronExpression=0/10 * * * * ?
quartz.job.taskInfos[24].start=true
#avi 刷新报警信号
quartz.job.taskInfos[37].jobName=net.vtstar.zhongtong.avi.monitoring.job.AviWarningJob
quartz.job.taskInfos[37].jobGroup=AviWarningJob
quartz.job.taskInfos[37].jobDescription=\u62a5\u8b66\u4fe1\u53f7Job
quartz.job.taskInfos[37].cronExpression=0/30 * * * * ?
quartz.job.taskInfos[37].start=true
#mes 工单同步
quartz.job.taskInfos[26].jobName=net.vtstar.zhongtong.avi.sqlserver.job.MesWorkOrderJob
quartz.job.taskInfos[26].jobGroup=MesWorkOrderJob
quartz.job.taskInfos[26].jobDescription=\u004d\u0045\u0053\u5de5\u5355\u540c\u6b65Job
quartz.job.taskInfos[26].cronExpression=0 0/15 * * * ?
quartz.job.taskInfos[26].cronExpression=0 0/30 * * * ?
quartz.job.taskInfos[26].start=true
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="net.vtstar.zhongtong.avi.gateway.painting.mapper.ElectrophoresisMapper">
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="net.vtstar.zhongtong.avi.gateway.painting.mapper.RotaryRollerBedMapper">
</mapper>
\ 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