From 7337cf6fa5c48c3c7320ccac269aaaf74dabc5d6 Mon Sep 17 00:00:00 2001 From: zhaoyang0415 <944381517@qq.com> Date: Sat, 25 Feb 2023 14:11:46 +0000 Subject: [PATCH 01/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E5=95=86?= =?UTF-8?q?=E5=93=81=E5=8F=82=E6=95=B0=E9=9B=86=E5=90=88=E5=88=A4=E7=A9=BA?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhaoyang0415 <944381517@qq.com> --- .../src/main/java/cn/lili/modules/goods/entity/dos/Goods.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/framework/src/main/java/cn/lili/modules/goods/entity/dos/Goods.java b/framework/src/main/java/cn/lili/modules/goods/entity/dos/Goods.java index 6f175250..029a66c9 100644 --- a/framework/src/main/java/cn/lili/modules/goods/entity/dos/Goods.java +++ b/framework/src/main/java/cn/lili/modules/goods/entity/dos/Goods.java @@ -1,5 +1,6 @@ package cn.lili.modules.goods.entity.dos; +import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.convert.Convert; import cn.hutool.core.text.CharSequenceUtil; import cn.hutool.http.HtmlUtil; @@ -219,7 +220,7 @@ public class Goods extends BaseEntity { this.mobileIntro = goodsDTO.getMobileIntro(); this.goodsVideo = goodsDTO.getGoodsVideo(); this.price = goodsDTO.getPrice(); - if (goodsDTO.getGoodsParamsDTOList() != null && goodsDTO.getGoodsParamsDTOList().isEmpty()) { + if (CollectionUtil.isNotEmpty(goodsDTO.getGoodsParamsDTOList())){ this.params = JSONUtil.toJsonStr(goodsDTO.getGoodsParamsDTOList()); } //如果立即上架则 From 032ecc4a3e4754b4360dd09df62ce4702cd0066f Mon Sep 17 00:00:00 2001 From: zhaoyang0415 <944381517@qq.com> Date: Sat, 25 Feb 2023 14:52:47 +0000 Subject: [PATCH 02/11] =?UTF-8?q?UpdateWrapper=E6=9B=BF=E6=8D=A2=E4=B8=BAQ?= =?UTF-8?q?ueryWrapper?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhaoyang0415 <944381517@qq.com> --- .../modules/goods/serviceimpl/GoodsGalleryServiceImpl.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsGalleryServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsGalleryServiceImpl.java index a6493be4..34b71e08 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsGalleryServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsGalleryServiceImpl.java @@ -10,7 +10,6 @@ import cn.lili.modules.system.entity.dto.GoodsSetting; import cn.lili.modules.system.entity.enums.SettingEnum; import cn.lili.modules.system.service.SettingService; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -39,7 +38,7 @@ public class GoodsGalleryServiceImpl extends ServiceImpl goodsGalleryList, String goodsId) { //删除原来商品相册信息 - this.baseMapper.delete(new UpdateWrapper().eq("goods_id", goodsId)); + this.baseMapper.delete(new QueryWrapper().eq("goods_id", goodsId)); //确定好图片选择器后进行处理 int i = 0; for (String origin : goodsGalleryList) { @@ -83,6 +82,6 @@ public class GoodsGalleryServiceImpl extends ServiceImpl().eq("goods_id", goodsId)); + this.baseMapper.delete(new QueryWrapper().eq("goods_id", goodsId)); } } \ No newline at end of file From 21d66f719d8617ed5d94e28c1fef57cb0f1086a6 Mon Sep 17 00:00:00 2001 From: 17600048398 <277692624@qq.com> Date: Wed, 15 Mar 2023 16:22:03 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E5=88=86=E9=94=80=E4=BD=A3=E9=87=91?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E6=97=B6=E8=AE=A1=E7=AE=97=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../distribution/entity/dos/Distribution.java | 13 +++++++------ .../distribution/mapper/DistributionMapper.java | 10 +++++----- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/distribution/entity/dos/Distribution.java b/framework/src/main/java/cn/lili/modules/distribution/entity/dos/Distribution.java index 3a24e867..58d27bdb 100644 --- a/framework/src/main/java/cn/lili/modules/distribution/entity/dos/Distribution.java +++ b/framework/src/main/java/cn/lili/modules/distribution/entity/dos/Distribution.java @@ -32,10 +32,11 @@ public class Distribution extends BaseEntity { public Distribution(String memberId, String memberName, DistributionApplyDTO distributionApplyDTO) { this.memberId = memberId; this.memberName = memberName; - distributionOrderCount=0; + this.distributionOrderCount=0; + this.rebateTotal=0D; + this.canRebate=0D; + this.commissionFrozen=0D; this.distributionStatus = DistributionStatusEnum.APPLY.name(); - commissionFrozen=0D; - canRebate=0D; BeanUtil.copyProperties(distributionApplyDTO, this); } @@ -52,13 +53,13 @@ public class Distribution extends BaseEntity { private String idNumber; @ApiModelProperty(value = "分销总额") - private Double rebateTotal = 0D; + private Double rebateTotal ; @ApiModelProperty(value = "可提现金额") - private Double canRebate = 0D; + private Double canRebate ; @ApiModelProperty(value = "冻结金额") - private Double commissionFrozen = 0D; + private Double commissionFrozen ; @ApiModelProperty(value = "分销订单数") private Integer distributionOrderCount; diff --git a/framework/src/main/java/cn/lili/modules/distribution/mapper/DistributionMapper.java b/framework/src/main/java/cn/lili/modules/distribution/mapper/DistributionMapper.java index 2068e1ed..d8ceab1c 100644 --- a/framework/src/main/java/cn/lili/modules/distribution/mapper/DistributionMapper.java +++ b/framework/src/main/java/cn/lili/modules/distribution/mapper/DistributionMapper.java @@ -19,8 +19,8 @@ public interface DistributionMapper extends BaseMapper { * @param commissionFrozen 分销金额 * @param distributionId 分销员ID */ - @Update("UPDATE li_distribution set commission_frozen = (commission_frozen+#{commissionFrozen}) " + - ", rebate_total=(rebate_total+#{commissionFrozen}) WHERE id = #{distributionId}") + @Update("UPDATE li_distribution set commission_frozen = (IFNULL(commission_frozen,0)+#{commissionFrozen}) " + + ", rebate_total=(IFNULL(rebate_total,0)+#{commissionFrozen}) WHERE id = #{distributionId}") void subCanRebate(Double commissionFrozen, String distributionId); /** @@ -29,9 +29,9 @@ public interface DistributionMapper extends BaseMapper { * @param commissionFrozen 分销金额 * @param distributionId 分销员ID */ - @Update("UPDATE li_distribution set commission_frozen = (commission_frozen+#{commissionFrozen}) " + - ", rebate_total=(rebate_total+#{commissionFrozen}) " + - ", distribution_order_count=(distribution_order_count+1) WHERE id = #{distributionId}") + @Update("UPDATE li_distribution set commission_frozen = (IFNULL(commission_frozen,0)+#{commissionFrozen}) " + + ", rebate_total=(IFNULL(rebate_total,0)+#{commissionFrozen}) " + + ", distribution_order_count=(IFNULL(distribution_order_count,0)+1) WHERE id = #{distributionId}") void addCanRebate(Double commissionFrozen, String distributionId); } \ No newline at end of file From 82a9c6dbf7ee2e3e3484ec14c622038259ca5ff3 Mon Sep 17 00:00:00 2001 From: 17600048398 <277692624@qq.com> Date: Wed, 15 Mar 2023 16:28:48 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E5=88=86=E9=94=80=E9=87=91=E9=A2=9D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lili/modules/distribution/entity/dos/Distribution.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/distribution/entity/dos/Distribution.java b/framework/src/main/java/cn/lili/modules/distribution/entity/dos/Distribution.java index 58d27bdb..96599e32 100644 --- a/framework/src/main/java/cn/lili/modules/distribution/entity/dos/Distribution.java +++ b/framework/src/main/java/cn/lili/modules/distribution/entity/dos/Distribution.java @@ -53,13 +53,13 @@ public class Distribution extends BaseEntity { private String idNumber; @ApiModelProperty(value = "分销总额") - private Double rebateTotal ; + private Double rebateTotal = 0D; @ApiModelProperty(value = "可提现金额") - private Double canRebate ; + private Double canRebate = 0D; @ApiModelProperty(value = "冻结金额") - private Double commissionFrozen ; + private Double commissionFrozen = 0D; @ApiModelProperty(value = "分销订单数") private Integer distributionOrderCount; From f3e11fd368fd36e423bef48f4ea357768bbc7cae Mon Sep 17 00:00:00 2001 From: Chopper711 Date: Fri, 17 Mar 2023 08:29:15 +0800 Subject: [PATCH 05/11] =?UTF-8?q?fix:=E5=BA=97=E5=91=98=E5=8F=AF=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=BA=97=E9=95=BF=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- framework/src/main/java/cn/lili/common/enums/ResultCode.java | 1 + .../cn/lili/modules/member/serviceimpl/ClerkServiceImpl.java | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/framework/src/main/java/cn/lili/common/enums/ResultCode.java b/framework/src/main/java/cn/lili/common/enums/ResultCode.java index 13de72db..d04690f5 100644 --- a/framework/src/main/java/cn/lili/common/enums/ResultCode.java +++ b/framework/src/main/java/cn/lili/common/enums/ResultCode.java @@ -148,6 +148,7 @@ public enum ResultCode { CLERK_ALREADY_EXIT_ERROR(20030, "店员已经存在"), CLERK_DISABLED_ERROR(20031, "店员已禁用"), CLERK_CURRENT_SUPPER(20032, "无法删除当前登录店员"), + CANT_EDIT_CLERK_SHOPKEEPER(20033, "无法在店员管理编辑店员信息"), /** * 权限 */ diff --git a/framework/src/main/java/cn/lili/modules/member/serviceimpl/ClerkServiceImpl.java b/framework/src/main/java/cn/lili/modules/member/serviceimpl/ClerkServiceImpl.java index 730890ac..c1853ac3 100644 --- a/framework/src/main/java/cn/lili/modules/member/serviceimpl/ClerkServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/member/serviceimpl/ClerkServiceImpl.java @@ -148,6 +148,10 @@ public class ClerkServiceImpl extends ServiceImpl implements @Override public Clerk updateClerk(ClerkEditDTO clerkEditDTO) { Clerk clerk = this.getById(clerkEditDTO.getId()); + if(clerk.getShopkeeper()){ + throw new ServiceException(ResultCode.CANT_EDIT_CLERK_SHOPKEEPER); + } + if (clerk != null) { //校验当前店员是否是当前店铺的 if (!clerk.getStoreId().equals(UserContext.getCurrentUser().getStoreId())) { From ceb61318f0187b207a5e28b7aa7d89b4bc8d403f Mon Sep 17 00:00:00 2001 From: Chopper711 Date: Fri, 17 Mar 2023 08:55:25 +0800 Subject: [PATCH 06/11] =?UTF-8?q?refactor:=E4=BB=A3=E7=A0=81=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E5=8F=AF=E8=83=BD=E5=87=BA=E7=8E=B0=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E9=87=8D=E6=9E=84=E4=BB=A3=E7=A0=81=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/member/serviceimpl/ClerkServiceImpl.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/member/serviceimpl/ClerkServiceImpl.java b/framework/src/main/java/cn/lili/modules/member/serviceimpl/ClerkServiceImpl.java index c1853ac3..00558f93 100644 --- a/framework/src/main/java/cn/lili/modules/member/serviceimpl/ClerkServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/member/serviceimpl/ClerkServiceImpl.java @@ -148,11 +148,12 @@ public class ClerkServiceImpl extends ServiceImpl implements @Override public Clerk updateClerk(ClerkEditDTO clerkEditDTO) { Clerk clerk = this.getById(clerkEditDTO.getId()); - if(clerk.getShopkeeper()){ - throw new ServiceException(ResultCode.CANT_EDIT_CLERK_SHOPKEEPER); - } - if (clerk != null) { + //编辑店主限制 + if(clerk.getShopkeeper()){ + throw new ServiceException(ResultCode.CANT_EDIT_CLERK_SHOPKEEPER); + } + //校验当前店员是否是当前店铺的 if (!clerk.getStoreId().equals(UserContext.getCurrentUser().getStoreId())) { throw new ServiceException(ResultCode.USER_AUTHORITY_ERROR); From 08a2f7dfcdafd3064053a809939d029f0e47ffb6 Mon Sep 17 00:00:00 2001 From: Chopper711 Date: Fri, 17 Mar 2023 08:57:01 +0800 Subject: [PATCH 07/11] =?UTF-8?q?refactor:=E6=BC=94=E7=A4=BA=E7=AB=99?= =?UTF-8?q?=E7=82=B9=E5=BE=AE=E4=BF=A1=E6=B6=88=E6=81=AF=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E9=99=90=E5=88=B6=EF=BC=8C=E7=94=B1=E4=BA=8E=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E9=83=A8=E5=88=86=E5=BE=AE=E4=BF=A1=E6=B6=88=E6=81=AF=E8=A2=AB?= =?UTF-8?q?=E5=88=A0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/wechat/WechatMPMessageManagerController.java | 5 +++++ .../controller/wechat/WechatMessageManageController.java | 3 +++ 2 files changed, 8 insertions(+) diff --git a/manager-api/src/main/java/cn/lili/controller/wechat/WechatMPMessageManagerController.java b/manager-api/src/main/java/cn/lili/controller/wechat/WechatMPMessageManagerController.java index df40f95a..2310bfdc 100644 --- a/manager-api/src/main/java/cn/lili/controller/wechat/WechatMPMessageManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/wechat/WechatMPMessageManagerController.java @@ -1,5 +1,6 @@ package cn.lili.controller.wechat; +import cn.lili.common.aop.annotation.DemoSite; import cn.lili.common.enums.ResultUtil; import cn.lili.common.vo.PageVO; import cn.lili.common.vo.ResultMessage; @@ -26,6 +27,7 @@ public class WechatMPMessageManagerController { @Autowired private WechatMPMessageService wechatMPMessageService; + @DemoSite @GetMapping(value = "/init") @ApiOperation(value = "初始化微信小程序消息订阅") public ResultMessage init() { @@ -50,6 +52,7 @@ public class WechatMPMessageManagerController { return new ResultUtil>().setData(data); } + @DemoSite @PostMapping @ApiOperation(value = "新增微信小程序消息订阅") public ResultMessage save(WechatMPMessage wechatMPMessage) { @@ -58,6 +61,7 @@ public class WechatMPMessageManagerController { return new ResultUtil().setData(wechatMPMessage); } + @DemoSite @PutMapping("/{id}") @ApiOperation(value = "更新微信小程序消息订阅") public ResultMessage update(@PathVariable String id, WechatMPMessage wechatMPMessage) { @@ -65,6 +69,7 @@ public class WechatMPMessageManagerController { return new ResultUtil().setData(wechatMPMessage); } + @DemoSite @DeleteMapping(value = "/{ids}") @ApiOperation(value = "删除微信小程序消息订阅") public ResultMessage delAllByIds(@PathVariable List ids) { diff --git a/manager-api/src/main/java/cn/lili/controller/wechat/WechatMessageManageController.java b/manager-api/src/main/java/cn/lili/controller/wechat/WechatMessageManageController.java index 3bac3257..d46f6070 100644 --- a/manager-api/src/main/java/cn/lili/controller/wechat/WechatMessageManageController.java +++ b/manager-api/src/main/java/cn/lili/controller/wechat/WechatMessageManageController.java @@ -53,6 +53,7 @@ public class WechatMessageManageController { return ResultUtil.data(data); } + @DemoSite @PostMapping @ApiOperation(value = "新增微信消息") public ResultMessage save(WechatMessage wechatMessage) { @@ -61,6 +62,7 @@ public class WechatMessageManageController { return ResultUtil.data(wechatMessage); } + @DemoSite @PutMapping("/{id}") @ApiOperation(value = "更新微信消息") public ResultMessage update(@PathVariable String id, WechatMessage wechatMessage) { @@ -68,6 +70,7 @@ public class WechatMessageManageController { return ResultUtil.data(wechatMessage); } + @DemoSite @DeleteMapping(value = "/{ids}") @ApiOperation(value = "删除微信消息") public ResultMessage delAllByIds(@PathVariable List ids) { From 72471168d77dc8f62940882519e54614a2fe8e53 Mon Sep 17 00:00:00 2001 From: chc <1501738723@qq.com> Date: Fri, 17 Mar 2023 19:34:24 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E6=9B=B4=E6=96=B0read=20me=20=20?= =?UTF-8?q?=E4=BA=A4=E6=B5=81=E7=BE=A4=205?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f058df13..c781f7f8 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,8 @@ ##### 交流 qq 1群 961316482(已满) ##### 交流 qq 2群 875294241(已满) ##### 交流 qq 3群 263785057(已满) -##### 交流 qq 4群 674617534 +##### 交流 qq 4群 674617534 (已满) +##### 交流 qq 5群 594675235 ##### 体验 公众号/小程序/APP 体验,扫描二维码 From d48e5a05a619a23627f2275397a0679d263cee86 Mon Sep 17 00:00:00 2001 From: "pikachu1995@126.com" Date: Mon, 20 Mar 2023 08:43:13 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8D=8E=E4=B8=BA?= =?UTF-8?q?=E4=BA=91obs=E5=BC=95=E5=85=A5=E7=89=88=E6=9C=AC=20=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1jsapi=E6=94=AF=E4=BB=98=E4=BF=AE=E6=94=B9=E4=BD=BF?= =?UTF-8?q?=E7=94=A8openID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- framework/pom.xml | 2 +- .../cn/lili/modules/file/plugin/impl/HuaweiFilePlugin.java | 7 +++++-- .../modules/payment/kit/plugin/wechat/WechatPlugin.java | 2 +- pom.xml | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/framework/pom.xml b/framework/pom.xml index 3003fb45..472ef724 100644 --- a/framework/pom.xml +++ b/framework/pom.xml @@ -440,7 +440,7 @@ com.huaweicloud esdk-obs-java - ${huaweicloud.version} + ${huaweicloud-obs.version} com.qcloud diff --git a/framework/src/main/java/cn/lili/modules/file/plugin/impl/HuaweiFilePlugin.java b/framework/src/main/java/cn/lili/modules/file/plugin/impl/HuaweiFilePlugin.java index 62e2c64d..9e1fb32b 100644 --- a/framework/src/main/java/cn/lili/modules/file/plugin/impl/HuaweiFilePlugin.java +++ b/framework/src/main/java/cn/lili/modules/file/plugin/impl/HuaweiFilePlugin.java @@ -44,7 +44,7 @@ public class HuaweiFilePlugin implements FilePlugin { * @return */ private ObsClient getObsClient() { - return new ObsClient(ossSetting.getHuaweicloudOBSAccessKey(), ossSetting.getHuaweicloudOBSSecretKey(), ossSetting.getAliyunOSSEndPoint()); + return new ObsClient(ossSetting.getHuaweicloudOBSAccessKey(), ossSetting.getHuaweicloudOBSSecretKey(), ossSetting.getHuaweicloudOBSEndPoint()); } @@ -72,14 +72,17 @@ public class HuaweiFilePlugin implements FilePlugin { public String inputStreamUpload(InputStream inputStream, String key) { ObsClient obsClient = getObsClient(); try { - obsClient.putObject(new PutObjectRequest(ossSetting.getHuaweicloudOBSBucketName(), key, inputStream)); + PutObjectRequest putObjectRequest=new PutObjectRequest(ossSetting.getHuaweicloudOBSBucketName(), key, inputStream); + obsClient.putObject(putObjectRequest); } catch (ObsException obsException) { + obsException.printStackTrace(); throw new ServiceException(ResultCode.OSS_EXCEPTION_ERROR); } finally { try { // 关闭OBS连接 obsClient.close(); } catch (IOException e) { + e.printStackTrace(); log.error("OBS关闭连接报错!" + e.getMessage()); throw new ServiceException(ResultCode.OSS_EXCEPTION_ERROR); } diff --git a/framework/src/main/java/cn/lili/modules/payment/kit/plugin/wechat/WechatPlugin.java b/framework/src/main/java/cn/lili/modules/payment/kit/plugin/wechat/WechatPlugin.java index 9601eb25..13617a89 100644 --- a/framework/src/main/java/cn/lili/modules/payment/kit/plugin/wechat/WechatPlugin.java +++ b/framework/src/main/java/cn/lili/modules/payment/kit/plugin/wechat/WechatPlugin.java @@ -179,7 +179,7 @@ public class WechatPlugin implements Payment { try { Connect connect = connectService.queryConnect( - ConnectQueryDTO.builder().userId(UserContext.getCurrentUser().getId()).unionType(ConnectEnum.WECHAT.name()).build() + ConnectQueryDTO.builder().userId(UserContext.getCurrentUser().getId()).unionType(SourceEnum.WECHAT_OFFIACCOUNT_OPEN_ID.name()).build() ); if (connect == null) { return null; diff --git a/pom.xml b/pom.xml index 1d30464c..64f3b885 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 2.3.1 20211018.2 8.0.3 - 3.21.8 + 3.20.6.2 5.6.97 3.1.693 1.0.11 From c2abc4e2e4ecd8c9267dac1dc26940127bd76a20 Mon Sep 17 00:00:00 2001 From: chc <1501738723@qq.com> Date: Mon, 20 Mar 2023 12:03:34 +0800 Subject: [PATCH 10/11] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DIM=E6=96=B0?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=B8=8E=E8=87=AA=E5=B7=B1=E5=AF=B9=E8=AF=9D?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/im/service/ImTalkService.java | 7 +++ .../im/serviceimpl/ImTalkServiceImpl.java | 44 +++++++++++++++++++ .../lili/controller/im/ImTalkController.java | 2 +- 3 files changed, 52 insertions(+), 1 deletion(-) diff --git a/framework/src/main/java/cn/lili/modules/im/service/ImTalkService.java b/framework/src/main/java/cn/lili/modules/im/service/ImTalkService.java index 3b6f92ea..b648a393 100644 --- a/framework/src/main/java/cn/lili/modules/im/service/ImTalkService.java +++ b/framework/src/main/java/cn/lili/modules/im/service/ImTalkService.java @@ -21,6 +21,13 @@ public interface ImTalkService extends IService { */ ImTalk getTalkByUser(String userId1); + /** + * 获取与某人的聊天 + * @param userId + * @return + */ + ImTalkVO getTalkByUserId(String userId); + /** * 置顶消息 * diff --git a/framework/src/main/java/cn/lili/modules/im/serviceimpl/ImTalkServiceImpl.java b/framework/src/main/java/cn/lili/modules/im/serviceimpl/ImTalkServiceImpl.java index c03f4c01..b5a4b17f 100644 --- a/framework/src/main/java/cn/lili/modules/im/serviceimpl/ImTalkServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/im/serviceimpl/ImTalkServiceImpl.java @@ -88,6 +88,50 @@ public class ImTalkServiceImpl extends ServiceImpl impleme return imTalk; } + @Override + public ImTalkVO getTalkByUserId(String userId) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + AuthUser currentUser = Objects.requireNonNull(UserContext.getCurrentUser()); + //登录用户的Id + String selfId = ""; + //查看当前用户角色对Id进行赋值 + if(UserEnums.STORE.equals(currentUser.getRole())){ + selfId = currentUser.getStoreId(); + }else if(UserEnums.MEMBER.equals(currentUser.getRole())){ + selfId = currentUser.getId(); + } + //小数在前保证永远是同一个对话 + String finalSelfId = selfId; + queryWrapper.and(wq-> wq.eq(ImTalk::getUserId2, userId).eq(ImTalk::getUserId1, finalSelfId).or().eq(ImTalk::getUserId2, finalSelfId).eq(ImTalk::getUserId1, userId)); + ImTalk imTalk = this.getOne(queryWrapper); + //如果没有聊天,则创建聊天 + if (imTalk == null) { + //当自己为店铺时 + if(UserEnums.STORE.equals(currentUser.getRole())){ + Store selfStore = storeService.getById(selfId); + //没有这个用户信息 + Member other = memberService.getById(userId); + if(other == null){ + return null; + } + //自己为店铺其他人必定为用户 + imTalk = new ImTalk(other,selfStore); + }else if(UserEnums.MEMBER.equals(currentUser.getRole())){ + //没有这个店铺信息 + Member self = memberService.getById(selfId); + Member otherMember = memberService.getById(userId); + Store otherStore = storeService.getById(userId); + if(otherStore != null){ + imTalk = new ImTalk(self, otherStore); + }else if (otherMember != null){ + imTalk = new ImTalk(self, otherMember); + } + } + this.save(imTalk); + } + return new ImTalkVO(imTalk,currentUser.getId()); + } + /** * 发起聊天后,如果聊天不可见为true,则需要修正 * diff --git a/im-api/src/main/java/cn/lili/controller/im/ImTalkController.java b/im-api/src/main/java/cn/lili/controller/im/ImTalkController.java index 3ecbcd35..eee31a4a 100644 --- a/im-api/src/main/java/cn/lili/controller/im/ImTalkController.java +++ b/im-api/src/main/java/cn/lili/controller/im/ImTalkController.java @@ -46,7 +46,7 @@ public class ImTalkController { @GetMapping(value = "/by/user/{userId}") @ApiOperation(value = "查看与某人聊天详情") public ResultMessage getByUser(@PathVariable String userId) { - return ResultUtil.data(new ImTalkVO(imTalkService.getTalkByUser(userId),userId)); + return ResultUtil.data(imTalkService.getTalkByUserId(userId)); } @GetMapping(value = "/top") From 3fef3307078bf60fe109e9afddccba0daa39d71e Mon Sep 17 00:00:00 2001 From: Chopper711 <1814994716@qq.com> Date: Tue, 21 Mar 2023 06:26:02 +0000 Subject: [PATCH 11/11] update README.md. Signed-off-by: Chopper711 <1814994716@qq.com> --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c781f7f8..41d30105 100644 --- a/README.md +++ b/README.md @@ -165,8 +165,8 @@ PS:手机验证码为 ‘111111’ ##### 交流 qq 1群 961316482(已满) ##### 交流 qq 2群 875294241(已满) ##### 交流 qq 3群 263785057(已满) -##### 交流 qq 4群 674617534 - +##### 交流 qq 4群 674617534(已满) +##### 交流 qq 5群 594675235 ### 附录 有人有自己的学习视频、学习记录文档、希望宣传关联开源项目等均可以私聊仓库所有者。