Commit 4129c868 authored by YangZhaoJun1's avatar YangZhaoJun1

去掉service中的token

parent bf986b9f
...@@ -59,12 +59,12 @@ public class BCarouselServiceImpl implements BCarouselService { ...@@ -59,12 +59,12 @@ public class BCarouselServiceImpl implements BCarouselService {
int line = 0; int line = 0;
if(!StringUtils.isEmpty(model.getBusinessId())){ if(!StringUtils.isEmpty(model.getBusinessId())){
BImage image = new BImage(); BImage image = new BImage();
UserUtil.setCurrentMergeOperation(image,token); UserUtil.setCurrentMergeOperation(image);
bImageRepository.updateTime(image); bImageRepository.updateTime(image);
UserUtil.setCurrentMergeOperation(model,token); UserUtil.setCurrentMergeOperation(model);
line = bCarouselRepository.updateCarouselById(model); line = bCarouselRepository.updateCarouselById(model);
}else{ }else{
UserUtil.setCurrentPersistOperation(model,token); UserUtil.setCurrentPersistOperation(model);
line = bCarouselRepository.insertSelective(model); line = bCarouselRepository.insertSelective(model);
} }
if(line!=1) if(line!=1)
...@@ -77,7 +77,7 @@ public class BCarouselServiceImpl implements BCarouselService { ...@@ -77,7 +77,7 @@ public class BCarouselServiceImpl implements BCarouselService {
public PersistModel removeBCarousel(String id, String token) { public PersistModel removeBCarousel(String id, String token) {
BCarousel bCarousel = bCarouselRepository.selectByPrimaryKey(id); BCarousel bCarousel = bCarouselRepository.selectByPrimaryKey(id);
bCarousel.setDelFlag(DelStatus.DELETED.getStatus()); bCarousel.setDelFlag(DelStatus.DELETED.getStatus());
UserUtil.setCurrentMergeOperation(bCarousel,token); UserUtil.setCurrentMergeOperation(bCarousel);
int line = bCarouselRepository.updateByPrimaryKeySelective(bCarousel); int line = bCarouselRepository.updateByPrimaryKeySelective(bCarousel);
return new PersistModel(line); return new PersistModel(line);
} }
......
...@@ -79,10 +79,10 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -79,10 +79,10 @@ public class BChapterServiceImpl implements BChapterService {
if(model.getBusinessId()==null) { if(model.getBusinessId()==null) {
if (bSlRepository.selectByPrimaryKey(model.getSlId()) == null) if (bSlRepository.selectByPrimaryKey(model.getSlId()) == null)
throw new ServiceException(ResultServiceEnums.SL_INFO_NOT_EXISTS); throw new ServiceException(ResultServiceEnums.SL_INFO_NOT_EXISTS);
UserUtil.setCurrentPersistOperation(model,token); UserUtil.setCurrentPersistOperation(model);
line = bChapterRepository.insertSelective(model); line = bChapterRepository.insertSelective(model);
}else }else
UserUtil.setCurrentMergeOperation(model,token); UserUtil.setCurrentMergeOperation(model);
line = bChapterRepository.updateByPrimaryKeySelective(model); line = bChapterRepository.updateByPrimaryKeySelective(model);
//FamilyLogger.sysInfo(UserUtils.getUser().getBusinessId(),UserUtils.getUser().getLoginName()+"新增了ID为"+user.getBusinessId()+"的用户"); //FamilyLogger.sysInfo(UserUtils.getUser().getBusinessId(),UserUtils.getUser().getLoginName()+"新增了ID为"+user.getBusinessId()+"的用户");
return new PersistModel(line); return new PersistModel(line);
...@@ -108,7 +108,7 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -108,7 +108,7 @@ public class BChapterServiceImpl implements BChapterService {
throw new ServiceException(ResultServiceEnums.CHAPTER_HAS_CHILD); throw new ServiceException(ResultServiceEnums.CHAPTER_HAS_CHILD);
bChapterRepository.deleteStudentChapter(id); bChapterRepository.deleteStudentChapter(id);
bChapterRepository.deleteByPrimaryKey(id); bChapterRepository.deleteByPrimaryKey(id);
UserUtil.setCurrentMergeOperation(bChapter,token); UserUtil.setCurrentMergeOperation(bChapter);
int line = bChapterRepository.updateByPrimaryKeySelective(bChapter); int line = bChapterRepository.updateByPrimaryKeySelective(bChapter);
return new PersistModel(line); return new PersistModel(line);
} }
...@@ -135,7 +135,7 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -135,7 +135,7 @@ public class BChapterServiceImpl implements BChapterService {
// bChapterRepository.insertScoreInfo(scoreInfoDTO); // bChapterRepository.insertScoreInfo(scoreInfoDTO);
}else{ //已经学习则修改 }else{ //已经学习则修改
scoreInfoDTO.setBusinessId(id); scoreInfoDTO.setBusinessId(id);
UserUtil.setCurrentMergeOperation(scoreInfoDTO,token); UserUtil.setCurrentMergeOperation(scoreInfoDTO);
bChapterRepository.updateScoreInfo(scoreInfoDTO); bChapterRepository.updateScoreInfo(scoreInfoDTO);
} }
} }
...@@ -162,7 +162,7 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -162,7 +162,7 @@ public class BChapterServiceImpl implements BChapterService {
if(bChapterRepository.selectIdByStudentIdAndChapterId(scoreInfoDTO.getChapterId(),scoreInfoDTO.getStudentId())!=null) if(bChapterRepository.selectIdByStudentIdAndChapterId(scoreInfoDTO.getChapterId(),scoreInfoDTO.getStudentId())!=null)
return; return;
scoreInfoDTO.setCommonBusinessId(); scoreInfoDTO.setCommonBusinessId();
UserUtil.setCurrentMergeOperation(scoreInfoDTO,token); UserUtil.setCurrentMergeOperation(scoreInfoDTO);
int result = bChapterRepository.updateIsComplete(scoreInfoDTO); int result = bChapterRepository.updateIsComplete(scoreInfoDTO);
if(result<1) if(result<1)
throw new ServiceException(ResultServiceEnums.UPDATE_ERROR); throw new ServiceException(ResultServiceEnums.UPDATE_ERROR);
......
...@@ -58,10 +58,10 @@ public class BClassServiceImpl implements BClassService { ...@@ -58,10 +58,10 @@ public class BClassServiceImpl implements BClassService {
if(model.getBusinessId()==null) { if(model.getBusinessId()==null) {
if (bClassRepository.selectOne(new BClass(model.getCode())) != null) if (bClassRepository.selectOne(new BClass(model.getCode())) != null)
throw new ServiceException(ResultServiceEnums.CLASS_EXISTS); throw new ServiceException(ResultServiceEnums.CLASS_EXISTS);
UserUtil.setCurrentPersistOperation(model,token); UserUtil.setCurrentPersistOperation(model);
line = bClassRepository.insertSelective(model); line = bClassRepository.insertSelective(model);
}else }else
UserUtil.setCurrentMergeOperation(model,token); UserUtil.setCurrentMergeOperation(model);
line = bClassRepository.updateByPrimaryKeySelective(model); line = bClassRepository.updateByPrimaryKeySelective(model);
//FamilyLogger.sysInfo(UserUtils.getUser().getBusinessId(),UserUtils.getUser().getLoginName()+"新增了ID为"+user.getBusinessId()+"的用户"); //FamilyLogger.sysInfo(UserUtils.getUser().getBusinessId(),UserUtils.getUser().getLoginName()+"新增了ID为"+user.getBusinessId()+"的用户");
return new PersistModel(line); return new PersistModel(line);
...@@ -98,7 +98,7 @@ public class BClassServiceImpl implements BClassService { ...@@ -98,7 +98,7 @@ public class BClassServiceImpl implements BClassService {
} }
bClass= new BClass(value[0],value[1]); bClass= new BClass(value[0],value[1]);
bClass.setCommonBusinessId(); bClass.setCommonBusinessId();
UserUtil.setCurrentPersistOperation(bClass,token); UserUtil.setCurrentPersistOperation(bClass);
if(!bClasses.contains(bClass)){ if(!bClasses.contains(bClass)){
bClasses.add(bClass); bClasses.add(bClass);
......
...@@ -10,7 +10,6 @@ import org.rcisoft.common.model.GridModel; ...@@ -10,7 +10,6 @@ import org.rcisoft.common.model.GridModel;
import org.rcisoft.core.constant.MessageConstant; import org.rcisoft.core.constant.MessageConstant;
import org.rcisoft.core.model.PersistModel; import org.rcisoft.core.model.PersistModel;
import org.rcisoft.core.result.Result; import org.rcisoft.core.result.Result;
import org.rcisoft.core.result.ResultCode;
import org.rcisoft.core.util.UserUtil; import org.rcisoft.core.util.UserUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
......
...@@ -52,12 +52,12 @@ public class BImageServiceImpl implements BImageService { ...@@ -52,12 +52,12 @@ public class BImageServiceImpl implements BImageService {
public PersistModel persist(BImage model,String token){ public PersistModel persist(BImage model,String token){
int line = 0; int line = 0;
if(StringUtils.isEmpty(model.getBusinessId())){ if(StringUtils.isEmpty(model.getBusinessId())){
UserUtil.setCurrentMergeOperation(model,token); UserUtil.setCurrentMergeOperation(model);
line = bImageRepository.updateByPrimaryKeySelective(model); line = bImageRepository.updateByPrimaryKeySelective(model);
}else { }else {
if(bImageRepository.selectOne(new BImage(model.getImageCode()))!=null) if(bImageRepository.selectOne(new BImage(model.getImageCode()))!=null)
throw new ServiceException(ResultServiceEnums.INSERT_DATA_EXIST); throw new ServiceException(ResultServiceEnums.INSERT_DATA_EXIST);
UserUtil.setCurrentPersistOperation(model,token); UserUtil.setCurrentPersistOperation(model);
line = bImageRepository.insertSelective(model); line = bImageRepository.insertSelective(model);
} }
...@@ -69,7 +69,7 @@ public class BImageServiceImpl implements BImageService { ...@@ -69,7 +69,7 @@ public class BImageServiceImpl implements BImageService {
public PersistModel removeBImage(String id, String token) { public PersistModel removeBImage(String id, String token) {
BImage bImage = bImageRepository.selectByPrimaryKey(id); BImage bImage = bImageRepository.selectByPrimaryKey(id);
bImage.setDelFlag(DelStatus.DELETED.getStatus()); bImage.setDelFlag(DelStatus.DELETED.getStatus());
UserUtil.setCurrentMergeOperation(bImage,token); UserUtil.setCurrentMergeOperation(bImage);
int line = bImageRepository.updateByPrimaryKeySelective(bImage); int line = bImageRepository.updateByPrimaryKeySelective(bImage);
return new PersistModel(line); return new PersistModel(line);
} }
......
...@@ -102,7 +102,7 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -102,7 +102,7 @@ public class BLessonController extends PaginationController<BLesson> {
BLesson bLesson=bLessonService.selectOne(bL); BLesson bLesson=bLessonService.selectOne(bL);
if(bLesson!=null){ if(bLesson!=null){
bLesson.setDefaultUrl(map.get(UploadUtil.URL).toString()); bLesson.setDefaultUrl(map.get(UploadUtil.URL).toString());
UserUtil.setCurrentMergeOperation(bLesson,getToken()); UserUtil.setCurrentMergeOperation(bLesson);
int line = bLessonService.updateByPrimaryKeySelective(bLesson); int line = bLessonService.updateByPrimaryKeySelective(bLesson);
return Result.builder(new PersistModel(line), return Result.builder(new PersistModel(line),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
...@@ -128,7 +128,7 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -128,7 +128,7 @@ public class BLessonController extends PaginationController<BLesson> {
BLesson bLesson=bLessonService.selectOne(bL); BLesson bLesson=bLessonService.selectOne(bL);
if(bLesson!=null){ if(bLesson!=null){
bLesson.setDefaultUrl(path); bLesson.setDefaultUrl(path);
UserUtil.setCurrentMergeOperation(bLesson,getToken()); UserUtil.setCurrentMergeOperation(bLesson);
int line =bLessonService.updateByPrimaryKeySelective(bLesson); int line =bLessonService.updateByPrimaryKeySelective(bLesson);
return Result.builder(new PersistModel(line), return Result.builder(new PersistModel(line),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
......
...@@ -75,10 +75,10 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -75,10 +75,10 @@ public class BLessonServiceImpl implements BLessonService {
throw new ServiceException(ResultServiceEnums.INSERT_DATA_EXIST); throw new ServiceException(ResultServiceEnums.INSERT_DATA_EXIST);
model.setCommonBusinessId(); model.setCommonBusinessId();
model.setDefaultUrl(global.getDEFAULT_COURSE_LOCATION()); model.setDefaultUrl(global.getDEFAULT_COURSE_LOCATION());
UserUtil.setCurrentPersistOperation(model,token); UserUtil.setCurrentPersistOperation(model);
line = bLessonRepository.insertSelective(model); line = bLessonRepository.insertSelective(model);
}else }else
UserUtil.setCurrentMergeOperation(model,token); UserUtil.setCurrentMergeOperation(model);
line = bLessonRepository.updateByPrimaryKeySelective(model); line = bLessonRepository.updateByPrimaryKeySelective(model);
//FamilyLogger.sysInfo(UserUtils.getUser().getBusinessId(),UserUtils.getUser().getLoginName()+"新增了ID为"+user.getBusinessId()+"的用户"); //FamilyLogger.sysInfo(UserUtils.getUser().getBusinessId(),UserUtils.getUser().getLoginName()+"新增了ID为"+user.getBusinessId()+"的用户");
return new PersistModel(line); return new PersistModel(line);
...@@ -116,7 +116,7 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -116,7 +116,7 @@ public class BLessonServiceImpl implements BLessonService {
} }
bLesson= new BLesson(value[0],value[1]); bLesson= new BLesson(value[0],value[1]);
bLesson.setDefaultUrl(global.getDEFAULT_COURSE_LOCATION()); bLesson.setDefaultUrl(global.getDEFAULT_COURSE_LOCATION());
UserUtil.setCurrentPersistOperation(bLesson,token); UserUtil.setCurrentPersistOperation(bLesson);
if(!lessons.contains(bLesson)){ if(!lessons.contains(bLesson)){
lessons.add(bLesson); lessons.add(bLesson);
......
...@@ -58,12 +58,12 @@ public class BNewsServiceImpl implements BNewsService { ...@@ -58,12 +58,12 @@ public class BNewsServiceImpl implements BNewsService {
if(model.getBusinessId()!=null&&model.getBusinessId()!=""&&!model.getBusinessId().equals("")){ if(model.getBusinessId()!=null&&model.getBusinessId()!=""&&!model.getBusinessId().equals("")){
if(!StringUtils.isEmpty(model.getIsRelease())&&model.getIsRelease().equals(ReleaseEnum.RELEASE.getCode())) //如果修改发布状态为发布, if(!StringUtils.isEmpty(model.getIsRelease())&&model.getIsRelease().equals(ReleaseEnum.RELEASE.getCode())) //如果修改发布状态为发布,
model.setReleaseTime(new Date()); // 则添加发布时间 model.setReleaseTime(new Date()); // 则添加发布时间
UserUtil.setCurrentMergeOperation(model,token); UserUtil.setCurrentMergeOperation(model);
line = bNewsRepository.updateByPrimaryKeySelective(model); line = bNewsRepository.updateByPrimaryKeySelective(model);
} }
else { else {
model.autoSetApplyCode(); model.autoSetApplyCode();
UserUtil.setCurrentPersistOperation(model,token); UserUtil.setCurrentPersistOperation(model);
line = bNewsRepository.insertSelective(model); line = bNewsRepository.insertSelective(model);
} }
if(line!=1) if(line!=1)
...@@ -78,7 +78,7 @@ public class BNewsServiceImpl implements BNewsService { ...@@ -78,7 +78,7 @@ public class BNewsServiceImpl implements BNewsService {
if(bNews==null) if(bNews==null)
throw new ServiceException(ResultServiceEnums.NEWS_NOT_EXISTS); throw new ServiceException(ResultServiceEnums.NEWS_NOT_EXISTS);
bNews.setDelFlag(DelStatus.DELETED.getStatus()); bNews.setDelFlag(DelStatus.DELETED.getStatus());
UserUtil.setCurrentMergeOperation(bNews,token); UserUtil.setCurrentMergeOperation(bNews);
int line = bNewsRepository.updateByPrimaryKeySelective(bNews); int line = bNewsRepository.updateByPrimaryKeySelective(bNews);
return new PersistModel(line); return new PersistModel(line);
} }
......
...@@ -90,7 +90,7 @@ public class BSlServiceImpl implements BSlService { ...@@ -90,7 +90,7 @@ public class BSlServiceImpl implements BSlService {
if(isRecommend&&!isOnline) if(isRecommend&&!isOnline)
throw new ServiceException(ResultServiceEnums.SL_NOT_ONLINE); throw new ServiceException(ResultServiceEnums.SL_NOT_ONLINE);
UserUtil.setCurrentMergeOperation(model,token); UserUtil.setCurrentMergeOperation(model);
line = bSlRepository.updateByPrimaryKeySelective(model); line = bSlRepository.updateByPrimaryKeySelective(model);
} }
else { else {
...@@ -113,7 +113,7 @@ public class BSlServiceImpl implements BSlService { ...@@ -113,7 +113,7 @@ public class BSlServiceImpl implements BSlService {
model.setGitLabProjectId(project.getId());*/ model.setGitLabProjectId(project.getId());*/
String pName = global.getGIT_LAB_PROJECT_PREFIX()+model.getCode(); String pName = global.getGIT_LAB_PROJECT_PREFIX()+model.getCode();
model.setGitLabProjectName(pName); model.setGitLabProjectName(pName);
UserUtil.setCurrentPersistOperation(model,token); UserUtil.setCurrentPersistOperation(model);
line = bSlRepository.insertSelective(model); line = bSlRepository.insertSelective(model);
} }
//FamilyLogger.sysInfo(UserUtils.getUser().getBusinessId(),UserUtils.getUser().getLoginName()+"新增了ID为"+user.getBusinessId()+"的用户"); //FamilyLogger.sysInfo(UserUtils.getUser().getBusinessId(),UserUtils.getUser().getLoginName()+"新增了ID为"+user.getBusinessId()+"的用户");
...@@ -178,7 +178,7 @@ public class BSlServiceImpl implements BSlService { ...@@ -178,7 +178,7 @@ public class BSlServiceImpl implements BSlService {
//2 封装BSL //2 封装BSL
bSl = new BSl(value[0], value[1], value[2], value[3]); bSl = new BSl(value[0], value[1], value[2], value[3]);
bSl.setSlCoverUrl(bLessonRepository.queryBLessonByCode(value[1]).getDefaultUrl()); bSl.setSlCoverUrl(bLessonRepository.queryBLessonByCode(value[1]).getDefaultUrl());
UserUtil.setCurrentPersistOperation(bSl,token); UserUtil.setCurrentPersistOperation(bSl);
//3. 封装git lab //3. 封装git lab
/*User user = userRepository.selectOne(new User(value[2])); /*User user = userRepository.selectOne(new User(value[2]));
...@@ -262,7 +262,7 @@ public class BSlServiceImpl implements BSlService { ...@@ -262,7 +262,7 @@ public class BSlServiceImpl implements BSlService {
one.setIsOnline(BSlEnum.UN_START.getCode()); one.setIsOnline(BSlEnum.UN_START.getCode());
else else
one.setIsOnline(BSlEnum.START.getCode()); one.setIsOnline(BSlEnum.START.getCode());
UserUtil.setCurrentMergeOperation(one,token); UserUtil.setCurrentMergeOperation(one);
int result = bSlRepository.updateByPrimaryKeySelective(one); int result = bSlRepository.updateByPrimaryKeySelective(one);
return new PersistModel(result); return new PersistModel(result);
} }
...@@ -270,7 +270,7 @@ public class BSlServiceImpl implements BSlService { ...@@ -270,7 +270,7 @@ public class BSlServiceImpl implements BSlService {
@Override @Override
@Transactional(propagation = Propagation.REQUIRED,readOnly = false) @Transactional(propagation = Propagation.REQUIRED,readOnly = false)
public PersistModel updateBSlByPrimaryKey(BSl bSl, String token) { public PersistModel updateBSlByPrimaryKey(BSl bSl, String token) {
UserUtil.setCurrentMergeOperation(bSl,token); UserUtil.setCurrentMergeOperation(bSl);
int line = bSlRepository.updateByPrimaryKeySelective(bSl); int line = bSlRepository.updateByPrimaryKeySelective(bSl);
return new PersistModel(line); return new PersistModel(line);
} }
......
...@@ -85,11 +85,11 @@ public class BSlApplyServiceImpl implements BSlApplyService { ...@@ -85,11 +85,11 @@ public class BSlApplyServiceImpl implements BSlApplyService {
if(model.getTeacherCode()!=null&&bTeacherRepository.selectOne(new BTeacher(model.getTeacherCode()))==null) if(model.getTeacherCode()!=null&&bTeacherRepository.selectOne(new BTeacher(model.getTeacherCode()))==null)
throw new ServiceException(ResultServiceEnums.TEACHER_NOT_EXISTS); throw new ServiceException(ResultServiceEnums.TEACHER_NOT_EXISTS);
if(model.getBusinessId()!=null) { if(model.getBusinessId()!=null) {
UserUtil.setCurrentMergeOperation(model, token); UserUtil.setCurrentMergeOperation(model);
line = bSlApplyRepository.updateByPrimaryKeySelective(model); line = bSlApplyRepository.updateByPrimaryKeySelective(model);
}else { }else {
model.autoSetApplyCode(); model.autoSetApplyCode();
UserUtil.setCurrentPersistOperation(model,token); UserUtil.setCurrentPersistOperation(model);
line = bSlApplyRepository.insertSelective(model); line = bSlApplyRepository.insertSelective(model);
} }
return new PersistModel(line); return new PersistModel(line);
...@@ -100,7 +100,7 @@ public class BSlApplyServiceImpl implements BSlApplyService { ...@@ -100,7 +100,7 @@ public class BSlApplyServiceImpl implements BSlApplyService {
public PersistModel removeBSlApply(String id, String token) { public PersistModel removeBSlApply(String id, String token) {
BSlApply bSlApply = bSlApplyRepository.selectByPrimaryKey(id); BSlApply bSlApply = bSlApplyRepository.selectByPrimaryKey(id);
bSlApply.setDelFlag(DelStatus.DELETED.getStatus()); bSlApply.setDelFlag(DelStatus.DELETED.getStatus());
UserUtil.setCurrentMergeOperation(bSlApply,token); UserUtil.setCurrentMergeOperation(bSlApply);
int line = bSlApplyRepository.updateByPrimaryKeySelective(bSlApply); int line = bSlApplyRepository.updateByPrimaryKeySelective(bSlApply);
return new PersistModel(line); return new PersistModel(line);
} }
...@@ -117,7 +117,7 @@ public class BSlApplyServiceImpl implements BSlApplyService { ...@@ -117,7 +117,7 @@ public class BSlApplyServiceImpl implements BSlApplyService {
if(bSlApply==null) if(bSlApply==null)
throw new ServiceException(ResultServiceEnums.SL_APPLY_NOT_EXISTS); throw new ServiceException(ResultServiceEnums.SL_APPLY_NOT_EXISTS);
bSlApply.setApplyState(ApplyStatuEnum.PROCESS.getCode()); bSlApply.setApplyState(ApplyStatuEnum.PROCESS.getCode());
UserUtil.setCurrentMergeOperation(bSlApply,token); UserUtil.setCurrentMergeOperation(bSlApply);
int l1 = bSlApplyRepository.updateByPrimaryKeySelective(bSlApply); int l1 = bSlApplyRepository.updateByPrimaryKeySelective(bSlApply);
//2.添加课程信息 //2.添加课程信息
......
...@@ -97,7 +97,7 @@ public class BStudentServiceImpl implements BStudentService { ...@@ -97,7 +97,7 @@ public class BStudentServiceImpl implements BStudentService {
userService.persistUser(user);*/ userService.persistUser(user);*/
//2.添加学生 //2.添加学生
UserUtil.setCurrentPersistOperation(model,token); UserUtil.setCurrentPersistOperation(model);
line = bStudentRepository.insertSelective(model); line = bStudentRepository.insertSelective(model);
//3.添加权限 //3.添加权限
...@@ -111,7 +111,7 @@ public class BStudentServiceImpl implements BStudentService { ...@@ -111,7 +111,7 @@ public class BStudentServiceImpl implements BStudentService {
/*String uid = userRepository.selectUserIdByStuOrTeaId(model.getBusinessId(), "b_student"); /*String uid = userRepository.selectUserIdByStuOrTeaId(model.getBusinessId(), "b_student");
if (uid == null) if (uid == null)
throw new ServiceException(ResultServiceEnums.STUDENT_NOT_EXISTS); throw new ServiceException(ResultServiceEnums.STUDENT_NOT_EXISTS);
UserUtil.setCurrentMergeOperation(model,token);*/ UserUtil.setCurrentMergeOperation(model);*/
line = bStudentRepository.updateByPrimaryKeySelective(model); line = bStudentRepository.updateByPrimaryKeySelective(model);
/*userService.updateUser(user,uid,line);*/ /*userService.updateUser(user,uid,line);*/
} }
...@@ -180,7 +180,7 @@ public class BStudentServiceImpl implements BStudentService { ...@@ -180,7 +180,7 @@ public class BStudentServiceImpl implements BStudentService {
User user = new User(value[0], UserConstant.INITIAL_PASSWORD, value[1], value[2]); //学号,密码,姓名,性别; User user = new User(value[0], UserConstant.INITIAL_PASSWORD, value[1], value[2]); //学号,密码,姓名,性别;
user.setEmail(value[3]); user.setEmail(value[3]);
user.setCommonBusinessId(); user.setCommonBusinessId();
UserUtil.setCurrentPersistOperation(user,token); UserUtil.setCurrentPersistOperation(user);
//2 创建gitlab账户 //2 创建gitlab账户
GitUser gitUser = new GitUser(); GitUser gitUser = new GitUser();
gitUser.setUsername(global.getGIT_LAB_STU_PREFIX()+value[0]); gitUser.setUsername(global.getGIT_LAB_STU_PREFIX()+value[0]);
...@@ -200,7 +200,7 @@ public class BStudentServiceImpl implements BStudentService { ...@@ -200,7 +200,7 @@ public class BStudentServiceImpl implements BStudentService {
//创建完Gitlab账户后,将完整的User信息和UserRole计入users和userRoles中等待插入数据库 //创建完Gitlab账户后,将完整的User信息和UserRole计入users和userRoles中等待插入数据库
/*BStudent bStudent = new BStudent(value[0]); /*BStudent bStudent = new BStudent(value[0]);
UserUtil.setCurrentPersistOperation(bStudent,token); UserUtil.setCurrentPersistOperation(bStudent);
if (!students.contains(bStudent)) { if (!students.contains(bStudent)) {
students.add(bStudent); students.add(bStudent);
users.add(user); users.add(user);
......
...@@ -149,7 +149,7 @@ public class BTeacherServiceImpl implements BTeacherService { ...@@ -149,7 +149,7 @@ public class BTeacherServiceImpl implements BTeacherService {
//创建完Gitlab账户后,将完整的User信息和UserRole计入users和userRoles中等待插入数据库 //创建完Gitlab账户后,将完整的User信息和UserRole计入users和userRoles中等待插入数据库
BTeacher bTeacher= new BTeacher(value[0]); BTeacher bTeacher= new BTeacher(value[0]);
/*UserUtil.setCurrentPersistOperation(bTeacher,token); /*UserUtil.setCurrentPersistOperation(bTeacher);
if (!teachers.contains(bTeacher)) { if (!teachers.contains(bTeacher)) {
teachers.add(bTeacher); teachers.add(bTeacher);
users.add(user); users.add(user);
...@@ -238,13 +238,13 @@ public class BTeacherServiceImpl implements BTeacherService { ...@@ -238,13 +238,13 @@ public class BTeacherServiceImpl implements BTeacherService {
//int line1 = userRepository.insertUserRole(userRole); //int line1 = userRepository.insertUserRole(userRole);
//添加教师 //添加教师
UserUtil.setCurrentPersistOperation(model,token); UserUtil.setCurrentPersistOperation(model);
line = bTeacherRepository.insertSelective(model); line = bTeacherRepository.insertSelective(model);
/* if (line1 != line) /* if (line1 != line)
throw new ServiceException(ResultServiceEnums.INSERT_ERROR);*/ throw new ServiceException(ResultServiceEnums.INSERT_ERROR);*/
} else { } else {
UserUtil.setCurrentMergeOperation(model,token); UserUtil.setCurrentMergeOperation(model);
line = bTeacherRepository.updateByPrimaryKeySelective(model); line = bTeacherRepository.updateByPrimaryKeySelective(model);
/*String uid = userRepository.selectUserIdByStuOrTeaId(model.getBusinessId(), "b_teacher"); /*String uid = userRepository.selectUserIdByStuOrTeaId(model.getBusinessId(), "b_teacher");
if (uid == null) if (uid == null)
......
...@@ -55,12 +55,12 @@ public class BTermServiceImpl implements BTermService { ...@@ -55,12 +55,12 @@ public class BTermServiceImpl implements BTermService {
public PersistModel persist(BTerm model, String token){ public PersistModel persist(BTerm model, String token){
int line = 0; int line = 0;
if(model.getBusinessId()!=null) { if(model.getBusinessId()!=null) {
UserUtil.setCurrentMergeOperation(model, token); UserUtil.setCurrentMergeOperation(model);
line = bTermRepository.updateByPrimaryKeySelective(model); line = bTermRepository.updateByPrimaryKeySelective(model);
}else { }else {
if(bTermRepository.selectOne(new BTerm(model.getCode()))!=null) if(bTermRepository.selectOne(new BTerm(model.getCode()))!=null)
throw new ServiceException(ResultServiceEnums.TERM_EXISTS); throw new ServiceException(ResultServiceEnums.TERM_EXISTS);
UserUtil.setCurrentPersistOperation(model,token); UserUtil.setCurrentPersistOperation(model);
line = bTermRepository.insertSelective(model); line = bTermRepository.insertSelective(model);
} }
return new PersistModel(line); return new PersistModel(line);
...@@ -94,7 +94,7 @@ public class BTermServiceImpl implements BTermService { ...@@ -94,7 +94,7 @@ public class BTermServiceImpl implements BTermService {
bTerm.setIsStart(BTermEnum.UN_START.getCode()); bTerm.setIsStart(BTermEnum.UN_START.getCode());
} }
//如果是用updateByPrimaryKey的话,那么在数据库中将没赋值的项 置空 //如果是用updateByPrimaryKey的话,那么在数据库中将没赋值的项 置空
UserUtil.setCurrentMergeOperation(bTerm,token); UserUtil.setCurrentMergeOperation(bTerm);
int line = bTermRepository.updateByPrimaryKeySelective(bTerm); int line = bTermRepository.updateByPrimaryKeySelective(bTerm);
return new PersistModel(line); return new PersistModel(line);
} }
......
...@@ -52,7 +52,7 @@ public class BVideoServiceImpl implements BVideoService { ...@@ -52,7 +52,7 @@ public class BVideoServiceImpl implements BVideoService {
@Override @Override
public PersistModel persist(BVideo model, String token){ public PersistModel persist(BVideo model, String token){
UserUtil.setCurrentPersistOperation(model,token); UserUtil.setCurrentPersistOperation(model);
int line = bVideoRepository.insertSelective(model); int line = bVideoRepository.insertSelective(model);
bVideoRepository.insertChapterVideo(model); bVideoRepository.insertChapterVideo(model);
return new PersistModel(line); return new PersistModel(line);
...@@ -62,7 +62,7 @@ public class BVideoServiceImpl implements BVideoService { ...@@ -62,7 +62,7 @@ public class BVideoServiceImpl implements BVideoService {
public PersistModel removeBVideo(String id, String token) { public PersistModel removeBVideo(String id, String token) {
BVideo bVideo = bVideoRepository.selectByPrimaryKey(id); BVideo bVideo = bVideoRepository.selectByPrimaryKey(id);
bVideo.setDelFlag(DelStatus.DELETED.getStatus()); bVideo.setDelFlag(DelStatus.DELETED.getStatus());
UserUtil.setCurrentMergeOperation(bVideo,token); UserUtil.setCurrentMergeOperation(bVideo);
int line = bVideoRepository.updateByPrimaryKeySelective(bVideo); int line = bVideoRepository.updateByPrimaryKeySelective(bVideo);
return new PersistModel(line); return new PersistModel(line);
} }
...@@ -86,7 +86,7 @@ public class BVideoServiceImpl implements BVideoService { ...@@ -86,7 +86,7 @@ public class BVideoServiceImpl implements BVideoService {
BVideo newVideo = this.uploadVideo(file,bVideo,path);//上传新视频 BVideo newVideo = this.uploadVideo(file,bVideo,path);//上传新视频
newVideo.setBusinessId(video.getBusinessId()); newVideo.setBusinessId(video.getBusinessId());
UserUtil.setCurrentMergeOperation(newVideo,token); UserUtil.setCurrentMergeOperation(newVideo);
bVideoRepository.updateByPrimaryKeySelective(newVideo);//更新表中信息 bVideoRepository.updateByPrimaryKeySelective(newVideo);//更新表中信息
videoUrl = newVideo.getVideoUrl(); videoUrl = newVideo.getVideoUrl();
}else{ }else{
......
...@@ -53,7 +53,7 @@ public class UserUtil { ...@@ -53,7 +53,7 @@ public class UserUtil {
* @param entity * @param entity
* @param token * @param token
*/ */
public static void setCurrentPersistOperation(IdEntity entity,String token) { public static void setCurrentPersistOperation(IdEntity entity) {
entity.setCreateBy(UserUtil.getAuthenBusinessId()); entity.setCreateBy(UserUtil.getAuthenBusinessId());
entity.setCreateDate(new Date()); entity.setCreateDate(new Date());
entity.setUpdateBy(UserUtil.getAuthenBusinessId()); entity.setUpdateBy(UserUtil.getAuthenBusinessId());
...@@ -68,7 +68,7 @@ public class UserUtil { ...@@ -68,7 +68,7 @@ public class UserUtil {
* @param entity * @param entity
* @param token * @param token
*/ */
public static void setCurrentMergeOperation(IdEntity entity, String token) { public static void setCurrentMergeOperation(IdEntity entity) {
entity.setUpdateBy(UserUtil.getAuthenBusinessId()); entity.setUpdateBy(UserUtil.getAuthenBusinessId());
entity.setUpdateDate(new Date()); entity.setUpdateDate(new Date());
} }
......
...@@ -69,7 +69,7 @@ public class SysDeptServiceImpl implements SysDeptService { ...@@ -69,7 +69,7 @@ public class SysDeptServiceImpl implements SysDeptService {
dept.setCommonBusinessId(); dept.setCommonBusinessId();
dept.setSeqDate(new Date()); dept.setSeqDate(new Date());
//增加操作 //增加操作
UserUtil.setCurrentPersistOperation(dept,token); UserUtil.setCurrentPersistOperation(dept);
int line = sysDeptRepository.insertSelective(dept); int line = sysDeptRepository.insertSelective(dept);
return new PersistModel(line); return new PersistModel(line);
} }
...@@ -78,7 +78,7 @@ public class SysDeptServiceImpl implements SysDeptService { ...@@ -78,7 +78,7 @@ public class SysDeptServiceImpl implements SysDeptService {
@Override @Override
public PersistModel mergeDept(SysDept dept, String token) { public PersistModel mergeDept(SysDept dept, String token) {
//修改操作 //修改操作
UserUtil.setCurrentPersistOperation(dept,token); UserUtil.setCurrentPersistOperation(dept);
int line = sysDeptRepository.updateByPrimaryKeySelective(dept); int line = sysDeptRepository.updateByPrimaryKeySelective(dept);
return new PersistModel(line); return new PersistModel(line);
} }
...@@ -90,7 +90,7 @@ public class SysDeptServiceImpl implements SysDeptService { ...@@ -90,7 +90,7 @@ public class SysDeptServiceImpl implements SysDeptService {
// TODO: 16/12/23 删除子部门 人员的岗位 && 逻辑删除子部门 // TODO: 16/12/23 删除子部门 人员的岗位 && 逻辑删除子部门
SysDept dept = sysDeptRepository.selectByPrimaryKey(id); SysDept dept = sysDeptRepository.selectByPrimaryKey(id);
dept.setDelFlag("1"); dept.setDelFlag("1");
UserUtil.setCurrentMergeOperation(dept,token); UserUtil.setCurrentMergeOperation(dept);
//int line = deptRepository.logicRemoveDept(id); //int line = deptRepository.logicRemoveDept(id);
sysDeptRepository.deleteDeptRoleByDeptId(id); sysDeptRepository.deleteDeptRoleByDeptId(id);
sysDeptRepository.deleteDeptRoleUserByDeptId(id); sysDeptRepository.deleteDeptRoleUserByDeptId(id);
......
...@@ -59,7 +59,7 @@ public class SysMenuServiceImpl implements SysMenuService { ...@@ -59,7 +59,7 @@ public class SysMenuServiceImpl implements SysMenuService {
public PersistModel persistMenu(SysMenu menu, String token) { public PersistModel persistMenu(SysMenu menu, String token) {
menu.setCommonBusinessId(); menu.setCommonBusinessId();
//增加操作 //增加操作
UserUtil.setCurrentPersistOperation(menu,token); UserUtil.setCurrentPersistOperation(menu);
int line = menuRepository.insertSelective(menu); int line = menuRepository.insertSelective(menu);
return new PersistModel(line); return new PersistModel(line);
} }
...@@ -71,7 +71,7 @@ public class SysMenuServiceImpl implements SysMenuService { ...@@ -71,7 +71,7 @@ public class SysMenuServiceImpl implements SysMenuService {
@Override @Override
public PersistModel mergeMenu(SysMenu menu, String token) { public PersistModel mergeMenu(SysMenu menu, String token) {
//修改操作 //修改操作
UserUtil.setCurrentMergeOperation(menu,token); UserUtil.setCurrentMergeOperation(menu);
int line = menuRepository.updateAppointedColumnByPrimaryKey(menu); int line = menuRepository.updateAppointedColumnByPrimaryKey(menu);
return new PersistModel(line); return new PersistModel(line);
} }
...@@ -90,7 +90,7 @@ public class SysMenuServiceImpl implements SysMenuService { ...@@ -90,7 +90,7 @@ public class SysMenuServiceImpl implements SysMenuService {
List<SysMenu> list = new ArrayList<SysMenu>(); List<SysMenu> list = new ArrayList<SysMenu>();
SysMenu menu = new SysMenu(); SysMenu menu = new SysMenu();
menu.setBusinessId(id); menu.setBusinessId(id);
UserUtil.setCurrentPersistOperation(menu,token); UserUtil.setCurrentPersistOperation(menu);
list.add(menu); list.add(menu);
//子节点 //子节点
list = this.queryChildMenuToList(id,list); list = this.queryChildMenuToList(id,list);
......
...@@ -39,7 +39,7 @@ public class SysRoleServiceImpl implements SysRoleService { ...@@ -39,7 +39,7 @@ public class SysRoleServiceImpl implements SysRoleService {
public PersistModel persistRole(SysRole sysRole, String token) { public PersistModel persistRole(SysRole sysRole, String token) {
sysRole.setCommonBusinessId(); sysRole.setCommonBusinessId();
//增加操作 //增加操作
UserUtil.setCurrentPersistOperation(sysRole,token); UserUtil.setCurrentPersistOperation(sysRole);
int line = sysRoleRepository.insertSelective(sysRole); int line = sysRoleRepository.insertSelective(sysRole);
log.info(UserUtil.getUserInfoProp(token,UserUtil.USER_USERNAME)+"新增了ID为"+ sysRole.getBusinessId()+"的角色信息"); log.info(UserUtil.getUserInfoProp(token,UserUtil.USER_USERNAME)+"新增了ID为"+ sysRole.getBusinessId()+"的角色信息");
return new PersistModel(line); return new PersistModel(line);
...@@ -49,7 +49,7 @@ public class SysRoleServiceImpl implements SysRoleService { ...@@ -49,7 +49,7 @@ public class SysRoleServiceImpl implements SysRoleService {
@Override @Override
public PersistModel mergeRole(SysRole sysRole, String token) { public PersistModel mergeRole(SysRole sysRole, String token) {
//修改操作 //修改操作
UserUtil.setCurrentMergeOperation(sysRole,token); UserUtil.setCurrentMergeOperation(sysRole);
int line = sysRoleRepository.updateByPrimaryKeySelective(sysRole); int line = sysRoleRepository.updateByPrimaryKeySelective(sysRole);
log.info(UserUtil.getUserInfoProp(token,UserUtil.USER_USERNAME)+"修改了ID为"+ sysRole.getBusinessId()+"的角色信息"); log.info(UserUtil.getUserInfoProp(token,UserUtil.USER_USERNAME)+"修改了ID为"+ sysRole.getBusinessId()+"的角色信息");
return new PersistModel(line); return new PersistModel(line);
...@@ -66,7 +66,7 @@ public class SysRoleServiceImpl implements SysRoleService { ...@@ -66,7 +66,7 @@ public class SysRoleServiceImpl implements SysRoleService {
SysRole sysRole = sysRoleRepository.selectByPrimaryKey(id); SysRole sysRole = sysRoleRepository.selectByPrimaryKey(id);
sysRole.setDelFlag(DelStatus.DELETED.getStatus()); sysRole.setDelFlag(DelStatus.DELETED.getStatus());
UserUtil.setCurrentMergeOperation(sysRole,token); UserUtil.setCurrentMergeOperation(sysRole);
line = sysRoleRepository.updateByPrimaryKeySelective(sysRole); line = sysRoleRepository.updateByPrimaryKeySelective(sysRole);
log.info(UserUtil.getUserInfoProp(token,UserUtil.USER_USERNAME)+"删除了ID为"+ sysRole.getBusinessId()+"的角色信息"); log.info(UserUtil.getUserInfoProp(token,UserUtil.USER_USERNAME)+"删除了ID为"+ sysRole.getBusinessId()+"的角色信息");
return new PersistModel(line); return new PersistModel(line);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment