|  | @@ -16,6 +16,7 @@ import com.ym.mec.util.date.DateUtil;
 | 
											
												
													
														|  |  import org.springframework.beans.factory.annotation.Autowired;
 |  |  import org.springframework.beans.factory.annotation.Autowired;
 | 
											
												
													
														|  |  import org.springframework.stereotype.Service;
 |  |  import org.springframework.stereotype.Service;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +import java.text.SimpleDateFormat;
 | 
											
												
													
														|  |  import java.util.*;
 |  |  import java.util.*;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  @Service
 |  |  @Service
 | 
											
										
											
												
													
														|  | @@ -41,7 +42,13 @@ public class StudentPreVisitServiceImpl extends BaseServiceImpl<Integer, Student
 | 
											
												
													
														|  |  			studentPreVisit.setTeacherId(student4operating.getTeacherId());
 |  |  			studentPreVisit.setTeacherId(student4operating.getTeacherId());
 | 
											
												
													
														|  |  			studentPreVisit.setTeacherName(student4operating.getTeacherName());
 |  |  			studentPreVisit.setTeacherName(student4operating.getTeacherName());
 | 
											
												
													
														|  |  			studentPreVisit.setOrgname(student4operating.getOrganName());
 |  |  			studentPreVisit.setOrgname(student4operating.getOrganName());
 | 
											
												
													
														|  | -			studentPreVisit.setVisitCycle(DateUtil.format(new Date(),"yyyy-MM"));
 |  | 
 | 
											
												
													
														|  | 
 |  | +			SimpleDateFormat sf=new SimpleDateFormat("yyyy-MM");
 | 
											
												
													
														|  | 
 |  | +			GregorianCalendar gc=new GregorianCalendar();
 | 
											
												
													
														|  | 
 |  | +			gc.setTime(new Date());
 | 
											
												
													
														|  | 
 |  | +			gc.add(2,-1);
 | 
											
												
													
														|  | 
 |  | +			String format = sf.format(gc.getTime());
 | 
											
												
													
														|  | 
 |  | +			//这里月份进行了减一,因为生成的上月的数据
 | 
											
												
													
														|  | 
 |  | +			studentPreVisit.setVisitCycle(format);
 | 
											
												
													
														|  |  			studentPreVisit.setIsVisit(0);
 |  |  			studentPreVisit.setIsVisit(0);
 | 
											
												
													
														|  |  			studentPreVisits.add(studentPreVisit);
 |  |  			studentPreVisits.add(studentPreVisit);
 | 
											
												
													
														|  |  		}
 |  |  		}
 |