Commit a72d41d1 by zhouhaibao

[+]策略中心逻辑提交

1 parent 79f3199f
...@@ -82,6 +82,7 @@ public class StrategyStaffRel implements Serializable { ...@@ -82,6 +82,7 @@ public class StrategyStaffRel implements Serializable {
* 学习进度 1.未开始 2.学习中 3.已完成 * 学习进度 1.未开始 2.学习中 3.已完成
*/ */
@Transient @Transient
@ApiModelProperty(notes = "学习进度 1.未开始 2.学习中 3.已完成")
private Integer progressStatus; private Integer progressStatus;
/** /**
...@@ -91,6 +92,7 @@ public class StrategyStaffRel implements Serializable { ...@@ -91,6 +92,7 @@ public class StrategyStaffRel implements Serializable {
* 这里以通用分数为例 * 这里以通用分数为例
*/ */
@Transient @Transient
@ApiModelProperty(notes = "成绩(可为分数、等级或百分制)")
private Double score; private Double score;
/** /**
...@@ -98,5 +100,6 @@ public class StrategyStaffRel implements Serializable { ...@@ -98,5 +100,6 @@ public class StrategyStaffRel implements Serializable {
* 使用 java.time.LocalDateTime(推荐)或 Date * 使用 java.time.LocalDateTime(推荐)或 Date
*/ */
@Transient @Transient
@ApiModelProperty(notes = "完成时间(任务/课程完成的具体时间)")
private Date completionTime; private Date completionTime;
} }
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.strategy.remote; package cn.com.glsx.dj.strategy.remote;
import cn.com.glsx.dj.strategy.dto.*; import cn.com.glsx.dj.strategy.dto.*;
import cn.com.glsx.dj.strategy.model.LearningRecord;
import cn.com.glsx.dj.strategy.model.StrategyInfo; import cn.com.glsx.dj.strategy.model.StrategyInfo;
import cn.com.glsx.framework.core.annotation.ApiMethod; import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam; import cn.com.glsx.framework.core.annotation.ApiParam;
...@@ -41,4 +42,11 @@ public interface StrategyInfoRemote { ...@@ -41,4 +42,11 @@ public interface StrategyInfoRemote {
@ApiMethod("查询驻店员工时长") @ApiMethod("查询驻店员工时长")
RpcResponse<StaffSummaryDTO> summaryStaffDuration(SceneMerchantBaseParam request); RpcResponse<StaffSummaryDTO> summaryStaffDuration(SceneMerchantBaseParam request);
@ApiMethod("查询策略信息")
RpcResponse<StrategyInfo> queryStrategyInfoById(Integer id);
@ApiMethod("新增或更新学习记录")
RpcResponse<Boolean> insertOrUpdateLearningRecord(LearningRecord learningRecord);
} }
package cn.com.glsx.dj.strategy.remote; package cn.com.glsx.dj.strategy.remote;
import cn.com.glsx.dj.strategy.dto.*; import cn.com.glsx.dj.strategy.dto.*;
import cn.com.glsx.dj.strategy.model.LearningRecord;
import cn.com.glsx.dj.strategy.model.StrategyInfo; import cn.com.glsx.dj.strategy.model.StrategyInfo;
import cn.com.glsx.dj.strategy.service.LearningRecordService;
import cn.com.glsx.dj.strategy.service.StrategyInfoService; import cn.com.glsx.dj.strategy.service.StrategyInfoService;
import cn.com.glsx.dj.strategy.service.StrategyMerchantTimelineService; import cn.com.glsx.dj.strategy.service.StrategyMerchantTimelineService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse; import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
...@@ -22,6 +24,9 @@ public class StrategyInfoRemoteImpl implements StrategyInfoRemote { ...@@ -22,6 +24,9 @@ public class StrategyInfoRemoteImpl implements StrategyInfoRemote {
@Autowired @Autowired
private StrategyMerchantTimelineService strategyMerchantTimelineService; private StrategyMerchantTimelineService strategyMerchantTimelineService;
@Autowired
public LearningRecordService learningRecordService;
@Override @Override
...@@ -101,4 +106,31 @@ public class StrategyInfoRemoteImpl implements StrategyInfoRemote { ...@@ -101,4 +106,31 @@ public class StrategyInfoRemoteImpl implements StrategyInfoRemote {
return RpcResponse.error(DefaultErrorEnum.SERVICE_ERROR, e.getMessage()); return RpcResponse.error(DefaultErrorEnum.SERVICE_ERROR, e.getMessage());
} }
} }
@Override
public RpcResponse<StrategyInfo> queryStrategyInfoById(Integer id) {
try {
return RpcResponse.success(strategyInfoService.queryStrategyInfoById(id));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
} catch (Exception e) {
log.error(e.getMessage(), e);
return RpcResponse.error(DefaultErrorEnum.SERVICE_ERROR, e.getMessage());
}
}
@Override
public RpcResponse<Boolean> insertOrUpdateLearningRecord(LearningRecord learningRecord) {
try {
learningRecordService.insertOrUpdateLearningRecord(learningRecord);
return RpcResponse.success(true);
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage());
} catch (Exception e) {
log.error(e.getMessage(), e);
return RpcResponse.error(DefaultErrorEnum.SERVICE_ERROR, e.getMessage());
}
}
} }
...@@ -31,7 +31,7 @@ public class LearningRecordService { ...@@ -31,7 +31,7 @@ public class LearningRecordService {
*/ */
@GlsxDistributeLockable(name = "'LearningRecordService_insertOrUpdate_' + #learningRecord.recordingId" + "'_' + #learningRecord.userUuid", @GlsxDistributeLockable(name = "'LearningRecordService_insertOrUpdate_' + #learningRecord.recordingId" + "'_' + #learningRecord.userUuid",
time = 5, timeUnit = TimeUnit.MINUTES, timeoutException = RpcServiceException.class) time = 5, timeUnit = TimeUnit.MINUTES, timeoutException = RpcServiceException.class)
public void insertOrUpdate(LearningRecord learningRecord) { public void insertOrUpdateLearningRecord(LearningRecord learningRecord) {
String recordingId = learningRecord.getRecordingId(); String recordingId = learningRecord.getRecordingId();
String userUuid = learningRecord.getUserUuid(); String userUuid = learningRecord.getUserUuid();
LearningRecord record = learningRecordMapper.selectOne(recordingId, userUuid); LearningRecord record = learningRecordMapper.selectOne(recordingId, userUuid);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!