Преглед изворни кода

Merge branch 'dev' into 'mp-server-test'

优惠券详情

See merge request quanshu/mp-server!413
zhong chunping пре 3 година
родитељ
комит
0ec831af04

+ 17 - 0
mp-admin/src/main/java/com/qs/mp/web/controller/api/user/UserMineController.java

@@ -35,6 +35,7 @@ import io.swagger.annotations.ApiResponses;
 import lombok.AllArgsConstructor;
 import ma.glasnost.orika.MapperFacade;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -108,6 +109,22 @@ public class UserMineController extends BaseApiController {
     return getDataTable(userCouponVOList);
   }
 
+  /**
+   * 优惠券详情
+   */
+  @PostMapping("/coupon/detail")
+  @ApiOperation(value = "优惠券详情", notes = "获取我的优惠券详情")
+  public AjaxResult getCouponInfo(@RequestBody UserCoupon param) {
+    Long userId = SecurityUtils.getLoginUser().getUserId();
+    List<UserCouponVO> userCouponVOList = userCouponService.listUserCouponVO(new QueryWrapper<UserCoupon>()
+        .eq("t1.id", param.getId())
+        .eq("t1.user_id", userId));
+    if (!CollectionUtils.isEmpty(userCouponVOList)) {
+      return AjaxResult.success(userCouponVOList.get(0));
+    }
+    return AjaxResult.error("优惠券不存在");
+  }
+
   /**
    * 我的盲豆
    */

+ 1 - 1
mp-service/src/main/resources/mapper/channel/ChannelMapper.xml

@@ -58,7 +58,7 @@
 
      <!-- 查询经销商列表信息 -->
     <select id="selectSaleSiteList" resultType="com.qs.mp.channel.domain.vo.ChannelVO">
-      select t1.* , t2.offLineQtyCnt, t2.offLineSaleCnt, t4.saleQty-t2.offLineSaleCnt as onLineSaleCnt, t3.userCnt
+      select t1.channel_id as channelId, t1.channel_no, t1.name, t1.parent_id, t1.level, t1.site_type, t1.site_name, t1.comm_rate as commRate, t1.province, t1.province_id, t1.city, t1.city_id, t1.area, t1.area_id, t1.address, t1.contact, t1.mobile, t1.user_id, t1.certify_status, t1.verify_status, t1.status, t1.created_time, t1.updated_time , t2.offLineQtyCnt, t2.offLineSaleCnt, t4.saleQty-t2.offLineSaleCnt as onLineSaleCnt, t3.userCnt
       from mp_channel t1
              left join (
         select channel_id, SUM(  b.pkg_unit - b.sale_qty ) AS offLineQtyCnt,