| | |
| | | import cn.gistack.sm.sjztmd.mapper.TbResGeneralInvestigationMapper; |
| | | 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.util.CalculateUtils; |
| | | import cn.gistack.sm.sjztmd.vo.TbResGeneralInvestigationParam; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.text.DecimalFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | public R saveOrUpdateBy(TbResGeneralInvestigation entity) { |
| | | |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("\"res_guid\"",entity.getResGuid()); |
| | | queryWrapper.eq("\"tb_year\"",entity.getTbYear()); |
| | | queryWrapper.eq("\"res_guid\"", entity.getResGuid()); |
| | | queryWrapper.eq("\"tb_year\"", entity.getTbYear()); |
| | | // queryWrapper.eq("\"tb_quarter\"",entity.getTbQuarter()); |
| | | TbResGeneralInvestigationState state = tbResGeneralInvestigationStateService.getOne(queryWrapper); |
| | | if (null == state) { |
| | |
| | | // 是否普查完成 1是 0否 |
| | | if (entity.getCheckState() != 0) { |
| | | state.setCheckState(entity.getIsInvCom()); |
| | | }else{ |
| | | } else { |
| | | state.setCheckState(0); |
| | | } |
| | | |
| | | tbResGeneralInvestigationStateService.saveOrUpdate(state); |
| | | |
| | | entity.setTbStateId(state.getGuid()); |
| | | return R.status(this.saveOrUpdate(entity)); |
| | | // return R.status(this.saveOrUpdate(entity)); |
| | | this.saveOrUpdate(entity); |
| | | return R.data(entity); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | //查询该水库本年度是否有填报状态记录 |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("\"res_guid\"",entity.getResGuid()); |
| | | queryWrapper.eq("\"tb_year\"",entity.getTbYear()); |
| | | queryWrapper.eq("\"res_guid\"", entity.getResGuid()); |
| | | queryWrapper.eq("\"tb_year\"", entity.getTbYear()); |
| | | TbResGeneralInvestigationState state = tbResGeneralInvestigationStateService.getOne(queryWrapper); |
| | | if (null == state) { |
| | | //无填报状态记录则新建 |
| | |
| | | //id清空方便批量新增 |
| | | // tbResGeneralInvestigation.setGuid(""); |
| | | |
| | | if (tbResGeneralInvestigation.getCreateTime() == null){ |
| | | if (tbResGeneralInvestigation.getCreateTime() == null) { |
| | | tbResGeneralInvestigation.setCreateTime(DateUtil.now()); |
| | | } |
| | | |
| | | if (tbResGeneralInvestigation.getCreateUser() == null){ |
| | | if (tbResGeneralInvestigation.getCreateUser() == null) { |
| | | tbResGeneralInvestigation.setCreateUser(AuthUtil.getUserId().toString()); |
| | | } |
| | | |
| | |
| | | } |
| | | return R.status(saveOrUpdateBatch(list)); |
| | | } |
| | | |
| | | @Override |
| | | public StatisticsPie statisticsPie(StatisticsParams statisticsParams) { |
| | | return baseMapper.statisticsPie(statisticsParams); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<StatisticsBar> statisticsBar(StatisticsParams statisticsParams) { |
| | | List<StatisticsBar> list = baseMapper.getStatisticsBar(statisticsParams); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<StatisticsTable> statisticsTable(StatisticsParams statisticsParams) { |
| | | |
| | | List<StatisticsTable> list = baseMapper.getStatisticsTable(statisticsParams); |
| | | |
| | | list.forEach(statisticsTable -> { |
| | | statisticsTable.setUnInvestigationResNum(statisticsTable.getResNum() - statisticsTable.getInvestigationResNum()); |
| | | statisticsTable.setUnInvestigationDykeNum(statisticsTable.getDykeNum() - statisticsTable.getInvestigationDykeNum()); |
| | | }); |
| | | |
| | | return list; |
| | | } |
| | | } |