| | |
| | | import com.taoke.autopay.entity.AdminUser; |
| | | import com.taoke.autopay.entity.WxUserInfo; |
| | | import com.taoke.autopay.entity.WxUserSettings; |
| | | import com.taoke.autopay.entity.credit.UserCreditBalance; |
| | | import com.taoke.autopay.factory.WxUserFactory; |
| | | import com.taoke.autopay.service.AdminUserService; |
| | | import com.taoke.autopay.service.WxUserService; |
| | | import com.taoke.autopay.service.WxUserSettingService; |
| | | import com.taoke.autopay.service.credit.UserCreditBalanceService; |
| | | import com.taoke.autopay.utils.TimeUtil; |
| | | import com.taoke.autopay.vo.WxUserOrderSettingVO; |
| | | import com.taoke.autopay.vo.WxUserVO; |
| | |
| | | @Resource |
| | | private WxUserSettingService wxUserSettingService; |
| | | |
| | | @Resource |
| | | private UserCreditBalanceService userCreditBalanceService; |
| | | |
| | | |
| | | /** |
| | | * @param key |
| | |
| | | List<WxUserInfo> userList = wxUserService.list(query, page, limit); |
| | | long count = wxUserService.count(query); |
| | | Map<Long, WxUserSettings> settingsMap = new HashMap<>(); |
| | | Map<Long, UserCreditBalance> creditBalanceMap = new HashMap<>(); |
| | | if (userList.size() > 0) { |
| | | List<Long> uids = new ArrayList<>(); |
| | | for (WxUserInfo u : userList) { |
| | |
| | | for (WxUserSettings setting : settings) { |
| | | settingsMap.put(setting.getId(), setting); |
| | | } |
| | | // 获取用户积分余额 |
| | | creditBalanceMap = userCreditBalanceService.getCreditBalancesByUserIds(uids); |
| | | |
| | | } |
| | | |
| | | |
| | | // 转vo |
| | | List<WxUserVO> voList = new ArrayList<>(); |
| | | for (WxUserInfo user : userList) { |
| | | voList.add(WxUserFactory.createVO(user, settingsMap.get(user.getId()))); |
| | | voList.add(WxUserFactory.createVO(user, settingsMap.get(user.getId()), creditBalanceMap.get(user.getId()))); |
| | | } |
| | | JSONObject data = new JSONObject(); |
| | | data.put("count", count); |