Browse Source

Merge branch 'dev'

dev_shibei_match
sunyuchao 4 years ago
parent
commit
10456ed02b
  1. 20
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml
  2. 9
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java
  3. 2
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxLoginServiceImpl.java
  4. 15
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/ResiTopicDTO.java
  5. 15
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicDraftDTO.java
  6. 15
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/CreateTopicFormDTO.java
  7. 9
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/DraftDetailResultDTO.java
  8. 10
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicIncludeIssueDetailResultDTO.java
  9. 10
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/ResiGroupMemberService.java
  10. 12
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/GroupMemeberOperationServiceImpl.java
  11. 18
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java
  12. 15
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/ResiTopicEntity.java
  13. 16
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/TopicDraftEntity.java
  14. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java
  15. 24
      epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.24__topic_locate.sql
  16. 6
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml
  17. 27
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/member/ResiGroupMemberDao.xml

20
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml

@ -26,12 +26,12 @@
COUNT(rgm.id) AS gridGroupPeopleTotal
FROM
resi_group rg
LEFT JOIN resi_group_member rgm ON rgm.resi_group_id = rg.id
LEFT JOIN resi_group_member rgm ON rgm.resi_group_id = rg.id AND rgm.DEL_FLAG = 0
WHERE
rg.DEL_FLAG = 0
AND rg.state = #{state}
AND rg.customer_id = #{customerId}
AND rgm.status != #{status}
AND (rgm.status = 'approved' OR rgm.status = 'silent')
AND DATE_FORMAT(rgm.created_time,'%Y%m%d') <![CDATA[ <= ]]> #{dateId}
GROUP BY rg.grid_id
</select>
@ -45,12 +45,12 @@
COUNT( rgm.id ) AS groupCount
FROM
resi_group rg
LEFT JOIN resi_group_member rgm ON rgm.resi_group_id = rg.id
LEFT JOIN resi_group_member rgm ON rgm.resi_group_id = rg.id AND rgm.DEL_FLAG = 0
WHERE
rg.DEL_FLAG = 0
AND rg.state = #{state}
AND rg.customer_id = #{customerId}
AND rgm.STATUS != #{status}
AND (rgm.status = 'approved' OR rgm.status = 'silent')
AND DATE_FORMAT(rgm.created_time,'%Y%m%d') <![CDATA[ <= ]]> #{dateId}
GROUP BY
rgm.resi_group_id
@ -94,12 +94,12 @@
COUNT(rgm.id) AS gridGroupPeopleTotal
FROM
resi_group rg
LEFT JOIN resi_group_member rgm ON rgm.resi_group_id = rg.id
LEFT JOIN resi_group_member rgm ON rgm.resi_group_id = rg.id AND rgm.DEL_FLAG = 0
WHERE
rg.DEL_FLAG = 0
AND rg.state = 'approved'
AND rg.customer_id = #{customerId}
AND rgm.status != 'removed'
AND (rgm.status = 'approved' OR rgm.status = 'silent')
AND DATE_FORMAT(rgm.created_time,'%Y%m%d') <![CDATA[ <= ]]> #{dateId}
GROUP BY rg.grid_id
</select>
@ -112,12 +112,12 @@
COUNT( rgm.id ) AS groupCount
FROM
resi_group rg
LEFT JOIN resi_group_member rgm ON rgm.resi_group_id = rg.id
LEFT JOIN resi_group_member rgm ON rgm.resi_group_id = rg.id AND rgm.DEL_FLAG = 0
WHERE
rg.DEL_FLAG = 0
AND rg.state = 'approved'
AND rg.customer_id = #{customerId}
AND rgm.STATUS != 'removed'
AND (rgm.status = 'approved' OR rgm.status = 'silent')
AND DATE_FORMAT(rgm.created_time,'%Y%m%d') <![CDATA[ <= ]]> #{dateId}
GROUP BY
rgm.resi_group_id
@ -145,12 +145,12 @@
COUNT( rgm.id ) AS groupCount
FROM
resi_group rg
LEFT JOIN resi_group_member rgm ON rgm.resi_group_id = rg.id
LEFT JOIN resi_group_member rgm ON rgm.resi_group_id = rg.id AND rgm.DEL_FLAG = 0
WHERE
rg.DEL_FLAG = 0
AND rg.state = 'approved'
AND rg.grid_id = #{gridId}
AND rgm.STATUS != 'removed'
AND (rgm.status = 'approved' OR rgm.status = 'silent')
GROUP BY
rgm.resi_group_id
</foreach>

9
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java

@ -779,6 +779,15 @@ public class CodeServiceImpl implements CodeService {
dto.setCreateTime(DateUtils.formatTimestamp(temp.getCreateTime(), DateUtils.DATE_TIME_PATTERN));
resultList.add(dto);
});
//按时间降序
if (resultList.size() > NumConstant.ZERO) {
Collections.sort(resultList, new Comparator<TemplateDraftListResultDTO>() {
@Override
public int compare(TemplateDraftListResultDTO o1, TemplateDraftListResultDTO o2) {
return o2.getCreateTime().compareTo(o1.getCreateTime());
}
});
}
return resultList;
}

2
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxLoginServiceImpl.java

@ -41,6 +41,7 @@ public class WxLoginServiceImpl implements WxLoginService {
@Override
public UserWechatDTO resiAndWorkLogin(String appId, String wxCode, String customerId, String clientType) {
//1.获取用户openid和session_key
logger.info(String.format("wxcode获取微信用户信息,接口入参appId:%s;wxCode:%s;customerId:%s;clientType:%s"), appId, wxCode, customerId, clientType);
Map<String, Object> map = new HashMap<>();
map.put("appid", appId);
map.put("js_code", wxCode);
@ -62,6 +63,7 @@ public class WxLoginServiceImpl implements WxLoginService {
UserWechatDTO dto = new UserWechatDTO();
dto.setWxOpenId(openid);
dto.setSessionKey(sessionKey);
logger.info("wxcode获取微信用户信息,接口返参UserWechatDTO->" + dto);
/*//2.换取用户基本信息
//小程序access_token

15
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/ResiTopicDTO.java

@ -88,6 +88,21 @@ public class ResiTopicDTO implements Serializable {
*/
private String dimension;
/**
* 定位地址
* */
private String locateAddress;
/**
* 定位经度
* */
private String locateLongitude;
/**
* 定位纬度
* */
private String locateDimension;
/**
* 删除标记 0未删除1已删除
*/

15
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicDraftDTO.java

@ -103,6 +103,21 @@ public class TopicDraftDTO implements Serializable {
*/
private String dimension;
/**
* 定位地址
* */
private String locateAddress;
/**
* 定位经度
* */
private String locateLongitude;
/**
* 定位纬度
* */
private String locateDimension;
/**
* 发布成功后的话题id
*/

15
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/CreateTopicFormDTO.java

@ -44,6 +44,21 @@ public class CreateTopicFormDTO implements Serializable {
@NotBlank(message = "地址信息不能为空")
private String address;
/**
* 经度
* */
private String locateLongitude;
/**
* 纬度
* */
private String locateDimension;
/**
* 地址
* */
private String locateAddress;
/**
* 省份
* */

9
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/DraftDetailResultDTO.java

@ -42,6 +42,15 @@ public class DraftDetailResultDTO implements Serializable {
* 发布地址
*/
private String releaseAddress;
/**
* 经度
*/
private String longitude;
/**
* 维度
*/
private String dimension;
/**
* 驳回理由
*/

10
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicIncludeIssueDetailResultDTO.java

@ -41,6 +41,16 @@ public class ResiTopicIncludeIssueDetailResultDTO implements Serializable {
* */
private String releaseAddress;
/**
* 经度
*/
private String longitude;
/**
* 维度
*/
private String dimension;
/**
* 话题内容
* */

10
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/ResiGroupMemberService.java

@ -252,4 +252,14 @@ public interface ResiGroupMemberService extends BaseService<ResiGroupMemberEntit
* @Date 2021/4/19 19:14
**/
List<ResiGroupMemberDTO> getMemberList(String groupId);
/**
* 查询小组人员信息
* @author zhaoqifeng
* @date 2021/5/8 15:17
* @param groupId
* @param userId
* @return com.epmet.resi.group.dto.member.ResiGroupMemberDTO
*/
ResiGroupMemberDTO getMemberInfo(String groupId, String userId);
}

12
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/GroupMemeberOperationServiceImpl.java

@ -247,8 +247,8 @@ public class GroupMemeberOperationServiceImpl extends BaseServiceImpl<GroupMemeb
throw new RenException("没有找到邀请人Id");
}
//查询是否在群内
ResiGroupMemberDTO groupMember = resiGroupMemberDao.selectGroupMemberInfo(groupId, param.getUserId());
if (null != groupMember && !MemberStateConstant.REMOVED.equals(groupMember.getStatus())) {
ResiGroupMemberDTO groupMember = memberService.getMemberInfo(groupId, param.getUserId());
if (null != groupMember && MemberStateConstant.APPROVED.equals(groupMember.getStatus())) {
log.info("已经在群内,直接返回成功,但是不发送积分事件");
result.setStatus("entered");
return result;
@ -341,7 +341,7 @@ public class GroupMemeberOperationServiceImpl extends BaseServiceImpl<GroupMemeb
}
}
if(StringUtils.isNotBlank(inviter)){
if(StringUtils.isNotBlank(inviter) && null == groupMember){
CommonGridIdFormDTO dataFilterParam = new CommonGridIdFormDTO();
dataFilterParam.setGridId(resiGroupDTO.getGridId());
@ -397,15 +397,15 @@ public class GroupMemeberOperationServiceImpl extends BaseServiceImpl<GroupMemeb
//直接加入群成员关系表
//如果是之前被移除的,则修改resi_group_member记录
ResiGroupMemberDTO resiGroupMemberDTO = new ResiGroupMemberDTO();
ResiGroupMemberDTO resiGroupMember = resiGroupMemberDao.selectGroupMemberInfo(groupId, param.getUserId());
if (null != resiGroupMember) {
resiGroupMemberDTO.setId(resiGroupMember.getId());
if (null != groupMember) {
resiGroupMemberDTO.setId(groupMember.getId());
}
resiGroupMemberDTO.setCustomerUserId(groupMemeberOperation.getCustomerUserId());
resiGroupMemberDTO.setResiGroupId(groupMemeberOperation.getGroupId());
resiGroupMemberDTO.setGroupLeaderFlag(LeaderFlagConstant.GROUP_MEMBER);
resiGroupMemberDTO.setEnterGroupType(groupMemeberOperation.getEnterGroupType());
resiGroupMemberDTO.setStatus(MemberStateConstant.APPROVED);
resiGroupMemberDTO.setDelFlag(NumConstant.ZERO_STR);
resiGroupMemberDTO.setCreatedBy(groupMemeberOperation.getCustomerUserId());
memberService.saveOrUpdate(resiGroupMemberDTO);
//修改群统计值

18
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java

@ -383,6 +383,24 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl<ResiGroupMemberD
return baseDao.getMemberList(groupId);
}
/**
* 查询小组人员信息
*
* @param groupId
* @param userId
* @return com.epmet.resi.group.dto.member.ResiGroupMemberDTO
* @author zhaoqifeng
* @date 2021/5/8 15:17
*/
@Override
public ResiGroupMemberDTO getMemberInfo(String groupId, String userId) {
QueryWrapper<ResiGroupMemberEntity> wrapper = new QueryWrapper<>();
wrapper.eq("RESI_GROUP_ID", groupId)
.eq("CUSTOMER_USER_ID", userId);
ResiGroupMemberEntity entity = baseDao.selectOne(wrapper);
return ConvertUtils.sourceToTarget(entity, ResiGroupMemberDTO.class);
}
/**
* @param groupMemberListFormDTO
* @return com.epmet.commons.tools.utils.Result

15
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/ResiTopicEntity.java

@ -90,6 +90,21 @@ public class ResiTopicEntity extends BaseEpmetEntity {
*/
private String dimension;
/**
* 定位地址
* */
private String locateAddress;
/**
* 定位经度
* */
private String locateLongitude;
/**
* 定位纬度
* */
private String locateDimension;
/**
* 议题Id
*/

16
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/TopicDraftEntity.java

@ -103,6 +103,22 @@ public class TopicDraftEntity extends BaseEpmetEntity {
*/
private String dimension;
/**
* 定位地址
* */
private String locateAddress;
/**
* 定位经度
* */
private String locateLongitude;
/**
* 定位纬度
* */
private String locateDimension;
/**
* 发布成功后的话题id
*/

2
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java

@ -871,7 +871,7 @@ public class TopicDraftServiceImpl extends BaseServiceImpl<TopicDraftDao, TopicD
}
topic.setCreatedBy(tokenDto.getUserId());
topic.setStatus(TopicConstant.PUBLISHMENT);
resiTopicDao.insertOne(topic);
resiTopicDao.insert(topic);
if(StringUtils.isBlank(topic.getId())){
//没有返回主键
log.error(ModuleConstant.NO_PRIMARY_KEY_RETURNED);

24
epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.24__topic_locate.sql

@ -0,0 +1,24 @@
ALTER TABLE `resi_topic`
ADD COLUMN `LOCATE_ADDRESS` varchar(255) NULL COMMENT '定位地址' AFTER `DIMENSION`,
ADD COLUMN `LOCATE_LONGITUDE` varchar(32) NULL COMMENT '定位经度' AFTER `LOCATE_ADDRESS`,
ADD COLUMN `LOCATE_DIMENSION` varchar(32) NULL COMMENT '定位维度' AFTER `LOCATE_LONGITUDE`;
ALTER TABLE `topic_draft`
ADD COLUMN `LOCATE_ADDRESS` varchar(255) NULL COMMENT '定位地址' AFTER `DIMENSION`,
ADD COLUMN `LOCATE_LONGITUDE` varchar(32) NULL COMMENT '定位经度' AFTER `LOCATE_ADDRESS`,
ADD COLUMN `LOCATE_DIMENSION` varchar(32) NULL COMMENT '定位维度' AFTER `LOCATE_LONGITUDE`;
ALTER TABLE `resi_group_member`
MODIFY COLUMN `STATUS` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '状态:( 审核通过 - approved、 已禁言 - silent、被移出群 - removed 【组长建组为under_auditting,建组审核不通过为rejected】)' AFTER `GROUP_INVITATION_ID`;
UPDATE resi_topic a
INNER JOIN resi_topic b ON a.ID = b.ID
SET a.LOCATE_ADDRESS = b.ADDRESS,
a.LOCATE_LONGITUDE = b.LONGITUDE,
a.LOCATE_DIMENSION = b.DIMENSION;
UPDATE topic_draft a
INNER JOIN topic_draft b ON a.ID = b.ID
SET a.LOCATE_ADDRESS = b.ADDRESS,
a.LOCATE_LONGITUDE = b.LONGITUDE,
a.LOCATE_DIMENSION = b.DIMENSION;

6
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml

@ -573,7 +573,7 @@
<!-- 查询 话题、通知、活动最近10条数据 -->
<select id="selectLatestTen" resultType="com.epmet.resi.group.dto.topic.result.LatestTenResultDTO">
SELECT id,userId,releaseTime,content,status,issueId,contentType,firstPhoto,isChanged FROM
SELECT id,userId,releaseTime,content,status,issueId,contentType,firstPhoto,isExpirat,isChanged FROM
((SELECT
t.ID,
t.CREATED_BY AS userId,
@ -701,7 +701,7 @@
GROUP_ACT_ID = #{id}
</foreach>
)
AND `VIEW_DETAIL` = 'un_read'
AND READ_FLAG = 'un_read'
AND GROUP_ID = #{groupId}
GROUP BY GROUP_ACT_ID
)
@ -716,7 +716,7 @@
NOTICE_ID = #{id}
</foreach>
)
AND `VIEW_DETAIL` = 'un_read'
AND READ_FLAG = 'un_read'
AND GROUP_ID = #{groupId}
GROUP BY NOTICE_ID
)

27
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/member/ResiGroupMemberDao.xml

@ -97,18 +97,21 @@
<select id="getMembersCountInGrid" resultType="integer">
SELECT
COUNT( DISTINCT member.CUSTOMER_USER_ID )
FROM
RESI_GROUP groupp
INNER JOIN RESI_GROUP_MEMBER member
ON (member.RESI_GROUP_ID = groupp.ID
AND member.DEL_FLAG = '0'
AND member.STATUS not in( 'removed','exit')
COUNT(
DISTINCT
CUSTOMER_USER_ID
)
WHERE
FROM
RESI_GROUP groupp
INNER JOIN RESI_GROUP_MEMBER member ON member.RESI_GROUP_ID = groupp.ID AND member.DEL_FLAG = '0' AND (member.STATUS = 'approved' OR
member.STATUS = 'silent')
WHERE
groupp.DEL_FLAG = '0'
AND groupp.GRID_ID = #{gridId}
AND groupp.STATE = 'approved'
AND
groupp.GRID_ID = #{gridId}
AND
groupp.STATE = 'approved'
</select>
<select id="getMembersCountInGrids" resultType="com.epmet.resi.group.dto.member.result.VotableCountResultDTO">
@ -120,7 +123,8 @@
) as votableCount
FROM
RESI_GROUP groupp
LEFT JOIN RESI_GROUP_MEMBER member ON member.RESI_GROUP_ID = groupp.ID AND member.DEL_FLAG = '0' AND member.STATUS <![CDATA[<>]]> 'removed'
LEFT JOIN RESI_GROUP_MEMBER member ON member.RESI_GROUP_ID = groupp.ID AND member.DEL_FLAG = '0' AND (member.STATUS = 'approved' OR
member.STATUS = 'silent')
WHERE
groupp.DEL_FLAG = '0'
AND
@ -161,6 +165,7 @@
AND CUSTOMER_USER_ID = #{userId}
AND RESI_GROUP_ID = #{groupId}
AND `STATUS` != 'removed'
AND `STATUS` != 'exit'
</select>
<!-- 修改群成员关系数据状态 -->

Loading…
Cancel
Save