Commit 39ea3298d1cc70cc7331e7580a43d8efe8f13b2b

Authored by landong2015
1 parent 9f2c5f6466

update bug

Showing 4 changed files with 140 additions and 0 deletions

platform-common/src/main/java/com/lyms/platform/common/enums/FmTypeEnums.java View file @ 39ea329
... ... @@ -30,6 +30,29 @@
30 30 return null;
31 31 }
32 32  
  33 + public static String getFmNameById(String id)
  34 + {
  35 + for (FmTypeEnums e : FmTypeEnums.values()) {
  36 + if (e.getId().equals(id))
  37 + {
  38 + return e.getName();
  39 + }
  40 + }
  41 + return null;
  42 + }
  43 +
  44 +
  45 + public static String getFmScNameById(String id)
  46 + {
  47 + for (FmScEnums e : FmScEnums.values()) {
  48 + if (e.getId().equals(id))
  49 + {
  50 + return e.getName();
  51 + }
  52 + }
  53 + return null;
  54 + }
  55 +
33 56 public static List<Map> getFmTypeEnums() {
34 57 List<Map> list = new ArrayList<>();
35 58 for (FmTypeEnums e : FmTypeEnums.values()) {
platform-common/src/main/java/com/lyms/platform/common/enums/TaiShuEnums.java View file @ 39ea329
1 1 package com.lyms.platform.common.enums;
2 2  
  3 +import org.apache.commons.lang.StringUtils;
  4 +
3 5 /**
4 6 * 胎盘
5 7 * Created by Administrator on 2016/6/21 0021.
... ... @@ -54,6 +56,23 @@
54 56 this.name = name;
55 57 }
56 58 }
  59 +
  60 + public static String getTpNameById(String id) {
  61 +
  62 + if (StringUtils.isEmpty(id)){
  63 + return null;
  64 + }
  65 +
  66 + for (TpEnums e : TpEnums.values()) {
  67 + if (e.getId().equals(id))
  68 + {
  69 + return e.getName();
  70 + }
  71 + }
  72 + return null;
  73 + }
  74 +
  75 +
57 76 public enum TpEnums {
58 77 O("完整","1"),O1("不完整","2");
59 78 private TpEnums(String name,String id){
platform-dal/src/main/java/com/lyms/platform/query/ResidentsArchiveQuery.java View file @ 39ea329
... ... @@ -137,6 +137,9 @@
137 137 if (StringUtils.isNotBlank(cityId)) {
138 138 condition = condition.and("cityId", cityId, MongoOper.IS);
139 139 }
  140 + if (StringUtils.isNotBlank(sex)) {
  141 + condition = condition.and("sex", sex, MongoOper.IS);
  142 + }
140 143 if (StringUtils.isNotBlank(areaId)) {
141 144 condition = condition.and("areaId", areaId, MongoOper.IS);
142 145 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/ResolveUtils.java View file @ 39ea329
  1 +package com.lyms.platform.operate.web.utils;
  2 +
  3 +import com.lyms.platform.biz.service.BasicConfigService;
  4 +import com.lyms.platform.common.utils.JsonUtil;
  5 +
  6 +import java.util.HashMap;
  7 +import java.util.Iterator;
  8 +import java.util.Map;
  9 +import java.util.Set;
  10 +
  11 +/**
  12 + * Created by Administrator on 2017/1/9 0009.
  13 + */
  14 +public class ResolveUtils {
  15 +
  16 + private static final Map<String, String> content = new HashMap<>();
  17 +
  18 + private static final String YES_OR_NO = "yesOrNo";
  19 +
  20 + static {
  21 + content.put("qztp", "前置胎盘");
  22 + content.put("tpzb", "胎盘早剥");
  23 + content.put("tpzl", "胎盘滞留");
  24 + content.put("tmzp", "胎膜早破");
  25 + content.put("chcx", "产后出血");
  26 + content.put("rsqgxy", "妊娠期高血压");
  27 + content.put("zxqqq", "子痫前期(轻)");
  28 + content.put("zxqqz", "子痫前期(重)");
  29 + content.put("zxmxgxybfzxqq", "子痫慢性高血压并发子痫前期");
  30 + content.put("rshbmxgxy", "妊娠合并慢性高血压");
  31 + content.put("qt", "其他");
  32 + }
  33 +
  34 + /**
  35 + * 解析产科并发症
  36 + * @param map
  37 + * @return
  38 + */
  39 + public static String replace(Map map) {
  40 + if (null == map) {
  41 + return "";
  42 + }
  43 + StringBuilder sb = new StringBuilder();
  44 + try {
  45 + if ("yes".equals(map.get(YES_OR_NO))) {
  46 + Set<Map.Entry<String, Object>> m = map.entrySet();
  47 + Iterator<Map.Entry<String, Object>> it = m.iterator();
  48 + while (it.hasNext()) {
  49 + Map.Entry<String, Object> ma = it.next();
  50 + if (ma.getKey().equals(YES_OR_NO)) {
  51 + continue;
  52 + }
  53 +
  54 + if ("true".equals(ma.getValue() + "")) {
  55 +
  56 + if (content.containsKey(ma.getKey())) {
  57 + sb.append(content.get(ma.getKey())).append(',');
  58 + }
  59 + }
  60 + }
  61 +
  62 + String bigSB = sb.toString();
  63 +
  64 + if (bigSB.contains("其他,")){
  65 + if (map.containsKey("qtText")){
  66 + bigSB = bigSB.replace("其他,","其他:" + map.get("qtText"));
  67 + }
  68 + }
  69 +
  70 + if (bigSB.endsWith(",")) {
  71 + bigSB = bigSB.substring(0, bigSB.length() - 1);
  72 + }
  73 + return bigSB;
  74 +
  75 + }else if ("no".equals(map.get(YES_OR_NO))){
  76 + return "无";
  77 + }
  78 +
  79 + }catch (Exception e){
  80 + e.printStackTrace();
  81 + }
  82 + return "";
  83 + }
  84 +
  85 + public static void main(String[] str) {
  86 + String ssss = "{\"qztp\":true,\"yesOrNo\":\"no\",\"tpzb\":true,\"zxqqz\":true,\"zxqqq\":true,\"tpzl\":true," +
  87 + "\"zxmxgxybfzxqq\":true,\"chcx\":true,\"rshbmxgxy\":true,\"tmzp\":true,\"rsqgxy\":true,\"qt\":false,\"qtText\":\"11\"}";
  88 +
  89 + Map m = JsonUtil.str2Obj(ssss,Map.class);
  90 +
  91 + String a = replace(m);
  92 + System.out.print("哈哈.................... " + a);
  93 + }
  94 +
  95 +}