Commit f8d93dc0 by 裴大威

Merge branch 'opti-confirm' into 'master'

优化接口

See merge request rays/pcloud-book!562
parents d40fb232 39afffcf
......@@ -157,7 +157,7 @@ public class SelfRobotKeywordBizImpl implements SelfRobotKeywordBiz {
@Autowired
private PcloudSkillRecordDao pcloudSkillRecordDao;
private static final ExecutorService EXECUTOR_SERVICE = Executors.newFixedThreadPool(5);
private static final ExecutorService EXECUTOR_SERVICE = Executors.newFixedThreadPool(2);
......@@ -764,31 +764,32 @@ wechatGroupConsr.sendMessage(JSON.toJSONString(sendFileVO));
if (null != pcloudSkill){
skillFuseReply = pcloudSkill.getSkillFuseReply();
}
if (SkillTypeEnum.TIME_MANAGE.value == type){
//读书计划 确认某个读书计划
if (null == state){
taskSubscribeBiz.subscribeTask(wxUserId,null,relSkillId,robotId);
}else {
if (SubTypeEnum.SUCCESS.value == state){
final Integer finalState = state;
EXECUTOR_SERVICE.execute(() ->{
if (SkillTypeEnum.TIME_MANAGE.value == type){
//读书计划 确认某个读书计划
if (null == finalState){
taskSubscribeBiz.subscribeTask(wxUserId,null,relSkillId,robotId);
}else if (SubTypeEnum.CANCEL.value == state){
taskSubscribeBiz.unSubscribeTask(wxUserId,null,relSkillId);
}else {
if (SubTypeEnum.SUCCESS.value == finalState){
taskSubscribeBiz.subscribeTask(wxUserId,null,relSkillId,robotId);
}else if (SubTypeEnum.CANCEL.value == finalState){
taskSubscribeBiz.unSubscribeTask(wxUserId,null,relSkillId);
}
}
}else if (SkillTypeEnum.READING.value == type){
pcloudGroupActivityBiz.processGroup(wxUserId,robotId,Long.valueOf(relSkillId.toString()));
pcloudSkillBiz.sendResource(id,wxUserId,robotId,relSkillId);
}else if (SkillTypeEnum.RESOURCE.value == type){
pcloudSkillBiz.sendResource(id,wxUserId,robotId,relSkillId);
}
}else if (SkillTypeEnum.READING.value == type){
pcloudGroupActivityBiz.processGroup(wxUserId,robotId,Long.valueOf(relSkillId.toString()));
pcloudSkillBiz.sendResource(id,wxUserId,robotId,relSkillId);
}else if (SkillTypeEnum.RESOURCE.value == type){
pcloudSkillBiz.sendResource(id,wxUserId,robotId,relSkillId);
}
//修改pcloud_skill_record 状态值
if (SkillTypeEnum.READING.value == type || SkillTypeEnum.RESOURCE.value == type){
state = SubTypeEnum.SUCCESS.value;
pcloudSkillRecordDao.updateState4ResourceAndActivity(wxUserId,robotId,id,state);
}
if (SkillTypeEnum.READING.value == type || SkillTypeEnum.RESOURCE.value == type){
pcloudSkillRecordDao.updateState4ResourceAndActivity(wxUserId,robotId,id,SubTypeEnum.SUCCESS.value);
}
//修改pcloud_sub_remind 未订阅提醒表状态
pcloudSubRemindBiz.updateSubState(relSkillId,type,wxUserId,id);
pcloudSubRemindBiz.updateSubState(relSkillId,type,wxUserId,id);
});
return skillFuseReply;
}
......
......@@ -305,13 +305,11 @@ public class PcloudSkillBizImpl implements PcloudSkillBiz {
if(skill == null) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "技能不存在,订阅失败!");
}
ThreadPoolUtils.OTHER_THREAD_POOL.execute(() -> {
// 发送订阅回复信息
List<PcloudSubReply> replyList = pcloudSubReplyDao.getListByPcloudSkillId(skill.getId());
List<PcloudSubReply> subReplyList;
subReplyList = replyList.stream().filter(s->SubTypeEnum.SUCCESS.value.equals(s.getSubType())).collect(Collectors.toList());
this.sendSubReplyMessage(subReplyList, robotId, wxUserId);
});
// 发送订阅回复信息
List<PcloudSubReply> replyList = pcloudSubReplyDao.getListByPcloudSkillId(skill.getId());
List<PcloudSubReply> subReplyList;
subReplyList = replyList.stream().filter(s->SubTypeEnum.SUCCESS.value.equals(s.getSubType())).collect(Collectors.toList());
this.sendSubReplyMessage(subReplyList, robotId, wxUserId);
}
@Override
......
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