From 96c1688f6bb469a4e3f2610b2d4551f33e4719cc Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Mon, 9 Dec 2024 16:04:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=89=E6=96=B9=E5=95=86=E5=9F=8E=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BasicdataTripartiteMallController.java | 2 +- .../BasicdataTripartiteMallServiceImpl.java | 44 ++++++++++++++++++- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTripartiteMallController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTripartiteMallController.java index 9709bf586..8eafb7aea 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTripartiteMallController.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTripartiteMallController.java @@ -118,7 +118,7 @@ public class BasicdataTripartiteMallController extends BladeController { @ApiOperationSupport(order = 4) @ApiOperation(value = "新增", notes = "传入basicdataTripartiteMall") public R save(@Valid @RequestBody BasicdataTripartiteMallEntity basicdataTripartiteMall) { - return R.status(basicdataTripartiteMallService.save(basicdataTripartiteMall)); + return basicdataTripartiteMallService.saveTripartiteMallEntity(basicdataTripartiteMall); } /** diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTripartiteMallServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTripartiteMallServiceImpl.java index 726cfa008..64a890f72 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTripartiteMallServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTripartiteMallServiceImpl.java @@ -19,6 +19,7 @@ package com.logpm.basicdata.service.impl; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.logpm.basicdata.dto.BasicdataTripartiteMallDTO; import com.logpm.basicdata.entity.BasicdataClientEntity; import com.logpm.basicdata.entity.BasicdataClientLogEntity; @@ -31,6 +32,7 @@ import com.logpm.basicdata.service.IBasicdataTripartiteMallService; import com.logpm.basicdata.vo.BasicdataTripartiteMallVO; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.jetbrains.annotations.Nullable; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; @@ -120,13 +122,16 @@ public class BasicdataTripartiteMallServiceImpl extends BaseServiceImpl list = this.list(Wrappers.query().lambda() + .eq(BasicdataTripartiteMallEntity::getBrandName, basicdataTripartiteMall.getBrandName()) + .eq(BasicdataTripartiteMallEntity::getTripartiteMall, basicdataTripartiteMall.getTripartiteMall()) + .eq(!Objects.isNull(basicdataTripartiteMall.getTripartiteCoding()), BasicdataTripartiteMallEntity::getTripartiteCoding, basicdataTripartiteMall.getTripartiteCoding()) + ); + if (!list.isEmpty()) { + List collect = list.stream().map(BasicdataTripartiteMallEntity::getClientId).collect(Collectors.toList()); + if (!collect.isEmpty()) { + List basicdataClientEntityList = basicdataClientService.listByIds(collect); + if (!basicdataClientEntityList.isEmpty()) { + String s = basicdataClientEntityList.stream().map(BasicdataClientEntity::getClientName).distinct().collect(Collectors.joining(",")); + return R.fail("当前商城信息已在[" + s + "]客户下存在!!!"); + + } + + } + return R.fail("当前商城信息已存在!!!"); + } + return R.status(true); + } + private Boolean judgeComparisonBasicdataTripartiteMall(BasicdataTripartiteMallEntity entity, BasicdataTripartiteMallEntity basicdataTripartiteMall) { String str1 = StringUtil.isBlank(entity.getTripartiteCoding()) ? "空" : entity.getTripartiteCoding(); String str2 = StringUtil.isBlank(basicdataTripartiteMall.getTripartiteCoding()) ? "空" : basicdataTripartiteMall.getTripartiteCoding(); @@ -196,6 +224,20 @@ public class BasicdataTripartiteMallServiceImpl extends BaseServiceImpl list = this.list(Wrappers.query().lambda() + .eq(BasicdataTripartiteMallEntity::getBrandName, basicdataTripartiteMall.getBrandName()) + .eq(BasicdataTripartiteMallEntity::getTripartiteMall, basicdataTripartiteMall.getTripartiteMall()) + .eq(Objects.isNull(basicdataTripartiteMall.getTripartiteCoding()), BasicdataTripartiteMallEntity::getTripartiteCoding, basicdataTripartiteMall.getTripartiteCoding()) + ); + if (!list.isEmpty()) { + return R.fail("当前商城信息已存在!!!"); + } + this.save(basicdataTripartiteMall); + return R.success("操作成功"); + } + private String comparisonBasicdataTripartiteMall(BasicdataTripartiteMallEntity entity, BasicdataTripartiteMallEntity basicdataTripartiteMall) { StringBuilder builder = new StringBuilder(); String str1 = entity.getTripartiteCoding().isEmpty() ? "空" : entity.getTripartiteCoding();