| | |
| | | //业务员 |
| | | // Item item = itemService.selectById(priOnline.getItemId()); |
| | | Plan plan = planService.selectById(priOnline2.getItemId()); |
| | | if (plan.getStatus()!=1){ |
| | | return R.error("此规划单状态改变,请刷新页面重新选择!"); |
| | | } |
| | | priOnline2.setMemberId(plan.getUserId()); |
| | | |
| | | Cstmr cstmr = cstmrService.selectById(plan.getCstmrId()); |
| | |
| | | |
| | | priOnline2.setSettle(0); |
| | | |
| | | User manager = userService.getDeptManager(getHostId(), getUser().getDeptId()); // 获取部门领导 |
| | | User manager = new User(); |
| | | try{ |
| | | manager = userService.getDeptManager(getHostId(), getUser().getDeptId()); // 获取部门领导 |
| | | }catch (Exception e){ |
| | | manager = getUser(); |
| | | } |
| | | User userUp = userService.selectById(plan.getUserId()); // 获取业务员 |
| | | List<String> initNames = new ArrayList<>(); |
| | | initNames.add("创建核价单模板"); |
| | | initNames.add("提交核价"); |
| | | initNames.add("部门经理审核"); |
| | | initNames.add("接取核价任务"); |
| | | initNames.add("完成核价"); |
| | | initNames.add("经理审核"); |
| | | initNames.add("业务员确认"); |
| | | priOnline2.setSettleMsg(JSON.toJSONString(SettleDto.initSalesPricing(manager,getUser(),initNames,3))); |
| | | priOnline2.setSettleMsg(JSON.toJSONString(SettleDto.initSalesPricing(manager,getUser(),userUp,initNames,3))); |
| | | |
| | | //设置项目流程 |
| | | plan.setStep(2); |
| | | plan.setStatus(2); |
| | | planService.updateById(plan); |
| | | |
| | | priOnline2Service.insert(priOnline2); |
| | |
| | | @RequestMapping(value = "/priOnline2/delete/auth") |
| | | @ManagerAuth(memo = "删除核价管理") |
| | | public R delete(Long[] ids){ |
| | | if (Cools.isEmpty(ids)){ |
| | | try{ |
| | | if (Cools.isEmpty(ids) || ids.length==0){ |
| | | return R.error(); |
| | | } |
| | | for (Long id : ids){ |
| | |
| | | return R.error("存在关联的产品费用明细,禁止删除!!!"); |
| | | } |
| | | } |
| | | for (Long id : ids) { |
| | | PriOnline2 priOnline2 = priOnline2Service.selectById(id); |
| | | Plan plan = planService.selectById(priOnline2.getItemId()); |
| | | plan.setStatus(1); |
| | | planService.updateById(plan); |
| | | } |
| | | |
| | | priOnline2Service.deleteBatchIds(Arrays.asList(ids)); |
| | | return R.ok(); |
| | | }catch (Exception e){ |
| | | return R.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/priOnline2/export/auth") |
| | |
| | | switch (priOnline2.getSettle()) { |
| | | case 0: |
| | | User user2 = userService.selectById(priOnline2.getUserId()); |
| | | User manager1 = userService.getDeptManager(getHostId(), user2.getDeptId()); |
| | | User manager1 = new User(); |
| | | try{ |
| | | manager1 = userService.getDeptManager(getHostId(), user2.getDeptId()); // 获取部门领导 |
| | | }catch (Exception e){ |
| | | manager1 = user2; |
| | | } |
| | | |
| | | if (Cools.isEmpty(getUser())) { |
| | | return R.error("抱歉,您没有提交的权限"); |
| | |
| | | case 1: |
| | | // 本部门经理审核 |
| | | User user = userService.selectById(priOnline2.getUserId()); |
| | | User manager = userService.getDeptManager(getHostId(), user.getDeptId()); |
| | | User manager = new User(); |
| | | try{ |
| | | manager = userService.getDeptManager(getHostId(), getUser().getDeptId()); // 获取部门领导 |
| | | }catch (Exception e){ |
| | | manager = user; |
| | | } |
| | | if (manager.getId().equals(getUserId())) { |
| | | |
| | | // 修改 settle 步骤数据 |