Commit dfb42cdc authored by 喻训浩's avatar 喻训浩

fix: avi修改

parent a3990d04
......@@ -43,7 +43,7 @@ public class MesWorkOrderInfo {
@Column(name = "vehicle_model")
private String vehicleModel;
@Show(label = "订单数量")
@Show(label = "订单数量")
@ApiModelProperty(notes = "订单数量")
@Column(name = "order_quantity")
private Integer orderQuantity;
......
......@@ -19,8 +19,8 @@ import java.util.List;
* @Author: xiadongwei
* @Date: 2019/11/4 18:55
*/
@Component
@Order(99)
//@Component
//@Order(99)
public class SprayBoothListener implements CommandLineRunner {
@Autowired
......
......@@ -47,4 +47,9 @@ public class CacheConfig {
Cache skidCache(ConcurrentMapCacheManager cacheManager) {
return cacheManager.getCache("skidCache");
}
@Bean
Cache webStationCache(ConcurrentMapCacheManager cacheManager) {
return cacheManager.getCache("webStationCache");
}
}
......@@ -2,10 +2,20 @@ package net.vtstar.zhongtong.avi.global.constant;
public class Constant {
public static long totalSize = 0;
public static long totalTimeOut = 0;
public static final String SKID_PREFIX = "skid:";
public static final String STATION_PREFIX = "station:";
//进车数统计
public static final String BUS_SIZE_IN = "BUS:IN";
//进车数统计
public static final String BUS_SIZE_OUT = "BUS:OUT";
public static final String HANZHUANG_VEHICLE1_RFID = "rfid68";
public static final String HANZHUANG_VEHICLE2_RFID = "rfid69";
......
package net.vtstar.zhongtong.avi.monitoring.domain;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Table;
@ApiModel("过站信息")
@Data
@Table(name = "vehicle_passing_info")
public class StationPassInfo {
@Column(name = "VIN")
private String VIN;
@Column(name = "rfid")
private String rfid;
@Column(name = "area_no")
private String areaNo;
@Column(name = "station_no")
private String stationNo;
@Column(name = "inTime")
private String in_time;
@Column(name = "outTime")
private String out_time;
}
......@@ -87,6 +87,7 @@ public class AVIMonitorJob extends GatherJob {
List<List<EquipDataTemplateItem>> lists = modbusService.groupByAddress(templateItemList);
for (List<EquipDataTemplateItem> itemList : lists) {
Constant.totalSize ++;
total = total + 1;
EquipDataTemplateItem startTemplate = itemList.get(0);
......@@ -109,15 +110,13 @@ public class AVIMonitorJob extends GatherJob {
response = modbusService.readInputRegister(slaveId, poolKey, startAddress, count);
}
} catch (Exception e) {
log.info("读取失败。ip{},端口{},slave{},start{}", poolKey.getHost(), poolKey.getPort(), slaveId, startAddress);
log.error("读取失败。ip{}, 端口{}, slave{}, start{}", poolKey.getHost(), poolKey.getPort(), slaveId, startAddress);
continue;
}
long end = System.currentTimeMillis();
log.debug("readTime:" + (end - start));
log.debug("___");
log.debug("slaveID:" + slaveId + " start:" + startAddress + " count:" + count + " functionCode:" + startTemplate.getFunctionCode());
log.debug("slaveID:" + slaveId + " start:" + startAddress + " count:" + count + " functionCode:" + startTemplate.getFunctionCode());
if (null == response) {
log.error("读取异常!");
error++;
......@@ -128,6 +127,7 @@ public class AVIMonitorJob extends GatherJob {
errorTotal++;
String error1 = response.getError();
if (error1.contains("秒内与对端连接")) {
Constant.totalTimeOut ++ ;
timeout++;
log.error("超时次数!:" + timeout);
}
......@@ -192,11 +192,10 @@ public class AVIMonitorJob extends GatherJob {
log.debug("error" + error);
log.debug("timeout" + timeout);
long l1 = System.currentTimeMillis();
log.debug("time:" + (l1 - l) / 1000);
log.debug("time:" + (l1 - l) / 1000) ;
// stationCache.put("station", stationMap);
// hashOperations.putAll("station", stationMap);
log.error("Constant size" + Constant.totalSize);
log.error("Constant timeout" + Constant.totalTimeOut);
}
}
package net.vtstar.zhongtong.avi.monitoring.job;
import lombok.extern.slf4j.Slf4j;
import net.vtstar.scada.base.gather.job.GatherJob;
import net.vtstar.zhongtong.avi.equipment.domain.PaintshopArea;
import net.vtstar.zhongtong.avi.equipment.domain.PaintshopStation;
import net.vtstar.zhongtong.avi.global.constant.Constant;
import net.vtstar.zhongtong.avi.monitoring.domain.enums.BusType;
import net.vtstar.zhongtong.avi.monitoring.domain.enums.DateType;
import net.vtstar.zhongtong.avi.monitoring.domain.vo.CarStatisticsVO;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Component;
import org.springframework.cache.Cache;
import javax.annotation.Resource;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@Slf4j
@Component
public class RedisToCacheJob extends GatherJob {
public static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy:MM:dd");
@Resource(name = "redisTemplate")
private ValueOperations valueOperations;
@Resource(name = "redisTemplate")
private RedisTemplate redisTemplate;
@Resource(name = "webStationCache")
private Cache webStationCache;
@Override
protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
log.info("______________");
log.info("RedisToCacheJob start");
Set<String> keys = redisTemplate.keys(Constant.STATION_PREFIX + "*");
List<PaintshopStation> stations = new ArrayList<>();
for (String key : keys) {
PaintshopStation station = (PaintshopStation) valueOperations.get(key);
stations.add(station);
}
Map<Long, List<PaintshopStation>> listMap = stations.stream().collect(Collectors.groupingBy(PaintshopStation::getAreaId));
Calendar instance = Calendar.getInstance();
String today = dateFormat.format(instance.getTime());
instance.add(Calendar.DATE, -1);
String previous = dateFormat.format(instance.getTime());
List<CarStatisticsVO> vos = new ArrayList<>();
addStatistics(today, vos, "0", DateType.TODAY);
addStatistics(previous, vos, "0", DateType.YESTERDAY);
List<PaintshopArea> areas = webStationCache.get("stationList", ArrayList.class);
for (PaintshopArea area : areas) {
Long id = area.getId();
List<PaintshopStation> stationList = listMap.get(id);
Map<String, PaintshopStation> collect = stationList.stream().collect(Collectors.toMap(PaintshopStation::getCode, sta -> sta, (key1, key2) -> key1));
area.setStationMap(collect);
addStatistics(today, vos, area.getCode(), DateType.TODAY);
}
webStationCache.put("busSta", vos);
webStationCache.put("stationList", areas);
}
private void addStatistics(String today, List<CarStatisticsVO> vos, String code, DateType dateType) {
CarStatisticsVO vo = new CarStatisticsVO();
vo.setAreaNo(code);
Integer todaySize = (Integer) valueOperations.get(Constant.BUS_SIZE_IN + code + ":" + today);
vo.setDateType(dateType);
if (null == todaySize) {
vo.setSize(BigDecimal.ZERO);
} else {
vo.setSize(BigDecimal.valueOf(todaySize));
}
vo.setBusType(BusType.IN);
CarStatisticsVO out = new CarStatisticsVO();
out.setAreaNo(code);
Integer todayOut = (Integer) valueOperations.get(Constant.BUS_SIZE_OUT + code + ":" + today);
out.setDateType(dateType);
if (null == todayOut) {
out.setSize(BigDecimal.ZERO);
} else {
out.setSize(BigDecimal.valueOf(todayOut));
}
out.setBusType(BusType.OUT);
vos.add(vo);
vos.add(out);
}
}
package net.vtstar.zhongtong.avi.monitoring.mapper;
import net.vtstar.user.mybatis.BaseMapper;
import net.vtstar.zhongtong.avi.monitoring.domain.StationPassInfo;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface StationPassInfoMapper extends BaseMapper<StationPassInfo> {
}
......@@ -7,10 +7,13 @@ import net.vtstar.user.search.service.SearchService;
import net.vtstar.zhongtong.avi.equipment.domain.PaintshopArea;
import net.vtstar.zhongtong.avi.equipment.domain.PaintshopLane;
import net.vtstar.zhongtong.avi.equipment.domain.PaintshopStation;
import net.vtstar.zhongtong.avi.equipment.mapper.PaintshopAreaMapper;
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;
import net.vtstar.zhongtong.avi.monitoring.domain.enums.ProductionType;
import net.vtstar.zhongtong.avi.monitoring.domain.enums.StationState;
import net.vtstar.zhongtong.avi.monitoring.mapper.SkidMapper;
import net.vtstar.zhongtong.avi.monitoring.mapper.VehicleMapper;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -37,6 +40,9 @@ public class ReadStationToCacheRunner implements CommandLineRunner {
private Cache vehicleCache;
@Resource(name = "laneStationCache")
private Cache laneStationCache;
@Resource(name = "webStationCache")
private Cache webStationCache;
@Resource(name = "redisTemplate")
protected HashOperations hashOperations;
@Resource(name = "redisTemplate")
......@@ -49,10 +55,18 @@ public class ReadStationToCacheRunner implements CommandLineRunner {
private VehicleMapper vehicleMapper;
@Autowired
private SkidMapper skidMapper;
@Autowired
private PaintshopAreaMapper areaMapper;
@Override
public void run(String... args) throws Exception {
// PaintshopStation paintshopStation = (PaintshopStation) valueOperations.get(Constant.STATION_PREFIX + "HDG1-13");
// Skid skid = new Skid();
// skid.setBusNo("eeee");
// skid.setBusType(ProductionType.OWN);
// paintshopStation.setState(StationState.USE);
// paintshopStation.setSkid(skid);
// valueOperations.set("station:HDG1-13",paintshopStation);
List<PaintshopStation> stations = stationMapper.findList(new WhereFilter() {{
addJoin(PaintshopStation.class, "area_id", PaintshopArea.class, "id");
......@@ -64,6 +78,10 @@ public class ReadStationToCacheRunner implements CommandLineRunner {
stationCache.put(station.getCode(),station);
// station.setTurnF(false);
// station.setTurnR(false);
// station.setArrive(false);
// station.setBusType(ProductionType.OWN);
// station.setBusNo("eee");
// station.setState(StationState.USE);
// valueOperations.set(Constant.STATION_PREFIX + station.getCode() ,station);
}
Map<String, List<PaintshopStation>> stationMap = stations.stream().filter(sta -> sta.getLaneCode() != null).collect(Collectors.groupingBy(PaintshopStation::getLaneCode));
......@@ -87,5 +105,7 @@ public class ReadStationToCacheRunner implements CommandLineRunner {
// for (PaintshopStation station : stations) {
// stationCache.put(station.getCode(), station);
// }
List<PaintshopArea> list = areaMapper.findList(new WhereFilter(), PaintshopArea.class);
webStationCache.put("stationList",list);
}
}
package net.vtstar.zhongtong.avi.monitoring.service;
import net.vtstar.user.mybatis.provider.Operation;
import net.vtstar.user.mybatis.provider.WhereFilter;
import net.vtstar.zhongtong.avi.equipment.domain.MesWorkOrderInfo;
import net.vtstar.zhongtong.avi.equipment.domain.PaintshopArea;
import net.vtstar.zhongtong.avi.equipment.domain.PaintshopStation;
import net.vtstar.zhongtong.avi.global.constant.Constant;
import net.vtstar.zhongtong.avi.equipment.mapper.MesWorkOrderMapper;
import net.vtstar.zhongtong.avi.monitoring.domain.Bus;
import net.vtstar.zhongtong.avi.monitoring.domain.vo.CarStatisticsVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.cache.Cache;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@Service
public class AreaService {
......@@ -21,14 +28,88 @@ public class AreaService {
protected ValueOperations valueOperations;
@Resource(name = "redisTemplate")
private RedisTemplate redisTemplate;
@Resource(name = "webStationCache")
private Cache webStationCache;
@Autowired
private MesWorkOrderMapper workOrderMapper;
public List<PaintshopArea> getInfoByAreaNo(String areaNo) {
List<PaintshopArea> areas = new ArrayList<>();
Set keys = redisTemplate.keys(Constant.STATION_PREFIX + "*");
for (Object key : keys) {
PaintshopStation station = (PaintshopStation) valueOperations.get(key);
List<PaintshopArea> areas = webStationCache.get("stationList", ArrayList.class);
if (null != areaNo) {
for (PaintshopArea area : areas) {
if (areaNo.equals(area.getCode())) {
ArrayList<PaintshopArea> paintshopAreas = new ArrayList<>();
paintshopAreas.add(area);
return paintshopAreas;
}
}
} else {
return areas;
}
return null;
return areas;
}
public List<PaintshopArea> findBusLocation(String orderNo, String workOrderNo) {
List<PaintshopArea> ar = new ArrayList<>();
List<String> nos = new ArrayList<>();
if (null != orderNo){
List<MesWorkOrderInfo> info = workOrderMapper.findList(new WhereFilter() {{
addFilter("sales_order_no", Operation.EQUAL, orderNo);
}}, MesWorkOrderInfo.class);
nos = info.stream().map(MesWorkOrderInfo::getWorkOrderNo).distinct().collect(Collectors.toList());
}
else {
nos.add(workOrderNo);
}
List<PaintshopArea> areas = webStationCache.get("stationList", ArrayList.class);
for (PaintshopArea area : areas) {
PaintshopArea paintshopArea = area;
Map<String, PaintshopStation> newMap = new HashMap<>();
Map<String, PaintshopStation> map = area.getStationMap();
for (Map.Entry<String, PaintshopStation> entry : map.entrySet()) {
PaintshopStation value = entry.getValue();
String key = entry.getKey();
for (String no : nos) {
if (value.getBusNo().equals(no)){
newMap.put(key,value);
}
}
}
paintshopArea.setStationMap(newMap);
ar.add(paintshopArea);
}
return ar;
}
public Bus getByBusNo(String busNo) {
List<MesWorkOrderInfo> info = workOrderMapper.findList(new WhereFilter() {{
addFilter("work_order_no", Operation.EQUAL, busNo);
}}, MesWorkOrderInfo.class);
if (CollectionUtils.isEmpty(info)){
return null;
}
else {
MesWorkOrderInfo orderInfo = info.get(0);
Bus bus = new Bus();
bus.setBusType(orderInfo.getVehicleModel());
bus.setLine(orderInfo.getProductionLine());
bus.setOrderSize(new BigDecimal(orderInfo.getOrderQuantity()));
bus.setUnit(orderInfo.getUnit());
bus.setShop(orderInfo.getWorkshop());
bus.setPlanOrderNo(orderInfo.getMasterWorkOrderNo());
bus.setSaleOrderNo(orderInfo.getSalesOrderNo());
bus.setCode(orderInfo.getWorkOrderNo());
return bus;
}
}
public List<CarStatisticsVO> getBusSta() {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy:MM:dd");
Calendar instance = Calendar.getInstance();
String format = dateFormat.format(instance.getTime());
List<CarStatisticsVO> sta = webStationCache.get("busSta", ArrayList.class);
return sta;
}
}
......@@ -13,10 +13,12 @@ import net.vtstar.zhongtong.avi.equipment.domain.RuntimeRecord;
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.StationPassInfo;
import net.vtstar.zhongtong.avi.monitoring.domain.Vehicle;
import net.vtstar.zhongtong.avi.monitoring.domain.bo.MQTTMessageBO;
import net.vtstar.zhongtong.avi.monitoring.domain.enums.ProductionType;
import net.vtstar.zhongtong.avi.monitoring.domain.enums.StationState;
import net.vtstar.zhongtong.avi.monitoring.mapper.StationPassInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.Cache;
import org.springframework.data.redis.core.HashOperations;
......@@ -28,13 +30,11 @@ import org.springframework.messaging.MessageHeaders;
import org.springframework.messaging.MessagingException;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import springfox.documentation.spring.web.json.Json;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@Slf4j
@Component
......@@ -42,6 +42,8 @@ public class RfidMessageHandler extends AbstractTesterMessageHandler {
public static MQTTMessageBO messageBO = new MQTTMessageBO();
public static SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
public static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy:MM:dd");
@Autowired
private RedisTemplate redisTemplate;
......@@ -68,22 +70,29 @@ public class RfidMessageHandler extends AbstractTesterMessageHandler {
private ModbusTemplate modbusTemplate;
@Autowired
private PaintshopStationMapper stationMapper;
@Autowired
private StationPassInfoMapper passInfoMapper;
public RfidMessageHandler() {
super("translation", "data/all");
}
@Override
public void handleMessage(Message<?> message) throws MessagingException
{
public void handleMessage(Message<?> message) throws MessagingException {
Date date = new Date();
Object payload = message.getPayload();
JSONObject json = JSONObject.parseObject(payload.toString());
String id = json.getString("ID");
Integer state = json.getIntValue("State");
String today = dateFormat.format(date);
//存rfid log日志
messageBO.setID(id);
messageBO.setState(state);
messageBO.setCreateDate(format.format(new Date()));
String currentDate = format.format(date);
messageBO.setCreateDate(currentDate);
MessageHeaders headers = message.getHeaders();
String vehicleCode = headers.get(MqttConstants.MSG_HEADER_KEY_EQUIPMENTNUMBER, String.class);
......@@ -109,6 +118,13 @@ public class RfidMessageHandler extends AbstractTesterMessageHandler {
skid.setBusType(ProductionType.OWN);
valueOperations.set(Constant.SKID_PREFIX + id, skid);
}
String format = dateFormat.format(date);
String key = Constant.BUS_SIZE_IN + "0:" + format;
Integer size = (Integer) valueOperations.get(key);
if (null == size) {
size = 0;
}
valueOperations.set(key, size);
return;
}
if (null == skid) {
......@@ -144,7 +160,6 @@ public class RfidMessageHandler extends AbstractTesterMessageHandler {
return;
}
List<PaintshopStation> collect = arriveList.stream().filter(sta -> (sta.getTurnF() != null && sta.getTurnR() != null)).collect(Collectors.toList());
Map<String, List<PaintshopStation>> listMap = collect.stream().collect(Collectors.groupingBy(PaintshopStation::getLandNo));
......@@ -168,8 +183,8 @@ public class RfidMessageHandler extends AbstractTesterMessageHandler {
} else {
PaintshopStation sta = stations.get(0);
// if (state == 1 && (sta.getTurnR() && )){
}}
}
}
Long laneId = sourceStation.getLaneId();
vehicle.setCurrentRfid(id);
......@@ -193,6 +208,9 @@ public class RfidMessageHandler extends AbstractTesterMessageHandler {
}
String currentRfid = vehicle.getCurrentRfid();
vehicle.setCurrentRfid(null);
//记录过站数及信息
savePassInfo(today, currentDate, skid, sourceStation);
} else if (state == 0) {
List<PaintshopStation> stations = new ArrayList<>();
for (PaintshopStation station : stations) {
......@@ -206,6 +224,44 @@ public class RfidMessageHandler extends AbstractTesterMessageHandler {
PaintshopStation station = new PaintshopStation();
station.setState(StationState.FREE);
station.setSkidID(null);
//记录过站数及信息
String areaCode = sourceStation.getAreaId().toString();
String key = Constant.BUS_SIZE_IN + areaCode + ":" + today;
Integer size = (Integer) valueOperations.get(key);
if (null == size) {
size = 0;
} else {
size++;
}
valueOperations.set(key, size);
List<StationPassInfo> list = passInfoMapper.findList(new WhereFilter() {{
addFilter("area_no", Operation.EQUAL, areaCode);
addFilter("out_time", Operation.IS, "null");
}}, StationPassInfo.class);
if (CollectionUtils.isEmpty(list)){
}
}
}
private void savePassInfo(String today, String currentDate, Skid skid, PaintshopStation sourceStation) {
String key = Constant.BUS_SIZE_OUT + sourceStation.getAreaId().toString() + ":" + today;
Integer size = (Integer) valueOperations.get(key);
if (null == size) {
size = 0;
} else {
size++;
}
valueOperations.set(key, size);
StationPassInfo info = new StationPassInfo();
info.setAreaNo(sourceStation.getAreaId().toString());
info.setRfid(skid.getRfid());
info.setVIN(skid.getBusNo());
info.setIn_time(currentDate);
info.setStationNo(sourceStation.getCode());
passInfoMapper.insert(info);
}
}
......@@ -2,5 +2,5 @@ modbus.tcp.netty.thread-num=200
modbus.tcp.netty.pool.max-connections=10
modbus.tcp.netty.option.so-keep-alive=true
modbus.tcp.netty.max-frame-length=260
modbus.tcp.netty.idle-state.reader-time-millis=3000
modbus.tcp.netty.idle-state.reader-time-millis=4000
modbus.tcp.netty.event-executor-group.thread-num=64
......@@ -203,8 +203,8 @@ quartz.job.taskInfos[20].start=false
quartz.job.taskInfos[24].jobName=net.vtstar.zhongtong.avi.monitoring.job.AVIMonitorJob
quartz.job.taskInfos[24].jobGroup=AVIMonitorJob
quartz.job.taskInfos[24].jobDescription=\u76d1\u63a7\u0041\u0056\u0049Job
quartz.job.taskInfos[24].cronExpression=0 0/3 * * * ?
quartz.job.taskInfos[24].start=true
quartz.job.taskInfos[24].cronExpression=0/20 * * * * ?
quartz.job.taskInfos[24].start=false
#mes 工单同步
quartz.job.taskInfos[26].jobName=net.vtstar.zhongtong.avi.sqlserver.job.MesWorkOrderJob
......@@ -214,6 +214,13 @@ quartz.job.taskInfos[26].cronExpression=0/10 * * * * ?
quartz.job.taskInfos[26].start=false
#mavi 刷新工位信息
quartz.job.taskInfos[27].jobName=net.vtstar.zhongtong.avi.monitoring.job.RedisToCacheJob
quartz.job.taskInfos[27].jobGroup=RedisToCacheJob
quartz.job.taskInfos[27].jobDescription=\u0041\u0056\u0049\u5de5\u4f4d\u4fe1\u606f\u540c\u6b65Job
quartz.job.taskInfos[27].cronExpression=0/15 * * * * ?
quartz.job.taskInfos[27].start=true
#quartz.job.taskInfos[8].jobName=net.vtstar.scada.base.equipmgt.job.CleanEquipStatusJob
##quartz.job.taskInfos[8].jobGroup=CleanEquipStatusJob
##quartz.job.taskInfos[8].jobDescription=\u6E05\u6D17\u8BBE\u5907\u72B6\u6001Job
......
......@@ -24,7 +24,7 @@ spring.messages.use-code-as-default-message=true
# JOB
gatherTestDataJob=true
# \u97E9\u56FD\u6D4B\u8BD5\u673A\u8F6F\u91C7\u670D\u52A1\u5668
# \u97E9\u56FD\u6D4B\u8BD5\u673A\u8F6F\u91C7\u670IDataListenerD\u52A1\u5668
soft.gather.korea-tester.ip=172.16.0.253
soft.gather.korea-tester.port=10001
......
......@@ -6,13 +6,19 @@ import net.vtstar.scada.base.equipmgt.mapper.EquipDataTemplateItemMapper;
import net.vtstar.user.mybatis.provider.WhereFilter;
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.enums.ProductionType;
import net.vtstar.zhongtong.avi.monitoring.domain.enums.StationState;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;
......@@ -28,6 +34,8 @@ public class StationTest {
private PaintshopStationMapper stationMapper;
@Autowired
private EquipDataTemplateItemMapper itemMapper;
@Resource(name = "redisTemplate")
private ValueOperations valueOperations;
@Test
public void test() {
......@@ -82,18 +90,13 @@ public class StationTest {
@Test
public void tt(){
ArrayList<PaintshopStation> stations = new ArrayList<>();
PaintshopStation station = new PaintshopStation();
station.setTurnR(true);
station.setTurnF(false);
PaintshopStation station2 = new PaintshopStation();
station2.setTurnR(true);
station2.setTurnF(false);
stations.add(station);
stations.add(station2);
List<PaintshopStation> collect = stations.stream().filter(sta -> sta.getTurnF() != null).collect(Collectors.toList());
int a =1;
PaintshopStation paintshopStation = (PaintshopStation) valueOperations.get(Constant.STATION_PREFIX + "HDG1-13");
Skid skid = new Skid();
skid.setBusNo("eeee");
skid.setBusType(ProductionType.OWN);
paintshopStation.setState(StationState.USE);
paintshopStation.setSkid(skid);
valueOperations.set("station:HDG1-13",paintshopStation);
}
}
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