|
@@ -5,9 +5,7 @@ import com.citu.framework.common.pojo.PageResult;
|
|
|
import com.citu.framework.common.util.object.BeanUtils;
|
|
|
import com.citu.module.menduner.system.controller.admin.cvattachment.vo.CvAttachmentPageReqVO;
|
|
|
import com.citu.module.menduner.system.controller.admin.cvattachment.vo.CvAttachmentSaveReqVO;
|
|
|
-import com.citu.module.menduner.system.controller.app.person.cvattachment.AppCvAttachmentRespVO;
|
|
|
import com.citu.module.menduner.system.controller.app.person.cvattachment.AppCvAttachmentSaveReqVO;
|
|
|
-import com.citu.module.menduner.system.convert.CvAttachmentConvert;
|
|
|
import com.citu.module.menduner.system.dal.dataobject.cvattachment.CvAttachmentDO;
|
|
|
import com.citu.module.menduner.system.dal.mysql.cvattachment.CvAttachmentMapper;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -18,6 +16,7 @@ import java.util.List;
|
|
|
|
|
|
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_CV_ATTACHMENT_MAX_EXISTS;
|
|
|
import static com.citu.module.menduner.system.enums.ErrorCodeConstants.MDE_CV_ATTACHMENT_NOT_EXISTS;
|
|
|
|
|
|
/**
|
|
@@ -77,9 +76,13 @@ public class CvAttachmentServiceImpl implements CvAttachmentService {
|
|
|
@Override
|
|
|
@DSTransactional
|
|
|
public void create(AppCvAttachmentSaveReqVO reqVO) {
|
|
|
+ Long userId = getLoginUserId();
|
|
|
+ if (cvAttachmentMapper.countByUserId(userId) > 5) {
|
|
|
+ throw exception(MDE_CV_ATTACHMENT_MAX_EXISTS);
|
|
|
+ }
|
|
|
// 插入
|
|
|
CvAttachmentDO cvAttachment = BeanUtils.toBean(reqVO, CvAttachmentDO.class);
|
|
|
- cvAttachment.setUserId(getLoginUserId());
|
|
|
+ cvAttachment.setUserId(userId);
|
|
|
cvAttachmentMapper.insert(cvAttachment);
|
|
|
}
|
|
|
|