|
|
@@ -4,6 +4,7 @@ import cn.dev33.satoken.stp.StpUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.github.yulichang.base.MPJBaseServiceImpl;
|
|
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
import com.xjrsoft.common.exception.MyException;
|
|
|
@@ -167,6 +168,16 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
|
|
|
IPage<TeacherCheckByStuVo> teacherCheckByStuVoList = textbookStudentClaimMapper.getTeacherCheckByStuList(ConventPage.getPage(dto), dto);
|
|
|
|
|
|
//为每个学生添加教材领取记录集合
|
|
|
+ //学生id集合
|
|
|
+// List<Long> stuIdList = new ArrayList<>();
|
|
|
+// for (TeacherCheckByStuVo teacherCheckByStuVo : teacherCheckByStuVoList.getRecords()) {
|
|
|
+// stuIdList.add(teacherCheckByStuVo.getStudentUserId());
|
|
|
+// }
|
|
|
+// //一次查出所有学生的所有书籍
|
|
|
+// if(stuIdList.size() > 0){
|
|
|
+// List<TextbookClaimVO> textbookClaimVOList = textbookStudentClaimMapper.getTextbookClaimVOList(stuIdList);
|
|
|
+// }
|
|
|
+
|
|
|
for (TeacherCheckByStuVo t : teacherCheckByStuVoList.getRecords()) {
|
|
|
List<TextbookClaimVO> textbookClaimVOList = textbookStudentClaimMapper.getTextbookClaimVOList(t.getStudentUserId());
|
|
|
t.setTextbookClaimVOList(textbookClaimVOList);
|
|
|
@@ -178,14 +189,20 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public Boolean updateByIds(List<Long> textbookStudentClaimIds) {
|
|
|
- for (Long textbookStudentClaimId : textbookStudentClaimIds) {
|
|
|
- this.updateById(new TextbookStudentClaim() {{
|
|
|
- setModifyUserId(StpUtil.getLoginIdAsLong());
|
|
|
- setModifyDate(new Date());
|
|
|
- setId(textbookStudentClaimId);
|
|
|
- setIsClaim(1);
|
|
|
- }});
|
|
|
- }
|
|
|
+ this.update(new TextbookStudentClaim() {{
|
|
|
+ setModifyUserId(StpUtil.getLoginIdAsLong());
|
|
|
+ setModifyDate(new Date());
|
|
|
+ setIsClaim(1);
|
|
|
+ }},Wrappers.<TextbookStudentClaim>query().lambda()
|
|
|
+ .in(TextbookStudentClaim::getId, textbookStudentClaimIds));
|
|
|
+// for (Long textbookStudentClaimId : textbookStudentClaimIds) {
|
|
|
+// this.updateById(new TextbookStudentClaim() {{
|
|
|
+// setModifyUserId(StpUtil.getLoginIdAsLong());
|
|
|
+// setModifyDate(new Date());
|
|
|
+// setId(textbookStudentClaimId);
|
|
|
+// setIsClaim(1);
|
|
|
+// }});
|
|
|
+// }
|
|
|
return true;
|
|
|
}
|
|
|
|