Browse Source

修改快手文件解析入库

yumeng 4 years ago
parent
commit
b5348410af

+ 10 - 5
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java

@@ -40,6 +40,7 @@ import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.util.DateUtils;
 import org.quartz.JobExecutionException;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -136,8 +137,14 @@ public class TestController {
     @Autowired
     private IMaterialUploadService materialUploadService;
 
+    @Value("${xxl-job.requestUrl}")
+    private String jobUrl;
+
     @GetMapping("/uploadVideo")
     public String uploadVideo(Long projectId) {
+
+        System.err.println(jobUrl + "/jeecg-boot/ai/create/customCreativeLimit");
+
         //  832
         JSONArray idList = materialInfoService.getIdListByProject(832L);
         JSONArray accountArray = new JSONArray();
@@ -148,7 +155,6 @@ public class TestController {
         accountArray.add(9825207L);
 
 
-
         materialUploadService.uploadAccount("2", idList, accountArray, "2e3b982046a44b5faadaa77a7c0da114", true);
         return "success";
     }
@@ -1060,17 +1066,16 @@ public class TestController {
 
 
     @GetMapping(value = "/getHistoryDataByAccountId")
-    public String getHistoryDataByAccountId(Long accountId) {
+    public String getHistoryDataByAccountId(Long accountId, String startDte, String endDate) {
         Result<String> result = new Result<>();
         try {
-            String endDateStr = DateUtils.getDate("yyyy-MM-dd");
-            String startDate = DateUtils.addMonth(endDateStr, -6);
+
             QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();
             tokenQueryWrapper.eq("media_id", 2);
             tokenQueryWrapper.eq("account_id", accountId);
             CtopOauthToken ctopOauthTokens = tokenMapper.selectOne(tokenQueryWrapper);
             if (!Check.isNull(ctopOauthTokens)) {
-                historyReportTaskService.createTask(ctopOauthTokens.getAccountId(), ctopOauthTokens.getAccessToken(), startDate, endDateStr, CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_HISTORY);
+                historyReportTaskService.createTask(ctopOauthTokens.getAccountId(), ctopOauthTokens.getAccessToken(), startDte, endDate, CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_HISTORY);
 
             }
         } catch (Exception e) {

+ 56 - 28
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -2,24 +2,18 @@ package org.jeecg;
 
 import cn.com.ctop.common.module.entity.BindAccountLogin;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.service.IBindAccountLoginService;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.service.IUserAllocationService;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.kuaishou.modules.batch.service.*;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
-import cn.com.ctop.kuaishou.modules.material.service.IEtlKuaishouVideoInfoService;
 import cn.com.ctop.kuaishou.modules.report.mapper.EtlKuaishouAccountMaterialReportDailyMapper;
-import cn.com.ctop.kuaishou.modules.report.service.*;
-import cn.com.ctop.oa.modules.service.IWechatCheckinDataService;
+import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyImageService;
 import cn.com.ctop.oa.modules.service.IWechatNoListService;
-import cn.com.ctop.oa.modules.service.IWechatUserListService;
 import cn.com.ctop.toutiao.modules.link.service.IETLReportBytedanceVideoService;
-import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceCampaignService;
-import cn.com.ctop.toutiao.modules.report.entity.BytedanceAccountReportTaskRecord;
 import cn.com.ctop.toutiao.modules.report.service.*;
+import com.csvreader.CsvReader;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.junit.Test;
@@ -30,8 +24,10 @@ import org.springframework.test.context.ActiveProfiles;
 import org.springframework.test.context.junit4.SpringRunner;
 
 import javax.annotation.Resource;
+import java.io.IOException;
+import java.nio.charset.Charset;
 import java.text.ParseException;
-import java.text.SimpleDateFormat;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -39,8 +35,6 @@ import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
-import static org.jeecg.common.util.DateUtils.getAnotherDay;
-
 @RunWith(SpringRunner.class)
 @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
 @ActiveProfiles("wps")
@@ -52,19 +46,47 @@ public class SampleTest {
     private IBindAccountLoginService bindAccountLoginService;
     @Autowired
     private IKuaishouWebInterfaceService kuaishouWebInterfaceService;
+    @Autowired
+    private IKuaishouInterfaceService kuaishouInterfaceService;
 
     @Test
-    public void loadKuaishouCookie() {
-        List<BindAccountLogin> list = bindAccountLoginService.getListByParams(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_PY, 1);
-        if (list != null && !list.isEmpty()) {
-            int i = 0;
-            for (BindAccountLogin login : list) {
-                if (null == login.getCookie() || "".equals(login.getCookie().trim())) {
-                    kuaishouWebInterfaceService.getkuaishouWebLoginCookie(login);
-                    i++;
-                }
+    public void loadKuaishouCookie() throws ParseException {
+
+
+        try {
+            // 用来保存数据
+            ArrayList<String[]> csvFileList = new ArrayList<String[]>();
+            // 定义一个CSV路径
+            String csvFilePath = "D:\\test\\123.csv";
+            // 创建CSV读对象 例如:CsvReader(文件路径,分隔符,编码格式);
+            CsvReader reader = new CsvReader(csvFilePath, ',', Charset.forName("UTF-8"));
+            // 跳过表头 如果需要表头的话,这句可以忽略
+            reader.readHeaders();
+            // 逐行读入除表头的数据
+            while (reader.readRecord()) {
+                System.out.println(reader.getRawRecord());
+                csvFileList.add(reader.getValues());
+            }
+            reader.close();
+
+            // 遍历读取的CSV文件
+            for (int row = 0; row < csvFileList.size(); row++) {
+                // 取得第row行第0列的数据
+                String cell = csvFileList.get(row)[0];
+                System.out.println("------------>" + cell);
             }
+        } catch (IOException e) {
+            e.printStackTrace();
         }
+
+
+
+
+
+       /* CtopOauthToken tokenByAccountId = tokenService.getTokenByAccountId(9792526L);
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        Date parse = dateFormat.parse("2021-04-02");
+        kuaishouInterfaceService.getAdvertiserReportDaily(tokenByAccountId, parse, parse, null);*/
     }
 
 
@@ -96,6 +118,7 @@ public class SampleTest {
             log.info("快手删评论所用时长:{}毫秒", end - start);
         }
     }
+
     @Autowired
     private IBytedanceReportService bytedanceReportService;
 
@@ -106,7 +129,7 @@ public class SampleTest {
         List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
         Long start = System.currentTimeMillis();
 
-        tokens.forEach(token->{
+        tokens.forEach(token -> {
             bytedanceReportService.bytedanceVideoMaterialReport(token, startDate, endDate);
         });
         Long end = System.currentTimeMillis();
@@ -117,11 +140,12 @@ public class SampleTest {
     private IWechatNoListService wechatNoListService;
     @Autowired
     private IETLReportBytedanceVideoService bytedanceVideoService;
+
     @Test
-    public void etlBytedanceVideoInfo(){
+    public void etlBytedanceVideoInfo() {
         String startDate = "2021-02-01";
-        for(int i=0;i<100;i++){
-            bytedanceVideoService.cleanData(DateUtils.addDay(startDate,i));
+        for (int i = 0; i < 100; i++) {
+            bytedanceVideoService.cleanData(DateUtils.addDay(startDate, i));
         }
     }
 
@@ -162,6 +186,7 @@ public class SampleTest {
     IKuaishouReportDailyImageService kuaishouReportDailyImageService;
     @Autowired
     IRuleByteDanceAccountService ruleByteDanceAccountService;
+
     @Test
     public void loadBDAccoutData() {
         Date startDate = DateUtils.addDay(new Date(), -2000);
@@ -170,6 +195,7 @@ public class SampleTest {
             bytedanceVideoEtlInfoService.etlBytedanceVideoInfo(getDate);
         }
     }
+
     @Resource
     private EtlKuaishouAccountMaterialReportDailyMapper etlKuaishouAccountMaterialReportDailyMapper;
 
@@ -177,12 +203,14 @@ public class SampleTest {
     public void etlKuaishouVideoInfo() {
         etlKuaishouAccountMaterialReportDailyMapper.etlKuaishouAccountMaterialReportDailyData(DateUtils.formatDate());
     }
+
     @Autowired
     private IByteDanceCampaignService campaignService;
+
     @Test
-    public void testLoadBytedanceCampaign(){
-        List<CtopOauthToken>tokens = tokenService.selectToutiaoToken();
-        for(CtopOauthToken token :tokens){
+    public void testLoadBytedanceCampaign() {
+        List<CtopOauthToken> tokens = tokenService.selectToutiaoToken();
+        for (CtopOauthToken token : tokens) {
             campaignService.getAdvertiserCampaign(token, null, null);
         }
     }

+ 794 - 0
module-common/src/main/java/cn/com/ctop/common/module/utils/ConverterUtils.java

@@ -0,0 +1,794 @@
+package cn.com.ctop.common.module.utils;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.text.NumberFormat;
+import java.text.ParseException;
+
+/**
+ * A simple object converter
+ * <br>
+ * 一个简单的数据类型转换工具类
+ */
+public class ConverterUtils {
+
+    public static void main(String[] args) {
+        Long asLong = ConverterUtils.getAsLong("12121.3444");
+        System.err.println(asLong);
+    }
+
+
+    /**
+     * Gets a String from a Object in a null-safe manner.
+     * <p>
+     * The String is obtained via <code>toString</code>.
+     *
+     * @param obj the object to use
+     * @return the value of the Object as a String, <code>null</code> if null object input
+     */
+    public static String getAsString(final Object obj) {
+        if (obj != null) {
+            return obj.toString();
+        }
+        return null;
+    }
+
+    /**
+     * Gets a String from a Object in a null-safe manner.
+     * <p>
+     * The String is obtained via <code>toString</code>.
+     *
+     * @param obj          the object to use
+     * @param defaultValue what to return if the value is null or if the conversion fails
+     * @return the value of the Object as a String, <code>defaultValue</code> if null object input
+     */
+    public static String getAsString(final Object obj, final String defaultValue) {
+        String answer = getAsString(obj);
+        if (answer == null) {
+            answer = defaultValue;
+        }
+        return answer;
+    }
+
+    /**
+     * Gets a Number from a Object in a null-safe manner.
+     * <p>
+     * If the value is a <code>Number</code> it is returned directly.
+     * If the value is a <code>String</code> it is converted using
+     * {@link NumberFormat#parse(String)} on the system default formatter
+     * returning <code>null</code> if the conversion fails.
+     * Otherwise, <code>null</code> is returned.
+     *
+     * @param obj the object to use
+     * @return the value of the Object as a Number, <code>null</code> if null object input
+     */
+    public static Number getAsNumber(final Object obj) {
+        if (obj != null) {
+            if (obj instanceof Number) {
+                return (Number) obj;
+            } else if (obj instanceof Boolean) {
+                return ((Boolean) obj) ? 1 : 0;
+            } else if (obj instanceof String) {
+                try {
+                    return NumberFormat.getInstance().parse((String) obj);
+                } catch (final ParseException e) {
+                    throw new NumberFormatException("For input string: \"" + obj + "\"");
+                }
+            } else {
+                throw new UnsupportedOperationException();
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Converting the Object into a number,
+     * using the default value if the the conversion fails.
+     *
+     * @param obj          the object to use
+     * @param defaultValue what to return if the value is null or if the conversion fails
+     * @return the value of the object as a number, or defaultValue if the
+     * original value is null, the object is null or the number conversion
+     * fails
+     */
+    @SuppressWarnings("unchecked")
+    public static <R extends Number> R getAsNumber(final Object obj, R defaultValue) {
+        Number answer = getAsNumber(obj);
+        if (answer == null) {
+            answer = defaultValue;
+        }
+        return (R) answer;
+    }
+
+    /**
+     * Gets a Boolean from a Object in a null-safe manner.
+     * <p>
+     * If the value is a <code>Boolean</code> it is returned directly.
+     * If the value is a <code>String</code> and it equals 'true' ignoring case
+     * then <code>true</code> is returned, otherwise <code>false</code>.
+     * If the value is a <code>Number</code> an integer zero value returns
+     * <code>false</code> and non-zero returns <code>true</code>.
+     * Otherwise, <code>null</code> is returned.
+     *
+     * @param obj the object to use
+     * @return the value of the Object as a Boolean, <code>null</code> if null object input
+     */
+    public static Boolean getAsBoolean(final Object obj) {
+        if (obj != null) {
+            if (obj instanceof Boolean) {
+                return (Boolean) obj;
+            } else if (obj instanceof String) {
+                return Boolean.valueOf((String) obj);
+            } else if (obj instanceof Number) {
+                final Number n = (Number) obj;
+                return (n.intValue() != 0) ? Boolean.TRUE : Boolean.FALSE;
+            } else {
+                throw new UnsupportedOperationException();
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Gets a Boolean from a Object in a null-safe manner.
+     * <p>
+     * If the value is a <code>Boolean</code> it is returned directly.
+     * If the value is a <code>String</code> and it equals 'true' ignoring case
+     * then <code>true</code> is returned, otherwise <code>false</code>.
+     * If the value is a <code>Number</code> an integer zero value returns
+     * <code>false</code> and non-zero returns <code>true</code>.
+     * Otherwise, <code>null</code> is returned.
+     *
+     * @param obj          the object to use
+     * @param defaultValue what to return if the value is null or if the conversion fails
+     * @return the value of the Object as a Boolean, <code>defaultValue</code> if null object input
+     */
+    public static Boolean getAsBoolean(final Object obj, final Boolean defaultValue) {
+        Boolean answer = getAsBoolean(obj);
+        if (answer == null) {
+            answer = defaultValue;
+        }
+        return answer;
+    }
+
+    /**
+     * Gets a boolean from a Object in a null-safe manner.
+     * <p>
+     * If the value is a <code>Boolean</code> its value is returned.
+     * If the value is a <code>String</code> and it equals 'true' ignoring case
+     * then <code>true</code> is returned, otherwise <code>false</code>.
+     * If the value is a <code>Number</code> an integer zero value returns
+     * <code>false</code> and non-zero returns <code>true</code>.
+     * Otherwise, <code>false</code> is returned.
+     *
+     * @param obj the object to use
+     * @return the value of the Object as a Boolean, <code>false</code> if null object input
+     */
+    public static boolean getAsBooleanValue(final Object obj) {
+        final Boolean booleanObject = getAsBoolean(obj);
+        if (booleanObject == null) {
+            return false;
+        }
+        return booleanObject.booleanValue();
+    }
+
+    /**
+     * Gets a boolean from a Object in a null-safe manner.
+     * <p>
+     * If the value is a <code>Boolean</code> its value is returned.
+     * If the value is a <code>String</code> and it equals 'true' ignoring case
+     * then <code>true</code> is returned, otherwise <code>false</code>.
+     * If the value is a <code>Number</code> an integer zero value returns
+     * <code>false</code> and non-zero returns <code>true</code>.
+     * Otherwise, <code>false</code> is returned.
+     *
+     * @param obj          the object to use
+     * @param defaultValue what to return if the value is null or if the conversion fails
+     * @return the value in the Map as a Boolean, <code>defaultValue</code> if null object input
+     */
+    public static boolean getAsBooleanValue(final Object obj, final boolean defaultValue) {
+        final Boolean booleanObject = getAsBoolean(obj);
+        if (booleanObject == null) {
+            return defaultValue;
+        }
+        return booleanObject.booleanValue();
+    }
+
+    /**
+     * Gets a Byte from a Object in a null-safe manner,
+     * using the default value if the the conversion fails.
+     * <p>
+     * The Byte is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj the object to use
+     * @return the value of Object as a Byte, <code>null</code> if null object input
+     */
+    public static Byte getAsByte(final Object obj) {
+        final Number answer = getAsNumber(obj);
+        if (answer == null) {
+            return null;
+        } else if (answer instanceof Byte) {
+            return (Byte) answer;
+        }
+        return Byte.valueOf(answer.byteValue());
+    }
+
+    /**
+     * Gets a Byte from a Object in a null-safe manner,
+     * using the default value if the the conversion fails.
+     * <p>
+     * The Byte is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj          the object to use
+     * @param defaultValue return if the value is null or if the conversion fails
+     * @return the value of Object as a Byte, <code>defaultValue</code> if null object input
+     */
+    public static Byte getAsByte(final Object obj, final Byte defaultValue) {
+        Byte answer = getAsByte(obj);
+        if (answer == null) {
+            answer = defaultValue;
+        }
+        return answer;
+    }
+
+    /**
+     * Gets a byte from a Object in a null-safe manner.
+     * <p>
+     * The byte is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj the object to use
+     * @return the value of the Object as a byte, <code>0</code> if null object input
+     */
+    public static byte getAsByteValue(final Object obj) {
+        final Byte byteObject = getAsByte(obj);
+        if (byteObject == null) {
+            return 0;
+        }
+        return byteObject.byteValue();
+    }
+
+    /**
+     * Gets a byte from a Object in a null-safe manner.
+     * <p>
+     * The byte is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj          the object to use
+     * @param defaultValue return if the value is null or if the conversion fails
+     * @return the value of the Object as a byte, <code>defaultValue</code> if null object input
+     */
+    public static byte getAsByteValue(final Object obj, final byte defaultValue) {
+        final Byte byteObject = getAsByte(obj);
+        if (byteObject == null) {
+            return defaultValue;
+        }
+        return byteObject.byteValue();
+    }
+
+    /**
+     * Gets a Short from a Object in a null-safe manner.
+     * <p>
+     * The Short is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj the object to use
+     * @return the value of the Object as a Short, <code>null</code> if null object input
+     */
+    public static Short getAsShort(final Object obj) {
+        final Number answer = getAsNumber(obj);
+        if (answer == null) {
+            return null;
+        } else if (answer instanceof Short) {
+            return (Short) answer;
+        }
+        return Short.valueOf(answer.shortValue());
+    }
+
+    /**
+     * Gets a Short from a Object in a null-safe manner,
+     * using the default value if the the conversion fails.
+     * <p>
+     * The Short is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj          the object to use
+     * @param defaultValue return if the value is null or if the conversion fails
+     * @return the value of Object as a Short, <code>defaultValue</code> if null object input
+     */
+    public static Short getAsShort(final Object obj, final Short defaultValue) {
+        Short answer = getAsShort(obj);
+        if (answer == null) {
+            answer = defaultValue;
+        }
+        return answer;
+    }
+
+    /**
+     * Gets a short from a Object in a null-safe manner.
+     * <p>
+     * The short is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj the object to use
+     * @return the value of the Object as a short, <code>0</code> if null object input
+     */
+    public static short getAsShortValue(final Object obj) {
+        final Short shortObject = getAsShort(obj);
+        if (shortObject == null) {
+            return 0;
+        }
+        return shortObject.shortValue();
+    }
+
+    /**
+     * Gets a short from a Object in a null-safe manner.
+     * <p>
+     * The short is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj          the object to use
+     * @param defaultValue return if the value is null or if the conversion fails
+     * @return the value of the Object as a short, <code>defaultValue</code> if null object input
+     */
+    public static short getAsShortValue(final Object obj, final short defaultValue) {
+        final Short shortObject = getAsShort(obj);
+        if (shortObject == null) {
+            return defaultValue;
+        }
+        return shortObject.shortValue();
+    }
+
+    /**
+     * Gets a Integer from a Object in a null-safe manner.
+     * <p>
+     * The Integer is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj the object to use
+     * @return the value of the Object as a Integer, <code>null</code> if null object input
+     */
+    public static Integer getAsInteger(final Object obj) {
+        final Number answer = getAsNumber(obj);
+        if (answer == null) {
+            return null;
+        } else if (answer instanceof Integer) {
+            return (Integer) answer;
+        }
+        return Integer.valueOf(answer.intValue());
+    }
+
+    /**
+     * Gets a Integer from a Object in a null-safe manner,
+     * using the default value if the the conversion fails.
+     * <p>
+     * The Integer is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj          the object to use
+     * @param defaultValue return if the value is null or if the conversion fails
+     * @return the value of Object as a Integer, <code>defaultValue</code> if null object input
+     */
+    public static Integer getAsInteger(final Object obj, final Integer defaultValue) {
+        Integer answer = getAsInteger(obj);
+        if (answer == null) {
+            answer = defaultValue;
+        }
+        return answer;
+    }
+
+    /**
+     * Gets a int from a Object in a null-safe manner.
+     * <p>
+     * The int is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj the object to use
+     * @return the value of the Object as a int, <code>0</code> if null object input
+     */
+    public static int getAsIntValue(final Object obj) {
+        final Integer integerObject = getAsInteger(obj);
+        if (integerObject == null) {
+            return 0;
+        }
+        return integerObject.intValue();
+    }
+
+    /**
+     * Gets a int from a Object in a null-safe manner.
+     * <p>
+     * The int is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj          the object to use
+     * @param defaultValue return if the value is null or if the conversion fails
+     * @return the value of the Object as a int, <code>defaultValue</code> if null object input
+     */
+    public static int getAsIntValue(final Object obj, final int defaultValue) {
+        final Integer integerObject = getAsInteger(obj);
+        if (integerObject == null) {
+            return defaultValue;
+        }
+        return integerObject.intValue();
+    }
+
+    /**
+     * Gets a Long from a Object in a null-safe manner.
+     * <p>
+     * The Long is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj the object to use
+     * @return the value of the Object as a Long, <code>null</code> if null object input
+     */
+    public static Long getAsLong(final Object obj) {
+        final Number answer = getAsNumber(obj);
+        if (Check.isNull(answer)) {
+            return null;
+        } else if (answer instanceof Long) {
+            return (Long) answer;
+        }
+        return Long.valueOf(answer.longValue());
+    }
+
+    /**
+     * Gets a Long from a Object in a null-safe manner,
+     * using the default value if the the conversion fails.
+     * <p>
+     * The Long is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj          the object to use
+     * @param defaultValue return if the value is null or if the conversion fails
+     * @return the value of Object as a Long, <code>defaultValue</code> if null object input
+     */
+    public static Long getAsLong(final Object obj, final Long defaultValue) {
+        Long answer = getAsLong(obj);
+        if (answer == null) {
+            answer = defaultValue;
+        }
+        return answer;
+    }
+
+    /**
+     * Gets a long from a Object in a null-safe manner.
+     * <p>
+     * The long is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj the object to use
+     * @return the value of the Object as a long, <code>0L</code> if null object input
+     */
+    public static long getAsLongValue(final Object obj) {
+        final Long longObject = getAsLong(obj);
+        if (longObject == null) {
+            return 0L;
+        }
+        return longObject.longValue();
+    }
+
+    /**
+     * Gets a long from a Object in a null-safe manner,
+     * using the default value if the the conversion fails.
+     * <p>
+     * The long is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj          the object to use
+     * @param defaultValue return if the value is null or if the conversion fails
+     * @return the value of Object as a long, <code>defaultValue</code> if null object input
+     */
+    public static long getAsLongValue(final Object obj, final long defaultValue) {
+        final Long longObject = getAsLong(obj);
+        if (longObject == null) {
+            return defaultValue;
+        }
+        return longObject.longValue();
+    }
+
+    /**
+     * Gets a Float from a Object in a null-safe manner.
+     * <p>
+     * The Float is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj the object to use
+     * @return the value of the Object as a Float, <code>null</code> if null object input
+     */
+    public static Float getAsFloat(final Object obj) {
+        final Number answer = getAsNumber(obj);
+        if (answer == null) {
+            return null;
+        } else if (answer instanceof Float) {
+            return (Float) answer;
+        }
+        return Float.valueOf(answer.floatValue());
+    }
+
+    /**
+     * Gets a Float from a Object in a null-safe manner,
+     * using the default value if the the conversion fails.
+     * <p>
+     * The Float is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj          the object to use
+     * @param defaultValue return if the value is null or if the conversion fails
+     * @return the value of Object as a Float, <code>defaultValue</code> if null object input
+     */
+    public static Float getAsFloat(final Object obj, final Float defaultValue) {
+        Float answer = getAsFloat(obj);
+        if (answer == null) {
+            answer = defaultValue;
+        }
+        return answer;
+    }
+
+    /**
+     * Gets a float from a Object in a null-safe manner.
+     * <p>
+     * The float is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj the object to use
+     * @return the value of Object as a float, <code>0.0F</code> if null object input
+     */
+    public static float getAsFloatValue(final Object obj) {
+        final Float floatObject = getAsFloat(obj);
+        if (floatObject == null) {
+            return 0f;
+        }
+        return floatObject.floatValue();
+    }
+
+    /**
+     * Gets a float from a Object in a null-safe manner,
+     * using the default value if the the conversion fails.
+     * <p>
+     * The float is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj          the object to use
+     * @param defaultValue return if the value is null or if the conversion fails
+     * @return the value of Object as a float, <code>defaultValue</code> if null object input
+     */
+    public static float getAsFloatValue(final Object obj, final float defaultValue) {
+        final Float floatObject = getAsFloat(obj);
+        if (floatObject == null) {
+            return defaultValue;
+        }
+        return floatObject.floatValue();
+    }
+
+    /**
+     * Gets a Double from a Object in a null-safe manner.
+     * <p>
+     * The Double is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj the object to use
+     * @return the value of the Object as a Double, <code>null</code> if null object input
+     */
+    public static Double getAsDouble(final Object obj) {
+        final Number answer = getAsNumber(obj);
+        if (Check.isNull(answer)) {
+            return null;
+        } else if (answer instanceof Double) {
+            return (Double) answer;
+        }
+        return Double.valueOf(answer.doubleValue());
+    }
+
+    /**
+     * Gets a Double from a Object in a null-safe manner,
+     * using the default value if the the conversion fails.
+     * <p>
+     * The Double is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj          the object to use
+     * @param defaultValue return if the value is null or if the conversion fails
+     * @return the value of Object as a Double, <code>defaultValue</code> if null object input
+     */
+    public static Double getAsDouble(final Object obj, final Double defaultValue) {
+        Double answer = getAsDouble(obj);
+        if (answer == null) {
+            answer = defaultValue;
+        }
+        return answer;
+    }
+
+    /**
+     * Gets a double from a Object in a null-safe manner.
+     * <p>
+     * The double is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj the object to use
+     * @return the value of Object as a double, <code>0.0</code> if null object input
+     */
+    public static double getAsDoubleValue(final Object obj) {
+        final Double doubleObject = getAsDouble(obj);
+        if (doubleObject == null) {
+            return 0d;
+        }
+        return doubleObject.doubleValue();
+    }
+
+    /**
+     * Gets a double from a Object in a null-safe manner,
+     * using the default value if the the conversion fails.
+     * <p>
+     * The double is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj          the object to use
+     * @param defaultValue return if the value is null or if the conversion fails
+     * @return the value of Object as a double, <code>defaultValue</code> if null object input
+     */
+    public static double getAsDoubleValue(final Object obj, final double defaultValue) {
+        final Double doubleObject = getAsDouble(obj);
+        if (doubleObject == null) {
+            return defaultValue;
+        }
+        return doubleObject.doubleValue();
+    }
+
+    /**
+     * Gets a BigInteger from a Object in a null-safe manner.
+     * <p>
+     * The BigInteger is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj the object to use
+     * @return the value of Object as a BigInteger, <code>0</code> if null object input
+     */
+    public static BigInteger getAsBigInteger(final Object obj) {
+        if (obj != null) {
+            if (obj instanceof BigInteger) {
+                return (BigInteger) obj;
+            } else if (obj instanceof String) {
+                return new BigInteger((String) obj);
+            } else if (obj instanceof Number || obj instanceof Boolean) {
+                final Number answer = getAsNumber(obj);
+                if (answer != null) {
+                    return BigInteger.valueOf(answer.longValue());
+                }
+            } else {
+                throw new UnsupportedOperationException();
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Gets a BigInteger from a Object in a null-safe manner,
+     * using the default value if the the conversion fails.
+     * <p>
+     * The BigInteger is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj          the object to use
+     * @param defaultValue return if the value is null or if the conversion fails
+     * @return the value of Object as a BigInteger, <code>defaultValue</code> if null object input
+     */
+    @SuppressWarnings("unchecked")
+    public static <R extends BigInteger> R getAsBigInteger(final Object obj, final R defaultValue) {
+        BigInteger answer = getAsBigInteger(obj);
+        if (answer == null) {
+            answer = defaultValue;
+        }
+        return (R) answer;
+    }
+
+    /**
+     * Gets a BigDecimal from a Object in a null-safe manner.
+     * <p>
+     * The BigDecimal is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj the object to use
+     * @return the value of Object as a BigDecimal, <code>0</code> if null object input
+     */
+    public static BigDecimal getAsBigDecimal(final Object obj) {
+        if (!Check.isNull(obj)) {
+            if (obj instanceof BigDecimal) {
+                return (BigDecimal) obj;
+            } else if (obj instanceof String) {
+                return new BigDecimal((String) obj);
+            } else if (obj instanceof Number || obj instanceof Boolean) {
+                final Number answer = getAsNumber(obj);
+                if (answer != null) {
+                    return BigDecimal.valueOf(answer.doubleValue());
+                }
+            } else {
+                throw new UnsupportedOperationException();
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Gets a BigDecimal from a Object in a null-safe manner,
+     * using the default value if the the conversion fails.
+     * <p>
+     * The BigDecimal is obtained from the results of {@link #getAsNumber(Object)}.
+     *
+     * @param obj          the object to use
+     * @param defaultValue return if the value is null or if the conversion fails
+     * @return the value of Object as a BigDecimal, <code>defaultValue</code> if null object input
+     */
+    @SuppressWarnings("unchecked")
+    public static <R extends BigDecimal> R getAsBigDecimal(final Object obj, final R defaultValue) {
+        BigDecimal answer = getAsBigDecimal(obj);
+        if (answer == null) {
+            answer = defaultValue;
+        }
+        return (R) answer;
+    }
+
+    /**
+     * This method is mainly used to provide data type conversion services.
+     *
+     * @param obj the object to use
+     * @param clz the type for conversion
+     * @return
+     */
+    @SuppressWarnings("unchecked")
+    public static <R> R cast(final Object obj, final Class<R> clz) {
+        if (obj == null) {
+            throw new IllegalArgumentException("'obj' must not be null");
+        }
+        if (clz == null) {
+            throw new IllegalArgumentException("'clz' must not be null");
+        }
+        R result = null;
+        if (Boolean.class.equals(clz) || boolean.class.equals(clz)) {
+            result = (R) getAsBoolean(obj);
+        } else if (Byte.class.equals(clz) || byte.class.equals(clz)) {
+            result = (R) getAsByte(obj);
+        } else if (Short.class.equals(clz) || short.class.equals(clz)) {
+            result = (R) getAsShort(obj);
+        } else if (Integer.class.equals(clz) || int.class.equals(clz)) {
+            result = (R) getAsInteger(obj);
+        } else if (Long.class.equals(clz) || long.class.equals(clz)) {
+            result = (R) getAsLong(obj);
+        } else if (Float.class.equals(clz) || float.class.equals(clz)) {
+            result = (R) getAsFloat(obj);
+        } else if (Double.class.equals(clz) || double.class.equals(clz)) {
+            result = (R) getAsDouble(obj);
+        } else if (String.class.equals(clz)) {
+            result = (R) getAsString(obj);
+        } else if (BigInteger.class.isAssignableFrom(clz)) {
+            result = (R) getAsBigInteger(obj);
+        } else if (BigDecimal.class.isAssignableFrom(clz)) {
+            result = (R) getAsBigDecimal(obj);
+        } else if (Number.class.isAssignableFrom(clz)) {
+            result = (R) getAsNumber(obj);
+        } else {
+            throw new UnsupportedOperationException();
+        }
+        return result;
+    }
+
+    /**
+     * This method is mainly used to provide data type conversion services.
+     *
+     * @param obj          the object to use
+     * @param defaultValue return if the value is null or if the conversion fails
+     * @return
+     */
+    @SuppressWarnings("unchecked")
+    public static <R> R cast(final Object obj, final R defaultValue) {
+        if (obj == null) {
+            throw new IllegalArgumentException("'obj' must not be null");
+        }
+        if (defaultValue == null) {
+            throw new IllegalArgumentException("'defaultValue' must not be null");
+        }
+        R result = null;
+        final Class<?> clz = defaultValue.getClass();
+        if (Boolean.class.equals(clz) || boolean.class.equals(clz)) {
+            result = (R) getAsBoolean(obj, (Boolean) defaultValue);
+        } else if (Byte.class.equals(clz) || byte.class.equals(clz)) {
+            result = (R) getAsByte(obj, (Byte) defaultValue);
+        } else if (Short.class.equals(clz) || short.class.equals(clz)) {
+            result = (R) getAsShort(obj, (Short) defaultValue);
+        } else if (Integer.class.equals(clz) || int.class.equals(clz)) {
+            result = (R) getAsInteger(obj, (Integer) defaultValue);
+        } else if (Long.class.equals(clz) || long.class.equals(clz)) {
+            result = (R) getAsLong(obj, (Long) defaultValue);
+        } else if (Float.class.equals(clz) || float.class.equals(clz)) {
+            result = (R) getAsFloat(obj, (Float) defaultValue);
+        } else if (Double.class.equals(clz) || double.class.equals(clz)) {
+            result = (R) getAsDouble(obj, (Double) defaultValue);
+        } else if (String.class.equals(clz)) {
+            result = (R) getAsString(obj, (String) defaultValue);
+        } else if (BigInteger.class.isAssignableFrom(clz)) {
+            result = (R) getAsBigInteger(obj, (BigInteger) defaultValue);
+        } else if (BigDecimal.class.isAssignableFrom(clz)) {
+            result = (R) getAsBigDecimal(obj, (BigDecimal) defaultValue);
+        } else if (Number.class.isAssignableFrom(clz)) {
+            result = (R) getAsNumber(obj, (Number) defaultValue);
+        } else {
+            throw new UnsupportedOperationException();
+        }
+        return result;
+    }
+
+}

+ 113 - 8
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouHistoryReportTaskServiceImpl.java

@@ -11,17 +11,21 @@ import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouDailyReportTaskServic
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterial;
 import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouReportDailyMaterialVo;
+import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccount;
 import cn.com.ctop.kuaishou.modules.report.entity.VideoGetvo;
 import cn.com.ctop.kuaishou.modules.report.mapper.*;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.csvreader.CsvReader;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
+import java.io.IOException;
+import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -213,7 +217,89 @@ public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHi
             requestMap.put("advertiser_id", task.getAccountId());
             requestMap.put("task_id", task.getTaskId());
             String localPath = LoadFileUtil.downloadByUrl(requestMap, downloadPath, url, token, fileName);
-            if (!Check.isNull(localPath)) {
+            ArrayList<String[]> reportList = getReportList(localPath);
+
+
+            if (task.getViewType() == 1) {
+                List<KuaishouReportDailyAccount> reportDailyAccounts = new ArrayList<>();
+                for (int row = 0; row < reportList.size(); row++) {
+                    if (Check.isNull(row)) {
+                        continue;
+                    }
+                    KuaishouReportDailyAccount reportDailyAccount = new KuaishouReportDailyAccount();
+                    reportDailyAccount.setAccountId(task.getAccountId());
+                    reportDailyAccount.setCharge(ConverterUtils.getAsBigDecimal(reportList.get(row)[1]));
+                    reportDailyAccount.setAdScene(reportList.get(row)[0]);
+                    reportDailyAccount.setPhotoShow(ConverterUtils.getAsLong(reportList.get(row)[2]));
+                    reportDailyAccount.setAclick(ConverterUtils.getAsLong(reportList.get(row)[3]));
+                    reportDailyAccount.setBclick(ConverterUtils.getAsLong(reportList.get(row)[4]));
+                    reportDailyAccount.setPhotoShare(ConverterUtils.getAsLong(reportList.get(row)[5]));
+                    reportDailyAccount.setPhotoComment(ConverterUtils.getAsLong(reportList.get(row)[6]));
+                    reportDailyAccount.setPhotoLike(ConverterUtils.getAsLong(reportList.get(row)[7]));
+                    reportDailyAccount.setFollow(ConverterUtils.getAsLong(reportList.get(row)[8]));
+                    reportDailyAccount.setCancelFollow(ConverterUtils.getAsLong(reportList.get(row)[9]));
+                    reportDailyAccount.setReport(ConverterUtils.getAsLong(reportList.get(row)[10]));
+                    reportDailyAccount.setBlock(ConverterUtils.getAsLong(reportList.get(row)[11]));
+                    reportDailyAccount.setNegative(ConverterUtils.getAsLong(reportList.get(row)[12]));
+                    reportDailyAccount.setDownloadStarted(ConverterUtils.getAsLong(reportList.get(row)[13]));
+                    reportDailyAccount.setDownloadCompleted(ConverterUtils.getAsLong(reportList.get(row)[14]));
+                    reportDailyAccount.setActivation(ConverterUtils.getAsLong(reportList.get(row)[15]));
+                    reportDailyAccount.setSubmit(ConverterUtils.getAsLong(reportList.get(row)[16]));
+                    reportDailyAccount.setStatDate(reportList.get(row)[17]);
+                    reportDailyAccount.setPhotoClick(ConverterUtils.getAsLong(reportList.get(row)[19]));
+                    reportDailyAccount.setPhotoClickRatio(ConverterUtils.getAsDouble(reportList.get(row)[20]));
+                    reportDailyAccount.setActionRatio(ConverterUtils.getAsDouble(reportList.get(row)[21]));
+                    reportDailyAccount.setImpression1kCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[22]));
+                    reportDailyAccount.setPhotoClickCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[23]));
+                    reportDailyAccount.setActionCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[25]));
+                    reportDailyAccount.setEventPayFirstDay(ConverterUtils.getAsLong(reportList.get(row)[26]));
+                    reportDailyAccount.setEventPayPurchaseAmountFirstDay(ConverterUtils.getAsBigDecimal(reportList.get(row)[27]));
+                    reportDailyAccount.setEventPayFirstDayRoi(ConverterUtils.getAsDouble(reportList.get(row)[28]));
+                    reportDailyAccount.setEventPay(ConverterUtils.getAsLong(reportList.get(row)[29]));
+                    reportDailyAccount.setEventPayPurchaseAmount(ConverterUtils.getAsBigDecimal(reportList.get(row)[30]));
+                    reportDailyAccount.setEventPayRoi(ConverterUtils.getAsDouble(reportList.get(row)[31]));
+                    reportDailyAccount.setEventRegister(ConverterUtils.getAsLong(reportList.get(row)[32]));
+                    reportDailyAccount.setEventRegisterCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[33]));
+                    reportDailyAccount.setEventRegisterRatio(ConverterUtils.getAsDouble(reportList.get(row)[34]));
+                    reportDailyAccount.setEventJinJianApp(ConverterUtils.getAsLong(reportList.get(row)[35]));
+                    reportDailyAccount.setEventJinJianAppCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[36]));
+                    reportDailyAccount.setEventCreditGrantApp(ConverterUtils.getAsLong(reportList.get(row)[37]));
+                    reportDailyAccount.setEventCreditGrantAppCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[38]));
+                    reportDailyAccount.setEventCreditGrantAppRatio(ConverterUtils.getAsDouble(reportList.get(row)[39]));
+                    reportDailyAccount.setEventOrderPaid(ConverterUtils.getAsLong(reportList.get(row)[40]));
+                    reportDailyAccount.setEventOrderPaidPurchaseAmount(ConverterUtils.getAsBigDecimal(reportList.get(row)[41]));
+                    reportDailyAccount.setEventOrderPaidCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[42]));
+                    reportDailyAccount.setFormCount(ConverterUtils.getAsLong(reportList.get(row)[43]));
+                    reportDailyAccount.setFormCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[44]));
+                    reportDailyAccount.setFormActionRatio(ConverterUtils.getAsDouble(reportList.get(row)[45]));
+                    reportDailyAccount.setEventJinJianLandingPage(ConverterUtils.getAsLong(reportList.get(row)[46]));
+                    reportDailyAccount.setEventJinJianLandingPageCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[47]));
+                    reportDailyAccount.setEventCreditGrantLandingPage(ConverterUtils.getAsLong(reportList.get(row)[48]));
+                    reportDailyAccount.setEventCreditGrantLandingPageCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[49]));
+                    reportDailyAccount.setEventCreditGrantLandingRatio(ConverterUtils.getAsDouble(reportList.get(row)[50]));
+                    reportDailyAccount.setEventNextDayStayCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[51]));
+                    reportDailyAccount.setEventNextDayStayRatio(ConverterUtils.getAsBigDecimal(reportList.get(row)[52]));
+                    reportDailyAccount.setEventNextDayStay(ConverterUtils.getAsLong(reportList.get(row)[53]));
+                    reportDailyAccount.setPlay3sRatio(ConverterUtils.getAsDouble(reportList.get(row)[54]));
+                    reportDailyAccount.setEventNewUserPay(ConverterUtils.getAsLong(reportList.get(row)[63]));
+                    reportDailyAccount.setEventNewUserPayCost(ConverterUtils.getAsBigDecimal(reportList.get(row)[64]));
+                    reportDailyAccount.setEventNewUserPayRatio(ConverterUtils.getAsBigDecimal(reportList.get(row)[65]));
+                    reportDailyAccounts.add(reportDailyAccount);
+
+                }
+
+                if (!Check.isNull(reportDailyAccounts)) {
+                    reportDailyAccountMapper.replaceBatch(reportDailyAccounts);
+                }
+
+
+            } else if (task.getViewType() == 5) {
+
+            }
+
+
+            //   System.err.println(reportList);
+          /*  if (!Check.isNull(localPath)) {
                 Map<String, Object> deleteMap = new HashMap<>();
                 deleteMap.put("account_id", task.getAccountId());
 
@@ -263,7 +349,7 @@ public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHi
                 }
 
 
-            }
+            }*/
             task.setTaskStatus(4);
 
         } catch (Exception e) {
@@ -274,6 +360,25 @@ public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHi
 
     }
 
+
+    private ArrayList<String[]> getReportList(String localPath) throws IOException {
+        ArrayList<String[]> csvFileList = new ArrayList<String[]>();
+        // 定义一个CSV路径
+
+        // 创建CSV读对象 例如:CsvReader(文件路径,分隔符,编码格式);
+        CsvReader reader = new CsvReader(localPath, ',', Charset.forName("UTF-8"));
+        // 跳过表头 如果需要表头的话,这句可以忽略
+        reader.readHeaders();
+        // 逐行读入除表头的数据
+        while (reader.readRecord()) {
+            System.out.println(reader.getRawRecord());
+            csvFileList.add(reader.getValues());
+        }
+        reader.close();
+        return csvFileList;
+
+    }
+
     @Autowired
     private KuaishouReportDailyImageMapper kuaishouReportDailyImageMapper;
 
@@ -282,12 +387,12 @@ public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHi
 
         historyTypeList = new ArrayList<>();
         historyTypeList.add(1);
-        historyTypeList.add(2);
-        historyTypeList.add(3);
-        historyTypeList.add(4);
-        historyTypeList.add(5);
-        historyTypeList.add(7);
-        historyTypeList.add(10);
+      /*  historyTypeList.add(2);
+        historyTypeList.add(3);*/
+        // historyTypeList.add(4);
+        //    historyTypeList.add(5);
+        // historyTypeList.add(7);
+        //  historyTypeList.add(10);
 
 
     }