瀏覽代碼

快手-快手材上新-有效-爆款修改

yangzian 3 年之前
父節點
當前提交
3cc04859ec

+ 4 - 2
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/mapper/xml/MaterialStareMapper.xml

@@ -761,8 +761,10 @@
         vd.signature = m.material_id
         AND m.media_time is not null
         AND vd.account_id = #{accountId}
-        AND vd.stat_date >= #{startDate}
-        AND vd.stat_date <= #{endDate}
+        <if test="searchType == '0'.toString()">
+            AND m.media_time &gt;= #{startDate}
+            AND m.media_time &lt;= #{endDate}
+        </if>
         <if test="searchType == '1'.toString()">
             and material_innovate = 2
         </if>

+ 2 - 6
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/service/impl/MaterialStareServiceImpl.java

@@ -3,35 +3,30 @@ package org.jeecg.ctop.material.service.impl;
 
 import cn.afterturn.easypoi.excel.ExcelExportUtil;
 import cn.afterturn.easypoi.excel.entity.ExportParams;
-import cn.hutool.core.date.DateUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
-import com.google.gson.JsonObject;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.ss.usermodel.Workbook;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.ctop.material.constants.Check;
-import org.jeecg.ctop.material.constants.CtopAdConstant;
 import org.jeecg.ctop.material.entity.vo.KuaiShouAccountPieVo;
 import org.jeecg.ctop.material.entity.vo.KuaiShouOperateAccountVo;
 import org.jeecg.ctop.material.entity.vo.KuaiShouOperateProjectVo;
 import org.jeecg.ctop.material.entity.vo.KuaiShouOperateVo;
 import org.jeecg.ctop.material.mapper.MaterialStareMapper;
 import org.jeecg.ctop.material.service.MaterialStareService;
+import org.jeecg.ctop.material.utils.FeidNotNullUtils;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
-import java.math.BigDecimal;
 import java.net.URLEncoder;
 import java.text.DecimalFormat;
-import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
-import java.util.stream.Collectors;
 
 /**
  * 盯盘接口
@@ -644,6 +639,7 @@ public class MaterialStareServiceImpl implements MaterialStareService {
                 return Result.successMsg("账户时报报折线图查询成功",resultList);
             }
             resultList = materialStareMapper.getKuaiShouAccountInfoBrokenLineDaily(type,accountId,startDate,entDate);
+
             return Result.successMsg("账户日报折线图查询成功",resultList);
 
         }catch (Exception e){

+ 37 - 0
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/utils/FeidNotNullUtils.java

@@ -0,0 +1,37 @@
+package org.jeecg.ctop.material.utils;
+
+import java.lang.reflect.Field;
+import java.math.BigDecimal;
+
+/**
+ * Administrator
+ * 2022/3/15
+ **/
+public class FeidNotNullUtils {
+
+
+    public static void setFeidValueNotNull (Object obj) {
+        try {
+            for (Field field : obj.getClass().getDeclaredFields()) {
+                field.setAccessible(true);
+                if (field.get(obj) == null) {
+                    if (field.getGenericType().toString().equals("class java.lang.String")) {
+                        field.set(obj, "0");
+                    } else if (field.getGenericType().toString().equals("class java.lang.Integer")) {
+                        field.set(obj, 0);
+                    } else if (field.getGenericType().toString().equals("class java.lang.Double")) {
+                        field.set(obj, 0.0);
+                    } else if (field.getGenericType().toString().equals("class java.lang.Long")) {
+                        field.set(obj, 0L);
+                    } else if (field.getGenericType().toString().equals("class java.math.BigDecimal")) {
+                        field.set(obj, new BigDecimal(0));
+                    }
+                }
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+    }
+}