| | |
| | | |
| | | 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.TbResGeneralInvestigationParam; |
| | | import cn.gistack.sm.sjztmd.wrapper.AttResBaseWrapper; |
| | |
| | | public class TbResGeneralInvestigationController { |
| | | |
| | | private ITbResGeneralInvestigationService tbResGeneralInvestigationService; |
| | | private ITbResGeneralInvestigationStateService tbResGeneralInvestigationStateService; |
| | | private IAttResBaseService attResBaseService; |
| | | |
| | | @ApiOperation(value = "中台水库-分页列表查询", notes = "中台水库-分页列表查询") |
| | |
| | | @PostMapping("/checkInfoByResGuid") |
| | | public R checkInfoByResGuid(@RequestBody TbResGeneralInvestigation tbResGeneralInvestigation) { |
| | | |
| | | if (tbResGeneralInvestigation.getResGuid() == null || tbResGeneralInvestigation.getCheckState() == null) { |
| | | if (tbResGeneralInvestigation.getTbStateId() == null || tbResGeneralInvestigation.getCheckState() == null) { |
| | | return R.fail(-1,"参数不对"); |
| | | } |
| | | |
| | | //查询根据状态id查询普查记录表 |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("\"res_guid\"", tbResGeneralInvestigation.getResGuid()); |
| | | queryWrapper.eq("\"tb_state_id\"", tbResGeneralInvestigation.getTbStateId()); |
| | | List<TbResGeneralInvestigation> list = tbResGeneralInvestigationService.list(queryWrapper); |
| | | List<TbResGeneralInvestigation> editList = list.stream().map(categoryEntity -> { |
| | | categoryEntity.setCheckState(tbResGeneralInvestigation.getCheckState()); // 给每个categoryEntity对象的EvaluateTaskId属性设置新值 |
| | | return categoryEntity; // 返回修改后的对象 |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | return R.status(tbResGeneralInvestigationService.updateBatchById(editList)); |
| | | TbResGeneralInvestigationState tbResGeneralInvestigationState = new TbResGeneralInvestigationState(); |
| | | tbResGeneralInvestigationState.setGuid(tbResGeneralInvestigation.getTbStateId()); |
| | | 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()); |
| | | } |
| | | // if (tbResGeneralInvestigation.getGuid() == null) { |
| | | tbResGeneralInvestigation.setCreateTime(new Date()); |
| | | // } |
| | | return tbResGeneralInvestigationService.saveOrUpdateBy(tbResGeneralInvestigation); |
| | | } |
| | | |
| | |
| | | return R.data(list); |
| | | } |
| | | |
| | | |
| | | |
| | | @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); |
| | | } |
| | | |
| | | } |