|
|
@ -298,14 +298,18 @@ public class DcDeviceServiceImpl extends ServiceImpl<DcDeviceMapper, DcDevice> i |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<DcDevice> devicePileNumberQueryDevice(Map<String, List> parameter) { |
|
|
|
public List<DcDevice> devicePileNumberQueryDevice(Map<String, Object> parameter) { |
|
|
|
ArrayList<DcDevice> dcDevices = new ArrayList<>(); |
|
|
|
Integer startStakeMark = Integer.parseInt(String.valueOf(parameter.get("startStakeMark").get(0)) + String.valueOf(parameter.get("startStakeMark").get(1))); |
|
|
|
Integer endStakeMark = Integer.parseInt(String.valueOf(parameter.get("endStakeMark").get(0)) + String.valueOf(parameter.get("endStakeMark").get(1))); |
|
|
|
List<String> startStakeMarks = castList(parameter.get("startStakeMark"), String.class); |
|
|
|
List<String> endStakeMarks = castList(parameter.get("endStakeMark"), String.class); |
|
|
|
String deviceType = String.valueOf(parameter.get("deviceType")); |
|
|
|
Integer startStakeMark = Integer.parseInt(startStakeMarks.get(0) + startStakeMarks.get(1)); |
|
|
|
Integer endStakeMark = Integer.parseInt(endStakeMarks.get(0) + endStakeMarks.get(1)); |
|
|
|
LambdaQueryWrapper<DcDevice> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
ArrayList<Integer> integers = new ArrayList<>(); |
|
|
|
integers.add(6); |
|
|
|
lambdaQueryWrapper.notIn(DcDevice::getDeviceType,integers); |
|
|
|
lambdaQueryWrapper.notIn(DcDevice::getDeviceType, integers); |
|
|
|
lambdaQueryWrapper.eq(DcDevice::getDeviceType, deviceType); |
|
|
|
List<DcDevice> list = list(lambdaQueryWrapper); |
|
|
|
for (DcDevice dcDevice : list) { |
|
|
|
String stakeMark = dcDevice.getStakeMark(); |
|
|
@ -336,5 +340,16 @@ public class DcDeviceServiceImpl extends ServiceImpl<DcDeviceMapper, DcDevice> i |
|
|
|
|
|
|
|
return dcDevices; |
|
|
|
} |
|
|
|
|
|
|
|
public static <T> List<T> castList(Object obj, Class<T> clazz) { |
|
|
|
List<T> result = new ArrayList<T>(); |
|
|
|
if (obj instanceof List<?>) { |
|
|
|
for (Object o : (List<?>) obj) { |
|
|
|
result.add(clazz.cast(o)); |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|