Browse Source

Merge branch 'music_detail'

# Conflicts:
#	mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentRegistrationDao.java
#	mec-biz/src/main/java/com/ym/mec/biz/service/StudentRegistrationService.java
#	mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java
#	mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml
yonge 4 years ago
parent
commit
88f9afd578

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

@@ -652,7 +652,9 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
      * @param params
      * @return
      */
-    List<StudentRegisterInstrumentsDetailDto> queryStudentRegisterInstrumentsDetail(Map<String, Object> params);
+    List<StudentRegisterInstrumentsDetailDto> queryStudentRegisterInstrumentsDetailList(Map<String, Object> params);
+	
+	int queryStudentRegisterInstrumentsDetailCount(Map<String, Object> params);
 
     List<SubjectApplyDetailDto> queryStudentApplyDetail(@Param("musicGroupId") String musicGroupId);
 }

+ 14 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPerformance.java

@@ -2,6 +2,8 @@ package com.ym.mec.biz.dal.entity;
 
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
+import java.util.List;
+
 /**
  * 对应数据库表(music_group_performance):
  */
@@ -22,8 +24,10 @@ public class MusicGroupPerformance {
 	private String organName;
 
 	/** 展演曲目名称,逗号分隔 */
+	private List<String> musicScoreNames;
+
 	private String musicScoreName;
-	
+
 	/** 添加人 */
 	private Integer operator;
 
@@ -45,6 +49,15 @@ public class MusicGroupPerformance {
 	/**  */
 	private java.util.Date updateTime;
 
+
+	public List<String> getMusicScoreNames() {
+		return musicScoreNames;
+	}
+
+	public void setMusicScoreNames(List<String> musicScoreNames) {
+		this.musicScoreNames = musicScoreNames;
+	}
+
 	public String getMusicGroupName() {
 		return musicGroupName;
 	}

+ 4 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/StudentRegistrationService.java

@@ -14,6 +14,7 @@ import com.ym.mec.biz.dal.dto.StudentFeeDetailDto;
 import com.ym.mec.biz.dal.dto.StudentInfo;
 import com.ym.mec.biz.dal.dto.StudentMusicDetailDto;
 import com.ym.mec.biz.dal.dto.StudentMusicGroupDto;
+import com.ym.mec.biz.dal.dto.StudentRegisterInstrumentsDetailDto;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderStudentDetail;
 import com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup;
@@ -23,6 +24,7 @@ import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
 import com.ym.mec.biz.dal.entity.StudentRegistration;
 import com.ym.mec.biz.dal.entity.Subject;
 import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
+import com.ym.mec.biz.dal.page.MusicGroupRecordStudentQueryInfo;
 import com.ym.mec.biz.dal.page.NoClassMusicStudentQueryInfo;
 import com.ym.mec.biz.dal.page.RegistrationOrPreQueryInfo;
 import com.ym.mec.biz.dal.page.StudentRegistrationQueryInfo;
@@ -445,6 +447,8 @@ public interface StudentRegistrationService extends BaseService<Long, StudentReg
      */
     StudentRegistration getStudentRegister(String musicGroupId, Integer studentId);
 
+    PageInfo<StudentRegisterInstrumentsDetailDto> queryStudentRegisterInstrumentsDetailList(MusicGroupRecordStudentQueryInfo queryInfo);
+	
     /**
      * 云教练收费:审核中的记录审核失败
      * @param studentRegistration

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

@@ -70,6 +70,7 @@ import com.ym.mec.biz.dal.dto.StudentFeeDto;
 import com.ym.mec.biz.dal.dto.StudentInfo;
 import com.ym.mec.biz.dal.dto.StudentMusicDetailDto;
 import com.ym.mec.biz.dal.dto.StudentMusicGroupDto;
+import com.ym.mec.biz.dal.dto.StudentRegisterInstrumentsDetailDto;
 import com.ym.mec.biz.dal.entity.ClassGroup;
 import com.ym.mec.biz.dal.entity.ClassGroupStudentMapper;
 import com.ym.mec.biz.dal.entity.CloudTeacherOrder;
@@ -112,6 +113,7 @@ import com.ym.mec.biz.dal.enums.OrderTypeEnum;
 import com.ym.mec.biz.dal.enums.PaymentStatusEnum;
 import com.ym.mec.biz.dal.enums.PlatformCashAccountDetailTypeEnum;
 import com.ym.mec.biz.dal.enums.StudentMusicGroupStatusEnum;
+import com.ym.mec.biz.dal.page.MusicGroupRecordStudentQueryInfo;
 import com.ym.mec.biz.dal.page.NoClassMusicStudentQueryInfo;
 import com.ym.mec.biz.dal.page.RegistrationOrPreQueryInfo;
 import com.ym.mec.biz.dal.page.StudentRegistrationQueryInfo;
@@ -2026,4 +2028,24 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
 		
 		return true;
 	}
+
+	@Override
+	public PageInfo<StudentRegisterInstrumentsDetailDto> queryStudentRegisterInstrumentsDetailList(MusicGroupRecordStudentQueryInfo queryInfo) {
+		PageInfo<StudentRegisterInstrumentsDetailDto> pageInfo = new PageInfo<StudentRegisterInstrumentsDetailDto>(queryInfo.getPage(), queryInfo.getRows());
+		Map<String, Object> params = new HashMap<String, Object>();
+		MapUtil.populateMap(params, queryInfo);
+
+		List<StudentRegisterInstrumentsDetailDto> dataList = null;
+		int count = studentRegistrationDao.queryStudentRegisterInstrumentsDetailCount(params);
+		if (count > 0) {
+			pageInfo.setTotal(count);
+			params.put("offset", pageInfo.getOffset());
+			dataList = studentRegistrationDao.queryStudentRegisterInstrumentsDetailList(params);
+		}
+		if (count == 0) {
+			dataList = new ArrayList<StudentRegisterInstrumentsDetailDto>();
+		}
+		pageInfo.setRows(dataList);
+		return pageInfo;
+	}
 }

+ 35 - 5
mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml

@@ -1587,14 +1587,14 @@
 		where sr.music_group_status_ = 'NORMAL' and sr.music_group_id_ = #{musicGroupId}
 		group by s.current_grade_num_
     </select>
-
-    <select id="queryStudentRegisterInstrumentsDetail" resultType="com.ym.mec.biz.dal.dto.StudentRegisterInstrumentsDetailDto" parameterType="map">
+    
+    <select id="queryStudentRegisterInstrumentsDetailList" resultType="com.ym.mec.biz.dal.dto.StudentRegisterInstrumentsDetailDto" parameterType="map">
         SELECT sr.user_id_ userId,u.username_ name,u.phone_ phone,u.gender_ phone,sub.name_ subjectName,sr.actual_subject_id_ actualSubjectId,s.current_grade_num_ currentGradeNum,
         si.goods_brand_ goodsBrand,si.goods_name_ goodsName,si.specification_ specification,si.create_time_ goodsBuyTime,si.start_time_ insuranceStartTime,si.end_time_ insuranceEndTime
-		from student_registration sr LEFT JOIN sys_user u on sr.user_id_ = u.id_
+		from student_registration sr LEFT JOIN sys_user u on sr.user_id_ = u.id_ 
 		LEFT JOIN student s on s.user_id_ = sr.user_id_ LEFT JOIN `subject` sub on sub.id_ = sr.actual_subject_id_
 		LEFT JOIN student_instrument si on si.student_id_ = sr.user_id_
-		WHERE sr.music_group_status_ = 'NORMAL'
+		WHERE sr.music_group_status_ = 'NORMAL' 
 		<if test="musicGroupId != null">
 			AND sr.music_group_id_ = #{musicGroupId}
 		</if>
@@ -1611,8 +1611,38 @@
 			AND si.start_time_ is null
 		</if>
 		<if test="search != null and search != ''">
-			AND (u.username_ LIKE CONCAT('%',#{search},'%') OR u.phone_ LIKE CONCAT('%',#{search},'%')) or u.id_ LIKE CONCAT('%',#{search},'%'))
+			AND (u.username_ LIKE CONCAT('%',#{search},'%') OR u.phone_ LIKE CONCAT('%',#{search},'%') or u.id_ LIKE CONCAT('%',#{search},'%'))
+		</if>
+        ORDER BY sr.create_time_ desc
+        <include refid="global.limit"/>
+    </select>
+    
+    <select id="queryStudentRegisterInstrumentsDetailCount" resultType="int" parameterType="map">
+        SELECT count(sr.id_)
+		from student_registration sr LEFT JOIN sys_user u on sr.user_id_ = u.id_ 
+		LEFT JOIN student s on s.user_id_ = sr.user_id_ LEFT JOIN `subject` sub on sub.id_ = sr.actual_subject_id_
+		LEFT JOIN student_instrument si on si.student_id_ = sr.user_id_
+		WHERE sr.music_group_status_ = 'NORMAL' 
+		<if test="musicGroupId != null">
+			AND sr.music_group_id_ = #{musicGroupId}
+		</if>
+		<if test="subjectId != null">
+			AND sr.actual_subject_id_ = #{subjectId}
 		</if>
+		<if test="currentGradeNum != null">
+			AND s.current_grade_num_ = #{currentGradeNum}
+		</if>
+		<if test="isBuyInstrumentsInsurance != null and isBuyInstrumentsInsurance == true">
+			AND si.start_time_ is not null
+		</if>
+		<if test="isBuyInstrumentsInsurance != null and isBuyInstrumentsInsurance == false">
+			AND si.start_time_ is null
+		</if>
+		<if test="search != null and search != ''">
+			AND (u.username_ LIKE CONCAT('%',#{search},'%') OR u.phone_ LIKE CONCAT('%',#{search},'%') or u.id_ LIKE CONCAT('%',#{search},'%'))
+		</if>
+        ORDER BY sr.create_time_ desc
+        <include refid="global.limit"/>
     </select>
 
     <select id="queryStudentApplyDetail" resultType="com.ym.mec.biz.dal.dto.SubjectApplyDetailDto">

+ 81 - 0
mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupRecordController.java

@@ -0,0 +1,81 @@
+package com.ym.mec.student.controller;
+
+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.ui.ModelMap;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.ym.mec.biz.dal.dao.ClassGroupDao;
+import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
+import com.ym.mec.biz.dal.dto.MusicGroupBasicDto;
+import com.ym.mec.biz.dal.entity.MusicGroup;
+import com.ym.mec.biz.dal.page.MusicGroupRecordStudentQueryInfo;
+import com.ym.mec.biz.service.CooperationOrganLinkmanService;
+import com.ym.mec.biz.service.MusicGroupService;
+import com.ym.mec.biz.service.OrganizationService;
+import com.ym.mec.biz.service.StudentRegistrationService;
+import com.ym.mec.common.controller.BaseController;
+
+@RequestMapping("musicGroupRecord")
+@Api(tags = "乐团档案")
+@RestController
+public class MusicGroupRecordController extends BaseController {
+
+	@Autowired
+	private CooperationOrganLinkmanService cooperationOrganLinkmanService;
+	
+	@Autowired
+	private MusicGroupService musicGroupService;
+	
+	@Autowired
+	private OrganizationService organizationService;
+	
+	@Autowired
+	private StudentRegistrationDao studentRegistrationDao;
+	
+	@Autowired
+	private StudentRegistrationService studentRegistrationService;
+	
+	@Autowired
+	private ClassGroupDao classGroupDao;
+
+	@ApiOperation(value = "查询基本信息")
+	@GetMapping("/queryBasicInfo")
+	public Object queryBasicInfo(String musicGroupId) {
+		
+		MusicGroupBasicDto musicGroupBasicDto = musicGroupService.queryBasicInfo(musicGroupId);
+		
+		if(musicGroupBasicDto != null){
+			Integer cooperationOrganId = musicGroupBasicDto.getCooperationOrganId();
+			musicGroupBasicDto.setCooperationOrganLinkmanList(cooperationOrganLinkmanService.queryByCooperationOrganId(cooperationOrganId));
+		}
+		
+		return succeed(musicGroupBasicDto);
+	}
+
+	@ApiOperation(value = "查询学员、师资")
+	@GetMapping("/queryStudentAndTeacher")
+	public Object queryStudentAndTeacher(String musicGroupId) {
+		
+		MusicGroup musicGroup = musicGroupService.get(musicGroupId);
+		if(musicGroup == null){
+			return failed("乐团信息查询失败");
+		}
+		
+		ModelMap model = new ModelMap();
+
+		model.put("subject", studentRegistrationDao.countStudentWithSubjectByMusicGroupId(musicGroupId));
+		
+		model.put("gradeMap", organizationService.getGradeList(musicGroup.getOrganId()));
+		model.put("grade", studentRegistrationDao.countStudentWithGradeByMusicGroupId(musicGroupId));
+		model.put("teacher", classGroupDao.countTeacherByMusicGroupId(musicGroupId));
+		
+		return succeed(model);
+	}
+
+}

+ 11 - 4
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPerformanceController.java

@@ -13,9 +13,12 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.List;
+
 @RequestMapping("musicGroupPerformance")
 @Api(tags = "乐团展演信息")
 @RestController
@@ -29,16 +32,20 @@ public class MusicGroupPerformanceController extends BaseController {
 	@ApiOperation("新增")
 	@PostMapping(value = "add")
 	@PreAuthorize("@pcs.hasPermissions('musicGroupPerformance/add')")
-	public Object add(MusicGroupPerformance musicGroupPerformance) {
+	public Object add(@RequestBody MusicGroupPerformance musicGroupPerformance) {
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
 		if(sysUser == null){
 			throw new BizException("请登录");
 		}
 		musicGroupPerformance.setOperator(sysUser.getId());
-		if(StringUtils.isNotEmpty(musicGroupPerformance.getMusicScoreName())){
-			if(musicGroupPerformance.getMusicScoreName().contains(",")){
-				throw new BizException("请勿录入特殊字符");
+		List<String> musicScoreNames = musicGroupPerformance.getMusicScoreNames();
+		if(musicScoreNames != null && musicScoreNames.size() > 0){
+			for (String musicScoreName : musicScoreNames) {
+				if(musicScoreName.contains(",")){
+					throw new BizException("请勿录入特殊字符");
+				}
 			}
+			musicGroupPerformance.setMusicGroupName(StringUtils.join(musicScoreNames,","));
 		}
 		return succeed(musicGroupPerformanceService.insert(musicGroupPerformance));
 	}

+ 5 - 7
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupRecordController.java

@@ -1,8 +1,5 @@
 package com.ym.mec.web.controller;
 
-import java.util.HashMap;
-import java.util.Map;
-
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 
@@ -21,8 +18,8 @@ import com.ym.mec.biz.dal.page.MusicGroupRecordStudentQueryInfo;
 import com.ym.mec.biz.service.CooperationOrganLinkmanService;
 import com.ym.mec.biz.service.MusicGroupService;
 import com.ym.mec.biz.service.OrganizationService;
+import com.ym.mec.biz.service.StudentRegistrationService;
 import com.ym.mec.common.controller.BaseController;
-import com.ym.mec.util.collection.MapUtil;
 
 @RequestMapping("musicGroupRecord")
 @Api(tags = "乐团档案")
@@ -42,6 +39,9 @@ public class MusicGroupRecordController extends BaseController {
 	private StudentRegistrationDao studentRegistrationDao;
 	
 	@Autowired
+	private StudentRegistrationService studentRegistrationService;
+	
+	@Autowired
 	private ClassGroupDao classGroupDao;
 
 	@ApiOperation(value = "查询基本信息")
@@ -84,8 +84,6 @@ public class MusicGroupRecordController extends BaseController {
 	@GetMapping("/queryStudentInfo")
 	@PreAuthorize("@pcs.hasPermissions('musicGroupRecord/queryStudentInfo')")
 	public Object queryStudentInfo(MusicGroupRecordStudentQueryInfo queryInfo) {
-		Map<String, Object> params = new HashMap<String, Object>();
-		MapUtil.populateMap(params, queryInfo);
-		return succeed(studentRegistrationDao.queryStudentRegisterInstrumentsDetail(params));
+		return succeed(studentRegistrationService.queryStudentRegisterInstrumentsDetailList(queryInfo));
 	}
 }