提交代码

dev-discount
胡锐 3 years ago
parent 870ff68323
commit 5cdc3a52cf
  1. 4
      hai-service/src/main/java/com/hai/dao/HighCouponAgentRelMapperExt.java
  2. 5
      hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java

@ -69,14 +69,14 @@ public interface HighCouponAgentRelMapperExt {
" b.sales_price price" + " b.sales_price price" +
" from high_coupon_agent_code a " + " from high_coupon_agent_code a " +
" LEFT JOIN high_coupon_agent_rel b on b.id = a.coupon_agent_id" + " LEFT JOIN high_coupon_agent_rel b on b.id = a.coupon_agent_id" +
" where b.id = 22 and a.`status` = 2) a," + " where b.id = #{couponAgentRelId} and a.`status` = 2) a," +
" (select " + " (select " +
" b.id," + " b.id," +
" count(1) usedNum," + " count(1) usedNum," +
" b.sales_price price" + " b.sales_price price" +
" from high_coupon_agent_code a" + " from high_coupon_agent_code a" +
" LEFT JOIN high_coupon_agent_rel b on b.id = a.coupon_agent_id" + " LEFT JOIN high_coupon_agent_rel b on b.id = a.coupon_agent_id" +
" where b.id = 22 and a.`status` = 3) b" + " where b.id = #{couponAgentRelId} and a.`status` = 3) b" +
" where a.id = b.id ") " where a.id = b.id ")
Map<String, Object> getUseNum(@Param("couponAgentRelId") Long couponAgentRelId); Map<String, Object> getUseNum(@Param("couponAgentRelId") Long couponAgentRelId);
} }

@ -427,6 +427,11 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "暂时无法使用兑换码"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "暂时无法使用兑换码");
} }
HighCouponCode couponCode = codeList.get(0); HighCouponCode couponCode = codeList.get(0);
couponCode.setIsAssignAgent(true);
couponCode.setAgentId(couponCode.getAgentId());
couponCode.setReceiveTime(new Date());
couponCode.setStatus(2);
highCouponCodeService.updateCouponCode(couponCode);
convertCode.setCouponCodeId(couponCode.getId()); convertCode.setCouponCodeId(couponCode.getId());
convertCode.setCouponCode(couponCode.getSalesCode()); convertCode.setCouponCode(couponCode.getSalesCode());

Loading…
Cancel
Save