You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
179 lines
9.2 KiB
Java
179 lines
9.2 KiB
Java
package com.glxp.api.controller.test;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.glxp.api.common.res.BaseResponse;
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
import com.glxp.api.dao.auth.AuthCompanyMapper;
|
|
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.collect.RelCodeBatch;
|
|
import com.glxp.api.entity.collect.RelCodeDetail;
|
|
import com.glxp.api.entity.thrsys.ThirdAliDrug;
|
|
import com.glxp.api.req.alihealth.AlihealthKytDrugrescodeReqeust;
|
|
import com.glxp.api.req.alihealth.AlihealthKytSearchbillReqeust;
|
|
import com.glxp.api.req.alihealth.AlihealthYljgListupoutDetailReqeust;
|
|
import com.glxp.api.req.alihealth.AlihealthYljgListupoutReqeust;
|
|
import com.glxp.api.req.alihealth.local.AlihealthRelCodeInsertReqeust;
|
|
import com.glxp.api.req.alihealth.local.AlihealthThirdAliDrugInsertReqeust;
|
|
import com.glxp.api.req.alihealth.local.AlihealthKytThirdAliSearchbillInsertReqeust;
|
|
import com.glxp.api.res.alihealth.AlihealthKytSinglerelationResponse;
|
|
import com.glxp.api.res.alihealth.AlihealthYljgListupoutDetailResponse;
|
|
import com.glxp.api.service.collect.RelCodeBatchService;
|
|
import com.glxp.api.service.collect.RelCodeDetailService;
|
|
import com.glxp.api.service.thrsys.ThirdAliDrugService;
|
|
import com.glxp.api.util.DimaUtil;
|
|
import com.glxp.api.util.alihealth.AlihealthUtils;
|
|
import com.glxp.api.util.alihealth.AlihealthYljgUtils;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import javax.annotation.Resource;
|
|
import java.util.ArrayList;
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.Objects;
|
|
|
|
@RestController
|
|
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() {
|
|
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");
|
|
alihealthKytDrugrescodeReqeust.setRef_ent_id("ef99b78bd9c54c1284f813149c858fb0");
|
|
alihealthThirdAliDrugInsertReqeust.setAlihealthKytDrugrescodeReqeust(alihealthKytDrugrescodeReqeust);
|
|
BaseResponse<List<ThirdAliDrug>> baseResponse = alihealthUtils.thirdAliDrugInsertAll(alihealthThirdAliDrugInsertReqeust);
|
|
|
|
return baseResponse;
|
|
// return alihealthUtils.thirdAliDrugInsert(alihealthThirdAliDrugInsertReqeust,true);
|
|
}
|
|
|
|
@PostMapping("/test2")
|
|
public BaseResponse test2() {
|
|
AlihealthKytThirdAliSearchbillInsertReqeust alihealthKytThirdAliSearchbillInsertReqeust = new AlihealthKytThirdAliSearchbillInsertReqeust();
|
|
alihealthKytThirdAliSearchbillInsertReqeust.setErpId("123");
|
|
alihealthKytThirdAliSearchbillInsertReqeust.setAppSecret("5231c601505706a9d49823c3dfe2cb01");
|
|
AlihealthKytSearchbillReqeust alihealthKytSearchbillReqeust = new AlihealthKytSearchbillReqeust();
|
|
alihealthKytSearchbillReqeust.setRef_ent_id("ef99b78bd9c54c1284f813149c858fb0");
|
|
alihealthKytSearchbillReqeust.setAuth_ref_user_id("ef99b78bd9c54c1284f813149c858fb0");
|
|
alihealthKytSearchbillReqeust.setBegin_date("2019-01-01");
|
|
alihealthKytSearchbillReqeust.setEnd_date("2024-05-01");
|
|
alihealthKytSearchbillReqeust.setBill_type("A");
|
|
alihealthKytSearchbillReqeust.setCur_page(1);
|
|
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);
|
|
}
|
|
|
|
@PostMapping("/test3")
|
|
public BaseResponse<List<AliYljgSearchbill>> test3() {
|
|
|
|
AlihealthYljgListupoutReqeust alihealthYljgListupoutReqeust1 = new AlihealthYljgListupoutReqeust();
|
|
alihealthYljgListupoutReqeust1.setBegin_date("2019-01-01");
|
|
alihealthYljgListupoutReqeust1.setEnd_date("2024-05-01");
|
|
alihealthYljgListupoutReqeust1.setPage(1);
|
|
alihealthYljgListupoutReqeust1.setPage_size(20);
|
|
return alihealthYljgUtils.listupout(alihealthYljgListupoutReqeust1, "72890663819159");
|
|
}
|
|
|
|
@PostMapping("/test4")
|
|
public BaseResponse<AliYljgBillDetail> test4() {
|
|
|
|
AlihealthYljgListupoutDetailReqeust alihealthYljgListupoutDetailReqeust = new AlihealthYljgListupoutDetailReqeust();
|
|
alihealthYljgListupoutDetailReqeust.setBill_code("19604910");
|
|
alihealthYljgListupoutDetailReqeust.setFrom_ref_user_id("a74061d26923498785ad8489962d9de2");
|
|
|
|
return alihealthYljgUtils.listupoutDetail(alihealthYljgListupoutDetailReqeust);
|
|
}
|
|
}
|