yonge %!s(int64=5) %!d(string=hai) anos
pai
achega
9582919ce7

+ 27 - 10
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ContractServiceImpl.java

@@ -19,9 +19,11 @@ import org.springframework.stereotype.Service;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
+import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
 import com.ym.mec.biz.dal.dto.StudentInfo;
 import com.ym.mec.biz.dal.entity.Goods;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
+import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
 import com.ym.mec.biz.dal.entity.MusicGroupSubjectPlan;
 import com.ym.mec.biz.dal.entity.StudentRegistration;
 import com.ym.mec.biz.dal.entity.Subject;
@@ -69,6 +71,9 @@ public class ContractServiceImpl implements ContractService {
 
 	@Autowired
 	private MusicGroupPaymentCalenderDao musicGroupPaymentCalenderDao;
+	
+	@Autowired
+	private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
 
 	@Autowired
 	private MusicGroupSubjectGoodsGroupService musicGroupSubjectGoodsGroupService;
@@ -250,12 +255,18 @@ public class ContractServiceImpl implements ContractService {
 		if (studentRegistration == null) {
 			throw new BizException("用户 报名信息不存在");
 		}
-		MusicGroupSubjectPlan musicGroupSubjectPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(musicGroupId,
-				studentRegistration.getActualSubjectId());
-		if (musicGroupSubjectPlan == null) {
-			throw new BizException("声部课程费用设置找不到");
+		MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(userId, musicGroupId);
+		if (musicGroupStudentFee == null) {
+			MusicGroupSubjectPlan musicGroupSubjectPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(musicGroupId,
+					studentRegistration.getActualSubjectId());
+			if (musicGroupSubjectPlan == null) {
+				throw new BizException("声部课程费用设置找不到");
+			}
+			params.put("courseFee", musicGroupSubjectPlan.getFee().doubleValue());
+		} else {
+			params.put("courseFee", musicGroupStudentFee.getTemporaryCourseFee().doubleValue() > 0 ? musicGroupStudentFee.getTemporaryCourseFee().doubleValue()
+					: musicGroupStudentFee.getCourseFee().doubleValue());
 		}
-		params.put("courseFee", musicGroupSubjectPlan.getFee().doubleValue());
 
 		// 收费形式
 		List<MusicGroupPaymentCalender> calenders = musicGroupPaymentCalenderDao.findByMusicGroupId(musicGroupId);
@@ -327,12 +338,18 @@ public class ContractServiceImpl implements ContractService {
 		if (studentRegistration == null) {
 			throw new BizException("用户 报名信息不存在");
 		}
-		MusicGroupSubjectPlan musicGroupSubjectPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(musicGroupId,
-				studentRegistration.getActualSubjectId());
-		if (musicGroupSubjectPlan == null) {
-			throw new BizException("声部课程费用设置找不到");
+		MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(userId, musicGroupId);
+		if (musicGroupStudentFee == null) {
+			MusicGroupSubjectPlan musicGroupSubjectPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(musicGroupId,
+					studentRegistration.getActualSubjectId());
+			if (musicGroupSubjectPlan == null) {
+				throw new BizException("声部课程费用设置找不到");
+			}
+			params.put("courseFee", musicGroupSubjectPlan.getFee().doubleValue());
+		} else {
+			params.put("courseFee", musicGroupStudentFee.getTemporaryCourseFee().doubleValue() > 0 ? musicGroupStudentFee.getTemporaryCourseFee().doubleValue()
+					: musicGroupStudentFee.getCourseFee().doubleValue());
 		}
-		params.put("courseFee", musicGroupSubjectPlan.getFee().doubleValue());
 
 		// 收费形式
 		List<MusicGroupPaymentCalender> calenders = musicGroupPaymentCalenderDao.findByMusicGroupId(musicGroupId);

+ 7 - 4
mec-biz/src/main/resources/config/contracts/courses.ftl

@@ -80,7 +80,7 @@
         <div style="display: flex;">乙方:
             <div style="flex: 1 auto;">
                 <div class="iInfo">
-                    <span>家长姓名 ${studentInfo.parentsName!}</span>
+                    <span>家长姓名 ${studentInfo.parentsName!}</span>
                     <span>电话: ${studentInfo.phone!}</span>
                 </div>
                 <div class="iInfo">
@@ -106,7 +106,7 @@
         
         <div class="iInfoContent">
             <span>授课类别:${classesType}</span>
-            <span>课程费用:${courseFee?string("0.00")}</span>
+            <span>课程费用:${courseFee?string("0.00")}</span>
             <span>收费形式:${paymentcalender}</span>
         </div>
 
@@ -160,14 +160,17 @@
             <div class="sign">甲方签章:深圳大雅乐盟网络教育股份有限公司<img class="cachet" src="https://daya-online.oss-cn-beijing.aliyuncs.com/website/cachet.png" alt="" />
                 <span>日期:${.now?string("yyyy年MM月dd日")}</span>
             </div>
+            <div class="sign">乙方签字:${studentInfo.parentsName!}
+                <span>日期:${.now?string("yyyy年MM月dd日")} </span>
+            </div>
         	<#else>
             <div class="sign">甲方签章:深圳大雅乐盟网络教育股份有限公司
                 <span>日期:${.now?string("yyyy年MM月dd日")}</span>
             </div>
-        	</#if>
-            <div class="sign">乙方签字:${studentInfo.realName!}
+            <div class="sign">乙方签字:
                 <span>日期:${.now?string("yyyy年MM月dd日")} </span>
             </div>
+        	</#if>
         </div>
     </div>
 </body>

+ 7 - 4
mec-biz/src/main/resources/config/contracts/goods.ftl

@@ -79,7 +79,7 @@
         <div style="display: flex;">乙方:
             <div style="flex: 1 auto;">
                 <div class="iInfo">
-                    <span>家长姓名 ${studentInfo.parentsName!}</span>
+                    <span>家长姓名 ${studentInfo.parentsName!}</span>
                     <span>电话: ${studentInfo.phone!}</span>
                 </div>
                 <div class="iInfo">
@@ -113,7 +113,7 @@
         </div>
         <div class="iInfo">
             <span>型号:${goodsList[0].specification}</span>
-            <span>团购价格:${goodsList[0].groupPurchasePrice?string("0.00")}</span>
+            <span>团购价格:${goodsList[0].groupPurchasePrice?string("0.00")}</span>
         </div>
 
         <h2>四、违约责任</h2>  
@@ -139,14 +139,17 @@
             <div class="sign">甲方签章:深圳大雅乐盟网络教育股份有限公司<img class="cachet" src="https://daya-online.oss-cn-beijing.aliyuncs.com/website/cachet.png" alt="" />
                 <span>日期:${.now?string("yyyy年MM月dd日")}</span>
             </div>
+            <div class="sign">乙方签字:${studentInfo.parentsName!}
+                <span>日期:${.now?string("yyyy年MM月dd日")} </span>
+            </div>
         	<#else>
             <div class="sign">甲方签章:深圳大雅乐盟网络教育股份有限公司
                 <span>日期:${.now?string("yyyy年MM月dd日")}</span>
             </div>
-            </#if>
-            <div class="sign">乙方签字:${studentInfo.realName!}
+            <div class="sign">乙方签字:
                 <span>日期:${.now?string("yyyy年MM月dd日")} </span>
             </div>
+            </#if>
         </div>
     </div>
 </body>