|
@@ -109,6 +109,61 @@ public class CommonRule {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 无需重复开单项
|
|
|
+ *
|
|
|
+ * @param wordCrfDTO
|
|
|
+ * @param billNeoMaxDTO
|
|
|
+ * @param billMsgList
|
|
|
+ */
|
|
|
+ public void needlessRepeatOrder(WordCrfDTO wordCrfDTO, BillNeoMaxDTO billNeoMaxDTO, List<BillMsg> billMsgList) {
|
|
|
+ List<NodeNeoDTO> needlessPacsOrder = billNeoMaxDTO.getNeedlessPacsOrder();
|
|
|
+ String orderStandName = billNeoMaxDTO.getOrderStandName();
|
|
|
+ for (NodeNeoDTO nodeNeoDTO : needlessPacsOrder) {
|
|
|
+ Map<String, List<Pacs>> map = EntityUtil.makeEntityListMap(wordCrfDTO.getPacs(), "uniqueName");
|
|
|
+ List<Pacs> pacsList = map.get(orderStandName);
|
|
|
+ if (ListUtil.isNotEmpty(pacsList)) {
|
|
|
+ sortByProperty(pacsList, "dateValue");
|
|
|
+ Pacs pacs = pacsList.get(pacsList.size() - 1);
|
|
|
+ String result = pacs.getResult();
|
|
|
+ if (StringUtil.isNotBlank(result) && StringUtil.isNotBlank(nodeNeoDTO.getRegex())
|
|
|
+ && result.matches(nodeNeoDTO.getRegex())) {
|
|
|
+ BillMsg commonBillMsg = MsgUtil.getNeedlessRepeatOrder(
|
|
|
+ billNeoMaxDTO.getOrderName(), billNeoMaxDTO.getOrderStandName(),
|
|
|
+ pacs.getName(), billNeoMaxDTO.getType());
|
|
|
+ billMsgList.add(commonBillMsg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据指定字段按照字符串排序
|
|
|
+ *
|
|
|
+ * @param tList
|
|
|
+ * @param property
|
|
|
+ * @param <T>
|
|
|
+ */
|
|
|
+ public <T> void sortByProperty(List<T> tList, String property) {
|
|
|
+ if (ListUtil.isNotEmpty(tList) && tList.size() > 1) {
|
|
|
+ // items 按照时间排序
|
|
|
+ Collections.sort(tList, new Comparator<T>() {
|
|
|
+ @Override
|
|
|
+ public int compare(T o1, T o2) {
|
|
|
+ String o1Str = (String) CoreUtil.getFieldValue(o1, property);
|
|
|
+ String o2Str = (String) CoreUtil.getFieldValue(o2, property);
|
|
|
+ if (StringUtil.isBlank(o1Str)) {
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ if (StringUtil.isBlank(o2Str)) {
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ return o1Str.compareTo(o2Str);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 24小时重复开单总入口
|
|
|
*
|
|
@@ -206,7 +261,7 @@ public class CommonRule {
|
|
|
if (!CatalogueUtil.compareTime(last, cur, 60L * 24)) {
|
|
|
String name = (String) CoreUtil.getFieldValue(it, "name");
|
|
|
String uniqueName = (String) CoreUtil.getFieldValue(it, "uniqueName");
|
|
|
- BillMsg commonBillMsg = MsgUtil.getBillMsg24Repeat(
|
|
|
+ BillMsg commonBillMsg = MsgUtil.getBill24RepeatMsg(
|
|
|
name, uniqueName, name, type);
|
|
|
billMsgList.add(commonBillMsg);
|
|
|
break;
|
|
@@ -285,4 +340,29 @@ public class CommonRule {
|
|
|
return drugAllergyAll;
|
|
|
}
|
|
|
|
|
|
+ public static void main(String[] args) {
|
|
|
+ List<Pacs> pacsList = new ArrayList<>();
|
|
|
+ Pacs pacs = new Pacs();
|
|
|
+ pacs.setName("d1");
|
|
|
+ pacs.setDateValue("2020-01-01");
|
|
|
+ pacsList.add(pacs);
|
|
|
+
|
|
|
+ Pacs pacs1 = new Pacs();
|
|
|
+ pacs1.setName("d2");
|
|
|
+ pacs1.setDateValue("2020-01-07");
|
|
|
+ pacsList.add(pacs1);
|
|
|
+
|
|
|
+ Pacs pacs3 = new Pacs();
|
|
|
+ pacs3.setName("d3");
|
|
|
+ pacs3.setDateValue("2020-01-09");
|
|
|
+ pacsList.add(pacs3);
|
|
|
+ CommonRule commonRule = new CommonRule();
|
|
|
+ commonRule.sortByProperty(pacsList, "dateValue");
|
|
|
+ for (Pacs bean : pacsList) {
|
|
|
+ System.out.println(bean.getName());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|