Bladeren bron

完善手写信息采集表增加导出excel逻辑

cgp 2 dagen geleden
bovenliggende
commit
b8ccdc89d7

+ 3 - 3
fs-admin/src/main/java/com/fs/crm/controller/HandwriteCollectionController.java

@@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
 import java.util.List;
 
 /**
@@ -42,11 +43,10 @@ public class HandwriteCollectionController extends BaseController
      * 导出手写信息采集表列表
      */
     @PostMapping("/export")
-    public AjaxResult export(HttpServletResponse response, HandwriteCollection handwriteCollection)
-    {
+    public void export(HttpServletResponse response,@RequestBody HandwriteCollection handwriteCollection) throws IOException {
         List<HandwriteCollection> list = handwriteCollectionService.selectHandwriteCollectionList(handwriteCollection);
         ExcelUtil<HandwriteCollection> util = new ExcelUtil<HandwriteCollection>(HandwriteCollection.class);
-        return util.exportExcel(list, "手写信息采集表数据");
+        util.exportExcel(response, list, "手写信息采集表数据");
     }
 
     /**

+ 3 - 3
fs-company/src/main/java/com/fs/company/controller/handwrite/HandwriteCollectionController.java

@@ -1,5 +1,6 @@
 package com.fs.company.controller.handwrite;
 
+import java.io.IOException;
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
@@ -51,11 +52,10 @@ public class HandwriteCollectionController extends BaseController
      * 导出手写信息采集表列表
      */
     @PostMapping("/export")
-    public AjaxResult export(HttpServletResponse response, HandwriteCollection handwriteCollection)
-    {
+    public void export(HttpServletResponse response, @RequestBody HandwriteCollection handwriteCollection) throws IOException {
         List<HandwriteCollection> list = handwriteCollectionService.selectHandwriteCollectionList(handwriteCollection);
         ExcelUtil<HandwriteCollection> util = new ExcelUtil<HandwriteCollection>(HandwriteCollection.class);
-        return util.exportExcel(list, "手写信息采集表数据");
+        util.exportExcel(response, list, "手写信息采集表数据");
     }
 
     /**

+ 13 - 12
fs-service/src/main/java/com/fs/handwrite/domain/HandwriteCollection.java

@@ -34,20 +34,28 @@ public class HandwriteCollection implements Serializable
     @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date createTime;
 
+    /** 销售id*/
+    private Long companyUserId;
+
+    /** 销售名称*/
+    @Excel(name = "销售名称")
+    private String companyUserName;
+
     /** 更新时间 */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    //@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date updateTime;
 
-    /** 手写信息采集表url */
-    @Excel(name = "手写信息采集表图片链接")
-    private String billImgUrl;
-
     /** 订单号 */
     @Excel(name = "订单号")
     private String orderCode;
 
 
+    /** 手写信息采集表url */
+    @Excel(name = "手写信息采集表图片链接")
+    private String billImgUrl;
+
+
     /** 创建人 */
     //@Excel(name = "创建人")
     private Long createBy;
@@ -60,13 +68,6 @@ public class HandwriteCollection implements Serializable
     @Excel(name = "补充图片链接,支持多张','隔开")
     private String extraImgUrl;
 
-    /** 销售id*/
-    private Long companyUserId;
-
-    /** 销售名称*/
-    @Excel(name = "销售名称")
-    private String companyUserName;
-
     /**
      * 开始日期
      * */

+ 2 - 2
fs-service/src/main/resources/mapper/handwrite/HandwriteCollectionMapper.xml

@@ -36,10 +36,10 @@
             <if test="billImgUrl != null and billImgUrl != ''"> and hc.bill_img_url = #{billImgUrl}</if>
             <!-- 创建时间范围过滤 -->
             <if test="startDate != null">
-                and DATE(hc.create_time) &gt; #{startDate}
+                and hc.create_time &gt;= #{startDate}
             </if>
             <if test="endDate != null">
-                and DATE(hc.create_time) &lt; #{endDate}
+                and hc.create_time &lt;= #{endDate}
             </if>
         </where>
         order by hc.create_time desc