定时获取工位库存码三期

dev_drug_dmyh250207
qiuyt 2 weeks ago
parent 36323cdd88
commit 9bb7c78de3

@ -6,6 +6,7 @@ import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.Log;
import com.glxp.api.common.res.BaseResponse;
@ -13,16 +14,17 @@ import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BusinessType;
import com.glxp.api.controller.BaseController;
import com.glxp.api.controller.inout.IoOrderReviewController;
import com.glxp.api.dao.inout.IoCodeDao;
import com.glxp.api.entity.alihealth.AliYljgBillDetail;
import com.glxp.api.entity.alihealth.AliYljgSearchbill;
import com.glxp.api.entity.collect.IoCollectCodeBackup;
import com.glxp.api.entity.inout.IoCodeEntity;
import com.glxp.api.entity.inout.IoCodeLostEntity;
import com.glxp.api.entity.inout.IoOrderEntity;
import com.glxp.api.entity.thrsys.CodeRel;
import com.glxp.api.entity.thrsys.ThirdAliDrug;
import com.glxp.api.entity.thrsys.YbDrug;
import com.glxp.api.req.alihealth.AliYljgSearchbillReqeust;
import com.glxp.api.req.alihealth.AlihealthKytDrugrescodeReqeust;
import com.glxp.api.req.alihealth.AlihealthKytGetentinfoReqeust;
import com.glxp.api.req.alihealth.*;
import com.glxp.api.req.alihealth.local.AliBillsDisposeReqeust;
import com.glxp.api.req.alihealth.local.AlihealthGetRelCodeReqeust;
import com.glxp.api.req.alihealth.local.AlihealthRelCodeInsertReqeust;
@ -31,11 +33,13 @@ import com.glxp.api.req.thrsys.ThirdAliDrugRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.alihealth.AlihealthKytGetentinfoResponse;
import com.glxp.api.service.alihealth.AlihealthBusService;
import com.glxp.api.service.basic.UdiContrastService;
import com.glxp.api.service.collect.RelCodeBatchService;
import com.glxp.api.service.inout.IoOrderService;
import com.glxp.api.util.DateUtil;
import com.glxp.api.util.alihealth.AlihealthUtils;
import com.glxp.api.util.alihealth.AlihealthYljgUtils;
import com.glxp.api.util.alihealth.PaginationUtil;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
@ -44,9 +48,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
@Slf4j
@ -256,6 +258,8 @@ public class AlihealthBusController extends BaseController {
@Resource
private IoOrderReviewController ioOrderReviewController;
@Resource
private AlihealthYljgUtils alihealthYljgUtils;
@PostMapping("/spms/alihealth/aliBillsDispose")
@Log(title = "手动调用阿里单据上传和关联关系拉取", businessType = BusinessType.OTHER)
public BaseResponse aliBillsDispose(@RequestBody AliBillsDisposeReqeust aliBillsDisposeReqeust) {
@ -271,24 +275,11 @@ public class AlihealthBusController extends BaseController {
return ResultVOUtils.success("成功");
}
@Resource
private UdiContrastService udiContrastService;
@PostMapping("/spms/alihealth/codeRelUpdateBatch")
@Log(title = "上传国家库多码融合库", businessType = BusinessType.OTHER)
public BaseResponse codeRelUpdateBatch(@RequestBody List<CodeRel> list) {
return udiContrastService.codeRelUpdateBatch(list);
@PostMapping("/spms/alihealth/codedetail")
@Log(title = "根据码查询码信息", businessType = BusinessType.OTHER)
public BaseResponse<List<IoCodeLostEntity>> codedetail(@RequestBody AlihealthYljgCodedetailReqeust alihealthYljgCodedetailReqeust) {
return alihealthYljgUtils.codedetail(alihealthYljgCodedetailReqeust);
}
@PostMapping("/spms/alihealth/deleteRelCode")
@Log(title = "删除多玛融合库", businessType = BusinessType.OTHER)
public BaseResponse deleteRelCode(@RequestBody CodeRel codeRel) {
return udiContrastService.deleteRelCode(codeRel);
}
@PostMapping("/spms/alihealth/optThirdAliDrug")
@Log(title = "删除多玛融合库", businessType = BusinessType.OTHER)
public BaseResponse optThirdAliDrug(@RequestBody ThirdAliDrugRequest thirdAliDrugRequest) {
return ResultVOUtils.success(udiContrastService.optThirdAliDrug(thirdAliDrugRequest));
}
}

@ -82,8 +82,8 @@ public class TestCodeController {
public BaseResponse<List<AliYljgSearchbill>> getAliBillCode() {
AlihealthYljgListupoutReqeust alihealthYljgListupoutReqeust1 = new AlihealthYljgListupoutReqeust();
alihealthYljgListupoutReqeust1.setBegin_date("2024-10-01");
alihealthYljgListupoutReqeust1.setEnd_date("2025-01-15");
alihealthYljgListupoutReqeust1.setBegin_date("2025-03-01");
alihealthYljgListupoutReqeust1.setEnd_date("2025-03-24");
alihealthYljgListupoutReqeust1.setPage(1);
alihealthYljgListupoutReqeust1.setPage_size(10000);
BaseResponse<List<AliYljgSearchbill>> baseResponse = alihealthYljgUtils.listupout(alihealthYljgListupoutReqeust1,null);
@ -96,29 +96,34 @@ public class TestCodeController {
list.add(value);
}
for (AliYljgSearchbill datum : list) {
AlihealthYljgListupoutDetailReqeust alihealthYljgListupoutDetailReqeust = new AlihealthYljgListupoutDetailReqeust();
alihealthYljgListupoutDetailReqeust.setBill_code(datum.getBillCode());
alihealthYljgListupoutDetailReqeust.setFrom_ref_user_id(datum.getFromRefUserId());
BaseResponse<AliYljgBillDetail> baseResponseNew = alihealthYljgUtils.listupoutDetail(alihealthYljgListupoutDetailReqeust);
List<String> codeList = new ArrayList<>();
AliYljgBillDetail aliYljgBillDetail = baseResponseNew.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);
try {
for (AliYljgSearchbill datum : list) {
AlihealthYljgListupoutDetailReqeust alihealthYljgListupoutDetailReqeust = new AlihealthYljgListupoutDetailReqeust();
alihealthYljgListupoutDetailReqeust.setBill_code(datum.getBillCode());
alihealthYljgListupoutDetailReqeust.setFrom_ref_user_id(datum.getFromRefUserId());
BaseResponse<AliYljgBillDetail> baseResponseNew = alihealthYljgUtils.listupoutDetail(alihealthYljgListupoutDetailReqeust);
List<String> codeList = new ArrayList<>();
AliYljgBillDetail aliYljgBillDetail = baseResponseNew.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);
}
}
}
}catch (Exception e){
e.printStackTrace();
System.out.println("错误");
}
return ResultVOUtils.success();
}
@Resource

Loading…
Cancel
Save