| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.Task; |
| | | import com.zy.asrs.service.TaskService; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.Task; |
| | | import com.zy.asrs.service.TaskService; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | EntityWrapper<Task> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | wrapper.eq("is_deleted", 0); |
| | | allLike(Task.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)) { |
| | | wrapper.orderBy(humpToLine(orderByField), "desc".equals(orderByType)); |
| | |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("task")); |
| | | convert(map, wrapper); |
| | | wrapper.eq("is_deleted", 0); |
| | | List<Task> list = taskService.selectList(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | |
| | | public R query(String condition) { |
| | | EntityWrapper<Task> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | wrapper.eq("is_deleted", 0); |
| | | Page<Task> page = taskService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (Task task : page.getRecords()) { |