|
|
@@ -1,5 +1,7 @@
|
|
|
package com.uas.platform.b2c.prod.product.component.service.impl;
|
|
|
|
|
|
+import com.google.common.collect.ImmutableSet;
|
|
|
+import com.google.common.collect.Iterables;
|
|
|
import com.uas.platform.b2c.common.account.dao.UserBaseInfoDao;
|
|
|
import com.uas.platform.b2c.common.base.service.SendMessageService;
|
|
|
import com.uas.platform.b2c.core.support.SystemSession;
|
|
|
@@ -723,6 +725,25 @@ public class ComponentSubmitServiceImpl implements ComponentSubmitService {
|
|
|
|
|
|
@Override
|
|
|
public List<ComponentCrawl> uploadComponentCrawl(List<Map<String, Object>> maps) {
|
|
|
+ // 验证表头信息是否一致
|
|
|
+ Map<String, Object> firstRow = maps.get(0);
|
|
|
+ Set<String> theads = ImmutableSet.copyOf(Iterables.limit(firstRow.keySet(), 8));
|
|
|
+
|
|
|
+ // 模板表头
|
|
|
+ Set<String> expectHeads = new HashSet<String>();
|
|
|
+ expectHeads.add("型号");
|
|
|
+ expectHeads.add("商城类目");
|
|
|
+ expectHeads.add("目标类目");
|
|
|
+ expectHeads.add("商城品牌");
|
|
|
+ expectHeads.add("来源网址");
|
|
|
+ expectHeads.add("规格书");
|
|
|
+ expectHeads.add("图片");
|
|
|
+ expectHeads.add("描述");
|
|
|
+
|
|
|
+ if (!expectHeads.containsAll(theads)) {
|
|
|
+ throw new IllegalOperatorException("表格表头内容不对,请重新确认模板");
|
|
|
+ }
|
|
|
+
|
|
|
return null;
|
|
|
}
|
|
|
|