commit
a502b8e502
@ -1 +1 @@ |
|||||||
package com.cweb.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.cweb.config.SysConst;
import com.hai.common.Base64Util;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.pay.util.XmlUtil;
import com.hai.common.pay.util.sdk.WXPayConstants;
import com.hai.common.security.SessionObject;
import com.hai.common.security.UserCenter;
import com.hai.common.utils.*;
import com.hai.config.*;
import com.hai.dao.HighGasOrderPushMapper;
import com.hai.entity.*;
import com.hai.enum_type.MerchantStoreSourceType;
import com.hai.model.*;
import com.hai.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.ssl.SSLContexts;
import org.apache.http.util.EntityUtils;
import org.bouncycastle.util.encoders.UrlBase64;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.IdGenerator;
import org.springframework.web.bind.annotation.*;
import sun.nio.cs.StreamEncoder;
import javax.annotation.Resource;
import javax.net.ssl.SSLContext;
import javax.servlet.http.HttpServletRequest;
import java.io.*;
import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;
import java.security.KeyStore;
import java.util.*;
/**
* @Auther: 胡锐
* @Description:
* @Date: 2021/3/26 23:08
*/
@Controller
@RequestMapping(value = "/test")
@Api(value = "订单接口")
public class HighTestController {
private static Logger log = LoggerFactory.getLogger(HighTestController.class);
@Resource
private PayloService payloService;
@Resource
private HighGasService gasService;
@RequestMapping(value = "/ycShellPageQueryAllStation", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "订单退款")
public ResponseData ycShellPageQueryAllStation() {
try {
return ResponseMsgUtil.success(payloService.ycShellPageQueryAllStation(1, 50));
} catch (Exception e) {
log.error("HighOrderController --> getBackendToken() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/HuiLianTongConfigPayOrderByCouNo", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "")
public ResponseData HuiLianTongConfigPayOrderByCouNo(@RequestParam(name = "couNo", required = true) String couNo) {
try {
JSONObject jsonObject = HuiLianTongConfig.getPayOrderByCouNo(couNo);
if (jsonObject.getString("respCode").equals("0000")) {
JSONObject data = HuiLianTongUnionCardConfig.resolveResponse(jsonObject.getString("data"));
return ResponseMsgUtil.success(data);
} else {
log.error("getRechargeProduct error!", "查询失败!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR , "查询失败");
}
} catch (Exception e) {
log.error("HighOrderController --> getBackendToken() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getPayloAllStation", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "paylo油站")
public ResponseData getPayloAllStation(HttpServletRequest request) {
try {
gasService.getPayloAllStation();
return ResponseMsgUtil.success("");
} catch (Exception e) {
log.error("HighOrderController --> unionStagingPay() error!", e);
return ResponseMsgUtil.exception(e);
}
}
} |
package com.cweb.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.cweb.config.SysConst;
import com.hai.common.Base64Util;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.pay.util.XmlUtil;
import com.hai.common.pay.util.sdk.WXPayConstants;
import com.hai.common.security.SessionObject;
import com.hai.common.security.UserCenter;
import com.hai.common.utils.*;
import com.hai.config.*;
import com.hai.dao.HighGasOrderPushMapper;
import com.hai.entity.*;
import com.hai.enum_type.MerchantStoreSourceType;
import com.hai.model.*;
import com.hai.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.ssl.SSLContexts;
import org.apache.http.util.EntityUtils;
import org.bouncycastle.util.encoders.UrlBase64;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.IdGenerator;
import org.springframework.web.bind.annotation.*;
import sun.nio.cs.StreamEncoder;
import javax.annotation.Resource;
import javax.net.ssl.SSLContext;
import javax.servlet.http.HttpServletRequest;
import java.io.*;
import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;
import java.security.KeyStore;
import java.util.*;
/**
* @Auther: 胡锐
* @Description:
* @Date: 2021/3/26 23:08
*/
@Controller
@RequestMapping(value = "/test")
@Api(value = "订单接口")
public class HighTestController {
private static Logger log = LoggerFactory.getLogger(HighTestController.class);
@Resource
private PayloService payloService;
@Resource
private HighGasService gasService;
@RequestMapping(value = "/invalidCoupon", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "重庆CNPC电子券作废")
public ResponseData invalidCoupon(@RequestParam(name = "couponNo", required = true) String couponNo,
@RequestParam(name = "random", required = false) String random) {
try {
return ResponseMsgUtil.success(ChongQingCNPCService.invalidCoupon(couponNo, null));
} catch (Exception e) {
log.error("HighOrderController --> getBackendToken() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/ycShellPageQueryAllStation", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "订单退款")
public ResponseData ycShellPageQueryAllStation() {
try {
return ResponseMsgUtil.success(payloService.ycShellPageQueryAllStation(1, 50));
} catch (Exception e) {
log.error("HighOrderController --> getBackendToken() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/HuiLianTongConfigPayOrderByCouNo", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "")
public ResponseData HuiLianTongConfigPayOrderByCouNo(@RequestParam(name = "couNo", required = true) String couNo) {
try {
JSONObject jsonObject = HuiLianTongConfig.getPayOrderByCouNo(couNo);
if (jsonObject.getString("respCode").equals("0000")) {
JSONObject data = HuiLianTongUnionCardConfig.resolveResponse(jsonObject.getString("data"));
return ResponseMsgUtil.success(data);
} else {
log.error("getRechargeProduct error!", "查询失败!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR , "查询失败");
}
} catch (Exception e) {
log.error("HighOrderController --> getBackendToken() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getPayloAllStation", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "paylo油站")
public ResponseData getPayloAllStation(HttpServletRequest request) {
try {
gasService.getPayloAllStation();
return ResponseMsgUtil.success("");
} catch (Exception e) {
log.error("HighOrderController --> unionStagingPay() error!", e);
return ResponseMsgUtil.exception(e);
}
}
} |
@ -0,0 +1,211 @@ |
|||||||
|
package com.web.controller.business; |
||||||
|
|
||||||
|
import com.alibaba.excel.EasyExcel; |
||||||
|
import com.github.pagehelper.PageHelper; |
||||||
|
import com.github.pagehelper.PageInfo; |
||||||
|
import com.hai.common.exception.ErrorCode; |
||||||
|
import com.hai.common.exception.ErrorHelp; |
||||||
|
import com.hai.common.exception.SysCode; |
||||||
|
import com.hai.common.security.UserCenter; |
||||||
|
import com.hai.common.utils.DateUtil; |
||||||
|
import com.hai.common.utils.ResponseMsgUtil; |
||||||
|
import com.hai.entity.HighGasOrder; |
||||||
|
import com.hai.enum_type.MerchantStoreSourceType; |
||||||
|
import com.hai.enum_type.UserObjectTypeEnum; |
||||||
|
import com.hai.enum_type.UserRoleTypeEnum; |
||||||
|
import com.hai.model.ResponseData; |
||||||
|
import com.hai.model.UserInfoModel; |
||||||
|
import com.hai.order.model.ExportGasOrderModel; |
||||||
|
import com.hai.order.service.OrderService; |
||||||
|
import com.hai.order.service.OrderServiceExt; |
||||||
|
import com.hai.order.type.OrderOilStatus; |
||||||
|
import com.hai.order.type.OrderPayType; |
||||||
|
import com.hai.service.HighGasOrderService; |
||||||
|
import com.web.config.SysConst; |
||||||
|
import io.swagger.annotations.Api; |
||||||
|
import io.swagger.annotations.ApiOperation; |
||||||
|
import org.apache.commons.collections4.MapUtils; |
||||||
|
import org.apache.commons.lang3.StringUtils; |
||||||
|
import org.slf4j.Logger; |
||||||
|
import org.slf4j.LoggerFactory; |
||||||
|
import org.springframework.stereotype.Controller; |
||||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestMethod; |
||||||
|
import org.springframework.web.bind.annotation.RequestParam; |
||||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||||
|
|
||||||
|
import javax.annotation.Resource; |
||||||
|
import java.io.File; |
||||||
|
import java.math.BigDecimal; |
||||||
|
import java.util.*; |
||||||
|
|
||||||
|
@Controller |
||||||
|
@RequestMapping(value = "oilCard") |
||||||
|
@Api(value = "油卡充值业务") |
||||||
|
public class OrderOilCardController { |
||||||
|
|
||||||
|
private static Logger log = LoggerFactory.getLogger(OrderOilCardController.class); |
||||||
|
|
||||||
|
@Resource |
||||||
|
private UserCenter userCenter; |
||||||
|
|
||||||
|
@Resource |
||||||
|
private OrderService orderService; |
||||||
|
|
||||||
|
@Resource |
||||||
|
private OrderServiceExt orderServiceExt; |
||||||
|
|
||||||
|
@RequestMapping(value="/getOilCardOrderList",method = RequestMethod.GET) |
||||||
|
@ResponseBody |
||||||
|
@ApiOperation(value = "查询油卡充值订单列表") |
||||||
|
public ResponseData getOilCardOrderList(@RequestParam(name = "orderNo", required = false) String orderNo, |
||||||
|
@RequestParam(name = "oilCardNo", required = false) String oilCardNo, |
||||||
|
@RequestParam(name = "memPhone", required = false) String memPhone, |
||||||
|
@RequestParam(name = "payType", required = false) Integer payType, |
||||||
|
@RequestParam(name = "status", required = false) Integer status, |
||||||
|
@RequestParam(name = "createTimeS", required = false) Long createTimeS, |
||||||
|
@RequestParam(name = "createTimeE", required = false) Long createTimeE, |
||||||
|
@RequestParam(name = "payTimeS", required = false) Long payTimeS, |
||||||
|
@RequestParam(name = "payTimeE", required = false) Long payTimeE, |
||||||
|
@RequestParam(name = "refundTimeS", required = false) Long refundTimeS, |
||||||
|
@RequestParam(name = "refundTimeE", required = false) Long refundTimeE, |
||||||
|
@RequestParam(name = "pageNum", required = true) Integer pageNum, |
||||||
|
@RequestParam(name = "pageSize", required = true) Integer pageSize |
||||||
|
) { |
||||||
|
try { |
||||||
|
Map<String, Object> param = new HashMap<>(); |
||||||
|
param.put("orderNo", orderNo); |
||||||
|
param.put("memPhone", memPhone); |
||||||
|
param.put("oilCardNo", oilCardNo); |
||||||
|
param.put("payType", payType); |
||||||
|
param.put("status", status); |
||||||
|
param.put("createTimeS", createTimeS); |
||||||
|
param.put("createTimeE", createTimeE); |
||||||
|
param.put("payTimeS", payTimeS); |
||||||
|
param.put("payTimeE", payTimeE); |
||||||
|
param.put("refundTimeS", refundTimeS); |
||||||
|
param.put("refundTimeE", refundTimeE); |
||||||
|
|
||||||
|
PageHelper.startPage(pageNum, pageSize); |
||||||
|
return ResponseMsgUtil.success(new PageInfo<>(orderService.getOilCardOrderList(param))); |
||||||
|
|
||||||
|
} catch (Exception e) { |
||||||
|
log.error("OrderOilCardController -> getOilCardOrderList() error!",e); |
||||||
|
return ResponseMsgUtil.exception(e); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@RequestMapping(value="/getOrderDetail",method = RequestMethod.GET) |
||||||
|
@ResponseBody |
||||||
|
@ApiOperation(value = "查询订单详情") |
||||||
|
public ResponseData getOrderDetail(@RequestParam(name = "orderNo", required = true) String orderNo) { |
||||||
|
try { |
||||||
|
|
||||||
|
return ResponseMsgUtil.success(orderService.getOrderDetailByNo(orderNo)); |
||||||
|
|
||||||
|
} catch (Exception e) { |
||||||
|
log.error("OrderExtController -> getGasOrderDetail() error!",e); |
||||||
|
return ResponseMsgUtil.exception(e); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@RequestMapping(value="/exportOilCardOrder",method = RequestMethod.GET) |
||||||
|
@ResponseBody |
||||||
|
@ApiOperation(value = "导出油卡充值订单") |
||||||
|
public ResponseData exportOilCardOrder(@RequestParam(name = "orderNo", required = false) String orderNo, |
||||||
|
@RequestParam(name = "oilCardNo", required = false) String oilCardNo, |
||||||
|
@RequestParam(name = "memPhone", required = false) String memPhone, |
||||||
|
@RequestParam(name = "payType", required = false) Integer payType, |
||||||
|
@RequestParam(name = "status", required = false) Integer status, |
||||||
|
@RequestParam(name = "createTimeS", required = false) Long createTimeS, |
||||||
|
@RequestParam(name = "createTimeE", required = false) Long createTimeE, |
||||||
|
@RequestParam(name = "payTimeS", required = false) Long payTimeS, |
||||||
|
@RequestParam(name = "payTimeE", required = false) Long payTimeE, |
||||||
|
@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("memPhone", memPhone); |
||||||
|
param.put("oilCardNo", oilCardNo); |
||||||
|
param.put("payType", payType); |
||||||
|
param.put("status", status); |
||||||
|
param.put("createTimeS", createTimeS); |
||||||
|
param.put("createTimeE", createTimeE); |
||||||
|
param.put("payTimeS", payTimeS); |
||||||
|
param.put("payTimeE", payTimeE); |
||||||
|
param.put("refundTimeS", refundTimeS); |
||||||
|
param.put("refundTimeE", refundTimeE); |
||||||
|
|
||||||
|
// 查询数据
|
||||||
|
List<Map<String, Object>> orderList = orderService.getOilCardOrderList(param); |
||||||
|
|
||||||
|
List<List<Object>> dataList = new ArrayList<>(); |
||||||
|
List<Object> data; |
||||||
|
|
||||||
|
for (Map<String,Object> order : orderList) { |
||||||
|
data = new ArrayList<>(); |
||||||
|
data.add(MapUtils.getString(order, "orderNo")); |
||||||
|
data.add(MapUtils.getString(order, "memPhone")); |
||||||
|
data.add(MapUtils.getString(order, "oildCard")); |
||||||
|
data.add(MapUtils.getString(order, "goodsActualPrice")); |
||||||
|
data.add(MapUtils.getString(order, "givePrice")); |
||||||
|
data.add(MapUtils.getString(order, "goodsPrice")); |
||||||
|
data.add(MapUtils.getString(order, "payRealPrice")); |
||||||
|
data.add(MapUtils.getString(order, "createTime")); |
||||||
|
data.add(MapUtils.getString(order, "payTime")); |
||||||
|
data.add(MapUtils.getString(order, "refundTime")); |
||||||
|
data.add(MapUtils.getString(order, "orderStatus")); |
||||||
|
dataList.add(data); |
||||||
|
} |
||||||
|
|
||||||
|
List<String> headList = new ArrayList<>();; |
||||||
|
headList.add("交易单号"); |
||||||
|
headList.add("客户电话"); |
||||||
|
headList.add("油卡卡号"); |
||||||
|
headList.add("充值金额"); |
||||||
|
headList.add("赠送金额"); |
||||||
|
headList.add("实际到账金额"); |
||||||
|
headList.add("支付金额"); |
||||||
|
headList.add("创建时间"); |
||||||
|
headList.add("支付时间"); |
||||||
|
headList.add("退款时间"); |
||||||
|
headList.add("交易状态"); |
||||||
|
|
||||||
|
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(generationHead(headList)) |
||||||
|
.sheet("交易订单") |
||||||
|
.doWrite(dataList); |
||||||
|
return ResponseMsgUtil.success(pathName); |
||||||
|
|
||||||
|
} catch (Exception e) { |
||||||
|
log.error("OrderExtController -> exportGasOrderList() error!",e); |
||||||
|
return ResponseMsgUtil.exception(e); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 生成头部 |
||||||
|
* @param headList |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
private List<List<String>> generationHead(List<String> headList) { |
||||||
|
List<List<String>> list = new ArrayList<>(); |
||||||
|
List<String> head; |
||||||
|
for (String headStr : headList) { |
||||||
|
head = new ArrayList<>(); |
||||||
|
head.add(headStr); |
||||||
|
list.add(head); |
||||||
|
} |
||||||
|
return list; |
||||||
|
} |
||||||
|
|
||||||
|
} |
Loading…
Reference in new issue