Merge remote-tracking branch 'origin/div' into div
| | |
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | | import com.yeshi.fanli.util.annotation.integral.IntegralGetFrequencyLimit;
|
| | | import com.yeshi.fanli.util.annotation.RequestSerializableByKey;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
| | | * 邀请嘛
|
| | | * @param out
|
| | | */
|
| | | @IntegralGetFrequencyLimit(key = "'activationInvite-'+#uid+'-'+#inviteCode", time = 30)
|
| | | @RequestSerializableByKey(key ="'activationInvite-'+#uid")
|
| | | @RequestMapping(value = "activationInvite")
|
| | | public void activationInvite(AcceptData acceptData, String callback, Long uid, String inviteCode, PrintWriter out) {
|
| | | try {
|
| | |
| | | * 邀请嘛
|
| | | * @param out
|
| | | */
|
| | | @RequestSerializableByKey(key ="'activationInviteWX-'+#uid")
|
| | | @RequestMapping(value = "activationInviteWX")
|
| | | @IntegralGetFrequencyLimit(key = "'activationInviteWX-'+#uid+'-'+#code", time = 30)
|
| | | public void activationInviteWX(AcceptData acceptData, Long uid, String code, PrintWriter out) {
|
| | | try {
|
| | | userInfoExtraService.activationInviteWX(uid, code);
|
| | |
| | | public void updateRecord(AcceptData acceptData, String shareId, String type, PrintWriter out) {
|
| | | if (StringUtil.isNullOrEmpty(shareId)) {
|
| | | out.print(JsonUtil.loadFalseResult("参数不正确"));
|
| | | return;
|
| | | }
|
| | |
|
| | | // 更新分享生效
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | int count = 5;
|
| | | if ("android".equalsIgnoreCase(acceptData.getPlatform())) {
|
| | | count = Integer.MAX_VALUE;
|
| | | }
|
| | | int count = Integer.MAX_VALUE;
|
| | |
|
| | | List<IntegralTaskRecord> list = integralTaskRecordService.listNotReceived(count, uid);
|
| | | if (list == null) {
|
| | |
| | | return;
|
| | | }
|
| | | Integer goldCoin = integralTaskRecordService.receiveGoldCoin(uid, idList);
|
| | | Set<Long> gidList = gson.fromJson(gids, new TypeToken<HashSet<Long>>() {
|
| | | }.getType());
|
| | | List<IntegralTaskRecord> list = null;
|
| | | if (gidList != null && gidList.size() > 0) {
|
| | | list = integralTaskRecordService.listNotReceivedExcludeId(5 - gidList.size(), uid, gidList);
|
| | | } else {
|
| | | list = integralTaskRecordService.listNotReceivedExcludeId(5, uid, null);
|
| | | }
|
| | |
|
| | | if (list == null) {
|
| | | list = new ArrayList<IntegralTaskRecord>();
|
| | | }
|
| | | GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
|
| | | Gson gson2 = gsonBuilder.create();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("goldCoin", goldCoin);
|
| | | data.put("list", gson2.toJson(list));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (IntegralTaskRecordException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getMsg()));
|
| | |
| | | * 查询近3天发布记录 |
| | | * @return |
| | | */ |
| | | List<CodePublishRecord> listValid(@Param("start") long start, @Param("count") int count); |
| | | List<CodePublishRecord> listValid(@Param("start") long start, @Param("count") int count, @Param("validTime")long validTime); |
| | | |
| | | |
| | | long countValid(); |
| | | long countValid(@Param("validTime") long validTime); |
| | | |
| | | |
| | | long countValidRecord(@Param("uid") long uid); |
| | | |
| | | long countValidRecord(@Param("uid") long uid, @Param("validTime") long validTime); |
| | | } |
| | |
| | | // 二级分享赚分销红包
|
| | | public final static int TYPE_SHARE_ERJI = 22;
|
| | |
|
| | | // 使用券红包
|
| | | // 金币兑换红包
|
| | | public final static int TYPE_EXCHANGE = 30;
|
| | |
|
| | | @Column(name = "hb_id")
|
| | |
| | | public class CodePublishRecord implements Serializable {
|
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | | // 发布有效时间
|
| | | public static final long VALIDTIME = 3*24*60*60;
|
| | |
|
| | | @Expose
|
| | | @Column(name = "pr_id")
|
| | |
| | | </update> |
| | | |
| | | <select id="listValid" resultMap="BaseResultVOMap"> |
| | | SELECT p.*,u.`nick_name`,u.`portrait`,e.`uie_invite_code` FROM yeshi_ec_code_publish_record p |
| | | LEFT JOIN `yeshi_ec_user` u ON u.`id` = p.`pr_uid` |
| | | LEFT JOIN `yeshi_ec_user_info_extra` e ON e.`uie_uid` = p.`pr_uid` |
| | | WHERE DATE_SUB(CURDATE(), INTERVAL 3 DAY) <![CDATA[<]]> DATE(p.`pr_create_time`) |
| | | ORDER BY p.`pr_create_time` DESC |
| | | LIMIT #{start},#{count} |
| | | SELECT p.*,u.`nick_name`,u.`portrait`,e.`uie_invite_code` FROM yeshi_ec_code_publish_record p |
| | | LEFT JOIN `yeshi_ec_user` u ON u.`id` = p.`pr_uid` |
| | | LEFT JOIN `yeshi_ec_user_info_extra` e ON e.`uie_uid` = p.`pr_uid` |
| | | WHERE TIMESTAMPDIFF(SECOND,p.`pr_create_time`,NOW())<![CDATA[<]]> #{validTime} |
| | | ORDER BY p.`pr_create_time` DESC |
| | | LIMIT #{start},#{count} |
| | | </select> |
| | | |
| | | <select id="countValid" resultType="Long"> |
| | | SELECT IFNULL(COUNT(pr_id),0) FROM yeshi_ec_code_publish_record |
| | | WHERE DATE_SUB(CURDATE(), INTERVAL 3 DAY) <![CDATA[<]]> DATE(pr_create_time) |
| | | SELECT IFNULL(COUNT(pr_id),0) FROM yeshi_ec_code_publish_record |
| | | WHERE TIMESTAMPDIFF(SECOND,`pr_create_time`,NOW())<![CDATA[<]]> #{validTime} |
| | | </select> |
| | | |
| | | <select id="countValidRecord" resultType="Long"> |
| | | SELECT IFNULL(COUNT(pr_id),0) FROM yeshi_ec_code_publish_record |
| | | WHERE DATE_SUB(CURDATE(), INTERVAL 3 DAY) <![CDATA[<]]> DATE(pr_create_time) |
| | | AND pr_uid = #{uid} |
| | | SELECT IFNULL(COUNT(pr_id),0) FROM yeshi_ec_code_publish_record |
| | | WHERE pr_uid = #{uid} AND TIMESTAMPDIFF(SECOND,`pr_create_time`,NOW())<![CDATA[<]]> #{validTime} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | |
|
| | | @Override
|
| | | public long countValidRecord(Long uid){
|
| | | return codePublishRecordMapper.countValidRecord(uid);
|
| | | return codePublishRecordMapper.countValidRecord(uid, CodePublishRecord.VALIDTIME);
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public List<CodePublishRecord> listValid(long start, int count) {
|
| | |
|
| | | List<CodePublishRecord> listValid = codePublishRecordMapper.listValid(start, count);
|
| | | List<CodePublishRecord> listValid = codePublishRecordMapper.listValid(start, count, CodePublishRecord.VALIDTIME);
|
| | | if (listValid == null || listValid.size() == 0) {
|
| | | return listValid;
|
| | | }
|
| | |
| | |
|
| | | @Override
|
| | | public long countValid() {
|
| | | return codePublishRecordMapper.countValid();
|
| | | return codePublishRecordMapper.countValid(CodePublishRecord.VALIDTIME);
|
| | | }
|
| | |
|
| | |
|
| | |
| | | if (exchange == null)
|
| | | throw new IntegralExchangeException(1, "兑换方式不存在");
|
| | |
|
| | | Integer state = exchange.getState();
|
| | | if (state == null || state != 1)
|
| | | throw new IntegralExchangeException(1, "兑换活动未开启");
|
| | | |
| | | |
| | | Integer goldCoin = exchange.getGoldCoin();
|
| | |
|
| | | ExchangeTipVO exchangeTip = new ExchangeTipVO();
|
| | |
| | | if (exchange == null)
|
| | | throw new IntegralExchangeException(1, "兑换方式不存在");
|
| | |
|
| | | ExchangeTypeEnum type = exchange.getType();
|
| | | Integer state = exchange.getState();
|
| | | if (state == null || state != 1)
|
| | | throw new IntegralExchangeException(1, "兑换活动未开启");
|
| | |
|
| | | long exchangeCount = 0;
|
| | | ExchangeTypeEnum type = exchange.getType();
|
| | | if (ExchangeTypeEnum.freeCouponBuy == type) {
|
| | | exchangeCount = integralExchangeRecordService.countRecordByUid(id, uid, null);
|
| | | if (exchangeCount >= 1) {
|
| | |
| | | }
|
| | |
|
| | | @IntegralGetVersionLimit(uid = "#uid")
|
| | | @IntegralGetFrequencyLimit(key = "'bindWeiXin-'+#uid", time = 30)
|
| | | @Async()
|
| | | @Override
|
| | | public void addBindWeiXin(Long uid) {
|
| | |
| | | }
|
| | |
|
| | | @IntegralGetVersionLimit(uid = "#uid")
|
| | | @IntegralGetFrequencyLimit(key = "'bindPhone-'+#uid", time = 30)
|
| | | @Async()
|
| | | @Override
|
| | | public void addBindPhone(Long uid) {
|
| | |
| | | }
|
| | |
|
| | | @IntegralGetVersionLimit(uid = "#uid")
|
| | | @IntegralGetFrequencyLimit(key = "'bindTaoBao-'+#uid", time = 30)
|
| | | @Async()
|
| | | @Override
|
| | | public void addBindTaoBao(Long uid) {
|
| | |
| | | }
|
| | |
|
| | | @IntegralGetVersionLimit(uid = "#uid")
|
| | | @IntegralGetFrequencyLimit(key = "'setWeiXinNum-'+#uid", time = 30)
|
| | | @Async()
|
| | | @Override
|
| | | public void addSetWeiXinNum(Long uid) {
|
| | |
| | | }
|
| | |
|
| | | @IntegralGetVersionLimit(uid = "#uid")
|
| | | @IntegralGetFrequencyLimit(key = "'setGender-'+#uid", time = 30)
|
| | | @Async()
|
| | | @Override
|
| | | public void addSetGender(Long uid) {
|
| | |
| | | }
|
| | |
|
| | | @IntegralGetVersionLimit(uid = "#uid")
|
| | | @IntegralGetFrequencyLimit(key = "'setPortrait-'+#uid", time = 30)
|
| | | @Async()
|
| | | @Override
|
| | | public void addSetPortrait(Long uid) {
|
| | |
| | | }
|
| | |
|
| | | @IntegralGetVersionLimit(uid = "#uid")
|
| | | @IntegralGetFrequencyLimit(key = "'setNickName-'+#uid", time = 30)
|
| | | @Async()
|
| | | @Override
|
| | | public void addSetNickname(Long uid) {
|
| | |
| | | }
|
| | |
|
| | | @IntegralGetVersionLimit(uid = "#uid")
|
| | | @IntegralGetFrequencyLimit(key = "'bindAlipay-'+#uid", time = 30)
|
| | | @Async()
|
| | | @Override
|
| | | public void addBindAlipay(Long uid) {
|
| | |
| | | }
|
| | |
|
| | | @IntegralGetVersionLimit(uid = "#uid")
|
| | | @IntegralGetFrequencyLimit(key = "'inviteActivate-'+#uid", time = 30)
|
| | | @Async()
|
| | | @Override
|
| | | public void addInviteActivate(Long uid) {
|
| | |
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public long countUsableRewardCoupon (Long uid) {
|
| | | if (uid == null) |
| | | return 0;
|
| | | |
| | | List<SystemCoupon> couponList = systemCouponService.getOrderCouponList();
|
| | | if (couponList == null || couponList.size() == 0)
|
| | | return 0;
|
| | | |
| | | List<Long> listCouponId = new ArrayList<Long>();
|
| | | for (SystemCoupon systemCoupon : couponList) {
|
| | | listCouponId.add(systemCoupon.getId());
|
| | | }
|
| | | |
| | | return userSystemCouponMapper.countUsableByUid(uid, listCouponId);
|
| | | }
|
| | | |
| | |
|
| | | @Transactional
|
| | | @Override
|
| | |
| | | * @return
|
| | | */
|
| | | public long countUsableFreeCouponForBuy(Long uid);
|
| | | |
| | | /**
|
| | | * 统计可使用的奖励券
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public long countUsableRewardCoupon(Long uid);
|
| | |
|
| | | }
|