|
|
@@ -230,6 +230,7 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
|
|
|
.selectAs(Textbook::getPrice, HeadTeaLookClassBookCategoryDetailVo::getPrice)
|
|
|
.selectAs(Textbook::getTextbookType, HeadTeaLookClassBookCategoryDetailVo::getTextbookType)
|
|
|
.select("1 as claim_num")
|
|
|
+ .select("3 as is_claim")
|
|
|
.innerJoin(BaseClassCourse.class, BaseClassCourse::getClassId, BaseClassAdminCourse::getId)
|
|
|
.innerJoin(Textbook.class, Textbook::getId, BaseClassCourse::getTextbookId)
|
|
|
.leftJoin(DictionaryDetail.class, DictionaryDetail::getCode, Textbook::getTextbookType,
|
|
|
@@ -853,7 +854,9 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
|
|
|
price = textBookPriceMap.get(textbookId);
|
|
|
}
|
|
|
oldTextbookStudentClaim = byUserIdAndTextbookId.get("" + userId + textbookId);
|
|
|
- if (ObjectUtils.isNotEmpty(oldTextbookStudentClaim)) {
|
|
|
+ if (ObjectUtils.isNotEmpty(oldTextbookStudentClaim)
|
|
|
+ && (ObjectUtils.isEmpty(oldTextbookStudentClaim.getClaimSource()) || oldTextbookStudentClaim.getClaimSource() != 1)
|
|
|
+ ) {
|
|
|
updateTextbookStudentClaim = new TextbookStudentClaim();
|
|
|
updateTextbookStudentClaim.setId(oldTextbookStudentClaim.getId());
|
|
|
updateTextbookStudentClaim.setIsClaim(dto.getIsClaim());
|
|
|
@@ -865,6 +868,7 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
|
|
|
if(dto.getIsClaim() == 1){
|
|
|
updateTextbookStudentClaim.setPrice(price);
|
|
|
}
|
|
|
+ updateTextbookStudentClaim.setClaimSource(2);
|
|
|
updateList.add(updateTextbookStudentClaim);
|
|
|
} else {
|
|
|
insertTextbookStudentClaim = new TextbookStudentClaim();
|
|
|
@@ -881,6 +885,7 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
|
|
|
if(dto.getIsClaim() == 1){
|
|
|
insertTextbookStudentClaim.setPrice(price);
|
|
|
}
|
|
|
+ insertTextbookStudentClaim.setClaimSource(2);
|
|
|
insertList.add(insertTextbookStudentClaim);
|
|
|
}
|
|
|
}
|
|
|
@@ -937,6 +942,9 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
|
|
|
Map<String, TextbookStudentClaim> byUserIdAndTextbookId = textbookStudentClaimList.stream()
|
|
|
.collect(Collectors.toMap(t -> "" + t.getBaseSemesterId() + t.getClassId() + t.getStudentUserId() + t.getTextbookId(), t -> t, (t1, t2) -> t1));
|
|
|
|
|
|
+ Map<Long, TextbookStudentClaim> byClaimSource = textbookStudentClaimList.stream()
|
|
|
+ .collect(Collectors.toMap(TextbookStudentClaim::getId , t -> t, (t1, t2) -> t1));
|
|
|
+
|
|
|
// 根据学期,班级获取申领教材信息
|
|
|
MPJLambdaWrapper<WfTextbookClaim> wfTextbookClaimLambdaQueryWrapper = new MPJLambdaWrapper<>();
|
|
|
wfTextbookClaimLambdaQueryWrapper
|
|
|
@@ -966,22 +974,30 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
|
|
|
if(MapUtils.isNotEmpty(textBookPriceMap) && ObjectUtils.isNotEmpty(textBookPriceMap.get(dto.getTextbookId()))){
|
|
|
price = textBookPriceMap.get(dto.getTextbookId());
|
|
|
}
|
|
|
- if (ObjectUtils.isNotEmpty(dto.getTextbookStudentClaimId()) && dto.getTextbookStudentClaimId() != 0) {
|
|
|
- updateTextbookStudentClaim = new TextbookStudentClaim();
|
|
|
- updateTextbookStudentClaim.setId(dto.getTextbookStudentClaimId());
|
|
|
- updateTextbookStudentClaim.setIsClaim(dto.getIsClaim());
|
|
|
- updateTextbookStudentClaim.setModifyUserId(loginUserId);
|
|
|
- updateTextbookStudentClaim.setModifyDate(nowDate);
|
|
|
- if(dto.getIsClaim() == 0){
|
|
|
- updateTextbookStudentClaim.setPrice(BigDecimal.ZERO);
|
|
|
- }
|
|
|
- if(dto.getIsClaim() == 1){
|
|
|
- updateTextbookStudentClaim.setPrice(price);
|
|
|
+ if (ObjectUtils.isNotEmpty(dto.getTextbookStudentClaimId())
|
|
|
+ && dto.getTextbookStudentClaimId() != 0) {
|
|
|
+ oldTextbookStudentClaim = byClaimSource.get(dto.getTextbookStudentClaimId());
|
|
|
+ if(ObjectUtils.isNotEmpty(oldTextbookStudentClaim)
|
|
|
+ && (ObjectUtils.isEmpty(oldTextbookStudentClaim.getClaimSource()) || oldTextbookStudentClaim.getClaimSource() != 1)) {
|
|
|
+ updateTextbookStudentClaim = new TextbookStudentClaim();
|
|
|
+ updateTextbookStudentClaim.setId(dto.getTextbookStudentClaimId());
|
|
|
+ updateTextbookStudentClaim.setIsClaim(dto.getIsClaim());
|
|
|
+ updateTextbookStudentClaim.setModifyUserId(loginUserId);
|
|
|
+ updateTextbookStudentClaim.setModifyDate(nowDate);
|
|
|
+ if (dto.getIsClaim() == 0) {
|
|
|
+ updateTextbookStudentClaim.setPrice(BigDecimal.ZERO);
|
|
|
+ }
|
|
|
+ if (dto.getIsClaim() == 1) {
|
|
|
+ updateTextbookStudentClaim.setPrice(price);
|
|
|
+ }
|
|
|
+ updateTextbookStudentClaim.setClaimSource(2);
|
|
|
+ updateList.add(updateTextbookStudentClaim);
|
|
|
}
|
|
|
- updateList.add(updateTextbookStudentClaim);
|
|
|
} else {
|
|
|
oldTextbookStudentClaim = byUserIdAndTextbookId.get("" + dto.getBaseSemesterId() + dto.getClassId() + dto.getStudentUserId() + dto.getTextbookId());
|
|
|
- if (ObjectUtils.isNotEmpty(oldTextbookStudentClaim)) {
|
|
|
+ if (ObjectUtils.isNotEmpty(oldTextbookStudentClaim)
|
|
|
+ && (ObjectUtils.isEmpty(oldTextbookStudentClaim.getClaimSource()) || oldTextbookStudentClaim.getClaimSource() != 1)
|
|
|
+ ) {
|
|
|
updateTextbookStudentClaim = new TextbookStudentClaim();
|
|
|
updateTextbookStudentClaim.setId(oldTextbookStudentClaim.getId());
|
|
|
updateTextbookStudentClaim.setIsClaim(dto.getIsClaim());
|
|
|
@@ -993,6 +1009,7 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
|
|
|
if(dto.getIsClaim() == 1){
|
|
|
updateTextbookStudentClaim.setPrice(price);
|
|
|
}
|
|
|
+ updateTextbookStudentClaim.setClaimSource(2);
|
|
|
updateList.add(updateTextbookStudentClaim);
|
|
|
} else {
|
|
|
insertTextbookStudentClaim = new TextbookStudentClaim();
|
|
|
@@ -1009,6 +1026,7 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
|
|
|
if(dto.getIsClaim() == 1){
|
|
|
insertTextbookStudentClaim.setPrice(price);
|
|
|
}
|
|
|
+ insertTextbookStudentClaim.setClaimSource(2);
|
|
|
insertList.add(insertTextbookStudentClaim);
|
|
|
}
|
|
|
}
|
|
|
@@ -1066,6 +1084,9 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
|
|
|
Map<String, TextbookStudentClaim> byUserIdAndTextbookId = textbookStudentClaimList.stream()
|
|
|
.collect(Collectors.toMap(t -> "" + t.getStudentUserId() + t.getTextbookId(), t -> t, (t1, t2) -> t1));
|
|
|
|
|
|
+ Map<Long, TextbookStudentClaim> byClaimSource = textbookStudentClaimList.stream()
|
|
|
+ .collect(Collectors.toMap(TextbookStudentClaim::getId , t -> t, (t1, t2) -> t1));
|
|
|
+
|
|
|
// 根据学期,班级获取申领教材信息
|
|
|
MPJLambdaWrapper<WfTextbookClaim> wfTextbookClaimLambdaQueryWrapper = new MPJLambdaWrapper<>();
|
|
|
wfTextbookClaimLambdaQueryWrapper
|
|
|
@@ -1094,22 +1115,29 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
|
|
|
if(MapUtils.isNotEmpty(textBookPriceMap) && ObjectUtils.isNotEmpty(textBookPriceMap.get(studentConfirmDetailDto.getTextbookId()))){
|
|
|
price = textBookPriceMap.get(studentConfirmDetailDto.getTextbookId());
|
|
|
}
|
|
|
- if (ObjectUtils.isNotEmpty(studentConfirmDetailDto.getTextbookStudentClaimId()) && studentConfirmDetailDto.getTextbookStudentClaimId() != 0) {
|
|
|
- updateTextbookStudentClaim = new TextbookStudentClaim();
|
|
|
- updateTextbookStudentClaim.setId(studentConfirmDetailDto.getTextbookStudentClaimId());
|
|
|
- updateTextbookStudentClaim.setIsClaim(dto.getIsClaim());
|
|
|
- updateTextbookStudentClaim.setModifyUserId(loginUserId);
|
|
|
- updateTextbookStudentClaim.setModifyDate(nowDate);
|
|
|
- if(dto.getIsClaim() == 0){
|
|
|
- updateTextbookStudentClaim.setPrice(BigDecimal.ZERO);
|
|
|
- }
|
|
|
- if(dto.getIsClaim() == 1){
|
|
|
- updateTextbookStudentClaim.setPrice(price);
|
|
|
+ if (ObjectUtils.isNotEmpty(studentConfirmDetailDto.getTextbookStudentClaimId())
|
|
|
+ && studentConfirmDetailDto.getTextbookStudentClaimId() != 0
|
|
|
+ ) {
|
|
|
+ oldTextbookStudentClaim = byClaimSource.get(studentConfirmDetailDto.getTextbookStudentClaimId());
|
|
|
+ if(ObjectUtils.isNotEmpty(oldTextbookStudentClaim)
|
|
|
+ && (ObjectUtils.isEmpty(oldTextbookStudentClaim.getClaimSource()) || oldTextbookStudentClaim.getClaimSource() != 1)){
|
|
|
+ updateTextbookStudentClaim = new TextbookStudentClaim();
|
|
|
+ updateTextbookStudentClaim.setId(studentConfirmDetailDto.getTextbookStudentClaimId());
|
|
|
+ updateTextbookStudentClaim.setIsClaim(dto.getIsClaim());
|
|
|
+ updateTextbookStudentClaim.setModifyUserId(loginUserId);
|
|
|
+ updateTextbookStudentClaim.setModifyDate(nowDate);
|
|
|
+ if(dto.getIsClaim() == 0){
|
|
|
+ updateTextbookStudentClaim.setPrice(BigDecimal.ZERO);
|
|
|
+ }
|
|
|
+ if(dto.getIsClaim() == 1){
|
|
|
+ updateTextbookStudentClaim.setPrice(price);
|
|
|
+ }
|
|
|
+ updateTextbookStudentClaim.setClaimSource(2);
|
|
|
+ updateList.add(updateTextbookStudentClaim);
|
|
|
}
|
|
|
- updateList.add(updateTextbookStudentClaim);
|
|
|
} else {
|
|
|
oldTextbookStudentClaim = byUserIdAndTextbookId.get("" + baseStudentSchoolRoll.getUserId() + studentConfirmDetailDto.getTextbookId());
|
|
|
- if (ObjectUtils.isNotEmpty(oldTextbookStudentClaim)) {
|
|
|
+ if (ObjectUtils.isNotEmpty(oldTextbookStudentClaim) && (ObjectUtils.isEmpty(oldTextbookStudentClaim.getClaimSource()) || oldTextbookStudentClaim.getClaimSource() != 1)) {
|
|
|
updateTextbookStudentClaim = new TextbookStudentClaim();
|
|
|
updateTextbookStudentClaim.setId(oldTextbookStudentClaim.getId());
|
|
|
updateTextbookStudentClaim.setIsClaim(dto.getIsClaim());
|
|
|
@@ -1121,6 +1149,7 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
|
|
|
if(dto.getIsClaim() == 1){
|
|
|
updateTextbookStudentClaim.setPrice(price);
|
|
|
}
|
|
|
+ updateTextbookStudentClaim.setClaimSource(2);
|
|
|
updateList.add(updateTextbookStudentClaim);
|
|
|
} else {
|
|
|
insertTextbookStudentClaim = new TextbookStudentClaim();
|
|
|
@@ -1137,6 +1166,7 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
|
|
|
if(dto.getIsClaim() == 1){
|
|
|
insertTextbookStudentClaim.setPrice(price);
|
|
|
}
|
|
|
+ insertTextbookStudentClaim.setClaimSource(2);
|
|
|
insertList.add(insertTextbookStudentClaim);
|
|
|
}
|
|
|
}
|