Parcourir la source

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

hgw il y a 3 ans
Parent
commit
7058fe7b94

+ 0 - 3
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/service/impl/SysRoleServiceImpl.java

@@ -1,15 +1,12 @@
 package com.ym.mec.auth.service.impl;
 
 import com.ym.mec.auth.api.entity.SysRole;
-import com.ym.mec.auth.api.entity.SysRoleMenu;
 import com.ym.mec.auth.dal.dao.SysRoleDao;
 import com.ym.mec.auth.dal.dao.SysRoleMenuDao;
 import com.ym.mec.auth.service.SysRoleService;
 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.common.tenant.TenantContextHolder;
-
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderMemberDao.java

@@ -11,5 +11,5 @@ public interface MusicGroupPaymentCalenderMemberDao extends BaseDAO<Long, MusicG
 
     void deleteByCalenderId(@Param("calenderId") Long calenderId);
 
-    List<MusicGroupPaymentCalenderMember> findByCalenderId(@Param("calenderId") Long calenderId);
+    MusicGroupPaymentCalenderMember findByCalenderId(@Param("calenderId") Long calenderId);
 }

+ 25 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CalenderAddStudent.java

@@ -0,0 +1,25 @@
+package com.ym.mec.biz.dal.dto;
+
+//进行中加学员参数拓展
+public class CalenderAddStudent {
+
+    private String classGroupIds;
+
+    private String studentIds;
+
+    public String getClassGroupIds() {
+        return classGroupIds;
+    }
+
+    public void setClassGroupIds(String classGroupIds) {
+        this.classGroupIds = classGroupIds;
+    }
+
+    public String getStudentIds() {
+        return studentIds;
+    }
+
+    public void setStudentIds(String studentIds) {
+        this.studentIds = studentIds;
+    }
+}

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupPaymentBaseCalender.java

@@ -47,6 +47,17 @@ public class MusicGroupPaymentBaseCalender {
 	@ApiModelProperty(value = "乐团课程信息", required = false)
 	private List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList;
 
+	@ApiModelProperty(value = "进行中加学员拓展信息", required = false)
+	private CalenderAddStudent calenderAddStudent;
+
+	public CalenderAddStudent getCalenderAddStudent() {
+		return calenderAddStudent;
+	}
+
+	public void setCalenderAddStudent(CalenderAddStudent calenderAddStudent) {
+		this.calenderAddStudent = calenderAddStudent;
+	}
+
 	public List<MusicGroupPaymentCalenderActivity> getCalenderActivityList() {
 		return calenderActivityList;
 	}

+ 0 - 10
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupPaymentCalenderDto.java

@@ -76,16 +76,6 @@ public class MusicGroupPaymentCalenderDto {
 		this.memberRankSettingId = memberRankSettingId;
 	}
 
-	private Boolean autoCreate = false;
-
-	public Boolean getAutoCreate() {
-		return autoCreate;
-	}
-
-	public void setAutoCreate(Boolean autoCreate) {
-		this.autoCreate = autoCreate;
-	}
-
 	@ApiModelProperty(value = "跨团合并时缴费项目中学员的缴费明细")
 	private List<MusicGroupPaymentCalenderStudentDetail> musicGroupPaymentCalenderStudentDetails;
 

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

@@ -1,11 +1,12 @@
 package com.ym.mec.biz.dal.entity;
 
+import com.ym.mec.common.entity.BaseEntity;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.math.BigDecimal;
 import java.util.Date;
 
-public class MusicGroupPaymentCalenderBase {
+public class MusicGroupPaymentCalenderBase extends BaseEntity {
     private long id;
 
     @ApiModelProperty(value = "数量", required = false)

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

@@ -9,5 +9,5 @@ public interface MusicGroupPaymentCalenderMemberService extends BaseService<Long
 
     void deleteByCalenderId(Long calenderId);
 
-    List<MusicGroupPaymentCalenderMember> findByCalenderId(Long calenderId);
+    MusicGroupPaymentCalenderMember findByCalenderId(Long calenderId);
 }

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

@@ -4597,7 +4597,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         paymentCalenderDto.setPaymentType(SPAN_GROUP_CLASS_ADJUST);
         //生成缴费项目
         paymentCalenderDto.setMasterTotalPrice(masterTotalPrice);
-        paymentCalenderDto.setIsGiveMusicNetwork(false);
+//        paymentCalenderDto.setIsGiveMusicNetwork(false);
         paymentCalenderDto.setStudentIds(StringUtils.join(studentIds, ","));
         musicGroupPaymentCalenderService.create(paymentCalenderDto);
         //记录申请信息

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

@@ -128,7 +128,7 @@ public class MusicGroupPaymentCalenderMemberServiceImpl extends BaseServiceImpl<
     }
 
     @Override
-    public List<MusicGroupPaymentCalenderMember> findByCalenderId(Long calenderId) {
+    public MusicGroupPaymentCalenderMember findByCalenderId(Long calenderId) {
         return musicGroupPaymentCalenderMemberDao.findByCalenderId(calenderId);
     }
 }

+ 14 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -192,14 +192,11 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		if (musicGroup.getCourseViewType() == CourseViewTypeEnum.MEMBER_FEE && musicGroupPaymentDateRangeList.size() > 1) {
 			throw new BizException("创建缴费失败:会员收费乐团不支持多周期缴费");
 		}
-		//是否自动创建
-		if(!musicGroupPaymentCalenderDto.getAutoCreate()){
-			// 所有缴费项目已完成排课才能创建下一个缴费项目
-			String orignBatchNo = musicGroupPaymentStudentCourseDetailDao.getUnUseBatchNoWithStudentAndCourseTypeAndCourseMinutes(musicGroupId, null, null,musicGroupPaymentCalenderDto.getIgnoreBatchNoList());
-			if (StringUtils.isNoneBlank(orignBatchNo)) {
-				if(StringUtils.isEmpty(musicGroupPaymentCalenderDto.getBatchNo()) || !musicGroupPaymentCalenderDto.getBatchNo().equals(orignBatchNo)){
-					throw new BizException("当前乐团存在未排课的缴费项目,请先完成排课再操作");
-				}
+		// 所有缴费项目已完成排课才能创建下一个缴费项目
+		String organBatchNo = musicGroupPaymentStudentCourseDetailDao.getUnUseBatchNoWithStudentAndCourseTypeAndCourseMinutes(musicGroupId, null, null,musicGroupPaymentCalenderDto.getIgnoreBatchNoList());
+		if (StringUtils.isNoneBlank(organBatchNo)) {
+			if(StringUtils.isEmpty(musicGroupPaymentCalenderDto.getBatchNo()) || !musicGroupPaymentCalenderDto.getBatchNo().equals(organBatchNo)){
+				throw new BizException("当前乐团存在未排课的缴费项目,请先完成排课再操作");
 			}
 		}
 
@@ -688,6 +685,15 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		Map<Long, Long> actualNumMap = MapUtil.convertIntegerMap(musicGroupPaymentCalenderDao.countActualNum(id));
 		calender.setActualNum(actualNumMap.get(id) == null ? 0 : actualNumMap.get(id).intValue());
 		calender.setExpectNum(expectNumMap.get(id) == null ? 0 : expectNumMap.get(id).intValue());
+
+		if(calender.getOrganId() != null){
+			Organization organization = organizationDao.get(calender.getOrganId());
+			calender.setOrganName(organization.getName());
+		}
+		if (StringUtils.isNotEmpty(calender.getMusicGroupId())){
+			MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
+			calender.setMusicGroupName(musicGroup.getName());
+		}
 		result.put("calender", calender);
 		//汇总收款金额
 		BigDecimal sumActualAmount = musicGroupPaymentCalenderDetailDao.sumActualAmount(id);

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

@@ -237,7 +237,7 @@ public class MusicGroupSchoolTermCourseDetailServiceImpl extends BaseServiceImpl
 			}
 		}
 
-		Date date = new Date();
+		/*Date date = new Date();
 		//会员结束前15天自动创建乐团续费(默认提前15天)
 		String autoCreateMemberRenew = sysTenantConfigService.getTenantConfigValue(SysConfigService.AUTO_CREATE_MEMBER_RENEW,tenantId);
 		if(StringUtils.isNotEmpty(autoCreateMemberRenew)){
@@ -306,7 +306,7 @@ public class MusicGroupSchoolTermCourseDetailServiceImpl extends BaseServiceImpl
 							"STUDENT",memberName,autoCreateMemberRenew);
 				}
 			}
-		}
+		}*/
 	}
 
 	private MusicGroupSchoolTermCourseDetail getCourseDetail(MusicGroupSchoolTermCourseDetail courseDetail){

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServeServiceImpl.java

@@ -966,7 +966,9 @@ public class StudentServeServiceImpl implements StudentServeService {
         LocalDate monDayDate = localDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
         LocalDate sunDayDate = localDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.SUNDAY.getValue());
 
+        //课后作业
         Set<Integer> hss = studentCourseHomeworkDao.checkStudentHaveHomeworkInDateRange(monDayDate.toString(), sunDayDate.toString(), studentIds);
+        //课外训练
         Set<Integer> ess = extracurricularExercisesReplyDao.checkStudentHaveExercisesInDateRange(monDayDate.toString(), sunDayDate.toString(), studentIds);
         for (Integer studentId : studentIds) {
             if(!hss.contains(studentId)&&!ess.contains(studentId)){

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

@@ -372,8 +372,9 @@
 		WHERE mgpc.batch_no_ = #{batchNo}
 	</select>
 	<select id="sumActualAmount" resultType="java.math.BigDecimal">
-		SELECT SUM(mgpcd.actual_amount_) FROM music_group_payment_calender_detail mgpcd
-		WHERE mgpcd.music_group_payment_calender_id_ = #{id}
+		SELECT SUM(spo.actual_amount_) FROM music_group_payment_calender_detail mgpcd
+		LEFT JOIN student_payment_order spo ON spo.id_ = mgpcd.payment_order_id_
+		WHERE mgpcd.music_group_payment_calender_id_ = #{id} AND spo.status_ = 'SUCCESS'
 	</select>
 	<select id="findByCalenderIdAndUserId" resultMap="MusicGroupPaymentCalenderDetail">
 		SELECT * FROM music_group_payment_calender_detail WHERE music_group_payment_calender_id_ = #{calenderId} AND user_id_ = #{userId} LIMIT 1

+ 8 - 7
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMapper.xml

@@ -10,6 +10,7 @@
         <result column="id_" property="id"/>
         <result column="music_group_id_" property="musicGroupId"/>
         <result column="tenant_id_" property="tenantId"/>
+        <result column="organ_id_" property="organId"/>
         <result column="music_group_organization_course_settings_id_" property="musicGroupOrganizationCourseSettingId"/>
         <result column="pay_user_type_" property="payUserType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="start_payment_date_" property="startPaymentDate"/>
@@ -44,7 +45,7 @@
         <result column="current_total_amount_" property="currentTotalAmount"/>
         <result column="original_total_amount_" property="originalTotalAmount"/>
     </resultMap>
-    
+
     <!-- 根据主键查询一条记录 -->
     <select id="get" resultMap="MusicGroupPaymentCalender">
 		SELECT * FROM music_group_payment_calender WHERE id_ = #{id} 
@@ -64,14 +65,14 @@
         payment_pattern_,payment_type_,payment_amount_,batch_no_,audit_memo_,operator_,attribute1_,
          attribute2_,student_ids_,member_payment_amount_,member_rank_setting_id_,member_valid_date_
          ,original_member_payment_amount_,member_period_,member_optional_flag_,
-         music_repair_num_,music_repair_actual_price_,music_repair_optional_flag_,current_total_amount_,original_total_amount_,tenant_id_)
+         music_repair_num_,music_repair_actual_price_,music_repair_optional_flag_,current_total_amount_,original_total_amount_,tenant_id_,organ_id_)
         VALUES(#{musicGroupId},#{musicGroupOrganizationCourseSettingId},#{payUserType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
         #{rejectReason},#{startPaymentDate},#{deadlinePaymentDate},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
         #{expectNum},#{actualNum},#{memo},#{isGiveMusicNetwork},now(),now(),
         #{paymentValidStartDate},#{paymentValidEndDate},#{paymentPattern},#{paymentType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
         #{paymentAmount},#{batchNo},#{auditMemo},#{operator},#{attribute1},#{attribute2},#{studentIds},
                #{memberPaymentAmount},#{memberRankSettingId},#{memberValidDate},#{originalMemberPaymentAmount},#{memberPeriod,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-               #{memberOptionalFlag},#{musicRepairNum},#{musicRepairActualPrice},#{musicRepairOptionalFlag},#{currentTotalAmount},#{originalTotalAmount},#{tenantId})
+               #{memberOptionalFlag},#{musicRepairNum},#{musicRepairActualPrice},#{musicRepairOptionalFlag},#{currentTotalAmount},#{originalTotalAmount},#{tenantId},#{organId})
     </insert>
 
     <insert id="batchInsert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender" useGeneratedKeys="true"
@@ -81,7 +82,7 @@
         actual_num_,memo_,is_give_music_network_,create_time_,update_time_,payment_valid_start_date_,payment_valid_end_date_,payment_pattern_,payment_amount_,
         payment_type_,batch_no_,audit_memo_,operator_,attribute1_,attribute2_,student_ids_,
          member_payment_amount_,member_rank_setting_id_,member_valid_date_,original_member_payment_amount_,member_period_
-        ,member_optional_flag_,music_repair_num_,music_repair_actual_price_,music_repair_optional_flag_,current_total_amount_,original_total_amount_,tenant_id_)
+        ,member_optional_flag_,music_repair_num_,music_repair_actual_price_,music_repair_optional_flag_,current_total_amount_,original_total_amount_,tenant_id_,organ_id_)
         VALUES
         <foreach collection="list" item="item" index="index" separator=",">
         (#{item.musicGroupId},#{item.musicGroupOrganizationCourseSettingId},#{item.payUserType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{item.rejectReason},#{item.startPaymentDate},#{item.deadlinePaymentDate},#{item.status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
@@ -89,7 +90,8 @@
         #{item.paymentValidStartDate},#{item.paymentValidEndDate},#{item.paymentPattern},#{item.paymentAmount},#{item.paymentType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
         #{item.batchNo},#{item.auditMemo},#{item.operator},#{item.attribute1},#{item.attribute2},
          #{item.studentIds},#{item.memberPaymentAmount},#{item.memberRankSettingId},#{item.memberValidDate},#{item.originalMemberPaymentAmount},#{item.memberPeriod,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-            #{item.memberOptionalFlag},#{item.musicRepairNum},#{item.musicRepairActualPrice},#{item.musicRepairOptionalFlag},#{item.currentTotalAmount},#{item.originalTotalAmount},#{tenantId})
+            #{item.memberOptionalFlag},#{item.musicRepairNum},#{item.musicRepairActualPrice},#{item.musicRepairOptionalFlag},
+         #{item.currentTotalAmount},#{item.originalTotalAmount},#{item.tenantId},#{item.organId})
         </foreach>
     </insert>
 
@@ -721,7 +723,6 @@
 
     <resultMap id="MusicGroupPaymentCalenderResultDto" type="com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderResultDto"
                extends="MusicGroupPaymentCalender">
-        <result column="organ_id_" property="organId"/>
         <result column="music_group_name_" property="musicGroupName"/>
         <result column="operator_name_" property="operatorName"/>
     </resultMap>
@@ -730,7 +731,7 @@
         mgpc.start_payment_date_,mgpc.deadline_payment_date_,mgpc.status_,mgpc.expect_num_,
         mgpc.actual_num_,mgpc.memo_,mgpc.create_time_,mgpc.update_time_,
         mgpc.payment_pattern_,mgpc.payment_type_,mgpc.batch_no_,mgpc.audit_memo_,mgpc.operator_,mgpc.attribute1_,
-        mgpc.attribute2_,mgpc.student_ids_,mgpc.current_total_amount_,mgpc.original_total_amount_,mg.name_ music_group_name_,mg.organ_id_
+        mgpc.attribute2_,mgpc.student_ids_,mgpc.current_total_amount_,mgpc.original_total_amount_,mg.name_ music_group_name_,mgpc.organ_id_
         FROM music_group_payment_calender mgpc
         LEFT JOIN music_group mg ON mg.id_ = mgpc.music_group_id_
         <include refid="queryCalenderPageSql"/>