| | |
| | | |
| | | Date date = Date.from(time.atZone(ZoneId.systemDefault()).toInstant()); |
| | | archiveRecords.setCreateTime(date); |
| | | |
| | | |
| | | System.out.println(archiveRecords.getRecordId()); |
| | | //根据档号查询,是否已经有档号,有的话,就不让插入 |
| | | LambdaQueryWrapper<ArchiveRecords> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | lambdaQueryWrapper.eq(!StringUtils.isEmpty(archiveRecords.getRecordId()), ArchiveRecords::getRecordId, |
| | | archiveRecords.getRecordId()); |
| | | List<ArchiveRecords> lis = list(lambdaQueryWrapper); |
| | | if(!lis.isEmpty()) |
| | | { |
| | | return 0; |
| | | } |
| | | archiveRecords.setRecordStatus("未录入"); |
| | | // archiveRecords |
| | | boolean res = this.save(archiveRecords); |
| | | |
| | | //0表示失败,1表示成功 |
| | | if(res) |
| | | return 1; |
| | | else |
| | |
| | | |
| | | for (ArchiveRecords archiveRecords : dataList) { |
| | | // physcialService.mySave(physcial); |
| | | archiveRecords.setRecordStatus("未录入"); |
| | | LocalDateTime time = LocalDateTime.now(); |
| | | |
| | | Date date = Date.from(time.atZone(ZoneId.systemDefault()).toInstant()); |
| | | archiveRecords.setCreateTime(date); |
| | | this.mySave(archiveRecords); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public int updateArchiveById(Long id) { |
| | | this.baseMapper.updateStatusById(id); |
| | | public int updateArchiveById(String status, Long id) { |
| | | this.baseMapper.updateStatusById(status, id); |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public int updateStatusByIds(Long[] ids) { |
| | | for(Long id : ids) |
| | | this.baseMapper.updateStatusById("录入完成",id); |
| | | return 0; |
| | | } |
| | | |
| | |
| | | if (list.size() > 0) { |
| | | // throw new RuntimeException("请勿新增重复数据"); |
| | | //如果有重复数据,则根据recordId进行数据修改 |
| | | this.baseMapper.update(archiveRecords, lqw); |
| | | return AjaxResult.success(); |
| | | // if() |
| | | |
| | | this.baseMapper.update(archiveRecords, lqw); |
| | | return AjaxResult.success(); |
| | | |
| | | |
| | | } |
| | | else { |
| | | Long userid = SecurityUtils.getUserId(); |
| | | if(userid==1) { |
| | | if (save(archiveRecords)) { |
| | | return AjaxResult.success(); |
| | | } else { |
| | | return AjaxResult.error(); |
| | | } |
| | | } |
| | | else |
| | | return AjaxResult.error("档案号不存在!"); |
| | | } |
| | | |
| | | } |
| | | } |