Merge remote-tracking branch 'origin/cc_20230520_partner' into cc_20230520_partner
This commit is contained in:
@@ -120,4 +120,6 @@ public class CommonConstants {
|
||||
|
||||
public static final String TRANSFER = "transfer";
|
||||
|
||||
public static final String FIX_MOBILE_OPENID_TEST = "HSAY5531DA7";
|
||||
public static final String FIX_MOBILE_OPENID_ONLINE = "HSAY4AF322E";
|
||||
}
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
package com.cool.store.utils;
|
||||
|
||||
import com.cool.store.exception.ServiceException;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.charset.Charset;
|
||||
import java.security.InvalidAlgorithmParameterException;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.Arrays;
|
||||
|
||||
import javax.crypto.BadPaddingException;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.IllegalBlockSizeException;
|
||||
import javax.crypto.KeyGenerator;
|
||||
import javax.crypto.NoSuchPaddingException;
|
||||
import javax.crypto.SecretKey;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
|
||||
/**
|
||||
* https://cloud.tencent.com/developer/article/1823249
|
||||
* 前后端约定
|
||||
*/
|
||||
public class AESDecryptor {
|
||||
|
||||
private static String Algorithm = "AES";
|
||||
private static String AlgorithmProvider = "AES/CBC/PKCS5Padding"; //算法/模式/补码方式
|
||||
|
||||
public static byte[] generatorKey() throws NoSuchAlgorithmException {
|
||||
KeyGenerator keyGenerator = KeyGenerator.getInstance(Algorithm);
|
||||
keyGenerator.init(256);//默认128,获得无政策权限后可为192或256
|
||||
SecretKey secretKey = keyGenerator.generateKey();
|
||||
return secretKey.getEncoded();
|
||||
}
|
||||
|
||||
public static IvParameterSpec getIv(byte[] ivstr) throws UnsupportedEncodingException {
|
||||
IvParameterSpec ivParameterSpec = new IvParameterSpec(ivstr);
|
||||
return ivParameterSpec;
|
||||
}
|
||||
|
||||
public static String encrypt(String src, String keystr, IvParameterSpec iv) throws
|
||||
NoSuchAlgorithmException,
|
||||
NoSuchPaddingException,
|
||||
InvalidKeyException,
|
||||
IllegalBlockSizeException,
|
||||
BadPaddingException,
|
||||
UnsupportedEncodingException,
|
||||
InvalidAlgorithmParameterException {
|
||||
byte[] key = keystr.getBytes("utf-8");
|
||||
SecretKey secretKey = new SecretKeySpec(key, Algorithm);
|
||||
IvParameterSpec ivParameterSpec = iv;
|
||||
Cipher cipher = Cipher.getInstance(AlgorithmProvider);
|
||||
cipher.init(Cipher.ENCRYPT_MODE, secretKey, ivParameterSpec);
|
||||
byte[] cipherBytes = cipher.doFinal(src.getBytes(Charset.forName("utf-8")));
|
||||
return byteToHexString(cipherBytes);
|
||||
}
|
||||
|
||||
public static String decrypt(String src, String keystr) {
|
||||
try {
|
||||
byte[] key = keystr.getBytes("utf-8");
|
||||
SecretKey secretKey = new SecretKeySpec(key, Algorithm);
|
||||
IvParameterSpec ivParameterSpec = getIv(Arrays.copyOfRange(keystr.getBytes("utf-8"), 0, 16));
|
||||
Cipher cipher = Cipher.getInstance(AlgorithmProvider);
|
||||
cipher.init(Cipher.DECRYPT_MODE, secretKey, ivParameterSpec);
|
||||
byte[] hexBytes = hexStringToBytes(src);
|
||||
byte[] plainBytes = cipher.doFinal(hexBytes);
|
||||
return new String(plainBytes, "utf-8");
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将byte转换为16进制字符串
|
||||
*
|
||||
* @param src
|
||||
* @return
|
||||
*/
|
||||
public static String byteToHexString(byte[] src) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < src.length; i++) {
|
||||
int v = src[i] & 0xff;
|
||||
String hv = Integer.toHexString(v);
|
||||
if (hv.length() < 2) {
|
||||
sb.append("0");
|
||||
}
|
||||
sb.append(hv);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 将16进制字符串装换为byte数组
|
||||
*
|
||||
* @param hexString
|
||||
* @return
|
||||
*/
|
||||
public static byte[] hexStringToBytes(String hexString) {
|
||||
hexString = hexString.toUpperCase();
|
||||
int length = hexString.length() / 2;
|
||||
char[] hexChars = hexString.toCharArray();
|
||||
byte[] b = new byte[length];
|
||||
for (int i = 0; i < length; i++) {
|
||||
int pos = i * 2;
|
||||
b[i] = (byte) (charToByte(hexChars[pos]) << 4 | charToByte(hexChars[pos + 1]));
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
private static byte charToByte(char c) {
|
||||
return (byte) "0123456789ABCDEF".indexOf(c);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
/* // 密钥必须是16的倍数
|
||||
String keystr = "0123456789ABCDEF";
|
||||
String ivstr = "0123456789101112";
|
||||
String src = "Hello World";
|
||||
|
||||
System.out.println("密钥:" + keystr);
|
||||
System.out.println("偏移量:" + ivstr);
|
||||
System.out.println("原字符串:" + src);
|
||||
IvParameterSpec iv = getIv(ivstr);
|
||||
String enc = encrypt(src, keystr, iv);
|
||||
System.out.println("加密:" + enc);
|
||||
*/
|
||||
String enc = "38395651e391c4b8ca327c4742b7f52f";
|
||||
String keystr = "77fea013c3a6459685b83c21a2fc3411";
|
||||
String ivstr = "77fea013c3a64596";
|
||||
// IvParameterSpec iv = getIv(ivstr);
|
||||
String dec = decrypt(enc, keystr);
|
||||
System.out.println("解密:" + dec);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -6,11 +6,10 @@ import com.cool.store.dto.partner.StageCountDTO;
|
||||
import com.cool.store.dto.partner.*;
|
||||
import com.cool.store.entity.HyPartnerLineInfoDO;
|
||||
import com.cool.store.mapper.HyPartnerLineInfoMapper;
|
||||
import com.cool.store.vo.LineFollowHistoryVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -91,9 +90,9 @@ public class HyPartnerLineInfoDAO {
|
||||
return hyPartnerLineInfoMapper.selectPartnerLineInfoAndBaseInfo(lineId);
|
||||
}
|
||||
|
||||
public PageInfo<HyPartnerLineInfoDO> lastMonthCloseLine(String userId, String lastMonthTodayDate){
|
||||
public List<HyPartnerLineInfoDO> lastMonthCloseLine(String userId, String lastMonthTodayDate){
|
||||
if (userId==null){
|
||||
return new PageInfo<>();
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return hyPartnerLineInfoMapper.lastMonthCloseLine(userId,lastMonthTodayDate);
|
||||
}
|
||||
@@ -115,7 +114,7 @@ public class HyPartnerLineInfoDAO {
|
||||
}
|
||||
|
||||
|
||||
public PageInfo<PartnerBlackListDTO> getBlackList( String userNameKeyword,String phoneKeyword, String intentArea , Integer acceptAdjustType){
|
||||
public List<PartnerBlackListDTO> getBlackList( String userNameKeyword,String phoneKeyword, String intentArea , Integer acceptAdjustType){
|
||||
return hyPartnerLineInfoMapper.getBlackList(userNameKeyword,phoneKeyword,intentArea,acceptAdjustType);
|
||||
}
|
||||
|
||||
@@ -127,10 +126,16 @@ public class HyPartnerLineInfoDAO {
|
||||
return hyPartnerLineInfoMapper.joinAndRemoveBlack(lineId,status,joinReason,removeReason);
|
||||
}
|
||||
|
||||
public PageInfo<PublicSeaLineDTO> getPublicSeaLineList( String userNameKeyword, String phoneKeyword, String intentArea, Integer acceptAdjustType, Date updateStartTime, Date updateEndTime, List<String> userIdList){
|
||||
public List<PublicSeaLineDTO> getPublicSeaLineList( String userNameKeyword, String phoneKeyword, String intentArea, Integer acceptAdjustType, Date updateStartTime, Date updateEndTime, List<String> userIdList){
|
||||
return hyPartnerLineInfoMapper.getPublicSeaLineList(userNameKeyword,phoneKeyword,intentArea,acceptAdjustType,updateStartTime,updateEndTime,userIdList);
|
||||
}
|
||||
|
||||
public List<PrivateSeaLineDTO> getPrivateSeaLineList(String keyword, String keywordType, String workflowStage, String workflowStatus, Date deadlineStart, Date deadlineEnd,
|
||||
String intentArea, Integer acceptAdjustType, String storeKeyword, String storeKeywordType, List<String> userIdList){
|
||||
return hyPartnerLineInfoMapper.getPrivateSeaLineList( keyword, keywordType, workflowStage, workflowStatus, deadlineStart, deadlineEnd,
|
||||
intentArea, acceptAdjustType, storeKeyword, storeKeywordType, userIdList);
|
||||
}
|
||||
|
||||
|
||||
public List<HyPartnerLineInfoDO> getPartnerLastLine(List<String> partnerIdList){
|
||||
if (CollectionUtils.isEmpty(partnerIdList)){
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -90,7 +90,7 @@ public interface HyPartnerLineInfoMapper {
|
||||
* @param lastMonthTodayDate
|
||||
* @return
|
||||
*/
|
||||
PageInfo<HyPartnerLineInfoDO> lastMonthCloseLine(@Param("userId") String userId,
|
||||
List<HyPartnerLineInfoDO> lastMonthCloseLine(@Param("userId") String userId,
|
||||
@Param("lastMonthTodayDate") String lastMonthTodayDate);
|
||||
|
||||
/**
|
||||
@@ -116,7 +116,7 @@ public interface HyPartnerLineInfoMapper {
|
||||
* @param acceptAdjustType
|
||||
* @return
|
||||
*/
|
||||
PageInfo<PartnerBlackListDTO> getBlackList(@Param("userNameKeyword") String userNameKeyword,
|
||||
List<PartnerBlackListDTO> getBlackList(@Param("userNameKeyword") String userNameKeyword,
|
||||
@Param("phoneKeyword") String phoneKeyword,
|
||||
@Param("intentArea") String intentArea ,
|
||||
@Param("acceptAdjustType") Integer acceptAdjustType);
|
||||
@@ -150,7 +150,7 @@ public interface HyPartnerLineInfoMapper {
|
||||
* @param userIdList
|
||||
* @return
|
||||
*/
|
||||
PageInfo<PublicSeaLineDTO> getPublicSeaLineList(@Param("userNameKeyword") String userNameKeyword,
|
||||
List<PublicSeaLineDTO> getPublicSeaLineList(@Param("userNameKeyword") String userNameKeyword,
|
||||
@Param("phoneKeyword") String phoneKeyword,
|
||||
@Param("intentArea") String intentArea,
|
||||
@Param("acceptAdjustType") Integer acceptAdjustType,
|
||||
@@ -158,6 +158,24 @@ public interface HyPartnerLineInfoMapper {
|
||||
@Param("updateEndTime") Date updateEndTime,
|
||||
@Param("userIdList") List<String> userIdList);
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<PrivateSeaLineDTO> getPrivateSeaLineList(@Param("keyword") String keyword,
|
||||
@Param("keywordType") String keywordType,
|
||||
@Param("workflowStage") String workflowStage,
|
||||
@Param("workflowStatus") String workflowStatus,
|
||||
@Param("deadlineStart") Date deadlineStart,
|
||||
@Param("deadlineEnd") Date deadlineEnd,
|
||||
@Param("intentArea") String intentArea,
|
||||
@Param("acceptAdjustType") Integer acceptAdjustType,
|
||||
@Param("storeKeyword") String storeKeyword,
|
||||
@Param("storeKeywordType") String storeKeywordType,
|
||||
@Param("userIdList") List<String> userIdList);
|
||||
|
||||
|
||||
/**
|
||||
* 查询对应的加盟商最近线索
|
||||
* @param partnerIdList
|
||||
|
||||
@@ -213,8 +213,8 @@
|
||||
<if test="mobile != null and mobile!=''">
|
||||
mobile = #{mobile},
|
||||
</if>
|
||||
where partner_id = #{partnerId}
|
||||
</set>
|
||||
where partner_id = #{partnerId}
|
||||
</update>
|
||||
|
||||
<select id="getByPartnerIdAndLineId" resultMap="BaseResultMap" >
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -432,6 +432,71 @@
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getPrivateSeaLineList" resultType="com.cool.store.dto.partner.PrivateSeaLineDTO">
|
||||
SELECT
|
||||
hpli.id as lineId,
|
||||
hpli.partner_id as partnerId,
|
||||
hpli.workflow_stage as workflowStage,
|
||||
hpli.workflow_status as workflowStatus,
|
||||
hpli.deadline as deadline,
|
||||
hpli.investment_manager as investmentManager,
|
||||
hpli.development_manager as developmentManager,
|
||||
hpli.line_status as lineStatus,
|
||||
hpli.update_time as updateTime,
|
||||
hpii.want_shop_area as wantShopArea,
|
||||
hpii.accept_adjust_type as acceptAdjustType,
|
||||
hpuinfo.username as partnerUserName,
|
||||
hpuinfo.mobile as partnerUserPhone,
|
||||
hpuinfo.shop_name as storeName,
|
||||
hpuinfo.recommend_partner_name as recommendPartnerName,
|
||||
eu.name as investmentManagerName
|
||||
FROM
|
||||
hy_partner_line_info hpli
|
||||
LEFT JOIN hy_partner_intent_info hpii ON hpli.id = hpii.partner_line_id
|
||||
LEFT JOIN hy_partner_user_info hpuinfo ON hpli.partner_id = hpuinfo.partner_id
|
||||
LEFT JOIN enterprise_user eu ON hpli.investment_manager = eu.user_id
|
||||
WHERE line_status in (1,2)
|
||||
<if test="keywordType!=null and keywordType=='name'">
|
||||
AND (eu.name like concat('%',#{keyword},'%') or hpuinfo.username like concat('%',#{keyword},'%'))
|
||||
</if>
|
||||
<if test="keywordType!=null and keywordType=='mobile'">
|
||||
AND ( eu.mobile like concat('%',#{keyword},'%') or hpuinfo.mobile like concat('%',#{keyword},'%')')
|
||||
</if>
|
||||
<if test="workflowStage!=null and workflowStage!=''">
|
||||
AND hpli.workflow_stage = #{workflowStage}
|
||||
</if>
|
||||
<if test="workflowStatus!=null and workflowStatus!=''">
|
||||
AND hpli.workflow_status = #workflowStatus}
|
||||
</if>
|
||||
<if test="deadlineStart!=null and deadlineEnd!=null">
|
||||
AND hpli.deadline BETWEEN #{deadlineStart} and #{deadlineStart}
|
||||
</if>
|
||||
<if test="intentArea!=null and intentArea!=''">
|
||||
AND hpuinfo.want_shop_area = #{intentArea}
|
||||
</if>
|
||||
<if test="acceptAdjustType!=null">
|
||||
AND hpuinfo.accept_adjust_type = #{acceptAdjustType}
|
||||
</if>
|
||||
<if test="storeKeywordType!=null and storeKeywordType==storeCode">
|
||||
AND hpuinfo.shop_code like concat('%',#{storeKeyword},'%')
|
||||
</if>
|
||||
<if test="storeKeywordType!=null and storeKeywordType==storeName">
|
||||
AND hpuinfo.shop_name like concat('%',#{storeKeyword},'%')
|
||||
</if>
|
||||
<if test="storeKeywordType!=null and storeKeywordType==partnerName">
|
||||
AND hpuinfo.recommend_partner_name like concat('%',#{storeKeyword},'%')
|
||||
</if>
|
||||
<if test="storeKeywordType!=null and storeKeywordType==partnerMobile">
|
||||
AND hpuinfo.recommend_partner_mobile like concat('%',#{storeKeyword},'%')
|
||||
</if>
|
||||
<if test="userIdList!=null and userIdList.size>0">
|
||||
<foreach collection="userIdList" item="userId" open="and a.investment_manager in (" close=")" separator=",">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getPartnerLastLine" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"></include>
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.cool.store.dto.partner;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/19 15:30
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class PrivateSeaLineDTO {
|
||||
|
||||
|
||||
@ApiModelProperty("线索ID")
|
||||
private Long lineId;
|
||||
|
||||
@ApiModelProperty("加盟商用户ID")
|
||||
private String partnerId;
|
||||
|
||||
@ApiModelProperty("流程阶段:1意向申请审核;2预约面试时间;3加盟资格面试;4分配选址开发经理;5商圈点位评估;6上传店铺租赁信息;7完善加盟签约信息;8支付加盟费用;9签订加盟合同")
|
||||
private String workflowStage;
|
||||
|
||||
@ApiModelProperty("流程子状态")
|
||||
private String workflowStatus;
|
||||
|
||||
@ApiModelProperty("加盟商用户名称")
|
||||
private String partnerUserName;
|
||||
|
||||
@ApiModelProperty("加盟商用户手机号")
|
||||
private String partnerUserPhone;
|
||||
|
||||
@ApiModelProperty("截止时间")
|
||||
private Date deadline;
|
||||
|
||||
@ApiModelProperty("招商经理")
|
||||
private String investmentManager;
|
||||
|
||||
@ApiModelProperty("招商经理名称")
|
||||
private String investmentManagerName;
|
||||
|
||||
|
||||
@ApiModelProperty("开发经理")
|
||||
private String developmentManager;
|
||||
|
||||
@ApiModelProperty("意向开店区域")
|
||||
private String wantShopArea;
|
||||
|
||||
@ApiModelProperty("0不接受调剂、1全国调剂、2省内调剂、3市内调剂")
|
||||
private Integer acceptAdjustType;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty("门店编码")
|
||||
private String storeCode;
|
||||
|
||||
@ApiModelProperty("门店名称")
|
||||
private String storeName;
|
||||
|
||||
@ApiModelProperty("线索状态")
|
||||
private Integer lineStatus;
|
||||
|
||||
@ApiModelProperty("推荐加盟商ID")
|
||||
private String recommendPartnerId;
|
||||
|
||||
@ApiModelProperty("推荐加盟商名称")
|
||||
private String recommendPartnerName;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -15,12 +15,18 @@ public class CreateQualifyVerifyReq {
|
||||
@ApiModelProperty(value = "线索id", required = true)
|
||||
private String lineId;
|
||||
|
||||
@ApiModelProperty(value = "会议安排id", required = true)
|
||||
private String interviewPlanId;
|
||||
|
||||
@ApiModelProperty(value = "会议id", required = true)
|
||||
private String interviewId;
|
||||
|
||||
@ApiModelProperty(value = "加盟商id", required = true)
|
||||
private String partnerId;
|
||||
|
||||
@ApiModelProperty(value = "开发主管用户id", required = true)
|
||||
private String devtDirectorId;
|
||||
|
||||
@ApiModelProperty(value = "面试表现记录", required = true)
|
||||
private String summary;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@@ -13,16 +14,17 @@ import java.util.Date;
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class PrivateSeaLineListRequest {
|
||||
public class PrivateSeaLineListRequest extends PageInfoRequest {
|
||||
|
||||
@ApiModelProperty("【用户姓名】、【手机号】、【招商经理姓名】或【招商经理手机号】 搜索关键字")
|
||||
private String keyword;
|
||||
|
||||
@ApiModelProperty("【用户姓名】、【手机号】、【招商经理姓名】或【招商经理手机号】")
|
||||
private String keyWord;
|
||||
@ApiModelProperty("name:表示用户姓名/招商经理姓名 mobile 用户手机号/招商经理手机号")
|
||||
private String keywordType;
|
||||
|
||||
@ApiModelProperty("一级下拉列表选择当前意向阶段")
|
||||
private String workflowStage;
|
||||
|
||||
|
||||
@ApiModelProperty("二级下拉列表可选项为当前一级下拉列表选中的意向阶段的状态")
|
||||
private String workflowStatus;
|
||||
|
||||
@@ -39,11 +41,9 @@ public class PrivateSeaLineListRequest {
|
||||
private Integer acceptAdjustType;
|
||||
|
||||
@ApiModelProperty("【推荐店铺编码】、【推荐店铺名称】、【加盟商姓名】或【手机号】")
|
||||
private String keyInfo;
|
||||
|
||||
|
||||
|
||||
|
||||
private String storeKeyword;
|
||||
@ApiModelProperty("【storeCode -推荐店铺编码】、【storeName 推荐店铺名称】、【partnerName 加盟商姓名】或【partnerMobile 手机号】")
|
||||
private String storeKeywordType;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -17,9 +17,9 @@ public class PrivateSeaLineListVo {
|
||||
|
||||
|
||||
@ApiModelProperty("线索ID")
|
||||
private Long id;
|
||||
private Long lineId;
|
||||
|
||||
@ApiModelProperty("hy_partner_user_info.partner_id")
|
||||
@ApiModelProperty("加盟商用户ID")
|
||||
private String partnerId;
|
||||
|
||||
@ApiModelProperty("流程阶段:1意向申请审核;2预约面试时间;3加盟资格面试;4分配选址开发经理;5商圈点位评估;6上传店铺租赁信息;7完善加盟签约信息;8支付加盟费用;9签订加盟合同")
|
||||
@@ -28,9 +28,6 @@ public class PrivateSeaLineListVo {
|
||||
@ApiModelProperty("流程子状态")
|
||||
private String workflowStatus;
|
||||
|
||||
@ApiModelProperty("加盟商用户ID")
|
||||
private String partnerUserId;
|
||||
|
||||
@ApiModelProperty("加盟商用户名称")
|
||||
private String partnerUserName;
|
||||
|
||||
@@ -43,12 +40,15 @@ public class PrivateSeaLineListVo {
|
||||
@ApiModelProperty("招商经理")
|
||||
private String investmentManager;
|
||||
|
||||
@ApiModelProperty("开发主管")
|
||||
private String developmentDirector;
|
||||
@ApiModelProperty("招商经理")
|
||||
private String investmentManagerName;
|
||||
|
||||
@ApiModelProperty("开发经理")
|
||||
private String developmentManager;
|
||||
|
||||
@ApiModelProperty("开发经理")
|
||||
private String developmentManagerName;
|
||||
|
||||
@ApiModelProperty("意向开店区域")
|
||||
private String wantShopArea;
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: young.yu
|
||||
* @Date: 2023-06-08 16:26
|
||||
@@ -22,6 +24,9 @@ public class InterviewVO {
|
||||
@ApiModelProperty("资质审核流程id")
|
||||
private String qualifyVerifyId;
|
||||
|
||||
@ApiModelProperty("意向合同编号")
|
||||
private String intentionContractNo;
|
||||
|
||||
@ApiModelProperty("审核通过时间")
|
||||
private String passTime;
|
||||
|
||||
@@ -76,7 +81,10 @@ public class InterviewVO {
|
||||
@ApiModelProperty(value = "预约状态 0 待预约;1待面试;2已开始;3待审核;4审批中;5审批通过;6拒绝", required = true)
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "面试过程信息", required = false)
|
||||
@ApiModelProperty(value = "面试过程信息视频URL数组", required = true)
|
||||
private List<String> vedioList;
|
||||
|
||||
@ApiModelProperty(value = "面试过程信息未解析String", required = false)
|
||||
private String processInfo;
|
||||
|
||||
@ApiModelProperty("授权码")
|
||||
|
||||
@@ -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,6 +2,7 @@ package com.cool.store.service;
|
||||
|
||||
import com.cool.store.request.CloseFollowRequest;
|
||||
import com.cool.store.request.LineRequest;
|
||||
import com.cool.store.request.PrivateSeaLineListRequest;
|
||||
import com.cool.store.vo.*;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
@@ -104,6 +105,15 @@ public interface HyPartnerLineInfoService {
|
||||
*/
|
||||
PageInfo<PublicSeaLineListVo> publicSeaLineList(String userId,LineRequest lineRequest);
|
||||
|
||||
|
||||
/**
|
||||
* 私海列表
|
||||
* @param userId
|
||||
* @param privateSeaLineListRequest
|
||||
* @return
|
||||
*/
|
||||
PageInfo<PrivateSeaLineListVo> privateSeaLineList(String userId, PrivateSeaLineListRequest privateSeaLineListRequest) ;
|
||||
|
||||
PartnerLineBaseInfoVO getPartnerLinBaseInfo(String partnerId);
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,8 +18,8 @@ public interface InterviewService {
|
||||
List<InterviewVO> getInterviewList(GetInterviewListReq request);
|
||||
|
||||
/**
|
||||
* 根据面试会议id查询面试信息
|
||||
* @param interviewId
|
||||
* 根据面试会议计划id查询面试信息
|
||||
* @param interviewPlanId
|
||||
* @return
|
||||
*/
|
||||
InterviewVO getInterviewInfo(String interviewPlanId);
|
||||
|
||||
@@ -14,7 +14,7 @@ public interface WechatMiniAppService {
|
||||
|
||||
PartnerUserInfoVO miniProgramLogin(MiniProgramLoginDTO param);
|
||||
|
||||
Boolean updateUserPhoneNumber(MobileUpdateRequest request, PartnerUserInfoVO userInfoVO);
|
||||
String updateUserPhoneNumber(MobileUpdateRequest request, PartnerUserInfoVO userInfoVO);
|
||||
|
||||
PartnerUserInfoVO getUserInfo(String mobile, String openId);
|
||||
}
|
||||
|
||||
@@ -96,10 +96,10 @@ public class FeiShuServiceImpl implements FeiShuService {
|
||||
long endTimeLong = DateUtil.parse(endStr).getTime();
|
||||
|
||||
for (UserFreeBusyInfoDTO userFreeBusyInfoDTO : UserFreeBusyInfoList) {
|
||||
//如果查询结果中的开始时间和结束时间在时间段内,则设置为忙碌
|
||||
if (( userFreeBusyInfoDTO.getStartTime()>startTimeLong && userFreeBusyInfoDTO.getStartTime() < endTimeLong)
|
||||
|| (userFreeBusyInfoDTO.getEndTime() > startTimeLong && userFreeBusyInfoDTO.getEndTime() < endTimeLong)) {
|
||||
//比较两个时间段是否有重叠
|
||||
if(!(endTimeLong <= userFreeBusyInfoDTO.getStartTime() || startTimeLong >= userFreeBusyInfoDTO.getEndTime())){
|
||||
freeBusyInfo.setFree(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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,15 +152,59 @@ 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);
|
||||
responseEntity = RestTemplateUtil.post(url, headers, rpcRequest, MDMResultDTO.class);
|
||||
log.info("url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
|
||||
if (Objects.nonNull(responseEntity.getBody()) && responseEntity.getBody().isSuccess()) {
|
||||
return JSONObject.toJSONString(responseEntity.getBody().getData());
|
||||
@@ -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("通过函生成失败!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import com.cool.store.enums.WorkflowStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.request.CloseFollowRequest;
|
||||
import com.cool.store.request.LineRequest;
|
||||
import com.cool.store.request.PrivateSeaLineListRequest;
|
||||
import com.cool.store.service.HyPartnerLineInfoService;
|
||||
import com.cool.store.utils.CoolDateUtils;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
@@ -92,7 +93,7 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
public PageInfo<PartnerLineInfoVO> lastMonthCloseLine(String userId, Integer pageSize, Integer pageNumber) {
|
||||
PageHelper.startPage(pageNumber,pageSize);
|
||||
String lastMonthTodayDate = DateUtil.format(CoolDateUtils.getDateBefore(new Date(),-30), CoolDateUtils.DATE_FORMAT_SEC);
|
||||
PageInfo hyPartnerLineInfoDOPageInfo = hyPartnerLineInfoDAO.lastMonthCloseLine(userId, lastMonthTodayDate);
|
||||
PageInfo hyPartnerLineInfoDOPageInfo = new PageInfo(hyPartnerLineInfoDAO.lastMonthCloseLine(userId, lastMonthTodayDate));
|
||||
|
||||
List<HyPartnerLineInfoDO> list = hyPartnerLineInfoDOPageInfo.getList();
|
||||
List<PartnerLineInfoVO> result = new ArrayList<>();
|
||||
@@ -150,7 +151,7 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
@Override
|
||||
public PageInfo<BlackListVO> getBlackList(LineRequest LineRequest) {
|
||||
PageHelper.startPage(LineRequest.getPageNum(),LineRequest.getPageSize());
|
||||
PageInfo blackListDTOPageInfo = hyPartnerLineInfoDAO.getBlackList(LineRequest.getUserNameKeyword(), LineRequest.getPhoneKeyword(),LineRequest.getIntentArea(), LineRequest.getAcceptAdjustType());
|
||||
PageInfo blackListDTOPageInfo = new PageInfo(hyPartnerLineInfoDAO.getBlackList(LineRequest.getUserNameKeyword(), LineRequest.getPhoneKeyword(),LineRequest.getIntentArea(), LineRequest.getAcceptAdjustType()));
|
||||
List<PartnerBlackListDTO> list = blackListDTOPageInfo.getList();
|
||||
List<BlackListVO> result = new ArrayList<>();
|
||||
list.stream().forEach(x->{
|
||||
@@ -256,8 +257,8 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
userIds = Arrays.asList(userId);
|
||||
}
|
||||
PageHelper.startPage(lineRequest.getPageNum(),lineRequest.getPageSize());
|
||||
PageInfo publicSeaLineList = hyPartnerLineInfoDAO.getPublicSeaLineList(lineRequest.getUserNameKeyword(), lineRequest.getPhoneKeyword(),
|
||||
lineRequest.getIntentArea(), lineRequest.getAcceptAdjustType(), lineRequest.getUpdateStartTime(), lineRequest.getUpdateEndTime(), userIds);
|
||||
PageInfo publicSeaLineList = new PageInfo(hyPartnerLineInfoDAO.getPublicSeaLineList(lineRequest.getUserNameKeyword(), lineRequest.getPhoneKeyword(),
|
||||
lineRequest.getIntentArea(), lineRequest.getAcceptAdjustType(), lineRequest.getUpdateStartTime(), lineRequest.getUpdateEndTime(), userIds));
|
||||
|
||||
List<PublicSeaLineDTO> list = publicSeaLineList.getList();
|
||||
if (CollectionUtils.isEmpty(list)){
|
||||
@@ -302,6 +303,52 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
return publicSeaLineList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<PrivateSeaLineListVo> privateSeaLineList(String userId, PrivateSeaLineListRequest request) {
|
||||
// TODO: 2023/6/19 su userlist计算
|
||||
PageHelper.startPage(request.getPageNum(),request.getPageSize());
|
||||
PageInfo privateLineList = new PageInfo(hyPartnerLineInfoDAO.getPrivateSeaLineList(request.getKeyword(), request.getKeywordType(), request.getWorkflowStage(),
|
||||
request.getWorkflowStatus(), request.getDeadlineStart(), request.getDeadlineEnd(),
|
||||
request.getIntentArea(), request.getAcceptAdjustType(), request.getStoreKeyword(), request.getStoreKeywordType(), null));
|
||||
List<PrivateSeaLineDTO> list = privateLineList.getList();
|
||||
if (CollectionUtils.isEmpty(list)){
|
||||
return new PageInfo<>();
|
||||
}
|
||||
Map<String, String> devManagerMap = new HashMap<>();
|
||||
List<String> devManagerIdList = list.stream().filter(x -> StringUtils.isNotEmpty(x.getDevelopmentManager())).map(PrivateSeaLineDTO::getDevelopmentManager).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(devManagerIdList)){
|
||||
List<EnterpriseUserDO> devManagerList = enterpriseUserDAO.getUserInfoByUserIds(devManagerIdList);
|
||||
devManagerMap = devManagerList.stream().collect(Collectors.toMap(EnterpriseUserDO::getUserId, EnterpriseUserDO::getName));
|
||||
}
|
||||
List<PrivateSeaLineListVo> result = new ArrayList<>();
|
||||
|
||||
Map<String, String> finalDevManagerMap = devManagerMap;
|
||||
list.forEach(x->{
|
||||
PrivateSeaLineListVo privateSeaLineListVo = new PrivateSeaLineListVo();
|
||||
privateSeaLineListVo.setLineId(x.getLineId());
|
||||
privateSeaLineListVo.setLineStatus(x.getLineStatus());
|
||||
privateSeaLineListVo.setPartnerId(x.getPartnerId());
|
||||
privateSeaLineListVo.setDeadline(x.getDeadline());
|
||||
privateSeaLineListVo.setPartnerUserPhone(x.getPartnerUserPhone());
|
||||
privateSeaLineListVo.setAcceptAdjustType(x.getAcceptAdjustType());
|
||||
privateSeaLineListVo.setInvestmentManagerName(x.getInvestmentManager());
|
||||
privateSeaLineListVo.setDevelopmentManager(x.getDevelopmentManager());
|
||||
privateSeaLineListVo.setInvestmentManagerName(x.getInvestmentManagerName());
|
||||
privateSeaLineListVo.setStoreCode(x.getStoreCode());
|
||||
privateSeaLineListVo.setStoreName(x.getStoreName());
|
||||
privateSeaLineListVo.setUpdateTime(x.getUpdateTime());
|
||||
privateSeaLineListVo.setRecommendPartnerId(x.getRecommendPartnerId());
|
||||
privateSeaLineListVo.setRecommendPartnerName(x.getRecommendPartnerName());
|
||||
privateSeaLineListVo.setWorkflowStage(x.getWorkflowStage());
|
||||
privateSeaLineListVo.setWantShopArea(x.getWantShopArea());
|
||||
privateSeaLineListVo.setWorkflowStage(x.getWorkflowStage());
|
||||
privateSeaLineListVo.setDevelopmentManagerName(finalDevManagerMap.get(x.getDevelopmentManager()));
|
||||
result.add(privateSeaLineListVo);
|
||||
});
|
||||
privateLineList.setList(result);
|
||||
return privateLineList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PartnerLineBaseInfoVO getPartnerLinBaseInfo(String partnerId) {
|
||||
PartnerLineBaseInfoVO lineBaseInfoVO = new PartnerLineBaseInfoVO();
|
||||
|
||||
@@ -33,6 +33,7 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
@@ -73,6 +74,12 @@ public class InterviewServiceImpl implements InterviewService {
|
||||
@Override
|
||||
public InterviewVO getInterviewInfo(String interviewPlanId) {
|
||||
InterviewVO vo = hyPartnerInterviewPlanMapper.getInterviewInfo(interviewPlanId);
|
||||
//将 processInfo 解析为 List
|
||||
if (!StringUtils.isEmpty(vo.getProcessInfo())) {
|
||||
List<String> split = Arrays.asList(vo.getProcessInfo().split(","));
|
||||
vo.setVedioList(split);
|
||||
vo.setProcessInfo("");
|
||||
}
|
||||
//查询面试官和记录人信息
|
||||
EnterpriseUserBaseInfoVO interviewerInfo = hyPartnerInterviewPlanMapper.getEnterpriseUserBaseInfo(vo.getInterviewerId());
|
||||
vo.setInterviewerName(interviewerInfo.getName());
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -120,7 +120,8 @@ public class WechatMiniAppServiceImpl implements WechatMiniAppService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateUserPhoneNumber(MobileUpdateRequest request, PartnerUserInfoVO userInfoVO) {
|
||||
public String updateUserPhoneNumber(MobileUpdateRequest request, PartnerUserInfoVO userInfoVO) {
|
||||
String newMobile = "";
|
||||
HyPartnerUserInfoDO oldUserInfo = hyPartnerUserInfoDAO.selectByMobile(userInfoVO.getMobile());
|
||||
if (oldUserInfo == null) {
|
||||
throw new ServiceException(ErrorCodeEnum.PARTNER_USER_NOT_EXIST);
|
||||
@@ -130,19 +131,26 @@ public class WechatMiniAppServiceImpl implements WechatMiniAppService {
|
||||
// 获取手机号码
|
||||
PhoneInfoDTO phoneInfoDTO = wechatRest.getUserPhoneNumber(request.getMobileCode(), accessToken);
|
||||
if(phoneInfoDTO != null && phoneInfoDTO.getPhoneInfo() != null && StringUtils.isNotBlank(phoneInfoDTO.getPhoneInfo().getPhoneNumber())){
|
||||
HyPartnerUserInfoDO newUserInfo = hyPartnerUserInfoDAO.selectByMobile(phoneInfoDTO.getPhoneInfo().getPhoneNumber());
|
||||
newMobile = phoneInfoDTO.getPhoneInfo().getPhoneNumber();
|
||||
HyPartnerUserInfoDO newUserInfo = hyPartnerUserInfoDAO.selectByMobile(newMobile);
|
||||
if (newUserInfo != null) {
|
||||
throw new ServiceException(ErrorCodeEnum.NEW_MOBILE_HAS_EXIST);
|
||||
}
|
||||
oldUserInfo.setMobile(phoneInfoDTO.getPhoneInfo().getPhoneNumber());
|
||||
oldUserInfo.setMobile(newMobile);
|
||||
hyPartnerUserInfoDAO.updateByPrimaryKeySelective(oldUserInfo);
|
||||
}
|
||||
return true;
|
||||
return newMobile;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PartnerUserInfoVO getUserInfo(String mobile, String openId) {
|
||||
PartnerUserInfoVO userInfoVO = new PartnerUserInfoVO();
|
||||
if(CommonConstants.FIX_MOBILE_OPENID_TEST.equals(mobile) || CommonConstants.FIX_MOBILE_OPENID_ONLINE.equals(mobile) ){
|
||||
userInfoVO.setMobile(mobile);
|
||||
userInfoVO.setOpenid(mobile);
|
||||
userInfoVO.setPartnerId("");
|
||||
return userInfoVO;
|
||||
}
|
||||
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByMobile(mobile);
|
||||
BeanUtil.copyProperties(hyPartnerUserInfoDO, userInfoVO);
|
||||
HyPartnerUserPlatformBindDO hyPartnerUserPlatformBindDO = hyPartnerUserPlatformBindDAO.getByPartnerId(hyPartnerUserInfoDO.getPartnerId());
|
||||
|
||||
@@ -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,8 +3,10 @@ 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;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -17,6 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* @Date: 2023-06-14 13:47
|
||||
* @Description: 流程相关
|
||||
*/
|
||||
@Api(tags = "流程相关接口")
|
||||
@RestController
|
||||
@RequestMapping({"/flow"})
|
||||
public class FlowController {
|
||||
@@ -32,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,26 @@
|
||||
package com.cool.store.config;
|
||||
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
/**
|
||||
* @Author: JCccc
|
||||
* @Date: 2022-6-12 10:35
|
||||
* @Description:
|
||||
*/
|
||||
public class BodyWrapperFilter implements Filter {
|
||||
@Override
|
||||
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
|
||||
ServletRequest requestWrapper = null;
|
||||
if(servletRequest instanceof HttpServletRequest) {
|
||||
requestWrapper = new CustomHttpServletRequestWrapper((HttpServletRequest) servletRequest);
|
||||
}
|
||||
if(requestWrapper == null) {
|
||||
filterChain.doFilter(servletRequest, servletResponse);
|
||||
} else {
|
||||
filterChain.doFilter(requestWrapper, servletResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.cool.store.config;
|
||||
|
||||
import javax.servlet.ReadListener;
|
||||
import javax.servlet.ServletInputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletRequestWrapper;
|
||||
import java.io.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
/**
|
||||
* @Author: JCccc
|
||||
* @Date: 2022-6-12 10:36
|
||||
* @Description: 重写一个自己的 RequestWrapper 拿出body给自己用
|
||||
*/
|
||||
|
||||
public class CustomHttpServletRequestWrapper extends HttpServletRequestWrapper {
|
||||
private byte[] body;
|
||||
public CustomHttpServletRequestWrapper(HttpServletRequest request) throws IOException {
|
||||
super(request);
|
||||
BufferedReader reader = request.getReader();
|
||||
try (StringWriter writer = new StringWriter()) {
|
||||
int read;
|
||||
char[] buf = new char[1024 * 8];
|
||||
while ((read = reader.read(buf)) != -1) {
|
||||
writer.write(buf, 0, read);
|
||||
}
|
||||
this.body = writer.getBuffer().toString().getBytes();
|
||||
}
|
||||
}
|
||||
public String getBody(){
|
||||
return new String(body, StandardCharsets.UTF_8);
|
||||
}
|
||||
@Override
|
||||
public ServletInputStream getInputStream() {
|
||||
final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(body);
|
||||
return new ServletInputStream() {
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean isReady() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setReadListener(ReadListener readListener) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int read() {
|
||||
return byteArrayInputStream.read();
|
||||
}
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public BufferedReader getReader() {
|
||||
return new BufferedReader(new InputStreamReader(this.getInputStream()));
|
||||
}
|
||||
}
|
||||
@@ -7,10 +7,7 @@ import com.cool.store.context.PartnerUserHolder;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.WechatMiniAppService;
|
||||
import com.cool.store.utils.AesUtil;
|
||||
import com.cool.store.utils.Md5Utils;
|
||||
import com.cool.store.utils.Sha1Utils;
|
||||
import com.cool.store.utils.UUIDUtils;
|
||||
import com.cool.store.utils.*;
|
||||
import com.cool.store.vo.PartnerUserInfoVO;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -26,8 +23,10 @@ import javax.servlet.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author ydw
|
||||
@@ -81,41 +80,51 @@ public class SignValidateFilter implements Filter {
|
||||
MDC.put(CommonConstants.REQUEST_ID, UUIDUtils.get32UUID());
|
||||
HttpServletResponse response = (HttpServletResponse) servletResponse;
|
||||
HttpServletRequest request = (HttpServletRequest) servletRequest;
|
||||
CustomHttpServletRequestWrapper wrapper = (CustomHttpServletRequestWrapper) request;
|
||||
String uri = request.getRequestURI();
|
||||
String method = request.getMethod();
|
||||
String userStr = "";
|
||||
boolean isInWhiteList = excludePath(uri);
|
||||
log.info("url:{}", uri);
|
||||
/* if ( !isInWhiteList && !method.equals("OPTIONS")) {
|
||||
Map<String, String[]> parameterMap = request.getParameterMap();
|
||||
String jsonStr = JSONObject.toJSONString(parameterMap);
|
||||
JSONObject obj = JSONObject.parseObject(jsonStr);
|
||||
log.info("params:{}", obj.toJSONString());
|
||||
String params = obj.toJSONString();
|
||||
if ( !isInWhiteList && !method.equals("OPTIONS")) {
|
||||
String params = "";
|
||||
if("GET".equalsIgnoreCase(method)){
|
||||
Map<String, String> parameterMap = new HashMap();
|
||||
Map<String, String[]> requestMap = request.getParameterMap();
|
||||
for(String key : requestMap.keySet()){
|
||||
parameterMap.put(key, requestMap.get(key)[0]);
|
||||
}
|
||||
params = JSONObject.toJSONString(parameterMap);
|
||||
}else if("POST".equalsIgnoreCase(method)){
|
||||
params = wrapper.getBody();
|
||||
// params = request.getReader().lines().collect(Collectors.joining(System.lineSeparator()));
|
||||
}
|
||||
log.info("params:{}", params);
|
||||
String sign = request.getHeader("SIGN");
|
||||
String nonce = request.getHeader("NONCE");
|
||||
String timestamp = request.getHeader("TIMESTAMP");
|
||||
String aesPhone = request.getHeader("PHONE");
|
||||
String openid = request.getHeader("OPENID");
|
||||
String phone = AesUtil.decrypt(aesPhone, signKey);
|
||||
String md5Value = phone + Md5Utils.md5(Md5Utils.md5(openid));
|
||||
log.info("sign:{}, nonce:{}, timestamp:{},aesPhone:{}, openid:{}, 解密后的手机号:{}, md5Value:{}",
|
||||
sign, nonce, timestamp, aesPhone, openid, phone, md5Value);
|
||||
String phone = AESDecryptor.decrypt(aesPhone, signKey);
|
||||
String plaintextOpenid = AESDecryptor.decrypt(openid, signKey);
|
||||
String md5Value = phone + Md5Utils.md5(Md5Utils.md5(plaintextOpenid));
|
||||
log.info("sign:{}, nonce:{}, timestamp:{},aesPhone:{}, openid:{}, 解密后的手机号:{}, md5Value:{}, 明文plaintextOpenid:{}",
|
||||
sign, nonce, timestamp, aesPhone, openid, phone, md5Value, plaintextOpenid);
|
||||
String signStr = timestamp + nonce + params + signKey + md5Value;
|
||||
String newSign = Sha1Utils.getSha1(signStr.getBytes());
|
||||
log.info("newSign: {}", newSign);
|
||||
log.info("signStr: {}, newSign: {}", signStr, newSign);
|
||||
// 前后端验签不等
|
||||
if (!newSign.equals(sign)) {
|
||||
response.setStatus(HttpStatus.OK.value());
|
||||
response.getWriter().write(JSON.toJSONString(ResponseResult.fail(ErrorCodeEnum.SIGN_FAIL)));
|
||||
return;
|
||||
}
|
||||
PartnerUserInfoVO partnerUserInfoVO = wechatMiniAppService.getUserInfo(phone, openid);
|
||||
PartnerUserInfoVO partnerUserInfoVO = wechatMiniAppService.getUserInfo(phone, plaintextOpenid);
|
||||
if(partnerUserInfoVO != null){
|
||||
userStr = JSONObject.toJSONString(partnerUserInfoVO);
|
||||
log.info("url:{}, userStr:{}", uri, userStr);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
try {
|
||||
PartnerUserHolder.setUser(userStr);
|
||||
filterChain.doFilter(servletRequest, servletResponse);
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.cool.store.config;
|
||||
|
||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @Author: JCccc
|
||||
* @Date: 2022-6-23 10:52
|
||||
* @Description:
|
||||
*/
|
||||
@Configuration
|
||||
public class WebApplicationConfig {
|
||||
|
||||
@Bean
|
||||
BodyWrapperFilter getBodyWrapperFilter(){
|
||||
return new BodyWrapperFilter();
|
||||
}
|
||||
@Bean("bodyWrapperFilter")
|
||||
public FilterRegistrationBean<BodyWrapperFilter> checkUserFilter(BodyWrapperFilter bodyWrapperFilter) {
|
||||
FilterRegistrationBean<BodyWrapperFilter> registrationBean = new FilterRegistrationBean();
|
||||
registrationBean.setFilter(bodyWrapperFilter);
|
||||
registrationBean.addUrlPatterns("/*");
|
||||
registrationBean.setOrder(1);
|
||||
registrationBean.setAsyncSupported(true);
|
||||
return registrationBean;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -38,16 +38,15 @@ public class MiniProgramAppController {
|
||||
|
||||
@ApiOperation("更新手机号")
|
||||
@PostMapping("/updateUserPhoneNumber")
|
||||
public ResponseResult<Boolean> updateUserPhoneNumber(@RequestBody @Valid MobileUpdateRequest request) {
|
||||
public ResponseResult<String> updateUserPhoneNumber(@RequestBody @Valid MobileUpdateRequest request) {
|
||||
PartnerUserInfoVO userInfoVO = PartnerUserHolder.getUser();
|
||||
return ResponseResult.success(wechatMiniAppService.updateUserPhoneNumber(request, userInfoVO));
|
||||
}
|
||||
|
||||
@ApiOperation("根据mobile和openId获取用户信息")
|
||||
@PostMapping("/getUserInfo")
|
||||
public ResponseResult<PartnerUserInfoVO> getUserInfo(@RequestParam(value = "mobile",required = false) String mobile,
|
||||
@RequestParam(value = "openId",required = false) String openId){
|
||||
PartnerUserInfoVO userInfoVO = wechatMiniAppService.getUserInfo(mobile, openId);
|
||||
@GetMapping("/getUserInfo")
|
||||
public ResponseResult<PartnerUserInfoVO> getUserInfo(){
|
||||
PartnerUserInfoVO userInfoVO = PartnerUserHolder.getUser();
|
||||
return ResponseResult.success(userInfoVO);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user