瀏覽代碼

缴费项目列表,详情,审核接口修改

zouxuan 4 年之前
父節點
當前提交
4dde091a83

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

@@ -115,10 +115,10 @@ public interface MusicGroupPaymentCalenderService extends BaseService<Long, Musi
 	 * @author zouxuan
 	 * @date 2020/10/30
 	 * @time 17:39
-	 * @param calenderId:
+	 * @param batchNo:
 	 * @return void
 	 */
-	void auditPass(Long calenderId,String auditMemo);
+	void auditPass(String batchNo,String auditMemo);
 
 	/**
 	 * @describe 审核拒绝
@@ -126,10 +126,10 @@ public interface MusicGroupPaymentCalenderService extends BaseService<Long, Musi
 	 * @author zouxuan
 	 * @date 2020/10/30
 	 * @time 17:39
-	 * @param calenderId:
+	 * @param batchNo:
 	 * @return void
 	 */
-	void auditRefuse(Long calenderId,String auditMemo);
+	void auditRefuse(String batchNo,String auditMemo);
 
 	/**
 	 * 获取乐团报名的缴费日历

+ 49 - 34
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -612,27 +612,39 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public void auditPass(Long calenderId,String auditMemo) {
-		MusicGroupPaymentCalender musicGroupPaymentCalender = musicGroupPaymentCalenderDao.get(calenderId);
-		Date date = new Date();
-		//如果是报名项目,将乐团改为审核中,缴费项目修改状态,审核状态改为审核通过
-		if(musicGroupPaymentCalender.getPayUserType() == SCHOOL){
-			musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
-		}else if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
-			musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
-		}else if (date.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
-			musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OVER);
-		}else {
-			musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.NO);
+	public void auditPass(String batchNo,String auditMemo) {
+		List<MusicGroupPaymentCalender> musicGroupPaymentCalenders = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);
+		if(musicGroupPaymentCalenders == null || musicGroupPaymentCalenders.size() == 0){
+			throw new BizException("缴费项目不存在");
 		}
-		musicGroupPaymentCalender.setAuditMemo(auditMemo);
-		musicGroupPaymentCalender.setUpdateTime(date);
+		Date date = new Date();
+		for (MusicGroupPaymentCalender musicGroupPaymentCalender : musicGroupPaymentCalenders) {
+			//如果是报名项目,将乐团改为审核中,缴费项目修改状态,审核状态改为审核通过
+			if(musicGroupPaymentCalender.getPayUserType() == SCHOOL){
+				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
+			}else if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
+				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
+			}else if (date.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
+				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OVER);
+			}else {
+				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.NO);
+			}
+			musicGroupPaymentCalender.setAuditMemo(auditMemo);
+			musicGroupPaymentCalender.setUpdateTime(date);
 
+			if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
+				musicGroupPaymentCalender.setExpectNum(1);
+				List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettings(musicGroupPaymentCalender.getId());
+				addStudent(musicGroupPaymentCalender,musicGroupPaymentCalenderCourseSettings);
+			}
+		}
+		MusicGroupPaymentCalender calender = musicGroupPaymentCalenders.get(0);
 		//如果是报名,并且所有的报名都审核通过,需要修改乐团状态
-		if (musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY) {
-			int count = musicGroupPaymentCalenderDao.countAuditReject(musicGroupPaymentCalender.getMusicGroupId(),calenderId);
+		if (calender.getPaymentType() == MUSIC_APPLY) {
+			//统计乐团还在审核中或者审核被拒的缴费
+			int count = musicGroupPaymentCalenderDao.countAuditReject(calender.getMusicGroupId(),calender.getId());
 			if(count == 0){
-				MusicGroup musicGroup = musicGroupDao.get(musicGroupPaymentCalender.getMusicGroupId());
+				MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
 				musicGroup.setStatus(MusicGroupStatusEnum.AUDIT);
 				musicGroup.setUpdateTime(date);
 				musicGroupDao.update(musicGroup);
@@ -646,35 +658,38 @@ 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 (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
-			musicGroupPaymentCalender.setExpectNum(1);
-			List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettings(calenderId);
-			addStudent(musicGroupPaymentCalender,musicGroupPaymentCalenderCourseSettings);
 		}
-		musicGroupPaymentCalenderDao.update(musicGroupPaymentCalender);
+		musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenders);
 	}
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public void auditRefuse(Long calenderId,String auditMemo) {
-		MusicGroupPaymentCalender musicGroupPaymentCalender = musicGroupPaymentCalenderDao.get(calenderId);
+	public void auditRefuse(String batchNo,String auditMemo) {
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		if(sysUser == null || sysUser.getId() == null){
+			throw new BizException("请重新登录");
+		}
+		List<MusicGroupPaymentCalender> musicGroupPaymentCalenders = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);
+		if(musicGroupPaymentCalenders == null || musicGroupPaymentCalenders.size() == 0){
+			throw new BizException("缴费项目不存在");
+		}
 		Date date = new Date();
-		musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.REJECT);
-		musicGroupPaymentCalender.setUpdateTime(date);
-		musicGroupPaymentCalender.setAuditMemo(auditMemo);
-		musicGroupPaymentCalenderDao.update(musicGroupPaymentCalender);
-		if (musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY) {
-			MusicGroup musicGroup = musicGroupDao.get(musicGroupPaymentCalender.getMusicGroupId());
+		for (MusicGroupPaymentCalender musicGroupPaymentCalender : musicGroupPaymentCalenders) {
+			musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.REJECT);
+			musicGroupPaymentCalender.setUpdateTime(date);
+			musicGroupPaymentCalender.setAuditMemo(auditMemo);
+		}
+		MusicGroupPaymentCalender calender = musicGroupPaymentCalenders.get(0);
+		//如果是报名,并且所有的报名都审核通过,需要修改乐团状态
+		if (calender.getPaymentType() == MUSIC_APPLY) {
+			MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
 			musicGroup.setStatus(MusicGroupStatusEnum.DRAFT);
 			musicGroup.setUpdateTime(date);
 			musicGroupDao.update(musicGroup);
-			SysUser sysUser = sysUserFeignService.queryUserInfo();
-			if(sysUser == null || sysUser.getId() == null){
-				throw new BizException("请重新登录");
-			}
 			//记录操作日志
 			musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "报名缴费项目失败(费用审核中 -> 草稿)", sysUser.getId(), ""));
 		}
+		musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenders);
 	}
 
 	//推送待续费通知

+ 4 - 4
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderController.java

@@ -137,16 +137,16 @@ public class MusicGroupPaymentCalenderController extends BaseController {
     @ApiOperation(value = "乐团缴费日历审核通过")
     @PostMapping("/auditPass")
     @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalender/auditPass')")
-    public Object auditPass(Long calenderId,String auditMemo) {
-        musicGroupPaymentCalenderService.auditPass(calenderId,auditMemo);
+    public Object auditPass(String batchNo,String auditMemo) {
+        musicGroupPaymentCalenderService.auditPass(batchNo,auditMemo);
         return succeed();
     }
 
     @ApiOperation(value = "乐团缴费日历审核拒绝")
     @PostMapping("/auditRefuse")
     @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalender/auditRefuse')")
-    public Object auditRefuse(Long calenderId,String auditMemo) {
-        musicGroupPaymentCalenderService.auditRefuse(calenderId,auditMemo);
+    public Object auditRefuse(String batchNo,String auditMemo) {
+        musicGroupPaymentCalenderService.auditRefuse(batchNo,auditMemo);
         return succeed();
     }