|
|
|
@ -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<AlihealthKytSinglerelationResponse> baseResponse = alihealthUtils.relCodeInsert(alihealthRelCodeInsertReqeust);
|
|
|
|
|
if (baseResponse.getCode() == 20000) {
|
|
|
|
|
AlihealthKytSinglerelationResponse alihealthKytSinglerelationResponse = baseResponse.getData();
|
|
|
|
|
// 返回的码关联关系进行插入
|
|
|
|
|
RelCodeBatch relCodeBatch = alihealthKytSinglerelationResponse.disposeRelCodeBatch(alihealthRelCodeInsertReqeust.getCustomerId());
|
|
|
|
|
RelCodeBatch relCodeBatchOne = relCodeBatchService.getOne(new QueryWrapper<RelCodeBatch>().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<RelCodeBatch>().eq("productCode", relCodeBatch.getProductCode()));
|
|
|
|
|
}
|
|
|
|
|
Integer id = Objects.isNull(relCodeBatch.getId()) ? relCodeBatchOne.getId() : relCodeBatch.getId();
|
|
|
|
|
// 进行查询
|
|
|
|
|
List<RelCodeDetail> 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<RelCodeDetail>().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<List<ThirdAliDrug>> 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<List<ThirdAliDrug>> baseResponse = alihealthUtils.thirdAliDrugInsert(alihealthThirdAliDrugInsertReqeust);
|
|
|
|
|
// if(baseResponse.getCode() == 20000){
|
|
|
|
|
// List<ThirdAliDrug> list = baseResponse.getData();
|
|
|
|
|
// if(list!=null && list.size() >0){
|
|
|
|
|
// for (ThirdAliDrug thirdAliDrug : list) {
|
|
|
|
|
// ThirdAliDrug thirdAliDrugNew = thirdAliDrugService.getOne(new QueryWrapper<ThirdAliDrug>().eq("nameCode", thirdAliDrug.getNameCode())
|
|
|
|
|
// .last("limit 1")
|
|
|
|
|
// );
|
|
|
|
|
// if (Objects.isNull(thirdAliDrugNew)) {
|
|
|
|
|
//
|
|
|
|
|
// thirdAliDrugService.save(thirdAliDrug);
|
|
|
|
|
//
|
|
|
|
|
// } else {
|
|
|
|
|
// thirdAliDrugService.update(thirdAliDrug, new QueryWrapper<ThirdAliDrug>().eq("nameCode", thirdAliDrug.getNameCode()));
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
return alihealthUtils.thirdAliSearchbillInsert(alihealthKytThirdAliSearchbillInsertReqeust);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private AliCodeTestMapper aliCodeTestMapper;
|
|
|
|
|
@PostMapping("/getAliBillCode")
|
|
|
|
|
public BaseResponse<List<AliYljgSearchbill>> getAliBillCode() {
|
|
|
|
|
|
|
|
|
@ -194,51 +119,5 @@ public class TestCodeController {
|
|
|
|
|
|
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
|
}
|
|
|
|
|
@PostMapping("/getAliBill")
|
|
|
|
|
public BaseResponse<List<AliYljgSearchbill>> 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<List<AliYljgSearchbill>> baseResponse = alihealthYljgUtils.listupout(alihealthYljgListupoutReqeust1,null);
|
|
|
|
|
Map<String, AliYljgSearchbill> collect = baseResponse.getData().stream()
|
|
|
|
|
.collect(Collectors.toMap(AliYljgSearchbill::getBillCode, p -> p, (p1, p2) -> p1));
|
|
|
|
|
List<AliYljgSearchbill> list = new ArrayList<>();
|
|
|
|
|
for (Map.Entry<String, AliYljgSearchbill> 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<AliYljgBillDetail> test4() {
|
|
|
|
|
|
|
|
|
|
AlihealthYljgListupoutDetailReqeust alihealthYljgListupoutDetailReqeust = new AlihealthYljgListupoutDetailReqeust();
|
|
|
|
|
alihealthYljgListupoutDetailReqeust.setBill_code("19604910");
|
|
|
|
|
alihealthYljgListupoutDetailReqeust.setFrom_ref_user_id("a74061d26923498785ad8489962d9de2");
|
|
|
|
|
BaseResponse<AliYljgBillDetail> baseResponse = alihealthYljgUtils.listupoutDetail(alihealthYljgListupoutDetailReqeust);
|
|
|
|
|
List<String> 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();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|