SigningBaseInfoResponse 增加拒绝原因

This commit is contained in:
guohb
2024-04-02 15:19:09 +08:00
parent 537cdd63d9
commit 9599296476
4 changed files with 45 additions and 30 deletions

View File

@@ -20,6 +20,7 @@
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="deleted" jdbcType="TINYINT" property="deleted"/> <result column="deleted" jdbcType="TINYINT" property="deleted"/>
<result column="audit_id" jdbcType="BIGINT" property="auditId"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, id,
@@ -39,7 +40,8 @@
business_license_address, business_license_address,
create_time, create_time,
update_time, update_time,
deleted deleted,
audit_id
</sql> </sql>
<insert id="insert" parameterType="com.cool.store.entity.SigningBaseInfoDO" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="com.cool.store.entity.SigningBaseInfoDO" useGeneratedKeys="true" keyProperty="id">
insert into xfsg_signing_base_info insert into xfsg_signing_base_info

View File

@@ -43,4 +43,6 @@ public class SigningBaseInfoDO {
private Integer deleted; private Integer deleted;
private Long auditId;
} }

View File

@@ -47,6 +47,8 @@ public class SigningBaseInfoResponse {
@ApiModelProperty("加盟身份 1个人加盟 2企业加盟") @ApiModelProperty("加盟身份 1个人加盟 2企业加盟")
private Integer type; private Integer type;
@ApiModelProperty("公开拒绝原因")
private String rejectPublicReason;
public static SigningBaseInfoResponse from(SigningBaseInfoDO signingBaseInfoDO) { public static SigningBaseInfoResponse from(SigningBaseInfoDO signingBaseInfoDO) {
if (signingBaseInfoDO == null) { if (signingBaseInfoDO == null) {

View File

@@ -2,14 +2,14 @@ package com.cool.store.service.impl;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cool.store.dao.LineInfoDAO; import com.cool.store.dao.LineInfoDAO;
import com.cool.store.entity.InitiatingDO; import com.cool.store.entity.*;
import com.cool.store.entity.LineInfoDO; import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.entity.MemberQuestionDO; import com.cool.store.enums.WorkflowSubStageEnum;
import com.cool.store.entity.SigningBaseInfoDO; import com.cool.store.enums.WorkflowSubStageStatusEnum;
import com.cool.store.enums.*;
import com.cool.store.exception.ServiceException; import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.IntentAgreementMapper; import com.cool.store.mapper.IntentAgreementMapper;
import com.cool.store.mapper.JoinIntentionMapper; import com.cool.store.mapper.JoinIntentionMapper;
import com.cool.store.mapper.LineAuditInfoMapper;
import com.cool.store.mapper.LineInfoMapper; import com.cool.store.mapper.LineInfoMapper;
import com.cool.store.mq.util.HttpRestTemplateService; import com.cool.store.mq.util.HttpRestTemplateService;
import com.cool.store.request.InitiatingRequest; import com.cool.store.request.InitiatingRequest;
@@ -19,15 +19,11 @@ import com.cool.store.response.SigningBaseInfoResponse;
import com.cool.store.service.IntentAgreementService; import com.cool.store.service.IntentAgreementService;
import com.cool.store.utils.SecureUtil; import com.cool.store.utils.SecureUtil;
import com.cool.store.utils.StringUtil; import com.cool.store.utils.StringUtil;
import com.cool.store.utils.poi.StringUtils;
import com.cool.store.utils.poi.constant.Constants; import com.cool.store.utils.poi.constant.Constants;
import com.google.gson.JsonObject;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestParam;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.HashMap; import java.util.HashMap;
@@ -59,21 +55,24 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
@Value("${xfsg.url}") @Value("${xfsg.url}")
private String xfsgUrl; private String xfsgUrl;
@Resource
LineAuditInfoMapper lineAuditInfoMapper;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean submit(IntentAgreementSubmitRequest request) { public boolean submit(IntentAgreementSubmitRequest request) {
SigningBaseInfoDO signingBaseInfoDO = request.toSigningBaseInfoDO(); SigningBaseInfoDO signingBaseInfoDO = request.toSigningBaseInfoDO();
if(Objects.nonNull(request.getIdCardNo()) || Objects.nonNull(request.getBusinessLicenseCode())){ if (Objects.nonNull(request.getIdCardNo()) || Objects.nonNull(request.getBusinessLicenseCode())) {
SigningBaseInfoDO isExist = intentAgreementMapper.judge(request); SigningBaseInfoDO isExist = intentAgreementMapper.judge(request);
if (Objects.nonNull(isExist)){ if (Objects.nonNull(isExist)) {
throw new ServiceException(ErrorCodeEnum.BUSINESS_LICENSE_OR_ID_CARD_REPEAT); throw new ServiceException(ErrorCodeEnum.BUSINESS_LICENSE_OR_ID_CARD_REPEAT);
} }
} }
boolean submitStatus = intentAgreementMapper.insert(signingBaseInfoDO); boolean submitStatus = intentAgreementMapper.insert(signingBaseInfoDO);
if (submitStatus){ if (submitStatus) {
LineInfoDO lineInfoDO = lineInfoMapper.getByPartnerId(request.getPartnerId()); LineInfoDO lineInfoDO = lineInfoMapper.getByPartnerId(request.getPartnerId());
if (Objects.isNull(lineInfoDO)){ if (Objects.isNull(lineInfoDO)) {
throw new ServiceException(ErrorCodeEnum.INTERVIEW_PARTNER_NOT_EXIST); throw new ServiceException(ErrorCodeEnum.INTERVIEW_PARTNER_NOT_EXIST);
} }
lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_63.getCode()); lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_63.getCode());
@@ -86,17 +85,27 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
@Override @Override
public SigningBaseInfoResponse getMiniIntentAgreement(String partnerId, Long lineId) { public SigningBaseInfoResponse getMiniIntentAgreement(String partnerId, Long lineId) {
if (StringUtil.isBlank(partnerId) && lineId == null){ if (StringUtil.isBlank(partnerId) && lineId == null) {
throw new ServiceException(PARAMS_VALIDATE_ERROR); throw new ServiceException(PARAMS_VALIDATE_ERROR);
} }
SigningBaseInfoDO signingBaseInfoDO = intentAgreementMapper.selectByPartnerIdOrLineId(partnerId, lineId); SigningBaseInfoDO signingBaseInfoDO = intentAgreementMapper.selectByPartnerIdOrLineId(partnerId, lineId);
if (Objects.isNull(signingBaseInfoDO)){
if (Objects.isNull(signingBaseInfoDO)) {
log.info("getMiniIntentAgreement signingBaseInfoDO IS NULL......"); log.info("getMiniIntentAgreement signingBaseInfoDO IS NULL......");
return null; return null;
} }
SigningBaseInfoResponse response = SigningBaseInfoResponse.from(signingBaseInfoDO); SigningBaseInfoResponse response = SigningBaseInfoResponse.from(signingBaseInfoDO);
MemberQuestionDO byLineId = joinIntentionMapper.getByLineId(lineId); MemberQuestionDO byLineId = joinIntentionMapper.getByLineId(lineId);
response.setType(byLineId.getJoinType()); response.setType(byLineId.getJoinType());
if (Objects.nonNull(signingBaseInfoDO.getAuditId())){
LineAuditInfoDO lineAuditInfoDO = lineAuditInfoMapper.selectByPrimaryKey(signingBaseInfoDO.getAuditId());
if (Objects.isNull(lineAuditInfoDO)){
response.setRejectPublicReason(null);
}
response.setRejectPublicReason(lineAuditInfoDO.getRejectPublicReason());
}
return response; return response;
} }
@@ -109,25 +118,25 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
protected Boolean auditPass(Long auditId, LineInfoDO lineInfo) { protected Boolean auditPass(Long auditId, LineInfoDO lineInfo) {
//校验是否是审核节点 //校验是否是审核节点
if (!lineInfo.getWorkflowStage().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_63.getCode()) && if (!lineInfo.getWorkflowStage().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_63.getCode()) &&
!lineInfo.getWorkflowStage().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_75.getCode())){ !lineInfo.getWorkflowStage().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_75.getCode())) {
throw new ServiceException(ErrorCodeEnum.NOT_APPROVE_NODE); throw new ServiceException(ErrorCodeEnum.NOT_APPROVE_NODE);
} }
//待审核code 63 处理逻辑 //待审核code 63 处理逻辑
if (lineInfo.getWorkflowStage().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_63.getCode())){ if (lineInfo.getWorkflowStage().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_63.getCode())) {
lineInfo.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_70.getCode()); lineInfo.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_70.getCode());
lineInfoDAO.updateLineInfo(lineInfo); lineInfoDAO.updateLineInfo(lineInfo);
} }
//待OA审核code 75 处理逻辑 //待OA审核code 75 处理逻辑
if(lineInfo.getWorkflowStage().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_75.getCode())){ if (lineInfo.getWorkflowStage().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_75.getCode())) {
WorkflowSubStageEnum workflowSubStageEnum = WorkflowSubStageEnum.getWorkflowSubStageEnum(lineInfo.getWorkflowSubStage()); WorkflowSubStageEnum workflowSubStageEnum = WorkflowSubStageEnum.getWorkflowSubStageEnum(lineInfo.getWorkflowSubStage());
WorkflowSubStageEnum nextStage = workflowSubStageEnum.getNextStage(); WorkflowSubStageEnum nextStage = workflowSubStageEnum.getNextStage();
//更新线索阶段 //更新线索阶段
lineInfoDAO.updateWorkflowStage(lineInfo.getId(), nextStage, nextStage.getInitStatus()); lineInfoDAO.updateWorkflowStage(lineInfo.getId(), nextStage, nextStage.getInitStatus());
//更新auditId //更新auditId
SigningBaseInfoDO signingBaseInfoDO = intentAgreementMapper.selectByPartnerIdOrLineId(null, lineInfo.getId()); SigningBaseInfoDO signingBaseInfoDO = intentAgreementMapper.selectByPartnerIdOrLineId(null, lineInfo.getId());
if (Objects.nonNull(signingBaseInfoDO)){ if (Objects.nonNull(signingBaseInfoDO)) {
intentAgreementMapper.updateAuditId(lineInfo.getId(),auditId); intentAgreementMapper.updateAuditId(lineInfo.getId(), auditId);
}else { } else {
throw new ServiceException("无法更新,没有对应的签约基本信息"); throw new ServiceException("无法更新,没有对应的签约基本信息");
} }
@@ -138,20 +147,20 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
@Override @Override
protected Boolean auditReject(Long auditId, LineInfoDO lineInfo) { protected Boolean auditReject(Long auditId, LineInfoDO lineInfo) {
if ((!lineInfo.getWorkflowStage().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_63.getCode()) && if ((!lineInfo.getWorkflowStage().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_63.getCode()) &&
!lineInfo.getWorkflowStage().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_75.getCode()))){ !lineInfo.getWorkflowStage().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_75.getCode()))) {
throw new ServiceException(ErrorCodeEnum.NOT_APPROVE_NODE); throw new ServiceException(ErrorCodeEnum.NOT_APPROVE_NODE);
} }
//待审核code 63 处理逻辑 //待审核code 63 处理逻辑
if (lineInfo.getWorkflowStage().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_63.getCode())){ if (lineInfo.getWorkflowStage().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_63.getCode())) {
lineInfo.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_65.getCode()); lineInfo.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_65.getCode());
lineInfoDAO.updateLineInfo(lineInfo); lineInfoDAO.updateLineInfo(lineInfo);
} }
//待OA审核code 75 处理逻辑 //待OA审核code 75 处理逻辑
if(lineInfo.getWorkflowStage().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_75.getCode())){ if (lineInfo.getWorkflowStage().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_75.getCode())) {
lineInfo.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_80.getCode()); lineInfo.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_80.getCode());
lineInfoDAO.updateLineInfo(lineInfo); lineInfoDAO.updateLineInfo(lineInfo);
//更新auditId //更新auditId
intentAgreementMapper.updateAuditId(lineInfo.getId(),auditId); intentAgreementMapper.updateAuditId(lineInfo.getId(), auditId);
} }
return Boolean.TRUE; return Boolean.TRUE;
} }
@@ -164,12 +173,12 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
@Override @Override
public InitiatingResponse initiating(InitiatingRequest request) { public InitiatingResponse initiating(InitiatingRequest request) {
log.info("initiating request:{}", JSONObject.toJSONString(request)); log.info("initiating request:{}", JSONObject.toJSONString(request));
if (Objects.isNull(request)){ if (Objects.isNull(request)) {
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR); throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
} }
Map<String, Object> requestMap = new HashMap<>(); Map<String, Object> requestMap = new HashMap<>();
fillSignatureInfo(requestMap); fillSignatureInfo(requestMap);
String url = xfsgUrl + Constants.INTENTION_CONTRACT_URL + "?timestamp="+requestMap.get("timestamp") + "&signature=" + requestMap.get("signature"); String url = xfsgUrl + Constants.INTENTION_CONTRACT_URL + "?timestamp=" + requestMap.get("timestamp") + "&signature=" + requestMap.get("signature");
InitiatingDO initiatingDO = request.toInitiatingDO(); InitiatingDO initiatingDO = request.toInitiatingDO();
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(request.getLineId()); LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(request.getLineId());
initiatingDO.setKdzBusinessId(lineInfoDO.getId() + "_" + lineInfoDO.getWorkflowSubStageStatus()); initiatingDO.setKdzBusinessId(lineInfoDO.getId() + "_" + lineInfoDO.getWorkflowSubStageStatus());