Quellcode durchsuchen

手术知情同意书页面排序添加

rengb vor 5 Jahren
Ursprung
Commit
229c6c1309

+ 16 - 4
trans/src/main/java/com/lantone/qc/trans/taizhou/TaizhouDocTrans.java

@@ -248,11 +248,11 @@ public class TaizhouDocTrans extends DocTrans {
                     .map(operationDoc -> operationDoc.getOperationRecordDoc().getPageData())
                     .sorted((map1, map2) -> {
                         Date date1 = null, date2 = null;
-                        if (map1.get("手术开始时间") != null) {
-                            date1 = DateUtil.parseDate(map1.get("手术开始时间").toString(), "yyyy/MM/dd HH:mm");
+                        if (map1.get("开始时间") != null) {
+                            date1 = DateUtil.parseDate(map1.get("开始时间").toString(), "yyyy/MM/dd HH:mm");
                         }
-                        if (map2.get("手术开始时间") != null) {
-                            date2 = DateUtil.parseDate(map2.get("手术开始时间").toString(), "yyyy/MM/dd HH:mm");
+                        if (map2.get("开始时间") != null) {
+                            date2 = DateUtil.parseDate(map2.get("开始时间").toString(), "yyyy/MM/dd HH:mm");
                         }
                         long time1 = date1 == null ? 0 : date1.getTime();
                         long time2 = date2 == null ? 0 : date2.getTime();
@@ -288,6 +288,18 @@ public class TaizhouDocTrans extends DocTrans {
                     .stream()
                     .filter(operationDoc -> operationDoc != null && operationDoc.getOperationInformedConsentDoc() != null)
                     .map(operationDoc -> operationDoc.getOperationInformedConsentDoc().getPageData())
+                    .sorted((map1, map2) -> {
+                        Date date1 = null, date2 = null;
+                        if (map1.get("谈话日期") != null) {
+                            date1 = DateUtil.parseDate(map1.get("谈话日期").toString(), "yyyy/MM/dd HH:mm");
+                        }
+                        if (map2.get("谈话日期") != null) {
+                            date2 = DateUtil.parseDate(map2.get("谈话日期").toString(), "yyyy/MM/dd HH:mm");
+                        }
+                        long time1 = date1 == null ? 0 : date1.getTime();
+                        long time2 = date2 == null ? 0 : date2.getTime();
+                        return (int) (time1 - time2);
+                    })
                     .collect(Collectors.toList());
             if (ListUtil.isNotEmpty(oicPageDataList)) {
                 inputInfo.getPageData().put("手术知情同意书", oicPageDataList);