fei
2025-09-22 0fdd6b6113fe6e120ca5731fbab562f56eca8ae5
archiveManager/src/main/java/com/ruoyi/service/impl/ArchiveRecordsServiceImpl.java
@@ -16,6 +16,7 @@
import com.ruoyi.domain.Archiverecordstouser;
import com.ruoyi.domain.vo.AnalysisResult;
import com.ruoyi.domain.vo.ArchiveInfoVo;
import com.ruoyi.domain.vo.ArchiveRecordSmall;
import com.ruoyi.mapper.ArchiveRecordsMapper;
import com.ruoyi.mapper.ArchiverecordstouserMapper;
import com.ruoyi.service.IArchiveRecordsService;
@@ -44,10 +45,18 @@
    private LambdaQueryWrapper<ArchiveRecords> buildCondition(ArchiveRecords archiveRecords, Long userId){
        LambdaQueryWrapper<ArchiveRecords> lqw = new LambdaQueryWrapper<>();
        System.out.println(archiveRecords.getIds());
        lqw.like(!StringUtils.isEmpty(archiveRecords.getProjectName()), ArchiveRecords::getProjectName, archiveRecords.getProjectName())
                .like(!StringUtils.isEmpty(archiveRecords.getFilingNumber()), ArchiveRecords::getFilingNumber, archiveRecords.getFilingNumber())
                .like(!StringUtils.isEmpty(archiveRecords.getArchiveRoomNumber()), ArchiveRecords::getArchiveRoomNumber, archiveRecords.getArchiveRoomNumber())
                        .like(!StringUtils.isEmpty(archiveRecords.getRecordId()), ArchiveRecords::getRecordId, archiveRecords.getRecordId());
                        .like(!StringUtils.isEmpty(archiveRecords.getRecordId()), ArchiveRecords::getRecordId, archiveRecords.getRecordId())
                .eq(!StringUtils.isEmpty(archiveRecords.getRecordStatus()), ArchiveRecords::getRecordStatus, archiveRecords.getRecordStatus())
             ;
        if(archiveRecords.getIds()!=null)
                lqw.in(ArchiveRecords::getId,new ArrayList<>(Arrays.asList(archiveRecords.getIds())));
        //                .like(!StringUtils.isEmpty(zfProperty.getLocation()), ZfProperty::getLocation, zfProperty.getLocation())
//                .like(!StringUtils.isEmpty(zfProperty.getHolder()), ZfProperty::getHolder, zfProperty.getHolder())
//                .like(!StringUtils.isEmpty(zfProperty.getAddress()), ZfProperty::getAddress, zfProperty.getAddress())
@@ -170,11 +179,21 @@
        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
@@ -257,6 +276,28 @@
        return this.baseMapper.statisticAyasis();
    }
    @Override
    public int updateArchiveById(Long id) {
        this.baseMapper.updateStatusById(id);
        return 0;
    }
    @Override
    public int updateStatusByIds(Long[] ids) {
        for(Long id : ids)
            this.baseMapper.updateStatusById(id);
        return 0;
    }
    @Override
    public List<ArchiveRecordSmall> findByIds(ArchiveRecords archiveRecords) {
        LambdaQueryWrapper<ArchiveRecords> lqw = new LambdaQueryWrapper<>();
        if(archiveRecords.getIds()!=null)
            lqw.in(ArchiveRecords::getId,new ArrayList<>(Arrays.asList(archiveRecords.getIds())));
        return this.baseMapper.selectByIds(lqw);
    }
    public AjaxResult mySave(ArchiveRecords archiveRecords) {