| | |
| | | */ |
| | | @Override |
| | | public boolean updateByGuid(TbAttResBase tbAttResBase) { |
| | | // 设置填报数据表的最终填报状态 |
| | | if (tbAttResBase.getCheckState()!=4) { |
| | | tbAttResBase.setFinalState(0); |
| | | } |
| | | // 查询是否存在 |
| | | TbAttResBase detail = baseMapper.getDetailByGuid(tbAttResBase.getGuid()); |
| | | // 更新审核日志 |
| | |
| | | // 驳回情况下将状态修改回0即已填写未提交状态 |
| | | if (tbAttResBase.getCheckState()==3){ |
| | | tbAttResBase.setCheckState(0); |
| | | // 只要一个退回则设置为填写中... |
| | | tbAttResBase.setFinalState(0); |
| | | } |
| | | // 更新数据 |
| | | int i = baseMapper.updateById(tbAttResBase); |
| | | if (i>0){ |
| | | // 如果是审核通过需要判断其他报表是否都已填报并审核通过 |
| | | if (tbAttResBase.getCheckState()==2){ |
| | | Boolean flag = baseMapper.getFinalCheckStateByGuid(tbAttResBase.getGuid()); |
| | | if (flag){ |
| | | TbAttResBase tbAttResBase1 = new TbAttResBase(); |
| | | tbAttResBase1.setFinalState(1); |
| | | tbAttResBase1.setGuid(tbAttResBase.getGuid()); |
| | | updateById(tbAttResBase1); |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | return false; |
| | |
| | | // 查询水库基础填报数据 |
| | | CompletableFuture<List<Map<String,Object>>> tbAttResBaseInfo = getTbAttResBaseInfo("tb_att_res_base",resGuid, executor); |
| | | // 查询水库其他填报数据 |
| | | CompletableFuture<List<Map<String,Object>>> tbAttResBuildInfo = getTbInfo("tb_att_res_build_info",resGuid,executor); |
| | | // CompletableFuture<List<Map<String,Object>>> tbAttResBuildInfo = getTbInfo("tb_att_res_build_info",resGuid,executor); |
| | | CompletableFuture<List<Map<String,Object>>> tbAttResEngBene = getTbInfo("tb_att_res_eng_bene",resGuid,executor); |
| | | CompletableFuture<List<Map<String,Object>>> tbAttResInfomationProject = getTbInfo("tb_att_res_infomation_project",resGuid,executor); |
| | | CompletableFuture<List<Map<String,Object>>> tbAttResMgrSysB = getTbInfo("tb_att_res_mgr_sys_b",resGuid,executor); |
| | |
| | | CompletableFuture<List<Map<String,Object>>> tbAttResStagChar = getTbInfo("tb_att_res_stag_char",resGuid,executor); |
| | | CompletableFuture<List<Map<String,Object>>> tbAttResWaterBlock = getTbInfo("tb_att_res_water_block",resGuid,executor); |
| | | CompletableFuture<List<Map<String,Object>>> tbAttResWaterDelivery = getTbInfo("tb_att_res_water_delivery",resGuid,executor); |
| | | CompletableFuture<List<Map<String,Object>>> tbFileStorageLocation = getTbInfo("tb_file_storage_location",resGuid,executor); |
| | | //等待所有任务执行完成 |
| | | try { |
| | | CompletableFuture.allOf( |
| | | tbAttResBaseInfo, |
| | | tbAttResBuildInfo, |
| | | tbFileStorageLocation, |
| | | tbAttResEngBene, |
| | | tbAttResInfomationProject, |
| | | tbAttResMgrSysB, |
| | |
| | | tbAttResWaterDelivery).get(); |
| | | // 数据处理 |
| | | list.addAll(tbAttResBaseInfo.get()); |
| | | list.addAll(tbAttResBuildInfo.get()); |
| | | list.addAll(tbAttResEngBene.get()); |
| | | list.addAll(tbAttResInfomationProject.get()); |
| | | list.addAll(tbAttResMgrSysB.get()); |
| | |
| | | list.addAll(tbAttResStagChar.get()); |
| | | list.addAll(tbAttResWaterBlock.get()); |
| | | list.addAll(tbAttResWaterDelivery.get()); |
| | | list.addAll(tbFileStorageLocation.get()); |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } catch (ExecutionException e) { |
| | |
| | | return tbInfo; |
| | | },executor); |
| | | } |
| | | |
| | | /** |
| | | * 更新水库信息填报最终状态 |
| | | * @param resGuid 水库编码 |
| | | * @param state 状态值 |
| | | */ |
| | | @Override |
| | | public Boolean updateFinalState(String resGuid, int state) { |
| | | TbAttResBase tbAttResBase = new TbAttResBase(); |
| | | tbAttResBase.setGuid(resGuid); |
| | | if (state==2){ |
| | | // 审核通过,判断是否已全部通过审核 |
| | | Boolean flag = baseMapper.getFinalCheckStateByGuid(resGuid); |
| | | if (flag){ |
| | | tbAttResBase.setFinalState(1); |
| | | }else { |
| | | tbAttResBase.setFinalState(0); |
| | | } |
| | | }else { |
| | | tbAttResBase.setFinalState(0); |
| | | } |
| | | //更新 |
| | | return updateById(tbAttResBase); |
| | | } |
| | | } |