| | |
| | | import me.zhyd.oauth.log.Log; |
| | | import org.joda.time.DateTime; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springblade.modules.task.entity.Task; |
| | |
| | | import org.springblade.modules.task.vo.TaskVO; |
| | | import org.springblade.modules.task.wrapper.TaskWrapper; |
| | | import org.springblade.modules.taskqd.entity.Taskqd; |
| | | import org.springblade.modules.taskqd.excel.TaskExcel; |
| | | import org.springblade.modules.taskqd.service.impl.TaskqdServiceImpl; |
| | | import org.springblade.modules.taskqd.vo.TaskqdVO; |
| | | import org.springblade.modules.taskqd.wrapper.TaskqdWrapper; |
| | | import org.springblade.modules.webscoket.service.IPushMsgService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | |
| | | return R.data(TaskqdWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | | /** |
| | | * 自定义分页查询 |
| | | * @param taskqd |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入task") |
| | | public R selectTaskQdPage(TaskqdVO taskqd, Query query) { |
| | | return R.data(taskqdService.selectTaskQdPage(Condition.getPage(query), taskqd)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 新增 |
| | |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入task") |
| | | public R update(@Valid @RequestBody Taskqd taskqd) { |
| | | |
| | | if (taskqd.getStime() == null || taskqd.getStime().equals("")){ |
| | | taskqd.setStime(null); |
| | | } |
| | | if (taskqd.getSendtime() == null || taskqd.getSendtime().equals("")){ |
| | | taskqd.setSendtime(null); |
| | | } |
| | | |
| | | return R.status(taskqdService.updateById(taskqd)); |
| | | } |
| | | |
| | |
| | | List<Taskqd> list = taskqdService.countTaskByJur(jurisdiction,startTime,period); |
| | | return R.data(list); |
| | | } |
| | | |
| | | /** |
| | | * 导出任务数据 |
| | | * @param task |
| | | * @param response |
| | | */ |
| | | @GetMapping("export-task") |
| | | public void exportTask(TaskqdVO task, HttpServletResponse response) { |
| | | List<TaskExcel> list = taskqdService.exportTask(task); |
| | | ExcelUtil.export(response, "任务数据" + DateUtil.time(), "任务数据表", list, TaskExcel.class); |
| | | } |
| | | } |