From 43e8e93525e6c980c8c0aa209c4e56ffef221206 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Fri, 2 Aug 2024 10:04:51 +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 | 21 +++++++++++++++++-- .../com/hfkj/dao/BsOrderCouponMapperExt.java | 1 + 2 files changed, 20 insertions(+), 2 deletions(-) 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 bde405a..ae4ed89 100644 --- a/order/src/main/java/com/order/controller/business/OrderCouponController.java +++ b/order/src/main/java/com/order/controller/business/OrderCouponController.java @@ -5,12 +5,16 @@ import com.github.pagehelper.PageInfo; import com.hfkj.common.exception.ErrorCode; import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.SysCode; +import com.hfkj.common.security.SessionObject; +import com.hfkj.common.security.UserCenter; import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.entity.BsOrderCoupon; import com.hfkj.model.ResponseData; +import com.hfkj.model.SecUserSessionObject; import com.hfkj.model.order.OrderCouponModel; import com.hfkj.service.coupon.BsOrderCouponNoService; import com.hfkj.service.coupon.BsOrderCouponService; +import com.hfkj.sysenum.SecUserObjectTypeEnum; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -41,6 +45,8 @@ public class OrderCouponController { private BsOrderCouponService orderCouponService; @Resource private BsOrderCouponNoService orderCouponNoService; + @Resource + private UserCenter userCenter; @RequestMapping(value="/queryCouNo",method = RequestMethod.GET) @ResponseBody @@ -98,6 +104,12 @@ public class OrderCouponController { @RequestParam(value = "pageSize" , required = true) Integer pageSize) { try { Map param = new HashMap<>(); + SecUserSessionObject userSessionObject = userCenter.getSessionModel(SecUserSessionObject.class); + if (SecUserObjectTypeEnum.type1.getCode() == userSessionObject.getAccount().getObjectType()) { + + } else if (SecUserObjectTypeEnum.type2.getCode() == userSessionObject.getAccount().getObjectType()) { + param.put("merId", userSessionObject.getAccount().getObjectId()); + } param.put("orderNo", orderNo); param.put("userPhone", userPhone); param.put("tradeStatus", tradeStatus); @@ -120,7 +132,7 @@ public class OrderCouponController { @RequestMapping(value="/export",method = RequestMethod.GET) @ResponseBody - @ApiOperation(value = "查询交易订单列表") + @ApiOperation(value = "导出订单") public ResponseData export(@RequestParam(value = "orderNo" , required = false) String orderNo, @RequestParam(value = "userPhone" , required = false) String userPhone, @RequestParam(value = "tradeStatus" , required = false) Integer tradeStatus, @@ -133,6 +145,12 @@ public class OrderCouponController { @RequestParam(value = "createTimeE" , required = false) Long createTimeE) { try { Map param = new HashMap<>(); + SecUserSessionObject userSessionObject = userCenter.getSessionModel(SecUserSessionObject.class); + if (SecUserObjectTypeEnum.type1.getCode() == userSessionObject.getAccount().getObjectType()) { + + } else if (SecUserObjectTypeEnum.type2.getCode() == userSessionObject.getAccount().getObjectType()) { + param.put("merId", userSessionObject.getAccount().getObjectId()); + } param.put("orderNo", orderNo); param.put("userPhone", userPhone); param.put("tradeStatus", tradeStatus); @@ -145,7 +163,6 @@ public class OrderCouponController { param.put("createTimeE", createTimeE); List orderList = orderCouponService.getOrderList(param); - return ResponseMsgUtil.success(orderList); } catch (Exception e) { diff --git a/service/src/main/java/com/hfkj/dao/BsOrderCouponMapperExt.java b/service/src/main/java/com/hfkj/dao/BsOrderCouponMapperExt.java index 7054385..f7b5c3e 100644 --- a/service/src/main/java/com/hfkj/dao/BsOrderCouponMapperExt.java +++ b/service/src/main/java/com/hfkj/dao/BsOrderCouponMapperExt.java @@ -43,6 +43,7 @@ public interface BsOrderCouponMapperExt { " bs_order_coupon_no a" + " LEFT JOIN bs_order_coupon b on a.coupon_order_id = b.id" + " WHERE 1 = 1" + + " and b.mer_id = #{param.merId} " + " and b.order_no like concat('%',#{param.orderNo},'%') " + " and b.child_order_no = #{param.orderChildNo} " + " and b.user_phone like concat('%',#{param.userPhone},'%') " +