From b51472315e7293e2aac430cddf2265b2297e216a Mon Sep 17 00:00:00 2001 From: = <=> Date: Sun, 16 May 2021 23:22:27 +0800 Subject: [PATCH] =?UTF-8?q?'=E4=BF=AE=E5=A4=8D=E5=B7=B2=E7=9F=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/hai/common/utils/MD5Util.java | 2 +- .../main/java/com/hai/dao/HighCouponAgentRelMapperExt.java | 2 +- .../com/hai/service/impl/HighCouponCodeServiceImpl.java | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/hai-service/src/main/java/com/hai/common/utils/MD5Util.java b/hai-service/src/main/java/com/hai/common/utils/MD5Util.java index 5f78801f..1ca9e865 100644 --- a/hai-service/src/main/java/com/hai/common/utils/MD5Util.java +++ b/hai-service/src/main/java/com/hai/common/utils/MD5Util.java @@ -44,7 +44,7 @@ public class MD5Util { }*/ public static void main(String[] args) throws Exception { - String str = "add123"; + String str = "123456"; System.out.println(MD5Util.encode(str.getBytes("UTF-8"))); //String ee = "29AD0E3FD3DB681FB9F8091C756313F7"; } diff --git a/hai-service/src/main/java/com/hai/dao/HighCouponAgentRelMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighCouponAgentRelMapperExt.java index eb5fa565..818a82f5 100644 --- a/hai-service/src/main/java/com/hai/dao/HighCouponAgentRelMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighCouponAgentRelMapperExt.java @@ -25,7 +25,7 @@ public interface HighCouponAgentRelMapperExt { AgentSalesModel getAgentSales(@Param("agentId") Long agentId, @Param("consumeTimeS")String consumeTimeS, @Param("consumeTimeE")String consumeTimeE); @Select(" select a.* from high_coupon_agent_code a,high_coupon_code b,high_coupon_agent_rel c " + - " where c.id = a.coupon_agent_id and c.agent_id = 8 and a.status = 3 and a.coupon_code_id = b.id " + + " where c.id = a.coupon_agent_id and c.agent_id = #{agentId} and a.status = 3 and a.coupon_code_id = b.id " + " and b.consume_time >= #{consumeTimeS} and b.consume_time <= #{consumeTimeE} ORDER BY b.consume_time desc") @Results({ @Result(column="id", property="id", jdbcType= JdbcType.BIGINT, id=true), diff --git a/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java index 1a7d896a..860b4254 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java @@ -161,13 +161,14 @@ public class HighCouponCodeServiceImpl implements HighCouponCodeService { List list = highUserCouponService.getUserCouponList(map); if (list.size() > 0) { for (HighUserCoupon userCoupon : list) { + userCoupon.setConsumeTime(useTime); + userCoupon.setStatus(2); // 状态 0:已过期 1:未使用 2:已使用 + highUserCouponService.updateUserCoupon(userCoupon); + HighChildOrderExample example = new HighChildOrderExample(); example.createCriteria().andMemIdEqualTo(userCoupon.getUserId()).andGoodsTypeEqualTo(1).andGoodsIdEqualTo(userCoupon.getCouponId()).andChildOrdeStatusEqualTo(2); List childOrderList = highChildOrderMapper.selectByExample(example); if (childOrderList.size() > 0) { - userCoupon.setConsumeTime(useTime); - userCoupon.setStatus(2); // 状态 0:已过期 1:未使用 2:已使用 - highUserCouponService.updateUserCoupon(userCoupon); highOrderService.childOrderComplete(childOrderList.get(0).getId()); } /*HighChildOrder order = highOrderService.getChildOrderByUserGoods(userCoupon.getUserId(), 1, userCoupon.getCouponId());