| | |
| | | import com.zy.crm.manager.service.PlanService; |
| | | import com.zy.crm.manager.service.PlanTypeService; |
| | | import com.zy.crm.system.entity.User; |
| | | import com.zy.crm.system.service.DeptService; |
| | | import com.zy.crm.system.service.UserService; |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | | import org.apache.poi.ss.usermodel.DataFormatter; |
| | |
| | | private PlanService planService; |
| | | @Autowired |
| | | private PlanTypeService planTypeService; |
| | | @Autowired |
| | | private DeptService deptService; |
| | | |
| | | @GetMapping(value = "/plan/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | } |
| | | resultObj.put("formHtml", planType.getHtml()); |
| | | // 步骤条相关 |
| | | resultObj.put("step", this.getStepOfSettle(plan.getSettle())); |
| | | resultObj.put("step", plan.getSettle() == 5 ? 0 : plan.getSettle() + 1); |
| | | |
| | | return R.ok().add(resultObj); |
| | | } |
| | |
| | | |
| | | plan.setForm(JSON.toJSONString(param)); // 自定义表单内容 |
| | | plan.setSettle(1); // 1.开始 |
| | | plan.setSettleMsg(JSON.toJSONString(SettleDto.init(plan))); |
| | | User manager = userService.getDeptManager(hostId, getUser().getDeptId()); // 获取部门领导 |
| | | plan.setSettleMsg(JSON.toJSONString(SettleDto.init(plan, manager))); |
| | | |
| | | if (!planService.insert(plan)) { |
| | | throw new CoolException("保持失败,请重试"); |
| | |
| | | plan.setUpdateTime(new Date()); |
| | | |
| | | plan.setForm(JSON.toJSONString(param)); // 自定义表单内容 |
| | | plan.setSettleMsg(JSON.toJSONString(SettleDto.init(plan))); |
| | | User manager = userService.getDeptManager(getHostId(), getUser().getDeptId()); |
| | | plan.setSettleMsg(JSON.toJSONString(SettleDto.init(plan, manager))); |
| | | |
| | | if (!planService.updateById(plan)) { |
| | | throw new CoolException("保持失败,请重试"); |
| | |
| | | throw new CoolException("删除失败,请联系管理员"); |
| | | } |
| | | return R.ok("删除成功"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /*************************************** 步骤条相关 **********************************************/ |
| | | private Integer getStepOfSettle(int settle){ |
| | | switch (settle){ |
| | | case 1: |
| | | return 2; |
| | | case 2: |
| | | return 3; |
| | | case 3: |
| | | return 4; |
| | | case 4: |
| | | return 0; |
| | | default: |
| | | return 1; |
| | | } |
| | | } |
| | | |
| | | } |