|
|
@ -1755,11 +1755,46 @@ public class CtqyyClient extends CommonHttpClient {
|
|
|
|
private BaseResponse covertSellOrder(UdiwmsBasicSkPrescribeRequest udiwmsBasicSkPrescribeRequest, IPage<VYpzsPresInfo> page) {
|
|
|
|
private BaseResponse covertSellOrder(UdiwmsBasicSkPrescribeRequest udiwmsBasicSkPrescribeRequest, IPage<VYpzsPresInfo> page) {
|
|
|
|
List<VYpzsPresInfo> presInfoEntities = page.getRecords();
|
|
|
|
List<VYpzsPresInfo> presInfoEntities = page.getRecords();
|
|
|
|
List<VYpzsPresInfo> vInsurNationGoodsPhysics = new ArrayList<>();
|
|
|
|
List<VYpzsPresInfo> vInsurNationGoodsPhysics = new ArrayList<>();
|
|
|
|
|
|
|
|
String summaryNo;
|
|
|
|
if (CollUtil.isNotEmpty(presInfoEntities)) {
|
|
|
|
if (CollUtil.isNotEmpty(presInfoEntities)) {
|
|
|
|
List<String> collect = presInfoEntities.stream().map(VYpzsPresInfo::getPRESCRIBE_NUMBER).collect(Collectors.toList());
|
|
|
|
if (presInfoEntities.size() == 1) {//进入拉取周边的同患者同处方 通过患者id 和 周边时间 上下10分钟
|
|
|
|
LambdaQueryWrapper<VYpzsPresInfo> wrapper1 = new LambdaQueryWrapper<>();
|
|
|
|
VYpzsPresInfo vYpzsPresInfo = presInfoEntities.get(0);
|
|
|
|
wrapper1.in(VYpzsPresInfo::getPRESCRIBE_NUMBER, collect);
|
|
|
|
|
|
|
|
vInsurNationGoodsPhysics = vYpzsPresInfoMapper.selectList(wrapper1);
|
|
|
|
LambdaQueryWrapper<VYpzsPresInfo> wrapper1 = new LambdaQueryWrapper<>();
|
|
|
|
|
|
|
|
wrapper1.eq(VYpzsPresInfo::getPRESCRIBE_NUMBER, vYpzsPresInfo.getPRESCRIBE_NUMBER());
|
|
|
|
|
|
|
|
presInfoEntities = vYpzsPresInfoMapper.selectList(wrapper1);
|
|
|
|
|
|
|
|
vYpzsPresInfo = presInfoEntities.get(0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String layTimeStr = vYpzsPresInfo.getLAY_TIME();//当前处方的时间
|
|
|
|
|
|
|
|
String sickId = vYpzsPresInfo.getSICK_ID();
|
|
|
|
|
|
|
|
String icCardId = vYpzsPresInfo.getIC_CARD_ID();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 时间格式处理(补充格式定义)
|
|
|
|
|
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 转换为 LocalDateTime 并计算时间范围
|
|
|
|
|
|
|
|
LocalDateTime layTime = LocalDateTime.parse(layTimeStr, formatter);
|
|
|
|
|
|
|
|
LocalDateTime startTime = layTime.minusMinutes(10); // 向前10分钟
|
|
|
|
|
|
|
|
LocalDateTime endTime = layTime.plusMinutes(10); // 向后10分钟
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
summaryNo = layTime.format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")) + icCardId;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<VYpzsPresInfo> wrapper2 = new LambdaQueryWrapper<>();
|
|
|
|
|
|
|
|
wrapper2.between(VYpzsPresInfo::getLAY_TIME, startTime.format(formatter), endTime.format(formatter));
|
|
|
|
|
|
|
|
wrapper2.eq(VYpzsPresInfo::getSICK_ID, sickId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vInsurNationGoodsPhysics = vYpzsPresInfoMapper.selectList(wrapper2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
summaryNo = "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<String> collect = presInfoEntities.stream().map(VYpzsPresInfo::getPRESCRIBE_NUMBER).collect(Collectors.toList());
|
|
|
|
|
|
|
|
LambdaQueryWrapper<VYpzsPresInfo> wrapper1 = new LambdaQueryWrapper<>();
|
|
|
|
|
|
|
|
wrapper1.in(VYpzsPresInfo::getPRESCRIBE_NUMBER, collect);
|
|
|
|
|
|
|
|
vInsurNationGoodsPhysics = vYpzsPresInfoMapper.selectList(wrapper1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
summaryNo = "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: 2024/9/19 这边在转换的时候就不能用VInsurNationGoodsPhysic
|
|
|
|
// TODO: 2024/9/19 这边在转换的时候就不能用VInsurNationGoodsPhysic
|
|
|
@ -1796,6 +1831,9 @@ public class CtqyyClient extends CommonHttpClient {
|
|
|
|
ioCollectOrder.setUpdateTime(new Date());
|
|
|
|
ioCollectOrder.setUpdateTime(new Date());
|
|
|
|
ioCollectOrder.setSplitStatus(0);
|
|
|
|
ioCollectOrder.setSplitStatus(0);
|
|
|
|
ioCollectOrder.setTagStatus(0);
|
|
|
|
ioCollectOrder.setTagStatus(0);
|
|
|
|
|
|
|
|
if (StrUtil.isNotEmpty(summaryNo)){
|
|
|
|
|
|
|
|
ioCollectOrder.setSummaryNo(summaryNo);
|
|
|
|
|
|
|
|
}
|
|
|
|
List<IoCollectOrderBiz> bizList = new ArrayList<>();
|
|
|
|
List<IoCollectOrderBiz> bizList = new ArrayList<>();
|
|
|
|
value.forEach(entity -> {
|
|
|
|
value.forEach(entity -> {
|
|
|
|
IoCollectOrderBiz collectOrderBiz = new IoCollectOrderBiz();
|
|
|
|
IoCollectOrderBiz collectOrderBiz = new IoCollectOrderBiz();
|
|
|
|