|
|
@@ -30,10 +30,7 @@ import javax.persistence.criteria.CriteriaBuilder;
|
|
|
import javax.persistence.criteria.CriteriaQuery;
|
|
|
import javax.persistence.criteria.Predicate;
|
|
|
import javax.persistence.criteria.Root;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* 品牌映射服务的实现类
|
|
|
@@ -181,4 +178,47 @@ public class BrandMapServiceImpl implements BrandMapService{
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void initBrandMapByEnUU(Long enuu) {
|
|
|
+ List<BrandTemp> originalList = brandTempDao.getAllBySdNameNotNull();
|
|
|
+ Set<BrandTemp> convertList = new LinkedHashSet<>(originalList.size());
|
|
|
+ for (BrandTemp temp : originalList){
|
|
|
+ if (!temp.getNameCd().equals(temp.getNameSd())) { //相同的不记录
|
|
|
+ convertList.add(temp);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<BrandMap> resultList = new ArrayList<>();
|
|
|
+
|
|
|
+ List<StoreIn> storeList = storeInDao.findByEnUU(enuu);
|
|
|
+ if (CollectionUtils.isEmpty(storeList)){
|
|
|
+ throw new IllegalOperatorException("对应的店铺信息丢失,请刷新重新");
|
|
|
+ }else{
|
|
|
+ StoreIn store = storeList.get(0);
|
|
|
+ for (BrandTemp temp : convertList){
|
|
|
+ List<Brand> brandList = brandDao.findByNameEn(temp.getNameSd());
|
|
|
+ if (!CollectionUtils.isEmpty(brandList)){
|
|
|
+ Brand brand = brandList.get(0);
|
|
|
+ BrandMap map = new BrandMap();
|
|
|
+ map.setNameStandardEn(temp.getNameSd());
|
|
|
+ map.setNameStandardCn(brand.getNameCn());
|
|
|
+ map.setBrandid(brand.getId());
|
|
|
+ map.setUuid(brand.getUuid());
|
|
|
+ map.setNameChildEn(temp.getNameCd());
|
|
|
+ map.setNameChildCn(temp.getNameCd());
|
|
|
+ map.setEnuu(store.getEnUU());
|
|
|
+ map.setEnName(store.getStoreName());
|
|
|
+ map.setType(store.getType());
|
|
|
+
|
|
|
+ User user = SystemSession.getUser();
|
|
|
+ map.setUserUU(user.getUserUU());
|
|
|
+ map.setOperateName(user.getUserName());
|
|
|
+ map.setOperateTime(new Date());
|
|
|
+
|
|
|
+ resultList.add(map);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ brandMapDao.save(resultList);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|