新增日志管理接口实现
This commit is contained in:
parent
a81c641d7b
commit
c2fafd2c9d
@ -18,7 +18,7 @@ import com.xhpc.common.domain.XhpcChargingPile;
|
||||
import com.xhpc.common.domain.XhpcChargingStation;
|
||||
import com.xhpc.common.domain.XhpcTerminal;
|
||||
import com.xhpc.common.enums.ConnectorTypeEnum;
|
||||
import com.xhpc.common.enums.EquipmentTypeEnum;
|
||||
import com.xhpc.common.enums.PileEquipmentTypeEnum;
|
||||
import com.xhpc.common.enums.PowerTypeEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.env.Environment;
|
||||
@ -345,7 +345,7 @@ public class XhpcChargingPileServiceImpl implements IXhpcChargingPileService {
|
||||
|
||||
pile.setType(PowerTypeEnum.getCodeByName(pile.getTypeName()));
|
||||
pile.setConnectorType(ConnectorTypeEnum.getCodeByName(pile.getConnectorTypeName()));
|
||||
pile.setEquipmentType(EquipmentTypeEnum.getCodeByName(pile.getEquipmentTypeName()));
|
||||
pile.setEquipmentType(PileEquipmentTypeEnum.getCodeByName(pile.getEquipmentTypeName()));
|
||||
|
||||
XhpcChargingStation station = xhpcChargingStationService.selectXhpcChargingStationByName(pile.getChargingStationName());
|
||||
if(station == null){
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.xhpc.log.controller;
|
||||
|
||||
import com.xhpc.common.core.utils.SecurityUtils;
|
||||
import com.xhpc.common.core.web.controller.BaseController;
|
||||
import com.xhpc.common.core.web.page.TableDataInfo;
|
||||
import com.xhpc.log.service.OrderLogService;
|
||||
@ -24,12 +25,13 @@ public class OrderLogController extends BaseController {
|
||||
@GetMapping("/getPage")
|
||||
public TableDataInfo getOrderPage(){
|
||||
startPage();
|
||||
Long operatorId = SecurityUtils.getUserId();
|
||||
|
||||
return getDataTable(orderLogService.getOrderPage());
|
||||
return getDataTable(orderLogService.getOrderPage(operatorId, null));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/order/{orderId}")
|
||||
@GetMapping("/{orderId}")
|
||||
public TableDataInfo getOrderDetailPage(@PathVariable("orderId") String orderId){
|
||||
startPage();
|
||||
return getDataTable(orderLogService.getOrderDetailPage(orderId));
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.xhpc.log.controller;
|
||||
|
||||
|
||||
import com.xhpc.common.core.utils.SecurityUtils;
|
||||
import com.xhpc.common.core.web.controller.BaseController;
|
||||
import com.xhpc.common.core.web.page.TableDataInfo;
|
||||
import com.xhpc.log.service.PileLogService;
|
||||
@ -25,13 +26,14 @@ public class PileLogController extends BaseController {
|
||||
|
||||
@GetMapping("/getPage")
|
||||
public TableDataInfo getPilePage() {
|
||||
Long operatorId = SecurityUtils.getUserId();
|
||||
startPage();
|
||||
return getDataTable(pileLogService.getPilePage());
|
||||
return getDataTable(pileLogService.getPilePage(operatorId, null));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/pile/{pileId}")
|
||||
public TableDataInfo getPileDetailPage(@PathVariable("pileId") Long pileId) {
|
||||
@GetMapping("/{pileId}")
|
||||
public TableDataInfo getPileDetailPage(@PathVariable("pileId") String pileId) {
|
||||
startPage();
|
||||
return getDataTable(pileLogService.getPileRunLogPage(pileId));
|
||||
}
|
||||
|
||||
@ -26,15 +26,14 @@ public class StationLogController extends BaseController {
|
||||
public TableDataInfo getPilePage() {
|
||||
startPage();
|
||||
Long operatorId = SecurityUtils.getUserId();
|
||||
int type = 1;
|
||||
return getDataTable(stationLogService.getStationPage(operatorId, type));
|
||||
return getDataTable(stationLogService.getStationPage(operatorId, null));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/pile/{pileId}")
|
||||
public TableDataInfo getPileDetailPage(@PathVariable("pileId") Long pileId) {
|
||||
@GetMapping("/{stationId}")
|
||||
public TableDataInfo getPileDetailPage(@PathVariable("stationId") Long stationId) {
|
||||
startPage();
|
||||
return getDataTable(stationLogService.getStationRatePage(pileId));
|
||||
return getDataTable(stationLogService.getStationRatePage(stationId));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ public class SystemLogController extends BaseController {
|
||||
SystemLogService systemLogService;
|
||||
|
||||
|
||||
@GetMapping("/getPage")
|
||||
@GetMapping("/oper/getPage")
|
||||
public TableDataInfo getPage(){
|
||||
startPage();
|
||||
return getDataTable(systemLogService.getPage(null));
|
||||
|
||||
@ -12,5 +12,4 @@ public interface XhpcHistoryOrderMapper {
|
||||
|
||||
List<Map<String, Object>> getOrderPage(@Param("operatorId") Long operatorId, @Param("number") Integer number);
|
||||
|
||||
List<Map<String, Object>> getOrderMessagePage(@Param("serialNumber")String serialNumber);
|
||||
}
|
||||
@ -2,9 +2,15 @@ package com.xhpc.log.mapper;
|
||||
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Mapper
|
||||
public interface XhpcMessageMapper {
|
||||
|
||||
|
||||
List<Map<String, Object>> getOrderMessagePage(@Param("serialNumber")String serialNumber);
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@ import java.util.Map;
|
||||
public interface OrderLogService {
|
||||
|
||||
|
||||
List<Map<String, Object>> getOrderPage();
|
||||
List<Map<String, Object>> getOrderPage(Long operatorId, Integer type);
|
||||
|
||||
|
||||
List<Map<String, Object>> getOrderDetailPage(String orderId);
|
||||
|
||||
@ -8,9 +8,9 @@ import java.util.Map;
|
||||
public interface PileLogService {
|
||||
|
||||
|
||||
List<Map<String, Object>> getPilePage();
|
||||
List<Map<String, Object>> getPilePage(Long operatorId, Integer type);
|
||||
|
||||
|
||||
List<Map<String, Object>> getPileRunLogPage(Long pileId);
|
||||
List<Map<String, Object>> getPileRunLogPage(String pileId);
|
||||
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@ import java.util.Map;
|
||||
public interface StationLogService {
|
||||
|
||||
|
||||
List<Map<String, Object>> getStationPage(Long operatorId, int type);
|
||||
List<Map<String, Object>> getStationPage(Long operatorId, Integer type);
|
||||
|
||||
|
||||
List<Map<String, Object>> getStationRatePage(Long stationId);
|
||||
|
||||
@ -3,6 +3,7 @@ package com.xhpc.log.service.impl;
|
||||
|
||||
import com.xhpc.common.core.utils.SecurityUtils;
|
||||
import com.xhpc.log.mapper.XhpcHistoryOrderMapper;
|
||||
import com.xhpc.log.mapper.XhpcMessageMapper;
|
||||
import com.xhpc.log.service.OrderLogService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -16,16 +17,18 @@ public class OrderLogServiceImpl implements OrderLogService {
|
||||
@Resource
|
||||
XhpcHistoryOrderMapper historyOrderMapper;
|
||||
|
||||
@Resource
|
||||
XhpcMessageMapper messageMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getOrderPage(){
|
||||
Long operatorId = SecurityUtils.getUserId();
|
||||
return historyOrderMapper.getOrderPage(operatorId, 1);
|
||||
public List<Map<String, Object>> getOrderPage(Long operatorId, Integer type){
|
||||
return historyOrderMapper.getOrderPage(operatorId, type);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getOrderDetailPage(String orderId){
|
||||
return historyOrderMapper.getOrderMessagePage(orderId);
|
||||
return messageMapper.getOrderMessagePage(orderId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
package com.xhpc.log.service.impl;
|
||||
|
||||
import com.xhpc.common.core.utils.SecurityUtils;
|
||||
import com.xhpc.common.enums.StationDeviceEnum;
|
||||
import com.xhpc.log.mapper.XhpcChargingPileMapper;
|
||||
import com.xhpc.log.mapper.XhpcDeviceMessageMapper;
|
||||
import com.xhpc.log.service.PileLogService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -16,16 +18,18 @@ public class PileLogServiceImpl implements PileLogService {
|
||||
@Resource
|
||||
XhpcChargingPileMapper pileMapper;
|
||||
|
||||
@Resource
|
||||
XhpcDeviceMessageMapper deviceMessageMapper;
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getPilePage(){
|
||||
Long operatorId = SecurityUtils.getUserId();
|
||||
return pileMapper.selectXhpcChargingPileList(operatorId , 1);
|
||||
public List<Map<String, Object>> getPilePage(Long operatorId, Integer type){
|
||||
|
||||
return pileMapper.selectXhpcChargingPileList(operatorId , type);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getPileRunLogPage(Long pileId){
|
||||
// todo 待完善电桩运行日志
|
||||
return null;
|
||||
public List<Map<String, Object>> getPileRunLogPage(String pileId){
|
||||
return deviceMessageMapper.selectListByTypeAndSerialNumber(StationDeviceEnum.PILE.getCode(), pileId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@ public class StationLogServiceImpl implements StationLogService {
|
||||
XhpcChargingStationMapper stationMapper;
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getStationPage(Long operatorId, int type){
|
||||
public List<Map<String, Object>> getStationPage(Long operatorId, Integer type){
|
||||
return stationMapper.selectXhpcChargingStationList(operatorId, type);
|
||||
}
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="selectUserOperLog" resultType="map">
|
||||
select
|
||||
oper_id as 'openId',
|
||||
oper_id as 'operId',
|
||||
title as 'title',
|
||||
business_type as 'businessType',
|
||||
method as 'method',
|
||||
|
||||
@ -25,17 +25,5 @@
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getOrderMessagePage" resultType="map">
|
||||
select
|
||||
m.message_id as 'messageId',
|
||||
m.charge_order_no as 'chargeOrderNo',
|
||||
m.content as 'content',
|
||||
m.status as 'status',
|
||||
m.remark as 'remark',
|
||||
m.create_time as 'createTime'
|
||||
from xhpc_message m
|
||||
left join xhpc_history_order h on h.charge_order_id = m.charge_order_no
|
||||
where h.serial_number=#{serialNumber}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -3,4 +3,15 @@
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xhpc.log.mapper.XhpcMessageMapper">
|
||||
|
||||
<select id="getOrderMessagePage" resultType="map">
|
||||
select
|
||||
m.message_id as 'messageId',
|
||||
m.charge_order_no as 'chargeOrderNo',
|
||||
m.content as 'content',
|
||||
m.status as 'status',
|
||||
m.remark as 'remark',
|
||||
m.create_time as 'createTime'
|
||||
from xhpc_message m
|
||||
where m.charge_order_no=#{serialNumber}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user