浏览代码

Merge branch 'master' into Joburgess

Joburgess 4 年之前
父节点
当前提交
168a581151
共有 100 个文件被更改,包括 3960 次插入301 次删除
  1. 5 0
      cms/pom.xml
  2. 1 1
      cms/src/main/java/com/ym/mec/cms/CmsServerApplication.java
  3. 11 0
      cms/src/main/java/com/ym/mec/cms/config/WebMvcConfig.java
  4. 3 0
      cms/src/main/java/com/ym/mec/cms/controller/HelpCenterCatalogController.java
  5. 3 0
      cms/src/main/java/com/ym/mec/cms/controller/HelpCenterContentControlller.java
  6. 4 0
      cms/src/main/java/com/ym/mec/cms/controller/NewsController.java
  7. 2 2
      cms/src/main/java/com/ym/mec/cms/controller/TaskController.java
  8. 33 0
      cms/src/main/java/com/ym/mec/cms/interceptor/OperationLogInterceptor.java
  9. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java
  10. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/IndexBaseMonthDataDao.java
  11. 15 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/InspectionDao.java
  12. 59 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/InspectionItemDao.java
  13. 62 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/InspectionItemPlanConclusionDao.java
  14. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/InspectionItemPlanDao.java
  15. 28 12
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupDao.java
  16. 7 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDao.java
  17. 8 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDetailDao.java
  18. 6 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentRegistrationDao.java
  19. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentVisitDao.java
  20. 3 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TeacherDao.java
  21. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/VipGroupActivityDao.java
  22. 27 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CheckItemDto.java
  23. 164 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ExportVipGroupActivityDto.java
  24. 42 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/InspectionItemPlanConclusionDto.java
  25. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupStudentsDto.java
  26. 11 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentPaymentRouteOrderDto.java
  27. 36 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherVisitDto.java
  28. 72 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/IndexErrInfoDto.java
  29. 185 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Inspection.java
  30. 210 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/InspectionItem.java
  31. 294 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/InspectionItemPlan.java
  32. 117 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/InspectionItemPlanConclusion.java
  33. 11 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentVisit.java
  34. 8 8
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TeacherCourseStatistics.java
  35. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/IndexDataType.java
  36. 53 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/IndexErrorType.java
  37. 27 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/InspectionItemEnum.java
  38. 128 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/InspectionItemPlanQueryInfo.java
  39. 73 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/InspectionQueryInfo.java
  40. 23 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/TeacherCourseStatisticsQueryInfo.java
  41. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/service/IndexBaseMonthDataService.java
  42. 37 0
      mec-biz/src/main/java/com/ym/mec/biz/service/InspectionItemPlanConclusionService.java
  43. 31 0
      mec-biz/src/main/java/com/ym/mec/biz/service/InspectionItemPlanService.java
  44. 21 0
      mec-biz/src/main/java/com/ym/mec/biz/service/InspectionItemService.java
  45. 50 0
      mec-biz/src/main/java/com/ym/mec/biz/service/InspectionService.java
  46. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/service/VipGroupActivityService.java
  47. 146 18
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java
  48. 85 16
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupStudentMapperServiceImpl.java
  49. 5 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  50. 9 37
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleTeacherSalaryServiceImpl.java
  51. 5 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/EduPracticeGroupServiceImpl.java
  52. 18 10
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/FinancialExpenditureServiceImpl.java
  53. 1 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/GoodsServiceImpl.java
  54. 27 11
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ImGroupMemberServiceImpl.java
  55. 117 12
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexBaseMonthDataServiceImpl.java
  56. 128 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/InspectionItemPlanConclusionServiceImpl.java
  57. 139 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/InspectionItemPlanServiceImpl.java
  58. 68 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/InspectionItemServiceImpl.java
  59. 162 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/InspectionServiceImpl.java
  60. 13 22
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java
  61. 5 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  62. 3 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/OnlineMusicGroupServiceImpl.java
  63. 4 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java
  64. 6 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentManageServiceImpl.java
  65. 6 9
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentRouteOrderServiceImpl.java
  66. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherCourseStatisticsServiceImpl.java
  67. 3 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherDefaultMusicGroupSalaryServiceImpl.java
  68. 12 16
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherDefaultVipGroupSalaryServiceImpl.java
  69. 12 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupActivityServiceImpl.java
  70. 11 0
      mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml
  71. 155 19
      mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml
  72. 185 0
      mec-biz/src/main/resources/config/mybatis/InspectionItemMapper.xml
  73. 122 0
      mec-biz/src/main/resources/config/mybatis/InspectionItemPlanConclusionMapper.xml
  74. 171 0
      mec-biz/src/main/resources/config/mybatis/InspectionItemPlanMapper.xml
  75. 114 0
      mec-biz/src/main/resources/config/mybatis/InspectionMapper.xml
  76. 16 0
      mec-biz/src/main/resources/config/mybatis/MusicGroupMapper.xml
  77. 19 24
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderDetailMapper.xml
  78. 15 1
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMapper.xml
  79. 11 3
      mec-biz/src/main/resources/config/mybatis/StudentAttendanceMapper.xml
  80. 3 1
      mec-biz/src/main/resources/config/mybatis/StudentPaymentRouteOrderMapper.xml
  81. 7 0
      mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml
  82. 19 5
      mec-biz/src/main/resources/config/mybatis/StudentVisitMapper.xml
  83. 26 8
      mec-biz/src/main/resources/config/mybatis/TeacherCourseStatisticsMapper.xml
  84. 8 1
      mec-biz/src/main/resources/config/mybatis/TeacherMapper.xml
  85. 52 1
      mec-biz/src/main/resources/config/mybatis/VipGroupActivityMapper.xml
  86. 1 1
      mec-common/audit-log/src/main/java/com/yonge/log/dal/dao/AuditLogDao.java
  87. 6 7
      mec-common/audit-log/src/main/java/com/yonge/log/dal/model/AuditLog.java
  88. 13 5
      mec-common/audit-log/src/main/java/com/yonge/log/interceptor/AuditLogInterceptor.java
  89. 1 1
      mec-common/audit-log/src/main/java/com/yonge/log/service/AuditLogService.java
  90. 2 2
      mec-common/audit-log/src/main/java/com/yonge/log/service/impl/AuditLogServiceImpl.java
  91. 5 5
      mec-common/audit-log/src/test/java/com/yonge/log/test/SpringBootMongodbApplicationTests.java
  92. 1 1
      mec-common/audit-log/src/test/resources/application.properties
  93. 6 5
      mec-common/pom.xml
  94. 52 12
      mec-util/src/main/java/com/ym/mec/util/excel/POIUtil.java
  95. 1 1
      mec-util/src/main/java/com/ym/mec/util/ini/IniFileEntity.java
  96. 1 1
      mec-util/src/main/java/com/ym/mec/util/ini/IniFileUtil.java
  97. 4 4
      mec-util/src/main/java/com/ym/mec/util/web/WebUtil.java
  98. 6 0
      mec-web/pom.xml
  99. 1 1
      mec-web/src/main/java/com/ym/mec/web/WebApplication.java
  100. 2 0
      mec-web/src/main/java/com/ym/mec/web/config/PermissionCheckService.java

+ 5 - 0
cms/pom.xml

@@ -62,6 +62,11 @@
 			<groupId>com.ym</groupId>
 			<artifactId>mec-client-api</artifactId>
 		</dependency>
+		
+		<dependency>
+			<groupId>com.yonge.log</groupId>
+			<artifactId>audit-log</artifactId>
+		</dependency>
 	</dependencies>
 	
 	<build>

+ 1 - 1
cms/src/main/java/com/ym/mec/cms/CmsServerApplication.java

@@ -17,7 +17,7 @@ import com.spring4all.swagger.EnableSwagger2Doc;
 @EnableDiscoveryClient
 @EnableFeignClients("com.ym.mec")
 @MapperScan("com.ym.mec.cms.dal.dao")
-@ComponentScan(basePackages = { "com.ym.mec.cms", "com.ym.mec.im", "com.ym.mec.auth", "com.ym.mec.common.config", "com.ym.mec.common.security" })
+@ComponentScan(basePackages = { "com.ym.mec.cms", "com.ym.mec.im", "com.ym.mec.auth", "com.ym.mec.common.config", "com.ym.mec.common.security", "com.yonge.log" })
 @Configuration
 @EnableSwagger2Doc
 public class CmsServerApplication {

+ 11 - 0
cms/src/main/java/com/ym/mec/cms/config/WebMvcConfig.java

@@ -3,18 +3,24 @@ package com.ym.mec.cms.config;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.format.FormatterRegistry;
 import org.springframework.http.MediaType;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
 import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 
+import com.ym.mec.cms.interceptor.OperationLogInterceptor;
 import com.ym.mec.common.config.EnumConverterFactory;
 import com.ym.mec.common.config.LocalFastJsonHttpMessageConverter;
 
 @Configuration
 public class WebMvcConfig implements WebMvcConfigurer {
+	
+	@Autowired
+	private OperationLogInterceptor operationLogInterceptor;
 
 	/**
 	 * 枚举类的转换器 addConverterFactory
@@ -24,6 +30,11 @@ public class WebMvcConfig implements WebMvcConfigurer {
 		registry.addConverterFactory(new EnumConverterFactory());
 	}
 	
+	@Override
+	public void addInterceptors(InterceptorRegistry registry) {
+		registry.addInterceptor(operationLogInterceptor).addPathPatterns("/**").excludePathPatterns("/login");
+	}
+
 	@Bean
     public HttpMessageConverters fastJsonHttpMessageConverters(){
 		LocalFastJsonHttpMessageConverter converter = new LocalFastJsonHttpMessageConverter();

+ 3 - 0
cms/src/main/java/com/ym/mec/cms/controller/HelpCenterCatalogController.java

@@ -20,6 +20,7 @@ import com.ym.mec.cms.dal.entity.HelpCenterCatalog;
 import com.ym.mec.cms.service.HelpCenterCatalogService;
 import com.ym.mec.cms.service.HelpCenterContentService;
 import com.ym.mec.common.controller.BaseController;
+import com.yonge.log.model.AuditLogAnnotation;
 
 @RestController
 @RequestMapping("helpCenterCatalog")
@@ -52,6 +53,7 @@ public class HelpCenterCatalogController extends BaseController {
 
 	@ApiOperation("修改分类")
 	@PostMapping(value = "modify", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@AuditLogAnnotation(operateName = "帮助中心分类修改",interfaceURL = "helpCenterCatalog/modify")
 	public Object modifyHelpCatalog(HelpCenterCatalog helpCatalog) {
 		if (helpCatalog == null)
 			return failed("参数输入有误");
@@ -70,6 +72,7 @@ public class HelpCenterCatalogController extends BaseController {
 	@ApiOperation("删除分类")
 	@PostMapping(value = "delete", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
 	@ApiImplicitParam(name = "id", value = "分类编号", required = true, dataType = "Integer", paramType = "path")
+	@AuditLogAnnotation(operateName = "帮助中心分类删除",interfaceURL = "helpCenterCatalog/delete")
 	public Object delHelpCatalog(Integer id) {
 		if (id == null || id <= 0)
 			return failed("ID解析失败");

+ 3 - 0
cms/src/main/java/com/ym/mec/cms/controller/HelpCenterContentControlller.java

@@ -20,6 +20,7 @@ import com.ym.mec.cms.service.HelpCenterCatalogService;
 import com.ym.mec.cms.service.HelpCenterContentService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.page.PageInfo;
+import com.yonge.log.model.AuditLogAnnotation;
 
 @RestController
 @RequestMapping("helpCenterContent")
@@ -54,6 +55,7 @@ public class HelpCenterContentControlller extends BaseController {
 
 	@ApiOperation("修改帮助中心内容")
 	@PostMapping(value = "modify", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@AuditLogAnnotation(operateName = "帮助中心内容修改",interfaceURL = "helpCenterContent/modify")
 	public Object modifyHelpContent(HelpCenterContent helpContent) {
 		if (helpContent == null) {
 			return failed("参数输入有误");
@@ -80,6 +82,7 @@ public class HelpCenterContentControlller extends BaseController {
 	@ApiOperation("删除帮助中心内容")
 	@PostMapping(value = "delete", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
 	@ApiImplicitParam(name = "id", value = "编号", required = true, dataType = "Integer", paramType = "path")
+	@AuditLogAnnotation(operateName = "帮助中心内容删除",interfaceURL = "helpCenterContent/delete")
 	public Object delHelpContent(Integer id) {
 		if (id == null || id <= 0)
 			return failed("ID解析失败");

+ 4 - 0
cms/src/main/java/com/ym/mec/cms/controller/NewsController.java

@@ -25,6 +25,7 @@ import com.ym.mec.cms.dal.entity.SysNewsInformation;
 import com.ym.mec.cms.service.SysNewsInformationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.util.collection.MapUtil;
+import com.yonge.log.model.AuditLogAnnotation;
 
 @RestController
 @RequestMapping("news")
@@ -74,12 +75,14 @@ public class NewsController extends BaseController {
 
 	@ApiOperation("新增资讯")
 	@PostMapping(value = "/add", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@AuditLogAnnotation(operateName = "资讯新增",interfaceURL = "news/add")
 	public Object add(SysNewsInformation newsInfo) {
 		return succeed(sysNewsInformationService.insert(newsInfo));
 	}
 
 	@ApiOperation("更新资讯")
 	@PostMapping(value = "/update", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@AuditLogAnnotation(operateName = "资讯更新",interfaceURL = "news/update")
 	public Object update(SysNewsInformation newsInfo) {
 		Date date = new Date();
 		newsInfo.setUpdateTime(date);
@@ -89,6 +92,7 @@ public class NewsController extends BaseController {
 
 	@ApiOperation("删除")
 	@PostMapping(value = "/del/{id}", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@AuditLogAnnotation(operateName = "资讯删除",interfaceURL = "news/del")
 	public Object add(@PathVariable("id") Long id) {
 		return succeed(sysNewsInformationService.deleteWithLogical(id));
 	}

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

@@ -13,13 +13,13 @@ import com.ym.mec.common.controller.BaseController;
 
 @RequestMapping("task")
 @RestController
-@Api(tags = "资讯服务")
+@Api(tags = "资讯定时任务服务")
 public class TaskController extends BaseController {
 
 	@Autowired
 	private SysNewsInformationService sysNewsInformationService;
 
-	@ApiOperation(value = "查询奖品组列表")
+	@ApiOperation(value = "更新资讯发布状态")
 	@GetMapping("/updateStatus")
 	public void updateStatus(){
 		sysNewsInformationService.autoUpdateStatus();

+ 33 - 0
cms/src/main/java/com/ym/mec/cms/interceptor/OperationLogInterceptor.java

@@ -0,0 +1,33 @@
+package com.ym.mec.cms.interceptor;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.stereotype.Component;
+
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.yonge.log.interceptor.AuditLogInterceptor;
+
+@Component
+public class OperationLogInterceptor extends AuditLogInterceptor {
+
+	@Autowired
+	@Lazy
+	private SysUserFeignService sysUserFeignService;
+
+	@Override
+	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws ServletException, IOException {
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		if (sysUser != null) {
+			setUsername(sysUser.getRealName());
+		}
+		return true;
+	}
+
+}

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.dao;
 
+import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
@@ -1768,4 +1769,12 @@ public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
      * @return
      */
     Integer getUnderwayCourseNum(@Param("musicGroupId") String musicGroupId, @Param("groupType") GroupType groupType, @Param("status") CourseStatusEnum status);
+
+
+    /**
+     * 获取时间段内乐团的线下课程信息
+     *
+     * @return
+     */
+    List<CourseSchedule> getMusicGroupCourseInfo(@Param("musicGroupId") String musicGroupId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
 }

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

@@ -99,4 +99,16 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
 
     List<IndexBaseMonthData> getGroupCourseData(@Param("month") String month,
                                                 @Param("groupType")GroupType groupType);
+
+
+    int countLessThenThreeClassGroupNum(@Param("organIds") Set<Integer> organIds);
+    List<String> getLessThenThreeMusicGroup(@Param("organIds") Set<Integer> organIds);
+
+    int countNoPaymentStudentNum(@Param("organIds") Set<Integer> organIds);
+    List<String> getNoPaymentMusicGroup(@Param("organIds") Set<Integer> organIds);
+
+    int countApplyForQuitGroupNum(@Param("organIds") Set<Integer> organIds);
+
+    int countStudentAttendanceInfo(@Param("organIds") Set<Integer> organIds,
+                                   @Param("type") String type);
 }

+ 15 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/InspectionDao.java

@@ -0,0 +1,15 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.entity.Inspection;
+import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
+
+public interface InspectionDao extends BaseDAO<Long, Inspection> {
+    /**
+     * 获取巡查任务详情
+     *
+     * @param id
+     * @return
+     */
+    Inspection getInfo(@Param("id") Long id);
+}

+ 59 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/InspectionItemDao.java

@@ -0,0 +1,59 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.entity.InspectionItem;
+import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface InspectionItemDao extends BaseDAO<Long, InspectionItem> {
+
+    /**
+     * 获取任务项数目及总次数
+     *
+     * @param inspectionIds
+     * @return
+     */
+    List<InspectionItem> getItemCountAndTimes(@Param("inspectionIds") List<Long> inspectionIds);
+
+    /**
+     * 批量插入巡查任务表
+     *
+     * @param inspectionItems
+     * @return
+     */
+    int batchInsert(@Param("inspectionItems") List<InspectionItem> inspectionItems);
+
+
+    /**
+     * 获取巡查任务的任务事项
+     *
+     * @param inspectionId
+     * @return
+     */
+    List<InspectionItem> getItemByInspectionId(@Param("inspectionId") Long inspectionId);
+
+    /**
+     * 根据id删除任务事项
+     *
+     * @param ids
+     * @return
+     */
+    int deleteByIds(@Param("ids") List<Long> ids);
+
+    /**
+     * 批量更新巡查任务事项
+     *
+     * @param inspectionItems
+     * @return
+     */
+    int batchUpdate(@Param("inspectionItems") List<InspectionItem> inspectionItems);
+
+    /**
+     * 根据任务项删除任务事项
+     *
+     * @param InspectionId
+     * @return
+     */
+    int deleteByInspectionId(@Param("InspectionId") Long InspectionId);
+}

+ 62 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/InspectionItemPlanConclusionDao.java

@@ -0,0 +1,62 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.dto.CheckItemDto;
+import com.ym.mec.biz.dal.entity.CourseSchedule;
+import com.ym.mec.biz.dal.entity.InspectionItemPlanConclusion;
+import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface InspectionItemPlanConclusionDao extends BaseDAO<Long, InspectionItemPlanConclusion> {
+
+    /**
+     * 插入巡查结果
+     *
+     * @param inspectionItemPlanConclusions
+     * @return
+     */
+    int batchAdd(@Param("inspectionItemPlanConclusions") List<InspectionItemPlanConclusion> inspectionItemPlanConclusions);
+
+    /**
+     * 根据日程计划id和检查事项id删除检查结果
+     *
+     * @param planId
+     * @param checkItem
+     * @return
+     */
+    int delByPlanIdAndCheckItem(@Param("planId") Long planId, @Param("checkItem") Integer checkItem);
+
+    /**
+     * 获取巡查日程提交的最后结果项
+     *
+     * @param planIds
+     * @return
+     */
+    List<CheckItemDto> getLastCheckItem(@Param("planIds") List<Long> planIds);
+
+    /**
+     * 获取巡查日程的巡查结果
+     *
+     * @param planId
+     * @param checkItem
+     * @return
+     */
+    List<InspectionItemPlanConclusion> getInspectionItemPlanConclusion(@Param("planId") Long planId, @Param("checkItem") Integer checkItem);
+
+    /**
+     * 获取巡查结果的课程信息
+     *
+     * @return
+     */
+    List<CourseSchedule> getPlanConclusionCourses(@Param("planId") Long planId);
+
+    /**
+     * 获取日程检查结果的数量
+     *
+     * @param planId
+     * @param checkConclusion
+     * @return
+     */
+    int getCountByPlanIdAndCheckConclusion(@Param("planId") Long planId, @Param("checkConclusion") Integer checkConclusion);
+}

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/InspectionItemPlanDao.java

@@ -0,0 +1,8 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.entity.InspectionItemPlan;
+import com.ym.mec.common.dal.BaseDAO;
+
+public interface InspectionItemPlanDao extends BaseDAO<Long, InspectionItemPlan> {
+
+}

+ 28 - 12
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupDao.java

@@ -262,66 +262,82 @@ public interface MusicGroupDao extends BaseDAO<String, MusicGroup> {
     List<MusicGroup> getTeacherMusicGroup(@Param("teacherId") Integer teacherId);
 
     /**
+     * @param userId:
+     * @return java.util.List<com.ym.mec.biz.dal.dto.MusicCardDto>
      * @describe 获取学员所在乐团名称
      * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
      * @author zouxuan
      * @date 2020/9/7
      * @time 14:16
-     * @param userId:
-     * @return java.util.List<com.ym.mec.biz.dal.dto.MusicCardDto>
      */
     List<MusicCardDto> queryUserMusicInfos(Integer userId);
 
     /**
+     * @param organId:
+     * @return java.util.List<com.ym.mec.biz.dal.dto.MusicCardDto>
      * @describe 获取分部下乐团名称列表
      * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
      * @author zouxuan
      * @date 2020/9/7
      * @time 14:31
-     * @param organId:
-     * @return java.util.List<com.ym.mec.biz.dal.dto.MusicCardDto>
      */
     List<MusicCardDto> queryOrganMusicInfos(@Param("organId") Integer organId);
 
     /**
+     * @param userId:
+     * @return java.lang.Integer
      * @describe 获取学员第一个教务老师
      * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
      * @author zouxuan
      * @date 2020/9/24
      * @time 10:27
-     * @param userId:
-     * @return java.lang.Integer
      */
     Integer getFirstEduTeacherId(@Param("userId") Integer userId);
 
     /**
+     * @param studentId:
+     * @return com.ym.mec.biz.dal.entity.MusicGroup
      * @describe 获取学员关联的乐团
      * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
      * @author zouxuan
      * @date 2020/9/28
      * @time 13:47
-     * @param studentId:
-     * @return com.ym.mec.biz.dal.entity.MusicGroup
      */
     MusicGroup getStuMusic(Integer studentId);
 
     /**
+     * @param studentId:
+     * @param educationalTeacherId:
+     * @return com.ym.mec.biz.dal.entity.MusicGroup
      * @describe 获取学员和乐团关联的乐团
      * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
      * @author zouxuan
      * @date 2020/9/28
      * @time 13:54
-     * @param studentId:
-     * @param educationalTeacherId:
-     * @return com.ym.mec.biz.dal.entity.MusicGroup
      */
     MusicGroup getStuEduMusic(@Param("studentId") Integer studentId, @Param("educationalTeacherId") Integer educationalTeacherId);
 
     /**
      * 根据班级编号获取乐团信息
-     * @author zouxuan
+     *
      * @param classGroupId
      * @return
+     * @author zouxuan
      */
     MusicGroup findByClassGroupId(Integer classGroupId);
+
+    /**
+     * 根据分部和教务老师查询乐团列表
+     * @param educationId
+     * @param organIds
+     * @return
+     */
+    List<String> queryIdsByEduIdAndOrganIds(@Param("educationId") Integer educationId, @Param("organIds") String organIds);
+
+    /**
+     * 获取乐团的教学点
+     * @param id
+     * @return
+     */
+    School getMusicGroupSchool(@Param("id") String id);
 }

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

@@ -111,7 +111,7 @@ public interface MusicGroupPaymentCalenderDao extends BaseDAO<Long, MusicGroupPa
 
     List<MusicGroupPaymentCalender> queryByIds(@Param("calenderId") Set<Long> calenderId);
 
-    List<Long> queryEndIds(@Param("configValue") String configValue, @Param("format") String format);
+    List<Long> queryEndIds(@Param("configValue") String configValue, @Param("format") String format, @Param("musicGroupIds") List<String> musicGroupIds);
 
     List<CalenderPushDto> getCalenderPushDto(@Param("calenderIds") Collection<Long> calenderIds);
 
@@ -307,4 +307,10 @@ public interface MusicGroupPaymentCalenderDao extends BaseDAO<Long, MusicGroupPa
      */
     MusicGroupPaymentCalender getSchoolCalender(@Param("calenderId") Long calenderId);
 
+    /**
+     * 获取
+     * @param calenderIds
+     * @return
+     */
+    List<String> queryMusicGroupIds(@Param("calenderIds") List<Long> calenderIds);
 }

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

@@ -228,5 +228,12 @@ public interface MusicGroupPaymentCalenderDetailDao extends BaseDAO<Long, MusicG
 	 *
 	 * @param calenderId
 	 */
-	void updateNoPaymentAndZeroPaymentStatus(Long calenderId);
+	int updateNoPaymentAndZeroPaymentStatus(Long calenderId);
+
+	/**
+	 * 获取学员乐团欠费金额
+	 * @param musicGroupId
+	 * @return
+	 */
+	List<Map<Integer, BigDecimal>> queryNoPaymentTotalAmount(String musicGroupId);
 }

+ 6 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentRegistrationDao.java

@@ -444,4 +444,10 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
      * @return
      */
     List<Map<Integer,String>> getStudentSubjectNameByStuIds(@Param("musicGroupId") String musicGroupId, @Param("studentIds") Collection<Integer> studentIds);
+
+    /**
+     * 将学员报名缴费状态更新至已缴费
+     * @param calenderId
+     */
+    void updatePaymentStatusByClaenderId(Long calenderId);
 }

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentVisitDao.java

@@ -2,10 +2,12 @@ package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.biz.dal.dto.BasicUserDto;
 import com.ym.mec.biz.dal.dto.StudentVisitDto;
+import com.ym.mec.biz.dal.dto.TeacherVisitDto;
 import com.ym.mec.biz.dal.entity.StudentVisit;
 import com.ym.mec.common.dal.BaseDAO;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -52,4 +54,14 @@ public interface StudentVisitDao extends BaseDAO<Integer, StudentVisit> {
      * @return
      */
     List<Integer> getMusicGroupVisitStudent(@Param("musicGroupId") String musicGroupId, @Param("studentIds") List<Integer> studentIds);
+
+    /**
+     * 获取老师时间段的回访次数
+     *
+     * @param teacherIds
+     * @param startTime
+     * @param endTime
+     * @return
+     */
+    List<TeacherVisitDto> getTeacherVisitCount(@Param("teacherIds") List<Integer> teacherIds, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
 }

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TeacherDao.java

@@ -10,6 +10,7 @@ import com.ym.mec.common.entity.ImUserModel;
 import org.apache.ibatis.annotations.Param;
 
 import java.math.BigDecimal;
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -61,6 +62,8 @@ public interface TeacherDao extends BaseDAO<Integer, Teacher> {
 
     List<Map<Integer, String>> queryUserNameByIdList(@Param("userIds") List<Integer> userIds);
 
+    List<Map<Integer, String>> queryNickNameByRole(@Param("userIds") Set<Integer> userIds, @Param("userRoleMap") Map<Integer,String> userRoleMap);
+
     List<Map<Integer, String>> querySubjectNameByIdList(@Param("userIds") List<Integer> userIds);
 
     /**

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/VipGroupActivityDao.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.dao;
 
+import com.ym.mec.biz.dal.dto.ExportVipGroupActivityDto;
 import com.ym.mec.biz.dal.entity.VipGroupActivity;
 import com.ym.mec.common.dal.BaseDAO;
 import org.apache.ibatis.annotations.Param;
@@ -24,4 +25,11 @@ public interface VipGroupActivityDao extends BaseDAO<Integer, VipGroupActivity>
 	List<Map<Integer, String>> queryNamesById(String activityIds);
 
 	List<VipGroupActivity> queryByIds(@Param("activityIds") String activityIds);
+
+	/**
+	 * 导出vip活动
+	 * @param params
+	 * @return
+	 */
+	List<ExportVipGroupActivityDto> exportVipGroupActivity(Map<String, Object> params);
 }

+ 27 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CheckItemDto.java

@@ -0,0 +1,27 @@
+package com.ym.mec.biz.dal.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+
+public class CheckItemDto {
+    @ApiModelProperty(value = "巡查日程id", required = false)
+    private Long planId;
+
+    @ApiModelProperty(value = "巡查日程最后提交项", required = false)
+    private Integer checkItem;
+
+    public Long getPlanId() {
+        return planId;
+    }
+
+    public void setPlanId(Long planId) {
+        this.planId = planId;
+    }
+
+    public Integer getCheckItem() {
+        return checkItem;
+    }
+
+    public void setCheckItem(Integer checkItem) {
+        this.checkItem = checkItem;
+    }
+}

+ 164 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ExportVipGroupActivityDto.java

@@ -0,0 +1,164 @@
+package com.ym.mec.biz.dal.dto;
+
+import com.ym.mec.biz.dal.enums.YesOrNoEnum;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Author zouxuan
+ */
+public class ExportVipGroupActivityDto {
+
+    @ApiModelProperty(value = "适用分部")
+    private String organName;
+
+    @ApiModelProperty(value = "活动编号")
+    private Integer id;
+
+    @ApiModelProperty(value = "活动名称")
+    private String name;
+
+    @ApiModelProperty(value = "活动内容")
+    private String description;
+
+    @ApiModelProperty(value = "适用课程类型")
+    private String vipGroupCategoryIdList;
+
+    @ApiModelProperty(value = "启用状态")
+    private YesOrNoEnum openFlag;
+
+    @ApiModelProperty(value = "活动持续时间")
+    private String time;
+
+    @ApiModelProperty(value = "课程安排时间")
+    private String courseTime;
+
+    @ApiModelProperty(value = "活动类型")
+    private String type;
+
+    @ApiModelProperty(value = "活动折扣")
+    private String disCount;
+
+    @ApiModelProperty(value = "线上课结算类型")
+    private String onlineSalaryType;
+
+    @ApiModelProperty(value = "线上课结算公式")
+    private String onlineSalarySettlement;
+
+    @ApiModelProperty(value = "线下课结算类型")
+    private String offlineSalaryType;
+
+    @ApiModelProperty(value = "线下课结算公式")
+    private String offlineSalarySettlement;
+
+    public String getCourseTime() {
+        return courseTime;
+    }
+
+    public void setCourseTime(String courseTime) {
+        this.courseTime = courseTime;
+    }
+
+    public String getOrganName() {
+        return organName;
+    }
+
+    public void setOrganName(String organName) {
+        this.organName = organName;
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public String getVipGroupCategoryIdList() {
+        return vipGroupCategoryIdList;
+    }
+
+    public void setVipGroupCategoryIdList(String vipGroupCategoryIdList) {
+        this.vipGroupCategoryIdList = vipGroupCategoryIdList;
+    }
+
+    public YesOrNoEnum getOpenFlag() {
+        return openFlag;
+    }
+
+    public void setOpenFlag(YesOrNoEnum openFlag) {
+        this.openFlag = openFlag;
+    }
+
+    public String getTime() {
+        return time;
+    }
+
+    public void setTime(String time) {
+        this.time = time;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getDisCount() {
+        return disCount;
+    }
+
+    public void setDisCount(String disCount) {
+        this.disCount = disCount;
+    }
+
+    public String getOnlineSalaryType() {
+        return onlineSalaryType;
+    }
+
+    public void setOnlineSalaryType(String onlineSalaryType) {
+        this.onlineSalaryType = onlineSalaryType;
+    }
+
+    public String getOnlineSalarySettlement() {
+        return onlineSalarySettlement;
+    }
+
+    public void setOnlineSalarySettlement(String onlineSalarySettlement) {
+        this.onlineSalarySettlement = onlineSalarySettlement;
+    }
+
+    public String getOfflineSalaryType() {
+        return offlineSalaryType;
+    }
+
+    public void setOfflineSalaryType(String offlineSalaryType) {
+        this.offlineSalaryType = offlineSalaryType;
+    }
+
+    public String getOfflineSalarySettlement() {
+        return offlineSalarySettlement;
+    }
+
+    public void setOfflineSalarySettlement(String offlineSalarySettlement) {
+        this.offlineSalarySettlement = offlineSalarySettlement;
+    }
+}

+ 42 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/InspectionItemPlanConclusionDto.java

@@ -0,0 +1,42 @@
+package com.ym.mec.biz.dal.dto;
+
+import com.ym.mec.biz.dal.entity.InspectionItemPlanConclusion;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.List;
+
+public class InspectionItemPlanConclusionDto {
+
+    @ApiModelProperty(value = "巡查结果记录")
+    private List<InspectionItemPlanConclusion> inspectionItemPlanConclusions;
+
+    @ApiModelProperty(value = "提交巡查结果时的gps信息")
+    private String submitedGps;
+
+    @ApiModelProperty(value = "提交时的状态 1-正常提交 2-异常提交")
+    private Integer status;
+
+    public List<InspectionItemPlanConclusion> getInspectionItemPlanConclusions() {
+        return inspectionItemPlanConclusions;
+    }
+
+    public void setInspectionItemPlanConclusions(List<InspectionItemPlanConclusion> inspectionItemPlanConclusions) {
+        this.inspectionItemPlanConclusions = inspectionItemPlanConclusions;
+    }
+
+    public String getSubmitedGps() {
+        return submitedGps;
+    }
+
+    public void setSubmitedGps(String submitedGps) {
+        this.submitedGps = submitedGps;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+}

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

@@ -67,6 +67,17 @@ public class MusicGroupStudentsDto{
     @ApiModelProperty(value = "剩余可排课时长",required = false)
     private BigDecimal subTotalCourseTime;
 
+    @ApiModelProperty(value = "欠费金额",required = false)
+    private BigDecimal noPaymentAmount;
+
+    public BigDecimal getNoPaymentAmount() {
+        return noPaymentAmount;
+    }
+
+    public void setNoPaymentAmount(BigDecimal noPaymentAmount) {
+        this.noPaymentAmount = noPaymentAmount;
+    }
+
     public BigDecimal getSubTotalCourseTime() {
         return subTotalCourseTime;
     }

+ 11 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentPaymentRouteOrderDto.java

@@ -12,6 +12,8 @@ public class StudentPaymentRouteOrderDto extends StudentPaymentOrder {
      * 分配分部id
      */
     private Integer routeOrganId;
+    
+    private String routeOrganName;
 
     /**
      * 学校id
@@ -59,7 +61,15 @@ public class StudentPaymentRouteOrderDto extends StudentPaymentOrder {
         this.routeOrganId = routingOrganId;
     }
 
-    public BigDecimal getRouteAmount() {
+    public String getRouteOrganName() {
+		return routeOrganName;
+	}
+
+	public void setRouteOrganName(String routeOrganName) {
+		this.routeOrganName = routeOrganName;
+	}
+
+	public BigDecimal getRouteAmount() {
         return routeAmount;
     }
 

+ 36 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherVisitDto.java

@@ -0,0 +1,36 @@
+package com.ym.mec.biz.dal.dto;
+
+/**
+ * 老师访问数
+ */
+public class TeacherVisitDto {
+    private Integer teacherId;
+
+    private String month;
+
+    private Integer num;
+
+    public Integer getTeacherId() {
+        return teacherId;
+    }
+
+    public void setTeacherId(Integer teacherId) {
+        this.teacherId = teacherId;
+    }
+
+    public Integer getNum() {
+        return num;
+    }
+
+    public void setNum(Integer num) {
+        this.num = num;
+    }
+
+    public String getMonth() {
+        return month;
+    }
+
+    public void setMonth(String month) {
+        this.month = month;
+    }
+}

+ 72 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/IndexErrInfoDto.java

@@ -0,0 +1,72 @@
+package com.ym.mec.biz.dal.entity;
+
+import com.ym.mec.biz.dal.enums.IndexErrorType;
+import org.springframework.util.CollectionUtils;
+
+import java.util.List;
+
+/**
+ * @Author Joburgess
+ * @Date 2021/1/19 0019
+ */
+public class IndexErrInfoDto<T> {
+
+    private IndexErrorType errorType;
+
+    private String desc;
+
+    private int num = 0;
+
+    private List<T> result;
+
+    public IndexErrInfoDto() {
+    }
+
+    public IndexErrInfoDto(IndexErrorType errorType, String desc, int num, List<T> result) {
+        this.errorType = errorType;
+        this.desc = desc;
+        this.num = num;
+        this.result = result;
+    }
+
+    public IndexErrInfoDto(IndexErrorType errorType, String desc, List<T> result) {
+        this.errorType = errorType;
+        this.desc = desc;
+        this.result = result;
+        if(!CollectionUtils.isEmpty(result)){
+            this.num = result.size();
+        }
+    }
+
+    public IndexErrorType getErrorType() {
+        return errorType;
+    }
+
+    public void setErrorType(IndexErrorType errorType) {
+        this.errorType = errorType;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+    public void setDesc(String desc) {
+        this.desc = desc;
+    }
+
+    public int getNum() {
+        return num;
+    }
+
+    public void setNum(int num) {
+        this.num = num;
+    }
+
+    public List<T> getResult() {
+        return result;
+    }
+
+    public void setResult(List<T> result) {
+        this.result = result;
+    }
+}

+ 185 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Inspection.java

@@ -0,0 +1,185 @@
+package com.ym.mec.biz.dal.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.PastOrPresent;
+import javax.validation.constraints.Positive;
+import java.util.Date;
+import java.util.List;
+
+@ApiModel(value = "com-ym-mec-biz-dal-entity-Inspection")
+public class Inspection {
+    /**
+     * id
+     */
+    @ApiModelProperty(value = "id")
+    private Long id;
+
+    /**
+     * 分部id
+     */
+    @ApiModelProperty(value = "分部id")
+    @Positive(message = "老师id必须大于0")
+    private Integer organId;
+
+    /**
+     * 主管userId
+     */
+    @ApiModelProperty(value = "主管userId",required = true)
+    @Positive(message = "乐团主管必选")
+    private Integer userId;
+
+    /**
+     * 月份
+     */
+    @ApiModelProperty(value = "月份",required = true)
+    @NotNull(message = "工作周期不能为空")
+    private Date month;
+
+    /**
+     * 处理意见
+     */
+    @ApiModelProperty(value = "处理意见")
+    private String memo;
+
+    /**
+     * 操作人
+     */
+    @ApiModelProperty(value = "操作人")
+    private Integer operation;
+
+    /**
+     * 创建时间
+     */
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+    /**
+     * 修改时间
+     */
+    @ApiModelProperty(value = "修改时间")
+    private Date updateTime;
+
+    @ApiModelProperty(value = "分部名称")
+    private String organName;
+
+    @ApiModelProperty(value = "主管名字")
+    private String userName;
+
+    @ApiModelProperty(value = "任务事项数量")
+    private Integer itemNum;
+
+    @ApiModelProperty(value = "任务总次数")
+    private Integer times;
+
+    @ApiModelProperty(value = "巡查事项列表")
+    @NotNull(message = "巡查事务项不能为空")
+    private List<InspectionItem> inspectionItems;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Integer getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(Integer organId) {
+        this.organId = organId;
+    }
+
+    public Integer getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    public Date getMonth() {
+        return month;
+    }
+
+    public void setMonth(Date month) {
+        this.month = month;
+    }
+
+    public String getMemo() {
+        return memo;
+    }
+
+    public void setMemo(String memo) {
+        this.memo = memo;
+    }
+
+    public Integer getOperation() {
+        return operation;
+    }
+
+    public void setOperation(Integer operation) {
+        this.operation = operation;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getOrganName() {
+        return organName;
+    }
+
+    public void setOrganName(String organName) {
+        this.organName = organName;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public Integer getItemNum() {
+        return itemNum;
+    }
+
+    public void setItemNum(Integer itemNum) {
+        this.itemNum = itemNum;
+    }
+
+    public Integer getTimes() {
+        return times;
+    }
+
+    public void setTimes(Integer times) {
+        this.times = times;
+    }
+
+    public List<InspectionItem> getInspectionItems() {
+        return inspectionItems;
+    }
+
+    public void setInspectionItems(List<InspectionItem> inspectionItems) {
+        this.inspectionItems = inspectionItems;
+    }
+}

+ 210 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/InspectionItem.java

@@ -0,0 +1,210 @@
+package com.ym.mec.biz.dal.entity;
+
+import com.ym.mec.biz.dal.enums.InspectionItemEnum;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.Date;
+
+@ApiModel(value = "com-ym-mec-biz-dal-entity-InspectionItem")
+public class InspectionItem {
+    /**
+     * 巡查任务项id
+     */
+    @ApiModelProperty(value = "巡查任务项id")
+    private Long id;
+
+    /**
+     * 巡查任务id
+     */
+    @ApiModelProperty(value = "巡查任务id")
+    private Long inspectionId;
+
+    /**
+     * 分部id
+     */
+    @ApiModelProperty(value = "分部id")
+    private Integer organId;
+
+    /**
+     * 乐团主管id
+     */
+    @ApiModelProperty(value = "乐团主管id")
+    private Integer userId;
+
+    /**
+     * 任务项
+     */
+    @ApiModelProperty(value = "任务项")
+    private InspectionItemEnum item;
+
+    /**
+     * 任务次数
+     */
+    @ApiModelProperty(value = "任务次数")
+    private Integer times;
+
+    /**
+     * 已安排日程次数
+     */
+    @ApiModelProperty(value = "已安排日程次数")
+    private Integer plannedTimes;
+
+    /**
+     * 已提交任务数
+     */
+    @ApiModelProperty(value = "已提交任务数")
+    private Integer submittedTimes;
+
+    /**
+     * 处理意见
+     */
+    @ApiModelProperty(value = "处理意见")
+    private String memo;
+
+    /**
+     * 操作人
+     */
+    @ApiModelProperty(value = "操作人")
+    private Integer operation;
+
+    /**
+     * 创建时间
+     */
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+    /**
+     * 修改时间
+     */
+    @ApiModelProperty(value = "修改时间")
+    private Date updateTime;
+
+    @ApiModelProperty(value = "月份")
+    private Date month;
+
+    @ApiModelProperty(value = "分部名称")
+    private String organName;
+
+    @ApiModelProperty(value = "主管名字")
+    private String userName;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getInspectionId() {
+        return inspectionId;
+    }
+
+    public void setInspectionId(Long inspectionId) {
+        this.inspectionId = inspectionId;
+    }
+
+    public Integer getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(Integer organId) {
+        this.organId = organId;
+    }
+
+    public Integer getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    public InspectionItemEnum getItem() {
+        return item;
+    }
+
+    public void setItem(InspectionItemEnum item) {
+        this.item = item;
+    }
+
+    public Integer getTimes() {
+        return times;
+    }
+
+    public void setTimes(Integer times) {
+        this.times = times;
+    }
+
+    public Integer getPlannedTimes() {
+        return plannedTimes;
+    }
+
+    public void setPlannedTimes(Integer plannedTimes) {
+        this.plannedTimes = plannedTimes;
+    }
+
+    public Integer getSubmittedTimes() {
+        return submittedTimes;
+    }
+
+    public void setSubmittedTimes(Integer submittedTimes) {
+        this.submittedTimes = submittedTimes;
+    }
+
+    public String getMemo() {
+        return memo;
+    }
+
+    public void setMemo(String memo) {
+        this.memo = memo;
+    }
+
+    public Integer getOperation() {
+        return operation;
+    }
+
+    public void setOperation(Integer operation) {
+        this.operation = operation;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public Date getMonth() {
+        return month;
+    }
+
+    public void setMonth(Date month) {
+        this.month = month;
+    }
+
+    public String getOrganName() {
+        return organName;
+    }
+
+    public void setOrganName(String organName) {
+        this.organName = organName;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+}

+ 294 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/InspectionItemPlan.java

@@ -0,0 +1,294 @@
+package com.ym.mec.biz.dal.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.Positive;
+import java.util.Date;
+
+@ApiModel(value = "com-ym-mec-biz-dal-entity-InspectionItemPlan")
+public class InspectionItemPlan {
+    /**
+     * 计划id
+     */
+    @ApiModelProperty(value = "计划id")
+    private Long id;
+
+    /**
+     * 巡查任务id
+     */
+    @ApiModelProperty(value = "巡查任务id")
+    private Long inspectionId;
+
+    /**
+     * 巡查任务id
+     */
+    @ApiModelProperty(value = "巡查任务id")
+    @Positive(message = "巡查任务id必须大于0")
+    private Long itemId;
+
+    /**
+     * 乐团主管user_id_
+     */
+    @ApiModelProperty(value = "乐团主管user_id_")
+    private Integer userId;
+
+    /**
+     * 日程开始时间
+     */
+    @ApiModelProperty(value = "日程开始时间")
+    private Date planStart;
+
+    /**
+     * 日程结束时间
+     */
+    @ApiModelProperty(value = "日程结束时间")
+    private Date planEnd;
+
+    /**
+     * 分部id
+     */
+    @ApiModelProperty(value = "分部id")
+    private Integer organId;
+
+    /**
+     * 合作单位id
+     */
+    @ApiModelProperty(value = "合作单位id")
+    private Integer cooperationOrganId;
+
+    /**
+     * 乐团id
+     */
+    @ApiModelProperty(value = "乐团id")
+    private String musicGroupId;
+
+    /**
+     * 教学点gps
+     */
+    @ApiModelProperty(value = "教学点gps")
+    private String schoolGps;
+
+    /**
+     * 提交时gps
+     */
+    @ApiModelProperty(value = "提交时gps")
+    private String submitedGps;
+
+    /**
+     * 提交时间
+     */
+    @ApiModelProperty(value = "提交时间")
+    private Date submitedTime;
+
+    /**
+     * 处理方式
+     */
+    @ApiModelProperty(value = "处理方式")
+    private String memo;
+
+
+    /**
+     * 巡查结果是否异常 0-正常 1-异常
+     */
+    @ApiModelProperty(value = "巡查结果是否异常 0-正常 1-异常")
+    private Integer conclusionStatus;
+
+    /**
+     * 0 -未提交 1-正常 2-异常
+     */
+    @ApiModelProperty(value = "提交状态 0 -未提交 1-正常 2-异常")
+    private Integer status;
+
+    /**
+     * 创建时间
+     */
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+    /**
+     * 修改时间
+     */
+    @ApiModelProperty(value = "修改时间")
+    private Date updateTime;
+
+    @ApiModelProperty(value = "分部")
+    private String organName;
+
+    @ApiModelProperty(value = "合作单位")
+    private String cooperationName;
+
+    @ApiModelProperty(value = "乐团名称")
+    private String musicGroupName;
+
+    @ApiModelProperty(value = "已提交的最后结果项")
+    private Integer lastCheckItem = 0;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getInspectionId() {
+        return inspectionId;
+    }
+
+    public void setInspectionId(Long inspectionId) {
+        this.inspectionId = inspectionId;
+    }
+
+    public Long getItemId() {
+        return itemId;
+    }
+
+    public void setItemId(Long itemId) {
+        this.itemId = itemId;
+    }
+
+    public Integer getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    public Date getPlanStart() {
+        return planStart;
+    }
+
+    public void setPlanStart(Date planStart) {
+        this.planStart = planStart;
+    }
+
+    public Date getPlanEnd() {
+        return planEnd;
+    }
+
+    public void setPlanEnd(Date planEnd) {
+        this.planEnd = planEnd;
+    }
+
+    public Integer getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(Integer organId) {
+        this.organId = organId;
+    }
+
+    public Integer getCooperationOrganId() {
+        return cooperationOrganId;
+    }
+
+    public void setCooperationOrganId(Integer cooperationOrganId) {
+        this.cooperationOrganId = cooperationOrganId;
+    }
+
+    public String getMusicGroupId() {
+        return musicGroupId;
+    }
+
+    public void setMusicGroupId(String musicGroupId) {
+        this.musicGroupId = musicGroupId;
+    }
+
+    public String getSchoolGps() {
+        return schoolGps;
+    }
+
+    public void setSchoolGps(String schoolGps) {
+        this.schoolGps = schoolGps;
+    }
+
+    public String getSubmitedGps() {
+        return submitedGps;
+    }
+
+    public void setSubmitedGps(String submitedGps) {
+        this.submitedGps = submitedGps;
+    }
+
+    public Date getSubmitedTime() {
+        return submitedTime;
+    }
+
+    public void setSubmitedTime(Date submitedTime) {
+        this.submitedTime = submitedTime;
+    }
+
+    public String getMemo() {
+        return memo;
+    }
+
+    public void setMemo(String memo) {
+        this.memo = memo;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getMusicGroupName() {
+        return musicGroupName;
+    }
+
+    public void setMusicGroupName(String musicGroupName) {
+        this.musicGroupName = musicGroupName;
+    }
+
+    public String getCooperationName() {
+        return cooperationName;
+    }
+
+    public void setCooperationName(String cooperationName) {
+        this.cooperationName = cooperationName;
+    }
+
+    public Integer getLastCheckItem() {
+        return lastCheckItem;
+    }
+
+    public void setLastCheckItem(Integer lastCheckItem) {
+        this.lastCheckItem = lastCheckItem;
+    }
+
+    public String getOrganName() {
+        return organName;
+    }
+
+    public void setOrganName(String organName) {
+        this.organName = organName;
+    }
+
+    public Integer getConclusionStatus() {
+        return conclusionStatus;
+    }
+
+    public void setConclusionStatus(Integer conclusionStatus) {
+        this.conclusionStatus = conclusionStatus;
+    }
+}

+ 117 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/InspectionItemPlanConclusion.java

@@ -0,0 +1,117 @@
+package com.ym.mec.biz.dal.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.Date;
+
+@ApiModel(value = "com-ym-mec-biz-dal-entity-InspectionItemPlanConclusion")
+public class InspectionItemPlanConclusion {
+    @ApiModelProperty(value = "")
+    private Long id;
+
+    /**
+     * 计划id
+     */
+    @ApiModelProperty(value = "计划id")
+    private Long planId;
+
+    /**
+     * 老师id
+     */
+    @ApiModelProperty(value = "课程id")
+    private Long courseScheduleId;
+
+    /**
+     * 老师id
+     */
+    @ApiModelProperty(value = "老师id")
+    private Integer teacherId;
+
+    /**
+     * 检查事项
+     */
+    @ApiModelProperty(value = "检查事项")
+    private Integer checkItem;
+
+    /**
+     * 老师是否佩戴工牌
+     */
+    @ApiModelProperty(value = "检查结果")
+    private Integer checkConclusion;
+
+    /**
+     * 创建时间
+     */
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+    /**
+     * 更新时间
+     */
+    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getPlanId() {
+        return planId;
+    }
+
+    public void setPlanId(Long planId) {
+        this.planId = planId;
+    }
+
+    public Long getCourseScheduleId() {
+        return courseScheduleId;
+    }
+
+    public void setCourseScheduleId(Long courseScheduleId) {
+        this.courseScheduleId = courseScheduleId;
+    }
+
+    public Integer getTeacherId() {
+        return teacherId;
+    }
+
+    public void setTeacherId(Integer teacherId) {
+        this.teacherId = teacherId;
+    }
+
+    public Integer getCheckItem() {
+        return checkItem;
+    }
+
+    public void setCheckItem(Integer checkItem) {
+        this.checkItem = checkItem;
+    }
+
+    public Integer getCheckConclusion() {
+        return checkConclusion;
+    }
+
+    public void setCheckConclusion(Integer checkConclusion) {
+        this.checkConclusion = checkConclusion;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+}

+ 11 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentVisit.java

@@ -111,6 +111,8 @@ public class StudentVisit {
      */
     private Date createTime;
 
+    private Long objectId;
+
     public Integer getId() {
         return id;
     }
@@ -206,4 +208,12 @@ public class StudentVisit {
     public void setCreateTime(Date createTime) {
         this.createTime = createTime;
     }
-}
+
+    public Long getObjectId() {
+        return objectId;
+    }
+
+    public void setObjectId(Long objectId) {
+        this.objectId = objectId;
+    }
+}

+ 8 - 8
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TeacherCourseStatistics.java

@@ -30,42 +30,42 @@ public class TeacherCourseStatistics {
     /**
     * vip课节数
     */
-    private Integer vipCourseNum;
+    private Integer vipCourseNum = 0;
 
     /**
     * 乐团课节数
     */
-    private Integer musicCourseNum;
+    private Integer musicCourseNum = 0;
 
     /**
      * 网管课节数
      */
-    private Integer practiceCourseNum;
+    private Integer practiceCourseNum = 0;
 
     /**
     * 预计乐团课酬
     */
-    private BigDecimal expectMusicCourseSalary;
+    private BigDecimal expectMusicCourseSalary = BigDecimal.ZERO;
 
     /**
     * 预计小课课酬
     */
-    private BigDecimal expectVipCourseSalary;
+    private BigDecimal expectVipCourseSalary = BigDecimal.ZERO;
 
     /**
      * 预计小课课酬
      */
-    private BigDecimal expectPracticeCourseSalary;
+    private BigDecimal expectPracticeCourseSalary = BigDecimal.ZERO;
 
     /**
     * 预计合计课酬
     */
-    private BigDecimal expectTotalSalary;
+    private BigDecimal expectTotalSalary = BigDecimal.ZERO;
 
     /**
     * 平均上课时长
     */
-    private Integer averageClassMinutes;
+    private Integer averageClassMinutes = 0;
 
     private Boolean lowSalary;
 

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/IndexDataType.java

@@ -33,7 +33,7 @@ public enum IndexDataType implements BaseEnum<String, IndexDataType> {
     STUDENT_CONVERSION("STUDENT_CONVERSION","学员转化"),
     STUDENT_CONVERSION_PRE_STUDENT_NUM("STUDENT_CONVERSION_PRE_STUDENT_NUM","预报名人数"),
     STUDENT_CONVERSION_STUDENT_NUM("STUDENT_CONVERSION_STUDENT_NUM","报名人数"),
-    STUDENT_CONVERSION_PAYMENT_STUDENT_NUM("STUDENT_CONVERSION_PAYMENT_STUDENT_NUM","学员转化"),
+    STUDENT_CONVERSION_PAYMENT_STUDENT_NUM("STUDENT_CONVERSION_PAYMENT_STUDENT_NUM","报名缴费"),
     STUDENT_CONVERSION_VIP_PRACTICE_STUDENT_NUM("STUDENT_CONVERSION_VIP_PRACTICE_STUDENT_NUM","VIP/网管课购买"),
 
     MUSIC_GROUP_COURSE("MUSIC_GROUP_COURSE","乐团课"),

+ 53 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/IndexErrorType.java

@@ -0,0 +1,53 @@
+package com.ym.mec.biz.dal.enums;
+
+import com.ym.mec.common.enums.BaseEnum;
+
+/**
+ * @Author Joburgess
+ * @Date 2021/1/18 0018
+ **/
+public enum IndexErrorType implements BaseEnum<String, IndexErrorType> {
+    MUSIC_PATROL("MUSIC_PATROL", "乐团巡查"),
+    HIGH_CLASS_STUDENT_LESS_THAN_THREE("HIGH_CLASS_STUDENT_LESS_THAN_THREE", "基础技能班学员数量异常"),
+    MUSIC_PATROL_ITEM("MUSIC_PATROL_ITEM", "乐团巡查事项异常"),
+
+    STUDENT_INFO("STUDENT_INFO", "学员处理"),
+    STUDENT_NOT_PAYMENT("STUDENT_NOT_PAYMENT", "学员未缴费"),
+    STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP("STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP", "学员退团申请"),
+    WAIT_CREATE_PAYMENT_CALENDER("WAIT_CREATE_PAYMENT_CALENDER", "待创建缴费项目"),
+    COURSE_TRUANT_STUDENT_NUM("COURSE_TRUANT_STUDENT_NUM", "学员考情异常旷课"),
+    COURSE_LEAVE_STUDENT_NUM("COURSE_LEAVE_STUDENT_NUM", "请假"),
+
+    TEACHER_INFO("TEACHER_INFO", "日常行政"),
+    TEACHER_EXCEPTION_ATTENDANCE("TEACHER_EXCEPTION_ATTENDANCE", "老师考勤异常"),
+    TEACHER_NOT_A_CLASS("TEACHER_NOT_A_CLASS", "未签到签退"),
+    TEACHER_LEAVE("TEACHER_LEAVE", "老师请假"),
+    TEACHER_EXPECT_SALARY_BE_LOW("TEACHER_EXPECT_SALARY_BE_LOW", "预计课酬较低"),
+    ;
+
+    private String code;
+
+    private String msg;
+
+    IndexErrorType(String code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+    @Override
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+}

+ 27 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/InspectionItemEnum.java

@@ -0,0 +1,27 @@
+package com.ym.mec.biz.dal.enums;
+
+import com.ym.mec.common.enums.BaseEnum;
+
+public enum InspectionItemEnum implements BaseEnum<String, InspectionItemEnum> {
+	INSPECT("INSPECT", "下校巡查"),
+	VISIT("VISIT", "学员回访");
+
+	private String code;
+
+	private String desc;
+
+	private InspectionItemEnum(String code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	@Override
+	public String getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+}

+ 128 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/InspectionItemPlanQueryInfo.java

@@ -0,0 +1,128 @@
+package com.ym.mec.biz.dal.page;
+
+import com.ym.mec.common.page.QueryInfo;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.Date;
+
+public class InspectionItemPlanQueryInfo extends QueryInfo {
+
+    @ApiModelProperty(value = "itemId",required = false)
+    private Long itemId;
+
+    @ApiModelProperty(value = "分部ids",required = false)
+    private String organId;
+
+    @ApiModelProperty(value = "合作单位id",required = false)
+    private Integer cooperationOrganId;
+
+    @ApiModelProperty(value = "乐团id",required = false)
+    private String musicGroupId;
+
+    @ApiModelProperty(value = "乐团主管id",required = false)
+    private Integer userId;
+
+    @ApiModelProperty(value = "巡查结果是否异常 0-正常 1-异常",required = false)
+    private Integer conclusionStatus;
+
+    @ApiModelProperty(value = "提交状态 0 -未提交 1-正常 2-异常",required = false)
+    private Integer status;
+
+    @ApiModelProperty(value = "是否已提交 0-未提交 1-已提交 ",required = false)
+    private Integer hasSubmit;
+
+    @ApiModelProperty(value = "月份",required = false)
+    private Date month;
+
+    private Date startTime;
+
+    private Date endTime;
+
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public Long getItemId() {
+        return itemId;
+    }
+
+    public void setItemId(Long itemId) {
+        this.itemId = itemId;
+    }
+
+    public Integer getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    public Integer getHasSubmit() {
+        return hasSubmit;
+    }
+
+    public void setHasSubmit(Integer hasSubmit) {
+        this.hasSubmit = hasSubmit;
+    }
+
+    public Date getMonth() {
+        return month;
+    }
+
+    public void setMonth(Date month) {
+        this.month = month;
+    }
+
+    public String getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(String organId) {
+        this.organId = organId;
+    }
+
+    public Integer getCooperationOrganId() {
+        return cooperationOrganId;
+    }
+
+    public void setCooperationOrganId(Integer cooperationOrganId) {
+        this.cooperationOrganId = cooperationOrganId;
+    }
+
+    public String getMusicGroupId() {
+        return musicGroupId;
+    }
+
+    public void setMusicGroupId(String musicGroupId) {
+        this.musicGroupId = musicGroupId;
+    }
+
+    public Integer getConclusionStatus() {
+        return conclusionStatus;
+    }
+
+    public void setConclusionStatus(Integer conclusionStatus) {
+        this.conclusionStatus = conclusionStatus;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+}

+ 73 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/InspectionQueryInfo.java

@@ -0,0 +1,73 @@
+package com.ym.mec.biz.dal.page;
+
+import com.ym.mec.common.page.QueryInfo;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.Date;
+
+public class InspectionQueryInfo extends QueryInfo {
+
+    @ApiModelProperty(value = "分部ids",required = false)
+    private String organId;
+
+    @ApiModelProperty(value = "乐团主管id",required = false)
+    private Integer userId;
+
+    @ApiModelProperty(value = "月份",required = false)
+    private Date month;
+
+    @ApiModelProperty(value = "添加人",required = false)
+    private Integer operation;
+
+    private Date startTime;
+
+    private Date endTime;
+
+	public String getOrganId() {
+		return organId;
+	}
+
+	public void setOrganId(String organId) {
+		this.organId = organId;
+	}
+
+    public Integer getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    public Date getMonth() {
+        return month;
+    }
+
+    public void setMonth(Date month) {
+        this.month = month;
+    }
+
+    public Integer getOperation() {
+        return operation;
+    }
+
+    public void setOperation(Integer operation) {
+        this.operation = operation;
+    }
+
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+}

+ 23 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/TeacherCourseStatisticsQueryInfo.java

@@ -3,6 +3,7 @@ package com.ym.mec.biz.dal.page;
 import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.ApiModelProperty;
 
+import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
 
@@ -20,6 +21,12 @@ public class TeacherCourseStatisticsQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "月份")
     private Date month;
 
+    @ApiModelProperty(value = "最小课酬")
+    private BigDecimal minSalary;
+
+    @ApiModelProperty(value = "最大课酬")
+    private BigDecimal maxSalary;
+
     public String getOrganId() {
         return organId;
     }
@@ -51,4 +58,20 @@ public class TeacherCourseStatisticsQueryInfo extends QueryInfo {
     public void setMonth(Date month) {
         this.month = month;
     }
+
+    public BigDecimal getMinSalary() {
+        return minSalary;
+    }
+
+    public void setMinSalary(BigDecimal minSalary) {
+        this.minSalary = minSalary;
+    }
+
+    public BigDecimal getMaxSalary() {
+        return maxSalary;
+    }
+
+    public void setMaxSalary(BigDecimal maxSalary) {
+        this.maxSalary = maxSalary;
+    }
 }

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

@@ -5,6 +5,7 @@ import java.util.Map;
 
 import com.ym.mec.biz.dal.dto.IndexBaseDto;
 import com.ym.mec.biz.dal.entity.IndexBaseMonthData;
+import com.ym.mec.biz.dal.entity.IndexErrInfoDto;
 import com.ym.mec.common.service.BaseService;
 
 public interface IndexBaseMonthDataService extends BaseService<Long, IndexBaseMonthData> {
@@ -13,4 +14,13 @@ public interface IndexBaseMonthDataService extends BaseService<Long, IndexBaseMo
 
     Map<String, List<IndexBaseDto>> indexBaseDataTask(String month);
 
+    Map<String, Object> getIndexErrData(String organIds);
+
+    /**
+     * 事项提醒
+     * @param organIds
+     * @return
+     */
+    List<IndexErrInfoDto> getRemindMatterData(String organIds);
+
 }

+ 37 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/InspectionItemPlanConclusionService.java

@@ -0,0 +1,37 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.dto.InspectionItemPlanConclusionDto;
+import com.ym.mec.biz.dal.entity.CourseSchedule;
+import com.ym.mec.biz.dal.entity.InspectionItemPlanConclusion;
+import com.ym.mec.common.service.BaseService;
+
+import java.util.List;
+import java.util.Map;
+
+public interface InspectionItemPlanConclusionService extends BaseService<Long, InspectionItemPlanConclusion> {
+    /**
+     * 添加巡查结果
+     *
+     * @param inspectionItemPlanConclusionDto
+     * @return
+     */
+    InspectionItemPlanConclusionDto add(InspectionItemPlanConclusionDto inspectionItemPlanConclusionDto);
+
+    /**
+     * 获取
+     * @param planId
+     * @param checkItem
+     * @return
+     */
+   Map<Integer,List<InspectionItemPlanConclusion>> getInfo(Long planId, Integer checkItem);
+
+    /**
+     * 获取日程内的课程信息
+     * @param planId
+     * @return
+     */
+    List<CourseSchedule> getPlanCourses(Long planId);
+}
+
+
+

+ 31 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/InspectionItemPlanService.java

@@ -0,0 +1,31 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.entity.InspectionItemPlan;
+import com.ym.mec.biz.dal.page.InspectionItemPlanQueryInfo;
+import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.common.service.BaseService;
+
+public interface InspectionItemPlanService extends BaseService<Long, InspectionItemPlan> {
+
+    /**
+     * 获取巡查日程列表
+     * @param queryInfo
+     * @return
+     */
+    PageInfo<InspectionItemPlan> getPageList(InspectionItemPlanQueryInfo queryInfo);
+    /**
+     * 添加日程
+     * @param inspectionItemPlan
+     * @return
+     */
+    InspectionItemPlan add(InspectionItemPlan inspectionItemPlan);
+
+    /**
+     * 修改日程
+     * @param inspectionItemPlan
+     * @return
+     */
+    InspectionItemPlan updatePlan(InspectionItemPlan inspectionItemPlan);
+}
+
+

+ 21 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/InspectionItemService.java

@@ -0,0 +1,21 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.entity.InspectionItem;
+import com.ym.mec.biz.dal.page.InspectionQueryInfo;
+import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.common.service.BaseService;
+
+import java.util.List;
+
+public interface InspectionItemService extends BaseService<Long, InspectionItem> {
+
+    /**
+     * 获取任务事务项列表
+     * @param queryInfo
+     * @return
+     */
+    PageInfo<InspectionItem> getPageList(InspectionQueryInfo queryInfo);
+
+}
+
+

+ 50 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/InspectionService.java

@@ -0,0 +1,50 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.entity.Inspection;
+import com.ym.mec.biz.dal.entity.School;
+import com.ym.mec.biz.dal.page.InspectionQueryInfo;
+import com.ym.mec.biz.dal.page.SchoolQueryInfo;
+import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.common.service.BaseService;
+
+import java.util.List;
+
+public interface InspectionService extends BaseService<Long, Inspection> {
+
+    /**
+     * 获取巡查任务列表
+     * @param queryInfo
+     * @return
+     */
+    PageInfo<Inspection> getPageList(InspectionQueryInfo queryInfo);
+
+
+    /**
+     * 添加巡查任务
+     * @param inspections
+     * @return
+     */
+    List<Inspection> add(List<Inspection> inspections,Integer operationUserId);
+
+    /**
+     * 获取巡查任务详情
+     * @param id
+     * @return
+     */
+    Inspection getInfo(Long id);
+
+    /**
+     * 修改巡查任务
+     * @return
+     */
+    Inspection updateInspection(Inspection inspection,Integer operationUserId);
+
+    /**
+     * 删除巡查任务
+     * @param id
+     * @return
+     */
+    Boolean delInspections(Long id);
+}
+
+

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/VipGroupActivityService.java

@@ -1,7 +1,9 @@
 package com.ym.mec.biz.service;
 
+import com.ym.mec.biz.dal.dto.ExportVipGroupActivityDto;
 import com.ym.mec.biz.dal.dto.VipGroupActivityAddDto;
 import com.ym.mec.biz.dal.entity.VipGroupActivity;
+import com.ym.mec.biz.dal.page.VipGroupActivityQueryInfo;
 import com.ym.mec.common.service.BaseService;
 
 import java.util.List;
@@ -29,4 +31,10 @@ public interface VipGroupActivityService extends BaseService<Integer, VipGroupAc
      */
     List<VipGroupActivity> findByVipGroupCategory(Long categoryId, Integer teacherId);
 
+    /**
+     * 导出vip活动
+     * @param queryInfo
+     * @return
+     */
+    List<ExportVipGroupActivityDto> exportVipGroupActivity(VipGroupActivityQueryInfo queryInfo);
 }

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

@@ -3,6 +3,8 @@ package com.ym.mec.biz.service.impl;
 import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.AUDITING;
 import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.NO;
 import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.SPAN_GROUP_CLASS_ADJUST;
+import static com.ym.mec.biz.dal.enums.ClassGroupTypeEnum.HIGH;
+import static com.ym.mec.biz.dal.enums.ClassGroupTypeEnum.HIGH_ONLINE;
 import static com.ym.mec.biz.dal.enums.GroupType.COMM;
 import static com.ym.mec.biz.dal.enums.GroupType.MUSIC;
 import static com.ym.mec.biz.dal.enums.GroupType.PRACTICE;
@@ -220,10 +222,10 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         }
 
         //基础技能班和线上基础技能班,可分班原则为声部人数/6向上取整
-        if (classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE) || classGroup.getType().equals(ClassGroupTypeEnum.HIGH)) {
+        if (classGroup.getType().equals(HIGH_ONLINE) || classGroup.getType().equals(HIGH)) {
             HighClassGroupNumDto highClassGroupNumDto = getSubjectMaxHighClassGroupNum(classGroup.getMusicGroupId(), classGroup.getType());
             if (highClassGroupNumDto.getNowHighClassGroupNum() >= highClassGroupNumDto.getMaxHighClassGroupNum()) {
-                String errMsg = classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE) ? "线上基础技能班" : "基础技能班";
+                String errMsg = classGroup.getType().equals(HIGH_ONLINE) ? "线上基础技能班" : "基础技能班";
                 throw new BizException("此乐团," + errMsg + "数量不能大于" + highClassGroupNumDto.getMaxHighClassGroupNum());
             }
         }
@@ -287,6 +289,19 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         // 加入IM群组
         if (userIdList.size() > 0) {
             addImGroup(classGroup, userIdList, teacherIdList);
+        }else {
+            MusicGroup musicGroup = musicGroupDao.get(classGroup.getMusicGroupId());
+            Map<Integer,String> userRoleMap = new HashMap<>();
+            userRoleMap.put(musicGroup.getEducationalTeacherId(), "乐团主管");
+            userRoleMap.put(musicGroup.getTeamTeacherId(), "运营主管");
+            userRoleMap.put(musicGroup.getDirectorUserId(), "乐队指导");
+            if(teacherIdList != null && teacherIdList.size() > 0){
+                for(Integer teacherId : teacherIdList){
+                    userRoleMap.put(teacherId, "指导老师");
+                }
+            }
+            imGroupService.create(classGroup.getId().longValue(), null, classGroup.getName(), musicGroup.getName(), musicGroup.getName(), musicGroup.getName(), null, "MUSIC");
+            imGroupMemberService.join(classGroup.getId().longValue(), userRoleMap);
         }
         return true;
     }
@@ -458,7 +473,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                 throw new BizException("班数不能大于" + highClassGroupNum);
             }
 
-            List<ClassGroup> classGroups = classGroupDao.findClassGroupByMusicGroupIdAndType(musicGroup.getId(), ClassGroupTypeEnum.HIGH);
+            List<ClassGroup> classGroups = classGroupDao.findClassGroupByMusicGroupIdAndType(musicGroup.getId(), HIGH);
             if (classGroups.size() > 0) {
                 List<Integer> classGroupIds = classGroups.stream().map(classGroup -> classGroup.getId()).collect(Collectors.toList());
 
@@ -502,7 +517,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                 highClassGroup.setGroupType(MUSIC);
                 highClassGroup.setCreateTime(date);
                 highClassGroup.setUpdateTime(date);
-                highClassGroup.setType(ClassGroupTypeEnum.HIGH);
+                highClassGroup.setType(HIGH);
                 highClassGroup.setTotalClassTimes(highClassGroup.getCourseTimes());
                 highClassGroup.setCurrentClassTimes(0);
                 insert(highClassGroup);
@@ -723,7 +738,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
             Long studentNum = classGroupStudentNumMap.get(classGroupAndTeacher.getId());
             studentNum = Objects.isNull(studentNum) ? 0 : studentNum;
-            if (classGroupAndTeacher.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE) && (studentNum < 3 || studentNum > 5)) {
+            if (classGroupAndTeacher.getType().equals(HIGH_ONLINE) && (studentNum < 3 || studentNum > 5)) {
                 String numWaring = studentNum < 3 ? "人数不能小于3," : "人数不能大于5,";
                 waringStr += classGroupAndTeacher.getName() + numWaring;
             }
@@ -1063,19 +1078,40 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         if (courseScheduleIds.size() > 0) {
             hasTeacherSalaryCount = courseScheduleTeacherSalaryDao.getHasTeacherSalaryCount(courseScheduleIds);
         }
-        if (classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE) && hasTeacherSalaryCount > 0) {
+        if ((classGroup.getType().equals(HIGH_ONLINE) || classGroup.getType().equals(HIGH)) && hasTeacherSalaryCount > 0) {
             Integer studentNum = classGroup.getStudentNum() + 1;
             List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaryList = new ArrayList<>();
             courseScheduleTeacherSalaryDao.batchDeleteByCourseScheduleIds(courseScheduleIds);
             for (CourseSchedule courseSchedule : courseScheduleList) {
                 for (ClassGroupTeacherMapper classGroupTeacher : classGroupTeachers) {
-                    List<TeacherDefaultMusicGroupSalary> teacherSalaryList = teacherDefaultMusicGroupSalaryService.getTeacherSalaryByUserIdAndType(classGroupTeacher.getUserId(), ClassGroupTypeEnum.HIGH_ONLINE.getCode(), null);
+                    List<TeacherDefaultMusicGroupSalary> teacherSalaryList = teacherDefaultMusicGroupSalaryService.getTeacherSalaryByUserIdAndType(classGroupTeacher.getUserId(), null, null);
                     Map<CourseSchedule.CourseScheduleType, TeacherDefaultMusicGroupSalary> collect = teacherSalaryList.stream().collect(Collectors.toMap(TeacherDefaultMusicGroupSalary::getCourseScheduleType, teacherDefaultMusicGroupSalary -> teacherDefaultMusicGroupSalary));
-                    TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalary = collect.get(courseSchedule.getType());
-                    if (studentNum > 5) {
+                    TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalary = collect.get(CourseSchedule.CourseScheduleType.HIGH_ONLINE);
+                    if (classGroup.getType().equals(HIGH_ONLINE) && studentNum > 5) {
                         studentNum = 5;
                     }
-                    BigDecimal salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(studentNum.toString());
+
+                    BigDecimal salary = null;
+                    if(classGroup.getType().equals(HIGH_ONLINE)){
+                        salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(studentNum + "");
+                    }else if(classGroup.getType().equals(HIGH)){
+                        MusicGroup musicGroup = musicGroupDao.get(classGroup.getMusicGroupId());
+                        TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalaryHigh = collect.get(CourseSchedule.CourseScheduleType.HIGH);
+                        if(Objects.isNull(teacherDefaultMusicGroupSalaryHigh)){
+                            throw new BizException("请设置老师课酬");
+                        }
+                        salary = TeachTypeEnum.BISHOP.equals(classGroupTeacher.getTeacherRole()) ? teacherDefaultMusicGroupSalaryHigh.getMainTeacher30MinSalary() : teacherDefaultMusicGroupSalaryHigh.getAssistantTeacher30MinSalary();
+                        if (musicGroup.getSettlementType().equals(SalarySettlementTypeEnum.GRADIENT_SALARY)) {
+                            salary = TeachTypeEnum.BISHOP.equals(classGroupTeacher.getTeacherRole()) ? teacherDefaultMusicGroupSalaryHigh.getMainTeacher90MinSalary() : teacherDefaultMusicGroupSalaryHigh.getAssistantTeacher90MinSalary();
+                        }
+                        if(Objects.isNull(salary)){
+                            throw new BizException("请设置老师课酬");
+                        }
+                        salary = salary.multiply(new BigDecimal(studentNum));
+                    }
+                    if(Objects.isNull(salary)){
+                        throw new BizException("请设置老师课酬");
+                    }
 
                     CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary();
                     courseScheduleTeacherSalary.setCourseScheduleId(courseSchedule.getId());
@@ -1202,14 +1238,14 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
             //4、调整未上课课酬
             List<ClassGroupTeacherMapper> classGroupTeachers = classGroupTeacherMapperService.getClassGroupTeachers(classGroup.getId());
-            if ((classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE) || classGroup.getType().equals(ClassGroupTypeEnum.HIGH)) && courseScheduleList.size() > 0) {
+            if ((classGroup.getType().equals(HIGH_ONLINE) || classGroup.getType().equals(HIGH)) && courseScheduleList.size() > 0) {
                 Date nowDate = new Date();
                 List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaryList = new ArrayList<>();
                 List<Long> courseScheduleIds = courseScheduleList.stream().map(CourseSchedule::getId).collect(Collectors.toList());
                 courseScheduleTeacherSalaryDao.batchDeleteByCourseScheduleIds(courseScheduleIds);
                 for (CourseSchedule courseSchedule : courseScheduleList) {
                     for (ClassGroupTeacherMapper classGroupTeacher : classGroupTeachers) {
-                        List<TeacherDefaultMusicGroupSalary> teacherSalaryList = teacherDefaultMusicGroupSalaryService.getTeacherSalaryByUserIdAndType(classGroupTeacher.getUserId(), ClassGroupTypeEnum.HIGH_ONLINE.getCode(), null);
+                        List<TeacherDefaultMusicGroupSalary> teacherSalaryList = teacherDefaultMusicGroupSalaryService.getTeacherSalaryByUserIdAndType(classGroupTeacher.getUserId(), null, null);
                         if (teacherSalaryList == null || teacherSalaryList.size() == 0) {
                             throw new BizException("请设置老师线上网管课课酬");
                         }
@@ -1217,11 +1253,31 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                         TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalary = collect.get(CourseSchedule.CourseScheduleType.HIGH_ONLINE);
 
                         int studentNum = classGroup.getStudentNum() + 1;
-                        if (studentNum > 5) {
+                        if (classGroup.getType().equals(HIGH_ONLINE) && studentNum > 5) {
                             studentNum = 5;
                         }
 
-                        BigDecimal salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(studentNum + "");
+                        BigDecimal salary = null;
+                        if(classGroup.getType().equals(HIGH_ONLINE)){
+                            salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(studentNum + "");
+                        }else if(classGroup.getType().equals(HIGH)){
+                            MusicGroup musicGroup = musicGroupDao.get(classGroup.getMusicGroupId());
+                            TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalaryHigh = collect.get(CourseSchedule.CourseScheduleType.HIGH);
+                            if(Objects.isNull(teacherDefaultMusicGroupSalaryHigh)){
+                                throw new BizException("请设置老师课酬");
+                            }
+                            salary = TeachTypeEnum.BISHOP.equals(classGroupTeacher.getTeacherRole()) ? teacherDefaultMusicGroupSalaryHigh.getMainTeacher30MinSalary() : teacherDefaultMusicGroupSalaryHigh.getAssistantTeacher30MinSalary();
+                            if (musicGroup.getSettlementType().equals(SalarySettlementTypeEnum.GRADIENT_SALARY)) {
+                                salary = TeachTypeEnum.BISHOP.equals(classGroupTeacher.getTeacherRole()) ? teacherDefaultMusicGroupSalaryHigh.getMainTeacher90MinSalary() : teacherDefaultMusicGroupSalaryHigh.getAssistantTeacher90MinSalary();
+                            }
+                            if(Objects.isNull(salary)){
+                                throw new BizException("请设置老师课酬");
+                            }
+                            salary = salary.multiply(new BigDecimal(studentNum));
+                        }
+                        if(Objects.isNull(salary)){
+                            throw new BizException("请设置老师课酬");
+                        }
 
                         CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary();
                         courseScheduleTeacherSalary.setCourseScheduleId(courseSchedule.getId());
@@ -1703,7 +1759,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
         List<Integer> subjectIdList = studentList.stream().map(student -> student.getActualSubjectId()).collect(Collectors.toList());
         TeachModeEnum teachMode = TeachModeEnum.OFFLINE;
-        if (classGroup4MixDtos.get(0).getType().equals(ClassGroupTypeEnum.HIGH_ONLINE)) {
+        if (classGroup4MixDtos.get(0).getType().equals(HIGH_ONLINE)) {
             subjectIdList.clear();
             subjectIdList.add(classGroup4MixDtos.get(0).getSubjectId());
             teachMode = TeachModeEnum.ONLINE;
@@ -1926,7 +1982,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         Integer schoolId = musicGroup.getSchoolId();
 
         TeachModeEnum teachMode = TeachModeEnum.OFFLINE;
-        if (classGroup4MixDto.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE)) {
+        if (classGroup4MixDto.getType().equals(HIGH_ONLINE)) {
             teachMode = TeachModeEnum.ONLINE;
         } else if (classGroup4MixDto.getType().equals(ClassGroupTypeEnum.MUSIC_NETWORK)) {
             teachMode = TeachModeEnum.ONLINE;
@@ -2035,7 +2091,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         List<StudentRegistration> studentList = studentRegistrationService.findStudentListByUserIdList(musicGroupId, studentIdList);
 
         List<Integer> subjectIdList = studentList.stream().map(student -> student.getActualSubjectId()).collect(Collectors.toList());
-        if (classGroup4MixDto.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE)) {
+        if (classGroup4MixDto.getType().equals(HIGH_ONLINE)) {
             subjectIdList.clear();
             subjectIdList.add(classGroup4MixDto.getSubjectId());
         }
@@ -2192,7 +2248,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         }
 
         TeachModeEnum teachMode = TeachModeEnum.OFFLINE;
-        if (classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE) || classGroup.getType().equals(ClassGroupTypeEnum.MUSIC_NETWORK)) {
+        if (classGroup.getType().equals(HIGH_ONLINE) || classGroup.getType().equals(ClassGroupTypeEnum.MUSIC_NETWORK)) {
             teachMode = TeachModeEnum.ONLINE;
         }
 
@@ -3833,5 +3889,77 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                 courseScheduleTeacherSalaryDao.batchDeleteByCourseScheduleIds(delCourseIds);
             }
         }
+        //如果是基础技能班,重新计算老师课酬
+        if(classGroupIds.size() > 0){
+            //获取班级学员人数
+            List<Map<Integer, Integer>> classGroupStudentNumMaps = classGroupStudentMapperDao.countClassGroupsStudentNum(classGroupIds, ClassGroupStudentStatusEnum.NORMAL);
+            Map<Integer, Long> classGroupStudentNumMap = MapUtil.convertIntegerMap(classGroupStudentNumMaps);
+            List<ClassGroup> byClassGroupIds = classGroupDao.findByClassGroupIds(classGroupIds, null);
+            for (ClassGroup classGroup : byClassGroupIds) {
+                Long aLong = classGroupStudentNumMap.get(classGroup.getId());
+                classGroup.setStudentNum(aLong==null?0:aLong.intValue());
+                if(classGroup.getType() == HIGH_ONLINE || classGroup.getType() == HIGH){
+                    if(aLong != null && aLong > 0){
+                        List<CourseSchedule> courseScheduleList = courseScheduleService.findNoStartCoursesByClassGroupId(classGroup.getId());
+                        if(courseScheduleList.size() > 0){
+                            //调整未上课课酬
+                            List<ClassGroupTeacherMapper> classGroupTeachers = classGroupTeacherMapperService.getClassGroupTeachers(classGroup.getId());
+                            Date nowDate = new Date();
+                            List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaryList = new ArrayList<>();
+                            List<Long> courseScheduleIds = courseScheduleList.stream().map(CourseSchedule::getId).collect(Collectors.toList());
+                            courseScheduleTeacherSalaryDao.batchDeleteByCourseScheduleIds(courseScheduleIds);
+                            for (CourseSchedule courseSchedule : courseScheduleList) {
+                                for (ClassGroupTeacherMapper classGroupTeacher : classGroupTeachers) {
+                                    List<TeacherDefaultMusicGroupSalary> teacherSalaryList = teacherDefaultMusicGroupSalaryService.getTeacherSalaryByUserIdAndType(classGroupTeacher.getUserId(), null, null);
+                                    if (teacherSalaryList == null || teacherSalaryList.size() == 0) {
+                                        throw new BizException("请设置老师线上网管课课酬");
+                                    }
+                                    Map<CourseSchedule.CourseScheduleType, TeacherDefaultMusicGroupSalary> collect = teacherSalaryList.stream().collect(Collectors.toMap(TeacherDefaultMusicGroupSalary::getCourseScheduleType, teacherDefaultMusicGroupSalary -> teacherDefaultMusicGroupSalary));
+                                    TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalary = collect.get(CourseSchedule.CourseScheduleType.HIGH_ONLINE);
+
+                                    if (classGroup.getType().equals(HIGH_ONLINE) && aLong > 5l) {
+                                        aLong = 5l;
+                                    }
+                                    BigDecimal salary = null;
+                                    if(classGroup.getType().equals(HIGH_ONLINE)){
+                                        salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(aLong + "");
+                                    }else if(classGroup.getType().equals(HIGH)){
+                                        MusicGroup musicGroup = musicGroupDao.get(classGroup.getMusicGroupId());
+                                        TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalaryHigh = collect.get(CourseSchedule.CourseScheduleType.HIGH);
+                                        if(Objects.isNull(teacherDefaultMusicGroupSalaryHigh)){
+                                            throw new BizException("请设置老师课酬");
+                                        }
+                                        salary = TeachTypeEnum.BISHOP.equals(classGroupTeacher.getTeacherRole()) ? teacherDefaultMusicGroupSalaryHigh.getMainTeacher30MinSalary() : teacherDefaultMusicGroupSalaryHigh.getAssistantTeacher30MinSalary();
+                                        if (musicGroup.getSettlementType().equals(SalarySettlementTypeEnum.GRADIENT_SALARY)) {
+                                            salary = TeachTypeEnum.BISHOP.equals(classGroupTeacher.getTeacherRole()) ? teacherDefaultMusicGroupSalaryHigh.getMainTeacher90MinSalary() : teacherDefaultMusicGroupSalaryHigh.getAssistantTeacher90MinSalary();
+                                        }
+                                        if(Objects.isNull(salary)){
+                                            throw new BizException("请设置老师课酬");
+                                        }
+                                        salary = salary.multiply(new BigDecimal(aLong));
+                                    }
+                                    if(Objects.isNull(salary)){
+                                        throw new BizException("请设置老师课酬");
+                                    }
+                                    CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary();
+                                    courseScheduleTeacherSalary.setCourseScheduleId(courseSchedule.getId());
+                                    courseScheduleTeacherSalary.setGroupType(courseSchedule.getGroupType());
+                                    courseScheduleTeacherSalary.setMusicGroupId(courseSchedule.getMusicGroupId());
+                                    courseScheduleTeacherSalary.setTeacherRole(classGroupTeacher.getTeacherRole());
+                                    courseScheduleTeacherSalary.setUserId(classGroupTeacher.getUserId());
+                                    courseScheduleTeacherSalary.setExpectSalary(salary);
+                                    courseScheduleTeacherSalary.setClassGroupId(classGroup.getId());
+                                    courseScheduleTeacherSalary.setCreateTime(nowDate);
+                                    courseScheduleTeacherSalary.setUpdateTime(nowDate);
+                                    courseScheduleTeacherSalaryList.add(courseScheduleTeacherSalary);
+                                }
+                            }
+                            courseScheduleTeacherSalaryService.batchInsert(courseScheduleTeacherSalaryList);
+                        }
+                    }
+                }
+            }
+            classGroupDao.batchUpdate(byClassGroupIds);
+        }
     }
 }

+ 85 - 16
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupStudentMapperServiceImpl.java

@@ -14,6 +14,7 @@ import java.util.Objects;
 import java.util.Set;
 import java.util.stream.Collectors;
 
+import com.ym.mec.biz.dal.enums.*;
 import com.ym.mec.biz.service.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -41,12 +42,6 @@ import com.ym.mec.biz.dal.entity.CourseScheduleTeacherSalary;
 import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.dal.entity.StudentRegistration;
 import com.ym.mec.biz.dal.entity.TeacherDefaultMusicGroupSalary;
-import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
-import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
-import com.ym.mec.biz.dal.enums.CourseStatusEnum;
-import com.ym.mec.biz.dal.enums.GroupType;
-import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
-import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.entity.ImGroupMember;
 import com.ym.mec.common.entity.ImGroupModel;
@@ -156,16 +151,38 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
             courseScheduleTeacherSalaryDao.batchDeleteByCourseScheduleIds(courseScheduleIds);
             for (CourseSchedule courseSchedule : courseScheduleList) {
                 for (ClassGroupTeacherMapper classGroupTeacher : classGroupTeachers) {
-                    List<TeacherDefaultMusicGroupSalary> teacherSalaryList = teacherDefaultMusicGroupSalaryService.getTeacherSalaryByUserIdAndType(classGroupTeacher.getUserId(), ClassGroupTypeEnum.HIGH_ONLINE.getCode(), null);
+                    List<TeacherDefaultMusicGroupSalary> teacherSalaryList = teacherDefaultMusicGroupSalaryService.getTeacherSalaryByUserIdAndType(classGroupTeacher.getUserId(), null, null);
                     if (teacherSalaryList == null || teacherSalaryList.size() == 0) {
                         throw new BizException("请设置老师线上网管课课酬");
                     }
                     Map<CourseSchedule.CourseScheduleType, TeacherDefaultMusicGroupSalary> collect = teacherSalaryList.stream().collect(Collectors.toMap(TeacherDefaultMusicGroupSalary::getCourseScheduleType, teacherDefaultMusicGroupSalary -> teacherDefaultMusicGroupSalary));
                     TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalary = collect.get(CourseSchedule.CourseScheduleType.HIGH_ONLINE);
-                    if (studentNum > 5) {
+
+                    if (classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE) && studentNum > 5) {
                         studentNum = 5;
                     }
-                    BigDecimal salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(studentNum.toString());
+
+                    BigDecimal salary = null;
+                    if(classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE)){
+                        salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(studentNum + "");
+                    }else if(classGroup.getType().equals(ClassGroupTypeEnum.HIGH)){
+                        MusicGroup musicGroup = musicGroupDao.get(classGroup.getMusicGroupId());
+                        TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalaryHigh = collect.get(CourseSchedule.CourseScheduleType.HIGH);
+                        if(Objects.isNull(teacherDefaultMusicGroupSalaryHigh)){
+                            throw new BizException("请设置老师课酬");
+                        }
+                        salary = TeachTypeEnum.BISHOP.equals(classGroupTeacher.getTeacherRole()) ? teacherDefaultMusicGroupSalaryHigh.getMainTeacher30MinSalary() : teacherDefaultMusicGroupSalaryHigh.getAssistantTeacher30MinSalary();
+                        if (musicGroup.getSettlementType().equals(SalarySettlementTypeEnum.GRADIENT_SALARY)) {
+                            salary = TeachTypeEnum.BISHOP.equals(classGroupTeacher.getTeacherRole()) ? teacherDefaultMusicGroupSalaryHigh.getMainTeacher90MinSalary() : teacherDefaultMusicGroupSalaryHigh.getAssistantTeacher90MinSalary();
+                        }
+                        if(Objects.isNull(salary)){
+                            throw new BizException("请设置老师课酬");
+                        }
+                        salary = salary.multiply(new BigDecimal(studentNum));
+                    }
+                    if(Objects.isNull(salary)){
+                        throw new BizException("请设置老师课酬");
+                    }
 
                     CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary();
                     courseScheduleTeacherSalary.setCourseScheduleId(courseSchedule.getId());
@@ -315,23 +332,43 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
         }
         //4、调整未上课课酬
         List<ClassGroupTeacherMapper> classGroupTeachers = classGroupTeacherMapperService.getClassGroupTeachers(classGroupId);
-        if (classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE) && courseScheduleList.size() > 0) {
+        if ((classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE) || classGroup.getType().equals(ClassGroupTypeEnum.HIGH)) && courseScheduleList.size() > 0) {
             studentNum += userIdStrSet.size();
             List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaryList = new ArrayList<>();
             List<Long> courseScheduleIds = courseScheduleList.stream().map(CourseSchedule::getId).collect(Collectors.toList());
             courseScheduleTeacherSalaryDao.batchDeleteByCourseScheduleIds(courseScheduleIds);
             for (CourseSchedule courseSchedule : courseScheduleList) {
                 for (ClassGroupTeacherMapper classGroupTeacher : classGroupTeachers) {
-                    List<TeacherDefaultMusicGroupSalary> teacherSalaryList = teacherDefaultMusicGroupSalaryService.getTeacherSalaryByUserIdAndType(classGroupTeacher.getUserId(), ClassGroupTypeEnum.HIGH_ONLINE.getCode(), null);
+                    List<TeacherDefaultMusicGroupSalary> teacherSalaryList = teacherDefaultMusicGroupSalaryService.getTeacherSalaryByUserIdAndType(classGroupTeacher.getUserId(), null, null);
                     if (teacherSalaryList == null || teacherSalaryList.size() == 0) {
                         throw new BizException("请设置老师线上网管课课酬");
                     }
                     Map<CourseSchedule.CourseScheduleType, TeacherDefaultMusicGroupSalary> collect = teacherSalaryList.stream().collect(Collectors.toMap(TeacherDefaultMusicGroupSalary::getCourseScheduleType, teacherDefaultMusicGroupSalary -> teacherDefaultMusicGroupSalary));
                     TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalary = collect.get(courseSchedule.getType());
-                    if (studentNum > 5) {
+                    if (classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE) && studentNum > 5) {
                         studentNum = 5;
                     }
-                    BigDecimal salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(studentNum.toString());
+                    BigDecimal salary = null;
+                    if(classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE)){
+                        salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(studentNum + "");
+                    }else if(classGroup.getType().equals(ClassGroupTypeEnum.HIGH)){
+                        MusicGroup musicGroup = musicGroupDao.get(classGroup.getMusicGroupId());
+                        TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalaryHigh = collect.get(CourseSchedule.CourseScheduleType.HIGH);
+                        if(Objects.isNull(teacherDefaultMusicGroupSalaryHigh)){
+                            throw new BizException("请设置老师课酬");
+                        }
+                        salary = TeachTypeEnum.BISHOP.equals(classGroupTeacher.getTeacherRole()) ? teacherDefaultMusicGroupSalaryHigh.getMainTeacher30MinSalary() : teacherDefaultMusicGroupSalaryHigh.getAssistantTeacher30MinSalary();
+                        if (musicGroup.getSettlementType().equals(SalarySettlementTypeEnum.GRADIENT_SALARY)) {
+                            salary = TeachTypeEnum.BISHOP.equals(classGroupTeacher.getTeacherRole()) ? teacherDefaultMusicGroupSalaryHigh.getMainTeacher90MinSalary() : teacherDefaultMusicGroupSalaryHigh.getAssistantTeacher90MinSalary();
+                        }
+                        if(Objects.isNull(salary)){
+                            throw new BizException("请设置老师课酬");
+                        }
+                        salary = salary.multiply(new BigDecimal(studentNum));
+                    }
+                    if(Objects.isNull(salary)){
+                        throw new BizException("请设置老师课酬");
+                    }
 
                     CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary();
                     courseScheduleTeacherSalary.setCourseScheduleId(courseSchedule.getId());
@@ -473,6 +510,19 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
 
         List<CourseSchedule> classGroupNotStartCourse = courseScheduleDao.findCoursesByClassGroupId(classGroupId.intValue(), CourseStatusEnum.NOT_START);
         if (CollectionUtils.isEmpty(classGroupNotStartCourse)) {
+            if (!CollectionUtils.isEmpty(addStudentIds)) {
+                if(musicGroup.getStatus() == MusicGroupStatusEnum.PROGRESS){
+                    Map<Integer,String> userRoleMap = new HashMap<>();
+                    for (Integer addStudentId : addStudentIds) {
+                        userRoleMap.put(addStudentId, "");
+                    }
+                    //5、添加进IM群组
+                    imGroupMemberService.join(classGroup.getId().longValue(), userRoleMap);
+                }
+            }
+            if(musicGroup.getStatus() == MusicGroupStatusEnum.PROGRESS){
+                imUserFriendService.refreshClassImUserFriend(classGroup.getId());
+            }
             return;
         }
 
@@ -494,7 +544,7 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
             courseScheduleTeacherSalaryDao.batchDeleteByCourseScheduleIds(courseScheduleIds);
             for (CourseSchedule courseSchedule : classGroupNotStartCourse) {
                 for (ClassGroupTeacherMapper classGroupTeacher : classGroupTeachers) {
-                    List<TeacherDefaultMusicGroupSalary> teacherSalaryList = teacherDefaultMusicGroupSalaryService.getTeacherSalaryByUserIdAndType(classGroupTeacher.getUserId(), ClassGroupTypeEnum.HIGH_ONLINE.getCode(), null);
+                    List<TeacherDefaultMusicGroupSalary> teacherSalaryList = teacherDefaultMusicGroupSalaryService.getTeacherSalaryByUserIdAndType(classGroupTeacher.getUserId(), null, null);
                     if (teacherSalaryList == null || teacherSalaryList.size() == 0) {
                         throw new BizException("请设置老师线上网管课课酬");
                     }
@@ -502,11 +552,30 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
                     TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalary = collect.get(CourseSchedule.CourseScheduleType.HIGH_ONLINE);
 
                     int studentNum = studentIds.size();
-                    if (studentNum > 5) {
+                    if (classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE) && studentNum > 5) {
                         studentNum = 5;
                     }
 
-                    BigDecimal salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(studentNum + "");
+                    BigDecimal salary = null;
+                    if(classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE)){
+                        salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(studentNum + "");
+                    }else if(classGroup.getType().equals(ClassGroupTypeEnum.HIGH)){
+                        TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalaryHigh = collect.get(CourseSchedule.CourseScheduleType.HIGH);
+                        if(Objects.isNull(teacherDefaultMusicGroupSalaryHigh)){
+                            throw new BizException("请设置老师课酬");
+                        }
+                        salary = TeachTypeEnum.BISHOP.equals(classGroupTeacher.getTeacherRole()) ? teacherDefaultMusicGroupSalaryHigh.getMainTeacher30MinSalary() : teacherDefaultMusicGroupSalaryHigh.getAssistantTeacher30MinSalary();
+                        if (musicGroup.getSettlementType().equals(SalarySettlementTypeEnum.GRADIENT_SALARY)) {
+                            salary = TeachTypeEnum.BISHOP.equals(classGroupTeacher.getTeacherRole()) ? teacherDefaultMusicGroupSalaryHigh.getMainTeacher90MinSalary() : teacherDefaultMusicGroupSalaryHigh.getAssistantTeacher90MinSalary();
+                        }
+                        if(Objects.isNull(salary)){
+                            throw new BizException("请设置老师课酬");
+                        }
+                        salary = salary.multiply(new BigDecimal(studentNum));
+                    }
+                    if(Objects.isNull(salary)){
+                        throw new BizException("请设置老师课酬");
+                    }
 
                     CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary();
                     courseScheduleTeacherSalary.setCourseScheduleId(courseSchedule.getId());

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

@@ -699,7 +699,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 							}else {
 								BigDecimal salary = teacherPracticeSalaryMap.get(cgtm.getUserId());
 								if (salary == null) {
-									throw new BizException("请设置老师陪练课课酬");
+									throw new BizException("请设置老师网管课课酬");
 								}
 								courseScheduleTeacherSalary.setExpectSalary(salary);
 							}
@@ -3360,7 +3360,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 					} else if (newCourseSchedule.getGroupType() == GroupType.VIP) {
 						Map<String, BigDecimal> salaryMap = vipGroupService.countVipGroupPredictFee(vipGroup, teacherId);
 
-						BigDecimal teacherSalary=BigDecimal.ZERO;
+						BigDecimal teacherSalary=null;
 
 						if(Objects.nonNull(salaryMap)){
 							teacherSalary=newCourseSchedule.getTeachMode() == TeachModeEnum.OFFLINE?salaryMap.get("offlineTeacherSalary"):salaryMap.get("onlineTeacherSalary");
@@ -3377,6 +3377,9 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 							throw new BizException("请设置老师 的网管课课酬");
 						}
 					}
+					if(ts.getExpectSalary() == null){
+						throw new BizException("请设置老师的课酬");
+					}
 					insertCourseScheduleTeacherSalaryList.add(ts);
 				}
 			}

+ 9 - 37
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleTeacherSalaryServiceImpl.java

@@ -132,7 +132,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                 courseScheduleTeacherSalary.setTeacherRole(TeachTypeEnum.BISHOP);
                 courseScheduleTeacherSalary.setUserId(courseSchedules.get(i).getActualTeacherId().intValue());
                 courseScheduleTeacherSalary.setClassGroupId(courseSchedules.get(i).getClassGroupId());
-                courseScheduleTeacherSalary.setSubsidy(subsidy);
+//                courseScheduleTeacherSalary.setSubsidy(subsidy);
 
                 if (Objects.nonNull(vipGroupActivity)
                         &&vipGroupActivity.getType() == VipGroupActivityTypeEnum.GIVE_CLASS
@@ -537,7 +537,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
             CourseSchedule courseSchedule = courseScheduleIdMap.get(courseScheduleTeacherSalary.getCourseScheduleId());
 
             //教师课酬
-            BigDecimal teacherSalary = new BigDecimal(0);
+            BigDecimal teacherSalary = courseScheduleTeacherSalary.getExpectSalary();
 
             Teacher teacher = idTeacherMap.get(courseScheduleTeacherSalary.getUserId());
 
@@ -632,41 +632,6 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                 courseScheduleTeacherSalaryDao.update(courseScheduleTeacherSalary);
 
                 continue;
-            }else if(CourseSchedule.CourseScheduleType.HIGH.equals(courseSchedule.getType())){
-                //根据课程类型获取对应的默认课酬设置列表
-                List<TeacherDefaultMusicGroupSalary> teacherDefaultMusicGroupSalariesWithCourseType = teacherDefaultMusicGroupSalariesGroupByCourseType.get(courseSchedule.getType());
-                if (CollectionUtils.isEmpty(teacherDefaultMusicGroupSalariesWithCourseType)) {
-                    LOGGER.error("存在未指定结算方式的课程类型[{}]", courseScheduleTeacherSalary.getId());
-                    continue;
-                }
-
-                //根据教师编号将对应结算方式下的默认课酬设置分组
-                Map<Integer, TeacherDefaultMusicGroupSalary> teacherDefaultMusicGroupSalariesGroupByTeacherId = teacherDefaultMusicGroupSalariesWithCourseType.stream().collect(Collectors.toMap(TeacherDefaultMusicGroupSalary::getUserId, teacherDefaultMusicGroupSalary -> teacherDefaultMusicGroupSalary));
-
-                TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalaryWithTeacherId = teacherDefaultMusicGroupSalariesGroupByTeacherId.get(courseScheduleTeacherSalary.getUserId());
-
-                Long normalStudentNum = courseNormalStudentsMap.get(courseSchedule.getId());
-                if(Objects.isNull(normalStudentNum)){
-                    normalStudentNum = Long.valueOf(0);
-                }
-
-                //结算方式
-                String settlementType = musicGroupSettlementsMap.get(courseScheduleTeacherSalary.getCourseScheduleId());
-                if(StringUtils.isEmpty(settlementType)){
-                    LOGGER.error("未指定课酬结算方式[{}]", courseScheduleTeacherSalary.getId());
-                    continue;
-                }
-
-                teacherSalary = TeachTypeEnum.BISHOP.equals(courseScheduleTeacherSalary.getTeacherRole()) ? teacherDefaultMusicGroupSalaryWithTeacherId.getMainTeacher30MinSalary() : teacherDefaultMusicGroupSalaryWithTeacherId.getAssistantTeacher30MinSalary();
-                if (settlementType.equals(SalarySettlementTypeEnum.GRADIENT_SALARY)) {
-                    teacherSalary = TeachTypeEnum.BISHOP.equals(courseScheduleTeacherSalary.getTeacherRole()) ? teacherDefaultMusicGroupSalaryWithTeacherId.getMainTeacher90MinSalary() : teacherDefaultMusicGroupSalaryWithTeacherId.getAssistantTeacher90MinSalary();
-                }
-
-                if(Objects.isNull(teacherSalary)){
-                    LOGGER.error("教师课酬设置异常{}", courseSchedule.getId());
-                    continue;
-                }
-                teacherSalary = teacherSalary.multiply(new BigDecimal(normalStudentNum));
             }else{
                 teacherSalary=courseScheduleTeacherSalary.getExpectSalary();
             }
@@ -1183,6 +1148,9 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                 throw new BizException("请指定教师类型");
             }
             List<TeacherDefaultMusicGroupSalary> teacherSalaryList = teacherSalaryMap.get(courseScheduleTeacherSalary.getUserId());
+            if(teacherSalaryList == null || teacherSalaryList.size() == 0){
+            	throw new BizException("请设置老师课酬");
+            }
 
             BigDecimal salary;
 
@@ -1218,6 +1186,10 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                 baseSalary = TeachTypeEnum.BISHOP.equals(courseScheduleTeacherSalary.getTeacherRole()) ? teacherDefaultMusicGroupSalary.getMainTeacher30MinSalary() : teacherDefaultMusicGroupSalary.getAssistantTeacher30MinSalary();
                 classTimeDuty = new BigDecimal(classCourseDuration).divide(new BigDecimal(40), BigDecimal.ZERO.intValue(), BigDecimal.ROUND_DOWN);
             }
+            
+            if(Objects.isNull(baseSalary)){
+                throw new BizException("课酬设置异常");
+            }
 
             salary = baseSalary.multiply(classTimeDuty).setScale(2, BigDecimal.ROUND_HALF_UP);
 

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

@@ -376,10 +376,13 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
         }
         courseScheduleDao.batchAddCourseSchedules(practiceCourses);
         TeacherDefaultPracticeGroupSalary teacherDefaultPracticeGroupSalary = teacherDefaultPracticeGroupSalaryDao.findByTeacherAndCourseMinutes(practiceGroupBuyParams.getUserId(),practiceCourseMinutes);
-        BigDecimal teacherDefaultSalary=BigDecimal.ZERO;
+        BigDecimal teacherDefaultSalary=null;
         if(Objects.nonNull(teacherDefaultPracticeGroupSalary)){
             teacherDefaultSalary=teacherDefaultPracticeGroupSalary.getMainTeacherSalary();
         }
+        if(teacherDefaultSalary == null){
+        	throw new BizException("请设置老师课酬");
+        }
         BigDecimal studentSingleCourseCost=amount.divide(new BigDecimal(practiceCourses.size()), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
         BigDecimal studentSingleCourseOriginalCost=originalAmount.divide(new BigDecimal(practiceCourses.size()), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
         for (CourseSchedule courseSchedule : practiceCourses) {
@@ -1057,7 +1060,7 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
         practiceCourses.sort(Comparator.comparing(CourseSchedule::getStartClassTime));
         courseScheduleDao.batchAddCourseSchedules(practiceCourses);
 
-        BigDecimal teacherDefaultSalary=BigDecimal.ZERO;
+        BigDecimal teacherDefaultSalary=new BigDecimal(16.67);
         for (CourseSchedule courseSchedule : practiceCourses) {
             //课程与老师薪水表
             CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary();

+ 18 - 10
mec-biz/src/main/java/com/ym/mec/biz/service/impl/FinancialExpenditureServiceImpl.java

@@ -18,8 +18,9 @@ import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
-import com.ym.mec.util.excel.IniFileUtil;
 import com.ym.mec.util.excel.POIUtil;
+import com.ym.mec.util.ini.IniFileUtil;
+
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -56,7 +57,7 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
 		List<FinancialExpenditure> financialExpenditures = new ArrayList<>();
 		Map<String, Integer> organMap = getMap("organization", "name_", "id_", true, String.class, Integer.class);
 		Map<String, Integer> cooperationOrganMap = getMap("cooperation_organ", "name_", "id_", true, String.class, Integer.class);
-//		Map<String, Integer> phoneMap = getMap("sys_user", "phone_", "id_", true, String.class, Integer.class);
+		StringBuffer sb = new StringBuffer();
 		for (String e : sheetsListMap.keySet()) {
 			List<Map<String, Object>> sheet = sheetsListMap.get(e);
 			List<Object> collect = sheet.stream().map(m -> m.get("钉钉流程编号")).collect(Collectors.toList());
@@ -68,9 +69,10 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
 				throw new BizException("导入数据错误  重复的钉钉流程编号:{}",list.get(0));
 			}
 
-			valueIsNull: for (Map<String, Object> row : sheet) {
-
-				if (row.size() == 0){
+			valueIsNull: for (int j = 0; j < sheet.size(); j++) {
+				int rowNum = j + 2;
+				Map<String, Object> row = sheet.get(j);
+				if (row.size() == 0) {
 					continue;
 				}
 				JSONObject objectMap = new JSONObject();
@@ -89,9 +91,11 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
 						continue;
 					}
 					if (columnValue.equals("dingtalkProcessNo")) {
-						if(StringUtils.isEmpty(row.get(s).toString())){
-							LOGGER.error("支出记录导入异常:钉钉流程编号不可为空 param:{}",objectMap);
+						if (StringUtils.isEmpty(row.get(s).toString())) {
+							sb.append("第" + rowNum).append("行数据导入失败:钉钉流程编号不可为空;");
 							continue valueIsNull;
+						} else {
+							objectMap.put("incomeType", row.get(s));
 						}
 					}
 					if (columnValue.equals("feeProject")) {
@@ -105,7 +109,7 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
 					}
 					if (columnValue.equals("amount")) {
 						if(StringUtils.isEmpty(row.get(s).toString())){
-							LOGGER.error("支出记录导入异常:费用不可为空 param:{}",objectMap);
+							sb.append("第" + rowNum).append("行数据导入失败:费用不可为空;");
 							continue valueIsNull;
 						}else {
 							objectMap.put("amount", row.get(s));
@@ -115,7 +119,7 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
 					if (columnValue.equals("organName") && StringUtils.isNotEmpty(row.get(s).toString())) {
 						Integer integer = organMap.get(row.get(s));
 						if(integer == null){
-							LOGGER.error("支出记录导入异常:分部校验失败 param:{}",objectMap);
+							sb.append("第" + rowNum).append("行数据导入失败:分部校验失败;");
 							continue valueIsNull;
 						}else {
 							objectMap.put("organId", integer);
@@ -125,7 +129,8 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
 					if (columnValue.equals("cooperationOrganName") && StringUtils.isNotEmpty(row.get(s).toString())) {
 						Integer integer = cooperationOrganMap.get(row.get(s));
 						if(integer == null){
-							LOGGER.error("支出记录导入异常:合作单位校验失败 param:{}",objectMap);
+							sb.append("第" + rowNum).append("行数据导入失败:合作单位校验失败;");
+							continue valueIsNull;
 						}else {
 							objectMap.put("cooperationOrganId", integer);
 						}
@@ -154,6 +159,9 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
 				}
 			}
 		}
+		if(sb.length() > 0){
+			throw new BizException(sb.toString());
+		}
 		if(financialExpenditures.size() != 0){
 			financialExpenditureDao.batchInsert(financialExpenditures);
 		}

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

@@ -56,8 +56,8 @@ import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.IdGeneratorService;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
-import com.ym.mec.util.excel.IniFileUtil;
 import com.ym.mec.util.excel.POIUtil;
+import com.ym.mec.util.ini.IniFileUtil;
 
 @Service
 public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implements GoodsService {
@@ -199,7 +199,6 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 		InputStream inputStream = new ClassPathResource("columnMapper.ini").getInputStream();
 		Map<String,String> columns = IniFileUtil.readIniFile(inputStream, TemplateTypeEnum.GOODS.getMsg());
 		List<Goods> goodsList = new ArrayList<>();
-//		Map<String, Integer> map = MapUtil.convertIntegerMap(goodsCategoryDao.queryCategotyMap());
 		Map<String, Integer> map = getMap("goods_category","name_","id_",true,String.class,Integer.class);
 		for (String e : sheetsListMap.keySet()) {
 			List<Map<String, Object>> sheet = sheetsListMap.get(e);

+ 27 - 11
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ImGroupMemberServiceImpl.java

@@ -1,11 +1,7 @@
 package com.ym.mec.biz.service.impl;
 
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.Map.Entry;
-import java.util.Objects;
 import java.util.stream.Collectors;
 
 import org.apache.commons.lang3.StringUtils;
@@ -112,29 +108,49 @@ public class ImGroupMemberServiceImpl extends BaseServiceImpl<Long, ImGroupMembe
 		List<GroupMember> groupMemberList = new ArrayList<GroupMember>();
 
 		String groupId = imGroup.getId().toString();
-		Map<Integer, String> nameIdMap= MapUtil.convertIntegerMap(teacherDao.queryUserNameByIdList(new ArrayList<>(userRoleMap.keySet())));
+		List<Integer> usernameIds = new ArrayList<>();
+		List<Integer> realNameIds = new ArrayList<>();
+
+//		Map<Integer, String> nameIdMap = MapUtil.convertIntegerMap(teacherDao.queryNickNameByRole(userRoleMap.keySet(),userRoleMap));
 		for (Entry<Integer, String> entry : userRoleMap.entrySet()) {
-			
 			if(existUserIdList.contains(entry.getKey())||Objects.isNull(entry.getKey())){
 				continue;
 			}
-
 			ImGroupMember imGroupMember = new ImGroupMember();
 			imGroupMember.setCreateTime(date);
 			imGroupMember.setImGroupId(imGroupId);
 			imGroupMember.setIsAdmin(false);
 			imGroupMember.setRoleType(entry.getValue());
+			if(StringUtils.isEmpty(entry.getValue())){
+				usernameIds.add(entry.getKey());
+			}else {
+				realNameIds.add(entry.getKey());
+			}
 			imGroupMember.setUpdateTime(date);
 			imGroupMember.setUserId(entry.getKey());
-			imGroupMember.setNickname(nameIdMap.get(imGroupMember.getUserId()));
-
+//			imGroupMember.setNickname(nameIdMap.get(imGroupMember.getUserId()));
 			imGroupMemberList.add(imGroupMember);
 			groupMemberList.add(new GroupMember(imGroupMember.getUserId().toString(), groupId));
 		}
 
+
 		if (imGroupMemberList.size() > 0) {
+			Map<Integer, String> usernameMap = new HashMap<>();
+			Map<Integer, String> realNameMap = new HashMap<>();
+			if(usernameIds.size() > 0){
+				usernameMap = MapUtil.convertIntegerMap(teacherDao.queryUserNameByIdList(usernameIds));
+			}
+			if(realNameIds.size() > 0){
+				realNameMap = MapUtil.convertIntegerMap(teacherDao.queryNameByIdList(realNameIds));
+			}
+			for (ImGroupMember imGroupMember : imGroupMemberList) {
+				if(StringUtils.isEmpty(imGroupMember.getRoleType())){
+					imGroupMember.setNickname(usernameMap.get(imGroupMember.getUserId()));
+				}else {
+					imGroupMember.setNickname(realNameMap.get(imGroupMember.getUserId()));
+				}
+			}
 			imGroupMemberDao.batchInsert(imGroupMemberList);
-
 			imGroup.setMemberNum(imGroup.getMemberNum() + imGroupMemberList.size());
 			imGroup.setUpdateTime(date);
 			imGroupDao.update(imGroup);

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

@@ -1,21 +1,21 @@
 package com.ym.mec.biz.service.impl;
 
-import com.ym.mec.biz.dal.dao.OrganizationDao;
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.IndexBaseDto;
+import com.ym.mec.biz.dal.entity.IndexErrInfoDto;
 import com.ym.mec.biz.dal.entity.Organization;
-import com.ym.mec.biz.dal.enums.GroupType;
-import com.ym.mec.biz.dal.enums.IndexDataType;
-import com.ym.mec.biz.dal.enums.JobNatureEnum;
-import com.ym.mec.biz.dal.enums.PaymentStatusEnum;
+import com.ym.mec.biz.dal.enums.*;
 import com.ym.mec.common.constant.CommonConstants;
 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.util.date.DateUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import com.ym.mec.biz.dal.entity.IndexBaseMonthData;
 import com.ym.mec.biz.service.IndexBaseMonthDataService;
-import com.ym.mec.biz.dal.dao.IndexBaseMonthDataDao;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
@@ -26,6 +26,8 @@ import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.stream.Collectors;
 
+import static com.ym.mec.biz.dal.enums.IndexErrorType.WAIT_CREATE_PAYMENT_CALENDER;
+
 @Service
 public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBaseMonthData> implements IndexBaseMonthDataService {
 	
@@ -33,6 +35,16 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 	private IndexBaseMonthDataDao indexBaseMonthDataDao;
 	@Autowired
 	private OrganizationDao organizationDao;
+	@Autowired
+	private EmployeeDao employeeDao;
+	@Autowired
+	private MusicGroupDao musicGroupDao;
+	@Autowired
+	private SysConfigDao sysConfigDao;
+	@Autowired
+	private MusicGroupPaymentCalenderDao musicGroupPaymentCalenderDao;
+	@Autowired
+	private SysUserFeignService sysUserFeignService;
 
 	private static ThreadLocal<Set<Integer>> organIds = new ThreadLocal<Set<Integer>>(){
 		@Override
@@ -63,6 +75,9 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		startDate = startDate.withDayOfMonth(1);
 
 		LocalDate endDate = startDate.withMonth(12);
+		if(nowDate.getYear()>endDate.getYear()){
+			currentMonth = Date.from(endDate.atStartOfDay(DateUtil.zoneId).toInstant());
+		}
 
 		Set<Integer> organIds = null;
 		if(StringUtils.isNotBlank(organIdsStr)){
@@ -98,7 +113,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			}
 			typeDateMapEntry.getValue().sort(Comparator.comparing(IndexBaseMonthData::getMonth));
 			if(IndexDataType.ACTIVATION_RATE.equals(typeDateMapEntry.getKey())||IndexDataType.HOMEWORK_CREATE_RATE.equals(typeDateMapEntry.getKey())
-					||IndexDataType.HOMEWORK_SUBMIT_RATE.equals(typeDateMapEntry.getKey())||IndexDataType.HOMEWORK_SUBMIT_RATE.equals(typeDateMapEntry.getKey())
+					||IndexDataType.HOMEWORK_SUBMIT_RATE.equals(typeDateMapEntry.getKey())||IndexDataType.HOMEWORK_COMMENT_RATE.equals(typeDateMapEntry.getKey())
 					||IndexDataType.STUDENT_CONVERSION.equals(typeDateMapEntry.getKey())){
 				for (IndexBaseMonthData indexBaseMonthData : typeDateMapEntry.getValue()) {
 					if(indexBaseMonthData.getTotalNum().compareTo(BigDecimal.ZERO)==0){
@@ -160,7 +175,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		saveData(indexBaseMonthDataDao.getTeacherData(month, null, true), month, IndexDataType.DIMISSION_NUM);
 
 		//学员变动
-		saveData(indexBaseMonthDataDao.getMusicStudentData(month, "ALL"), month, IndexDataType.NEWLY_STUDENT_NUM);
+		saveData(indexBaseMonthDataDao.getMusicStudentData(month, "ADD"), month, IndexDataType.NEWLY_STUDENT_NUM);
 		saveData(indexBaseMonthDataDao.getMusicStudentData(month, "QUIT"), month, IndexDataType.QUIT_MUSIC_GROUP_STUDENT_NUM);
 		saveData(indexBaseMonthDataDao.getMusicGroupPreRegistrationStudentData(month), month, IndexDataType.STUDENT_CONVERSION_PRE_STUDENT_NUM);
 		saveData(indexBaseMonthDataDao.getMusicGroupStudentFromPreData(month, null), month, IndexDataType.STUDENT_CONVERSION_STUDENT_NUM);
@@ -184,7 +199,10 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		List<IndexBaseMonthData> convertData = new ArrayList<>();
 
 		Map<IndexDataType, IndexBaseDto> typeDataMap = result.stream().collect(Collectors.toMap(IndexBaseDto::getDataType, i -> i, (i1, i2) -> i1));
-		List<IndexBaseMonthData> preStudentNum = typeDataMap.get(IndexDataType.STUDENT_CONVERSION_PRE_STUDENT_NUM).getIndexMonthData();
+		List<IndexBaseMonthData> preStudentNum = new ArrayList<>();
+		if(typeDataMap.containsKey(IndexDataType.STUDENT_CONVERSION_PRE_STUDENT_NUM)){
+			preStudentNum = typeDataMap.get(IndexDataType.STUDENT_CONVERSION_PRE_STUDENT_NUM).getIndexMonthData();
+		}
 
 		IndexBaseMonthData preStudentNumData = new IndexBaseMonthData();
 		preStudentNumData.setMonth(currentMonth);
@@ -194,7 +212,10 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		preStudentNumData.setActivateNum(preStudentNum.stream().map(IndexBaseMonthData::getActivateNum).reduce(BigDecimal.ZERO, BigDecimal::add));
 		preStudentNumData.setPercent(preStudentNumData.getActivateNum());
 
-		List<IndexBaseMonthData> studentNum = typeDataMap.get(IndexDataType.STUDENT_CONVERSION_STUDENT_NUM).getIndexMonthData();
+		List<IndexBaseMonthData> studentNum = new ArrayList<>();
+		if(typeDataMap.containsKey(IndexDataType.STUDENT_CONVERSION_STUDENT_NUM)){
+			studentNum = typeDataMap.get(IndexDataType.STUDENT_CONVERSION_STUDENT_NUM).getIndexMonthData();
+		}
 
 		IndexBaseMonthData studentNumData = new IndexBaseMonthData();
 		studentNumData.setMonth(currentMonth);
@@ -203,7 +224,10 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		studentNumData.setTotalNum(studentNum.stream().map(IndexBaseMonthData::getTotalNum).reduce(BigDecimal.ZERO, BigDecimal::add));
 		studentNumData.setActivateNum(studentNum.stream().map(IndexBaseMonthData::getActivateNum).reduce(BigDecimal.ZERO, BigDecimal::add));
 
-		List<IndexBaseMonthData> paymentStudentNum = typeDataMap.get(IndexDataType.STUDENT_CONVERSION_PAYMENT_STUDENT_NUM).getIndexMonthData();
+		List<IndexBaseMonthData> paymentStudentNum = new ArrayList<>();
+		if(typeDataMap.containsKey(IndexDataType.STUDENT_CONVERSION_PAYMENT_STUDENT_NUM)){
+			paymentStudentNum = typeDataMap.get(IndexDataType.STUDENT_CONVERSION_PAYMENT_STUDENT_NUM).getIndexMonthData();
+		}
 
 		IndexBaseMonthData paymentStudentNumData = new IndexBaseMonthData();
 		paymentStudentNumData.setMonth(currentMonth);
@@ -212,7 +236,10 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		paymentStudentNumData.setTotalNum(paymentStudentNum.stream().map(IndexBaseMonthData::getTotalNum).reduce(BigDecimal.ZERO, BigDecimal::add));
 		paymentStudentNumData.setActivateNum(paymentStudentNum.stream().map(IndexBaseMonthData::getActivateNum).reduce(BigDecimal.ZERO, BigDecimal::add));
 
-		List<IndexBaseMonthData> convertStudentNum = typeDataMap.get(IndexDataType.STUDENT_CONVERSION_VIP_PRACTICE_STUDENT_NUM).getIndexMonthData();
+		List<IndexBaseMonthData> convertStudentNum = new ArrayList<>();
+		if(typeDataMap.containsKey(IndexDataType.STUDENT_CONVERSION_VIP_PRACTICE_STUDENT_NUM)){
+			convertStudentNum = typeDataMap.get(IndexDataType.STUDENT_CONVERSION_VIP_PRACTICE_STUDENT_NUM).getIndexMonthData();
+		}
 
 		IndexBaseMonthData convertStudentNumData = new IndexBaseMonthData();
 		convertStudentNumData.setMonth(currentMonth);
@@ -276,4 +303,82 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		indexBaseMonthDataDao.deleteWithMonthAndType(Arrays.asList(startMonth), indexDataType);
 		indexBaseMonthDataDao.batchInsertWithDataType(dataList, indexDataType);
 	}
+
+	@Override
+	public Map<String, Object> getIndexErrData(String organIdsStr) {
+		Set<Integer> organIds = null;
+		if(StringUtils.isNotBlank(organIdsStr)){
+			organIds = Arrays.stream(organIdsStr.split(",")).map(Integer::new).collect(Collectors.toSet());
+		}
+
+		List<IndexErrInfoDto> all = new ArrayList<>();
+
+		IndexErrInfoDto<IndexErrInfoDto> one = new IndexErrInfoDto<>();
+		one.setErrorType(IndexErrorType.MUSIC_PATROL);
+		one.setDesc(IndexErrorType.MUSIC_PATROL.getMsg());
+		List<IndexErrInfoDto> oneChild = new ArrayList<>();
+
+		oneChild.add(new IndexErrInfoDto(IndexErrorType.HIGH_CLASS_STUDENT_LESS_THAN_THREE, IndexErrorType.HIGH_CLASS_STUDENT_LESS_THAN_THREE.getMsg(), indexBaseMonthDataDao.countLessThenThreeClassGroupNum(organIds), indexBaseMonthDataDao.getLessThenThreeMusicGroup(organIds)));
+		one.setNum(oneChild.stream().mapToInt(IndexErrInfoDto::getNum).sum());
+		one.setResult(oneChild);
+		all.add(one);
+
+
+		IndexErrInfoDto<IndexErrInfoDto> two = new IndexErrInfoDto<>();
+		two.setErrorType(IndexErrorType.STUDENT_INFO);
+		two.setDesc(IndexErrorType.STUDENT_INFO.getMsg());
+		List<IndexErrInfoDto> twoChild = new ArrayList<>();
+
+		twoChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_NOT_PAYMENT, IndexErrorType.STUDENT_NOT_PAYMENT.getMsg(), indexBaseMonthDataDao.countNoPaymentStudentNum(organIds), indexBaseMonthDataDao.getNoPaymentMusicGroup(organIds)));
+		twoChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP, IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP.getMsg(), indexBaseMonthDataDao.countApplyForQuitGroupNum(organIds),  null));
+		twoChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_TRUANT_STUDENT_NUM, IndexErrorType.COURSE_TRUANT_STUDENT_NUM.getMsg(), indexBaseMonthDataDao.countStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.TRUANT.getCode()), null));
+		twoChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_LEAVE_STUDENT_NUM, IndexErrorType.COURSE_LEAVE_STUDENT_NUM.getMsg(), indexBaseMonthDataDao.countStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.LEAVE.getCode()), null));
+		two.setNum(twoChild.stream().mapToInt(IndexErrInfoDto::getNum).sum());
+		two.setResult(twoChild);
+		all.add(two);
+
+
+		IndexErrInfoDto<IndexErrInfoDto> three = new IndexErrInfoDto<>();
+		three.setErrorType(IndexErrorType.TEACHER_INFO);
+		three.setDesc(IndexErrorType.TEACHER_INFO.getMsg());
+		List<IndexErrInfoDto> threeChild = new ArrayList<>();
+
+		three.setNum(threeChild.stream().mapToInt(IndexErrInfoDto::getNum).sum());
+		three.setResult(threeChild);
+		all.add(three);
+
+		Map<String, Object> result = new HashMap<>();
+		result.put("totalNum", all.stream().mapToInt(IndexErrInfoDto::getNum).sum());
+		result.put("data", all);
+		return result;
+	}
+
+	@Override
+	public List<IndexErrInfoDto> getRemindMatterData(String organIds) {
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		if (sysUser == null) {
+			throw new BizException("用户信息获取失败");
+		}
+		//当前用户是否是分部经理
+		List<Integer> userRole = employeeDao.queryUserRole(sysUser.getId());
+		//获取关联的乐团列表
+		List<String> musicGroupIds = musicGroupDao.queryIdsByEduIdAndOrganIds(userRole.contains(3)?sysUser.getId():null,organIds);
+		String configValue1 = sysConfigDao.findConfigValue("push_create_payment_calender");
+		Date date = new Date();
+		String format = DateUtil.format(date, DateUtil.DEFAULT_PATTERN);
+		List<IndexErrInfoDto> result = new ArrayList<>();
+		IndexErrInfoDto indexErrInfoDto = new IndexErrInfoDto();
+		indexErrInfoDto.setErrorType(WAIT_CREATE_PAYMENT_CALENDER);
+		indexErrInfoDto.setDesc(WAIT_CREATE_PAYMENT_CALENDER.getMsg());
+		if(musicGroupIds.size() > 0){
+			List<Long> calenderIds = musicGroupPaymentCalenderDao.queryEndIds(configValue1, format,musicGroupIds);
+			if(calenderIds.size() > 0){
+				List<String> musicGroupIdList = musicGroupPaymentCalenderDao.queryMusicGroupIds(calenderIds);
+				indexErrInfoDto.setResult(musicGroupIdList);
+			}
+			indexErrInfoDto.setNum(calenderIds.size());
+		}
+		result.add(indexErrInfoDto);
+		return result;
+	}
 }

+ 128 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/InspectionItemPlanConclusionServiceImpl.java

@@ -0,0 +1,128 @@
+package com.ym.mec.biz.service.impl;
+
+import com.ym.mec.biz.dal.dao.CourseScheduleDao;
+import com.ym.mec.biz.dal.dao.InspectionItemDao;
+import com.ym.mec.biz.dal.dao.InspectionItemPlanConclusionDao;
+import com.ym.mec.biz.dal.dao.InspectionItemPlanDao;
+import com.ym.mec.biz.dal.dto.InspectionItemPlanConclusionDto;
+import com.ym.mec.biz.dal.entity.CourseSchedule;
+import com.ym.mec.biz.dal.entity.InspectionItem;
+import com.ym.mec.biz.dal.entity.InspectionItemPlan;
+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.util.date.DateUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ym.mec.biz.dal.entity.InspectionItemPlanConclusion;
+import com.ym.mec.biz.service.InspectionItemPlanConclusionService;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@Service
+public class InspectionItemPlanConclusionServiceImpl extends BaseServiceImpl<Long, InspectionItemPlanConclusion> implements InspectionItemPlanConclusionService {
+
+    @Autowired
+    private InspectionItemPlanConclusionDao inspectionItemPlanConclusionDao;
+    @Autowired
+    private InspectionItemPlanDao inspectionItemPlanDao;
+    @Autowired
+    private InspectionItemDao inspectionItemDao;
+    @Autowired
+    private CourseScheduleDao courseScheduleDao;
+
+    @Override
+    public BaseDAO<Long, InspectionItemPlanConclusion> getDAO() {
+        return inspectionItemPlanConclusionDao;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public InspectionItemPlanConclusionDto add(InspectionItemPlanConclusionDto inspectionItemPlanConclusionDto) {
+        Date nowDate = new Date();
+        List<InspectionItemPlanConclusion> inspectionItemPlanConclusions = inspectionItemPlanConclusionDto.getInspectionItemPlanConclusions();
+        //删除老的
+        Long planId = inspectionItemPlanConclusions.get(0).getPlanId();
+        Integer checkItem = inspectionItemPlanConclusions.get(0).getCheckItem();
+        //时间早于/晚于计划时间当天,不能提交
+        InspectionItemPlan inspectionItemPlan = inspectionItemPlanDao.get(planId);
+        if (nowDate.before(DateUtil.trunc(inspectionItemPlan.getPlanStart()))) {
+            throw new BizException("提价时间不能早于日程安排当天");
+        }
+
+        if (nowDate.after(DateUtil.getLastTimeWithDay(inspectionItemPlan.getPlanStart()))) {
+            throw new BizException("提价时间不能晚于日程安排当天");
+        }
+
+        inspectionItemPlanConclusionDao.delByPlanIdAndCheckItem(planId, checkItem);
+        for (InspectionItemPlanConclusion inspectionItemPlanConclusion : inspectionItemPlanConclusions) {
+            inspectionItemPlanConclusion.setCreateTime(nowDate);
+            inspectionItemPlanConclusion.setUpdateTime(nowDate);
+        }
+        inspectionItemPlanConclusionDto.setInspectionItemPlanConclusions(inspectionItemPlanConclusions);
+        //插入新的
+        inspectionItemPlanConclusionDao.batchAdd(inspectionItemPlanConclusions);
+        //有状态信息,更新gps信息和提交状态
+        if (inspectionItemPlanConclusionDto.getStatus() == null) {
+            return inspectionItemPlanConclusionDto;
+        }
+        //获取巡查结果的异常数量
+        int eConclusionNum = inspectionItemPlanConclusionDao.getCountByPlanIdAndCheckConclusion(planId, 0);
+        inspectionItemPlan.setConclusionStatus(0);
+
+        //未提交过,更新提交信息
+        if (inspectionItemPlan.getStatus().equals(0)) {
+            inspectionItemPlan.setSubmitedGps(inspectionItemPlanConclusionDto.getSubmitedGps());
+            inspectionItemPlan.setSubmitedTime(nowDate);
+            inspectionItemPlan.setStatus(inspectionItemPlanConclusionDto.getStatus());
+            inspectionItemPlan.setUpdateTime(nowDate);
+            if (eConclusionNum > 0) {
+                inspectionItemPlan.setConclusionStatus(1);
+            }
+            inspectionItemPlanDao.update(inspectionItemPlan);
+            //更新提交次数
+            InspectionItem inspectionItem = inspectionItemDao.get(inspectionItemPlan.getItemId());
+            inspectionItem.setSubmittedTimes(inspectionItem.getSubmittedTimes() + 1);
+            inspectionItem.setUpdateTime(nowDate);
+            inspectionItemDao.update(inspectionItem);
+            return inspectionItemPlanConclusionDto;
+        }
+
+        //提交过,异常变正常,更新提交信息
+        if (inspectionItemPlanConclusionDto.getStatus().equals(1)) {
+            inspectionItemPlan.setSubmitedGps(inspectionItemPlanConclusionDto.getSubmitedGps());
+            inspectionItemPlan.setSubmitedTime(nowDate);
+            inspectionItemPlan.setStatus(inspectionItemPlanConclusionDto.getStatus());
+        }
+        if (eConclusionNum > 0) {
+            inspectionItemPlan.setConclusionStatus(1);
+        }
+        inspectionItemPlan.setUpdateTime(nowDate);
+        inspectionItemPlanDao.update(inspectionItemPlan);
+        return inspectionItemPlanConclusionDto;
+    }
+
+    @Override
+    public Map<Integer, List<InspectionItemPlanConclusion>> getInfo(Long planId, Integer checkItem) {
+        List<InspectionItemPlanConclusion> conclusions = inspectionItemPlanConclusionDao.getInspectionItemPlanConclusion(planId, checkItem);
+        return conclusions.stream().collect(Collectors.groupingBy(InspectionItemPlanConclusion::getCheckItem));
+    }
+
+    @Override
+    public List<CourseSchedule> getPlanCourses(Long planId) {
+        InspectionItemPlan plan = inspectionItemPlanDao.get(planId);
+        List<CourseSchedule> courseSchedules = inspectionItemPlanConclusionDao.getPlanConclusionCourses(planId);
+        if (courseSchedules.size() > 0) {
+            return courseSchedules;
+        }
+        courseSchedules = courseScheduleDao.getMusicGroupCourseInfo(plan.getMusicGroupId(), plan.getPlanStart(), plan.getPlanEnd());
+        return courseSchedules;
+    }
+}
+
+
+

+ 139 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/InspectionItemPlanServiceImpl.java

@@ -0,0 +1,139 @@
+package com.ym.mec.biz.service.impl;
+
+import com.ym.mec.biz.dal.dao.*;
+import com.ym.mec.biz.dal.dto.CheckItemDto;
+import com.ym.mec.biz.dal.entity.Inspection;
+import com.ym.mec.biz.dal.entity.InspectionItem;
+import com.ym.mec.biz.dal.entity.School;
+import com.ym.mec.biz.dal.page.InspectionItemPlanQueryInfo;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.exception.BizException;
+import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.util.date.DateUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ym.mec.biz.dal.entity.InspectionItemPlan;
+import com.ym.mec.biz.service.InspectionItemPlanService;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+public class InspectionItemPlanServiceImpl extends BaseServiceImpl<Long, InspectionItemPlan> implements InspectionItemPlanService {
+
+    @Autowired
+    private InspectionItemPlanDao inspectionItemPlanDao;
+    @Autowired
+    private InspectionItemDao inspectionItemDao;
+    @Autowired
+    private InspectionDao inspectionDao;
+    @Autowired
+    private MusicGroupDao musicGroupDao;
+    @Autowired
+    private InspectionItemPlanConclusionDao inspectionItemPlanConclusionDao;
+
+    @Override
+    public BaseDAO<Long, InspectionItemPlan> getDAO() {
+        return inspectionItemPlanDao;
+    }
+
+
+    @Override
+    public PageInfo<InspectionItemPlan> getPageList(InspectionItemPlanQueryInfo queryInfo) {
+        PageInfo<InspectionItemPlan> pageInfo = this.queryPage(queryInfo);
+        if (pageInfo.getTotal() > 0) {
+            List<Long> planIds = pageInfo.getRows().stream().map(InspectionItemPlan::getId).collect(Collectors.toList());
+            List<CheckItemDto> lastCheckItems = inspectionItemPlanConclusionDao.getLastCheckItem(planIds);
+            for (InspectionItemPlan row : pageInfo.getRows()) {
+                for (CheckItemDto lastCheckItem : lastCheckItems) {
+                    if (!lastCheckItem.getPlanId().equals(row.getId())) continue;
+                    row.setLastCheckItem(lastCheckItem.getCheckItem());
+                }
+            }
+        }
+        return pageInfo;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public InspectionItemPlan add(InspectionItemPlan inspectionItemPlan) {
+        InspectionItem inspectionItem = inspectionItemDao.get(inspectionItemPlan.getItemId());
+        if (inspectionItem == null) {
+            throw new BizException("任务项不存在");
+        }
+        if (!inspectionItem.getUserId().equals(inspectionItemPlan.getUserId())) {
+            throw new BizException("请勿非法操作他人日程");
+        }
+        Date nowDate = new Date();
+        Inspection inspection = inspectionDao.get(inspectionItem.getInspectionId());
+        if (inspection.getMonth().after(inspectionItemPlan.getPlanStart())) {
+            throw new BizException("日程时间不能早于工作周期开始时间");
+        }
+        if (nowDate.after(inspectionItemPlan.getPlanStart())) {
+            throw new BizException("日程时间不能早于当前时间");
+        }
+        Date itemEndTime = DateUtil.getLastTimeWithDay(DateUtil.getLastDayOfMonth(inspection.getMonth()));
+        if (itemEndTime.before(inspectionItemPlan.getPlanEnd())) {
+            throw new BizException("日程时间不能晚于工作周期结束时间");
+        }
+        //获取乐团教学点的GPS信息
+        School school = musicGroupDao.getMusicGroupSchool(inspectionItemPlan.getMusicGroupId());
+
+        inspectionItemPlan.setOrganId(inspectionItem.getOrganId());
+        inspectionItemPlan.setInspectionId(inspectionItem.getInspectionId());
+        inspectionItemPlan.setSchoolGps(school.getLongitudeLatitude());
+        inspectionItemPlan.setSubmitedGps("");
+        inspectionItemPlan.setMemo("");
+        inspectionItemPlan.setStatus(0);
+        inspectionItemPlan.setCreateTime(nowDate);
+        inspectionItemPlan.setUpdateTime(nowDate);
+        inspectionItemPlanDao.insert(inspectionItemPlan);
+        inspectionItem.setPlannedTimes(inspectionItem.getPlannedTimes() + 1);
+        inspectionItemDao.update(inspectionItem);
+        return inspectionItemPlan;
+    }
+
+    @Override
+    public InspectionItemPlan updatePlan(InspectionItemPlan inspectionItemPlan) {
+        InspectionItemPlan oldPlan = inspectionItemPlanDao.get(inspectionItemPlan.getId());
+        if (oldPlan.getStatus() > 0) {
+            throw new BizException("日程已完成,不能修改");
+        }
+        InspectionItem inspectionItem = inspectionItemDao.get(inspectionItemPlan.getItemId());
+        if (inspectionItem == null) {
+            throw new BizException("任务项不存在");
+        }
+        if (!inspectionItem.getUserId().equals(inspectionItemPlan.getUserId())) {
+            throw new BizException("请勿非法操作他人日程");
+        }
+        Date nowDate = new Date();
+        Inspection inspection = inspectionDao.get(inspectionItem.getInspectionId());
+        if (inspection.getMonth().after(inspectionItemPlan.getPlanStart())) {
+            throw new BizException("日程时间不能早于工作周期开始时间");
+        }
+        if (nowDate.after(inspectionItemPlan.getPlanStart())) {
+            throw new BizException("日程时间不能早于当前时间");
+        }
+        Date itemEndTime = DateUtil.getLastTimeWithDay(DateUtil.getLastDayOfMonth(inspection.getMonth()));
+        if (itemEndTime.before(inspectionItemPlan.getPlanEnd())) {
+            throw new BizException("日程时间不能晚于工作周期结束时间");
+        }
+        //获取乐团教学点的GPS信息
+        if (oldPlan.getStatus().equals(0)) { //未提交的修改
+            School school = musicGroupDao.getMusicGroupSchool(inspectionItemPlan.getMusicGroupId());
+            inspectionItemPlan.setInspectionId(inspectionItem.getInspectionId());
+            inspectionItemPlan.setSchoolGps(school.getLongitudeLatitude());
+            inspectionItemPlan.setSubmitedGps("");
+            inspectionItemPlan.setMemo("");
+            inspectionItemPlan.setStatus(0);
+        }
+        inspectionItemPlan.setUpdateTime(nowDate);
+        inspectionItemPlanDao.update(inspectionItemPlan);
+        return inspectionItemPlan;
+    }
+}
+
+

+ 68 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/InspectionItemServiceImpl.java

@@ -0,0 +1,68 @@
+package com.ym.mec.biz.service.impl;
+
+import com.ym.mec.biz.dal.dao.InspectionItemDao;
+import com.ym.mec.biz.dal.dao.StudentVisitDao;
+import com.ym.mec.biz.dal.dto.TeacherVisitDto;
+import com.ym.mec.biz.dal.enums.InspectionItemEnum;
+import com.ym.mec.biz.dal.page.InspectionQueryInfo;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.util.date.DateUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ym.mec.biz.dal.entity.InspectionItem;
+import com.ym.mec.biz.service.InspectionItemService;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+@Service
+public class InspectionItemServiceImpl extends BaseServiceImpl<Long, InspectionItem> implements InspectionItemService {
+
+    @Autowired
+    private InspectionItemDao inspectionItemDao;
+    @Autowired
+    private StudentVisitDao studentVisitDao;
+
+    @Override
+    public BaseDAO<Long, InspectionItem> getDAO() {
+        return inspectionItemDao;
+    }
+
+    @Override
+    public PageInfo<InspectionItem> getPageList(InspectionQueryInfo queryInfo) {
+        if (queryInfo.getMonth() != null) {
+            queryInfo.setStartTime(DateUtil.getFirstDayOfMonth(queryInfo.getMonth()));
+            queryInfo.setEndTime(DateUtil.getLastTimeWithDay(DateUtil.getLastDayOfMonth(queryInfo.getMonth())));
+        }
+        PageInfo<InspectionItem> pageInfo = this.queryPage(queryInfo);
+        if (pageInfo.getTotal() <= 0) {
+            return pageInfo;
+        }
+        List<InspectionItem> rows = pageInfo.getRows();
+        List<Integer> teacherIds = rows.stream().filter(e -> e.getItem().equals(InspectionItemEnum.VISIT)).map(InspectionItem::getUserId).collect(Collectors.toList());
+        if (teacherIds.size() > 0) {
+            Date startTime = rows.stream().map(InspectionItem::getMonth).min(Date::compareTo).get();
+            Date EndTime = rows.stream().map(InspectionItem::getMonth).max(Date::compareTo).get();
+            startTime = DateUtil.getFirstDayOfMonth(startTime);
+            EndTime = DateUtil.getLastTimeWithDay(DateUtil.getLastDayOfMonth(EndTime));
+            List<TeacherVisitDto> teacherVisitCounts = studentVisitDao.getTeacherVisitCount(teacherIds, startTime, EndTime);
+            for (InspectionItem row : rows) {
+                if (row.getItem().equals(InspectionItemEnum.INSPECT)) continue;
+                for (TeacherVisitDto teacherVisitCount : teacherVisitCounts) {
+                    if (teacherVisitCount.getTeacherId().equals(row.getUserId()) &&
+                            DateUtil.dateToString(row.getMonth(), "yyyy-MM").equals(teacherVisitCount.getMonth())
+                    ) {
+                        row.setSubmittedTimes(teacherVisitCount.getNum());
+                    }
+                }
+            }
+        }
+        return pageInfo;
+    }
+}
+
+

+ 162 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/InspectionServiceImpl.java

@@ -0,0 +1,162 @@
+package com.ym.mec.biz.service.impl;
+
+import com.ym.mec.biz.dal.dao.InspectionItemDao;
+import com.ym.mec.biz.dal.entity.InspectionItem;
+import com.ym.mec.biz.dal.page.InspectionQueryInfo;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.exception.BizException;
+import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.util.date.DateUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ym.mec.biz.dal.entity.Inspection;
+import com.ym.mec.biz.dal.dao.InspectionDao;
+import com.ym.mec.biz.service.InspectionService;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+@Service
+public class InspectionServiceImpl extends BaseServiceImpl<Long, Inspection> implements InspectionService {
+
+    @Autowired
+    private InspectionDao inspectionDao;
+    @Autowired
+    private InspectionItemDao inspectionItemDao;
+
+    @Override
+    public BaseDAO<Long, Inspection> getDAO() {
+        return inspectionDao;
+    }
+
+    @Override
+    public PageInfo<Inspection> getPageList(InspectionQueryInfo queryInfo) {
+        if (queryInfo.getMonth() != null) {
+            queryInfo.setStartTime(DateUtil.getFirstDayOfMonth(queryInfo.getMonth()));
+            queryInfo.setEndTime(DateUtil.getLastTimeWithDay(DateUtil.getLastDayOfMonth(queryInfo.getMonth())));
+        }
+        PageInfo<Inspection> pageInfo = this.queryPage(queryInfo);
+        if (pageInfo.getTotal() > 0) {
+            List<Inspection> rows = pageInfo.getRows();
+            List<Long> inspectionIds = rows.stream().map(Inspection::getId).collect(Collectors.toList());
+            List<InspectionItem> itemCountAndTimes = inspectionItemDao.getItemCountAndTimes(inspectionIds);
+            for (Inspection row : rows) {
+                for (InspectionItem itemCountAndTime : itemCountAndTimes) {
+                    if (!row.getId().equals(itemCountAndTime.getInspectionId())) continue;
+                    row.setItemNum(itemCountAndTime.getPlannedTimes());
+                    row.setTimes(itemCountAndTime.getTimes());
+                }
+            }
+        }
+        return pageInfo;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public List<Inspection> add(List<Inspection> inspections, Integer operationUserId) {
+        Date nowDate = new Date();
+        for (Inspection inspection : inspections) {
+            inspection.setOperation(operationUserId);
+            inspection.setCreateTime(nowDate);
+            inspection.setUpdateTime(nowDate);
+            inspectionDao.insert(inspection);
+            for (InspectionItem inspectionItem : inspection.getInspectionItems()) {
+                inspectionItem.setInspectionId(inspection.getId());
+                inspectionItem.setOrganId(inspection.getOrganId());
+                inspectionItem.setUserId(inspection.getUserId());
+                inspectionItem.setOperation(operationUserId);
+                inspectionItem.setCreateTime(nowDate);
+                inspectionItem.setUpdateTime(nowDate);
+            }
+            inspectionItemDao.batchInsert(inspection.getInspectionItems());
+        }
+        return inspections;
+    }
+
+    @Override
+    public Inspection getInfo(Long id) {
+        return inspectionDao.getInfo(id);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Inspection updateInspection(Inspection inspection, Integer operationUserId) {
+        if (inspection.getInspectionItems() == null || inspection.getInspectionItems().size() <= 0) {
+            throw new BizException("任务事项不能为空");
+        }
+        Date nowDate = new Date();
+        Inspection oldInspection = inspectionDao.get(inspection.getId());
+        if (oldInspection == null) {
+            throw new BizException("巡查任务不存在,请核查");
+        }
+        oldInspection.setUpdateTime(nowDate);
+        inspectionDao.update(oldInspection);
+
+        List<InspectionItem> updateItems = inspection.getInspectionItems().stream().filter(e -> e.getId() != null).collect(Collectors.toList());
+        List<InspectionItem> addItems = inspection.getInspectionItems().stream().filter(e -> e.getId() == null).collect(Collectors.toList());
+
+        List<InspectionItem> delItems = new ArrayList<>();
+        List<InspectionItem> oldItems = inspectionItemDao.getItemByInspectionId(inspection.getId());
+        for (InspectionItem oldItem : oldItems) {
+            boolean isUpdate = false;
+            for (InspectionItem updateItem : updateItems) {
+                if (!oldItem.getId().equals(updateItem.getId())) continue;
+                isUpdate = true;
+            }
+            if (!isUpdate) {
+                if (oldItem.getPlannedTimes() > 0) {
+                    throw new BizException(oldItem.getItem() + "已有日程安排不能删除");
+                }
+                delItems.add(oldItem);
+            }
+        }
+        //增加新的
+        for (InspectionItem addItem : addItems) {
+            addItem.setInspectionId(oldInspection.getId());
+            addItem.setOrganId(oldInspection.getOrganId());
+            addItem.setUserId(oldInspection.getUserId());
+            addItem.setOperation(operationUserId);
+            addItem.setCreateTime(nowDate);
+            addItem.setUpdateTime(nowDate);
+        }
+        //插入新的
+        if (addItems.size() > 0) {
+            inspectionItemDao.batchInsert(addItems);
+        }
+        //删除
+        if (delItems.size() > 0) {
+            List<Long> itemIds = delItems.stream().map(InspectionItem::getId).collect(Collectors.toList());
+            inspectionItemDao.deleteByIds(itemIds);
+        }
+        //修改现有的
+        if (updateItems.size() > 0) {
+            for (InspectionItem updateItem : updateItems) {
+                updateItem.setUpdateTime(nowDate);
+                updateItem.setOperation(operationUserId);
+            }
+            inspectionItemDao.batchUpdate(updateItems);
+        }
+        return inspection;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean delInspections(Long id) {
+        List<InspectionItem> items = inspectionItemDao.getItemByInspectionId(id);
+        for (InspectionItem item : items) {
+            if (item.getPlannedTimes() > 0) {
+                throw new BizException(item.getItem() + "已有日程安排不能删除");
+            }
+        }
+        inspectionDao.delete(id);
+        inspectionItemDao.deleteByInspectionId(id);
+        return true;
+    }
+}
+
+

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

@@ -9,6 +9,7 @@ import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.AD
 import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.MUSIC_APPLY;
 import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.MUSIC_RENEW;
 import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.SPAN_GROUP_CLASS_ADJUST;
+import static com.ym.mec.biz.dal.enums.PaymentStatusEnum.YES;
 
 import java.math.BigDecimal;
 import java.util.ArrayList;
@@ -24,7 +25,9 @@ import java.util.Map.Entry;
 import java.util.Set;
 import java.util.stream.Collectors;
 
+import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.enums.GroupType;
+import com.ym.mec.biz.dal.enums.StudentMusicGroupStatusEnum;
 import com.ym.mec.biz.service.*;
 import org.apache.commons.beanutils.BeanUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -37,25 +40,6 @@ import com.alibaba.fastjson.JSON;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.auth.api.entity.SysUserRole;
-import com.ym.mec.biz.dal.dao.ClassGroupDao;
-import com.ym.mec.biz.dal.dao.ClassGroupStudentMapperDao;
-import com.ym.mec.biz.dal.dao.CourseScheduleDao;
-import com.ym.mec.biz.dal.dao.CourseScheduleTeacherSalaryDao;
-import com.ym.mec.biz.dal.dao.MusicGroupBuildLogDao;
-import com.ym.mec.biz.dal.dao.MusicGroupDao;
-import com.ym.mec.biz.dal.dao.MusicGroupOrganizationCourseSettingsDao;
-import com.ym.mec.biz.dal.dao.MusicGroupOrganizationCourseSettingsDetailDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderCourseSettingsDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDetailDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderStudentDetailDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentStudentCourseDetailDao;
-import com.ym.mec.biz.dal.dao.MusicGroupStudentClassAdjustDao;
-import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
-import com.ym.mec.biz.dal.dao.OrganizationCourseUnitPriceSettingsDao;
-import com.ym.mec.biz.dal.dao.OrganizationDao;
-import com.ym.mec.biz.dal.dao.SysConfigDao;
-import com.ym.mec.biz.dal.dao.TeacherAttendanceDao;
 import com.ym.mec.biz.dal.dto.CalenderPushDto;
 import com.ym.mec.biz.dal.dto.ClassGroup4MixDto;
 import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDetailDto;
@@ -160,6 +144,8 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 	private MusicGroupPaymentCalenderDetailService musicGroupPaymentCalenderDetailService;
 	@Autowired
 	private MusicGroupPaymentCalenderStudentDetailDao musicGroupPaymentCalenderStudentDetailDao;
+	@Autowired
+	private StudentRegistrationDao studentRegistrationDao;
 
 	@Override
 	public BaseDAO<Long, MusicGroupPaymentCalender> getDAO() {
@@ -925,7 +911,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		}
 		// 获取离截止还有指定时间的缴费项,并发送推送消息给指定老师
 		String configValue1 = sysConfigDao.findConfigValue("push_create_payment_calender");
-		List<Long> calenderIds = musicGroupPaymentCalenderDao.queryEndIds(configValue1, format);
+		List<Long> calenderIds = musicGroupPaymentCalenderDao.queryEndIds(configValue1, format,null);
 		if (calenderIds != null && calenderIds.size() > 0) {
 			List<CalenderPushDto> calenderPushDtos = musicGroupPaymentCalenderDao.getCalenderPushDto(calenderIds);
 			Map<Long, List<CalenderPushDto>> collect = calenderPushDtos.stream().collect(Collectors.groupingBy(CalenderPushDto::getCalenderId));
@@ -1211,9 +1197,14 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				// “进行中”更新至“已结束”
 				mgpc.setUpdateTime(date);
 				mgpc.setStatus(PaymentCalenderStatusEnum.OVER);
-				updateMusicGroupPaymentCalenderList.add(mgpc);
 				//将0元未缴费学员缴费状态更新为已缴费
-				musicGroupPaymentCalenderDetailDao.updateNoPaymentAndZeroPaymentStatus(mgpc.getId());
+				int i = musicGroupPaymentCalenderDetailDao.updateNoPaymentAndZeroPaymentStatus(mgpc.getId());
+				mgpc.setActualNum((mgpc.getActualNum()==null?0:mgpc.getActualNum()) + i);
+				updateMusicGroupPaymentCalenderList.add(mgpc);
+				//如果是进行中加学员,将报名表状态改为NORMAL
+				if(mgpc.getPaymentType() == MusicGroupPaymentCalender.PaymentType.ADD_STUDENT){
+					studentRegistrationDao.updatePaymentStatusByClaenderId(mgpc.getId());
+				}
 			} else if (mgpc.getStartPaymentDate() != null && date.after(mgpc.getStartPaymentDate()) && mgpc.getStatus() == PaymentCalenderStatusEnum.NO) {
 				MusicGroup musicGroup = musicGroupDao.get(mgpc.getMusicGroupId());
 				if(musicGroup == null){

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

@@ -2381,6 +2381,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         if (courseSchedule == null) {
             throw new BizException("课程信息不存在");
         }
+        
+        if(salary == null){
+        	throw new BizException("请设置老师课酬");
+        }
 
         if ("all".equals(scope)) {
             Integer classGrpupId = courseSchedule.getClassGroupId();
@@ -2530,7 +2534,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         userRoleMap.put(directorUserId, "乐队指导");
         userRoleMap.put(educationalTeacherId, "乐团主管");
         userRoleMap.put(teamTeacherId, "运营主管");
-        
+
         classGroups.forEach(e -> {
         	imGroupMemberService.quit(e.getId().longValue(), quitUserIdList);
         	imGroupMemberService.join(e.getId().longValue(), userRoleMap);

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

@@ -203,6 +203,9 @@ public class OnlineMusicGroupServiceImpl implements OnlineMusicGroupService {
             throw new BizException("请设置教师课酬");
         }
         BigDecimal teacherDefaultSalary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal("1");
+        if(teacherDefaultSalary == null){
+        	throw new BizException("请设置教师课酬");
+        }
         BigDecimal studentSingleCourseCost=BigDecimal.ZERO;
         for (CourseSchedule courseSchedule : courses) {
             //课程与老师薪水表

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

@@ -2984,10 +2984,13 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         }
         courseScheduleDao.batchAddCourseSchedules(practiceCourses);
         TeacherDefaultPracticeGroupSalary teacherDefaultPracticeGroupSalary = teacherDefaultPracticeGroupSalaryDao.findByTeacherAndCourseMinutes(practiceGroupBuyParams.getUserId(), practiceCourseMinutes);
-        BigDecimal teacherDefaultSalary = BigDecimal.ZERO;
+        BigDecimal teacherDefaultSalary = null;
         if (Objects.nonNull(teacherDefaultPracticeGroupSalary)) {
             teacherDefaultSalary = teacherDefaultPracticeGroupSalary.getMainTeacherSalary();
         }
+        if(teacherDefaultSalary == null){
+        	throw new BizException("请设置教师课酬");
+        }
         BigDecimal studentSingleCourseCost = amount.divide(new BigDecimal(practiceCourses.size()), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
 
         BigDecimal oneMonthOriginalPrice=practiceGroupBuyParams.getDrillTimesOnWeek()==1?practiceGroupSellPrice.getOnceOriginalPrice():practiceGroupSellPrice.getTwiceOriginalPrice();

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

@@ -99,7 +99,7 @@ public class StudentManageServiceImpl implements StudentManageService {
     @Autowired
     private SubjectChangeDao subjectChangeDao;
     @Autowired
-    private MusicGroupPaymentCalenderDao musicGroupPaymentCalenderDao;
+    private MusicGroupPaymentCalenderDetailDao musicGroupPaymentCalenderDetailDao;
     @Autowired
     private SysConfigService sysConfigService;
     @Autowired
@@ -424,6 +424,8 @@ public class StudentManageServiceImpl implements StudentManageService {
             pageInfo.setTotal(count);
             params.put("offset", pageInfo.getOffset());
             dataList = studentManageDao.queryMusicGroupStudent(params);
+            //获取乐团学员欠费金额
+            Map<Integer,BigDecimal> totalAmountMap = MapUtil.convertIntegerMap(musicGroupPaymentCalenderDetailDao.queryNoPaymentTotalAmount(queryInfo.getMusicGroupId()));
             //退团的学生
             List<Integer> quitUserIds = dataList.stream().filter(e -> e.getStudentStatus().equals("QUIT")).map(MusicGroupStudentsDto::getUserId).collect(Collectors.toList());
             if (quitUserIds.size() > 0) {
@@ -435,6 +437,9 @@ public class StudentManageServiceImpl implements StudentManageService {
                     }
                 }
             }
+            dataList.forEach(e->{
+                e.setNoPaymentAmount(totalAmountMap.get(e.getUserId()));
+            });
         }
         if (count == 0) {
             dataList = new ArrayList<>();

+ 6 - 9
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentRouteOrderServiceImpl.java

@@ -15,8 +15,9 @@ import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.*;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.util.date.DateUtil;
-import com.ym.mec.util.excel.IniFileUtil;
 import com.ym.mec.util.excel.POIUtil;
+import com.ym.mec.util.ini.IniFileUtil;
+
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.io.ClassPathResource;
@@ -39,6 +40,7 @@ import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.IdGeneratorService;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.util.collection.MapUtil;
+
 import org.springframework.web.multipart.MultipartFile;
 
 @Service
@@ -379,10 +381,6 @@ public class StudentPaymentRouteOrderServiceImpl extends BaseServiceImpl<Long, S
             if (collect == null || collect.size() == 0) {
                 continue;
             }
-//            List<String> list = studentPaymentRouteOrderDao.countByTransNo(collect);
-//            if (list != null && list.size() > 0) {
-//                throw new BizException("导入数据错误  重复的交易流水号:{}", list.get(0));
-//            }
             Date nowDate = new Date();
 
             List<Object> calenderIds = sheet.stream().map(m -> m.get("缴费单号")).collect(Collectors.toList());
@@ -538,11 +536,10 @@ public class StudentPaymentRouteOrderServiceImpl extends BaseServiceImpl<Long, S
                 studentPaymentRouteOrders.add(studentPaymentRouteOrder);
             }
         }
+        if(sb.length() > 0){
+            throw new BizException(sb.toString());
+        }
         if (studentPaymentRouteOrders.size() > 0) {
-//            Map<String, List<StudentPaymentRouteOrder>> stringListMap = studentPaymentRouteOrders.stream().collect(Collectors.groupingBy(StudentPaymentRouteOrder::getTransNo));
-//            if (stringListMap.size() != studentPaymentRouteOrders.size()) {
-//                throw new BizException("导入失败:请勿录入重复的交易流水号");
-//            }
             studentPaymentRouteOrderDao.batchAdd(studentPaymentRouteOrders);
         } else {
             throw new BizException(sb.length() > 0 ? sb.toString() : "导入失败:没有可以录入的数据");

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

@@ -98,7 +98,7 @@ public class TeacherCourseStatisticsServiceImpl extends BaseServiceImpl<Long, Te
             teacherCourseStatistics.setPracticeCourseNum(practiceCourseNum);
 
             BigDecimal organWarningSalary = salaryConfigObject.getBigDecimal(teacherCourseStatistics.getOrganId().toString());
-            if(Objects.isNull(organWarningSalary)||teacherCourseStatistics.getExpectTotalSalary().compareTo(organWarningSalary)<=0){
+            if(Objects.isNull(organWarningSalary)||Objects.isNull(teacherCourseStatistics.getExpectTotalSalary())||teacherCourseStatistics.getExpectTotalSalary().compareTo(organWarningSalary)<0){
                 teacherCourseStatistics.setLowSalary(true);
             }else{
                 teacherCourseStatistics.setLowSalary(false);

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

@@ -180,6 +180,9 @@ public class TeacherDefaultMusicGroupSalaryServiceImpl extends BaseServiceImpl<L
 									}
 									list.add(ts);
 								}
+								if(ts.getExpectSalary() == null){
+									throw new BizException("请设置教师课酬");
+								}
 							}
 						}
 					}

+ 12 - 16
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherDefaultVipGroupSalaryServiceImpl.java

@@ -10,6 +10,7 @@ import java.util.Objects;
 import java.util.Set;
 import java.util.stream.Collectors;
 
+import com.ym.mec.biz.service.VipGroupService;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -54,6 +55,9 @@ public class TeacherDefaultVipGroupSalaryServiceImpl extends BaseServiceImpl<Lon
 	@Autowired
 	private TeacherDao teacherDao;
 
+	@Autowired
+	private VipGroupService vipGroupService;
+
 	@Override
 	public BaseDAO<Long, TeacherDefaultVipGroupSalary> getDAO() {
 		return teacherDefaultVipGroupSalaryDao;
@@ -157,23 +161,15 @@ public class TeacherDefaultVipGroupSalaryServiceImpl extends BaseServiceImpl<Lon
 							TeacherDefaultVipGroupSalary tdms = salaryMap.get(vipGroup.getVipGroupCategoryId());
 							TeacherDefaultVipGroupSalary origTdms = map.get(vipGroup.getVipGroupCategoryId());
 							if (tdms != null && origTdms != null) {
-								if (vipGroupSalarySettlementDto.getOnlineSalarySettlement() != null
-										&& vipGroupSalarySettlementDto.getOnlineSalarySettlement().getSalarySettlementType() == SalarySettlementTypeEnum.TEACHER_DEFAULT
-										&& (ts.getCourseSchedule().getTeachMode() == TeachModeEnum.ONLINE)) {// 线上课
-									if (teacher.getJobNature() != JobNatureEnum.FULL_TIME
-											&& ts.getExpectSalary().compareTo(origTdms.getOfflineClassesSalary()) == 0
-											&& tdms.getOfflineClassesSalary().compareTo(origTdms.getOfflineClassesSalary()) != 0) {
-										ts.setExpectSalary(tdms.getOfflineClassesSalary());
-										list.add(ts);
-									}
-								} else if (vipGroupSalarySettlementDto.getOfflineSalarySettlement() != null
-										&& vipGroupSalarySettlementDto.getOfflineSalarySettlement().getSalarySettlementType() == SalarySettlementTypeEnum.TEACHER_DEFAULT
-										&& ts.getCourseSchedule().getTeachMode() == TeachModeEnum.OFFLINE
-										&& ts.getExpectSalary().compareTo(origTdms.getOfflineClassesSalary()) == 0
-										&& tdms.getOfflineClassesSalary().compareTo(origTdms.getOfflineClassesSalary()) != 0) {// 线下课
-									ts.setExpectSalary(tdms.getOfflineClassesSalary());
-									list.add(ts);
+								Map<String, BigDecimal> teachModeSalaryMap = vipGroupService.countVipGroupCoursePredictFee(vipGroup, ts.getUserId(), ts.getCourseScheduleId());
+								if(TeachModeEnum.ONLINE.equals(ts.getCourseSchedule().getTeachMode())&&teachModeSalaryMap.containsKey("onlineTeacherSalary")){
+									ts.setExpectSalary(teachModeSalaryMap.get("onlineTeacherSalary"));
+								}else if(TeachModeEnum.OFFLINE.equals(ts.getCourseSchedule().getTeachMode())&&teachModeSalaryMap.containsKey("offlineTeacherSalary")){
+									ts.setExpectSalary(teachModeSalaryMap.get("offlineTeacherSalary"));
 								}
+
+								ts.setExpectSalary(tdms.getOfflineClassesSalary());
+								list.add(ts);
 							}
 						}
 					}

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

@@ -3,23 +3,25 @@ package com.ym.mec.biz.service.impl;
 import com.alibaba.fastjson.JSON;
 import com.ym.mec.biz.dal.dao.TeacherDao;
 import com.ym.mec.biz.dal.dao.VipGroupActivityDao;
+import com.ym.mec.biz.dal.dto.ExportVipGroupActivityDto;
 import com.ym.mec.biz.dal.dto.VipGroupActivityAddDto;
 import com.ym.mec.biz.dal.dto.VipGroupSalarySettlementDto;
 import com.ym.mec.biz.dal.entity.Teacher;
 import com.ym.mec.biz.dal.entity.VipGroupActivity;
+import com.ym.mec.biz.dal.page.VipGroupActivityQueryInfo;
 import com.ym.mec.biz.event.source.EntityChangeEventSource;
 import com.ym.mec.biz.service.VipGroupActivityService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
+import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.util.collection.MapUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Objects;
+import java.util.*;
 
 @Service
 public class VipGroupActivityServiceImpl extends BaseServiceImpl<Integer, VipGroupActivity>  implements VipGroupActivityService {
@@ -161,4 +163,11 @@ public class VipGroupActivityServiceImpl extends BaseServiceImpl<Integer, VipGro
 		}
 		return vipGroupActivityDao.findByCategory(categoryId,organIds);
 	}
+
+	@Override
+	public List<ExportVipGroupActivityDto> exportVipGroupActivity(VipGroupActivityQueryInfo queryInfo) {
+		Map<String, Object> params = new HashMap<String, Object>();
+		MapUtil.populateMap(params, queryInfo);
+		return vipGroupActivityDao.exportVipGroupActivity(params);
+	}
 }

+ 11 - 0
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -3516,4 +3516,15 @@
     <select id="getUnderwayCourseNum" resultType="int">
         SELECT COUNT(*) FROM course_schedule WHERE music_group_id_ = #{musicGroupId} AND group_type_ = #{groupType} AND status_=#{status}
     </select>
+
+    <select id="getMusicGroupCourseInfo" resultMap="CourseSchedule"><![CDATA[
+        SELECT cs.id_, cs.actual_teacher_id_,CONCAT(cg.name_,'-',su.real_name_) name_  FROM course_schedule cs
+        LEFT JOIN class_group cg ON cg.id_ = cs.class_group_id_
+        LEFT JOIN sys_user su ON su.id_=cs.actual_teacher_id_
+        WHERE cs.music_group_id_ = #{musicGroupId}
+            AND CONCAT(cs.class_date_,' ',cs.start_class_time_) >= #{startTime}
+            AND CONCAT(cs.class_date_,' ',cs.end_class_time_) <= #{endTime}
+            AND cs.group_type_ = 'MUSIC'
+            AND cs.teach_mode_ = 'OFFLINE'
+    ]]></select>
 </mapper>

+ 155 - 19
mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml

@@ -150,8 +150,7 @@
 			del_flag_=0
 		  	AND organ_id_ IS NOT NULL
 			AND user_type_ LIKE '%STUDENT%'
-			AND YEAR(create_time_)=YEAR(CONCAT(#{month}, '-01'))
-			AND MONTH(create_time_)&lt;=MONTH(CONCAT(#{month}, '-01'))
+		  	AND DATE_FORMAT(create_time_, '%Y-%m')&lt;=#{month}
 		GROUP BY organ_id_
 		ORDER BY organ_id_;
 	</select>
@@ -162,14 +161,14 @@
 			CONCAT(#{month}, '-01') month_,
 			<choose>
 				<when test="type == 'submit'">
-					SUM(sees.expect_exercises_num_) total_num_,
+					SUM(sees.actual_exercises_num_) total_num_,
 					SUM(sees.exercises_reply_num_) activate_num_,
-					TRUNCATE(SUM(sees.exercises_reply_num_)/SUM(sees.expect_exercises_num_)*100, 2) percent_
+					TRUNCATE(SUM(sees.exercises_reply_num_)/SUM(sees.actual_exercises_num_)*100, 2) percent_
 				</when>
 				<when test="type == 'comment'">
-					SUM(sees.expect_exercises_num_) total_num_,
-					SUM(sees.exercises_reply_num_) activate_num_,
-					TRUNCATE(SUM(sees.exercises_reply_num_)/SUM(sees.expect_exercises_num_)*100, 2) percent_
+					SUM(sees.exercises_reply_num_) total_num_,
+					SUM(sees.exercises_message_num_) activate_num_,
+					TRUNCATE(SUM(sees.exercises_message_num_)/SUM(sees.exercises_reply_num_)*100, 2) percent_
 				</when>
 				<otherwise>
 					SUM(sees.expect_exercises_num_) total_num_,
@@ -182,7 +181,7 @@
 		WHERE su.del_flag_=0
 			AND su.organ_id_ IS NOT NULL
 			AND YEAR(sees.monday_)=YEAR(CONCAT(#{month}, '-01'))
-			AND MONTH(sees.monday_)&lt;=MONTH(CONCAT(#{month}, '-01'))
+			AND MONTH(sees.monday_)=MONTH(CONCAT(#{month}, '-01'))
 		GROUP BY su.organ_id_
 		ORDER BY su.organ_id_
 	</select>
@@ -198,6 +197,7 @@
 			cooperation_organ
 		WHERE
 			del_flag_ = 0
+		  	AND is_enable_ = 1
 		  	AND organ_id_ IS NOT NULL
 		  	<if test="month!=null and month!=''">
 				AND DATE_FORMAT(create_time_, '%Y-%m') &lt;= #{month}
@@ -240,12 +240,17 @@
 		WHERE
 			mg.del_flag_ = 0
 		  	AND mg.organ_id_ IS NOT NULL
+			AND mg.status_ = 'PROGRESS'
 			<if test="type==null">
-				AND mg.status_ = 'PROGRESS'
 				AND sr.music_group_status_='NORMAL'
 			</if>
 			<if test="type!=null and type=='QUIT'">
 				AND sr.music_group_status_='QUIT'
+				AND DATE_FORMAT(sr.create_time_, '%Y-%m') &gt;= CONCAT(DATE_FORMAT(NOW(), '%Y'), '-01')
+			</if>
+			<if test="type!=null and type=='ADD'">
+				AND sr.music_group_status_='NORMAL'
+				AND DATE_FORMAT(sr.create_time_, '%Y-%m') &gt;= CONCAT(DATE_FORMAT(NOW(), '%Y'), '-01')
 			</if>
 			<if test="month!=null and month!=''">
 				AND DATE_FORMAT(sr.create_time_, '%Y-%m') &lt;= #{month}
@@ -295,8 +300,9 @@
 			course_schedule m
 		WHERE
 			m.del_flag_ = 0
-			AND m.is_lock_ = 0
+			AND (m.is_lock_ = 0 OR m.is_lock_ IS NULL)
 		  	AND m.status_ = 'OVER'
+			AND (m.new_course_id_ IS NULL OR m.new_course_id_=m.id_)
 			AND m.organ_id_ IS NOT NULL
 			<if test="groupType!=null">
 				AND m.group_type_ = #{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
@@ -312,26 +318,28 @@
 
 	<select id="getOtherStudentData" resultMap="IndexBaseMonthData">
 		SELECT
-			m.organ_id_,
+			su.organ_id_,
 			CONCAT(#{month}, '-01') month_,
 			COUNT( DISTINCT s.user_id_ ) total_num_,
 			COUNT( DISTINCT s.user_id_ ) activate_num_,
 			COUNT( DISTINCT s.user_id_ ) percent_
 		FROM
-			course_schedule_student_payment s
-				LEFT JOIN course_schedule m ON s.course_schedule_id_=m.id_
+		    sys_user su
+			LEFT JOIN course_schedule_student_payment s ON su.id_=s.user_id_
+			LEFT JOIN course_schedule m ON s.course_schedule_id_=m.id_
 		WHERE
 			m.del_flag_ = 0
-			AND m.is_lock_ = 0
-			AND m.organ_id_ IS NOT NULL
+			AND (m.is_lock_ = 0 OR m.is_lock_ IS NULL)
+			AND su.organ_id_ IS NOT NULL
 			AND m.group_type_ IN ('VIP', 'PRACTICE')
+			AND m.status_ = 'NOT_START'
 			<if test="month!=null and month!=''">
 				AND (DATE_FORMAT(m.create_time_, '%Y-%m') &lt;= #{month} OR YEAR(m.create_time_)=3000)
 			</if>
 		GROUP BY
-			m.organ_id_
+			su.organ_id_
 		ORDER BY
-			m.organ_id_;
+			su.organ_id_;
 	</select>
 
 	<select id="getStudentConversionData" resultMap="IndexBaseMonthData">
@@ -343,12 +351,14 @@
 			COUNT( DISTINCT m.user_id_ ) percent_
 		FROM
 			course_schedule_student_payment m
-				LEFT JOIN course_schedule cs ON m.course_schedule_id_=cs.id_
+			LEFT JOIN course_schedule cs ON m.course_schedule_id_=cs.id_
+			LEFT JOIN practice_group pg ON m.music_group_id_=pg.id_ AND m.group_type_='PRACTICE'
 		WHERE
 			(cs.del_flag_ IS NULL OR cs.del_flag_=0)
 			AND cs.organ_id_ IS NOT NULL
 			AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_)
 			AND m.group_type_ IN ('VIP', 'PRACTICE')
+			AND (pg.id_ IS NULL OR pg.type_='CHARGE')
 			AND m.user_id_ IN
 			<foreach collection="studentIds" item="studentId" open="(" close=")" separator=",">
 				#{studentId}
@@ -372,6 +382,7 @@
 		WHERE
 			mg.del_flag_ = 0
 			AND mg.organ_id_ IS NOT NULL
+		  	AND mg.status_ = 'PROGRESS'
 			AND DATE_FORMAT( spr.create_time_, '%Y-%m' ) &lt;= #{month}
 		GROUP BY
 			mg.organ_id_
@@ -394,8 +405,11 @@
 			mg.del_flag_ = 0
 			AND mg.organ_id_ IS NOT NULL
 			AND mg.status_ = 'PROGRESS'
-			AND sr.music_group_status_ = 'NORMAL'
+			<if test="paymentStatus==null">
+				AND sr.music_group_status_ IN ('APPLY', 'NORMAL')
+			</if>
 		  	<if test="paymentStatus!=null">
+				AND sr.music_group_status_ IN ('NORMAL')
 				AND sr.payment_status_ = #{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
 			</if>
 			AND DATE_FORMAT( sr.create_time_, '%Y-%m' ) &lt;= #{month}
@@ -422,4 +436,126 @@
 			</if>
 			AND DATE_FORMAT( sr.create_time_, '%Y-%m' ) &lt;= #{month}
 	</select>
+
+	<select id="countLessThenThreeClassGroupNum" resultType="int">
+		SELECT COUNT(t.id_) FROM (
+			SELECT
+			DISTINCT cg.id_
+			FROM
+			class_group cg
+			LEFT JOIN class_group_student_mapper cgsm ON cg.id_ = cgsm.class_group_id_
+			LEFT JOIN music_group mg ON cg.music_group_id_=mg.id_
+			WHERE
+			cg.type_ = 'HIGH'
+			AND mg.status_ = 'PROGRESS'
+			AND cgsm.status_ = 'NORMAL'
+			<if test="organIds!=null and organIds.size()>0">
+				AND mg.organ_id_ IN
+				<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
+					#{organId}
+				</foreach>
+			</if>
+			GROUP BY
+			cg.id_
+			HAVING
+			COUNT( DISTINCT cgsm.user_id_ )&lt;3
+		) t
+	</select>
+
+    <select id="getLessThenThreeMusicGroup" resultType="java.lang.String">
+		SELECT
+			cg.music_group_id_
+		FROM
+			class_group cg
+			LEFT JOIN class_group_student_mapper cgsm ON cg.id_ = cgsm.class_group_id_
+			LEFT JOIN music_group mg ON cg.music_group_id_=mg.id_
+		WHERE
+			cg.type_ = 'HIGH'
+		  	AND mg.status_ = 'PROGRESS'
+			AND cgsm.status_ = 'NORMAL'
+			<if test="organIds!=null and organIds.size()>0">
+				AND mg.organ_id_ IN
+				<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
+					#{organId}
+				</foreach>
+			</if>
+		GROUP BY
+			cg.id_
+		HAVING
+			COUNT( DISTINCT cgsm.user_id_ )&lt;3
+	</select>
+
+	<select id="countNoPaymentStudentNum" resultType="int">
+		SELECT
+			COUNT(DISTINCT mgpcd.user_id_)
+		FROM
+		music_group_payment_calender_detail mgpcd
+		LEFT JOIN music_group_payment_calender mgpc ON mgpcd.music_group_payment_calender_id_ = mgpc.id_
+		LEFT JOIN music_group mg ON mgpc.music_group_id_ = mg.id_
+		WHERE
+		mg.status_ = 'PROGRESS'
+		AND mgpc.payment_valid_end_date_ &lt; NOW()
+		AND mgpcd.payment_status_ = 'NON_PAYMENT'
+		<if test="organIds!=null and organIds.size()>0">
+			AND mg.organ_id_ IN
+			<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
+				#{organId}
+			</foreach>
+		</if>
+	</select>
+
+	<select id="getNoPaymentMusicGroup" resultType="java.lang.String">
+		SELECT
+			DISTINCT mg.id_
+		FROM
+			music_group_payment_calender_detail mgpcd
+			LEFT JOIN music_group_payment_calender mgpc ON mgpcd.music_group_payment_calender_id_ = mgpc.id_
+			LEFT JOIN music_group mg ON mgpc.music_group_id_ = mg.id_
+		WHERE
+			mg.status_ = 'PROGRESS'
+			AND mgpc.payment_valid_end_date_ &lt; NOW()
+			AND mgpcd.payment_status_ = 'NON_PAYMENT'
+			<if test="organIds!=null and organIds.size()>0">
+				AND mg.organ_id_ IN
+				<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
+					#{organId}
+				</foreach>
+			</if>
+	</select>
+
+	<select id="countApplyForQuitGroupNum" resultType="int">
+		SELECT COUNT(mgq.id_) FROM music_group_quit mgq
+			LEFT JOIN music_group mg ON mgq.music_group_id_=mg.id_
+		WHERE mg.status_='PROGRESS'
+		  AND mgq.status_='PROCESSING'
+		<if test="organIds!=null and organIds.size()>0">
+			AND mg.organ_id_ IN
+			<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
+				#{organId}
+			</foreach>
+		</if>
+	</select>
+
+	<select id="countStudentAttendanceInfo" resultType="java.lang.Integer">
+		SELECT
+			COUNT( DISTINCT cssp.user_id_ )
+		FROM
+			course_schedule_student_payment cssp
+			LEFT JOIN course_schedule cs ON cssp.course_schedule_id_ = cs.id_
+			LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = cssp.course_schedule_id_ AND sa.user_id_ = cssp.user_id_
+			LEFT JOIN student_visit sv ON cssp.id_=sv.object_id_
+		WHERE
+			<if test="type!=null and type=='LEAVE'">
+				(sa.status_ = 'LEAVE' AND sa.remark_ IS NOT NULL AND sv.id_ IS NULL)
+			</if>
+			<if test="type!=null and type=='TRUANT'">
+				(sa.status_ = 'TRUANT' OR sa.id_ IS NULL)
+			</if>
+			<if test="organIds!=null and organIds.size()>0">
+				AND cs.organ_id_ IN
+				<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
+					#{organId}
+				</foreach>
+			</if>
+	</select>
 </mapper>

+ 185 - 0
mec-biz/src/main/resources/config/mybatis/InspectionItemMapper.xml

@@ -0,0 +1,185 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ym.mec.biz.dal.dao.InspectionItemDao">
+    <resultMap id="InspectionItem" type="com.ym.mec.biz.dal.entity.InspectionItem">
+        <!--@mbg.generated-->
+        <!--@Table inspection_item-->
+        <id column="id_" property="id"/>
+        <result column="inspection_id_" property="inspectionId"/>
+        <result column="organ_id_" property="organId"/>
+        <result column="user_id_" property="userId"/>
+        <result column="item_" property="item" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="times_" property="times"/>
+        <result column="planned_times_" property="plannedTimes"/>
+        <result column="submitted_times" property="submittedTimes"/>
+        <result column="memo_" property="memo"/>
+        <result column="operation_" property="operation"/>
+        <result column="create_time_" property="createTime"/>
+        <result column="update_time_" property="updateTime"/>
+        <result column="month" property="month"/>
+        <result column="organName" property="organName"/>
+        <result column="userName" property="userName"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+        <!--@mbg.generated-->
+        id_, inspection_id_, organ_id_, user_id_, item_, times_, planned_times_, submitted_times,
+        memo_, operation_, create_time_, update_time_
+    </sql>
+    <select id="get" parameterType="java.lang.Long" resultMap="InspectionItem">
+        <!--@mbg.generated-->
+        select
+        <include refid="Base_Column_List"/>
+        from inspection_item
+        where id_ = #{id}
+    </select>
+    <delete id="delete" parameterType="java.lang.Long">
+        <!--@mbg.generated-->
+        delete from inspection_item
+        where id_ = #{id}
+    </delete>
+    <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.InspectionItem"
+            useGeneratedKeys="true">
+        <!--@mbg.generated-->
+        insert into inspection_item (inspection_id_, organ_id_, user_id_, item_, times_, planned_times_,
+        submitted_times, memo_, operation_, create_time_, update_time_)
+        values (#{inspectionId}, #{organId}, #{userId}, #{item,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+        #{times}, #{plannedTimes},
+        #{submittedTimes}, #{memo}, #{operation}, #{createTime}, #{updateTime})
+    </insert>
+    <update id="update" parameterType="com.ym.mec.biz.dal.entity.InspectionItem">
+        <!--@mbg.generated-->
+        update inspection_item
+        <set>
+            <if test="inspectionId != null">
+                inspection_id_ = #{inspectionId},
+            </if>
+            <if test="organId != null">
+                organ_id_ = #{organId},
+            </if>
+            <if test="userId != null">
+                user_id_ = #{userId},
+            </if>
+            <if test="item != null">
+                item_ = #{item,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            </if>
+            <if test="times != null">
+                times_ = #{times},
+            </if>
+            <if test="plannedTimes != null">
+                planned_times_ = #{plannedTimes},
+            </if>
+            <if test="submittedTimes != null">
+                submitted_times = #{submittedTimes},
+            </if>
+            <if test="memo != null">
+                memo_ = #{memo},
+            </if>
+            <if test="operation != null">
+                operation_ = #{operation},
+            </if>
+            <if test="createTime != null">
+                create_time_ = #{createTime},
+            </if>
+            <if test="updateTime != null">
+                update_time_ = #{updateTime},
+            </if>
+        </set>
+        where id_ = #{id}
+    </update>
+    <!-- 获取任务项数目及总次数 -->
+    <select id="getItemCountAndTimes" resultMap="InspectionItem">
+        SELECT inspection_id_ ,IFNULL(COUNT(*),0) planned_times_,SUM(times_) times_ FROM inspection_item
+        WHERE inspection_id_ IN
+        <foreach collection="inspectionIds" item="inspectionId" open="(" close=")" separator=",">
+            #{inspectionId}
+        </foreach>
+        GROUP BY inspection_id_
+    </select>
+
+    <insert id="batchInsert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.InspectionItem"
+            useGeneratedKeys="true">
+        INSERT INTO inspection_item (inspection_id_, organ_id_, user_id_, item_, times_,operation_, create_time_,
+        update_time_)
+        VALUE
+        <foreach collection="inspectionItems" item="inspectionItem" separator=",">
+            (#{inspectionItem.inspectionId}, #{inspectionItem.organId}, #{inspectionItem.userId},
+            #{inspectionItem.item,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{inspectionItem.times},
+            #{inspectionItem.operation},
+            #{inspectionItem.createTime}, #{inspectionItem.updateTime})
+        </foreach>
+    </insert>
+
+    <select id="getItemByInspectionId" resultMap="InspectionItem">
+        SELECT *
+        FROM inspection_item
+        WHERE inspection_id_ = #{inspectionId}
+    </select>
+
+    <delete id="deleteByIds">
+        DELETE FROM inspection_item WHERE id_ IN
+        <foreach collection="ids" item="id" open="(" close=")" separator=",">
+            #{id}
+        </foreach>
+    </delete>
+
+    <!-- 批量更新任务次数 -->
+    <update id="batchUpdate">
+        <foreach collection="inspectionItems" item="inspectionItem" index="index" open="" close="" separator=";">
+            update inspection_item
+            <set>
+                <if test="inspectionItem.times != null">
+                    times_ = #{inspectionItem.times},
+                </if>
+                <if test="inspectionItem.operation != null">
+                    operation_ = #{inspectionItem.operation},
+                </if>
+                <if test="inspectionItem.updateTime != null">
+                    update_time_ = #{inspectionItem.updateTime}
+                </if>
+            </set>
+            where id_ = #{inspectionItem.id}
+        </foreach>
+    </update>
+    <delete id="deleteByInspectionId">
+        DELETE FROM inspection_item
+        WHERE inspection_id_ = #{InspectionId}
+    </delete>
+
+    <!-- 分页查询 -->
+    <select id="queryPage" resultMap="InspectionItem" parameterType="map">
+        SELECT ii.*,i.month_ month,o.name_ organName,su.real_name_ userName FROM inspection_item ii
+        LEFT JOIN inspection i ON i.id_ = ii.inspection_id_
+        LEFT JOIN organization o ON o.id_=ii.organ_id_
+        LEFT JOIN sys_user su ON su.id_ = ii.user_id_
+        <include refid="queryPageSql"/>
+        ORDER BY ii.id_
+        <include refid="global.limit"/>
+    </select>
+
+    <!-- 查询当前表的总记录数 -->
+    <select id="queryCount" resultType="int">
+        SELECT COUNT(*) FROM inspection_item ii
+        LEFT JOIN inspection i ON i.id_ = ii.inspection_id_
+        <include refid="queryPageSql"/>
+    </select>
+
+    <sql id="queryPageSql">
+        <where>
+            <if test="organId != null">
+                AND FIND_IN_SET(ii.organ_id_,#{organId})
+            </if>
+            <if test="userId != null">
+                AND ii.user_id_ = #{userId}
+            </if>
+            <if test="operation != null">
+                AND ii.operation_ = #{operation}
+            </if>
+            <if test="startTime != null">
+                AND i.month_ >= #{startTime}
+            </if>
+            <if test="endTime != null">
+                <![CDATA[AND i.month_ <= #{endTime}]]>
+            </if>
+        </where>
+    </sql>
+</mapper>

+ 122 - 0
mec-biz/src/main/resources/config/mybatis/InspectionItemPlanConclusionMapper.xml

@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ym.mec.biz.dal.dao.InspectionItemPlanConclusionDao">
+    <resultMap id="BaseResultMap" type="com.ym.mec.biz.dal.entity.InspectionItemPlanConclusion">
+        <!--@mbg.generated-->
+        <!--@Table inspection_item_plan_conclusion-->
+        <id column="id_" property="id"/>
+        <result column="plan_id_" property="planId"/>
+        <result column="course_schedule_id_" property="courseScheduleId"/>
+        <result column="teacher_id_" property="teacherId"/>
+        <result column="check_item_" property="checkItem"/>
+        <result column="check_conclusion_" property="checkConclusion"/>
+        <result column="create_time_" property="createTime"/>
+        <result column="update_time_" property="updateTime"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+        <!--@mbg.generated-->
+        id_, plan_id_,course_schedule_id_, teacher_id_, check_item_, check_conclusion_, create_time_, update_time_
+    </sql>
+    <select id="get" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+        <!--@mbg.generated-->
+        select
+        <include refid="Base_Column_List"/>
+        from inspection_item_plan_conclusion
+        where id_ = #{id}
+    </select>
+    <delete id="delete" parameterType="java.lang.Integer">
+        <!--@mbg.generated-->
+        delete from inspection_item_plan_conclusion
+        where id_ = #{id}
+    </delete>
+    <insert id="insert" keyColumn="id_" keyProperty="id"
+            parameterType="com.ym.mec.biz.dal.entity.InspectionItemPlanConclusion" useGeneratedKeys="true">
+        <!--@mbg.generated-->
+        insert into inspection_item_plan_conclusion (plan_id_,course_schedule_id_, teacher_id_,check_item_,
+        check_conclusion_, create_time_,update_time_)
+        values (#{planId}, #{courseScheduleId},#{teacherId}, #{checkItem}, #{checkConclusion},#{createTime},
+        #{updateTime})
+    </insert>
+    <update id="update" parameterType="com.ym.mec.biz.dal.entity.InspectionItemPlanConclusion">
+        <!--@mbg.generated-->
+        update inspection_item_plan_conclusion
+        <set>
+            <if test="planId != null">
+                plan_id_ = #{planId},
+            </if>
+            <if test="courseScheduleId != null != null">
+                course_schedule_id_ = #{courseScheduleId},
+            </if>
+            <if test="teacherId != null">
+                teacher_id_ = #{teacherId},
+            </if>
+            <if test="checkItem != null">
+                check_item_ = #{checkItem},
+            </if>
+            <if test="checkConclusion != null">
+                check_conclusion_ = #{checkConclusion},
+            </if>
+            <if test="createTime != null">
+                create_time_ = #{createTime},
+            </if>
+            <if test="updateTime != null">
+                update_time_ = #{updateTime},
+            </if>
+        </set>
+        where id_ = #{id}
+    </update>
+    <delete id="delByPlanIdAndCheckItem">
+        DELETE
+        FROM inspection_item_plan_conclusion
+        WHERE plan_id_ = #{planId}
+          ANd check_item_ = #{checkItem}
+    </delete>
+    <insert id="batchAdd" keyColumn="id_" keyProperty="id"
+            parameterType="com.ym.mec.biz.dal.entity.InspectionItemPlanConclusion"
+            useGeneratedKeys="true">
+        INSERT INTO inspection_item_plan_conclusion (plan_id_,course_schedule_id_, teacher_id_, check_item_,
+        check_conclusion_,create_time_,update_time_)
+        VALUE
+        <foreach collection="inspectionItemPlanConclusions" item="inspectionItemPlanConclusion" separator=",">
+            (#{inspectionItemPlanConclusion.planId},#{inspectionItemPlanConclusion.courseScheduleId},
+            #{inspectionItemPlanConclusion.teacherId},
+            #{inspectionItemPlanConclusion.checkItem},
+            #{inspectionItemPlanConclusion.checkConclusion}, #{inspectionItemPlanConclusion.createTime},
+            #{inspectionItemPlanConclusion.updateTime})
+        </foreach>
+    </insert>
+
+    <select id="getLastCheckItem" resultType="com.ym.mec.biz.dal.dto.CheckItemDto">
+        SELECT plan_id_ planId,MAX(check_item_) checkItem FROM inspection_item_plan_conclusion WHERE plan_id_ IN
+        <foreach collection="planIds" item="planId" open="(" close=")" separator=",">
+            #{planId}
+        </foreach>
+        GROUP BY plan_id_
+    </select>
+
+    <select id="getInspectionItemPlanConclusion" resultMap="BaseResultMap">
+        SELECT * FROM inspection_item_plan_conclusion WHERE plan_id_=#{planId}
+        <if test="checkItem != null">
+            AND check_item_ = #{checkItem}
+        </if>
+    </select>
+
+    <select id="getPlanConclusionCourses" resultMap="com.ym.mec.biz.dal.dao.CourseScheduleDao.CourseSchedule">
+        SELECT iipc.course_schedule_id_             id_,
+               iipc.teacher_id_                     actual_teacher_id_,
+               CONCAT(cg.name_, '-', su.real_name_) name_
+        FROM inspection_item_plan_conclusion iipc
+                 LEFT JOIN course_schedule cs ON iipc.course_schedule_id_ = cs.id_
+                 LEFT JOIN class_group cg ON cg.id_ = cs.class_group_id_
+                 LEFT JOIN sys_user su on iipc.teacher_id_ = su.id_
+        WHERE plan_id_ = #{planId}
+        GROUP BY iipc.course_schedule_id_, iipc.teacher_id_
+    </select>
+
+    <select id="getCountByPlanIdAndCheckConclusion" resultType="int">
+        SELECT COUNT(*)
+        FROM inspection_item_plan_conclusion
+        WHERE plan_id_ = #{planId}
+          AND check_conclusion_ = #{checkConclusion}
+    </select>
+</mapper>

+ 171 - 0
mec-biz/src/main/resources/config/mybatis/InspectionItemPlanMapper.xml

@@ -0,0 +1,171 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ym.mec.biz.dal.dao.InspectionItemPlanDao">
+    <resultMap id="InspectionItemPlan" type="com.ym.mec.biz.dal.entity.InspectionItemPlan">
+        <!--@mbg.generated-->
+        <!--@Table inspection_item_plan-->
+        <id column="id_" property="id"/>
+        <result column="inspection_id_" property="inspectionId"/>
+        <result column="item_id_" property="itemId"/>
+        <result column="user_id_" property="userId"/>
+        <result column="plan_start_" property="planStart"/>
+        <result column="plan_end_" property="planEnd"/>
+        <result column="organ_id_" property="organId"/>
+        <result column="cooperation_organ_id_" property="cooperationOrganId"/>
+        <result column="music_group_id_" property="musicGroupId"/>
+        <result column="school_gps_" property="schoolGps"/>
+        <result column="submited_gps_" property="submitedGps"/>
+        <result column="submited_time_" property="submitedTime"/>
+        <result column="memo_" property="memo"/>
+        <result column="conclusion_status_" property="conclusionStatus"/>
+        <result column="status_" property="status"/>
+        <result column="create_time_" property="createTime"/>
+        <result column="update_time_" property="updateTime"/>
+        <result column="cooperationName" property="cooperationName"/>
+        <result column="musicGroupName" property="musicGroupName"/>
+        <result column="organName" property="organName"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+        <!--@mbg.generated-->
+        id_, inspection_id_, item_id_, user_id_, plan_start_, plan_end_,organ_id_, cooperation_organ_id_,
+        music_group_id_, school_gps_, submited_gps_, submited_time_, memo_, conclusion_status_, status_, create_time_,
+        update_time_
+    </sql>
+    <select id="get" parameterType="java.lang.Integer" resultMap="InspectionItemPlan">
+        <!--@mbg.generated-->
+        select
+        <include refid="Base_Column_List"/>
+        from inspection_item_plan
+        where id_ = #{id}
+    </select>
+    <delete id="delete" parameterType="java.lang.Integer">
+        <!--@mbg.generated-->
+        delete from inspection_item_plan
+        where id_ = #{id}
+    </delete>
+    <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.InspectionItemPlan"
+            useGeneratedKeys="true">
+        <!--@mbg.generated-->
+        insert into inspection_item_plan (inspection_id_, item_id_, user_id_, plan_start_, plan_end_,
+        organ_id_,cooperation_organ_id_,
+        music_group_id_, school_gps_, submited_gps_, submited_time_, memo_, conclusion_status_, status_,
+        create_time_, update_time_)
+        values (#{inspectionId}, #{itemId}, #{userId}, #{planStart}, #{planEnd}, #{organId},#{cooperationOrganId},
+        #{musicGroupId}, #{schoolGps}, #{submitedGps}, #{submitedTime}, #{memo}, #{status},
+        #{createTime}, #{updateTime})
+    </insert>
+    <update id="update" parameterType="com.ym.mec.biz.dal.entity.InspectionItemPlan">
+        <!--@mbg.generated-->
+        update inspection_item_plan
+        <set>
+            <if test="inspectionId != null">
+                inspection_id_ = #{inspectionId},
+            </if>
+            <if test="itemId != null">
+                item_id_ = #{itemId},
+            </if>
+            <if test="userId != null">
+                user_id_ = #{userId},
+            </if>
+            <if test="planStart != null">
+                plan_start_ = #{planStart},
+            </if>
+            <if test="planEnd != null">
+                plan_end_ = #{planEnd},
+            </if>
+            <if test="organId != null">
+                organ_id_ = #{organId},
+            </if>
+            <if test="cooperationOrganId != null">
+                cooperation_organ_id_ = #{cooperationOrganId},
+            </if>
+            <if test="musicGroupId != null">
+                music_group_id_ = #{musicGroupId},
+            </if>
+            <if test="schoolGps != null">
+                school_gps_ = #{schoolGps},
+            </if>
+            <if test="submitedGps != null">
+                submited_gps_ = #{submitedGps},
+            </if>
+            <if test="submitedTime != null">
+                submited_time_ = #{submitedTime},
+            </if>
+            <if test="memo != null">
+                memo_ = #{memo},
+            </if>
+            <if test="conclusionStatus != null">
+                conclusion_status_ = #{conclusionStatus},
+            </if>
+            <if test="status != null">
+                status_ = #{status},
+            </if>
+            <if test="createTime != null">
+                create_time_ = #{createTime},
+            </if>
+            <if test="updateTime != null">
+                update_time_ = #{updateTime},
+            </if>
+        </set>
+        where id_ = #{id}
+    </update>
+
+    <!-- 分页查询 -->
+    <select id="queryPage" resultMap="InspectionItemPlan" parameterType="map">
+        SELECT iip.*,o.name_ organName,co.name_ cooperationName,mg.name_ musicGroupName FROM inspection_item_plan iip
+        LEFT JOIN organization o ON o.id_=iip.organ_id_
+        LEFT JOIN cooperation_organ co ON co.id_=iip.cooperation_organ_id_
+        LEFT JOIN music_group mg ON mg.id_ = iip.music_group_id_
+        <include refid="queryPageSql"/>
+        ORDER BY iip.plan_start_ ASC
+        <include refid="global.limit"/>
+    </select>
+
+    <!-- 查询当前表的总记录数 -->
+    <select id="queryCount" resultType="int">
+        SELECT COUNT(*) FROM inspection_item_plan iip
+        LEFT JOIN music_group mg ON mg.id_ = iip.music_group_id_
+        <include refid="queryPageSql"/>
+    </select>
+
+    <sql id="queryPageSql">
+        <where>
+            <if test="itemId != null">
+                AND iip.item_id_ = #{itemId}
+            </if>
+            <if test="userId != null">
+                AND iip.user_id_ = #{userId}
+            </if>
+            <if test="organId != null">
+                AND FIND_IN_SET(iip.organ_id_,#{organId})
+            </if>
+            <if test="cooperationOrganId != null">
+                AND iip.cooperation_organ_id_ = #{cooperationOrganId}
+            </if>
+            <if test="musicGroupId != null">
+                AND iip.music_group_id_ = #{musicGroupId}
+            </if>
+            <if test="conclusionStatus != null">
+                AND iip.conclusion_status = #{conclusionStatus}
+            </if>
+            <if test="status !=null">
+                AND iip.status_ = #{status}
+            </if>
+            <if test='hasSubmit != null and hasSubmit.toString()=="1".toString()'>
+                AND iip.status_ > 0
+            </if>
+            <if test='hasSubmit != null and hasSubmit.toString()=="0".toString()'>
+                AND iip.status_ = 0
+            </if>
+            <if test="startTime != null">
+                AND iip.plan_start_ >= #{startTime}
+            </if>
+            <if test="endTime != null">
+                <![CDATA[AND iip.plan_start_ <= #{endTime}]]>
+            </if>
+            <if test="search != null">
+                AND mg.name LIKE CONCAT('%', #{search}, '%')
+            </if>
+        </where>
+    </sql>
+</mapper>

+ 114 - 0
mec-biz/src/main/resources/config/mybatis/InspectionMapper.xml

@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ym.mec.biz.dal.dao.InspectionDao">
+    <resultMap id="Inspection" type="com.ym.mec.biz.dal.entity.Inspection">
+        <!--@mbg.generated-->
+        <!--@Table inspection-->
+        <id column="id_" property="id"/>
+        <result column="organ_id_" property="organId"/>
+        <result column="user_id_" property="userId"/>
+        <result column="month_" property="month"/>
+        <result column="memo_" property="memo"/>
+        <result column="operation_" property="operation"/>
+        <result column="create_time_" property="createTime"/>
+        <result column="update_time_" property="updateTime"/>
+        <result column="organName" property="organName"/>
+        <result column="userName" property="userName"/>
+        <collection property="inspectionItems" ofType="com.ym.mec.biz.dal.entity.InspectionItem" resultMap="com.ym.mec.biz.dal.dao.InspectionItemDao.InspectionItem"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+        <!--@mbg.generated-->
+        id_, organ_id_, user_id_, month_, memo_, operation_, create_time_, update_time_
+    </sql>
+    <select id="get" parameterType="java.lang.Long" resultMap="Inspection">
+        <!--@mbg.generated-->
+        select
+        <include refid="Base_Column_List"/>
+        from inspection
+        where id_ = #{id}
+    </select>
+    <delete id="delete" parameterType="java.lang.Long">
+        <!--@mbg.generated-->
+        delete from inspection
+        where id_ = #{id}
+    </delete>
+    <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.Inspection"
+            useGeneratedKeys="true">
+        <!--@mbg.generated-->
+        insert into inspection (organ_id_, user_id_, month_, operation_, create_time_, update_time_
+        )
+        values (#{organId}, #{userId}, #{month}, #{operation}, #{createTime}, #{updateTime}
+        )
+    </insert>
+    <update id="update" parameterType="com.ym.mec.biz.dal.entity.Inspection">
+        <!--@mbg.generated-->
+        update inspection
+        <set>
+            <if test="organId != null">
+                organ_id_ = #{organId},
+            </if>
+            <if test="userId != null">
+                user_id_ = #{userId},
+            </if>
+            <if test="month != null">
+                month_ = #{month},
+            </if>
+            <if test="memo != null">
+                memo_ = #{memo},
+            </if>
+            <if test="operation != null">
+                operation_ = #{operation},
+            </if>
+            <if test="createTime != null">
+                create_time_ = #{createTime},
+            </if>
+            <if test="updateTime != null">
+                update_time_ = #{updateTime},
+            </if>
+        </set>
+        where id_ = #{id}
+    </update>
+
+    <!-- 分页查询 -->
+    <select id="queryPage" resultMap="Inspection" parameterType="map">
+        SELECT i.*,o.name_ organName,su.real_name_ userName FROM inspection i
+        LEFT JOIN organization o ON o.id_=i.organ_id_
+        LEFT JOIN sys_user su ON su.id_ = i.user_id_
+        <include refid="queryPageSql"/>
+        ORDER BY i.id_
+        <include refid="global.limit"/>
+    </select>
+
+    <!-- 查询当前表的总记录数 -->
+    <select id="queryCount" resultType="int">
+        SELECT COUNT(*) FROM inspection i
+        <include refid="queryPageSql"/>
+    </select>
+
+    <sql id="queryPageSql">
+        <where>
+            <if test="organId != null">
+                AND FIND_IN_SET(i.organ_id_,#{organId})
+            </if>
+            <if test="userId != null">
+                AND i.user_id_ = #{userId}
+            </if>
+            <if test="operation != null">
+                AND i.operation_ = #{operation}
+            </if>
+            <if test="startTime != null">
+                AND i.month_ >= #{startTime}
+            </if>
+            <if test="endTime != null">
+                <![CDATA[AND i.month_ <= #{endTime}]]>
+            </if>
+        </where>
+    </sql>
+    <select id="getInfo" resultMap="Inspection">
+        SELECT i.*,ii.*, o.name_ organName,su.real_name_ userName FROM inspection i
+        LEFT JOIN organization o ON o.id_ = i.organ_id_
+        LEFT JOIN sys_user su ON su.id_ = i.user_id_
+        LEFT JOIN inspection_item ii ON ii.inspection_id_ = i.id_
+        WHERE i.id_ = #{id}
+    </select>
+</mapper>

+ 16 - 0
mec-biz/src/main/resources/config/mybatis/MusicGroupMapper.xml

@@ -630,4 +630,20 @@
 		LEFT JOIN class_group cg ON cg.music_group_id_ = mg.id_
 		WHERE cg.id_ = #{classGroupId} LIMIT 1
     </select>
+    <select id="queryIdsByEduIdAndOrganIds" resultType="java.lang.String">
+        SELECT DISTINCT id_ FROM music_group
+        <where>
+            <if test="educationId != null">
+                AND educational_teacher_id_ = #{educationId}
+            </if>
+            <if test="organIds != null and organIds != ''">
+                AND FIND_IN_SET(organ_id_,#{organIds})
+            </if>
+        </where>
+    </select>
+    <select id="getMusicGroupSchool" resultMap="com.ym.mec.biz.dal.dao.SchoolDao.School">
+        SELECT s.* FROM music_group mg
+        LEFT JOIN school s ON s.id_=mg.school_id_
+        WHERE mg.id_ = #{id}
+    </select>
 </mapper>

+ 19 - 24
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderDetailMapper.xml

@@ -213,6 +213,11 @@
 		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_
+		<include refid="queryPageSql"/>
+		ORDER BY mgpc.update_time_ DESC
+		<include refid="global.limit" />
+	</select>
+	<sql id="queryPageSql">
 		<where>
 			mgpc.music_group_id_ = sr.music_group_id_
 			<if test="search != null and search != ''">
@@ -224,6 +229,12 @@
 			<if test="paymentStatus != null and paymentStatus != ''">
 				AND mgpcd.payment_status_ = #{paymentStatus}
 			</if>
+			<if test="musicGroupId != null and musicGroupId != ''">
+				AND mgpc.music_group_id_ = #{musicGroupId}
+			</if>
+			<if test="userId != null">
+				AND mgpcd.user_id_ = #{userId}
+			</if>
 			<if test="musicGroupStatus != null and musicGroupStatus != ''">
 				AND sr.music_group_status_ = #{musicGroupStatus}
 			</if>
@@ -234,9 +245,7 @@
 				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" />
-	</select>
+	</sql>
 
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
@@ -246,27 +255,7 @@
 		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_
-			<if test="search != null and search != ''">
-				AND (mgpcd.user_id_ = #{search} OR su.username_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%'))
-			</if>
-			<if test="id != null">
-				AND mgpcd.music_group_payment_calender_id_ = #{id}
-			</if>
-			<if test="subjectId != null">
-				AND #{subjectId} = sr.actual_subject_id_
-			</if>
-			<if test="paymentStatus != null and paymentStatus != ''">
-				AND mgpcd.payment_status_ = #{paymentStatus}
-			</if>
-			<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>
+		<include refid="queryPageSql"/>
 	</select>
 	<select id="queryListByIds" resultMap="MusicGroupPaymentCalenderDetail">
 		SELECT mgpcd.*,mgpc.music_group_id_ FROM music_group_payment_calender_detail mgpcd
@@ -395,6 +384,12 @@
 			</foreach>
 		</if>
     </select>
+	<select id="queryNoPaymentTotalAmount" resultType="java.util.Map">
+		SELECT mgpcd.user_id_ 'key',SUM(mgpcd.expect_amount_) 'value' FROM music_group_payment_calender_detail mgpcd
+		LEFT JOIN music_group_payment_calender mgpc ON mgpcd.music_group_payment_calender_id_ = mgpc.id_
+		WHERE mgpcd.payment_status_ = 'NON_PAYMENT' AND mgpc.music_group_id_ = #{musicGroupId} AND mgpc.status_ IN ('OPEN','OVER','PAID')
+		GROUP BY mgpcd.user_id_
+	</select>
 
 	<update id="updateNoPaymentAndZeroPaymentStatus">
 		UPDATE music_group_payment_calender_detail SET payment_status_ = 'PAID_COMPLETED',actual_amount_ = 0,update_time_ = NOW()

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

@@ -348,7 +348,14 @@
     </select>
     <select id="queryEndIds" resultType="java.lang.Long">
         SELECT DISTINCT mgpc.id_ FROM music_group_payment_calender mgpc
-        WHERE mgpc.payment_valid_end_date_ IS NOT NULL AND DATEDIFF(mgpc.payment_valid_end_date_,#{format}) = #{configValue} AND mgpc.payment_type_ IN ('MUSIC_APPLY','MUSIC_RENEW')
+        WHERE mgpc.payment_valid_end_date_ IS NOT NULL AND DATEDIFF(mgpc.payment_valid_end_date_,#{format}) = #{configValue}
+        AND mgpc.payment_type_ IN ('MUSIC_APPLY','MUSIC_RENEW')
+        <if test="musicGroupIds != null">
+            AND mgpc.music_group_id_ IN
+            <foreach collection="musicGroupIds" open="(" close=")" item="item" separator=",">
+                #{item}
+            </foreach>
+        </if>
     </select>
     <resultMap id="CalenderPushDto" type="com.ym.mec.biz.dal.dto.CalenderPushDto">
         <result property="paymentValidEndDate" column="payment_valid_end_date_"/>
@@ -562,4 +569,11 @@
     <select id="getSchoolCalender" resultMap="MusicGroupPaymentCalender">
         SELECT * FROM music_group_payment_calender WHERE id_ = #{calenderId} AND status_ IN ('NO', 'OPEN', 'OVER', 'PAID');
     </select>
+    <select id="queryMusicGroupIds" resultType="java.lang.String">
+        SELECT music_group_id_ FROM music_group_payment_calender
+        WHERE id_ IN
+        <foreach collection="calenderIds" item="calenderId" open="(" close=")" separator=",">
+            #{calenderId}
+        </foreach>
+    </select>
 </mapper>

+ 11 - 3
mec-biz/src/main/resources/config/mybatis/StudentAttendanceMapper.xml

@@ -485,7 +485,7 @@
     </select>
     
     <select id="findStudentAttendance" resultMap="StudentAttendance">
-        SELECT cssp.course_schedule_id_,cssp.user_id_,cssp.group_type_,cssp.music_group_id_,sa.sign_in_time_,sa.sign_out_time_,sa.status_,
+        SELECT cssp.course_schedule_id_,cssp.user_id_,cssp.group_type_,cssp.music_group_id_,sa.sign_in_time_,sa.sign_out_time_,CASE WHEN sa.status_ IS NULL THEN 'TRUANT' ELSE sa.status_ END status_,
         su.username_,su.phone_,su.avatar_,cs.teach_mode_,cs.type_ course_type_,o.name_ organ_name_,tu.real_name_ teacher_name_,cs.name_ course_schedule_name_,cs.status_ course_status_,
         cs.actual_teacher_id_ teacher_id_,cs.class_date_ ,cs.start_class_time_,cs.end_class_time_ ,cs.new_course_id_
         FROM course_schedule_student_payment cssp left join course_schedule cs on cs.id_ = cssp.course_schedule_id_
@@ -519,7 +519,11 @@
         		and cs.status_ = #{courseStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
         	</if>
         	<if test="status != null">
-        		and sa.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+                and (sa.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+                <if test="status.code == 'TRUANT'">
+                    OR sa.id_ IS NULL
+                </if>
+                )
         	</if>
         	<if test="groupType != null">
         		and cssp.group_type_ = #{groupType}
@@ -565,7 +569,11 @@
         		and cs.status_ = #{courseStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
         	</if>
         	<if test="status != null">
-        		and sa.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+        		and (sa.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+                <if test="status.code == 'TRUANT'">
+                    OR sa.id_ IS NULL
+                </if>
+                )
         	</if>
         	<if test="groupType != null">
         		and cssp.group_type_ = #{groupType}

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

@@ -38,6 +38,7 @@
         <result column="mer_no_" property="merNo"/>
         <result column="order_no_" property="orderNo"/>
         <result column="fee_flag_" property="feeFlag"/>
+        <result column="route_organ_name_" property="routeOrganName"/>
     </resultMap>
 
     <resultMap id="StudentPaymentRouteOrderMap" type="com.ym.mec.biz.dal.entity.StudentPaymentRouteOrder" extends="StudentPaymentRouteOrder">
@@ -157,9 +158,10 @@
     </insert>
 
     <select id="queryPageOrder" parameterType="map" resultMap="StudentPaymentRouteOrderDto">
-        SELECT spo.*,spro.*,u.username_,u.phone_ FROM student_payment_order spo
+        SELECT spo.*,spro.*,u.username_,u.phone_,o.name_ route_organ_name_ FROM student_payment_order spo
         LEFT JOIN student_payment_route_order spro ON spo.order_no_ = spro.order_no_
         left join sys_user u on spo.user_id_ = u.id_
+        left join organization o on o.id_ = spro.route_organ_id_
         <include refid="queryPaymentOrder"/>
         ORDER BY spo.id_ DESC
         <include refid="global.limit"/>

+ 7 - 0
mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml

@@ -623,6 +623,13 @@
         UPDATE student_registration sr SET sr.current_grade_ = #{currentGrade},sr.current_class_ = #{currentClass},sr.current_grade_date_= NOW(),sr.update_time_ = NOW()
         WHERE sr.user_id_ = #{userId}
     </update>
+    <update id="updatePaymentStatusByClaenderId">
+        UPDATE student_registration sr
+        LEFT JOIN music_group_payment_calender mgpc ON mgpc.music_group_id_ = sr.music_group_id_
+        LEFT JOIN music_group_payment_calender_detail mgpcd ON mgpc.id_ = mgpcd.music_group_payment_calender_id_
+        SET sr.payment_status_ = 2,sr.music_group_status_ = 'NORMAL',sr.update_time_ = NOW()
+        WHERE mgpcd.user_id_ = sr.user_id_ AND mgpcd.expect_amount_ = 0 AND mgpc.id_ = #{calenderId}
+    </update>
 
     <select id="findStudentByMusicGroupIdAndUserId" resultMap="StudentRegistration">
         SELECT s.name_ school_name_,s2.name_ subject_name_,mgsp.kit_group_purchase_type_ kit_group_purchase_type_,

+ 19 - 5
mec-biz/src/main/resources/config/mybatis/StudentVisitMapper.xml

@@ -18,6 +18,7 @@
         <result column="feedback_" property="feedback"/>
         <result column="visit_time_" property="visitTime"/>
         <result column="create_time_" property="createTime"/>
+        <result column="object_id_" property="objectId"/>
     </resultMap>
     <sql id="Base_Column_List">
         <!--@mbg.generated-->
@@ -40,13 +41,11 @@
         <!--@mbg.generated-->
         insert into student_visit (music_group_id_, organ_id_, student_id_, teacher_id_, visiter_type_,
         type_, purpose_, overview_,
-        feedback_, visit_time_, create_time_
-        )
+        feedback_, visit_time_, create_time_,object_id_)
         values (#{musicGroupId,jdbcType=VARCHAR}, #{organId,jdbcType=INTEGER}, #{studentId,jdbcType=INTEGER},
         #{teacherId,jdbcType=INTEGER},#{visiterType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
         #{type,jdbcType=VARCHAR}, #{purpose,jdbcType=VARCHAR}, #{overview,jdbcType=VARCHAR},
-        #{feedback,jdbcType=VARCHAR}, #{visitTime}, #{createTime}
-        )
+        #{feedback,jdbcType=VARCHAR}, #{visitTime}, #{createTime},#{objectId})
     </insert>
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.StudentVisit">
         <!--@mbg.generated-->
@@ -79,6 +78,9 @@
             <if test="createTime != null">
                 create_time_ = #{createTime},
             </if>
+            <if test="objectId != null">
+                object_id_ = #{objectId},
+            </if>
         </set>
         where id_ = #{id,jdbcType=INTEGER}
     </update>
@@ -179,4 +181,16 @@
             #{studentId}
         </foreach>
     </select>
-</mapper>
+    <select id="getTeacherVisitCount" resultType="com.ym.mec.biz.dal.dto.TeacherVisitDto">
+        SELECT teacher_id_ teacherId,date_format(visit_time_, '%Y-%m') month, COUNT(*) num
+        FROM student_visit
+        WHERE teacher_id_ IN
+        <foreach collection="teacherIds" item="teacherId" open="(" close=")" separator=",">
+            #{teacherId}
+        </foreach>
+        AND visit_time_ >= #{startTime}
+        <![CDATA[AND visit_time_ <= #{endTime}
+        ]]>
+        GROUP BY teacher_id_,date_format(visit_time_, '%Y-%m')
+    </select>
+</mapper>

+ 26 - 8
mec-biz/src/main/resources/config/mybatis/TeacherCourseStatisticsMapper.xml

@@ -62,14 +62,26 @@
 
     <!-- 查找下月排课小于基准课酬的老师-->
     <select id="findUserByWarringSalary" resultMap="TeacherCourseStatistics"><![CDATA[
-        SELECT SUM(csts.expect_salary_) expect_total_salary_, csts.user_id_,t.organ_id_,t.subject_id_ subject_id_list_,
-        ROUND(AVG(TIMESTAMPDIFF(MINUTE,start_class_time_,end_class_time_)),0) average_class_minutes_
-        FROM course_schedule_teacher_salary csts
-        LEFT JOIN course_schedule cs ON cs.id_ = csts.course_schedule_id_
-        LEFT JOIN teacher t on t.id_ = csts.user_id_
-        WHERE cs.class_date_ >= #{startDate} AND cs.class_date_ <= #{endDate} AND csts.group_type_ IN ('VIP','MUSIC', 'PRACTICE')
-          AND cs.del_flag_ != 1 AND t.organ_id_ IS NOT NULL
-        GROUP BY csts.user_id_
+        SELECT ctt.expect_total_salary_, t.id_ user_id_,t.organ_id_,t.subject_id_ subject_id_list_,
+               ctt.average_class_minutes_
+        FROM teacher t
+         LEFT JOIN sys_user su ON t.id_=su.id_
+         LEFT JOIN (
+            SELECT
+                csts.user_id_,
+                SUM( csts.expect_salary_ ) expect_total_salary_,
+                ROUND( AVG( TIMESTAMPDIFF( MINUTE, start_class_time_, end_class_time_ )), 0 ) average_class_minutes_
+            FROM course_schedule_teacher_salary csts
+                     LEFT JOIN course_schedule cs ON cs.id_=csts.course_schedule_id_
+            WHERE cs.del_flag_ != 1
+              AND cs.class_date_ >= #{startDate} AND cs.class_date_ <= #{endDate}
+              AND csts.group_type_ IN ( 'VIP', 'MUSIC', 'PRACTICE' )
+            GROUP BY
+                csts.user_id_
+        ) ctt ON ctt.user_id_=t.id_
+        WHERE su.del_flag_ != 1 AND su.lock_flag_!=1
+          AND t.demission_date_ IS NULL
+          AND t.organ_id_ IS NOT NULL
         ]]>
   </select>
     <select id="findUserCourseSalaryByUserIds" resultMap="TeacherCourseStatistics">
@@ -110,6 +122,12 @@
             <if test="userId != null">
                 AND tcs.user_id_ = #{userId}
             </if>
+            <if test="minSalary != null">
+                AND tcs.expect_total_salary_ &gt; #{minSalary}
+            </if>
+            <if test="maxSalary != null">
+                AND tcs.expect_total_salary_ &lt; #{maxSalary}
+            </if>
         </where>
     </sql>
 </mapper>

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

@@ -367,7 +367,7 @@
         select id_ `key`,IF(real_name_ IS NUll,'',real_name_) `value` FROM sys_user s WHERE FIND_IN_SET(id_,#{userIds})
     </select>
     <select id="queryNameByIdList" resultType="java.util.Map">
-        select id_ `key`,IF(real_name_ IS NUll,'',real_name_) `value` FROM sys_user s WHERE id_ IN
+        select id_ `key`,IF(real_name_ IS NUll,username_,real_name_) `value` FROM sys_user s WHERE id_ IN
         <foreach collection="userIds" item="userId" separator="," open="(" close=")">
             #{userId}
         </foreach>
@@ -379,6 +379,13 @@
         </foreach>
     </select>
 
+    <select id="queryNickNameByRole" resultType="java.util.Map">
+        select id_ `key`,IF(username_ IS NUll,real_name_,username_) `value` FROM sys_user s WHERE id_ IN
+        <foreach collection="userIds" item="userId" separator="," open="(" close=")">
+            #{userId}
+        </foreach>
+    </select>
+
     <select id="querySubjectNameByIdList" resultType="java.util.Map">
         select t.id_ `key`,GROUP_CONCAT(s.name_) `value`
         FROM teacher t

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

@@ -125,7 +125,7 @@
 			</if>
 			</set> WHERE id_ = #{id}
 	</update>
-	
+
 	<!-- 根据主键删除一条记录 -->
 	<delete id="delete" >
 		UPDATE vip_group_activity SET del_flag_=1 WHERE id_ = #{id}
@@ -185,4 +185,55 @@
     <select id="queryByIds" resultMap="VipGroupActivity">
 		SELECT * FROM vip_group_activity vga WHERE FIND_IN_SET(vga.id_,#{activityIds})
 	</select>
+	<resultMap type="com.ym.mec.biz.dal.dto.ExportVipGroupActivityDto" id="exportVipGroupActivityMap">
+		<result column="organ_name_" property="organName" />
+		<result column="id_" property="id" />
+		<result column="name_" property="name" />
+		<result column="description_" property="description" />
+		<result column="vip_group_category_id_list_" property="vipGroupCategoryIdList" />
+		<result column="open_flag_" property="openFlag" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+		<result column="time_" property="time" />
+		<result column="course_time_" property="courseTime" />
+		<result column="type_" property="type" />
+		<result column="dis_count_" property="disCount" />
+		<result column="online_salary_type_" property="onlineSalaryType" />
+		<result column="online_salary_settlement_" property="onlineSalarySettlement" />
+		<result column="offline_salary_type_" property="offlineSalaryType" />
+		<result column="offline_salary_settlement_" property="offlineSalarySettlement" />
+
+	</resultMap>
+	<select id="exportVipGroupActivity" resultMap="exportVipGroupActivityMap">
+		SELECT GROUP_CONCAT(distinct o.`name_`) organ_name_,vga.id_ , vga.`name_`,vga.`description_`,GROUP_CONCAT(distinct vgc.`name_`) vip_group_category_id_list_ ,
+		((NOW() &lt; vga.end_time_ AND NOW() > vga.start_time_) OR vga.end_time_ IS NULL) open_flag_,concat(vga.`start_time_`,' - ',vga.`end_time_` ) time_,
+		concat(vga.courses_start_time_,' - ',vga.courses_end_time_) course_time_,
+		case when vga.`type_` = 'BASE_ACTIVITY' then '基础活动' when vga.`type_` = 'DISCOUNT' then '折扣' else '赠送课时' end type_ ,
+		case when vga.`type_` = 'DISCOUNT' then concat(vga.`attribute1_`,'%')  end dis_count_ ,
+		case when JSON_EXTRACT(vga.`salary_settlement_json_`,'$.onlineSalarySettlement.salarySettlementType') = 'RATIO_DISCOUNT' then '课程单价比例折扣'
+		when JSON_EXTRACT(vga.`salary_settlement_json_`,'$.onlineSalarySettlement.salarySettlementType') = 'FIXED_SALARY' then '固定课酬'
+		else '老师默认课酬' end online_salary_type_,
+		JSON_EXTRACT(vga.`salary_settlement_json_`,'$.onlineSalarySettlement.settlementValue') online_salary_settlement_,
+		case when JSON_EXTRACT(vga.`salary_settlement_json_`,'$.offlineSalarySettlement.salarySettlementType') = 'RATIO_DISCOUNT' then '课程单价比例折扣'
+		when JSON_EXTRACT(vga.`salary_settlement_json_`,'$.offlineSalarySettlement.salarySettlementType') = 'FIXED_SALARY' then '固定课酬'
+		else '老师默认课酬' end  offline_salary_type_,
+		JSON_EXTRACT(vga.`salary_settlement_json_`,'$.offlineSalarySettlement.settlementValue') offline_salary_settlement_
+		FROM `vip_group_activity` vga
+		LEFT JOIN `organization` o on find_in_set(o.`id_`,vga.`organ_id_` )
+		LEFT JOIN `vip_group_category` vgc on find_in_set(vgc.`id_`,vga.`vip_group_category_id_list_` )
+		<where>
+			vga.del_flag_=0
+			<if test="organId != null">
+				AND INTE_ARRAY(vga.organ_id_,#{organId})
+			</if>
+			<if test="enable != null and enable == true">
+				AND ((NOW() &lt; vga.end_time_ AND NOW() > vga.start_time_) OR end_time_ IS NULL)
+			</if>
+			<if test="enable != null and enable == false">
+				AND (NOW() >= vga.end_time_ OR NOW() &lt;= vga.start_time_)
+			</if>
+			<if test="search != null and search != ''">
+				AND (vga.id_ = #{search} OR vga.name_ LIKE CONCAT('%', #{search}, '%'))
+			</if>
+		</where>
+		GROUP BY vga.`id_`
+	</select>
 </mapper>

+ 1 - 1
mec-common/audit-log/src/main/java/com/yonge/log/dal/dao/AuditLogDao.java

@@ -6,7 +6,7 @@ import com.yonge.log.dal.model.AuditLog;
 import com.yonge.mongodb.dao.BaseDaoWithMongo;
 
 @Component
-public class AuditLogDao extends BaseDaoWithMongo<Long, AuditLog> {
+public class AuditLogDao extends BaseDaoWithMongo<String, AuditLog> {
 
 	@Override
 	public Class<AuditLog> getClassEntity() {

+ 6 - 7
mec-common/audit-log/src/main/java/com/yonge/log/dal/model/AuditLog.java

@@ -1,7 +1,6 @@
 package com.yonge.log.dal.model;
 
 import java.io.Serializable;
-import java.util.Date;
 
 import org.springframework.data.annotation.Id;
 import org.springframework.data.mongodb.core.mapping.Document;
@@ -15,7 +14,7 @@ public class AuditLog implements Serializable {
 	private static final long serialVersionUID = 7721535265828759275L;
 
 	@Id
-	private Long id;
+	private String id;
 
 	private String username;
 
@@ -25,15 +24,15 @@ public class AuditLog implements Serializable {
 
 	private String inputParams;
 
-	private Date operateTime;
+	private String operateTime;
 
 	private String userIp;
 
-	public Long getId() {
+	public String getId() {
 		return id;
 	}
 
-	public void setId(Long id) {
+	public void setId(String id) {
 		this.id = id;
 	}
 
@@ -69,11 +68,11 @@ public class AuditLog implements Serializable {
 		this.inputParams = inputParams;
 	}
 
-	public Date getOperateTime() {
+	public String getOperateTime() {
 		return operateTime;
 	}
 
-	public void setOperateTime(Date operateTime) {
+	public void setOperateTime(String operateTime) {
 		this.operateTime = operateTime;
 	}
 

+ 13 - 5
mec-common/audit-log/src/main/java/com/yonge/log/interceptor/AuditLogInterceptor.java

@@ -1,12 +1,16 @@
 package com.yonge.log.interceptor;
 
 import java.io.IOException;
+import java.nio.charset.Charset;
+import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.Map;
 
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.commons.io.IOUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.method.HandlerMethod;
 import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
@@ -27,9 +31,7 @@ public class AuditLogInterceptor extends HandlerInterceptorAdapter {
 
 	private String username;
 
-	public AuditLogInterceptor(String username) {
-		this.username = username;
-	}
+	private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 
 	@Override
 	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws ServletException, IOException {
@@ -48,10 +50,16 @@ public class AuditLogInterceptor extends HandlerInterceptorAdapter {
 			auditLog.setOperateName(anno.operateName());
 			auditLog.setInterfaceUrl(anno.interfaceURL());
 			auditLog.setUserIp(WebUtil.getRemoteIp(request));
-			auditLog.setInputParams(JsonUtil.toJSONString(WebUtil.getParameterMap(request)));
+
+			Map<String, Object> params = WebUtil.getParameterMap(request);
+			if (params == null || params.size() == 0) {
+				auditLog.setInputParams(IOUtils.toString(request.getInputStream(), Charset.defaultCharset()));
+			} else {
+				auditLog.setInputParams(JsonUtil.toJSONString(WebUtil.getParameterMap(request)));
+			}
 			// 操作人
 			auditLog.setUsername(username);
-			auditLog.setOperateTime(new Date());
+			auditLog.setOperateTime(sdf.format(new Date()));
 			auditLogService.insert(auditLog);
 		}
 

+ 1 - 1
mec-common/audit-log/src/main/java/com/yonge/log/service/AuditLogService.java

@@ -3,6 +3,6 @@ package com.yonge.log.service;
 import com.yonge.log.dal.model.AuditLog;
 import com.yonge.mongodb.service.BaseServiceWithMongo;
 
-public interface AuditLogService extends BaseServiceWithMongo<Long, AuditLog> {
+public interface AuditLogService extends BaseServiceWithMongo<String, AuditLog> {
 
 }

+ 2 - 2
mec-common/audit-log/src/main/java/com/yonge/log/service/impl/AuditLogServiceImpl.java

@@ -10,13 +10,13 @@ import com.yonge.mongodb.dao.BaseDaoWithMongo;
 import com.yonge.mongodb.service.impl.BaseServiceImplWithMongo;
 
 @Service
-public class AuditLogServiceImpl extends BaseServiceImplWithMongo<Long, AuditLog> implements AuditLogService {
+public class AuditLogServiceImpl extends BaseServiceImplWithMongo<String, AuditLog> implements AuditLogService {
 
 	@Autowired
 	private AuditLogDao auditLogDao;
 
 	@Override
-	public BaseDaoWithMongo<Long, AuditLog> getDAO() {
+	public BaseDaoWithMongo<String, AuditLog> getDAO() {
 		return auditLogDao;
 	}
 

+ 5 - 5
mec-common/audit-log/src/test/java/com/yonge/log/test/SpringBootMongodbApplicationTests.java

@@ -25,7 +25,7 @@ public class SpringBootMongodbApplicationTests {
 	@Test
 	public void add() {
 		AuditLog auditLog = new AuditLog();
-		auditLog.setId(1L);
+		auditLog.setId("1");
 		auditLog.setInputParams("{'signClassId':'','mixClassId':'','snapClassIds':'','highClassId':'','temporaryCourseFee':null,'studentRegistration':{'name':'上低08','gender':1,'birthdate':'2020-12-21','parentsName':'上低08家长','parentsPhone':'18881230038','currentGrade':'一年级','currentClass':'A','subjectId':2,'musicGroupId':'20123009470100001'},'studentPaymentOrderDetails':[]}");
 		auditLog.setInterfaceUrl("api-web/studentRegistration/insertStudent");
 		auditLog.setOperateName("进行中加学员");
@@ -41,23 +41,23 @@ public class SpringBootMongodbApplicationTests {
 	@Test
 	public void query() {
 		System.out.println("********query**********");
-		System.out.println(JsonUtil.toJSONString(auditLogService.get(1L)));
+		System.out.println(JsonUtil.toJSONString(auditLogService.get("1")));
 		System.out.println("******************");
 	}
 
 	@Test
 	public void update() {
-		AuditLog auditLog = auditLogService.get(1L);
+		AuditLog auditLog = auditLogService.get("1");
 		auditLog.setInputParams("测试输入参数222");
 		System.out.println("********update**********");
-		System.out.println(JsonUtil.toJSONString(auditLogService.update(1L, auditLog)));
+		System.out.println(JsonUtil.toJSONString(auditLogService.update("1", auditLog)));
 		System.out.println("******************");
 	}
 
 	@Test
 	public void delete() {
 		System.out.println("********delete**********");
-		System.out.println(JsonUtil.toJSONString(auditLogService.delete(1L)));
+		System.out.println(JsonUtil.toJSONString(auditLogService.delete("1")));
 		System.out.println("******************");
 	}
 

+ 1 - 1
mec-common/audit-log/src/test/resources/application.properties

@@ -1,6 +1,6 @@
 spring.application.name=audit-log
 
 # mongodb
-spring.data.mongodb.uri=mongodb://47.114.1.200:27018
+spring.data.mongodb.uri=mongodb://47.114.1.200:27017
 
 spring.data.mongodb.database=mec_dev

+ 6 - 5
mec-common/pom.xml

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 	<modelVersion>4.0.0</modelVersion>
 	<parent>
 		<groupId>com.ym</groupId>
@@ -22,11 +23,11 @@
 			<artifactId>mec-util</artifactId>
 		</dependency>
 	</dependencies>
-	
+
 	<modules>
 		<module>common-core</module>
 		<module>common-log</module>
-	  <module>mongo-db</module>
-    <module>audit-log</module>
-  </modules>
+		<module>mongo-db</module>
+		<module>audit-log</module>
+	</modules>
 </project>

+ 52 - 12
mec-util/src/main/java/com/ym/mec/util/excel/POIUtil.java

@@ -1,24 +1,57 @@
 package com.ym.mec.util.excel;
 
-import com.ym.mec.util.exception.UtilException;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
 import org.apache.commons.beanutils.NestedNullException;
 import org.apache.commons.beanutils.PropertyUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.POIXMLDocumentPart;
-import org.apache.poi.hssf.usermodel.*;
-import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.hssf.usermodel.HSSFCell;
+import org.apache.poi.hssf.usermodel.HSSFCellStyle;
+import org.apache.poi.hssf.usermodel.HSSFClientAnchor;
+import org.apache.poi.hssf.usermodel.HSSFFont;
+import org.apache.poi.hssf.usermodel.HSSFPicture;
+import org.apache.poi.hssf.usermodel.HSSFRow;
+import org.apache.poi.hssf.usermodel.HSSFShape;
+import org.apache.poi.hssf.usermodel.HSSFSheet;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.CellStyle;
+import org.apache.poi.ss.usermodel.Font;
+import org.apache.poi.ss.usermodel.IndexedColors;
+import org.apache.poi.ss.usermodel.PictureData;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.ss.usermodel.WorkbookFactory;
 import org.apache.poi.xssf.streaming.SXSSFWorkbook;
-import org.apache.poi.xssf.usermodel.*;
+import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
+import org.apache.poi.xssf.usermodel.XSSFDrawing;
+import org.apache.poi.xssf.usermodel.XSSFPicture;
+import org.apache.poi.xssf.usermodel.XSSFShape;
+import org.apache.poi.xssf.usermodel.XSSFSheet;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTMarker;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.expression.ExpressionParser;
+import org.springframework.expression.spel.standard.SpelExpressionParser;
+import org.springframework.expression.spel.support.StandardEvaluationContext;
 
-import java.io.*;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.text.SimpleDateFormat;
-import java.util.*;
-import java.util.Map.Entry;
+import com.ym.mec.util.exception.UtilException;
 
 public class POIUtil {
 
@@ -28,7 +61,9 @@ public class POIUtil {
 	private final static int MAX_DATA_SIZE = 50000;
 
 	private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-
+	
+	private static ExpressionParser expressionParser =new SpelExpressionParser();
+	
 	/**
 	 * 将数据集dataset导出到fileName文件中(只支持.xlsx格式)
 	 *
@@ -201,17 +236,22 @@ public class POIUtil {
 		// 添加数据
 		T data = null;
 		Object obj = null;
+		StandardEvaluationContext context = null;
 		for (int i = 1; i <= dataset.size(); i++) {
 			data = dataset.get(i - 1);
 			if (data != null) {
+				
+				context = new StandardEvaluationContext(data);
 				row = sheet.createRow(i);
 				for (int j = 0; j < fieldColumns.length; j++) {
 					cell = row.createCell(j);
 					try {
-						obj = PropertyUtils.getNestedProperty(data, fieldColumns[j]);
+						//obj = PropertyUtils.getNestedProperty(data, fieldColumns[j]);
+						obj = expressionParser.parseExpression(fieldColumns[j]).getValue(context);
 						if (obj instanceof Date) {
 							obj = sdf.format(obj);
 						}
+						
 					} catch (NestedNullException e) {
 						LOGGER.warn(e.getMessage());
 						obj = null;

+ 1 - 1
mec-util/src/main/java/com/ym/mec/util/excel/IniFileEntity.java → mec-util/src/main/java/com/ym/mec/util/ini/IniFileEntity.java

@@ -1,4 +1,4 @@
-package com.ym.mec.util.excel;
+package com.ym.mec.util.ini;
 
 import org.apache.commons.lang3.builder.ToStringBuilder;
 

+ 1 - 1
mec-util/src/main/java/com/ym/mec/util/excel/IniFileUtil.java → mec-util/src/main/java/com/ym/mec/util/ini/IniFileUtil.java

@@ -1,4 +1,4 @@
-package com.ym.mec.util.excel;
+package com.ym.mec.util.ini;
 
 import com.ym.mec.util.exception.UtilException;
 import org.ini4j.Ini;

+ 4 - 4
mec-util/src/main/java/com/ym/mec/util/web/WebUtil.java

@@ -7,17 +7,17 @@
  */
 package com.ym.mec.util.web;
 
-import java.util.*;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
 
 import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import com.ym.mec.util.encode.AES;
 import org.apache.commons.lang3.StringUtils;
 
-import static com.ym.mec.util.encode.AES.encrypt;
-
 /**
  * 
  */

+ 6 - 0
mec-web/pom.xml

@@ -56,6 +56,12 @@
 			<groupId>com.ym</groupId>
 			<artifactId>mec-biz</artifactId>
 		</dependency>
+		
+		<dependency>
+			<groupId>com.yonge.log</groupId>
+			<artifactId>audit-log</artifactId>
+		</dependency>
+		
 		<dependency>
 			<groupId>com.github.penggle</groupId>
 			<artifactId>kaptcha</artifactId>

+ 1 - 1
mec-web/src/main/java/com/ym/mec/web/WebApplication.java

@@ -25,7 +25,7 @@ import com.ym.mec.common.filters.EmojiEncodingFilter;
 @EnableDiscoveryClient
 @EnableFeignClients("com.ym.mec")
 @MapperScan("com.ym.mec.biz.dal.dao")
-@ComponentScan(basePackages = "com.ym.mec")
+@ComponentScan(basePackages = {"com.ym.mec", "com.yonge.log"})
 @Configuration
 @EnableSwagger2Doc
 @EnableAsync

+ 2 - 0
mec-web/src/main/java/com/ym/mec/web/config/PermissionCheckService.java

@@ -4,6 +4,7 @@ import java.util.Collection;
 
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.security.core.Authentication;
 import org.springframework.security.core.GrantedAuthority;
 import org.springframework.stereotype.Component;
@@ -16,6 +17,7 @@ import com.ym.mec.common.security.SecurityUtils;
 public class PermissionCheckService {
 	
 	@Autowired
+	@Lazy
 	private SysUserFeignService sysUserFeignService;
 
 	public boolean hasPermissions(String... permissions) {

部分文件因为文件数量过多而无法显示