| | |
| | | import com.zy.crm.manager.controller.result.FollowerTableVo; |
| | | import com.zy.crm.manager.entity.Plan; |
| | | import com.zy.crm.manager.entity.PlanFoll; |
| | | import com.zy.crm.manager.entity.PlanType; |
| | | import com.zy.crm.manager.service.PlanFollService; |
| | | 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.UserService; |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | |
| | | |
| | | @Autowired |
| | | private PlanService planService; |
| | | @Autowired |
| | | private PlanTypeService planTypeService; |
| | | |
| | | @GetMapping(value = "/plan/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(planService.selectById(String.valueOf(id))); |
| | | Plan plan = planService.selectById(String.valueOf(id)); |
| | | assert plan != null; |
| | | JSONObject resultObj = JSON.parseObject(JSON.toJSONString(plan)); |
| | | if (!Cools.isEmpty(plan.getForm())) { |
| | | JSONObject formObj = JSON.parseObject(plan.getForm()); |
| | | formObj.forEach(resultObj::putIfAbsent); |
| | | } |
| | | PlanType planType = planTypeService.selectById(plan.getPlanType()); |
| | | if (planType == null) { |
| | | return R.error("当前规划单类型已被禁用"); |
| | | } |
| | | resultObj.put("formHtml", planType.getHtml()); |
| | | return R.ok().add(resultObj); |
| | | } |
| | | |
| | | @RequestMapping(value = "/plan/page/auth") |