| | |
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
| | | import org.apache.poi.ss.usermodel.Cell;
|
| | | import org.apache.poi.ss.usermodel.Row;
|
| | |
| | | import com.google.gson.GsonBuilder;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.controller.admin.utils.AdminUtils;
|
| | | import com.yeshi.fanli.dto.money.AccountDetails;
|
| | | import com.yeshi.fanli.entity.admin.UserInfoAdmin;
|
| | | import com.yeshi.fanli.entity.bus.user.AccountDetails;
|
| | | import com.yeshi.fanli.entity.bus.user.BindingAccount;
|
| | | import com.yeshi.fanli.entity.bus.user.Extract;
|
| | | import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode;
|
| | | import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode.ForbiddenUserIdentifyCodeTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBao;
|
| | | import com.yeshi.fanli.entity.bus.user.MoneyRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.Order;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode.ForbiddenUserIdentifyCodeTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.UserRank;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | | import com.yeshi.fanli.entity.taobao.PidOrder;
|
| | | import com.yeshi.fanli.entity.taobao.ScanHistory;
|
| | | import com.yeshi.fanli.exception.user.ForbiddenUserIdentifyCodeException;
|
| | |
| | | import com.yeshi.fanli.service.inter.order.OrderItemServcie;
|
| | | import com.yeshi.fanli.service.inter.order.OrderService;
|
| | | import com.yeshi.fanli.service.inter.order.PidOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.AccountDetailsService;
|
| | | import com.yeshi.fanli.service.inter.user.BindingAccountService;
|
| | | import com.yeshi.fanli.service.inter.user.ExtractService;
|
| | | import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.ScanHistoryService;
|
| | | import com.yeshi.fanli.service.inter.user.UserActiveLogService;
|
| | | import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserMoneyDetailService;
|
| | | import com.yeshi.fanli.service.inter.user.UserRankService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.GsonUtil;
|
| | | import com.yeshi.fanli.util.HongBaoUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.factory.AccountDetailsFactory;
|
| | | import com.yeshi.fanli.vo.user.ForbiddenUserIdentifyCodeVO;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("admin/new/api/v1/user")
|
| | |
| | | private PidOrderService pidOrderService;
|
| | |
|
| | | @Resource
|
| | | private AccountDetailsService accountDetailsService;
|
| | |
|
| | | @Resource
|
| | | private BindingAccountService bindingAccountService;
|
| | |
|
| | | @Resource
|
| | |
| | |
|
| | | @Resource
|
| | | private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | |
|
| | | @Resource
|
| | | private UserRankService userRankService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserMoneyDetailService userMoneyDetailService;
|
| | |
|
| | | @RequestMapping(value = "getUserList", method = RequestMethod.POST)
|
| | | public void getUserList(int pageIndex, String key, PrintWriter out) {
|
| | |
| | | public void countInfo(String callback, PrintWriter out) {
|
| | | try {
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | // 累计用户数量
|
| | | long totalUser = userInfoCountService.countNewUser(null, null);
|
| | | // 流失用户数量(180天未使用登录并且无任何资金流动的账号数量)
|
| | | long loseUser = userInfoCountService.countLoseUser(180);
|
| | | // 累计有购买用户数
|
| | | long orderUser = userInfoCountService.countHasOrderUser();
|
| | |
|
| | | // 总数-普通用户
|
| | | long countNormal = userInfoCountService.countRank(0);
|
| | | long countNormal = 0;
|
| | | // 总数-铜用户
|
| | | long countCuprum = userInfoCountService.countRank(1);
|
| | | long countCuprum = 0;
|
| | | // 总数-银用户
|
| | | long countSilver = userInfoCountService.countRank(2);
|
| | | long countSilver = 0;
|
| | | // 总数-金用户
|
| | | long countGold = userInfoCountService.countRank(3);
|
| | | long countGold = 0;
|
| | |
|
| | | List<UserRank> listRank = userRankService.getAllRank();
|
| | | if (listRank != null && listRank.size() > 0) {
|
| | | for (UserRank userRank : listRank) {
|
| | | Long id = userRank.getId();
|
| | | String name = userRank.getName();
|
| | | if ("青铜".equals(name)) {
|
| | | continue;
|
| | | }
|
| | |
|
| | | long count = userInfoExtraService.countByRankId(id);
|
| | | if ("白银".equals(name)) {
|
| | | countCuprum = count;
|
| | | } else if ("黄金".equals(name)) {
|
| | | countSilver = count;
|
| | | } else if ("铂金".equals(name)) {
|
| | | countGold = count;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | // 普通用户计算
|
| | | countNormal = totalUser - (countCuprum + countSilver + countGold);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("totalUser", totalUser);
|
| | | data.put("loseUser", loseUser);
|
| | | data.put("orderUser", orderUser);
|
| | | data.put("countNormal", countNormal);
|
| | | data.put("countCuprum", countCuprum);
|
| | | data.put("countSilver", countSilver);
|
| | |
| | | * data.put("countTotalMoney", countTotalMoney);
|
| | | * data.put("countCanAssets", countCanAssets);
|
| | | */
|
| | |
|
| | | // 累计用户数量
|
| | | long totalUser = userInfoCountService.countNewUser(null, null);
|
| | | // 流失用户数量(180天未使用登录并且无任何资金流动的账号数量)
|
| | | long loseUser = userInfoCountService.countLoseUser(180);
|
| | | // 累计有购买用户数
|
| | | long orderUser = userInfoCountService.countHasOrderUser();
|
| | |
|
| | | data.put("totalUser", totalUser);
|
| | | data.put("loseUser", loseUser);
|
| | | data.put("orderUser", orderUser);
|
| | |
|
| | | // 今日新增用户数量
|
| | | long todayUser = userInfoCountService.countNewUser(1, null);
|
| | |
| | |
|
| | | try {
|
| | |
|
| | | List<AccountDetails> detailsList = accountDetailsService.findAccountDetailsList(uid, pageIndex);
|
| | | if (detailsList == null || detailsList.size() == 0) {
|
| | | List<UserMoneyDetail> userMoneyDetailsList = userMoneyDetailService.listByUidWithState(uid, pageIndex,
|
| | | pageSize);
|
| | | if (userMoneyDetailsList == null || userMoneyDetailsList.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
|
| | | return;
|
| | | }
|
| | |
|
| | | int count = accountDetailsService.getCount(uid);
|
| | | List<AccountDetails> detailList = new ArrayList<>();
|
| | | for (UserMoneyDetail detail : userMoneyDetailsList)
|
| | | detailList.add(AccountDetailsFactory.create(detail));
|
| | |
|
| | | long count = userMoneyDetailService.countByUidWithState(uid);
|
| | |
|
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("pe", pe);
|
| | | data.put("result_list", GsonUtil.toJsonExpose(detailsList));
|
| | | data.put("result_list", GsonUtil.toJsonExpose(detailList));
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 查询封禁
|
| | | * @param callback
|
| | | * @param pageIndex
|
| | | * @param pageSize
|
| | | * @param key
|
| | | * @param type
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "forbiddenQuery")
|
| | | public void forbiddenQuery(String callback, Integer pageIndex, Integer pageSize, String key, Integer type, PrintWriter out) {
|
| | |
|
| | | try {
|
| | |
|
| | | if (pageIndex == null)
|
| | | pageIndex = 1;
|
| | |
|
| | | if (pageSize == null)
|
| | | pageSize = Constant.PAGE_SIZE;
|
| | |
|
| | | |
| | | List<ForbiddenUserIdentifyCodeVO> list = forbiddenUserIdentifyCodeService.listQuery((pageIndex - 1) * pageSize, |
| | | pageSize, key, type);
|
| | | |
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无相关数据"));
|
| | | return;
|
| | | }
|
| | |
|
| | | long count = forbiddenUserIdentifyCodeService.countQuery(key, type);
|
| | | |
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | |
|
| | | GsonBuilder gsonBuilder = new GsonBuilder();
|
| | | gsonBuilder.serializeNulls();
|
| | | Gson gson = gsonBuilder.create();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("pe", pe);
|
| | | data.put("result_list", gson.toJson(list));
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 用户账号- 封禁/解封 |
| | | * @param callback
|
| | | * @param code
|
| | | * @param type 1("微信unionId"), 2("淘宝ID"), 3("手机号"), 4("支付宝账号");
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "saveForbiddenInfo")
|
| | | public void saveForbiddenInfo(String callback, String code, Integer type, boolean state, PrintWriter out) {
|
| | | try {
|
| | | if (code == null || code.trim().length() == 0 || type == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("参数不能为空"));
|
| | | }
|
| | | |
| | | forbiddenUserIdentifyCodeService.saveForbiddenInfo(code, type, state);
|
| | | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("修改成功"));
|
| | |
|
| | | } catch (ForbiddenUserIdentifyCodeException e) {
|
| | | e.printStackTrace();
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | }
|
| | | |
| | | }
|
| | | |
| | | }
|