Pārlūkot izejas kodu

feat:首页改版

Joburgess 4 gadi atpakaļ
vecāks
revīzija
5c01e40f59

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

@@ -59,7 +59,7 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
      * @date 2021/1/11 0011
      * @return java.util.List<com.ym.mec.biz.dal.entity.IndexBaseMonthData>
      */
-    List<IndexBaseMonthData> getSchoolData();
+    List<IndexBaseMonthData> getSchoolData(@Param("month") String month);
 
     /**
      * @describe 统计乐团数据

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

@@ -11,6 +11,6 @@ public interface IndexBaseMonthDataService extends BaseService<Long, IndexBaseMo
 
     List<IndexBaseDto> getIndexBaseData(String dataType, String organIds, String startMonth, String endMonth);
 
-    Map<String, List<IndexBaseDto>> indexBaseDataTask(String startMonth, String endMonth);
+    Map<String, List<IndexBaseDto>> indexBaseDataTask(String month);
 
 }

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

@@ -88,7 +88,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public Map<String, List<IndexBaseDto>> indexBaseDataTask(String startMonth, String endMonth) {
+	public Map<String, List<IndexBaseDto>> indexBaseDataTask(String month) {
 		Map<String, List<IndexBaseDto>> result = new HashMap<>();
 
 		DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM");
@@ -100,42 +100,42 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			this.organIds.get().addAll(allOrgans.stream().map(Organization::getId).collect(Collectors.toSet()));
 		}
 
-		startMonth = df.format(nowDate);
+		month = df.format(nowDate);
 
 		//运营数据
-		saveData(indexBaseMonthDataDao.getSchoolData(), startMonth, IndexDataType.SCHOOL);
-		saveData(indexBaseMonthDataDao.getMusicData(), startMonth, IndexDataType.MUSIC_GROUP_NUM);
-		saveData(indexBaseMonthDataDao.getMusicStudentData(null), startMonth, IndexDataType.MUSIC_GROUP_STUDENT);
-		saveData(indexBaseMonthDataDao.getOtherStudentData(), startMonth, IndexDataType.OTHER_STUDENT);
+		saveData(indexBaseMonthDataDao.getSchoolData(month), month, IndexDataType.SCHOOL);
+		saveData(indexBaseMonthDataDao.getMusicData(), month, IndexDataType.MUSIC_GROUP_NUM);
+		saveData(indexBaseMonthDataDao.getMusicStudentData(null), month, IndexDataType.MUSIC_GROUP_STUDENT);
+		saveData(indexBaseMonthDataDao.getOtherStudentData(), month, IndexDataType.OTHER_STUDENT);
 
 		//业务数据
-		saveData(indexBaseMonthDataDao.getStudentSignUpData(), startMonth, IndexDataType.ACTIVATION_RATE);
-		saveData(indexBaseMonthDataDao.getHomeworkData(null), startMonth, IndexDataType.HOMEWORK_CREATE_RATE);
-		saveData(indexBaseMonthDataDao.getHomeworkData("submit"), startMonth, IndexDataType.HOMEWORK_SUBMIT_RATE);
-		saveData(indexBaseMonthDataDao.getHomeworkData("comment"), startMonth, IndexDataType.HOMEWORK_COMMENT_RATE);
+		saveData(indexBaseMonthDataDao.getStudentSignUpData(), month, IndexDataType.ACTIVATION_RATE);
+		saveData(indexBaseMonthDataDao.getHomeworkData(null), month, IndexDataType.HOMEWORK_CREATE_RATE);
+		saveData(indexBaseMonthDataDao.getHomeworkData("submit"), month, IndexDataType.HOMEWORK_SUBMIT_RATE);
+		saveData(indexBaseMonthDataDao.getHomeworkData("comment"), month, IndexDataType.HOMEWORK_COMMENT_RATE);
 
 		//经营数据
-		saveData(null, startMonth, IndexDataType.SHOULD_INCOME_MONEY);
-		saveData(null, startMonth, IndexDataType.ANTICIPATED_INCOME_MONEY);
-		saveData(null, startMonth, IndexDataType.SHOULD_EXPEND_MONEY);
-		saveData(null, startMonth, IndexDataType.ANTICIPATED_EXPEND_MONEY);
-		saveData(null, startMonth, IndexDataType.REVENUE_MONEY);
+		saveData(null, month, IndexDataType.SHOULD_INCOME_MONEY);
+		saveData(null, month, IndexDataType.ANTICIPATED_INCOME_MONEY);
+		saveData(null, month, IndexDataType.SHOULD_EXPEND_MONEY);
+		saveData(null, month, IndexDataType.ANTICIPATED_EXPEND_MONEY);
+		saveData(null, month, IndexDataType.REVENUE_MONEY);
 
 		//人事数据
-		saveData(indexBaseMonthDataDao.getTeacherData(null, null), startMonth, IndexDataType.TEACHER_NUM);
-		saveData(indexBaseMonthDataDao.getTeacherData(JobNatureEnum.FULL_TIME, null), startMonth, IndexDataType.FULL_TIME_NUM);
-		saveData(indexBaseMonthDataDao.getTeacherData(JobNatureEnum.PART_TIME, null), startMonth, IndexDataType.PART_TIME_NUM);
-		saveData(indexBaseMonthDataDao.getTeacherData(null, true), startMonth, IndexDataType.DIMISSION_NUM);
+		saveData(indexBaseMonthDataDao.getTeacherData(null, null), month, IndexDataType.TEACHER_NUM);
+		saveData(indexBaseMonthDataDao.getTeacherData(JobNatureEnum.FULL_TIME, null), month, IndexDataType.FULL_TIME_NUM);
+		saveData(indexBaseMonthDataDao.getTeacherData(JobNatureEnum.PART_TIME, null), month, IndexDataType.PART_TIME_NUM);
+		saveData(indexBaseMonthDataDao.getTeacherData(null, true), month, IndexDataType.DIMISSION_NUM);
 
 		//学员变动
-		saveData(indexBaseMonthDataDao.getMusicStudentData("ALL"), startMonth, IndexDataType.NEWLY_STUDENT_NUM);
-		saveData(indexBaseMonthDataDao.getMusicStudentData("QUIT"), startMonth, IndexDataType.QUIT_MUSIC_GROUP_STUDENT_NUM);
-		saveData(indexBaseMonthDataDao.getStudentConversionData(), startMonth, IndexDataType.STUDENT_CONVERSION);
+		saveData(indexBaseMonthDataDao.getMusicStudentData("ALL"), month, IndexDataType.NEWLY_STUDENT_NUM);
+		saveData(indexBaseMonthDataDao.getMusicStudentData("QUIT"), month, IndexDataType.QUIT_MUSIC_GROUP_STUDENT_NUM);
+		saveData(indexBaseMonthDataDao.getStudentConversionData(), month, IndexDataType.STUDENT_CONVERSION);
 
 		//课程数据
-		saveData(indexBaseMonthDataDao.getGroupCourseData(GroupType.MUSIC), startMonth, IndexDataType.MUSIC_GROUP_COURSE);
-		saveData(indexBaseMonthDataDao.getGroupCourseData(GroupType.VIP), startMonth, IndexDataType.VIP_GROUP_COURSE);
-		saveData(indexBaseMonthDataDao.getGroupCourseData(GroupType.PRACTICE), startMonth, IndexDataType.PRACTICE_GROUP_COURSE);
+		saveData(indexBaseMonthDataDao.getGroupCourseData(GroupType.MUSIC), month, IndexDataType.MUSIC_GROUP_COURSE);
+		saveData(indexBaseMonthDataDao.getGroupCourseData(GroupType.VIP), month, IndexDataType.VIP_GROUP_COURSE);
+		saveData(indexBaseMonthDataDao.getGroupCourseData(GroupType.PRACTICE), month, IndexDataType.PRACTICE_GROUP_COURSE);
 
 		return result;
 	}

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

@@ -149,9 +149,9 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			throw new BizException("乐团查询失败,请检查参数");
 		}
 		
-		if (musicGroup.getStatus() != MusicGroupStatusEnum.PROGRESS && musicGroup.getStatus() != MusicGroupStatusEnum.PRE_BUILD_FEE) {
-			throw new BizException("创建失败:乐团当前状态不能创建缴费");
-		}
+//		if (musicGroup.getStatus() != MusicGroupStatusEnum.PROGRESS && musicGroup.getStatus() != MusicGroupStatusEnum.PRE_BUILD_FEE) {
+//			throw new BizException("创建失败:乐团当前状态不能创建缴费");
+//		}
 		
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
 		if (sysUser == null) {

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

@@ -188,7 +188,7 @@
 	<select id="getSchoolData" resultMap="IndexBaseMonthData">
 		SELECT
 			organ_id_,
-			CONCAT(DATE_FORMAT(NOW(), '%Y-%m'), '-01') month_,
+			CONCAT(#{month}, '-01') month_,
 			COUNT( id_ ) total_num_,
 			COUNT( id_ ) activate_num_,
 			COUNT( id_ ) percent_
@@ -197,6 +197,7 @@
 		WHERE
 			del_flag_ = 0
 		  	AND organ_id_ IS NOT NULL
+			AND DATE_FORMAT(create_time_, '%Y-%m') = #{month}
 		GROUP BY
 			organ_id_
 		ORDER BY

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

@@ -321,7 +321,7 @@ public class TaskController extends BaseController {
 	}
 
 	@GetMapping("/countIndexBaseData")
-	public void countIndexBaseData(String startMonth, String endMonth){
-		indexBaseMonthDataService.indexBaseDataTask(startMonth, endMonth);
+	public void countIndexBaseData(String startMonth){
+		indexBaseMonthDataService.indexBaseDataTask(startMonth);
 	}
 }