提交代码

dev-discount
胡锐 2 years ago
parent 9072216f24
commit 19c887b939
  1. 1
      hai-cweb/src/main/java/com/cweb/controller/HighCouponController.java
  2. 11
      hai-service/src/main/java/com/hai/dao/HighCouponMapperExt.java
  3. 44
      hai-service/src/main/java/com/hai/model/HighCouponModel.java
  4. 7
      hai-service/src/main/java/com/hai/service/HighCouponService.java
  5. 5
      hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java

@ -122,6 +122,7 @@ public class HighCouponController {
HighCoupon coupon = highCouponService.getCouponById(couponId); HighCoupon coupon = highCouponService.getCouponById(couponId);
if (coupon != null & userId != null) { if (coupon != null & userId != null) {
coupon.setMonthlySales(highCouponService.getMonthlySales(couponId));
coupon.setNumberUpperLimitStatus(highCouponService.userBuyLimitNumber(userId, coupon.getId())); coupon.setNumberUpperLimitStatus(highCouponService.userBuyLimitNumber(userId, coupon.getId()));
} }
return ResponseMsgUtil.success(coupon); return ResponseMsgUtil.success(coupon);

@ -1,7 +1,18 @@
package com.hai.dao; package com.hai.dao;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
/** /**
* mapper扩展类 * mapper扩展类
*/ */
public interface HighCouponMapperExt { public interface HighCouponMapperExt {
/**
* 查询月销量
* @param couponId
* @return
*/
@Select({"SELECT count(1) FROM `high_child_order` " +
"where goods_type = 1 and goods_id = #{couponId} and child_order_status in (2,3,6,7) and DATE_FORMAT(pay_time,'%Y%m')=DATE_FORMAT(CURDATE(),'%Y%m');"})
int getMonthlySales(@Param("couponId") Long couponId);
} }

@ -2,6 +2,7 @@ package com.hai.model;
import com.hai.entity.HighCoupon; import com.hai.entity.HighCoupon;
import com.hai.entity.HighCouponHandsel; import com.hai.entity.HighCouponHandsel;
import lombok.Data;
import java.util.List; import java.util.List;
@ -10,6 +11,7 @@ import java.util.List;
* @Description: 卡卷模型 * @Description: 卡卷模型
* @Date: 2021/3/11 22:27 * @Date: 2021/3/11 22:27
*/ */
@Data
public class HighCouponModel { public class HighCouponModel {
// 商户名称 // 商户名称
@ -18,6 +20,8 @@ public class HighCouponModel {
// 库存数量 // 库存数量
private Integer stockCount; private Integer stockCount;
private Integer monthlySales;
// 赠送卡卷id // 赠送卡卷id
private List<Long> handselCouponId; private List<Long> handselCouponId;
@ -26,44 +30,4 @@ public class HighCouponModel {
// 赠送卡卷 // 赠送卡卷
private List<HighCouponHandselModel> handselCouponList; private List<HighCouponHandselModel> handselCouponList;
public Boolean getNumberUpperLimitStatus() {
return numberUpperLimitStatus;
}
public void setNumberUpperLimitStatus(Boolean numberUpperLimitStatus) {
this.numberUpperLimitStatus = numberUpperLimitStatus;
}
public String getMerchantName() {
return merchantName;
}
public void setMerchantName(String merchantName) {
this.merchantName = merchantName;
}
public Integer getStockCount() {
return stockCount;
}
public void setStockCount(Integer stockCount) {
this.stockCount = stockCount;
}
public List<Long> getHandselCouponId() {
return handselCouponId;
}
public void setHandselCouponId(List<Long> handselCouponId) {
this.handselCouponId = handselCouponId;
}
public List<HighCouponHandselModel> getHandselCouponList() {
return handselCouponList;
}
public void setHandselCouponList(List<HighCouponHandselModel> handselCouponList) {
this.handselCouponList = handselCouponList;
}
} }

@ -156,4 +156,11 @@ public interface HighCouponService {
* @param childOrderNo * @param childOrderNo
*/ */
HighCouponCode assignOrderStock(Long couponId, String childOrderNo) throws InterruptedException; HighCouponCode assignOrderStock(Long couponId, String childOrderNo) throws InterruptedException;
/**
* 月销量
* @param couponId
* @return
*/
int getMonthlySales(Long couponId);
} }

@ -592,4 +592,9 @@ public class HighCouponServiceImpl implements HighCouponService {
} }
return null; return null;
} }
@Override
public int getMonthlySales(Long couponId) {
return highCouponMapper.getMonthlySales(couponId);
}
} }

Loading…
Cancel
Save