|
|
|
@ -44,6 +44,8 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
import static cn.estsh.i3plus.platform.common.util.CommonConstWords.DEFAULT_LANGUAGE;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description :
|
|
|
|
|
* @Reference :
|
|
|
|
@ -106,7 +108,7 @@ public class WhiteController extends CoreBaseController {
|
|
|
|
|
@Autowired
|
|
|
|
|
private ILicenseClickService licenseClickService;
|
|
|
|
|
|
|
|
|
|
@Resource(name= CommonConstWords.IMPP_REDIS_SESSION)
|
|
|
|
|
@Resource(name = CommonConstWords.IMPP_REDIS_SESSION)
|
|
|
|
|
private ImppRedis redisSession;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@ -114,73 +116,77 @@ public class WhiteController extends CoreBaseController {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/sys-locale-language/list")
|
|
|
|
|
@ApiOperation(value = "查询可用语言",notes = "查询可用语言")
|
|
|
|
|
public ResultBean listSysLocaleLanguage(){
|
|
|
|
|
@ApiOperation(value = "查询可用语言", notes = "查询可用语言")
|
|
|
|
|
public ResultBean listSysLocaleLanguage() {
|
|
|
|
|
try {
|
|
|
|
|
List sysLocaleLanguageList = sysLocaleLanguageService.findSysLocaleLanguageByStatus(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue());
|
|
|
|
|
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultList(sysLocaleLanguageList);
|
|
|
|
|
}catch(ImppBusiException busExcep){
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/system-info")
|
|
|
|
|
@ApiOperation(value = "查询可用语言",notes = "查询可用语言")
|
|
|
|
|
public ResultBean getSystemInfo(){
|
|
|
|
|
@ApiOperation(value = "查询可用语言", notes = "查询可用语言")
|
|
|
|
|
public ResultBean getSystemInfo() {
|
|
|
|
|
try {
|
|
|
|
|
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultList(configService.findSystemInfoConfig());
|
|
|
|
|
}catch(ImppBusiException busExcep){
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping(value="/auth/logout")
|
|
|
|
|
@ApiOperation(value="登出",notes="登出")
|
|
|
|
|
public ResultBean logout(){
|
|
|
|
|
@GetMapping(value = "/auth/logout")
|
|
|
|
|
@ApiOperation(value = "登出", notes = "登出")
|
|
|
|
|
public ResultBean logout() {
|
|
|
|
|
LOGGER.info("用户退出...");
|
|
|
|
|
try {
|
|
|
|
|
AuthUtil.logout();
|
|
|
|
|
return new ResultBean(true,"您已安全退出。").build();
|
|
|
|
|
return new ResultBean(true, "您已安全退出。").build();
|
|
|
|
|
} catch (ImppBusiException e) {
|
|
|
|
|
return new ResultBean(false,e.getErrorDetail() + "-[解决]" + e.getErrorSolution());
|
|
|
|
|
return new ResultBean(false, e.getErrorDetail() + "-[解决]" + e.getErrorSolution());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping(value="/auth/login")
|
|
|
|
|
@ApiOperation(value="登陆",notes="登陆")
|
|
|
|
|
@GetMapping(value = "/auth/login")
|
|
|
|
|
@ApiOperation(value = "登陆", notes = "登陆")
|
|
|
|
|
public ResultBean login(HttpServletRequest request, String loginName, String loginPwd,
|
|
|
|
|
@RequestParam(required = false) String languageCode,
|
|
|
|
|
@RequestParam(required = false) String deviceId){
|
|
|
|
|
@RequestParam(required = false) String deviceId) {
|
|
|
|
|
Long startTime = System.currentTimeMillis();
|
|
|
|
|
startMultiService();
|
|
|
|
|
licenseClickService.checkLicenseNumberLogin();
|
|
|
|
|
|
|
|
|
|
LOGGER.info("用户登陆 loginName:{} loginPwd:{} languageCode:{}",loginName,loginPwd,languageCode);
|
|
|
|
|
LOGGER.info("用户登陆 loginName:{} loginPwd:{} languageCode:{}", loginName, loginPwd, languageCode);
|
|
|
|
|
ResultBean result = null;
|
|
|
|
|
CommonEnumUtil.USER_LOGIN_STATUS userLoginStatus = CommonEnumUtil.USER_LOGIN_STATUS.LOGIN_SUCCESS;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
ValidatorBean.checkNotNull(languageCode,"语言不能为空");
|
|
|
|
|
ValidatorBean.checkNotNull(languageCode, "语言不能为空");
|
|
|
|
|
// TODO 后期移除,暂时用于避免自动登录后前台没有正确的传输组织代码信息
|
|
|
|
|
if ("null".equals(languageCode)) {
|
|
|
|
|
languageCode = DEFAULT_LANGUAGE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 设置语言代码
|
|
|
|
|
BaseThreadLocal.setData(BaseThreadLocal.LANGUAGE_CODE, languageCode);
|
|
|
|
|
|
|
|
|
|
ValidatorBean.checkNotNull(loginName,"用户名不能为空");
|
|
|
|
|
ValidatorBean.checkNotNull(loginPwd,"密码不能为空");
|
|
|
|
|
ValidatorBean.checkNotNull(loginName, "用户名不能为空");
|
|
|
|
|
ValidatorBean.checkNotNull(loginPwd, "密码不能为空");
|
|
|
|
|
|
|
|
|
|
int sessionMode = RedisCacheTool.getSysConfigIntVal(CommonConstWords.CONFIG_SESSION_MODE, CommonConstWords.CONFIG_SESSION_MODE_DEFAULT);
|
|
|
|
|
if (sessionMode != CommonEnumUtil.SESSION_MODE.SEIZE.getValue()) {
|
|
|
|
|
logout();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SessionUser user = userService.queryUserLogin(loginName.trim(), loginPwd.trim(), languageCode, getLoginPlatform().getValue(),deviceId);
|
|
|
|
|
SessionUser user = userService.queryUserLogin(loginName.trim(), loginPwd.trim(), languageCode, getLoginPlatform().getValue(), deviceId);
|
|
|
|
|
|
|
|
|
|
String redisKey = CommonConstWords.USER_LOGIN_ERROR + "_" + user.getUser().getId();
|
|
|
|
|
redisCore.deleteKey(redisKey);
|
|
|
|
@ -191,11 +197,11 @@ public class WhiteController extends CoreBaseController {
|
|
|
|
|
result.setUrl("/");
|
|
|
|
|
|
|
|
|
|
// 记录登录记录
|
|
|
|
|
recordSysUserLog(user.getUser().getUserInfoId(), loginName,CommonEnumUtil.USER_LOGIN_STATUS.LOGIN_SUCCESS.getValue());
|
|
|
|
|
recordSysUserLog(user.getUser().getUserInfoId(), loginName, CommonEnumUtil.USER_LOGIN_STATUS.LOGIN_SUCCESS.getValue());
|
|
|
|
|
AuthUtil.setOrganize(user.getUser().getOrganize());
|
|
|
|
|
} catch (IncorrectCredentialsException e) {
|
|
|
|
|
result = ResultBean.fail(ImppExceptionEnum.LOGIN_EXCEPTION_USER_PASSWORD);
|
|
|
|
|
userPasswordUtil.checkLoginErrorNumber(loginName,result,e);
|
|
|
|
|
userPasswordUtil.checkLoginErrorNumber(loginName, result, e);
|
|
|
|
|
|
|
|
|
|
userLoginStatus = CommonEnumUtil.USER_LOGIN_STATUS.WRONG_PASSWORD;
|
|
|
|
|
} catch (CredentialsException e) {
|
|
|
|
@ -234,16 +240,16 @@ public class WhiteController extends CoreBaseController {
|
|
|
|
|
|
|
|
|
|
// 记录登录记录
|
|
|
|
|
userLoginStatus = CommonEnumUtil.USER_LOGIN_STATUS.SYSTEM_ERROR;
|
|
|
|
|
}finally {
|
|
|
|
|
} finally {
|
|
|
|
|
// 记录登录记录
|
|
|
|
|
recordSysUserLog(null, loginName,userLoginStatus.getValue());
|
|
|
|
|
recordSysUserLog(null, loginName, userLoginStatus.getValue());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
LOGGER.info("会员{}登陆登录完成 ,语言:{} , 登录耗时:{}",loginName,BaseThreadLocal.getThreadLanguageCode(),(System.currentTimeMillis() - startTime));
|
|
|
|
|
LOGGER.info("会员{}登陆登录完成 ,语言:{} , 登录耗时:{}", loginName, BaseThreadLocal.getThreadLanguageCode(), (System.currentTimeMillis() - startTime));
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void recordSysUserLog(Long userId, String username,Integer userLoginStatus){
|
|
|
|
|
private void recordSysUserLog(Long userId, String username, Integer userLoginStatus) {
|
|
|
|
|
SysLogUserLogin log = new SysLogUserLogin();
|
|
|
|
|
|
|
|
|
|
log.setUserId(userId);
|
|
|
|
@ -259,11 +265,11 @@ public class WhiteController extends CoreBaseController {
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/find-language-code")
|
|
|
|
|
@ApiOperation(value = "根据语言代码查询资源")
|
|
|
|
|
public ResultBean findSysLocaleResourceByLanguageCode(String languageCode){
|
|
|
|
|
public ResultBean findSysLocaleResourceByLanguageCode(String languageCode) {
|
|
|
|
|
try {
|
|
|
|
|
startMultiService();
|
|
|
|
|
|
|
|
|
|
ValidatorBean.checkNotNull(languageCode,"语言代码不能为空");
|
|
|
|
|
ValidatorBean.checkNotNull(languageCode, "语言代码不能为空");
|
|
|
|
|
if (sysLocaleLanguageService.getSysLocaleLanguageByCode(languageCode) == null) {
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
@ -274,23 +280,23 @@ public class WhiteController extends CoreBaseController {
|
|
|
|
|
|
|
|
|
|
// 从缓存获取语言信息
|
|
|
|
|
Map<Object, Object> resourceMap =
|
|
|
|
|
redisRes.getHashMap(CommonConstWords.REDIS_PREFIX_CACHE_LANGUAGE_WEB+ ":" + languageCode);
|
|
|
|
|
redisRes.getHashMap(CommonConstWords.REDIS_PREFIX_CACHE_LANGUAGE_WEB + ":" + languageCode);
|
|
|
|
|
if (resourceMap == null || resourceMap.size() == 0) {
|
|
|
|
|
systemInitService.putAndLoadSysLocaleLanguage();
|
|
|
|
|
resourceMap = redisRes.getHashMap(CommonConstWords.REDIS_PREFIX_CACHE_LANGUAGE_WEB + ":" + languageCode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultMap(resourceMap);
|
|
|
|
|
}catch(ImppBusiException busExcep){
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping(value = "/sys-locale-resource/query")
|
|
|
|
|
@ApiOperation(value = "按条件查询资源")
|
|
|
|
|
public ResultBean findSysLocaleResource(@RequestBody CloudPagerModel<SysLocaleResource> pagerModel){
|
|
|
|
|
public ResultBean findSysLocaleResource(@RequestBody CloudPagerModel<SysLocaleResource> pagerModel) {
|
|
|
|
|
try {
|
|
|
|
|
ListPager<SysLocaleResource> resourceList = sysLocaleResourceService.querySysLocaleResourceByPager(
|
|
|
|
|
pagerModel.getObj(), pagerModel.getPager()
|
|
|
|
@ -298,40 +304,39 @@ public class WhiteController extends CoreBaseController {
|
|
|
|
|
return ResultBean.success("操作成功")
|
|
|
|
|
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode())
|
|
|
|
|
.setListPager(resourceList);
|
|
|
|
|
}catch(ImppBusiException busExcep){
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping(value = "/find-resource")
|
|
|
|
|
@ApiOperation(value = "按条件查询资源")
|
|
|
|
|
public ResultBean<SysLocaleResource> findSysLocaleResource(@RequestBody SysLocaleResource resource){
|
|
|
|
|
public ResultBean<SysLocaleResource> findSysLocaleResource(@RequestBody SysLocaleResource resource) {
|
|
|
|
|
try {
|
|
|
|
|
startMultiService();
|
|
|
|
|
|
|
|
|
|
List<SysLocaleResource> resourceList = sysLocaleResourceService.findSysLocaleResource(resource);
|
|
|
|
|
|
|
|
|
|
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultList(resourceList);
|
|
|
|
|
}catch(ImppBusiException busExcep){
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/find-language-code-soft-type")
|
|
|
|
|
@ApiOperation(value = "根据语言代码查询资源")
|
|
|
|
|
public ResultBean findSysLocaleResourceByLanguageCode(String languageCode,Integer softType,
|
|
|
|
|
@RequestParam(defaultValue = "2") Integer needPlatformRes){
|
|
|
|
|
public ResultBean findSysLocaleResourceByLanguageCode(String languageCode, Integer softType,
|
|
|
|
|
@RequestParam(defaultValue = "2") Integer needPlatformRes) {
|
|
|
|
|
try {
|
|
|
|
|
startMultiService();
|
|
|
|
|
|
|
|
|
|
ValidatorBean.checkNotNull(languageCode,"语言代码不能为空");
|
|
|
|
|
ValidatorBean.checkNotNull(softType,"软件类型不能为空");
|
|
|
|
|
ValidatorBean.checkNotNull(languageCode, "语言代码不能为空");
|
|
|
|
|
ValidatorBean.checkNotNull(softType, "软件类型不能为空");
|
|
|
|
|
if (sysLocaleLanguageService.getSysLocaleLanguageByCode(languageCode) == null) {
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
@ -348,16 +353,17 @@ public class WhiteController extends CoreBaseController {
|
|
|
|
|
resourceMap = redisRes.getHashMap(CommonConstWords.REDIS_PREFIX_CACHE_LANGUAGE_WEB + ":" + languageCode + ":" + softType);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(needPlatformRes.intValue() == CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()){
|
|
|
|
|
if (needPlatformRes.intValue() == CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) {
|
|
|
|
|
Map<Object, Object> platformResMap =
|
|
|
|
|
redisRes.getHashMap(CommonConstWords.REDIS_PREFIX_CACHE_LANGUAGE_WEB + ":" + languageCode + ":" + CommonEnumUtil.SOFT_TYPE.IMPP.getValue());;
|
|
|
|
|
redisRes.getHashMap(CommonConstWords.REDIS_PREFIX_CACHE_LANGUAGE_WEB + ":" + languageCode + ":" + CommonEnumUtil.SOFT_TYPE.IMPP.getValue());
|
|
|
|
|
;
|
|
|
|
|
resourceMap.putAll(platformResMap);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultMap(resourceMap);
|
|
|
|
|
}catch(ImppBusiException busExcep){
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -365,7 +371,7 @@ public class WhiteController extends CoreBaseController {
|
|
|
|
|
|
|
|
|
|
@PostMapping(value = "/sys-file/insert")
|
|
|
|
|
@ApiOperation(value = "新增文件资源", notes = "新增文件资源")
|
|
|
|
|
public ResultBean insertSysFile(@RequestBody SysFile sysFile){
|
|
|
|
|
public ResultBean insertSysFile(@RequestBody SysFile sysFile) {
|
|
|
|
|
try {
|
|
|
|
|
startMultiService();
|
|
|
|
|
|
|
|
|
@ -379,11 +385,11 @@ public class WhiteController extends CoreBaseController {
|
|
|
|
|
// 文件类型验证
|
|
|
|
|
SysDictionary dictionary = dictionaryService.getSysDictionaryByParentCodeAndValue(BaseConstWords.DICTIONARY_FILE_TYPE,
|
|
|
|
|
StringTool.getStringFileSuffix(sysFile.getFileOriginalName(), true));
|
|
|
|
|
if(dictionary == null){
|
|
|
|
|
if (dictionary == null) {
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION_FORMAT.getCode())
|
|
|
|
|
.setErrorDetail("文件格式不支持 %s",sysFile.getFileOriginalName())
|
|
|
|
|
.setErrorDetail("文件格式不支持 %s", sysFile.getFileOriginalName())
|
|
|
|
|
.setErrorSolution("请到字典管理中添加文件类型")
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
@ -392,19 +398,20 @@ public class WhiteController extends CoreBaseController {
|
|
|
|
|
sysFile.setFileTypeId(dictionary.getId());
|
|
|
|
|
sysFile.setFileTypeName(dictionary.getName());
|
|
|
|
|
|
|
|
|
|
ConvertBean.serviceModelInitialize(sysFile,"白名单");
|
|
|
|
|
ConvertBean.serviceModelInitialize(sysFile, "白名单");
|
|
|
|
|
|
|
|
|
|
sysFile = sysFileService.insertSysFile(sysFile);
|
|
|
|
|
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultObject(sysFile);
|
|
|
|
|
}catch(ImppBusiException busExcep){
|
|
|
|
|
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultObject(sysFile);
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据文件代码查询文件信息
|
|
|
|
|
*
|
|
|
|
|
* @param fileCode 文件代码
|
|
|
|
|
* @return 处理结果
|
|
|
|
|
*/
|
|
|
|
@ -416,10 +423,10 @@ public class WhiteController extends CoreBaseController {
|
|
|
|
|
ValidatorBean.checkNotNull(fileCode, "文件代码不能为空");
|
|
|
|
|
SysFile sysFile = sysFileService.getSysFileByFileCode(fileCode);
|
|
|
|
|
|
|
|
|
|
return ResultBean.success().setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultObject(sysFile);
|
|
|
|
|
}catch(ImppBusiException busExcep){
|
|
|
|
|
return ResultBean.success().setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultObject(sysFile);
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -464,14 +471,14 @@ public class WhiteController extends CoreBaseController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping(value = "/sys-find-user/list")
|
|
|
|
|
@ApiOperation(value = "查询用户列表信息",notes = "查询用户列表信息")
|
|
|
|
|
public ResultBean findSysUserInfoList(UserDetailModel model){
|
|
|
|
|
@ApiOperation(value = "查询用户列表信息", notes = "查询用户列表信息")
|
|
|
|
|
public ResultBean findSysUserInfoList(UserDetailModel model) {
|
|
|
|
|
try {
|
|
|
|
|
List<SysUser> userList = personnelService.querySysUserByUserDetailModelOrIds(model, new ArrayList<>());
|
|
|
|
|
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultList(userList);
|
|
|
|
|
}catch(ImppBusiException busExcep){
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -491,14 +498,14 @@ public class WhiteController extends CoreBaseController {
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
private CommonEnumUtil.LOG_LOGIN_PLATFORM getLoginPlatform(){
|
|
|
|
|
private CommonEnumUtil.LOG_LOGIN_PLATFORM getLoginPlatform() {
|
|
|
|
|
String value = CookieTool.getCookieValue(request, CommonConstWords.SESSION_LOGIN_PLATFORM);
|
|
|
|
|
if(StringUtils.isBlank(value)){
|
|
|
|
|
if (StringUtils.isBlank(value)) {
|
|
|
|
|
value = CommonEnumUtil.LOG_LOGIN_PLATFORM.PC_IMPP_CORE.getValue() + "";
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
try {
|
|
|
|
|
Integer.parseInt(value);
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION_FORMAT.getCode())
|
|
|
|
@ -513,55 +520,58 @@ public class WhiteController extends CoreBaseController {
|
|
|
|
|
|
|
|
|
|
@GetMapping("/sys-organize/list")
|
|
|
|
|
@ApiOperation(value = "获取全部组织", notes = "获取全部组织")
|
|
|
|
|
public ResultBean<SysOrganize> findSysOrganizeList(){
|
|
|
|
|
public ResultBean<SysOrganize> findSysOrganizeList() {
|
|
|
|
|
try {
|
|
|
|
|
List<SysOrganize> sysOrganizeList = sysOrganizeService.findAll();
|
|
|
|
|
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultList(sysOrganizeList);
|
|
|
|
|
}catch(ImppBusiException busExcep){
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询全部打印模板
|
|
|
|
|
*
|
|
|
|
|
* @return 处理结果
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping(value = "/sys-label-template/list")
|
|
|
|
|
@ApiOperation(value = "查询全部打印模板",notes = "查询全部打印模板")
|
|
|
|
|
public ResultBean<SysLabelTemplate> findSysConfigAll(@RequestBody SysLabelTemplate template){
|
|
|
|
|
@ApiOperation(value = "查询全部打印模板", notes = "查询全部打印模板")
|
|
|
|
|
public ResultBean<SysLabelTemplate> findSysConfigAll(@RequestBody SysLabelTemplate template) {
|
|
|
|
|
try {
|
|
|
|
|
List<SysLabelTemplate> sysLabelTemplateList = sysLabelTemplateService.listSysLabelTemplateDetail(template);;
|
|
|
|
|
return ResultBean.success("操作成功")
|
|
|
|
|
List<SysLabelTemplate> sysLabelTemplateList = sysLabelTemplateService.listSysLabelTemplateDetail(template);
|
|
|
|
|
;
|
|
|
|
|
return ResultBean.success("操作成功")
|
|
|
|
|
.setResultList(sysLabelTemplateList)
|
|
|
|
|
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
|
}catch(ImppBusiException busExcep){
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询未翻译的资源
|
|
|
|
|
*
|
|
|
|
|
* @return 处理结果
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping(value = "/locale-resource/no-resource")
|
|
|
|
|
@ApiOperation(value = "查询未翻译的资源",notes = "查询未翻译的资源")
|
|
|
|
|
public ResultBean<SysLabelTemplate> findSysConfigAll(){
|
|
|
|
|
@ApiOperation(value = "查询未翻译的资源", notes = "查询未翻译的资源")
|
|
|
|
|
public ResultBean<SysLabelTemplate> findSysConfigAll() {
|
|
|
|
|
try {
|
|
|
|
|
Set<String> keys = redisRes.getKeysSet(CommonConstWords.REDIS_PREFIX_CACHE_NO_RES+"*");
|
|
|
|
|
Set<String> keys = redisRes.getKeysSet(CommonConstWords.REDIS_PREFIX_CACHE_NO_RES + "*");
|
|
|
|
|
List<String> list = new ArrayList<>();
|
|
|
|
|
for (String key : keys) {
|
|
|
|
|
list.add(redisRes.getObject(key).toString());
|
|
|
|
|
}
|
|
|
|
|
return ResultBean.success("操作成功")
|
|
|
|
|
return ResultBean.success("操作成功")
|
|
|
|
|
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode())
|
|
|
|
|
.setResultList(list);
|
|
|
|
|
}catch(ImppBusiException busExcep){
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -587,6 +597,7 @@ public class WhiteController extends CoreBaseController {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 缺失资源
|
|
|
|
|
*
|
|
|
|
|
* @param key
|
|
|
|
|
* @param menuCode
|
|
|
|
|
* @return
|
|
|
|
@ -594,10 +605,10 @@ public class WhiteController extends CoreBaseController {
|
|
|
|
|
@AnnoIgnoreLog
|
|
|
|
|
@PostMapping(value = "/miss-resource/get")
|
|
|
|
|
@ApiOperation(value = "缺失资源", notes = "缺失资源")
|
|
|
|
|
public ResultBean getMissResourceByKey(String key,String menuCode){
|
|
|
|
|
public ResultBean getMissResourceByKey(String key, String menuCode) {
|
|
|
|
|
try {
|
|
|
|
|
Map<String,String> missResource = new HashMap<>();
|
|
|
|
|
missResource.put(key,menuCode);
|
|
|
|
|
Map<String, String> missResource = new HashMap<>();
|
|
|
|
|
missResource.put(key, menuCode);
|
|
|
|
|
rabbitTemplate.convertAndSend(PlatformConstWords.QUEUE_IMPP_RESOURCE, JsonUtilTool.encode(missResource));
|
|
|
|
|
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
@ -615,7 +626,7 @@ public class WhiteController extends CoreBaseController {
|
|
|
|
|
@AnnoIgnoreLog
|
|
|
|
|
@GetMapping(value = "/miss-resource/web-listener-switch")
|
|
|
|
|
@ApiOperation(value = "缺失资源开关", notes = "缺失资源开关")
|
|
|
|
|
public ResultBean getWebMissResourceSwitch(){
|
|
|
|
|
public ResultBean getWebMissResourceSwitch() {
|
|
|
|
|
try {
|
|
|
|
|
int webListener = RedisCacheTool.getSysConfigIntVal(PlatformConstWords.WEB_MISS_RESOURCE_LISTENER_SWITCH,
|
|
|
|
|
CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
|
|
|
|
@ -630,12 +641,12 @@ public class WhiteController extends CoreBaseController {
|
|
|
|
|
|
|
|
|
|
@PostMapping(value = "/license")
|
|
|
|
|
@ApiOperation(value = "更新授权", notes = "更新授权")
|
|
|
|
|
public ResultBean updateLicense(String content){
|
|
|
|
|
public ResultBean updateLicense(String content) {
|
|
|
|
|
try {
|
|
|
|
|
ImppLicense license = ImppLicenseDecoder.getLicenseDecoder(content);
|
|
|
|
|
if(Objects.nonNull(license)){
|
|
|
|
|
if (Objects.nonNull(license)) {
|
|
|
|
|
ImppLicenseTool.updateImppLicense(license);
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
return ResultBean.fail("错误的授权信息");
|
|
|
|
|
}
|
|
|
|
|
return ResultBean.success("操作成功");
|
|
|
|
@ -648,10 +659,10 @@ public class WhiteController extends CoreBaseController {
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/forced-offline/{loginName}")
|
|
|
|
|
@ApiOperation(value = "强制下线", notes = "强制下线")
|
|
|
|
|
public ResultBean forcedOffline(@PathVariable("loginName") String loginName){
|
|
|
|
|
public ResultBean forcedOffline(@PathVariable("loginName") String loginName) {
|
|
|
|
|
try {
|
|
|
|
|
SysUser sysUser = userService.getSysUserByLoginName(loginName);
|
|
|
|
|
ValidatorBean.checkNotNull(sysUser,"用户不存在,请检查【登录名】");
|
|
|
|
|
ValidatorBean.checkNotNull(sysUser, "用户不存在,请检查【登录名】");
|
|
|
|
|
redisSession.deleteBatchKey(CommonConstWords.SESSION_USER + ":*_" + sysUser.getId());
|
|
|
|
|
return ResultBean.success("操作成功");
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
@ -670,6 +681,7 @@ public class WhiteController extends CoreBaseController {
|
|
|
|
|
/********************************************SWEB所需接口*******************************************/
|
|
|
|
|
/**
|
|
|
|
|
* 添加用户信息
|
|
|
|
|
*
|
|
|
|
|
* @param model 用户信息
|
|
|
|
|
* @return 处理结果
|
|
|
|
|
*/
|
|
|
|
@ -681,6 +693,7 @@ public class WhiteController extends CoreBaseController {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 修改用户信息
|
|
|
|
|
*
|
|
|
|
|
* @param model 用户信息
|
|
|
|
|
* @return 处理结果
|
|
|
|
|
*/
|
|
|
|
@ -692,6 +705,7 @@ public class WhiteController extends CoreBaseController {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 删除用户信息
|
|
|
|
|
*
|
|
|
|
|
* @param id 用户id
|
|
|
|
|
* @return 处理结果
|
|
|
|
|
*/
|
|
|
|
@ -703,11 +717,12 @@ public class WhiteController extends CoreBaseController {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询用户信息
|
|
|
|
|
*
|
|
|
|
|
* @param cloudPagerModel 查询条件
|
|
|
|
|
* @return 处理结果
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping(value="/user/query")
|
|
|
|
|
@ApiOperation(value="查询用户信息",notes="复杂查询用户信息带分页")
|
|
|
|
|
@PostMapping(value = "/user/query")
|
|
|
|
|
@ApiOperation(value = "查询用户信息", notes = "复杂查询用户信息带分页")
|
|
|
|
|
public ResultBean querySysUserInfo(@RequestBody CloudPagerModel<SysUserInfo> cloudPagerModel) {
|
|
|
|
|
return sysUserInfoController.querySysUserInfo(cloudPagerModel.getObj(), cloudPagerModel.getPager());
|
|
|
|
|
}
|
|
|
|
|