From 99c330627f8c503626923f246b0d3cd61cb8a189 Mon Sep 17 00:00:00 2001 From: yuyang Date: Fri, 31 Dec 2021 16:13:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=BA=E7=AB=99=E6=9C=8D=E5=8A=A1=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=AE=8C=E6=88=90=EF=BC=88=E7=A7=9F=E6=88=B7=E5=92=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../station/controller/XhpcTerminalController.java | 9 +++++++-- .../station/mapper/XhpcChargingStationMapper.java | 2 +- .../mapper/XhpcChargingStationPushStatusMapper.java | 2 +- .../charging/station/mapper/XhpcTerminalMapper.java | 2 +- .../station/service/IXhpcTerminalService.java | 3 ++- .../service/XhpcChargingStationServiceImpl.java | 4 ++-- .../station/service/XhpcTerminalServiceImpl.java | 12 ++++++++---- .../resources/mapper/XhpcChargingStationMapper.xml | 2 +- .../mapper/XhpcChargingStationPushStatusMapper.xml | 2 +- .../src/main/resources/mapper/XhpcTerminalMapper.xml | 3 +++ 10 files changed, 27 insertions(+), 14 deletions(-) diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcTerminalController.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcTerminalController.java index 5f58fdf3..f498ed7b 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcTerminalController.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcTerminalController.java @@ -5,9 +5,12 @@ import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; import com.xhpc.charging.station.service.IXhpcTerminalService; import com.xhpc.common.domain.XhpcTerminal; +import com.xhpc.common.log.annotation.Log; +import com.xhpc.common.log.enums.BusinessType; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletRequest; import java.util.List; import java.util.Map; @@ -35,10 +38,10 @@ public class XhpcTerminalController extends BaseController { */ //@PreAuthorize(hasPermi = "system:station:list") @GetMapping("/list") - public TableDataInfo list(String serialNumber, Integer type, Integer status, String workStatus, Long chargingStationId) { + public TableDataInfo list(HttpServletRequest request, String serialNumber, Integer type, Integer status, String workStatus, Long chargingStationId) { startPage(); - List> list = xhpcTerminalService.getXhpcTerminalList(serialNumber, type, status, workStatus, chargingStationId); + List> list = xhpcTerminalService.getXhpcTerminalList(request,serialNumber, type, status, workStatus, chargingStationId); return getDataTable(list); } @@ -48,6 +51,7 @@ public class XhpcTerminalController extends BaseController { * * @return */ + @Log(title = "终端-停用", businessType = BusinessType.UPDATE) @PostMapping(value = "/updateStatus") public AjaxResult updateStatus(@RequestBody XhpcTerminal xhpcTerminal) { @@ -68,6 +72,7 @@ public class XhpcTerminalController extends BaseController { * * @return */ + @Log(title = "终端-修改", businessType = BusinessType.UPDATE) @PostMapping(value = "/updateXhpcTerminalName") public AjaxResult updateXhpcTerminalName(@RequestBody XhpcTerminal xhpcTerminal) { diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcChargingStationMapper.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcChargingStationMapper.java index a4165cd2..c4246a29 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcChargingStationMapper.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcChargingStationMapper.java @@ -191,7 +191,7 @@ public interface XhpcChargingStationMapper { /** * 添加费率时段 */ - int addXhpcRateTime(XhpcRateTime xhpcRateTime); + int insertXhpcRateTime(XhpcRateTime xhpcRateTime); /** diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcChargingStationPushStatusMapper.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcChargingStationPushStatusMapper.java index ca611a91..83fc0939 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcChargingStationPushStatusMapper.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcChargingStationPushStatusMapper.java @@ -26,7 +26,7 @@ public interface XhpcChargingStationPushStatusMapper { * @date 2021/11/4 12:54 * @since version-1.0 */ - Integer saveStationPushStatus(@Param("chargingStationId") Integer chargingStationId, @Param("stationName") String stationName, @Param("pushStatus") Integer pushStatus); + Integer insertStationPushStatus(@Param("chargingStationId") Integer chargingStationId, @Param("stationName") String stationName, @Param("pushStatus") Integer pushStatus); /** * 查找电站id是否已经存在 diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcTerminalMapper.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcTerminalMapper.java index c3674273..5ce98d96 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcTerminalMapper.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcTerminalMapper.java @@ -33,7 +33,7 @@ public interface XhpcTerminalMapper { * @param chargingStationId * @return */ - List> getXhpcTerminalList(@Param("serialNumber") String serialNumber, @Param("type") Integer type, @Param("status") Integer status, @Param("workStatus") String workStatus, @Param("chargingStationId") Long chargingStationId); + List> getXhpcTerminalList(@Param("serialNumber") String serialNumber, @Param("type") Integer type, @Param("status") Integer status, @Param("workStatus") String workStatus, @Param("chargingStationId") Long chargingStationId, @Param("tenantId") String tenantId); /** diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/IXhpcTerminalService.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/IXhpcTerminalService.java index e4ec387f..10613b3a 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/IXhpcTerminalService.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/IXhpcTerminalService.java @@ -2,6 +2,7 @@ package com.xhpc.charging.station.service; import com.xhpc.common.core.web.domain.AjaxResult; +import javax.servlet.http.HttpServletRequest; import java.util.List; import java.util.Map; @@ -24,7 +25,7 @@ public interface IXhpcTerminalService { /** * 列表接口 */ - List> getXhpcTerminalList(String serialNumber, Integer type,Integer status,String workStatus, Long chargingStationId); + List> getXhpcTerminalList(HttpServletRequest request, String serialNumber, Integer type, Integer status, String workStatus, Long chargingStationId); /** * 停用 diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java index 2e5b4ba0..7a7181bc 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java @@ -86,7 +86,7 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi if (map != null) { return 0; } - return xhpcChargingStationPushStatusMapper.saveStationPushStatus(chargingStationId, stationName, pushStatus); + return xhpcChargingStationPushStatusMapper.insertStationPushStatus(chargingStationId, stationName, pushStatus); } /** @@ -681,7 +681,7 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi xhpcRateTime.setType(type); xhpcRateTime.setRateValue(rateValue); xhpcRateTime.setCreateTime(Calendar.getInstance().getTime()); - xhpcChargingStationMapper.addXhpcRateTime(xhpcRateTime); + xhpcChargingStationMapper.insertXhpcRateTime(xhpcRateTime); return sort++; } diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcTerminalServiceImpl.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcTerminalServiceImpl.java index 355052fa..493917d7 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcTerminalServiceImpl.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcTerminalServiceImpl.java @@ -4,9 +4,12 @@ import cn.hutool.core.date.DateUtil; import com.xhpc.charging.station.mapper.XhpcTerminalMapper; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.domain.XhpcTerminal; +import com.xhpc.common.util.LogUserUtils; +import com.xhpc.system.api.model.LoginUser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import javax.servlet.http.HttpServletRequest; import java.util.*; /** @@ -26,7 +29,8 @@ public class XhpcTerminalServiceImpl implements IXhpcTerminalService { @Autowired private IXhpcChargingStationService xhpcChargingStationService; - + @Autowired + private LogUserUtils logUserUtils; /** * PC端页面统计 * @@ -40,9 +44,9 @@ public class XhpcTerminalServiceImpl implements IXhpcTerminalService { } @Override - public List> getXhpcTerminalList(String serialNumber, Integer type, Integer status, String workStatus, Long chargingStationId) { - - List> list = xhpcTerminalMapper.getXhpcTerminalList(serialNumber, type, status, workStatus, chargingStationId); + public List> getXhpcTerminalList(HttpServletRequest request, String serialNumber, Integer type, Integer status, String workStatus, Long chargingStationId) { + LoginUser logUser = logUserUtils.getLogUser(request); + List> list = xhpcTerminalMapper.getXhpcTerminalList(serialNumber, type, status, workStatus, chargingStationId,logUser.getTenantId()); if(list !=null && list.size()>0){ for (int i = 0; i map = list.get(i); diff --git a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingStationMapper.xml b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingStationMapper.xml index fd99a605..5ed1000e 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingStationMapper.xml +++ b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingStationMapper.xml @@ -718,7 +718,7 @@ - insert into xhpc_rate_time diff --git a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingStationPushStatusMapper.xml b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingStationPushStatusMapper.xml index 546d1401..247814b7 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingStationPushStatusMapper.xml +++ b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingStationPushStatusMapper.xml @@ -14,7 +14,7 @@ - + insert into xhpc_charging_station_push_status (charging_station_id, station_name, push_status) values (#{chargingStationId}, #{stationName}, #{pushStatus}) diff --git a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcTerminalMapper.xml b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcTerminalMapper.xml index 09673fa4..221e71e3 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcTerminalMapper.xml +++ b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcTerminalMapper.xml @@ -107,6 +107,9 @@ and te.work_status=#{chargingStationId} + + and te.tenant_id=#{tenantId} +