|
@@ -2,17 +2,21 @@ package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
import com.ym.mec.biz.dal.dao.StudentPreVisitDao;
|
|
|
import com.ym.mec.biz.dal.dto.Student4operating;
|
|
|
+import com.ym.mec.biz.dal.dto.StudentPreVisitDto;
|
|
|
+import com.ym.mec.biz.dal.dto.StudentVisitDto;
|
|
|
import com.ym.mec.biz.dal.entity.StudentPreVisit;
|
|
|
+import com.ym.mec.biz.dal.page.StudentPreVisitQueryInfo;
|
|
|
+import com.ym.mec.biz.dal.page.StudentVisitQueryInfo;
|
|
|
import com.ym.mec.biz.service.StudentPreVisitService;
|
|
|
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.collection.MapUtil;
|
|
|
import com.ym.mec.util.date.DateUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
+import java.util.*;
|
|
|
|
|
|
@Service
|
|
|
public class StudentPreVisitServiceImpl extends BaseServiceImpl<Integer, StudentPreVisit> implements StudentPreVisitService {
|
|
@@ -37,10 +41,31 @@ public class StudentPreVisitServiceImpl extends BaseServiceImpl<Integer, Student
|
|
|
studentPreVisit.setTeacherId(Integer.parseInt(student4operating.getTeacherId()));
|
|
|
studentPreVisit.setTeacherName(student4operating.getTeacherName());
|
|
|
studentPreVisit.setOrgname(student4operating.getOrganName());
|
|
|
- studentPreVisit.setVisitCycle(DateUtil.format(new Date(),"yyyy-MM").toString());
|
|
|
+ studentPreVisit.setVisitCycle(DateUtil.format(new Date(),"yyyy-MM"));
|
|
|
studentPreVisit.setIsVisit(0);
|
|
|
studentPreVisits.add(studentPreVisit);
|
|
|
}
|
|
|
return studentPreVisitDao.batchInsert(studentPreVisits);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public PageInfo<StudentPreVisitDto> getPageList(StudentPreVisitQueryInfo queryInfo) {
|
|
|
+
|
|
|
+ PageInfo<StudentPreVisitDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
|
+ Map<String, Object> params = new HashMap<String, Object>();
|
|
|
+ MapUtil.populateMap(params, queryInfo);
|
|
|
+
|
|
|
+ List<StudentPreVisitDto> dataList = new ArrayList<>();
|
|
|
+ int count = this.findCount(params);
|
|
|
+ if (count > 0) {
|
|
|
+ pageInfo.setTotal(count);
|
|
|
+ params.put("offset", pageInfo.getOffset());
|
|
|
+ dataList = studentPreVisitDao.getPageList(params);
|
|
|
+ }
|
|
|
+ pageInfo.setRows(dataList);
|
|
|
+ return pageInfo;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|