| | |
| | | } |
| | | |
| | | assert dataList != null; |
| | | // System.out.println("++++++++++++++++++++000000"); |
| | | |
| | | // System.out.println(dataList.size()); |
| | | // for (ArchiveRecords archiveRecords : dataList) { |
| | | // System.out.println(dataList.size()); |
| | | // |
| | | // } |
| | | for (ArchiveRecords archiveRecords : dataList) { |
| | | // physcialService.mySave(physcial); |
| | | archiveRecords.setRecordStatus("未录入"); |
| | |
| | | LocalDateTime time = LocalDateTime.now(); |
| | | |
| | | Date date = Date.from(time.atZone(ZoneId.systemDefault()).toInstant()); |
| | | for(Long id : ids) |
| | | for(Long id : ids) { |
| | | // 获取当前用户ID,收回授权 |
| | | Long userId = SecurityUtils.getUserId(); |
| | | archiverecordstouserService.deleteArchiverecordstouserByRecordId(id, userId); |
| | | |
| | | this.baseMapper.updateStatusById("录入完成",id, date); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | |
| | | @Override |
| | | public AjaxResult mySave(ArchiveRecords archiveRecords) { |
| | | // 检查是否有重复数据插入 |
| | | System.out.println(archiveRecords.getRecordId()+"aaaaaaaaaaaaaaaaa"); |
| | | if(archiveRecords.getRecordId()==null||StringUtils.isEmpty(archiveRecords.getRecordId())) |
| | | throw new RuntimeException("档案号不能为空!"); |
| | | |
| | | LambdaQueryWrapper<ArchiveRecords> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(!StringUtils.isEmpty(archiveRecords.getRecordId()), ArchiveRecords::getRecordId,archiveRecords.getRecordId()); |
| | | List<ArchiveRecords> list = list(lqw); |
| | | if (!list.isEmpty()) { |
| | | Long userid = SecurityUtils.getUserId(); |
| | | if (!list.isEmpty()&&userid!=1) { |
| | | // throw new RuntimeException("请勿新增重复数据"); |
| | | //如果有重复数据,则根据recordId进行数据修改 |
| | | //如果有重复数据,则根据recordId进行数据修改sele |
| | | // if() |
| | | |
| | | // |
| | | this.baseMapper.update(archiveRecords, lqw); |
| | | return AjaxResult.success(); |
| | | |
| | | |
| | | } |
| | | else if(!list.isEmpty()) |
| | | { |
| | | throw new RuntimeException("请勿新增重复数据"); |
| | | } |
| | | else { |
| | | Long userid = SecurityUtils.getUserId(); |
| | | |
| | | if(userid==1) { |
| | | if (save(archiveRecords)) { |
| | | return AjaxResult.success(); |
| | |
| | | } |
| | | } |
| | | else |
| | | return AjaxResult.error("档案号不存在!"); |
| | | return AjaxResult.error("不是管理员,不能新增记录!"); |
| | | } |
| | | |
| | | } |