|
@@ -779,26 +779,10 @@ public class TEquipmentController {
|
|
return R.fail(ResponseCodesEnum.A0001, "找不到设备");
|
|
return R.fail(ResponseCodesEnum.A0001, "找不到设备");
|
|
}
|
|
}
|
|
TEquipmentDesc tEquipmentDesc = equipmentDescService.getById(equipment.getId());
|
|
TEquipmentDesc tEquipmentDesc = equipmentDescService.getById(equipment.getId());
|
|
-
|
|
|
|
- Long adminId = equipment.getAdminId();
|
|
|
|
- LambdaQueryWrapper<TAdmin> wrapper = Wrappers.lambdaQuery();
|
|
|
|
- wrapper.eq(TAdmin::getId, adminId);
|
|
|
|
- TAdmin admin = tAdminService.getOne(wrapper);
|
|
|
|
- Integer type = admin.getType();
|
|
|
|
-// String ifForeign = admin.getIfForeign();
|
|
|
|
-// if (type < 2 && "0".equals(ifForeign)) {
|
|
|
|
- if (type < 2) {
|
|
|
|
- if (tEquipmentDesc != null) {
|
|
|
|
- tEquipmentService.sentMessage(equipment.getClientId(), PushUtils.buildJson("couponStatus", couponStatus).toString());
|
|
|
|
- equipment.setCouponStatus(couponStatus);
|
|
|
|
- tEquipmentService.saveOrUpdate(equipment);
|
|
|
|
- tEquipmentDesc.setCouponStatus(couponStatus);
|
|
|
|
- equipmentDescService.saveOrUpdate(tEquipmentDesc);
|
|
|
|
- } else {
|
|
|
|
- return R.fail(ResponseCodesEnum.A0001, "找不到设备描述");
|
|
|
|
- }
|
|
|
|
|
|
+ if (tEquipmentDesc != null) {
|
|
|
|
+ tEquipmentService.sentMessage(equipment.getClientId(), PushUtils.buildJson("couponStatus", couponStatus).toString());
|
|
} else {
|
|
} else {
|
|
- return R.fail("仅管理员可操作");
|
|
|
|
|
|
+ return R.fail(ResponseCodesEnum.A0001, "找不到设备");
|
|
}
|
|
}
|
|
return R.ok(null, "修改成功");
|
|
return R.ok(null, "修改成功");
|
|
}
|
|
}
|