fei
2025-09-29 ebeecf61232967a9c21ca4aa63ccec8e269b8c0e
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,35 @@
    private LambdaQueryWrapper<ArchiveRecords> buildCondition(ArchiveRecords archiveRecords, Long userId){
        LambdaQueryWrapper<ArchiveRecords> lqw = new LambdaQueryWrapper<>();
        lqw.like(!StringUtils.isEmpty(archiveRecords.getProjectName()), ArchiveRecords::getProjectName, archiveRecords.getProjectName())
        System.out.println(archiveRecords.getIds());
        lqw.like(!StringUtils.isEmpty(archiveRecords.getRecordId()), ArchiveRecords::getRecordId, archiveRecords.getRecordId())
                .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.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.getFilingNumber()), ArchiveRecords::getFilingNumber, archiveRecords.getFilingNumber())
                .like(!StringUtils.isEmpty(archiveRecords.getConstructionUnit()), ArchiveRecords::getConstructionUnit, archiveRecords.getConstructionUnit())
                .like(!StringUtils.isEmpty(archiveRecords.getConstructionAddress()), ArchiveRecords::getConstructionAddress, archiveRecords.getConstructionAddress())
                .like(!StringUtils.isEmpty(archiveRecords.getProjectName()), ArchiveRecords::getProjectName, archiveRecords.getProjectName())
                .like(!StringUtils.isEmpty(archiveRecords.getProjectNumber()), ArchiveRecords::getProjectNumber, archiveRecords.getProjectNumber())
                .like(!StringUtils.isEmpty(archiveRecords.getScanningCompany()), ArchiveRecords::getScanningCompany, archiveRecords.getScanningCompany())
                .like(!StringUtils.isEmpty(archiveRecords.getArchiveRoomNumber()), ArchiveRecords::getArchiveRoomNumber, archiveRecords.getArchiveRoomNumber())
                        .like(!StringUtils.isEmpty(archiveRecords.getRecordId()), ArchiveRecords::getRecordId, archiveRecords.getRecordId());
                .like(!StringUtils.isEmpty(archiveRecords.getMicrofilmNumber()), ArchiveRecords::getMicrofilmNumber, archiveRecords.getMicrofilmNumber())
                .like(!StringUtils.isEmpty(archiveRecords.getHistoricalReferenceNumber()), ArchiveRecords::getHistoricalReferenceNumber, archiveRecords.getHistoricalReferenceNumber())
                .eq(!StringUtils.isEmpty(archiveRecords.getRecordStatus()), ArchiveRecords::getRecordStatus, archiveRecords.getRecordStatus())
                .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())));
        //                .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 +196,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 +293,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) {