| | |
| | | |
| | | entity.setTbStateId(state.getGuid()); |
| | | // return R.status(this.saveOrUpdate(entity)); |
| | | |
| | | // 如果有危害,设置危害长度只留一个 |
| | | if (entity.getHazardRating().equals("有危害")) { |
| | | QueryWrapper qw = new QueryWrapper(); |
| | | qw.eq("\"dyke_guid\"",entity.getDykeGuid()); |
| | | qw.eq("\"unit\"",entity.getUnit()); |
| | | long count = count(qw); |
| | | if (count > 0) { |
| | | entity.setDangerLength(0D); |
| | | } |
| | | } |
| | | |
| | | this.saveOrUpdate(entity); |
| | | return R.data(entity); |
| | | } |
| | |
| | | // delete.eq("\"tb_state_id\"",state.getGuid()); |
| | | // boolean remove = remove(delete); |
| | | |
| | | String lengStr = "";//处理危害长度问题 |
| | | for (int i = 0; i < list.size(); i++) { |
| | | TbDykeInvestigation tbDykeInvestigation = list.get(i); |
| | | //id清空方便批量新增 |
| | |
| | | |
| | | //设置状态表id |
| | | tbDykeInvestigation.setTbStateId(state.getGuid()); |
| | | |
| | | |
| | | //处理危害长度 |
| | | if (tbDykeInvestigation.getHazardRating().equals("有危害")) { |
| | | if (lengStr.indexOf(tbDykeInvestigation.getUnit()) > -1) { |
| | | tbDykeInvestigation.setDangerLength(0D); |
| | | } |
| | | } |
| | | |
| | | lengStr = lengStr + tbDykeInvestigation.getUnit(); |
| | | |
| | | } |
| | | |
| | | return R.status(saveOrUpdateBatch(list)); |