Browse Source

产品申请显示(导出订单相关信息修改)

wangyu 6 years ago
parent
commit
bf02397317

+ 9 - 0
diagbotman-service/src/main/java/com/diagbot/entity/ProductOrderIndex.java

@@ -36,4 +36,13 @@ public class ProductOrderIndex implements Serializable {
      */
     private List<Long> userId;
 
+    /**
+     * 开始时间
+     */
+    private String startTime;
+
+    /**
+     * 结束时间
+     */
+    private String endTime;
 }

+ 15 - 7
diagbotman-service/src/main/java/com/diagbot/facade/ProductOrderFacade.java

@@ -32,6 +32,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
 
+import javax.servlet.http.HttpServletResponse;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -261,9 +262,16 @@ public class ProductOrderFacade extends ProductOrderServiceImpl {
         return true;
     }
 
-    public RespDTO export(ProductOrderExportVO productOrderExportVO){
+    /**
+     *  导出产品订单相关信息
+     * @param productOrderExportVO
+     * @param response
+     */
+    public void export(ProductOrderExportVO productOrderExportVO,HttpServletResponse response){
 	    ProductOrderVO productOrderVO =new ProductOrderVO();
-	    productOrderVO.setSize(999999999999999999L);
+	    BeanUtil.copyProperties(productOrderExportVO,productOrderVO);
+	    productOrderVO.setCurrent(1L);
+        productOrderVO.setSize(999999999999999999L);
         Map<String, Object> userMap = new HashMap<String, Object>();
         userMap.put("startTime", productOrderExportVO.getStartTime());
         userMap.put("endTime", productOrderExportVO.getEndTime());
@@ -303,13 +311,13 @@ public class ProductOrderFacade extends ProductOrderServiceImpl {
                     userInfo.getEmail(),
                     String.valueOf(userInfo.getAuditStatus())));
         }
-        //response.setContentType("text/html;charset=UTF-8");
-        String filePath = productOrderExportVO.getFilePath();//文件路径
+        response.setContentType("text/html;charset=UTF-8");
+        /*String filePath = productOrderExportVO.getFilePath();//文件路径
         String fileName = productOrderExportVO.getFileName();//文件名
         ExportBeanExcelUtil ex = new ExportBeanExcelUtil();
-        RespDTO resul = ex.exportExcel("测试POI导出EXCEL文档", listName, listId, list, filePath, fileName);
-
-        return resul;
+        RespDTO resul = ex.exportExcel("测试POI导出EXCEL文档", listName, listId, list, filePath, fileName);*/
+        ExportBeanExcelUtil ex = new ExportBeanExcelUtil();
+        ex.exportExcelNew("产品申请相关信息", listName, listId, list,response);
     }
 }
 

+ 20 - 2
diagbotman-service/src/main/java/com/diagbot/vo/ProductOrderExportVO.java

@@ -12,9 +12,27 @@ import lombok.Setter;
 @Setter
 public class ProductOrderExportVO {
 
+    /**
+     * 开始时间
+     */
     private String startTime;
+
+    /**
+     * 结束时间
+     */
     private String endTime;
-    private String filePath;//文件路径
-    private String fileName;//文件名
+
+    /**
+     * 审核状态
+     */
+    private Integer auditStatus;
+    /**
+     * 订单编号
+     */
+    private String num;
+    /**
+     * 机构名称
+     */
+    private String orgName;
 
 }

+ 10 - 0
diagbotman-service/src/main/java/com/diagbot/vo/ProductOrderVO.java

@@ -31,4 +31,14 @@ public class ProductOrderVO {
      * 机构名称
      */
     private String orgName;
+
+    /**
+     * 开始时间
+     */
+    private String startTime;
+
+    /**
+     * 结束时间
+     */
+    private String endTime;
 }

+ 13 - 7
diagbotman-service/src/main/java/com/diagbot/web/ReporExcelController.java

@@ -1,8 +1,7 @@
 package com.diagbot.web;
 
 
-import com.diagbot.annotation.SysLogger;
-import com.diagbot.dto.RespDTO;
+import com.diagbot.annotation.SysLoggerExport;
 import com.diagbot.facade.ProductOrderFacade;
 import com.diagbot.vo.ProductOrderExportVO;
 import io.swagger.annotations.Api;
@@ -14,6 +13,9 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
 /**
  * @Description: Excel导出API Excel导出API
  * @Author: wangyu
@@ -27,14 +29,18 @@ public class ReporExcelController {
     @Autowired
     ProductOrderFacade productOrderFacade;
 
-    @ApiOperation(value = "导出产品订单相关信息:[by:wangyu]", notes = "根据时间 导出产品订单相关信息")
+    @ApiOperation(value = "导出产品订单相关信息:[by:wangyu]", notes = "根据时间 导出产品订单相关信息" +
+            "startTime: 开始时间<br>" +
+            "endTime: 结束时间<br>" +
+            "auditStatus: 审核状态<br>" +
+            "num: 订单编号<br>" +
+            "orgName: 机构名称<br>")
     @PostMapping("/exportProductOrderInfo")
-    @SysLogger("exportProductOrderInfo")
+    @SysLoggerExport("exportProductOrderInfo")
     @Transactional
-    public RespDTO export(@RequestBody ProductOrderExportVO productOrderExportVO)
+    public void export(@RequestBody ProductOrderExportVO productOrderExportVO, HttpServletRequest request, HttpServletResponse response)
             throws Exception {
-        RespDTO resul = productOrderFacade.export(productOrderExportVO);
-        return resul;
+        productOrderFacade.export(productOrderExportVO,response);
     }
 }
 

+ 3 - 0
diagbotman-service/src/main/resources/mapper/ProductOrderMapper.xml

@@ -93,6 +93,9 @@
                 #{product.userId}
             </foreach>
         </if>
+        <if test="product.startTime != null and product.endTime != null">
+            AND time BETWEEN #{product.startTime} and #{product.endTime}
+        </if>
         ORDER BY time DESC
     </select>
 </mapper>