|
@@ -27,6 +27,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.fuzamei.constant.Role;
|
|
|
import com.fuzamei.entity.UserDetail;
|
|
|
import com.fuzamei.service.ProjectFileService;
|
|
|
import com.fuzamei.utils.HashXiZhiUtil;
|
|
@@ -150,7 +151,7 @@ public class ProjectFileAction {
|
|
|
public Map<String, Object> download(HttpServletRequest request,HttpServletResponse response,@RequestParam("url") String url,@RequestParam("userId") Object id) {
|
|
|
try {
|
|
|
int userId=ValidationUtil.checkAndAssignInt(id);
|
|
|
- projectFileService.checkUserAuthority(userId,"监管机构","省分行托管分中心档案保管岗");
|
|
|
+ projectFileService.checkUserAuthority(userId,Role.SUPERVISION_AGENCY,Role.ARCHIVE_KEEPING_POS_OF_PBBTBC);
|
|
|
String fileName = request.getServletContext().getRealPath("")+url;
|
|
|
|
|
|
if(!new File(fileName).exists()){
|
|
@@ -198,8 +199,8 @@ public class ProjectFileAction {
|
|
|
try {
|
|
|
Map<String,Object> map = JSON.parseObject(data, Map.class);
|
|
|
int userId = ValidationUtil.checkAndAssignInt(map.get("userId"));
|
|
|
- projectFileService.checkUserAuthority(userId,"省分行托管分中心档案保管岗");
|
|
|
- Integer projectId = ValidationUtil.checkAndAssignDefaultInt(map.get("projectId"),0);
|
|
|
+ projectFileService.checkUserAuthority(userId,Role.ARCHIVE_KEEPING_POS_OF_PBBTBC);
|
|
|
+ Integer projectId = ValidationUtil.checkAndAssignDefaultInt(map.get("projectId"),-1);
|
|
|
String projectName=ValidationUtil.checkBlankStringAndAssignEmptyIfIsBlank(map.get("projectName"));
|
|
|
Map<String, Object> mapToClient =new LinkedHashMap<String, Object>();
|
|
|
mapToClient.put("projectId", projectId);
|
|
@@ -229,10 +230,14 @@ public class ProjectFileAction {
|
|
|
*/
|
|
|
@RequestMapping(value="/uploadProjetcFile",method=RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
- public Map<String, Object> upload(@RequestParam("file") MultipartFile file,HttpServletRequest request,@RequestParam("projectId") String pId,@RequestParam("projectName") String pName,@RequestParam("userId") Object uId) {
|
|
|
+ public Map<String, Object> upload(@RequestParam("file") MultipartFile file,
|
|
|
+ @RequestParam("projectId") String pId,
|
|
|
+ @RequestParam("projectName") String pName,
|
|
|
+ @RequestParam("userId") Object uId,
|
|
|
+ HttpServletRequest request) {
|
|
|
try {
|
|
|
int userId=ValidationUtil.checkAndAssignInt(uId);
|
|
|
- UserDetail userDetail = projectFileService.checkUserAuthority(userId,"监管机构","省分行托管分中心档案保管岗");
|
|
|
+ UserDetail userDetail = projectFileService.checkUserAuthority(userId,Role.ARCHIVE_KEEPING_POS_OF_PBBTBC);
|
|
|
String projectId = ValidationUtil.checkBlankAndAssignString(pId);
|
|
|
String projectName = ValidationUtil.checkBlankAndAssignString(pName);
|
|
|
String path = request.getServletContext().getRealPath("")+SP+"content";
|
|
@@ -244,7 +249,7 @@ public class ProjectFileAction {
|
|
|
String pathFile=path+SP+filename;
|
|
|
File newFile=new File(pathFile);
|
|
|
file.transferTo(newFile);
|
|
|
- String fileHash = HashXiZhiUtil.getMD5Checksum(filename);
|
|
|
+ String fileHash = HashXiZhiUtil.getMD5Checksum(filename);
|
|
|
Map<String, Object> mapToService =new LinkedHashMap<String, Object>();
|
|
|
mapToService.put("userDetail", userDetail);
|
|
|
mapToService.put("projectId", projectId);
|