|
@@ -3672,8 +3672,8 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
Map<Integer, Integer> studentCLassMap = new HashMap<>();
|
|
|
List<Map<Integer, BigDecimal>> surplusCourseFeeMapList = new ArrayList<>();
|
|
|
List<Map<String,String>> classGroupStudents = (List<Map<String,String>>)JSON.parse(classGroupStudentMap);
|
|
|
- Map<Integer,Map<String, BigDecimal>> classGroupUnitPriceMap = new HashMap<>();
|
|
|
- Map<Integer,Map<String, BigDecimal>> classSubCoursePriceMap = new HashMap<>();
|
|
|
+// Map<Integer,Map<String, BigDecimal>> classGroupUnitPriceMap = new HashMap<>();
|
|
|
+// Map<Integer,Map<String, BigDecimal>> classSubCoursePriceMap = new HashMap<>();
|
|
|
for (Map<String, String> classGroupStudent : classGroupStudents) {
|
|
|
for (String integer : classGroupStudent.keySet()) {
|
|
|
//获取学员剩余课程费用
|
|
@@ -3683,9 +3683,10 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
throw new BizException("操作失败:班级所在乐团状态不支持");
|
|
|
}
|
|
|
//学员可能来自不同的分部,获取对应的课程单价
|
|
|
- classGroupUnitPriceMap.put(Integer.parseInt(integer),MapUtil.convertIntegerMap(organizationCourseUnitPriceSettingsDao.queryMapByOrganIdAndChargeTypeId(byClassId.getChargeTypeId(), byClassId.getOrganId())));
|
|
|
+// classGroupUnitPriceMap.put(Integer.parseInt(integer),MapUtil.convertIntegerMap(organizationCourseUnitPriceSettingsDao.queryMapByOrganIdAndChargeTypeId(byClassId.getChargeTypeId(), byClassId.getOrganId())));
|
|
|
+
|
|
|
//获取班级剩余课程时长
|
|
|
- classSubCoursePriceMap.put(Integer.parseInt(integer),MapUtil.convertIntegerMap(courseScheduleDao.querySubCourseTimeMap(Integer.parseInt(integer))));
|
|
|
+// classSubCoursePriceMap.put(Integer.parseInt(integer),MapUtil.convertIntegerMap(courseScheduleDao.querySubCourseTimeMap(Integer.parseInt(integer))));
|
|
|
String[] s = classGroupStudent.get(integer).split(",");
|
|
|
for (String s1 : s) {
|
|
|
studentCLassMap.put(Integer.parseInt(s1),Integer.parseInt(integer));
|
|
@@ -3718,23 +3719,25 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
Map<Integer, BigDecimal> totalPriceMap = new HashMap<>();
|
|
|
//课程余额转移
|
|
|
for (Integer studentId : studentCLassMap.keySet()) {
|
|
|
+ //学员剩余课程价值
|
|
|
+ BigDecimal totalPrice = courseScheduleStudentPaymentDao.querySubCoursePriceMap(studentId,studentCLassMap.get(studentId),s);
|
|
|
//学员剩余课程余额
|
|
|
BigDecimal bigDecimal = surplusCourseFeeMap.get(studentId);
|
|
|
//创建学员缴费项目
|
|
|
MusicGroupPaymentCalenderStudentDetail calenderDto = new MusicGroupPaymentCalenderStudentDetail();
|
|
|
calenderDto.setClassGroupId(studentCLassMap.get(studentId));
|
|
|
//学员班级剩余课程价值
|
|
|
- Map<String, BigDecimal> subCoursePriceMap = classSubCoursePriceMap.get(calenderDto.getClassGroupId());
|
|
|
- Map<String, BigDecimal> unitPriceMap = classGroupUnitPriceMap.get(calenderDto.getClassGroupId());
|
|
|
- BigDecimal courseTime = subCoursePriceMap.get(s);
|
|
|
- BigDecimal unitPrice = unitPriceMap.get(s);
|
|
|
- if (unitPrice == null) {
|
|
|
- throw new BizException("分部默认课程类型单价不存在,请设置");
|
|
|
- }
|
|
|
- if(courseTime == null){
|
|
|
- courseTime = BigDecimal.ZERO;
|
|
|
- }
|
|
|
- BigDecimal totalPrice = unitPrice.multiply(courseTime).setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
|
+// Map<String, BigDecimal> subCoursePriceMap = classSubCoursePriceMap.get(calenderDto.getClassGroupId());
|
|
|
+// Map<String, BigDecimal> unitPriceMap = classGroupUnitPriceMap.get(calenderDto.getClassGroupId());
|
|
|
+// BigDecimal courseTime = subCoursePriceMap.get(s);
|
|
|
+// BigDecimal unitPrice = unitPriceMap.get(s);
|
|
|
+// if (unitPrice == null) {
|
|
|
+// throw new BizException("分部默认课程类型单价不存在,请设置");
|
|
|
+// }
|
|
|
+ if(totalPrice == null){
|
|
|
+ totalPrice = BigDecimal.ZERO;
|
|
|
+ }
|
|
|
+// BigDecimal totalPrice = unitPrice.multiply(courseTime).setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
|
totalPriceMap.put(studentId,totalPrice);
|
|
|
calenderDto.setMasterSubCoursePrice(masterTotalPrice);
|
|
|
BigDecimal subCourseAmount = new BigDecimal(Math.min(Math.min(masterTotalPrice.doubleValue(), totalPrice.doubleValue()), bigDecimal.doubleValue()));
|
|
@@ -3758,7 +3761,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
// bigDecimal = bigDecimal.subtract(totalPrice);
|
|
|
surplusCourseFeeMap.put(studentId,bigDecimal.subtract(masterTotalPrice));
|
|
|
}
|
|
|
- calenderDto.setCourseTime(courseTime.intValue());
|
|
|
+// calenderDto.setCourseTime(courseTime.intValue());
|
|
|
calenderDto.setCourseType(s);
|
|
|
|
|
|
calenderDto.setPhone(phoneMaps.get(studentId));
|