From 1c474b597d4afad2f8e49810c67aab160191fafc Mon Sep 17 00:00:00 2001 From: qiuyt Date: Tue, 4 Mar 2025 14:01:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/test/TestCodeController.java | 133 +----------------- .../AlihealthKytCommonParametersResponse.java | 4 - .../AlihealthKytDrugrescodeResponse.java | 2 - .../AlihealthKytGetentinfoResponse.java | 2 - .../AlihealthKytSinglerelationResponse.java | 6 - .../AlihealthYljgCodedetailResponse.java | 1 - .../AlihealthYljgListupoutDetailResponse.java | 3 - .../AlihealthYljgListupoutResponse.java | 3 - .../AlihealthYljgUploadinoutbillResponse.java | 4 - .../api/util/alihealth/AlihealthUtils.java | 10 -- .../util/alihealth/AlihealthYljgUtils.java | 10 -- .../glxp/api/util/alihealth/CopyUtils.java | 6 +- 12 files changed, 10 insertions(+), 174 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/test/TestCodeController.java b/src/main/java/com/glxp/api/controller/test/TestCodeController.java index 994b7ffa..3896a4cd 100644 --- a/src/main/java/com/glxp/api/controller/test/TestCodeController.java +++ b/src/main/java/com/glxp/api/controller/test/TestCodeController.java @@ -37,69 +37,14 @@ public class TestCodeController { @Resource private AlihealthUtils alihealthUtils; @Resource - private ThirdAliDrugService thirdAliDrugService; - @Resource - private RelCodeBatchService relCodeBatchService; - @Resource - private RelCodeDetailService relCodeDetailService; - @Resource - private AuthCompanyMapper authCompanyMapper; - @Resource private AlihealthYljgUtils alihealthYljgUtils; - @PostMapping("/test") - public BaseResponse test() { - AlihealthRelCodeInsertReqeust alihealthRelCodeInsertReqeust = new AlihealthRelCodeInsertReqeust(); - alihealthRelCodeInsertReqeust.setAppKey("31721223"); - alihealthRelCodeInsertReqeust.setAppSecret("5231c601505706a9d49823c3dfe2cb01"); - alihealthRelCodeInsertReqeust.setCustomerId("73157692795424"); - alihealthRelCodeInsertReqeust.setCode("88979920013901715365"); - alihealthRelCodeInsertReqeust.setRefEntId("ef99b78bd9c54c1284f813149c858fb0"); - BaseResponse baseResponse = alihealthUtils.relCodeInsert(alihealthRelCodeInsertReqeust); - if (baseResponse.getCode() == 20000) { - AlihealthKytSinglerelationResponse alihealthKytSinglerelationResponse = baseResponse.getData(); - // 返回的码关联关系进行插入 - RelCodeBatch relCodeBatch = alihealthKytSinglerelationResponse.disposeRelCodeBatch(alihealthRelCodeInsertReqeust.getCustomerId()); - RelCodeBatch relCodeBatchOne = relCodeBatchService.getOne(new QueryWrapper().eq("productCode", relCodeBatch.getProductCode()) - .last("limit 1") - ); - if (Objects.isNull(relCodeBatchOne)) { - relCodeBatch.setCreateUser(alihealthRelCodeInsertReqeust.getCustomerId()); - relCodeBatch.setCreateTime(new Date()); - relCodeBatchService.save(relCodeBatch); - - } else { - relCodeBatchService.update(relCodeBatch, new QueryWrapper().eq("productCode", relCodeBatch.getProductCode())); - } - Integer id = Objects.isNull(relCodeBatch.getId()) ? relCodeBatchOne.getId() : relCodeBatch.getId(); - // 进行查询 - List list = alihealthKytSinglerelationResponse.disposeRelRodeDetailList(id); - if (list != null && list.size() > 0) { - List curCodeList = new ArrayList(); - for (RelCodeDetail relCodeDetail : list) { - curCodeList.add(relCodeDetail.getCurCode()); - } - relCodeDetailService.remove(new QueryWrapper().in("curCode", curCodeList)); - - relCodeDetailService.saveBatch(list); - } - } - return null; - - } - - @PostMapping("/test1") - public BaseResponse test1() { + @PostMapping("/thirdAliDrugInsertAll") + public BaseResponse thirdAliDrugInsertAll() { AlihealthThirdAliDrugInsertReqeust alihealthThirdAliDrugInsertReqeust = new AlihealthThirdAliDrugInsertReqeust(); alihealthThirdAliDrugInsertReqeust.setErpId("123"); alihealthThirdAliDrugInsertReqeust.setAppSecret("5231c601505706a9d49823c3dfe2cb01"); AlihealthKytDrugrescodeReqeust alihealthKytDrugrescodeReqeust = new AlihealthKytDrugrescodeReqeust(); alihealthKytDrugrescodeReqeust.setPhysic_name("复方黄柏液涂剂"); -// alihealthKytDrugrescodeReqeust.setApproval_licence_no(); -// alihealthKytDrugrescodeReqeust.setStart_date(); -// alihealthKytDrugrescodeReqeust.setEnd_date(); -// alihealthKytDrugrescodeReqeust.setEnt_name(); -// alihealthKytDrugrescodeReqeust.setPackage_spec(); -// alihealthKytDrugrescodeReqeust.setPrepn_spec(); alihealthKytDrugrescodeReqeust.setPage_size(20); alihealthKytDrugrescodeReqeust.setPage(1); alihealthKytDrugrescodeReqeust.setApp_key("31721223"); @@ -108,11 +53,10 @@ public class TestCodeController { BaseResponse> baseResponse = alihealthUtils.thirdAliDrugInsertAll(alihealthThirdAliDrugInsertReqeust); return baseResponse; -// return alihealthUtils.thirdAliDrugInsert(alihealthThirdAliDrugInsertReqeust,true); } - @PostMapping("/test2") - public BaseResponse test2() { + @PostMapping("/thirdAliSearchbillInsert") + public BaseResponse thirdAliSearchbillInsert() { AlihealthKytThirdAliSearchbillInsertReqeust alihealthKytThirdAliSearchbillInsertReqeust = new AlihealthKytThirdAliSearchbillInsertReqeust(); alihealthKytThirdAliSearchbillInsertReqeust.setErpId("123"); alihealthKytThirdAliSearchbillInsertReqeust.setAppSecret("5231c601505706a9d49823c3dfe2cb01"); @@ -126,31 +70,12 @@ public class TestCodeController { alihealthKytSearchbillReqeust.setPage_size(20); alihealthKytSearchbillReqeust.setApp_key("31721223"); - alihealthKytThirdAliSearchbillInsertReqeust.setAlihealthKytSearchbillReqeust(alihealthKytSearchbillReqeust); -// BaseResponse> baseResponse = alihealthUtils.thirdAliDrugInsert(alihealthThirdAliDrugInsertReqeust); -// if(baseResponse.getCode() == 20000){ -// List list = baseResponse.getData(); -// if(list!=null && list.size() >0){ -// for (ThirdAliDrug thirdAliDrug : list) { -// ThirdAliDrug thirdAliDrugNew = thirdAliDrugService.getOne(new QueryWrapper().eq("nameCode", thirdAliDrug.getNameCode()) -// .last("limit 1") -// ); -// if (Objects.isNull(thirdAliDrugNew)) { -// -// thirdAliDrugService.save(thirdAliDrug); -// -// } else { -// thirdAliDrugService.update(thirdAliDrug, new QueryWrapper().eq("nameCode", thirdAliDrug.getNameCode())); -// } -// } -// } -// -// } return alihealthUtils.thirdAliSearchbillInsert(alihealthKytThirdAliSearchbillInsertReqeust); } - + @Resource + private AliCodeTestMapper aliCodeTestMapper; @PostMapping("/getAliBillCode") public BaseResponse> getAliBillCode() { @@ -194,51 +119,5 @@ public class TestCodeController { return ResultVOUtils.success(); } - @PostMapping("/getAliBill") - public BaseResponse> getAliBill() { - - AlihealthYljgListupoutReqeust alihealthYljgListupoutReqeust1 = new AlihealthYljgListupoutReqeust(); - alihealthYljgListupoutReqeust1.setBegin_date("2024-10-01"); - alihealthYljgListupoutReqeust1.setEnd_date("2025-01-15"); - alihealthYljgListupoutReqeust1.setPage(1); - alihealthYljgListupoutReqeust1.setPage_size(10000); - BaseResponse> baseResponse = alihealthYljgUtils.listupout(alihealthYljgListupoutReqeust1,null); - Map collect = baseResponse.getData().stream() - .collect(Collectors.toMap(AliYljgSearchbill::getBillCode, p -> p, (p1, p2) -> p1)); - List list = new ArrayList<>(); - for (Map.Entry entry : collect.entrySet()) { - String key = entry.getKey(); - AliYljgSearchbill value = entry.getValue(); - list.add(value); - } - - - return ResultVOUtils.success(); - } - @Resource - private AliCodeTestMapper aliCodeTestMapper; - @PostMapping("/test4") - public BaseResponse test4() { - AlihealthYljgListupoutDetailReqeust alihealthYljgListupoutDetailReqeust = new AlihealthYljgListupoutDetailReqeust(); - alihealthYljgListupoutDetailReqeust.setBill_code("19604910"); - alihealthYljgListupoutDetailReqeust.setFrom_ref_user_id("a74061d26923498785ad8489962d9de2"); - BaseResponse baseResponse = alihealthYljgUtils.listupoutDetail(alihealthYljgListupoutDetailReqeust); - List codeList = new ArrayList<>(); - AliYljgBillDetail aliYljgBillDetail = baseResponse.getData(); - for (AliYljgBillDetailDrug aliYljgBillDetailDrug : aliYljgBillDetail.getAliYljgBillDetailDrugList()) { - AliCodeTest aliCodeTest = new AliCodeTest(); - BeanUtils.copyProperties(aliYljgBillDetailDrug, aliCodeTest); - for (AliYljgBillDetailDrugCode aliYljgBillDetailDrugCode : aliYljgBillDetailDrug.getAliYljgBillDetailDrugCodeList()) { - aliCodeTest.setPrepnSpec(aliYljgBillDetailDrugCode.getPrepnSpec()); - aliCodeTest.setCode(aliYljgBillDetailDrugCode.getCode()); - aliCodeTest.setBillCode(aliYljgBillDetail.getBillCode()); - aliCodeTest.setBillTime(DateUtil.parseDate(aliYljgBillDetail.getStoreOutDate())); - aliCodeTest.setEntSendName(aliYljgBillDetail.getEntSendName()); - aliCodeTest.setFrom_ref_user_id(alihealthYljgListupoutDetailReqeust.getFrom_ref_user_id()); - aliCodeTestMapper.insert(aliCodeTest); - } - } - return ResultVOUtils.success(); - } } diff --git a/src/main/java/com/glxp/api/res/alihealth/AlihealthKytCommonParametersResponse.java b/src/main/java/com/glxp/api/res/alihealth/AlihealthKytCommonParametersResponse.java index 82ccfbc6..5394b3a0 100644 --- a/src/main/java/com/glxp/api/res/alihealth/AlihealthKytCommonParametersResponse.java +++ b/src/main/java/com/glxp/api/res/alihealth/AlihealthKytCommonParametersResponse.java @@ -1,12 +1,8 @@ package com.glxp.api.res.alihealth; -import cn.hutool.json.JSONObject; -import com.alibaba.fastjson.JSONArray; import lombok.Data; import org.apache.commons.lang.StringUtils; -import org.apache.poi.ss.formula.functions.T; -import java.util.Map; @Data public class AlihealthKytCommonParametersResponse { diff --git a/src/main/java/com/glxp/api/res/alihealth/AlihealthKytDrugrescodeResponse.java b/src/main/java/com/glxp/api/res/alihealth/AlihealthKytDrugrescodeResponse.java index bb0c36e9..e9d95422 100644 --- a/src/main/java/com/glxp/api/res/alihealth/AlihealthKytDrugrescodeResponse.java +++ b/src/main/java/com/glxp/api/res/alihealth/AlihealthKytDrugrescodeResponse.java @@ -5,7 +5,6 @@ import java.util.Date; import cn.hutool.json.JSONArray; import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; -import com.glxp.api.entity.collect.RelCodeDetail; import com.glxp.api.entity.thrsys.ThirdAliDrug; import lombok.Data; import org.apache.commons.lang3.StringUtils; @@ -13,7 +12,6 @@ import org.springframework.beans.BeanUtils; import java.util.ArrayList; import java.util.List; -import java.util.Map; import java.util.Objects; @Data diff --git a/src/main/java/com/glxp/api/res/alihealth/AlihealthKytGetentinfoResponse.java b/src/main/java/com/glxp/api/res/alihealth/AlihealthKytGetentinfoResponse.java index c73dddf2..c2dc3c00 100644 --- a/src/main/java/com/glxp/api/res/alihealth/AlihealthKytGetentinfoResponse.java +++ b/src/main/java/com/glxp/api/res/alihealth/AlihealthKytGetentinfoResponse.java @@ -1,7 +1,5 @@ package com.glxp.api.res.alihealth; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.json.JSONArray; import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; import lombok.Data; diff --git a/src/main/java/com/glxp/api/res/alihealth/AlihealthKytSinglerelationResponse.java b/src/main/java/com/glxp/api/res/alihealth/AlihealthKytSinglerelationResponse.java index 3d6550a5..2d091a1c 100644 --- a/src/main/java/com/glxp/api/res/alihealth/AlihealthKytSinglerelationResponse.java +++ b/src/main/java/com/glxp/api/res/alihealth/AlihealthKytSinglerelationResponse.java @@ -1,22 +1,16 @@ package com.glxp.api.res.alihealth; -import cn.hutool.Hutool; -import cn.hutool.http.HttpUtil; import cn.hutool.json.JSONArray; import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; -import com.baomidou.mybatisplus.annotation.TableField; import com.glxp.api.entity.collect.RelCodeBatch; import com.glxp.api.entity.collect.RelCodeDetail; import com.glxp.api.util.udi.FilterUdiUtils; -import io.swagger.annotations.ApiModelProperty; import lombok.Data; import org.apache.commons.lang3.StringUtils; -import org.apache.poi.ss.formula.functions.T; import org.springframework.beans.BeanUtils; -import java.io.Serializable; import java.util.*; @Data diff --git a/src/main/java/com/glxp/api/res/alihealth/AlihealthYljgCodedetailResponse.java b/src/main/java/com/glxp/api/res/alihealth/AlihealthYljgCodedetailResponse.java index 6d54109d..2389f871 100644 --- a/src/main/java/com/glxp/api/res/alihealth/AlihealthYljgCodedetailResponse.java +++ b/src/main/java/com/glxp/api/res/alihealth/AlihealthYljgCodedetailResponse.java @@ -4,7 +4,6 @@ import cn.hutool.core.util.IdUtil; import cn.hutool.json.JSONArray; import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; -import com.glxp.api.entity.collect.RelCodeBatch; import com.glxp.api.entity.inout.IoCodeLostEntity; import com.glxp.api.util.udi.FilterUdiUtils; import lombok.Data; diff --git a/src/main/java/com/glxp/api/res/alihealth/AlihealthYljgListupoutDetailResponse.java b/src/main/java/com/glxp/api/res/alihealth/AlihealthYljgListupoutDetailResponse.java index 1884dc62..034f87b5 100644 --- a/src/main/java/com/glxp/api/res/alihealth/AlihealthYljgListupoutDetailResponse.java +++ b/src/main/java/com/glxp/api/res/alihealth/AlihealthYljgListupoutDetailResponse.java @@ -1,18 +1,15 @@ package com.glxp.api.res.alihealth; -import cn.hutool.json.JSONArray; import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; import com.glxp.api.entity.alihealth.AliYljgBillDetail; import com.glxp.api.entity.alihealth.AliYljgBillDetailDrug; import com.glxp.api.entity.alihealth.AliYljgBillDetailDrugCode; -import com.glxp.api.entity.alihealth.AliYljgSearchbill; import com.glxp.api.util.alihealth.AlihealthUtils; import com.glxp.api.util.alihealth.CopyUtils; import lombok.Data; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Component; import javax.annotation.Resource; import java.util.ArrayList; diff --git a/src/main/java/com/glxp/api/res/alihealth/AlihealthYljgListupoutResponse.java b/src/main/java/com/glxp/api/res/alihealth/AlihealthYljgListupoutResponse.java index ed59289f..ff0a80bf 100644 --- a/src/main/java/com/glxp/api/res/alihealth/AlihealthYljgListupoutResponse.java +++ b/src/main/java/com/glxp/api/res/alihealth/AlihealthYljgListupoutResponse.java @@ -1,6 +1,5 @@ package com.glxp.api.res.alihealth; -import cn.hutool.core.bean.BeanUtil; import cn.hutool.json.JSONArray; import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; @@ -10,10 +9,8 @@ import com.glxp.api.util.alihealth.CopyUtils; import lombok.Data; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; -import org.springframework.stereotype.Component; import javax.annotation.Resource; -import java.lang.reflect.Field; import java.util.ArrayList; import java.util.List; import java.util.Objects; diff --git a/src/main/java/com/glxp/api/res/alihealth/AlihealthYljgUploadinoutbillResponse.java b/src/main/java/com/glxp/api/res/alihealth/AlihealthYljgUploadinoutbillResponse.java index 86f99bac..06bcc51f 100644 --- a/src/main/java/com/glxp/api/res/alihealth/AlihealthYljgUploadinoutbillResponse.java +++ b/src/main/java/com/glxp/api/res/alihealth/AlihealthYljgUploadinoutbillResponse.java @@ -1,9 +1,5 @@ package com.glxp.api.res.alihealth; -import cn.hutool.json.JSONObject; -import cn.hutool.json.JSONUtil; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.BeanUtils; import javax.annotation.Resource; diff --git a/src/main/java/com/glxp/api/util/alihealth/AlihealthUtils.java b/src/main/java/com/glxp/api/util/alihealth/AlihealthUtils.java index 824279ab..a606fec1 100644 --- a/src/main/java/com/glxp/api/util/alihealth/AlihealthUtils.java +++ b/src/main/java/com/glxp/api/util/alihealth/AlihealthUtils.java @@ -1,8 +1,6 @@ package com.glxp.api.util.alihealth; import cn.hutool.core.bean.BeanUtil; -import cn.hutool.http.HttpUtil; -import cn.hutool.json.JSONObject; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.constant.AliConstants; @@ -19,13 +17,9 @@ import com.glxp.api.req.alihealth.local.AlihealthKytThirdAliSearchbillInsertReqe import com.glxp.api.res.alihealth.AlihealthKytDrugrescodeResponse; import com.glxp.api.res.alihealth.AlihealthKytSearchbillResponse; import com.glxp.api.res.alihealth.AlihealthKytSinglerelationResponse; -import com.glxp.api.service.auth.CustomerInfoService; -import com.glxp.api.service.collect.RelCodeBatchService; -import com.glxp.api.service.collect.RelCodeDetailService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; @@ -34,14 +28,10 @@ import javax.crypto.Mac; import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; import java.io.IOException; -import java.lang.reflect.Field; import java.security.GeneralSecurityException; import java.security.MessageDigest; import java.text.SimpleDateFormat; import java.util.*; - -//import static com.taobao.api.internal.util.TaobaoUtils.byte2hex; - @Slf4j @Component public class AlihealthUtils { diff --git a/src/main/java/com/glxp/api/util/alihealth/AlihealthYljgUtils.java b/src/main/java/com/glxp/api/util/alihealth/AlihealthYljgUtils.java index 4c25a7e3..f5d51375 100644 --- a/src/main/java/com/glxp/api/util/alihealth/AlihealthYljgUtils.java +++ b/src/main/java/com/glxp/api/util/alihealth/AlihealthYljgUtils.java @@ -1,7 +1,6 @@ package com.glxp.api.util.alihealth; import cn.hutool.core.util.ObjectUtil; -import cn.hutool.http.HttpUtil; import cn.hutool.json.JSONUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.glxp.api.common.res.BaseResponse; @@ -11,26 +10,17 @@ import com.glxp.api.dao.basic.BasicCorpDao; import com.glxp.api.entity.alihealth.AliYljgBillDetail; import com.glxp.api.entity.alihealth.AliYljgSearchbill; import com.glxp.api.entity.auth.AuthCompany; -import com.glxp.api.entity.auth.CustomerInfoEntity; import com.glxp.api.entity.basic.BasicCorpEntity; -import com.glxp.api.entity.collect.RelCodeBatch; import com.glxp.api.entity.inout.IoCodeLostEntity; import com.glxp.api.httpClient.serviceClient.AlihealthClient; import com.glxp.api.req.alihealth.*; -import com.glxp.api.req.alihealth.local.*; import com.glxp.api.res.alihealth.*; -import com.glxp.api.service.auth.CustomerInfoService; -import com.glxp.api.service.collect.RelCodeBatchService; -import com.glxp.api.service.collect.RelCodeDetailService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import org.jfree.util.Log; -import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import javax.annotation.Resource; import java.util.List; -import java.util.Map; @Component @Slf4j diff --git a/src/main/java/com/glxp/api/util/alihealth/CopyUtils.java b/src/main/java/com/glxp/api/util/alihealth/CopyUtils.java index 6aad78a8..6127d094 100644 --- a/src/main/java/com/glxp/api/util/alihealth/CopyUtils.java +++ b/src/main/java/com/glxp/api/util/alihealth/CopyUtils.java @@ -2,12 +2,14 @@ package com.glxp.api.util.alihealth; import cn.hutool.core.bean.BeanUtil; import com.glxp.api.util.StringUtils; +import lombok.extern.slf4j.Slf4j; +import org.jfree.util.Log; import java.lang.reflect.Field; import java.util.Map; import java.util.Objects; import java.util.Set; - +@Slf4j public class CopyUtils { // 第一个参数为空才复制 public static String copyNullStr(String str,String strNew){ @@ -40,7 +42,7 @@ public class CopyUtils { } catch (Exception e) { - System.out.println("错误==="+e); + log.error("对象转换错误==="+e.getMessage()); e.printStackTrace(); // BeanUtil.copyProperties(source, target);