| | |
| | | import com.core.common.R; |
| | | import com.core.domain.KeyValueVo; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.crm.common.model.enums.RoleType; |
| | | import com.zy.crm.common.web.BaseController; |
| | | import com.zy.crm.manager.controller.result.FollowerTableVo; |
| | | import com.zy.crm.manager.entity.Order; |
| | |
| | | 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) { |
| | |
| | | Role role = getRole(); assert role != null; |
| | | Page<Order> page = orderService.getPage(new Page<>(1, 30) |
| | | , getHostId() |
| | | , (role.getCode().equals(RoleType.boss.toString()) || role.getCode().equals(RoleType.manager.toString())) ? String.valueOf(user.getDeptId()) : null |
| | | , role.judgeLeader() ? String.valueOf(user.getDeptId()) : null |
| | | , user.getId() |
| | | , condition); |
| | | List<KeyValueVo> vos = new ArrayList<>(); |