From ba608fba51a53426ec15e8689354affdd5727349 Mon Sep 17 00:00:00 2001 From: yuyang Date: Wed, 2 Mar 2022 14:19:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=A7=9F=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../station/controller/XhpcDownCodeController.java | 1 - .../station/mapper/XhpcDownCodeMapper.java | 2 +- .../station/service/XhpcDownCodeServiceImpl.java | 8 ++++++-- .../main/resources/mapper/XhpcDownCodeMapper.xml | 3 +++ .../com/xhpc/general/mapper/XhpcSmsMapper.java | 6 +++--- .../xhpc/general/service/XhpcSmsServiceImpl.java | 14 +++++++++----- .../src/main/resources/mapper/XhpcSmsMapper.xml | 12 +++++++++--- .../service/impl/XhpcInvoiceServiceImpl.java | 6 ++++++ .../main/resources/mapper/XhpcInvoiceMapper.xml | 2 +- 9 files changed, 38 insertions(+), 16 deletions(-) diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcDownCodeController.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcDownCodeController.java index a8f8b18d..56d3a170 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcDownCodeController.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcDownCodeController.java @@ -27,7 +27,6 @@ public class XhpcDownCodeController extends BaseController { @GetMapping(value = "/listStations") public TableDataInfo listStations(String stationName){ - startPage(); return getDataTable(iXhpcDownCodeService.listStations(stationName)); } diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcDownCodeMapper.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcDownCodeMapper.java index d03c5ff3..66f25fdd 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcDownCodeMapper.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcDownCodeMapper.java @@ -14,7 +14,7 @@ import java.util.Map; @Mapper public interface XhpcDownCodeMapper { - List> selectStationsBy(@Param(value = "stationName") String stationName); + List> selectStationsBy(@Param(value = "stationName") String stationName,@Param("tenantId") String tenantId); List> selectPilesBy(@Param(value = "stationId") Long stationId); diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcDownCodeServiceImpl.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcDownCodeServiceImpl.java index 0c0825d2..aef7df97 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcDownCodeServiceImpl.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcDownCodeServiceImpl.java @@ -2,6 +2,8 @@ package com.xhpc.charging.station.service; import com.xhpc.charging.station.mapper.XhpcDownCodeMapper; import com.xhpc.charging.station.utils.img.DownMaterialUtil; +import com.xhpc.common.security.service.TokenService; +import com.xhpc.system.api.model.LoginUser; import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFSheet; @@ -31,13 +33,15 @@ public class XhpcDownCodeServiceImpl implements IXhpcDownCodeService { @Autowired private Environment environment; + @Autowired + private TokenService tokenService; private static final Logger logger = LoggerFactory.getLogger(XhpcDownCodeServiceImpl.class); @Override public List> listStations(String stationName) { - - return xhpcDownCodeMapper.selectStationsBy(stationName); + LoginUser loginUser = tokenService.getLoginUser(); + return xhpcDownCodeMapper.selectStationsBy(stationName,loginUser.getTenantId()); } @Override diff --git a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcDownCodeMapper.xml b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcDownCodeMapper.xml index 4af8f143..4b9a24c9 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcDownCodeMapper.xml +++ b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcDownCodeMapper.xml @@ -15,6 +15,9 @@ and xcs.name like concat('%',#{stationName},'%') + + and xcs.tenant_id =#{tenantId} + group by xcs.charging_station_id, xcs.name, xo.name diff --git a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/mapper/XhpcSmsMapper.java b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/mapper/XhpcSmsMapper.java index f427cb9a..401b0e8b 100644 --- a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/mapper/XhpcSmsMapper.java +++ b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/mapper/XhpcSmsMapper.java @@ -14,7 +14,7 @@ public interface XhpcSmsMapper { int addXhpcSms(XhpcSms xhpcSms); - List> getList(@Param("status") Integer status, @Param("phone") String phone); + List> getList(@Param("status") Integer status, @Param("phone") String phone,@Param("tenantId")String tenantId); /** * 查询阿里云中发送失败的短信条数 @@ -24,7 +24,7 @@ public interface XhpcSmsMapper { * @date 2021/11/29 14:11 * @since version-1.0 */ - Long querySumOfFailMessage(); + Long querySumOfFailMessage(@Param("tenantId")String tenantId); /** * 查询阿里云中的发送成功的短信条数 @@ -34,7 +34,7 @@ public interface XhpcSmsMapper { * @date 2021/11/29 * @since version-1.0 */ - Long querySumOfSuccessMessage(); + Long querySumOfSuccessMessage(@Param("tenantId")String tenantId); /** * 查询所有发送的短信的总记录数(包括异常,失败) diff --git a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/service/XhpcSmsServiceImpl.java b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/service/XhpcSmsServiceImpl.java index 6594514b..815c12b3 100644 --- a/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/service/XhpcSmsServiceImpl.java +++ b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/service/XhpcSmsServiceImpl.java @@ -7,11 +7,13 @@ import com.aliyun.dysmsapi20170525.models.SendSmsResponse; import com.aliyun.dysmsapi20170525.models.SendSmsResponseBody; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.redis.service.RedisService; +import com.xhpc.common.security.service.TokenService; import com.xhpc.general.constant.AliyunSendResult; import com.xhpc.general.constant.AliyunTemplate; import com.xhpc.general.domain.XhpcSms; import com.xhpc.general.mapper.XhpcSmsMapper; import com.xhpc.general.util.sms.SmsUtil; +import com.xhpc.system.api.model.LoginUser; import lombok.extern.slf4j.Slf4j; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -41,6 +43,8 @@ public class XhpcSmsServiceImpl implements IXhpcSmsService { private RedisService redisService; @Autowired private XhpcSmsMapper xhpcSmsMapper; + @Autowired + private TokenService tokenService; @PostConstruct public void init() { @@ -61,8 +65,8 @@ public class XhpcSmsServiceImpl implements IXhpcSmsService { @Override public List> getList(Integer status, String phone) { - - return xhpcSmsMapper.getList(status,phone); + LoginUser loginUser = tokenService.getLoginUser(); + return xhpcSmsMapper.getList(status,phone,loginUser.getTenantId()); } @Override @@ -179,9 +183,9 @@ public class XhpcSmsServiceImpl implements IXhpcSmsService { @Override public Object getAliyunShortMessageInfo() { - - Long successMessage = xhpcSmsMapper.querySumOfSuccessMessage(); - Long failMessage = xhpcSmsMapper.querySumOfFailMessage(); + LoginUser loginUser = tokenService.getLoginUser(); + Long successMessage = xhpcSmsMapper.querySumOfSuccessMessage(loginUser.getTenantId()); + Long failMessage = xhpcSmsMapper.querySumOfFailMessage(loginUser.getTenantId()); Long sumOfMessage = successMessage + failMessage; Map messageInfoMap = new HashMap<>(); messageInfoMap.put("successMessage", successMessage); diff --git a/xhpc-modules/xhpc-general/src/main/resources/mapper/XhpcSmsMapper.xml b/xhpc-modules/xhpc-general/src/main/resources/mapper/XhpcSmsMapper.xml index a3e3902c..620290f1 100644 --- a/xhpc-modules/xhpc-general/src/main/resources/mapper/XhpcSmsMapper.xml +++ b/xhpc-modules/xhpc-general/src/main/resources/mapper/XhpcSmsMapper.xml @@ -104,6 +104,9 @@ and status=#{status} + + and tenant_id= #{tenantId} + and phone like concat('%',#{phone},'%') @@ -115,16 +118,19 @@ FROM xhpc_sms WHERE status = 1 AND del_flag = 0 - + + and tenant_id= #{tenantId} +