@源码地址来源: https://minglisoft.cn/honghu/business.html
会员控制类:
/**
* Copyright © 2012-2017 HongHu All rights reserved.
*/
package com.honghu.cloud.controller;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.StringUtils;
import org.apache.http.HttpException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.google.common.collect.Maps;
import com.honghu.cloud.bean.Album;
import com.honghu.cloud.bean.CustomerService;
import com.honghu.cloud.bean.MemberFans;
import com.honghu.cloud.bean.Menu;
import com.honghu.cloud.bean.PredepositLog;
import com.honghu.cloud.bean.PullUserOrder;
import com.honghu.cloud.bean.Role;
import com.honghu.cloud.bean.User;
import com.honghu.cloud.bean.UserCard;
import com.honghu.cloud.bean.VerifyidCard;
import com.honghu.cloud.code.MemberResponseCode;
import com.honghu.cloud.code.ResponseCode;
import com.honghu.cloud.code.ResponseVO;
import com.honghu.cloud.constant.Globals;
import com.honghu.cloud.dto.AccessoryDto;
import com.honghu.cloud.dto.AreaDto;
import com.honghu.cloud.dto.IntegralLogDto;
import com.honghu.cloud.dto.ModularClassDto;
import com.honghu.cloud.dto.StoreDto;
import com.honghu.cloud.dto.SysConfigDto;
import com.honghu.cloud.dto.TemplateDto;
import com.honghu.cloud.dto.UserDto;
import com.honghu.cloud.dto.VerifyCodeDto;
import com.honghu.cloud.feign.AccessoryFeignClient;
import com.honghu.cloud.feign.AreaFeignClient;
import com.honghu.cloud.feign.CouponInfoFeignClient;
import com.honghu.cloud.feign.IntegralLogFeignClient;
import com.honghu.cloud.feign.IntegralToolsFeignClient;
import com.honghu.cloud.feign.ModularClassFeignClient;
import com.honghu.cloud.feign.MsgToolsFeignClient;
import com.honghu.cloud.feign.OrderFormFeignClient;
import com.honghu.cloud.feign.QrCodeFeignClient;
import com.honghu.cloud.feign.StoreFeignClient;
import com.honghu.cloud.feign.SysConfigFeignClient;
import com.honghu.cloud.feign.TemplateFeignClient;
import com.honghu.cloud.feign.TencentIMFeignClient;
import com.honghu.cloud.feign.VerifyCodeFeignClient;
import com.honghu.cloud.redis.RedisUtil;
import com.honghu.cloud.service.IAlbumService;
import com.honghu.cloud.service.ICustomerService;
import com.honghu.cloud.service.IFavoriteService;
import com.honghu.cloud.service.IFootPointService;
import com.honghu.cloud.service.IMemberFansService;
import com.honghu.cloud.service.IPredepositLogService;
import com.honghu.cloud.service.IPullUserOrderService;
import com.honghu.cloud.service.IRoleService;
import com.honghu.cloud.service.IUserCardService;
import com.honghu.cloud.service.IUserService;
import com.honghu.cloud.service.IVerifyidCardService;
import com.honghu.cloud.tools.SecurityUserHolder;
import com.honghu.cloud.utils.CommUtil;
import com.honghu.cloud.utils.JWT;
import com.honghu.cloud.utils.beans.BeanUtils;
import com.honghu.cloud.utils.tools.Md5Encrypt;
import net.sf.json.JSONObject;
/**
* 用户Controller
* @author Administrator
* @param
*
*/
@SuppressWarnings({"rawtypes","unchecked"})
@RestController
@RequestMapping(value = "/user")
/*/*@CrossOrigin(origins = "*", maxAge = 3600, methods = { RequestMethod.GET, RequestMethod.POST, RequestMethod.DELETE,
RequestMethod.PUT })*/
public class UserController {
private static final Logger logger = LoggerFactory.getLogger(UserController.class);
@Autowired
private IUserService userService;
@Autowired
private IFootPointService footPointService;
@Autowired
private CouponInfoFeignClient couponInfoFeignClient;
@Autowired
private OrderFormFeignClient orderFormFeignClient;
@Autowired
private SysConfigFeignClient sysConfigFeignClient;
@Autowired
private AccessoryFeignClient accessoryFeignClient;
@Autowired
private VerifyCodeFeignClient verifyCodeFeignClient;
@Autowired
private MsgToolsFeignClient msgToolsFeignClient;
@Autowired
private IPullUserOrderService pullUserOrderService;
@Autowired
private QrCodeFeignClient qrCodeFeignClient;
@Autowired
private IRoleService roleService;
@Autowired
private AreaFeignClient areaFeignClient;
@Autowired
private IntegralLogFeignClient integralLogFeignClient;
@Autowired
private TemplateFeignClient templateFeignClient;
@Autowired
private ModularClassFeignClient modularClassFeignClient;
@Autowired
private ICustomerService customerService;
@Autowired
private IAlbumService albumService;
@Autowired
private IFavoriteService favoriteService;
@Autowired
private RedisUtil redisUtil;
@Autowired
private IVerifyidCardService verifyidCardService;
@Autowired
private StoreFeignClient storeFeignClient;
@Autowired
private TencentIMFeignClient tencentIMFeignClient;
@Autowired
private IUserCardService userCardService;
@Autowired
private IPredepositLogService predepositLogService;
@Autowired
private IMemberFansService memberFansService;
@Autowired
private IntegralToolsFeignClient integralToolsFeignClient;
@RequestMapping(value = "/apiForFeign/selectByIds", method = RequestMethod.POST)
public List selectByIds(@RequestBody Map params) {
return userService.selectByIds(params);
}
@RequestMapping(value = "/apiForFeign/getMsgSubUsers", method = RequestMethod.GET)
public List getMsgSubUsers(@RequestParam("parent_id") Long parent_id){
return userService.getMsgSubUsers(parent_id);
}
@RequestMapping(value = "/apiForFeign/auditNoteUser", method = RequestMethod.GET)
public List auditNoteUser(){
return userService.auditNoteUser();
}
@RequestMapping(value = "/apiForFeign/selectCount", method = RequestMethod.GET)
public int selectCount(@RequestParam("params")Map params){
return userService.selectCount(params);
}
@RequestMapping(value = "/apiForFeign/whetherFans", method = RequestMethod.GET)
public boolean whetherFans(@RequestParam("mid") Long mid, @RequestParam("fansid") Long fansid) {
MemberFans memberFans = memberFansService.whetherFans(mid, fansid);
if (memberFans != null)
return true;
return false;
}
/**
* 根据用户id查询用户
* @param congelationDto
* @return
*/
@RequestMapping(value = "/apiForFeign/selectByPrimaryKey", method = RequestMethod.GET)
public User selectByPrimaryKey(@RequestParam("id") Long id) {
User user = userService.selectByPrimaryKey(id);
if(user != null && user.getPhoto_id() != null){
user.setPhoto(accessoryFeignClient.selectByPrimaryKey(user.getPhoto_id()));
}
return user;
}
@RequestMapping(value = "/apiForFeign/selectUserCardByUserId", method = RequestMethod.GET)
public UserCard selectUserCardByUserId(@RequestParam("id") Long id) {
return userCardService.selectByUserId(id);
}
@RequestMapping(value = "/apiForFeign/queryPageList", method = RequestMethod.GET)
public List queryPageList(@RequestParam("params")Map params) {
return userService.queryPageList(params, null, null);
}
@RequestMapping(value = "/apiForFeign/verityUserNamePassword", method = RequestMethod.POST)
public List verityUserNamePassword(@RequestBody Map params) {
return userService.verityUserNamePassword(params);
}
@RequestMapping(value = "/apiForFeign/selectPullByOrderId", method = RequestMethod.GET)
public PullUserOrder selectPullByOrderId(@RequestParam("id") Long id) {
PullUserOrder obj = pullUserOrderService.selectPullByOrderId(id);
return obj;
}
@RequestMapping(value = "/apiForFeign/savePullUserOrder", method = RequestMethod.POST)
public void savePullUserOrder(@RequestBody PullUserOrder obj) {
pullUserOrderService.saveEntity(obj);
}
/**
* 根据订单id查询拉新用户表 ,进行删除
* @param id
*/
@RequestMapping(value = "/apiForFeign/delPullByOrderId", method = RequestMethod.GET)
public void delPullByOrderId(@RequestParam("id") Long id) {
pullUserOrderService.deleteByOrderId(id);
}
@RequestMapping(value = "/apiForFeign/queryByProperty", method = RequestMethod.POST)
public User queryByProperty(@RequestParam("params")Map params) {
return userService.queryByProperty(params);
}
@RequestMapping(value = "/apiForFeign/updateById", method = RequestMethod.POST)
public void updateById(@RequestBody User obj) {
userService.updateById(obj);
}
@RequestMapping(value = "/apiForFeign/update", method = RequestMethod.POST)
public void update(@RequestBody User obj) {
userService.update(obj);
}
@RequestMapping(value = "/apiForFeign/saveEntity", method = RequestMethod.POST)
public User saveEntity(@RequestBody User obj) {
return userService.saveEntity(obj);
}
@RequestMapping(value = "/apiForFeign/saveUserCard", method = RequestMethod.POST)
public void saveUserCard(@RequestBody UserCard obj) {
userCardService.saveEntity(obj);
}
/**
* 根据unionid查询用户
* @param unionid
* @return
*/
@RequestMapping(value = "/apiForFeign/selectByUnionid", method = RequestMethod.POST)
public User selectByUnionid(@RequestParam("unionid") String unionid){
return userService.selectByUnionid(unionid);
}
@RequestMapping(value = "/apiForFeign/selectByWxOpenId", method = RequestMethod.POST)
public User selectByWxOpenId(@RequestParam("openid") String openid){
return userService.selectByWxOpenId(openid);
}
@RequestMapping(value = "/apiForFeign/getUserByStoreId", method = RequestMethod.GET)
public User getUserByStoreId(@RequestParam("id") Long id) {
return userService.getUserByStoreId(id);
}
@RequestMapping(value = "/apiForFeign/deleteUserMenu", method = RequestMethod.GET)
public void deleteUserMenu(@RequestParam("id") Long id) {
userService.deleteUserMenu(id);
}
@RequestMapping(value = "/apiForFeign/updateLiveById", method = RequestMethod.GET)
public void updateLiveById(@RequestParam("id") Long id) {
userService.updateLiveById(id);
}
@RequestMapping(value = "/apiForFeign/saveUserMenu", method = RequestMethod.POST)
public void saveUserMenu(@RequestParam("id") Long id,@RequestBody List
@源码地址来源: https://minglisoft.cn/honghu/business.html