|
|
@ -11,6 +11,7 @@ import com.ruoyi.common.utils.PageUtils; |
|
|
|
import com.ruoyi.common.utils.StakeMarkUtils; |
|
|
|
import com.zc.business.constant.RedisKeyConstants; |
|
|
|
import com.zc.business.domain.DcDevice; |
|
|
|
import com.zc.business.domain.DcEvent; |
|
|
|
import com.zc.business.domain.DcProduct; |
|
|
|
import com.zc.business.domain.DcStakeMark; |
|
|
|
import com.zc.business.domain.MdDevice; |
|
|
@ -365,6 +366,52 @@ public class DcDeviceServiceImpl extends ServiceImpl<DcDeviceMapper, DcDevice> i |
|
|
|
return dcDeviceMapper.selectDcDeviceList(dcDevice); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 根据事件数据查询可用设备 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<DcDevice> deviceListByEvent(DcEvent dcEvent, String deviceType) { |
|
|
|
// 事件方向 1
|
|
|
|
String direction = dcEvent.getDirection(); |
|
|
|
// 事件桩号 K086+285
|
|
|
|
dcEvent.setStakeMark(dcEvent.getStakeMark().replace(UniversalEnum.CAPITAL_K.getValue(), UniversalEnum.EMPTY_STRING.getValue())); |
|
|
|
String[] markArray = dcEvent.getStakeMark().split(UniversalEnum.BARRE_PLUS.getValue()); |
|
|
|
if (markArray[UniversalEnum.ONE.getNumber()].length() < UniversalEnum.THREE.getNumber()) { |
|
|
|
// 不足三位 补零
|
|
|
|
markArray[UniversalEnum.ONE.getNumber()] = String.format("%0" + UniversalEnum.THREE.getNumber() + "d", markArray[UniversalEnum.ONE.getNumber()]); |
|
|
|
} |
|
|
|
List<String> start = new ArrayList<>(); |
|
|
|
List<String> end = new ArrayList<>(); |
|
|
|
Map<String, Object> parameter = new HashMap<>(); |
|
|
|
parameter.put("deviceType", deviceType); |
|
|
|
// 根据桩号和方向确定设备的范围
|
|
|
|
if (direction.equals("1") || direction.equals("菏泽方向")) { |
|
|
|
// 菏泽方向
|
|
|
|
start.add(UniversalEnum.FIFTY_FIVE.getValue()); |
|
|
|
start.add(UniversalEnum.THREE_HUNDRED_SEVENTY_NINE.getValue()); |
|
|
|
end.add(markArray[UniversalEnum.ZERO.getNumber()]); |
|
|
|
end.add(markArray[UniversalEnum.ONE.getNumber()]); |
|
|
|
}else { |
|
|
|
// 济南方向
|
|
|
|
start.add(markArray[UniversalEnum.ZERO.getNumber()]); |
|
|
|
start.add(markArray[UniversalEnum.ONE.getNumber()]); |
|
|
|
end.add(UniversalEnum.TWO_HUNDRED_AND_EIGHT.getValue()); |
|
|
|
end.add(UniversalEnum.ONE_HUNDRED_AND_FIFTY_FOUR.getValue()); |
|
|
|
} |
|
|
|
parameter.put("startStakeMark", start); |
|
|
|
parameter.put("endStakeMark", end); |
|
|
|
parameter.put("useState",UniversalEnum.ONE.getNumber()); |
|
|
|
parameter.put("deviceState", UniversalEnum.ONE.getValue()); |
|
|
|
List<DcDevice> dcDeviceList = devicePileNumberQueryDevice(parameter); |
|
|
|
Collections.sort(dcDeviceList, new Comparator<DcDevice>() { |
|
|
|
@Override |
|
|
|
public int compare(DcDevice o1, DcDevice o2) { |
|
|
|
return o1.getStakeMark().compareTo(o2.getStakeMark()); |
|
|
|
} |
|
|
|
}); |
|
|
|
return dcDeviceList; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 批量修改设备 |
|
|
|
* |
|
|
|