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

fix: avi修改

parent 321d6c73
......@@ -8,6 +8,7 @@ import net.vtstar.user.search.Search;
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 net.vtstar.zhongtong.avi.monitoring.domain.vo.StationPos;
import org.hibernate.validator.constraints.Length;
import javax.persistence.Column;
......@@ -52,12 +53,17 @@ public class PaintshopStation implements Serializable {
private Long laneId;
@ApiModelProperty(notes = "车道编号")
//@JoinColumn(tableName = PaintshopLane.class, name = "lane_code")
@Column(name = "vehicle_lane_code")
@Search
private String laneCode;
@ApiModelProperty(notes = "从上至下车道号")
@Column(name = "lane_no")
@Search
private String landNo;
@ApiModelProperty(notes = "平移车道编号")
@Column(name = "vehicle_lane_code")
//@Column(name = "vehicle_lane_code")
@Search
private String vehicleLaneCode;
......@@ -107,4 +113,10 @@ public class PaintshopStation implements Serializable {
@ApiModelProperty(notes = "工位正转", hidden = true)
private Boolean turnF;
@ApiModelProperty(notes = "工艺流向", hidden = true)
private Boolean flow;
@ApiModelProperty(notes = "工位平移车位置", hidden = true)
private StationPos pos;
}
......@@ -30,7 +30,8 @@ public class PretreamentMachineJob extends GatherJob {
@Override
public boolean handleObject(EquipmentData equipmentData) {
PretreatmentMachine data = (PretreatmentMachine) equipmentData;
Integer state = data.getStatus();
// Integer state = data.getStatus();
Integer state = 1;
if (state != null && state ==1) {
return false;
}
......
......@@ -30,7 +30,8 @@ public class AutomaticSpotWeldingMachineJob extends GatherJob {
@Override
public boolean handleObject(EquipmentData equipmentData) {
AutomaticSpotWeldingMachine data = (AutomaticSpotWeldingMachine) equipmentData;
Integer state = data.getStatus();
// Integer state = data.getStatus();
Integer state = 1;
if (state != null && state == 0) {
return false;
}
......
......@@ -30,7 +30,8 @@ public class PlcControlTireMachine2Job extends GatherJob {
@Override
public boolean handleObject(EquipmentData equipmentData) {
PlcControlTireMachine2 data = (PlcControlTireMachine2) equipmentData;
Integer state = data.getStatus();
// Integer state = data.getStatus();
Integer state = 1;
if (state != null && state == 0) {
return false;
}
......
......@@ -10,9 +10,11 @@ public class Constant {
public static final String HANZHUANG_VEHICLE2_RFID = "rfid69";
public static final String HANZHUANG_VEHICLE1_BUSNO_KEY = "HZC1";
//焊装平移车道1车身号
public static final String HANZHUANG_VEHICLE1_BUSNO_KEY = "HZC1:";
public static final String HANZHUANG_VEHICLE2_BUSNO_KEY = "HZC2";
//焊装平移车道2车身号
public static final String HANZHUANG_VEHICLE2_BUSNO_KEY = "HZC2:";
//redis平移车信号到位
public static final String VEHICLE_PREFIX = "VEHICLE:STATE";
......
......@@ -12,6 +12,8 @@ import net.vtstar.zhongtong.avi.monitoring.domain.enums.DateType;
import net.vtstar.zhongtong.avi.monitoring.domain.enums.ProductionType;
import net.vtstar.zhongtong.avi.monitoring.domain.enums.StationState;
import net.vtstar.zhongtong.avi.monitoring.domain.vo.CarStatisticsVO;
import net.vtstar.zhongtong.avi.monitoring.service.AreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
......@@ -29,10 +31,15 @@ import java.util.Map;
@RequestMapping("/area")
public class AreaController {
@Autowired
private AreaService areaService;
@ApiOperation(value = "根据区域编号查询区域实时信息", response = PaintshopArea.class, responseContainer = "List",notes = "区域编号:\r\n" +
"整体区域:0\r\n钣金:1\r\n电泳:2\r\n密封防腐:3\r\n腻子:4\r\n中涂:5\r\n面/色漆:6\r\n成品:7")
@GetMapping("/areaInfo/realTime")
private Return getAreaInfo(@RequestParam(value = "areaNo",required = false) String areaNo) {
List<PaintshopArea> areas2 = areaService.getInfoByAreaNo(areaNo);
List<PaintshopArea> areas = new ArrayList<>();
PaintshopArea area = new PaintshopArea();
area.setCode("2");
......
......@@ -2,8 +2,6 @@ package net.vtstar.zhongtong.avi.monitoring.domain.bo;
import lombok.Data;
import java.util.Date;
@Data
public class MQTTMessageBO {
......
package net.vtstar.zhongtong.avi.monitoring.domain.vo;
/**
*工位位于平移车位置
*/
public enum StationPos {
LEFT,
RIGHT;
}
......@@ -56,7 +56,14 @@ public class AVIMonitorJob extends GatherJob {
// Map<String, PaintshopStation> stationMap = hashOperations.entries("station");
// Map<String, Vehicle> vehicleMap = hashOperations.entries("vehicle_signal");
equipInfoList.forEach(equipInfo -> {
long l = System.currentTimeMillis();
int total = 0;
int error = 0;
int timeout = 0;
int errorTotal = 0;
for (EquipInfo equipInfo : equipInfoList) {
List<EquipCommunication> commList = equipInfoService.getCommunicationList(equipInfo.getEquipCode(), 1);
if (CollectionUtils.isEmpty(commList)) {
return;
......@@ -80,12 +87,17 @@ public class AVIMonitorJob extends GatherJob {
List<List<EquipDataTemplateItem>> lists = modbusService.groupByAddress(templateItemList);
for (List<EquipDataTemplateItem> itemList : lists) {
total = total + 1;
EquipDataTemplateItem startTemplate = itemList.get(0);
Integer startAddress = startTemplate.getAddress();
Integer endAddress = itemList.get(itemList.size() - 1).getAddress();
Integer quantity = itemList.get(itemList.size() - 1).getLength();
Integer count = endAddress + quantity - startAddress;
AbstractModbusResponse response = null;
long start = System.currentTimeMillis();
try {
if (1 == startTemplate.getFunctionCode()) {
response = modbusService.readCoilRegister(slaveId, poolKey, startAddress, count);
......@@ -100,14 +112,26 @@ public class AVIMonitorJob extends GatherJob {
log.info("读取失败。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());
if (null == response) {
log.error("读取异常!");
error++;
log.error("异常次数!:" + error);
continue;
}
if (!response.isSuccess()) {
log.error(response.getError());
errorTotal++;
String error1 = response.getError();
if (error1.contains("秒内与对端连接")) {
timeout++;
log.error("超时次数!:" + timeout);
}
log.error(error1);
continue;
}
......@@ -160,7 +184,17 @@ public class AVIMonitorJob extends GatherJob {
}
}
}
});
}
;
log.debug("_________________________________________________");
log.debug("_________________________________________________");
log.debug("total" + total);
log.debug("error" + error);
log.debug("timeout" + timeout);
long l1 = System.currentTimeMillis();
log.debug("time:" + (l1 - l) / 1000);
// stationCache.put("station", stationMap);
// hashOperations.putAll("station", stationMap);
}
......
......@@ -8,6 +8,7 @@ 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.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.mapper.SkidMapper;
......@@ -17,6 +18,7 @@ import org.springframework.boot.CommandLineRunner;
import org.springframework.cache.Cache;
import org.springframework.core.annotation.Order;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
......@@ -37,7 +39,8 @@ public class ReadStationToCacheRunner implements CommandLineRunner {
private Cache laneStationCache;
@Resource(name = "redisTemplate")
protected HashOperations hashOperations;
@Resource(name = "redisTemplate")
protected ValueOperations valueOperations;
@Autowired
private SearchService searchService;
@Autowired
......@@ -54,14 +57,16 @@ public class ReadStationToCacheRunner implements CommandLineRunner {
List<PaintshopStation> stations = stationMapper.findList(new WhereFilter() {{
addJoin(PaintshopStation.class, "area_id", PaintshopArea.class, "id");
addJoin(PaintshopStation.class, "lane_id", PaintshopLane.class, "id");
addOrderBy(PaintshopStation.class, "sequence", OrderBy.ASC);
addOrderBy(PaintshopStation.class, "id", OrderBy.ASC);
}}, PaintshopStation.class);
for (PaintshopStation station : stations) {
stationCache.put(station.getCode(),station);
// station.setTurnF(false);
// station.setTurnR(false);
// valueOperations.set(Constant.STATION_PREFIX + station.getCode() ,station);
}
Map<String, List<PaintshopStation>> stationMap = stations.stream().filter(sta -> sta.getVehicleLaneCode() != null).collect(Collectors.groupingBy(PaintshopStation::getVehicleLaneCode));
Map<String, List<PaintshopStation>> stationMap = stations.stream().filter(sta -> sta.getLaneCode() != null).collect(Collectors.groupingBy(PaintshopStation::getLaneCode));
for (Map.Entry<String, List<PaintshopStation>> entry : stationMap.entrySet()) {
laneStationCache.put(entry.getKey(),entry.getValue());
}
......
package net.vtstar.zhongtong.avi.monitoring.service;
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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
@Service
public class AreaService {
@Resource(name = "redisTemplate")
protected ValueOperations valueOperations;
@Resource(name = "redisTemplate")
private RedisTemplate redisTemplate;
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);
}
return null;
}
}
package net.vtstar.zhongtong.avi.monitoring.service;
import net.vtstar.zhongtong.avi.equipment.domain.PaintshopStation;
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 org.springframework.data.redis.core.HashOperations;
......@@ -7,7 +9,10 @@ import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service
public class PDAService {
......@@ -17,12 +22,28 @@ public class PDAService {
@Resource(name = "redisTemplate")
protected ValueOperations valueOperations;
public static void main(String[] args) {
boolean a =true;
boolean b =false;
boolean c =false;
boolean d =true;
System.out.println(a & b);
System.out.println(a & d);
System.out.println(b&&c);
}
//钣金上车绑定
public void bound(String vehicleNo, String busNo) {
// TODO: 2019-11-02 判断车身工单号是否在计划中
valueOperations.set(vehicleNo, busNo);
if (vehicleNo.equals("HZC1")){
valueOperations.set(Constant.HANZHUANG_VEHICLE1_BUSNO_KEY + "rfid68", busNo);
}
if (vehicleNo.equals("HZC2")){
valueOperations.set(Constant.HANZHUANG_VEHICLE1_BUSNO_KEY + "rfid69", busNo);
}
}
}
......@@ -15,6 +15,7 @@ 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.bo.MQTTMessageBO;
import net.vtstar.zhongtong.avi.monitoring.domain.enums.ProductionType;
import net.vtstar.zhongtong.avi.monitoring.domain.enums.StationState;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.Cache;
......@@ -33,13 +34,14 @@ import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@Slf4j
@Component
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 format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@Autowired
private RedisTemplate redisTemplate;
......@@ -72,7 +74,8 @@ public class RfidMessageHandler extends AbstractTesterMessageHandler {
}
@Override
public void handleMessage(Message<?> message) throws MessagingException {
public void handleMessage(Message<?> message) throws MessagingException
{
Object payload = message.getPayload();
JSONObject json = JSONObject.parseObject(payload.toString());
......@@ -84,104 +87,125 @@ public class RfidMessageHandler extends AbstractTesterMessageHandler {
MessageHeaders headers = message.getHeaders();
String vehicleCode = headers.get(MqttConstants.MSG_HEADER_KEY_EQUIPMENTNUMBER, String.class);
log.info(vehicleCode + "______" + json.toJSONString());
listOperations.rightPush("rfid:log:" + vehicleCode,messageBO);
// Map<String, Vehicle> vehicleMap = hashOperations.entries("vehicle");
//
// Skid skid = (Skid) valueOperations.get(Constant.SKID_PREFIX + id);
// if (vehicleCode.equals(Constant.HANZHUANG_VEHICLE1_RFID) || vehicleCode.equals(Constant.HANZHUANG_VEHICLE1_RFID)) {
// String busNo = (String) valueOperations.get(vehicleCode);
// skid.setBusNo(busNo);
// valueOperations.set(Constant.SKID_PREFIX + id, skid);
// }
// Vehicle vehicle = vehicleMap.get(vehicleCode);
// if (null == vehicle) {
// vehicle = vehicleCache.get(vehicleCode, Vehicle.class);
// }
// // TODO: 2019-11-02 获得正反转信息,以及相邻的工位
// Integer land = vehicle.getLane();
// Set<String> keys = redisTemplate.keys(Constant.STATION_PREFIX + land + ":*");
//
// List<PaintshopStation> arriveList = new ArrayList<>();
//
// List<PaintshopStation> stationList = laneStationCache.get(land.toString(), ArrayList.class);
// for (PaintshopStation station : stationList) {
// String code = station.getCode();
// PaintshopStation sta = (PaintshopStation) valueOperations.get(Constant.STATION_PREFIX + code);
// if (null == sta) {
// sta = stationCache.get(code, PaintshopStation.class);
// }
// if (null == sta.getArrive()) {
// continue;
// }
// if (sta.getArrive()) {
// arriveList.add(sta);
// }
// }
// if (CollectionUtils.isEmpty(stationList)) {
// log.error("找不到对平移车到位信号! 平移车 id:{},滑撬 {}", vehicle.getCode(), id);
// return;
// }
//
// Map<String, List<PaintshopStation>> listMap = stationList.stream().filter(sta -> sta.getTurnF() != null && sta.getTurnR() !=null)
// .collect(Collectors.groupingBy(PaintshopStation::getLaneCode));
//
// PaintshopStation sourceStation = new PaintshopStation();
//
// if (listMap.size() > 1) {
// Set<String> veKeys = redisTemplate.keys(Constant.VEHICLE_PREFIX);
// if (CollectionUtils.isEmpty(veKeys) || veKeys.size() != listMap.size()) {
// log.error("平移车读写信号数量:{} 与 到位信号数量不一致!{}", veKeys.size(), listMap.size());
// return;
// }
// for (String veKey : veKeys) {
// Vehicle v = (Vehicle) valueOperations.get(veKey);
// }
// } else {
// List<PaintshopStation> stations = listMap.get(0);
// if (stations.size() == 1) {
// sourceStation = stations.get(0);
// } else {
// }
// }
//
// Long laneId = sourceStation.getLaneId();
//
// vehicle.setCurrentRfid(id);
// StationState oldState = null;
// String oldSkidId = null;
// if (state == 1) {
// //获得正反转信息,得到平移车相邻工位信息
// List<PaintshopStation> stations;
// stations = stationMapper.findList(new WhereFilter() {{
// addFilter(PaintshopStation.class, "lane_id", Operation.EQUAL, laneId);
// addOrderBy(RuntimeRecord.class, "sequence", OrderBy.DESC);
// }}, PaintshopStation.class);
//
// for (PaintshopStation station : stations) {
// station.setOldState(oldState);
// station.setSkidID(oldSkidId);
// oldState = station.getState();
// oldSkidId = station.getSkidID();
// station.setState(StationState.USE);
// station.setSkidID(id);
// }
// String currentRfid = vehicle.getCurrentRfid();
// vehicle.setCurrentRfid(null);
// } else if (state == 0) {
// List<PaintshopStation> stations = new ArrayList<>();
// for (PaintshopStation station : stations) {
// station.setOldState(oldState);
// station.setSkidID(oldSkidId);
// oldState = station.getState();
// oldSkidId = station.getSkidID();
// station.setState(StationState.FREE);
// station.setSkidID(id);
// }
// PaintshopStation station = new PaintshopStation();
// station.setState(StationState.FREE);
// station.setSkidID(null);
// }
log.info(vehicleCode + "______" + json.toJSONString() + " code:" + vehicleCode);
listOperations.rightPush("rfid:log:" + vehicleCode, messageBO);
Map<String, Vehicle> vehicleMap = hashOperations.entries("vehicle");
if (id.equals("A61A0000000000000000000000000")) {
log.error("读写头错误!");
return;
}
Skid skid = (Skid) valueOperations.get(Constant.SKID_PREFIX + id);
if (state == 1 && (vehicleCode.equals(Constant.HANZHUANG_VEHICLE1_RFID) || vehicleCode.equals(Constant.HANZHUANG_VEHICLE1_RFID))) {
String busNo = (String) valueOperations.get(Constant.HANZHUANG_VEHICLE1_BUSNO_KEY + vehicleCode);
if (null == busNo) {
log.error("未录入PDA车身号! :" + vehicleCode);
return;
}
if (null == skid) {
skid = new Skid();
skid.setRfid(id);
skid.setBusNo(busNo);
skid.setBusType(ProductionType.OWN);
valueOperations.set(Constant.SKID_PREFIX + id, skid);
}
return;
}
if (null == skid) {
log.error("无滑撬信息! :" + vehicleCode);
return;
}
Vehicle vehicle = vehicleMap.get(vehicleCode);
if (null == vehicle) {
vehicle = vehicleCache.get(vehicleCode, Vehicle.class);
}
// TODO: 2019-11-02 获得正反转信息,以及相邻的工位
Integer land = vehicle.getLane();
//Set<String> keys = redisTemplate.keys(Constant.STATION_PREFIX + land + ":*");
List<PaintshopStation> arriveList = new ArrayList<>();
List<PaintshopStation> stationList = laneStationCache.get(land.toString(), ArrayList.class);
for (PaintshopStation station : stationList) {
String code = station.getCode();
PaintshopStation sta = (PaintshopStation) valueOperations.get(Constant.STATION_PREFIX + code);
if (null == sta) {
sta = stationCache.get(code, PaintshopStation.class);
}
if (null == sta.getArrive()) {
continue;
}
if (sta.getArrive()) {
arriveList.add(sta);
}
}
if (CollectionUtils.isEmpty(arriveList)) {
log.error("找不到对平移车到位信号! 平移车 id:{},滑撬 {}", vehicle.getCode(), id);
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));
PaintshopStation sourceStation = new PaintshopStation();
if (CollectionUtils.isEmpty(listMap)) {
return;
}
if (listMap.size() > 1) {
Set<String> veKeys = redisTemplate.keys(Constant.VEHICLE_PREFIX);
if (CollectionUtils.isEmpty(veKeys) || veKeys.size() != listMap.size()) {
log.error("平移车读写信号数量:{} 与 到位信号数量不一致!{}", veKeys.size(), listMap.size());
return;
}
for (String veKey : veKeys) {
Vehicle v = (Vehicle) valueOperations.get(veKey);
}
} else {
List<PaintshopStation> stations = listMap.get(0);
if (stations.size() == 1) {
sourceStation = stations.get(0);
} else {
PaintshopStation sta = stations.get(0);
// if (state == 1 && (sta.getTurnR() && )){
}}
Long laneId = sourceStation.getLaneId();
vehicle.setCurrentRfid(id);
StationState oldState = null;
String oldSkidId = null;
if (state == 1) {
//获得正反转信息,得到平移车相邻工位信息
List<PaintshopStation> stations;
stations = stationMapper.findList(new WhereFilter() {{
addFilter(PaintshopStation.class, "lane_id", Operation.EQUAL, laneId);
addOrderBy(RuntimeRecord.class, "sequence", OrderBy.DESC);
}}, PaintshopStation.class);
for (PaintshopStation station : stations) {
station.setOldState(oldState);
station.setSkidID(oldSkidId);
oldState = station.getState();
oldSkidId = station.getSkidID();
station.setState(StationState.USE);
station.setSkidID(id);
}
String currentRfid = vehicle.getCurrentRfid();
vehicle.setCurrentRfid(null);
} else if (state == 0) {
List<PaintshopStation> stations = new ArrayList<>();
for (PaintshopStation station : stations) {
station.setOldState(oldState);
station.setSkidID(oldSkidId);
oldState = station.getState();
oldSkidId = station.getSkidID();
station.setState(StationState.FREE);
station.setSkidID(id);
}
PaintshopStation station = new PaintshopStation();
station.setState(StationState.FREE);
station.setSkidID(null);
}
}
}
......@@ -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/20 * * * * ?
quartz.job.taskInfos[24].start=false
quartz.job.taskInfos[24].cronExpression=0 0/3 * * * ?
quartz.job.taskInfos[24].start=true
#mes 工单同步
quartz.job.taskInfos[26].jobName=net.vtstar.zhongtong.avi.sqlserver.job.MesWorkOrderJob
......
......@@ -14,7 +14,9 @@ import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@Slf4j
@RunWith(SpringRunner.class)
......@@ -77,4 +79,21 @@ public class StationTest {
stationMapper.insert(station);
}
}
@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;
}
}
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