| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.task.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.log.annotation.ApiLog; |
| | | import org.springblade.core.log.logger.BladeLogger; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.jackson.JsonUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.grid.entity.GridmanEntity; |
| | | import org.springblade.modules.task.entity.TaskReportForRepairsEntity; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 报事报修任务表 控制器 |
| | |
| | | public class TaskReportForRepairsController extends BladeController { |
| | | |
| | | private final ITaskReportForRepairsService taskReportForRepairsService; |
| | | private final BladeLogger bladeLogger; |
| | | |
| | | /** |
| | | * 报事报修任务表 详情 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiLog("报事报修任务表 详情") |
| | | @ApiOperation(value = "详情", notes = "传入taskReportForRepairs") |
| | | public R<TaskReportForRepairsVO> detail(TaskReportForRepairsEntity taskReportForRepairs) { |
| | | public R detail(TaskReportForRepairsEntity taskReportForRepairs) { |
| | | bladeLogger.info("报事报修任务表 详情", JsonUtil.toJson(taskReportForRepairs)); |
| | | TaskReportForRepairsEntity detail = taskReportForRepairsService.getOne(Condition.getQueryWrapper(taskReportForRepairs)); |
| | | return R.data(TaskReportForRepairsWrapper.build().entityVO(detail)); |
| | | return R.data(detail); |
| | | } |
| | | /** |
| | | * 报事报修任务表 分页 |
| | |
| | | * 报事报修任务表 自定义分页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiLog("报事报修任务表 自定义分页") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入taskReportForRepairs") |
| | | public R<IPage<TaskReportForRepairsVO>> page(TaskReportForRepairsVO taskReportForRepairs, Query query) { |
| | | bladeLogger.info("报事报修任务表 自定义分页", JsonUtil.toJson(taskReportForRepairs)); |
| | | IPage<TaskReportForRepairsVO> pages = taskReportForRepairsService.selectTaskReportForRepairsPage(Condition.getPage(query), taskReportForRepairs); |
| | | return R.data(pages); |
| | | } |
| | |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiLog("报事报修任务表 新增") |
| | | @ApiOperation(value = "新增", notes = "传入taskReportForRepairs") |
| | | public R save(@Valid @RequestBody TaskReportForRepairsEntity taskReportForRepairs) { |
| | | bladeLogger.info("报事报修任务表 新增", JsonUtil.toJson(taskReportForRepairs)); |
| | | return R.status(taskReportForRepairsService.saveTaskReportForRepairs(taskReportForRepairs)); |
| | | } |
| | | |
| | |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiLog("报事报修任务表 修改") |
| | | @ApiOperation(value = "修改", notes = "传入taskReportForRepairs") |
| | | public R update(@Valid @RequestBody TaskReportForRepairsEntity taskReportForRepairs) { |
| | | bladeLogger.info("报事报修任务表 修改", JsonUtil.toJson(taskReportForRepairs)); |
| | | taskReportForRepairs.setConfirmTime(new Date()); |
| | | return R.status(taskReportForRepairsService.updateById(taskReportForRepairs)); |
| | | } |
| | | |
| | |
| | | * 报事报修任务表 自定义修改 |
| | | */ |
| | | @PostMapping("/updateTaskReportForRepairs") |
| | | @ApiOperation(value = "修改", notes = "传入taskReportForRepairs") |
| | | @ApiLog("报事报修任务表 自定义修改") |
| | | @ApiOperation(value = "自定义修改", notes = "传入taskReportForRepairs") |
| | | public R updateTaskReportForRepairs(@RequestBody TaskReportForRepairsEntity taskReportForRepairs) { |
| | | bladeLogger.info("报事报修任务表 自定义修改", JsonUtil.toJson(taskReportForRepairs)); |
| | | return R.status(taskReportForRepairsService.updateTaskReportForRepairs(taskReportForRepairs)); |
| | | } |
| | | |
| | |
| | | */ |
| | | @PostMapping("/checkReportForRepairs") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入taskReportForRepairs") |
| | | @ApiLog("报事报修任务表 审核") |
| | | @ApiOperation(value = "审核", notes = "传入taskReportForRepairs") |
| | | public R checkReportForRepairs(@RequestBody TaskReportForRepairsEntity taskReportForRepairs) { |
| | | bladeLogger.info("报事报修任务表 审核", JsonUtil.toJson(taskReportForRepairs)); |
| | | return R.status(taskReportForRepairsService.checkReportForRepairs(taskReportForRepairs)); |
| | | } |
| | | |
| | |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiLog("报事报修任务表 新增或修改") |
| | | @ApiOperation(value = "新增或修改", notes = "传入taskReportForRepairs") |
| | | public R submit(@Valid @RequestBody TaskReportForRepairsEntity taskReportForRepairs) { |
| | | bladeLogger.info("报事报修任务表 新增或修改", JsonUtil.toJson(taskReportForRepairs)); |
| | | return R.status(taskReportForRepairsService.saveOrUpdate(taskReportForRepairs)); |
| | | } |
| | | |
| | |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiLog("报事报修任务表 详情") |
| | | @ApiOperation(value = "逻辑删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | bladeLogger.info("报事报修任务表 删除", JsonUtil.toJson(ids)); |
| | | return R.status(taskReportForRepairsService.deleteLogic(Func.toLongList(ids))); |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/getStatisticsCount") |
| | | public R statisticsCount() { |
| | | return R.data(taskReportForRepairsService.getStatisticsCount()); |
| | | @ApiLog("查询报事报修统计") |
| | | public R statisticsCount(@RequestParam(value = "houseCode",required = false) String houseCode) { |
| | | bladeLogger.info("查询报事报修统计", JsonUtil.toJson(houseCode)); |
| | | return R.data(taskReportForRepairsService.getStatisticsCount(houseCode)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/getStatistics") |
| | | @ApiLog("w网格员查询报事报修统计") |
| | | @ApiOperation(value = "w网格员查询报事报修统计" ) |
| | | public R getStatistics() { |
| | | return R.data(taskReportForRepairsService.getStatistics(AuthUtil.getUserId())); |
| | | return R.data(null); |
| | | } |
| | | |
| | | /** |
| | | * w网格员查询报事报修统计 |
| | | * |
| | | * @return |
| | | */ |
| | | @GetMapping("/getReportForStatistics") |
| | | @ApiLog("报事报修任务表 详情") |
| | | @ApiOperation(value = "查询报事报修统计" ) |
| | | public R getReportForStatistics(@RequestParam("code") String code, @RequestParam("roleType") String roleType) { |
| | | bladeLogger.info("w网格员查询报事报修统计", JsonUtil.toJson(roleType)); |
| | | return R.data(taskReportForRepairsService.getReportForStatistics(code, roleType)); |
| | | } |
| | | |
| | | /** |
| | |
| | | public R updateView(@Valid @RequestBody GridmanEntity gridman) { |
| | | return R.status(taskReportForRepairsService.updateView(gridman)); |
| | | } |
| | | |
| | | |
| | | } |