|
@@ -283,21 +283,27 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
return R.fail("设备不存在");
|
|
|
}
|
|
|
DeviceStatusDto.Vo deviceStatus = deviceInfo.getDeviceStatus();
|
|
|
- SysDictRedis sysDictRedis = SysDictUtils.get(EnumDeviceFaultLevelPayThreshold.Code.CODE.getCode(), EnumDeviceFaultLevelPayThreshold.NOT_PAY.getCode());
|
|
|
- if (deviceInfo.getFaultLevel() >= Integer.valueOf(sysDictRedis.getValue())) {
|
|
|
- return R.fail("设备故障");
|
|
|
- }
|
|
|
- check(deviceStatus.getNetState(), 2, "设备已离线");
|
|
|
- if (!deviceStatus.getIsPay()) {
|
|
|
- return R.fail("设备不可交易");
|
|
|
- }
|
|
|
- check(obj.getDoor() != null && obj.getDoor() == 1 ? deviceStatus.getDoorStateR() : deviceStatus.getDoorStateL(), 1, "设备正在使用中,请稍后");
|
|
|
- //质检用户不检查
|
|
|
SysDictRedis qualitySets = SysDictUtils.get(EnumQualityMercSets.Code.CODE.getCode(), EnumQualityMercSets.MERC_CODE.getCode());
|
|
|
+ //设备当前商户是质检时不检查
|
|
|
if (!qualitySets.getValue().equals(deviceInfo.getMercCode())) {
|
|
|
+ SysDictRedis activeStatus = SysDictUtils.get(EnumDeviceActiveStatus.Code.CODE.getCode(), EnumDeviceActiveStatus.N_2.getCode());
|
|
|
+ check(deviceInfo.getActiveState(), activeStatus.getValue(), "设备未激活");
|
|
|
check(deviceInfo.getFreezeStatus(), 2, "设备已冻结");
|
|
|
check(obj.getDoor() != null && obj.getDoor() == 1 ? deviceStatus.getLockStateR() : deviceStatus.getLockStateL(), 2, "设备已锁机");
|
|
|
+ if (!deviceStatus.getIsPay()) {
|
|
|
+ return R.fail("设备不可交易");
|
|
|
+ }
|
|
|
+ SysDictRedis sdr = SysDictUtils.get(EnumDeviceBusyStatus.Code.CODE.getCode(), EnumDeviceBusyStatus.N_2.getCode());
|
|
|
+ if (deviceInfo.getBusyState().intValue() == Integer.valueOf(sdr.getValue()).intValue()) {
|
|
|
+ return R.fail("设备已停运");
|
|
|
+ }
|
|
|
+ SysDictRedis sysDictRedis = SysDictUtils.get(EnumDeviceFaultLevelPayThreshold.Code.CODE.getCode(), EnumDeviceFaultLevelPayThreshold.NOT_PAY.getCode());
|
|
|
+ if (deviceInfo.getFaultLevel() >= Integer.valueOf(sysDictRedis.getValue())) {
|
|
|
+ return R.fail("设备故障");
|
|
|
+ }
|
|
|
}
|
|
|
+ check(deviceStatus.getNetState(), 2, "设备已离线");
|
|
|
+ check(obj.getDoor() != null && obj.getDoor() == 1 ? deviceStatus.getDoorStateR() : deviceStatus.getDoorStateL(), 1, "设备正在使用中,请稍后");
|
|
|
return R.ok(deviceInfo);
|
|
|
}
|
|
|
|