|
@@ -38,64 +38,71 @@ public class ImportExcelListener extends AnalysisEventListener<Map<Integer, Stri
|
|
|
|
|
|
Map<String, String> ObjectMap = new HashMap<>();
|
|
|
|
|
|
- log.info("解析到的一条数据=====excelRow = {}", JSON.toJSONString(data));
|
|
|
+ String dataStr = JSON.toJSONString(data);
|
|
|
|
|
|
- data.forEach((key,vlue) ->{
|
|
|
- Object mapKey = importHeadList.get(key);
|
|
|
- if (StringUtils.isNotNull(mapKey)){
|
|
|
+ log.info("解析到的一条数据=====excelRow = {}", JSON.toJSONString(data));
|
|
|
|
|
|
- String keyStr = (String)mapKey;
|
|
|
- keyStr.replace(" ","");
|
|
|
+ if (!dataStr.isEmpty() && !StringUtils.equals(dataStr,"{}")){
|
|
|
+ data.forEach((key,vlue) ->{
|
|
|
+ Object mapKey = importHeadList.get(key);
|
|
|
+ if (StringUtils.isNotNull(mapKey)){
|
|
|
+
|
|
|
+ String keyStr = (String)mapKey;
|
|
|
+ keyStr.replace(" ","");
|
|
|
+
|
|
|
+ if (StringUtils.isNotNull(vlue)){
|
|
|
+ vlue = vlue.replace(" ","");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (keyStr.contains("家ID")){
|
|
|
+ ObjectMap.put("sellerId",vlue);
|
|
|
+ }
|
|
|
+ if (keyStr.contains("昵称")){
|
|
|
+ ObjectMap.put("sellerName",vlue);
|
|
|
+ }
|
|
|
+ if (keyStr.contains("粉丝")){
|
|
|
+ ObjectMap.put("fans",vlue);
|
|
|
+ }
|
|
|
+ if (keyStr.contains("行业")){
|
|
|
+ ObjectMap.put("industryId",vlue);
|
|
|
+ }
|
|
|
+ if (keyStr.contains("省份")){
|
|
|
+ ObjectMap.put("provinceId",vlue);
|
|
|
+ }
|
|
|
+ if (keyStr.contains("城市")){
|
|
|
+ ObjectMap.put("cityId",vlue);
|
|
|
+ }
|
|
|
+ if (keyStr.contains("联系")){
|
|
|
+ ObjectMap.put("telephone",vlue);
|
|
|
+ }
|
|
|
+ if (keyStr.contains("服务商")){
|
|
|
+ //ObjectMap.put("providerFlag",StringUtils.isEmpty(vlue) ? "否" : vlue);
|
|
|
+ ObjectMap.put("providerFlag",vlue);
|
|
|
+ }
|
|
|
+ if (keyStr.contains("跃迁")){
|
|
|
+ //ObjectMap.put("transitionFlag",StringUtils.isEmpty(vlue) ? "否" : vlue);
|
|
|
+ ObjectMap.put("transitionFlag",vlue);
|
|
|
+ }
|
|
|
+ if ((keyStr).contains("30天")){
|
|
|
+ ObjectMap.put("NearlyThirtyDays",vlue);
|
|
|
+ }
|
|
|
+
|
|
|
+ if ((keyStr).contains("gmv") || (keyStr).contains("GMV")){
|
|
|
+ ObjectMap.put("gmvMonth",keyStr.substring(0,keyStr.length()-3));
|
|
|
+ ObjectMap.put("gmv",vlue);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (keyStr.contains("mtd") || keyStr.contains("MTD")){
|
|
|
+ ObjectMap.put("mtdDate",keyStr.substring(0,keyStr.length()-3));
|
|
|
+ ObjectMap.put("mtd",vlue);
|
|
|
+ }
|
|
|
|
|
|
- if (StringUtils.isNotNull(vlue)){
|
|
|
- vlue = vlue.replace(" ","");
|
|
|
}
|
|
|
+ });
|
|
|
|
|
|
- if (keyStr.contains("家ID")){
|
|
|
- ObjectMap.put("sellerId",vlue);
|
|
|
- }
|
|
|
- if (keyStr.contains("昵称")){
|
|
|
- ObjectMap.put("sellerName",vlue);
|
|
|
- }
|
|
|
- if (keyStr.contains("粉丝")){
|
|
|
- ObjectMap.put("fans",vlue);
|
|
|
- }
|
|
|
- if (keyStr.contains("行业")){
|
|
|
- ObjectMap.put("industryId",vlue);
|
|
|
- }
|
|
|
- if (keyStr.contains("省份")){
|
|
|
- ObjectMap.put("provinceId",vlue);
|
|
|
- }
|
|
|
- if (keyStr.contains("城市")){
|
|
|
- ObjectMap.put("cityId",vlue);
|
|
|
- }
|
|
|
- if (keyStr.contains("联系")){
|
|
|
- ObjectMap.put("telephone",vlue);
|
|
|
- }
|
|
|
- if (keyStr.contains("服务商")){
|
|
|
- //ObjectMap.put("providerFlag",StringUtils.isEmpty(vlue) ? "否" : vlue);
|
|
|
- ObjectMap.put("providerFlag",vlue);
|
|
|
- }
|
|
|
- if (keyStr.contains("跃迁")){
|
|
|
- //ObjectMap.put("transitionFlag",StringUtils.isEmpty(vlue) ? "否" : vlue);
|
|
|
- ObjectMap.put("transitionFlag",vlue);
|
|
|
- }
|
|
|
- if ((keyStr).contains("30天")){
|
|
|
- ObjectMap.put("NearlyThirtyDays",vlue);
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
- if ((keyStr).contains("gmv") || (keyStr).contains("GMV")){
|
|
|
- ObjectMap.put("gmvMonth",keyStr.substring(0,keyStr.length()-3));
|
|
|
- ObjectMap.put("gmv",vlue);
|
|
|
- }
|
|
|
-
|
|
|
- if (keyStr.contains("mtd") || keyStr.contains("MTD")){
|
|
|
- ObjectMap.put("mtdDate",keyStr.substring(0,keyStr.length()-3));
|
|
|
- ObjectMap.put("mtd",vlue);
|
|
|
- }
|
|
|
|
|
|
- }
|
|
|
- });
|
|
|
|
|
|
importDataList.add(ObjectMap);
|
|
|
|