From f95e0b92eaff3e38741ec37ce6803533ced40ab8 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Wed, 12 Oct 2022 14:48:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bweb/controller/HighOrderController.java | 110 ---------- .../business/OrderCouponController.java | 189 ++++++++++++++++++ .../OrderOilController.java} | 90 ++------- .../java/com/hai/dao/HighOrderMapperExt.java | 50 ----- .../com/hai/dao/order/OrderMapperExt.java | 90 +++++---- .../com/hai/order/model/OrderCouponModal.java | 72 ------- .../{ => order}/model/OrderCouponModel.java | 6 +- .../hai/order/service/OrderServiceExt.java | 10 +- .../service/impl/OrderServiceExtImpl.java | 35 +++- .../com/hai/service/HighOrderService.java | 7 - .../service/impl/HighOrderServiceImpl.java | 28 --- 11 files changed, 288 insertions(+), 399 deletions(-) create mode 100644 hai-order/src/main/java/com/web/controller/business/OrderCouponController.java rename hai-order/src/main/java/com/web/controller/{OrderBWebController.java => business/OrderOilController.java} (83%) delete mode 100644 hai-service/src/main/java/com/hai/order/model/OrderCouponModal.java rename hai-service/src/main/java/com/hai/{ => order}/model/OrderCouponModel.java (91%) diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java b/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java index eacaba9b..93809c8e 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.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 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 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 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 = "获取用户订单") diff --git a/hai-order/src/main/java/com/web/controller/business/OrderCouponController.java b/hai-order/src/main/java/com/web/controller/business/OrderCouponController.java new file mode 100644 index 00000000..90572cb4 --- /dev/null +++ b/hai-order/src/main/java/com/web/controller/business/OrderCouponController.java @@ -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 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 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 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 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); + } + } + +} diff --git a/hai-order/src/main/java/com/web/controller/OrderBWebController.java b/hai-order/src/main/java/com/web/controller/business/OrderOilController.java similarity index 83% rename from hai-order/src/main/java/com/web/controller/OrderBWebController.java rename to hai-order/src/main/java/com/web/controller/business/OrderOilController.java index d3851a9e..270c9a6c 100644 --- a/hai-order/src/main/java/com/web/controller/OrderBWebController.java +++ b/hai-order/src/main/java/com/web/controller/business/OrderOilController.java @@ -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 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 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 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, diff --git a/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java index 55812db2..c6de3a56 100644 --- a/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java @@ -1285,54 +1285,4 @@ public interface HighOrderMapperExt { }) List integralRebateOrder(); - - @Select({""}) - List queryOrderCoupon(@Param("param") Map param); } diff --git a/hai-service/src/main/java/com/hai/dao/order/OrderMapperExt.java b/hai-service/src/main/java/com/hai/dao/order/OrderMapperExt.java index f6e33b25..b7f4dd07 100644 --- a/hai-service/src/main/java/com/hai/dao/order/OrderMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/order/OrderMapperExt.java @@ -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("") - List queryOrderCouponList(@Param("param") Map param); + " where a.goods_type = 1" + + " and a.goods_id in (${param.goodsId}) " + + " and b.order_no like concat('%', #{param.orderNo}, '%') " + + " and b.mem_phone like concat('%', #{param.memPhone}, '%') " + + " and a.goods_name like concat('%', #{param.couponName}, '%') " + + " and b.pay_type = #{param.payType} " + + " and b.order_status = #{param.orderStatus} " + + " = #{param.createTimeS} ]]> " + + " " + + " = #{param.payTimeS} ]]> " + + " " + + " = #{param.finishTimeS} ]]> " + + " " + + " ORDER BY b.create_time desc" + + ""}) + List queryOrderCoupon(@Param("param") Map param); } diff --git a/hai-service/src/main/java/com/hai/order/model/OrderCouponModal.java b/hai-service/src/main/java/com/hai/order/model/OrderCouponModal.java deleted file mode 100644 index 0d28ae19..00000000 --- a/hai-service/src/main/java/com/hai/order/model/OrderCouponModal.java +++ /dev/null @@ -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; - - -} diff --git a/hai-service/src/main/java/com/hai/model/OrderCouponModel.java b/hai-service/src/main/java/com/hai/order/model/OrderCouponModel.java similarity index 91% rename from hai-service/src/main/java/com/hai/model/OrderCouponModel.java rename to hai-service/src/main/java/com/hai/order/model/OrderCouponModel.java index d774c88a..49088478 100644 --- a/hai-service/src/main/java/com/hai/model/OrderCouponModel.java +++ b/hai-service/src/main/java/com/hai/order/model/OrderCouponModel.java @@ -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; diff --git a/hai-service/src/main/java/com/hai/order/service/OrderServiceExt.java b/hai-service/src/main/java/com/hai/order/service/OrderServiceExt.java index ee7fddec..3471b344 100644 --- a/hai-service/src/main/java/com/hai/order/service/OrderServiceExt.java +++ b/hai-service/src/main/java/com/hai/order/service/OrderServiceExt.java @@ -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 getOrderCouponList(Map param); + List getOrderCouponList(Map param) throws Exception; } diff --git a/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceExtImpl.java b/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceExtImpl.java index a19c2aaf..8f08ca01 100644 --- a/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceExtImpl.java +++ b/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceExtImpl.java @@ -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 getOrderCouponList(Map param) { - return orderMapperExt.queryOrderCouponList(param); + public List getOrderCouponList(Map 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); } } diff --git a/hai-service/src/main/java/com/hai/service/HighOrderService.java b/hai-service/src/main/java/com/hai/service/HighOrderService.java index 661305a1..a5088d21 100644 --- a/hai-service/src/main/java/com/hai/service/HighOrderService.java +++ b/hai-service/src/main/java/com/hai/service/HighOrderService.java @@ -589,12 +589,5 @@ public interface HighOrderService { * @return java.util.List */ List orderListByAgentId(Map map) throws Exception; - - /** - * 查询卡券订单 - * @param param - * @return - */ - List getOrderCouponList(Map param) throws Exception; } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java index da916b83..1de25677 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java @@ -3352,32 +3352,4 @@ public class HighOrderServiceImpl implements HighOrderService { return list; } - @Override - public List getOrderCouponList(Map 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); - } }