Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
613610630d
@ -96,21 +96,19 @@ public class XhpcHistoryOrderController extends BaseController {
|
|||||||
* @throws IOException 文件创建异常
|
* @throws IOException 文件创建异常
|
||||||
*/
|
*/
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void getListPage(HttpServletResponse response, @RequestBody Map map) throws IOException {
|
public void getExport(HttpServletResponse response,
|
||||||
|
String phone,
|
||||||
String phone = map.get("phone").toString();
|
String transactionNumber,
|
||||||
String transactionNumber = map.get("transactionNumber").toString();
|
@RequestParam("status")Integer status,
|
||||||
Integer status = StringUtils.isNotEmpty(map.get("transactionNumber").toString())? Integer.valueOf(map.get("transactionNumber").toString()) : null ;
|
String chargingStationName,
|
||||||
String chargingStationName = map.get("chargingStationName").toString();
|
Long operatorId,
|
||||||
Long operatorId = StringUtils.isNotEmpty(map.get("operatorId").toString())? Long.parseLong(map.get("operatorId").toString()) : null;
|
Integer source,
|
||||||
Integer source = StringUtils.isNotEmpty(map.get("source").toString())? Integer.valueOf(map.get("source").toString()): null;
|
String startTime,
|
||||||
String startTime = map.get("startTime").toString();
|
String endTime,
|
||||||
String endTime = map.get("endTime").toString();
|
@RequestParam("userId") Long userId,
|
||||||
Long userId = StringUtils.isNotEmpty(map.get("userId").toString())? Long.parseLong(map.get("userId").toString()): null;
|
Integer type) throws IOException {
|
||||||
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);
|
xhpcHistoryOrderService.export(response, phone, transactionNumber, status, chargingStationName, operatorId, source, startTime, endTime, userId, type);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -18,6 +18,7 @@ import com.xhpc.order.mapper.XhpcHistoryOrderMapper;
|
|||||||
import com.xhpc.order.service.IXhpcChargeOrderService;
|
import com.xhpc.order.service.IXhpcChargeOrderService;
|
||||||
import com.xhpc.order.service.IXhpcHistoryOrderService;
|
import com.xhpc.order.service.IXhpcHistoryOrderService;
|
||||||
import com.xhpc.order.service.IXhpcRealTimeOrderService;
|
import com.xhpc.order.service.IXhpcRealTimeOrderService;
|
||||||
|
import org.apache.poi.util.IOUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -156,11 +157,12 @@ public class XhpcHistoryOrderServiceImpl implements IXhpcHistoryOrderService {
|
|||||||
// 一次性写出内容,使用默认样式,强制输出标题
|
// 一次性写出内容,使用默认样式,强制输出标题
|
||||||
writer.write(list, true);
|
writer.write(list, true);
|
||||||
//out为OutputStream,需要写出到的目标流
|
//out为OutputStream,需要写出到的目标流
|
||||||
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||||
//response为HttpServletResponse对象
|
response.setCharacterEncoding("utf-8");
|
||||||
response.setContentType("application/vnd.ms-excel;charset=utf-8");
|
// //response为HttpServletResponse对象
|
||||||
//test.xls是弹出下载对话框的文件名,不能为中文,中文请自行编码
|
// response.setContentType("application/vnd.ms-excel;charset=utf-8");
|
||||||
response.setHeader("Content-Disposition", "attachment;filename=历史订单列表.xls");
|
// //test.xls是弹出下载对话框的文件名,不能为中文,中文请自行编码
|
||||||
|
// response.setHeader("Content-Disposition", "attachment;filename=历史订单列表.xls");
|
||||||
ServletOutputStream out = response.getOutputStream();
|
ServletOutputStream out = response.getOutputStream();
|
||||||
|
|
||||||
writer.flush(out, true);
|
writer.flush(out, true);
|
||||||
|
|||||||
@ -63,14 +63,13 @@ public class XhpcRechargeOrderController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
//@PreAuthorize(hasPermi = "refund:order:page")
|
//@PreAuthorize(hasPermi = "refund:order:page")
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void page(HttpServletResponse response, @RequestBody Map map) throws IOException {
|
public void page(HttpServletResponse response,
|
||||||
|
String phone,
|
||||||
String phone = map.get("phone").toString();
|
String rechargeOrderNumber,
|
||||||
String rechargeOrderNumber= map.get("rechargeOrderNumber").toString();
|
String status,
|
||||||
String status= map.get("status").toString();
|
String createTimeStart,
|
||||||
String createTimeStart= map.get("createTimeStart").toString();
|
String createTimeEnd,
|
||||||
String createTimeEnd= map.get("createTimeEnd").toString();
|
Integer type) throws IOException {
|
||||||
Integer type= StringUtils.isNotEmpty(map.get("type").toString())? Integer.valueOf(map.get("type").toString()): null;
|
|
||||||
|
|
||||||
iXhpcRechargeOrderService.export(response, phone, rechargeOrderNumber, status, createTimeStart, createTimeEnd,type);
|
iXhpcRechargeOrderService.export(response, phone, rechargeOrderNumber, status, createTimeStart, createTimeEnd,type);
|
||||||
|
|
||||||
|
|||||||
@ -112,15 +112,13 @@ public class XhpcRefundOrderController extends BaseController {
|
|||||||
|
|
||||||
|
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, @RequestBody Map map) throws IOException {
|
public void export(HttpServletResponse response,
|
||||||
|
String phone,
|
||||||
String phone = map.get("phone").toString();
|
String refundOrderNumber,
|
||||||
String refundOrderNumber= map.get("refundOrderNumber").toString();
|
String status,
|
||||||
String status= map.get("status").toString();
|
String createTimeStart,
|
||||||
String createTimeStart= map.get("createTimeStart").toString();
|
String createTimeEnd,
|
||||||
String createTimeEnd= map.get("createTimeEnd").toString();
|
Integer type) throws IOException {
|
||||||
Integer type= StringUtils.isNotEmpty(map.get("type").toString())? Integer.valueOf(map.get("type").toString()): null;
|
|
||||||
|
|
||||||
iXhpcRefundOrderService.export(response, phone, refundOrderNumber, status, createTimeStart, createTimeEnd,type);
|
iXhpcRefundOrderService.export(response, phone, refundOrderNumber, status, createTimeStart, createTimeEnd,type);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -97,10 +97,13 @@ public class XhpcRechargeOrderServiceImpl implements IXhpcRechargeOrderService {
|
|||||||
writer.write(list, true);
|
writer.write(list, true);
|
||||||
//out为OutputStream,需要写出到的目标流
|
//out为OutputStream,需要写出到的目标流
|
||||||
|
|
||||||
//response为HttpServletResponse对象
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||||
response.setContentType("application/vnd.ms-excel;charset=utf-8");
|
response.setCharacterEncoding("utf-8");
|
||||||
//test.xls是弹出下载对话框的文件名,不能为中文,中文请自行编码
|
|
||||||
response.setHeader("Content-Disposition", "attachment;filename=充值订单列表.xls");
|
// //response为HttpServletResponse对象
|
||||||
|
// response.setContentType("application/vnd.ms-excel;charset=utf-8");
|
||||||
|
// //test.xls是弹出下载对话框的文件名,不能为中文,中文请自行编码
|
||||||
|
// response.setHeader("Content-Disposition", "attachment;filename=充值订单列表.xls");
|
||||||
ServletOutputStream out = response.getOutputStream();
|
ServletOutputStream out = response.getOutputStream();
|
||||||
|
|
||||||
writer.flush(out, true);
|
writer.flush(out, true);
|
||||||
|
|||||||
@ -99,11 +99,12 @@ public class XhpcRefundOrderServiceImpl implements IXhpcRefundOrderService {
|
|||||||
// 一次性写出内容,使用默认样式,强制输出标题
|
// 一次性写出内容,使用默认样式,强制输出标题
|
||||||
writer.write(list, true);
|
writer.write(list, true);
|
||||||
//out为OutputStream,需要写出到的目标流
|
//out为OutputStream,需要写出到的目标流
|
||||||
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||||
//response为HttpServletResponse对象
|
response.setCharacterEncoding("utf-8");
|
||||||
response.setContentType("application/vnd.ms-excel;charset=utf-8");
|
// //response为HttpServletResponse对象
|
||||||
//test.xls是弹出下载对话框的文件名,不能为中文,中文请自行编码
|
// response.setContentType("application/vnd.ms-excel;charset=utf-8");
|
||||||
response.setHeader("Content-Disposition", "attachment;filename=退款订单列表.xls");
|
// //test.xls是弹出下载对话框的文件名,不能为中文,中文请自行编码
|
||||||
|
// response.setHeader("Content-Disposition", "attachment;filename=退款订单列表.xls");
|
||||||
ServletOutputStream out = response.getOutputStream();
|
ServletOutputStream out = response.getOutputStream();
|
||||||
|
|
||||||
writer.flush(out, true);
|
writer.flush(out, true);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user