Browse Source

教材学生确定列表教材价格

大数据与最优化研究所 7 months ago
parent
commit
eb9471ff13

+ 13 - 11
src/main/java/com/xjrsoft/module/textbook/service/impl/TextbookStudentClaimServiceImpl.java

@@ -312,7 +312,9 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
                 .values()); // 转换回 List
 
         // 如果申领教材列表为空,应该使用基础数据维护的
+        boolean isCourseFlag = false;
         if(CollectionUtils.isEmpty(mergedDistinctList)){
+            isCourseFlag = true;
             mergedDistinctList = courselList;
         }
 
@@ -352,18 +354,18 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
 
                     categoryTotalPrice = BigDecimal.ZERO;
                     for (HeadTeaLookClassBookCategoryDetailVo vo : value) {
-                        textbookStudentClaim = byTextbookId.get(vo.getTextbookId());
-                        if (ObjectUtils.isNotEmpty(textbookStudentClaim)) {
-                            vo.setTextbookStudentClaimId(textbookStudentClaim.getId());
-                            vo.setIsClaim(textbookStudentClaim.getIsClaim());
-                            vo.setPrice(textbookStudentClaim.getPrice());
-                        } else {
-                            vo.setIsClaim(0);
-                            vo.setPrice(BigDecimal.ZERO);
-                        }
-                        if (ObjectUtils.isEmpty(vo.getPrice())) {
-                            vo.setPrice(BigDecimal.ZERO);
+                        if(!isCourseFlag){
+                            textbookStudentClaim = byTextbookId.get(vo.getTextbookId());
+                            if (ObjectUtils.isNotEmpty(textbookStudentClaim)) {
+                                vo.setTextbookStudentClaimId(textbookStudentClaim.getId());
+                                vo.setIsClaim(textbookStudentClaim.getIsClaim());
+                                vo.setPrice(textbookStudentClaim.getPrice());
+                            } else {
+                                vo.setIsClaim(0);
+                                vo.setPrice(BigDecimal.ZERO);
+                            }
                         }
+
                         categoryTotalPrice = categoryTotalPrice.add(vo.getPrice().multiply(BigDecimal.valueOf(vo.getClaimNum())));
                         totalPrice = totalPrice.add(vo.getPrice().multiply(BigDecimal.valueOf(vo.getClaimNum())));
                     }