|
@@ -0,0 +1,58 @@
|
|
|
+package com.diagbot.facade;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.diagbot.entity.BrRecdiagnose;
|
|
|
+import com.diagbot.service.impl.BrRecdiagnoseServiceImpl;
|
|
|
+import com.diagbot.util.EntityUtil;
|
|
|
+import com.diagbot.util.ListUtil;
|
|
|
+import com.diagbot.util.StringUtil;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @Description:
|
|
|
+ * @Author:zhaops
|
|
|
+ * @time: 2020/1/19 16:29
|
|
|
+ */
|
|
|
+@Component
|
|
|
+public class BrRecdiagnoseFacade extends BrRecdiagnoseServiceImpl {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 按类型获取诊断列表
|
|
|
+ *
|
|
|
+ * @param basyid
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Map<String, List<BrRecdiagnose>> getListByParam(Long basyid) {
|
|
|
+ Map<String, List<BrRecdiagnose>> retMap = new HashMap<>();
|
|
|
+ QueryWrapper<BrRecdiagnose> brRecdiagnoseQueryWrapper = new QueryWrapper<>();
|
|
|
+ brRecdiagnoseQueryWrapper.eq("BASYID", basyid);
|
|
|
+ List<BrRecdiagnose> brRecdiagnoses = this.list(brRecdiagnoseQueryWrapper);
|
|
|
+ brRecdiagnoses = brRecdiagnoses.stream().filter(i -> StringUtil.isNotBlank(i.getZdlbdm())).collect(Collectors.toList());
|
|
|
+ if (ListUtil.isEmpty(brRecdiagnoses)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ Map<String, List<BrRecdiagnose>> map = EntityUtil.makeEntityListMap(brRecdiagnoses, "zdlbdm");
|
|
|
+ for (Map.Entry<String, List<BrRecdiagnose>> entry : map.entrySet()) {
|
|
|
+ if (entry.getKey().equals("1")) {
|
|
|
+ retMap.put("mjzzdList", entry.getValue());
|
|
|
+ } else if (entry.getKey().equals("2")) {
|
|
|
+ if (ListUtil.isNotEmpty(entry.getValue())) {
|
|
|
+ List<BrRecdiagnose> subBrRecdiagnoses = entry.getValue().stream().filter(i -> i.getZczdpb() != null).collect(Collectors.toList());
|
|
|
+ Map<String, List<BrRecdiagnose>> subMap = EntityUtil.makeEntityListMap(subBrRecdiagnoses, "zczdpb");
|
|
|
+ if (subMap.containsKey(1)) {
|
|
|
+ retMap.put("zyzyzdList", subMap.get(1));
|
|
|
+ }
|
|
|
+ if (subMap.containsKey(2)) {
|
|
|
+ retMap.put("zyqtzdList", subMap.get(2));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return retMap;
|
|
|
+ }
|
|
|
+}
|