|
@@ -195,6 +195,7 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
|
|
|
// 获取学期
|
|
// 获取学期
|
|
|
BaseSemester baseSemester = baseSemesterMapper.selectById(dto.getBaseSemesterId());
|
|
BaseSemester baseSemester = baseSemesterMapper.selectById(dto.getBaseSemesterId());
|
|
|
|
|
|
|
|
|
|
+ Long loginId = StpUtil.getLoginIdAsLong();
|
|
|
// 获取当前学生的信息
|
|
// 获取当前学生的信息
|
|
|
MPJLambdaWrapper<BaseStudentSchoolRoll> baseStudentSchoolRollMPJLambdaWrapper = new MPJLambdaWrapper<>();
|
|
MPJLambdaWrapper<BaseStudentSchoolRoll> baseStudentSchoolRollMPJLambdaWrapper = new MPJLambdaWrapper<>();
|
|
|
baseStudentSchoolRollMPJLambdaWrapper
|
|
baseStudentSchoolRollMPJLambdaWrapper
|
|
@@ -205,6 +206,7 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
|
|
|
.leftJoin(BaseClass.class, BaseClass::getId, BaseStudentSchoolRoll::getClassId)
|
|
.leftJoin(BaseClass.class, BaseClass::getId, BaseStudentSchoolRoll::getClassId)
|
|
|
.leftJoin(XjrUser.class, XjrUser::getId, BaseStudentSchoolRoll::getUserId)
|
|
.leftJoin(XjrUser.class, XjrUser::getId, BaseStudentSchoolRoll::getUserId)
|
|
|
.leftJoin(BaseStudent.class, BaseStudent::getUserId, BaseStudentSchoolRoll::getUserId)
|
|
.leftJoin(BaseStudent.class, BaseStudent::getUserId, BaseStudentSchoolRoll::getUserId)
|
|
|
|
|
+ .eq(BaseStudentSchoolRoll::getUserId, loginId)
|
|
|
.last("limit 1")
|
|
.last("limit 1")
|
|
|
;
|
|
;
|
|
|
TextbookClaimStudentConfirmVo result = baseStudentSchoolRollMapper.selectJoinOne(TextbookClaimStudentConfirmVo.class, baseStudentSchoolRollMPJLambdaWrapper);
|
|
TextbookClaimStudentConfirmVo result = baseStudentSchoolRollMapper.selectJoinOne(TextbookClaimStudentConfirmVo.class, baseStudentSchoolRollMPJLambdaWrapper);
|
|
@@ -312,6 +314,7 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
|
|
|
for (HeadTeaLookClassBookCategoryDetailVo vo : value) {
|
|
for (HeadTeaLookClassBookCategoryDetailVo vo : value) {
|
|
|
textbookStudentClaim = byTextbookId.get(vo.getTextbookId());
|
|
textbookStudentClaim = byTextbookId.get(vo.getTextbookId());
|
|
|
if(ObjectUtils.isNotEmpty(textbookStudentClaim)){
|
|
if(ObjectUtils.isNotEmpty(textbookStudentClaim)){
|
|
|
|
|
+ vo.setTextbookStudentClaimId(textbookStudentClaim.getId());
|
|
|
vo.setIsClaim(textbookStudentClaim.getIsClaim());
|
|
vo.setIsClaim(textbookStudentClaim.getIsClaim());
|
|
|
}else {
|
|
}else {
|
|
|
vo.setIsClaim(0);
|
|
vo.setIsClaim(0);
|
|
@@ -712,7 +715,7 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
|
|
|
if(ObjectUtils.isNotEmpty(oldTextbookStudentClaim)){
|
|
if(ObjectUtils.isNotEmpty(oldTextbookStudentClaim)){
|
|
|
updateTextbookStudentClaim = new TextbookStudentClaim();
|
|
updateTextbookStudentClaim = new TextbookStudentClaim();
|
|
|
updateTextbookStudentClaim.setId(oldTextbookStudentClaim.getId());
|
|
updateTextbookStudentClaim.setId(oldTextbookStudentClaim.getId());
|
|
|
- updateTextbookStudentClaim.setIsClaim(oldTextbookStudentClaim.getIsClaim() == 1 ? 0 : 1);
|
|
|
|
|
|
|
+ updateTextbookStudentClaim.setIsClaim(dto.getIsClaim());
|
|
|
updateTextbookStudentClaim.setModifyDate(nowDate);
|
|
updateTextbookStudentClaim.setModifyDate(nowDate);
|
|
|
updateTextbookStudentClaim.setModifyUserId(loginUserId);
|
|
updateTextbookStudentClaim.setModifyUserId(loginUserId);
|
|
|
updateList.add(updateTextbookStudentClaim);
|
|
updateList.add(updateTextbookStudentClaim);
|
|
@@ -722,7 +725,7 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
|
|
|
insertTextbookStudentClaim.setClassId(dto.getClassId());
|
|
insertTextbookStudentClaim.setClassId(dto.getClassId());
|
|
|
insertTextbookStudentClaim.setStudentUserId(userId);
|
|
insertTextbookStudentClaim.setStudentUserId(userId);
|
|
|
insertTextbookStudentClaim.setTextbookId(textbookId);
|
|
insertTextbookStudentClaim.setTextbookId(textbookId);
|
|
|
- insertTextbookStudentClaim.setIsClaim(1);
|
|
|
|
|
|
|
+ insertTextbookStudentClaim.setIsClaim(dto.getIsClaim());
|
|
|
insertTextbookStudentClaim.setCreateDate(nowDate);
|
|
insertTextbookStudentClaim.setCreateDate(nowDate);
|
|
|
insertTextbookStudentClaim.setCreateUserId(loginUserId);
|
|
insertTextbookStudentClaim.setCreateUserId(loginUserId);
|
|
|
insertList.add(insertTextbookStudentClaim);
|
|
insertList.add(insertTextbookStudentClaim);
|
|
@@ -802,7 +805,7 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
|
|
|
if(ObjectUtils.isNotEmpty(oldTextbookStudentClaim)){
|
|
if(ObjectUtils.isNotEmpty(oldTextbookStudentClaim)){
|
|
|
updateTextbookStudentClaim = new TextbookStudentClaim();
|
|
updateTextbookStudentClaim = new TextbookStudentClaim();
|
|
|
updateTextbookStudentClaim.setId(oldTextbookStudentClaim.getId());
|
|
updateTextbookStudentClaim.setId(oldTextbookStudentClaim.getId());
|
|
|
- updateTextbookStudentClaim.setIsClaim(oldTextbookStudentClaim.getIsClaim() == 1 ? 0 : 1);
|
|
|
|
|
|
|
+ updateTextbookStudentClaim.setIsClaim(dto.getIsClaim());
|
|
|
updateTextbookStudentClaim.setModifyDate(nowDate);
|
|
updateTextbookStudentClaim.setModifyDate(nowDate);
|
|
|
updateTextbookStudentClaim.setModifyUserId(loginUserId);
|
|
updateTextbookStudentClaim.setModifyUserId(loginUserId);
|
|
|
updateList.add(updateTextbookStudentClaim);
|
|
updateList.add(updateTextbookStudentClaim);
|
|
@@ -812,7 +815,7 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
|
|
|
insertTextbookStudentClaim.setClassId(dto.getClassId());
|
|
insertTextbookStudentClaim.setClassId(dto.getClassId());
|
|
|
insertTextbookStudentClaim.setStudentUserId(dto.getStudentUserId());
|
|
insertTextbookStudentClaim.setStudentUserId(dto.getStudentUserId());
|
|
|
insertTextbookStudentClaim.setTextbookId(dto.getTextbookId());
|
|
insertTextbookStudentClaim.setTextbookId(dto.getTextbookId());
|
|
|
- insertTextbookStudentClaim.setIsClaim(1);
|
|
|
|
|
|
|
+ insertTextbookStudentClaim.setIsClaim(dto.getIsClaim());
|
|
|
insertTextbookStudentClaim.setCreateDate(nowDate);
|
|
insertTextbookStudentClaim.setCreateDate(nowDate);
|
|
|
insertTextbookStudentClaim.setCreateUserId(loginUserId);
|
|
insertTextbookStudentClaim.setCreateUserId(loginUserId);
|
|
|
insertList.add(insertTextbookStudentClaim);
|
|
insertList.add(insertTextbookStudentClaim);
|
|
@@ -835,6 +838,79 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Boolean studentConfirm(StudentConfirmDto dto) {
|
|
|
|
|
+ Long loginId = StpUtil.getLoginIdAsLong();
|
|
|
|
|
+ // 获取当前学生的信息
|
|
|
|
|
+ LambdaQueryWrapper<BaseStudentSchoolRoll> baseStudentSchoolRollLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
+ baseStudentSchoolRollLambdaQueryWrapper
|
|
|
|
|
+ .eq(BaseStudentSchoolRoll::getUserId, loginId)
|
|
|
|
|
+ .eq(BaseStudentSchoolRoll::getDeleteMark, DeleteMark.NODELETE.getCode())
|
|
|
|
|
+ .last("limit 1")
|
|
|
|
|
+ ;
|
|
|
|
|
+ BaseStudentSchoolRoll baseStudentSchoolRoll = baseStudentSchoolRollMapper.selectOne(baseStudentSchoolRollLambdaQueryWrapper);
|
|
|
|
|
+
|
|
|
|
|
+ if(ObjectUtils.isEmpty(baseStudentSchoolRoll)){
|
|
|
|
|
+ throw new MyException("学生信息有误,请重新登录");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 根据学期,班级,学生,教材信息获取记录
|
|
|
|
|
+ LambdaQueryWrapper<TextbookStudentClaim> textbookStudentClaimLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
+ textbookStudentClaimLambdaQueryWrapper
|
|
|
|
|
+ .eq(TextbookStudentClaim::getBaseSemesterId, dto.getBaseSemesterId())
|
|
|
|
|
+ .eq(TextbookStudentClaim::getClassId, baseStudentSchoolRoll.getClassId())
|
|
|
|
|
+ .eq(TextbookStudentClaim::getStudentUserId, baseStudentSchoolRoll.getUserId())
|
|
|
|
|
+ .in(TextbookStudentClaim::getTextbookId, dto.getTextbookIds())
|
|
|
|
|
+ ;
|
|
|
|
|
+ List<TextbookStudentClaim> textbookStudentClaimList = textbookStudentClaimMapper.selectList(textbookStudentClaimLambdaQueryWrapper);
|
|
|
|
|
+
|
|
|
|
|
+ Map<String, TextbookStudentClaim> byUserIdAndTextbookId = textbookStudentClaimList.stream()
|
|
|
|
|
+ .collect(Collectors.toMap(t -> "" + t.getStudentUserId() + t.getTextbookId(), t -> t, (t1, t2) -> t1));
|
|
|
|
|
+
|
|
|
|
|
+ List<TextbookStudentClaim> insertList = new ArrayList<>();
|
|
|
|
|
+ List<TextbookStudentClaim> updateList = new ArrayList<>();
|
|
|
|
|
+ TextbookStudentClaim oldTextbookStudentClaim;
|
|
|
|
|
+ TextbookStudentClaim insertTextbookStudentClaim;
|
|
|
|
|
+ TextbookStudentClaim updateTextbookStudentClaim;
|
|
|
|
|
+ Date nowDate = new Date();
|
|
|
|
|
+ Long loginUserId = StpUtil.getLoginIdAsLong();
|
|
|
|
|
+ for (Long textbookId : dto.getTextbookIds()){
|
|
|
|
|
+ oldTextbookStudentClaim = byUserIdAndTextbookId.get("" + baseStudentSchoolRoll.getUserId() + textbookId);
|
|
|
|
|
+ if(ObjectUtils.isNotEmpty(oldTextbookStudentClaim)){
|
|
|
|
|
+ updateTextbookStudentClaim = new TextbookStudentClaim();
|
|
|
|
|
+ updateTextbookStudentClaim.setId(oldTextbookStudentClaim.getId());
|
|
|
|
|
+ updateTextbookStudentClaim.setIsClaim(dto.getIsClaim());
|
|
|
|
|
+ updateTextbookStudentClaim.setModifyDate(nowDate);
|
|
|
|
|
+ updateTextbookStudentClaim.setModifyUserId(loginUserId);
|
|
|
|
|
+ updateList.add(updateTextbookStudentClaim);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ insertTextbookStudentClaim = new TextbookStudentClaim();
|
|
|
|
|
+ insertTextbookStudentClaim.setBaseSemesterId(dto.getBaseSemesterId());
|
|
|
|
|
+ insertTextbookStudentClaim.setClassId(baseStudentSchoolRoll.getClassId());
|
|
|
|
|
+ insertTextbookStudentClaim.setStudentUserId(baseStudentSchoolRoll.getUserId());
|
|
|
|
|
+ insertTextbookStudentClaim.setTextbookId(textbookId);
|
|
|
|
|
+ insertTextbookStudentClaim.setIsClaim(dto.getIsClaim());
|
|
|
|
|
+ insertTextbookStudentClaim.setCreateDate(nowDate);
|
|
|
|
|
+ insertTextbookStudentClaim.setCreateUserId(loginUserId);
|
|
|
|
|
+ insertList.add(insertTextbookStudentClaim);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (ObjectUtils.isNotEmpty(insertList)) {
|
|
|
|
|
+ for (TextbookStudentClaim insert : insertList) {
|
|
|
|
|
+ textbookStudentClaimMapper.insert(insert);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (ObjectUtils.isNotEmpty(updateList)) {
|
|
|
|
|
+ for (TextbookStudentClaim update : updateList) {
|
|
|
|
|
+ textbookStudentClaimMapper.updateById(update);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public List<TeacherConfirmBatchTextbookListVo> teacherConfirmBatchTextbookList(TeacherConfirmBatchTextbookListDto dto) {
|
|
public List<TeacherConfirmBatchTextbookListVo> teacherConfirmBatchTextbookList(TeacherConfirmBatchTextbookListDto dto) {
|
|
|
MPJLambdaWrapper<WfTextbookClaimItem> wfTextbookClaimItemMPJLambdaWrapper = new MPJLambdaWrapper<>();
|
|
MPJLambdaWrapper<WfTextbookClaimItem> wfTextbookClaimItemMPJLambdaWrapper = new MPJLambdaWrapper<>();
|