提交代码

master
胡锐 3 months ago
parent 5f73901b7d
commit 48431670fc
  1. 21
      order/src/main/java/com/order/controller/business/OrderCouponController.java
  2. 1
      service/src/main/java/com/hfkj/dao/BsOrderCouponMapperExt.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<String,Object> 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<String,Object> 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<OrderCouponModel> orderList = orderCouponService.getOrderList(param);
return ResponseMsgUtil.success(orderList);
} catch (Exception e) {

@ -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" +
" <if test='param.merId != null'> and b.mer_id = #{param.merId} </if>" +
" <if test='param.orderNo != null'> and b.order_no like concat('%',#{param.orderNo},'%') </if>" +
" <if test='param.orderChildNo != null'> and b.child_order_no = #{param.orderChildNo} </if>" +
" <if test='param.userPhone != null'> and b.user_phone like concat('%',#{param.userPhone},'%') </if>" +

Loading…
Cancel
Save