提交代码

dev-discount
胡锐 2 years ago
parent 0090949543
commit f95e0b92ea
  1. 110
      hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java
  2. 189
      hai-order/src/main/java/com/web/controller/business/OrderCouponController.java
  3. 90
      hai-order/src/main/java/com/web/controller/business/OrderOilController.java
  4. 50
      hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java
  5. 90
      hai-service/src/main/java/com/hai/dao/order/OrderMapperExt.java
  6. 72
      hai-service/src/main/java/com/hai/order/model/OrderCouponModal.java
  7. 6
      hai-service/src/main/java/com/hai/order/model/OrderCouponModel.java
  8. 10
      hai-service/src/main/java/com/hai/order/service/OrderServiceExt.java
  9. 35
      hai-service/src/main/java/com/hai/order/service/impl/OrderServiceExtImpl.java
  10. 7
      hai-service/src/main/java/com/hai/service/HighOrderService.java
  11. 28
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java

@ -115,116 +115,6 @@ public class HighOrderController {
}
@RequestMapping(value = "/getOrderCouponList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询卡券订单列表")
public ResponseData getOrderCouponList(@RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "memPhone", required = false) String memPhone,
@RequestParam(name = "couponName", required = false) String couponName,
@RequestParam(name = "payType", required = false) Integer payType,
@RequestParam(name = "orderStatus", required = false) Integer orderStatus,
@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 = "finishTimeS", required = false) Long finishTimeS,
@RequestParam(name = "finishTimeE", required = false) Long finishTimeE,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize,
HttpServletRequest request) {
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())) {
} else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type1.getType())) {
map.put("goodsId", couponService.getCouponIdsByCompanyId(userInfoModel.getBsCompany().getId()));
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
map.put("orderNo", orderNo);
map.put("memPhone", memPhone);
map.put("couponName", couponName);
map.put("payType", payType);
map.put("orderStatus", orderStatus);
map.put("createTimeS", createTimeS);
map.put("createTimeE", createTimeE);
map.put("payTimeS", payTimeS);
map.put("payTimeE", payTimeE);
map.put("finishTimeS", finishTimeS);
map.put("finishTimeE", finishTimeE);
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(highOrderService.getOrderCouponList(map)));
} catch (Exception e) {
log.error("HighOrderController --> getUserOrderList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/exportOrderCouponExcel", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "导出卡券订单")
public ResponseData exportOrderCouponExcel(@RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "memPhone", required = false) String memPhone,
@RequestParam(name = "couponName", required = false) String couponName,
@RequestParam(name = "payType", required = false) Integer payType,
@RequestParam(name = "orderStatus", required = false) Integer orderStatus,
@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 = "finishTimeS", required = false) Long finishTimeS,
@RequestParam(name = "finishTimeE", required = false) Long finishTimeE,
HttpServletRequest request) {
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())) {
} else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type1.getType())) {
map.put("goodsId", couponService.getCouponIdsByCompanyId(userInfoModel.getBsCompany().getId()));
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
map.put("orderNo", orderNo);
map.put("memPhone", memPhone);
map.put("couponName", couponName);
map.put("payType", payType);
map.put("orderStatus", orderStatus);
map.put("createTimeS", createTimeS);
map.put("createTimeE", createTimeE);
map.put("payTimeS", payTimeS);
map.put("payTimeE", payTimeE);
map.put("finishTimeS", finishTimeS);
map.put("finishTimeE", finishTimeE);
List<OrderCouponModel> list = highOrderService.getOrderCouponList(map);
String fileName = "/temporary/" + System.currentTimeMillis() + ".xlsx";
EasyExcel.write(SysConst.getSysConfig().getFileUrl() + fileName, OrderCouponModel.class)
.sheet("卡券订单")
.doWrite(list);
return ResponseMsgUtil.success(fileName);
} catch (Exception e) {
log.error("HighOrderController --> getUserOrderList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getOrderBList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取用户订单")

@ -0,0 +1,189 @@
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.ResponseMsgUtil;
import com.hai.entity.HighCoupon;
import com.hai.entity.HighGasOrder;
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.model.OrderCouponModel;
import com.hai.order.service.OrderService;
import com.hai.order.service.OrderServiceExt;
import com.hai.order.type.OrderOilStatus;
import com.hai.service.HighCouponService;
import com.hai.service.HighGasOrderService;
import com.web.config.SysConst;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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 javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.math.BigDecimal;
import java.util.*;
@Controller
@RequestMapping(value = "coupon")
@Api(value = "卡券订单业务")
public class OrderCouponController {
private static Logger log = LoggerFactory.getLogger(OrderCouponController.class);
@Resource
private UserCenter userCenter;
@Resource
private OrderService orderService;
@Resource
private HighCouponService couponService;
@Resource
private OrderServiceExt orderServiceExt;
@RequestMapping(value = "/getOrderList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询卡券订单列表")
public ResponseData getOrderList(@RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "memPhone", required = false) String memPhone,
@RequestParam(name = "couponName", required = false) String couponName,
@RequestParam(name = "payType", required = false) Integer payType,
@RequestParam(name = "orderStatus", required = false) Integer orderStatus,
@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 = "finishTimeS", required = false) Long finishTimeS,
@RequestParam(name = "finishTimeE", required = false) Long finishTimeE,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize,
HttpServletRequest request) {
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())) {
} else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type1.getType())) {
map.put("goodsId", couponService.getCouponIdsByCompanyId(userInfoModel.getBsCompany().getId()));
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
map.put("orderNo", orderNo);
map.put("memPhone", memPhone);
map.put("couponName", couponName);
map.put("payType", payType);
map.put("orderStatus", orderStatus);
map.put("createTimeS", createTimeS);
map.put("createTimeE", createTimeE);
map.put("payTimeS", payTimeS);
map.put("payTimeE", payTimeE);
map.put("finishTimeS", finishTimeS);
map.put("finishTimeE", finishTimeE);
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(orderServiceExt.getOrderCouponList(map)));
} catch (Exception e) {
log.error("OrderCouponController --> getOrderList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/exportOrderCouponExcel", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "导出卡券订单")
public ResponseData exportOrderCouponExcel(@RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "memPhone", required = false) String memPhone,
@RequestParam(name = "couponName", required = false) String couponName,
@RequestParam(name = "payType", required = false) Integer payType,
@RequestParam(name = "orderStatus", required = false) Integer orderStatus,
@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 = "finishTimeS", required = false) Long finishTimeS,
@RequestParam(name = "finishTimeE", required = false) Long finishTimeE,
HttpServletRequest request) {
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())) {
} else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type1.getType())) {
map.put("goodsId", couponService.getCouponIdsByCompanyId(userInfoModel.getBsCompany().getId()));
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
map.put("orderNo", orderNo);
map.put("memPhone", memPhone);
map.put("couponName", couponName);
map.put("payType", payType);
map.put("orderStatus", orderStatus);
map.put("createTimeS", createTimeS);
map.put("createTimeE", createTimeE);
map.put("payTimeS", payTimeS);
map.put("payTimeE", payTimeE);
map.put("finishTimeS", finishTimeS);
map.put("finishTimeE", finishTimeE);
List<OrderCouponModel> list = orderServiceExt.getOrderCouponList(map);
String fileName = "/temporary/" + System.currentTimeMillis() + ".xlsx";
EasyExcel.write(SysConst.getSysConfig().getFileUrl() + fileName, OrderCouponModel.class)
.sheet("卡券订单")
.doWrite(list);
return ResponseMsgUtil.success(fileName);
} catch (Exception e) {
log.error("HighOrderController --> getUserOrderList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getOrderDetail",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询卡券订单详情")
public ResponseData getOrderDetail(@RequestParam(name = "orderNo", required = false) String orderNo) {
try {
Map<String, Object> param = new HashMap<>();
param.put("tradeOrder", orderService.getOrderDetailByNo(orderNo));
return ResponseMsgUtil.success(param);
} catch (Exception e) {
log.error("OrderCouponController -> getOrderDetail() error!",e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -1,4 +1,4 @@
package com.web.controller;
package com.web.controller.business;
import com.alibaba.excel.EasyExcel;
import com.github.pagehelper.PageHelper;
@ -7,12 +7,10 @@ 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.ExcelUtils;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.HighGasOrder;
import com.hai.enum_type.UserObjectTypeEnum;
import com.hai.enum_type.UserRoleTypeEnum;
import com.hai.model.HighOrderPreModel;
import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel;
import com.hai.order.model.ExportGasOrderModel;
@ -36,17 +34,12 @@ import java.io.File;
import java.math.BigDecimal;
import java.util.*;
/**
* @className: OrderExtController
* @author: HuRui
* @date: 2022/9/14
**/
@Controller
@RequestMapping(value = "bweb")
@Api(value = "订单业务")
public class OrderBWebController {
@RequestMapping(value = "oil")
@Api(value = "加油订单业务")
public class OrderOilController {
private static Logger log = LoggerFactory.getLogger(OrderBWebController.class);
private static Logger log = LoggerFactory.getLogger(OrderOilController.class);
@Resource
private UserCenter userCenter;
@ -60,69 +53,10 @@ public class OrderBWebController {
@Resource
private HighGasOrderService gasOrderService;
@RequestMapping(value="/getCouponOrderList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询卡券订单列表")
public ResponseData getCouponOrderList(@RequestParam(name = "companyId", required = false) Long companyId,
@RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "orderStatus", required = false) Integer orderStatus,
@RequestParam(name = "childOrderNo", required = false) String childOrderNo,
@RequestParam(name = "goodsId", required = false) Long goodsId,
@RequestParam(name = "goodsName", required = false) String goodsName,
@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("companyId", companyId);
param.put("orderNo", orderNo);
param.put("orderStatus", orderStatus);
param.put("childOrderNo", childOrderNo);
param.put("goodsId", goodsId);
param.put("goodsName", goodsName);
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(orderServiceExt.getOrderCouponList(param));
} catch (Exception e) {
log.error("OrderExtController -> getCouponOrderList() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getCouponOrderDetail",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询卡券订单详情")
public ResponseData getCouponOrderDetail(@RequestParam(name = "orderNo", required = false) String orderNo) {
try {
Map<String, Object> param = new HashMap<>();
param.put("order", orderService.getOrderDetailByNo(orderNo));
return ResponseMsgUtil.success(param);
} catch (Exception e) {
log.error("OrderExtController -> getCouponOrderDetail() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getGasOrderList",method = RequestMethod.GET)
@RequestMapping(value="/getOilOrderList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询油站订单列表")
public ResponseData getGasOrderList(@RequestParam(name = "companyId", required = false) Long companyId,
public ResponseData getOilOrderList(@RequestParam(name = "companyId", required = false) Long companyId,
@RequestParam(name = "merId", required = false) Long merId,
@RequestParam(name = "storeId", required = false) Long storeId,
@RequestParam(name = "storeName", required = false) String storeName,
@ -226,10 +160,10 @@ public class OrderBWebController {
}
@RequestMapping(value="/getGasOrderDetail",method = RequestMethod.GET)
@RequestMapping(value="/getOilOrderDetail",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询油站详情")
public ResponseData getGasOrderDetail(@RequestParam(name = "orderNo", required = true) String orderNo) {
public ResponseData getOilOrderDetail(@RequestParam(name = "orderNo", required = true) String orderNo) {
try {
Map<String, Object> map = new HashMap<>();
map.put("tradeOrder", orderService.getOrderDetailByNo(orderNo));
@ -243,10 +177,10 @@ public class OrderBWebController {
}
}
@RequestMapping(value="/exportGasOrder",method = RequestMethod.GET)
@RequestMapping(value="/exportOilOrder",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询油站订单列表")
public ResponseData exportGasOrder(@RequestParam(name = "companyId", required = false) Long companyId,
@ApiOperation(value = "导出加油订单")
public ResponseData exportOilOrder(@RequestParam(name = "companyId", required = false) Long companyId,
@RequestParam(name = "merId", required = false) Long merId,
@RequestParam(name = "storeId", required = false) Long storeId,
@RequestParam(name = "storeName", required = false) String storeName,

@ -1285,54 +1285,4 @@ public interface HighOrderMapperExt {
})
List<HighOrder> integralRebateOrder();
@Select({"<script>" +
" select" +
" b.order_no orderNo," +
" b.mem_phone memPhone," +
" a.goods_name couponName," +
" b.total_price totalPrice," +
" b.deduction_price deductionPrice," +
" b.payable_price payablePrice," +
" b.pay_gold payGold," +
" b.pay_price payPrice," +
" CASE b.pay_type " +
" WHEN 1 THEN '支付宝' " +
" WHEN 2 THEN '微信'" +
" WHEN 3 THEN '积分抵扣'" +
" WHEN 4 THEN '贵州汇联通工会卡'" +
" WHEN 5 THEN '银联'" +
" WHEN 6 THEN '银联分期'" +
" WHEN 7 THEN '嗨森逛油卡'" +
" ELSE '未知' END payType," +
" CASE b.order_status " +
" WHEN 1 THEN '待支付' " +
" WHEN 2 THEN '已支付'" +
" WHEN 3 THEN '已完成'" +
" WHEN 4 THEN '已退款'" +
" WHEN 5 THEN '已取消'" +
" WHEN 6 THEN '退款中'" +
" WHEN 7 THEN '退款拒绝'" +
" ELSE '未知' END orderStatus," +
" b.create_time createTime," +
" b.pay_time payTime," +
" b.finish_time finishTime" +
" from high_child_order a" +
" LEFT JOIN high_order b on b.id = a.order_id" +
" where a.goods_type = 1" +
" <if test='param.goodsId != null'> and a.goods_id in (${param.goodsId}) </if>" +
" <if test='param.orderNo != null'> and b.order_no like concat('%', #{param.orderNo}, '%') </if>" +
" <if test='param.memPhone != null'> and b.mem_phone like concat('%', #{param.memPhone}, '%') </if>" +
" <if test='param.couponName != null'> and a.goods_name like concat('%', #{param.couponName}, '%') </if>" +
" <if test='param.payType != null'> and b.pay_type = #{param.payType} </if>" +
" <if test='param.orderStatus != null'> and b.order_status = #{param.orderStatus} </if>" +
" <if test='param.createTimeS != null'> <![CDATA[ and b.create_time >= #{param.createTimeS} ]]> </if>" +
" <if test='param.createTimeE != null'> <![CDATA[ and b.create_time <= #{param.createTimeE} ]]> </if>" +
" <if test='param.payTimeS != null'> <![CDATA[ and b.pay_time >= #{param.payTimeS} ]]> </if>" +
" <if test='param.payTimeE != null'> <![CDATA[ and b.pay_time <= #{param.payTimeE} ]]> </if>" +
" <if test='param.finishTimeS != null'> <![CDATA[ and b.finish_time >= #{param.finishTimeS} ]]> </if>" +
" <if test='param.finishTimeE != null'> <![CDATA[ and b.finish_time <= #{param.finishTimeE} ]]> </if>" +
" ORDER BY b.create_time desc" +
"</script>"})
List<OrderCouponModel> queryOrderCoupon(@Param("param") Map<String, Object> param);
}

@ -1,6 +1,6 @@
package com.hai.dao.order;
import com.hai.order.model.OrderCouponModal;
import com.hai.order.model.OrderCouponModel;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@ -23,49 +23,55 @@ public interface OrderMapperExt {
@Select("SELECT count(1) FROM high_child_order where mem_id = #{userId} and child_order_status in (2,3) and goods_type = 1 and goods_id = #{couponId}")
int userBuyCouponNum(@Param("userId") Long userId,@Param("couponId") Long couponId);
/**
* 查询卡券订单列表
* @param param
* @return
*/
@Select("<script>" +
@Select({"<script>" +
" select" +
" a.order_id orderId," +
" a.order_no orderNo," +
" b.pay_serial_no paySerialNo," +
" a.id childOrderId," +
" a.child_order_no childOrderNo," +
" a.mem_phone memPhone," +
" b.pay_gold integralDeduct," +
" b.pay_type payType," +
" a.goods_id goodsId," +
" a.goods_name goodsName," +
" a.goods_price goodsPrice," +
" a.goods_actual_price goodsActualPrice," +
" a.child_order_status childOrderStatus," +
" a.create_time createTime," +
" a.pay_time payTime," +
" a.finish_time finishTime," +
" a.cancel_time cancelTime," +
" a.refund_time refundTime" +
" b.order_no orderNo," +
" b.mem_phone memPhone," +
" a.goods_name couponName," +
" a.goods_price couponPrice," +
" b.total_price totalPrice," +
" b.deduction_price deductionPrice," +
" b.payable_price payablePrice," +
" b.pay_gold payGold," +
" b.pay_price payPrice," +
" CASE b.pay_type " +
" WHEN 1 THEN '支付宝' " +
" WHEN 2 THEN '微信'" +
" WHEN 3 THEN '积分抵扣'" +
" WHEN 4 THEN '贵州汇联通工会卡'" +
" WHEN 5 THEN '银联'" +
" WHEN 6 THEN '银联分期'" +
" WHEN 7 THEN '嗨森逛油卡'" +
" ELSE '未知' END payType," +
" CASE b.order_status " +
" WHEN 1 THEN '待支付' " +
" WHEN 2 THEN '已支付'" +
" WHEN 3 THEN '已完成'" +
" WHEN 4 THEN '已退款'" +
" WHEN 5 THEN '已取消'" +
" WHEN 6 THEN '退款中'" +
" WHEN 7 THEN '退款拒绝'" +
" ELSE '未知' END orderStatus," +
" b.create_time createTime," +
" b.pay_time payTime," +
" b.finish_time finishTime" +
" from high_child_order a" +
" LEFT JOIN high_order b on b.id = a.order_id" +
" where a.goods_type = 1 and a.giveaway_type = 0" +
" <if test='param.orderNo != null'> and a.order_no LIKE concat('%',#{param.orderNo},'%') </if>" +
" <if test='param.paySerialNo != null'> and b.pay_serial_no LIKE concat('%',#{param.paySerialNo},'%') </if>" +
" <if test='param.payType != null'> and a.pay_type = #{param.payType} </if>" +
" <if test='param.childOrderNo != null'> and a.child_order_no = #{param.childOrderNo} </if>" +
" <if test='param.memPhone != null'> and a.mem_phone = #{param.memPhone} </if>" +
" <if test='param.goodsName != null'> and b.goods_name LIKE concat('%',#{param.goodsName},'%') </if>" +
" <if test='param.childOrderStatus != null'> and b.child_order_status = #{param.childOrderStatus} </if>" +
" <if test='param.createTimeS != null'> <![CDATA[ and a.create_time >= #{param.createTimeS} ]]> </if>" +
" <if test='param.createTimeE != null'> <![CDATA[ and a.create_time <= #{param.createTimeE} ]]> </if>" +
" <if test='param.payTimeS != null'> <![CDATA[ and a.pay_time >= #{param.payTimeS} ]]> </if>" +
" <if test='param.payTimeE != null'> <![CDATA[ and a.pay_time <= #{param.payTimeE} ]]> </if>" +
" <if test='param.refundTimeS != null'> <![CDATA[ and a.refund_time >= #{param.refundTimeS} ]]> </if>" +
" <if test='param.refundTimeE != null'> <![CDATA[ and a.refund_time <= #{param.refundTimeE} ]]> </if>" +
" ORDER BY a.create_time desc" +
"</script>")
List<OrderCouponModal> queryOrderCouponList(@Param("param") Map<String, Object> param);
" where a.goods_type = 1" +
" <if test='param.goodsId != null'> and a.goods_id in (${param.goodsId}) </if>" +
" <if test='param.orderNo != null'> and b.order_no like concat('%', #{param.orderNo}, '%') </if>" +
" <if test='param.memPhone != null'> and b.mem_phone like concat('%', #{param.memPhone}, '%') </if>" +
" <if test='param.couponName != null'> and a.goods_name like concat('%', #{param.couponName}, '%') </if>" +
" <if test='param.payType != null'> and b.pay_type = #{param.payType} </if>" +
" <if test='param.orderStatus != null'> and b.order_status = #{param.orderStatus} </if>" +
" <if test='param.createTimeS != null'> <![CDATA[ and b.create_time >= #{param.createTimeS} ]]> </if>" +
" <if test='param.createTimeE != null'> <![CDATA[ and b.create_time <= #{param.createTimeE} ]]> </if>" +
" <if test='param.payTimeS != null'> <![CDATA[ and b.pay_time >= #{param.payTimeS} ]]> </if>" +
" <if test='param.payTimeE != null'> <![CDATA[ and b.pay_time <= #{param.payTimeE} ]]> </if>" +
" <if test='param.finishTimeS != null'> <![CDATA[ and b.finish_time >= #{param.finishTimeS} ]]> </if>" +
" <if test='param.finishTimeE != null'> <![CDATA[ and b.finish_time <= #{param.finishTimeE} ]]> </if>" +
" ORDER BY b.create_time desc" +
"</script>"})
List<OrderCouponModel> queryOrderCoupon(@Param("param") Map<String, Object> param);
}

@ -1,72 +0,0 @@
package com.hai.order.model;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* 卡券订单模型
* @className: OrderCouponModal
* @author: HuRui
* @date: 2022/9/14
**/
@Data
public class OrderCouponModal {
// 交易订单id
private Long orderId;
// 交易订单号
private String orderNo;
// 第三方交易流水号
private String paySerialNo;
// 子订单id
private Long childOrderId;
// 子订单号
private String childOrderNo;
// 用户手机号
private String memPhone;
// 积分抵扣
private Integer integralDeduct;
// 支付方式
private Integer payType;
// 产品id
private Long goodsId;
// 产品名称
private String goodsName;
// 产品价格
private BigDecimal goodsPrice;
// 产品实际价格
private BigDecimal goodsActualPrice;
// 子订单状态
private Integer childOrderStatus;
// 创建时间
private Date createTime;
// 支付时间
private Date payTime;
// 完成时间
private Date finishTime;
// 取消时间
private Date cancelTime;
// 退款时间
private Date refundTime;
}

@ -1,4 +1,4 @@
package com.hai.model;
package com.hai.order.model;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
@ -7,6 +7,7 @@ import java.math.BigDecimal;
import java.util.Date;
/**
* 卡券订单模型
* @className: OrderCouponModel
* @author: HuRui
* @date: 2022/9/30
@ -23,6 +24,9 @@ public class OrderCouponModel {
@ExcelProperty(value = "卡券名称")
private String couponName;
@ExcelProperty(value = "卡券面值")
private String couponPrice;
@ExcelProperty(value = "总价格")
private BigDecimal totalPrice;

@ -1,9 +1,7 @@
package com.hai.order.service;
import com.hai.entity.HighGasOrder;
import com.hai.model.OrderCountModel;
import com.hai.order.model.OrderCouponModal;
import org.apache.ibatis.annotations.Param;
import com.hai.order.model.OrderCouponModel;
import java.util.List;
import java.util.Map;
@ -25,10 +23,10 @@ public interface OrderServiceExt {
int userBuyCouponNum(Long userId,Long couponId);
/**
* 查询卡券订单列表
* 查询卡券订单
* @param param
* @return
*/
List<OrderCouponModal> getOrderCouponList(Map<String, Object> param);
List<OrderCouponModel> getOrderCouponList(Map<String, Object> param) throws Exception;
}

@ -1,13 +1,14 @@
package com.hai.order.service.impl;
import com.hai.common.utils.DateUtil;
import com.hai.dao.order.OrderMapperExt;
import com.hai.entity.HighGasOrder;
import com.hai.order.model.OrderCouponModal;
import com.hai.order.model.OrderCouponModel;
import com.hai.order.service.OrderServiceExt;
import com.hai.service.HighGasOrderService;
import org.apache.commons.collections4.MapUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -28,8 +29,32 @@ public class OrderServiceExtImpl implements OrderServiceExt {
}
@Override
public List<OrderCouponModal> getOrderCouponList(Map<String, Object> param) {
return orderMapperExt.queryOrderCouponList(param);
public List<OrderCouponModel> getOrderCouponList(Map<String, Object> param) throws Exception {
if (MapUtils.getLong(param, "createTimeS") != null) {
param.put("createTimeS", DateUtil.date2String(new Date(MapUtils.getLong(param, "createTimeS")), DateUtil.Y_M_D_HMS));
}
if (MapUtils.getLong(param, "createTimeE") != null) {
param.put("createTimeE", DateUtil.date2String(new Date(MapUtils.getLong(param, "createTimeE")), DateUtil.Y_M_D_HMS));
}
if (MapUtils.getLong(param, "payTimeS") != null) {
param.put("payTimeS", DateUtil.date2String(new Date(MapUtils.getLong(param, "payTimeS")), DateUtil.Y_M_D_HMS));
}
if (MapUtils.getLong(param, "payTimeE") != null) {
param.put("payTimeE", DateUtil.date2String(new Date(MapUtils.getLong(param, "payTimeE")), DateUtil.Y_M_D_HMS));
}
if (MapUtils.getLong(param, "finishTimeS") != null) {
param.put("finishTimeS", DateUtil.date2String(new Date(MapUtils.getLong(param, "finishTimeS")), DateUtil.Y_M_D_HMS));
}
if (MapUtils.getLong(param, "finishTimeE") != null) {
param.put("finishTimeE", DateUtil.date2String(new Date(MapUtils.getLong(param, "finishTimeE")), DateUtil.Y_M_D_HMS));
}
return orderMapperExt.queryOrderCoupon(param);
}
}

@ -589,12 +589,5 @@ public interface HighOrderService {
* @return java.util.List<com.hai.entity.HighOrder>
*/
List<HighOrder> orderListByAgentId(Map<String , Object> map) throws Exception;
/**
* 查询卡券订单
* @param param
* @return
*/
List<OrderCouponModel> getOrderCouponList(Map<String, Object> param) throws Exception;
}

@ -3352,32 +3352,4 @@ public class HighOrderServiceImpl implements HighOrderService {
return list;
}
@Override
public List<OrderCouponModel> getOrderCouponList(Map<String, Object> param) throws Exception {
if (MapUtils.getLong(param, "createTimeS") != null) {
param.put("createTimeS", DateUtil.date2String(new Date(MapUtils.getLong(param, "createTimeS")), DateUtil.Y_M_D_HMS));
}
if (MapUtils.getLong(param, "createTimeE") != null) {
param.put("createTimeE", DateUtil.date2String(new Date(MapUtils.getLong(param, "createTimeE")), DateUtil.Y_M_D_HMS));
}
if (MapUtils.getLong(param, "payTimeS") != null) {
param.put("payTimeS", DateUtil.date2String(new Date(MapUtils.getLong(param, "payTimeS")), DateUtil.Y_M_D_HMS));
}
if (MapUtils.getLong(param, "payTimeE") != null) {
param.put("payTimeE", DateUtil.date2String(new Date(MapUtils.getLong(param, "payTimeE")), DateUtil.Y_M_D_HMS));
}
if (MapUtils.getLong(param, "finishTimeS") != null) {
param.put("finishTimeS", DateUtil.date2String(new Date(MapUtils.getLong(param, "finishTimeS")), DateUtil.Y_M_D_HMS));
}
if (MapUtils.getLong(param, "finishTimeE") != null) {
param.put("finishTimeE", DateUtil.date2String(new Date(MapUtils.getLong(param, "finishTimeE")), DateUtil.Y_M_D_HMS));
}
return highOrderMapper.queryOrderCoupon(param);
}
}

Loading…
Cancel
Save