去除惠州代码
This commit is contained in:
parent
c0791ca2b2
commit
326f1132cc
@ -2,7 +2,6 @@ package com.zhgd.xmgl.modules.basicdata.controller.admin;
|
||||
|
||||
import com.zhgd.annotation.OperLog;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.xmgl.modules.basicdata.dto.MenuHzDto;
|
||||
import com.zhgd.xmgl.modules.basicdata.dto.MenuTreeDto;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.BaseMenu;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.SystemRoleMenu;
|
||||
@ -219,15 +218,4 @@ public class BaseMenuController {
|
||||
public Result<Set<String>> queryRouter() {
|
||||
return Result.success(baseMenuService.queryRouter());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询菜单列表(项目管理子系统)
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "系统菜单管理", operType = "查询", operDesc = "查询菜单列表(项目管理子系统)")
|
||||
@ApiOperation(value = "查询菜单列表(项目管理子系统)", notes = "查询菜单列表(项目管理子系统)" , httpMethod="POST")
|
||||
@PostMapping(value = "/getAll")
|
||||
public Result<List<MenuHzDto>> getAll(@RequestBody Map<String, Object> map) {
|
||||
return Result.success(baseMenuService.getAllForHz(map));
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,6 +17,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@ -41,25 +42,25 @@ public class FileController {
|
||||
/**
|
||||
* 上传文件到指定存储平台,成功返回文件信息
|
||||
*/
|
||||
// @OperLog(operModul = "文件管理", operType = "文件上传", operDesc = "文件上传")
|
||||
// @ApiOperation(value = "文件上传", notes = "文件上传", httpMethod="POST")
|
||||
// @PostMapping("/upload")
|
||||
// public Result<FileInfo> uploadPlatform(MultipartFile file) {
|
||||
// return Result.success(fileStorageService.of(file)
|
||||
// .setPlatform("minio-1") //使用指定的存储平台
|
||||
// .upload());
|
||||
// }
|
||||
|
||||
/**
|
||||
* 上传文件到本地,成功返回文件信息
|
||||
*/
|
||||
@OperLog(operModul = "文件管理", operType = "文件上传", operDesc = "文件上传")
|
||||
@ApiOperation(value = "文件上传", notes = "文件上传", httpMethod="POST")
|
||||
@PostMapping("/upload")
|
||||
public Result<Map<String, Object>> upload(MultipartFile file) {
|
||||
return Result.success(fileDetailService.upload(file));
|
||||
public Result<FileInfo> uploadPlatform(MultipartFile file) {
|
||||
return Result.success(fileStorageService.of(file)
|
||||
.setPlatform("minio-1") //使用指定的存储平台
|
||||
.upload());
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 上传文件到本地,成功返回文件信息
|
||||
// */
|
||||
// @OperLog(operModul = "文件管理", operType = "文件上传", operDesc = "文件上传")
|
||||
// @ApiOperation(value = "文件上传", notes = "文件上传", httpMethod="POST")
|
||||
// @PostMapping("/upload")
|
||||
// public Result<Map<String, Object>> upload(MultipartFile file) {
|
||||
// return Result.success(fileDetailService.upload(file));
|
||||
// }
|
||||
|
||||
/**
|
||||
* 上传BASE64文件
|
||||
*/
|
||||
@ -95,23 +96,6 @@ public class FileController {
|
||||
fileStorageService.download(fileInfo).outputStream(response.getOutputStream());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取预览文件流
|
||||
*/
|
||||
// @OperLog(operModul = "文件管理", operType = "获取预览文件流", operDesc = "获取预览文件流")
|
||||
// @ApiOperation(value = "获取预览文件流", notes = "获取预览文件流", httpMethod="POST")
|
||||
// @GetMapping("/preview")
|
||||
// public void download(@RequestParam(value = "fileUrl", required = true) String fileUrl, HttpServletResponse response) throws Exception {
|
||||
// // 获取文件信息
|
||||
// FileInfo fileInfo = fileStorageService.getFileInfoByUrl(fileUrl);
|
||||
// if (null == fileInfo) {
|
||||
// throw new Exception("缩略图文件预览失败,文件不存在!fileInfo:" + fileInfo);
|
||||
// }
|
||||
// response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileInfo.getOriginalFilename(), "UTF-8"));
|
||||
// response.setContentType("application/octet-stream");// 定义输出类型
|
||||
// fileStorageService.download(fileInfo).outputStream(response.getOutputStream());
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取预览文件流
|
||||
*/
|
||||
@ -120,6 +104,23 @@ public class FileController {
|
||||
@GetMapping("/preview")
|
||||
public void download(@RequestParam(value = "fileUrl", required = true) String fileUrl, HttpServletResponse response) throws Exception {
|
||||
// 获取文件信息
|
||||
fileDetailService.download(fileUrl, response);
|
||||
FileInfo fileInfo = fileStorageService.getFileInfoByUrl(fileUrl);
|
||||
if (null == fileInfo) {
|
||||
throw new Exception("缩略图文件预览失败,文件不存在!fileInfo:" + fileInfo);
|
||||
}
|
||||
response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileInfo.getOriginalFilename(), "UTF-8"));
|
||||
response.setContentType("application/octet-stream");// 定义输出类型
|
||||
fileStorageService.download(fileInfo).outputStream(response.getOutputStream());
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 获取预览文件流
|
||||
// */
|
||||
// @OperLog(operModul = "文件管理", operType = "获取预览文件流", operDesc = "获取预览文件流")
|
||||
// @ApiOperation(value = "获取预览文件流", notes = "获取预览文件流", httpMethod="POST")
|
||||
// @GetMapping("/preview")
|
||||
// public void download(@RequestParam(value = "fileUrl", required = true) String fileUrl, HttpServletResponse response) throws Exception {
|
||||
// // 获取文件信息
|
||||
// fileDetailService.download(fileUrl, response);
|
||||
// }
|
||||
}
|
||||
|
||||
@ -211,50 +211,4 @@ public class SystemUserAuthController {
|
||||
return RestResult.fail().message("用户暂未登录");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "解析秘钥信息登录系统", notes = "解析秘钥信息登录系统" , httpMethod="POST")
|
||||
@PostMapping("/analysis")
|
||||
public Result<SystemUserAuthDto> analysis(@RequestBody Map<String, Object> map) {
|
||||
Result<SystemUserAuthDto> result = new Result<SystemUserAuthDto>();
|
||||
try {
|
||||
// String ssoToken = MapUtils.getString(map, "ssoToken");
|
||||
// ssoToken = ssoToken.replace("-", "+").replace("_", "/");
|
||||
// JSONObject decrypt = JSONObject.parseObject(Aes.decrypt(ssoToken, "ssologin66!@#$%^"));
|
||||
// if (decrypt.getLong("exp") < System.currentTimeMillis()) {
|
||||
// log.error("单点登录token已过期");
|
||||
// result.error500("token已过期");
|
||||
// return result;
|
||||
// }
|
||||
// String userId = decrypt.getString("uid");
|
||||
// String account = "";
|
||||
// if (userId.equals("myy")) {
|
||||
// account = "hzxmgl";
|
||||
// }
|
||||
// if (userId.equals("test")) {
|
||||
// account = "hzxm";
|
||||
// }
|
||||
// if (StringUtils.isBlank(account)) {
|
||||
// result.error500("用户不存在");
|
||||
// return result;
|
||||
// }
|
||||
SystemUser user = systemUserService.getOne(Wrappers.<SystemUser>lambdaQuery()
|
||||
.eq(SystemUser::getAccount, "pjadmin"));
|
||||
SystemUserAuthDto userInfo = new SystemUserAuthDto();
|
||||
checkLogin(user, userInfo, result);
|
||||
if (result.getCode() != CommonConstant.SC_INTERNAL_SERVER_ERROR_500) {
|
||||
// Long time = decrypt.getLong("exp") - System.currentTimeMillis();
|
||||
String token = jwtTokenProvider.createToken(userInfo.getAccount(), 3600 * 24 * 1000L);
|
||||
userInfo.setToken(token);
|
||||
userInfo.setIsEngineering(systemUserDataScopeService.count(Wrappers.<SystemUserDataScope>lambdaQuery()
|
||||
.eq(SystemUserDataScope::getUserId, userInfo.getUserId())) > 0);
|
||||
result.setResult(userInfo);
|
||||
result.setSuccess(true);
|
||||
}
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
result.error500("登陆信息错误,请刷新或重新登录!");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -54,6 +54,4 @@ public interface IBaseMenuService extends IService<BaseMenu> {
|
||||
List<SystemRoleMenu> roleMenu(String roleId);
|
||||
|
||||
Set<String> queryRouter();
|
||||
|
||||
List<MenuHzDto> getAllForHz(Map<String, Object> map);
|
||||
}
|
||||
|
||||
@ -150,28 +150,6 @@ public class BaseMenuServiceImpl extends ServiceImpl<BaseMenuMapper, BaseMenu> i
|
||||
return routers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MenuHzDto> getAllForHz(Map<String, Object> map) {
|
||||
String userId = MapUtils.getString(map, "userId");
|
||||
userId = Aes.decrypt(userId, "ssologin66!@#$%^");
|
||||
SystemUser systemUser = new SystemUser();
|
||||
Long moduleId = 0L;
|
||||
if (userId.equals("myy")) {
|
||||
systemUser = systemUserMapper.selectOne(Wrappers.<SystemUser>lambdaQuery().eq(SystemUser::getAccount, "hzxmgl"));
|
||||
moduleId = 1670639811581595650L;
|
||||
}
|
||||
if (userId.equals("test")) {
|
||||
systemUser = systemUserMapper.selectOne(Wrappers.<SystemUser>lambdaQuery().eq(SystemUser::getAccount, "hzxm"));
|
||||
moduleId = 1670603312504918018L;
|
||||
}
|
||||
if (systemUser == null) {
|
||||
throw new CustomException("用户不存在");
|
||||
}
|
||||
List<BaseMenu> baseMenus = baseMenuMapper.selectList(Wrappers.<BaseMenu>lambdaQuery().in(BaseMenu::getModuleId, moduleId)
|
||||
.eq(BaseMenu::getStatus, 1).orderByAsc(BaseMenu::getPriority));
|
||||
return TreeUtil.formatHz(baseMenus);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getProjectModuleAndMenu(Map<String, Object> map) {
|
||||
map.put("styleType",getStyleType(MapUtils.getString(map,"projectSn")));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user