Commit e1c705fa by 阮思源

个人二维码

parent 0e6fe017
...@@ -14,6 +14,8 @@ import com.pcloud.wechatgroup.message.dto.GroupChatCountDTO; ...@@ -14,6 +14,8 @@ import com.pcloud.wechatgroup.message.dto.GroupChatCountDTO;
import com.pcloud.wechatgroup.message.service.MessageService; import com.pcloud.wechatgroup.message.service.MessageService;
import com.pcloud.wechatgroup.monitor.service.MonitorService; import com.pcloud.wechatgroup.monitor.service.MonitorService;
import com.pcloud.wechatgroup.selfrobot.dto.SelfRobotDTO;
import com.pcloud.wechatgroup.selfrobot.service.SelfRobotService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -35,6 +37,8 @@ public class WechatGroupConsr { ...@@ -35,6 +37,8 @@ public class WechatGroupConsr {
private MessageService messageService; private MessageService messageService;
@Autowired @Autowired
private MonitorService monitorService; private MonitorService monitorService;
@Autowired
private SelfRobotService selfRobotService;
/** /**
* 是否黑名单 * 是否黑名单
...@@ -267,4 +271,15 @@ public class WechatGroupConsr { ...@@ -267,4 +271,15 @@ public class WechatGroupConsr {
} }
return map; return map;
} }
@ParamLog(value = "获取可用机器人")
public SelfRobotDTO getAvailableRobot(Long wechatUserId, Integer largeTemplet, Long classifyId) {
SelfRobotDTO selfRobotDTO = null;
try {
selfRobotDTO = ResponseHandleUtil.parseResponse(selfRobotService.getAvailableRobot(wechatUserId, largeTemplet, classifyId), SelfRobotDTO.class);
} catch (Exception e) {
log.error("获取可用机器人.[getAvailableRobot]:" + e.getMessage(), e);
}
return selfRobotDTO;
}
} }
...@@ -18,6 +18,7 @@ import com.pcloud.book.consumer.resource.ProductConsr; ...@@ -18,6 +18,7 @@ import com.pcloud.book.consumer.resource.ProductConsr;
import com.pcloud.book.consumer.settlement.SettlementConsr; import com.pcloud.book.consumer.settlement.SettlementConsr;
import com.pcloud.book.consumer.trade.TradeConsr; import com.pcloud.book.consumer.trade.TradeConsr;
import com.pcloud.book.consumer.user.AdviserConsr; import com.pcloud.book.consumer.user.AdviserConsr;
import com.pcloud.book.consumer.wechatgroup.WechatGroupConsr;
import com.pcloud.book.group.biz.BookGroupBiz; import com.pcloud.book.group.biz.BookGroupBiz;
import com.pcloud.book.group.biz.BookGroupClassifyBiz; import com.pcloud.book.group.biz.BookGroupClassifyBiz;
import com.pcloud.book.group.dao.*; import com.pcloud.book.group.dao.*;
...@@ -67,6 +68,7 @@ import com.pcloud.settlementcenter.record.service.SettlementService; ...@@ -67,6 +68,7 @@ import com.pcloud.settlementcenter.record.service.SettlementService;
import com.pcloud.videolesson.schedule.service.ScheduleService; import com.pcloud.videolesson.schedule.service.ScheduleService;
import com.pcloud.wechatgroup.group.service.GroupMemberService; import com.pcloud.wechatgroup.group.service.GroupMemberService;
import com.pcloud.wechatgroup.selfrobot.dto.SelfRobotDTO;
import org.apache.commons.collections.MapUtils; import org.apache.commons.collections.MapUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -154,6 +156,8 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -154,6 +156,8 @@ public class BookGroupBizImpl implements BookGroupBiz {
private TempletRelevanceDao templetRelevanceDao; private TempletRelevanceDao templetRelevanceDao;
@Autowired @Autowired
private JoinGroupCipherDao joinGroupCipherDao; private JoinGroupCipherDao joinGroupCipherDao;
@Autowired
private WechatGroupConsr wechatGroupConsr;
@Override @Override
...@@ -1058,9 +1062,11 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -1058,9 +1062,11 @@ public class BookGroupBizImpl implements BookGroupBiz {
return bookGroupDao.getIsShowBookName(partyId); return bookGroupDao.getIsShowBookName(partyId);
} }
@Transactional(rollbackFor = Exception.class)
@ParamLog("根据分类id获取个人二维码信息") @ParamLog("根据分类id获取个人二维码信息")
@Override @Override
public OwnAltQrcodeInfoDTO getOwnAltQrcodeInfoDTOByClassifyId(Long wechatUserId, Long classifyId) { public OwnAltQrcodeInfoDTO getOwnAltQrcodeInfoDTOByClassifyId(Long wechatUserId, Long classifyId) {
OwnAltQrcodeInfoDTO ownAltQrcodeInfoDTO = new OwnAltQrcodeInfoDTO();
//根据分类id查询社群码信息 //根据分类id查询社群码信息
ClassifyDTO classifyDTO = bookGroupClassifyDao.getById(classifyId); ClassifyDTO classifyDTO = bookGroupClassifyDao.getById(classifyId);
if (classifyDTO == null) { if (classifyDTO == null) {
...@@ -1077,10 +1083,18 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -1077,10 +1083,18 @@ public class BookGroupBizImpl implements BookGroupBiz {
TempletRelevance templetRelevance = templetRelevanceDao.getByTempletId(templetId); TempletRelevance templetRelevance = templetRelevanceDao.getByTempletId(templetId);
LOGGER.info("根据分类id获取大类templetRelevance" + templetRelevance.toString()); LOGGER.info("根据分类id获取大类templetRelevance" + templetRelevance.toString());
Integer largeTemplet = templetRelevance.getLargeTemplet(); Integer largeTemplet = templetRelevance.getLargeTemplet();
//TODO 调内部接口获取分配的小号信息 SelfRobotDTO selfRobotDTO = wechatGroupConsr.getAvailableRobot(wechatUserId, largeTemplet, classifyId);
if (selfRobotDTO == null) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "未找到机器人!");
}
ownAltQrcodeInfoDTO.setAltHeadUrl(selfRobotDTO.getHeadPic());
ownAltQrcodeInfoDTO.setAltId(selfRobotDTO.getWxId());
ownAltQrcodeInfoDTO.setAltNickName(selfRobotDTO.getNickName());
ownAltQrcodeInfoDTO.setAltQrcodeUrl(selfRobotDTO.getQrcodeUrl());
ownAltQrcodeInfoDTO.setAltHeadUrl(selfRobotDTO.getHeadPic());
//获取之前是否有没有使用的暗号 //获取之前是否有没有使用的暗号
JoinGroupCipher joinGroupCipher = joinGroupCipherDao.getByCreateUser(wechatUserId, classifyId); JoinGroupCipher joinGroupCipher = joinGroupCipherDao.getByCreateUser(wechatUserId, classifyId);
String cipher = ""; String cipher;
if (joinGroupCipher != null) { if (joinGroupCipher != null) {
cipher = joinGroupCipher.getCipher(); cipher = joinGroupCipher.getCipher();
} else { } else {
...@@ -1092,11 +1106,7 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -1092,11 +1106,7 @@ public class BookGroupBizImpl implements BookGroupBiz {
joinGroupCipherNew.setClassifyId(classifyId); joinGroupCipherNew.setClassifyId(classifyId);
joinGroupCipherDao.insert(joinGroupCipherNew); joinGroupCipherDao.insert(joinGroupCipherNew);
} }
OwnAltQrcodeInfoDTO ownAltQrcodeInfoDTO=new OwnAltQrcodeInfoDTO();
ownAltQrcodeInfoDTO.setCipher(cipher); ownAltQrcodeInfoDTO.setCipher(cipher);
//TODO 填充小号信息等
return ownAltQrcodeInfoDTO; return ownAltQrcodeInfoDTO;
} }
...@@ -1121,6 +1131,7 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -1121,6 +1131,7 @@ public class BookGroupBizImpl implements BookGroupBiz {
return state; return state;
} }
@Transactional(rollbackFor = Exception.class)
@ParamLog("获取暗号状态为已使用") @ParamLog("获取暗号状态为已使用")
@Override @Override
public void updateCipherStateToUsed(String cipher, String wxId) { public void updateCipherStateToUsed(String cipher, String wxId) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment