fix: 梅州三院采集判断心里量表报告时间判断

master
wyb 2 months ago
parent d2f97a6ad2
commit e6664c318d

@ -1,6 +1,7 @@
package com.docus.server.mzsy.job;
import com.alibaba.fastjson.JSONObject;
import com.docus.core.util.DateUtil;
import com.docus.core.util.Func;
import com.docus.infrastructure.core.utils.TableJsonRead;
import com.docus.infrastructure.web.api.CommonResult;
@ -30,6 +31,7 @@ import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -96,7 +98,12 @@ public class MzsyReportCollectJob {
mzsyReportDataViewList.add(mzsyReportDataView);
fileIdDistinct.put(mzsyReportDataView.getFfileId(), "0");
}
Date xinLiStartDateTime=Func.parseDate("2025-04-01 00:00:00", DateUtil.PATTERN_DATETIME);
mzsyReportDataViewList = mzsyReportDataViewList.stream()
// 如果是心里量表,并且报告时间小于标记时间(不为心里量表或者报告时间不小于目标时间) 则不采集,医院扫描上传
.filter(view ->
!"心理量表".equals(view.getFpatModule()) || !view.getFfileTime().before(xinLiStartDateTime)
)
.sorted(Comparator.comparing(MzsyReportDataView::getFpatModule)
.thenComparing(MzsyReportDataView::getFfileTime))
.collect(Collectors.toList());
@ -291,28 +298,12 @@ public class MzsyReportCollectJob {
public static void main(String[] args) {
MzsyReportDataView mzsyReportDataView1 = new MzsyReportDataView();
mzsyReportDataView1.setFfileTime(Func.parseDate("2025-11-13 01:01:02","yyyy-MM-dd HH:mm:ss"));
mzsyReportDataView1.setFpatModule("ct");
MzsyReportDataView mzsyReportDataView2 = new MzsyReportDataView();
mzsyReportDataView2.setFfileTime(Func.parseDate("2025-11-13 05:01:02","yyyy-MM-dd HH:mm:ss"));
mzsyReportDataView2.setFpatModule("ecg");
MzsyReportDataView mzsyReportDataView3 = new MzsyReportDataView();
mzsyReportDataView3.setFfileTime(Func.parseDate("2025-11-13 04:01:02","yyyy-MM-dd HH:mm:ss"));
mzsyReportDataView3.setFpatModule("ecg");
MzsyReportDataView mzsyReportDataView4 = new MzsyReportDataView();
mzsyReportDataView4.setFfileTime(Func.parseDate("2025-11-12 04:01:02","yyyy-MM-dd HH:mm:ss"));
mzsyReportDataView4.setFpatModule("ct");
List<MzsyReportDataView> mzsyReportDataViewList = new ArrayList<>();
mzsyReportDataViewList.add(mzsyReportDataView1);
mzsyReportDataViewList.add(mzsyReportDataView2);
mzsyReportDataViewList.add(mzsyReportDataView3);
mzsyReportDataViewList.add(mzsyReportDataView4);
System.out.println("排序前:"+Func.toJson(mzsyReportDataViewList));
mzsyReportDataViewList = mzsyReportDataViewList.stream()
.sorted(Comparator.comparing(MzsyReportDataView::getFpatModule)
.thenComparing(MzsyReportDataView::getFfileTime))
.collect(Collectors.toList());
System.out.println("排序后:"+Func.toJson(mzsyReportDataViewList));
Date xinLiStartDateTime=Func.parseDate("2025-04-01 00:00:00", DateUtil.PATTERN_DATETIME);
Date fileTime=Func.parseDate("2025-04-01 00:00:00", DateUtil.PATTERN_DATETIME);
Date fileTime2=Func.parseDate("2025-04-02 00:00:00", DateUtil.PATTERN_DATETIME);
Date fileTime3=Func.parseDate("2025-03-01 00:00:00", DateUtil.PATTERN_DATETIME);
System.out.println(fileTime.before(xinLiStartDateTime));
System.out.println(fileTime2.before(xinLiStartDateTime));
System.out.println(fileTime3.before(xinLiStartDateTime));
}
}

Loading…
Cancel
Save