| | |
| | | |
| | | import cn.gistack.sm.sg.DO.SgProjectInfoDO; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import cn.gistack.sm.sg.VO.SgProjectInfoVO; |
| | | import cn.gistack.sm.sg.VO.*; |
| | | import cn.gistack.sm.sg.excel.ProjectExcel; |
| | | import cn.gistack.sm.sg.excel.ProjectImport; |
| | | import cn.gistack.sm.sg.service.SgProjectInfoService; |
| | | import cn.gistack.sm.sjztmd.entity.AttResBase; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | |
| | | 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.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | |
| | | /** |
| | | * 分页列表查询 |
| | | */ |
| | | @GetMapping(value = "/list") |
| | | public R queryPageList(ProjectSearchDTO searchDTO, Query query) { |
| | | IPage<SgProjectInfoDO> page = sgProjectInfoService.queryPageList(Condition.getPage(query), searchDTO); |
| | | @PostMapping(value = "/list") |
| | | public R queryPageListPage(@RequestBody ProjectSearchDTO searchDTO) { |
| | | Query query = new Query(); |
| | | query.setCurrent(searchDTO.getCurrent()); |
| | | query.setSize(searchDTO.getSize()); |
| | | Object page = sgProjectInfoService.queryPageList(Condition.getPage(query), searchDTO); |
| | | return R.data(page); |
| | | } |
| | | |
| | |
| | | ExcelUtil.save(file, projectImport, ProjectExcel.class); |
| | | return R.success("操作成功"); |
| | | } |
| | | |
| | | /** |
| | | * 统计项目饼状图 |
| | | */ |
| | | @GetMapping("statisticsce") |
| | | public R projectStatisSum(String code) { |
| | | SgStatisticsVO sgStatisticsVO = sgProjectInfoService.getsgStatistics(code); |
| | | return R.data(sgStatisticsVO); |
| | | } |
| | | |
| | | /** |
| | | * 统计项目图列表 |
| | | */ |
| | | @GetMapping("statisticsBarlist") |
| | | public R projectStatisList(String code) { |
| | | List<SgStatisProVO> sgStatisProVOS = sgProjectInfoService.getsgStatisticsList(code); |
| | | return R.data(sgStatisProVOS); |
| | | } |
| | | |
| | | /** |
| | | * 统计项目柱状图 |
| | | */ |
| | | @GetMapping("statisticsBar") |
| | | public R projectStatis(String code) { |
| | | List<SgStatistccVO> sgStatisProVOS = sgProjectInfoService.getsgStatisticscc(code); |
| | | return R.data(sgStatisProVOS); |
| | | } |
| | | |
| | | /** |
| | | * 新增项目 |
| | | */ |
| | | @PostMapping("add") |
| | | public R add(@RequestBody SgProjectInfoDO sgProjectInfoDO) { |
| | | sgProjectInfoService.save(sgProjectInfoDO); |
| | | return R.data(sgProjectInfoDO); |
| | | } |
| | | |
| | | /** |
| | | * 修改项目 |
| | | */ |
| | | @PostMapping("update") |
| | | public R update(@RequestBody SgProjectInfoDO sgProjectInfoDO) { |
| | | sgProjectInfoService.updateById(sgProjectInfoDO); |
| | | return R.success("修改成功"); |
| | | } |
| | | |
| | | /** |
| | | * 项目树 |
| | | */ |
| | | @GetMapping("project_tree") |
| | | public R projectTree(ProjectSearchDTO dto) { |
| | | List<SgProjectTreeVO> tree = sgProjectInfoService.projectTree(dto); |
| | | return R.data(tree); |
| | | } |
| | | } |