LiTaohong пре 7 година
родитељ
комит
9aff45c8ab

+ 54 - 24
patient-co/patient-co-figure-label/sql/label_es_sql

@ -1,31 +1,61 @@
-- 新增居民标签索引映射
PUT http://172.19.103.45:9200/figure_label_index
{
  "mappings": {
    "figure_label_type": {
      "properties": {
      	"idcard":{
      		"type":"String"
      	},
      	"labelType":{
      		"type":"String"
      	},
      	"labelCode":{
      		"type":"String"
      	},
      	"labelName":{
      		"type":"String"
      	},
      	"labeValue":{
      		"type":"String"
      	},
         "createTime":{
          		"type":"date",
          		"format":"yyyy-MM-dd HH:mm:ss"
        "mappings": {
            "figure_label_type": {
                "properties": {
                    "createTime": {
                        "type": "date",
                        "format": "yyyy-MM-dd HH:mm:ss"
                    },
                    "currentActive": {
                        "type": "boolean"
                    },
                    "id": {
                        "type": "string"
                    },
                    "idcard": {
                        "type": "string"
                    },
                    "labeName": {
                        "type": "string"
                    },
                    "labeValue": {
                        "type": "string"
                    },
                    "labelCode": {
                        "type": "string"
                    },
                    "labelName": {
                        "type": "string"
                    },
                    "labelType": {
                        "type": "string"
                    },
                    "labelValue": {
                        "type": "string"
                    },
                    "modelId": {
                        "type": "string"
                    },
                    "query": {
                        "properties": {
                            "match_all": {
                                "type": "object"
                            }
                        }
                    },
                    "source": {
                        "type": "string"
                    },
                    "sourceTime": {
                        "type": "string"
                    }
                }
            }
        }
      }
    }
  }
}

+ 2 - 1
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/extract/MysqlExtracter.java

@ -9,6 +9,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
@ -91,7 +92,7 @@ public class MysqlExtracter implements Extracter {
                StringBuilder limitSql = new StringBuilder();
                limitSql.append(sql)
                        .append(" limit ")
                        .append((int)(i * numPerPage))
                        .append(i * numPerPage)
                        .append(",")
                        .append(numPerPage);
                MutilThreadMysqlExtracter mutilThreadMysqlExtracter = new MutilThreadMysqlExtracter(jdbcTemplate, limitSql.toString());

+ 2 - 2
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/storage/Store2ES.java

@ -34,7 +34,7 @@ public class Store2ES implements Storager {
        List<String> list = new ArrayList<>();
        int saveCount = 0;
        long start = System.currentTimeMillis();
        String logtitle = "start to loop(save) data,total size:" + modelList.size();
        String logtitle = "loop(save) data,total size:" + modelList.size();
        TimeUtil.start(logger,logtitle,start);
        for(SaveModel saveModel:modelList){
            try {
@ -54,6 +54,6 @@ public class Store2ES implements Storager {
            }
        }
        long finish = System.currentTimeMillis();
        TimeUtil.finish(logger,logtitle,start,finish);
        TimeUtil.finish(logger,"loop(save) data",start,finish);
    }
}

+ 2 - 2
patient-co/patient-co-figure-label/src/main/resources/application-dev.yml

@ -22,8 +22,8 @@ spring:
  data:
    elasticsearch:
      cluster-name: jkzl #es集群的名字
      cluster-nodes: http://11.1.2.28:9300,http://11.1.2.29:9300 # 172.19.103.45:9300,172.19.103.68:9300
      cluster-nodes-jest: http://11.1.2.28:9200,http://11.1.2.29:9200  # http://172.19.103.68:9200,http://172.19.103.45:9200  #多个逗号分割
      cluster-nodes: 172.19.103.45:9300,172.19.103.68:9300 # 11.1.2.28:9300,11.1.2.29:9300
      cluster-nodes-jest: http://172.19.103.68:9200,http://172.19.103.45:9200  #http://11.1.2.28:9200,http://11.1.2.29:9200   #多个逗号分割
      repositories:
        enabled: true
      properties:

+ 1 - 0
patient-co/patient-co-figure-label/src/main/resources/application.yml

@ -26,5 +26,6 @@ spring:
hibernate:
  dialect: org.hibernate.dialect.MySQL5Dialect
  show_sql: false
  ejb:
    naming_strategy: org.hibernate.cfg.ImprovedNamingStrategy