资质审核流程信息回调接口
This commit is contained in:
@@ -2,7 +2,6 @@ package com.cool.store.utils;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import com.lowagie.text.Document;
|
||||
import com.lowagie.text.Image;
|
||||
@@ -12,8 +11,7 @@ import com.lowagie.text.pdf.PdfWriter;
|
||||
|
||||
import java.awt.*;
|
||||
import java.io.*;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Date;
|
||||
|
||||
//生成资格面试通过函的工具
|
||||
public class PassLetterUtils {
|
||||
@@ -26,7 +24,7 @@ public class PassLetterUtils {
|
||||
* @param passCode 通过函编码
|
||||
* @param passTime 审批通过时间
|
||||
*/
|
||||
public static ByteArrayOutputStream genPassLetter(String partnerName, String passCode, String verifyCity, DateTime passTime) {
|
||||
public static ByteArrayOutputStream genPassLetter(String partnerName, String passCode, String verifyCity, Date passTime) {
|
||||
String passTimeStr = DateUtil.format(passTime, "yyyy年MM月dd日");
|
||||
Document document = new Document();
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
@@ -65,7 +63,7 @@ public class PassLetterUtils {
|
||||
* 生成 passCode 的方法,拆分出来方便单独获取 passCode
|
||||
* @return
|
||||
*/
|
||||
public static String genPassCode(DateTime passTime) {
|
||||
public static String genPassCode(Date passTime) {
|
||||
String randomNum = RandomUtil.randomNumbers(5);
|
||||
String passCode = "HSAY" + DateUtil.format(passTime, "yyMMdd") + "-" + randomNum;
|
||||
return passCode;
|
||||
|
||||
@@ -22,4 +22,11 @@ public interface HyPartnerCertificationInfoMapper {
|
||||
* dateTime:2023-05-29 03:51
|
||||
*/
|
||||
int updateByPrimaryKeySelective(@Param("record") HyPartnerCertificationInfoDO record);
|
||||
|
||||
/**
|
||||
* 根据资质审核流程 id 获取面试会议 id
|
||||
* @param qualifyVerifyId 资质审核流程 id
|
||||
* @return 面试会议 id
|
||||
*/
|
||||
String getInterviewIdByQualifyVerifyId(@Param("qualifyVerifyId") String qualifyVerifyId);
|
||||
}
|
||||
@@ -79,4 +79,11 @@ public interface HyPartnerInterviewMapper {
|
||||
* 根据面试 id 查询面试信息
|
||||
*/
|
||||
HyPartnerInterviewDO selectByPrimaryKeySelective(String interviewId);
|
||||
|
||||
/**
|
||||
* 根据面试 id 获取意向区域
|
||||
* @param interviewId
|
||||
* @return
|
||||
*/
|
||||
String getVerifyCityByInterviewId(@Param("interviewId") String interviewId);
|
||||
}
|
||||
@@ -84,7 +84,7 @@ public interface HyPartnerInterviewPlanMapper {
|
||||
/**
|
||||
* 查询面试详情
|
||||
*
|
||||
* @param interviewId
|
||||
* @param interviewPlanId
|
||||
* @return
|
||||
*/
|
||||
InterviewVO getInterviewInfo(String interviewPlanId);
|
||||
|
||||
@@ -169,6 +169,12 @@
|
||||
<if test="record.partnership != null">
|
||||
partnership = #{record.partnership},
|
||||
</if>
|
||||
<if test="record.qualifyVerifyId != null">
|
||||
qualify_verify_id = #{record.qualifyVerifyId},
|
||||
</if>
|
||||
<if test="record.intentionContractNo != null">
|
||||
intention_contract_no = #{record.intentionContractNo},
|
||||
</if>
|
||||
<if test="record.wantSignTime != null">
|
||||
want_sign_time = #{record.wantSignTime},
|
||||
</if>
|
||||
@@ -215,6 +221,21 @@
|
||||
update_time = #{record.updateTime},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{record.id}
|
||||
<where>
|
||||
1 = 0
|
||||
<if test="record.id != null">
|
||||
or id = #{record.id}
|
||||
</if>
|
||||
<if test="record.partnerLineId != null">
|
||||
or partner_id_line_id = #{record.partnerLineId}
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
|
||||
<!-- 根据资质审核流程 id 获取面试会议 id -->
|
||||
<select id="getInterviewIdByQualifyVerifyId" resultType="java.lang.String">
|
||||
select partner_interview_id
|
||||
from hy_partner_certification_info
|
||||
where qualify_verify_id = #{qualifyVerifyId}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -220,8 +220,17 @@
|
||||
<if test="authCode != null">
|
||||
auth_code = #{authCode},
|
||||
</if>
|
||||
<if test="passFileUrl != null">
|
||||
pass_file_url = #{passFileUrl},
|
||||
<if test="passCode != null">
|
||||
pass_code = #{passCode},
|
||||
</if>
|
||||
<if test="passPdfUrl != null">
|
||||
pass_pdf_url = #{passPdfUrl},
|
||||
</if>
|
||||
<if test="passImageUrl != null">
|
||||
pass_image_url = #{passImageUrl},
|
||||
</if>
|
||||
<if test="passTime != null">
|
||||
pass_time = #{passTime},
|
||||
</if>
|
||||
<if test="expiryDate != null">
|
||||
expiry_date = #{expiryDate},
|
||||
@@ -250,11 +259,16 @@
|
||||
<if test="interviewerEnterTime != null">
|
||||
interviewer_enter_time = #{interviewerEnterTime},
|
||||
</if>
|
||||
<if test="qualifyVerifyId != null">
|
||||
qualify_verify_id = #{qualifyVerifyId},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
<where>
|
||||
1 = 0
|
||||
<if test="id != null">
|
||||
or id = #{id}
|
||||
</if>
|
||||
<if test="interviewPlanId != null">
|
||||
or interview_plan_id = #{interviewPlanId}
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
|
||||
<!-- 根据加盟商id查询面试信息 -->
|
||||
@@ -338,7 +352,7 @@
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from
|
||||
hy_partner_intent_info
|
||||
hy_partner_interview
|
||||
where
|
||||
id = #{interviewId}
|
||||
|
||||
@@ -364,4 +378,19 @@
|
||||
WHERE id = #{interviewId}
|
||||
</update>
|
||||
|
||||
<!-- 根据 interviewId 获取意向区域 -->
|
||||
<select id="getVerifyCityByInterviewId" resultType="java.lang.String">
|
||||
SELECT area_path
|
||||
FROM hy_open_area_info
|
||||
WHERE id = (
|
||||
SELECT want_shop_area
|
||||
FROM hy_partner_intent_info
|
||||
WHERE partner_line_id = (
|
||||
SELECT partner_line_id
|
||||
FROM hy_partner_interview
|
||||
WHERE id = #{interviewId}
|
||||
)
|
||||
)
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -247,41 +247,44 @@
|
||||
|
||||
<select id="getInterviewList" resultType="com.cool.store.vo.interview.InterviewVO">
|
||||
select hpip.id as interviewPlanId,
|
||||
hpip.partner_id as partnerId,
|
||||
hpui.username as partnerName,
|
||||
hpui.mobile as partnerMobile,
|
||||
hpip.room_id as roomId,
|
||||
hpip.start_time as startTime,
|
||||
hpui.username as interviewerName,
|
||||
hpui.mobile as interviewerMobile,
|
||||
hpip.interviewer as interviewerId,
|
||||
eu.name as interviewerName,
|
||||
eu.mobile as interviewerMobile,
|
||||
hpip.room_status as roomStatus,
|
||||
hpip.end_time as endTime
|
||||
from hy_partner_interview_plan hpip
|
||||
left join hy_partner_line_info hpll on hpip.partner_line_id = hpll.id
|
||||
left join hy_partner_user_info hpui on hpui.partner_id = hpip.partner_id
|
||||
left join enterprise_user eu on hpip.interviewer = eu.user_id
|
||||
<where>
|
||||
<if test="record.partnerName !=null and record.partnerName!=''">
|
||||
hpui.username like concat('%',#{record.partnerName},'%')
|
||||
</if>
|
||||
<if test="record.partnerMobile !=null and record.partnerMobile!=''">
|
||||
hpui.mobile like concat('%',#{record.partnerMobile},'%')
|
||||
and hpui.mobile like concat('%',#{record.partnerMobile},'%')
|
||||
</if>
|
||||
<if test="record.roomId !=null and record.roomId!=''">
|
||||
hpip.room_id = #{record.roomId}
|
||||
and hpip.room_id = #{record.roomId}
|
||||
</if>
|
||||
<if test="record.interviewerName !=null and record.interviewerName!=''">
|
||||
hpui.username like concat('%',#{record.interviewerName},'%')
|
||||
and hpui.username like concat('%',#{record.interviewerName},'%')
|
||||
</if>
|
||||
<if test="record.interviewerMobile !=null and record.interviewerMobile!=''">
|
||||
hpui.mobile like concat('%',#{record.interviewerMobile},'%')
|
||||
and hpui.mobile like concat('%',#{record.interviewerMobile},'%')
|
||||
</if>
|
||||
<if test="record.roomStatus !=null and record.roomStatus!=''">
|
||||
hpip.room_status = #{record.roomStatus}
|
||||
and hpip.room_status = #{record.roomStatus}
|
||||
</if>
|
||||
<if test="record.startTime !=null and record.startTime!=''">
|
||||
hpip.start_time <= #{record.startTime}
|
||||
and hpip.start_time >= #{record.startTime}
|
||||
</if>
|
||||
<if test="record.endTime !=null and record.endTime!=''">
|
||||
hpip.end_time >= #{record.endTime}
|
||||
and hpip.end_time <= #{record.endTime}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
@@ -289,7 +292,8 @@
|
||||
<select id="getInterviewInfo" resultType="com.cool.store.vo.interview.InterviewVO">
|
||||
select hpip.id as interviewPlanId,
|
||||
hpi.id as interviewId,
|
||||
hpi.qualify_verify_id as qualifyVerifyId,
|
||||
hpci.qualify_verify_id as qualifyVerifyId,
|
||||
hpci.intention_contract_no as intentionContractNo,
|
||||
hpi.pass_time as passTime,
|
||||
hpi.pass_reason as passReason,
|
||||
hpi.recorder as recorderId,
|
||||
@@ -317,6 +321,7 @@
|
||||
left join hy_partner_line_info hpll on hpip.partner_line_id = hpll.id
|
||||
left join hy_partner_user_info hpui on hpui.partner_id = hpip.partner_id
|
||||
left join hy_partner_interview hpi on hpip.id = hpi.interview_plan_id
|
||||
left join hy_partner_certification_info hpci on hpci.partner_interview_id = hpi.id
|
||||
where hpip.id = #{interviewPlanId}
|
||||
</select>
|
||||
<select id="selectBySelective" resultType="com.cool.store.entity.HyPartnerInterviewPlanDO">
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.cool.store.dto.mdm;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class CallbackDto {
|
||||
//
|
||||
// private Owner owner;
|
||||
//
|
||||
// private long modifiedTime;
|
||||
//
|
||||
// private Creator creator;
|
||||
//
|
||||
// private CreatorDepartment creatorDepartment;
|
||||
//
|
||||
// private String authCode;
|
||||
//
|
||||
// private Modifier modifier;
|
||||
//
|
||||
// private int amtDeposit;
|
||||
//
|
||||
// private FraSource fraSource;
|
||||
//
|
||||
// private String intendedSignerTel;
|
||||
//
|
||||
// private String sequenceNo;
|
||||
//
|
||||
// private String sequenceStatus;
|
||||
//
|
||||
// private String instanceId;
|
||||
//
|
||||
// private OwnerDepartment ownerDepartment;
|
||||
//
|
||||
// private SelfObject selfObject;
|
||||
//
|
||||
// private String name;
|
||||
//
|
||||
// private long createdTime;
|
||||
//
|
||||
// private String id;
|
||||
//
|
||||
// private long intendedSignDate;
|
||||
//
|
||||
// private String intendedSigner;
|
||||
//
|
||||
// private String systemsource;
|
||||
|
||||
}
|
||||
@@ -33,6 +33,12 @@ public class HyPartnerCertificationInfoDO implements Serializable {
|
||||
@ApiModelProperty("合作关系:1总部下属;2小区代直营;3县代直营;4县代下属;5区代直营;6区代下属")
|
||||
private String partnership;
|
||||
|
||||
@ApiModelProperty("资质审核流程id")
|
||||
private String qualifyVerifyId;
|
||||
|
||||
@ApiModelProperty("意向合同编号")
|
||||
private String intentionContractNo;
|
||||
|
||||
@ApiModelProperty("意向签约时间")
|
||||
private Date wantSignTime;
|
||||
|
||||
|
||||
@@ -54,11 +54,17 @@ public class HyPartnerInterviewDO implements Serializable {
|
||||
@ApiModelProperty("授权码")
|
||||
private String authCode;
|
||||
|
||||
@ApiModelProperty("资质审核流程id")
|
||||
private String qualifyVerifyId;
|
||||
@ApiModelProperty("通过函编码")
|
||||
private String passCode;
|
||||
|
||||
@ApiModelProperty("函文件url")
|
||||
private String passFileUrl;
|
||||
@ApiModelProperty("函文件Pdf url")
|
||||
private String passPdfUrl;
|
||||
|
||||
@ApiModelProperty("函文件image url")
|
||||
private String passImageUrl;
|
||||
|
||||
@ApiModelProperty("审核通过时间")
|
||||
private Date passTime;
|
||||
|
||||
@ApiModelProperty("有效期")
|
||||
private Date expiryDate;
|
||||
|
||||
@@ -12,9 +12,9 @@ import lombok.Data;
|
||||
@Data
|
||||
@ApiModel
|
||||
public class GetFreeBusyListReq {
|
||||
@ApiModelProperty("开始时间")
|
||||
@ApiModelProperty(value = "开始时间", required = true)
|
||||
private String startDate;
|
||||
@ApiModelProperty("结束时间")
|
||||
@ApiModelProperty(value = "结束时间",required = true)
|
||||
private String endDate;
|
||||
@ApiModelProperty("加盟商用户ID")
|
||||
private String partnerId;
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Api("资质审核回调入参")
|
||||
public class QualificationCallbackReq {
|
||||
|
||||
@ApiModelProperty(value = "审核流程id", required = true)
|
||||
private String instanceId;
|
||||
|
||||
@ApiModelProperty(value = "流程状态 已完成:FINISHED, 已作废:CANCELED", required = true)
|
||||
private String sequenceStatus;
|
||||
|
||||
@ApiModelProperty(value = "意向签约人", required = true)
|
||||
private String intendedSigner;
|
||||
|
||||
@ApiModelProperty(value = "审核通过时间", required = true)
|
||||
private long modifiedTime;
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.cool.store.service;
|
||||
|
||||
import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.request.CreateQualifyVerifyReq;
|
||||
import com.cool.store.request.QualificationCallbackReq;
|
||||
|
||||
/**
|
||||
* @Author: young.yu
|
||||
@@ -10,4 +11,6 @@ import com.cool.store.request.CreateQualifyVerifyReq;
|
||||
*/
|
||||
public interface FlowService {
|
||||
void createQualifyVerify(CreateQualifyVerifyReq request) throws ApiException;
|
||||
|
||||
void qualificationCallback(QualificationCallbackReq request);
|
||||
}
|
||||
|
||||
@@ -2,13 +2,14 @@ package com.cool.store.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.TypeReference;
|
||||
import com.cool.store.dao.EnterpriseUserDAO;
|
||||
import com.cool.store.dto.login.UserIdInfoDTO;
|
||||
import com.cool.store.dto.mdm.AccessTokenDTO;
|
||||
import com.cool.store.dto.response.MDMResultDTO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.DataSourceEnum;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.WorkflowStatusEnum;
|
||||
import com.cool.store.exception.ApiException;
|
||||
@@ -17,18 +18,28 @@ import com.cool.store.mapper.DingdingUserMapper;
|
||||
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.RpcCreateQualifyVerfyReq;
|
||||
import com.cool.store.request.RpcGetMdmTokenReq;
|
||||
import com.cool.store.service.FlowService;
|
||||
import com.cool.store.utils.PDFUtils;
|
||||
import com.cool.store.utils.PassLetterUtils;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import com.cool.store.utils.RestTemplateUtil;
|
||||
import com.cool.store.vo.PartnerPassLetterDetailVO;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -63,7 +74,11 @@ public class FlowServiceImpl implements FlowService {
|
||||
@Autowired
|
||||
private HyPartnerCertificationInfoMapper hyPartnerCertificationInfoMapper;
|
||||
|
||||
@Autowired
|
||||
private OSSServer ossServer;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void createQualifyVerify(CreateQualifyVerifyReq request) throws ApiException {
|
||||
//1.发起加盟商资质审核
|
||||
RpcCreateQualifyVerfyReq rpcRequest = new RpcCreateQualifyVerfyReq();
|
||||
@@ -96,7 +111,8 @@ public class FlowServiceImpl implements FlowService {
|
||||
rpcRequest.setIntendedSigner(request.getIntentionSignerUsername());
|
||||
rpcRequest.setIntendedSignerTel(request.getIntentionSignerMobile());
|
||||
|
||||
String qualifyVerifyId = createQualifyVerify(rpcRequest);
|
||||
//通过 rpc 请求审核系统获取返回数据
|
||||
Map<String, String> qualifyVerifyRespData = JSON.parseObject(createQualifyVerify(rpcRequest), new TypeReference<HashMap<String,String>>() {});
|
||||
//2.更新审核信息
|
||||
HyPartnerCertificationInfoDO partnerCertificationInfoDO = new HyPartnerCertificationInfoDO();
|
||||
partnerCertificationInfoDO.setPartnerId(request.getPartnerId());
|
||||
@@ -118,6 +134,10 @@ public class FlowServiceImpl implements FlowService {
|
||||
partnerCertificationInfoDO.setSignerRealControlRelationCert(request.getSignerRealControlRelationCert());
|
||||
partnerCertificationInfoDO.setCreateTime(new Date());
|
||||
partnerCertificationInfoDO.setUpdateTime(new Date());
|
||||
//set 资质审核流程id
|
||||
partnerCertificationInfoDO.setQualifyVerifyId(qualifyVerifyRespData.get("id"));
|
||||
//set 意向合同编号
|
||||
partnerCertificationInfoDO.setIntentionContractNo(qualifyVerifyRespData.get("sequenceNo"));
|
||||
hyPartnerCertificationInfoMapper.updateByPrimaryKeySelective(partnerCertificationInfoDO);
|
||||
//3.更新面试信息
|
||||
//根据面试id获取面试信息
|
||||
@@ -125,7 +145,6 @@ public class FlowServiceImpl implements FlowService {
|
||||
if (Objects.isNull(hyPartnerInterviewDO)) {
|
||||
throw new ServiceException(ErrorCodeEnum.INTERVIEW_NOT_EXIST);
|
||||
}
|
||||
hyPartnerInterviewDO.setQualifyVerifyId(qualifyVerifyId);
|
||||
hyPartnerInterviewDO.setUpdateTime(new Date());
|
||||
//更新
|
||||
hyPartnerInterviewDO.setStatus(Integer.valueOf(WorkflowStatusEnum.INTERVIEW_4.getCode()));
|
||||
@@ -133,12 +152,56 @@ public class FlowServiceImpl implements FlowService {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void qualificationCallback(QualificationCallbackReq request) {
|
||||
//1. 信息是否完整
|
||||
if (null == request.getSequenceStatus() || "".equals(request.getSequenceStatus())) {
|
||||
log.error("MDM回调入参缺失,request{}", JSON.toJSONString(request));
|
||||
throw new ServiceException("MDM回调错误!");
|
||||
}
|
||||
//根据审核流程 id 获取面试会议 id
|
||||
String interviewId = hyPartnerCertificationInfoMapper.getInterviewIdByQualifyVerifyId(request.getInstanceId());
|
||||
if (StringUtils.isEmpty(interviewId)) {
|
||||
throw new ServiceException(ErrorCodeEnum.INTERVIEW_NOT_EXIST);
|
||||
}
|
||||
HyPartnerInterviewDO interviewDO = new HyPartnerInterviewDO();
|
||||
interviewDO.setId(Long.parseLong(interviewId));
|
||||
//审核通过
|
||||
if ("FINISHED".equals(request.getSequenceStatus())) {
|
||||
interviewDO.setStatus(Integer.valueOf(WorkflowStatusEnum.INTERVIEW_6.getCode()));
|
||||
//2. 准备需要的信息
|
||||
String partnerName = request.getIntendedSigner();
|
||||
String verifyCity = hyPartnerInterviewMapper.getVerifyCityByInterviewId(interviewId);
|
||||
String[] split = verifyCity.split("/");
|
||||
//根据长度来取市级行政区域
|
||||
if (split.length == 2) {
|
||||
verifyCity = split[1];
|
||||
} else if (split.length == 3) {
|
||||
verifyCity = split[1];
|
||||
} else if (split.length == 4) {
|
||||
verifyCity = split[2];
|
||||
} else {
|
||||
throw new ServiceException(ErrorCodeEnum.INTENT_INFO_NOT_EXIST);
|
||||
}
|
||||
// TODO pass_reason 暂无
|
||||
Date passDate = new Date(request.getModifiedTime());
|
||||
//3. 生成通过函并修改数据库相关信息
|
||||
genPassLetterAndUpdateDB(partnerName, verifyCity, passDate, interviewId);
|
||||
//审核未通过
|
||||
} else if ("CANCELED".equals(request.getSequenceStatus())) {
|
||||
interviewDO.setStatus(Integer.valueOf(WorkflowStatusEnum.INTERVIEW_7.getCode()));
|
||||
}
|
||||
hyPartnerInterviewMapper.updateByPrimaryKeySelective(interviewDO);
|
||||
}
|
||||
|
||||
|
||||
public String createQualifyVerify(RpcCreateQualifyVerfyReq rpcRequest) throws ApiException{
|
||||
String url = mdmBaseUrl + "/api/openapi/runtime/form/startFraQualExam";
|
||||
String url = mdmBaseUrl + "/api/openapi/runtime/form/startFraQualExamWithData";
|
||||
ResponseEntity<MDMResultDTO> responseEntity = null;
|
||||
try {
|
||||
RpcGetMdmTokenReq rpcGetMDMTokenReq = new RpcGetMdmTokenReq();
|
||||
// TODO set appKey 与 appSecret
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
headers.put("Authorization", getMdmAccessToken(rpcGetMDMTokenReq));
|
||||
responseEntity = RestTemplateUtil.post(url, headers, rpcRequest, MDMResultDTO.class);
|
||||
@@ -185,4 +248,41 @@ public class FlowServiceImpl implements FlowService {
|
||||
String prefix = jobNumber + DateUtil.format(new Date(), "yyyyMMdd");
|
||||
return prefix + redisUtilPool.incrby(prefix, 1, 60 * 60 * 25);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成通知函上传 OSS 和修改数据库相应数据
|
||||
* @return passCode
|
||||
*/
|
||||
private void genPassLetterAndUpdateDB(String partnerName, String verifyCity, Date passTime, String interviewId) {
|
||||
try {
|
||||
String passCode = PassLetterUtils.genPassCode(passTime);
|
||||
//生成的 pdf 通过函内存输出流
|
||||
ByteArrayOutputStream pdfOut = PassLetterUtils.genPassLetter(partnerName, passCode, verifyCity, passTime);
|
||||
//生成的 pdf 通过函内存输入流
|
||||
ByteArrayInputStream inputStream = new ByteArrayInputStream(pdfOut.toByteArray());
|
||||
String passPdfUrl = ossServer.uploadFileServer(inputStream, "partner/passLetter/" + passCode + ".pdf");
|
||||
//转换为图片
|
||||
inputStream.reset();
|
||||
ByteArrayOutputStream imageOut = PDFUtils.pdf2Img(inputStream, 2.0f);
|
||||
inputStream = new ByteArrayInputStream(imageOut.toByteArray());
|
||||
//上传 OSS
|
||||
String passImageUrl = ossServer.uploadFileServer(inputStream, "partner/passLetter/" + passCode + ".png");
|
||||
//计算有效期截止日期
|
||||
DateTime expiryDate = DateUtil.offsetDay(passTime, 60);
|
||||
HyPartnerInterviewDO interviewDO = new HyPartnerInterviewDO();
|
||||
interviewDO.setId(Long.parseLong(interviewId));
|
||||
interviewDO.setPassCode(passCode);
|
||||
interviewDO.setPassTime(passTime);
|
||||
interviewDO.setExpiryDate(expiryDate);
|
||||
interviewDO.setPassPdfUrl(passPdfUrl);
|
||||
interviewDO.setPassImageUrl(passImageUrl);
|
||||
hyPartnerInterviewMapper.updateByPrimaryKeySelective(interviewDO);
|
||||
inputStream.close();
|
||||
pdfOut.close();
|
||||
imageOut.close();
|
||||
} catch (Exception e) {
|
||||
log.error("资格面试通过函生成失败 e{}", e.getMessage());
|
||||
throw new ServiceException("通过函生成失败!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,9 +3,6 @@ package com.cool.store.service.impl;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.cool.store.dto.calendar.UpdateCalendarEventDTO;
|
||||
import com.cool.store.dto.calendar.UserCalendarsEventDTO;
|
||||
import com.cool.store.dto.partner.EnterInterviewDto;
|
||||
import com.cool.store.entity.HyPartnerInterviewPlanDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
@@ -14,27 +11,23 @@ import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.HyPartnerInterviewMapper;
|
||||
import com.cool.store.mapper.HyPartnerInterviewPlanMapper;
|
||||
import com.cool.store.oss.OSSServer;
|
||||
import com.cool.store.request.ModifyInterviewTimeReq;
|
||||
import com.cool.store.service.PartnerInterviewService;
|
||||
import com.cool.store.utils.PDFUtils;
|
||||
import com.cool.store.utils.PassLetterUtils;
|
||||
import com.cool.store.utils.TRTCUtils;
|
||||
import com.cool.store.vo.EnterInterviewVO;
|
||||
import com.cool.store.vo.PartnerInterviewInfoVO;
|
||||
import com.cool.store.vo.PartnerPassLetterDetailVO;
|
||||
import com.cool.store.vo.interview.InterviewVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.Date;
|
||||
|
||||
import static com.cool.store.utils.PDFUtils.pdf2Img;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class PartnerInterviewServiceImpl implements PartnerInterviewService {
|
||||
|
||||
@Autowired
|
||||
@@ -43,9 +36,6 @@ public class PartnerInterviewServiceImpl implements PartnerInterviewService {
|
||||
@Autowired
|
||||
private HyPartnerInterviewPlanMapper interviewPlanMapper;
|
||||
|
||||
@Autowired
|
||||
private OSSServer ossServer;
|
||||
|
||||
@Value("${trtc.sdkAppId}")
|
||||
private Long sdkAppId;
|
||||
|
||||
@@ -110,17 +100,8 @@ public class PartnerInterviewServiceImpl implements PartnerInterviewService {
|
||||
} else if (split.length == 4) {
|
||||
vo.setVerifyCity(split[2]);
|
||||
} else {
|
||||
System.out.println("wrong");
|
||||
throw new ServiceException(ErrorCodeEnum.INTENT_INFO_NOT_EXIST);
|
||||
}
|
||||
verifyCity = vo.getVerifyCity();
|
||||
// 调用生成通过函和修改数据库数据的方法
|
||||
String passCode = genPassLetterAndUpdateDB(vo, interviewPlanId);
|
||||
//再查一次 vo
|
||||
vo = interviewMapper.getPassLetterDetail(interviewPlanId);
|
||||
//有效期为审批通过次日起第 60 天的 23:59:59,由此倒推 createTime
|
||||
DateTime expiryDate = DateUtil.parseDate(vo.getExpiryDate());
|
||||
DateTime createTime = DateUtil.offsetDay(expiryDate, -60);
|
||||
vo.setCreateTime(DateUtil.format(createTime, "yyyy-MM-dd"));
|
||||
vo.setVerifyCity((verifyCity));
|
||||
return vo;
|
||||
}
|
||||
@@ -143,37 +124,4 @@ public class PartnerInterviewServiceImpl implements PartnerInterviewService {
|
||||
interviewPlanMapper.updateByPrimaryKeySelective(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成通知函上传 OSS 和修改数据库相应数据
|
||||
* @return passCode
|
||||
*/
|
||||
private String genPassLetterAndUpdateDB(PartnerPassLetterDetailVO passLetterDetail, String interviewId) {
|
||||
//已经有文件 URL 的话就不要再生成了,默认上游全部数据都正确
|
||||
if (ObjectUtil.isEmpty(passLetterDetail.getPassPdfUrl()) || ObjectUtil.isEmpty(passLetterDetail.getPassImageUrl())) {
|
||||
try {
|
||||
DateTime createTime = DateUtil.date();
|
||||
String code = passLetterDetail.getPassCode() == null ? PassLetterUtils.genPassCode(createTime) : passLetterDetail.getPassCode();
|
||||
//生成的 pdf 通过函内存输出流
|
||||
ByteArrayOutputStream pdfOut = PassLetterUtils.genPassLetter(passLetterDetail.getPartnerName(), code, passLetterDetail.getVerifyCity(), createTime);
|
||||
//生成的 pdf 通过函内存输入流
|
||||
ByteArrayInputStream inputStream = new ByteArrayInputStream(pdfOut.toByteArray());
|
||||
String passPdfUrl = ossServer.uploadFileServer(inputStream, "partner/passLetter/" + code + ".pdf");
|
||||
//转换为图片
|
||||
inputStream.reset();
|
||||
ByteArrayOutputStream imageOut = PDFUtils.pdf2Img(inputStream, 2.0f);
|
||||
inputStream = new ByteArrayInputStream(imageOut.toByteArray());
|
||||
//上传 OSS
|
||||
String passImageUrl = ossServer.uploadFileServer(inputStream, "partner/passLetter/" + code + ".png");
|
||||
//计算有效期截止日期
|
||||
DateTime expiryDate = DateUtil.offsetDay(createTime, 60);
|
||||
String expiryDateStr = DateUtil.format(expiryDate, "yyyy-MM-dd") + " 23:59:59";
|
||||
interviewMapper.updatePassLetterInfo(code, passPdfUrl, passImageUrl, expiryDateStr, interviewId);
|
||||
inputStream.close();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
return passLetterDetail.getPassCode();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.cool.store.service.ContentService;
|
||||
import com.cool.store.vo.HyContentInfoVO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -18,6 +19,7 @@ import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("news")
|
||||
@Api(tags = "动态")
|
||||
@Slf4j
|
||||
public class ContentController {
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.cool.store.controller;
|
||||
import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.request.CreateQualifyVerifyReq;
|
||||
import com.cool.store.request.FinishInterviewReq;
|
||||
import com.cool.store.request.QualificationCallbackReq;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.FlowService;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -34,8 +35,9 @@ public class FlowController {
|
||||
|
||||
@PostMapping("/qualificationReview/callback")
|
||||
@ApiOperation("流程信息回调接口")
|
||||
public ResponseResult qualificationCallback() {
|
||||
return null;
|
||||
public ResponseResult qualificationCallback(@RequestBody QualificationCallbackReq request) {
|
||||
flowService.qualificationCallback(request);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.cool.store.controller;
|
||||
|
||||
import com.cool.store.dto.content.ContentQueryListDto;
|
||||
import com.cool.store.entity.HyContentInfoDO;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.ContentService;
|
||||
import com.cool.store.vo.HyContentInfoVO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("news")
|
||||
@Api(tags = "动态")
|
||||
@Slf4j
|
||||
public class ContentController {
|
||||
|
||||
@Autowired
|
||||
private ContentService contentService;
|
||||
|
||||
@PostMapping("/queryContentList")
|
||||
@ApiOperation("查询动态列表")
|
||||
public ResponseResult<PageInfo<HyContentInfoVO>> queryContentList(@RequestBody ContentQueryListDto dto) {
|
||||
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
|
||||
List<HyContentInfoVO> list = contentService.queryContentList(dto);
|
||||
PageInfo<HyContentInfoVO> page = new PageInfo<>(list);
|
||||
return ResponseResult.success(page);
|
||||
}
|
||||
|
||||
@PostMapping("/detail")
|
||||
@ApiOperation("动态详情")
|
||||
public ResponseResult<HyContentInfoDO> queryContentInfo(@RequestParam String contentId) {
|
||||
return ResponseResult.success(contentService.queryContentInfo(contentId));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user