|
|
@@ -630,15 +630,30 @@ public class ComponentSubmitServiceImpl implements ComponentSubmitService {
|
|
|
component.setImg(img.toString().trim());
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 生命周期 (器件所处生命周期)
|
|
|
+ * ACTIVE 815 正常
|
|
|
+ * DISCONTINUED 816 即将停产
|
|
|
+ * OBSOLETE 817 停产
|
|
|
+ * PRELIMINARY 818 新品
|
|
|
+ */
|
|
|
+ Object lifecycle = row.get(7);
|
|
|
+ if (lifecycle != null && StringUtils.hasText(String.valueOf(lifecycle))) {
|
|
|
+ try {
|
|
|
+ component.setLifecycle(Integer.valueOf(String.valueOf(lifecycle)));
|
|
|
+ } catch (NumberFormatException e) {
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 描述
|
|
|
- Object description = row.get(7);
|
|
|
+ Object description = row.get(8);
|
|
|
if (description != null && StringUtils.hasText(description.toString())) {
|
|
|
component.setDescription(description.toString().trim());
|
|
|
}
|
|
|
|
|
|
// 参数值
|
|
|
Set<PropertyValueCrawl> propertyValues = new HashSet<PropertyValueCrawl>();
|
|
|
- for (int j = 8; j < maxSize && j < row.size(); j++) {
|
|
|
+ for (int j = 9; j < maxSize && j < row.size(); j++) {
|
|
|
Object property = row.get(j);
|
|
|
if (property != null && StringUtils.hasText(property.toString())) {
|
|
|
PropertyValueCrawl propertyValue = new PropertyValueCrawl();
|
|
|
@@ -680,7 +695,7 @@ public class ComponentSubmitServiceImpl implements ComponentSubmitService {
|
|
|
if (headers != null && headers.size() > 0) {
|
|
|
|
|
|
// 验证表头信息
|
|
|
- List<Object> header = headers.get(0).subList(0, 8);
|
|
|
+ List<Object> header = headers.get(0).subList(0, 9);
|
|
|
List<Object> exceptHeader = new ArrayList<Object>();
|
|
|
exceptHeader.add("型号");
|
|
|
exceptHeader.add("商城类目");
|
|
|
@@ -689,6 +704,7 @@ public class ComponentSubmitServiceImpl implements ComponentSubmitService {
|
|
|
exceptHeader.add("来源网址");
|
|
|
exceptHeader.add("规格书");
|
|
|
exceptHeader.add("图片");
|
|
|
+ exceptHeader.add("生命周期");
|
|
|
exceptHeader.add("描述");
|
|
|
|
|
|
if (header.equals(exceptHeader)) {
|
|
|
@@ -699,16 +715,16 @@ public class ComponentSubmitServiceImpl implements ComponentSubmitService {
|
|
|
if (size > 0 && size < 10000) {
|
|
|
int rowSize = headers.get(0).size();
|
|
|
if (rowSize < 50) {
|
|
|
- // 列数超过30的文件不得超过2000行
|
|
|
- if (rowSize > 30 && size > 2000) {
|
|
|
- throw new IllegalOperatorException("属性超过22个时,文件只允许上传2000行");
|
|
|
+ // 列数超过34的文件不得超过2000行
|
|
|
+ if (rowSize > 34 && size > 2000) {
|
|
|
+ throw new IllegalOperatorException("属性超过25个时,文件只允许上传2000行");
|
|
|
}
|
|
|
map.put("rows", rows);
|
|
|
map.put("fileName", fileName);
|
|
|
return map;
|
|
|
// 整体列数不得超过50
|
|
|
} else {
|
|
|
- throw new IllegalOperatorException("属性值不得超过42个");
|
|
|
+ throw new IllegalOperatorException("属性值不得超过41个");
|
|
|
}
|
|
|
// 文件不得超过10000行
|
|
|
} else {
|