| | |
| | | |
| | | @RequestMapping(value = "/plan/url/view/file/auth") |
| | | @ManagerAuth |
| | | public R viewFile(@RequestParam("planId") String planId){ |
| | | public R viewFile(@RequestParam("planId") String planId,@RequestParam("planIdI") String planIdI){ |
| | | List<FileSaveExampleUtil.FileDTO> fileDTOS = new ArrayList<>(); |
| | | if (Cools.isEmpty(planId)){ |
| | | return R.ok(fileDTOS); |
| | | } |
| | | Long id = Long.parseLong(planId); |
| | | Plan plan = planService.selectById(id); |
| | | Long idPlanIdI = Long.parseLong(planIdI); |
| | | Plan plan = planService.selectById(idPlanIdI); |
| | | PlanType planType = planTypeService.selectById(plan.getPlanType()); |
| | | if (plan.getAssistantHostSign()==1){ |
| | | planType.setType(1); |
| | | } |
| | | // String savePath = "D:/crm/plan/file/"+id+"/"; // 指定保存文件的路径 |
| | | try{ |
| | | List<PlanUrl> planUrls = planUrlService.selectPlanUrlByPlanId(id,0,planType.getType(),0); |
| | |
| | | }else { |
| | | status=2; |
| | | } |
| | | if (plan.getAssistantHostSign()==1){ |
| | | planType.setType(1); |
| | | } |
| | | String url = "http://zhongyang-ftpserver.oss-cn-hangzhou.aliyuncs.com/" + filename; |
| | | PlanUrl planUrl = new PlanUrl(id, url, filename, filesize,user.getNickname(),user.getId(),1,planType.getType(),status); |
| | | planUrlService.insert(planUrl); |
| | |
| | | |
| | | @RequestMapping(value = "/pri/online/url/view/file/auth") |
| | | @ManagerAuth |
| | | public R viewFilePriOnline(@RequestParam("planId") String planId){ |
| | | public R viewFilePriOnline(@RequestParam("planId") String planId,@RequestParam("planIdI") String planIdI){ |
| | | List<FileSaveExampleUtil.FileDTO> fileDTOS = new ArrayList<>(); |
| | | if (Cools.isEmpty(planId)){ |
| | | return R.ok(fileDTOS); |
| | | } |
| | | Long id = Long.parseLong(planId); |
| | | Long idPlanIdI = Long.parseLong(planIdI); |
| | | int planType =0; |
| | | Plan plan = planService.selectById(id); |
| | | if (!plan.getUserId().equals(getUserId())){ |
| | | List<ProcessPermissions> processPermissionsList = processPermissionsService.selectList(new EntityWrapper<ProcessPermissions>().eq("process_memo", 4).or().eq("process_memo", 5));//2:核价流程 |
| | | for (ProcessPermissions processPermissions:processPermissionsList){ |
| | | if (getUserId().equals(processPermissions.getUserId())){ |
| | | planType=PBN-processPermissions.getProcessMemo(); |
| | | break; |
| | | Plan plan = planService.selectById(idPlanIdI); |
| | | if (plan.getAssistantHostSign()==1){ |
| | | planType=1; |
| | | }else { |
| | | if (!plan.getUserId().equals(getUserId())){ |
| | | List<ProcessPermissions> processPermissionsList = processPermissionsService.selectList(new EntityWrapper<ProcessPermissions>().eq("process_memo", 4).or().eq("process_memo", 5));//2:核价流程 |
| | | for (ProcessPermissions processPermissions:processPermissionsList){ |
| | | if (getUserId().equals(processPermissions.getUserId())){ |
| | | planType=PBN-processPermissions.getProcessMemo(); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | status=1; |
| | | }else { |
| | | status=2; |
| | | } |
| | | if (plan.getAssistantHostSign()==1){ |
| | | planType.setType(1); |
| | | } |
| | | String url = "http://zhongyang-ftpserver.oss-cn-hangzhou.aliyuncs.com/" + filename; |
| | | PlanUrl planUrl = new PlanUrl(id, url, filename, filesize,user.getNickname(),user.getId(),2,planType.getType(),status); |
| | |
| | | }else { |
| | | status=2; |
| | | } |
| | | if (plan.getAssistantHostSign()==1){ |
| | | planType.setType(1); |
| | | } |
| | | String url = "http://zhongyang-ftpserver.oss-cn-hangzhou.aliyuncs.com/" + filename; |
| | | PlanUrl planUrl = new PlanUrl(id, url, filename, filesize,user.getNickname(),user.getId(),3,planType.getType(),status); |
| | | planUrlService.insert(planUrl); |