diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcStopChargingOrderController.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcStopChargingOrderController.java new file mode 100644 index 00000000..3de42e69 --- /dev/null +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcStopChargingOrderController.java @@ -0,0 +1,49 @@ +package com.xhpc.order.controller; + +import com.xhpc.common.core.web.controller.BaseController; +import com.xhpc.common.core.web.domain.AjaxResult; +import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.order.api.XhpcChargeOrderController; +import com.xhpc.order.service.IXhpcStopChargingOrderService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + + +/** + * program: ruoyi + * User: HongYun + * Date:2021-09-07 15 + */ +@RestController +@RequestMapping(value = "/stopChargingOrder") +public class XhpcStopChargingOrderController extends BaseController { + + @Autowired + private IXhpcStopChargingOrderService iXhpcStopChargingOrderService; + + @Autowired + private XhpcChargeOrderController xhpcChargeOrderController; + + @GetMapping("/list") + public TableDataInfo list(Long userId, Long chargingStationId, Long terminalId){ + + startPage(); + return getDataTable(iXhpcStopChargingOrderService.list(userId, chargingStationId, terminalId)); + } + + /** + * 停止充电 + * @param userId + * @param serialNumber 终端编码 + * @param chargingOrderId 充电id + * @return + */ + @GetMapping("/stopUp") + public AjaxResult stopUp(@RequestParam Long userId, @RequestParam String terminalSerialNumber, @RequestParam Long chargingOrderId){ + + return xhpcChargeOrderController.stopUp(userId, terminalSerialNumber, chargingOrderId); + } +} diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcStopChargingOrderMapper.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcStopChargingOrderMapper.java new file mode 100644 index 00000000..91bc0012 --- /dev/null +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcStopChargingOrderMapper.java @@ -0,0 +1,16 @@ +package com.xhpc.order.mapper; + +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * program: ruoyi + * User: HongYun + * Date:2021-09-07 15 + */ +public interface XhpcStopChargingOrderMapper { + + List> list(@Param("userId")Long userId, @Param("chargingStationId") Long chargingStationId, @Param("terminalId") Long terminalId); +} diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcStopChargingOrderService.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcStopChargingOrderService.java new file mode 100644 index 00000000..edd7273c --- /dev/null +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcStopChargingOrderService.java @@ -0,0 +1,14 @@ +package com.xhpc.order.service; + +import java.util.List; +import java.util.Map; + +/** + * program: ruoyi + * User: HongYun + * Date:2021-09-07 15 + */ +public interface IXhpcStopChargingOrderService { + + List> list(Long userId, Long chargingStationId, Long terminalId); +} diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcStopChargingOrderServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcStopChargingOrderServiceImpl.java new file mode 100644 index 00000000..6999bfc7 --- /dev/null +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcStopChargingOrderServiceImpl.java @@ -0,0 +1,28 @@ +package com.xhpc.order.service.impl; + +import com.xhpc.order.mapper.XhpcStopChargingOrderMapper; +import com.xhpc.order.service.IXhpcStopChargingOrderService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +/** + * program: ruoyi + * User: HongYun + * Date:2021-09-07 15 + */ +@Service +public class XhpcStopChargingOrderServiceImpl implements IXhpcStopChargingOrderService { + + + @Autowired + private XhpcStopChargingOrderMapper xhpcStopChargingOrderMapper; + + @Override + public List> list(Long userId, Long chargingStationId, Long terminalId) { + + return xhpcStopChargingOrderMapper.list(userId, chargingStationId, terminalId); + } +} diff --git a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStopChargingMapper.xml b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStopChargingMapper.xml new file mode 100644 index 00000000..184168a3 --- /dev/null +++ b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStopChargingMapper.xml @@ -0,0 +1,32 @@ + + + + + + + \ No newline at end of file