| | |
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserRank;
|
| | | import com.yeshi.fanli.entity.common.AdminUser;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | | import com.yeshi.fanli.exception.user.ForbiddenUserIdentifyCodeException;
|
| | | import com.yeshi.fanli.service.inter.count.UserInfoCountService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.BindingAccountService;
|
| | | import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService;
|
| | | import com.yeshi.fanli.service.inter.user.UserAccountService;
|
| | | import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoDeleteRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserMoneyDetailService;
|
| | |
| | | @Resource
|
| | | private UserInfoCountService userInfoCountService;
|
| | |
|
| | |
|
| | | @Resource
|
| | | private ForbiddenUserIdentifyCodeService forbiddenUserIdentifyCodeService;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private UserRankService userRankService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserMoneyDetailService userMoneyDetailService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoDeleteRecordService userInfoDeleteRecordService;
|
| | |
|
| | | @Resource
|
| | | private UserAccountService userAccountService;
|
| | |
|
| | | /**
|
| | | * 查询用户信息列表 正常用户/异常用户
|
| | | * 查询用户信息列表 正常用户/异常用户
|
| | | *
|
| | | * @param callback
|
| | | * @param pageIndex
|
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户类型type不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | if (pageIndex == null)
|
| | | pageIndex = 1;
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | *
|
| | | * @param data
|
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("没有可更改的内容"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | Gson gson = new Gson();
|
| | | List<Integer> list = gson.fromJson(typeArray, new TypeToken<ArrayList<Integer>>() {}.getType());
|
| | | List<Integer> list = gson.fromJson(typeArray, new TypeToken<ArrayList<Integer>>() {
|
| | | }.getType());
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("没有可更改的内容"));
|
| | | return;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户id不能为空"));
|
| | | return;
|
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("不存在该用户!"));
|
| | | return;
|
| | | }
|
| | | |
| | | |
| | | for (Integer type: list) {
|
| | |
|
| | | for (Integer type : list) {
|
| | | String openid = find.getOpenid();
|
| | | String wxUnionId = find.getWxUnionId();
|
| | | String phone = find.getPhone();
|
| | |
| | | }
|
| | | } else if (4 == type) {
|
| | | // 查询支付宝绑定
|
| | | BindingAccount account = bindingAccountService.getBindingAccountByUidAndType(uid, BindingAccount.TYPE_ALIPAY);
|
| | | BindingAccount account = bindingAccountService.getBindingAccountByUidAndType(uid,
|
| | | BindingAccount.TYPE_ALIPAY);
|
| | | if (account == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("当前用户未绑定支付宝!"));
|
| | | return;
|
| | |
| | |
|
| | | /**
|
| | | * 封禁用户ID
|
| | | * |
| | | * @param callback
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "forbiddenUser")
|
| | | public void forbiddenUser(String callback, Long uid, PrintWriter out) {
|
| | | public void forbiddenUser(String callback, Long uid, HttpServletRequest request, PrintWriter out) {
|
| | | try {
|
| | |
|
| | | if (uid == null) {
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | currentInfo.setState(UserInfo.STATE_FORBIDDEN);
|
| | | currentInfo.setStateDesc("管理员封禁");
|
| | | userInfoService.updateByPrimaryKeySelective(currentInfo);
|
| | | |
| | | // 加入封禁的账号列表
|
| | | ForbiddenUserIdentifyCode forbiddenUserIdentifyCode = new ForbiddenUserIdentifyCode();
|
| | | forbiddenUserIdentifyCode.setType(ForbiddenUserIdentifyCodeTypeEnum.wxUnionId);
|
| | | forbiddenUserIdentifyCode.setIdentifyCode(currentInfo.getWxUnionId());
|
| | | forbiddenUserIdentifyCode.setBeiZhu(currentInfo.getWxName());
|
| | | try {
|
| | | forbiddenUserIdentifyCodeService.forbiddenIdentifyCode(forbiddenUserIdentifyCode);
|
| | | } catch (ForbiddenUserIdentifyCodeException e) {
|
| | | e.printStackTrace();
|
| | | AdminUser admin = (AdminUser) request.getSession().getAttribute(Constant.SESSION_ADMIN);
|
| | | if (admin == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("登录失效,请登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | // 电话号码
|
| | | forbiddenUserIdentifyCode = new ForbiddenUserIdentifyCode();
|
| | | forbiddenUserIdentifyCode.setType(ForbiddenUserIdentifyCodeTypeEnum.phone);
|
| | | forbiddenUserIdentifyCode.setIdentifyCode(currentInfo.getPhone());
|
| | | try {
|
| | | forbiddenUserIdentifyCodeService.forbiddenIdentifyCode(forbiddenUserIdentifyCode);
|
| | | } catch (ForbiddenUserIdentifyCodeException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | String reason = "后台封禁,操作人:" + admin.getId() + "-" + admin.getName();
|
| | | userAccountService.forbiddenUserAll(uid, reason);
|
| | |
|
| | | // 淘宝
|
| | | UserExtraTaoBaoInfo taoBao = userExtraTaoBaoInfoService.getByUid(uid);
|
| | | if (taoBao != null && !StringUtil.isNullOrEmpty(taoBao.getTaoBaoUid())) {
|
| | | forbiddenUserIdentifyCode = new ForbiddenUserIdentifyCode();
|
| | | forbiddenUserIdentifyCode.setType(ForbiddenUserIdentifyCodeTypeEnum.taobaoUid);
|
| | | forbiddenUserIdentifyCode.setIdentifyCode(taoBao.getTaoBaoUid());
|
| | | try {
|
| | | forbiddenUserIdentifyCodeService.forbiddenIdentifyCode(forbiddenUserIdentifyCode);
|
| | | } catch (ForbiddenUserIdentifyCodeException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | // 查询支付宝绑定
|
| | |
|
| | | List<BindingAccount> list = bindingAccountService.getBindingAccountByUid(uid);
|
| | | if (list != null) {
|
| | | for (BindingAccount ba : list) {
|
| | | forbiddenUserIdentifyCode = new ForbiddenUserIdentifyCode();
|
| | | forbiddenUserIdentifyCode.setType(ForbiddenUserIdentifyCodeTypeEnum.alipayAccount);
|
| | | forbiddenUserIdentifyCode.setIdentifyCode(ba.getAccount());
|
| | | forbiddenUserIdentifyCode.setBeiZhu(ba.getName());
|
| | | try {
|
| | | forbiddenUserIdentifyCodeService.forbiddenIdentifyCode(forbiddenUserIdentifyCode);
|
| | | } catch (ForbiddenUserIdentifyCodeException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("用户封禁成功"));
|
| | | |
| | |
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 解除封禁用户ID
|
| | | * |
| | | * @param callback
|
| | | * @param uid
|
| | | * @param out
|
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 用户账号- 封禁/解封 |
| | | * 用户账号- 封禁/解封
|
| | | * |
| | | * @param callback
|
| | | * @param code
|
| | | * @param type 1("微信unionId"), 2("淘宝ID"), 3("手机号"), 4("支付宝账号");
|
| | | * @param type
|
| | | * 1("微信unionId"), 2("淘宝ID"), 3("手机号"), 4("支付宝账号");
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "saveForbiddenInfo")
|
| | | public void saveForbiddenInfo(String callback, String code, Integer type, PrintWriter out) {
|
| | | try {
|
| | | if (code == null || code.trim().length() == 0 || type == null ||"NULL".equalsIgnoreCase(code)) {
|
| | | if (code == null || code.trim().length() == 0 || type == null || "NULL".equalsIgnoreCase(code)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("参数不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | forbiddenUserIdentifyCodeService.saveForbiddenInfo(code, type);
|
| | | |
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("修改成功"));
|
| | |
|
| | | } catch (ForbiddenUserIdentifyCodeException e) {
|
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 删除队员关系
|
| | | * 删除队员关系
|
| | | * |
| | | * @param callback
|
| | | * @param id
|
| | | * @param out
|
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @RequestMapping(value = "queryMyFirstTeams")
|
| | | public void queryMyFirstTeams(String callback, Integer pageIndex, Integer pageSize, String key, Long bossId,
|
| | | PrintWriter out) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 队员关系
|
| | | *
|
| | |
| | | }
|
| | |
|
| | | try {
|
| | |
|
| | | List<UserMoneyDetail> userMoneyDetailsList = userMoneyDetailService.listByUidWithState(uid, pageIndex,
|
| | | pageSize);
|
| | | if (userMoneyDetailsList == null || userMoneyDetailsList.size() == 0) {
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | 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);
|
| | |
|
| | | Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd HH:mm:ss").create();
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("pe", pe);
|
| | | data.put("result_list", GsonUtil.toJsonExpose(detailList));
|
| | | data.put("result_list", gson.toJson(userMoneyDetailsList));
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | |
| | | }
|