|
@ -1,16 +1,28 @@ |
|
|
package com.yxt.ordermall.biz.ordorder; |
|
|
package com.yxt.ordermall.biz.ordorder; |
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.excel.EasyExcel; |
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.yxt.common.core.query.PagerQuery; |
|
|
import com.yxt.common.core.query.PagerQuery; |
|
|
import com.yxt.common.core.result.ResultBean; |
|
|
import com.yxt.common.core.result.ResultBean; |
|
|
import com.yxt.common.core.vo.PagerVo; |
|
|
import com.yxt.common.core.vo.PagerVo; |
|
|
|
|
|
import com.yxt.ordermall.api.lpkreserveorder.LpkReserveOrderQuery; |
|
|
import com.yxt.ordermall.api.ordorder.OrdOrderDto; |
|
|
import com.yxt.ordermall.api.ordorder.OrdOrderDto; |
|
|
|
|
|
import com.yxt.ordermall.api.ordorder.OrdOrderExcelVo; |
|
|
import com.yxt.ordermall.api.ordorder.OrdOrderQuery; |
|
|
import com.yxt.ordermall.api.ordorder.OrdOrderQuery; |
|
|
import com.yxt.ordermall.api.ordorder.OrdOrderVo; |
|
|
import com.yxt.ordermall.api.ordorder.OrdOrderVo; |
|
|
|
|
|
import com.yxt.ordermall.api.ordorderdetails.OrdOrderDetail; |
|
|
|
|
|
import com.yxt.ordermall.biz.ordorderdetails.OrdOrderDetailService; |
|
|
|
|
|
import com.yxt.ordermall.biz.vegecallerreserveorder.ReserveAllExcel; |
|
|
import io.swagger.annotations.Api; |
|
|
import io.swagger.annotations.Api; |
|
|
import io.swagger.annotations.ApiOperation; |
|
|
import io.swagger.annotations.ApiOperation; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
|
import java.io.IOException; |
|
|
|
|
|
import java.net.URLEncoder; |
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @author wangpengfei |
|
|
* @author wangpengfei |
|
|
* @date 2023/11/23 10:35 |
|
|
* @date 2023/11/23 10:35 |
|
@ -21,7 +33,8 @@ import org.springframework.web.bind.annotation.*; |
|
|
public class OrdOrderRest { |
|
|
public class OrdOrderRest { |
|
|
@Autowired |
|
|
@Autowired |
|
|
OrdOrderService ordOrderService; |
|
|
OrdOrderService ordOrderService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
OrdOrderDetailService ordOrderDetailService; |
|
|
|
|
|
|
|
|
@PostMapping("/createOrder") |
|
|
@PostMapping("/createOrder") |
|
|
@ApiOperation(value = "创建订单") |
|
|
@ApiOperation(value = "创建订单") |
|
@ -48,6 +61,18 @@ public class OrdOrderRest { |
|
|
public ResultBean<PagerVo<OrdOrderVo>> pcOrderList(@RequestBody PagerQuery<OrdOrderQuery> query) { |
|
|
public ResultBean<PagerVo<OrdOrderVo>> pcOrderList(@RequestBody PagerQuery<OrdOrderQuery> query) { |
|
|
return ordOrderService.pcOrderList(query); |
|
|
return ordOrderService.pcOrderList(query); |
|
|
} |
|
|
} |
|
|
|
|
|
@PostMapping("/pcOrderListExport") |
|
|
|
|
|
@ApiOperation(value = "pc支付记录导出") |
|
|
|
|
|
public void pcOrderListExport(@RequestBody OrdOrderQuery query, HttpServletResponse response) throws IOException { |
|
|
|
|
|
// 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman
|
|
|
|
|
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
|
|
|
|
|
response.setCharacterEncoding("utf-8"); |
|
|
|
|
|
// 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系
|
|
|
|
|
|
String fileName = URLEncoder.encode("预售单明细", "UTF-8").replaceAll("\\+", "%20"); |
|
|
|
|
|
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); |
|
|
|
|
|
List<OrdOrderExcelVo> list = ordOrderService.pcOrderList(query); |
|
|
|
|
|
EasyExcel.write(response.getOutputStream(), OrdOrderExcelVo.class).sheet("预售单明细").doWrite(list); |
|
|
|
|
|
} |
|
|
@GetMapping("/OrderDetails/{sid}") |
|
|
@GetMapping("/OrderDetails/{sid}") |
|
|
@ApiOperation(value = "支付记录明细") |
|
|
@ApiOperation(value = "支付记录明细") |
|
|
public ResultBean<OrdOrderVo> getOrderDetails(@PathVariable("sid") String sid) { |
|
|
public ResultBean<OrdOrderVo> getOrderDetails(@PathVariable("sid") String sid) { |
|
@ -85,4 +110,11 @@ public class OrdOrderRest { |
|
|
public ResultBean wxElectronicInvoice(@RequestBody OrdOrderQuery query) { |
|
|
public ResultBean wxElectronicInvoice(@RequestBody OrdOrderQuery query) { |
|
|
return ordOrderService.wxElectronicInvoice(query); |
|
|
return ordOrderService.wxElectronicInvoice(query); |
|
|
} |
|
|
} |
|
|
|
|
|
@ApiOperation("根据sid批量删除") |
|
|
|
|
|
@DeleteMapping("/delBySids") |
|
|
|
|
|
public ResultBean delBySids(@RequestBody String[] sids){ |
|
|
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
|
|
ordOrderService.delAll(sids); |
|
|
|
|
|
return rb.success(); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|