Commit fc6d506d by 阮思源

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

parent 05819e10
......@@ -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