|
|
|
@ -1,12 +1,16 @@ |
|
|
|
package com.hxhq.business.service.impl; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.hxhq.business.domain.StudyMethodRead; |
|
|
|
import com.hxhq.business.enums.study.StudyMethodStatusEnum; |
|
|
|
import com.hxhq.business.form.study.StudyMethodForm; |
|
|
|
import com.hxhq.business.form.study.StudyMethodReadForm; |
|
|
|
import com.hxhq.business.form.study.StudyMethodSearchForm; |
|
|
|
import com.hxhq.business.service.IStudyMethodReadService; |
|
|
|
import com.hxhq.common.core.exception.ServiceException; |
|
|
|
import com.hxhq.common.security.utils.SecurityUtils; |
|
|
|
import com.hxhq.system.api.domain.SysUser; |
|
|
|
import com.hxhq.system.service.ISysUserService; |
|
|
|
@ -94,4 +98,32 @@ public class StudyMethodServiceImpl extends ServiceImpl |
|
|
|
studyMethodReadService.save(studyMethodRead); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void read(StudyMethodReadForm form) { |
|
|
|
SysUser qmr = sysUserService.selectUserById(form.getQmrId()); |
|
|
|
// TODO |
|
|
|
|
|
|
|
StudyMethod studyMethod = this.getById(form.getStudyMethodId()); |
|
|
|
if(studyMethod == null) { |
|
|
|
throw new ServiceException("试验方法不存在或已被删除"); |
|
|
|
} |
|
|
|
|
|
|
|
LambdaQueryWrapper<StudyMethodRead> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
queryWrapper.eq(StudyMethodRead::getStudyMethodId, form.getStudyMethodId()) |
|
|
|
.eq(StudyMethodRead::getQmrId, form.getQmrId()); |
|
|
|
long count = studyMethodReadService.count(queryWrapper); |
|
|
|
if(count > 0) { |
|
|
|
return; |
|
|
|
} |
|
|
|
StudyMethodRead studyMethodRead = new StudyMethodRead(); |
|
|
|
studyMethodRead.setQmyy("阅读"); |
|
|
|
studyMethodRead.setQmrMc(qmr.getNickName()); |
|
|
|
studyMethodRead.setQmrId(qmr.getUserId()); |
|
|
|
studyMethodRead.setRemark(form.getRemark()); |
|
|
|
studyMethodRead.setStudyId(studyMethod.getStudyId()); |
|
|
|
studyMethodRead.setStudySubjectId(studyMethod.getStudySubjectId()); |
|
|
|
studyMethodRead.setStudyMethodId(studyMethod.getId()); |
|
|
|
studyMethodReadService.save(studyMethodRead); |
|
|
|
} |
|
|
|
|
|
|
|
} |