Bläddra i källkod

上课签到部分处理逻辑调整

Joburgess 5 år sedan
förälder
incheckning
8b8fa7f3be

+ 1 - 0
.gitignore

@@ -9,3 +9,4 @@ bin
 /manage-center/src/main/resources/config/properties/generatorConfig.xml
 /p2p-utils/.gitignore
 .idea
+*.iml

+ 29 - 0
mec-web/src/main/java/com/ym/mec/web/dal/dto/StudentAttendancePageInfo.java

@@ -0,0 +1,29 @@
+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<StudentAttendance> {
+
+    /**
+	 * 
+	 */
+	private static final long serialVersionUID = 2758558285813409262L;
+	
+	@ApiModelProperty(value = "请假人数",required = false)
+    private Integer numberOfLeavePeoples;
+
+    public Integer getNumberOfLeavePeoples() {
+        return numberOfLeavePeoples;
+    }
+
+    public void setNumberOfLeavePeoples(Integer numberOfLeavePeoples) {
+        this.numberOfLeavePeoples = numberOfLeavePeoples;
+    }
+}

+ 11 - 5
mec-web/src/main/java/com/ym/mec/web/service/impl/StudentAttendanceServiceImpl.java

@@ -1,15 +1,20 @@
 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;
@@ -32,16 +37,17 @@ 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));
 			}
 		});
 	}
 
 	@Override
-	public StudentAttendancePageInfo queryPage(QueryInfo queryInfo) {
+	public Map<String, Object> getCurrentCourseStudents(QueryInfo queryInfo) {
+		Map<String,Object> result=new HashMap<>();
+
 		PageInfo pageInfo = super.queryPage(queryInfo);
-		StudentAttendancePageInfo studentAttendancePageInfo = new StudentAttendancePageInfo();
 
 		result.put("pageInfo",pageInfo);
 
@@ -50,7 +56,7 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 		stringIntegerMap.forEach(studentStatusCount->{
 			switch (studentStatusCount.getStudentStatus()){
 				case LEAVE:
-					studentAttendancePageInfo.setNumberOfLeavePeoples(studentStatusCount.getNumberOfStudent());
+					result.put("numberOfLeavePeoples",studentStatusCount.getNumberOfStudent());
 					break;
 
 			}