|
@@ -14,6 +14,8 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import com.ssj.bean.conch.conch.domain.ConchDerver;
|
|
|
+import com.ssj.bean.sys.imlibuser.TbClass;
|
|
|
+import com.ssj.bean.sys.imlibuser.TbClassStudent;
|
|
|
import com.ssj.bean.sys.imlibuser.TbClassStudentTemp;
|
|
|
import com.ssj.bean.weixin.libmy.domain.LibVip;
|
|
|
import com.ssj.bean.weixin.libmy.domain.TbLibJoin;
|
|
@@ -31,7 +33,7 @@ import com.ssj.framework.idworker.IdWorker;
|
|
|
import com.ssj.service.conch.common.service.ConchCommonService;
|
|
|
import com.ssj.service.conch.conch.service.ConchDerverService;
|
|
|
import com.ssj.service.sys.easemob.service.EasemobService;
|
|
|
-import com.ssj.service.sys.fx.service.MerchantService;
|
|
|
+import com.ssj.service.sys.imlibuser.service.TbClassService;
|
|
|
import com.ssj.service.sys.imlibuser.service.TbClassStudentService;
|
|
|
import com.ssj.service.sys.imlibuser.service.TbClassStudentTempService;
|
|
|
import com.ssj.service.weixin.library.service.ILibJoinService;
|
|
@@ -83,6 +85,12 @@ public class TbClassStudentTempServiceImpl extends BaseServiceImpl<TbClassStuden
|
|
|
@Autowired
|
|
|
private ILibVipService libVipService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TbClassService tbClassService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private TbClassStudentService tbClassStudentService;
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public PagingAndSortingRepository<TbClassStudentTemp, String> getDao() {
|
|
@@ -282,18 +290,27 @@ public class TbClassStudentTempServiceImpl extends BaseServiceImpl<TbClassStuden
|
|
|
}
|
|
|
|
|
|
|
|
|
-// TbClass tbClass=tbClassService.getDefaultTbClassByLibId(libJoin.getId());
|
|
|
+ TbClass tbClass=tbClassService.getTbClassGradeByLibId(tbLibImStudentTemp.getLibId(),tbLibImStudentTemp.getGrade(), tbLibImStudentTemp.getClassName());
|
|
|
+ if(tbClass==null) {
|
|
|
+ tbClass=new TbClass();
|
|
|
+ tbClass.setLibId(tbLibImStudentTemp.getLibId());
|
|
|
+ tbClass.setClassName(tbLibImStudentTemp.getClassName());
|
|
|
+ tbClass.setGrade(tbLibImStudentTemp.getGrade());
|
|
|
+ tbClass.setCreateTime(new Date());
|
|
|
+ tbClass.setStatus(1);
|
|
|
+ tbClass=tbClassService.save(tbClass);
|
|
|
+ }
|
|
|
|
|
|
-// TbClassStudent tbClassStudent=tbClassStudentService.getTbClassTeacherByVipId(tbClass.getId(), libVip.getId());
|
|
|
-// if(tbClassStudent==null) {
|
|
|
-// tbClassStudent=new TbClassStudent();
|
|
|
-// tbClassStudent.setLibId(libJoin.getId());
|
|
|
-// tbClassStudent.setClassId(tbClass.getId());
|
|
|
-// tbClassStudent.setVipId(libVip.getId());
|
|
|
-// tbClassStudent.setStatus(1);
|
|
|
-// tbClassStudent.setCreateTime(new Date());
|
|
|
-// tbClassStudentService.save(tbClassStudent);
|
|
|
-// }
|
|
|
+ TbClassStudent tbClassStudent=tbClassStudentService.getTbClassTeacherByVipId(tbClass.getId(), libVip.getId());
|
|
|
+ if(tbClassStudent==null) {
|
|
|
+ tbClassStudent=new TbClassStudent();
|
|
|
+ tbClassStudent.setLibId(libJoin.getId());
|
|
|
+ tbClassStudent.setClassId(tbClass.getId());
|
|
|
+ tbClassStudent.setVipId(libVip.getId());
|
|
|
+ tbClassStudent.setStatus(1);
|
|
|
+ tbClassStudent.setCreateTime(new Date());
|
|
|
+ tbClassStudentService.save(tbClassStudent);
|
|
|
+ }
|
|
|
|
|
|
//给学生增加一个默认的永久校区批改服务
|
|
|
libVipServiceService.insertLibServiceByType(libVip.getId(), libJoin.getId(), libJoin.getEndSignTime(), libJoin.getSignType());
|