From 0526213b637192e43ced1a9a6a38516d877adfeb Mon Sep 17 00:00:00 2001 From: chenhc <2369838784@qq.com> Date: Fri, 28 Mar 2025 17:40:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=98=B3=E9=87=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/thrsys/ThirdAliDrugController.java | 15 ++++++++++++--- .../alihealth/impl/AlihealthBusServiceImpl.java | 10 +++------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/thrsys/ThirdAliDrugController.java b/src/main/java/com/glxp/api/controller/thrsys/ThirdAliDrugController.java index 0c5ee842c..ba0bb94c5 100644 --- a/src/main/java/com/glxp/api/controller/thrsys/ThirdAliDrugController.java +++ b/src/main/java/com/glxp/api/controller/thrsys/ThirdAliDrugController.java @@ -3,6 +3,9 @@ package com.glxp.api.controller.thrsys; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; +import cn.hutool.json.JSONObject; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.TypeReference; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.github.pagehelper.PageInfo; import com.glxp.api.common.enums.ResultEnum; @@ -90,9 +93,15 @@ public class ThirdAliDrugController extends BaseController { try { BaseResponse> baseResponse = spGetHttpClient.thirdAliDrugList(alihealthThirdAliDrugInsertReqeust); if (baseResponse.getCode() == 20000) { - if (!CollUtil.isEmpty(baseResponse.getData().getList())){ - list = baseResponse.getData().getList(); - total = baseResponse.getData().getTotal(); + // 正确的类型转换(使用FastJSON的parseObject方法) + PageSimpleResponse data = JSON.parseObject( + JSON.toJSONString(baseResponse.getData()), + new TypeReference>() {} + ); + + if (data != null) { + list = data.getList(); + total = data.getTotal(); } } else { log.error("获取阿里和国家库码段信息出现错误===" + baseResponse.getMessage()); diff --git a/src/main/java/com/glxp/api/service/alihealth/impl/AlihealthBusServiceImpl.java b/src/main/java/com/glxp/api/service/alihealth/impl/AlihealthBusServiceImpl.java index 48bf93fd3..46b759348 100644 --- a/src/main/java/com/glxp/api/service/alihealth/impl/AlihealthBusServiceImpl.java +++ b/src/main/java/com/glxp/api/service/alihealth/impl/AlihealthBusServiceImpl.java @@ -253,25 +253,21 @@ public class AlihealthBusServiceImpl implements AlihealthBusService { } } - @Resource - CustomerService customerService; private AddBizProductReqeust buildProductRequest(YcFileOrderUploadVo orderUploadVo, IoOrderEntity orderEntity, String fromCorp) { orderEntity.setYcBillNo(orderUploadVo.getYcBillNo()); UdiRelevanceResponse udiRelevance = udiRelevanceService.selectByMainIdOne(orderUploadVo.getDrugUnifiedCode()); if (udiRelevance == null) { - throw new JsonException(500, "未通过药品标识获取详情信息!"); + throw new JsonException(500, "文件中的药品统一编码:【"+orderUploadVo.getDrugUnifiedCode() + "】" +"没有维护产品信息!"); } Long id = udiRelevance.getId(); - String supId = udiRelevance.getSupId(); - String userId = customerService.getCustomerId(); List companyProductRelevanceEntities = companyProductRelevanceDao.selectList(new LambdaQueryWrapper() .eq(CompanyProductRelevanceEntity::getUdiRlIdFk, id) - .eq(CompanyProductRelevanceEntity::getCustomerId, userId)); + .eq(CompanyProductRelevanceEntity::getCustomerId, fromCorp)); if (CollUtil.isEmpty(companyProductRelevanceEntities)) { - throw new JsonException(500, "当前产品标识:【" + udiRelevance.getNameCode() + "】未添加文件中供应商配送服务!"); + throw new JsonException(500, "文件中的药品统一编码:【"+orderUploadVo.getDrugUnifiedCode() + "】 产品标识:【" + udiRelevance.getNameCode() + "】未添加文件中供应商配送服务!"); } AddBizProductReqeust productRequest = new AddBizProductReqeust();