diff --git a/jsowell-admin/src/main/java/com/jsowell/api/uniapp/PileController.java b/jsowell-admin/src/main/java/com/jsowell/api/uniapp/PileController.java index 695d60b38..ea0f6cc8d 100644 --- a/jsowell-admin/src/main/java/com/jsowell/api/uniapp/PileController.java +++ b/jsowell-admin/src/main/java/com/jsowell/api/uniapp/PileController.java @@ -11,13 +11,13 @@ import com.jsowell.pile.dto.QueryConnectorListDTO; import com.jsowell.pile.dto.QueryStationDTO; import com.jsowell.pile.service.IPileConnectorInfoService; import com.jsowell.pile.service.IPileStationInfoService; -import com.jsowell.pile.vo.base.StationInfoVO; -import com.jsowell.pile.vo.uniapp.PersonalPileInfoVO; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; +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 javax.servlet.http.HttpServletRequest; -import java.util.List; /** * 充电桩相关接口 @@ -89,6 +89,27 @@ public class PileController extends BaseController { return response; } + /** + * 根据充电站id查询枪口列表 + * @param request + * @param dto + * @return + */ + @PostMapping("/selectStationConnectorList") + public RestApiResponse selectStationConnectorList(HttpServletRequest request, @RequestBody QueryConnectorListDTO dto) { + logger.info("查询充电枪口列表 params:{}", JSONObject.toJSONString(dto)); + RestApiResponse response = null; + try { + PageResponse pageResponse = pileConnectorInfoService.selectStationConnectorList(dto); + response = new RestApiResponse<>(pageResponse); + } catch (Exception e) { + logger.error("查询充电枪口列表异常", e); + response = new RestApiResponse<>(ReturnCodeEnum.CODE_GET_CONNECTOR_INFO_BY_STATION_ID_ERROR); + } + logger.info("查询充电枪口列表 result:{}", response); + return response; + } + } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/IPileConnectorInfoService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/IPileConnectorInfoService.java index 33aba530f..798420031 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/IPileConnectorInfoService.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/IPileConnectorInfoService.java @@ -132,4 +132,6 @@ public interface IPileConnectorInfoService { List getConnectorListForLianLian(Long stationId); List selectConnectorInfoList(String pileSn); + + PageResponse selectStationConnectorList(QueryConnectorListDTO dto); } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileConnectorInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileConnectorInfoServiceImpl.java index bd0139300..cf67c58d3 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileConnectorInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileConnectorInfoServiceImpl.java @@ -423,6 +423,12 @@ public class PileConnectorInfoServiceImpl implements IPileConnectorInfoService { return connectorInfoList; } + @Override + public PageResponse selectStationConnectorList(QueryConnectorListDTO dto) { + PageResponse response = getUniAppConnectorInfoListByParams(dto); + return response; + } + /** * 查询充电枪口的实时数据 */ @@ -448,7 +454,8 @@ public class PileConnectorInfoServiceImpl implements IPileConnectorInfoService { pileConnectorInfoVO.setChargingDegree(new BigDecimal(realTimeMonitorData.getChargingDegree())); pileConnectorInfoVO.setGunLineTemperature(realTimeMonitorData.getGunLineTemperature()); // 枪线温度 pileConnectorInfoVO.setTimeRemaining(realTimeMonitorData.getTimeRemaining()); - pileConnectorInfoVO.setChargingTime(realTimeMonitorData.getSumChargingTime()); + pileConnectorInfoVO.setChargingTime(realTimeMonitorData.getSumChargingTime()); // 已充时长 + pileConnectorInfoVO.setTimeRemaining(realTimeMonitorData.getTimeRemaining()); // 剩余时间 // 计算实时功率(单位:kw) BigDecimal instantPowerTemp = outputVoltage.multiply(outputCurrent); BigDecimal instantPower = instantPowerTemp.divide(new BigDecimal(1000)); diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/PileConnectorInfoVO.java b/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/PileConnectorInfoVO.java index 3f5fa89cb..a945ca31f 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/PileConnectorInfoVO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/PileConnectorInfoVO.java @@ -102,6 +102,11 @@ public class PileConnectorInfoVO { */ private String chargingTime; + /** + * 剩余时间 + */ + private String timeRemaining; + /** * 电压 */