Browse Source

Merge remote-tracking branch 'origin/master'

Joburgess 5 years ago
parent
commit
f06a192dbb
21 changed files with 143 additions and 102 deletions
  1. 0 0
      cms/src/main/resources/application-template.yml
  2. 0 0
      mec-auth/mec-auth-server/src/main/resources/application-template.yml
  3. 17 60
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderDetailServiceImpl.java
  4. 28 5
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java
  5. 1 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  6. 5 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupSubjectPlanServiceImpl.java
  7. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java
  8. 4 4
      mec-biz/src/main/resources/config/mybatis/ChargeTypeSubjectMapperMapper.xml
  9. 2 6
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderDetailMapper.xml
  10. 0 1
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMapper.xml
  11. 0 0
      mec-eureka/src/main/resources/application-template.yml
  12. 0 0
      mec-gateway/mec-gateway-web/src/main/resources/application-template.yml
  13. 0 0
      mec-im/src/main/resources/application-template.yml
  14. 2 2
      mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupController.java
  15. 14 12
      mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupPaymentCalenderController.java
  16. 0 0
      mec-student/src/main/resources/application-template.yml
  17. 0 0
      mec-task/src/main/resources/application-template.yml
  18. 0 0
      mec-teacher/src/main/resources/application-template.yml
  19. 51 0
      mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java
  20. 18 6
      mec-web/src/main/java/com/ym/mec/web/controller/StudentRegistrationController.java
  21. 0 0
      mec-web/src/main/resources/application-template.yml

+ 0 - 0
cms/src/main/resources/application.yml → cms/src/main/resources/application-template.yml


+ 0 - 0
mec-auth/mec-auth-server/src/main/resources/application.yml → mec-auth/mec-auth-server/src/main/resources/application-template.yml


+ 17 - 60
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderDetailServiceImpl.java

@@ -1,41 +1,10 @@
 package com.ym.mec.biz.service.impl;
 
-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 java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-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.dao.*;
 import com.ym.mec.biz.dal.dto.FeeStudentDto;
 import com.ym.mec.biz.dal.dto.SimpleUserDto;
-import com.ym.mec.biz.dal.entity.MusicGroup;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
+import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail;
-import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.service.MusicGroupPaymentCalenderDetailService;
@@ -45,6 +14,17 @@ import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.math.BigDecimal;
+import java.util.*;
+import java.util.stream.Collectors;
+
+import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.NON_PAYMENT;
+import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.PAID_COMPLETED;
 
 @Service
 public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<Long, MusicGroupPaymentCalenderDetail>  implements MusicGroupPaymentCalenderDetailService {
@@ -146,40 +126,17 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 		if(calenderDetails.size() == 0){
 			return "操作失败,没有可以开启缴费的学员";
 		}
-//		Long musicGroupPaymentCalenderId = calenderDetails.get(0).getMusicGroupPaymentCalenderId();
-//		MusicGroupPaymentCalender calender = musicGroupPaymentCalenderDao.get(musicGroupPaymentCalenderId);
-//		Date startPaymentDate = calender.getStartPaymentDate();
-//		Date deadlinePaymentDate = calender.getDeadlinePaymentDate();
 		int length = ids.split(",").length;
 		Date date = new Date();
-		Iterator<MusicGroupPaymentCalenderDetail> iterator = calenderDetails.iterator();
-		MusicGroupPaymentCalenderDetail next;
-		while(iterator.hasNext()){
-			next = iterator.next();
-			Integer countOpenPayment = musicGroupPaymentCalenderDetailDao.countOpenPayment(next.getMusicGroupId(), next.getUserId());
-			if(countOpenPayment > 0){
-				iterator.remove();
-			}
-			/*int count1 = musicGroupPaymentCalenderDao.queryIntersectionByPaymentDate(next.getMusicGroupId(),startPaymentDate,deadlinePaymentDate);
-			int count = musicGroupPaymentCalenderDetailDao.queryIntersectionByPaymentDate(next.getMusicGroupId(),next.getUserId());
-			if(count > 0 || count1 > 0){
-				iterator.remove();
-			}*/
-		}
-		if(calenderDetails.size() == 0){
-			return "操作失败,学员有未完成的订单";
-		}
-		String musicGroupId = calenderDetails.get(0).getMusicGroupId();
+		Long calenderId = calenderDetails.get(0).getMusicGroupPaymentCalenderId();
+		MusicGroupPaymentCalender calender = musicGroupPaymentCalenderDao.get(calenderId);
 		calenderDetails.forEach(e->{
 			e.setUpdateTime(date);
 			e.setOpen(1);
-//			e.setPaymentStatus(PROCESSING);
 			e.setStartPaymentDate(date);
 			e.setDeadlinePaymentDate(date);
 		});
 		musicGroupPaymentCalenderDetailDao.batchUpdate(calenderDetails);
-		//修改学员缴费状态为未缴费
-		musicGroupStudentFeeDao.setNoPayment(calenderDetails);
 		Set<Integer> studentIds = calenderDetails.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
 		//推送消息
 		if (studentIds.size() > 0) {
@@ -187,9 +144,9 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 			for (Integer userId : studentIds) {
 				push.put(userId, userId + "");
 			}
-			MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
+			MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
 			String baseUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
-			String memo = "4?" + baseUrl + "/#/renew?musicGroupId=" + musicGroupId;
+			String memo = "4?" + baseUrl + "/#/renew?musicGroupId=" + calender.getMusicGroupId();
 			// 发送续费通知
 			sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_WAIT_RENEW_MESSAGE, push, null, 0, memo,"STUDENT",musicGroup.getName());
 		}

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

@@ -17,6 +17,7 @@ import java.util.Map.Entry;
 import java.util.Set;
 import java.util.stream.Collectors;
 
+import com.ym.mec.auth.api.entity.SysUserRole;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -193,7 +194,8 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 						break;
 					}
 				}
-			} else if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_COURSE) {
+			} else if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_COURSE || musicGroupPaymentCalender.getPaymentType() == PaymentType
+					.ADD_STUDENT) {
 				// 如果是临时加课,是否审核是根据单价判断
 				for (MusicGroupPaymentCalenderCourseSettings courseSettings : musicGroupPaymentCalenderCourseSettingsList) {
 					OrganizationCourseUnitPriceSettings defaultUnitPrice = organizationCourseUnitPriceSettingsDao.queryByOrganIdAndCourseTypeAndChargeType(
@@ -289,6 +291,9 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 					musicGroup.setStatus(MusicGroupStatusEnum.AUDIT);
 					// 记录操作日志
 					musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "报名缴费项目创建成功(草稿 -> 基础信息审核中)", sysUser.getId(), ""));
+					Set<Integer> roleIds = new HashSet<>(1);
+					roleIds.add(SysUserRole.SECTION_MANAGER);
+					sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()), MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_APPLY, "", sysUser.getUsername());
 				}else{
 					musicGroup.setStatus(MusicGroupStatusEnum.FEE_AUDIT);
 					// 记录操作日志
@@ -408,7 +413,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 						break;
 					}
 				}
-			} else if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_COURSE) {
+			} else if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_COURSE || musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
 				// 如果是临时加课,是否审核是根据单价判断
 				for (MusicGroupPaymentCalenderCourseSettings courseSettings : musicGroupPaymentCalenderCourseSettingsList) {
 					OrganizationCourseUnitPriceSettings defaultUnitPrice = organizationCourseUnitPriceSettingsDao.queryByOrganIdAndCourseTypeAndChargeType(
@@ -496,15 +501,18 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 
 		// 如果是报名,需要修改乐团状态
 		if (musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY) {
-			int countAuditReject = musicGroupPaymentCalenderDao.countAuditReject(musicGroupPaymentCalender.getMusicGroupId(),null);
+			int countAuditReject = musicGroupPaymentCalenderDao.countAuditReject(musicGroupPaymentCalender.getMusicGroupId(),musicGroupPaymentCalender.getId());
 			if(countAuditReject == 0){
-				if (musicGroup.getStatus() != MusicGroupStatusEnum.DRAFT) {
+				if (musicGroup.getStatus() != MusicGroupStatusEnum.DRAFT && musicGroup.getStatus() != MusicGroupStatusEnum.AUDIT_FAILED) {
 					throw new BizException("创建失败:缴费项目类型不匹配");
 				}
 				if(musicGroupPaymentCalender.getStatus() != PaymentCalenderStatusEnum.AUDITING){
 					musicGroup.setStatus(MusicGroupStatusEnum.AUDIT);
 					// 记录操作日志
 					musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "报名缴费项目创建成功(草稿 -> 基础信息审核中)", sysUser.getId(), ""));
+					Set<Integer> roleIds = new HashSet<>(1);
+					roleIds.add(SysUserRole.SECTION_MANAGER);
+					sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()), MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_APPLY, "", sysUser.getUsername());
 				}else{
 					musicGroup.setStatus(MusicGroupStatusEnum.FEE_AUDIT);
 					// 记录操作日志
@@ -573,7 +581,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		List<CalenderPushDto> calenderPushDtos = musicGroupPaymentCalenderDao.getMusicCalenderPushDto(configValue1, format);
 		if (calenderPushDtos != null && calenderPushDtos.size() > 0) {
 			calenderPushDtos.forEach(e -> {
-
 				Map<Integer, String> receivers = new HashMap<>(1);
 				receivers.put(e.getTeacherId(), e.getTeacherPhone());
 				sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.AWSMS, MessageTypeEnum.SMS_PAYMENT_CREATE, receivers, null, 0,
@@ -595,6 +602,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			params.put("offset", pageInfo.getOffset());
 			dataList = musicGroupPaymentCalenderDao.queryAuditList(params);
 			List<Integer> collect = dataList.stream().map(e -> e.getOrganId()).collect(Collectors.toList());
+			collect.removeAll(Collections.singleton(null));
 			Map<Integer, String> organNameMap = getMap("organization", "id_", "name_", collect, Integer.class, String.class);
 			List<Integer> operatorIds = dataList.stream().map(e -> e.getOperator()).collect(Collectors.toList());
 			operatorIds.removeAll(Collections.singleton(null));
@@ -662,6 +670,9 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				}
 				//记录操作日志
 				musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "报名缴费项目通过(草稿 -> 审核中)", sysUser.getId(), ""));
+				Set<Integer> roleIds = new HashSet<>(1);
+				roleIds.add(SysUserRole.SECTION_MANAGER);
+				sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()), MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_APPLY, "", sysUser.getUsername());
 			}
 		}
 	}
@@ -675,6 +686,18 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		musicGroupPaymentCalender.setUpdateTime(date);
 		musicGroupPaymentCalender.setAuditMemo(auditMemo);
 		musicGroupPaymentCalenderDao.update(musicGroupPaymentCalender);
+		if (musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY) {
+			MusicGroup musicGroup = musicGroupDao.get(musicGroupPaymentCalender.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(), ""));
+		}
 	}
 
 	@Override

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

@@ -195,7 +195,6 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         if (musicGroup.getStatus() == MusicGroupStatusEnum.AUDIT) {
             Set<Integer> roleIds = new HashSet<>(1);
             roleIds.add(SysUserRole.SECTION_MANAGER);
-
             sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()), MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_APPLY, "", sysUser.getUsername());
         }
         // 保存乐团付费主体列表
@@ -1019,7 +1018,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         }
         MusicGroup musicGroup = saveLog(musicGroupId, MusicGroupStatusEnum.AUDIT);
         //记录操作日志
-        musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "审核失败(审核中 -> 审核失败)", sysUser.getId(), memo));
+        musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "乐团审核失败(审核中 -> 审核失败)", sysUser.getId(), memo));
         musicGroup.setMemo(memo);
         musicGroup.setStatus(MusicGroupStatusEnum.AUDIT_FAILED);
         musicGroupDao.update(musicGroup);

+ 5 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupSubjectPlanServiceImpl.java

@@ -227,7 +227,7 @@ public class MusicGroupSubjectPlanServiceImpl extends BaseServiceImpl<Integer, M
     @Override
     public List<MusicGroupGoodsAndDiscountDto> getSubjectGoods(Integer subjectId, String type, Integer chargeTypeId) {
         List<MusicGroupGoodsAndDiscountDto> goodsList = goodsDao.getMusicGroupGoodsAndDiscount(subjectId, type);
-        if (chargeTypeId == null || !"INSTRUMENT".equals(type)) {
+        if (chargeTypeId == null || (type != null && !"INSTRUMENT".equals(type))) {
             return goodsList;
         }
 
@@ -236,8 +236,10 @@ public class MusicGroupSubjectPlanServiceImpl extends BaseServiceImpl<Integer, M
             return goodsList;
         }
         for (MusicGroupGoodsAndDiscountDto musicGroupGoodsAndDiscountDto : goodsList) {
-            musicGroupGoodsAndDiscountDto.setDiscountRate(subjectDiscount.getGoodsDiscountRate());
-            musicGroupGoodsAndDiscountDto.setGroupPurchasePrice(musicGroupGoodsAndDiscountDto.getGroupPurchasePrice().multiply(subjectDiscount.getGoodsDiscountRate()).setScale(2, BigDecimal.ROUND_HALF_UP));
+            if (musicGroupGoodsAndDiscountDto.getType() != null && musicGroupGoodsAndDiscountDto.getType().equals(GoodsType.INSTRUMENT)) {
+                musicGroupGoodsAndDiscountDto.setDiscountRate(subjectDiscount.getGoodsDiscountRate());
+                musicGroupGoodsAndDiscountDto.setGroupPurchasePrice(musicGroupGoodsAndDiscountDto.getGroupPurchasePrice().multiply(subjectDiscount.getGoodsDiscountRate()).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP));
+            }
         }
         return goodsList;
     }

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

@@ -1042,7 +1042,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         musicGroupPaymentCalenderDao.update(musicGroupRegCalender);
 
         List<String> orderDetailTypes = studentPaymentOrderDetailDao.getOrderDetailType(studentPaymentOrder.getId());
-        List<MusicGroupPaymentCalenderCourseSettings> courseSettings = musicGroupPaymentCalenderCourseSettingsDao.getMusicGroupRegCalenderCourseSettings(studentRegistration.getMusicGroupId());
+        List<MusicGroupPaymentCalenderCourseSettings> courseSettings = musicGroupPaymentCalenderCourseSettingsDao.getWithPaymentCalender(musicGroupRegCalender.getId());
         BigDecimal courseTotalPrice = courseSettings.stream().filter(e -> orderDetailTypes.contains(e.getCourseType().getCode())).map(MusicGroupPaymentCalenderCourseSettings::getCourseCurrentPrice).reduce(BigDecimal.ZERO, BigDecimal::add);
 
         MusicGroupPaymentCalenderDetail musicGroupPaymentCalenderDetail = new MusicGroupPaymentCalenderDetail();

+ 4 - 4
mec-biz/src/main/resources/config/mybatis/ChargeTypeSubjectMapperMapper.xml

@@ -133,10 +133,10 @@
         SELECT * FROM charge_type_subject_mapper 
         <where>
         	<if test="chargeTypeId != null">
-        		charge_type_id_ = #{chargeTypeId}
+        		and charge_type_id_ = #{chargeTypeId}
         	</if>
         	<if test="subjectId != null">
-        		subject_id_ = #{subjectId}
+        		and subject_id_ = #{subjectId}
         	</if>
         </where>
         ORDER BY id_ desc
@@ -148,10 +148,10 @@
         SELECT COUNT(*) FROM charge_type_subject_mapper
         <where>
         	<if test="chargeTypeId != null">
-        		charge_type_id_ = #{chargeTypeId}
+        		and charge_type_id_ = #{chargeTypeId}
         	</if>
         	<if test="subjectId != null">
-        		subject_id_ = #{subjectId}
+        		and subject_id_ = #{subjectId}
         	</if>
         </where>
     </select>

+ 2 - 6
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderDetailMapper.xml

@@ -274,12 +274,8 @@
 		ORDER BY mgpc.start_payment_date_ DESC LIMIT 1
 	</select>
 	<select id="queryCanOpenList" resultMap="MusicGroupPaymentCalenderDetail">
-		SELECT mgpcd.*,mgpc.music_group_id_ FROM music_group_payment_calender_detail mgpcd
-		LEFT JOIN music_group_payment_calender mgpc ON mgpc.id_ = mgpcd.music_group_payment_calender_id_
-		LEFT JOIN student_registration sr ON sr.music_group_id_ = mgpc.music_group_id_
-		WHERE mgpcd.payment_status_ = 'NON_PAYMENT' AND (mgpcd.open_ = 0 OR mgpcd.open_ IS NULL) AND sr.music_group_status_ != 'QUIT' AND mgpc.status_ = 'OVER'
-		AND FIND_IN_SET(mgpcd.id_,#{ids})
-		GROUP BY mgpcd.id_
+		SELECT * FROM music_group_payment_calender_detail
+		WHERE FIND_IN_SET(id_,#{ids}) AND payment_status_ = 'NON_PAYMENT'
 	</select>
 	<select id="queryIntersectionByPaymentDate" resultType="java.lang.Integer">
 		SELECT COUNT(mgpcd.id_) FROM music_group_payment_calender_detail mgpcd

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

@@ -478,7 +478,6 @@
         WHERE music_group_id_ = #{musicGroupId}
         AND payment_type_ = 'MUSIC_APPLY'
         AND pay_user_type_='STUDENT'
-        AND status_='OPEN'
     </select>
     <select id="queryUserPaymentStatus" resultType="java.util.Map">
         SELECT mg.id_ 'key',CASE WHEN COUNT(mgpc.id_) = 0 OR COUNT(DISTINCT mgpcd.id_) > 0 THEN 'NON_PAYMENT' ELSE 'PAID_COMPLETED' END 'value'

+ 0 - 0
mec-eureka/src/main/resources/application.yml → mec-eureka/src/main/resources/application-template.yml


+ 0 - 0
mec-gateway/mec-gateway-web/src/main/resources/application.yml → mec-gateway/mec-gateway-web/src/main/resources/application-template.yml


+ 0 - 0
mec-im/src/main/resources/application.yml → mec-im/src/main/resources/application-template.yml


+ 2 - 2
mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupController.java

@@ -168,7 +168,7 @@ public class MusicGroupController extends BaseController {
         return succeed(studentRegistration);
     }
 
-    @ApiOperation(value = "查询续费信息")
+    /*@ApiOperation(value = "查询续费信息")
     @GetMapping("/queryRenewInfo")
     @ApiImplicitParams({@ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "String")})
     public HttpResponseResult queryRenewInfo(String musicGroupId) throws Exception {
@@ -209,7 +209,7 @@ public class MusicGroupController extends BaseController {
         model.put("balance", studentRegistration.getBalance());
 
         return succeed(model);
-    }
+    }*/
 
     @ApiOperation(value = "续费")
     @GetMapping("/renew")

+ 14 - 12
mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupPaymentCalenderController.java

@@ -2,30 +2,32 @@ package com.ym.mec.student.controller;
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dao.*;
-import com.ym.mec.biz.dal.dto.RegisterPayDto;
-import com.ym.mec.biz.dal.entity.*;
+import com.ym.mec.biz.dal.dao.MusicGroupDao;
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderCourseSettingsDao;
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDetailDao;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
-import com.ym.mec.biz.dal.enums.*;
-import com.ym.mec.biz.service.*;
+import com.ym.mec.biz.dal.entity.StudentRegistration;
+import com.ym.mec.biz.service.MusicGroupPaymentCalenderService;
+import com.ym.mec.biz.service.StudentRegistrationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
-import com.ym.mec.util.date.DateUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
 import org.springframework.ui.ModelMap;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
-import java.math.BigDecimal;
-import java.util.*;
+import java.util.List;
 
 @RequestMapping("musicGroupPaymentCalender")
 @Api(tags = "乐团缴费项目服务")
@@ -66,7 +68,7 @@ public class MusicGroupPaymentCalenderController extends BaseController {
         }else if(calenderDetail.getPaymentStatus() == PaymentStatus.PROCESSING){
             throw new BizException("存在待处理的订单,请稍候尝试");
         }
-        if(calender.getStatus() == PaymentCalenderStatusEnum.OPEN){
+        if(calender.getStatus() == PaymentCalenderStatusEnum.OPEN || calenderDetail.getOpen() == 1){
             StudentRegistration studentRegistration = studentRegistrationService.queryByUserIdAndMusicGroupId(userId,musicGroupId);
             if (studentRegistration == null) {
                 return failed("乐团报名信息不存在");

+ 0 - 0
mec-student/src/main/resources/application.yml → mec-student/src/main/resources/application-template.yml


+ 0 - 0
mec-task/src/main/resources/application.yml → mec-task/src/main/resources/application-template.yml


+ 0 - 0
mec-teacher/src/main/resources/application.yml → mec-teacher/src/main/resources/application-template.yml


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

@@ -102,6 +102,8 @@ public class ExportController extends BaseController {
     private TeacherService teacherService;
     @Autowired
     private MusicGroupBuildLogDao musicGroupBuildLogDao;
+    @Autowired
+    private MusicGroupPaymentCalenderService musicGroupPaymentCalenderService;
 
     @ApiOperation(value = "乐团管理--修改--缴费设置--缴费记录导出")
     @PostMapping("export/musicGroupPaymentCalenderDetail")
@@ -135,6 +137,55 @@ public class ExportController extends BaseController {
         }
     }
 
+    @ApiOperation(value = "业务管理--审核列表导出")
+    @PostMapping("export/exportPaymentCalenderAuditList")
+    @PreAuthorize("@pcs.hasPermissions('export/exportPaymentCalenderAuditList')")
+    public void exportPaymentCalenderAuditList(HttpServletResponse response, MusicGroupPaymentCalenderQueryInfo queryInfo) throws IOException {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            throw new BizException("用户信息获取失败");
+        }
+        if(!sysUser.getIsSuperAdmin()){
+            Employee employee = employeeDao.get(sysUser.getId());
+            if (StringUtils.isEmpty(queryInfo.getOrganId())) {
+                queryInfo.setOrganId(employee.getOrganIdList());
+            }else if(StringUtils.isEmpty(employee.getOrganIdList())){
+                throw new BizException("用户所在分部异常");
+            }else {
+                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
+                if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
+                    throw new BizException("非法请求");
+                }
+            }
+        }
+        queryInfo.setPage(1);
+        queryInfo.setRows(49999);
+        List<MusicGroupPaymentCalenderAuditDto> rows = musicGroupPaymentCalenderService.auditList(queryInfo).getRows();
+        OutputStream outputStream = response.getOutputStream();
+        try {
+            HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部名称","分部编号","乐团编号", "乐团名称", "申请类型", "订单类型", "加课总时长(分钟)", "原现价(元)",
+                    "申请价格(元)", "备注", "申请人", "状态", "申请时间"}, new String[]{
+                    "organName", "organId", "musicGroupId", "musicGroupName", "paymentType.desc", "payUserType.desc",
+                    "addCourseTotalTime", "courseCurrentPrice", "courseOriginalPrice", "memo", "operatorName", "auditStatus.desc", "createTime"}, rows);
+            response.setContentType("application/octet-stream");
+            response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
+            response.flushBuffer();
+            outputStream = response.getOutputStream();
+            workbook.write(outputStream);
+            outputStream.flush();
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            if (outputStream != null) {
+                try {
+                    outputStream.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+    }
+
     @ApiOperation(value = "导出教师考勤列表")
     @PostMapping("export/queryTeacherAttendances")
     @PreAuthorize("@pcs.hasPermissions('export/queryTeacherAttendances')")

+ 18 - 6
mec-web/src/main/java/com/ym/mec/web/controller/StudentRegistrationController.java

@@ -1,10 +1,10 @@
 package com.ym.mec.web.controller;
 
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderCourseSettingsDao;
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
 import com.ym.mec.biz.dal.dto.MusicGroupSubjectGoodsAndInfoDto;
 import com.ym.mec.biz.dal.dto.StudentAddDto;
-import com.ym.mec.biz.dal.entity.MusicGroup;
-import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
-import com.ym.mec.biz.dal.entity.StudentRegistration;
+import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
 import com.ym.mec.biz.dal.page.StudentRegistrationQueryInfo;
 import com.ym.mec.biz.service.MusicGroupSubjectPlanService;
@@ -33,6 +33,10 @@ public class StudentRegistrationController extends BaseController {
     private StudentRegistrationService studentRegistrationService;
     @Autowired
     private MusicGroupSubjectPlanService musicGroupSubjectPlanService;
+    @Autowired
+    private MusicGroupPaymentCalenderDao musicGroupPaymentCalenderDao;
+    @Autowired
+    private MusicGroupPaymentCalenderCourseSettingsDao musicGroupPaymentCalenderCourseSettingsDao;
 
     @ApiOperation(value = "乐团添加学员")
     @PostMapping("/insertStudent")
@@ -153,11 +157,19 @@ public class StudentRegistrationController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('studentRegistration/getSubjectGoodsAndInfo')")
     @ApiImplicitParams({@ApiImplicitParam(name = "subjectId", value = "声部信息", required = true, dataType = "Integer"),
             @ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "String")})
-    public HttpResponseResult<MusicGroupSubjectGoodsAndInfoDto> getSubjectGoodsAndInfo(Integer subjectId, String musicGroupId) {
-        if (subjectId == null || StringUtils.isEmpty(musicGroupId)) {
+    public HttpResponseResult<MusicGroupSubjectGoodsAndInfoDto> getSubjectGoodsAndInfo(Integer subjectId, String musicGroupId, Long calenderId) {
+        if (subjectId == null || StringUtils.isEmpty(musicGroupId) || calenderId == null) {
             return failed("参数校验异常");
         }
-        return succeed(musicGroupSubjectPlanService.getSubjectGoodsAndInfo(musicGroupId, subjectId));
+        MusicGroupSubjectGoodsAndInfoDto subjectGoodsAndInfo = musicGroupSubjectPlanService.getSubjectGoodsAndInfo(musicGroupId, subjectId);
+
+        MusicGroupPaymentCalender musicGroupRegCalender = musicGroupPaymentCalenderDao.get(calenderId);
+        if (musicGroupRegCalender != null && musicGroupRegCalender.getPayUserType().equals(MusicGroupPaymentCalender.PayUserType.STUDENT)) {
+            List<MusicGroupPaymentCalenderCourseSettings> courseSettings = musicGroupPaymentCalenderCourseSettingsDao.getWithPaymentCalender(musicGroupRegCalender.getId());
+            musicGroupRegCalender.setMusicGroupPaymentCalenderCourseSettingsList(courseSettings);
+            subjectGoodsAndInfo.setMusicGroupPaymentCalender(musicGroupRegCalender);
+        }
+        return succeed(subjectGoodsAndInfo);
     }
 
     @ApiOperation(value = "获取班级课程的价值")

+ 0 - 0
mec-web/src/main/resources/application.yml → mec-web/src/main/resources/application-template.yml