diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/entity/ExpertGovBusinessStrip.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/entity/ExpertGovBusinessStrip.java index 671cba0..31f8cb7 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/entity/ExpertGovBusinessStrip.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/entity/ExpertGovBusinessStrip.java @@ -14,9 +14,9 @@ import java.io.Serializable; * @author Liuxinxin * @since 2023-04-17 */ -@TableName("expert_gov_business_strip") @Data -@ApiModel(value = "ExpertGovBusinessStrip对象", description = "") +@TableName("expert_gov_business_strip") +@ApiModel(value = "ExpertGovBusinessStrip对象") public class ExpertGovBusinessStrip implements Serializable { private static final long serialVersionUID = 1L; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertGovBusinessStripService.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertGovBusinessStripService.java index 3aaefd7..b6bb813 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertGovBusinessStripService.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertGovBusinessStripService.java @@ -1,11 +1,16 @@ package com.ningdatech.pmapi.expert.service; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ningdatech.pmapi.expert.entity.ExpertGovBusinessStrip; import com.baomidou.mybatisplus.extension.service.IService; +import java.util.Collection; +import java.util.List; + /** *
- * 服务类 + * 服务类 *
* * @author Liuxinxin @@ -13,4 +18,11 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface IExpertGovBusinessStripService extends IService+ * 前端控制器 + *
+ * + * @author liuxinxin + * @since 2023-04-18 + */ +@Slf4j +@Validated +@RestController +@RequiredArgsConstructor +@Api(value = "BelongOrgController", tags = "单位所属条线") +@RequestMapping("/api/v1/belong-org") +public class BelongOrgController { + + private final BelongOrgManage belongOrgManage; + + @GetMapping("/business-strip/list") + @ApiOperation("获取条线列表") + public List+ * + *
+ * + * @author liuxinxin + * @since 2023-04-18 + */ +@Data +@TableName("belong_org") +@ApiModel(value = "BelongOrg对象") +public class BelongOrg implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + private Long id; + + @ApiModelProperty("组织code") + private String orgCode; + + @ApiModelProperty("组织名称") + private String orgName; + + @ApiModelProperty("所属组织code") + private String belongCode; + + @ApiModelProperty("所属组织名称") + private String belongName; + + @ApiModelProperty("组织类型") + private String orgType; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/gov/entity/GovBusinessStrip.java b/pmapi/src/main/java/com/ningdatech/pmapi/gov/entity/GovBusinessStrip.java new file mode 100644 index 0000000..779048e --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/gov/entity/GovBusinessStrip.java @@ -0,0 +1,78 @@ +package com.ningdatech.pmapi.gov.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; + +import java.io.Serializable; + +/** + *+ * + *
+ * + * @author liuxinxin + * @since 2023-04-13 + */ +@TableName("gov_business_strip") +@ApiModel(value = "GovBusinessStrip对象", description = "") +public class GovBusinessStrip implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long id; + + private String businessStripCode; + + private String businessStripName; + + private String parentCode; + + private String parentName; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + public String getBusinessStripCode() { + return businessStripCode; + } + + public void setBusinessStripCode(String businessStripCode) { + this.businessStripCode = businessStripCode; + } + public String getBusinessStripName() { + return businessStripName; + } + + public void setBusinessStripName(String businessStripName) { + this.businessStripName = businessStripName; + } + public String getParentCode() { + return parentCode; + } + + public void setParentCode(String parentCode) { + this.parentCode = parentCode; + } + public String getParentName() { + return parentName; + } + + public void setParentName(String parentName) { + this.parentName = parentName; + } + + @Override + public String toString() { + return "GovBusinessStrip{" + + "id=" + id + + ", businessStripCode=" + businessStripCode + + ", businessStripName=" + businessStripName + + ", parentCode=" + parentCode + + ", parentName=" + parentName + + "}"; + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/gov/enumeration/BelongTypeEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/gov/enumeration/BelongTypeEnum.java new file mode 100644 index 0000000..136ade5 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/gov/enumeration/BelongTypeEnum.java @@ -0,0 +1,20 @@ +package com.ningdatech.pmapi.gov.enumeration; + +/** + * @author liuxinxin + * @date 2023/4/18 下午2:48 + */ + +public enum BelongTypeEnum { + + /** + * 组织 + */ + ORGANIZATION, + + /** + * 条线 + */ + GOV_BUSINESS_STRIP + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/gov/helper/GovBusinessStripHelper.java b/pmapi/src/main/java/com/ningdatech/pmapi/gov/helper/GovBusinessStripHelper.java new file mode 100644 index 0000000..2524980 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/gov/helper/GovBusinessStripHelper.java @@ -0,0 +1,44 @@ +package com.ningdatech.pmapi.gov.helper; + +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.ningdatech.pmapi.expert.entity.ExpertGovBusinessStrip; +import com.ningdatech.pmapi.gov.entity.BelongOrg; +import com.ningdatech.pmapi.gov.service.IBelongOrgService; +import lombok.RequiredArgsConstructor; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author liuxinxin + * @date 2023/4/21 下午2:07 + */ + +@Component +@RequiredArgsConstructor +public class GovBusinessStripHelper { + + private final IBelongOrgService iBelongOrgService; + + public List+ * Mapper 接口 + *
+ * + * @author liuxinxin + * @since 2023-04-18 + */ +public interface BelongOrgMapper extends BaseMapper+ * 服务类 + *
+ * + * @author liuxinxin + * @since 2023-04-18 + */ +public interface IBelongOrgService extends IService+ * 服务实现类 + *
+ * + * @author liuxinxin + * @since 2023-04-18 + */ +@Service +public class BelongOrgServiceImpl extends ServiceImpl+ * AvoidTypeEnum + *
+ * + * @author WendyYang + * @since 2023/8/17 + **/ +@Getter +@AllArgsConstructor +public enum AvoidTypeEnum { + + CURR_UNIT(1, "同单位"), + CURR_STRIP(2, "同条线"), + NONE(3, "不回避"); + + private final Integer code; + private final String remark; + + public static AvoidTypeEnum getByCode(int code) { + return Arrays.stream(values()) + .filter(w -> w.getCode().equals(code)) + .findFirst() + .orElseThrow(() -> BizException.wrap("回避类型无效")); + } + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/ExpertRandomInviteAlgorithm.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/ExpertRandomInviteAlgorithm.java index 44137e4..873ac28 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/ExpertRandomInviteAlgorithm.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/ExpertRandomInviteAlgorithm.java @@ -1,15 +1,14 @@ package com.ningdatech.pmapi.meeting.helper; import cn.hutool.core.util.RandomUtil; +import com.ningdatech.basic.util.CollUtils; +import com.ningdatech.pmapi.expert.entity.ExpertGovBusinessStrip; import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo; import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.RandomUtils; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; /** @@ -74,6 +73,77 @@ public class ExpertRandomInviteAlgorithm { } } + public static List
@@ -66,6 +70,7 @@ public class ExpertInviteManage {
private final IMeetingService meetingService;
private final IExpertAvoidCompanyService expertAvoidCompanyService;
private final MeetingCallOrMsgHelper meetingCallOrMsgHelper;
+ private final IExpertGovBusinessStripService expertGovBusinessStripService;
@Value("#{randomInviteProperties.recentMeetingCount}")
private Integer recentMeetingCount;
@@ -364,10 +369,29 @@ public class ExpertInviteManage {
if (userInfoList.isEmpty()) {
return result;
}
- Map