| | |
| | | if (StringUtils.isEmpty(categoryNumberStart) || StringUtils.isEmpty(categoryNumberEnd)) { |
| | | lqw.like(!StringUtils.isEmpty(archiveRecords.getRecordId()), ArchiveRecords::getRecordId, archiveRecords.getRecordId()); |
| | | } |
| | | else { |
| | | // else { |
| | | lqw. |
| | | like(!StringUtils.isEmpty(archiveRecords.getInquiryNumber()), ArchiveRecords::getInquiryNumber, archiveRecords.getInquiryNumber()) |
| | | .like(!StringUtils.isEmpty(archiveRecords.getCaseTitle()), ArchiveRecords::getCaseTitle, archiveRecords.getCaseTitle()) |
| | | .like(!StringUtils.isEmpty(archiveRecords.getPublicAttribute()), ArchiveRecords::getPublicAttribute, archiveRecords.getPublicAttribute()) |
| | | |
| | | .like(!StringUtils.isEmpty(archiveRecords.getPublicAttribute()), ArchiveRecords::getPublicAttribute, archiveRecords.getPublicAttribute()) |
| | | .like(!StringUtils.isEmpty(archiveRecords.getPreparationUnit()), ArchiveRecords::getPreparationUnit, archiveRecords.getPreparationUnit()) |
| | | .like(!StringUtils.isEmpty(archiveRecords.getRetentionPeriod()), ArchiveRecords::getRetentionPeriod, archiveRecords.getRetentionPeriod()) |
| | | .like(!StringUtils.isEmpty(archiveRecords.getSecurityClassification()), ArchiveRecords::getSecurityClassification, archiveRecords.getSecurityClassification()) |
| | |
| | | .like(!StringUtils.isEmpty(archiveRecords.getEveryProjectName()), ArchiveRecords::getEveryProjectName, archiveRecords.getEveryProjectName()) |
| | | .like(!StringUtils.isEmpty(archiveRecords.getRemarks()), ArchiveRecords::getRemarks, archiveRecords.getRemarks()); |
| | | |
| | | } |
| | | // } |
| | | |
| | | if(archiveRecords.getIds()!=null) |
| | | lqw.in(ArchiveRecords::getId,new ArrayList<>(Arrays.asList(archiveRecords.getIds()))); |
| | |
| | | } |
| | | |
| | | 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("未录入"); |
| | | System.out.println(archiveRecords.getProjectName()); |
| | | LocalDateTime time = LocalDateTime.now(); |
| | | |
| | | String title = ""; |
| | | if(archiveRecords.getConstructionUnit()!=null) |
| | | title = title +archiveRecords.getConstructionUnit(); |
| | | if(archiveRecords.getConstructionAddress()!=null) |
| | | title = title + archiveRecords.getConstructionAddress(); |
| | | if(archiveRecords.getProjectName()!=null) |
| | | title = title + archiveRecords.getProjectName(); |
| | | archiveRecords.setCaseTitle(title); |
| | | Date date = Date.from(time.atZone(ZoneId.systemDefault()).toInstant()); |
| | | archiveRecords.setCreateTime(date); |
| | | this.mySave(archiveRecords); |
| | |
| | | // 获取当前用户ID |
| | | Long userId = SecurityUtils.getUserId(); |
| | | // 可以在这里使用userId进行授权操作 |
| | | if(operator.equals("退回管理员")) |
| | | if(operator.equals("退回管理员")||status.equals("录入完成")) |
| | | archiverecordstouserService.deleteArchiverecordstouserByRecordId(id, userId); |
| | | this.baseMapper.updateStatusById(status, id, date); |
| | | return 0; |
| | |
| | | LocalDateTime time = LocalDateTime.now(); |
| | | |
| | | Date date = Date.from(time.atZone(ZoneId.systemDefault()).toInstant()); |
| | | for(Long id : ids) |
| | | this.baseMapper.updateStatusById("录入完成",id, date); |
| | | 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()) { |
| | | // throw new RuntimeException("请勿新增重复数据"); |
| | | //如果有重复数据,则根据recordId进行数据修改 |
| | | Long userid = SecurityUtils.getUserId(); |
| | | if (!list.isEmpty()&&userid!=1) { |
| | | // throw new RuntimeException("请勿新增重复数据"); |
| | | //如果有重复数据,则根据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(); |
| | |
| | | return AjaxResult.error(); |
| | | } |
| | | } |
| | | else |
| | | return AjaxResult.error("档案号不存在!"); |
| | | else |
| | | return AjaxResult.error("不是管理员,不能新增记录!"); |
| | | } |
| | | |
| | | } |