接口调整

This commit is contained in:
daichao 2025-06-16 14:32:18 +08:00
parent a5afa9955d
commit 9617b16473
3 changed files with 77 additions and 9 deletions

View File

@ -0,0 +1,43 @@
package com.alihealth.d2d.provtest.VO;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 药品发货单与收货单信息的中间层按照时间进行排序
*/
@Data
public class DrugInvoiceAndDeliveryInfoVO implements Serializable {
private static final long serialVersionUID = -9217183676850562960L;
/**
* 时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date sj;
/**
* 公司信用代码
*/
private String tyshxydm;
/**
* 公司名称
*/
private String gsmc;
/**
* 订单号
*/
private String ddh;
/**
* 单据类型 : delivery : 收货单invoice : 发货单
*/
private String djlx;
}

View File

@ -16,14 +16,9 @@ public class DrugRetraceVO implements Serializable {
private DrugProductionInfoVO drugProductionInfoVO;
/**
* 药品发货信息 发货信息可能会有多条
* 药品发货单与收货单信息
*/
private List<DrugInvoiceInfoVO> drugInvoiceInfoVOList;
/**
* 药品收货信息 收货信息可能会有多条
*/
private List<DrugDeliveryNoteInfoVO> drugDeliveryNoteInfoVOList;
private List<DrugInvoiceAndDeliveryInfoVO> drugInvoiceAndDeliveryInfoVOList;
/**
* 药品零售与药品使用信息

View File

@ -7,7 +7,9 @@ import com.alihealth.d2d.provtest.searcher.DrugRetraceSearcher;
import com.alihealth.d2d.provtest.service.DrugRetraceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@ -42,12 +44,40 @@ public class DrugRetraceServiceImpl implements DrugRetraceService {
throw new ServiceException("未查询到该药品!");
}
drugRetraceVO.setDrugProductionInfoVO(drugProductionInfoVO);
//统一发货单与收货单并行排序
List<DrugInvoiceAndDeliveryInfoVO> drugInvoiceAndDeliveryInfoVOList = new ArrayList<>();
// 查询发货单
List<DrugInvoiceInfoVO> drugInvoiceInfoVOList = drugInvoiceApplyInfoMapper.selectByYpzsm(searcher.getYpzsm());
drugRetraceVO.setDrugInvoiceInfoVOList(drugInvoiceInfoVOList);
if (!CollectionUtils.isEmpty(drugInvoiceInfoVOList)) {
for (DrugInvoiceInfoVO drugInvoiceInfoVO : drugInvoiceInfoVOList) {
DrugInvoiceAndDeliveryInfoVO drugInvoiceAndDeliveryInfoVO = new DrugInvoiceAndDeliveryInfoVO();
drugInvoiceAndDeliveryInfoVO.setSj(drugInvoiceInfoVO.getFhsj());
drugInvoiceAndDeliveryInfoVO.setTyshxydm(drugInvoiceInfoVO.getTyshxydmfhjg());
drugInvoiceAndDeliveryInfoVO.setGsmc(drugInvoiceInfoVO.getFhjgmc());
drugInvoiceAndDeliveryInfoVO.setDdh(drugInvoiceInfoVO.getFhdbh());
drugInvoiceAndDeliveryInfoVO.setDjlx("invoice");
drugInvoiceAndDeliveryInfoVOList.add(drugInvoiceAndDeliveryInfoVO);
}
}
// 查询收货单
List<DrugDeliveryNoteInfoVO> drugDeliveryNoteInfoVOList = drugDeliveryNoteApplyInfoMapper.selectByYpzsm(searcher.getYpzsm());
drugRetraceVO.setDrugDeliveryNoteInfoVOList(drugDeliveryNoteInfoVOList);
if (!CollectionUtils.isEmpty(drugDeliveryNoteInfoVOList)) {
for (DrugDeliveryNoteInfoVO drugDeliveryNoteInfoVO : drugDeliveryNoteInfoVOList) {
DrugInvoiceAndDeliveryInfoVO drugInvoiceAndDeliveryInfoVO = new DrugInvoiceAndDeliveryInfoVO();
drugInvoiceAndDeliveryInfoVO.setSj(drugDeliveryNoteInfoVO.getShsj());
drugInvoiceAndDeliveryInfoVO.setTyshxydm(drugDeliveryNoteInfoVO.getTyshxydmshjg());
drugInvoiceAndDeliveryInfoVO.setGsmc(drugDeliveryNoteInfoVO.getShjgmc());
drugInvoiceAndDeliveryInfoVO.setDdh(drugDeliveryNoteInfoVO.getShdbh());
drugInvoiceAndDeliveryInfoVO.setDjlx("delivery");
drugInvoiceAndDeliveryInfoVOList.add(drugInvoiceAndDeliveryInfoVO);
}
}
if (!CollectionUtils.isEmpty(drugInvoiceAndDeliveryInfoVOList)) {
drugInvoiceAndDeliveryInfoVOList.sort((o1, o2) -> o1.getSj().compareTo(o2.getSj()));
}
drugRetraceVO.setDrugInvoiceAndDeliveryInfoVOList(drugInvoiceAndDeliveryInfoVOList);
// 查询零售及使用信息
DrugRetailAndUseInfoVO drugRetailAndUseInfoVO = drugRetailAndUseApplyInfoMapper.selectByYpzsm(searcher.getYpzsm());
drugRetraceVO.setDrugRetailAndUseInfoVO(drugRetailAndUseInfoVO);