Commit 2a46bafa by 林冲

Merge branch 'v5.7.0' into 'master'

上线合并

See merge request !5
2 parents 7c59288f 6d24f81f
...@@ -13,6 +13,11 @@ ...@@ -13,6 +13,11 @@
<packaging>war</packaging> <packaging>war</packaging>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-supervisor-api</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cn.com.glsx</groupId> <groupId>cn.com.glsx</groupId>
<artifactId>rpc-dj-mindworkplate-api</artifactId> <artifactId>rpc-dj-mindworkplate-api</artifactId>
<version>5.6.0-SNAPSHOT</version> <version>5.6.0-SNAPSHOT</version>
......
...@@ -11,6 +11,7 @@ import cn.com.glsx.dj.riskmanage.remote.LearningCenterCourseCategoryRemote; ...@@ -11,6 +11,7 @@ import cn.com.glsx.dj.riskmanage.remote.LearningCenterCourseCategoryRemote;
import cn.com.glsx.dj.riskmanage.remote.LearningCenterCourseRemote; import cn.com.glsx.dj.riskmanage.remote.LearningCenterCourseRemote;
import cn.com.glsx.dj.smartcarlife.remote.*; import cn.com.glsx.dj.smartcarlife.remote.*;
import cn.com.glsx.dj.strategy.remote.StrategyInfoRemote; import cn.com.glsx.dj.strategy.remote.StrategyInfoRemote;
import cn.com.glsx.dj.supervisor.remote.PersonCourseRecommendationRemote;
import cn.com.glsx.merchants.remote.MerchantStaffRemote; import cn.com.glsx.merchants.remote.MerchantStaffRemote;
import com.rop.config.InterceptorHolder; import com.rop.config.InterceptorHolder;
import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory; import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
...@@ -142,4 +143,9 @@ public class DubboConfig { ...@@ -142,4 +143,9 @@ public class DubboConfig {
public StrategyInfoRemote getStrategyInfoRemote() { public StrategyInfoRemote getStrategyInfoRemote() {
return factory.builder(StrategyInfoRemote.class).check(false).timeout(30000).version("1.0.0").build(); return factory.builder(StrategyInfoRemote.class).check(false).timeout(30000).version("1.0.0").build();
} }
@Bean
public PersonCourseRecommendationRemote personCourseRecommendationRemote() {
return factory.builder(PersonCourseRecommendationRemote.class).check(false).version("1.0.0").timeout(30000).build();
}
} }
...@@ -16,6 +16,9 @@ import cn.com.glsx.dj.riskmanage.remote.learningcenter.PadLearningCenterRemote; ...@@ -16,6 +16,9 @@ import cn.com.glsx.dj.riskmanage.remote.learningcenter.PadLearningCenterRemote;
import cn.com.glsx.dj.smartcarlife.dto.study.StaffStudyDTO; import cn.com.glsx.dj.smartcarlife.dto.study.StaffStudyDTO;
import cn.com.glsx.dj.smartcarlife.enums.study.StaffPunishStatusEnum; import cn.com.glsx.dj.smartcarlife.enums.study.StaffPunishStatusEnum;
import cn.com.glsx.dj.smartcarlife.remote.ContentManagerTaskRemote; import cn.com.glsx.dj.smartcarlife.remote.ContentManagerTaskRemote;
import cn.com.glsx.dj.supervisor.dto.MyselfCourseRecommendDTO;
import cn.com.glsx.dj.supervisor.remote.PersonCourseRecommendationRemote;
import cn.com.glsx.dj.supervisor.remote.SupervisorLearningCenterRemote;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination; import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse; import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum; import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
...@@ -55,6 +58,7 @@ public class LearningCenterController { ...@@ -55,6 +58,7 @@ public class LearningCenterController {
private final LearningCenterConvert learningCenterConvert; private final LearningCenterConvert learningCenterConvert;
private final PadLearningCenterRemote padLearningCenterRemote; private final PadLearningCenterRemote padLearningCenterRemote;
private final ContentManagerTaskRemote contentManagerTaskRemote; private final ContentManagerTaskRemote contentManagerTaskRemote;
private final PersonCourseRecommendationRemote personCourseRecommendationRemote;
@ApiOperation("学习中心-开始测评弹窗") @ApiOperation("学习中心-开始测评弹窗")
@ServiceMethod(method = "dj.api.pad.learning.center.level.exam", needInSession = NeedInSessionType.YES) @ServiceMethod(method = "dj.api.pad.learning.center.level.exam", needInSession = NeedInSessionType.YES)
...@@ -111,6 +115,33 @@ public class LearningCenterController { ...@@ -111,6 +115,33 @@ public class LearningCenterController {
} }
} }
@ApiOperation("学习中心-我的课程-推荐学习")
@ServiceMethod(method = "dj.api.pad.learning.center.myself.course.recommend", needInSession = NeedInSessionType.YES)
public RopResponse<RpcPagination<LearningCenterMyselfCourseResponse>> learningCenterMyselfCourseRecommend(LearningCenterMyselfCourseRequest request) {
try {
String phone = Optional.ofNullable(CommonUtil.getLoginUserInfo()).map(LoginUserInfoResponse::getPhone)
.orElseThrow(() -> new RpcServiceException(RopErrorEnum.SCL_WORKWECHAT_GET_LOGIN_EXPIRE));
RpcPagination<MyselfCourseRecommendDTO> rpcPagination = CommonUtil.getRpcPagination(MyselfCourseRecommendDTO.class);
MyselfCourseRecommendDTO learningCenterMyselfCourseDTO = BeanUtil.copyProperties(request, MyselfCourseRecommendDTO.class);
learningCenterMyselfCourseDTO.setPhone(phone);
rpcPagination.setCondition(learningCenterMyselfCourseDTO);
RpcResponse<RpcPagination<MyselfCourseRecommendDTO>> response = personCourseRecommendationRemote.getPersonCourseRecommendPage(rpcPagination);
RpcPagination<MyselfCourseRecommendDTO> result = response.getResult();
if (response.isFailed()) {
throw new RpcServiceException(response.getError(), response.getMessage());
}
return RopResponse.success(learningCenterConvert.myselfCourseRecommendDTOPage2ResponsePage(result));
} catch (RpcServiceException e) {
log.info("dj.api.pad.learning.center.myself.course.recommend!", e);
return RopResponse.error(e);
} catch (Exception e) {
log.info("dj.api.pad.learning.center.myself.course.recommend!", e);
return RopResponse.result(DefaultErrorEnum.SERVICE_ERROR);
}
}
@ApiOperation("学习中心-我的课程-查询各页签数据量") @ApiOperation("学习中心-我的课程-查询各页签数据量")
@ServiceMethod(method = "dj.api.pad.learning.center.myself.course.count", needInSession = NeedInSessionType.YES) @ServiceMethod(method = "dj.api.pad.learning.center.myself.course.count", needInSession = NeedInSessionType.YES)
public RopResponse<LearningCenterMyselfCourseCountResponse> learningCenterMyselfCourseCount(AbstractRopRequest request) { public RopResponse<LearningCenterMyselfCourseCountResponse> learningCenterMyselfCourseCount(AbstractRopRequest request) {
...@@ -126,6 +157,20 @@ public class LearningCenterController { ...@@ -126,6 +157,20 @@ public class LearningCenterController {
LearningCenterMyselfCourseCountRespDTO result = rpcResponse.getResult(); LearningCenterMyselfCourseCountRespDTO result = rpcResponse.getResult();
LearningCenterMyselfCourseCountResponse response = BeanUtil.copyProperties(result, LearningCenterMyselfCourseCountResponse.class); LearningCenterMyselfCourseCountResponse response = BeanUtil.copyProperties(result, LearningCenterMyselfCourseCountResponse.class);
// 查询推荐课程总数
RpcPagination<MyselfCourseRecommendDTO> recommendPagination = new RpcPagination<>();
MyselfCourseRecommendDTO recommendCondition = new MyselfCourseRecommendDTO();
recommendCondition.setPhone(phone);
recommendPagination.setCondition(recommendCondition);
recommendPagination.setPageNum(1);
recommendPagination.setPageSize(1);
RpcResponse<RpcPagination<MyselfCourseRecommendDTO>> recommendResponse = personCourseRecommendationRemote.getPersonCourseRecommendPage(recommendPagination);
if (recommendResponse != null && recommendResponse.hasResult() && recommendResponse.getResult() != null) {
response.setRecommendCount(recommendResponse.getResult().getTotal());
} else {
response.setRecommendCount(0L);
}
return RopResponse.success(response); return RopResponse.success(response);
} catch (RpcServiceException e) { } catch (RpcServiceException e) {
log.info("dj.api.pad.learning.center.myself.course.count error reason!", e); log.info("dj.api.pad.learning.center.myself.course.count error reason!", e);
......
...@@ -2,6 +2,7 @@ package cn.com.glsx.dj.pad.convert; ...@@ -2,6 +2,7 @@ package cn.com.glsx.dj.pad.convert;
import cn.com.glsx.dj.pad.response.learningcenter.LearningCenterMyselfCourseResponse; import cn.com.glsx.dj.pad.response.learningcenter.LearningCenterMyselfCourseResponse;
import cn.com.glsx.dj.riskmanage.dto.learningcenter.LearningCenterMyselfCourseDTO; import cn.com.glsx.dj.riskmanage.dto.learningcenter.LearningCenterMyselfCourseDTO;
import cn.com.glsx.dj.supervisor.dto.MyselfCourseRecommendDTO;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination; import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import org.mapstruct.Mapper; import org.mapstruct.Mapper;
...@@ -16,4 +17,6 @@ public interface LearningCenterConvert { ...@@ -16,4 +17,6 @@ public interface LearningCenterConvert {
RpcPagination<LearningCenterMyselfCourseResponse> myselfCourseDTOPage2ResponsePage(RpcPagination<LearningCenterMyselfCourseDTO> page); RpcPagination<LearningCenterMyselfCourseResponse> myselfCourseDTOPage2ResponsePage(RpcPagination<LearningCenterMyselfCourseDTO> page);
RpcPagination<LearningCenterMyselfCourseResponse> myselfCourseRecommendDTOPage2ResponsePage(RpcPagination<MyselfCourseRecommendDTO> page);
} }
...@@ -38,4 +38,11 @@ public class LearningCenterMyselfCourseCountResponse implements Serializable { ...@@ -38,4 +38,11 @@ public class LearningCenterMyselfCourseCountResponse implements Serializable {
example = "4" example = "4"
) )
private Integer completedCount; private Integer completedCount;
@ApiModelProperty(
name = "recommendCount",
notes = "推荐课程总数",
example = "5"
)
private Long recommendCount;
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!