|
@@ -140,21 +140,29 @@ public class GLPPLeiBieServiceImpl implements GLPPLeiBieService {
|
|
|
Map<String, List<SysDict>> oldSysDictRecXMap = new HashMap<>();
|
|
|
Map<String, List<ProductSeries>> oldpsMap = new HashMap<>();
|
|
|
|
|
|
+ log.info("格力产品系列 a");
|
|
|
+
|
|
|
// 提取大类字典数据
|
|
|
oldSysDictRec = sysDictService.lambdaQuery()
|
|
|
.eq(SysDict::getDictType, DictTypeEnum.DICT_TYPE_MAIN_TYPE.getCode())
|
|
|
.list();
|
|
|
if (CollectionUtils.isNotEmpty(oldSysDictRec)){
|
|
|
oldSysDictRecMap = oldSysDictRec.stream().collect(Collectors.groupingBy(SysDict::getDictCode));
|
|
|
+ oldSysDictRec.clear();
|
|
|
}
|
|
|
|
|
|
+ log.info("格力产品系列 b");
|
|
|
+
|
|
|
// 提取小类字典数据 sysDictService
|
|
|
oldSysDictXRec = sysDictService.lambdaQuery()
|
|
|
.eq(SysDict::getDictType,DictTypeEnum.DICT_TYPE_SMALL_TYPE.getCode()).list();
|
|
|
if (CollectionUtils.isNotEmpty(oldSysDictXRec)){
|
|
|
oldSysDictRecXMap = oldSysDictXRec.stream().collect(Collectors.groupingBy(SysDict::getDictCode));
|
|
|
+ oldSysDictXRec.clear();
|
|
|
}
|
|
|
|
|
|
+ log.info("格力产品系列 c");
|
|
|
+
|
|
|
// 提取现有数据防重使用
|
|
|
List<ProductSeries> oldps = productSeriesService.lambdaQuery().list();
|
|
|
if (CollectionUtils.isNotEmpty(oldps)){
|
|
@@ -162,10 +170,15 @@ public class GLPPLeiBieServiceImpl implements GLPPLeiBieService {
|
|
|
xlid.add(en.getXlId());
|
|
|
});
|
|
|
oldpsMap = oldps.stream().collect(Collectors.groupingBy(ProductSeries::getXlId));
|
|
|
+ oldps.clear();
|
|
|
}
|
|
|
|
|
|
+ log.info("格力产品系列 d");
|
|
|
+
|
|
|
// 获取新增的
|
|
|
if (addRec.size()>0){
|
|
|
+ log.info("格力产品系列 e");
|
|
|
+
|
|
|
for (ItfTblSplbXilieDownload item : addRec){
|
|
|
if (xlid.contains(item.getId())){
|
|
|
upProductSeries(brandRec, upps, oldSysDictRecMap, oldSysDictRecXMap, oldpsMap, item);
|
|
@@ -177,6 +190,7 @@ public class GLPPLeiBieServiceImpl implements GLPPLeiBieService {
|
|
|
}
|
|
|
// 获取修改的
|
|
|
if (updateRec.size()>0){
|
|
|
+ log.info("格力产品系列 f");
|
|
|
for (ItfTblSplbXilieDownload item : updateRec){
|
|
|
if (xlid.contains(item.getId())){
|
|
|
upProductSeries(brandRec, upps, oldSysDictRecMap, oldSysDictRecXMap, oldpsMap, item);
|
|
@@ -187,6 +201,8 @@ public class GLPPLeiBieServiceImpl implements GLPPLeiBieService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ log.info("格力产品系列 g {}-{}",addps.size(),upps.size());
|
|
|
+
|
|
|
// 新增的插入到表
|
|
|
if (addps.size()>0){
|
|
|
productSeriesService.saveBatch(addps);
|
|
@@ -199,6 +215,10 @@ public class GLPPLeiBieServiceImpl implements GLPPLeiBieService {
|
|
|
log.info("本地系列信息表更新修改了{}条数据", upps.size());
|
|
|
upps.clear();
|
|
|
}
|
|
|
+ oldSysDictRecMap.clear();
|
|
|
+ oldSysDictRecXMap.clear();
|
|
|
+ oldpsMap.clear();
|
|
|
+ xlid.clear();
|
|
|
}
|
|
|
|
|
|
private void upProductSeries(Brand brandRec, List<ProductSeries> upps, Map<String, List<SysDict>> oldSysDictRecMap, Map<String, List<SysDict>> oldSysDictRecXMap, Map<String, List<ProductSeries>> oldpsMap, ItfTblSplbXilieDownload item) {
|
|
@@ -1269,6 +1289,7 @@ public class GLPPLeiBieServiceImpl implements GLPPLeiBieService {
|
|
|
.eq(SysDict::getDictType,DictTypeEnum.DICT_TYPE_SERIES.getCode()).list();
|
|
|
if (CollectionUtils.isNotEmpty(oldSysDictRec)){
|
|
|
oldSysDictRecMap = oldSysDictRec.stream().collect(Collectors.groupingBy(SysDict::getDictCode));
|
|
|
+ oldSysDictRec.clear();
|
|
|
}
|
|
|
|
|
|
// 获取新增的
|
|
@@ -1309,6 +1330,7 @@ public class GLPPLeiBieServiceImpl implements GLPPLeiBieService {
|
|
|
log.info("本地字典信息表更新修改了{}条数据", updateSysDict.size());
|
|
|
}
|
|
|
xiids.clear();
|
|
|
+ oldSysDictRecMap.clear();
|
|
|
}
|
|
|
|
|
|
private void addSysDict(List<SysDict> addSysDict, ItfTblSplbXilieDownload item) {
|