|
|
@ -55,13 +55,13 @@ public class CommonApi { |
|
|
|
@Autowired |
|
|
|
private SysUserProService sysUserProService; |
|
|
|
|
|
|
|
// 文件路径
|
|
|
|
// 文件路径
|
|
|
|
@Value("${jianwei.profile}") |
|
|
|
private String filePath; |
|
|
|
|
|
|
|
@ApiOperation("字典数据") |
|
|
|
@GetMapping("dict/{dictType}") |
|
|
|
public AjaxResult dict(@PathVariable("dictType")String dictType){ |
|
|
|
public AjaxResult dict(@PathVariable("dictType") String dictType) { |
|
|
|
List<SysDictData> dictCache = DictUtils.getDictCache(dictType); |
|
|
|
return AjaxResult.success(dictCache); |
|
|
|
|
|
|
@ -78,9 +78,9 @@ public class CommonApi { |
|
|
|
@ApiOperation("分片上传") |
|
|
|
@RequestMapping("sliceUpload") |
|
|
|
public AjaxResult upload(HttpServletRequest request, Chunk chunk) throws IOException { |
|
|
|
System.out.println("开始时间:"+System.currentTimeMillis()); |
|
|
|
System.out.println("开始时间:" + System.currentTimeMillis()); |
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
jsonObject.put("id",chunk.getIdentifier()); |
|
|
|
jsonObject.put("id", chunk.getIdentifier()); |
|
|
|
boolean isMultipart = ServletFileUpload.isMultipartContent(request); |
|
|
|
if (isMultipart) { |
|
|
|
MultipartFile file = chunk.getFile(); |
|
|
@ -91,14 +91,14 @@ public class CommonApi { |
|
|
|
if (chunkNumber == null) { |
|
|
|
chunkNumber = 0; |
|
|
|
} |
|
|
|
jsonObject.put("num",chunkNumber); |
|
|
|
jsonObject.put("num", chunkNumber); |
|
|
|
File outFile = new File(filePath + File.separator + chunk.getIdentifier(), chunkNumber + ".part"); |
|
|
|
InputStream inputStream = file.getInputStream(); |
|
|
|
FileUtils.copyInputStreamToFile(inputStream, outFile); |
|
|
|
}else{ |
|
|
|
jsonObject.put("count",chunk.getTotalChunks()); |
|
|
|
} else { |
|
|
|
jsonObject.put("count", chunk.getTotalChunks()); |
|
|
|
} |
|
|
|
System.out.println("结束时间:"+System.currentTimeMillis()); |
|
|
|
System.out.println("结束时间:" + System.currentTimeMillis()); |
|
|
|
return AjaxResult.success(jsonObject); |
|
|
|
} |
|
|
|
|
|
|
@ -148,9 +148,8 @@ public class CommonApi { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/show") |
|
|
|
public void show(@RequestBody ShowFileUrl showFileUrl , HttpServletResponse response) throws IOException { |
|
|
|
public void show(@RequestBody ShowFileUrl showFileUrl, HttpServletResponse response) throws IOException { |
|
|
|
byte[] bytes = fastDfsUtil.downloadFile(showFileUrl.getFileUrl()); |
|
|
|
response.getOutputStream().write(bytes); |
|
|
|
} |
|
|
@ -161,22 +160,31 @@ public class CommonApi { |
|
|
|
List<SysRole> sysRoles = sysRoleService.getRoleByUserId(user.getId()); |
|
|
|
List<SysRole> legalPerson = sysRoles.stream().filter(x -> x.getRoleKey().equals("legalPerson")).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (CollectionUtil.isEmpty(legalPerson)) { |
|
|
|
return true; |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
LambdaQueryWrapper<SysUserPro> queryWrapper = Wrappers.lambdaQuery(SysUserPro.class).eq(SysUserPro::getUserId, user.getId()); |
|
|
|
|
|
|
|
List<SysUserPro> list = sysUserProService.list(queryWrapper); |
|
|
|
if (CollectionUtil.isEmpty(list)) { |
|
|
|
return false; |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("/bindPro") |
|
|
|
public AjaxResult bindPro(@RequestBody List<String> proNos) { |
|
|
|
SysUser user = UserUtils.getUser(); |
|
|
|
List<SysUserPro> proList = proNos.stream() |
|
|
|
.map(x -> new SysUserPro(x, user.getId(), user.getId(), null)) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
return AjaxResult.success(sysUserProService.saveBatch(proList)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|