Forráskód Böngészése

新增人员加标签

xufei 4 éve
szülő
commit
58483358f8

+ 1 - 0
src/main/java/com/winhc/service/impl/LegalEntityRelationV1ServiceImpl.java

@@ -33,6 +33,7 @@ public class LegalEntityRelationV1ServiceImpl implements RelationService {
                 "UNWIND batch_list AS row \n" +
                 "MERGE(s:" + CompanyEnum.Lable.PERSON.code + "{person_id:row.start_id}) \n" +
                 "SET s.name=row.start_name, s.person_id=row.start_id \n" +
+                "SET s:" + CompanyUtils.getIncrPersonLabel() + " \n" +
                 "MERGE(e:" + CompanyEnum.Lable.COMPANY.code + "{company_id:row.end_id}) \n" +
                 "SET e.name=row.end_name, e.company_id=row.end_id \n" +
                 "WITH s,e,row \n" +

+ 1 - 0
src/main/java/com/winhc/service/impl/StaffRelationServiceImpl.java

@@ -33,6 +33,7 @@ public class StaffRelationServiceImpl implements RelationService {
                 "UNWIND batch_list AS row \n" +
                 "MERGE(s:" + CompanyEnum.Lable.PERSON.code + "{person_id:row.start_id}) \n" +
                 "SET s.name=row.start_name, s.person_id=row.start_id \n" +
+                "SET s:" + CompanyUtils.getIncrPersonLabel() + " \n" +
                 "MERGE(e:" + CompanyEnum.Lable.COMPANY.code + "{company_id:row.end_id}) \n" +
                 "SET e.name=row.end_name, e.company_id=row.end_id \n" +
                 "WITH s,e,row \n" +

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

@@ -55,7 +55,7 @@ public class CompanyUtils {
     }
 
     public static String getIncrPersonLabel(){
-        return CompanyEnum.Lable.新增.code + DateUtil.formatDate_YYYYMMDD(new Date());
+        return CompanyEnum.Lable.新增.code +DateUtil.getDateBefore(-1).replace("-", "");
     }
 
     public static void main(String[] args) {

+ 14 - 0
src/main/java/com/winhc/utils/DateUtil.java

@@ -479,6 +479,20 @@ public class DateUtil {
 
     }
 
+
+    /**
+     *
+     * 获取day前数据
+     *
+     * @return yyyyMMdd
+     */
+    public static String getDateBefore(Integer dayNum) {
+        Calendar cal = Calendar.getInstance();
+        cal.add(Calendar.DATE, dayNum);
+
+        return formatDate(cal.getTime(), FORMAT_YYYY_MM_DD);
+    }
+
     public static void main(String[] args) throws Exception {
         System.out.println(formatDate_YYYYMMDD(new Date()));
     }