| | |
| | | */ |
| | | @Override |
| | | public int deleteHoleByIds(String ids) { |
| | | |
| | | // 批量删除钻孔下面的关联数据 |
| | | String[] strings = Convert.toStrArray(ids); |
| | | if (!ObjectUtils.isEmpty(strings)) { |
| | | for (String holeId : strings) { |
| | | |
| | | // =======标贯========== |
| | | List<HoleBiaoguan> biaoguans = holeBiaoguanMapper.selectHoleBiaoguanByHoleId(holeId); |
| | | String[] biaoguanIds = biaoguans.stream().map(HoleBiaoguan::getIds).toArray(String[]::new); |
| | | |
| | | // =======回次========== |
| | | List<HoleHuici> holeHuicis = holeHuiciMapper.selectHoleHuiciByHoleId(holeId); |
| | | String[] huiCiIds = holeHuicis.stream().map(HoleHuici::getIds).toArray(String[]::new); |
| | | |
| | | // =======人员========== |
| | | List<HolePerson> persons = holePersonMapper.selectHolePersonByHoleId(holeId); |
| | | String[] personIds = persons.stream().map(HolePerson::getIds).toArray(String[]::new); |
| | | |
| | | // =======取土========== |
| | | List<HoleQutu> qutus = holeQutuMapper.selectHoleQutuByHoleId(holeId); |
| | | String[] qutuIds = qutus.stream().map(HoleQutu::getIds).toArray(String[]::new); |
| | | |
| | | // =======水位========== |
| | | List<HoleShuiwei> shuiweis = holeShuiweiMapper.selectHoleShuiWeiByHoleId(holeId); |
| | | String[] shuiweiIds = shuiweis.stream().map(HoleShuiwei::getIds).toArray(String[]::new); |
| | | |
| | | // =======岩土========== |
| | | List<HoleYantu> yantus = holeYantuMapper.selectHoleYantuListByHoleId(holeId); |
| | | String[] yantusIds = yantus.stream().map(HoleYantu::getIds).toArray(String[]::new); |
| | | |
| | | holeBiaoguanMapper.deleteHoleBiaoguanByIds(biaoguanIds); |
| | | holeHuiciMapper.deleteHoleHuiciByIds(huiCiIds); |
| | | holePersonMapper.deleteHolePersonByIds(personIds); |
| | | holeQutuMapper.deleteHoleQutuByIds(qutuIds); |
| | | holeShuiweiMapper.deleteHoleShuiweiByIds(shuiweiIds); |
| | | holeYantuMapper.deleteHoleYantuByIds(yantusIds); |
| | | } |
| | | } |
| | | // String[] strings = Convert.toStrArray(ids); |
| | | // if (!ObjectUtils.isEmpty(strings)) { |
| | | // for (String holeId : strings) { |
| | | // |
| | | // // =======标贯========== |
| | | // List<HoleBiaoguan> biaoguans = holeBiaoguanMapper.selectHoleBiaoguanByHoleId(holeId); |
| | | // String[] biaoguanIds = biaoguans.stream().map(HoleBiaoguan::getIds).toArray(String[]::new); |
| | | // |
| | | // // =======回次========== |
| | | // List<HoleHuici> holeHuicis = holeHuiciMapper.selectHoleHuiciByHoleId(holeId); |
| | | // String[] huiCiIds = holeHuicis.stream().map(HoleHuici::getIds).toArray(String[]::new); |
| | | // |
| | | // // =======人员========== |
| | | // List<HolePerson> persons = holePersonMapper.selectHolePersonByHoleId(holeId); |
| | | // String[] personIds = persons.stream().map(HolePerson::getIds).toArray(String[]::new); |
| | | // |
| | | // // =======取土========== |
| | | // List<HoleQutu> qutus = holeQutuMapper.selectHoleQutuByHoleId(holeId); |
| | | // String[] qutuIds = qutus.stream().map(HoleQutu::getIds).toArray(String[]::new); |
| | | // |
| | | // // =======水位========== |
| | | // List<HoleShuiwei> shuiweis = holeShuiweiMapper.selectHoleShuiWeiByHoleId(holeId); |
| | | // String[] shuiweiIds = shuiweis.stream().map(HoleShuiwei::getIds).toArray(String[]::new); |
| | | // |
| | | // // =======岩土========== |
| | | // List<HoleYantu> yantus = holeYantuMapper.selectHoleYantuListByHoleId(holeId); |
| | | // String[] yantusIds = yantus.stream().map(HoleYantu::getIds).toArray(String[]::new); |
| | | // |
| | | // holeBiaoguanMapper.deleteHoleBiaoguanByIds(biaoguanIds); |
| | | // holeHuiciMapper.deleteHoleHuiciByIds(huiCiIds); |
| | | // holePersonMapper.deleteHolePersonByIds(personIds); |
| | | // holeQutuMapper.deleteHoleQutuByIds(qutuIds); |
| | | // holeShuiweiMapper.deleteHoleShuiweiByIds(shuiweiIds); |
| | | // holeYantuMapper.deleteHoleYantuByIds(yantusIds); |
| | | // } |
| | | // } |
| | | |
| | | return holeMapper.deleteHoleByIds(Convert.toStrArray(ids)); |
| | | } |
| | |
| | | try { |
| | | String dest = saveExcel(file); |
| | | List<Hole> list = readData(dest); |
| | | for (Hole item : list) { |
| | | |
| | | insertHole(item); |
| | | if(!ObjectUtils.isEmpty(list)){ |
| | | for (Hole item : list) { |
| | | item.setProjectId(projectId); |
| | | insertHole(item); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | return e.toString(); |