From a037c7111ecbcf5927a752fca2321661523e0f01 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Sat, 12 Oct 2024 13:59:40 +0800 Subject: [PATCH] =?UTF-8?q?modify:=201.=20=E5=A2=9E=E5=8A=A0=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E5=85=81=E8=AE=B8=E9=87=8D=E6=96=B0=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E5=8F=98=E6=9B=B4=E5=AD=97=E6=AE=B5;=202.=20=E4=BC=9A=E8=AE=AE?= =?UTF-8?q?=E8=AF=84=E5=AE=A1=E7=BB=93=E6=9E=9C=E4=B8=8A=E4=BC=A0=E5=8E=BB?= =?UTF-8?q?=E9=99=A4=E4=BC=9A=E8=AE=AE=E6=9C=AA=E7=BB=93=E6=9D=9F=E9=99=90?= =?UTF-8?q?=E5=88=B6=EF=BC=9B=203.=20=E7=A1=AE=E8=AE=A4=E5=90=8D=E5=8D=95?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E7=9F=AD=E4=BF=A1=E9=80=9A=E7=9F=A5=E6=A0=87?= =?UTF-8?q?=E8=AF=86=EF=BC=9B=204.=20=E4=B8=93=E5=AE=B6=E9=82=80=E8=AF=B7?= =?UTF-8?q?=E6=83=85=E5=86=B5=E5=A2=9E=E5=8A=A0=E7=A1=AE=E8=AE=A4=E5=90=8D?= =?UTF-8?q?=E5=8D=95=E7=9F=AD=E4=BF=A1=E5=9B=9E=E5=A4=8D=E5=86=85=E5=AE=B9?= =?UTF-8?q?=EF=BC=9B=205.=20=E5=A2=9E=E5=8A=A0=E8=AF=84=E5=AE=A1=E8=AF=A6?= =?UTF-8?q?=E7=BB=86=E5=9C=B0=E5=9D=80=E5=AD=97=E6=AE=B5=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hz/pm/api/meeting/entity/domain/Meeting.java | 3 ++ .../pm/api/meeting/entity/dto/MeetingBasicDTO.java | 4 +++ .../api/meeting/entity/vo/MeetingByManagerVO.java | 3 ++ .../meeting/entity/vo/MeetingDetailBasicVO.java | 3 ++ .../pm/api/meeting/helper/MeetingManageHelper.java | 1 + .../pm/api/meeting/helper/MeetingNotifyHelper.java | 3 +- .../hz/pm/api/meeting/manage/MeetingManage.java | 2 ++ .../pm/api/open/model/vo/MeetingExpertToMhDTO.java | 3 ++ .../com/hz/pm/api/user/manage/UserInfoManage.java | 35 ++++++++++++++++++++-- 9 files changed, 54 insertions(+), 3 deletions(-) diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/domain/Meeting.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/domain/Meeting.java index 17e8689..c16e835 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/domain/Meeting.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/domain/Meeting.java @@ -52,6 +52,9 @@ public class Meeting implements Serializable { @ApiModelProperty("会议地址") private String meetingAddress; + @ApiModelProperty("会议详细地址") + private String meetingAddressDetail; + @ApiModelProperty("评审地点经度") private Double addressLongitude; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/MeetingBasicDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/MeetingBasicDTO.java index 9c56148..401c0e5 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/MeetingBasicDTO.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/MeetingBasicDTO.java @@ -53,6 +53,10 @@ public class MeetingBasicDTO { @ApiModelProperty("评审地点") private String meetingAddress; + @Length(max = 200, message = "评审详细地址超出限制") + @ApiModelProperty("评审详细地址") + private String meetingAddressDetail; + @ApiModelProperty("评审地点经度") private Double addressLongitude; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingByManagerVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingByManagerVO.java index 480b24f..56e4022 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingByManagerVO.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingByManagerVO.java @@ -42,6 +42,9 @@ public class MeetingByManagerVO { @ApiModelProperty("评审地点") private String meetingAddress; + @ApiModelProperty("评审详细地址") + private String meetingAddressDetail; + @ApiModelProperty("会议状态") private Integer status; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingDetailBasicVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingDetailBasicVO.java index dda5d1d..9c57a40 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingDetailBasicVO.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingDetailBasicVO.java @@ -59,6 +59,9 @@ public class MeetingDetailBasicVO { @ApiModelProperty("评审地点") private String meetingAddress; + @ApiModelProperty("评审详细地址") + private String meetingAddressDetail; + @ApiModelProperty("联系方式") private String contact; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/MeetingManageHelper.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/MeetingManageHelper.java index 9e64d12..8c87e15 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/MeetingManageHelper.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/MeetingManageHelper.java @@ -112,6 +112,7 @@ public class MeetingManageHelper { result.setConnecter(meeting.getConnecter()); result.setContact(meeting.getContact()); result.setMeetingAddress(meeting.getMeetingAddress()); + result.setMeetingAddressDetail(meeting.getMeetingAddressDetail()); result.setIsInnerProject(meeting.getIsInnerProject()); result.setHasMeetingResult(StrUtil.isNotBlank(meeting.getResultDescription())); result.setSignQrCodeUrl(meeting.getSignQrCodeUrl()); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/MeetingNotifyHelper.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/MeetingNotifyHelper.java index af35e06..602d725 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/MeetingNotifyHelper.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/MeetingNotifyHelper.java @@ -132,9 +132,10 @@ public class MeetingNotifyHelper { String meetingTime = sTime + "至" + eTime; List notifies = new ArrayList<>(); List workingNotices = new ArrayList<>(); + String meetingAddress = meeting.getMeetingAddress() + " " + meeting.getMeetingAddressDetail(); experts.forEach(w -> { String msgContent = String.format(MeetingMsgTemplateConst.CONFIRMED_ROSTER, - w.getExpertName(), officialTime(w.getCreateOn()), meetingTime, meeting.getMeetingAddress(), + w.getExpertName(), officialTime(w.getCreateOn()), meetingTime, meetingAddress, meeting.getConnecter(), meeting.getContact()); // 音信通消息 try { diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java index 069f8298..6a3bc39 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java @@ -498,6 +498,7 @@ public class MeetingManage { .meetingName(meeting.getName()) .meetingType(meeting.getType()) .meetingAddress(meeting.getMeetingAddress()) + .meetingAddressDetail(meeting.getMeetingAddressDetail()) .typeName(getDictName(meeting.getType())) .startTime(meeting.getStartTime()) .endTime(meeting.getEndTime()) @@ -961,6 +962,7 @@ public class MeetingManage { data.setEndTime(meeting.getEndTime()); data.setMeetingName(meeting.getName()); data.setMeetingAddress(meeting.getMeetingAddress()); + data.setMeetingAddressDetail(meeting.getMeetingAddressDetail()); data.setConnecter(meeting.getConnecter()); data.setContact(meeting.getContact()); data.setLongitude(meeting.getAddressLongitude()); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/open/model/vo/MeetingExpertToMhDTO.java b/hz-pm-api/src/main/java/com/hz/pm/api/open/model/vo/MeetingExpertToMhDTO.java index 5c12cb1..274af14 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/open/model/vo/MeetingExpertToMhDTO.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/open/model/vo/MeetingExpertToMhDTO.java @@ -34,6 +34,9 @@ public class MeetingExpertToMhDTO { @ApiModelProperty("会议地址") private String meetingAddress; + @ApiModelProperty("会议地址详情") + private String meetingAddressDetail; + @ApiModelProperty("会议地址经度") private Double longitude; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/user/manage/UserInfoManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/user/manage/UserInfoManage.java index d1da415..9e6ee76 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/user/manage/UserInfoManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/user/manage/UserInfoManage.java @@ -15,7 +15,6 @@ import com.hz.pm.api.sys.model.entity.UserRole; import com.hz.pm.api.sys.service.IRoleService; import com.hz.pm.api.sys.service.IUserRoleService; import com.hz.pm.api.user.helper.MhUnitCache; -import com.hz.pm.api.user.model.dto.UnitDTO; import com.hz.pm.api.user.model.entity.UserInfo; import com.hz.pm.api.user.model.enumeration.UserAvailableEnum; import com.hz.pm.api.user.model.po.ReqUserDetailEditPO; @@ -75,6 +74,8 @@ public class UserInfoManage { if (page.getTotal() == 0) { return PageVo.empty(); } + List userIds = CollUtils.fieldList(page.getRecords(), UserInfo::getId); + Map> userRoleMap = getUserRoleMap(userIds); List result = new ArrayList<>(); page.getRecords().forEach(r -> { UserInfoListVO item = new UserInfoListVO(); @@ -82,7 +83,7 @@ public class UserInfoManage { userStatusBuilder(item, r); item.setUpdateTime(r.getUpdateOn()); item.setEmployeeCode(r.getEmployeeCode()); - item.setUserRoleList(getUserRole(item.getUserId())); + item.setUserRoleList(userRoleMap.get(r.getId())); item.setUserId(r.getId()); item.setPhoneNo(r.getMobile()); item.setMhUnitId(r.getMhUnitId()); @@ -154,6 +155,36 @@ public class UserInfoManage { return userRoleInfoList; } + private Map> getUserRoleMap(Collection userIds) { + if (CollUtil.isEmpty(userIds)) { + return Collections.emptyMap(); + } + List userRoleList = userRoleService.list(Wrappers.lambdaQuery(UserRole.class) + .in(UserRole::getUserId, userIds) + .orderByAsc(UserRole::getCreateOn)); + if (CollUtil.isNotEmpty(userRoleList)) { + List roleIds = CollUtils.fieldList(userRoleList, UserRole::getRoleId); + List roleList = roleService.listByIds(roleIds); + Map roleMap = CollUtils.listToMap(roleList, Role::getId); + Map> userRoleMap = userRoleList.stream() + .filter(r -> roleMap.containsKey(r.getRoleId())) + .collect(Collectors.groupingBy(UserRole::getUserId, + Collectors.mapping(w -> { + Role role = roleMap.get(w.getRoleId()); + UserRoleVO userRoleVO = new UserRoleVO(); + userRoleVO.setId(role.getId()); + userRoleVO.setName(role.getName()); + userRoleVO.setCreateOn(role.getCreateOn()); + return userRoleVO; + }, Collectors.toList()))); + for (List value : userRoleMap.values()) { + value.sort(Comparator.comparing(UserRoleVO::getCreateOn)); + } + return userRoleMap; + } + return Collections.emptyMap(); + } + @Transactional(rollbackFor = Exception.class) public void disableOrEnable(ReqUserDisableOrEnablePO req) { Long userId;