|
|
@ -1,16 +1,25 @@ |
|
|
|
package com.order.controller.business; |
|
|
|
package com.order.controller.business; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.excel.EasyExcel; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.hfkj.common.exception.ErrorCode; |
|
|
|
import com.hfkj.common.exception.ErrorCode; |
|
|
|
import com.hfkj.common.exception.ErrorHelp; |
|
|
|
import com.hfkj.common.exception.ErrorHelp; |
|
|
|
import com.hfkj.common.exception.SysCode; |
|
|
|
import com.hfkj.common.exception.SysCode; |
|
|
|
|
|
|
|
import com.hfkj.common.security.UserCenter; |
|
|
|
import com.hfkj.common.utils.ResponseMsgUtil; |
|
|
|
import com.hfkj.common.utils.ResponseMsgUtil; |
|
|
|
|
|
|
|
import com.hfkj.config.CommonSysConst; |
|
|
|
import com.hfkj.entity.BsOrderCoupon; |
|
|
|
import com.hfkj.entity.BsOrderCoupon; |
|
|
|
import com.hfkj.model.ResponseData; |
|
|
|
import com.hfkj.model.ResponseData; |
|
|
|
|
|
|
|
import com.hfkj.model.SecUserSessionObject; |
|
|
|
import com.hfkj.model.order.OrderCouponModel; |
|
|
|
import com.hfkj.model.order.OrderCouponModel; |
|
|
|
import com.hfkj.service.coupon.BsOrderCouponNoService; |
|
|
|
import com.hfkj.service.coupon.BsOrderCouponNoService; |
|
|
|
import com.hfkj.service.coupon.BsOrderCouponService; |
|
|
|
import com.hfkj.service.coupon.BsOrderCouponService; |
|
|
|
|
|
|
|
import com.hfkj.sysenum.SecUserObjectTypeEnum; |
|
|
|
|
|
|
|
import com.hfkj.sysenum.order.OrderChildStatusEnum; |
|
|
|
|
|
|
|
import com.hfkj.sysenum.order.OrderCouponNoStatusEnum; |
|
|
|
|
|
|
|
import com.hfkj.sysenum.order.OrderPayChannelEnum; |
|
|
|
|
|
|
|
import com.hfkj.sysenum.order.OrderPayTypeEnum; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.Logger; |
|
|
@ -22,9 +31,8 @@ import org.springframework.web.bind.annotation.RequestParam; |
|
|
|
import org.springframework.web.bind.annotation.ResponseBody; |
|
|
|
import org.springframework.web.bind.annotation.ResponseBody; |
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.io.File; |
|
|
|
import java.util.List; |
|
|
|
import java.util.*; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @className: OrderCouponController |
|
|
|
* @className: OrderCouponController |
|
|
@ -41,6 +49,8 @@ public class OrderCouponController { |
|
|
|
private BsOrderCouponService orderCouponService; |
|
|
|
private BsOrderCouponService orderCouponService; |
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
private BsOrderCouponNoService orderCouponNoService; |
|
|
|
private BsOrderCouponNoService orderCouponNoService; |
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private UserCenter userCenter; |
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/queryCouNo",method = RequestMethod.GET) |
|
|
|
@RequestMapping(value="/queryCouNo",method = RequestMethod.GET) |
|
|
|
@ResponseBody |
|
|
|
@ResponseBody |
|
|
@ -98,6 +108,12 @@ public class OrderCouponController { |
|
|
|
@RequestParam(value = "pageSize" , required = true) Integer pageSize) { |
|
|
|
@RequestParam(value = "pageSize" , required = true) Integer pageSize) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
Map<String,Object> param = new HashMap<>(); |
|
|
|
Map<String,Object> param = new HashMap<>(); |
|
|
|
|
|
|
|
SecUserSessionObject userSessionObject = userCenter.getSessionModel(SecUserSessionObject.class); |
|
|
|
|
|
|
|
if (SecUserObjectTypeEnum.type1.getCode() == userSessionObject.getAccount().getObjectType()) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if (SecUserObjectTypeEnum.type2.getCode() == userSessionObject.getAccount().getObjectType()) { |
|
|
|
|
|
|
|
param.put("merId", userSessionObject.getAccount().getObjectId()); |
|
|
|
|
|
|
|
} |
|
|
|
param.put("orderNo", orderNo); |
|
|
|
param.put("orderNo", orderNo); |
|
|
|
param.put("userPhone", userPhone); |
|
|
|
param.put("userPhone", userPhone); |
|
|
|
param.put("tradeStatus", tradeStatus); |
|
|
|
param.put("tradeStatus", tradeStatus); |
|
|
@ -120,7 +136,7 @@ public class OrderCouponController { |
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/export",method = RequestMethod.GET) |
|
|
|
@RequestMapping(value="/export",method = RequestMethod.GET) |
|
|
|
@ResponseBody |
|
|
|
@ResponseBody |
|
|
|
@ApiOperation(value = "查询交易订单列表") |
|
|
|
@ApiOperation(value = "导出订单") |
|
|
|
public ResponseData export(@RequestParam(value = "orderNo" , required = false) String orderNo, |
|
|
|
public ResponseData export(@RequestParam(value = "orderNo" , required = false) String orderNo, |
|
|
|
@RequestParam(value = "userPhone" , required = false) String userPhone, |
|
|
|
@RequestParam(value = "userPhone" , required = false) String userPhone, |
|
|
|
@RequestParam(value = "tradeStatus" , required = false) Integer tradeStatus, |
|
|
|
@RequestParam(value = "tradeStatus" , required = false) Integer tradeStatus, |
|
|
@ -133,6 +149,12 @@ public class OrderCouponController { |
|
|
|
@RequestParam(value = "createTimeE" , required = false) Long createTimeE) { |
|
|
|
@RequestParam(value = "createTimeE" , required = false) Long createTimeE) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
Map<String,Object> param = new HashMap<>(); |
|
|
|
Map<String,Object> param = new HashMap<>(); |
|
|
|
|
|
|
|
SecUserSessionObject userSessionObject = userCenter.getSessionModel(SecUserSessionObject.class); |
|
|
|
|
|
|
|
if (SecUserObjectTypeEnum.type1.getCode() == userSessionObject.getAccount().getObjectType()) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if (SecUserObjectTypeEnum.type2.getCode() == userSessionObject.getAccount().getObjectType()) { |
|
|
|
|
|
|
|
param.put("merId", userSessionObject.getAccount().getObjectId()); |
|
|
|
|
|
|
|
} |
|
|
|
param.put("orderNo", orderNo); |
|
|
|
param.put("orderNo", orderNo); |
|
|
|
param.put("userPhone", userPhone); |
|
|
|
param.put("userPhone", userPhone); |
|
|
|
param.put("tradeStatus", tradeStatus); |
|
|
|
param.put("tradeStatus", tradeStatus); |
|
|
@ -145,8 +167,36 @@ public class OrderCouponController { |
|
|
|
param.put("createTimeE", createTimeE); |
|
|
|
param.put("createTimeE", createTimeE); |
|
|
|
List<OrderCouponModel> orderList = orderCouponService.getOrderList(param); |
|
|
|
List<OrderCouponModel> orderList = orderCouponService.getOrderList(param); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (OrderCouponModel coupon : orderList) { |
|
|
|
|
|
|
|
if (coupon.getPayChannel() != null) { |
|
|
|
|
|
|
|
coupon.setPayChannel(OrderPayChannelEnum.getData(Integer.valueOf(coupon.getPayChannel())).getName()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (coupon.getPayType() != null) { |
|
|
|
|
|
|
|
coupon.setPayType(OrderPayTypeEnum.getData(Integer.valueOf(coupon.getPayType())).getName()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
coupon.setTradeStatus(OrderChildStatusEnum.getData(Integer.valueOf(coupon.getTradeStatus())).getName()); |
|
|
|
|
|
|
|
coupon.setCouStatus(OrderCouponNoStatusEnum.getData(Integer.valueOf(coupon.getCouStatus())).getName()); |
|
|
|
|
|
|
|
coupon.setExceptionStatus(Boolean.getBoolean(coupon.getExceptionStatus())?"是":"否"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(orderList); |
|
|
|
String fileUrl = CommonSysConst.getSysConfig().getFileUrl() + "/temporary/"; |
|
|
|
|
|
|
|
String pathName = System.currentTimeMillis()+".xlsx"; |
|
|
|
|
|
|
|
File file = new File(fileUrl); |
|
|
|
|
|
|
|
if (!file.exists()) { |
|
|
|
|
|
|
|
file.mkdirs(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//设置第几列开始合并
|
|
|
|
|
|
|
|
int[] mergeColumnIndex = {0,1,2,17}; |
|
|
|
|
|
|
|
//设置第几行开始合并
|
|
|
|
|
|
|
|
int mergeRowIndex = 1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EasyExcel.write(fileUrl+pathName) |
|
|
|
|
|
|
|
.head(OrderCouponModel.class) |
|
|
|
|
|
|
|
.sheet("虚拟商品订单") |
|
|
|
|
|
|
|
//.registerWriteHandler(new ExcelFillCellMergeStrategyUtils(mergeRowIndex, mergeColumnIndex))
|
|
|
|
|
|
|
|
.doWrite(orderList); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(pathName); |
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("error!",e); |
|
|
|
log.error("error!",e); |
|
|
|