|  |  | 
 |  |  | import com.core.common.BaseRes; | 
 |  |  | import com.core.common.Cools; | 
 |  |  | import com.core.common.R; | 
 |  |  | import com.core.domain.KeyValueVo; | 
 |  |  | import com.core.exception.CoolException; | 
 |  |  | import com.zy.crm.common.web.BaseController; | 
 |  |  | import com.zy.crm.manager.controller.result.FollowerTableVo; | 
 |  |  | 
 |  |  | import com.zy.crm.manager.entity.OrderFoll; | 
 |  |  | import com.zy.crm.manager.service.OrderFollService; | 
 |  |  | import com.zy.crm.manager.service.OrderService; | 
 |  |  | import com.zy.crm.system.entity.Role; | 
 |  |  | import com.zy.crm.system.entity.User; | 
 |  |  | import com.zy.crm.system.service.UserService; | 
 |  |  | import org.apache.poi.hssf.usermodel.HSSFWorkbook; | 
 |  |  | 
 |  |  |         order.setUpdateBy(getUserId()); | 
 |  |  |         order.setUpdateTime(new Date()); | 
 |  |  |         order.setStatus(1); | 
 |  |  |         order.setStep(1); | 
 |  |  |  | 
 |  |  |         orderService.insert(order); | 
 |  |  |         return R.ok(); | 
 |  |  | 
 |  |  |         return R.ok(result); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @RequestMapping(value = "/orderQueryName/auth") | 
 |  |  |     @ManagerAuth | 
 |  |  |     public R queryName(String condition) { | 
 |  |  |         EntityWrapper<Order> wrapper = new EntityWrapper<>(); | 
 |  |  |         wrapper.like("name", condition); | 
 |  |  |         Long id = getRole().getId(); | 
 |  |  |         if (id.equals(1L)) { | 
 |  |  |             wrapper.eq("host_id", 1); | 
 |  |  |         } else if (id.equals(2L)) { | 
 |  |  |             wrapper.eq("dept_id", getDeptId()); | 
 |  |  |         } else { | 
 |  |  |             wrapper.eq("user_id", getUserId()); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         Page<Order> page = orderService.selectPage(new Page<>(0, 10), wrapper); | 
 |  |  |         List<Map<String, Object>> result = new ArrayList<>(); | 
 |  |  |         for (Order order : page.getRecords()){ | 
 |  |  |             Map<String, Object> map = new HashMap<>(); | 
 |  |  |             map.put("id", order.getId()); | 
 |  |  |             map.put("value", order.getName()); | 
 |  |  |             result.add(map); | 
 |  |  |         } | 
 |  |  |         return R.ok(result); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @RequestMapping(value = "/order/check/column/auth") | 
 |  |  |     @ManagerAuth | 
 |  |  |     public R query(@RequestBody JSONObject param) { | 
 |  |  | 
 |  |  |         return R.ok(); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @RequestMapping("/order/all/get/kv") | 
 |  |  |     @ManagerAuth | 
 |  |  |     public R getDataKV(@RequestParam(required = false) String condition) { | 
 |  |  |         User user = getUser(); assert user != null; | 
 |  |  |         Role role = getRole(); assert role != null; | 
 |  |  |         Page<Order> page = orderService.getPage(new Page<>(1, 30) | 
 |  |  |                 , getHostId() | 
 |  |  |                 , role.judgeLeader() ? String.valueOf(user.getDeptId()) : null | 
 |  |  |                 , user.getId() | 
 |  |  |                 , condition); | 
 |  |  |         List<KeyValueVo> vos = new ArrayList<>(); | 
 |  |  |         page.getRecords().forEach(item -> vos.add(new KeyValueVo(item.getName(), item.getId()))); | 
 |  |  |         return R.ok().add(vos); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /*************************************** 数据相关 ***********************************************/ | 
 |  |  |  | 
 |  |  |     /** |