| | |
| | | import com.google.gson.stream.JsonReader;
|
| | | import com.google.gson.stream.JsonWriter;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.redpack.RedPackDetail.RedPackDetailTypeEnum;
|
| | | import com.yeshi.fanli.entity.redpack.RedPackExchange;
|
| | | import com.yeshi.fanli.entity.redpack.RedPackWinInvite;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.UserInviteUtil;
|
| | | import com.yeshi.fanli.vo.redpack.RedPackDetailVO;
|
| | | import com.yeshi.fanli.vo.redpack.RedPackWinInviteVO;
|
| | | import com.yeshi.fanli.vo.redpack.RedPackWinProgressVO;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private SwiperPictureService swiperPictureService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserSystemCouponService userSystemCouponService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private RedPackForbidService redPackForbidService;
|
| | |
|
| | | |
| | | @Resource
|
| | | private ThreeSaleSerivce threeSaleSerivce;
|
| | | |
| | | |
| | | /**
|
| | | * 统计
|
| | | *
|
| | |
| | | BigDecimal yesterdayUse = zero;
|
| | | BigDecimal thisMonthUse = zero;
|
| | | BigDecimal lastMonthUse = zero;
|
| | | BigDecimal balance = redPackBalanceService.getBalance(uid);;
|
| | | BigDecimal balance = redPackBalanceService.getBalance(uid);
|
| | | ;
|
| | | if (balance == null) {
|
| | | balance = zero;
|
| | | } else {
|
| | |
| | | *
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param index
|
| | | * List最末的主键ID
|
| | | * @param year
|
| | | * 年份
|
| | | * @param month
|
| | | * 月份
|
| | | * @param index List最末的主键ID
|
| | | * @param year 年份
|
| | | * @param month 月份
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getMoneyDetails")
|
| | |
| | | @RequestMapping(value = "getBasicInfo")
|
| | | public void getBasicInfo(AcceptData acceptData, Long uid, String callback, PrintWriter out) {
|
| | | if (uid == null || uid <= 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | data.put("shareLink", UserInviteUtil.getShareUrl(uid));
|
| | | data.put("redPackLock", redPackForbidService.verifyForbid(uid));
|
| | |
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra != null && !StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
|
| | | data.put("inviteCode", userInfoExtra.getInviteCode());
|
| | | String inviteCode = userInfoExtraService.getInviteCodeByUid(uid);
|
| | | if ( !StringUtil.isNullOrEmpty(inviteCode)) {
|
| | | data.put("inviteCode", inviteCode);
|
| | | } else {
|
| | | data.put("inviteCode", "");
|
| | | }
|
| | |
|
| | | //
|
| | | long freeCouponCount= userSystemCouponService.countUsableFreeCouponForBuy(uid);
|
| | | long rewardCouponCount= userSystemCouponService.countUsableRewardCoupon(uid);
|
| | | |
| | | data.put("freeCouponCount", freeCouponCount);
|
| | | data.put("rewardCouponCount", rewardCouponCount);
|
| | | // 赠送免单券
|
| | | long freeCouponCount = userSystemCouponService.countGiveFreeCoupon(uid);
|
| | | // 奖励券
|
| | | long rewardCouponCount = userSystemCouponService.countUsableRewardCoupon(uid);
|
| | |
|
| | | data.put("freeCouponCount", freeCouponCount);
|
| | | data.put("rewardCouponCount", rewardCouponCount);
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(callback)) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | } else
|
| | | } else {
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | |
| | | /**
|
| | | * 该用户邀请奖金榜
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid 下线UID
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getInviteReward")
|
| | | public void getInviteReward(AcceptData acceptData,Integer page, Long uid, String callback, PrintWriter out) {
|
| | | if (uid == null || uid <= 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | | |
| | | if (page == null || page < 1)
|
| | | page = 1;
|
| | | |
| | | List<RedPackWinProgressVO> listVO = new ArrayList<RedPackWinProgressVO>();
|
| | | List<RedPackWinInvite> list = redPackWinInviteService.getWinTopListByBossId(page, Constant.PAGE_SIZE, uid);
|
| | | if (list != null) {
|
| | | for (RedPackWinInvite win: list) {
|
| | | ThreeSale threeSale = threeSaleSerivce.getNearRelationByBossIdAndWorkerId(uid, win.getTeamUid());
|
| | | if (threeSale == null)
|
| | | continue;
|
| | | |
| | | UserInfo userInfo = userInfoService.selectByPKey(win.getTeamUid());
|
| | | if (userInfo == null)
|
| | | continue;
|
| | | |
| | | RedPackWinProgressVO progressVO = new RedPackWinProgressVO();
|
| | | progressVO.setUid(userInfo.getId());
|
| | | progressVO.setName(userInfo.getNickName());
|
| | | progressVO.setPortrait(userInfo.getPortrait());
|
| | | progressVO.setMoney(win.getMoney().setScale(2).toString());
|
| | | progressVO.setTime("邀请:" + TimeUtil.formatDate(threeSale.getSucceedTime()));
|
| | | listVO.add(progressVO);
|
| | | }
|
| | | }
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("list", listVO);
|
| | | data.put("count", redPackWinInviteService.countWinTopListByBossId(uid));
|
| | | if (!StringUtil.isNullOrEmpty(callback)) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | } else {
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 该用户邀请进度
|
| | | * |
| | | * @param acceptData
|
| | | * @param tid 下线UID
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getInviteProgress")
|
| | | public void getInviteProgress(AcceptData acceptData, Long uid, Long tid, String callback, PrintWriter out) {
|
| | | if (uid == null || uid <= 0 || tid == null || tid <= 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "传递参数缺失"));
|
| | | return;
|
| | | }
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("list", redPackWinInviteService.getInviteProgressByWorkerId(uid, tid));
|
| | | data.put("num", redPackWinInviteService.countTeamNumByTid(uid, tid));
|
| | | if (!StringUtil.isNullOrEmpty(callback)) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | } else {
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | }
|
| | | }
|