Merge branch 'dev' into test

yun-zuoyi
allen.zhang 6 years ago
commit ec56ff968d

@ -36,6 +36,9 @@ public interface IPersonnelService {
@ApiOperation(value = "更新用户状态") @ApiOperation(value = "更新用户状态")
void updateSysUserInfoStatus(Long userInfoId,Integer status); void updateSysUserInfoStatus(Long userInfoId,Integer status);
@ApiOperation(value = "修改用户主组织信息")
void updateSysUserOrganize(Long userId, Long organizeId);
@ApiOperation(value = "删除账号信息") @ApiOperation(value = "删除账号信息")
void deleteSysUser(Long[] userIdList,String userName); void deleteSysUser(Long[] userIdList,String userName);

@ -77,6 +77,23 @@ public class AuthController extends CoreBaseController {
} }
} }
/**
*
*
* @return
*/
@GetMapping(value = "/get-user-organize")
@ApiOperation(value = "获取会话用户组织信息", notes = "获取当前登录用户账号详细信息")
public ResultBean getUserOrganize() {
LOGGER.info("获取用户信息...lang:{}", AuthUtil.getSessionAttribute("languageCode"));
try {
return new ResultBean(true, "", AuthUtil.getOrganize());
} catch (ImppBusiException e) {
return new ResultBean(false, e.getErrorDetail() + "-[解决]" + e.getErrorSolution());
}
}
/** /**
* *
* *

@ -625,7 +625,7 @@ public class PersonnelController extends CoreBaseController {
// 会话工厂信息保存进Redis // 会话工厂信息保存进Redis
AuthUtil.setOrganize(organize); AuthUtil.setOrganize(organize);
personnelService.updateSysUserOrganize(AuthUtil.getSessionUser().getUser().getId(),organize.getId());
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultObject(organize); return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultObject(organize);
} catch (ImppBusiException busExcep) { } catch (ImppBusiException busExcep) {
return ResultBean.fail(busExcep); return ResultBean.fail(busExcep);

@ -65,7 +65,7 @@ public class SysLocaleLanguageController extends CoreBaseController {
sysLocaleLanguageService.insertSysLocaleLanguage(sysLocaleLanguage); sysLocaleLanguageService.insertSysLocaleLanguage(sysLocaleLanguage);
redisCore.putHashMap(CommonConstWords.REDIS_PREFIX_CACHE_LANGUAGE + sysLocaleLanguage.getLanguageCode(),new HashMap<>()); redisCore.putHashMap(CommonConstWords.REDIS_PREFIX_CACHE_LANGUAGE + ":" + sysLocaleLanguage.getLanguageCode(),new HashMap<>());
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()); return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
}catch(ImppBusiException busExcep){ }catch(ImppBusiException busExcep){
return ResultBean.fail(busExcep); return ResultBean.fail(busExcep);

@ -306,7 +306,7 @@ public class SysMenuController extends CoreBaseController {
ValidatorBean.checkNotNull(menu.getParentId(), "父级功能ID不能为空"); ValidatorBean.checkNotNull(menu.getParentId(), "父级功能ID不能为空");
menu.setId(Long.parseLong(menu.getMenuCode())); menu.setId(Long.parseLong(menu.getMenuCode()));
menu.setMenuSort(Integer.parseInt(menu.getMenuCode())); menu.setMenuSort(10000);
if (!map.containsKey(menu.getMenuCode())) { if (!map.containsKey(menu.getMenuCode())) {
map.put(menu.getMenuCode(),menu); map.put(menu.getMenuCode(),menu);
} else { } else {

@ -17,6 +17,7 @@ import cn.estsh.impp.framework.base.controller.CoreBaseController;
import cn.estsh.impp.framework.boot.exception.ImppBusiException; import cn.estsh.impp.framework.boot.exception.ImppBusiException;
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder; import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
import cn.estsh.impp.framework.boot.util.ResultBean; import cn.estsh.impp.framework.boot.util.ResultBean;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;

@ -78,7 +78,8 @@ public class SystemInitService implements ISystemInitService {
try { try {
List<SysDictionary> list = dictionaryRDao.findAll(); List<SysDictionary> list = dictionaryRDao.findAll();
if(list != null && list.size() > 0){ if(list != null && list.size() > 0){
Map<String, List<SysDictionary>> parentCodeMap = list.stream().collect(Collectors.groupingBy(SysDictionary::getParentCodeRdd)); list.stream().filter(sysDictionary-> sysDictionary.getParentCodeRdd() != null).forEach(System.out :: print);
Map<String, List<SysDictionary>> parentCodeMap = list.stream().filter(sysDictionary-> sysDictionary.getParentCodeRdd() != null).collect(Collectors.groupingBy(SysDictionary::getParentCodeRdd));
Map<Long, List<SysDictionary>> parentIdMap = list.stream().collect(Collectors.groupingBy(SysDictionary::getParentId)); Map<Long, List<SysDictionary>> parentIdMap = list.stream().collect(Collectors.groupingBy(SysDictionary::getParentId));
for (String key : parentCodeMap.keySet()) { for (String key : parentCodeMap.keySet()) {

@ -113,6 +113,16 @@ public class PersonnelServiceService implements IPersonnelService {
} }
@Override @Override
public void updateSysUserOrganize(Long userId, Long organizeId) {
LOGGER.debug("平台账号 SysUser userId:{} organizeId",userId, organizeId);
SysUser user = userRDao.getById(userId);
if(user != null){
user.setOrganizeId(organizeId);
userRDao.save(user);
}
}
@Override
@ApiOperation(value = "删除账号信息") @ApiOperation(value = "删除账号信息")
public void deleteSysUser(Long[] userIdList,String userName) { public void deleteSysUser(Long[] userIdList,String userName) {
LOGGER.debug("平台账号 SysUser userIdList:{}", userIdList); LOGGER.debug("平台账号 SysUser userIdList:{}", userIdList);

@ -39,7 +39,7 @@ public class SysDictionaryService implements ISysDictionaryService {
public void insertSysDictionary(SysDictionary sysDictionary) { public void insertSysDictionary(SysDictionary sysDictionary) {
long repeatCodeCount = sysDictionaryRDao.findByPropertyCount(new String[]{"dictionaryCode", "dictionarySoftType"}, long repeatCodeCount = sysDictionaryRDao.findByPropertyCount(new String[]{"dictionaryCode", "dictionarySoftType"},
new Object[]{sysDictionary.getDictionaryCode(), sysDictionary.getDictionarySoftType()}); new Object[]{sysDictionary.getDictionaryCode(), sysDictionary.getDictionarySoftType()});
if (repeatCodeCount > 0) { if (sysDictionary.getParentIdVal() == CommonEnumUtil.PARENT.DEFAULT.getValue() &&repeatCodeCount > 0) {
throw ImppExceptionBuilder.newInstance() throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode()) .setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION_DATA_EXIT.getCode()) .setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION_DATA_EXIT.getCode())
@ -87,7 +87,7 @@ public class SysDictionaryService implements ISysDictionaryService {
// 校验唯一 // 校验唯一
String hqlPack = CoreHqlPack.packHqlSysDictionaryCode(sysDictionary); String hqlPack = CoreHqlPack.packHqlSysDictionaryCode(sysDictionary);
long repeatCodeCount = sysDictionaryRDao.findByHqlWhereCount(hqlPack); long repeatCodeCount = sysDictionaryRDao.findByHqlWhereCount(hqlPack);
if (repeatCodeCount > 0) { if (sysDictionary.getParentIdVal() == CommonEnumUtil.PARENT.DEFAULT.getValue() &&repeatCodeCount > 0) {
throw ImppExceptionBuilder.newInstance() throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode()) .setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION_DATA_EXIT.getCode()) .setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION_DATA_EXIT.getCode())

Loading…
Cancel
Save