Browse Source

教材优化

大数据与最优化研究所 1 year ago
parent
commit
d6de39b3ac

+ 2 - 2
src/main/java/com/xjrsoft/module/textbook/service/impl/TextbookServiceImpl.java

@@ -99,7 +99,7 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
         BeanUtils.copyProperties(textbook, textbookCoreAttribute);
         textbookCoreAttributeMapper.insert(textbookCoreAttribute);
         textbook.setTextbookCoreAttributeId(textbookCoreAttribute.getId());
-        textbook.setSubtotal(textbook.getPrice().multiply(BigDecimal.valueOf(textbook.getDiscount())));
+        textbook.setSubtotal(textbook.getPrice().multiply(BigDecimal.valueOf(textbook.getDiscount()/10)));
         textbookTextbookMapper.insert(textbook);
         for (TextbookClassRelation textbookClassRelation : textbook.getTextbookClassRelationList()) {
             textbookClassRelation.setTextbookId(textbook.getId());
@@ -949,7 +949,7 @@ public class TextbookServiceImpl extends MPJBaseServiceImpl<TextbookMapper, Text
             textbook.setUseType(UseSemesterTypeEnum.getCode(textbookImportDto.getUseTypeCn()));
 
             //处理小计
-            textbook.setSubtotal(textbook.getPrice().multiply(BigDecimal.valueOf(textbook.getDiscount())));
+            textbook.setSubtotal(textbook.getPrice().multiply(BigDecimal.valueOf(textbook.getDiscount()/10)));
 
             // 判断导入的教材是否已经存在,根据教材的 ISBN 码和使用的学期判断
             LambdaQueryWrapper<Textbook> textbookLambdaQueryWrapper = new LambdaQueryWrapper<>();