充电桩远程升级

This commit is contained in:
2023-04-06 16:32:41 +08:00
parent 263970c1e0
commit b3bbc21a82
8 changed files with 47 additions and 33 deletions

View File

@@ -9,7 +9,7 @@ import com.jsowell.netty.command.ykc.PublishPileBillingTemplateCommand;
import com.jsowell.netty.command.ykc.RebootCommand;
import com.jsowell.netty.command.ykc.StartChargingCommand;
import com.jsowell.netty.command.ykc.StopChargingCommand;
import com.jsowell.netty.command.ykc.UpdateFileCommand;
import com.jsowell.netty.command.ykc.UpdateFirmwareCommand;
import com.jsowell.netty.service.yunkuaichong.YKCPushCommandService;
import com.jsowell.pile.domain.PileBillingRelation;
import com.jsowell.pile.domain.PileBillingTemplate;
@@ -186,9 +186,9 @@ public class PileRemoteService {
*
* @param pileSns 前台传的桩号集合
*/
public void updateFile(List<String> pileSns) {
public void updateFirmware(List<String> pileSns) {
//
UpdateFileCommand command = UpdateFileCommand.builder().pileSnList(pileSns).build();
UpdateFirmwareCommand command = UpdateFirmwareCommand.builder().pileSnList(pileSns).build();
ykcPushCommandService.pushUpdateFileCommand(command);
}
}

View File

@@ -7,19 +7,18 @@ import com.jsowell.pile.dto.GenerateOrderDTO;
import com.jsowell.pile.dto.QueryPileDTO;
import com.jsowell.service.OrderService;
import com.jsowell.service.PileRemoteService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.text.ParseException;
/**
* 远程控制controller
*/
@RestController
@RequestMapping("/remote")
@RequestMapping("/pile/remote")
public class PileRemoteController {
@Autowired
@@ -30,7 +29,7 @@ public class PileRemoteController {
/**
* 获取实时上传数据
* http://localhost:8080/remote/getRealTimeMonitorData
* http://localhost:8080/pile/remote/getRealTimeMonitorData
* @return
*/
@PostMapping("/getRealTimeMonitorData")
@@ -41,7 +40,7 @@ public class PileRemoteController {
/**
* 远程重启
* http://localhost:8080/remote/reboot
* http://localhost:8080/pile/remote/reboot
* @return
*/
@PostMapping("/reboot")
@@ -52,7 +51,7 @@ public class PileRemoteController {
/**
* 后管-远程启动充电
* http://localhost:8080/remote/remoteStartChargingForWeb
* http://localhost:8080/pile/remote/remoteStartChargingForWeb
*/
@PostMapping("/remoteStartChargingForWeb")
public AjaxResult remoteStartCharging(@RequestBody GenerateOrderDTO dto) {
@@ -70,7 +69,7 @@ public class PileRemoteController {
/**
* 远程停止充电
* http://localhost:8080/remote/remoteStopCharging
* http://localhost:8080/pile/remote/remoteStopCharging
* @param dto
* @return
*/
@@ -82,7 +81,7 @@ public class PileRemoteController {
/**
* 远程下发二维码
* http://localhost:8080/remote/issueQRCode
* http://localhost:8080/pile/remote/issueQRCode
*/
@PostMapping("/issueQRCode")
public AjaxResult issueQRCode(@RequestBody QueryPileDTO queryPileDTO) {
@@ -92,7 +91,7 @@ public class PileRemoteController {
/**
* 对时
* http://localhost:8080/remote/proofreadTime
* http://localhost:8080/pile/remote/proofreadTime
*/
@PostMapping("/proofreadTime")
public AjaxResult proofreadTime(@RequestBody QueryPileDTO queryPileDTO) {
@@ -102,12 +101,15 @@ public class PileRemoteController {
/**
* 远程升级
* http://localhost:8080/remote/updateFile
* http://localhost:8080/pile/remote/updateFirmware
* @return
*/
@PostMapping("/updateFile")
public AjaxResult updateFile(@RequestBody QueryPileDTO queryPileDTO) {
pileRemoteService.updateFile(queryPileDTO.getPileSns());
@PostMapping("/updateFirmware")
public AjaxResult updateFirmware(@RequestBody QueryPileDTO queryPileDTO) {
if (CollectionUtils.isEmpty(queryPileDTO.getPileSns())) {
return AjaxResult.error("参数不能为空");
}
pileRemoteService.updateFirmware(queryPileDTO.getPileSns());
return AjaxResult.success();
}

View File

@@ -546,7 +546,7 @@ public class SpringBootTestController {
public void testRemoteUpdate() {
ArrayList<String> list = new ArrayList<>();
list.add("88000000000001");
pileRemoteService.updateFile(list);
pileRemoteService.updateFirmware(list);
}
@Test