|
|
@ -1,5 +1,6 @@ |
|
|
|
package com.web.controller; |
|
|
|
package com.web.controller; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.excel.EasyExcel; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
@ -10,17 +11,22 @@ import com.hai.common.security.UserCenter; |
|
|
|
import com.hai.common.utils.ResponseMsgUtil; |
|
|
|
import com.hai.common.utils.ResponseMsgUtil; |
|
|
|
import com.hai.entity.HighChildOrder; |
|
|
|
import com.hai.entity.HighChildOrder; |
|
|
|
import com.hai.entity.HighOrder; |
|
|
|
import com.hai.entity.HighOrder; |
|
|
|
|
|
|
|
import com.hai.entity.HighOrderRefund; |
|
|
|
import com.hai.model.HighUserModel; |
|
|
|
import com.hai.model.HighUserModel; |
|
|
|
import com.hai.model.ResponseData; |
|
|
|
import com.hai.model.ResponseData; |
|
|
|
import com.hai.order.model.CreateOrderChildModel; |
|
|
|
import com.hai.order.model.CreateOrderChildModel; |
|
|
|
import com.hai.order.model.CreateOrderModel; |
|
|
|
import com.hai.order.model.CreateOrderModel; |
|
|
|
|
|
|
|
import com.hai.order.model.ExportGasOrderModel; |
|
|
|
|
|
|
|
import com.hai.order.model.ExportOrderRefundModel; |
|
|
|
import com.hai.order.service.OrderPaySuccessService; |
|
|
|
import com.hai.order.service.OrderPaySuccessService; |
|
|
|
import com.hai.order.service.OrderRefundService; |
|
|
|
import com.hai.order.service.OrderRefundService; |
|
|
|
import com.hai.order.service.OrderService; |
|
|
|
import com.hai.order.service.OrderService; |
|
|
|
import com.hai.order.type.OrderChildGoodsType; |
|
|
|
import com.hai.order.type.OrderChildGoodsType; |
|
|
|
import com.hai.order.type.OrderChildStatus; |
|
|
|
import com.hai.order.type.OrderChildStatus; |
|
|
|
import com.hai.order.type.OrderPayType; |
|
|
|
import com.hai.order.type.OrderPayType; |
|
|
|
|
|
|
|
import com.hai.order.type.OrderRefundStatus; |
|
|
|
import com.hai.order.utils.OrderUtil; |
|
|
|
import com.hai.order.utils.OrderUtil; |
|
|
|
|
|
|
|
import com.web.config.SysConst; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
@ -32,8 +38,11 @@ import org.springframework.stereotype.Controller; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import javax.annotation.Resource; |
|
|
|
|
|
|
|
import java.io.File; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.math.BigDecimal; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashMap; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
|
@Controller |
|
|
|
@Controller |
|
|
@ -160,16 +169,27 @@ public class OrderRefundController { |
|
|
|
@RequestParam(name = "refundOrderNo", required = false) String refundOrderNo, |
|
|
|
@RequestParam(name = "refundOrderNo", required = false) String refundOrderNo, |
|
|
|
@RequestParam(name = "memPhone", required = false) String memPhone, |
|
|
|
@RequestParam(name = "memPhone", required = false) String memPhone, |
|
|
|
@RequestParam(name = "goodsType", required = false) Integer goodsType, |
|
|
|
@RequestParam(name = "goodsType", required = false) Integer goodsType, |
|
|
|
|
|
|
|
@RequestParam(name = "goodsName", required = false) String goodsName, |
|
|
|
@RequestParam(name = "status", required = false) Integer status, |
|
|
|
@RequestParam(name = "status", required = false) Integer status, |
|
|
|
|
|
|
|
@RequestParam(name = "createTimeS", required = false) Long createTimeS, |
|
|
|
|
|
|
|
@RequestParam(name = "createTimeE", required = false) Long createTimeE, |
|
|
|
|
|
|
|
@RequestParam(name = "refundTimeS", required = false) Long refundTimeS, |
|
|
|
|
|
|
|
@RequestParam(name = "refundTimeE", required = false) Long refundTimeE, |
|
|
|
@RequestParam(name = "pageNum", required = true) Integer pageNum, |
|
|
|
@RequestParam(name = "pageNum", required = true) Integer pageNum, |
|
|
|
@RequestParam(name = "pageSize", required = true) Integer pageSize) { |
|
|
|
@RequestParam(name = "pageSize", required = true) Integer pageSize) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
Map<String, Object> param = new HashMap<>(); |
|
|
|
Map<String, Object> param = new HashMap<>(); |
|
|
|
param.put("orderNo", orderNo); |
|
|
|
param.put("orderNo", orderNo); |
|
|
|
param.put("orderChildNo", orderChildNo); |
|
|
|
param.put("orderChildNo", orderChildNo); |
|
|
|
|
|
|
|
param.put("refundOrderNo", refundOrderNo); |
|
|
|
param.put("memPhone", memPhone); |
|
|
|
param.put("memPhone", memPhone); |
|
|
|
param.put("goodsType", goodsType); |
|
|
|
param.put("goodsType", goodsType); |
|
|
|
|
|
|
|
param.put("goodsName", goodsName); |
|
|
|
param.put("status", status); |
|
|
|
param.put("status", status); |
|
|
|
|
|
|
|
param.put("createTimeS", createTimeS); |
|
|
|
|
|
|
|
param.put("createTimeE", createTimeE); |
|
|
|
|
|
|
|
param.put("refundTimeS", refundTimeS); |
|
|
|
|
|
|
|
param.put("refundTimeE", refundTimeE); |
|
|
|
|
|
|
|
|
|
|
|
PageHelper.startPage(pageNum, pageSize); |
|
|
|
PageHelper.startPage(pageNum, pageSize); |
|
|
|
return ResponseMsgUtil.success(new PageInfo<>(orderRefundService.getRefundOrderList(param))); |
|
|
|
return ResponseMsgUtil.success(new PageInfo<>(orderRefundService.getRefundOrderList(param))); |
|
|
@ -180,4 +200,75 @@ public class OrderRefundController { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/excelRefund",method = RequestMethod.GET) |
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
|
|
|
|
@ApiOperation(value = "导出退款") |
|
|
|
|
|
|
|
public ResponseData excelRefund(@RequestParam(name = "orderNo", required = false) String orderNo, |
|
|
|
|
|
|
|
@RequestParam(name = "orderChildNo", required = false) String orderChildNo, |
|
|
|
|
|
|
|
@RequestParam(name = "refundOrderNo", required = false) String refundOrderNo, |
|
|
|
|
|
|
|
@RequestParam(name = "memPhone", required = false) String memPhone, |
|
|
|
|
|
|
|
@RequestParam(name = "goodsType", required = false) Integer goodsType, |
|
|
|
|
|
|
|
@RequestParam(name = "goodsName", required = false) String goodsName, |
|
|
|
|
|
|
|
@RequestParam(name = "status", required = false) Integer status, |
|
|
|
|
|
|
|
@RequestParam(name = "createTimeS", required = false) Long createTimeS, |
|
|
|
|
|
|
|
@RequestParam(name = "createTimeE", required = false) Long createTimeE, |
|
|
|
|
|
|
|
@RequestParam(name = "refundTimeS", required = false) Long refundTimeS, |
|
|
|
|
|
|
|
@RequestParam(name = "refundTimeE", required = false) Long refundTimeE) { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
Map<String, Object> param = new HashMap<>(); |
|
|
|
|
|
|
|
param.put("orderNo", orderNo); |
|
|
|
|
|
|
|
param.put("orderChildNo", orderChildNo); |
|
|
|
|
|
|
|
param.put("refundOrderNo", refundOrderNo); |
|
|
|
|
|
|
|
param.put("memPhone", memPhone); |
|
|
|
|
|
|
|
param.put("goodsType", goodsType); |
|
|
|
|
|
|
|
param.put("goodsName", goodsName); |
|
|
|
|
|
|
|
param.put("status", status); |
|
|
|
|
|
|
|
param.put("createTimeS", createTimeS); |
|
|
|
|
|
|
|
param.put("createTimeE", createTimeE); |
|
|
|
|
|
|
|
param.put("refundTimeS", refundTimeS); |
|
|
|
|
|
|
|
param.put("refundTimeE", refundTimeE); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<HighOrderRefund> list = orderRefundService.getRefundOrderList(param); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<ExportOrderRefundModel> orderRefundModelList = new ArrayList<>(); |
|
|
|
|
|
|
|
ExportOrderRefundModel orderRefundModel; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (HighOrderRefund orderRefund : list) { |
|
|
|
|
|
|
|
orderRefundModel = new ExportOrderRefundModel(); |
|
|
|
|
|
|
|
orderRefundModel.setOrderNo(orderRefund.getOrderNo()); |
|
|
|
|
|
|
|
orderRefundModel.setChildOrderNo(orderRefund.getOrderChildNo()); |
|
|
|
|
|
|
|
orderRefundModel.setMemPhone(orderRefund.getMemPhone()); |
|
|
|
|
|
|
|
orderRefundModel.setGoodsType(OrderChildGoodsType.getDataByType(orderRefund.getGoodsType()).getName()); |
|
|
|
|
|
|
|
orderRefundModel.setGoodsName(orderRefund.getGoodsName()); |
|
|
|
|
|
|
|
orderRefundModel.setRefundOrderNo(orderRefund.getRefundOrderNo()); |
|
|
|
|
|
|
|
orderRefundModel.setRefundGoodsNum(orderRefund.getRefundGoodsNum()); |
|
|
|
|
|
|
|
orderRefundModel.setReturnTotalPrice(orderRefund.getReturnTotalPrice()); |
|
|
|
|
|
|
|
orderRefundModel.setRefundPrice(orderRefund.getRefundPrice()); |
|
|
|
|
|
|
|
orderRefundModel.setRefundIntegral(orderRefund.getRefundIntegral()); |
|
|
|
|
|
|
|
orderRefundModel.setRefundStatus(OrderRefundStatus.getDataByType(orderRefund.getRefundStatus()).getName()); |
|
|
|
|
|
|
|
orderRefundModel.setCreateTime(orderRefund.getCreateTime()); |
|
|
|
|
|
|
|
orderRefundModel.setRefundTime(orderRefund.getRefundTime()); |
|
|
|
|
|
|
|
orderRefundModel.setRefundRemark(orderRefund.getRefundRemark()); |
|
|
|
|
|
|
|
orderRefundModelList.add(orderRefundModel); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String fileUrl = SysConst.getSysConfig().getFileUrl() + "/temporary/"; |
|
|
|
|
|
|
|
String pathName = System.currentTimeMillis()+".xlsx"; |
|
|
|
|
|
|
|
File file = new File(fileUrl); |
|
|
|
|
|
|
|
if (!file.exists()) { |
|
|
|
|
|
|
|
file.mkdirs(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
EasyExcel.write(fileUrl+pathName) |
|
|
|
|
|
|
|
.head(ExportOrderRefundModel.class) |
|
|
|
|
|
|
|
.sheet("交易退款记录") |
|
|
|
|
|
|
|
.doWrite(orderRefundModelList); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(fileUrl+pathName); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
log.error("OrderRefundController -> excelRefund() error!",e); |
|
|
|
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|