|
|
|
@ -5,6 +5,7 @@ import cn.estsh.i3plus.core.api.iservice.base.ISystemInitService;
|
|
|
|
|
import cn.estsh.i3plus.core.api.iservice.base.ISystemLoginStrategyService;
|
|
|
|
|
import cn.estsh.i3plus.core.api.iservice.busi.*;
|
|
|
|
|
import cn.estsh.i3plus.core.apiservice.controller.busi.*;
|
|
|
|
|
import cn.estsh.i3plus.core.apiservice.util.MailUtil;
|
|
|
|
|
import cn.estsh.i3plus.core.apiservice.util.SysUserPasswordUtil;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
|
|
|
|
@ -15,13 +16,18 @@ import cn.estsh.i3plus.platform.common.tool.TimeTool;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.util.CommonConstWords;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.util.PlatformConstWords;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.annotation.AnnoIgnoreLog;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.*;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.BaseConstWords;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.BaseResultBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.BaseThreadLocal;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.ImppEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.model.common.CloudPagerModel;
|
|
|
|
|
import cn.estsh.i3plus.pojo.model.common.ImppEmail;
|
|
|
|
|
import cn.estsh.i3plus.pojo.model.common.ImppSmsContent;
|
|
|
|
|
import cn.estsh.i3plus.pojo.model.common.UserModel;
|
|
|
|
|
import cn.estsh.i3plus.pojo.model.license.ImppLicense;
|
|
|
|
|
import cn.estsh.i3plus.pojo.model.platform.SysLoginModel;
|
|
|
|
|
import cn.estsh.i3plus.pojo.model.platform.SysRoleModel;
|
|
|
|
@ -33,15 +39,9 @@ import cn.estsh.impp.framework.base.controller.CoreBaseController;
|
|
|
|
|
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
|
|
|
|
import cn.estsh.impp.framework.boot.fileservice.ImppFileService;
|
|
|
|
|
import cn.estsh.impp.framework.boot.license.ImppLicenseTool;
|
|
|
|
|
import cn.estsh.impp.framework.boot.license.serviceimpl.ImppLicenseDecoder;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.ImppRedis;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.LocaleUtils;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.RedisCacheTool;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.ResultBean;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.SpringContextsUtil;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.ValidatorBean;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.*;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.dingtalk.api.response.OapiV2UserGetResponse;
|
|
|
|
|
import com.google.common.cache.Cache;
|
|
|
|
@ -49,42 +49,21 @@ import com.google.common.cache.CacheBuilder;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.apache.shiro.authc.AuthenticationException;
|
|
|
|
|
import org.apache.shiro.authc.CredentialsException;
|
|
|
|
|
import org.apache.shiro.authc.ExpiredCredentialsException;
|
|
|
|
|
import org.apache.shiro.authc.IncorrectCredentialsException;
|
|
|
|
|
import org.apache.shiro.authc.LockedAccountException;
|
|
|
|
|
import org.apache.shiro.authc.UnknownAccountException;
|
|
|
|
|
import org.apache.shiro.authc.*;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
|
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.PutMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
import java.util.Optional;
|
|
|
|
|
import java.util.Set;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
import java.util.function.BiFunction;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
import java.util.stream.Stream;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description :
|
|
|
|
@ -107,6 +86,9 @@ public class WhiteController extends CoreBaseController {
|
|
|
|
|
private SysUserInfoController sysUserInfoController;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private ISysUserService sysUserService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private ISysLocaleLanguageService sysLocaleLanguageService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@ -972,6 +954,50 @@ public class WhiteController extends CoreBaseController {
|
|
|
|
|
return sysUserInfoController.querySysUserInfo(cloudPagerModel.getObj(), cloudPagerModel.getPager());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据登录名,邮箱获取用户账号信息
|
|
|
|
|
* @param sysUser
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping(value = "/user/query-user")
|
|
|
|
|
@ApiOperation(value = "根据条件查询单个用户信息",notes = "根据条件查询单个用户信息")
|
|
|
|
|
public ResultBean querySysUser(@RequestBody SysUser sysUser){
|
|
|
|
|
ValidatorBean.checkNotNull(sysUser.getUserLoginName(),"用户登录名不能为空!");
|
|
|
|
|
ValidatorBean.checkNotNull(sysUser.getUserEmail(),"用户email不能为空!");
|
|
|
|
|
SysUser user = sysUserService.getSysUserByLoginNameAndEmail(sysUser.getUserLoginName(), sysUser.getUserEmail());
|
|
|
|
|
return ResultBean.success("查询成功!").setResultObject(user);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping(value = "/sendEmail")
|
|
|
|
|
@ApiOperation(value = "无需登录,发送邮件")
|
|
|
|
|
public ResultBean sendEmail(@RequestBody ImppEmail imppEmail){
|
|
|
|
|
ValidatorBean.checkNotNull(imppEmail.getContent(),"消息内容不能为空");
|
|
|
|
|
ValidatorBean.checkNotNull(imppEmail.getEmail(),"email地址不能为空");
|
|
|
|
|
try {
|
|
|
|
|
MailUtil mailUtil = new MailUtil();
|
|
|
|
|
mailUtil.init();
|
|
|
|
|
mailUtil.setContentType(ImppEnumUtil.MESSAGE_TYPE_CONTENT.HTML.getDescription());
|
|
|
|
|
mailUtil.setNick(imppEmail.getNick());
|
|
|
|
|
mailUtil.setSubject(imppEmail.getSubject());
|
|
|
|
|
mailUtil.setTo(imppEmail.getEmail());
|
|
|
|
|
mailUtil.setBody(imppEmail.getContent());
|
|
|
|
|
mailUtil.send();
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
LOGGER.error("发送邮件:{}失败:{}",imppEmail.getEmail(),e.getMessage());
|
|
|
|
|
return ResultBean.fail("发送失败,请检查邮箱是否输入正确!");
|
|
|
|
|
}
|
|
|
|
|
return ResultBean.success("验证码已发送!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping(value = "/update-vendor-pwd")
|
|
|
|
|
@ApiOperation(value = "忘记密码")
|
|
|
|
|
public ResultBean updateVendorPwd(@RequestBody UserModel userModel){
|
|
|
|
|
ValidatorBean.checkNotNull(userModel.getLoginName(),"登录名不能为空!");
|
|
|
|
|
ValidatorBean.checkNotNull(userModel.getPassword(),"密码不能为空!");
|
|
|
|
|
sysUserService.updateSysUserPwdByLoginName(userModel.getLoginName(),userModel.getPassword());
|
|
|
|
|
return ResultBean.success("修改成功!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping("/sendSms")
|
|
|
|
|
@ApiOperation("无需登录 发送短信")
|
|
|
|
|
public ResultBean sendSms(@RequestBody ImppSmsContent imppSmsContent){
|
|
|
|
|