k94314517
2025-04-03 4ba3510d270292d0448c6f766b8a9c5688d605a6
代码初始化
已修改3个文件
44 ■■■■■ 文件已修改
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/BoardServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java
@@ -96,12 +96,19 @@
            if(StringUtils.isBlank(parent.getHkId())){
                throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "对不起,父级组织信息尚未同步下发成功~");
            }
            if(Constants.equalsInteger(parent.getType(),Constants.ZERO)){
                //如果父级是相关方组织,下级不能建立内部组织
                if(Constants.equalsInteger(company.getType(),Constants.ONE)){
                    throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "对不起,相关方组织,下级不能建立内部组织~");
            if(Objects.nonNull(parent.getType())&&!Constants.equalsInteger(parent.getType(),-1)){
                if(Constants.equalsInteger(company.getType(),parent.getType())){
                    throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,组织信息错误");
                }
            }else if(Objects.isNull(parent.getType())){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,组织信息错误");
            }
//            if(Constants.equalsInteger(parent.getType(),Constants.ZERO)){
//                //如果父级是相关方组织,下级不能建立内部组织
//                if(Constants.equalsInteger(company.getType(),Constants.ONE)){
//                    throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "对不起,相关方组织,下级不能建立内部组织~");
//                }
//            }
            idPath = parent.getCompanyPath();
            company.setHkParentId(parent.getHkId());
            company.setCompanyPath(parent.getCompanyPath()+company.getId()+"/");
@@ -291,16 +298,18 @@
        if(model == null || Constants.equalsInteger(model.getIsdeleted(),Constants.ONE)){
            throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "对不起,组织信息不存在~");
        }
         if( Constants.equalsInteger(Constants.ONE,model.getType())&& Constants.equalsInteger(Constants.ZERO,company.getType())){
        //如果由内部组织切换成内部组织,排查下级组织是否有内部组织
             if(companyJoinMapper.selectCount(new QueryWrapper<Company>().lambda()
                     .eq(Company::getIsdeleted,Constants.ZERO )
                     .eq(Company::getType,Constants.ONE )
                     .ne(Company::getId,model.getId())
                     .likeRight(Company::getCompanyPath,model.getCompanyPath())) >0){
                 throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "对不起,下级部门存在内部组织,该部门不支持切换为相关方组织!~");
             }
        }
//         if( Constants.equalsInteger(Constants.ONE,model.getType())&& Constants.equalsInteger(Constants.ZERO,company.getType())){
//        //如果由内部组织切换成内部组织,排查下级组织是否有内部组织
//             if(companyJoinMapper.selectCount(new QueryWrapper<Company>().lambda()
//                     .eq(Company::getIsdeleted,Constants.ZERO )
//                     .eq(Company::getType,Constants.ONE )
//                     .ne(Company::getId,model.getId())
//                     .likeRight(Company::getCompanyPath,model.getCompanyPath())) >0){
//                 throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "对不起,下级部门存在内部组织,该部门不支持切换为相关方组织!~");
//             }
//        }
        company.setType(null);
        company.setEditDate(new Date());
        company.setEditor(user.getId());
        company.setHkStatus(Constants.ONE);
@@ -688,7 +697,8 @@
        queryWrapper.leftJoin(SystemUser.class,SystemUser::getId,Company::getEditor);
        queryWrapper.eq(Company::getIsdeleted,Constants.ZERO);
        if(Objects.nonNull(type) && ( Constants.equalsInteger(type,Constants.ONE) || Constants.equalsInteger(type,Constants.ZERO))){
            queryWrapper.eq(type!=null,Company::getType,type);
//            queryWrapper.eq(type!=null,Company::getType,type);
            queryWrapper.apply("( type = "+type+" or type  = -1  )");
        }else if(Objects.nonNull(type) &&  Constants.equalsInteger(type,Constants.TWO)){
            String companySpecialId = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.SPECIAL_COMPANY_ID).getCode();
            if(StringUtils.isNotBlank(companySpecialId)){
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java
@@ -1984,6 +1984,7 @@
        List<Visits> visitsList = visitsMapper.selectList(new QueryWrapper<Visits>().lambda()
                .eq(Visits::getStatus,Constants.VisitStatus.signin)
                .eq(Visits::getSendTimeOutNotice,Constants.ZERO)
                .eq(Visits::getIsdeleted,Constants.ZERO)
                .apply("   now() >=  DATE_ADD(ENDTIME,INTERVAL -"+times+" MINUTE)   ")
        );
        Integer visitTimeCount = 0;
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/BoardServiceImpl.java
@@ -1746,11 +1746,10 @@
    @Override
    public  VisitDataVO visitSecurityData(){
        //待访问、已登记、已离开
        VisitDataVO result = new VisitDataVO();
        result.setWaitVisitNum(visitsJoinMapper.selectCount(new MPJLambdaWrapper<Visits>()
                .eq(Visits::getIsdeleted,Constants.ZERO)
                .apply("to_days(create_date)=to_days(now())")
                .apply(" now() >  STARTTIME and now() < ENDTIME")
                .in(Visits::getStatus,Constants.VisitStatus.pass,Constants.VisitStatus.xfSuccess )));//待访问
        result.setRegisterVisitNum(visitsJoinMapper.selectCount(new MPJLambdaWrapper<Visits>()
                .eq(Visits::getIsdeleted,Constants.ZERO)