| | |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.AttResBase; |
| | | import cn.gistack.sm.sjztmd.entity.TbResGeneralInvestigation; |
| | | import cn.gistack.sm.sjztmd.entity.TbResGeneralInvestigationState; |
| | | import cn.gistack.sm.sjztmd.service.IAttResBaseService; |
| | | import cn.gistack.sm.sjztmd.service.ITbResGeneralInvestigationService; |
| | | import cn.gistack.sm.sjztmd.service.ITbResGeneralInvestigationStateService; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsBar; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsParams; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsPie; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsTable; |
| | | import cn.gistack.sm.sjztmd.vo.AttResBaseGeneralInvestigationVO; |
| | | import cn.gistack.sm.sjztmd.vo.ResGentionVO; |
| | | import cn.gistack.sm.sjztmd.vo.TbResGeneralInvestigationParam; |
| | | import cn.gistack.sm.sjztmd.wrapper.AttResBaseWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @PROJECT_NAME: skjcmanager |
| | |
| | | public class TbResGeneralInvestigationController { |
| | | |
| | | private ITbResGeneralInvestigationService tbResGeneralInvestigationService; |
| | | private ITbResGeneralInvestigationStateService tbResGeneralInvestigationStateService; |
| | | private IAttResBaseService attResBaseService; |
| | | |
| | | @ApiOperation(value = "中台水库-分页列表查询", notes = "中台水库-分页列表查询") |
| | | @GetMapping(value = "/resList") |
| | | public R queryPageList(AttResBase attResBase, Query query) { |
| | | IPage<AttResBase> pageList = attResBaseService.selectAttResBasePage(Condition.getPage(query), attResBase); |
| | | return R.data(AttResBaseWrapper.build().pageVO(pageList)); |
| | | @GetMapping(value = "/queryPageResList") |
| | | public R queryPageResList(AttResBaseGeneralInvestigationVO attResBase, Query query) { |
| | | Object pageList = attResBaseService.selectAttResBaseGeneralInvestigation(Condition.getPage(query), attResBase); |
| | | return R.data(pageList); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | |
| | | queryWrapper.eq("\"check_state\"", param.getCheckState()); |
| | | if (!StringUtil.isBlank(param.getResName())) |
| | | queryWrapper.like("\"res_name\"", param.getResName()); |
| | | if (!StringUtil.isBlank(param.getResGuid())) |
| | | queryWrapper.like("\"res_guid\"", param.getResGuid()); |
| | | if (!StringUtil.isBlank(param.getCreateUser())) |
| | | queryWrapper.like("\"create_user\"", param.getCreateUser()); |
| | | if (null != param.getTbYear()) |
| | | queryWrapper.like("\"tb_year\"", param.getTbYear()); |
| | | if (!StringUtil.isBlank(param.getTbQuarter())) |
| | | queryWrapper.like("\"tb_quarter\"", param.getTbQuarter()); |
| | | return R.data(tbResGeneralInvestigationService.page(Condition.getPage(query), queryWrapper)); |
| | | } |
| | | |
| | | @ApiOperation(value = "白蚁普查-校核接口", notes = "白蚁普查-校核接口") |
| | | @PostMapping("/checkInfoByResGuid") |
| | | public R checkInfoByResGuid(@RequestBody TbResGeneralInvestigationState tbResGeneralInvestigationState) { |
| | | |
| | | if (tbResGeneralInvestigationState.getGuid() == null || tbResGeneralInvestigationState.getCheckState() == null) { |
| | | return R.fail(-1,"参数不对"); |
| | | } |
| | | |
| | | //查询根据状态id查询普查记录表 |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("\"tb_state_id\"", tbResGeneralInvestigationState.getGuid()); |
| | | List<TbResGeneralInvestigation> list = tbResGeneralInvestigationService.list(queryWrapper); |
| | | List<TbResGeneralInvestigation> editList = list.stream().map(categoryEntity -> { |
| | | categoryEntity.setCheckState(tbResGeneralInvestigationState.getCheckState()); // 给每个categoryEntity对象的EvaluateTaskId属性设置新值 |
| | | return categoryEntity; // 返回修改后的对象 |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | // TbResGeneralInvestigationState tbResGeneralInvestigationState = new TbResGeneralInvestigationState(); |
| | | // tbResGeneralInvestigationState.setGuid(tbResGeneralInvestigation.getGuid()); |
| | | // tbResGeneralInvestigationState.setCheckState(tbResGeneralInvestigation.getCheckState()); |
| | | |
| | | //更新普查记录表状态和状态表状态 |
| | | return R.status(tbResGeneralInvestigationService.updateBatchById(editList) && tbResGeneralInvestigationStateService.updateById(tbResGeneralInvestigationState)); |
| | | } |
| | | |
| | | @ApiOperation(value = "白蚁普查-添加或者修改", notes = "白蚁普查-添加或者修改") |
| | | @PostMapping(value = "/submit") |
| | | public R submit(@RequestBody TbResGeneralInvestigation tbResGeneralInvestigation) { |
| | | if (tbResGeneralInvestigation.getGuid() == null) { |
| | | tbResGeneralInvestigation.setCreateTime(new Date()); |
| | | } |
| | | return R.status(tbResGeneralInvestigationService.saveOrUpdate(tbResGeneralInvestigation)); |
| | | // if (tbResGeneralInvestigation.getGuid() == null) { |
| | | tbResGeneralInvestigation.setCreateTime(new Date()); |
| | | // } |
| | | return tbResGeneralInvestigationService.saveOrUpdateBy(tbResGeneralInvestigation); |
| | | } |
| | | |
| | | @ApiOperation(value = "白蚁普查-添加或者修改", notes = "白蚁普查-添加或者修改") |
| | | @PostMapping(value = "/submitBatch") |
| | | public R submit(@RequestBody TbResGeneralInvestigationParam tbResGeneralInvestigationParam) { |
| | | |
| | | return tbResGeneralInvestigationService.saveOrUpdateByBatch(tbResGeneralInvestigationParam); |
| | | } |
| | | |
| | | @PostMapping("/remove") |
| | | @ApiOperation(value = "物理删除", notes = "传入id") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String id) { |
| | | return R.status(tbResGeneralInvestigationService.removeById(id)); |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | // return R.status(tbResGeneralInvestigationService.removeBatchByIds(Arrays.asList(ids.split(",")))); |
| | | return R.status(tbResGeneralInvestigationService.removeByIds(Arrays.asList(ids.split(",")))); |
| | | } |
| | | |
| | | @PostMapping("/getInvestigationListByStateId") |
| | | @ApiOperation(value = "根据状态id获取普查集合", notes = "传入id") |
| | | public R getInvestigationListByStateId(String stateId){ |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("\"tb_state_id\"",stateId); |
| | | |
| | | List<TbResGeneralInvestigation> list = tbResGeneralInvestigationService.list(queryWrapper); |
| | | return R.data(list); |
| | | } |
| | | |
| | | @GetMapping("/downloadZip") |
| | | @ApiOperation(value = "批量导出白蚁普查的图片视频zip文件") |
| | | public R downloadZip(Query query,String type) throws IOException { |
| | | |
| | | List<String> msg = tbResGeneralInvestigationService.downZip(Condition.getPage(query),type); |
| | | |
| | | return R.data(msg); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/downloadZipCopy") |
| | | @ApiOperation(value = "批量导出白蚁普查的图片视频zip文件") |
| | | public R downloadZipCopy(Query query,String type,AttResBaseGeneralInvestigationVO attResBase){ |
| | | |
| | | List<ResGentionVO> msg = tbResGeneralInvestigationService.downZipCopy(Condition.getPage(query),type,attResBase); |
| | | |
| | | return R.data(msg); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/statisticsPie") |
| | | public R statisticsPie(StatisticsParams statisticsParams){ |
| | | StatisticsPie statisticsPie = tbResGeneralInvestigationService.statisticsPie(statisticsParams); |
| | | return R.data(statisticsPie); |
| | | } |
| | | |
| | | @GetMapping("/statisticsBar") |
| | | public R statisticsBarProvince(StatisticsParams statisticsParams){ |
| | | List<StatisticsBar> list = tbResGeneralInvestigationService.statisticsBar(statisticsParams); |
| | | return R.data(list); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/statisticsTable") |
| | | public R statisticsTable(StatisticsParams statisticsParams){ |
| | | List<StatisticsTable> list = tbResGeneralInvestigationService.statisticsTable(statisticsParams); |
| | | return R.data(list); |
| | | } |
| | | |
| | | } |