From 0179e57d73b235823cdbc9e643aed7935ef108ef Mon Sep 17 00:00:00 2001 From: qiuyt Date: Fri, 10 Jan 2025 11:19:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=9A=E7=A0=81=E8=9E=8D=E5=90=88=E8=A1=A8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AD=97=E6=AE=B5=E5=92=8C=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../collect/ThirdAliDrugController.java | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/glxp/udidl/admin/controller/collect/ThirdAliDrugController.java b/src/main/java/com/glxp/udidl/admin/controller/collect/ThirdAliDrugController.java index 8332fd6..3b1e36d 100644 --- a/src/main/java/com/glxp/udidl/admin/controller/collect/ThirdAliDrugController.java +++ b/src/main/java/com/glxp/udidl/admin/controller/collect/ThirdAliDrugController.java @@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil; import cn.hutool.core.thread.ThreadUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.github.pagehelper.PageInfo; import com.glxp.udidl.admin.entity.collect.ThirdAliDrug; import com.glxp.udidl.admin.enums.ResultEnum; @@ -18,12 +19,14 @@ import com.glxp.udidl.admin.service.collect.ThirdAliDrugService; import com.glxp.udidl.admin.util.ResultVOUtils; import com.glxp.udidl.admin.util.alihealth.AlihealthUtils; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import javax.validation.Valid; +import java.util.ArrayList; import java.util.List; @RestController @@ -119,12 +122,34 @@ public class ThirdAliDrugController { - + @PostMapping("/udiwms/aliDrug/optThirdAliDrug") + public BaseResponse optThirdAliDrug(@RequestBody @Valid ThirdAliDrugRequest thirdAliDrugRequest, BindingResult bindingResult) { + if (StrUtil.isEmpty(thirdAliDrugRequest.getNameCode())) { + return ResultVOUtils.error(ResultEnum.DATA_REPEAT,"标识参数不能为空"); + } + ThirdAliDrug thirdAliDrugServiceOne = thirdAliDrugService.getOne( + new QueryWrapper().eq("nameCode", thirdAliDrugRequest.getNameCode()).last("limit 1") + ); + String str = ""; + List thirdAliDrugList = new ArrayList<>(); + if (thirdAliDrugServiceOne != null) { + thirdAliDrugList = thirdAliDrugService.list( + new QueryWrapper().eq(StringUtils.isNotBlank(thirdAliDrugServiceOne.getBzgg()), "bzgg", thirdAliDrugServiceOne.getBzgg()) + .eq(StringUtils.isNotBlank(thirdAliDrugServiceOne.getPackRatio()), "packRatio", thirdAliDrugServiceOne.getPackRatio()) + .like(StringUtils.isNotBlank(thirdAliDrugRequest.getCpmctymc()), "cpmctymc", thirdAliDrugRequest.getCpmctymc()) + .like(StringUtils.isNotBlank(thirdAliDrugRequest.getManufacturer()), "manufacturer", thirdAliDrugRequest.getManufacturer()) + .like(StringUtils.isNotBlank(thirdAliDrugRequest.getApprovalNum()), "approvalNum", thirdAliDrugRequest.getApprovalNum()) + .like(StringUtils.isNotBlank(thirdAliDrugRequest.getFormSpec()), "formSpec", thirdAliDrugRequest.getFormSpec()) + .like(StringUtils.isNotBlank(thirdAliDrugRequest.getBzgg()), "bzgg", thirdAliDrugRequest.getBzgg()) + + ); + } + return ResultVOUtils.success(thirdAliDrugList); + } @GetMapping("/udiwms/aliDrug/111") public BaseResponse teest111() { thirdAliDrugService.updateThirdAliDrugTask(); return ResultVOUtils.success(); } - }