| | |
| | |
|
| | | @Resource
|
| | | private ShareMapper shareMapper;
|
| | | |
| | |
|
| | | @Resource
|
| | | private HongBaoV2CountService hongBaoV2CountService;
|
| | | |
| | |
|
| | | public UserInfo getUserByLoginTypeAndOpenId(int loginType, String openid, String appid) {
|
| | | List<UserInfo> list = null;
|
| | |
| | | list = userInfoDao.list("from UserInfo u where u.wxUnionId=? and u.appId = ? ",
|
| | | new Serializable[] { openid, appid });
|
| | | }
|
| | |
|
| | | if (list != null)
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | if (list.get(i).getState() == UserInfo.STATE_DELETE
|
| | | || list.get(i).getState() == UserInfo.STATE_DELETE_OUT_OF_DATE) {
|
| | | list.remove(i);
|
| | | i--;
|
| | | }
|
| | | }
|
| | |
|
| | | if (list != null && list.size() > 0) {
|
| | | return list.get(0);
|
| | | }
|
| | |
| | | String wxUnionId = weiXinUser.getUnionid();
|
| | | UserInfo find = getUserByLoginTypeAndOpenId(Constant.WEIXIN, wxUnionId, Constant.APPID);
|
| | |
|
| | | if (find == null||find.getState()==UserInfo.STATE_DELETE||find.getState()==UserInfo.STATE_DELETE_OUT_OF_DATE) {
|
| | | if (find == null) {
|
| | | find = new UserInfo();
|
| | | find.setAppId(Constant.APPID);
|
| | | find.setWxUnionId(weiXinUser.getUnionid());
|
| | |
| | |
|
| | | // 历史总订单
|
| | | long totalOrder = hongBaoV2CountService.countValidNumberByUid(uid, null);
|
| | | |
| | |
|
| | | // 今日总订单
|
| | | long todayOrder = hongBaoV2CountService.countValidNumberByUid(uid, 1);
|
| | | // 本月总订单
|
| | |
| | | userInfoAdmin.setTotalOrder(totalOrder);
|
| | | userInfoAdmin.setTodayOrder(todayOrder);
|
| | | userInfoAdmin.setMonthOrder(monthOrder);
|
| | | |
| | | |
| | |
|
| | | // 未领取红包 待入账金额
|
| | | BigDecimal unaccountedMoney = hongBaoV2CountService.countWillGetMoneyByUid(uid);
|
| | | if (unaccountedMoney ==null) {
|
| | | if (unaccountedMoney == null) {
|
| | | unaccountedMoney = new BigDecimal(0);
|
| | | }
|
| | | userInfoAdmin.setUnaccountedMoney(unaccountedMoney.toString());
|
| | |
|
| | | // 历史总收益
|
| | | BigDecimal totalMoneyHistory = hongBaoV2CountService.countMoneyByUidAndState(uid,3);
|
| | | if (totalMoneyHistory ==null) {
|
| | | BigDecimal totalMoneyHistory = hongBaoV2CountService.countMoneyByUidAndState(uid, 3);
|
| | | if (totalMoneyHistory == null) {
|
| | | totalMoneyHistory = new BigDecimal(0);
|
| | | }
|
| | | userInfoAdmin.setTotalMoneyHistory(totalMoneyHistory.toString());
|
| | | |
| | | |
| | | |
| | |
|
| | | // 支付宝账号 累计转账总金额
|
| | | double totalMoney = payInfoMapper.sumMoneyByUid(uid);
|
| | |
| | |
|
| | | /**
|
| | | * 根据电话号码、邀请码获取邀请用户
|
| | | * |
| | | * @param phone
|
| | | * @param inviteCode
|
| | | * @return
|
| | |
| | | public UserInfo getInfoByPhoneOrInviteCode(String phone, String inviteCode) {
|
| | | return userInfoMapper.getInfoByPhoneOrInviteCode(phone, inviteCode);
|
| | | }
|
| | | |
| | |
|
| | | }
|