提交 781f9f9b authored 作者: malei's avatar malei

feat(school-sysUser): BookRecommend

1.重新推荐 References:N/A
上级 39b60c67
......@@ -24,7 +24,7 @@ public class ApprovalStatus extends BaseModel {
private Integer id;
/**
* 状态
* 教材状态
* {@link BookRecommendStatusEnum}
*/
@ApiModelProperty("状态;0:已提交 ,1:未提交 , 2:已退回")
......@@ -45,5 +45,19 @@ public class ApprovalStatus extends BaseModel {
@ApiModelProperty("用户与教材推荐的关系ID")
private Integer bookUserRelationId;
/**
* 两个步骤时,终审能看到多本教材,确认一本提交分单
* {@link com.zrqx.core.enums.school.sysuser.ApprovalStatusEnum}
*/
@ApiModelProperty("状态;0:待确认 ,1:已确认")
private String confirmStatus;
/**
* 课程状态,列表以课程为单位展示
* {@link BookRecommendStatusEnum}
*/
// @ApiModelProperty("状态;0:已提交, 1:未提交, 2:已退回")
// private String lessonStatus;
}
......@@ -53,4 +53,14 @@ public interface BookUserRelationManage {
*/
BookRecommendUserRelation findById(Integer id);
/**
* 查询当前用户的推荐记录,重新推荐使用
*@param queryCondition
*@return
*@author: ml
*@date: 2019/9/2 10:59
*/
BookRecommendUserRelation findOneByCreaterAndLessonId(BookRecommendUserRelation queryCondition);
}
......@@ -52,4 +52,9 @@ public class BookUserRelationManageImpl extends BaseManageImpl<BookRecommendUser
public BookRecommendUserRelation findById(Integer id) {
return super.selectByPrimaryKey(id);
}
@Override
public BookRecommendUserRelation findOneByCreaterAndLessonId(BookRecommendUserRelation queryCondition) {
return super.selectOne(queryCondition);
}
}
......@@ -296,17 +296,36 @@ public class BookRecommendServiceImpl extends BaseModelServiceImpl<BookRecommend
@Transactional
public Boolean renewRecommend(RenewRecommendForm form) {
//更新教参习题册绑定状态
BookRecommendUserRelation userRelation = relationManage.findById(form.getId());
userRelation.setIsGuide(form.getIsGuides());
userRelation.setIsExercise(form.getIsExercise());
//查询需要更新的推荐记录
BookRecommendUserRelation userRelation = new BookRecommendUserRelation();
userRelation.setCreater(redis.getMember().getId().toString());
userRelation.setLessonId(form.getLessonId());
userRelation.setRecommendId(form.getId());
userRelation = relationManage.findOneByCreaterAndLessonId(userRelation);
//教材是否绑定了教参或习题册
CallBack<CheckBindingVo> data = fgResouceClient.getCheckBindingByMainId(form.getBookId());
if (data == null || data.getData() == null) {
throw new BaseException("推荐失败,获取资源失败");
}
CheckBindingVo binding = data.getData();
if (binding.getExercise() != null && binding.getExercise()) {
userRelation.setIsExercise(BooleanStatusEnum.YES.getCode());
userRelation.setExerciseId(data.getData().getExerciseId());
}
if (binding.getExercise() != null && binding.getGuides()) {
userRelation.setIsGuide(BooleanStatusEnum.YES.getCode());
userRelation.setGuideId(data.getData().getGuideId());
}
//更新推荐记录
relationManage.update(userRelation);
String code = this.getFlowCodeByMemberId(redis.getMember().getId());
String nextCode = code.substring(0, code.length()-2);
//修改当前环节已退回状态为已提交
ApprovalStatus current = statusManage.queryOne(
form.getId(),
userRelation.getId(),
code,
BookRecommendStatusEnum.RETURNED.getCode());
current.setStatus(BookRecommendStatusEnum.SUBMITTED.getCode());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论