| | |
| | | for(Member member : memberList){ |
| | | for (int i = 0; i < Constants.formatLongNum(param.getNum()); i++) { |
| | | //挨个送 |
| | | addList.add(initMemberCouponByParam(coupon,member,loginUserInfo,now)); |
| | | addList.add(MemberCoupon.couponToBean(coupon,member,now,Constants.TWO,loginUserInfo)); |
| | | } |
| | | } |
| | | index++; |
| | |
| | | return "操作成功,成功人员数量:"+memberList.size()+",共发放优惠券数量:"+addList.size(); |
| | | |
| | | } |
| | | /* |
| | | |
| | | private MemberCoupon initMemberCouponByParam(Coupon coupon, Member member, LoginUserInfo loginUserInfo ,Date now) { |
| | | MemberCoupon insert = new MemberCoupon(); |
| | |
| | | insert.setCouponId(coupon.getId()); |
| | | return insert; |
| | | } |
| | | */ |
| | | |
| | | private Coupon getCouponFromListById(Integer id, List<Coupon> couponList) { |
| | | for(Coupon c : couponList){ |
| | |
| | | .apply(Objects.nonNull(status)&&Constants.equalsInteger(status,Constants.TWO),"m.STATUS = 0 and m.END_DATE < now() " ) |
| | | .eq("TYPE",couponType) |
| | | .apply(!Objects.isNull(price)," m.LIMIT_PRICE >= "+price+" ") |
| | | .apply(" now() between m.START_DATE and m.END_DATE ") |
| | | // .apply(" now() between m.START_DATE and m.END_DATE ") |
| | | .orderByDesc(" m.PRICE ") |
| | | ); |
| | | return page; |
| | |
| | | //查询商品列表 |
| | | List<Goods> goodsList = goodsMapper.selectJoinList(Goods.class, |
| | | new MPJLambdaWrapper<Goods>() |
| | | .selectAll(Goods.class) |
| | | .selectAs(GoodsSku::getPrice,Goods::getSkuPrice) |
| | | .selectAs(GoodsSku::getId,Goods::getSkuId) |
| | | .leftJoin(GoodsSku.class,GoodsSku::getGoodsId,Goods::getId) |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 计算当前已选择优惠券每个商品占比金额 |
| | | * @param coupon 优惠券信息 |
| | |
| | | response.setUseCoupon(idList.contains(Constants.equalsInteger(vaildType,Constants.ZERO)?response.getId().toString():response.getCategoryId().toString())?true:false); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | // public Set<Integer> isVaildUse(List<String> idList,List<OrderGoodsCalculateResponse> goodsList,Integer vaildType){ |
| | | // List<OrderGoodsCalculateResponse> resultList = new ArrayList<>(); |
| | | // for (String id:idList) { |