新增日志管理接口实现

This commit is contained in:
panshuling321 2021-12-30 11:20:15 +08:00
parent a81c641d7b
commit c2fafd2c9d
16 changed files with 56 additions and 42 deletions

View File

@ -18,7 +18,7 @@ import com.xhpc.common.domain.XhpcChargingPile;
import com.xhpc.common.domain.XhpcChargingStation; import com.xhpc.common.domain.XhpcChargingStation;
import com.xhpc.common.domain.XhpcTerminal; import com.xhpc.common.domain.XhpcTerminal;
import com.xhpc.common.enums.ConnectorTypeEnum; 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 com.xhpc.common.enums.PowerTypeEnum;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
@ -345,7 +345,7 @@ public class XhpcChargingPileServiceImpl implements IXhpcChargingPileService {
pile.setType(PowerTypeEnum.getCodeByName(pile.getTypeName())); pile.setType(PowerTypeEnum.getCodeByName(pile.getTypeName()));
pile.setConnectorType(ConnectorTypeEnum.getCodeByName(pile.getConnectorTypeName())); pile.setConnectorType(ConnectorTypeEnum.getCodeByName(pile.getConnectorTypeName()));
pile.setEquipmentType(EquipmentTypeEnum.getCodeByName(pile.getEquipmentTypeName())); pile.setEquipmentType(PileEquipmentTypeEnum.getCodeByName(pile.getEquipmentTypeName()));
XhpcChargingStation station = xhpcChargingStationService.selectXhpcChargingStationByName(pile.getChargingStationName()); XhpcChargingStation station = xhpcChargingStationService.selectXhpcChargingStationByName(pile.getChargingStationName());
if(station == null){ if(station == null){

View File

@ -1,5 +1,6 @@
package com.xhpc.log.controller; 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.controller.BaseController;
import com.xhpc.common.core.web.page.TableDataInfo; import com.xhpc.common.core.web.page.TableDataInfo;
import com.xhpc.log.service.OrderLogService; import com.xhpc.log.service.OrderLogService;
@ -24,12 +25,13 @@ public class OrderLogController extends BaseController {
@GetMapping("/getPage") @GetMapping("/getPage")
public TableDataInfo getOrderPage(){ public TableDataInfo getOrderPage(){
startPage(); 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){ public TableDataInfo getOrderDetailPage(@PathVariable("orderId") String orderId){
startPage(); startPage();
return getDataTable(orderLogService.getOrderDetailPage(orderId)); return getDataTable(orderLogService.getOrderDetailPage(orderId));

View File

@ -1,6 +1,7 @@
package com.xhpc.log.controller; 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.controller.BaseController;
import com.xhpc.common.core.web.page.TableDataInfo; import com.xhpc.common.core.web.page.TableDataInfo;
import com.xhpc.log.service.PileLogService; import com.xhpc.log.service.PileLogService;
@ -25,13 +26,14 @@ public class PileLogController extends BaseController {
@GetMapping("/getPage") @GetMapping("/getPage")
public TableDataInfo getPilePage() { public TableDataInfo getPilePage() {
Long operatorId = SecurityUtils.getUserId();
startPage(); startPage();
return getDataTable(pileLogService.getPilePage()); return getDataTable(pileLogService.getPilePage(operatorId, null));
} }
@GetMapping("/pile/{pileId}") @GetMapping("/{pileId}")
public TableDataInfo getPileDetailPage(@PathVariable("pileId") Long pileId) { public TableDataInfo getPileDetailPage(@PathVariable("pileId") String pileId) {
startPage(); startPage();
return getDataTable(pileLogService.getPileRunLogPage(pileId)); return getDataTable(pileLogService.getPileRunLogPage(pileId));
} }

View File

@ -26,15 +26,14 @@ public class StationLogController extends BaseController {
public TableDataInfo getPilePage() { public TableDataInfo getPilePage() {
startPage(); startPage();
Long operatorId = SecurityUtils.getUserId(); Long operatorId = SecurityUtils.getUserId();
int type = 1; return getDataTable(stationLogService.getStationPage(operatorId, null));
return getDataTable(stationLogService.getStationPage(operatorId, type));
} }
@GetMapping("/pile/{pileId}") @GetMapping("/{stationId}")
public TableDataInfo getPileDetailPage(@PathVariable("pileId") Long pileId) { public TableDataInfo getPileDetailPage(@PathVariable("stationId") Long stationId) {
startPage(); startPage();
return getDataTable(stationLogService.getStationRatePage(pileId)); return getDataTable(stationLogService.getStationRatePage(stationId));
} }

View File

@ -22,7 +22,7 @@ public class SystemLogController extends BaseController {
SystemLogService systemLogService; SystemLogService systemLogService;
@GetMapping("/getPage") @GetMapping("/oper/getPage")
public TableDataInfo getPage(){ public TableDataInfo getPage(){
startPage(); startPage();
return getDataTable(systemLogService.getPage(null)); return getDataTable(systemLogService.getPage(null));

View File

@ -12,5 +12,4 @@ public interface XhpcHistoryOrderMapper {
List<Map<String, Object>> getOrderPage(@Param("operatorId") Long operatorId, @Param("number") Integer number); List<Map<String, Object>> getOrderPage(@Param("operatorId") Long operatorId, @Param("number") Integer number);
List<Map<String, Object>> getOrderMessagePage(@Param("serialNumber")String serialNumber);
} }

View File

@ -2,9 +2,15 @@ package com.xhpc.log.mapper;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
@Mapper @Mapper
public interface XhpcMessageMapper { public interface XhpcMessageMapper {
List<Map<String, Object>> getOrderMessagePage(@Param("serialNumber")String serialNumber);
} }

View File

@ -6,7 +6,7 @@ import java.util.Map;
public interface OrderLogService { public interface OrderLogService {
List<Map<String, Object>> getOrderPage(); List<Map<String, Object>> getOrderPage(Long operatorId, Integer type);
List<Map<String, Object>> getOrderDetailPage(String orderId); List<Map<String, Object>> getOrderDetailPage(String orderId);

View File

@ -8,9 +8,9 @@ import java.util.Map;
public interface PileLogService { 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);
} }

View File

@ -6,7 +6,7 @@ import java.util.Map;
public interface StationLogService { 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); List<Map<String, Object>> getStationRatePage(Long stationId);

View File

@ -3,6 +3,7 @@ package com.xhpc.log.service.impl;
import com.xhpc.common.core.utils.SecurityUtils; import com.xhpc.common.core.utils.SecurityUtils;
import com.xhpc.log.mapper.XhpcHistoryOrderMapper; import com.xhpc.log.mapper.XhpcHistoryOrderMapper;
import com.xhpc.log.mapper.XhpcMessageMapper;
import com.xhpc.log.service.OrderLogService; import com.xhpc.log.service.OrderLogService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -16,16 +17,18 @@ public class OrderLogServiceImpl implements OrderLogService {
@Resource @Resource
XhpcHistoryOrderMapper historyOrderMapper; XhpcHistoryOrderMapper historyOrderMapper;
@Resource
XhpcMessageMapper messageMapper;
@Override @Override
public List<Map<String, Object>> getOrderPage(){ public List<Map<String, Object>> getOrderPage(Long operatorId, Integer type){
Long operatorId = SecurityUtils.getUserId(); return historyOrderMapper.getOrderPage(operatorId, type);
return historyOrderMapper.getOrderPage(operatorId, 1);
} }
@Override @Override
public List<Map<String, Object>> getOrderDetailPage(String orderId){ public List<Map<String, Object>> getOrderDetailPage(String orderId){
return historyOrderMapper.getOrderMessagePage(orderId); return messageMapper.getOrderMessagePage(orderId);
} }
} }

View File

@ -1,7 +1,9 @@
package com.xhpc.log.service.impl; package com.xhpc.log.service.impl;
import com.xhpc.common.core.utils.SecurityUtils; import com.xhpc.common.core.utils.SecurityUtils;
import com.xhpc.common.enums.StationDeviceEnum;
import com.xhpc.log.mapper.XhpcChargingPileMapper; import com.xhpc.log.mapper.XhpcChargingPileMapper;
import com.xhpc.log.mapper.XhpcDeviceMessageMapper;
import com.xhpc.log.service.PileLogService; import com.xhpc.log.service.PileLogService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -16,16 +18,18 @@ public class PileLogServiceImpl implements PileLogService {
@Resource @Resource
XhpcChargingPileMapper pileMapper; XhpcChargingPileMapper pileMapper;
@Resource
XhpcDeviceMessageMapper deviceMessageMapper;
@Override @Override
public List<Map<String, Object>> getPilePage(){ public List<Map<String, Object>> getPilePage(Long operatorId, Integer type){
Long operatorId = SecurityUtils.getUserId();
return pileMapper.selectXhpcChargingPileList(operatorId , 1); return pileMapper.selectXhpcChargingPileList(operatorId , type);
} }
@Override @Override
public List<Map<String, Object>> getPileRunLogPage(Long pileId){ public List<Map<String, Object>> getPileRunLogPage(String pileId){
// todo 待完善电桩运行日志 return deviceMessageMapper.selectListByTypeAndSerialNumber(StationDeviceEnum.PILE.getCode(), pileId);
return null;
} }
} }

View File

@ -16,7 +16,7 @@ public class StationLogServiceImpl implements StationLogService {
XhpcChargingStationMapper stationMapper; XhpcChargingStationMapper stationMapper;
@Override @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); return stationMapper.selectXhpcChargingStationList(operatorId, type);
} }

View File

@ -6,7 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectUserOperLog" resultType="map"> <select id="selectUserOperLog" resultType="map">
select select
oper_id as 'openId', oper_id as 'operId',
title as 'title', title as 'title',
business_type as 'businessType', business_type as 'businessType',
method as 'method', method as 'method',

View File

@ -25,17 +25,5 @@
</select> </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> </mapper>

View File

@ -3,4 +3,15 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xhpc.log.mapper.XhpcMessageMapper"> <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> </mapper>