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