Explorar o código

Merge remote-tracking branch 'origin/saas' into saas

hgw %!s(int64=3) %!d(string=hai) anos
pai
achega
91b6bdfa10

+ 12 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CloudCoachPaymentProgram.java

@@ -23,6 +23,9 @@ public class CloudCoachPaymentProgram extends BaseEntity {
 	
 	/** 会员数量 */
 	private BigDecimal memberNum = BigDecimal.ZERO;
+
+	/** 云教练描述 */
+	private String memberIntro;
 	
 	/** 缴费项目总人数 */
 	private Integer userNum = 0;
@@ -34,7 +37,7 @@ public class CloudCoachPaymentProgram extends BaseEntity {
 	private PeriodEnum period = PeriodEnum.MONTH;
 	
 	/** 会员等级编号 */
-	private Integer memberRankSettingId;
+	private Integer memberRankSettingId = 1;
 	
 	/** 现价 */
 	private java.math.BigDecimal actualAmount = BigDecimal.ZERO;
@@ -60,6 +63,14 @@ public class CloudCoachPaymentProgram extends BaseEntity {
 
 	private List<Integer> userIds;
 
+	public String getMemberIntro() {
+		return memberIntro;
+	}
+
+	public void setMemberIntro(String memberIntro) {
+		this.memberIntro = memberIntro;
+	}
+
 	public String getOperatorName() {
 		return operatorName;
 	}

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TenantEntryActivities.java

@@ -2,12 +2,13 @@ package com.ym.mec.biz.dal.entity;
 
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
+import com.ym.mec.common.entity.BaseEntity;
 import com.ym.mec.common.enums.BaseEnum;
 
 /**
  * 对应数据库表(tenant_entry_activites):
  */
-public class TenantEntryActivities {
+public class TenantEntryActivities extends BaseEntity {
 
 	public enum SuitableUser implements BaseEnum<String, SuitableUser> {
 		NEW("NEW", "新手"), ALL("ALL", "全部");

+ 28 - 36
mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexBaseMonthDataServiceImpl.java

@@ -3,29 +3,23 @@ package com.ym.mec.biz.service.impl;
 import com.alibaba.fastjson.JSON;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.auth.api.entity.SysUserRole;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.*;
 import com.ym.mec.biz.dal.page.IndexDataQueryInfo;
 import com.ym.mec.biz.dal.page.OrganCloudStudyStudentDataQueryInfo;
-import com.ym.mec.biz.dal.page.OrganizationQueryInfo;
 import com.ym.mec.biz.service.*;
 import com.ym.mec.common.constant.CommonConstants;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
-import com.ym.mec.common.filters.TenantIdThreadLocal;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.common.tenant.TenantContextHolder;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
-
-import io.swagger.models.auth.In;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
@@ -34,12 +28,10 @@ import java.math.BigDecimal;
 import java.time.DayOfWeek;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.stream.Collectors;
 
 import static com.ym.mec.biz.dal.enums.IndexDataType.*;
-import static com.ym.mec.biz.dal.enums.IndexErrorType.WAIT_CREATE_PAYMENT_CALENDER;
 import static com.ym.mec.biz.dal.enums.SysUserRoleEnum.EDUCATION;
 
 @Service
@@ -153,7 +145,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 
 		Map<IndexDataType, List<IndexBaseMonthData>> typeDateMap = indexBaseDatas.stream().filter(d->Objects.nonNull(d.getDataType())).collect(Collectors.groupingBy(IndexBaseMonthData::getDataType));
 
-		if(CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(FINANCE_PAY.getCode())||dataTypes.contains(FINANCE_BALANCE_AMOUNT.getCode())||dataTypes.contains(FINANCE_AMOUNT.getCode()) && organIds != null){
+		if((CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(FINANCE_PAY.getCode())||dataTypes.contains(FINANCE_BALANCE_AMOUNT.getCode())||dataTypes.contains(FINANCE_AMOUNT.getCode())) && organIds != null){
 			List<IndexBaseMonthData> financePayDataWithTimely = indexBaseMonthDataDao.getFinancePayDataWithTimely(startDate.toString(), endDate.toString(), new ArrayList<>(organIds),queryInfo.getTenantId());
 			typeDateMap.put(IndexDataType.FINANCE_PAY,financePayDataWithTimely);
 			typeDateMap.put(IndexDataType.FINANCE_BALANCE_AMOUNT,indexBaseMonthDataDao.getFinanceBalanceDataWithTimely(startDate.toString(), endDate.toString(), new ArrayList<>(organIds),queryInfo.getTenantId()));
@@ -176,12 +168,12 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		if(CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(MUSIC_GROUP_COURSE.getCode())||dataTypes.contains(VIP_GROUP_COURSE.getCode())
 				||dataTypes.contains(VIP_GROUP_ONLINE_COURSE.getCode())||dataTypes.contains(VIP_GROUP_OFFLINE_COURSE.getCode())
 				||dataTypes.contains(PRACTICE_GROUP_COURSE.getCode())){
-			if(CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(IndexDataType.MUSIC_GROUP_COURSE.getCode())) {
+			if((CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(IndexDataType.MUSIC_GROUP_COURSE.getCode())) && organIds != null) {
 				List<IndexBaseMonthData> musicCourseData = indexBaseMonthDataDao.getGroupCourseDataWithGroup(null, startDate.toString(), endDate.toString(), GroupType.MUSIC, null, null, new ArrayList<>(organIds),queryInfo.getTenantId());
 				typeDateMap.put(MUSIC_GROUP_COURSE,musicCourseData);
 			}
 
-			if(CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(IndexDataType.VIP_GROUP_COURSE.getCode())) {
+			if((CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(IndexDataType.VIP_GROUP_COURSE.getCode())) && organIds != null) {
 				List<IndexBaseMonthData> vipCourseData = indexBaseMonthDataDao.getGroupCourseDataWithGroup(null, startDate.toString(), endDate.toString(), GroupType.VIP, null, null, new ArrayList<>(organIds),queryInfo.getTenantId());
 				List<OrganVipGroupCategoryCourseNumDto> vipGroupCategoryCourseData = indexBaseMonthDataDao.getVipGroupCategoryCourseData(null, startDate.toString(), endDate.toString(), GroupType.VIP, null, null, new ArrayList<>(organIds),queryInfo.getTenantId());
 				Map<Integer, Map<String, Integer>> organCategoryCourseMap = new HashMap<>();
@@ -196,7 +188,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 				typeDateMap.put(VIP_GROUP_COURSE,vipCourseData);
 			}
 
-			if(CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(IndexDataType.VIP_GROUP_ONLINE_COURSE.getCode())) {
+			if((CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(IndexDataType.VIP_GROUP_ONLINE_COURSE.getCode())) && organIds != null) {
 				List<IndexBaseMonthData> vipOnlineCourseData = indexBaseMonthDataDao.getGroupCourseDataWithGroup(null, startDate.toString(), endDate.toString(), GroupType.VIP, null, TeachModeEnum.ONLINE, new ArrayList<>(organIds),queryInfo.getTenantId());
 				List<OrganVipGroupCategoryCourseNumDto> vipGroupOnlineCategoryCourseData = indexBaseMonthDataDao.getVipGroupCategoryCourseData(null, startDate.toString(), endDate.toString(), GroupType.VIP, null, TeachModeEnum.ONLINE, new ArrayList<>(organIds),queryInfo.getTenantId());
 				Map<Integer, Map<String, Integer>> organOnlineCategoryCourseMap = new HashMap<>();
@@ -211,7 +203,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 				typeDateMap.put(VIP_GROUP_ONLINE_COURSE,vipOnlineCourseData);
 			}
 
-			if(CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(IndexDataType.VIP_GROUP_OFFLINE_COURSE.getCode())) {
+			if((CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(IndexDataType.VIP_GROUP_OFFLINE_COURSE.getCode())) && organIds != null) {
 				List<IndexBaseMonthData> vipOfflineCourseData = indexBaseMonthDataDao.getGroupCourseDataWithGroup(null, startDate.toString(), endDate.toString(), GroupType.VIP, null, TeachModeEnum.OFFLINE, new ArrayList<>(organIds),queryInfo.getTenantId());
 				List<OrganVipGroupCategoryCourseNumDto> vipGroupOfflineCategoryCourseData = indexBaseMonthDataDao.getVipGroupCategoryCourseData(null, startDate.toString(), endDate.toString(), GroupType.VIP, null, TeachModeEnum.OFFLINE, new ArrayList<>(organIds),queryInfo.getTenantId());
 				Map<Integer, Map<String, Integer>> organOfflineCategoryCourseMap = new HashMap<>();
@@ -226,7 +218,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 				typeDateMap.put(VIP_GROUP_OFFLINE_COURSE,vipOfflineCourseData);
 			}
 
-			if(CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(IndexDataType.PRACTICE_GROUP_COURSE.getCode())) {
+			if((CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(IndexDataType.PRACTICE_GROUP_COURSE.getCode())) && organIds != null) {
 				List<IndexBaseMonthData> practiceCourses = indexBaseMonthDataDao.getGroupCourseDataWithGroup(null, startDate.toString(), endDate.toString(), GroupType.PRACTICE, null, null, new ArrayList<>(organIds),queryInfo.getTenantId());
 				typeDateMap.put(PRACTICE_GROUP_COURSE,practiceCourses);
 			}
@@ -683,15 +675,15 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			twoChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP, IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP.getMsg(), quitGroupNum.size(),  quitGroupNum));
 
 			//乐团学员会员到期首页提醒
-			List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(null,educationUserId,organIdsStr);
-			IndexErrInfoDto noClassMusicGroupStudentInfo = new IndexErrInfoDto();
-			Set<String> musicGroupIds = studentRegistrations.stream().map(e -> e.getMusicGroupId()).collect(Collectors.toSet());
-			Set<Integer> userIds = studentRegistrations.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
-			noClassMusicGroupStudentInfo.setErrorType(IndexErrorType.NO_MEMBER_STUDENT_INFO);
-			noClassMusicGroupStudentInfo.setNum(musicGroupIds.size());
-			noClassMusicGroupStudentInfo.setNum2(userIds.size());
-			noClassMusicGroupStudentInfo.setDesc(IndexErrorType.NO_MEMBER_STUDENT_INFO.getMsg());
-			twoChild.add(noClassMusicGroupStudentInfo);
+//			List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(null,educationUserId,organIdsStr);
+//			IndexErrInfoDto noClassMusicGroupStudentInfo = new IndexErrInfoDto();
+//			Set<String> musicGroupIds = studentRegistrations.stream().map(e -> e.getMusicGroupId()).collect(Collectors.toSet());
+//			Set<Integer> userIds = studentRegistrations.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
+//			noClassMusicGroupStudentInfo.setErrorType(IndexErrorType.NO_MEMBER_STUDENT_INFO);
+//			noClassMusicGroupStudentInfo.setNum(musicGroupIds.size());
+//			noClassMusicGroupStudentInfo.setNum2(userIds.size());
+//			noClassMusicGroupStudentInfo.setDesc(IndexErrorType.NO_MEMBER_STUDENT_INFO.getMsg());
+//			twoChild.add(noClassMusicGroupStudentInfo);
 			two.setNum(twoChild.stream().mapToInt(IndexErrInfoDto::getNum).sum());
 			two.setResult(twoChild);
 			all.add(two);
@@ -1065,19 +1057,19 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		result.add(new IndexErrInfoDto(IndexErrorType.TEACHER_EXPECT_SALARY_BE_LOW, IndexErrorType.TEACHER_EXPECT_SALARY_BE_LOW.getMsg(),lowTeacherSalary, null));
 
 		//乐团学员会员即将到期首页提醒
-		String configValue = sysTenantConfigService.getTenantConfigValue(SysConfigService.PUSH_MEMBER_RENEW_QUIT,tenantId);
-		if (StringUtils.isEmpty(configValue)) {
-			configValue = "15";
-		}
-		List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(configValue,educationUserId,organIds);
-		Set<String> musicGroupIdList = studentRegistrations.stream().map(e -> e.getMusicGroupId()).collect(Collectors.toSet());
-		Set<Integer> userIds = studentRegistrations.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
-		IndexErrInfoDto infoDto = new IndexErrInfoDto();
-		infoDto.setErrorType(IndexErrorType.MEMBER_STUDENT_INFO);
-		infoDto.setNum(musicGroupIdList.size());
-		infoDto.setNum2(userIds.size());
-		infoDto.setDesc(IndexErrorType.MEMBER_STUDENT_INFO.getMsg());
-		result.add(infoDto);
+//		String configValue = sysTenantConfigService.getTenantConfigValue(SysConfigService.PUSH_MEMBER_RENEW_QUIT,tenantId);
+//		if (StringUtils.isEmpty(configValue)) {
+//			configValue = "15";
+//		}
+//		List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(configValue,educationUserId,organIds);
+//		Set<String> musicGroupIdList = studentRegistrations.stream().map(e -> e.getMusicGroupId()).collect(Collectors.toSet());
+//		Set<Integer> userIds = studentRegistrations.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
+//		IndexErrInfoDto infoDto = new IndexErrInfoDto();
+//		infoDto.setErrorType(IndexErrorType.MEMBER_STUDENT_INFO);
+//		infoDto.setNum(musicGroupIdList.size());
+//		infoDto.setNum2(userIds.size());
+//		infoDto.setDesc(IndexErrorType.MEMBER_STUDENT_INFO.getMsg());
+//		result.add(infoDto);
 
 		//乐团展演计划提醒
 		List<MusicGroupPerformance> musicGroupPerformances = musicGroupPerformanceDao.findNoStart(educationUserId,organIds);

+ 12 - 28
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -2292,37 +2292,21 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
                 //退乐保费用
                 if (returnFeeDto.getIsReturnMaintenanceFee()) {
-
-                    Map<Long, StudentPaymentOrderDetail> maintenanceMap = orderDetailList.stream()
-                            .filter(t -> (t.getType() == OrderDetailTypeEnum.MAINTENANCE))
-                            .collect(Collectors.toMap(t -> t.getStudentInstrumentId(), StudentPaymentOrderDetail -> StudentPaymentOrderDetail));
-
-                    List<Long> instrumentIdList = new ArrayList<Long>(maintenanceMap.keySet());
-                    List<StudentInstrument> updateStudentInstrumentList = new ArrayList<StudentInstrument>();
-
-                    if (instrumentIdList != null && instrumentIdList.size() > 0) {
-                        List<StudentInstrument> studentInstrumentList = studentInstrumentDao.queryById(instrumentIdList);
-
-                        for (StudentInstrument si : studentInstrumentList) {
-                            if (si.getDelFlag() == 1) {
-                                continue;
-                            }
-
-                            if ((si.getStatus() == 0 && si.getStartTime() == null) || si.getEndTime().after(date)) {
-                                updateStudentInstrumentList.add(si);
-                            }
+                    //是否有乐保
+                    //乐保是否退过
+                    //金额是否正确
+                    StudentInstrument studentMaintenance = studentInstrumentDao.getStudentMaintenance(userId, musicGroupId);
+                    if (returnFeeDto.getMaintenanceFee().compareTo(BigDecimal.ZERO) > 0) {
+                        if (studentMaintenance == null) {
+                            throw new BizException("学生没有有效期内的乐保,不能退乐保费用");
                         }
                     }
-
                     amount = amount.add(returnFeeDto.getMaintenanceFee());
-
-                    if (updateStudentInstrumentList.size() > 0) {
-                        for (StudentInstrument studentMaintenance : updateStudentInstrumentList) {
-                            studentMaintenance.setStatus(0);
-                            studentMaintenance.setStartTime(null);
-                            studentMaintenance.setEndTime(null);
-                            studentInstrumentDao.update(studentMaintenance);
-                        }
+                    if (returnFeeDto.getMaintenanceFee().compareTo(BigDecimal.ZERO) > 0 && studentMaintenance != null) {
+                        studentMaintenance.setStatus(0);
+                        studentMaintenance.setStartTime(null);
+                        studentMaintenance.setEndTime(null);
+                        studentInstrumentDao.update(studentMaintenance);
                     }
                 }
             }

+ 9 - 11
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServiceImpl.java

@@ -141,11 +141,13 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
     	// 判断用户是否存在
         SysUser user = teacherDao.getUserWithPhone(studentPreRegistration.getPhone());
         Integer userId = null;
-        
+
         if(user != null && user.getId() != null){
-        	if(user.getUserType().contains("STUDENT")){
+        	if (user.getUserType().contains("STUDENT")) {
         		throw new BizException("您已注册,请直接下载APP!");
-        	}
+        	} else { // 当前用户是 SYSTEM, TEACHER 添加学生
+                user.setUserType(user.getUserType() + ",STUDENT");
+            }
         	userId = user.getId();
             if (studentPreRegistration.getOrganId() != null) {
                 user.setOrganId(studentPreRegistration.getOrganId());
@@ -156,11 +158,7 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
             if (studentPreRegistration.getUserName() != null) {
                 user.setUsername(studentPreRegistration.getUserName());
             }
-            if (user.getUserType() == null) {
-                user.setUserType("STUDENT");
-            } else if (!user.getUserType().contains("STUDENT")) {
-                user.setUserType(user.getUserType() + ",STUDENT");
-            }
+
             user.setUpdateTime(date);
             teacherDao.updateUser(user);
         }else{
@@ -177,7 +175,7 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
             userId = user.getId();
             sysUserCashAccountDao.insert(new SysUserCashAccount(userId, "CNY"));
         }
-        
+
         //添加student
         Student student = new Student();
         student.setUserId(userId);
@@ -451,9 +449,9 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
         if (student == null) {
             throw new BizException("学员信息不存在");
         }
-        
+
         Date nowDate = new Date();
-        
+
         if(student.getMembershipStartTime() == null){
             student.setMembershipStartTime(nowDate);
         }

+ 2 - 3
mec-biz/src/main/resources/config/mybatis/StudentManageDao.xml

@@ -580,9 +580,8 @@
         sr.actual_subject_id_ subject_id_,s.name_ subject_name_,sr.music_group_id_,CASE WHEN su.password_ IS NULL THEN 0 ELSE 1 END isActive_,
         IF(DATE_FORMAT(sr.create_time_,'%Y-%m-%d') > DATE_FORMAT(mg.payment_expire_date_,'%Y-%m-%d'),1,0) is_new_student_,
         stu.care_package_,stu.come_on_package_,sr.create_time_ registerTime,
-        sr.membership_end_time_ music_membership_end_time_,stu.membership_end_time_,stu.experience_membership_end_time_,
-        DATEDIFF(stu.experience_membership_end_time_,NOW()) experience_membership_day_,DATEDIFF(stu.membership_end_time_,NOW()) membership_day_
-        ,DATEDIFF(sr.membership_end_time_,NOW()) music_membership_day_,stu.member_rank_setting_id_
+        sr.membership_end_time_ music_membership_end_time_,stu.membership_end_time_,
+        DATEDIFF(stu.membership_end_time_,NOW()) music_membership_day_,stu.member_rank_setting_id_
         FROM student_registration sr
         LEFT JOIN sys_user su ON sr.user_id_ = su.id_
         LEFT JOIN subject s ON s.id_ = sr.actual_subject_id_

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

@@ -21,10 +21,12 @@
 		<result column="del_flag_" property="delFlag" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+		<result column="tenant_id_" property="tenantId" />
 	</resultMap>
 	
 	<sql id="queryCondition">
 		<where>
+			tenant_id_ = #{tenantId}
 			<if test="startDate != null">
 				and (start_date_ &lt;= #{startDate} and end_date_ &gt;= #{startDate})
 			</if>
@@ -45,7 +47,7 @@
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="TenantEntryActivities">
 		SELECT * FROM
-		tenant_entry_activities ORDER BY id_
+		tenant_entry_activities where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 
 	<!-- 向数据库增加一条记录 -->
@@ -54,8 +56,8 @@
 		<!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval 
 			AS ID FROM DUAL </selectKey> -->
 		INSERT INTO tenant_entry_activities
-		(id_,name_,cover_img_,detail_,suitable_user_,tag_,total_price_,discount_price_,purchase_minutes_,give_minutes_,start_date_,end_date_,condition_,del_flag_,create_time_,update_time_)
-		VALUES(#{id},#{name},#{coverImg},#{detail},#{suitableUser, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{tag},#{totalPrice},#{discountPrice},#{purchaseMinutes},#{giveMinutes},#{startDate},#{endDate},#{condition},#{delFlag},#{createTime},#{updateTime})
+		(id_,name_,cover_img_,detail_,suitable_user_,tag_,total_price_,discount_price_,purchase_minutes_,give_minutes_,start_date_,end_date_,condition_,del_flag_,create_time_,update_time_,tenant_id_)
+		VALUES(#{id},#{name},#{coverImg},#{detail},#{suitableUser, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{tag},#{totalPrice},#{discountPrice},#{purchaseMinutes},#{giveMinutes},#{startDate},#{endDate},#{condition},#{delFlag},#{createTime},#{updateTime},#{tenantId})
 	</insert>
 
 	<!-- 根据主键查询一条记录 -->
@@ -111,7 +113,7 @@
 				discount_price_ = #{discountPrice},
 			</if>
 		</set>
-		WHERE id_ = #{id}
+		WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
 
 	<!-- 根据主键删除一条记录 -->

+ 33 - 0
mec-student/src/main/java/com/ym/mec/student/controller/CloudCoachPaymentProgramController.java

@@ -0,0 +1,33 @@
+package com.ym.mec.student.controller;
+
+import com.ym.mec.biz.dal.entity.CloudCoachPaymentProgram;
+import com.ym.mec.biz.dal.entity.MemberRankSetting;
+import com.ym.mec.biz.service.CloudCoachPaymentProgramService;
+import com.ym.mec.biz.service.MemberRankSettingService;
+import com.ym.mec.common.controller.BaseController;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@Api(tags = "云教练缴费项目")
+@RequestMapping("cloudCoachPaymentProgram")
+@RestController
+public class CloudCoachPaymentProgramController extends BaseController {
+
+    @Autowired
+    private CloudCoachPaymentProgramService cloudCoachPaymentProgramService;
+    @Autowired
+    private MemberRankSettingService memberRankSettingService;
+
+    @ApiOperation(value = "新增")
+    @PostMapping("/get")
+    public Object get(Long id){
+        CloudCoachPaymentProgram cloudCoachPaymentProgram = cloudCoachPaymentProgramService.get(id);
+        MemberRankSetting memberRankSetting = memberRankSettingService.get(cloudCoachPaymentProgram.getMemberRankSettingId());
+        cloudCoachPaymentProgram.setMemberIntro(memberRankSetting.getIntro());
+        return succeed(cloudCoachPaymentProgram);
+    }
+}

+ 3 - 9
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -18,10 +18,8 @@ import com.ym.mec.common.tenant.TenantContextHolder;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
 import com.ym.mec.util.excel.POIUtil;
-
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -34,7 +32,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.servlet.http.HttpServletResponse;
-
 import java.io.IOException;
 import java.io.OutputStream;
 import java.math.BigDecimal;
@@ -1330,16 +1327,13 @@ public class ExportController extends BaseController {
                 }
             }
             String[] header = {"学员编号", "学员姓名", "性别", "联系电话","入团时间", "年级", "班级", "入团专业", "学员状态", "报名缴费", "缴费金额", "是否激活",
-                    "VIP/网管是否有课","关心包","加油包", "欠费金额(元)", "退团原因",
-                    "下次续费时间", "下次续费剩余天数", "会员截止时间", "会员剩余天数", "试用会员截止时间", "试用会员剩余天数"};
+                    "VIP/网管是否有课","关心包","加油包", "欠费金额(元)", "退团原因", "会员截止时间", "会员剩余天数"};
             String[] body = {"userId", "realName", "gender", "phone","registerTime", "currentGrade", "currentClass", "subjectName", "studentStatus", "paymentStatus.desc"
                     ,"courseFee", "activeName", "hasCourse ? '是' : '否'"
                     ,"carePackage == null || carePackage == 0 ? \"不可用\" : carePackage == 1 ? \"可用\" : \"已使用\""
                     ,"comeOnPackage == null || comeOnPackage == 0 ? \"不可用\" : comeOnPackage == 1 ? \"可用\" : \"已使用\""
-                    ,"noPaymentAmount == null ? 0 : noPaymentAmount", "quitReason", "musicMembershipEndTime",
-                    "musicMembershipEndTime == null ? '' : musicMembershipDay >= 0 ? musicMembershipDay : '已欠费' + musicMembershipDay1 + '天'",
-                    "membershipEndTime","membershipEndTime == null ? hasNoStartCloudTeacher ? \"未生效\" : \"未购买\" : membershipDay >= 0 ? membershipDay : hasNoStartCloudTeacher ? \"未生效\" : \"会员已过期\"",
-                    "experienceMembershipEndTime","experienceMembershipEndTime == null ? \"未试用\" : experienceMembershipDay >= 0 ? experienceMembershipDay : \"已失效\""};
+                    ,"noPaymentAmount == null ? 0 : noPaymentAmount", "quitReason",
+                    "membershipEndTime","membershipEndTime == null ? hasNoStartCloudTeacher ? \"未生效\" : \"未购买\" : membershipDay >= 0 ? membershipDay : hasNoStartCloudTeacher ? \"未生效\" : \"会员已过期\""};
             HSSFWorkbook workbook = POIUtil.exportExcel(header, body, musicGroupStudentsDtoPageInfo.getRows());
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");