|
@@ -1,18 +1,19 @@
|
|
package com.citu.module.menduner.system.service.eduexp;
|
|
package com.citu.module.menduner.system.service.eduexp;
|
|
|
|
|
|
|
|
+import com.citu.framework.common.pojo.PageResult;
|
|
|
|
+import com.citu.framework.common.util.object.BeanUtils;
|
|
import com.citu.module.menduner.system.controller.admin.eduexp.vo.EduExpPageReqVO;
|
|
import com.citu.module.menduner.system.controller.admin.eduexp.vo.EduExpPageReqVO;
|
|
import com.citu.module.menduner.system.controller.admin.eduexp.vo.EduExpSaveReqVO;
|
|
import com.citu.module.menduner.system.controller.admin.eduexp.vo.EduExpSaveReqVO;
|
|
|
|
+import com.citu.module.menduner.system.dal.dataobject.eduexp.EduExpDO;
|
|
|
|
+import com.citu.module.menduner.system.dal.mysql.eduexp.EduExpMapper;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
-import javax.annotation.Resource;
|
|
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
|
-import com.citu.module.menduner.system.dal.dataobject.eduexp.EduExpDO;
|
|
|
|
-import com.citu.framework.common.pojo.PageResult;
|
|
|
|
-import com.citu.framework.common.util.object.BeanUtils;
|
|
|
|
-
|
|
|
|
-import com.citu.module.menduner.system.dal.mysql.eduexp.EduExpMapper;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
|
|
|
import static com.citu.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
import static com.citu.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
|
|
+import static com.citu.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
|
import static com.citu.module.menduner.system.enums.ErrorCodeConstants.MDE_EDU_EXP_NOT_EXISTS;
|
|
import static com.citu.module.menduner.system.enums.ErrorCodeConstants.MDE_EDU_EXP_NOT_EXISTS;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -28,24 +29,29 @@ public class EduExpServiceImpl implements EduExpService {
|
|
private EduExpMapper eduExpMapper;
|
|
private EduExpMapper eduExpMapper;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
public Long createEduExp(EduExpSaveReqVO createReqVO) {
|
|
public Long createEduExp(EduExpSaveReqVO createReqVO) {
|
|
// 插入
|
|
// 插入
|
|
EduExpDO eduExp = BeanUtils.toBean(createReqVO, EduExpDO.class);
|
|
EduExpDO eduExp = BeanUtils.toBean(createReqVO, EduExpDO.class);
|
|
|
|
+ eduExp.setUserId(getLoginUserId());
|
|
eduExpMapper.insert(eduExp);
|
|
eduExpMapper.insert(eduExp);
|
|
// 返回
|
|
// 返回
|
|
return eduExp.getId();
|
|
return eduExp.getId();
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
public void updateEduExp(EduExpSaveReqVO updateReqVO) {
|
|
public void updateEduExp(EduExpSaveReqVO updateReqVO) {
|
|
// 校验存在
|
|
// 校验存在
|
|
validateEduExpExists(updateReqVO.getId());
|
|
validateEduExpExists(updateReqVO.getId());
|
|
// 更新
|
|
// 更新
|
|
EduExpDO updateObj = BeanUtils.toBean(updateReqVO, EduExpDO.class);
|
|
EduExpDO updateObj = BeanUtils.toBean(updateReqVO, EduExpDO.class);
|
|
|
|
+ updateObj.setUserId(getLoginUserId());
|
|
eduExpMapper.updateById(updateObj);
|
|
eduExpMapper.updateById(updateObj);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
public void deleteEduExp(Long id) {
|
|
public void deleteEduExp(Long id) {
|
|
// 校验存在
|
|
// 校验存在
|
|
validateEduExpExists(id);
|
|
validateEduExpExists(id);
|