From af19b2fec1c2a53de3eb47cdef0b80dd3d839ec7 Mon Sep 17 00:00:00 2001 From: 199901012 Date: Thu, 22 Apr 2021 00:11:07 +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 --- .../com/hai/service/impl/HighCouponAgentServiceImpl.java | 1 + .../com/hai/service/impl/HighCouponCodeServiceImpl.java | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java index bb7c79f0..6190fa2e 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java @@ -48,6 +48,7 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService { Map map = new HashMap<>(); map.put("couponId", highCouponAgentRel.getCouponId()); map.put("status", 1); + map.put("salesEndTimeS", new Date().getTime()); map.put("isAssignAgent", false); List codeList = highCouponCodeService.getCouponCodeList(map); 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 ab7ca097..0b994eea 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 @@ -183,7 +183,7 @@ public class HighCouponCodeServiceImpl implements HighCouponCodeService { @Override public Integer getStockCountByCoupon(Long couponId) { HighCouponCodeExample example = new HighCouponCodeExample(); - example.createCriteria().andCouponIdEqualTo(couponId).andStatusEqualTo(1).andSalesEndTimeGreaterThan(new Date()); + example.createCriteria().andCouponIdEqualTo(couponId).andStatusEqualTo(1).andSalesEndTimeGreaterThan(new Date()).andIsAssignAgentEqualTo(false); return highCouponCodeMapper.selectByExample(example).size(); } @@ -211,6 +211,10 @@ public class HighCouponCodeServiceImpl implements HighCouponCodeService { criteria.andSalesCodeLike("%" + MapUtils.getString(map, "salesCode") + "%"); } + if (MapUtils.getLong(map, "salesEndTimeS") != null) { + criteria.andSalesEndTimeGreaterThan(new Date(MapUtils.getLong(map, "salesEndTimeS"))); + } + if (MapUtils.getBoolean(map, "isAssignAgent") != null) { criteria.andIsAssignAgentEqualTo(MapUtils.getBoolean(map, "isAssignAgent")); }