zouxuan 5 years ago
parent
commit
3fc5bb1480

+ 22 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalenderDetail.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.entity;
 
+import com.ym.mec.auth.api.entity.SysUser;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
@@ -38,7 +39,27 @@ public class MusicGroupPaymentCalenderDetail {
 	
 	/**  */
 	private java.util.Date createTime;
-	
+
+	private SysUser sysUser;
+
+	private Student student;
+
+	public Student getStudent() {
+		return student;
+	}
+
+	public void setStudent(Student student) {
+		this.student = student;
+	}
+
+	public SysUser getSysUser() {
+		return sysUser;
+	}
+
+	public void setSysUser(SysUser sysUser) {
+		this.sysUser = sysUser;
+	}
+
 	public void setId(Long id){
 		this.id = id;
 	}

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Student.java

@@ -13,6 +13,9 @@ public class Student {
 	/**  */
 	private String subjectIdList;
 
+	/**  */
+	private String subjectNames;
+
 	private Integer serviceTag;
 
 	private Integer operatingTag;
@@ -32,6 +35,14 @@ public class Student {
 		this.subjectIdList = subjectIdList;
 	}
 
+	public String getSubjectNames() {
+		return subjectNames;
+	}
+
+	public void setSubjectNames(String subjectNames) {
+		this.subjectNames = subjectNames;
+	}
+
 	public Student(Integer userId) {
 		this.userId = userId;
 	}

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

@@ -15,6 +15,12 @@
 		<result column="pay_time_" property="payTime" />
 		<result column="update_time_" property="updateTime" />
 		<result column="create_time_" property="createTime" />
+		<association property="sysUser" javaType="com.ym.mec.auth.api.entity.SysUser">
+			<result column="username_" property="username" />
+		</association>
+		<association property="student" javaType="com.ym.mec.biz.dal.entity.Student">
+			<result column="subject_names_" property="subjectNames" />
+		</association>
 	</resultMap>
 
 	<!-- 根据主键查询一条记录 -->
@@ -94,16 +100,21 @@
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="MusicGroupPaymentCalenderDetail"
 		parameterType="map">
-		SELECT * FROM music_group_payment_calender_detail
+		SELECT mgpc.*,su.username_,GROUP_CONCAT(DISTINCT st.name_) subject_names_
+		FROM music_group_payment_calender_detail mgpc
+		LEFT JOIN sys_user su ON su.id_ = mgpc.user_id_
+		LEFT JOIN student s ON s.user_id_ = mgpc.user_id_
+		LEFT JOIN `subject` st ON FIND_IN_SET(st.id_,s.subject_id_list_)
 		<where>
 			<if test="userId != null">
-				user_id_ = #{userId}
+				mgpc.user_id_ = #{userId}
 			</if>
 			<if test="paymentStatus != null">
-				payment_status_ = #{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+				mgpc.payment_status_ = #{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
 			</if>
 		</where>
-		ORDER BY create_time_
+		GROUP BY mgpc.id_
+		ORDER BY mgpc.create_time_
 		<include refid="global.limit" />
 	</select>
 

+ 2 - 2
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderDetailController.java

@@ -3,12 +3,12 @@ package com.ym.mec.web.controller;
 import com.ym.mec.biz.dal.page.MusicCalenderDetailQueryInfo;
 import com.ym.mec.biz.service.MusicGroupPaymentCalenderDetailService;
 import com.ym.mec.common.controller.BaseController;
-import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -30,7 +30,7 @@ public class MusicGroupPaymentCalenderDetailController extends BaseController {
     }
 
     @ApiOperation(value = "修改学员预计缴费金额")
-    @GetMapping("/updateActualAmount")
+    @PostMapping("/updateActualAmount")
     @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalenderDetail/updateActualAmount')")
     public Object updateActualAmount(BigDecimal actualAmount,Long id) {
         musicGroupPaymentCalenderDetailService.updateActualAmount(actualAmount,id);