update远程升级接口

This commit is contained in:
2023-07-24 16:44:03 +08:00
parent 7dce806203
commit a0fc6ccdf3
2 changed files with 5 additions and 8 deletions

View File

@@ -1,19 +1,16 @@
package com.jsowell.web.controller.pile; package com.jsowell.web.controller.pile;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.jsowell.common.constant.Constants;
import com.jsowell.common.core.domain.AjaxResult; import com.jsowell.common.core.domain.AjaxResult;
import com.jsowell.common.enums.ykc.OrderPayModeEnum;
import com.jsowell.common.enums.ykc.PayModeEnum;
import com.jsowell.common.enums.ykc.ReturnCodeEnum; import com.jsowell.common.enums.ykc.ReturnCodeEnum;
import com.jsowell.common.exception.BusinessException; import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.util.StringUtils;
import com.jsowell.common.util.id.IdUtils; import com.jsowell.common.util.id.IdUtils;
import com.jsowell.pile.dto.GenerateOrderDTO; import com.jsowell.pile.dto.GenerateOrderDTO;
import com.jsowell.pile.dto.PayOrderDTO;
import com.jsowell.pile.dto.QueryPileDTO; import com.jsowell.pile.dto.QueryPileDTO;
import com.jsowell.pile.dto.UpdateFirmwareDTO; import com.jsowell.pile.dto.UpdateFirmwareDTO;
import com.jsowell.service.OrderService;
import com.jsowell.pile.service.PileRemoteService; import com.jsowell.pile.service.PileRemoteService;
import com.jsowell.service.OrderService;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@@ -131,6 +128,9 @@ public class PileRemoteController {
if (CollectionUtils.isEmpty(dto.getPileSns())) { if (CollectionUtils.isEmpty(dto.getPileSns())) {
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR); throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
} }
if (StringUtils.isBlank(dto.getFirmwareId())) {
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
}
pileRemoteService.updateFirmware(dto); pileRemoteService.updateFirmware(dto);
result = AjaxResult.success(); result = AjaxResult.success();
} catch (BusinessException e) { } catch (BusinessException e) {

View File

@@ -192,9 +192,6 @@ public class PileRemoteService {
* 远程更新 * 远程更新
*/ */
public void updateFirmware(UpdateFirmwareDTO dto) { public void updateFirmware(UpdateFirmwareDTO dto) {
if (StringUtils.isBlank(dto.getFirmwareId())) {
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
}
PileFirmwareInfo pileFirmwareInfo = pileFirmwareInfoService.selectPileFirmwareInfoById(Long.valueOf(dto.getFirmwareId())); PileFirmwareInfo pileFirmwareInfo = pileFirmwareInfoService.selectPileFirmwareInfoById(Long.valueOf(dto.getFirmwareId()));
if (pileFirmwareInfo == null) { if (pileFirmwareInfo == null) {
throw new BusinessException(ReturnCodeEnum.CODE_FIRMWARE_NOT_FOUND_ERROR); throw new BusinessException(ReturnCodeEnum.CODE_FIRMWARE_NOT_FOUND_ERROR);