优化用户可使用的优惠券列表

dev-discount
胡锐 3 years ago
parent 28768a62fd
commit f581118ec4
  1. 10
      hai-cweb/src/main/java/com/cweb/controller/HighUserDiscountController.java
  2. 4
      hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java

@ -27,10 +27,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -152,11 +149,14 @@ public class HighUserDiscountController {
for (HighDiscountCouponRel highDiscountCouponRel : discountCouponRelList) {
List<HighDiscountUserRel> collect = userRels.stream().filter(o -> o.getDiscountId().equals(highDiscountCouponRel.getDiscountId())).collect(Collectors.toList());
if (collect != null && collect.size() > 0) {
list.add(collect.get(0));
for (HighDiscountUserRel discountUser : collect) {
list.add(discountUser);
}
}
}
}
}
list.sort(Comparator.comparing(o -> o.getUseEndTime()));
return ResponseMsgUtil.success(list);
} catch (Exception e) {

@ -269,12 +269,12 @@ public class HighOrderSchedule {
}
}
@Scheduled(cron="1 * * * * * ?") //每1分钟执行一次
/* @Scheduled(cron="1 * * * * * ?") //每1分钟执行一次
public void unionStagingPayOrder() {
List<Map<String, Object>> mapList = highOrderService.getFinishGasOrder();
if (mapList != null && mapList.size() > 0) {
}
}
}*/
}

Loading…
Cancel
Save