修改注册送券内容

dev-discount
袁野 2 years ago
parent 6ae301399f
commit 88b6b96038
  1. 7
      hai-bweb/src/main/java/com/bweb/controller/OutRechargeOrderController.java
  2. 101
      hai-order/src/main/java/com/web/controller/business/OrderThirdPartyController.java
  3. 4
      hai-order/src/main/resources/dev/config.properties
  4. 9
      hai-service/src/main/java/com/hai/enum_type/OrderPayTypeEnum.java
  5. 71
      hai-service/src/main/java/com/hai/order/model/OrderThirdPartyModel.java

@ -48,6 +48,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
@ -254,6 +255,12 @@ public class OutRechargeOrderController {
String name = "/outRechargeOrder/充值订单" + System.currentTimeMillis() + ".xlsx"; String name = "/outRechargeOrder/充值订单" + System.currentTimeMillis() + ".xlsx";
String fileName = SysConst.getSysConfig().getFileUrl() + name; String fileName = SysConst.getSysConfig().getFileUrl() + name;
String fileUrl = SysConst.getSysConfig().getFileUrl() + "outRechargeOrder/";
String pathName = System.currentTimeMillis()+".xlsx";
File file = new File(fileUrl);
if (!file.exists()) {
file.mkdirs();
}
EasyExcel.write(fileName, ExportOutRechargeOrder.class).sheet("充值订单").doWrite(list); EasyExcel.write(fileName, ExportOutRechargeOrder.class).sheet("充值订单").doWrite(list);
return ResponseMsgUtil.success(name); return ResponseMsgUtil.success(name);
} catch (Exception e) { } catch (Exception e) {

@ -1,5 +1,6 @@
package com.web.controller.business; package com.web.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.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorCode;
@ -7,10 +8,18 @@ import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode; import com.hai.common.exception.SysCode;
import com.hai.common.security.UserCenter; import com.hai.common.security.UserCenter;
import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.HighGasOrder;
import com.hai.entity.HighOrder;
import com.hai.enum_type.OrderPayTypeEnum;
import com.hai.enum_type.OrderStatusEnum;
import com.hai.enum_type.UserObjectTypeEnum; import com.hai.enum_type.UserObjectTypeEnum;
import com.hai.model.ResponseData; import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel; import com.hai.model.UserInfoModel;
import com.hai.order.model.ExportGasOrderModel;
import com.hai.order.model.OrderThirdPartyModel;
import com.hai.order.service.OrderService; import com.hai.order.service.OrderService;
import com.hai.order.type.OrderOilStatus;
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.slf4j.Logger; import org.slf4j.Logger;
@ -23,8 +32,12 @@ import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.math.BigDecimal;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
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
@ -112,4 +125,92 @@ public class OrderThirdPartyController {
} }
} }
@RequestMapping(value = "/exportThirdPartyOrderList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "导出第三方订单列表")
public ResponseData exportThirdPartyOrderList(@RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "memPhone", required = false) String memPhone,
@RequestParam(name = "memCardNo", required = false) String memCardNo,
@RequestParam(name = "payType", required = false) Integer payType,
@RequestParam(name = "status", required = false) Integer status,
@RequestParam(name = "companyId", required = false) Long companyId,
@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 = "productType", required = false) Integer productType,
@RequestParam(name = "finishTimeS", required = false) Long finishTimeS,
@RequestParam(name = "finishTimeE", required = false) Long finishTimeE) {
try {
UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class);
if (userInfoModel == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
Map<String,Object> map = new HashMap<>();
if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type0.getType())) {
map.put("companyId" , companyId);
} else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type1.getType())) {
map.put("companyId", userInfoModel.getBsCompany().getId());
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
map.put("createTimeS", createTimeS);
map.put("createTimeE", createTimeE);
map.put("payTimeS", payTimeS);
map.put("payTimeE", payTimeE);
map.put("finishTimeS", finishTimeS);
map.put("finishTimeE", finishTimeE);
map.put("orderNo", orderNo);
map.put("memPhone", memPhone);
map.put("memCardNo", memCardNo);
map.put("productType", productType);
map.put("status", status);
map.put("payType", payType);
// 查询数据
List<HighOrder> orderList = orderService.getOrderList(map);
List<OrderThirdPartyModel> dataList = new ArrayList<>();
OrderThirdPartyModel model;
for (HighOrder thirdPartyModel : orderList) {
model = new OrderThirdPartyModel();
model.setOrderNo(thirdPartyModel.getOrderNo());
model.setMemPhone(thirdPartyModel.getMemPhone());
model.setTitle(thirdPartyModel.getTitle());
model.setTotalPrice(thirdPartyModel.getTotalPrice());
model.setTotalDeductionPrice(thirdPartyModel.getTotalDeductionPrice());
model.setDeductionProductPrice(thirdPartyModel.getDeductionProductPrice());
model.setPayablePrice(thirdPartyModel.getPayablePrice());
model.setPayPrice(thirdPartyModel.getPayPrice());
model.setPayType(OrderPayTypeEnum.getNameByType(thirdPartyModel.getPayType()));
model.setOrderStatus(OrderStatusEnum.getNameByType(thirdPartyModel.getOrderStatus()));
model.setCreateTime(thirdPartyModel.getCreateTime());
model.setPayTime(thirdPartyModel.getPayTime());
dataList.add(model);
}
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(ExportGasOrderModel.class)
.sheet("交易订单")
.doWrite(dataList);
return ResponseMsgUtil.success(pathName);
} catch (Exception e) {
log.error("OrderCouponController --> getOrderList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
} }

@ -9,5 +9,5 @@ wxPayUnifiedOrderUrl=https://api.mch.weixin.qq.com/pay/unifiedorder
wxPayNotifyUrl=https://hsgcs.dctpay.com/order/payNotify/wechatPay wxPayNotifyUrl=https://hsgcs.dctpay.com/order/payNotify/wechatPay
unionPayNotifyUrl=https://hsgcs.dctpay.com/order/payNotify/unionPay unionPayNotifyUrl=https://hsgcs.dctpay.com/order/payNotify/unionPay
fileUrl=F:/hurui_probject/filesystem fileUrl=/Volumes/work/code/filesystem/
cmsPath=F:/hurui_probject/filesystem cmsPath=/Volumes/work/code/filesystem/

@ -1,5 +1,7 @@
package com.hai.enum_type; package com.hai.enum_type;
import java.util.Objects;
/** /**
* 支付方式 * 支付方式
* @author hurui * @author hurui
@ -22,6 +24,13 @@ public enum OrderPayTypeEnum {
this.name = name; this.name = name;
} }
public static String getNameByType(Integer type) {
for (OrderPayTypeEnum ele : values()) {
if(Objects.equals(type,ele.getType())) return ele.getName();
}
return null;
}
public Integer getType() { public Integer getType() {
return type; return type;
} }

@ -0,0 +1,71 @@
package com.hai.order.model;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* 第三方订单模型
* @className: OrderThirdPartyModel
* @author: HuRui
* @date: 2022/9/30
**/
@Data
public class OrderThirdPartyModel {
@ColumnWidth(25)
@ExcelProperty(value = "交易订单号")
private String orderNo;
@ColumnWidth(15)
@ExcelProperty(value = "客户电话")
private String memPhone;
@ColumnWidth(15)
@ExcelProperty(value = "订单标题")
private String title;
@ColumnWidth(13)
@ExcelProperty(value = "订单总额")
private BigDecimal totalPrice;
@ColumnWidth(13)
@ExcelProperty(value = "总优惠金额")
private BigDecimal totalDeductionPrice;
@ColumnWidth(13)
@ExcelProperty(value = "优惠券优惠金额")
private BigDecimal deductionCouponPrice;
@ColumnWidth(13)
@ExcelProperty(value = "产品优惠金额")
private BigDecimal deductionProductPrice;
@ColumnWidth(13)
@ExcelProperty(value = "应付金额")
private BigDecimal payablePrice;
@ColumnWidth(13)
@ExcelProperty(value = "实付金额")
private BigDecimal payPrice;
@ColumnWidth(13)
@ExcelProperty(value = "支付方式")
private String payType;
@ColumnWidth(13)
@ExcelProperty(value = "订单状态")
private String orderStatus;
@ColumnWidth(20)
@ExcelProperty(value = "创建时间")
private Date createTime;
@ColumnWidth(20)
@ExcelProperty(value = "支付时间")
private Date payTime;
}
Loading…
Cancel
Save