From 287a115f0006cc7ed4d5bd8b6418d89d46be9db5 Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期五, 26 七月 2024 13:39:51 +0800
Subject: [PATCH] 优化代码
---
service-common/src/main/java/com/java110/common/cmd/chargeMachine/ListChargeMachinePortCmd.java | 32 +++++---------------------------
1 files changed, 5 insertions(+), 27 deletions(-)
diff --git a/service-common/src/main/java/com/java110/common/cmd/chargeMachine/ListChargeMachinePortCmd.java b/service-common/src/main/java/com/java110/common/cmd/chargeMachine/ListChargeMachinePortCmd.java
index 3ced3e9..632e93d 100644
--- a/service-common/src/main/java/com/java110/common/cmd/chargeMachine/ListChargeMachinePortCmd.java
+++ b/service-common/src/main/java/com/java110/common/cmd/chargeMachine/ListChargeMachinePortCmd.java
@@ -21,6 +21,7 @@
import com.java110.core.event.cmd.Cmd;
import com.java110.core.event.cmd.CmdEvent;
import com.java110.intf.common.IChargeMachinePortV1InnerServiceSMO;
+import com.java110.intf.job.IIotInnerServiceSMO;
import com.java110.utils.exception.CmdException;
import com.java110.utils.util.Assert;
import com.java110.utils.util.BeanConvertUtil;
@@ -52,7 +53,7 @@
private static Logger logger = LoggerFactory.getLogger(ListChargeMachinePortCmd.class);
@Autowired
- private IChargeMachinePortV1InnerServiceSMO chargeMachinePortV1InnerServiceSMOImpl;
+ private IIotInnerServiceSMO iotInnerServiceSMOImpl;
@Override
public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
@@ -64,36 +65,13 @@
@Override
public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
- ChargeMachinePortDto chargeMachinePortDto = BeanConvertUtil.covertBean(reqJson, ChargeMachinePortDto.class);
- int count = chargeMachinePortV1InnerServiceSMOImpl.queryChargeMachinePortsCount(chargeMachinePortDto);
-
- List<ChargeMachinePortDto> chargeMachinePortDtos = null;
-
- if (count > 0) {
- chargeMachinePortDtos = chargeMachinePortV1InnerServiceSMOImpl.queryChargeMachinePorts(chargeMachinePortDto);
-
- //璋冪敤 绗笁鏂规煡璇� 鎻掓Ы鐘舵��
- // queryPortState(chargeMachinePortDtos);
- } else {
- chargeMachinePortDtos = new ArrayList<>();
- }
-
- ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, chargeMachinePortDtos);
-
+ reqJson.put("iotApiCode", "listChargeMachinePortBmoImpl");
+ ResultVo resultVo = iotInnerServiceSMOImpl.postIot(reqJson);
ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
cmdDataFlowContext.setResponseEntity(responseEntity);
}
-// private void queryPortState(List<ChargeMachinePortDto> chargeMachinePortDtos) {
-// if (chargeMachinePortDtos == null || chargeMachinePortDtos.size() < 1) {
-// return;
-//
-// }
-//
-// for (ChargeMachinePortDto chargeMachinePortDto : chargeMachinePortDtos) {
-// chargeMachinePortDto.setStateName("绌洪棽");
-// }
-// }
+
}
--
Gitblit v1.8.0