实训体验
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.request.IntentAgreementSubmitRequest;
|
||||
import com.cool.store.response.SigningBaseInfoResponse;
|
||||
|
||||
public interface IntentAgreementService {
|
||||
/**
|
||||
@@ -10,4 +11,11 @@ public interface IntentAgreementService {
|
||||
*/
|
||||
boolean submit(IntentAgreementSubmitRequest request);
|
||||
|
||||
/**
|
||||
* 根据线索id或者加盟商id查询意向协议信息
|
||||
* @param partnerId
|
||||
* @param lineId
|
||||
* @return
|
||||
*/
|
||||
SigningBaseInfoResponse getMiniIntentAgreement(String partnerId, Long lineId);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.request.TrainingExperienceDistributionRequest;
|
||||
|
||||
public interface TrainingExperienceService {
|
||||
/**
|
||||
* 实训分配
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
boolean distribution(TrainingExperienceDistributionRequest request);
|
||||
|
||||
/**
|
||||
* 实训状态变更
|
||||
* @param lineId
|
||||
* @param status
|
||||
* @param abandonCause
|
||||
*/
|
||||
void experienceStatusChange(Long lineId, Integer status, String abandonCause);
|
||||
|
||||
}
|
||||
@@ -8,13 +8,19 @@ import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.IntentAgreementMapper;
|
||||
import com.cool.store.mapper.LineInfoMapper;
|
||||
import com.cool.store.request.IntentAgreementSubmitRequest;
|
||||
import com.cool.store.response.SigningBaseInfoResponse;
|
||||
import com.cool.store.service.IntentAgreementService;
|
||||
import com.cool.store.utils.StringUtil;
|
||||
import com.cool.store.utils.poi.StringUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Objects;
|
||||
|
||||
import static com.cool.store.enums.ErrorCodeEnum.PARAMS_VALIDATE_ERROR;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class IntentAgreementServiceImpl implements IntentAgreementService {
|
||||
@@ -28,6 +34,7 @@ public class IntentAgreementServiceImpl implements IntentAgreementService {
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean submit(IntentAgreementSubmitRequest request) {
|
||||
SigningBaseInfoDO signingBaseInfoDO = request.toSigningBaseInfoDO();
|
||||
boolean submitStatus = intentAgreementMapper.insert(signingBaseInfoDO);
|
||||
@@ -43,4 +50,18 @@ public class IntentAgreementServiceImpl implements IntentAgreementService {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SigningBaseInfoResponse getMiniIntentAgreement(String partnerId, Long lineId) {
|
||||
if (StringUtil.isBlank(partnerId) && lineId == null){
|
||||
throw new ServiceException(PARAMS_VALIDATE_ERROR);
|
||||
}
|
||||
SigningBaseInfoDO signingBaseInfoDO = intentAgreementMapper.selectByPartnerIdOrLineId(partnerId, lineId);
|
||||
if (Objects.isNull(signingBaseInfoDO)){
|
||||
log.info("getMiniIntentAgreement signingBaseInfoDO IS NULL......");
|
||||
return null;
|
||||
}
|
||||
SigningBaseInfoResponse response = SigningBaseInfoResponse.from(signingBaseInfoDO);
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.cool.store.entity.LeaseBaseInfoDO;
|
||||
import com.cool.store.entity.LineInfoDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.ExperienceStatusEnum;
|
||||
import com.cool.store.enums.WorkflowSubStageStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.LineInfoMapper;
|
||||
import com.cool.store.mapper.TrainingExperienceMapper;
|
||||
import com.cool.store.request.TrainingExperienceDistributionRequest;
|
||||
import com.cool.store.service.TrainingExperienceService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.annotation.Tainted;
|
||||
import java.util.Objects;
|
||||
|
||||
import static com.cool.store.enums.ErrorCodeEnum.INTERVIEW_LINE_ID_IS_NULL;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class TrainingExperienceServiceImpl implements TrainingExperienceService {
|
||||
|
||||
@Resource
|
||||
TrainingExperienceMapper trainingExperienceMapper;
|
||||
|
||||
@Resource
|
||||
LineInfoMapper lineInfoMapper;
|
||||
|
||||
@Override
|
||||
public boolean distribution(TrainingExperienceDistributionRequest request) {
|
||||
if (Objects.isNull(request)) {
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
if (Objects.isNull(request.getLineId())) {
|
||||
throw new ServiceException(INTERVIEW_LINE_ID_IS_NULL);
|
||||
}
|
||||
trainingExperienceMapper.insert(request.toLeaseBaseInfoDO());
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void experienceStatusChange(Long lineId, Integer status, String abandonCause) {
|
||||
trainingExperienceMapper.updateStatus(lineId,status,abandonCause);
|
||||
if (ExperienceStatusEnum.DONE.getExperienceStatus().equals(status)){
|
||||
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(lineId);
|
||||
if (Objects.isNull(lineInfoDO)){
|
||||
throw new ServiceException(ErrorCodeEnum.INTERVIEW_PARTNER_NOT_EXIST);
|
||||
}
|
||||
lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SECOND_INTERVIEWS_100.getCode());
|
||||
lineInfoMapper.updateByPrimaryKeySelective(lineInfoDO);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user