Переглянути джерело

修改会议列表

tags/24080901
WendyYang 1 рік тому
джерело
коміт
b2418eff06
9 змінених файлів з 79 додано та 96 видалено
  1. +8
    -8
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingController.java
  2. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/domain/Meeting.java
  3. +8
    -8
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/req/MeetingListReq.java
  4. +24
    -36
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/MeetingByManagerVO.java
  5. +26
    -20
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/MeetingManageHelper.java
  6. +8
    -19
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java
  7. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/impl/MeetingServiceImpl.java
  8. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertInviteTask.java
  9. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/meta/helper/basic/AbstractDictionaryCache.java

+ 8
- 8
pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingController.java Переглянути файл

@@ -52,16 +52,16 @@ public class MeetingController {
return meetingManage.expertCountOnChange(po);
}

@ApiOperation("专家抽取员会议列表")
@GetMapping("/meetingListByManager")
@WebLog(value = "专家抽取员事务列表")
public PageVo<MeetingByManagerVO> meetingListByManager(MeetingListReq po) {
return meetingManage.meetingListByManager(po);
@ApiOperation("管理员会议列表")
@GetMapping("/manager/meetingList")
@WebLog(value = "管理员会议列表")
public PageVo<MeetingByManagerVO> meetingListByManager(MeetingListReq req) {
return meetingManage.meetingListByManager(req);
}

@ApiOperation("履职记录 | 专家会议列表")
@GetMapping("/meetingListByExpert")
@WebLog(value = "履职记录 | 专家会议列表")
@ApiOperation("专家会议列表")
@GetMapping("/expert/meetingList")
@WebLog(value = "专家会议列表")
public PageVo<MeetingByManagerVO> meetingListByExpert(MeetingListReq po) {
return meetingManage.meetingListByExpert(po);
}


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/domain/Meeting.java Переглянути файл

@@ -62,8 +62,8 @@ public class Meeting implements Serializable {

private Integer status;

@ApiModelProperty("是否停止随机邀请")
private Boolean inviteStopped;
@ApiModelProperty("抽取状态")
private Boolean inviteStatus;

@ApiModelProperty("是否确认名单")
private Boolean confirmedRoster;


+ 8
- 8
pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/req/MeetingListReq.java Переглянути файл

@@ -22,28 +22,28 @@ import java.time.LocalDateTime;
@EqualsAndHashCode(callSuper = true)
public class MeetingListReq extends PagePo {

@ApiModelProperty("事务名称")
@ApiModelProperty("会议名称")
private String name;

@ApiModelProperty("事务开始时间")
@ApiModelProperty("会议开始时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime startTime;

@ApiModelProperty("事务结束时间")
@ApiModelProperty("会议结束时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime endTime;

@ApiModelProperty("地点")
private String address;

@ApiModelProperty("事务状态:1 未完成、2 已完成、3 已取消\n" +
"专家参与状态:1 待参加、2 已参加、3 已请假")
private Integer status;

@ApiModelProperty("事务类型")
private String type;
@ApiModelProperty("会议类型")
private String meetingType;

@ApiModelProperty("专家ID")
private Long expertId;

@ApiModelProperty("项目名称")
private String projectName;

}

+ 24
- 36
pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/MeetingByManagerVO.java Переглянути файл

@@ -26,51 +26,39 @@ public class MeetingByManagerVO {
public MeetingByManagerVO() {
}

@ApiModelProperty("事务ID")
private Long id;
@ApiModelProperty("会议ID")
private Long meetingId;

@ApiModelProperty("事务状态")
private Integer status;

@ApiModelProperty("会议参加状态:1 待参加、2 已参加、3 已请假")
private Integer attendStatus;

@ApiModelProperty("事务名称")
private String name;

@ApiModelProperty("联系人")
private String connecter;

@ApiModelProperty("联系方式")
private String contact;

@ApiModelProperty("会议地址详情")
private String meetingAddress;

@ApiModelProperty("事务类型编码")
private String dateType;

@ApiModelProperty("事务类型名称")
private String dateTypeName;

@ApiModelProperty("事务开始时间")
@ApiModelProperty("会议开始时间")
@JSONField(format = "yyyy-MM-dd HH:mm")
private LocalDateTime startTime;

@ApiModelProperty("事务结束时间")
@ApiModelProperty("会议结束时间")
@JSONField(format = "yyyy-MM-dd HH:mm")
private LocalDateTime endTime;

@ApiModelProperty("邀请人数")
private Integer inviteCount;
@ApiModelProperty("会议状态")
private Integer status;

@ApiModelProperty("抽取类型")
private Integer inviteType;

@ApiModelProperty("抽取状态")
private Boolean inviteStatus;

@ApiModelProperty("名单确认状态")
private Boolean confirmedRoster;

@ApiModelProperty("会议参加状态:1 待参加、2 已参加、3 已请假")
private Integer attendStatus;

@ApiModelProperty("确认人数")
private Integer confirmCount;
@ApiModelProperty("会议名称")
private String meetingName;

@ApiModelProperty("是否进行了专家抽取:true 是、false 否")
private Boolean invited;
@ApiModelProperty("会议类型编码")
private String meetingType;

@ApiModelProperty("抽取单位")
private String holdOrg;
@ApiModelProperty("会议类型名称")
private String meetingTypeName;

}

+ 26
- 20
pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/MeetingManageHelper.java Переглянути файл

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.pmapi.common.util.BizUtils;
import com.ningdatech.pmapi.common.util.StrUtils;
import com.ningdatech.pmapi.expert.constant.ExpertAccountStatusEnum;
import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo;
import com.ningdatech.pmapi.expert.service.ExpertInfoService;
@@ -24,14 +25,12 @@ import com.ningdatech.pmapi.meeting.service.IExpertInviteAvoidRuleService;
import com.ningdatech.pmapi.meeting.service.IExpertInviteRuleService;
import com.ningdatech.pmapi.meeting.service.IMeetingExpertService;
import com.ningdatech.pmapi.meta.helper.DictionaryCache;
import com.ningdatech.pmapi.meta.model.dto.DictionaryDTO;
import lombok.AllArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Component;

import java.util.Collection;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.*;

/**
* <p>
@@ -73,32 +72,39 @@ public class MeetingManageHelper {
}

public MeetingByManagerVO buildByMeeting(Meeting meeting) {
DictionaryDTO dict = dictionaryCache.getByCode(meeting.getType());
return MeetingByManagerVO.builder()
.id(meeting.getId())
.dateTypeName(dictionaryCache.getByCode(meeting.getType()).getName())
.meetingAddress(meeting.getMeetingAddress())
.name(meeting.getName())
.meetingId(meeting.getId())
.meetingTypeName(dict == null ? "" : dict.getName())
.meetingName(meeting.getName())
.startTime(meeting.getStartTime())
.endTime(meeting.getEndTime())
.connecter(meeting.getConnecter())
.contact(meeting.getContact())
.inviteType(meeting.getInviteType())
.confirmedRoster(meeting.getConfirmedRoster())
.inviteStatus(meeting.getInviteStatus())
.status(meeting.getStatus())
.holdOrg(meeting.getHoldOrg())
.build();
}

public void buildMeetingQuery(LambdaQueryWrapper<Meeting> query, MeetingListReq po) {
if (StrUtil.isNotBlank(po.getName())) {
query.like(Meeting::getName, po.getName());
public void buildMeetingQuery(LambdaQueryWrapper<Meeting> query, MeetingListReq req) {
if (StrUtil.isNotBlank(req.getName())) {
query.like(Meeting::getName, req.getName());
}
if (StrUtil.isNotBlank(po.getType())) {
query.eq(Meeting::getType, po.getType());
if (StrUtil.isNotBlank(req.getMeetingType())) {
query.eq(Meeting::getType, req.getMeetingType());
}
if (po.getStartTime() != null) {
query.ge(Meeting::getStartTime, po.getStartTime());
if (req.getStartTime() != null) {
query.ge(Meeting::getStartTime, req.getStartTime());
}
if (po.getEndTime() != null) {
query.le(Meeting::getEndTime, po.getEndTime());
if (req.getEndTime() != null) {
query.le(Meeting::getEndTime, req.getEndTime());
}
if (StrUtils.isNotBlank(req.getProjectName())) {
String projectName = "%" + req.getProjectName() + "%";
query.and(q1 -> q1.exists("select 1 from nd_project np inner join meeting_inner_project mip on mip.project_id = np.id" +
" where mip.meeting_id = meeting.id and np.project_name like {0}", projectName)
.or(q2 -> q2.exists("select 1 from meeting_outer_project mop where mop.meeting_id = meeting.id" +
"and mop.project_name like {0}", projectName)));
}
}



+ 8
- 19
pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java Переглянути файл

@@ -111,7 +111,7 @@ public class MeetingManage {
meeting.setHoldOrgCode(userDetail.getOrganizationCode());
meeting.setRegionCode(userDetail.getRegionCode());
meeting.setCreator(userDetail.getUsername());
meeting.setInviteStopped(Boolean.FALSE);
meeting.setInviteStatus(Boolean.FALSE);
meeting.setConfirmedRoster(Boolean.FALSE);
meeting.setInviteType(inviteRule.getInviteType());
meetingService.save(meeting);
@@ -166,7 +166,7 @@ public class MeetingManage {
expertInviteManage.expertRandomInviteByMeetingCreate(meeting, randomRules, avoidInfo);
expertInviteTask.addInviteExpertTaskByMeetingCreate(meeting.getId(), 5);
LambdaUpdateWrapper<Meeting> update = Wrappers.lambdaUpdate(Meeting.class);
update.set(Meeting::getInviteStopped, false);
update.set(Meeting::getInviteStatus, false);
update.eq(Meeting::getId, meeting.getId());
meetingService.update(update);
// 回避规则
@@ -271,37 +271,26 @@ public class MeetingManage {
/**
* 管理员会议列表
*
* @param po 查询参数
* @param req 查询参数
* @return 会议列表
* @author WendyYang
*/
public PageVo<MeetingByManagerVO> meetingListByManager(MeetingListReq po) {
public PageVo<MeetingByManagerVO> meetingListByManager(MeetingListReq req) {
LambdaQueryWrapper<Meeting> query = new LambdaQueryWrapper<Meeting>()
.orderByDesc(Meeting::getCreateOn);
// 补充逻辑 如果拥有超级管理员权限可以看到所有事务
if (!permissionCheckHelper.isSuperAdmin()) {
query.eq(Meeting::getCreateBy, LoginUserUtil.getUserId());
}
query.eq(po.getStatus() != null, Meeting::getStatus, po.getStatus());
meetingManageHelper.buildMeetingQuery(query, po);
Page<Meeting> page = meetingService.page(po.page(), query);
query.eq(req.getStatus() != null, Meeting::getStatus, req.getStatus());
meetingManageHelper.buildMeetingQuery(query, req);
Page<Meeting> page = meetingService.page(req.page(), query);
if (page.getTotal() == 0) {
return PageVo.empty();
}
PageVo<MeetingByManagerVO> result = new PageVo<>(new ArrayList<>(), page.getTotal());
Map<Long, CountConfirmByMeetingIdDTO> countConfirmMap = new HashMap<>(16);
List<Long> meetingIds = CollUtils.fieldList(page.getRecords(), Meeting::getId);
countConfirmMap.putAll(meetingExpertService.countConfirmedByMeetingIds(meetingIds));
page.getRecords().forEach(meeting -> {
MeetingByManagerVO item = meetingManageHelper.buildByMeeting(meeting);
CountConfirmByMeetingIdDTO confirm = countConfirmMap.get(meeting.getId());
if (confirm == null) {
item.setInviteCount(0);
item.setConfirmCount(0);
} else {
item.setInviteCount(confirm.getTotal());
item.setConfirmCount(confirm.getConfirmed());
}
result.getRecords().add(item);
});
return result;
@@ -354,7 +343,7 @@ public class MeetingManage {
throw BizException.wrap("该会议信息不存在");
}
ExpertInviteDetailVO result = new ExpertInviteDetailVO();
result.setInvitedStopped(meeting.getInviteStopped());
result.setInvitedStopped(meeting.getInviteStatus());
result.setConfirmedRoster(meeting.getConfirmedRoster());
List<MeetingExpert> experts = meetingExpertService.listByMeetingId(meetingId);
if (experts.isEmpty()) {


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/impl/MeetingServiceImpl.java Переглянути файл

@@ -27,7 +27,7 @@ public class MeetingServiceImpl extends ServiceImpl<MeetingMapper, Meeting> impl
public void stopRandomInvite(Long meetingId) {
Meeting meeting = new Meeting();
meeting.setId(meetingId);
meeting.setInviteStopped(Boolean.TRUE);
meeting.setInviteStatus(Boolean.TRUE);
baseMapper.updateById(meeting);
}



+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertInviteTask.java Переглянути файл

@@ -156,7 +156,7 @@ public class ExpertInviteTask {
addInviteExpertTask(meetingId, false, properties.getInviteDelay());
log.info("重置会议的随机抽取状态:{}", meetingId);
LambdaUpdateWrapper<Meeting> update = Wrappers.lambdaUpdate(Meeting.class);
update.set(Meeting::getInviteStopped, false);
update.set(Meeting::getInviteStatus, false);
update.set(Meeting::getUpdateBy, LoginUserUtil.getUserId());
update.set(Meeting::getUpdateOn, LocalDateTime.now());
update.eq(Meeting::getId, meetingId);


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/meta/helper/basic/AbstractDictionaryCache.java Переглянути файл

@@ -24,7 +24,7 @@ public abstract class AbstractDictionaryCache implements InitializingBean, Dicti
@Autowired
private IMetaDictionaryService iMetaDictionaryService;

protected Map<String, DictionaryDTO> dictionaryMap;
protected Map<String, DictionaryDTO> dictionaryMap = new ConcurrentHashMap<>();
protected LoadingCache<String, List<DictionaryDTO>> dictionaryCacheHelper;

@Override


Завантаження…
Відмінити
Зберегти