记得上下班打卡 | git大法好,push需谨慎

Commit c5e12ba3 authored by 胡佳晨's avatar 胡佳晨

修改 导出接口 增加返回值

parent 9dd2c228
......@@ -6,6 +6,6 @@ import javax.servlet.http.HttpServletResponse;
public interface IGoblinExportService {
//导出商城订单信息
ResponseDto<Boolean> exportMallOrder(HttpServletResponse response, String beginTime, String endTime, String state, Integer mailType,String storeId);
ResponseDto<String> exportMallOrder(HttpServletResponse response, String beginTime, String endTime, String state, Integer mailType,String storeId);
}
package com.liquidnet.service.platform.controller.goblin;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.service.IGoblinExportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
......@@ -11,6 +12,7 @@ import org.springframework.validation.annotation.Validated;
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.ResponseBody;
import javax.servlet.http.HttpServletResponse;
......@@ -32,6 +34,7 @@ public class GoblinExportDataController {
*/
@GetMapping("/exportMallOrder")
@ApiOperation(value = "excel订单信息导出")
@ResponseBody
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "beginTime", value = "开始时间"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "storeId", value = "店铺id"),
......@@ -39,9 +42,9 @@ public class GoblinExportDataController {
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "state", value = "状态逗号隔开字符串[0-待付款(用户刚下单)|2-代发货(用户付完款 等待商城发货)|3-代收货(商城已经发货 等待用户确认收货)|4-已完成(用户已经确认收货 订单结束)|5-取消订单(用户未付款前取消订单)|6-退款通过(用户已经付款但是商城还未发货,用户发出退款申请,商城同意退款)|7-退货通过(用户已经确认收货后用户发出退货申请,商城同意所有退货申请 ,一个订单可能有多个单品)|61-6的发起状态|71-7的发起状态】"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "mailType", value = "快递状态[0-全部|1-未发货|2-已发货]"),
})
public void exportMallOrder(HttpServletResponse response, @RequestParam("beginTime") String beginTime, @RequestParam("endTime") String endTime,
public ResponseDto<String> exportMallOrder(HttpServletResponse response, @RequestParam("beginTime") String beginTime, @RequestParam("endTime") String endTime,
@RequestParam("state") String state, @RequestParam("mailType") Integer mailType, @RequestParam("storeId") String storeId) {
iGoblinExportService.exportMallOrder(response, beginTime, endTime, state, mailType, storeId);
return iGoblinExportService.exportMallOrder(response, beginTime, endTime, state, mailType, storeId);
}
}
......@@ -31,7 +31,7 @@ public class GoblinExportServiceImpl implements IGoblinExportService {
GoblinStoreOrderMapper goblinStoreOrderMapper;
@Override
public ResponseDto<Boolean> exportMallOrder(HttpServletResponse response, String beginTime, String endTime, String state, Integer mailType, String storeId) {
public ResponseDto<String> exportMallOrder(HttpServletResponse response, String beginTime, String endTime, String state, Integer mailType, String storeId) {
if (!timeIsNotNull(beginTime, endTime)) {
return ResponseDto.failure("起始和结束时间不能为空!");
}
......@@ -145,6 +145,8 @@ public class GoblinExportServiceImpl implements IGoblinExportService {
.head(head(header))
// 当然这里数据也可以用 List<List<String>> 去传入
.doWrite(objectList);
}else{
return ResponseDto.failure("无数据");
}
} catch (Exception e) {
e.printStackTrace();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment