充电中C端用户查看与停止充电功能
This commit is contained in:
parent
73a46e080a
commit
e226265865
@ -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);
|
||||
}
|
||||
}
|
||||
@ -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<Map<String,Object>> list(@Param("userId")Long userId, @Param("chargingStationId") Long chargingStationId, @Param("terminalId") Long terminalId);
|
||||
}
|
||||
@ -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<Map<String,Object>> list(Long userId, Long chargingStationId, Long terminalId);
|
||||
}
|
||||
@ -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<Map<String, Object>> list(Long userId, Long chargingStationId, Long terminalId) {
|
||||
|
||||
return xhpcStopChargingOrderMapper.list(userId, chargingStationId, terminalId);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xhpc.order.mapper.XhpcStopChargingOrderMapper">
|
||||
|
||||
|
||||
<select id="list" resultType="map">
|
||||
select cs.name as stationName,
|
||||
cs.charging_station_id as chargingStationId,
|
||||
t.terminal_id as terminalId,
|
||||
t.name as terminalName,
|
||||
o.user_id as userId,
|
||||
o.charge_order_id as chargeOrderId,
|
||||
t.serial_number as termialSerialNumber
|
||||
from xhpc_charge_order as o
|
||||
left join xhpc_charging_station as cs
|
||||
on o.charging_station_id = cs.charging_station_id
|
||||
left join xhpc_terminal as t
|
||||
on o.terminal_id = t.terminal_id
|
||||
where o.status=1
|
||||
<if test="userId!=null">
|
||||
and o.user_id = #{userId}
|
||||
</if>
|
||||
<if test="chargingStationId!=null">
|
||||
and cs.charging_station_id = #{chargingStationId}
|
||||
</if>
|
||||
<if test="terminalId!=null">
|
||||
and t.terminal_id = #{terminalId}
|
||||
</if>
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
x
Reference in New Issue
Block a user