Parcourir la source

Merge branch 'online1'

周箭河 il y a 4 ans
Parent
commit
21f7e726a8

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

@@ -1096,7 +1096,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         //如果学员已经在某些班级,
         Boolean isExistClassGroup = classGroupStudentMapperDao.existByClassGroupIds(classGroupIdListStr,studentId);
         if(isExistClassGroup){
-            throw new BizException("操作失败:学员已存在");
+            return true;
         }
 		List<ClassGroup> classGroupList = classGroupDao.findClassGroupByIds(classGroupIdListStr);
 		if (classGroupList == null || classGroupList.size() == 0) {

+ 28 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -425,6 +425,16 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			}
 			musicGroup.setUpdateTime(date);
 			musicGroupDao.update(musicGroup);
+		} else if (paymentType == ADD_STUDENT) {
+
+			if (status != AUDITING) {
+				// 学生加到班级
+				String classGroupIdStr = musicGroupPaymentCalenderDto.getAttribute1();
+				if (StringUtils.isNotBlank(classGroupIdStr)) {
+					classGroupService.addStudentToClassGroupAndCourseArranging(Integer.parseInt(musicGroupPaymentCalenderDto.getStudentIds()), classGroupIdStr,
+							batchNo, musicGroupPaymentCalenderCourseSettingsList);
+				}
+			}
 		}
 
 		if (status == AUDITING) {
@@ -711,6 +721,16 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			}
 			musicGroup.setUpdateTime(date);
 			musicGroupDao.update(musicGroup);
+		} else if (paymentType == ADD_STUDENT) {
+
+			if (status != AUDITING) {
+				// 学生加到班级
+				String classGroupIdStr = musicGroupPaymentCalenderDto.getAttribute1();
+				if (StringUtils.isNotBlank(classGroupIdStr)) {
+					classGroupService.addStudentToClassGroupAndCourseArranging(Integer.parseInt(musicGroupPaymentCalenderDto.getStudentIds()), classGroupIdStr,
+							batchNo, musicGroupPaymentCalenderCourseSettingsList);
+				}
+			}
 		}
 
 		if (status == AUDITING) {
@@ -795,12 +815,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				if(musicGroupPaymentStudentCourseDetailList.size() > 0){
 					musicGroupPaymentStudentCourseDetailDao.batchInsert(musicGroupPaymentStudentCourseDetailList);
 				}
-
-				// 学生加到班级
-				String classGroupIdStr = musicGroupPaymentCalender.getAttribute1();
-				if(StringUtils.isNotBlank(classGroupIdStr)){
-					classGroupService.addStudentToClassGroupAndCourseArranging(Integer.parseInt(studentId), classGroupIdStr, musicGroupPaymentCalender.getBatchNo(), musicGroupPaymentCalenderCourseSettingsList);
-				}
 			}
 		}
 	}
@@ -1010,6 +1024,14 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				roleIds.add(SysUserRole.SECTION_MANAGER);
 				sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()), MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_APPLY, "", sysUser.getUsername());
 			}
+		} else if (calender.getPaymentType() == ADD_STUDENT) {
+
+			// 学生加到班级
+			String classGroupIdStr = calender.getAttribute1();
+			if (StringUtils.isNotBlank(classGroupIdStr)) {
+				classGroupService.addStudentToClassGroupAndCourseArranging(Integer.parseInt(calender.getStudentIds()), classGroupIdStr, batchNo,
+						musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettingsByBatchNo(batchNo));
+			}
 		}
 		musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenders);
 		//如果是合班缴费

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

@@ -130,6 +130,11 @@ public class StudentPaymentRouteOrderServiceImpl extends BaseServiceImpl<Long, S
     @Override
     @Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
     public StudentPaymentRouteOrder addOutOrder(StudentPaymentRouteOrder studentPaymentRouteOrder) {
+        Map<String, Object> params = new HashMap<>();
+        params.put("transNo", studentPaymentRouteOrder.getTransNo());
+        if(studentPaymentRouteOrderDao.queryAuditCount(params) >0){
+            throw new  BizException("流水号不能重复");
+        }
         Date nowDate = new Date();
         String orderNo = idGeneratorService.generatorId("payment") + "";
         studentPaymentRouteOrder.setOrderNo(orderNo);
@@ -251,7 +256,7 @@ public class StudentPaymentRouteOrderServiceImpl extends BaseServiceImpl<Long, S
 
                     BigDecimal hasRouteSellOrderActualAmount = BigDecimal.ZERO;
                     for (SellOrder sellOrder : sellOrderList) {
-                        if (!goodsMap.getKey().equals(sellOrder.getParentGoodsId()) && !goodsMap.getKey().equals(sellOrder.getGoodsId().toString())) {
+                        if (!goodsMap.getKey().equals(sellOrder.getParentGoodsId().toString()) && !goodsMap.getKey().equals(sellOrder.getGoodsId().toString())) {
                             continue;
                         }
                         BigDecimal sellOrderActualAmount = BigDecimal.ZERO;