| | |
| | | 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.Cstmr; |
| | | import com.zy.crm.manager.entity.CstmrFoll; |
| | | import com.zy.crm.manager.entity.CstmrType; |
| | | import com.zy.crm.manager.entity.result.KeyValueVo; |
| | | import com.zy.crm.manager.service.CstmrFollService; |
| | | import com.zy.crm.manager.service.CstmrService; |
| | | import com.zy.crm.manager.service.CstmrTypeService; |
| | | import com.zy.crm.system.entity.Dic; |
| | | import com.zy.crm.system.entity.Role; |
| | | import com.zy.crm.system.entity.User; |
| | | import com.zy.crm.system.service.DicService; |
| | | import com.zy.crm.system.service.UserService; |
| | |
| | | @RequestMapping("/cstmr/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<Cstmr> page = cstmrService.getPage(new Page<>(1, 30) |
| | | , getHostId() |
| | | , role.judgeLeader() ? String.valueOf(user.getDeptId()) : null |
| | | , user.getId() |
| | | , condition); |
| | | List<KeyValueVo> vos = new ArrayList<>(); |
| | | Wrapper<Cstmr> wrapper = new EntityWrapper<Cstmr>().andNew().like("name", condition).or().like("uuid", condition).orderBy("create_time", false); |
| | | cstmrService.selectPage(new Page<>(1, 30), wrapper).getRecords().forEach(item -> vos.add(new KeyValueVo(item.getName(), item.getId()))); |
| | | page.getRecords().forEach(item -> vos.add(new KeyValueVo(item.getName(), item.getId()))); |
| | | return R.ok().add(vos); |
| | | } |
| | | |