Commit 811f5fb4 by 阮思源

Merge branch 'feat-1002498' into 'master'

1002498客服入口需呈现读者当前阶段情况

See merge request rays/pcloud-book!503
parents 05819e10 fc6d506d
......@@ -74,4 +74,6 @@ public interface PersonalStageBiz {
*/
Boolean isFirstVisit(Long personalStageUserId);
PersonalStage getCurrentPersonalStage(String wxId, String robotId);
}
......@@ -893,6 +893,15 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
return false;
}
@ParamLog("当前用户阶段")
@Override
public PersonalStage getCurrentPersonalStage(String wxId, String robotId) {
PersonalStageUser last = personalStageUserDao.getLast(wxId, robotId, null);
if (last!=null){
return personalStageDao.getById(last.getPersonalStageId());
}
return null;
}
private void setProgressTime(List<PersonalStageProgressMessage> personalStageProgressMessages, Date startTime) {
personalStageProgressMessages.stream().forEach(e ->{
e.setProgressTime(DateUtils.addMinute(startTime,e.getMinutes()));
......
......@@ -228,4 +228,15 @@ public class PersonalStageFacade {
return new ResponseDto<>(personalStageBiz.isFirstVisit(personalStageUserId));
}
@ApiOperation("获取单个用户当前定制化阶段")
@GetMapping("/getCurrentPersonalStage")
public ResponseDto<?> getCurrentPersonalStage(
@RequestHeader("token") @ApiParam("token信息") String token,
@RequestParam("wxId") @ApiParam("用户id") String wxId,
@RequestParam("robotId") @ApiParam("机器人id") String robotId
) throws BizException, PermissionException {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
return new ResponseDto<>(personalStageBiz.getCurrentPersonalStage(wxId, robotId));
}
}
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