| | |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.A5OrderEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.mainboard.MainBoardInvokeSyncService; |
| | | import com.sandu.ximon.admin.param.LightControlParam; |
| | | import com.sandu.ximon.admin.param.LightPowerSettingParam; |
| | | import com.sandu.ximon.admin.param.LightRemarkParam; |
| | | import com.sandu.ximon.admin.redis.LightKey; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | |
| | | return CommonPage.restPage(list); |
| | | } |
| | | |
| | | public boolean setPower(List<Long> ids, Integer power1, Integer power2) { |
| | | List<Light> lights = listByIds(ids); |
| | | public boolean setPower(LightPowerSettingParam lightPowerSettingParam) { |
| | | if (lightPowerSettingParam.getLightIds().size() == 0) { |
| | | throw new BusinessException("灯杆ID不能为空"); |
| | | } |
| | | List<Light> lights = listByIds(lightPowerSettingParam.getLightIds()); |
| | | lights.forEach(light -> { |
| | | light.setPower1(power1); |
| | | light.setPower2(power2); |
| | | light.setPower1(lightPowerSettingParam.getPower1()); |
| | | light.setPower2(lightPowerSettingParam.getPower2()); |
| | | light.setLightCount(lightPowerSettingParam.getLightCount()); |
| | | } |
| | | ); |
| | | return updateBatchById(lights); |