From 4c06fcb809ffae4dca571d967662b92e32a7c278 Mon Sep 17 00:00:00 2001 From: chenhc <2369838784@qq.com> Date: Tue, 12 Nov 2024 15:35:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=8D=AF=E5=93=81=E5=85=B3=E8=81=94?= =?UTF-8?q?=E5=85=B3=E7=B3=BB=E6=9F=A5=E9=87=8D=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../collect/RelCodeBatchController.java | 14 ++++++++++++++ .../service/collect/RelCodeBatchService.java | 17 +++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/src/main/java/com/glxp/udidl/admin/controller/collect/RelCodeBatchController.java b/src/main/java/com/glxp/udidl/admin/controller/collect/RelCodeBatchController.java index e3aac09..052289c 100644 --- a/src/main/java/com/glxp/udidl/admin/controller/collect/RelCodeBatchController.java +++ b/src/main/java/com/glxp/udidl/admin/controller/collect/RelCodeBatchController.java @@ -1,9 +1,13 @@ package com.glxp.udidl.admin.controller.collect; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.text.CharSequenceUtil; import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.github.pagehelper.PageInfo; +import com.glxp.udidl.admin.entity.chs.CodeRel; import com.glxp.udidl.admin.entity.collect.RelCodeBatch; +import com.glxp.udidl.admin.enums.ResultEnum; import com.glxp.udidl.admin.req.collect.RelCodeBatchRequest; import com.glxp.udidl.admin.req.collect.RelCodeDetailRequest; import com.glxp.udidl.admin.res.BaseResponse; @@ -11,6 +15,7 @@ import com.glxp.udidl.admin.res.PageSimpleResponse; import com.glxp.udidl.admin.res.collect.RelCodeBatchResponse; import com.glxp.udidl.admin.service.collect.RelCodeBatchService; import com.glxp.udidl.admin.util.ResultVOUtils; +import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.*; @@ -99,4 +104,13 @@ public class RelCodeBatchController { return ResultVOUtils.success(relCodeBatchService.detailByParentCode(parentCode)); } + @PostMapping("/udiwms/relCode/checkCode") + public BaseResponse checkCode(@RequestBody List codeList) { + if (CollUtil.isEmpty(codeList)){ + return ResultVOUtils.error(ResultEnum.DATA_ERROR,"参数错误"); + } + List list = relCodeBatchService.checkCode(codeList); + return ResultVOUtils.success(list); + } + } diff --git a/src/main/java/com/glxp/udidl/admin/service/collect/RelCodeBatchService.java b/src/main/java/com/glxp/udidl/admin/service/collect/RelCodeBatchService.java index b176b16..a522868 100644 --- a/src/main/java/com/glxp/udidl/admin/service/collect/RelCodeBatchService.java +++ b/src/main/java/com/glxp/udidl/admin/service/collect/RelCodeBatchService.java @@ -298,4 +298,21 @@ public class RelCodeBatchService extends ServiceImpl checkCode(List codeList) { + List list = new ArrayList<>(); + List list1 = relCodeDetailService.list(new LambdaQueryWrapper().in(RelCodeDetail::getCurCode, codeList)); + List list2 = relCodeDetailService.list(new LambdaQueryWrapper().in(RelCodeDetail::getParentCode, codeList)); + if (CollUtil.isNotEmpty(list1)){ + list1.forEach(item -> { + list.add(item.getCurCode()); + }); + } + if (CollUtil.isNotEmpty(list2)){ + list2.forEach(item -> { + list.add(item.getParentCode()); + }); + } + return list; + } }