浏览代码

Merge branch 'master' of http://git.dayaedu.com/yonge/mec

zouxuan 4 年之前
父节点
当前提交
837694bcd1

+ 30 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalenderDetail.java

@@ -69,8 +69,14 @@ public class MusicGroupPaymentCalenderDetail {
 	private java.util.Date createTime;
 
 	private Integer useInCourse;
+	
+	private Integer responsibleUserId;
+	
+	private String responsibleRecord;
 
 	private SysUser sysUser = new SysUser();
+	
+	private SysUser responsible = new SysUser();
 
 	public Date getStartPaymentDateMgpc() {
 		return startPaymentDateMgpc;
@@ -242,6 +248,30 @@ public class MusicGroupPaymentCalenderDetail {
 		this.useInCourse = useInCourse;
 	}
 
+	public Integer getResponsibleUserId() {
+		return responsibleUserId;
+	}
+
+	public void setResponsibleUserId(Integer responsibleUserId) {
+		this.responsibleUserId = responsibleUserId;
+	}
+
+	public String getResponsibleRecord() {
+		return responsibleRecord;
+	}
+
+	public void setResponsibleRecord(String responsibleRecord) {
+		this.responsibleRecord = responsibleRecord;
+	}
+
+	public SysUser getResponsible() {
+		return responsible;
+	}
+
+	public void setResponsible(SysUser responsible) {
+		this.responsible = responsible;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/MusicCalenderDetailQueryInfo.java

@@ -15,6 +15,8 @@ public class MusicCalenderDetailQueryInfo extends QueryInfo {
 	private String musicGroupStatus;
 
 	private Long id;
+	
+	private String responsibleRealName;
 
 	public String getPaymentStatus() {
 		return paymentStatus;
@@ -63,4 +65,12 @@ public class MusicCalenderDetailQueryInfo extends QueryInfo {
 	public void setId(Long id) {
 		this.id = id;
 	}
+
+	public String getResponsibleRealName() {
+		return responsibleRealName;
+	}
+
+	public void setResponsibleRealName(String responsibleRealName) {
+		this.responsibleRealName = responsibleRealName;
+	}
 }

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

@@ -76,7 +76,7 @@ public class DegreeRegistrationServiceImpl extends BaseServiceImpl<Integer, Degr
 
         //获取收费项价格
         SporadicChargeInfo chargeInfo = null;
-        if(Objects.nonNull(degreeRegistration.getLevel())&&Objects.nonNull(degreeRegistration.getTheoryLevel())){
+        if(Objects.nonNull(degreeRegistration.getSporadicId())&&Objects.nonNull(degreeRegistration.getTheoryLevel())){
             chargeInfo = sporadicChargeInfoDao.get(degreeRegistration.getSporadicId());
             if (chargeInfo == null || chargeInfo.getDelFlag().equals(1) || chargeInfo.getOpenFlag().equals(1)) {
                 throw new BizException("你选的考试级别不存在");
@@ -215,7 +215,7 @@ public class DegreeRegistrationServiceImpl extends BaseServiceImpl<Integer, Degr
             return notifyMap;
         }
 
-        if(BigDecimal.ZERO.compareTo(additionCoursePrice)>0){
+        if(BigDecimal.ZERO.compareTo(additionCoursePrice)<0){
             StudentPaymentOrderDetail studentPaymentOrderDetail = new StudentPaymentOrderDetail();
             studentPaymentOrderDetail.setType(OrderDetailTypeEnum.DEGREE_REGISTRATION);
             studentPaymentOrderDetail.setGoodsIdList(JSON.toJSONString(typeCourseTime));

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

@@ -208,6 +208,9 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 		musicGroupPaymentCalenderDetail.setPaymentStatus(MusicGroupStudentFee.PaymentStatus.NON_PAYMENT);
 		musicGroupPaymentCalenderDetail.setUpdateTime(date);
 		musicGroupPaymentCalenderDetail.setUserId(userId);
+		musicGroupPaymentCalenderDetail.setStartPaymentDate(calender.getStartPaymentDate());
+		musicGroupPaymentCalenderDetail.setDeadlinePaymentDate(calender.getDeadlinePaymentDate());
+		musicGroupPaymentCalenderDetail.setResponsibleUserId(calender.getOperator());
 		musicGroupPaymentCalenderDetailDao.insert(musicGroupPaymentCalenderDetail);
 		
 		List<MusicGroupPaymentStudentCourseDetail> musicGroupPaymentStudentCourseDetailList = new ArrayList<MusicGroupPaymentStudentCourseDetail>();
@@ -275,12 +278,16 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 			musicGroupPaymentCalenderDetail.setUserId(studentId);
 			musicGroupPaymentCalenderDetail.setStartPaymentDate(musicGroupPaymentCalender.getStartPaymentDate());
 			musicGroupPaymentCalenderDetail.setDeadlinePaymentDate(musicGroupPaymentCalender.getDeadlinePaymentDate());
-			userMap.put(studentId, musicGroupPaymentCalenderDetail);
+			musicGroupPaymentCalenderDetail.setResponsibleUserId(musicGroupPaymentCalender.getOperator());
+
 			musicGroupPaymentCalenderDetailList.add(musicGroupPaymentCalenderDetail);
 		}
 
 		if (musicGroupPaymentCalenderDetailList.size() > 0) {
 			musicGroupPaymentCalenderDetailDao.batchInsert(musicGroupPaymentCalenderDetailList);
+			for(MusicGroupPaymentCalenderDetail cd : musicGroupPaymentCalenderDetailList){
+				userMap.put(cd.getUserId(), musicGroupPaymentCalenderDetail);
+			}
 		}
 		//更新预计缴费人数
 		musicGroupPaymentCalender.setExpectNum(musicGroupPaymentCalender.getExpectNum() + userIdList.size());
@@ -364,12 +371,16 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 				musicGroupPaymentCalenderDetail.setUserId(studentId);
 				musicGroupPaymentCalenderDetail.setStartPaymentDate(musicGroupPaymentCalender.getStartPaymentDate());
 				musicGroupPaymentCalenderDetail.setDeadlinePaymentDate(musicGroupPaymentCalender.getDeadlinePaymentDate());
-				userMap.put(studentId, musicGroupPaymentCalenderDetail);
+				musicGroupPaymentCalenderDetail.setResponsibleUserId(musicGroupPaymentCalender.getOperator());
+				
 				musicGroupPaymentCalenderDetailList.add(musicGroupPaymentCalenderDetail);
 			}
 
 			if (musicGroupPaymentCalenderDetailList.size() > 0) {
 				musicGroupPaymentCalenderDetailDao.batchInsert(musicGroupPaymentCalenderDetailList);
+				for(MusicGroupPaymentCalenderDetail cd : musicGroupPaymentCalenderDetailList){
+					userMap.put(cd.getUserId(), musicGroupPaymentCalenderDetail);
+				}
 			}
 			//更新预计缴费人数
 			musicGroupPaymentCalender.setExpectNum(musicGroupPaymentCalender.getExpectNum() + userIdList.size());

+ 28 - 5
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderDetailMapper.xml

@@ -24,6 +24,9 @@
 		<result column="open_" property="open"/>
 		<result column="open_" property="openFlag" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
 		<result column="use_in_course_" property="useInCourse"/>
+		<result column="responsible_user_id_" property="responsibleUserId"/>
+		<result column="responsible_record_" property="responsibleRecord"/>
+		<result column="responsible_username_" property="responsible.username"/>
 		<association property="sysUser" javaType="com.ym.mec.auth.api.entity.SysUser">
 			<result column="username_" property="username" />
 			<result column="phone_" property="phone" />
@@ -50,21 +53,21 @@
 		useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		INSERT INTO music_group_payment_calender_detail
 		(id_,music_group_payment_calender_id_,user_id_,expect_amount_,actual_amount_,payment_status_,
-		user_status_,pay_time_,update_time_,create_time_,start_payment_date_,deadline_payment_date_,payment_order_id_,use_in_course_)
+		user_status_,pay_time_,update_time_,create_time_,start_payment_date_,deadline_payment_date_,payment_order_id_,use_in_course_,responsible_user_id_,responsible_record_)
 		VALUES(#{id},#{musicGroupPaymentCalenderId},#{userId},#{expectAmount},#{actualAmount},#{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-		#{userStatus},#{payTime},#{updateTime},#{createTime},#{startPaymentDate},#{deadlinePaymentDate},#{paymentOrderId},#{useInCourse})
+		#{userStatus},#{payTime},#{updateTime},#{createTime},#{startPaymentDate},#{deadlinePaymentDate},#{paymentOrderId},#{useInCourse},#{responsibleUserId},#{responsibleRecord})
 	</insert>
 
     <insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyColumn="id"
             keyProperty="id">
         INSERT INTO music_group_payment_calender_detail
 		(id_,music_group_payment_calender_id_,user_id_,expect_amount_,actual_amount_,
-		payment_status_,user_status_,pay_time_,update_time_,create_time_,start_payment_date_,deadline_payment_date_,payment_order_id_,use_in_course_)
+		payment_status_,user_status_,pay_time_,update_time_,create_time_,start_payment_date_,deadline_payment_date_,payment_order_id_,use_in_course_,responsible_user_id_,responsible_record_)
 		VALUES
 		<foreach collection="list" item="item" separator=",">
             (#{item.id},#{item.musicGroupPaymentCalenderId},#{item.userId},#{item.expectAmount},
             #{item.actualAmount},#{item.paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{item.userStatus},#{item.payTime},
-            #{item.updateTime},#{item.createTime},#{item.startPaymentDate},#{item.deadlinePaymentDate},#{item.paymentOrderId},#{item.useInCourse})
+            #{item.updateTime},#{item.createTime},#{item.startPaymentDate},#{item.deadlinePaymentDate},#{item.paymentOrderId},#{item.useInCourse},#{item.responsibleUserId},#{item.responsibleRecord})
         </foreach>
     </insert>
 
@@ -112,6 +115,12 @@
 			<if test="useInCourse != null">
 				use_in_course_ = #{useInCourse},
 			</if>
+			<if test="responsibleUserId != null">
+				responsible_user_id_ = #{responsibleUserId},
+			</if>
+			<if test="responsibleRecord != null">
+				responsible_record_ = #{responsibleRecord},
+			</if>
 		</set>
 		WHERE id_ = #{id}
 	</update>
@@ -158,6 +167,12 @@
 				<if test="item.useInCourse != null">
 					use_in_course_ = #{item.useInCourse},
 				</if>
+				<if test="item.responsibleUserId != null">
+					responsible_user_id_ = #{item.responsibleUserId},
+				</if>
+				<if test="item.responsibleRecord != null">
+					responsible_record_ = #{item.responsibleRecord},
+				</if>
 			</set>
 			WHERE id_ = #{item.id}
 		</foreach>
@@ -187,12 +202,13 @@
 
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="MusicGroupPaymentCalenderDetail" parameterType="map">
-		SELECT su.username_,su.phone_,st.name_ subject_names_,sr.music_group_status_,
+		SELECT su.username_,su.phone_,st.name_ subject_names_,sr.music_group_status_,tu.real_name_ responsible_username_,
 		CASE WHEN mgpcd.start_payment_date_ IS NULL THEN mgpc.start_payment_date_ ELSE mgpcd.start_payment_date_ END start_payment_date_mgpc_,
 		CASE WHEN mgpcd.deadline_payment_date_ IS NULL THEN mgpc.deadline_payment_date_ ELSE mgpcd.deadline_payment_date_ END deadline_payment_date_mgpc_,
 		CASE WHEN mgpc.status_ = 'OPEN' OR mgpcd.open_ = 1 THEN 1 ELSE 0 END open_,mgpcd.*
 		FROM music_group_payment_calender_detail mgpcd
 		LEFT JOIN sys_user su ON su.id_ = mgpcd.user_id_
+		left join sys_user tu on tu.id_ = mgpcd.responsible_user_id_
 		LEFT JOIN student_registration sr ON sr.user_id_ = mgpcd.user_id_
 		LEFT JOIN `subject` st ON st.id_ = sr.actual_subject_id_
 		LEFT JOIN music_group_payment_calender mgpc ON mgpc.id_ = mgpcd.music_group_payment_calender_id_
@@ -213,6 +229,9 @@
 			<if test="subjectId != null">
 				AND #{subjectId} = sr.actual_subject_id_
 			</if>
+			<if test="responsibleRealName != null and responsibleRealName != ''">
+				AND (mgpcd.responsible_user_id_ = #{responsibleRealName} OR tu.real_name_ LIKE CONCAT('%',#{responsibleRealName},'%') OR tu.phone_ LIKE CONCAT('%',#{responsibleRealName},'%'))
+			</if>
 		</where>
 		ORDER BY mgpc.update_time_ DESC
 		<include refid="global.limit" />
@@ -224,6 +243,7 @@
 		LEFT JOIN student_registration sr ON sr.user_id_ = mgpcd.user_id_
 		LEFT JOIN `subject` st ON st.id_ = sr.actual_subject_id_
 		LEFT JOIN sys_user su ON su.id_ = mgpcd.user_id_
+		left join sys_user tu on tu.id_ = mgpcd.responsible_user_id_
 		LEFT JOIN music_group_payment_calender mgpc ON mgpc.id_ = mgpcd.music_group_payment_calender_id_
 		<where>
 			mgpc.music_group_id_ = sr.music_group_id_
@@ -242,6 +262,9 @@
 			<if test="musicGroupStatus != null and musicGroupStatus != ''">
 				AND sr.music_group_status_ = #{musicGroupStatus}
 			</if>
+			<if test="responsibleRealName != null and responsibleRealName != ''">
+				AND (mgpcd.responsible_user_id_ = #{responsibleRealName} OR tu.real_name_ LIKE CONCAT('%',#{responsibleRealName},'%') OR tu.phone_ LIKE CONCAT('%',#{responsibleRealName},'%'))
+			</if>
 		</where>
 	</select>
 	<select id="queryListByIds" resultMap="MusicGroupPaymentCalenderDetail">

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

@@ -159,7 +159,7 @@
             <if test="courseType != null">
             AND mgpscd.course_type_ = #{courseType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
             </if>
-        GROUP BY mgpc.batch_no_ HAVING SUM(mgpscd.used_course_minutes_) &lt;=0 ORDER BY MIN(mgpc.id_) LIMIT 1;
+        GROUP BY mgpc.batch_no_ HAVING min(mgpscd.used_course_minutes_) &lt;=0 ORDER BY MIN(mgpc.id_) LIMIT 1;
     </select>
 
     <select id="getUnUseWithStudents" resultMap="MusicGroupPaymentStudentCourseDetail">

+ 6 - 0
mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java

@@ -29,6 +29,7 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.util.CollectionUtils;
 import org.springframework.util.DigestUtils;
 import org.springframework.web.bind.annotation.*;
 
@@ -140,6 +141,11 @@ public class StudentOrderController extends BaseController {
             if (orderByOrderNo.getType().equals(OrderTypeEnum.DOUBLE_ELEVEN2020)) {
                 LuckDrawCount luckDrawCount = luckDrawCountService.get(orderByOrderNo.getUserId().longValue());
                 orderDetail.put("drawTimes", luckDrawCount==null? 0: luckDrawCount.getAvailableCount());
+            }else if(OrderTypeEnum.DEGREE_REGISTRATION.equals(orderByOrderNo.getType())){
+                List<StudentPaymentOrderDetail> studentPaymentOrderDetails = studentPaymentOrderDetailService.getOrderDetail(orderByOrderNo.getId());
+                if(!CollectionUtils.isEmpty(studentPaymentOrderDetails)){
+                    orderDetail.put("additionCourseInfo", studentPaymentOrderDetails.get(0).getGoodsIdList());
+                }
             }
         } else if (orderByOrderNo.getGroupType().equals(GroupType.GOODS_SELL)) {
             orderDetail.put("detail", studentGoodsSellDao.getStudentGoodsSellDto(orderNo));