yaozhixue il y a 1 an
Parent
commit
428d02a460

+ 71 - 62
src/main/java/com/zfire/jiasm/syncdata/service/impl/GLPPLeiBieServiceImpl.java

@@ -162,24 +162,26 @@ public class GLPPLeiBieServiceImpl implements GLPPLeiBieService {
         // 获取新增的
         if (addRec.size()>0){
             for (ItfTblSplbJixinDownload item : addRec){
-                if (oldProductRecMap.containsKey(item.getId()) ||
-                        dictcodes.contains(item.getId())){
+                if (oldProductRecMap.containsKey(item.getId())){
                     upGetProduct(updateProduct, oldProductRecMap, item);
                 } else {
-                    addGetProduct(brandRec, addProduct, item);
-                    dictcodes.add(item.getId());
+                    if (!dictcodes.contains(item.getId())){
+                        addGetProduct(brandRec, addProduct, item);
+                        dictcodes.add(item.getId());
+                    }
                 }
             }
         }
         // 获取修改的
         if (updateRec.size()>0){
             for (ItfTblSplbJixinDownload item : updateRec){
-                if (oldProductRecMap.containsKey(item.getId()) ||
-                        dictcodes.contains(item.getId())){
+                if (oldProductRecMap.containsKey(item.getId())){
                     upGetProduct(updateProduct, oldProductRecMap, item);
                 } else {
-                    addGetProduct(brandRec, addProduct, item);
-                    dictcodes.add(item.getId());
+                    if (!dictcodes.contains(item.getId())){
+                        addGetProduct(brandRec, addProduct, item);
+                        dictcodes.add(item.getId());
+                    }
                 }
             }
         }
@@ -977,7 +979,7 @@ public class GLPPLeiBieServiceImpl implements GLPPLeiBieService {
                 oldRecId.add(item.getId());
                 addRec.add(item);
 
-                if (addRec.size()>=1000){
+                if (addRec.size()>=500){
                     itfTblSplbJixinDownloadService.saveBatch(addRec);
                     log.info("格力品牌机型基础资料信息同步新增插入了{}条数据", addRec.size());
                     addAllRec.addAll(addRec);
@@ -1019,17 +1021,13 @@ public class GLPPLeiBieServiceImpl implements GLPPLeiBieService {
         // 获取新增的
         if (addRec.size()>0){
             for (ItfTblSplbXilieDownload item : addRec){
-                log.info("xiids {}",JSONObject.toJSONString(xiids));
-                log.info("item {}",JSONObject.toJSONString(item));
-                log.info("oldSysDictRefRecMap {}",JSONObject.toJSONString(oldSysDictRefRecMap));
-
-
-                if (oldSysDictRefRecMap.containsKey(String.valueOf(item.getXiid())) ||
-                        xiids.contains(String.valueOf(item.getXiid()))){
+                if (oldSysDictRefRecMap.containsKey(String.valueOf(item.getXiid()))){
                     upSysDictRef(updateSysDictRef, oldSysDictRefRecMap, item);
                 } else {
-                    addSysDictRef(brandRec, addSysDictRef, item);
-                    xiids.add(String.valueOf(item.getXiid()));
+                    if (!xiids.contains(String.valueOf(item.getXiid()))){
+                        addSysDictRef(brandRec, addSysDictRef, item);
+                        xiids.add(String.valueOf(item.getXiid()));
+                    }
                 }
             }
         }
@@ -1037,12 +1035,13 @@ public class GLPPLeiBieServiceImpl implements GLPPLeiBieService {
         // 获取修改的
         if (updateRec.size()>0){
             for (ItfTblSplbXilieDownload item : updateRec){
-                if (oldSysDictRefRecMap.containsKey(String.valueOf(item.getXiid())) ||
-                        xiids.contains(String.valueOf(item.getXiid()))){
+                if (oldSysDictRefRecMap.containsKey(String.valueOf(item.getXiid()))){
                     upSysDictRef(updateSysDictRef, oldSysDictRefRecMap, item);
                 } else {
-                    addSysDictRef(brandRec, addSysDictRef, item);
-                    xiids.add(String.valueOf(item.getXiid()));
+                    if (!xiids.contains(String.valueOf(item.getXiid()))){
+                        addSysDictRef(brandRec, addSysDictRef, item);
+                        xiids.add(String.valueOf(item.getXiid()));
+                    }
                 }
             }
         }
@@ -1123,24 +1122,26 @@ public class GLPPLeiBieServiceImpl implements GLPPLeiBieService {
         // 获取新增的
         if (addRec.size()>0){
             for (ItfTblSplbXilieDownload item : addRec){
-                if (oldSysDictRecMap.containsKey(String.valueOf(item.getXiid())) ||
-                        xiids.contains(String.valueOf(item.getXiid()))){
+                if (oldSysDictRecMap.containsKey(String.valueOf(item.getXiid()))){
                     upSysDict(updateSysDict, oldSysDictRecMap, item);
                 } else {
-                    addSysDict(addSysDict, item);
-                    xiids.add(String.valueOf(item.getXiid()));
+                    if (!xiids.contains(String.valueOf(item.getXiid()))){
+                        addSysDict(addSysDict, item);
+                        xiids.add(String.valueOf(item.getXiid()));
+                    }
                 }
             }
         }
         // 获取修改的
         if (updateRec.size()>0){
             for (ItfTblSplbXilieDownload item : updateRec){
-                if (oldSysDictRecMap.containsKey(String.valueOf(item.getXiid())) ||
-                        xiids.contains(String.valueOf(item.getXiid()))){
+                if (oldSysDictRecMap.containsKey(String.valueOf(item.getXiid()))){
                     upSysDict(updateSysDict, oldSysDictRecMap, item);
                 } else {
-                    addSysDict(addSysDict, item);
-                    xiids.add(String.valueOf(item.getXiid()));
+                    if (!xiids.contains(String.valueOf(item.getXiid()))){
+                        addSysDict(addSysDict, item);
+                        xiids.add(String.valueOf(item.getXiid()));
+                    }
                 }
             }
         }
@@ -1338,24 +1339,26 @@ public class GLPPLeiBieServiceImpl implements GLPPLeiBieService {
         // 获取新增的
         if (addRec.size()>0){
             for (ItfTblSplbXiaoleiDownload item : addRec){
-                if (oldSysDictRefRecMap.containsKey(String.valueOf(item.getXlid())) ||
-                        dictcodes.contains(String.valueOf(item.getXlid()))){
+                if (oldSysDictRefRecMap.containsKey(String.valueOf(item.getXlid()))){
                     upxlSysdRef(updateSysDictRef, oldSysDictRefRecMap, item);
                 } else {
-                    addxlSysdRef(brandRec, addSysDictRef, item);
-                    dictcodes.add(String.valueOf(item.getXlid()));
+                    if (!dictcodes.contains(String.valueOf(item.getXlid()))){
+                        addxlSysdRef(brandRec, addSysDictRef, item);
+                        dictcodes.add(String.valueOf(item.getXlid()));
+                    }
                 }
             }
         }
         // 获取修改的
         if (updateRec.size()>0){
             for (ItfTblSplbXiaoleiDownload item : updateRec){
-                if (oldSysDictRefRecMap.containsKey(String.valueOf(item.getXlid())) ||
-                        dictcodes.contains(String.valueOf(item.getXlid()))){
+                if (oldSysDictRefRecMap.containsKey(String.valueOf(item.getXlid()))){
                     upxlSysdRef(updateSysDictRef, oldSysDictRefRecMap, item);
                 } else {
-                    addxlSysdRef(brandRec, addSysDictRef, item);
-                    dictcodes.add(String.valueOf(item.getXlid()));
+                    if (!dictcodes.contains(String.valueOf(item.getXlid()))){
+                        addxlSysdRef(brandRec, addSysDictRef, item);
+                        dictcodes.add(String.valueOf(item.getXlid()));
+                    }
                 }
             }
         }
@@ -1484,24 +1487,26 @@ public class GLPPLeiBieServiceImpl implements GLPPLeiBieService {
         // 获取新增的
         if (addRec.size()>0){
             for (ItfTblSplbXiaoleiDownload item : addRec){
-                if (oldSysDictRecMap.containsKey(String.valueOf(item.getXlid())) ||
-                        dictcodes.contains(String.valueOf(item.getXlid()))){
+                if (oldSysDictRecMap.containsKey(String.valueOf(item.getXlid()))){
                     upXiaoLei(updateSysDict, oldSysDictRecMap, item);
                 } else {
-                    addXiaoLei(addSysDict, item);
-                    dictcodes.add(String.valueOf(item.getXlid()));
+                    if (!dictcodes.contains(String.valueOf(item.getXlid()))){
+                        addXiaoLei(addSysDict, item);
+                        dictcodes.add(String.valueOf(item.getXlid()));
+                    }
                 }
             }
         }
         // 获取修改的
         if (updateRec.size()>0){
             for (ItfTblSplbXiaoleiDownload item : updateRec){
-                if (oldSysDictRecMap.containsKey(String.valueOf(item.getXlid())) ||
-                        dictcodes.contains(String.valueOf(item.getXlid()))){
+                if (oldSysDictRecMap.containsKey(String.valueOf(item.getXlid()))){
                     upXiaoLei(updateSysDict, oldSysDictRecMap, item);
                 } else {
-                    addXiaoLei(addSysDict, item);
-                    dictcodes.add(String.valueOf(item.getXlid()));
+                    if (!dictcodes.contains(String.valueOf(item.getXlid()))){
+                        addXiaoLei(addSysDict, item);
+                        dictcodes.add(String.valueOf(item.getXlid()));
+                    }
                 }
             }
         }
@@ -1691,24 +1696,26 @@ public class GLPPLeiBieServiceImpl implements GLPPLeiBieService {
         // 获取新增的
         if (addRec.size()>0){
             for (ItfTblSplbDaleiDownload item : addRec){
-                if (oldSysDictRecMap.containsKey(String.valueOf(item.getSpid())) ||
-                        dictcodes.contains(String.valueOf(item.getSpid()))){
+                if (oldSysDictRecMap.containsKey(String.valueOf(item.getSpid()))){
                     updalei(updateSysDict, oldSysDictRecMap, item);
                 } else {
-                    addDalei(addSysDict, item);
-                    dictcodes.add(String.valueOf(item.getSpid()));
+                    if (!dictcodes.contains(String.valueOf(item.getSpid()))){
+                        addDalei(addSysDict, item);
+                        dictcodes.add(String.valueOf(item.getSpid()));
+                    }
                 }
             }
         }
         // 获取修改的
         if (updateRec.size()>0){
             for (ItfTblSplbDaleiDownload item : updateRec){
-                if (oldSysDictRecMap.containsKey(String.valueOf(item.getSpid())) ||
-                        dictcodes.contains(String.valueOf(item.getSpid()))){
+                if (oldSysDictRecMap.containsKey(String.valueOf(item.getSpid()))){
                     updalei(updateSysDict, oldSysDictRecMap, item);
                 } else {
-                    addDalei(addSysDict, item);
-                    dictcodes.add(String.valueOf(item.getSpid()));
+                    if (!dictcodes.contains(String.valueOf(item.getSpid()))){
+                        addDalei(addSysDict, item);
+                        dictcodes.add(String.valueOf(item.getSpid()));
+                    }
                 }
             }
         }
@@ -1865,24 +1872,26 @@ public class GLPPLeiBieServiceImpl implements GLPPLeiBieService {
         // 获取新增的
         if (addRec.size()>0){
             for (ItfTblSplbDaleiDownload item : addRec){
-                if (oldSysDictRefRecMap.containsKey(String.valueOf(item.getSpid())) ||
-                        dictcodes.contains(String.valueOf(item.getSpid()))){
+                if (oldSysDictRefRecMap.containsKey(String.valueOf(item.getSpid()))){
                     updateLeibie(updateSysDictRef, oldSysDictRefRecMap, item);
                 } else {
-                    addLeibie(brandRec, addSysDictRef, item);
-                    dictcodes.add(String.valueOf(item.getSpid()));
+                    if (!dictcodes.contains(String.valueOf(item.getSpid()))){
+                        addLeibie(brandRec, addSysDictRef, item);
+                        dictcodes.add(String.valueOf(item.getSpid()));
+                    }
                 }
             }
         }
         // 获取修改的
         if (updateRec.size()>0){
             for (ItfTblSplbDaleiDownload item : updateRec){
-                if (oldSysDictRefRecMap.containsKey(String.valueOf(item.getSpid())) ||
-                        dictcodes.contains(String.valueOf(item.getSpid()))){
+                if (oldSysDictRefRecMap.containsKey(String.valueOf(item.getSpid()))){
                     updateLeibie(updateSysDictRef, oldSysDictRefRecMap, item);
                 } else {
-                    addLeibie(brandRec, addSysDictRef, item);
-                    dictcodes.add(String.valueOf(item.getSpid()));
+                    if (!dictcodes.contains(String.valueOf(item.getSpid()))){
+                        addLeibie(brandRec, addSysDictRef, item);
+                        dictcodes.add(String.valueOf(item.getSpid()));
+                    }
                 }
             }
         }

+ 11 - 7
src/main/java/com/zfire/jiasm/syncdata/service/impl/GLPPXSLXDownloadServiceImpl.java

@@ -58,26 +58,30 @@ public class GLPPXSLXDownloadServiceImpl implements GLPPXSLXDownloadService {
         // 获取新增的
         if (addRec.size()>0){
             for (ItfTblAzAssignXslxDowload item : addRec){
-                if (oldSysDictRecMap.containsKey(String.valueOf(item.getXslxid())) || sxlxids.contains(item.getXslxid())){
+                if (oldSysDictRecMap.containsKey(String.valueOf(item.getXslxid()))){
                     // 修改
                     upXslx(updateSysDict, oldSysDictRecMap, item);
                 } else {
                     // 新增
-                    addXslx(addSysDict, item);
-                    sxlxids.add(item.getXslxid());
+                    if (!sxlxids.contains(item.getXslxid())){
+                        addXslx(addSysDict, item);
+                        sxlxids.add(item.getXslxid());
+                    }
                 }
             }
         }
         // 获取修改的
         if (updateRec.size()>0){
             for (ItfTblAzAssignXslxDowload item : updateRec){
-                if (oldSysDictRecMap.containsKey(String.valueOf(item.getXslxid())) || sxlxids.contains(item.getXslxid())){
-                    // 修改
+                // 修改
+                if (oldSysDictRecMap.containsKey(String.valueOf(item.getXslxid()))){
                     upXslx(updateSysDict, oldSysDictRecMap, item);
                 } else {
                     // 新增
-                    addXslx(addSysDict, item);
-                    sxlxids.add(item.getXslxid());
+                    if (!sxlxids.contains(item.getXslxid())){
+                        addXslx(addSysDict, item);
+                        sxlxids.add(item.getXslxid());
+                    }
                 }
             }
         }

+ 40 - 32
src/main/java/com/zfire/jiasm/syncdata/service/impl/GLPPYHSXXXQDServiceImpl.java

@@ -108,24 +108,26 @@ public class GLPPYHSXXXQDServiceImpl implements GLPPYHSXXXQDService {
         // 获取新增的
         if (addRec.size()>0){
             for (ItfTblYhsxViprankDowload item : addRec){
-                if (oldSysDictRecMap.containsKey(String.valueOf(item.getVipid())) ||
-                        dictcodes.contains(String.valueOf(item.getVipid()))){
+                if (oldSysDictRecMap.containsKey(String.valueOf(item.getVipid()))){
                     upYhsxVip(updateSysDict, oldSysDictRecMap, item);
                 } else {
-                    addYhsxWip(addSysDict, item);
-                    dictcodes.add(String.valueOf(item.getVipid()));
+                    if (!dictcodes.contains(String.valueOf(item.getVipid()))){
+                        addYhsxWip(addSysDict, item);
+                        dictcodes.add(String.valueOf(item.getVipid()));
+                    }
                 }
             }
         }
         // 获取修改的
         if (updateRec.size()>0){
             for (ItfTblYhsxViprankDowload item : updateRec){
-                if (oldSysDictRecMap.containsKey(String.valueOf(item.getVipid())) ||
-                        dictcodes.contains(String.valueOf(item.getVipid()))){
+                if (oldSysDictRecMap.containsKey(String.valueOf(item.getVipid()))){
                     upYhsxVip(updateSysDict, oldSysDictRecMap, item);
                 } else {
-                    addYhsxWip(addSysDict, item);
-                    dictcodes.add(String.valueOf(item.getVipid()));
+                    if (!dictcodes.contains(String.valueOf(item.getVipid()))){
+                        addYhsxWip(addSysDict, item);
+                        dictcodes.add(String.valueOf(item.getVipid()));
+                    }
                 }
             }
         }
@@ -251,24 +253,26 @@ public class GLPPYHSXXXQDServiceImpl implements GLPPYHSXXXQDService {
         // 获取新增的
         if (addRec.size()>0){
             for (ItfTblAssignXxlyDowload item : addRec){
-                if (oldSysDictRecMap.containsKey(String.valueOf(item.getLyid())) ||
-                        dictcodes.contains(String.valueOf(item.getLyid()))){
+                if (oldSysDictRecMap.containsKey(String.valueOf(item.getLyid()))){
                     upXxly(updateSysDict, oldSysDictRecMap, item);
                 } else {
-                    addXxly(addSysDict, item);
-                    dictcodes.add(String.valueOf(item.getLyid()));
+                    if (!dictcodes.contains(String.valueOf(item.getLyid()))){
+                        addXxly(addSysDict, item);
+                        dictcodes.add(String.valueOf(item.getLyid()));
+                    }
                 }
             }
         }
         // 获取修改的
         if (updateRec.size()>0){
             for (ItfTblAssignXxlyDowload item : updateRec){
-                if (oldSysDictRecMap.containsKey(String.valueOf(item.getLyid())) ||
-                        dictcodes.contains(String.valueOf(item.getLyid()))){
+                if (oldSysDictRecMap.containsKey(String.valueOf(item.getLyid()))){
                     upXxly(updateSysDict, oldSysDictRecMap, item);
                 } else {
-                    addXxly(addSysDict, item);
-                    dictcodes.add(String.valueOf(item.getLyid()));
+                    if (!dictcodes.contains(String.valueOf(item.getLyid()))){
+                        addXxly(addSysDict, item);
+                        dictcodes.add(String.valueOf(item.getLyid()));
+                    }
                 }
             }
         }
@@ -429,24 +433,26 @@ public class GLPPYHSXXXQDServiceImpl implements GLPPYHSXXXQDService {
         // 获取新增的
         if (addRec.size()>0){
             for (ItfTblAssignXxqdDowload item : addRec){
-                if (oldSysDictRecMap.containsKey(String.valueOf(item.getQdid())) ||
-                        dictcodes.contains(String.valueOf(item.getQdid()))){
+                if (oldSysDictRecMap.containsKey(String.valueOf(item.getQdid()))){
                     upXxqd(updateSysDict, oldSysDictRecMap, item);
                 } else {
-                    addXxqd(addSysDict, item);
-                    dictcodes.add(String.valueOf(item.getQdid()));
+                    if (!dictcodes.contains(String.valueOf(item.getQdid()))){
+                        addXxqd(addSysDict, item);
+                        dictcodes.add(String.valueOf(item.getQdid()));
+                    }
                 }
             }
         }
         // 获取修改的
         if (updateRec.size()>0){
             for (ItfTblAssignXxqdDowload item : updateRec){
-                if (oldSysDictRecMap.containsKey(String.valueOf(item.getQdid())) ||
-                        dictcodes.contains(String.valueOf(item.getQdid()))){
+                if (oldSysDictRecMap.containsKey(String.valueOf(item.getQdid()))){
                     upXxqd(updateSysDict, oldSysDictRecMap, item);
                 } else {
-                    addXxqd(addSysDict, item);
-                    dictcodes.add(String.valueOf(item.getQdid()));
+                    if (!dictcodes.contains(String.valueOf(item.getQdid()))){
+                        addXxqd(addSysDict, item);
+                        dictcodes.add(String.valueOf(item.getQdid()));
+                    }
                 }
             }
         }
@@ -608,24 +614,26 @@ public class GLPPYHSXXXQDServiceImpl implements GLPPYHSXXXQDService {
         // 获取新增的
         if (addRec.size()>0){
             for (ItfTblAssignYhsxWxDowload item : addRec){
-                if (oldSysDictRecMap.containsKey(String.valueOf(item.getYhsxid())) ||
-                        dictcodes.contains(String.valueOf(item.getYhsxid()))){
+                if (oldSysDictRecMap.containsKey(String.valueOf(item.getYhsxid()))){
                     upYhsxWx(updateSysDict, oldSysDictRecMap, item);
                 } else {
-                    addYhsxWx(addSysDict, item);
-                    dictcodes.add(String.valueOf(item.getYhsxid()));
+                    if (!dictcodes.contains(String.valueOf(item.getYhsxid()))){
+                        addYhsxWx(addSysDict, item);
+                        dictcodes.add(String.valueOf(item.getYhsxid()));
+                    }
                 }
             }
         }
         // 获取修改的
         if (updateRec.size()>0){
             for (ItfTblAssignYhsxWxDowload item : updateRec){
-                if (oldSysDictRecMap.containsKey(String.valueOf(item.getYhsxid())) ||
-                        dictcodes.contains(String.valueOf(item.getYhsxid()))){
+                if (oldSysDictRecMap.containsKey(String.valueOf(item.getYhsxid()))){
                     upYhsxWx(updateSysDict, oldSysDictRecMap, item);
                 } else {
-                    addYhsxWx(addSysDict, item);
-                    dictcodes.add(String.valueOf(item.getYhsxid()));
+                    if (!dictcodes.contains(String.valueOf(item.getYhsxid()))){
+                        addYhsxWx(addSysDict, item);
+                        dictcodes.add(String.valueOf(item.getYhsxid()));
+                    }
                 }
             }
         }