From 3c4ef583dff4d7c82bc3b8d0a9cd994812c958a4 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Mon, 13 May 2024 17:50:17 +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 --- .../business/OrderCouponController.java | 49 +++++++++------ .../com/hfkj/dao/BsOrderCouponMapperExt.java | 55 ++++++++++++++++- .../com/hfkj/dao/BsOrderCouponNoMapper.java | 19 +++--- .../hfkj/dao/BsOrderCouponNoSqlProvider.java | 14 +++++ .../java/com/hfkj/entity/BsOrderCouponNo.java | 16 +++++ .../hfkj/entity/BsOrderCouponNoExample.java | 60 +++++++++++++++++++ .../hfkj/model/order/OrderCouponModel.java | 43 +++++++++++++ .../service/coupon/BsOrderCouponService.java | 8 +++ .../coupon/impl/BsOrderCouponServiceImpl.java | 14 +++++ 9 files changed, 250 insertions(+), 28 deletions(-) create mode 100644 service/src/main/java/com/hfkj/model/order/OrderCouponModel.java diff --git a/order/src/main/java/com/order/controller/business/OrderCouponController.java b/order/src/main/java/com/order/controller/business/OrderCouponController.java index 97fd2af..d77e689 100644 --- a/order/src/main/java/com/order/controller/business/OrderCouponController.java +++ b/order/src/main/java/com/order/controller/business/OrderCouponController.java @@ -1,12 +1,10 @@ package com.order.controller.business; -import com.alibaba.excel.EasyExcel; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.model.ResponseData; import com.hfkj.service.coupon.BsOrderCouponService; -import com.order.controller.OrderController; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -35,42 +33,53 @@ public class OrderCouponController { @Resource private BsOrderCouponService orderCouponService; + @RequestMapping(value="/queryDetail",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询交易订单详情") + public ResponseData queryDetail(@RequestParam(value = "orderChildOrderNo" , required = true) String orderChildOrderNo) { + try { + Map param = new HashMap<>(); + param.put("orderNo", orderCouponService.getListByChildOrderNo(orderChildOrderNo)); + param.put("goods", null); + + return ResponseMsgUtil.success(param); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + @RequestMapping(value="/queryList",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询交易订单列表") public ResponseData queryList(@RequestParam(value = "orderNo" , required = false) String orderNo, - @RequestParam(value = "childOrderNo" , required = false) String childOrderNo, - @RequestParam(value = "merId" , required = false) Long merId, @RequestParam(value = "userPhone" , required = false) String userPhone, - @RequestParam(value = "payChannel" , required = false) Integer payChannel, + @RequestParam(value = "tradeStatus" , required = false) Integer tradeStatus, + @RequestParam(value = "goodsName" , required = false) String goodsName, @RequestParam(value = "payType" , required = false) Integer payType, + @RequestParam(value = "channelOrderNo" , required = false) String channelOrderNo, + @RequestParam(value = "couNo" , required = false) String couNo, + @RequestParam(value = "couStatus" , required = false) Integer couStatus, @RequestParam(value = "createTimeS" , required = false) Long createTimeS, @RequestParam(value = "createTimeE" , required = false) Long createTimeE, - @RequestParam(value = "payTimeS" , required = false) Long payTimeS, - @RequestParam(value = "payTimeE" , required = false) Long payTimeE, - @RequestParam(value = "finishTimeS" , required = false) Long finishTimeS, - @RequestParam(value = "finishTimeE" , required = false) Long finishTimeE, - @RequestParam(value = "cancelTimeS" , required = false) Long cancelTimeS, - @RequestParam(value = "cancelTimeE" , required = false) Long cancelTimeE, @RequestParam(value = "pageNum" , required = true) Integer pageNum, @RequestParam(value = "pageSize" , required = true) Integer pageSize) { try { Map param = new HashMap<>(); param.put("orderNo", orderNo); param.put("userPhone", userPhone); - param.put("payChannel", payChannel); + param.put("tradeStatus", tradeStatus); + param.put("goodsName", goodsName); param.put("payType", payType); + param.put("channelOrderNo", channelOrderNo); + param.put("couNo", couNo); + param.put("couStatus", couStatus); param.put("createTimeS", createTimeS); param.put("createTimeE", createTimeE); - param.put("payTimeS", payTimeS); - param.put("payTimeE", payTimeE); - param.put("finishTimeS", finishTimeS); - param.put("finishTimeE", finishTimeE); - param.put("cancelTimeS", cancelTimeS); - param.put("cancelTimeE", cancelTimeE); PageHelper.startPage(pageNum, pageSize); - return ResponseMsgUtil.success(new PageInfo<>()); + return ResponseMsgUtil.success(new PageInfo<>(orderCouponService.getOrderList(param))); } catch (Exception e) { log.error("error!",e); @@ -80,4 +89,6 @@ public class OrderCouponController { + + } diff --git a/service/src/main/java/com/hfkj/dao/BsOrderCouponMapperExt.java b/service/src/main/java/com/hfkj/dao/BsOrderCouponMapperExt.java index d21027a..f1274f1 100644 --- a/service/src/main/java/com/hfkj/dao/BsOrderCouponMapperExt.java +++ b/service/src/main/java/com/hfkj/dao/BsOrderCouponMapperExt.java @@ -1,7 +1,60 @@ package com.hfkj.dao; +import com.hfkj.model.order.OrderCouponModel; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; +import java.util.Map; + /** * mapper扩展类 */ public interface BsOrderCouponMapperExt { -} \ No newline at end of file + + @Select("") + List getOrderList(@Param("param") Map param); +} diff --git a/service/src/main/java/com/hfkj/dao/BsOrderCouponNoMapper.java b/service/src/main/java/com/hfkj/dao/BsOrderCouponNoMapper.java index 3559838..60ea76c 100644 --- a/service/src/main/java/com/hfkj/dao/BsOrderCouponNoMapper.java +++ b/service/src/main/java/com/hfkj/dao/BsOrderCouponNoMapper.java @@ -43,16 +43,16 @@ public interface BsOrderCouponNoMapper extends BsOrderCouponNoMapperExt { "channel_order_no, goods_vpd_source_cou_no, ", "expire_status, expire_time, ", "`status`, exception_status, ", - "create_time, finish_time, ", - "update_time, ext_1, ", - "ext_2, ext_3)", + "create_time, deliver_time, ", + "finish_time, update_time, ", + "ext_1, ext_2, ext_3)", "values (#{couponOrderId,jdbcType=BIGINT}, #{orderNo,jdbcType=VARCHAR}, ", "#{channelOrderNo,jdbcType=VARCHAR}, #{goodsVpdSourceCouNo,jdbcType=VARCHAR}, ", "#{expireStatus,jdbcType=BIT}, #{expireTime,jdbcType=TIMESTAMP}, ", "#{status,jdbcType=INTEGER}, #{exceptionStatus,jdbcType=BIT}, ", - "#{createTime,jdbcType=TIMESTAMP}, #{finishTime,jdbcType=TIMESTAMP}, ", - "#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", - "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + "#{createTime,jdbcType=TIMESTAMP}, #{deliverTime,jdbcType=TIMESTAMP}, ", + "#{finishTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(BsOrderCouponNo record); @@ -73,6 +73,7 @@ public interface BsOrderCouponNoMapper extends BsOrderCouponNoMapperExt { @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @Result(column="exception_status", property="exceptionStatus", jdbcType=JdbcType.BIT), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="deliver_time", property="deliverTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="finish_time", property="finishTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), @@ -84,8 +85,8 @@ public interface BsOrderCouponNoMapper extends BsOrderCouponNoMapperExt { @Select({ "select", "id, coupon_order_id, order_no, channel_order_no, goods_vpd_source_cou_no, expire_status, ", - "expire_time, `status`, exception_status, create_time, finish_time, update_time, ", - "ext_1, ext_2, ext_3", + "expire_time, `status`, exception_status, create_time, deliver_time, finish_time, ", + "update_time, ext_1, ext_2, ext_3", "from bs_order_coupon_no", "where id = #{id,jdbcType=BIGINT}" }) @@ -100,6 +101,7 @@ public interface BsOrderCouponNoMapper extends BsOrderCouponNoMapperExt { @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @Result(column="exception_status", property="exceptionStatus", jdbcType=JdbcType.BIT), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="deliver_time", property="deliverTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="finish_time", property="finishTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), @@ -128,6 +130,7 @@ public interface BsOrderCouponNoMapper extends BsOrderCouponNoMapperExt { "`status` = #{status,jdbcType=INTEGER},", "exception_status = #{exceptionStatus,jdbcType=BIT},", "create_time = #{createTime,jdbcType=TIMESTAMP},", + "deliver_time = #{deliverTime,jdbcType=TIMESTAMP},", "finish_time = #{finishTime,jdbcType=TIMESTAMP},", "update_time = #{updateTime,jdbcType=TIMESTAMP},", "ext_1 = #{ext1,jdbcType=VARCHAR},", diff --git a/service/src/main/java/com/hfkj/dao/BsOrderCouponNoSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsOrderCouponNoSqlProvider.java index e9bf8f7..4010770 100644 --- a/service/src/main/java/com/hfkj/dao/BsOrderCouponNoSqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/BsOrderCouponNoSqlProvider.java @@ -64,6 +64,10 @@ public class BsOrderCouponNoSqlProvider { sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); } + if (record.getDeliverTime() != null) { + sql.VALUES("deliver_time", "#{deliverTime,jdbcType=TIMESTAMP}"); + } + if (record.getFinishTime() != null) { sql.VALUES("finish_time", "#{finishTime,jdbcType=TIMESTAMP}"); } @@ -103,6 +107,7 @@ public class BsOrderCouponNoSqlProvider { sql.SELECT("`status`"); sql.SELECT("exception_status"); sql.SELECT("create_time"); + sql.SELECT("deliver_time"); sql.SELECT("finish_time"); sql.SELECT("update_time"); sql.SELECT("ext_1"); @@ -165,6 +170,10 @@ public class BsOrderCouponNoSqlProvider { sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); } + if (record.getDeliverTime() != null) { + sql.SET("deliver_time = #{record.deliverTime,jdbcType=TIMESTAMP}"); + } + if (record.getFinishTime() != null) { sql.SET("finish_time = #{record.finishTime,jdbcType=TIMESTAMP}"); } @@ -203,6 +212,7 @@ public class BsOrderCouponNoSqlProvider { sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); sql.SET("exception_status = #{record.exceptionStatus,jdbcType=BIT}"); sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + sql.SET("deliver_time = #{record.deliverTime,jdbcType=TIMESTAMP}"); sql.SET("finish_time = #{record.finishTime,jdbcType=TIMESTAMP}"); sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); @@ -254,6 +264,10 @@ public class BsOrderCouponNoSqlProvider { sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); } + if (record.getDeliverTime() != null) { + sql.SET("deliver_time = #{deliverTime,jdbcType=TIMESTAMP}"); + } + if (record.getFinishTime() != null) { sql.SET("finish_time = #{finishTime,jdbcType=TIMESTAMP}"); } diff --git a/service/src/main/java/com/hfkj/entity/BsOrderCouponNo.java b/service/src/main/java/com/hfkj/entity/BsOrderCouponNo.java index 3bc8b08..f60e0f8 100644 --- a/service/src/main/java/com/hfkj/entity/BsOrderCouponNo.java +++ b/service/src/main/java/com/hfkj/entity/BsOrderCouponNo.java @@ -63,6 +63,11 @@ public class BsOrderCouponNo implements Serializable { */ private Date createTime; + /** + * 派发时间 + */ + private Date deliverTime; + /** * 完成时间 */ @@ -161,6 +166,14 @@ public class BsOrderCouponNo implements Serializable { this.createTime = createTime; } + public Date getDeliverTime() { + return deliverTime; + } + + public void setDeliverTime(Date deliverTime) { + this.deliverTime = deliverTime; + } + public Date getFinishTime() { return finishTime; } @@ -223,6 +236,7 @@ public class BsOrderCouponNo implements Serializable { && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) && (this.getExceptionStatus() == null ? other.getExceptionStatus() == null : this.getExceptionStatus().equals(other.getExceptionStatus())) && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (this.getDeliverTime() == null ? other.getDeliverTime() == null : this.getDeliverTime().equals(other.getDeliverTime())) && (this.getFinishTime() == null ? other.getFinishTime() == null : this.getFinishTime().equals(other.getFinishTime())) && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) && (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) @@ -244,6 +258,7 @@ public class BsOrderCouponNo implements Serializable { result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); result = prime * result + ((getExceptionStatus() == null) ? 0 : getExceptionStatus().hashCode()); result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + result = prime * result + ((getDeliverTime() == null) ? 0 : getDeliverTime().hashCode()); result = prime * result + ((getFinishTime() == null) ? 0 : getFinishTime().hashCode()); result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); @@ -268,6 +283,7 @@ public class BsOrderCouponNo implements Serializable { sb.append(", status=").append(status); sb.append(", exceptionStatus=").append(exceptionStatus); sb.append(", createTime=").append(createTime); + sb.append(", deliverTime=").append(deliverTime); sb.append(", finishTime=").append(finishTime); sb.append(", updateTime=").append(updateTime); sb.append(", ext1=").append(ext1); diff --git a/service/src/main/java/com/hfkj/entity/BsOrderCouponNoExample.java b/service/src/main/java/com/hfkj/entity/BsOrderCouponNoExample.java index 2d7a6af..159e7fe 100644 --- a/service/src/main/java/com/hfkj/entity/BsOrderCouponNoExample.java +++ b/service/src/main/java/com/hfkj/entity/BsOrderCouponNoExample.java @@ -755,6 +755,66 @@ public class BsOrderCouponNoExample { return (Criteria) this; } + public Criteria andDeliverTimeIsNull() { + addCriterion("deliver_time is null"); + return (Criteria) this; + } + + public Criteria andDeliverTimeIsNotNull() { + addCriterion("deliver_time is not null"); + return (Criteria) this; + } + + public Criteria andDeliverTimeEqualTo(Date value) { + addCriterion("deliver_time =", value, "deliverTime"); + return (Criteria) this; + } + + public Criteria andDeliverTimeNotEqualTo(Date value) { + addCriterion("deliver_time <>", value, "deliverTime"); + return (Criteria) this; + } + + public Criteria andDeliverTimeGreaterThan(Date value) { + addCriterion("deliver_time >", value, "deliverTime"); + return (Criteria) this; + } + + public Criteria andDeliverTimeGreaterThanOrEqualTo(Date value) { + addCriterion("deliver_time >=", value, "deliverTime"); + return (Criteria) this; + } + + public Criteria andDeliverTimeLessThan(Date value) { + addCriterion("deliver_time <", value, "deliverTime"); + return (Criteria) this; + } + + public Criteria andDeliverTimeLessThanOrEqualTo(Date value) { + addCriterion("deliver_time <=", value, "deliverTime"); + return (Criteria) this; + } + + public Criteria andDeliverTimeIn(List values) { + addCriterion("deliver_time in", values, "deliverTime"); + return (Criteria) this; + } + + public Criteria andDeliverTimeNotIn(List values) { + addCriterion("deliver_time not in", values, "deliverTime"); + return (Criteria) this; + } + + public Criteria andDeliverTimeBetween(Date value1, Date value2) { + addCriterion("deliver_time between", value1, value2, "deliverTime"); + return (Criteria) this; + } + + public Criteria andDeliverTimeNotBetween(Date value1, Date value2) { + addCriterion("deliver_time not between", value1, value2, "deliverTime"); + return (Criteria) this; + } + public Criteria andFinishTimeIsNull() { addCriterion("finish_time is null"); return (Criteria) this; diff --git a/service/src/main/java/com/hfkj/model/order/OrderCouponModel.java b/service/src/main/java/com/hfkj/model/order/OrderCouponModel.java new file mode 100644 index 0000000..ea80447 --- /dev/null +++ b/service/src/main/java/com/hfkj/model/order/OrderCouponModel.java @@ -0,0 +1,43 @@ +package com.hfkj.model.order; + +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 卡券订单模型 + * @className: BsOrderCouponModel + * @author: HuRui + * @date: 2024/5/13 + **/ +@Data +public class OrderCouponModel { + + public String orderNo; + public String childOrderNo; + public String userPhone; + public String goodsKey; + public String goodsName; + public String goodsSpecsName; + public String goodsPrice; + public String goodsCount; + public BigDecimal totalPrice; + public BigDecimal totalDeductionPrice; + public BigDecimal couponDiscountPrice; + public BigDecimal integralDiscountPrice; + public BigDecimal payRealPrice; + public Integer payChannel; + public Integer payType; + public String paySerialNo; + public Integer tradeStatus; + public Date createTime; + public Date payTime; + public String channelOrderNo; + public String couNo; + public Integer couStatus; + public Date expireTime; + public String exceptionStatus; + public Date finishTime; + +} diff --git a/service/src/main/java/com/hfkj/service/coupon/BsOrderCouponService.java b/service/src/main/java/com/hfkj/service/coupon/BsOrderCouponService.java index 777fd91..4c90d55 100644 --- a/service/src/main/java/com/hfkj/service/coupon/BsOrderCouponService.java +++ b/service/src/main/java/com/hfkj/service/coupon/BsOrderCouponService.java @@ -1,6 +1,7 @@ package com.hfkj.service.coupon; import com.hfkj.entity.BsOrderCoupon; +import com.hfkj.model.order.OrderCouponModel; import java.util.List; import java.util.Map; @@ -26,4 +27,11 @@ public interface BsOrderCouponService { */ List getListByChildOrderNo(String orderChildOrderNo); + /** + * 查询卡券订单 + * @param param + * @return + */ + List getOrderList(Map param); + } diff --git a/service/src/main/java/com/hfkj/service/coupon/impl/BsOrderCouponServiceImpl.java b/service/src/main/java/com/hfkj/service/coupon/impl/BsOrderCouponServiceImpl.java index 7f740af..5e8c500 100644 --- a/service/src/main/java/com/hfkj/service/coupon/impl/BsOrderCouponServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/coupon/impl/BsOrderCouponServiceImpl.java @@ -1,9 +1,12 @@ package com.hfkj.service.coupon.impl; +import com.hfkj.common.utils.DateUtil; import com.hfkj.dao.BsOrderCouponMapper; import com.hfkj.entity.BsOrderCoupon; import com.hfkj.entity.BsOrderCouponExample; +import com.hfkj.model.order.OrderCouponModel; import com.hfkj.service.coupon.BsOrderCouponService; +import org.apache.commons.collections4.MapUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -40,5 +43,16 @@ public class BsOrderCouponServiceImpl implements BsOrderCouponService { return orderCouponMapper.selectByExample(example); } + @Override + public List getOrderList(Map param) { + 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)); + } + return orderCouponMapper.getOrderList(param); + } + }