Selaa lähdekoodia

Merge remote-tracking branch 'origin/master'

Joburgess 4 vuotta sitten
vanhempi
commit
3019222641

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderDetailService.java

@@ -107,9 +107,9 @@ public interface MusicGroupPaymentCalenderDetailService extends BaseService<Long
 
 
     /**
     /**
      * 主动发送学员待续费通知
      * 主动发送学员待续费通知
-     * @param calenderDetailId
+     * @param calenderId
      * @param studentIds
      * @param studentIds
      * @return
      * @return
      */
      */
-    void pushWaitRenewMessage(Long calenderDetailId, String studentIds);
+    void pushWaitRenewMessage(Long calenderId, String studentIds);
 }
 }

+ 9 - 9
mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderService.java

@@ -6,10 +6,7 @@ import java.util.Set;
 import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDetailDto;
 import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDetailDto;
 import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDto;
 import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDto;
 import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderDto;
 import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderDto;
-import com.ym.mec.biz.dal.entity.MusicGroup;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
-import com.ym.mec.biz.dal.entity.MusicGroupStudentClassAdjust;
-import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
+import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.page.MusicGroupPaymentCalenderQueryInfo;
 import com.ym.mec.biz.dal.page.MusicGroupPaymentCalenderQueryInfo;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
 import com.ym.mec.common.service.BaseService;
@@ -42,11 +39,14 @@ public interface MusicGroupPaymentCalenderService extends BaseService<Long, Musi
 	 * @return
 	 * @return
 	 */
 	 */
 	boolean makesureSchoolePaid(Long id, String memo);
 	boolean makesureSchoolePaid(Long id, String memo);
-	
-	/**
-	 * 自动更新付款日历记录状态
-	 * @return
-	 */
+
+	void addStudent(MusicGroupPaymentCalender musicGroupPaymentCalender,List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList);
+
+
+		/**
+         * 自动更新付款日历记录状态
+         * @return
+         */
 	boolean autoUpdateMusicGroupPaymentCalenderStatus();
 	boolean autoUpdateMusicGroupPaymentCalenderStatus();
 
 
 	/**
 	/**

+ 24 - 11
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderDetailServiceImpl.java

@@ -4,13 +4,16 @@ import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType.ST
 import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.*;
 import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.*;
 import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.NON_PAYMENT;
 import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.NON_PAYMENT;
 import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.PAID_COMPLETED;
 import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.PAID_COMPLETED;
+import static com.ym.mec.biz.dal.enums.PaymentStatusEnum.YES;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.util.*;
 import java.util.*;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 
+import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.MusicArrearageStudentDto;
 import com.ym.mec.biz.dal.dto.MusicArrearageStudentDto;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.entity.*;
+import com.ym.mec.biz.dal.enums.StudentMusicGroupStatusEnum;
 import com.ym.mec.biz.dal.page.ArrearageStudentsQueryInfo;
 import com.ym.mec.biz.dal.page.ArrearageStudentsQueryInfo;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.page.QueryInfo;
@@ -21,13 +24,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 
 
-import com.ym.mec.biz.dal.dao.MusicGroupDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderCourseSettingsDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDetailDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentStudentCourseDetailDao;
-import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
-import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.dto.FeeStudentDto;
 import com.ym.mec.biz.dal.dto.FeeStudentDto;
 import com.ym.mec.biz.dal.dto.SimpleUserDto;
 import com.ym.mec.biz.dal.dto.SimpleUserDto;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
@@ -66,6 +62,8 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 	@Autowired
 	@Autowired
 	private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
 	private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
 	@Autowired
 	@Autowired
+	private StudentRegistrationDao studentRegistrationDao;
+	@Autowired
 	private SysMessageService sysMessageService;
 	private SysMessageService sysMessageService;
 
 
 	@Override
 	@Override
@@ -108,6 +106,21 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 			}else {
 			}else {
 				calender.setActualNum((calender.getActualNum()==null?0:calender.getActualNum()) + 1);
 				calender.setActualNum((calender.getActualNum()==null?0:calender.getActualNum()) + 1);
 				e.setPaymentStatus(PAID_COMPLETED);
 				e.setPaymentStatus(PAID_COMPLETED);
+				if(calender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.ADD_STUDENT){
+					MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(e.getUserId(), calender.getMusicGroupId());
+					if (musicGroupStudentFee != null) {
+						musicGroupStudentFee.setUpdateTime(date);
+						musicGroupStudentFee.setLatestPaidTime(date);
+						musicGroupStudentFee.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
+						musicGroupStudentFee.setTemporaryCourseFee(new BigDecimal(0));
+						musicGroupStudentFeeDao.update(musicGroupStudentFee);
+					}
+					//如果是进行中加学员
+					StudentRegistration studentRegistration = studentRegistrationDao.queryByUserIdAndMusicGroupId(e.getUserId(), calender.getMusicGroupId());
+					studentRegistration.setPaymentStatus(YES);
+					studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
+					studentRegistrationDao.update(studentRegistration);
+				}
 			}
 			}
 		});
 		});
 		musicGroupPaymentCalenderDao.update(calender);
 		musicGroupPaymentCalenderDao.update(calender);
@@ -602,16 +615,16 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 		if(calenderDetails == null || calenderDetails.size() == 0){
 		if(calenderDetails == null || calenderDetails.size() == 0){
 			throw new BizException("发送失败:没有可以发送缴费提醒的学员");
 			throw new BizException("发送失败:没有可以发送缴费提醒的学员");
 		}
 		}
+		Set<Integer> studentIdList = calenderDetails.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
 		MusicGroupPaymentCalender paymentCalender = musicGroupPaymentCalenderDao.get(calenderId);
 		MusicGroupPaymentCalender paymentCalender = musicGroupPaymentCalenderDao.get(calenderId);
 		//未缴费
 		//未缴费
-		HashSet<String> strings = new HashSet<>(Arrays.asList(studentIds.split(",")));
-		Map<Integer,String> studentMaps = MapUtil.convertMybatisMap(musicGroupPaymentCalenderDetailDao.queryNoPaymentAndNotZeroStudent(calenderId,strings));
+		Map<Integer,String> studentMaps = MapUtil.convertMybatisMap(musicGroupPaymentCalenderDetailDao.queryNoPaymentAndNotZeroStudent(calenderId,studentIdList));
 		MusicGroup musicGroup = musicGroupDao.get(paymentCalender.getMusicGroupId());
 		MusicGroup musicGroup = musicGroupDao.get(paymentCalender.getMusicGroupId());
 		String baseUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
 		String baseUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
 		String memo = "4?" + baseUrl + "/#/musicGroupRenew?calenderId="+calenderId+"&id=" + musicGroup.getId();
 		String memo = "4?" + baseUrl + "/#/musicGroupRenew?calenderId="+calenderId+"&id=" + musicGroup.getId();
 		Map<Integer, String> push = new HashMap<>();
 		Map<Integer, String> push = new HashMap<>();
-		for (String userId : strings) {
-			push.put(Integer.parseInt(userId), userId);
+		for (Integer userId : studentIdList) {
+			push.put(userId, userId.toString());
 		}
 		}
 		// 发送续费通知
 		// 发送续费通知
 		sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_WAIT_RENEW_MESSAGE, push,
 		sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_WAIT_RENEW_MESSAGE, push,

+ 21 - 19
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -25,6 +25,7 @@ import java.util.Set;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dao.*;
+import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.enums.StudentMusicGroupStatusEnum;
 import com.ym.mec.biz.dal.enums.StudentMusicGroupStatusEnum;
 import com.ym.mec.biz.service.*;
 import com.ym.mec.biz.service.*;
@@ -45,25 +46,11 @@ import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDetailDto;
 import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDto;
 import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDto;
 import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderDto;
 import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderDto;
 import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderDto.MusicGroupPaymentDateRange;
 import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderDto.MusicGroupPaymentDateRange;
-import com.ym.mec.biz.dal.entity.ClassGroup;
 import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
 import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
-import com.ym.mec.biz.dal.entity.MusicGroup;
-import com.ym.mec.biz.dal.entity.MusicGroupBuildLog;
-import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettings;
-import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettingsDetail;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderStudentDetail;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail;
-import com.ym.mec.biz.dal.entity.MusicGroupStudentClassAdjust;
-import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
-import com.ym.mec.biz.dal.entity.Organization;
-import com.ym.mec.biz.dal.entity.OrganizationCourseUnitPriceSettings;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
 import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
 import com.ym.mec.biz.dal.page.MusicGroupPaymentCalenderQueryInfo;
 import com.ym.mec.biz.dal.page.MusicGroupPaymentCalenderQueryInfo;
@@ -839,6 +826,8 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		return true;
 		return true;
 	}
 	}
 
 
+	@Transactional(rollbackFor = Exception.class)
+	@Override
 	public void addStudent(MusicGroupPaymentCalender musicGroupPaymentCalender,List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList){
 	public void addStudent(MusicGroupPaymentCalender musicGroupPaymentCalender,List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList){
 		//如果是进行中加学生
 		//如果是进行中加学生
 		Date date = new Date();
 		Date date = new Date();
@@ -866,6 +855,22 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				musicGroupPaymentCalenderDetail.setDeadlinePaymentDate(musicGroupPaymentCalender.getDeadlinePaymentDate());
 				musicGroupPaymentCalenderDetail.setDeadlinePaymentDate(musicGroupPaymentCalender.getDeadlinePaymentDate());
 
 
 				musicGroupPaymentCalenderDetailDao.insert(musicGroupPaymentCalenderDetail);
 				musicGroupPaymentCalenderDetailDao.insert(musicGroupPaymentCalenderDetail);
+				//如果是0元那么更新fee表和studentRegistration表
+				if(totalPrice.doubleValue() == 0d){
+					MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(Integer.parseInt(studentId), musicGroupPaymentCalender.getMusicGroupId());
+					if (musicGroupStudentFee != null) {
+						musicGroupStudentFee.setUpdateTime(date);
+						musicGroupStudentFee.setLatestPaidTime(date);
+						musicGroupStudentFee.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
+						musicGroupStudentFee.setTemporaryCourseFee(new BigDecimal(0));
+						musicGroupStudentFeeDao.update(musicGroupStudentFee);
+					}
+					//如果是进行中加学员
+					StudentRegistration studentRegistration = studentRegistrationDao.queryByUserIdAndMusicGroupId(Integer.parseInt(studentId), musicGroupPaymentCalender.getMusicGroupId());
+					studentRegistration.setPaymentStatus(YES);
+					studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
+					studentRegistrationDao.update(studentRegistration);
+				}
 
 
 				// 学生加课程明细
 				// 学生加课程明细
 				for(MusicGroupPaymentCalenderCourseSettings courseSettings : musicGroupPaymentCalenderCourseSettingsList){
 				for(MusicGroupPaymentCalenderCourseSettings courseSettings : musicGroupPaymentCalenderCourseSettingsList){
@@ -1088,9 +1093,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettings(musicGroupPaymentCalender.getId());
 				List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettings(musicGroupPaymentCalender.getId());
 				addStudent(musicGroupPaymentCalender,musicGroupPaymentCalenderCourseSettings);
 				addStudent(musicGroupPaymentCalender,musicGroupPaymentCalenderCourseSettings);
 			}
 			}
-			//将0元未缴费学员缴费状态更新为已缴费
-			int j = musicGroupPaymentCalenderDetailDao.updateNoPaymentAndZeroPaymentStatus(musicGroupPaymentCalender.getId());
-			musicGroupPaymentCalender.setActualNum((musicGroupPaymentCalender.getActualNum()==null?0:musicGroupPaymentCalender.getActualNum()) + j);
 		}
 		}
 		MusicGroupPaymentCalender calender = musicGroupPaymentCalenders.get(0);
 		MusicGroupPaymentCalender calender = musicGroupPaymentCalenders.get(0);
 		//如果是报名,并且所有的报名都审核通过,需要修改乐团状态
 		//如果是报名,并且所有的报名都审核通过,需要修改乐团状态
@@ -1175,7 +1177,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 
 
 	//推送待续费通知
 	//推送待续费通知
 	public void pushWaitRenewMessage(Long calenderId,MusicGroup musicGroup,Set<Integer> studentIds){
 	public void pushWaitRenewMessage(Long calenderId,MusicGroup musicGroup,Set<Integer> studentIds){
-		if(studentIds == null){
+		/*if(studentIds == null){
 			studentIds = musicGroupPaymentCalenderDetailDao.queryNoPaymentStudentIds(calenderId);
 			studentIds = musicGroupPaymentCalenderDetailDao.queryNoPaymentStudentIds(calenderId);
 		}
 		}
 		if (studentIds.size() > 0) {
 		if (studentIds.size() > 0) {
@@ -1195,7 +1197,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.AWSMS, MessageTypeEnum.STUDENT_SMS_WAIT_RENEW_MESSAGE, studentMaps,
 				sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.AWSMS, MessageTypeEnum.STUDENT_SMS_WAIT_RENEW_MESSAGE, studentMaps,
 						null, 0, memo, null, musicGroup.getName());
 						null, 0, memo, null, musicGroup.getName());
 			}
 			}
-		}
+		}*/
 	}
 	}
 
 
     @Override
     @Override

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

@@ -109,8 +109,8 @@ public class MusicGroupPaymentCalenderDetailController extends BaseController {
     @ApiOperation(value = "发送学员待续费通知")
     @ApiOperation(value = "发送学员待续费通知")
     @PostMapping("/sendWaitRenewMessage")
     @PostMapping("/sendWaitRenewMessage")
     @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalenderDetail/sendWaitRenewMessage')")
     @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalenderDetail/sendWaitRenewMessage')")
-    public HttpResponseResult sendWaitRenewMessage(Long calenderDetailId, String studentIds) {
-        musicGroupPaymentCalenderDetailService.pushWaitRenewMessage(calenderDetailId,studentIds);
+    public HttpResponseResult sendWaitRenewMessage(Long calenderId, String studentIds) {
+        musicGroupPaymentCalenderDetailService.pushWaitRenewMessage(calenderId,studentIds);
         return succeed();
         return succeed();
     }
     }
 
 

+ 6 - 6
mec-web/src/main/java/com/ym/mec/web/controller/education/EduRepairController.java

@@ -107,12 +107,12 @@ public class EduRepairController extends BaseController {
         }
         }
         repairInfo.setEmployeeId(sysUser.getId());
         repairInfo.setEmployeeId(sysUser.getId());
         repairInfo.setEmployeeName(sysUser.getRealName());
         repairInfo.setEmployeeName(sysUser.getRealName());
-        if(repairInfo.getSendType().equals(1)){
-            Employee employee = employeeDao.get(sysUser.getId());
-            if(StringUtils.isBlank(employee.getContactAddress())){
-                return failed("联系地址为空,请联系相关人员在\"员工管理\"完善");
-            }
-        }
+//        if(repairInfo.getSendType().equals(1)){
+//            Employee employee = employeeDao.get(sysUser.getId());
+//            if(StringUtils.isBlank(employee.getContactAddress())){
+//                return failed("联系地址为空,请联系相关人员在\"员工管理\"完善");
+//            }
+//        }
         return succeed(studentRepairService.addRepair(repairInfo));
         return succeed(studentRepairService.addRepair(repairInfo));
     }
     }