Browse Source

Merge branch 'dev_group_point' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev_temp

master
jianjun 4 years ago
parent
commit
60e07813d1
  1. 21
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/UniqueIdGenerator.java
  2. 26
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java
  3. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupServiceImpl.java
  4. 2
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/send/SendMqMsgUtil.java
  5. 3
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/AbstractStatsAchievementService.java
  6. 19
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java
  7. 34
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/StatsAchievementServiceImpl.java
  8. 21
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java
  9. 41
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java
  10. 22
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java
  11. 54
      epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.18__groupAchievement.sql

21
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/UniqueIdGenerator.java

@ -11,6 +11,8 @@ import java.util.concurrent.atomic.AtomicLong;
* 唯一ID生成器
*/
public class UniqueIdGenerator {
public final static String FORMAT_DMDHS = "yyyyMMddHHmmss";
private static UniqueValue uniqueValue = new UniqueValue();
private static String middle;
@ -25,7 +27,7 @@ public class UniqueIdGenerator {
private static class UniqueValue {
private AtomicLong uniqueValue = new AtomicLong(0L);
private volatile String currentTime = DateUtils.format(new Date(), DateUtils.DATE_TIME_NO_SPLIT);
private volatile String currentTime = DateUtils.format(new Date(), FORMAT_DMDHS);
private volatile String lastTime = currentTime;
/**
@ -35,7 +37,7 @@ public class UniqueIdGenerator {
* @return
*/
public String getCurrentTime() {
currentTime = DateUtils.format(new Date(), DateUtils.DATE_TIME_NO_SPLIT);
currentTime = DateUtils.format(new Date(), FORMAT_DMDHS);
if (!currentTime.equals(lastTime)) {
lastTime = currentTime;
Random random = new Random();
@ -51,31 +53,32 @@ public class UniqueIdGenerator {
/**
* 生成一个24位唯一ID
* 15位时间+2位中间值防止多服务冲突+2个线程code+5位秒级递增值
* 14位时间+2位中间值防止多服务冲突+3个线程code+5位秒级递增值
*
* @return
*/
public static String generate() {
public static String generate24() {
StringBuilder builder = new StringBuilder(32);
builder.append(uniqueValue.getCurrentTime())
.append(middle)
.append(getUniqueThreadCode())
.append(getUniqueThreadCode(3))
.append(uniqueValue.getCurrentValue());
return builder.toString();
}
public static String getUniqueThreadCode() {
String threadCode = StringUtils.left(String.valueOf(Thread.currentThread().hashCode()), 2);
return StringUtils.leftPad(threadCode, 2, "0");
public static String getUniqueThreadCode(Integer length) {
String threadCode = StringUtils.left(String.valueOf(Thread.currentThread().hashCode()), length);
return StringUtils.leftPad(threadCode, length, "0");
}
public static void main(String[] args) throws InterruptedException {
System.out.println(UniqueIdGenerator.uniqueValue.currentTime);
System.out.println(UniqueIdGenerator.middle);
System.out.println(UniqueIdGenerator.getUniqueThreadCode());
System.out.println(UniqueIdGenerator.getUniqueThreadCode(2));
System.out.println(uniqueValue.getCurrentValue());
System.out.println(UniqueIdGenerator.generate24());
}
}

26
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java

@ -157,7 +157,7 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
group1 = new IndexGroupTemplateEntity();
group1.setIndexId(indexDictEntity.getId());
group1.setParentIndexGroupId("0");
group1.setId(UniqueIdGenerator.generate());
group1.setId(UniqueIdGenerator.generate24());
group1.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(), true, 4));
group1.setAllIndexCodePath(index.getAllIndexCodePath(0));
indexGroupMap.put(index.getLevel1Index(), group1);
@ -173,7 +173,7 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
group2 = new IndexGroupTemplateEntity();
group2.setIndexId(indexDictEntity.getId());
group2.setParentIndexGroupId(group1.getId());
group2.setId(UniqueIdGenerator.generate());
group2.setId(UniqueIdGenerator.generate24());
group2.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(), false, 4));
group2.setAllIndexCodePath(index.getAllIndexCodePath(3));
indexGroupMap.put(level4IndexDetailKey, group2);
@ -184,7 +184,7 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
templateEntity.setIndexGroupId(group1.getId());
templateEntity.setIndexId(indexDictEntity.getId());
templateEntity.setAllParentIndexCode(allIndexCodeSb.toString());
templateEntity.setId(UniqueIdGenerator.generate());
templateEntity.setId(UniqueIdGenerator.generate24());
templateEntity.setCorrelation(index.getCorrelation());
templateEntity.setAllIndexCodePath(index.getAllIndexCodePath(3));
buildIndexGroupDetail(templateEntity, indexDictEntity, index, 2);
@ -202,7 +202,7 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
templateEntity.setIndexGroupId(group2.getId());
templateEntity.setIndexId(indexDictEntity.getId());
templateEntity.setAllParentIndexCode(allIndexCodeSb.toString());
templateEntity.setId(UniqueIdGenerator.generate());
templateEntity.setId(UniqueIdGenerator.generate24());
templateEntity.setCorrelation(index.getCorrelation());
templateEntity.setAllIndexCodePath(index.getAllIndexCodePath(4));
buildIndexGroupDetail(templateEntity, indexDictEntity, index, 5);
@ -217,7 +217,7 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
group1 = new IndexGroupTemplateEntity();
group1.setIndexId(indexDictEntity.getId());
group1.setParentIndexGroupId("0");
group1.setId(UniqueIdGenerator.generate());
group1.setId(UniqueIdGenerator.generate24());
group1.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(), false, 4));
group1.setAllIndexCodePath(index.getAllIndexCodePath(0));
indexGroupMap.put(index.getLevel1Index(), group1);
@ -232,7 +232,7 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
group2 = new IndexGroupTemplateEntity();
group2.setIndexId(indexDictEntity.getId());
group2.setParentIndexGroupId(group1.getId());
group2.setId(UniqueIdGenerator.generate());
group2.setId(UniqueIdGenerator.generate24());
group2.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(), false, 4));
group2.setAllIndexCodePath(index.getAllIndexCodePath(1));
indexGroupMap.put(level2IndexGroupKey, group2);
@ -243,7 +243,7 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
templateEntity.setIndexGroupId(group2.getId());
templateEntity.setIndexId(indexDictEntity.getId());
templateEntity.setAllParentIndexCode(allIndexCodeSb.toString());
templateEntity.setId(UniqueIdGenerator.generate());
templateEntity.setId(UniqueIdGenerator.generate24());
templateEntity.setCorrelation(index.getCorrelation());
templateEntity.setAllIndexCodePath(index.getAllIndexCodePath(1));
buildIndexGroupDetail(templateEntity, indexDictEntity, index, 2);
@ -260,7 +260,7 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
templateEntity.setIndexGroupId(group2.getId());
templateEntity.setIndexId(indexDictEntity.getId());
templateEntity.setAllParentIndexCode(allIndexCodeSb.toString());
templateEntity.setId(UniqueIdGenerator.generate());
templateEntity.setId(UniqueIdGenerator.generate24());
templateEntity.setCorrelation(index.getCorrelation());
templateEntity.setAllIndexCodePath(index.getAllIndexCodePath(4));
buildIndexGroupDetail(templateEntity, indexDictEntity, index, 5);
@ -289,7 +289,7 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
private void buildIndexDicEntity(IndexModel data, IndexDictEntity entity, IndexDictEntity entity2, IndexDictEntity entity3, IndexDictEntity entity4, IndexDictEntity entity5) {
if (!indexDicMap.containsKey(data.getLevel1Index())) {
entity.setId(UniqueIdGenerator.generate());
entity.setId(UniqueIdGenerator.generate24());
entity.setIndexName(data.getLevel1Index());
entity.setCorrelation(data.getCorrelation());
entity.setLevel("1");
@ -297,7 +297,7 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
indexDicMap.put(data.getLevel1Index(), entity);
}
if (!indexDicMap.containsKey(data.getLevel2Index())) {
entity2.setId(UniqueIdGenerator.generate());
entity2.setId(UniqueIdGenerator.generate24());
entity2.setIndexName(data.getLevel2Index());
entity2.setCorrelation(data.getCorrelation());
entity2.setLevel("2");
@ -305,7 +305,7 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
indexDicMap.put(data.getLevel2Index(), entity2);
}
if (!indexDicMap.containsKey(data.getLevel3Index())) {
entity3.setId(UniqueIdGenerator.generate());
entity3.setId(UniqueIdGenerator.generate24());
entity3.setIndexName(data.getLevel3Index());
entity3.setCorrelation(data.getCorrelation());
entity3.setLevel("3");
@ -313,7 +313,7 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
indexDicMap.put(data.getLevel3Index(), entity3);
}
if (!indexDicMap.containsKey(data.getLevel4Index())) {
entity4.setId(UniqueIdGenerator.generate());
entity4.setId(UniqueIdGenerator.generate24());
entity4.setIndexName(data.getLevel4Index());
entity4.setCorrelation(data.getCorrelation());
entity4.setLevel("4");
@ -321,7 +321,7 @@ public class IndexExcelDataListener extends AnalysisEventListener<IndexModel> {
indexDicMap.put(data.getLevel4Index(), entity4);
}
if (!indexDicMap.containsKey(data.getLevel5Index())) {
entity5.setId(UniqueIdGenerator.generate());
entity5.setId(UniqueIdGenerator.generate24());
entity5.setIndexName(data.getLevel5Index());
entity5.setCorrelation(data.getCorrelation());
entity5.setLevel("5");

6
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupServiceImpl.java

@ -80,7 +80,7 @@ private IndexGroupTemplateDao indexGroupTemplateDao;
List<IndexGroupEntity> insertGroupList = new ArrayList<>();
groupMap.forEach((oldGroupTempId, o) -> {
IndexGroupEntity newGroupEntity = ConvertUtils.sourceToTarget(o, IndexGroupEntity.class);
String newGroupId = UniqueIdGenerator.generate();
String newGroupId = UniqueIdGenerator.generate24();
newGroupEntity.setId(newGroupId);
newGroupEntity.setCustomerId(customerId);
groupNewIdMap.put(oldGroupTempId, newGroupId);
@ -99,7 +99,7 @@ private IndexGroupTemplateDao indexGroupTemplateDao;
IndexGroupDetailEntity entity = ConvertUtils.sourceToTarget(groupDetailTemp, IndexGroupDetailEntity.class);
entity.setId(UniqueIdGenerator.generate());
entity.setId(UniqueIdGenerator.generate24());
String newGroupId = groupNewIdMap.get(oldIndexGroupId);
if (StringUtils.isBlank(newGroupId)){
log.error("新旧id映射关系有误");
@ -134,4 +134,4 @@ private IndexGroupTemplateDao indexGroupTemplateDao;
});*/
return true;
}
}
}

2
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/send/SendMqMsgUtil.java

@ -50,7 +50,7 @@ public class SendMqMsgUtil {
systemMsgFormDTO.setMessageType(SystemMessageType.GROUP_ACHIEVEMENT);
systemMsgFormDTO.setContent(msgContent);
Result sendMsgResult = null;
int retryTime = 1;
int retryTime = 0;
do {
sendMsgResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(systemMsgFormDTO);
} while ((sendMsgResult == null || !sendMsgResult.success()) && retryTime++ < NumConstant.TWO);

3
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/AbstractStatsAchievementService.java

@ -21,6 +21,7 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.UniqueIdGenerator;
import com.epmet.modules.enums.AchievementTypeEnum;
import com.epmet.modules.group.entity.ResiGroupAchievementConfigEntity;
import com.epmet.modules.group.entity.ResiGroupAchievementStatsEntity;
@ -83,6 +84,8 @@ public abstract class AbstractStatsAchievementService {
for (int i = 0; i < 5; i++) {
nextTargetValue = GroupAchievementUtils.getNextTargetValue(achievementType, preValue);
ResiGroupAchievementConfigEntity next = new ResiGroupAchievementConfigEntity();
//生成ID 自增
next.setId(UniqueIdGenerator.generate24());
next.setCustomerId(lastOne.getCustomerId());
next.setAchievementName(oldName.replace(StrConstant.UNDER_LINE, String.valueOf(nextTargetValue)));
preValue = nextTargetValue;

19
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java

@ -686,11 +686,20 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
epmetMessageOpenFeignClient.sendWxSubscribeMessage(msgList);
//发送小组成就消息
boolean flag = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient)
.sendGroupAchievementMqMsg(new GroupAchievementMQMsg(resiGroupDTO.getCustomerId(),resiGroupDTO.getId(),AchievementTypeEnum.MEMBER.getCode()));
if (!flag) {
logger.error("发送(小组成就)系统消息到message服务失败");
}
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() {
@Override
public void afterCommit() {
try {
boolean flag = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient)
.sendGroupAchievementMqMsg(new GroupAchievementMQMsg(resiGroupDTO.getCustomerId(), resiGroupDTO.getId(), AchievementTypeEnum.MEMBER.getCode()));
if (!flag) {
logger.error("发送(小组成就)系统消息到message服务失败");
}
}catch (Exception e){
logger.error("afterCommit",e);
}
}
});
return new Result();
}

34
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/StatsAchievementServiceImpl.java

@ -54,24 +54,24 @@ public class StatsAchievementServiceImpl extends AbstractStatsAchievementService
@Override
public Boolean initAllGroupAchievement(String customerId) {
//计算所有类型的 小组人数、话题数、转议题数、小组内问题解决数
QueryWrapper<ResiGroupEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(ResiGroupEntity::getDelFlag,'0');
if (StringUtils.isNotBlank(customerId)){
queryWrapper.lambda().eq(ResiGroupEntity::getCustomerId,customerId);
}
List<ResiGroupEntity> groupEntities = resiGroupDao.selectList(queryWrapper);
groupEntities.forEach(group->{
AchievementTypeEnum[] achievementTypeEnum = AchievementTypeEnum.values();
for (AchievementTypeEnum anEnum : achievementTypeEnum) {
try {
Thread.sleep(2);
} catch (InterruptedException e) {
e.printStackTrace();
}
calculateAcm(group.getCustomerId(),group.getId(),anEnum.getCode());
//计算所有类型的 小组人数、话题数、转议题数、小组内问题解决数
QueryWrapper<ResiGroupEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(ResiGroupEntity::getDelFlag, '0');
if (StringUtils.isNotBlank(customerId)) {
queryWrapper.lambda().eq(ResiGroupEntity::getCustomerId, customerId);
}
List<ResiGroupEntity> groupEntities = resiGroupDao.selectList(queryWrapper);
groupEntities.forEach(group -> {
AchievementTypeEnum[] achievementTypeEnum = AchievementTypeEnum.values();
for (AchievementTypeEnum anEnum : achievementTypeEnum) {
try {
Thread.sleep(2);
} catch (InterruptedException e) {
e.printStackTrace();
}
});
calculateAcm(group.getCustomerId(), group.getId(), anEnum.getCode());
}
});
return true;
}

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

@ -86,6 +86,8 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.TransactionSynchronizationAdapter;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.util.CollectionUtils;
import java.text.DateFormat;
@ -691,11 +693,20 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl<ResiGroupMemberD
List<WxSubscribeMessageFormDTO> msgList = new ArrayList<>();
msgList.add(wxSubscribeMessageFormDTO);
epmetMessageOpenFeignClient.sendWxSubscribeMessage(msgList);
//发送小组成就消息
boolean flag = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendGroupAchievementMqMsg(new GroupAchievementMQMsg(resiGroupMemberDTO.getCustomerId(), resiGroupMemberDTO.getResiGroupId(), AchievementTypeEnum.MEMBER.getCode()));
if (!flag) {
logger.error("发送(小组成就)系统消息到message服务失败");
}
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() {
@Override
public void afterCommit() {
try {
//发送小组成就消息
boolean flag = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendGroupAchievementMqMsg(new GroupAchievementMQMsg(resiGroupMemberDTO.getCustomerId(), resiGroupMemberDTO.getResiGroupId(), AchievementTypeEnum.MEMBER.getCode()));
if (!flag) {
logger.error("发送(小组成就)系统消息到message服务失败");
}
}catch (Exception e){
logger.error("afterCommit",e);
}
}
});
}
/**

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

@ -116,6 +116,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.TransactionSynchronizationAdapter;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.util.CollectionUtils;
import javax.validation.constraints.NotBlank;
@ -805,10 +807,19 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
log.error("组长解决话题事件发送失败,参数:{}",JSON.toJSONString(closeFormDTO));
}
//发送小组成就消息
boolean flag = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendGroupAchievementMqMsg(new GroupAchievementMQMsg(topic.getCustomerId(), topic.getGroupId(), AchievementTypeEnum.RESOVLE_TOPIC.getCode()));
if (!flag) {
log.error("发送(小组成就)系统消息到message服务失败");
}
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() {
@Override
public void afterCommit() {
try {
boolean flag = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendGroupAchievementMqMsg(new GroupAchievementMQMsg(topic.getCustomerId(), topic.getGroupId(), AchievementTypeEnum.RESOVLE_TOPIC.getCode()));
if (!flag) {
log.error("发送(小组成就)系统消息到message服务失败");
}
}catch (Exception e){
logger.error("afterCommit",e);
}
}
});
}
//2021.4.22 start sun 因业务调整,新增组内消息记录表,话题状态变化时相应的修改数据状态
@ -1798,6 +1809,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
pointEventMsg2.setActionFlag(MqConstant.PLUS);
pointEventMsg2.setIsCommon(false);
pointEventMsg2.setEventTag(EventEnum.SHIFT_TOPIC_TO_ISSUE.getEventTag());
pointEventMsg2.setEventClass(EventEnum.SHIFT_TOPIC_TO_ISSUE.getEventClass());
//将话题“某某某…” (前十个字后面省略号) 转为议题
pointEventMsg2.setRemark(new StringBuilder("将")
.append(
@ -1812,12 +1824,20 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
log.error("话题转议题事件发送失败,参数:{}",JSON.toJSONString(topicTurnIssueFromDTO));
}
//发送小组成就消息
boolean flag = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendGroupAchievementMqMsg(new GroupAchievementMQMsg(group.getCustomerId(), group.getGroupId(), AchievementTypeEnum.TOISSUE.getCode()));
if (!flag) {
log.error("发送(小组成就)系统消息到message服务失败");
}
}
else {
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() {
@Override
public void afterCommit() {
try {
boolean flag = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendGroupAchievementMqMsg(new GroupAchievementMQMsg(group.getCustomerId(), group.getGroupId(), AchievementTypeEnum.TOISSUE.getCode()));
if (!flag) {
log.error("发送(小组成就)系统消息到message服务失败");
}
}catch (Exception e){
logger.error("afterCommit",e);
}
}
});
} else {
ValidatorUtils.validateEntity(result, FirstTopicShiftedToIssueApplicationResultDTO.AllowAuditionGroup.class);
}
@ -1964,6 +1984,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
pointEventMsg2.setActionFlag(MqConstant.PLUS);
pointEventMsg2.setIsCommon(false);
pointEventMsg2.setEventTag(EventEnum.SHIFT_TOPIC_TO_ISSUE.getEventTag());
pointEventMsg2.setEventClass(EventEnum.SHIFT_TOPIC_TO_ISSUE.getEventClass());
//将话题“某某某…” (前十个字后面省略号) 转为议题
pointEventMsg2.setRemark(new StringBuilder("将")
.append(

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

@ -92,6 +92,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.TransactionSynchronizationAdapter;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import java.text.SimpleDateFormat;
import java.util.*;
@ -1001,11 +1003,21 @@ public class TopicDraftServiceImpl extends BaseServiceImpl<TopicDraftDao, TopicD
}
//发送小组成就消息
boolean flag = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient)
.sendGroupAchievementMqMsg(new GroupAchievementMQMsg(customerId,groupId,AchievementTypeEnum.TOPIC.getCode()));
if (!flag) {
log.error("发送(小组成就)系统消息到message服务失败");
}
//发送小组成就消息
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() {
@Override
public void afterCommit() {
try {
boolean flag = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient)
.sendGroupAchievementMqMsg(new GroupAchievementMQMsg(customerId,groupId,AchievementTypeEnum.TOPIC.getCode()));
if (!flag) {
log.error("发送(小组成就)系统消息到message服务失败");
}
}catch (Exception e){
logger.error("afterCommit",e);
}
}
});
}

54
epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.18__groupAchievement.sql

@ -34,4 +34,56 @@ CREATE TABLE `resi_group_achievement_stats` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='小组成就统计表';
ALTER TABLE `resi_group`
ADD COLUMN `LEVEL` int(11) DEFAULT '1' COMMENT '小组等级' AFTER `GROUP_TYPE`;
ADD COLUMN `LEVEL` int(11) DEFAULT '1' COMMENT '小组等级' AFTER `GROUP_TYPE`;
-- ----------------------------
-- Records of resi_group_achievement_config
-- ----------------------------
BEGIN;
INSERT INTO `resi_group_achievement_config` VALUES ('202104261402388211700001', 'default', '组内第1名成员加入', 1, 'member', '0', 0, 'APP_USER', '2021-04-19 16:19:49', 'APP_USER', '2021-04-19 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261402388211700002', 'default', '组内成员达到3人', 3, 'member', '0', 0, 'APP_USER', '2021-04-19 16:19:49', 'APP_USER', '2021-04-19 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261402388211700003', 'default', '组内成员达到10人', 10, 'member', '0', 0, 'APP_USER', '2021-04-19 16:19:49', 'APP_USER', '2021-04-19 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261402388211700004', 'default', '组内成员达到20人', 20, 'member', '0', 0, 'APP_USER', '2021-04-19 16:19:49', 'APP_USER', '2021-04-19 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261402388211700005', 'default', '组内成员达到50人', 50, 'member', '0', 0, 'APP_USER', '2021-04-19 16:19:49', 'APP_USER', '2021-04-19 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261402388211700006', 'default', '组内成员达到100人', 100, 'member', '0', 0, 'APP_USER', '2021-04-19 16:19:49', 'APP_USER', '2021-04-19 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261402388211700007', 'default', '组内成员达到200人', 200, 'member', '0', 0, 'APP_USER', '2021-04-19 16:19:49', 'APP_USER', '2021-04-19 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261402388211700008', 'default', '组内成员达到500人', 500, 'member', '0', 0, 'APP_USER', '2021-04-19 16:19:49', 'APP_USER', '2021-04-19 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261402388211700009', 'default', '组内成员达到1000人', 1000, 'member', '0', 0, 'APP_USER', '2021-04-19 16:19:49', 'APP_USER', '2021-04-19 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261402388211700010', 'default', '组内成员达到2000人', 2000, 'member', '0', 0, 'APP_USER', '2021-04-19 16:19:49', 'APP_USER', '2021-04-19 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261402388211700011', 'default', '组内成员达到5000人', 5000, 'member', '0', 0, 'APP_USER', '2021-04-19 16:19:49', 'APP_USER', '2021-04-19 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261402388211700012', 'default', '组内成员达到10000人', 10000, 'member', '0', 0, 'APP_USER', '2021-04-19 16:19:49', 'APP_USER', '2021-04-19 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261403464411700001', 'default', '组内第1条话题诞生', 1, 'topic', '0', 0, 'APP_USER', '2021-04-20 16:19:49', 'APP_USER', '2021-04-20 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261403464411700002', 'default', '组内发布话题数3条', 3, 'topic', '0', 0, 'APP_USER', '2021-04-20 16:19:49', 'APP_USER', '2021-04-20 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261403464411700003', 'default', '组内发布话题数5条', 5, 'topic', '0', 0, 'APP_USER', '2021-04-20 16:19:49', 'APP_USER', '2021-04-20 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261403464411700004', 'default', '组内发布话题数10条', 10, 'topic', '0', 0, 'APP_USER', '2021-04-20 16:19:49', 'APP_USER', '2021-04-20 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261403464411700005', 'default', '组内发布话题数20条', 20, 'topic', '0', 0, 'APP_USER', '2021-04-20 16:19:49', 'APP_USER', '2021-04-20 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261403464411700006', 'default', '组内发布话题数50条', 50, 'topic', '0', 0, 'APP_USER', '2021-04-20 16:19:49', 'APP_USER', '2021-04-20 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261403464411700007', 'default', '组内发布话题数100条', 100, 'topic', '0', 0, 'APP_USER', '2021-04-20 16:19:49', 'APP_USER', '2021-04-20 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261403464411700008', 'default', '组内发布话题数200条', 200, 'topic', '0', 0, 'APP_USER', '2021-04-20 16:19:49', 'APP_USER', '2021-04-20 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261403464411700009', 'default', '组内发布话题数500条', 500, 'topic', '0', 0, 'APP_USER', '2021-04-20 16:19:49', 'APP_USER', '2021-04-20 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261403464411700010', 'default', '组内发布话题数1000条', 1000, 'topic', '0', 0, 'APP_USER', '2021-04-20 16:19:49', 'APP_USER', '2021-04-20 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261403464411700011', 'default', '组内发布话题数1500条', 1500, 'topic', '0', 0, 'APP_USER', '2021-04-20 16:19:49', 'APP_USER', '2021-04-20 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261403464411700012', 'default', '组内发布话题数2000条', 2000, 'topic', '0', 0, 'APP_USER', '2021-04-20 16:19:49', 'APP_USER', '2021-04-20 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261403464411700013', 'default', '组内发布话题数2500条', 2500, 'topic', '0', 0, 'APP_USER', '2021-04-20 16:19:49', 'APP_USER', '2021-04-20 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261403464411700014', 'default', '组内发布话题数3000条', 3000, 'topic', '0', 0, 'APP_USER', '2021-04-20 16:19:49', 'APP_USER', '2021-04-20 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261404210411700001', 'default', '组内第1次话题转议题', 1, 'toissue', '0', 0, 'APP_USER', '2021-04-20 16:19:49', 'APP_USER', '2021-04-20 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261404210411700002', 'default', '组内话题转议题数3条', 3, 'toissue', '0', 0, 'APP_USER', '2021-04-20 16:19:49', 'APP_USER', '2021-04-20 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261404210411700003', 'default', '组内话题转议题数5条', 5, 'toissue', '0', 0, 'APP_USER', '2021-04-20 16:19:49', 'APP_USER', '2021-04-20 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261404210411700004', 'default', '组内话题转议题数10条', 10, 'toissue', '0', 0, 'APP_USER', '2021-04-20 16:19:49', 'APP_USER', '2021-04-20 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261404210411700005', 'default', '组内话题转议题数20条', 20, 'toissue', '0', 0, 'APP_USER', '2021-04-20 16:19:49', 'APP_USER', '2021-04-20 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261404210411700006', 'default', '组内话题转议题数50条', 50, 'toissue', '0', 0, 'APP_USER', '2021-04-20 16:19:49', 'APP_USER', '2021-04-20 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261404210411700007', 'default', '组内话题转议题数100条', 100, 'toissue', '0', 0, 'APP_USER', '2021-04-20 16:19:49', 'APP_USER', '2021-04-20 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261404210411700008', 'default', '组内话题转议题数150条', 150, 'toissue', '0', 0, 'APP_USER', '2021-04-20 16:19:49', 'APP_USER', '2021-04-20 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261404210411700009', 'default', '组内话题转议题数200条', 200, 'toissue', '0', 0, 'APP_USER', '2021-04-20 16:19:49', 'APP_USER', '2021-04-20 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261404543611700001', 'default', '组内话题第1次被解决', 1, 'resovletopic', '0', 0, 'APP_USER', '2021-04-20 16:19:49', 'APP_USER', '2021-04-20 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261404543611700002', 'default', '组内话题解决数3条', 3, 'resovletopic', '0', 0, 'APP_USER', '2021-04-20 16:19:49', 'APP_USER', '2021-04-20 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261404543611700003', 'default', '组内话题解决数5条', 5, 'resovletopic', '0', 0, 'APP_USER', '2021-04-20 16:19:49', 'APP_USER', '2021-04-20 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261404543611700004', 'default', '组内话题解决数10条', 10, 'resovletopic', '0', 0, 'APP_USER', '2021-04-20 16:19:49', 'APP_USER', '2021-04-20 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261404543611700005', 'default', '组内话题解决数30条', 30, 'resovletopic', '0', 0, 'APP_USER', '2021-04-20 16:19:49', 'APP_USER', '2021-04-20 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261404543611700006', 'default', '组内话题解决数50条', 50, 'resovletopic', '0', 0, 'APP_USER', '2021-04-20 16:19:49', 'APP_USER', '2021-04-20 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261404543611700007', 'default', '组内话题解决数100条', 100, 'resovletopic', '0', 0, 'APP_USER', '2021-04-20 16:19:49', 'APP_USER', '2021-04-20 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261404543611700008', 'default', '组内话题解决数200条', 200, 'resovletopic', '0', 0, 'APP_USER', '2021-04-20 16:19:49', 'APP_USER', '2021-04-20 16:19:52');
INSERT INTO `resi_group_achievement_config` VALUES ('202104261404543611700009', 'default', '组内话题解决数300条', 300, 'resovletopic', '0', 0, 'APP_USER', '2021-04-20 16:19:49', 'APP_USER', '2021-04-20 16:19:52');
COMMIT;
SET FOREIGN_KEY_CHECKS = 1;

Loading…
Cancel
Save