Bladeren bron

邀请规则增加回避单位名称、回避条线名称

tags/24080901
WendyYang 1 jaar geleden
bovenliggende
commit
b451cd21a8
4 gewijzigde bestanden met toevoegingen van 116 en 3 verwijderingen
  1. +11
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java
  2. +24
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/organization/service/IDingOrganizationService.java
  3. +60
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/organization/service/IGovBusinessStripService.java
  4. +21
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/organization/service/impl/DingOrganizationServiceImpl.java

+ 11
- 1
pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java Bestand weergeven

@@ -37,6 +37,8 @@ import com.ningdatech.pmapi.meeting.service.*;
import com.ningdatech.pmapi.meeting.task.ExpertInviteTask;
import com.ningdatech.pmapi.meta.helper.DictionaryCache;
import com.ningdatech.pmapi.meta.helper.TagCache;
import com.ningdatech.pmapi.organization.service.IDingOrganizationService;
import com.ningdatech.pmapi.organization.service.IGovBusinessStripService;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO;
@@ -85,13 +87,15 @@ public class MeetingManage {
private final IProjectService projectService;
private final IMeetingInnerProjectService meetingInnerProjectService;
private final IMeetingOuterProjectService meetingOuterProjectService;
private final IGovBusinessStripService businessStripService;
private final IDingOrganizationService dingOrganizationService;

private final ExpertInviteHelper expertInviteHelper;
private static final String INVITED_RULE_CREATE = "INVITED_RULE_CREATE:";

private static final String MEETING_CREATE_KEY = "MEETING_CREATE:";

private String getDictName(String dictType){
private String getDictName(String dictType) {
return Optional.ofNullable(dictionaryCache.getByCode(dictType))
.flatMap(w -> Optional.of(w.getName()))
.orElse(StrPool.EMPTY);
@@ -507,6 +511,12 @@ public class MeetingManage {
AvoidInfoVO vo = new AvoidInfoVO();
vo.setAvoidOrgIds(avoidInfo.getAvoidOrgIdList());
vo.setAvoidUnitIds(avoidInfo.getAvoidUnitIdList());
if (CollUtil.isNotEmpty(vo.getAvoidOrgIds())) {
vo.setAvoidOrgs(businessStripService.listNameByCodes(avoidInfo.getAvoidOrgIdList()));
}
if (CollUtil.isNotEmpty(vo.getAvoidUnits())) {
vo.setAvoidUnits(dingOrganizationService.listNameByCodes(avoidInfo.getAvoidUnitIdList()));
}
if (CollUtil.isNotEmpty(avoidInfo.getExpertIds())) {
vo.setExperts(new ArrayList<>(meetingManageHelper.getExpertBasicInfo(avoidInfo.getExpertIds()).values()));
}


+ 24
- 0
pmapi/src/main/java/com/ningdatech/pmapi/organization/service/IDingOrganizationService.java Bestand weergeven

@@ -3,6 +3,9 @@ package com.ningdatech.pmapi.organization.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ningdatech.pmapi.organization.model.entity.DingOrganization;

import java.util.Collection;
import java.util.List;

/**
* <p>
* 服务类
@@ -15,6 +18,7 @@ public interface IDingOrganizationService extends IService<DingOrganization> {

/**
* 根据组织code查询组织信息
*
* @param orgCode
* @return
*/
@@ -22,8 +26,28 @@ public interface IDingOrganizationService extends IService<DingOrganization> {

/**
* 根据组织code查询父组织信息
*
* @param orgCode
* @return
*/
DingOrganization getParentOrganization(String orgCode);

/**
* 批量查询单位信息
*
* @param codes 单位编码
* @return 单位信息
* @author WendyYang
**/
List<DingOrganization> listByCodes(Collection<String> codes);

/**
* 批量查询单位名称
*
* @param codes 单位编码
* @return 单位信息
* @author WendyYang
**/
List<String> listNameByCodes(Collection<String> codes);

}

+ 60
- 2
pmapi/src/main/java/com/ningdatech/pmapi/organization/service/IGovBusinessStripService.java Bestand weergeven

@@ -1,11 +1,20 @@
package com.ningdatech.pmapi.organization.service;

import com.ningdatech.pmapi.organization.entity.GovBusinessStrip;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.basic.util.StrPool;
import com.ningdatech.pmapi.organization.entity.GovBusinessStrip;

import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Optional;

/**
* <p>
* 服务类
* 服务类
* </p>
*
* @author Liuxinxin
@@ -13,4 +22,53 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface IGovBusinessStripService extends IService<GovBusinessStrip> {

/**
* 根据code查询名称
*
* @param codes 条线编码
* @return 条线名称
* @author WendyYang
**/
default List<String> listNameByCodes(Collection<String> codes) {
return CollUtils.fieldList(listByCodes(codes), GovBusinessStrip::getBusinessStripName);
}

/**
* 根据code查询条线
*
* @param codes 条线编码
* @return 条线名称
* @author WendyYang
**/
default List<GovBusinessStrip> listByCodes(Collection<String> codes) {
LambdaQueryWrapper<GovBusinessStrip> query = Wrappers.lambdaQuery(GovBusinessStrip.class)
.in(GovBusinessStrip::getBusinessStripCode, codes);
return list(query);
}

/**
* 根据code查询名称
*
* @param code 条线编码
* @return 条线名称
* @author WendyYang
**/
default String getNameByCode(String code) {
return Optional.ofNullable(getByCode(code))
.flatMap(w -> Optional.of(w.getBusinessStripName()))
.orElse(StrPool.EMPTY);
}

/**
* 根据code查询名称
*
* @param code 条线编码
* @return 条线名称
* @author WendyYang
**/
default GovBusinessStrip getByCode(String code) {
List<GovBusinessStrip> strips = listByCodes(Collections.singletonList(code));
return strips.isEmpty() ? null : strips.get(0);
}

}

+ 21
- 0
pmapi/src/main/java/com/ningdatech/pmapi/organization/service/impl/DingOrganizationServiceImpl.java Bestand weergeven

@@ -1,13 +1,18 @@
package com.ningdatech.pmapi.organization.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.pmapi.organization.mapper.DingOrganizationMapper;
import com.ningdatech.pmapi.organization.model.entity.DingOrganization;
import com.ningdatech.pmapi.organization.service.IDingOrganizationService;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.List;

/**
* <p>
* 服务实现类
@@ -37,4 +42,20 @@ public class DingOrganizationServiceImpl extends ServiceImpl<DingOrganizationMap
String parentCode = dingOrganization.getParentCode();
return getByOrgCode(parentCode);
}

@Override
public List<DingOrganization> listByCodes(Collection<String> codes) {
LambdaQueryWrapper<DingOrganization> query = Wrappers.lambdaQuery(DingOrganization.class)
.eq(DingOrganization::getOrganizationCode, codes);
return list(query);
}

@Override
public List<String> listNameByCodes(Collection<String> codes) {
LambdaQueryWrapper<DingOrganization> query = Wrappers.lambdaQuery(DingOrganization.class)
.select(DingOrganization::getOrganizationName)
.eq(DingOrganization::getOrganizationCode, codes);
return CollUtils.fieldList(list(query), DingOrganization::getOrganizationName);
}

}

Laden…
Annuleren
Opslaan