| | |
| | | private OrderService orderService; |
| | | @Autowired |
| | | private SmsCodeService smsCodeService; |
| | | @Autowired |
| | | private ProcessPermissionsService processPermissionsService; |
| | | |
| | | String PZH=" ————————————————— "; |
| | | Integer PBN = 6; |
| | | |
| | | |
| | | @GetMapping(value = "/plan/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | @RequestParam(required = false) String condition, |
| | | @RequestParam(required = false, value = "dept_id") Long deptId, |
| | | @RequestParam(required = false, value = "user_id") Long userId) { |
| | | Long director = null; |
| | | if (deptId==null && userId == null){ |
| | | if (getRole().getId()==3){ |
| | | userId = getUserId(); |
| | | }else if (getRole().getId()==2){ |
| | | deptId = getDeptId(); |
| | | userId = null; |
| | | } |
| | | director = getUserId(); |
| | | } |
| | | |
| | | return R.ok(planService.getPage(new Page<>(curr, limit) |
| | | , getHostId() |
| | | , deptId == null ? null : String.valueOf(deptId) |
| | | , userId == null ? getUserId() : userId |
| | | , userId |
| | | , director |
| | | , condition) |
| | | ); |
| | | } |
| | |
| | | |
| | | @RequestMapping(value = "/plan/insert/file/auth") |
| | | // @ManagerAuth |
| | | public R insertFile(@RequestParam("planId") String planId,@RequestParam MultipartFile file){ |
| | | try{ |
| | | InputStream inputStream = file.getInputStream(); |
| | | // 获取文件的内容类型 |
| | | String contentType = file.getContentType(); |
| | | String suffix = getFileSuffix(file.getOriginalFilename()); |
| | | String url = ossService.upload(inputStream, suffix,contentType); |
| | | // String url = "http://tjdt.oss-cn-hangzhou.aliyuncs.com/"+file.getOriginalFilename(); |
| | | String[] names = url.split("com/"); |
| | | String name= names[1]; |
| | | public R insertFile(@RequestParam("planId") String planId, @RequestParam("filename") String filename, @RequestParam("filesize") Long filesize) { |
| | | try { |
| | | // InputStream inputStream = file.getInputStream(); |
| | | // // 获取文件的内容类型 |
| | | // String contentType = file.getContentType(); |
| | | // String url = ossService.upload(inputStream, file.getOriginalFilename(), contentType); |
| | | //// String url = "http://tjdt.oss-cn-hangzhou.aliyuncs.com/"+file.getOriginalFilename(); |
| | | // String[] names = url.split("com/"); |
| | | // String name= names[1]; |
| | | |
| | | |
| | | String[] split = planId.split("-"); |
| | | int id = Integer.parseInt(split[1]); |
| | | planService.increasePlanUrl(id,url,name,file.getSize()); |
| | | |
| | | /*String[] split = planId.split("-"); |
| | | int id = Integer.parseInt(split[1]); |
| | | System.out.println("---开始---"); |
| | | String savePath = "D:/crm/plan/file/"+id+"/"; // 指定保存文件的路径 |
| | | try{ |
| | | FileSaveExampleUtil.saveFile(file, savePath); |
| | | }catch (Exception e){ |
| | | return R.error(); |
| | | }*/ |
| | | String url = "http://zhongyang-ftpserver.oss-cn-hangzhou.aliyuncs.com/" + filename; |
| | | planService.increasePlanUrl(id, url, filename, filesize); |
| | | return R.ok(); |
| | | }catch (Exception e){ |
| | | } catch (Exception e) { |
| | | System.out.println(e); |
| | | return R.error(); |
| | | } |
| | |
| | | if (Cools.isEmpty(dto.getMsg())){ |
| | | dto.setMsg("售前组长" + planLeader.getNickname() + "审批通过"); |
| | | }else { |
| | | dto.setMsg(dto.getMsg()+" ————————————————— "+DateUtils.convert(new Date())+" "+"售前组长" + planLeader.getNickname() + "审批通过"); |
| | | dto.setMsg(dto.getMsg()+PZH+DateUtils.convert(new Date())+" "+"售前组长" + planLeader.getNickname() + "审批通过"); |
| | | } |
| | | dto.setTime(DateUtils.convert(new Date())); |
| | | break; |
| | |
| | | if (Cools.isEmpty(dto.getMsg())){ |
| | | dto.setMsg("规划员" + plannerUser.getNickname() + "审批通过"); |
| | | }else { |
| | | dto.setMsg(dto.getMsg()+" ————————————————— "+DateUtils.convert(new Date())+" "+"规划员" + plannerUser.getNickname() + "审批通过"); |
| | | dto.setMsg(dto.getMsg()+PZH+DateUtils.convert(new Date())+" "+"规划员" + plannerUser.getNickname() + "审批通过"); |
| | | } |
| | | dto.setTime(DateUtils.convert(new Date())); |
| | | break; |
| | |
| | | if (Cools.isEmpty(dto.getMsg())){ |
| | | dto.setMsg("业务员" + salesman0.getNickname() + "审批通过"); |
| | | }else { |
| | | dto.setMsg(dto.getMsg()+" ————————————————— "+DateUtils.convert(new Date())+" "+"业务员" + salesman0.getNickname() + "审批通过"); |
| | | dto.setMsg(dto.getMsg()+PZH+DateUtils.convert(new Date())+" "+"业务员" + salesman0.getNickname() + "审批通过"); |
| | | } |
| | | dto.setTime(DateUtils.convert(new Date())); |
| | | break; |
| | |
| | | List<SettleDto> planDtoList = new ArrayList<>(); |
| | | boolean sign = true; |
| | | for (SettleDto dto : planDtos) { |
| | | if (dto.getStep().equals(2)){ |
| | | plan.setDirector(dto.getUserId()); |
| | | } |
| | | if (sign && dto.getUserId().equals(directorId) && plan.getSettle()+1==dto.getStep()){ |
| | | if (Cools.isEmpty(dto.getMsg())){ |
| | | dto.setMsg(DateUtils.convert(now)+" "+director.getNickname()+"回退审批"); |
| | | }else { |
| | | dto.setMsg(dto.getMsg()+" ————————————————— "+DateUtils.convert(now)+" "+director.getNickname()+"回退审批"); |
| | | dto.setMsg(dto.getMsg()+PZH+DateUtils.convert(now)+" "+director.getNickname()+"回退审批"); |
| | | } |
| | | sign = false; |
| | | } |
| | | if (sign){ |
| | | dto.setMsg(dto.getMsg()+" ————————————————— "+DateUtils.convert(now)+" "+director.getNickname()+"回退审批"); |
| | | dto.setMsg(dto.getMsg()+PZH+DateUtils.convert(now)+" "+director.getNickname()+"回退审批"); |
| | | } |
| | | |
| | | planDtoList.add(dto); |
| | |
| | | plan.setStatus(0); |
| | | plan.setStep(1); |
| | | plan.setSettle(1); |
| | | |
| | | PlanType planType = planTypeService.selectById(plan.getPlanType()); |
| | | User planLeader = planTypeService.findPlanLeader(planType); |
| | | plan.setDirector(planLeader.getId()); |
| | | plan.setSettleMsg(JSON.toJSONString(planDtoList)); |
| | | plan.setUpdateBy(getUserId()); |
| | | plan.setUpdateTime(now); |
| | | planService.updateById(plan); |
| | | return R.ok("回退成功"); |
| | | } |
| | |
| | | List<User> users = userService.selectList(new EntityWrapper<User>().eq("dept_id", planLeader.getDeptId())); |
| | | List<KeyValueVo> vos = new ArrayList<>(); |
| | | users.forEach(item -> vos.add(new KeyValueVo(String.valueOf(item.getNickname()), item.getId()))); |
| | | if (planType.getType().equals(2)){ |
| | | ProcessPermissions processPermissions= processPermissionsService.selectOne(new EntityWrapper<ProcessPermissions>().eq("process_memo", 101).eq("process", "1-1"));//2:核价流程 |
| | | User manager = userService.selectById(processPermissions.getUserId()); // 获取核价流程节点1确认人 |
| | | vos.add(new KeyValueVo(String.valueOf(manager.getNickname()), manager.getId())); |
| | | } |
| | | return R.ok().add(vos); |
| | | } |
| | | |
| | |
| | | wrapper.like("name", condition); |
| | | wrapper.eq("status",1); |
| | | |
| | | int type =1; |
| | | if (getUser().getNickname().equals("李世豪2级")){ |
| | | type=2; |
| | | List<ProcessPermissions> processPermissionsList = processPermissionsService.selectList(new EntityWrapper<ProcessPermissions>().eq("process_memo", 4).or().eq("process_memo", 5));//2:核价流程 |
| | | int type =0; |
| | | for (ProcessPermissions processPermissions:processPermissionsList){ |
| | | if (getUserId().equals(processPermissions.getUserId())){ |
| | | type=PBN-processPermissions.getProcessMemo(); |
| | | break; |
| | | } |
| | | } |
| | | if (type==0){ |
| | | return R.error("你不是核价员,无权接任务"); |
| | | } |
| | | |
| | | List<Long> typeList = new ArrayList<>(); |
| | | List<PlanType> planTypes = planTypeService.selectList(new EntityWrapper<PlanType>().eq("type", type)); |
| | | if (Cools.isEmpty(planTypes) || planTypes.size()==0){ |
| | | return R.ok(); |
| | | } |
| | | for (PlanType planType : planTypes){ |
| | | typeList.add(planType.getId()); |
| | | } |