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());