From 18a2f002a7b7cc47f8f775bdc663c1d71d1167d2 Mon Sep 17 00:00:00 2001 From: x_z Date: Fri, 21 Oct 2022 09:51:25 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E9=87=8D=E6=96=B0=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E5=8C=BB=E9=99=A2=E5=AE=A2=E6=88=B7=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84=E5=A4=9A=E6=9D=A1=E6=95=B0=E6=8D=AE=E7=A7=98=E9=92=A5?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=B8=8D=E5=90=8C=EF=BC=8C=E6=97=A7=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=A4=B1=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../udi/admin/dao/inout/UnitMaintainPlatformDao.java | 10 ++++++++++ .../glxp/udi/admin/service/info/PlatformService.java | 10 ++++++++++ .../mybatis/mapper/inout/UnitMaintainPlatformDao.xml | 4 ++++ 3 files changed, 24 insertions(+) diff --git a/src/main/java/com/glxp/udi/admin/dao/inout/UnitMaintainPlatformDao.java b/src/main/java/com/glxp/udi/admin/dao/inout/UnitMaintainPlatformDao.java index f2e9450..5a7b6d1 100644 --- a/src/main/java/com/glxp/udi/admin/dao/inout/UnitMaintainPlatformDao.java +++ b/src/main/java/com/glxp/udi/admin/dao/inout/UnitMaintainPlatformDao.java @@ -7,6 +7,8 @@ import com.glxp.udi.admin.res.info.PlatformLinkResponse; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + @Mapper public interface UnitMaintainPlatformDao extends BaseMapper { @@ -19,4 +21,12 @@ public interface UnitMaintainPlatformDao extends BaseMapper getLinkPlatformList(IPage page, @Param("customerId") String customerId, @Param("key") String key); + + /** + * 根据客户ID查询关联数据 + * + * @param customerId + * @return + */ + List selectByCustomerId(@Param("customerId") Long customerId); } \ No newline at end of file diff --git a/src/main/java/com/glxp/udi/admin/service/info/PlatformService.java b/src/main/java/com/glxp/udi/admin/service/info/PlatformService.java index b89054c..0e15fd7 100644 --- a/src/main/java/com/glxp/udi/admin/service/info/PlatformService.java +++ b/src/main/java/com/glxp/udi/admin/service/info/PlatformService.java @@ -238,6 +238,16 @@ public class PlatformService { } else { unitMaintainPlatformDao.insert(unitMaintainPlatform); } + + //更新当前客户关联数据的所有key + List list = unitMaintainPlatformDao.selectByCustomerId(unitMaintainPlatform.getCustomerId()); + for (UnitMaintainPlatform maintainPlatform : list) { + maintainPlatform.setAppid(unitMaintainPlatform.getAppid()); + maintainPlatform.setApiKey(unitMaintainPlatform.getApiKey()); + maintainPlatform.setSecretKey(unitMaintainPlatform.getSecretKey()); + unitMaintainPlatformDao.updateById(maintainPlatform); + } + } /** diff --git a/src/main/resources/mybatis/mapper/inout/UnitMaintainPlatformDao.xml b/src/main/resources/mybatis/mapper/inout/UnitMaintainPlatformDao.xml index dbd5e8f..d4f0ca5 100644 --- a/src/main/resources/mybatis/mapper/inout/UnitMaintainPlatformDao.xml +++ b/src/main/resources/mybatis/mapper/inout/UnitMaintainPlatformDao.xml @@ -24,4 +24,8 @@ ) + + \ No newline at end of file