无关风月
2024-08-28 1c4311135628b53daa336821ff452292a9d063e9
ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/SlAuditServiceImpl.java
@@ -42,6 +42,8 @@
    @Resource
    private SlVolumeProductionRkglMapper slVolumeProductionRkglMapper;
    @Resource
    private SlVolumeProductionRkMapper slVolumeProductionRkMapper;
    @Resource
    private SlVolumeProductionCkglMapper slVolumeProductionCKglMapper;
@@ -71,6 +73,12 @@
        Page<SlAudit> page = new Page<>(auditRecordListQuery.getPageCurr(), auditRecordListQuery.getPageSize());
        LambdaQueryWrapper< SlAudit> wrapper= Wrappers.lambdaQuery();
        wrapper.eq(SlAudit::getDelFlag,0);
        if (auditRecordListQuery.getState()!=null){
            wrapper.eq(SlAudit::getState,auditRecordListQuery.getState());
        }
        if (goodsSkuIdList.size()>0){
            wrapper.in(SlAudit::getSysId,goodsSkuIdList);
        }else{
@@ -114,7 +122,6 @@
                            .like("shenh_id", data.getUserId())).stream().map(SlAuditRecord::getAuditId).collect(Collectors.toList());
                    wrapper.in(SlAudit::getId,auditIds);
                }
                break;
        }
        wrapper.eq(SlAudit::getType,auditRecordListQuery.getType());
@@ -139,10 +146,10 @@
        }
        return slEquipmentVOPageDTO;
    }
    @Resource
    private SlStoreManagementMapper slStoreManagementMapper;
    @Override
    public void addslAudit(SlAuditDTO slAuditDTO) {
        LambdaQueryWrapper< SlAudit> wrapper= Wrappers.lambdaQuery();
        wrapper.eq(SlAudit::getRkId,slAuditDTO.getRkId());
        wrapper.eq(SlAudit::getType,slAuditDTO.getType());
@@ -163,101 +170,437 @@
        slAudit.setState(1);
        slAudit.setCreateTime(new Date());
        slAudit.setRkId(slAuditDTO.getRkId());
        // 根据发起人
        if (slAudit.getType()==1){
            SlVolumeProductionRkgl slVolumeProductionRkgl = slVolumeProductionRkglMapper.selectById(slAuditDTO.getRkId());
            SlStoreManagement slStoreManagement = slStoreManagementMapper.selectById(slVolumeProductionRkgl.getManagementId());
            String directorId = slStoreManagement.getDirectorId();
            String competentId = slStoreManagement.getCompetentId();
            String administratorId = slStoreManagement.getAdministratorId();
            Long userid = SecurityUtils.getUserId();
            List<String> list1 = Arrays.asList(administratorId.split(","));
            List<String> list2 = Arrays.asList(competentId.split(","));
            List<String> list3 = Arrays.asList(directorId.split(","));
            slAudit.setSysId(slVolumeProductionRkgl.getSysId());
            slAudit.setManagementId(slVolumeProductionRkgl.getManagementId());
            SlStoreManagement byId = slStoreManagementService.getById(slVolumeProductionRkgl.getManagementId());
            slAudit.setShenhId(byId.getAdministratorId());
            this.save(slAudit);
            SlAuditRecord slAuditRecord=new SlAuditRecord();
            slAuditRecord.setAuditId(slAudit.getId());
            slAuditRecord.setShenhId(byId.getAdministratorId());
            slAuditRecord.setType(1);
            slAuditRecord.setState(1);
            slAuditRecord.setCreateTime(new Date());
            slAuditRecordMapper.insert(slAuditRecord);
            if (list3.contains(userid.toString())){
                slVolumeProductionRkgl.setAuditStatus(4);
                slVolumeProductionRkgl.setPresentState(3);
                slVolumeProductionRkglMapper.updateById(slVolumeProductionRkgl);
                slAudit.setState(4);
                this.save(slAudit);
                // 主任发起 主管和管理员默认审核通过
                SlAuditRecord slAuditRecord4=new SlAuditRecord();
                slAuditRecord4.setAuditId(slAudit.getId());
                slAuditRecord4.setShenhId(byId.getDirectorId());
                slAuditRecord4.setType(3);
                slAuditRecord4.setState(2);
                slAuditRecord4.setShenhTime(new Date());
                slAuditRecord4.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord4);
            SlAuditRecord slAuditRecord1=new SlAuditRecord();
            slAuditRecord1.setAuditId(slAudit.getId());
            slAuditRecord1.setShenhId(byId.getCompetentId());
            slAuditRecord1.setType(2);
            slAuditRecord1.setState(1);
            slAuditRecord1.setCreateTime(new Date());
            slAuditRecordMapper.insert(slAuditRecord1);
                SlAuditRecord slAuditRecord3=new SlAuditRecord();
                slAuditRecord3.setAuditId(slAudit.getId());
                slAuditRecord3.setShenhId(byId.getCompetentId());
                slAuditRecord3.setType(2);
                slAuditRecord3.setState(2);
                slAuditRecord3.setShenhTime(new Date());
                slAuditRecord3.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord3);
            SlAuditRecord slAuditRecord2=new SlAuditRecord();
            slAuditRecord2.setAuditId(slAudit.getId());
            slAuditRecord2.setShenhId(byId.getDirectorId());
            slAuditRecord2.setType(3);
            slAuditRecord2.setState(1);
            slAuditRecord2.setCreateTime(new Date());
            slAuditRecordMapper.insert(slAuditRecord2);
                SlAuditRecord slAuditRecord2=new SlAuditRecord();
                slAuditRecord2.setAuditId(slAudit.getId());
                slAuditRecord2.setShenhId(byId.getAdministratorId());
                slAuditRecord2.setType(1);
                slAuditRecord2.setState(2);
                slAuditRecord2.setShenhTime(new Date());
                slAuditRecord2.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord2);
            }else if (list2.contains(userid.toString())){
                slAudit.setState(3);
                this.save(slAudit);
                slVolumeProductionRkgl.setAuditStatus(3);
                slVolumeProductionRkgl.setPresentState(1);
                slVolumeProductionRkglMapper.updateById(slVolumeProductionRkgl);
                // 如果是主管
                SlAuditRecord slAuditRecord3=new SlAuditRecord();
                slAuditRecord3.setAuditId(slAudit.getId());
                slAuditRecord3.setShenhId(byId.getCompetentId());
                slAuditRecord3.setType(2);
                slAuditRecord3.setState(2);
                slAuditRecord3.setShenhTime(new Date());
                slAuditRecord3.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord3);
                SlAuditRecord slAuditRecord2=new SlAuditRecord();
                slAuditRecord2.setAuditId(slAudit.getId());
                slAuditRecord2.setShenhId(byId.getAdministratorId());
                slAuditRecord2.setType(1);
                slAuditRecord2.setState(2);
                slAuditRecord2.setShenhTime(new Date());
                slAuditRecord2.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord2);
                SlAuditRecord slAuditRecord4=new SlAuditRecord();
                slAuditRecord4.setAuditId(slAudit.getId());
                slAuditRecord4.setShenhId(byId.getDirectorId());
                slAuditRecord4.setType(3);
                slAuditRecord4.setState(1);
                slAuditRecord4.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord4);
            }else if (list1.contains(userid.toString())){
                // 如果是管理员
                slAudit.setState(2);
                this.save(slAudit);
                slVolumeProductionRkgl.setAuditStatus(2);
                slVolumeProductionRkgl.setPresentState(1);
                slVolumeProductionRkglMapper.updateById(slVolumeProductionRkgl);
                // 如果是主管
                SlAuditRecord slAuditRecord3=new SlAuditRecord();
                slAuditRecord3.setAuditId(slAudit.getId());
                slAuditRecord3.setShenhId(byId.getCompetentId());
                slAuditRecord3.setType(2);
                slAuditRecord3.setState(1);
                slAuditRecord3.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord3);
                SlAuditRecord slAuditRecord2=new SlAuditRecord();
                slAuditRecord2.setAuditId(slAudit.getId());
                slAuditRecord2.setShenhId(byId.getAdministratorId());
                slAuditRecord2.setType(1);
                slAuditRecord2.setState(2);
                slAuditRecord2.setShenhTime(new Date());
                slAuditRecord2.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord2);
                SlAuditRecord slAuditRecord4=new SlAuditRecord();
                slAuditRecord4.setAuditId(slAudit.getId());
                slAuditRecord4.setShenhId(byId.getDirectorId());
                slAuditRecord4.setType(3);
                slAuditRecord4.setState(1);
                slAuditRecord4.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord4);
            }
            if (!list3.contains(userid.toString()) && !list2.contains(userid.toString()) && !list1.contains(userid.toString())){
                this.save(slAudit);
                SlAuditRecord slAuditRecord=new SlAuditRecord();
                slAuditRecord.setAuditId(slAudit.getId());
                slAuditRecord.setShenhId(byId.getAdministratorId());
                slAuditRecord.setType(1);
                slAuditRecord.setState(1);
                slAuditRecord.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord);
                SlAuditRecord slAuditRecord3=new SlAuditRecord();
                slAuditRecord3.setAuditId(slAudit.getId());
                slAuditRecord3.setShenhId(byId.getCompetentId());
                slAuditRecord3.setType(2);
                slAuditRecord3.setState(1);
                slAuditRecord3.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord3);
                SlAuditRecord slAuditRecord4=new SlAuditRecord();
                slAuditRecord4.setAuditId(slAudit.getId());
                slAuditRecord4.setShenhId(byId.getDirectorId());
                slAuditRecord4.setType(3);
                slAuditRecord4.setState(1);
                slAuditRecord4.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord4);
            }
        }
        if (slAudit.getType()==2){
        if (slAudit.getType()==2) {
            SlVolumeProductionCkgl slVolumeProductionCkgl = slVolumeProductionCKglMapper.selectById(slAuditDTO.getRkId());
            SlStoreManagement slStoreManagement = slStoreManagementMapper.selectById(slVolumeProductionCkgl.getManagementId());
            String directorId = slStoreManagement.getDirectorId();
            String competentId = slStoreManagement.getCompetentId();
            String administratorId = slStoreManagement.getAdministratorId();
            Long userid = SecurityUtils.getUserId();
            List<String> list1 = Arrays.asList(administratorId.split(","));
            List<String> list2 = Arrays.asList(competentId.split(","));
            List<String> list3 = Arrays.asList(directorId.split(","));
            slAudit.setSysId(slVolumeProductionCkgl.getSysId());
            slAudit.setManagementId(slVolumeProductionCkgl.getManagementId());
            SlStoreManagement byId = slStoreManagementService.getById(slVolumeProductionCkgl.getManagementId());
            slAudit.setShenhId(byId.getAdministratorId());
            this.save(slAudit);
            SlAuditRecord slAuditRecord=new SlAuditRecord();
            slAuditRecord.setAuditId(slAudit.getId());
            slAuditRecord.setShenhId(byId.getAdministratorId());
            slAuditRecord.setType(1);
            slAuditRecord.setState(1);
            slAuditRecord.setCreateTime(new Date());
            slAuditRecordMapper.insert(slAuditRecord);
            if (list3.contains(userid.toString())){
                slAudit.setState(4);
                this.save(slAudit);
                slVolumeProductionCkgl.setAuditStatus(4);
                slVolumeProductionCkgl.setPresentState(3);
                slVolumeProductionCKglMapper.updateById(slVolumeProductionCkgl);
                // 主任发起 主管和管理员默认审核通过
                SlAuditRecord slAuditRecord4=new SlAuditRecord();
                slAuditRecord4.setAuditId(slAudit.getId());
                slAuditRecord4.setShenhId(byId.getDirectorId());
                slAuditRecord4.setType(3);
                slAuditRecord4.setState(2);
                slAuditRecord4.setShenhTime(new Date());
                slAuditRecord4.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord4);
            SlAuditRecord slAuditRecord1=new SlAuditRecord();
            slAuditRecord1.setAuditId(slAudit.getId());
            slAuditRecord1.setShenhId(byId.getCompetentId());
            slAuditRecord1.setType(2);
            slAuditRecord1.setState(1);
            slAuditRecord1.setCreateTime(new Date());
            slAuditRecordMapper.insert(slAuditRecord1);
                SlAuditRecord slAuditRecord3=new SlAuditRecord();
                slAuditRecord3.setAuditId(slAudit.getId());
                slAuditRecord3.setShenhId(byId.getCompetentId());
                slAuditRecord3.setType(2);
                slAuditRecord3.setState(2);
                slAuditRecord3.setShenhTime(new Date());
                slAuditRecord3.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord3);
            SlAuditRecord slAuditRecord2=new SlAuditRecord();
            slAuditRecord2.setAuditId(slAudit.getId());
            slAuditRecord2.setShenhId(byId.getDirectorId());
            slAuditRecord2.setType(3);
            slAuditRecord2.setState(1);
            slAuditRecord2.setCreateTime(new Date());
            slAuditRecordMapper.insert(slAuditRecord2);
                SlAuditRecord slAuditRecord2=new SlAuditRecord();
                slAuditRecord2.setAuditId(slAudit.getId());
                slAuditRecord2.setShenhId(byId.getAdministratorId());
                slAuditRecord2.setType(1);
                slAuditRecord2.setState(2);
                slAuditRecord2.setShenhTime(new Date());
                slAuditRecord2.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord2);
            }else if (list2.contains(userid.toString())){
                slAudit.setState(3);
                this.save(slAudit);
                slVolumeProductionCkgl.setAuditStatus(3);
                slVolumeProductionCkgl.setPresentState(1);
                slVolumeProductionCKglMapper.updateById(slVolumeProductionCkgl);
                // 如果是主管
                SlAuditRecord slAuditRecord3=new SlAuditRecord();
                slAuditRecord3.setAuditId(slAudit.getId());
                slAuditRecord3.setShenhId(byId.getCompetentId());
                slAuditRecord3.setType(2);
                slAuditRecord3.setState(2);
                slAuditRecord3.setShenhTime(new Date());
                slAuditRecord3.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord3);
                SlAuditRecord slAuditRecord2=new SlAuditRecord();
                slAuditRecord2.setAuditId(slAudit.getId());
                slAuditRecord2.setShenhId(byId.getAdministratorId());
                slAuditRecord2.setType(1);
                slAuditRecord2.setState(2);
                slAuditRecord2.setShenhTime(new Date());
                slAuditRecord2.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord2);
                SlAuditRecord slAuditRecord4=new SlAuditRecord();
                slAuditRecord4.setAuditId(slAudit.getId());
                slAuditRecord4.setShenhId(byId.getDirectorId());
                slAuditRecord4.setType(3);
                slAuditRecord4.setState(1);
                slAuditRecord4.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord4);
            }else if (list1.contains(userid.toString())){
                // 如果是管理员
                slAudit.setState(2);
                this.save(slAudit);
                slVolumeProductionCkgl.setAuditStatus(2);
                slVolumeProductionCkgl.setPresentState(1);
                slVolumeProductionCKglMapper.updateById(slVolumeProductionCkgl);
                // 如果是主管
                SlAuditRecord slAuditRecord3=new SlAuditRecord();
                slAuditRecord3.setAuditId(slAudit.getId());
                slAuditRecord3.setShenhId(byId.getCompetentId());
                slAuditRecord3.setType(2);
                slAuditRecord3.setState(1);
                slAuditRecord3.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord3);
                SlAuditRecord slAuditRecord2=new SlAuditRecord();
                slAuditRecord2.setAuditId(slAudit.getId());
                slAuditRecord2.setShenhId(byId.getAdministratorId());
                slAuditRecord2.setType(1);
                slAuditRecord2.setState(2);
                slAuditRecord2.setShenhTime(new Date());
                slAuditRecord2.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord2);
                SlAuditRecord slAuditRecord4=new SlAuditRecord();
                slAuditRecord4.setAuditId(slAudit.getId());
                slAuditRecord4.setShenhId(byId.getDirectorId());
                slAuditRecord4.setType(3);
                slAuditRecord4.setState(1);
                slAuditRecord4.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord4);
            }
            if (!list3.contains(userid.toString()) && !list2.contains(userid.toString()) && !list1.contains(userid.toString())){
                this.save(slAudit);
                SlAuditRecord slAuditRecord=new SlAuditRecord();
                slAuditRecord.setAuditId(slAudit.getId());
                slAuditRecord.setShenhId(byId.getAdministratorId());
                slAuditRecord.setType(1);
                slAuditRecord.setState(1);
                slAuditRecord.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord);
                SlAuditRecord slAuditRecord3=new SlAuditRecord();
                slAuditRecord3.setAuditId(slAudit.getId());
                slAuditRecord3.setShenhId(byId.getCompetentId());
                slAuditRecord3.setType(2);
                slAuditRecord3.setState(1);
                slAuditRecord3.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord3);
                SlAuditRecord slAuditRecord4=new SlAuditRecord();
                slAuditRecord4.setAuditId(slAudit.getId());
                slAuditRecord4.setShenhId(byId.getDirectorId());
                slAuditRecord4.setType(3);
                slAuditRecord4.setState(1);
                slAuditRecord4.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord4);
            }
        }
        if (slAudit.getType()==3){
        if(slAuditDTO.getType() == 3){
            SlVolumeProductionZygl slVolumeProductionZygl = slVolumeProductionZyglMapper.selectById(slAuditDTO.getRkId());
            slAudit.setSysId(slVolumeProductionZygl.getSysId());
            slAudit.setManagementId(slVolumeProductionZygl.getManagementId());
            slAudit.setZymanagementId(slVolumeProductionZygl.getBmanagementId());
            SlStoreManagement slStoreManagement = slStoreManagementMapper.selectById(slVolumeProductionZygl.getManagementId());
            String directorId = slStoreManagement.getDirectorId();
            String competentId = slStoreManagement.getCompetentId();
            String administratorId = slStoreManagement.getAdministratorId();
            Long userid = SecurityUtils.getUserId();
            List<String> list1 = Arrays.asList(administratorId.split(","));
            List<String> list2 = Arrays.asList(competentId.split(","));
            List<String> list3 = Arrays.asList(directorId.split(","));
            slAudit.setSysId(slVolumeProductionZygl.getSysId());
            slAudit.setManagementId(slVolumeProductionZygl.getManagementId());
            slAudit.setZymanagementId(slVolumeProductionZygl.getBmanagementId());
            SlStoreManagement byId = slStoreManagementService.getById(slVolumeProductionZygl.getManagementId());
            slAudit.setShenhId(byId.getAdministratorId());
            this.save(slAudit);
            SlAuditRecord slAuditRecord=new SlAuditRecord();
            slAuditRecord.setAuditId(slAudit.getId());
            slAuditRecord.setShenhId(byId.getAdministratorId());
            slAuditRecord.setType(1);
            slAuditRecord.setState(1);
            slAuditRecord.setCreateTime(new Date());
            slAuditRecordMapper.insert(slAuditRecord);
            if (list3.contains(userid.toString())){
                slAudit.setState(4);
                this.save(slAudit);
                slVolumeProductionZygl.setAuditStatus(4);
                slVolumeProductionZygl.setPresentState(3);
                slVolumeProductionZyglMapper.updateById(slVolumeProductionZygl);
                // 主任发起 主管和管理员默认审核通过
                SlAuditRecord slAuditRecord4=new SlAuditRecord();
                slAuditRecord4.setAuditId(slAudit.getId());
                slAuditRecord4.setShenhId(byId.getDirectorId());
                slAuditRecord4.setType(3);
                slAuditRecord4.setState(2);
                slAuditRecord4.setShenhTime(new Date());
                slAuditRecord4.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord4);
            SlAuditRecord slAuditRecord1=new SlAuditRecord();
            slAuditRecord1.setAuditId(slAudit.getId());
            slAuditRecord1.setShenhId(byId.getCompetentId());
            slAuditRecord1.setType(2);
            slAuditRecord1.setState(1);
            slAuditRecord1.setCreateTime(new Date());
            slAuditRecordMapper.insert(slAuditRecord1);
                SlAuditRecord slAuditRecord3=new SlAuditRecord();
                slAuditRecord3.setAuditId(slAudit.getId());
                slAuditRecord3.setShenhId(byId.getCompetentId());
                slAuditRecord3.setType(2);
                slAuditRecord3.setState(2);
                slAuditRecord3.setShenhTime(new Date());
                slAuditRecord3.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord3);
            SlAuditRecord slAuditRecord2=new SlAuditRecord();
            slAuditRecord2.setAuditId(slAudit.getId());
            slAuditRecord2.setShenhId(byId.getDirectorId());
            slAuditRecord2.setType(3);
            slAuditRecord2.setState(1);
            slAuditRecord2.setCreateTime(new Date());
            slAuditRecordMapper.insert(slAuditRecord2);
                SlAuditRecord slAuditRecord2=new SlAuditRecord();
                slAuditRecord2.setAuditId(slAudit.getId());
                slAuditRecord2.setShenhId(byId.getAdministratorId());
                slAuditRecord2.setType(1);
                slAuditRecord2.setState(2);
                slAuditRecord2.setShenhTime(new Date());
                slAuditRecord2.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord2);
            }else if (list2.contains(userid.toString())){
                slAudit.setState(3);
                this.save(slAudit);
                slVolumeProductionZygl.setAuditStatus(3);
                slVolumeProductionZygl.setPresentState(1);
                slVolumeProductionZyglMapper.updateById(slVolumeProductionZygl);
                // 如果是主管
                SlAuditRecord slAuditRecord3=new SlAuditRecord();
                slAuditRecord3.setAuditId(slAudit.getId());
                slAuditRecord3.setShenhId(byId.getCompetentId());
                slAuditRecord3.setType(2);
                slAuditRecord3.setState(2);
                slAuditRecord3.setShenhTime(new Date());
                slAuditRecord3.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord3);
                SlAuditRecord slAuditRecord2=new SlAuditRecord();
                slAuditRecord2.setAuditId(slAudit.getId());
                slAuditRecord2.setShenhId(byId.getAdministratorId());
                slAuditRecord2.setType(1);
                slAuditRecord2.setState(2);
                slAuditRecord2.setShenhTime(new Date());
                slAuditRecord2.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord2);
                SlAuditRecord slAuditRecord4=new SlAuditRecord();
                slAuditRecord4.setAuditId(slAudit.getId());
                slAuditRecord4.setShenhId(byId.getDirectorId());
                slAuditRecord4.setType(3);
                slAuditRecord4.setState(1);
                slAuditRecord4.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord4);
            }else if (list1.contains(userid.toString())){
                // 如果是管理员
                slAudit.setState(2);
                this.save(slAudit);
                slVolumeProductionZygl.setAuditStatus(2);
                slVolumeProductionZygl.setPresentState(1);
                slVolumeProductionZyglMapper.updateById(slVolumeProductionZygl);
                // 如果是主管
                SlAuditRecord slAuditRecord3=new SlAuditRecord();
                slAuditRecord3.setAuditId(slAudit.getId());
                slAuditRecord3.setShenhId(byId.getCompetentId());
                slAuditRecord3.setType(2);
                slAuditRecord3.setState(1);
                slAuditRecord3.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord3);
                SlAuditRecord slAuditRecord2=new SlAuditRecord();
                slAuditRecord2.setAuditId(slAudit.getId());
                slAuditRecord2.setShenhId(byId.getAdministratorId());
                slAuditRecord2.setType(1);
                slAuditRecord2.setState(2);
                slAuditRecord2.setShenhTime(new Date());
                slAuditRecord2.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord2);
                SlAuditRecord slAuditRecord4=new SlAuditRecord();
                slAuditRecord4.setAuditId(slAudit.getId());
                slAuditRecord4.setShenhId(byId.getDirectorId());
                slAuditRecord4.setType(3);
                slAuditRecord4.setState(1);
                slAuditRecord4.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord4);
            }
            if (!list3.contains(userid.toString()) && !list2.contains(userid.toString()) && !list1.contains(userid.toString())){
                this.save(slAudit);
                SlAuditRecord slAuditRecord=new SlAuditRecord();
                slAuditRecord.setAuditId(slAudit.getId());
                slAuditRecord.setShenhId(byId.getAdministratorId());
                slAuditRecord.setType(1);
                slAuditRecord.setState(1);
                slAuditRecord.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord);
                SlAuditRecord slAuditRecord3=new SlAuditRecord();
                slAuditRecord3.setAuditId(slAudit.getId());
                slAuditRecord3.setShenhId(byId.getCompetentId());
                slAuditRecord3.setType(2);
                slAuditRecord3.setState(1);
                slAuditRecord3.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord3);
                SlAuditRecord slAuditRecord4=new SlAuditRecord();
                slAuditRecord4.setAuditId(slAudit.getId());
                slAuditRecord4.setShenhId(byId.getDirectorId());
                slAuditRecord4.setType(3);
                slAuditRecord4.setState(1);
                slAuditRecord4.setCreateTime(new Date());
                slAuditRecordMapper.insert(slAuditRecord4);
            }
        }
    }
}