yonge vor 5 Jahren
Ursprung
Commit
e3ac9907c7

+ 1 - 0
mec-common/common-core/src/main/java/com/ym/mec/common/redis/service/RedisCache.java

@@ -45,6 +45,7 @@ public class RedisCache<K, V> implements Cache<K, V> {
 		return redisTemplate.hasKey(key);
 	}
 
+	@SuppressWarnings("unchecked")
 	@Override
 	public Set<K> keys() throws CacheException {
 		return redisTemplate.keys((K) "*");

+ 8 - 8
mec-common/common-core/src/main/java/com/ym/mec/common/security/SecurityUtils.java

@@ -1,11 +1,11 @@
 package com.ym.mec.common.security;
 
-import com.alibaba.fastjson.JSON;
+import java.util.Map;
+
 import org.springframework.security.core.Authentication;
 import org.springframework.security.core.context.SecurityContextHolder;
 
-import java.util.HashMap;
-import java.util.Map;
+import com.alibaba.fastjson.JSON;
 
 public class SecurityUtils {
 	/**
@@ -42,14 +42,14 @@ public class SecurityUtils {
 	 */
 	public static AuthUser getUser() {
 		Authentication authentication = getAuthentication();
-		Object tokenValue = JSON.parseObject(JSON.toJSONString(authentication.getDetails()), Map.class).get("tokenValue");
-		if (authentication == null) {
-			return null;
-		}
 		return getUser(authentication);
 	}
 
-	public static String getToken(){
+	public static String getAuthenticationValue(){
 		return "bearer " + JSON.parseObject(JSON.toJSONString(getAuthentication().getDetails()), Map.class).get("tokenValue").toString();
 	}
+
+	public static String getToken(){
+		return JSON.parseObject(JSON.toJSONString(getAuthentication().getDetails()), Map.class).get("tokenValue").toString();
+	}
 }

+ 20 - 20
mec-im/src/main/java/com/ym/service/Impl/RoomServiceImpl.java

@@ -77,7 +77,7 @@ public class RoomServiceImpl implements RoomService {
     @Transactional
     @Override
     public RoomResult joinRoom(String userName, String roomId, boolean isAudience, boolean isDisableCamera) throws ApiException, Exception {
-        String token = SecurityUtils.getToken();
+        String token = SecurityUtils.getAuthenticationValue();
 
         CheckUtils.checkArgument(userName != null, "userName must't be null");
         CheckUtils.checkArgument(roomId != null, "roomId must't be null");
@@ -181,7 +181,7 @@ public class RoomServiceImpl implements RoomService {
 //        JwtToken jwtToken = tokenHelper.createJwtToken(jwtUser);
         IMTokenInfo tokenInfo = imHelper.getToken(userId, userId, "");
         if (tokenInfo.isSuccess()) {
-            roomResult.setImToken(tokenInfo.getToken());
+            roomResult.setImToken(tokenInfo.getAuthenticationValue());
         } else {
             throw new ApiException(ErrorEnum.ERR_IM_TOKEN_ERROR, tokenInfo.getErrorMessage());
         }
@@ -220,7 +220,7 @@ public class RoomServiceImpl implements RoomService {
     @Transactional
     @Override
     public Boolean leaveRoom(String roomId) throws Exception {
-        String token = SecurityUtils.getToken();
+        String token = SecurityUtils.getAuthenticationValue();
         SysUser user = sysUserFeignService.queryUserInfo();
         String userId = user.getId().toString();
         
@@ -327,7 +327,7 @@ public class RoomServiceImpl implements RoomService {
     public Boolean downgrade(String roomId, List<ReqChangeUserRoleData.ChangedUser> users) throws ApiException, Exception {
         CheckUtils.checkArgument(roomId != null, "roomId must't be null");
         CheckUtils.checkArgument(users.size() > 0, "the changed user list must't be null");
-        String token = SecurityUtils.getToken();
+        String token = SecurityUtils.getAuthenticationValue();
         SysUser authUser = sysUserFeignService.queryUserInfo();
         String userId = authUser.getId().toString();
         List<Room> roomList = roomDao.findByRid(roomId);
@@ -377,7 +377,7 @@ public class RoomServiceImpl implements RoomService {
 
     @Override
     public Boolean kickMember(String roomId) throws ApiException, Exception {
-        String token = SecurityUtils.getToken();
+        String token = SecurityUtils.getAuthenticationValue();
         SysUser authUser = sysUserFeignService.queryUserInfo();
         String userId = authUser.getId().toString();
         CheckUtils.checkArgument(userId != null, "userId must't be null");
@@ -417,7 +417,7 @@ public class RoomServiceImpl implements RoomService {
 
     @Override
     public Boolean display(String roomId, int type, String uri) throws ApiException, Exception {
-        String token = SecurityUtils.getToken();
+        String token = SecurityUtils.getAuthenticationValue();
         SysUser authUser = sysUserFeignService.queryUserInfo();
         String userId = authUser.getId().toString();
         log.info("display in room: {}, type = {}, uri = {}", roomId, type, uri);
@@ -482,7 +482,7 @@ public class RoomServiceImpl implements RoomService {
     public String createWhiteBoard(String roomId) throws ApiException, Exception {
         CheckUtils.checkArgument(roomId != null, "roomId must't be null");
         CheckUtils.checkArgument(roomDao.existsByRid(roomId), "room not exist");
-        String token = SecurityUtils.getToken();
+        String token = SecurityUtils.getAuthenticationValue();
         SysUser authUser = sysUserFeignService.queryUserInfo();
         String userId = authUser.getId().toString();
         CheckUtils.checkArgument(roomMemberDao.existsByRidAndUid(roomId, userId), "room member not exist");
@@ -526,7 +526,7 @@ public class RoomServiceImpl implements RoomService {
     public Boolean deleteWhiteboard(String roomId, String whiteBoardId) throws ApiException, Exception {
         CheckUtils.checkArgument(roomId != null, "roomId must't be null");
         CheckUtils.checkArgument(whiteBoardId != null, "whiteBoardId must't be null");
-        String token = SecurityUtils.getToken();
+        String token = SecurityUtils.getAuthenticationValue();
         SysUser authUser = sysUserFeignService.queryUserInfo();
         String userId = authUser.getId().toString();
 
@@ -583,7 +583,7 @@ public class RoomServiceImpl implements RoomService {
     public Boolean turnWhiteBoardPage(String roomId, String whiteBoardId, int page) throws ApiException, Exception {
         CheckUtils.checkArgument(roomId != null, "roomId must't be null");
         CheckUtils.checkArgument(whiteBoardId != null, "whiteBoardId must't be null");
-        String token = SecurityUtils.getToken();
+        String token = SecurityUtils.getAuthenticationValue();
         SysUser authUser = sysUserFeignService.queryUserInfo();
         String userId = authUser.getId().toString();
         List<Room> roomList = roomDao.findByRid(roomId);
@@ -603,7 +603,7 @@ public class RoomServiceImpl implements RoomService {
         CheckUtils.checkArgument(userId != null, "userId must't be null");
         CheckUtils.checkArgument(roomDao.existsByRid(roomId), "room not exist");
         CheckUtils.checkArgument(roomMemberDao.existsByRidAndUid(roomId, userId), "room member not exist");
-        String token = SecurityUtils.getToken();
+        String token = SecurityUtils.getAuthenticationValue();
         SysUser authUser = sysUserFeignService.queryUserInfo();
 
         log.info("controlDevice: userId={}, typeEnum={}, onOff={}", userId, typeEnum, enable);
@@ -644,7 +644,7 @@ public class RoomServiceImpl implements RoomService {
     @Override
     public Boolean approveControlDevice(String roomId, String ticket) throws ApiException, Exception {
         CheckUtils.checkArgument(ticket != null, "ticket must't be null");
-        String token = SecurityUtils.getToken();
+        String token = SecurityUtils.getAuthenticationValue();
         SysUser authUser = sysUserFeignService.queryUserInfo();
         String userId = authUser.getId().toString();
         log.info("approveControlDevice: ticket={}", ticket);
@@ -669,7 +669,7 @@ public class RoomServiceImpl implements RoomService {
     @Override
     public Boolean rejectControlDevice(String roomId, String ticket) throws ApiException, Exception {
         CheckUtils.checkArgument(ticket != null, "ticket must't be null");
-        String token = SecurityUtils.getToken();
+        String token = SecurityUtils.getAuthenticationValue();
         SysUser authUser = sysUserFeignService.queryUserInfo();
         String userId = authUser.getId().toString();
 
@@ -687,7 +687,7 @@ public class RoomServiceImpl implements RoomService {
     public Boolean syncDeviceState(String roomId, DeviceTypeEnum type, boolean enable) throws ApiException, Exception {
         CheckUtils.checkArgument(roomId != null, "roomId must't be null");
         CheckUtils.checkArgument(roomDao.existsByRid(roomId), "room not exist");
-        String token = SecurityUtils.getToken();
+        String token = SecurityUtils.getAuthenticationValue();
         SysUser authUser = sysUserFeignService.queryUserInfo();
         String userId = authUser.getId().toString();
 
@@ -720,7 +720,7 @@ public class RoomServiceImpl implements RoomService {
     public Boolean applySpeech(String roomId) throws ApiException, Exception {
         CheckUtils.checkArgument(roomId != null, "roomId must't be null");
         CheckUtils.checkArgument(roomDao.existsByRid(roomId), "room not exist");
-        String token = SecurityUtils.getToken();
+        String token = SecurityUtils.getAuthenticationValue();
         SysUser authUser = sysUserFeignService.queryUserInfo();
         String userId = authUser.getId().toString();
         List<RoomMember> assistants = roomMemberDao.findByRidAndRole(roomId, RoleEnum.RoleAssistant.getValue());
@@ -755,7 +755,7 @@ public class RoomServiceImpl implements RoomService {
     public Boolean approveSpeech(String roomId, String ticket) throws ApiException, Exception {
         CheckUtils.checkArgument(roomId != null, "roomId must't be null");
         CheckUtils.checkArgument(roomDao.existsByRid(roomId), "room not exist");
-        String token = SecurityUtils.getToken();
+        String token = SecurityUtils.getAuthenticationValue();
         SysUser authUser = sysUserFeignService.queryUserInfo();
         String userId = authUser.getId().toString();
 
@@ -800,7 +800,7 @@ public class RoomServiceImpl implements RoomService {
     public Boolean rejectSpeech(String roomId, String ticket) throws ApiException, Exception {
         CheckUtils.checkArgument(roomId != null, "roomId must't be null");
         CheckUtils.checkArgument(roomDao.existsByRid(roomId), "room not exist");
-        String token = SecurityUtils.getToken();
+        String token = SecurityUtils.getAuthenticationValue();
         SysUser authUser = sysUserFeignService.queryUserInfo();
         String userId = authUser.getId().toString();
         ScheduledTaskInfo taskInfo = scheduleManager.executeTask(ticket);
@@ -874,7 +874,7 @@ public class RoomServiceImpl implements RoomService {
         CheckUtils.checkArgument(roomId != null, "roomId must't be null");
         CheckUtils.checkArgument(targetUserId != null, "userId must't be null");
         CheckUtils.checkArgument(roomMemberDao.existsByRidAndUid(roomId, targetUserId), "room member not exist");
-        String token = SecurityUtils.getToken();
+        String token = SecurityUtils.getAuthenticationValue();
         SysUser authUser = sysUserFeignService.queryUserInfo();
         String userId = authUser.getId().toString();
         log.info("inviteUpgradeRole roomId = {}, targetUserId = {}, targetRole = {}", roomId, targetUserId, targetRole);
@@ -914,7 +914,7 @@ public class RoomServiceImpl implements RoomService {
         CheckUtils.checkArgument(roomId != null, "roomId must't be null");
         CheckUtils.checkArgument(ticket != null, "ticket must't be null");
         CheckUtils.checkArgument(roomDao.existsByRid(roomId), "room not exist");
-        String token = SecurityUtils.getToken();
+        String token = SecurityUtils.getAuthenticationValue();
         SysUser authUser = sysUserFeignService.queryUserInfo();
         String userId = authUser.getId().toString();
         UpgradeRoleTaskInfo taskInfo = (UpgradeRoleTaskInfo) scheduleManager.executeTask(ticket);
@@ -957,7 +957,7 @@ public class RoomServiceImpl implements RoomService {
         CheckUtils.checkArgument(roomId != null, "roomId must't be null");
         CheckUtils.checkArgument(ticket != null, "ticket must't be null");
         CheckUtils.checkArgument(roomDao.existsByRid(roomId), "room not exist");
-        String token = SecurityUtils.getToken();
+        String token = SecurityUtils.getAuthenticationValue();
         SysUser authUser = sysUserFeignService.queryUserInfo();
         String userId = authUser.getId().toString();
         UpgradeRoleTaskInfo taskInfo = (UpgradeRoleTaskInfo) scheduleManager.executeTask(ticket);
@@ -981,7 +981,7 @@ public class RoomServiceImpl implements RoomService {
         CheckUtils.checkArgument(roomDao.existsByRid(roomId), "room not exist");
         CheckUtils.checkArgument(RoleEnum.getEnumByValue(targetRole).equals(RoleEnum.RoleTeacher), "only set to teacher");
         CheckUtils.checkArgument(roomMemberDao.existsByRidAndUid(roomId, targetUserId), "room member not exist");
-        String token = SecurityUtils.getToken();
+        String token = SecurityUtils.getAuthenticationValue();
         SysUser authUser = sysUserFeignService.queryUserInfo();
         String userId = authUser.getId().toString();
 

+ 1 - 1
mec-im/src/main/java/com/ym/service/Impl/UserServiceImpl.java

@@ -47,7 +47,7 @@ public class UserServiceImpl implements UserService {
         log.info("request token: {}, {}", userId, name);
         IMTokenInfo tokenInfo = imHelper.getToken(userId, name, "");
         if (tokenInfo.isSuccess()) {
-            return tokenInfo.getToken();
+            return tokenInfo.getAuthenticationValue();
         } else {
             throw new ApiException(ErrorEnum.ERR_IM_TOKEN_ERROR, tokenInfo.getErrorMessage());
         }

+ 16 - 6
mec-web/src/main/java/com/ym/mec/web/controller/GoodsCategoryController.java

@@ -1,16 +1,26 @@
 package com.ym.mec.web.controller;
 
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+
+import java.util.Date;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.web.dal.entity.GoodsCategory;
 import com.ym.mec.web.dal.page.GoodsCategoryQueryInfo;
-import com.ym.mec.web.dal.page.GoodsQueryInfo;
 import com.ym.mec.web.service.GoodsCategoryService;
 import com.ym.mec.web.service.GoodsService;
-import io.swagger.annotations.*;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.Date;
 
 @RequestMapping("category")
 @Api(tags = "商品分类服务")

+ 19 - 10
mec-web/src/main/java/com/ym/mec/web/controller/GoodsController.java

@@ -1,19 +1,28 @@
 package com.ym.mec.web.controller;
 
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+
+import java.util.Date;
+import java.util.HashMap;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.web.dal.entity.Goods;
-import com.ym.mec.web.dal.entity.Subject;
 import com.ym.mec.web.dal.page.GoodsQueryInfo;
-import com.ym.mec.web.dal.page.SubjectQueryInfo;
 import com.ym.mec.web.service.GoodsService;
-import com.ym.mec.web.service.SubjectService;
-import io.swagger.annotations.*;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.util.Date;
-import java.util.HashMap;
 
 @RequestMapping("goods")
 @Api(tags = "商品(教材、辅件)服务")

+ 16 - 10
mec-web/src/main/java/com/ym/mec/web/controller/TeacherController.java

@@ -1,21 +1,27 @@
 package com.ym.mec.web.controller;
 
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+
+import java.util.Date;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
 import com.ym.mec.common.controller.BaseController;
-import com.ym.mec.common.security.AuthUser;
 import com.ym.mec.common.security.SecurityUtils;
-import com.ym.mec.web.dal.entity.ClassGroup;
 import com.ym.mec.web.dal.entity.Teacher;
 import com.ym.mec.web.dal.page.TeacherQueryInfo;
 import com.ym.mec.web.service.ClassGroupService;
 import com.ym.mec.web.service.TeacherService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.Date;
-import java.util.List;
 
 @RequestMapping("teacher")
 @Api(tags = "教师服务")

+ 3 - 5
mec-web/src/main/java/com/ym/mec/web/dal/dao/ClassGroupDao.java

@@ -1,12 +1,10 @@
 package com.ym.mec.web.dal.dao;
-import java.util.Date;
-import com.ym.mec.web.dal.enums.ClassGroupTypeEnum;
+import java.util.List;
 
-import com.ym.mec.common.dal.BaseDAO;
-import com.ym.mec.web.dal.entity.ClassGroup;
 import org.apache.ibatis.annotations.Param;
 
-import java.util.List;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.web.dal.entity.ClassGroup;
 
 public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
 

+ 0 - 2
mec-web/src/main/java/com/ym/mec/web/dal/dao/MusicGroupPaymentEntitiesDao.java

@@ -3,7 +3,5 @@ package com.ym.mec.web.dal.dao;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.web.dal.entity.MusicGroupPaymentEntities;
 
-import java.util.List;
-
 public interface MusicGroupPaymentEntitiesDao extends BaseDAO<Integer, MusicGroupPaymentEntities> {
 }

+ 4 - 4
mec-web/src/main/java/com/ym/mec/web/dal/dao/OrganizationDao.java

@@ -1,11 +1,11 @@
 package com.ym.mec.web.dal.dao;
 
-import com.ym.mec.common.dal.BaseDAO;
-import com.ym.mec.web.dal.entity.Organization;
-import com.ym.mec.web.dal.page.OrganizationQueryInfo;
+import java.util.List;
+
 import org.apache.ibatis.annotations.Param;
 
-import java.util.List;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.web.dal.entity.Organization;
 
 public interface OrganizationDao extends BaseDAO<Integer, Organization> {
 

+ 10 - 3
mec-web/src/main/java/com/ym/mec/web/dal/dto/StudentAttendancePageInfo.java

@@ -1,15 +1,22 @@
-package com.ym.mec.web.dal.utilEntity;
+package com.ym.mec.web.dal.dto;
 
 import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.web.dal.entity.StudentAttendance;
+
 import io.swagger.annotations.ApiModelProperty;
 
 /**
  * @Author Joburgess
  * @Date 2019/9/12
  */
-public class StudentAttendancePageInfo extends PageInfo {
+public class StudentAttendancePageInfo extends PageInfo<StudentAttendance> {
 
-    @ApiModelProperty(value = "请假人数",required = false)
+    /**
+	 * 
+	 */
+	private static final long serialVersionUID = 2758558285813409262L;
+	
+	@ApiModelProperty(value = "请假人数",required = false)
     private Integer numberOfLeavePeoples;
 
     public Integer getNumberOfLeavePeoples() {

+ 2 - 3
mec-web/src/main/java/com/ym/mec/web/service/OrganizationService.java

@@ -1,12 +1,11 @@
 package com.ym.mec.web.service;
 
+import org.apache.ibatis.annotations.Param;
+
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
 import com.ym.mec.web.dal.entity.Organization;
 import com.ym.mec.web.dal.page.OrganizationQueryInfo;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
 
 public interface OrganizationService extends BaseService<Integer, Organization> {
 

+ 0 - 1
mec-web/src/main/java/com/ym/mec/web/service/TeacherService.java

@@ -2,7 +2,6 @@ package com.ym.mec.web.service;
 
 import com.ym.mec.common.service.BaseService;
 import com.ym.mec.web.dal.entity.Teacher;
-import org.apache.ibatis.annotations.Param;
 
 public interface TeacherService extends BaseService<Integer, Teacher> {
 

+ 4 - 5
mec-web/src/main/java/com/ym/mec/web/service/impl/MusicGroupPaymentEntitiesServiceImpl.java

@@ -1,18 +1,17 @@
 package com.ym.mec.web.service.impl;
 
+import java.util.Date;
+import java.util.List;
+
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.web.dal.dao.MusicGroupPaymentEntitiesDao;
 import com.ym.mec.web.dal.entity.MusicGroupPaymentEntities;
 import com.ym.mec.web.service.MusicGroupPaymentEntitiesService;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.Date;
-import java.util.List;
 
 @Service
 public class MusicGroupPaymentEntitiesServiceImpl extends BaseServiceImpl<Integer, MusicGroupPaymentEntities>  implements MusicGroupPaymentEntitiesService {

+ 5 - 6
mec-web/src/main/java/com/ym/mec/web/service/impl/OrganizationServiceImpl.java

@@ -1,18 +1,17 @@
 package com.ym.mec.web.service.impl;
 
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.page.PageInfo;
-import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.web.dal.dao.OrganizationDao;
 import com.ym.mec.web.dal.entity.Organization;
 import com.ym.mec.web.dal.page.OrganizationQueryInfo;
 import com.ym.mec.web.service.OrganizationService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.HashMap;
-import java.util.List;
 
 @Service
 public class OrganizationServiceImpl extends BaseServiceImpl<Integer, Organization> implements OrganizationService {

+ 17 - 14
mec-web/src/main/java/com/ym/mec/web/service/impl/StudentAttendanceServiceImpl.java

@@ -1,24 +1,25 @@
 package com.ym.mec.web.service.impl;
 
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.web.dal.dao.StudentAttendanceDao;
+import com.ym.mec.web.dal.dto.StudentAttendancePageInfo;
 import com.ym.mec.web.dal.dto.StudentStatusCountUtilEntity;
 import com.ym.mec.web.dal.entity.StudentAttendance;
 import com.ym.mec.web.dal.enums.StudentAttendanceStatusEnum;
 import com.ym.mec.web.dal.page.StudentAttendanceQueryInfo;
-import com.ym.mec.web.dal.utilEntity.StudentAttendancePageInfo;
 import com.ym.mec.web.service.StudentAttendanceService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
 
 @Service
-public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentAttendance>  implements StudentAttendanceService {
-	
+public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentAttendance> implements StudentAttendanceService {
+
 	@Autowired
 	private StudentAttendanceDao studentAttendanceDao;
 
@@ -30,7 +31,7 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 	@Override
 	public void addStudentAttendances(List<StudentAttendance> studentAttendances) {
 		studentAttendances.forEach(studentAttendance -> {
-			if(studentAttendance.getStatus()!= StudentAttendanceStatusEnum.DROP_OUT){
+			if (studentAttendance.getStatus() != StudentAttendanceStatusEnum.DROP_OUT) {
 				studentAttendanceDao.insert(studentAttendanceDao.getStudentAttendanceInfo(studentAttendance));
 			}
 		});
@@ -38,7 +39,7 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 
 	@Override
 	public StudentAttendancePageInfo queryPage(QueryInfo queryInfo) {
-		PageInfo pageInfo = super.queryPage(queryInfo);
+		PageInfo<StudentAttendance> pageInfo = super.queryPage(queryInfo);
 		StudentAttendancePageInfo studentAttendancePageInfo = new StudentAttendancePageInfo();
 
 		studentAttendancePageInfo.setPageNo(pageInfo.getPageNo());
@@ -50,11 +51,13 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 
 		List<StudentStatusCountUtilEntity> stringIntegerMap = studentAttendanceDao.countStudentStatus(((StudentAttendanceQueryInfo) queryInfo).getClassId());
 
-		stringIntegerMap.forEach(studentStatusCount->{
-			switch (studentStatusCount.getStudentStatus()){
-				case LEAVE:
-					studentAttendancePageInfo.setNumberOfLeavePeoples(studentStatusCount.getNumberOfStudent());
-					break;
+		stringIntegerMap.forEach(studentStatusCount -> {
+			switch (studentStatusCount.getStudentStatus()) {
+			case LEAVE:
+				studentAttendancePageInfo.setNumberOfLeavePeoples(studentStatusCount.getNumberOfStudent());
+				break;
+			default:
+				break;
 
 			}
 		});