| New file |
| | |
| | | package cn.gistack.sm.sg.controller; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgProgressReportDO; |
| | | import cn.gistack.sm.sg.DO.SgProjectInfoDO; |
| | | import cn.gistack.sm.sg.DTO.ApprovalDTO; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import cn.gistack.sm.sg.VO.SgProgressReportVO; |
| | | import cn.gistack.sm.sg.VO.SgProjectInfoVO; |
| | | import cn.gistack.sm.sg.VO.SgReportVO; |
| | | import cn.gistack.sm.sg.service.SgProgressReportService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 施工进度上报表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author shenyijian |
| | | * @since 2024-06-15 10:22:08 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/progress_report") |
| | | public class SgProgressReportController { |
| | | @Autowired |
| | | private SgProgressReportService sgProgressReportService; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | | */ |
| | | @GetMapping(value = "/page") |
| | | public R queryPageList(ProjectSearchDTO searchDTO, Query query) { |
| | | IPage<SgProgressReportVO> page = sgProgressReportService.queryPageList(Condition.getPage(query), searchDTO); |
| | | return R.data(page); |
| | | } |
| | | |
| | | /** |
| | | * 分页列表查询(所有数据,管理员用) |
| | | */ |
| | | @GetMapping(value = "/page_all") |
| | | public R queryPageListAll(ProjectSearchDTO searchDTO, Query query) { |
| | | IPage<SgProgressReportVO> page = sgProgressReportService.queryPageListAll(Condition.getPage(query), searchDTO); |
| | | return R.data(page); |
| | | } |
| | | |
| | | /** |
| | | * 新增上报 |
| | | */ |
| | | @PostMapping(value = "/add") |
| | | public R add(@RequestBody SgProgressReportDO sgProgressReportDO) { |
| | | sgProgressReportService.add(sgProgressReportDO); |
| | | return R.success("添加成功"); |
| | | } |
| | | |
| | | /** |
| | | * 修改上报 |
| | | */ |
| | | @PostMapping(value = "/update") |
| | | public R update(@RequestBody SgProgressReportDO sgProgressReportDO) { |
| | | sgProgressReportService.updateReport(sgProgressReportDO); |
| | | return R.success("添加成功"); |
| | | } |
| | | |
| | | /** |
| | | * 上报详情 |
| | | */ |
| | | @GetMapping(value = "/detail") |
| | | public R detail(String id) { |
| | | SgProgressReportVO sgProgressReportVO = sgProgressReportService.detail(id); |
| | | return R.data(sgProgressReportVO); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 审批 |
| | | */ |
| | | @PostMapping(value = "/approval") |
| | | public R approval(@RequestBody ApprovalDTO approvalDTO) { |
| | | sgProgressReportService.approval(approvalDTO); |
| | | return R.success("审批成功"); |
| | | } |
| | | |
| | | /** |
| | | * 待办列表(APP) |
| | | */ |
| | | @GetMapping(value = "/list") |
| | | public R queryList(ProjectSearchDTO searchDTO) { |
| | | List<SgProgressReportVO> list = sgProgressReportService.queryList( searchDTO); |
| | | return R.data(list); |
| | | } |
| | | |
| | | /** |
| | | * 待办列表分页 |
| | | */ |
| | | @GetMapping(value = "/project_progress_page") |
| | | public R progressPage(ProjectSearchDTO searchDTO,Query query) { |
| | | IPage<SgProgressReportVO> page = sgProgressReportService.progressPage(Condition.getPage(query),searchDTO); |
| | | return R.data(page); |
| | | } |
| | | |
| | | /** |
| | | * 待办列表统计(超级管理员) |
| | | */ |
| | | @GetMapping(value = "/approval_count_all") |
| | | public R countListAll(ProjectSearchDTO searchDTO) { |
| | | Map<String,Long> map= sgProgressReportService.countListAll( searchDTO); |
| | | return R.data(map); |
| | | } |
| | | |
| | | /** |
| | | * 待办列表统计(APP) |
| | | */ |
| | | @GetMapping(value = "/approval_count") |
| | | public R countList(ProjectSearchDTO searchDTO) { |
| | | Map<String,Long> map= sgProgressReportService.countList( searchDTO); |
| | | return R.data(map); |
| | | } |
| | | |
| | | /** |
| | | * 审批状态统计 |
| | | */ |
| | | @GetMapping(value = "/status_count") |
| | | public R statusCount(ProjectSearchDTO searchDTO) { |
| | | Map<String,Long> map= sgProgressReportService.statusCount(searchDTO); |
| | | return R.data(map); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 审批情况检验(APP) |
| | | */ |
| | | @GetMapping(value = "/check_step") |
| | | public R checkStep(@RequestParam Long deviceId , @RequestParam Long stepId) { |
| | | boolean flag = sgProgressReportService.checkStep(deviceId,stepId); |
| | | return R.data(flag); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询当前设备审批记录 |
| | | */ |
| | | @GetMapping(value = "/get_device_report") |
| | | public R getDeviceReport(@RequestParam Long deviceId , @RequestParam(required = false) Long stepId) { |
| | | String reportId = sgProgressReportService.getDeviceReport(deviceId,stepId); |
| | | return R.data(reportId); |
| | | } |
| | | |
| | | /** |
| | | * 查询当前设备审批记录 |
| | | */ |
| | | @GetMapping(value = "/get_device_reportcopy") |
| | | public R getDeviceReportcopy(@RequestParam Long deviceId , @RequestParam(required = false) Long stepId) { |
| | | SgReportVO sgReportVO = sgProgressReportService.getDeviceReportcopy(deviceId, stepId); |
| | | return R.data(sgReportVO); |
| | | } |
| | | } |