Browse Source

更新配置

xufei 3 năm trước cách đây
mục cha
commit
5c0c6bc539

+ 1 - 1
src/main/java/com/winhc/kafka/consumer/KafkaConsumerPersonMerge.java

@@ -20,7 +20,7 @@ import java.util.Map;
  * @date 2021/4/8 16:12
  */
 @Slf4j
-//@Service
+@Service
 @AllArgsConstructor
 public class KafkaConsumerPersonMerge {
 

+ 2 - 4
src/main/java/com/winhc/service/impl/PersonMergeImpl.java

@@ -30,8 +30,6 @@ public class PersonMergeImpl implements RelationService {
         if (batch_list.isEmpty()) return null;
         long start = System.currentTimeMillis();
         Session session = driver.session();
-
-        //System.out.println(JSON.toJSONString(batch_list));
         final String cql =
                 "\nWITH  {batch_list} AS batch_list \n" +
                         "UNWIND batch_list AS row \n" +
@@ -39,8 +37,8 @@ public class PersonMergeImpl implements RelationService {
                         "MATCH (n:个人{person_id:row.deleted_human_pid})-[r]-(x:企业)\n" +
                         "with m,n,r,x\n" +
                         "CALL apoc.merge.relationship(m, TYPE(r), properties(r),{}, x,{}) YIELD rel\n" +
-                        "SET m:update20210415\n" +
-                        "SET n:deleted20210415\n" +
+                        "SET m:" + CompanyUtils.getIncrPersonLabel("新增") + "\n" +
+                        "SET n:" + CompanyUtils.getIncrPersonLabel("删除") + "\n" +
                         "DELETE r";
         log.info("consumer size: {}, cql:{}", batch_list.size(), cql);
         String data = CompanyUtils.writeNeo4j(session, cql, new HashMap<String, Object>() {{

+ 5 - 1
src/main/java/com/winhc/utils/CompanyUtils.java

@@ -101,7 +101,11 @@ public class CompanyUtils {
         return CompanyEnum.Lable.新增.code + DateUtil.getDateBefore(-1).replace("-", "");
     }
 
+    public static String getIncrPersonLabel(String label) {
+        return label + DateUtil.getDateBefore(-1).replace("-", "");
+    }
+
     public static void main(String[] args) {
-        System.out.println(getIncrPersonLabel());
+        System.out.println(getIncrPersonLabel("新增"));
     }
 }

+ 8 - 4
src/main/resources/application-dev.properties

@@ -15,7 +15,11 @@ spring.data.neo4j.uri=bolt://192.168.2.60:7687
 #spring.data.neo4j.uri=http://10.29.26.76:7474
 #spring.data.neo4j.uri=http://47.101.212.122:7474
 
-
+#内网地址
+spring.datasource.url = jdbc:mysql://rm-uf61r3m23ba1p5z3d.mysql.rds.aliyuncs.com:3306/prism1?useUnicode=true&characterEncoding=utf-8
+spring.datasource.username = wenshu
+spring.datasource.password = wenshu_168
+spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
 
 #spring.datasource.url = jdbc:mysql://47.100.20.161:3306/prism1?useUnicode=true&characterEncoding=utf-8
 #spring.datasource.username = firefly
@@ -30,9 +34,9 @@ scheduling.enabled = false
 #spring.kafka.bootstrap-servers=47.101.221.131:9092
 spring.kafka.bootstrap-servers=192.168.4.239:9092,192.168.4.241:9092,192.168.4.240:9092
 #topic
-spring.kafka.topic_node_relation_union=inc_node_relation_union_test
-spring.kafka.topic_person_companys=inc_person_companys
-spring.kafka.topic_person_merge=inc_person_merge
+spring.kafka.topic_node_relation_union=inc_node_relation_union_dev
+spring.kafka.topic_person_companys=inc_person_companys_dev
+spring.kafka.topic_person_merge=inc_person_merge_dev
 
 #spring.kafka.bootstrap-servers=192.168.4.237:9092,192.168.4.235:9092,192.168.4.236:9092
 #spring.kafka.topic=xf_test