Merge remote-tracking branch 'origin/2.0-dev' into 2.0-dev

dev-discount
袁野 2 years ago
commit 785b70b53d
  1. 7
      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. 2
      hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java
  5. 7
      hai-service/src/main/java/com/hai/service/HighCouponService.java
  6. 5
      hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java
  7. 2
      hai-user/src/main/java/com/web/controller/LoginController.java

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

@ -1,7 +1,18 @@
package com.hai.dao;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
/**
* mapper扩展类
*/
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.HighCouponHandsel;
import lombok.Data;
import java.util.List;
@ -10,6 +11,7 @@ import java.util.List;
* @Description: 卡卷模型
* @Date: 2021/3/11 22:27
*/
@Data
public class HighCouponModel {
// 商户名称
@ -18,6 +20,8 @@ public class HighCouponModel {
// 库存数量
private Integer stockCount;
private Integer monthlySales;
// 赠送卡卷id
private List<Long> handselCouponId;
@ -26,44 +30,4 @@ public class HighCouponModel {
// 赠送卡卷
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;
}
}

@ -154,7 +154,7 @@ public class OrderServiceImpl implements OrderService {
child.setMemId(order.getMemId());
child.setMemName(order.getMemName());
child.setMemPhone(order.getMemPhone());
child.setOrderNo(order.getOrderNo());
// 购买卡券
if (child.getGoodsType().equals(OrderChildGoodsType.TYPE1.getNumber())) {

@ -156,4 +156,11 @@ public interface HighCouponService {
* @param childOrderNo
*/
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;
}
@Override
public int getMonthlySales(Long couponId) {
return highCouponMapper.getMonthlySales(couponId);
}
}

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save