Explorar o código

Merge remote-tracking branch 'origin/master'

zouxuan %!s(int64=4) %!d(string=hai) anos
pai
achega
069ec31204

+ 18 - 30
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -1791,9 +1791,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
             //5、插入班级排课信息
             LocalDateTime now = LocalDate.parse(classGroup4MixDto.getStartDate(), DateTimeFormatter.ofPattern("yyyy-MM-dd")).atStartOfDay();
 
-            long courseDuration = Duration.between(LocalDateTime.parse(classGroup4MixDto.getStartDate() + " " + classGroup4MixDto.getCourseTimeDtoList().get(0).getStartClassTime() + ":00", formatter),
-                    LocalDateTime.parse(classGroup4MixDto.getStartDate() + " " + classGroup4MixDto.getCourseTimeDtoList().get(0).getEndClassTime() + ":00", formatter))
-                    .toMinutes();
+            long totalCourseDuration = 0;
 
             if(!courseTypeMinutesMap.containsKey(classGroup4MixDto.getCourseType().getCode())){
                 throw new BizException("{}课程类型暂无剩余课程时长", classGroup4MixDto.getCourseType().getMsg());
@@ -1805,8 +1803,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                 throw new BizException("{}课程类型剩余课程时长不足", classGroup4MixDto.getCourseType().getMsg());
             }
 
-            int times = 0;
-
             Set<String> holidayDays = new HashSet<>();
 
             if (classGroup4MixDto.getHoliday()) {
@@ -1834,6 +1830,11 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                             LocalDateTime.parse(classGroup4MixDto.getStartDate() + " " + courseTimeDto.getEndClassTime() + ":00", formatter))
                             .toMinutes();
 
+                    totalCourseDuration += classCourseDuration;
+
+                    if (totalCourseDuration>totalMinutes) {
+                        break WhileNode;
+                    }
 
                     Date classDate = DateConvertor.toDate(now);
                     String startClassTime = DateUtil.getDate(classDate) + " " + courseTimeDto.getStartClassTime() + ":00";
@@ -1865,8 +1866,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                     courseScheduleDao.insert(courseSchedule);
                     courseScheduleList.add(courseSchedule);
 
-                    times++;
-
                     for (ClassGroupTeacherMapper classGroupTeacherMapper : classGroupTeacherMapperList) {
                         List<TeacherDefaultMusicGroupSalary> teacherSalaryList = teacherDefaultMusicGroupSalaryService.getTeacherSalaryByUserIdAndType(classGroupTeacherMapper.getUserId(), null, null);
                         BigDecimal salary = new BigDecimal("0");
@@ -1960,9 +1959,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                         courseScheduleTeacherSalary.setUpdateTime(date);
                         courseScheduleTeacherSalaryList.add(courseScheduleTeacherSalary);
                     }
-                    if (classGroup4MixDto.getCourseTimes().equals(times)) {
-                        break WhileNode;
-                    }
                 }
                 now = now.plusDays(1);
             }
@@ -2470,16 +2466,13 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                 throw new BizException("{}课程类型暂无剩余课程时长", classGroup4MixDto.getCourseType().getMsg());
             }
             Integer totalMinutes = courseTypeMinutesMap.get(classGroup4MixDto.getCourseType().getCode());
-            long courseDuration = Duration.between(LocalDateTime.parse(classGroup4MixDto.getStartDate() + " " + classGroup4MixDto.getCourseTimeDtoList().get(0).getStartClassTime() + ":00", formatter),
-                    LocalDateTime.parse(classGroup4MixDto.getStartDate() + " " + classGroup4MixDto.getCourseTimeDtoList().get(0).getEndClassTime() + ":00", formatter))
-                    .toMinutes();
+            long totalCourseDuration = 0;
 //            classGroup4MixDto.setCourseTimes(totalMinutes/(int)courseDuration);
 
             if(classGroup4MixDto.getCourseTimes()<=0){
                 throw new BizException("{}课程类型剩余课程时长不足", classGroup4MixDto.getCourseType().getMsg());
             }
 
-            int times = 0;
             Set<String> holidayDays = new HashSet<>();
             if (classGroup4MixDto.getHoliday()) {
                 SysConfig holidaySetting = sysConfigService.findByParamName(SysConfigService.HOLIDAY_SETTING);
@@ -2506,6 +2499,11 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                             LocalDateTime.parse(classGroup4MixDto.getStartDate() + " " + courseTimeDto.getEndClassTime() + ":00", formatter))
                             .toMinutes();
 
+                    totalCourseDuration += classCourseDuration;
+
+                    if (totalCourseDuration>totalMinutes) {
+                        break WhileNode;
+                    }
 
                     Date classDate = DateConvertor.toDate(now);
                     String startClassTime = DateUtil.getDate(classDate) + " " + courseTimeDto.getStartClassTime() + ":00";
@@ -2535,7 +2533,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                     courseSchedule.setClassGroupType(classGroup.getType().getCode());
                     courseScheduleDao.insert(courseSchedule);
                     courseScheduleList.add(courseSchedule);
-                    times++;
 
                     for (ClassGroupTeacherMapper classGroupTeacherMapper : newClassGroupTeacherMapperList) {
                         List<TeacherDefaultMusicGroupSalary> teacherSalaryList = teacherDefaultMusicGroupSalaryService.getTeacherSalaryByUserIdAndType(classGroupTeacherMapper.getUserId(), null, null);
@@ -2631,15 +2628,9 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                         courseScheduleTeacherSalary.setUpdateTime(date);
                         courseScheduleTeacherSalaryList.add(courseScheduleTeacherSalary);
                     }
-                    if (classGroup4MixDto.getCourseTimes().equals(times)) {
-                        break WhileNode;
-                    }
                 }
 
                 now = now.plusDays(1);
-                if (classGroup4MixDto.getCourseTimes().equals(times)) {
-                    break;
-                }
             }
         }
 
@@ -2772,16 +2763,13 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                 throw new BizException("{}课程类型暂无剩余课程时长", classGroup4MixDto.getCourseType().getMsg());
             }
             Integer totalMinutes = courseTypeMinutesMap.get(classGroup4MixDto.getCourseType().getCode());
-            long courseDuration = Duration.between(LocalDateTime.parse(classGroup4MixDto.getStartDate() + " " + classGroup4MixDto.getCourseTimeDtoList().get(0).getStartClassTime() + ":00", formatter),
-                    LocalDateTime.parse(classGroup4MixDto.getStartDate() + " " + classGroup4MixDto.getCourseTimeDtoList().get(0).getEndClassTime() + ":00", formatter))
-                    .toMinutes();
+            long totalCourseDuration = 0;
 //            classGroup4MixDto.setCourseTimes(totalMinutes/(int)courseDuration);
 
             if(classGroup4MixDto.getCourseTimes()<=0){
                 throw new BizException("{}课程类型剩余课程时长不足", classGroup4MixDto.getCourseType().getMsg());
             }
 
-            int times = 0;
             Set<String> holidayDays = new HashSet<>();
             if (classGroup4MixDto.getHoliday()) {
                 SysConfig holidaySetting = sysConfigService.findByParamName(SysConfigService.HOLIDAY_SETTING);
@@ -2809,6 +2797,11 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                             LocalDateTime.parse(classGroup4MixDto.getStartDate() + " " + courseTimeDto.getEndClassTime() + ":00", formatter))
                             .toMinutes();
 
+                    totalCourseDuration += classCourseDuration;
+
+                    if (totalCourseDuration>totalMinutes) {
+                        break WhileNode;
+                    }
 
                     Date classDate = DateConvertor.toDate(now);
                     String startClassTime = DateUtil.getDate(classDate) + " " + courseTimeDto.getStartClassTime() + ":00";
@@ -2840,8 +2833,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
                     courseScheduleDao.insert(courseSchedule);
 
-                    times++;
-
                     for (ClassGroupTeacherMapper classGroupTeacherMapper : classGroupTeacherMapperList) {
                         List<TeacherDefaultMusicGroupSalary> teacherSalaryList = teacherDefaultMusicGroupSalaryService.getTeacherSalaryByUserIdAndType(classGroupTeacherMapper.getUserId(), null, null);
                         BigDecimal salary = new BigDecimal("0");
@@ -2929,9 +2920,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                         courseScheduleTeacherSalary.setUpdateTime(date);
                         courseScheduleTeacherSalaryList.add(courseScheduleTeacherSalary);
                     }
-                    if (classGroup4MixDto.getCourseTimes().equals(times)) {
-                        break WhileNode;
-                    }
                 }
 
                 now = now.plusDays(1);

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentRouteOrderServiceImpl.java

@@ -517,7 +517,7 @@ public class StudentPaymentRouteOrderServiceImpl extends BaseServiceImpl<Long, S
                 studentPaymentRouteOrder.setRouteAmount(studentPaymentRouteOrder.getSaleAmount().add(studentPaymentRouteOrder.getServiceAmount()));
                 studentPaymentRouteOrder.setCreateBy(sysUser.getId());
                 studentPaymentRouteOrder.setUpdateBy(sysUser.getId());
-                studentPaymentRouteOrder.setUserId(sysUser.getId());
+                //studentPaymentRouteOrder.setUserId(sysUser.getId());
                 studentPaymentRouteOrders.add(studentPaymentRouteOrder);
             }
         }

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/StudentPaymentRouteOrderMapper.xml

@@ -378,7 +378,7 @@
 		<include refid="global.limit" />
 	</select>
     <select id="sumAmountByCalenderId" resultType="java.math.BigDecimal">
-        SELECT IF(SUM(route_amount_) IS NULL,0, SUM(route_amount_))FROM student_payment_route_order WHERE calender_id_ = #{calenderId}
+        SELECT IF(SUM(route_amount_) IS NULL,0, SUM(route_amount_)) FROM student_payment_route_order WHERE calender_id_ = #{calenderId} AND audit_status_='PASS'
     </select>
 
 </mapper>

+ 6 - 8
mec-util/src/main/java/com/ym/mec/util/excel/POIUtil.java

@@ -450,7 +450,7 @@ public class POIUtil {
 			}
 
 			List<Map<String, Object>> datas = new ArrayList<Map<String, Object>>();
-			rowIter = sheet.iterator();
+			rowIter = sheet.rowIterator();
 			while (rowIter.hasNext()) {
 				Map<String, Object> obj = null;
 				boolean hasVal = false;
@@ -460,7 +460,7 @@ public class POIUtil {
 					currentRowNum++;
 
 					if (currentRowNum == 1) {// 第一列表示英文名称对应表字段
-						cellIter = row.iterator();
+						cellIter = row.cellIterator();
 						// 列号清零
 						List<String> names = new ArrayList<String>();
 						while (cellIter.hasNext()) {
@@ -476,15 +476,13 @@ public class POIUtil {
 					}
 					// 实例化对象
 					obj = new HashMap<>();
-					cellIter = row.iterator();
 					// 列号清零
 					currentCellNum = 0;
-					while (cellIter.hasNext() && currentCellNum < fieldsName.length) {
-						cell = cellIter.next();
-						int columnIndex = cell.getColumnIndex();
-						cell.setCellType(Cell.CELL_TYPE_STRING);
+					while (currentCellNum < fieldsName.length) {
 						String fieldValue = "";
-						if (columnIndex == currentCellNum) {
+						cell = row.getCell(currentCellNum);
+						if (cell != null) {
+							cell.setCellType(Cell.CELL_TYPE_STRING);
 							fieldValue = cell.getStringCellValue();
 						}
 						if (StringUtils.isNotBlank(fieldValue)) {

+ 2 - 0
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -1162,6 +1162,7 @@ public class ExportController extends BaseController {
                     row.setRepairFee(feeByType.getExpectAmount().subtract(feeByType.getMusicalFee()).subtract(feeByType.getTeachingFee()));
                 } else if (row.getType().equals(OrderTypeEnum.OUTORDER)) {
                     row.setCourseFee(feeByType.getExpectAmount().subtract(feeByType.getMusicalFee()).subtract(feeByType.getTeachingFee()));
+                    row.setTransferFee(BigDecimal.ZERO);
                 }
             }
             String paymentChannel = "";
@@ -2242,6 +2243,7 @@ public class ExportController extends BaseController {
                     row.setRepairFee(feeByType.getExpectAmount().subtract(feeByType.getMusicalFee()).subtract(feeByType.getTeachingFee()));
                 } else if (row.getType().equals(OrderTypeEnum.OUTORDER)) {
                     row.setCourseFee(feeByType.getExpectAmount().subtract(feeByType.getMusicalFee()).subtract(feeByType.getTeachingFee()));
+                    row.setTransferFee(BigDecimal.ZERO);
                 }
             }
             String paymentChannel = "";

BIN=BIN
mec-web/src/main/resources/excelTemplate/财务管理导入模板.xls