审核回调接口逻辑修改

This commit is contained in:
俞扬
2023-07-03 16:51:55 +08:00
parent 3b5f73fb25
commit 63dcea0b1a
6 changed files with 38 additions and 10 deletions

View File

@@ -78,6 +78,8 @@ public interface HyPartnerInterviewMapper {
HyPartnerInterviewDO getInterviewInfoByInterviewPlanId(@Param("interviewPlanId") String interviewPlanId);
HyPartnerInterviewDO getInterviewInfoByQualifyVerifyId(@Param("qualifyVerifyId") String qualifyVerifyId);
/**
* 修改面试状态
*/

View File

@@ -504,5 +504,16 @@
FROM hy_partner_interview
WHERE FIND_IN_SET(#{videoUrl}, process_info)
</select>
<select id="getInterviewInfoByQualifyVerifyId" resultType="com.cool.store.entity.HyPartnerInterviewDO">
SELECT
hpi.id, hpi.status, hpi.partner_line_id, hpi.interview_plan_id
FROM
hy_partner_interview hpi
LEFT JOIN hy_partner_certification_info hpci ON hpci.partner_interview_id = hpi.id
WHERE
hpci.qualify_verify_id = #{qualifyVerifyId}
AND hpi.deleted = 0
</select>
</mapper>

View File

@@ -14,5 +14,5 @@ import java.io.IOException;
public interface FlowService {
void createQualifyVerify(CreateQualifyVerifyReq request) throws ApiException, IOException;
void qualificationCallback(QualificationCallbackReq request);
void qualificationCallback(QualificationCallbackReq request) throws ApiException;
}

View File

@@ -23,13 +23,11 @@ import com.cool.store.mapper.HyPartnerCertificationInfoMapper;
import com.cool.store.mapper.HyPartnerInterviewMapper;
import com.cool.store.mapper.HyPartnerLineInfoMapper;
import com.cool.store.oss.OSSServer;
import com.cool.store.request.CreateQualifyVerifyReq;
import com.cool.store.request.QualificationCallbackReq;
import com.cool.store.request.RpcCreateQualifyVerifyReq;
import com.cool.store.request.RpcGetMdmTokenReq;
import com.cool.store.request.*;
import com.cool.store.request.data.flow.KeyText;
import com.cool.store.request.data.flow.SkrRelshipProve;
import com.cool.store.service.FlowService;
import com.cool.store.service.HyPartnerLineInfoService;
import com.cool.store.service.LogService;
import com.cool.store.utils.*;
import lombok.extern.slf4j.Slf4j;
@@ -92,6 +90,9 @@ public class FlowServiceImpl implements FlowService {
@Autowired
private LogService logService;
@Autowired
private HyPartnerLineInfoService hyPartnerLineInfoService;
@Override
@Transactional
public void createQualifyVerify(CreateQualifyVerifyReq request) throws ApiException, IOException {
@@ -218,7 +219,7 @@ public class FlowServiceImpl implements FlowService {
}
@Override
public void qualificationCallback(QualificationCallbackReq request) {
public void qualificationCallback(QualificationCallbackReq request) throws ApiException {
log.info("MDM800审批成功回调request{}", JSONObject.toJSONString(request));
//1. 信息是否完整
if (null == request.getInstanceStatus() || "".equals(request.getInstanceStatus())) {
@@ -226,11 +227,15 @@ public class FlowServiceImpl implements FlowService {
throw new ServiceException("MDM回调错误");
}
//根据审核流程 id 获取面试会议相关 id
String interviewId = hyPartnerCertificationInfoMapper.getInterviewIdByQualifyVerifyId(request.getInstanceId());
String interviewPlanId = hyPartnerCertificationInfoMapper.getInterviewPlanIdByQualifyVerifyId(request.getInstanceId());
if (StringUtils.isEmpty(interviewPlanId)) {
// String interviewId = hyPartnerCertificationInfoMapper.getInterviewIdByQualifyVerifyId(request.getInstanceId());
// String interviewPlanId = hyPartnerCertificationInfoMapper.getInterviewPlanIdByQualifyVerifyId(request.getInstanceId());
HyPartnerInterviewDO hyPartnerInterviewDO = hyPartnerInterviewMapper.getInterviewInfoByQualifyVerifyId(request.getInstanceId());
if (hyPartnerInterviewDO == null || hyPartnerInterviewDO.getInterviewPlanId() == null) {
throw new ServiceException(ErrorCodeEnum.INTERVIEW_NOT_EXIST);
}
String interviewId = hyPartnerInterviewDO.getId().toString();
String interviewPlanId = hyPartnerInterviewDO.getInterviewPlanId().toString();
Long partnerLineId = hyPartnerInterviewDO.getPartnerLineId();
//审核通过
if ("FINISHED".equals(request.getInstanceStatus())) {
//更新面试状态
@@ -257,6 +262,11 @@ public class FlowServiceImpl implements FlowService {
// TODO 4. 修改流程状态到下一阶段 4 分配选址开发经理
//审核未通过
} else if ("CANCELED".equals(request.getInstanceStatus())) {
CloseFollowRequest closeFollowRequest = new CloseFollowRequest();
closeFollowRequest.setRejectRealReason("资质审核流程拒绝");
closeFollowRequest.setLineId(partnerLineId);
closeFollowRequest.setType("reject");
hyPartnerLineInfoService.closeOrPassFollow(null,closeFollowRequest);
interviewDAO.updateInterviewWorkflowStatus(interviewPlanId, WorkflowStatusEnum.INTERVIEW_7);
}
}

View File

@@ -322,6 +322,11 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean closeOrPassFollow(LoginUserInfo user,CloseFollowRequest closeFollowRequest) throws ApiException {
//该方法中user可能为空注意处理空指针的情况
if(user == null){
user = new LoginUserInfo();
}
HyPartnerLineInfoDO hyPartnerLineInfoDO = hyPartnerLineInfoDAO.selectByPrimaryKeySelective(closeFollowRequest.getLineId());
if (hyPartnerLineInfoDO==null){
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);

View File

@@ -37,7 +37,7 @@ public class FlowController {
@PostMapping("/qualificationReview/callback")
@ApiOperation("加盟商资质审核流程信息回调接口")
public ResponseResult qualificationCallback(@RequestBody QualificationCallbackReq request) {
public ResponseResult qualificationCallback(@RequestBody QualificationCallbackReq request) throws ApiException {
flowService.qualificationCallback(request);
return ResponseResult.success();
}