Browse Source

Merge remote-tracking branch 'origin/dev_personal_center' into dev_personal_center

dev_shibei_match
yinzuomei 5 years ago
parent
commit
71e9ded2ee
  1. 1
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiTopicServiceImpl.java
  2. 2
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueProjectResultDTO.java
  3. 31
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java
  4. 44
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/TopicController.java
  5. 10
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceDTO.java
  6. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java
  7. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceExcel.java
  8. 17
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java
  9. 2
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.7__add_useradvice.sql
  10. 2
      epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml

1
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiTopicServiceImpl.java

@ -79,6 +79,7 @@ public class ResiTopicServiceImpl implements ResiTopicService {
govTopic.setTopicRealseTime(top.getReleaseTime());
govTopic.setTopicFirstPhoto(top.getFirstPhoto());
govTopic.setTopicState(top.getStatus());
govTopic.setBadgeList(top.getBadgeList());
topicsResult.add(govTopic);
});
}

2
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueProjectResultDTO.java

@ -27,7 +27,7 @@ public class IssueProjectResultDTO implements Serializable {
/**
* 议题转项目时间(项目表创建时间)
*/
@JsonFormat
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date shiftedTime;
}

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

@ -371,7 +371,36 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
//2.2从缓存中查找用户信息
setCacheUserInfoWithIssue(groupId,latestTenTopics);
}
//3.用户徽章
//3.1首先需要拿到客户Id
ResiGroupEntity group = resiGroupDao.selectById(groupId);
if(null != group && StringUtils.isNotBlank(group.getCustomerId())){
Result<Map<String, List<UserBadgeUnitFormDTO>>> badgeR
= userOpenFeignClient.userShowBadge(
new UserGroupFormDTO(group.getCustomerId(),
latestTenTopics.stream()
.filter(top -> StringUtils.equals("other",top.getReleaseUserFlag()))
.map(ResiTopicIncludeIssueInfoResultDTO::getUserId)
.distinct().collect(Collectors.toList())));
if(null != badgeR && badgeR.success() && null != badgeR.getData() && !badgeR.getData().isEmpty()){
Map<String, List<UserBadgeUnitFormDTO>> badgeM = badgeR.getData();
latestTenTopics.forEach(top -> {
if(StringUtils.equals("other",top.getReleaseUserFlag())){
top.setBadgeList(
CollectionUtils.isEmpty(badgeM.get(top.getUserId())) ?
Collections.EMPTY_LIST :
badgeM.get(top.getUserId()).stream().map(UserBadgeUnitFormDTO :: getBadgeIcon).collect(Collectors.toList())
);
}else top.setBadgeList(Collections.EMPTY_LIST);
});
}else latestTenTopics.forEach(top -> top.setBadgeList(Collections.EMPTY_LIST));
}
}
return new Result<List<ResiTopicIncludeIssueInfoResultDTO>>().ok(latestTenTopics);
}

44
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/TopicController.java

@ -0,0 +1,44 @@
package com.epmet.modules.person.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.resi.group.dto.topic.form.CustomerPageFormDTO;
import com.epmet.resi.group.dto.topic.result.ParticipatedTopicUnitResultDTO;
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @Description 个人中心-话题
* @ClassName TopicController
* @Auth wangc
* @Date 2020-11-12 14:33
*/
@RestController
@RequestMapping("topic")
public class TopicController {
@Autowired
private ResiGroupOpenFeignClient groupFeign;
/**
* @Description 个人中心-我参与过的话题
* @param param
* @return java.util.List<com.epmet.resi.group.dto.topic.result.ParticipatedTopicUnitResultDTO>
* @author wangc
* @date 2020.11.11 23:20
*/
@PostMapping("my-part-topics")
Result<List<ParticipatedTopicUnitResultDTO>> myPartTopics(@LoginUser TokenDto token , @RequestBody CustomerPageFormDTO param){
param.setUserId(token.getUserId());
ValidatorUtils.validateEntity(param);
return groupFeign.myPartTopics(param);
}
}

10
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceDTO.java

@ -53,6 +53,16 @@ public class UserAdviceDTO implements Serializable {
*/
private String agencyId;
/**
* 组织pids
*/
private String agencyPids;
/**
* 组织parent name
*/
private String agencyAllParentName;
/**
* 组织名
*/

10
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java

@ -53,6 +53,16 @@ public class UserAdviceEntity extends BaseEpmetEntity {
*/
private String agencyId;
/**
* 组织pids
*/
private String agencyPids;
/**
* 组织parent name
*/
private String agencyAllParentName;
/**
* 组织名
*/

6
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceExcel.java

@ -43,6 +43,12 @@ public class UserAdviceExcel {
@Excel(name = "组织ID")
private String agencyId;
@Excel(name = "组织PIDs")
private String agencyPids;
@Excel(name = "组织ParentName")
private String agencyAllParentName;
@Excel(name = "组织名")
private String agencyName;

17
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java

@ -202,6 +202,10 @@ public class UserAdviceServiceImpl extends BaseServiceImpl<UserAdviceDao, UserAd
AdviceDetailResultDTO adviceDetailResultDTO = new AdviceDetailResultDTO();
BeanUtils.copyProperties(userAdviceEntity, adviceDetailResultDTO);
adviceDetailResultDTO.setAdviceId(userAdviceEntity.getId());
//如果parentName不为空,拼接agencyName
if (StringUtils.isNotBlank(userAdviceEntity.getAgencyAllParentName())){
adviceDetailResultDTO.setAgencyName(userAdviceEntity.getAgencyAllParentName()+"-"+userAdviceEntity.getAgencyName());
}
//拼接建议类型
if (!"*".equals(userAdviceEntity.getAdviceType())) {
StringBuilder type = new StringBuilder();
@ -248,6 +252,8 @@ public class UserAdviceServiceImpl extends BaseServiceImpl<UserAdviceDao, UserAd
//wrapper
QueryWrapper<UserAdviceEntity> wrapper = new QueryWrapper<>();
//del_flag
wrapper.eq("DEL_FLAG","0");
//客户Id
wrapper.eq(StringUtils.isNotBlank(dto.getCustomerId()), "CUSTOMER_ID", dto.getCustomerId());
//是否回复
@ -258,14 +264,19 @@ public class UserAdviceServiceImpl extends BaseServiceImpl<UserAdviceDao, UserAd
wrapper.eq("REPLY_USER_ID", "");
wrapper.eq("REPLY_CONTENT", "");
}
// 组织id
wrapper.eq(StringUtils.isNotBlank(dto.getAgencyId()), "AGENCY_ID", dto.getAgencyId());
//建议类型
wrapper.like(StringUtils.isNotBlank(dto.getAdviceType()), "ADVICE_TYPE", dto.getAdviceType());
//开始时间
wrapper.ge(dto.getStartTime() != null, "CREATED_TIME", dto.getStartTime());
//结束时间
wrapper.le(dto.getEndTime() != null, "CREATED_TIME", dto.getEndTime());
// 组织id
if (StringUtils.isNotBlank(dto.getAgencyId())){
wrapper.and(wrapper1 ->wrapper1.eq("AGENCY_ID", dto.getAgencyId())
.or()
.like("AGENCY_PIDS", dto.getAgencyId()));
}
IPage<UserAdviceEntity> result = baseDao.selectPage(page, wrapper);
@ -341,6 +352,8 @@ public class UserAdviceServiceImpl extends BaseServiceImpl<UserAdviceDao, UserAd
Result<CustomerAgencyDTO> agencyById = govOrgOpenFeignClient.getAgencyById(gridInfoResultDTOResult.getData().getParentAgencyId());
if (agencyById.success()){
userAdviceDTO.setAgencyName(agencyById.getData().getAllParentName());
userAdviceDTO.setAgencyAllParentName(agencyById.getData().getAllParentName());
userAdviceDTO.setAgencyPids(agencyById.getData().getPids());
}else {
logger.error("agencyId:{},获取组织详情失败",gridInfoResultDTOResult.getData().getParentAgencyId());
}

2
epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.7__add_useradvice.sql

@ -3,6 +3,8 @@ CREATE TABLE `user_advice` (
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
`CUSTOMER_NAME` varchar(64) NOT NULL COMMENT '客户名',
`AGENCY_ID` varchar(64) NOT NULL COMMENT '组织ID',
`AGENCY_PIDS` varchar(1024) NOT NULL COMMENT '组织PIDs',
`AGENCY_ALL_PARENT_NAME` varchar(1024) COMMENT '组织parent name',
`AGENCY_NAME` varchar(64) NOT NULL COMMENT '组织名',
`GRID_ID` varchar(64) NOT NULL COMMENT '网格ID',
`GRID_NAME` varchar(64) NOT NULL COMMENT '网格名',

2
epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml

@ -8,6 +8,8 @@
<result property="customerId" column="CUSTOMER_ID"/>
<result property="customerName" column="CUSTOMER_NAME"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="agencyPids" column="AGENCY_PIDS"/>
<result property="agencyAllParentName" column="AGENCY_ALL_PARENT_NAME"/>
<result property="agencyName" column="AGENCY_NAME"/>
<result property="gridId" column="GRID_ID"/>
<result property="gridName" column="GRID_NAME"/>

Loading…
Cancel
Save