| @@ -54,7 +54,8 @@ public class KwBoxController extends BaseController { | |||||
| return new ResultData(ErrorCode.DEVICE_ALREADY_EXIST); | return new ResultData(ErrorCode.DEVICE_ALREADY_EXIST); | ||||
| kwBox.setTenantId(getTenantId()); | kwBox.setTenantId(getTenantId()); | ||||
| kwBox.setStatus(EnumBoxStatus.VALID.getCode()); | kwBox.setStatus(EnumBoxStatus.VALID.getCode()); | ||||
| return kwBoxService.saveOrUpdate(kwBox); | |||||
| kwBoxService.saveOrUpdate(kwBox); | |||||
| return new ResultData(kwBox); | |||||
| } | } | ||||
| @ApiOperation("更新设备") | @ApiOperation("更新设备") | ||||
| @@ -65,7 +66,8 @@ public class KwBoxController extends BaseController { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | ||||
| if (kwBox.getId() == null) | if (kwBox.getId() == null) | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | ||||
| return kwBoxService.saveOrUpdate(kwBox); | |||||
| kwBoxService.saveOrUpdate(kwBox); | |||||
| return new ResultData(kwBox); | |||||
| } | } | ||||
| @ApiOperation("设备详情") | @ApiOperation("设备详情") | ||||
| @@ -76,7 +78,7 @@ public class KwBoxController extends BaseController { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | ||||
| KwBox kwBox = kwBoxService.getById(id); | KwBox kwBox = kwBoxService.getById(id); | ||||
| if (kwBox == null) | if (kwBox == null) | ||||
| return new ResultData(ErrorCode.SCREENAD_NOT_FOUND); | |||||
| return new ResultData(ErrorCode.DEVICE_NOT_FOUND); | |||||
| kwBox.setMeters(kwBoxService.findMeters(kwBox)); | kwBox.setMeters(kwBoxService.findMeters(kwBox)); | ||||
| return new ResultData(kwBox); | return new ResultData(kwBox); | ||||
| @@ -91,6 +93,7 @@ public class KwBoxController extends BaseController { | |||||
| KwBox kwBox = new KwBox(); | KwBox kwBox = new KwBox(); | ||||
| kwBox.setId(id); | kwBox.setId(id); | ||||
| kwBox.setStatus(EnumBoxStatus.INVALID.getCode()); | kwBox.setStatus(EnumBoxStatus.INVALID.getCode()); | ||||
| return kwBoxService.saveOrUpdate(kwBox); | |||||
| kwBoxService.saveOrUpdate(kwBox); | |||||
| return new ResultData(kwBox); | |||||
| } | } | ||||
| } | } | ||||
| @@ -35,7 +35,7 @@ public interface KwBoxCmdHistoryService { | |||||
| * | * | ||||
| * @param record | * @param record | ||||
| */ | */ | ||||
| ResultData saveOrUpdate(KwBoxCmdHistory record); | |||||
| void saveOrUpdate(KwBoxCmdHistory record); | |||||
| /** | /** | ||||
| @@ -57,7 +57,7 @@ public interface KwBoxService { | |||||
| * | * | ||||
| * @param record | * @param record | ||||
| */ | */ | ||||
| ResultData saveOrUpdate(KwBox record); | |||||
| void saveOrUpdate(KwBox record); | |||||
| /** | /** | ||||
| @@ -36,7 +36,7 @@ public interface KwMerchantMeterService { | |||||
| * | * | ||||
| * @param record | * @param record | ||||
| */ | */ | ||||
| ResultData saveOrUpdate(KwMerchantMeter record); | |||||
| void saveOrUpdate(KwMerchantMeter record); | |||||
| /** | /** | ||||
| @@ -35,7 +35,7 @@ public class KwBoxCmdHistoryServiceImpl implements KwBoxCmdHistoryService { | |||||
| @Override | @Override | ||||
| public ResultData saveOrUpdate(KwBoxCmdHistory record) { | |||||
| public void saveOrUpdate(KwBoxCmdHistory record) { | |||||
| if (record.getId() == null) { | if (record.getId() == null) { | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| record.setId(idWorker.nextId()); | record.setId(idWorker.nextId()); | ||||
| @@ -43,7 +43,6 @@ public class KwBoxCmdHistoryServiceImpl implements KwBoxCmdHistoryService { | |||||
| } else { | } else { | ||||
| kwBoxCmdHistoryMapper.updateByPrimaryKeySelective(record); | kwBoxCmdHistoryMapper.updateByPrimaryKeySelective(record); | ||||
| } | } | ||||
| return new ResultData(); | |||||
| } | } | ||||
| @@ -50,7 +50,7 @@ public class KwBoxServiceImpl implements KwBoxService { | |||||
| @Override | @Override | ||||
| public ResultData saveOrUpdate(KwBox record) { | |||||
| public void saveOrUpdate(KwBox record) { | |||||
| if (record.getId() == null) { | if (record.getId() == null) { | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| record.setId(idWorker.nextId()); | record.setId(idWorker.nextId()); | ||||
| @@ -61,7 +61,6 @@ public class KwBoxServiceImpl implements KwBoxService { | |||||
| record.setUpdateTime(new Date()); | record.setUpdateTime(new Date()); | ||||
| kwBoxMapper.updateByPrimaryKeySelective(record); | kwBoxMapper.updateByPrimaryKeySelective(record); | ||||
| } | } | ||||
| return new ResultData(); | |||||
| } | } | ||||
| @@ -46,7 +46,7 @@ public class KwMerchantMeterServiceImpl implements KwMerchantMeterService { | |||||
| @Override | @Override | ||||
| public ResultData saveOrUpdate(KwMerchantMeter record) { | |||||
| public void saveOrUpdate(KwMerchantMeter record) { | |||||
| if (record.getId() == null) { | if (record.getId() == null) { | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| record.setId(idWorker.nextId()); | record.setId(idWorker.nextId()); | ||||
| @@ -57,7 +57,6 @@ public class KwMerchantMeterServiceImpl implements KwMerchantMeterService { | |||||
| record.setUpdateTime(new Date()); | record.setUpdateTime(new Date()); | ||||
| kwMerchantMeterMapper.updateByPrimaryKeySelective(record); | kwMerchantMeterMapper.updateByPrimaryKeySelective(record); | ||||
| } | } | ||||
| return new ResultData(); | |||||
| } | } | ||||