diff --git a/xhpc-modules/xhpc-order/pom.xml b/xhpc-modules/xhpc-order/pom.xml
index bdb09969..bce8e5eb 100644
--- a/xhpc-modules/xhpc-order/pom.xml
+++ b/xhpc-modules/xhpc-order/pom.xml
@@ -101,11 +101,11 @@
org.springframework.boot
spring-boot-starter-websocket
-
- org.apache.poi
- poi-ooxml
- 3.9
-
+
+
+
+
+
diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderController.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderController.java
index d8db4640..1dc68bb6 100644
--- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderController.java
+++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderController.java
@@ -4,6 +4,9 @@ import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
+import cn.hutool.poi.excel.ExcelWriter;
+import com.xhpc.common.core.utils.StringUtils;
+import com.xhpc.common.core.utils.poi.ExcelUtil;
import com.xhpc.common.core.web.controller.BaseController;
import com.xhpc.common.core.web.domain.AjaxResult;
import com.xhpc.common.core.web.page.TableDataInfo;
@@ -15,17 +18,18 @@ import com.xhpc.order.dto.XhpcChargeHistoryOrder;
import com.xhpc.order.service.IXhpcChargeOrderService;
import com.xhpc.order.service.IXhpcHistoryOrderService;
import com.xhpc.order.service.IXhpcStatisticsService;
+import com.xhpc.system.api.domain.SysUser;
import io.swagger.annotations.Api;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
@@ -84,6 +88,31 @@ public class XhpcHistoryOrderController extends BaseController {
return xhpcHistoryOrderService.getById(historyOrderId);
}
+
+ /**
+ * 历史订单导出
+ * @param response 返回数据流
+ * @param map 参数集
+ * @throws IOException 文件创建异常
+ */
+ @PostMapping("/export")
+ public void getListPage(HttpServletResponse response, @RequestBody Map map) throws IOException {
+
+ String phone = map.get("phone").toString();
+ String transactionNumber = map.get("transactionNumber").toString();
+ Integer status = StringUtils.isNotEmpty(map.get("transactionNumber").toString())? Integer.valueOf(map.get("transactionNumber").toString()) : null ;
+ String chargingStationName = map.get("chargingStationName").toString();
+ Long operatorId = StringUtils.isNotEmpty(map.get("operatorId").toString())? Long.parseLong(map.get("operatorId").toString()) : null;
+ Integer source = StringUtils.isNotEmpty(map.get("source").toString())? Integer.valueOf(map.get("source").toString()): null;
+ String startTime = map.get("startTime").toString();
+ String endTime = map.get("endTime").toString();
+ Long userId = StringUtils.isNotEmpty(map.get("userId").toString())? Long.parseLong(map.get("userId").toString()): null;
+ Integer type = StringUtils.isNotEmpty(map.get("type").toString())? Integer.valueOf(map.get("type").toString()): null;
+
+ xhpcHistoryOrderService.export(response, phone, transactionNumber, status, chargingStationName, operatorId, source, startTime, endTime, userId, type);
+
+ }
+
/**
* 终端统计
*/
diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcHistoryOrderService.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcHistoryOrderService.java
index 6fd3b30e..1eeafb65 100644
--- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcHistoryOrderService.java
+++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcHistoryOrderService.java
@@ -4,6 +4,8 @@ import com.xhpc.common.core.web.domain.AjaxResult;
import com.xhpc.order.domain.XhpcHistoryOrder;
import com.xhpc.order.dto.XhpcChargeHistoryOrder;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
import java.util.List;
import java.util.Map;
@@ -52,6 +54,14 @@ public interface IXhpcHistoryOrderService {
*/
List