|
@@ -100,22 +100,22 @@ public class UserController {
|
|
|
@GetMapping("queryById")
|
|
|
@ApiOperation(value = "查询用户")
|
|
|
public ResponseEntity queryById(@RequestParam("id") String id) {
|
|
|
- UserDTO userDTO = userService.get ( id );
|
|
|
+ UserDTO userDTO = userService.get(id);
|
|
|
if (ObjectUtil.isNotEmpty(userDTO) && StringUtils.isNotBlank(userDTO.getPhoto())) {
|
|
|
String lsUrl = UserUtils.getLsUrl(userDTO.getPhoto());
|
|
|
userDTO.setPhoto(lsUrl);
|
|
|
}
|
|
|
- if(StringUtils.isNotBlank(userDTO.getManageOfficeIds())){
|
|
|
+ if (StringUtils.isNotBlank(userDTO.getManageOfficeIds())) {
|
|
|
//获取当前人管理的部门id
|
|
|
- List<String> manageOfficeIdList=Arrays.asList(userDTO.getManageOfficeIds().split(","));
|
|
|
+ List<String> manageOfficeIdList = Arrays.asList(userDTO.getManageOfficeIds().split(","));
|
|
|
//查询这些部门信息
|
|
|
List<String> officeNameList = officeService.getOfficeNameByIds(manageOfficeIdList);
|
|
|
userDTO.setManageOfficeNameList(officeNameList);
|
|
|
}
|
|
|
- if(ObjectUtil.isNotEmpty(userDTO)) {
|
|
|
- if(CollectionUtil.isNotEmpty(userDTO.getCertDTOList())){
|
|
|
- userDTO.getCertDTOList().stream().forEach(item->{
|
|
|
- if (StringUtils.isNotBlank(item.getFileUrl())){
|
|
|
+ if (ObjectUtil.isNotEmpty(userDTO)) {
|
|
|
+ if (CollectionUtil.isNotEmpty(userDTO.getCertDTOList())) {
|
|
|
+ userDTO.getCertDTOList().stream().forEach(item -> {
|
|
|
+ if (StringUtils.isNotBlank(item.getFileUrl())) {
|
|
|
String fileTemporaryLookUrl = this.getFileTemporaryLookUrl(item.getFileUrl());
|
|
|
item.setFileLsUrl(fileTemporaryLookUrl);
|
|
|
}
|
|
@@ -123,19 +123,19 @@ public class UserController {
|
|
|
}
|
|
|
}
|
|
|
//根据office.id 查询部门的所有父节点信息
|
|
|
- if(null != userDTO.getOfficeDTO() && StringUtils.isNotBlank(userDTO.getOfficeDTO().getId())){
|
|
|
+ if (null != userDTO.getOfficeDTO() && StringUtils.isNotBlank(userDTO.getOfficeDTO().getId())) {
|
|
|
OfficeDTO office = officeService.getOfficeById(userDTO.getOfficeDTO().getId());
|
|
|
//将office的父节点信息进行分割并查询赋值
|
|
|
- if(null != office){
|
|
|
+ if (null != office) {
|
|
|
List<String> officeIdList = Arrays.asList(office.getParentIds().split(","));
|
|
|
Integer sort = 0;
|
|
|
- if(null != officeIdList && officeIdList.size()>0){
|
|
|
+ if (null != officeIdList && officeIdList.size() > 0) {
|
|
|
for (String officeId : officeIdList) {
|
|
|
- if(StringUtils.isNotBlank(officeId) && !"0".equals(officeId)){
|
|
|
- sort ++ ;
|
|
|
+ if (StringUtils.isNotBlank(officeId) && !"0".equals(officeId)) {
|
|
|
+ sort++;
|
|
|
OfficeDTO officeChild = officeService.getOfficeById(officeId);
|
|
|
- if(null != officeChild) {
|
|
|
- switch (sort){
|
|
|
+ if (null != officeChild) {
|
|
|
+ switch (sort) {
|
|
|
case 1:
|
|
|
userDTO.setCompanyDTO(officeChild);
|
|
|
break;
|
|
@@ -153,7 +153,7 @@ public class UserController {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- return ResponseEntity.ok ( userDTO );
|
|
|
+ return ResponseEntity.ok(userDTO);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -167,20 +167,20 @@ public class UserController {
|
|
|
@ApiOperation(value = "用户数据列表")
|
|
|
//@PreAuthorize("hasAuthority('sys:user:list')")
|
|
|
@GetMapping("list")
|
|
|
- public ResponseEntity list(UserDTO userDTO, Page <UserDTO> page) throws Exception {
|
|
|
- QueryWrapper <UserDTO> queryWrapper = QueryWrapperGenerator.buildQueryCondition ( userDTO, UserDTO.class );
|
|
|
+ public ResponseEntity list(UserDTO userDTO, Page<UserDTO> page) throws Exception {
|
|
|
+ QueryWrapper<UserDTO> queryWrapper = QueryWrapperGenerator.buildQueryCondition(userDTO, UserDTO.class);
|
|
|
// 管理员查询不限制
|
|
|
if (!UserUtils.getCurrentUserDTO().isAdmin()) {
|
|
|
queryWrapper.isNull("a.is_admin");
|
|
|
- if (ObjectUtil.isNotEmpty(userDTO)){
|
|
|
+ if (ObjectUtil.isNotEmpty(userDTO)) {
|
|
|
if (ObjectUtil.isNotEmpty(userDTO.getCompanyDTO()) && ObjectUtil.isNotEmpty(userDTO.getOfficeDTO())) {
|
|
|
OfficeDTO officeDTO = UserUtils.getCurrentUserDTO().getOfficeDTO();
|
|
|
if (StringUtils.isNotBlank(userDTO.getCertType())) {
|
|
|
//获取当前登陆人是否事中审公司人员
|
|
|
- if(officeDTO.getParentIds().contains("1615171302381182978")){
|
|
|
+ if (officeDTO.getParentIds().contains("1615171302381182978")) {
|
|
|
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
// 当不是精确的部门查询时,再添加下面的筛选条件
|
|
|
if ((StringUtils.isNotBlank(userDTO.getCompanyDTO().getId()) && StringUtils.isBlank(userDTO.getOfficeDTO().getId()))
|
|
|
|| "true".equals(userDTO.getSelectAll())) {
|
|
@@ -193,13 +193,13 @@ public class UserController {
|
|
|
String[] split = ids.split(",");
|
|
|
// split.length大于2,说明当前登录人所属部门是普通部门,展示部分人员信息
|
|
|
// 否则,当前登录人所属公共类部门(忘了叫什么类部门了,就是总经办那种部门),展示全部人员信息
|
|
|
- if(split.length>2){
|
|
|
+ if (split.length > 2) {
|
|
|
companyId = split[2];
|
|
|
// 根据公司id,找到此公司下的所有部门
|
|
|
List<Office> officeList = officeService.list(new QueryWrapper<Office>().lambda().eq(Office::getParentId, companyId));
|
|
|
Set officeIdSet = new HashSet();
|
|
|
for (Office office : officeList) {
|
|
|
- if(StringUtils.isNotBlank(office.getId())){
|
|
|
+ if (StringUtils.isNotBlank(office.getId())) {
|
|
|
officeIdSet.add(office.getId());
|
|
|
}
|
|
|
}
|
|
@@ -207,18 +207,18 @@ public class UserController {
|
|
|
// 拿到这些部门的id
|
|
|
//List<String> officeIdList = officeList.stream().distinct().map(Office::getId).collect(Collectors.toList());
|
|
|
// 拿到所有公有部门的id
|
|
|
- List<String> officePublicIdList = officeService.list(new LambdaQueryWrapper<Office>().eq(Office::getIsPublic,"1")).stream().map(Office::getId).collect(Collectors.toList());
|
|
|
+ List<String> officePublicIdList = officeService.list(new LambdaQueryWrapper<Office>().eq(Office::getIsPublic, "1")).stream().map(Office::getId).collect(Collectors.toList());
|
|
|
// 拿到直属公司的id
|
|
|
officeIdList.add(companyId);
|
|
|
// 最后得到的所有部门的id
|
|
|
officeIdList.addAll(officePublicIdList);
|
|
|
List<String> lastIds = officeIdList.stream().distinct().collect(Collectors.toList());
|
|
|
// 添加筛选条件为这些部门的id
|
|
|
- queryWrapper.in("a.office_id",lastIds);
|
|
|
+ queryWrapper.in("a.office_id", lastIds);
|
|
|
}
|
|
|
- } else if(StringUtils.isBlank(userDTO.getCompanyDTO().getId()) && StringUtils.isNotBlank(userDTO.getOfficeDTO().getId())) {
|
|
|
+ } else if (StringUtils.isBlank(userDTO.getCompanyDTO().getId()) && StringUtils.isNotBlank(userDTO.getOfficeDTO().getId())) {
|
|
|
// officeDTO.id不是空,companyDTO.id是空的话,说明前端组件点击的部门查询
|
|
|
- queryWrapper.eq("a.office_id",userDTO.getOfficeDTO().getId());
|
|
|
+ queryWrapper.eq("a.office_id", userDTO.getOfficeDTO().getId());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -227,29 +227,71 @@ public class UserController {
|
|
|
if (ObjectUtil.isNotEmpty(userDTO)) {
|
|
|
// 当certType传值时,获取拥有此资格证类型的人员
|
|
|
if (StringUtils.isNotBlank(userDTO.getCertType())) {
|
|
|
- queryWrapper.eq("sc.type",userDTO.getCertType());
|
|
|
+ queryWrapper.eq("sc.type", userDTO.getCertType());
|
|
|
}
|
|
|
- if(StringUtils.isNotBlank(userDTO.getMobile())){
|
|
|
- queryWrapper.like("a.mobile",userDTO.getMobile());
|
|
|
+ if (StringUtils.isNotBlank(userDTO.getMobile())) {
|
|
|
+ queryWrapper.like("a.mobile", userDTO.getMobile());
|
|
|
}
|
|
|
}
|
|
|
- IPage <UserDTO> result = userService.findPage ( page, queryWrapper );
|
|
|
+ IPage<UserDTO> result = userService.findPage(page, queryWrapper);
|
|
|
//判断 如果是签字注师筛选,则获取签字注师的被选择次数
|
|
|
- if(StringUtils.isNotBlank(userDTO.getCertType()) && "6".equals(userDTO.getCertType())){
|
|
|
+ if (StringUtils.isNotBlank(userDTO.getCertType()) && "6".equals(userDTO.getCertType())) {
|
|
|
List<UserDTO> userList = result.getRecords();
|
|
|
for (UserDTO info : userList) {
|
|
|
if("潘中".equals(info.getName()) || "张宁".equals(info.getName()) || "孙文宝".equals(info.getName())){
|
|
|
info.setAccountantUserFlag(0);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
info.setAccountantUserFlag(1);
|
|
|
}
|
|
|
Integer accountantUserCount = userService.getAccountantUserCount(info.getId());
|
|
|
info.setAccountantUserCount(accountantUserCount);
|
|
|
}
|
|
|
}
|
|
|
- return ResponseEntity.ok ( result );
|
|
|
+ return ResponseEntity.ok(result);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @GetMapping("list2")
|
|
|
+ public ResponseEntity list2(UserDTO userDTO, Page<UserDTO> page) throws Exception {
|
|
|
+ if (ObjectUtil.isNotEmpty(userDTO.getOfficeDTO().getId())||ObjectUtil.isNotEmpty(userDTO.getLoginName())){
|
|
|
+ IPage<UserDTO> result = userService.findPage2(userDTO);
|
|
|
+ //判断 如果是签字注师筛选,则获取签字注师的被选择次数
|
|
|
+ if (StringUtils.isNotBlank(userDTO.getCertType()) && "6".equals(userDTO.getCertType())) {
|
|
|
+ List<UserDTO> userList = result.getRecords();
|
|
|
+ for (UserDTO info : userList) {
|
|
|
+ if ("潘中".equals(info.getName())) {
|
|
|
+ info.setAccountantUserFlag(0);
|
|
|
+ } else {
|
|
|
+ info.setAccountantUserFlag(1);
|
|
|
+ }
|
|
|
+ Integer accountantUserCount = userService.getAccountantUserCount(info.getId());
|
|
|
+ info.setAccountantUserCount(accountantUserCount);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ result.setTotal(result.getRecords().size());
|
|
|
+ return ResponseEntity.ok(result);
|
|
|
+
|
|
|
+ }else {
|
|
|
+ IPage<UserDTO> result = userService.findPage1(userDTO,page);
|
|
|
+ //判断 如果是签字注师筛选,则获取签字注师的被选择次数
|
|
|
+ if (StringUtils.isNotBlank(userDTO.getCertType()) && "6".equals(userDTO.getCertType())) {
|
|
|
+ List<UserDTO> userList = result.getRecords();
|
|
|
+ for (UserDTO info : userList) {
|
|
|
+ if ("潘中".equals(info.getName())) {
|
|
|
+ info.setAccountantUserFlag(0);
|
|
|
+ } else {
|
|
|
+ info.setAccountantUserFlag(1);
|
|
|
+ }
|
|
|
+ Integer accountantUserCount = userService.getAccountantUserCount(info.getId());
|
|
|
+ info.setAccountantUserCount(accountantUserCount);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ result.setTotal(result.getRecords().size());
|
|
|
+ return ResponseEntity.ok(result);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 保存用户
|
|
|
*
|
|
@@ -263,15 +305,15 @@ public class UserController {
|
|
|
@PostMapping("save")
|
|
|
public ResponseEntity save(@Valid @RequestBody UserDTO userDTO) throws Exception {
|
|
|
// 如果新密码为空,则不更换密码
|
|
|
- if ( StrUtil.isNotBlank ( userDTO.getNewPassword ( ) ) ) {
|
|
|
- userDTO.setPassword ( SecurityUtils.encryptPassword ( userDTO.getNewPassword ( ) ) );
|
|
|
+ if (StrUtil.isNotBlank(userDTO.getNewPassword())) {
|
|
|
+ userDTO.setPassword(SecurityUtils.encryptPassword(userDTO.getNewPassword()));
|
|
|
}
|
|
|
- if ( isCheckLoginName ( userDTO.getOldLoginName ( ),userDTO.getId(), userDTO.getLoginName ( ) ) ) {
|
|
|
- return ResponseEntity.badRequest ( ).body ( "保存用户'" + userDTO.getLoginName ( ) + "'失败,登录名已存在!" );
|
|
|
+ if (isCheckLoginName(userDTO.getOldLoginName(), userDTO.getId(), userDTO.getLoginName())) {
|
|
|
+ return ResponseEntity.badRequest().body("保存用户'" + userDTO.getLoginName() + "'失败,登录名已存在!");
|
|
|
}
|
|
|
// 保存用户信息
|
|
|
- userService.saveOrUpdate ( userDTO );
|
|
|
- return ResponseEntity.ok ( "保存用户'" + userDTO.getLoginName ( ) + "'成功!" );
|
|
|
+ userService.saveOrUpdate(userDTO);
|
|
|
+ return ResponseEntity.ok("保存用户'" + userDTO.getLoginName() + "'成功!");
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -287,7 +329,7 @@ public class UserController {
|
|
|
@PostMapping("saveCertList")
|
|
|
public ResponseEntity saveCertList(@Valid @RequestBody UserDTO userDTO) {
|
|
|
userService.saveCertList(userDTO);
|
|
|
- return ResponseEntity.ok ( "保存成功!" );
|
|
|
+ return ResponseEntity.ok("保存成功!");
|
|
|
}
|
|
|
|
|
|
|
|
@@ -304,11 +346,11 @@ public class UserController {
|
|
|
public ResponseEntity saveInfo(@RequestBody UserDTO userDTO) throws Exception {
|
|
|
//修改用户信息
|
|
|
//判断参数中手机号是否存在
|
|
|
- if(StringUtils.isNotBlank(userDTO.getMobile())){
|
|
|
+ if (StringUtils.isNotBlank(userDTO.getMobile())) {
|
|
|
//如果手机号存在,则根据手机号查询除当前更改人以外是否还存在手机号重复的情况,如果存在,则不允许更改
|
|
|
List<UserDTO> userList = userService.getUserInfoByMobile(userDTO);
|
|
|
- if (null != userList && userList.size()>0){
|
|
|
- return ResponseEntity.badRequest ( ).body ( "修改个人资料失败! 该手机号已存在,无法修改!" );
|
|
|
+ if (null != userList && userList.size() > 0) {
|
|
|
+ return ResponseEntity.badRequest().body("修改个人资料失败! 该手机号已存在,无法修改!");
|
|
|
}
|
|
|
}
|
|
|
return userService.updateInfo(userDTO);
|
|
@@ -323,26 +365,26 @@ public class UserController {
|
|
|
@PreAuthorize("hasAuthority('sys:user:del')")
|
|
|
@DeleteMapping("delete")
|
|
|
public ResponseEntity delete(String ids) {
|
|
|
- String idArray[] = ids.split ( "," );
|
|
|
- StringBuffer msg = new StringBuffer ( );
|
|
|
+ String idArray[] = ids.split(",");
|
|
|
+ StringBuffer msg = new StringBuffer();
|
|
|
boolean success = true;
|
|
|
for (String id : idArray) {
|
|
|
- UserDTO userDTO = userService.get ( id );
|
|
|
- if ( UserUtils.getCurrentUserDTO ( ).getId ( ).equals ( userDTO.getId ( ) ) ) {
|
|
|
+ UserDTO userDTO = userService.get(id);
|
|
|
+ if (UserUtils.getCurrentUserDTO().getId().equals(userDTO.getId())) {
|
|
|
success = false;
|
|
|
- msg.append ( "[" + userDTO.getLoginName ( ) + "]删除失败,不允许删除当前用户!<br/>" );
|
|
|
- } else if ( userDTO.isAdmin () ) {
|
|
|
+ msg.append("[" + userDTO.getLoginName() + "]删除失败,不允许删除当前用户!<br/>");
|
|
|
+ } else if (userDTO.isAdmin()) {
|
|
|
success = false;
|
|
|
- msg.append ( "[" + userDTO.getLoginName ( ) + "]删除失败,不允许删除超级管理员!<br/>" );//删除用户失败, 不允许删除超级管理员用户
|
|
|
+ msg.append("[" + userDTO.getLoginName() + "]删除失败,不允许删除超级管理员!<br/>");//删除用户失败, 不允许删除超级管理员用户
|
|
|
} else {
|
|
|
- msg.append ( "[" + userDTO.getLoginName ( ) + "]删除成功!<br/>" );
|
|
|
- userService.deleteUser ( userDTO );//删除用户成功
|
|
|
+ msg.append("[" + userDTO.getLoginName() + "]删除成功!<br/>");
|
|
|
+ userService.deleteUser(userDTO);//删除用户成功
|
|
|
}
|
|
|
}
|
|
|
- if ( success ) {
|
|
|
- return ResponseEntity.ok ( msg.toString ( ) );
|
|
|
+ if (success) {
|
|
|
+ return ResponseEntity.ok(msg.toString());
|
|
|
} else {
|
|
|
- return ResponseEntity.badRequest ( ).body ( msg.toString ( ) );
|
|
|
+ return ResponseEntity.badRequest().body(msg.toString());
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -358,22 +400,22 @@ public class UserController {
|
|
|
@PreAuthorize("hasAnyAuthority('sys:user:export')")
|
|
|
@GetMapping("export")
|
|
|
@ApiOperation(value = "导出用户excel")
|
|
|
- public void exportFile(UserDTO userDTO, Page <UserDTO> page, ExcelOptions options, HttpServletResponse response) throws Exception {
|
|
|
- String fileName = options.getFilename ( );
|
|
|
- QueryWrapper <UserDTO> queryWrapper = QueryWrapperGenerator.buildQueryCondition ( userDTO, UserDTO.class );
|
|
|
- List <UserDTO> result;
|
|
|
- if ( ExportMode.current.equals ( options.getMode ( ) ) ) {
|
|
|
- result = userService.findPage ( page, queryWrapper ).getRecords ( );
|
|
|
- } else if ( ExportMode.selected.equals ( options.getMode ( ) ) ) {
|
|
|
- result = userService.findPage ( page, queryWrapper ).getRecords ( ).stream ( ).filter ( userDTO1 ->
|
|
|
- options.getSelectIds ( ).contains ( userDTO1.getId ( ) )
|
|
|
- ).collect ( Collectors.toList ( ) );
|
|
|
+ public void exportFile(UserDTO userDTO, Page<UserDTO> page, ExcelOptions options, HttpServletResponse response) throws Exception {
|
|
|
+ String fileName = options.getFilename();
|
|
|
+ QueryWrapper<UserDTO> queryWrapper = QueryWrapperGenerator.buildQueryCondition(userDTO, UserDTO.class);
|
|
|
+ List<UserDTO> result;
|
|
|
+ if (ExportMode.current.equals(options.getMode())) {
|
|
|
+ result = userService.findPage(page, queryWrapper).getRecords();
|
|
|
+ } else if (ExportMode.selected.equals(options.getMode())) {
|
|
|
+ result = userService.findPage(page, queryWrapper).getRecords().stream().filter(userDTO1 ->
|
|
|
+ options.getSelectIds().contains(userDTO1.getId())
|
|
|
+ ).collect(Collectors.toList());
|
|
|
} else {
|
|
|
- page.setSize ( -1 );
|
|
|
- page.setCurrent ( 0 );
|
|
|
- result = userService.findPage ( page, queryWrapper ).getRecords ( );
|
|
|
+ page.setSize(-1);
|
|
|
+ page.setCurrent(0);
|
|
|
+ result = userService.findPage(page, queryWrapper).getRecords();
|
|
|
}
|
|
|
- EasyPoiUtil.exportExcel ( result, "用户数据", options.getSheetName ( ), UserDTO.class, fileName, response );
|
|
|
+ EasyPoiUtil.exportExcel(result, "用户数据", options.getSheetName(), UserDTO.class, fileName, response);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -390,21 +432,21 @@ public class UserController {
|
|
|
try {
|
|
|
Integer successNum = 0;
|
|
|
Integer failureNum = 0;
|
|
|
- StringBuilder failureMsg = new StringBuilder ( );
|
|
|
- List <UserDTO> list = EasyPoiUtil.importExcel ( file, 1, 2, UserDTO.class );
|
|
|
+ StringBuilder failureMsg = new StringBuilder();
|
|
|
+ List<UserDTO> list = EasyPoiUtil.importExcel(file, 1, 2, UserDTO.class);
|
|
|
for (UserDTO user : list) {
|
|
|
try {
|
|
|
- if ( isCheckLoginNameNoCache ( "", user.getLoginName ( ) ) ) {
|
|
|
- user.setPassword ( SecurityUtils.encryptPassword ( "123456" ) );
|
|
|
- BeanValidators.validateWithException ( validator, user );
|
|
|
+ if (isCheckLoginNameNoCache("", user.getLoginName())) {
|
|
|
+ user.setPassword(SecurityUtils.encryptPassword("123456"));
|
|
|
+ BeanValidators.validateWithException(validator, user);
|
|
|
//查询人员公司信息
|
|
|
- OfficeDTO company = officeService.getOfficeByName(user.getCompanyDTO().getName(),"");
|
|
|
- if(ObjectUtil.isNotEmpty(company)){
|
|
|
+ OfficeDTO company = officeService.getOfficeByName(user.getCompanyDTO().getName(), "");
|
|
|
+ if (ObjectUtil.isNotEmpty(company)) {
|
|
|
user.getCompanyDTO().setId(company.getId());
|
|
|
}
|
|
|
//查询人员部门信息
|
|
|
- OfficeDTO office = officeService.getOfficeByName(user.getOfficeDTO().getName(),user.getOfficeDTO().getParentName());
|
|
|
- if(ObjectUtil.isNotEmpty(office)){
|
|
|
+ OfficeDTO office = officeService.getOfficeByName(user.getOfficeDTO().getName(), user.getOfficeDTO().getParentName());
|
|
|
+ if (ObjectUtil.isNotEmpty(office)) {
|
|
|
user.getOfficeDTO().setId(office.getId());
|
|
|
}
|
|
|
user.setLoginFlag("1");
|
|
@@ -414,12 +456,12 @@ public class UserController {
|
|
|
userService.save(user1);
|
|
|
//人员角色添加
|
|
|
List<RoleDTO> roleDTOList = user.getRoleDTOList();
|
|
|
- if(roleDTOList.size()!=0){
|
|
|
- if(StrUtil.isNotEmpty(roleDTOList.get(0).getName())){
|
|
|
+ if (roleDTOList.size() != 0) {
|
|
|
+ if (StrUtil.isNotEmpty(roleDTOList.get(0).getName())) {
|
|
|
RoleDTO role = roleService.getRoleByName(user.getRoleDTOList().get(0).getName());
|
|
|
- if(ObjectUtil.isNotEmpty(role)){
|
|
|
+ if (ObjectUtil.isNotEmpty(role)) {
|
|
|
roleDTOList.get(0).setId(role.getId());
|
|
|
- userService.saveUserRole(user1.getId(),role.getId());
|
|
|
+ userService.saveUserRole(user1.getId(), role.getId());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -429,27 +471,27 @@ public class UserController {
|
|
|
userService.saveOrUpdate(userDTO);
|
|
|
successNum++;
|
|
|
} else {
|
|
|
- failureMsg.append ( "<br/>登录名 " + user.getLoginName ( ) + " 已存在; " );
|
|
|
+ failureMsg.append("<br/>登录名 " + user.getLoginName() + " 已存在; ");
|
|
|
failureNum++;
|
|
|
}
|
|
|
} catch (ConstraintViolationException ex) {
|
|
|
- failureMsg.append ( "<br/>登录名 " + user.getLoginName ( ) + " 导入失败:" );
|
|
|
- List <String> messageList = BeanValidators.extractPropertyAndMessageAsList ( ex, ": " );
|
|
|
+ failureMsg.append("<br/>登录名 " + user.getLoginName() + " 导入失败:");
|
|
|
+ List<String> messageList = BeanValidators.extractPropertyAndMessageAsList(ex, ": ");
|
|
|
for (String message : messageList) {
|
|
|
- failureMsg.append ( message + "; " );
|
|
|
+ failureMsg.append(message + "; ");
|
|
|
failureNum++;
|
|
|
}
|
|
|
} catch (Exception ex) {
|
|
|
failureNum++;
|
|
|
- failureMsg.append ( "<br/>登录名 " + user.getLoginName ( ) + " 导入失败:" + ex.getMessage ( ) );
|
|
|
+ failureMsg.append("<br/>登录名 " + user.getLoginName() + " 导入失败:" + ex.getMessage());
|
|
|
}
|
|
|
}
|
|
|
- if ( failureNum > 0 ) {
|
|
|
- failureMsg.insert ( 0, ",失败 " + failureNum + " 条用户,导入信息如下:" );
|
|
|
+ if (failureNum > 0) {
|
|
|
+ failureMsg.insert(0, ",失败 " + failureNum + " 条用户,导入信息如下:");
|
|
|
}
|
|
|
- return ResponseEntity.ok ( "已成功导入 " + successNum + " 条用户" + failureMsg );
|
|
|
+ return ResponseEntity.ok("已成功导入 " + successNum + " 条用户" + failureMsg);
|
|
|
} catch (Exception e) {
|
|
|
- return ResponseEntity.badRequest().body ( "导入用户失败!失败信息:" + e.getMessage ( ) );
|
|
|
+ return ResponseEntity.badRequest().body("导入用户失败!失败信息:" + e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -459,23 +501,23 @@ public class UserController {
|
|
|
* @param response
|
|
|
* @return
|
|
|
*/
|
|
|
- @PreAuthorize ("hasAnyAuthority('sys:user:import')")
|
|
|
+ @PreAuthorize("hasAnyAuthority('sys:user:import')")
|
|
|
@GetMapping("import/template")
|
|
|
@ApiOperation(value = "下载模板")
|
|
|
public void importFileTemplate(HttpServletResponse response) {
|
|
|
String fileName = "用户数据导入模板.xlsx";
|
|
|
List<UserDTO> list = Lists.newArrayList();
|
|
|
- list.add(UserUtils.getCurrentUserDTO ());
|
|
|
- EasyPoiUtil.exportExcel ( list, "用户数据", "用户数据", UserDTO.class, fileName, response );
|
|
|
+ list.add(UserUtils.getCurrentUserDTO());
|
|
|
+ EasyPoiUtil.exportExcel(list, "用户数据", "用户数据", UserDTO.class, fileName, response);
|
|
|
}
|
|
|
|
|
|
|
|
|
- private boolean isCheckLoginName(String oldLoginName,String oldLoginId, String loginName) {
|
|
|
+ private boolean isCheckLoginName(String oldLoginName, String oldLoginId, String loginName) {
|
|
|
if (StringUtils.isNotBlank(loginName)) {
|
|
|
- List<User> userList = userService.list(new QueryWrapper<User>().lambda().eq(User::getLoginName,loginName));
|
|
|
+ List<User> userList = userService.list(new QueryWrapper<User>().lambda().eq(User::getLoginName, loginName));
|
|
|
if (CollectionUtil.isNotEmpty(userList)) {
|
|
|
- for (User info: userList) {
|
|
|
- if(!info.getId().equals(oldLoginId)){
|
|
|
+ for (User info : userList) {
|
|
|
+ if (!info.getId().equals(oldLoginId)) {
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
@@ -491,9 +533,9 @@ public class UserController {
|
|
|
|
|
|
private boolean isCheckLoginNameNoCache(String oldLoginName, String loginName) {
|
|
|
UserDTO userByLoginName = userService.getUserByLoginNameNoCache(loginName);
|
|
|
- if ( loginName != null && loginName.equals ( oldLoginName ) ) {
|
|
|
+ if (loginName != null && loginName.equals(oldLoginName)) {
|
|
|
return true;
|
|
|
- } else if ( loginName != null && userByLoginName == null ) {
|
|
|
+ } else if (loginName != null && userByLoginName == null) {
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
|
@@ -510,27 +552,27 @@ public class UserController {
|
|
|
@PostMapping("imageUpload")
|
|
|
@ApiOperation(value = "上传头像")
|
|
|
public ResponseEntity imageUpload(MultipartFile file) throws IllegalStateException, IOException {
|
|
|
- String userId = UserUtils.getCurrentUserDTO ( ).getId ( );
|
|
|
+ String userId = UserUtils.getCurrentUserDTO().getId();
|
|
|
// 判断文件是否为空
|
|
|
- if ( !file.isEmpty ( ) ) {
|
|
|
- if ( fileProperties.isImage ( file.getOriginalFilename ( ) ) ) {
|
|
|
+ if (!file.isEmpty()) {
|
|
|
+ if (fileProperties.isImage(file.getOriginalFilename())) {
|
|
|
// 文件保存路径
|
|
|
- String realPath = "attachment-file"+"/"+"user_avatar"+this.datePath()+"/"+ System.currentTimeMillis();
|
|
|
+ String realPath = "attachment-file" + "/" + "user_avatar" + this.datePath() + "/" + System.currentTimeMillis();
|
|
|
//文件原名称
|
|
|
String newName = file.getOriginalFilename();
|
|
|
- this.uploadFile(file.getInputStream(),realPath,newName); // 文件上传到oss
|
|
|
+ this.uploadFile(file.getInputStream(), realPath, newName); // 文件上传到oss
|
|
|
String filePath = realPath + newName;
|
|
|
- userService.updateAvatarById ( userId,filePath ); // 修改头像
|
|
|
+ userService.updateAvatarById(userId, filePath); // 修改头像
|
|
|
String url = aliyunUrl + "/" + realPath + newName;
|
|
|
String lsUrl = UserUtils.getLsUrl(url); // 获取头像临时地址
|
|
|
// 获取临时头像地址
|
|
|
- return ResponseUtil.newInstance ( ).add ( "path", lsUrl ).ok ( "上传成功!" );
|
|
|
+ return ResponseUtil.newInstance().add("path", lsUrl).ok("上传成功!");
|
|
|
} else {
|
|
|
- return ResponseEntity.badRequest ( ).body ( "请上传图片!" );
|
|
|
+ return ResponseEntity.badRequest().body("请上传图片!");
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
- return ResponseEntity.badRequest ( ).body ( "文件不存在!" );
|
|
|
+ return ResponseEntity.badRequest().body("文件不存在!");
|
|
|
}
|
|
|
|
|
|
|
|
@@ -545,7 +587,7 @@ public class UserController {
|
|
|
@GetMapping("info")
|
|
|
@ApiOperation(value = "获取当前用户信息")
|
|
|
public ResponseEntity infoData() {
|
|
|
- return ResponseUtil.newInstance ( ).add ( "role", UserUtils.getRoleDTOList ( ) ).add ( "user", UserUtils.getCurrentUserDTO ( ) ).ok ( "获取个人信息成功!" );
|
|
|
+ return ResponseUtil.newInstance().add("role", UserUtils.getRoleDTOList()).add("user", UserUtils.getCurrentUserDTO()).ok("获取个人信息成功!");
|
|
|
}
|
|
|
|
|
|
|
|
@@ -554,20 +596,20 @@ public class UserController {
|
|
|
@RequestMapping("savePwd")
|
|
|
@ApiOperation(value = "修改密码")
|
|
|
public ResponseEntity savePwd(String oldPassword, String newPassword) {
|
|
|
- UserDTO userDTO = UserUtils.getCurrentUserDTO ( );
|
|
|
- if ( StrUtil.isNotBlank ( oldPassword ) && StrUtil.isNotBlank ( newPassword ) ) {
|
|
|
- if ( SecurityUtils.validatePassword ( oldPassword, userDTO.getPassword ( ) ) ) {
|
|
|
- User user = new User ( userDTO.getId ( ) );
|
|
|
- user.setPassword ( SecurityUtils.encryptPassword ( newPassword ) );
|
|
|
+ UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
|
+ if (StrUtil.isNotBlank(oldPassword) && StrUtil.isNotBlank(newPassword)) {
|
|
|
+ if (SecurityUtils.validatePassword(oldPassword, userDTO.getPassword())) {
|
|
|
+ User user = new User(userDTO.getId());
|
|
|
+ user.setPassword(SecurityUtils.encryptPassword(newPassword));
|
|
|
user.setUpPassword("1"); // 密码修改状态改为”已修改“
|
|
|
- userService.updateById ( user );
|
|
|
- UserUtils.deleteCache ( userDTO );
|
|
|
- return ResponseEntity.ok ( "修改密码成功!" );
|
|
|
+ userService.updateById(user);
|
|
|
+ UserUtils.deleteCache(userDTO);
|
|
|
+ return ResponseEntity.ok("修改密码成功!");
|
|
|
} else {
|
|
|
- return ResponseEntity.badRequest ( ).body ( "修改密码失败,旧密码错误!" );
|
|
|
+ return ResponseEntity.badRequest().body("修改密码失败,旧密码错误!");
|
|
|
}
|
|
|
}
|
|
|
- return ResponseEntity.badRequest ( ).body ( "参数错误!" );
|
|
|
+ return ResponseEntity.badRequest().body("参数错误!");
|
|
|
}
|
|
|
|
|
|
/*@DemoMode
|
|
@@ -615,79 +657,79 @@ public class UserController {
|
|
|
/**
|
|
|
* 修改的原因,在某些性能很差的服务器上该方法的执行速度可以提升十几倍。当然在性能优良的服务器上,两种方式耗时几无区别。
|
|
|
*/
|
|
|
- Map map = new HashMap ( );
|
|
|
- map.put ( "dictList", DictUtils.getDictMap ( ) ); //获取字典
|
|
|
- map.put( "permissions", UserUtils.getPermissions ( ) );
|
|
|
- map.put ( "menuList", MenuUtils.getMenus ( ) );
|
|
|
- map.put ( "routerList", RouterUtils.getRoutersByMenu ( ) );
|
|
|
- String res = new Gson ().toJson(map);
|
|
|
- return ResponseEntity.ok ( res );
|
|
|
+ Map map = new HashMap();
|
|
|
+ map.put("dictList", DictUtils.getDictMap()); //获取字典
|
|
|
+ map.put("permissions", UserUtils.getPermissions());
|
|
|
+ map.put("menuList", MenuUtils.getMenus());
|
|
|
+ map.put("routerList", RouterUtils.getRoutersByMenu());
|
|
|
+ String res = new Gson().toJson(map);
|
|
|
+ return ResponseEntity.ok(res);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取机构JSON数据。
|
|
|
*
|
|
|
- * @param extId 排除的ID
|
|
|
- * @param type 类型(1:公司;2:部门)
|
|
|
+ * @param extId 排除的ID
|
|
|
+ * @param type 类型(1:公司;2:部门)
|
|
|
* @param showAll 是否显示不可用数据 1 显示 0 隐藏
|
|
|
* @return
|
|
|
*/
|
|
|
@ApiLog("获取部门用户数据")
|
|
|
@GetMapping("treeUserData")
|
|
|
public ResponseEntity treeUserData(@RequestParam(required = false) String extId, @RequestParam(required = false) String type, @RequestParam(required = false, defaultValue = CommonConstants.NO) String showAll) {
|
|
|
- List<OfficeDTO> list = officeWrapper.toDTO (officeService.list ());
|
|
|
+ List<OfficeDTO> list = officeWrapper.toDTO(officeService.list());
|
|
|
for (OfficeDTO info :
|
|
|
list) {
|
|
|
info.setTypeFlag(true);
|
|
|
}
|
|
|
//根据部门查询对应部门下的所有数据
|
|
|
- List<OfficeDTO> officeDTOList = userService.disposeUserOffice(list,type);
|
|
|
+ List<OfficeDTO> officeDTOList = userService.disposeUserOffice(list, type);
|
|
|
list.addAll(officeDTOList);
|
|
|
- List rootTree = officeService.getRootTree (list, extId, type, showAll, "1");
|
|
|
- return ResponseEntity.ok (rootTree);
|
|
|
+ List rootTree = officeService.getRootTree(list, extId, type, showAll, "1");
|
|
|
+ return ResponseEntity.ok(rootTree);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取机构JSON数据。
|
|
|
*
|
|
|
* @param officeName 部门名称
|
|
|
- * @param extId 排除的ID
|
|
|
- * @param type 类型(1:公司;2:部门)
|
|
|
- * @param showAll 是否显示不可用数据 1 显示 0 隐藏
|
|
|
+ * @param extId 排除的ID
|
|
|
+ * @param type 类型(1:公司;2:部门)
|
|
|
+ * @param showAll 是否显示不可用数据 1 显示 0 隐藏
|
|
|
* @return
|
|
|
*/
|
|
|
@ApiLog("获取部门用户数据")
|
|
|
@GetMapping("treeUserDataAllOffice")
|
|
|
- public ResponseEntity treeUserDataAllOffice(@RequestParam(required = false) String officeName,@RequestParam(required = false) String extId, @RequestParam(required = false) String type, @RequestParam(required = false, defaultValue = CommonConstants.NO) String showAll) {
|
|
|
- List<OfficeDTO> list = officeService.getOfficeAllByOfficeName (officeName);
|
|
|
- if(list.size()>0){
|
|
|
+ public ResponseEntity treeUserDataAllOffice(@RequestParam(required = false) String officeName, @RequestParam(required = false) String extId, @RequestParam(required = false) String type, @RequestParam(required = false, defaultValue = CommonConstants.NO) String showAll) {
|
|
|
+ List<OfficeDTO> list = officeService.getOfficeAllByOfficeName(officeName);
|
|
|
+ if (list.size() > 0) {
|
|
|
List<String> officeIds = Lists.newArrayList();
|
|
|
for (OfficeDTO info : list) {
|
|
|
info.setTypeFlag(true);
|
|
|
officeIds.add(info.getId());
|
|
|
}
|
|
|
//根据部门查询对应部门下的所有数据
|
|
|
- List<OfficeDTO> officeDTOList = userService.getUserByOffice(officeIds,type);
|
|
|
+ List<OfficeDTO> officeDTOList = userService.getUserByOffice(officeIds, type);
|
|
|
list.addAll(officeDTOList);
|
|
|
}
|
|
|
- List rootTree = officeService.getRootTree (list, extId, type, showAll, "1");
|
|
|
- return ResponseEntity.ok (rootTree);
|
|
|
+ List rootTree = officeService.getRootTree(list, extId, type, showAll, "1");
|
|
|
+ return ResponseEntity.ok(rootTree);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取机构JSON数据。
|
|
|
*
|
|
|
* @param officeName 部门名称
|
|
|
- * @param extId 排除的ID
|
|
|
- * @param type 类型(1:公司;2:部门)
|
|
|
- * @param showAll 是否显示不可用数据 1 显示 0 隐藏
|
|
|
+ * @param extId 排除的ID
|
|
|
+ * @param type 类型(1:公司;2:部门)
|
|
|
+ * @param showAll 是否显示不可用数据 1 显示 0 隐藏
|
|
|
* @return
|
|
|
*/
|
|
|
@ApiLog("获取部门用户数据")
|
|
|
@GetMapping("treeUserDataByOfficeName")
|
|
|
- public ResponseEntity treeUserDataByOfficeName(@RequestParam(required = false) String officeName,@RequestParam(required = false) String extId, @RequestParam(required = false) String type, @RequestParam(required = false, defaultValue = CommonConstants.NO) String showAll) {
|
|
|
- List<OfficeDTO> list = officeService.getOfficeAllByOfficeName (officeName);
|
|
|
- if(list.size()>0){
|
|
|
+ public ResponseEntity treeUserDataByOfficeName(@RequestParam(required = false) String officeName, @RequestParam(required = false) String extId, @RequestParam(required = false) String type, @RequestParam(required = false, defaultValue = CommonConstants.NO) String showAll) {
|
|
|
+ List<OfficeDTO> list = officeService.getOfficeAllByOfficeName(officeName);
|
|
|
+ if (list.size() > 0) {
|
|
|
List<String> officeIds = Lists.newArrayList();
|
|
|
for (OfficeDTO info :
|
|
|
list) {
|
|
@@ -695,35 +737,35 @@ public class UserController {
|
|
|
officeIds.add(info.getId());
|
|
|
}
|
|
|
//根据部门查询对应部门下的所有数据
|
|
|
- List<OfficeDTO> officeDTOList = userService.getUserByOffice(officeIds,type);
|
|
|
+ List<OfficeDTO> officeDTOList = userService.getUserByOffice(officeIds, type);
|
|
|
list.addAll(officeDTOList);
|
|
|
}
|
|
|
- List rootTree = officeService.getofficeUserTree (officeName,list, extId, type, showAll);
|
|
|
- return ResponseEntity.ok (rootTree);
|
|
|
+ List rootTree = officeService.getofficeUserTree(officeName, list, extId, type, showAll);
|
|
|
+ return ResponseEntity.ok(rootTree);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取机构JSON数据。
|
|
|
*
|
|
|
* @param officeName 部门名称
|
|
|
- * @param extId 排除的ID
|
|
|
- * @param type 类型(1:公司;2:部门)
|
|
|
- * @param showAll 是否显示不可用数据 1 显示 0 隐藏
|
|
|
+ * @param extId 排除的ID
|
|
|
+ * @param type 类型(1:公司;2:部门)
|
|
|
+ * @param showAll 是否显示不可用数据 1 显示 0 隐藏
|
|
|
* @return
|
|
|
*/
|
|
|
@ApiLog("获取部门信息")
|
|
|
@GetMapping("treeUserDataByOfficeList")
|
|
|
- public ResponseEntity treeUserDataByOfficeList(@RequestParam(required = false) String officeName,@RequestParam(required = false) String extId, @RequestParam(required = false) String type, @RequestParam(required = false, defaultValue = CommonConstants.NO) String showAll) {
|
|
|
- List<OfficeDTO> list = officeService.getOfficeAllByOfficeName (officeName);
|
|
|
- if(list.size()>0){
|
|
|
+ public ResponseEntity treeUserDataByOfficeList(@RequestParam(required = false) String officeName, @RequestParam(required = false) String extId, @RequestParam(required = false) String type, @RequestParam(required = false, defaultValue = CommonConstants.NO) String showAll) {
|
|
|
+ List<OfficeDTO> list = officeService.getOfficeAllByOfficeName(officeName);
|
|
|
+ if (list.size() > 0) {
|
|
|
List<String> officeIds = Lists.newArrayList();
|
|
|
for (OfficeDTO info :
|
|
|
list) {
|
|
|
officeIds.add(info.getId());
|
|
|
}
|
|
|
}
|
|
|
- List rootTree = officeService.getofficeUserTree (officeName,list, extId, type, showAll);
|
|
|
- return ResponseEntity.ok (rootTree);
|
|
|
+ List rootTree = officeService.getofficeUserTree(officeName, list, extId, type, showAll);
|
|
|
+ return ResponseEntity.ok(rootTree);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -751,31 +793,33 @@ public class UserController {
|
|
|
private String accessKeySecret;
|
|
|
@Value("${config.accessory.aliyun.bucketName}")
|
|
|
private String bucketName;
|
|
|
+
|
|
|
/**
|
|
|
* 阿里云获取临时文件查看url
|
|
|
+ *
|
|
|
* @param url
|
|
|
*/
|
|
|
- public String getFileTemporaryLookUrl(String url){
|
|
|
- url = url.replace("amp;","");
|
|
|
+ public String getFileTemporaryLookUrl(String url) {
|
|
|
+ url = url.replace("amp;", "");
|
|
|
String cons = "";
|
|
|
- if (url.contains(aliyunUrl)){
|
|
|
+ if (url.contains(aliyunUrl)) {
|
|
|
cons = aliyunUrl;
|
|
|
- }else if (url.contains("http://gangwan-app.oss-cn-hangzhou.aliyuncs.com")){
|
|
|
+ } else if (url.contains("http://gangwan-app.oss-cn-hangzhou.aliyuncs.com")) {
|
|
|
cons = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com";
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
cons = aliyunDownloadUrl;
|
|
|
}
|
|
|
String key = "";
|
|
|
String[] split = url.split(cons + "/");
|
|
|
- if(split.length>1){
|
|
|
+ if (split.length > 1) {
|
|
|
key = split[1];
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
key = url;
|
|
|
}
|
|
|
// 指定过期时间为24小时。
|
|
|
- Date expiration = new Date(new Date().getTime() + 1000 * 60 * 60 * 24 );
|
|
|
+ Date expiration = new Date(new Date().getTime() + 1000 * 60 * 60 * 24);
|
|
|
//初始化OSSClient
|
|
|
- OSSClient ossClient = new OSSClient(endpoint,accessKeyId,accessKeySecret);
|
|
|
+ OSSClient ossClient = new OSSClient(endpoint, accessKeyId, accessKeySecret);
|
|
|
return ossClient.generatePresignedUrl(bucketName, key, expiration).toString();
|
|
|
}
|
|
|
|
|
@@ -816,6 +860,7 @@ public class UserController {
|
|
|
|
|
|
/**
|
|
|
* 获取当前用户是否已经修改过密码
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@ApiLog("获取当前用户是否已经修改过密码")
|
|
@@ -830,7 +875,7 @@ public class UserController {
|
|
|
|
|
|
public String uploadFile(InputStream inStream, String fileDir, String fileName) {
|
|
|
//初始化OSSClient
|
|
|
- OSSClient ossClient = new OSSClient(endpoint,accessKeyId,accessKeySecret);
|
|
|
+ OSSClient ossClient = new OSSClient(endpoint, accessKeyId, accessKeySecret);
|
|
|
// long start = System.currentTimeMillis();
|
|
|
//上传文件
|
|
|
PutObjectResult putResult = ossClient.putObject(bucketName, fileDir + fileName, inStream);
|
|
@@ -847,22 +892,24 @@ public class UserController {
|
|
|
// log.info("上传文件到云服务器成功,文件名:{},耗时:{}ms",fileName,end-start);
|
|
|
return ret;
|
|
|
}
|
|
|
- public String datePath(){
|
|
|
+
|
|
|
+ public String datePath() {
|
|
|
Calendar date = Calendar.getInstance();
|
|
|
String year = String.valueOf(date.get(Calendar.YEAR));
|
|
|
- String month = String.valueOf(date.get(Calendar.MONTH)+1);
|
|
|
+ String month = String.valueOf(date.get(Calendar.MONTH) + 1);
|
|
|
String day = String.valueOf(date.get(Calendar.DAY_OF_MONTH));
|
|
|
- String path = "/"+year+"/"+month+"/"+day;
|
|
|
+ String path = "/" + year + "/" + month + "/" + day;
|
|
|
return path;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 查看签字注释2角色的用户
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@ApiLog("签字注师2")
|
|
|
@GetMapping("list1")
|
|
|
- public List<String> list1(){
|
|
|
+ public List<String> list1() {
|
|
|
return userService.selectSignatureNaster();
|
|
|
}
|
|
|
}
|