Merge remote-tracking branch 'origin/cc_20230520_partner'

This commit is contained in:
zhangchenbiao
2023-07-06 10:56:16 +08:00
34 changed files with 233 additions and 79 deletions

View File

@@ -119,7 +119,5 @@ public class CommonConstants {
public static final String ALLOCATION = "allocation";
public static final String TRANSFER = "transfer";
public static final String FIX_MOBILE_OPENID_TEST = "HSAY5531DA7";
public static final String FIX_MOBILE_OPENID_ONLINE = "HSAY4AF322E";
}

View File

@@ -38,8 +38,14 @@ public enum OperateLogFieldValueEnum {
BEFORE_USERINFO_UPDATE("beforeUserinfoUpdate", "修改前的用户信息"),
AFTER_USERINFO_UPDATE("afterUserinfoUpdate", "修改后的用户信息"),
BEFORE_INTENT_INFO_UPDATE("beforeIntentInfoUpdate", "修改前的意向申请"),
AFTER_INTENT_INFO_UPDATE("afterIntentInfoUpdate", "修改后的意向申请"),
BEFORE_BASE_INFO_UPDATE("beforeBaseInfoUpdate", "修改前的意向书基本信息"),
AFTER_BASE_INFO_UPDATE("afterBaseInfoUpdate", "修改后的意向书基本信息"),
BEFORE_INTENT_INFO_UPDATE("beforeIntentInfoUpdate", "修改前的意向行业信息"),
AFTER_INTENT_INFO_UPDATE("afterIntentInfoUpdate", "修改后的意向行业信息"),
BEFORE_CLERK_INFO_UPDATE("beforeClerkUpdate", "修改前的意向书员工信息"),
AFTER_CLERK_INFO_UPDATE("afterClerkUpdate", "修改后的意向书员工信息"),
;

View File

@@ -28,9 +28,12 @@ public enum OperateTypeEnum {
REJECT_INTERVIEW("reject_interview", "合作资格面试-拒绝并结束跟进", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME, REJECT_PUBLIC_REASON,REJECT_REAL_REASON, CERTIFY_FILE)),
CREATE_QUALIFYVERIFY("create_qualifyverify", "合作资格面试-创建资格审核", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME,SUMMARY,QUALI_VERIFY_CONTENT)),
QUALIFYVERIFY_PASS("qualifyverify_pass", "合作资格面试-审核通过", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME,SUMMARY,QUALI_VERIFY_CONTENT)),
QUALIFYVERIFY_REJECT("qualifyverify_reject", "合作资格面试-审核拒绝", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME,SUMMARY,QUALI_VERIFY_CONTENT)),
USERINFO_UPDATE("userinfo_update", "修改(修改意向信息)", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME, BEFORE_USERINFO_UPDATE, AFTER_USERINFO_UPDATE)),
INTENT_INFO_SUBMIT("intent_info_submit", "提交意向申请书", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME, BEFORE_INTENT_INFO_UPDATE, AFTER_INTENT_INFO_UPDATE)),
INTENT_INFO_UPDATE("intent_info_update", "修改意向申请书", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME, BEFORE_INTENT_INFO_UPDATE, AFTER_INTENT_INFO_UPDATE)),
INTENT_INFO_SUBMIT("intent_info_submit", "提交意向申请书", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME, AFTER_BASE_INFO_UPDATE, AFTER_INTENT_INFO_UPDATE, AFTER_CLERK_INFO_UPDATE)),
INTENT_INFO_UPDATE("intent_info_update", "修改意向申请书", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME, BEFORE_BASE_INFO_UPDATE, AFTER_BASE_INFO_UPDATE, BEFORE_INTENT_INFO_UPDATE, AFTER_INTENT_INFO_UPDATE, BEFORE_CLERK_INFO_UPDATE, AFTER_CLERK_INFO_UPDATE)),
ADD_TAGS("add_tags", "修改意向申请书", Arrays.asList(OPERATE_USER_ID,OPERATE_USER_NAME, MOBILE, OPERATE_TIME)),
;

View File

@@ -1,5 +1,6 @@
package com.cool.store.dao;
import com.cool.store.dto.partner.AdvanceLineDTO;
import com.cool.store.dto.partner.PartnerInterviewInfoDTO;
import com.cool.store.dto.partner.SpecialDateRangeInterviewCountDTO;
import com.cool.store.entity.HyPartnerInterviewPlanDO;
@@ -36,11 +37,11 @@ public class HyPartnerInterviewPlanDAO {
* @param currentDate
* @return
*/
public Integer getCurrentDateInterviewCount(String userId,String currentDate){
public List<AdvanceLineDTO> getCurrentDateInterviewCount(String userId, String currentDate, String endDate){
if (StringUtils.isEmpty(userId)){
return 0;
return new ArrayList<>();
}
return hyPartnerInterviewPlanMapper.getCurrentDateInterviewCount(userId,currentDate);
return hyPartnerInterviewPlanMapper.getCurrentDateInterviewCount(userId,currentDate,endDate);
}
/**

View File

@@ -64,11 +64,11 @@ public class HyPartnerLineInfoDAO {
}
public Integer getAdventLineCount( String userId, String currentDate){
public List<AdvanceLineDTO> getAdventLineCount( String userId, String currentDate,String endDate){
if (StringUtils.isEmpty(userId)){
return 0;
return new ArrayList<>();
}
return hyPartnerLineInfoMapper.getAdventLineCount(userId,currentDate);
return hyPartnerLineInfoMapper.getAdventLineCount(userId,currentDate,endDate);
}
public StageCountDTO selectStagePendingCount(String userId){

View File

@@ -9,6 +9,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.Objects;
/**
* @Author wxp
@@ -45,4 +46,11 @@ public class HyPartnerTaskInfoLogDAO {
insertSelective(logInfo);
}
public int updateLineId(String newPartnerId,Long newLineId,Long oldLineId){
if (newLineId==null || Objects.isNull(oldLineId)){
return 0;
}
return hyPartnerTaskInfoLogMapper.updateLineId(newPartnerId,newLineId, oldLineId);
}
}

View File

@@ -1,6 +1,7 @@
package com.cool.store.mapper;
import com.cool.store.dto.message.RemindInterviewMsgDTO;
import com.cool.store.dto.partner.AdvanceLineDTO;
import com.cool.store.dto.partner.PartnerInterviewInfoDTO;
import com.cool.store.dto.partner.SpecialDateRangeInterviewCountDTO;
import com.cool.store.entity.HyPartnerInterviewPlanDO;
@@ -39,7 +40,7 @@ public interface HyPartnerInterviewPlanMapper {
* @param currentDate
* @return
*/
Integer getCurrentDateInterviewCount(@Param("userId") String userId, @Param("currentDate") String currentDate);
List<AdvanceLineDTO> getCurrentDateInterviewCount(@Param("userId") String userId, @Param("currentDate") String currentDate, String endDate);
/**
* todo 当天面试数据需要修改

View File

@@ -61,7 +61,7 @@ public interface HyPartnerLineInfoMapper {
* @param currentDate
* @return
*/
Integer getAdventLineCount(@Param("userId") String userId, @Param("currentDate") String currentDate);
List<AdvanceLineDTO> getAdventLineCount(@Param("userId") String userId, @Param("currentDate") String currentDate, @Param("endDate") String endDate);
/**
* 招商经理 对应各阶段待处理数据

View File

@@ -26,4 +26,7 @@ public interface HyPartnerTaskInfoLogMapper {
int updateByPrimaryKeySelective(@Param("record") HyPartnerTaskInfoLogDO record);
List<HyPartnerTaskInfoLogDO> selectByPartnerLineIdAndOperateType(@Param("partnerLineId") Long partnerLineId, @Param("operateType") String operateType);
int updateLineId(@Param("newPartnerId") String newPartnerId, @Param("newLineId") Long newLineId, @Param("oldLineId") Long oldLineId);
}

View File

@@ -294,7 +294,7 @@
*
from hy_partner_base_info a
left join hy_partner_line_info b on a.partner_line_id = b.id
where a.id_card = #{idCard} and ( b.line_status != 3 or b.deleted = 1 )
where a.id_card = #{idCard} and ( b.line_status != 3 and b.deleted = 0 )
</select>
<update id="cleanIdCardInfoByPartnerLineId">

View File

@@ -255,17 +255,19 @@
where id = #{id}
</update>
<select id="getCurrentDateInterviewCount" resultType="java.lang.Integer">
select count(1) from hy_partner_interview_plan
<select id="getCurrentDateInterviewCount" resultType="com.cool.store.dto.partner.AdvanceLineDTO">
select interview_date as date,count(1) as count from hy_partner_interview_plan
<where>
<if test="userId!=null and userId!=''">
and interviewer = #{userId}
</if>
<if test="currentDate!=null and currentDate!=''">
and interview_date = #{currentDate}
and interview_date BETWEEN #{currentDate} and #{endDate}
</if>
and deleted = 0 and application_approved = 1
</where>
</select>
group by interview_date
</select>
<select id="getInterviewCount" resultType="com.cool.store.dto.partner.SpecialDateRangeInterviewCountDTO">
@@ -274,6 +276,7 @@
ifnull(sum(if(start_time>#{startTime} and end_time <![CDATA[<]]> #{endTime},1,0)),0) as lastSevenDayInterviewCount
FROM hy_partner_interview_plan
where interviewer = #{userId}
and deleted = 0
and application_approved = 1
</select>
@@ -345,11 +348,12 @@
hpip.room_status as roomStatus,
hpip.end_time as endTime
from hy_partner_interview_plan hpip
left join hy_partner_interview hpi on hpip.id = hpi.interview_plan_id
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>
hpip.deleted = 0
hpip.deleted = 0 and hpi.deleted = 0 and hpi.status != 1
<if test="record.partnerName !=null and record.partnerName!=''">
and hpui.username like concat('%',#{record.partnerName},'%')
</if>

View File

@@ -45,7 +45,8 @@
workflow_stage,
workflow_status,
line_status,
investment_manager
investment_manager,
user_channel_id
)
values
<foreach collection="recordList" item="record" separator=",">
@@ -53,7 +54,8 @@
#{record.workflowStage},
#{record.workflowStatus},
#{record.lineStatus},
#{record.investmentManager})
#{record.investmentManager},
#{record.userChannelId})
</foreach>
</insert>
@@ -276,17 +278,18 @@
where id = #{record.id}
</update>
<select id="getAdventLineCount" resultType="java.lang.Integer">
select count(1) from hy_partner_line_info
<select id="getAdventLineCount" resultType="com.cool.store.dto.partner.AdvanceLineDTO">
select DATE(deadline) as date ,count(1) as count from hy_partner_line_info
<where>
<if test="userId!=null and userId!=''">
and investment_manager = #{userId}
</if>
<if test="currentDate!=null and currentDate!=''">
and DATE(deadline) = #{currentDate}
and DATE(deadline) BETWEEN #{currentDate} and #{endDate}
</if>
and (workflow_stage = 2 and workflow_status = 0)
</where>
group by DATE(deadline)
</select>
<select id="selectStagePendingCount" resultType="com.cool.store.dto.partner.StageCountDTO">

View File

@@ -142,4 +142,11 @@
and operate_type = #{operateType}
order by create_time desc
</select>
<update id="updateLineId">
update hy_partner_task_info_log
set partner_line_id = #{newLineId} , partner_id = #{newPartnerId}
where partner_line_id = #{oldLineId}
</update>
</mapper>

View File

@@ -68,7 +68,8 @@ public class LineLogInfo<T> {
}
public static boolean checkParams(LineLogInfo params){
if(StringUtils.isAnyBlank(params.getPartnerId(), params.getOperateUserId(), params.getOperateUsername())){
//部分操作没有操作人,这里不再校验操作人
if(StringUtils.isAnyBlank(params.getPartnerId())){
log.info("lineLogInfo string:{}", JSONObject.toJSONString(params));
return false;
}

View File

@@ -4,6 +4,7 @@ import lombok.Data;
import lombok.experimental.SuperBuilder;
import java.util.Date;
import java.util.List;
/**
* @Author: wxp
@@ -20,8 +21,8 @@ public class WantInfoUpdateDTO extends LogBasicDTO{
private IntentInfoUpdate beforeIntentInfoUpdate;
private IntentInfoUpdate afterIntentInfoUpdate;
private ClerkUpdate beforeClerkUpdate;
private ClerkUpdate afterClerkUpdate;
private List<ClerkUpdate> beforeClerkUpdate;
private List<ClerkUpdate> afterClerkUpdate;
@Data
public static class BaseInfoUpdate{

View File

@@ -0,0 +1,19 @@
package com.cool.store.dto.partner;
import lombok.Data;
import java.util.Date;
/**
* @Author suzhuhong
* @Date 2023/7/5 15:52
* @Version 1.0
*/
@Data
public class AdvanceLineDTO {
private String date;
private Integer count;
}

View File

@@ -7,6 +7,7 @@ import com.cool.store.vo.InterviewScheduleInfoVO;
import com.cool.store.vo.StageCountVO;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
/**
@@ -22,7 +23,7 @@ public interface DeskService {
* @param userId
* @return
*/
InterviewPlanVO getInterviewPlan(String userId);
HashMap<String, InterviewPlanVO> getInterviewPlan(String userId);
/**

View File

@@ -68,14 +68,14 @@ public class CommonServiceImpl implements CommonService {
} else if (workflowStage.equals(WorkflowStageEnum.INTERVIEW.getCode()) && workflowStatus.equals(WorkflowStatusEnum.INTERVIEW_4.getCode())) {
return getInterviewTips(partnerLineId, OperateTypeEnum.FINISH_INTERVIEW, "结束面试");
}else if (workflowStage.equals(WorkflowStageEnum.INTERVIEW.getCode()) && workflowStatus.equals(WorkflowStatusEnum.INTERVIEW_5.getCode())) {
return getInterviewTips(partnerLineId, OperateTypeEnum.FINISH_INTERVIEW, "发起加盟商资质审核");
return getInterviewTips(partnerLineId, OperateTypeEnum.CREATE_QUALIFYVERIFY, "发起加盟商资质审核");
}else if (workflowStage.equals(WorkflowStageEnum.INTERVIEW.getCode()) && workflowStatus.equals(WorkflowStatusEnum.INTERVIEW_6.getCode())) {
HyPartnerCertificationInfoDO partnerCertificationInfoDO = hyPartnerCertificationInfoMapper.selectByPartnerLineId(partnerLineId);
String intentionContractNo = null;
if(partnerCertificationInfoDO != null){
intentionContractNo = partnerCertificationInfoDO.getIntentionContractNo();
}
return getInterviewTips(partnerLineId, OperateTypeEnum.FINISH_INTERVIEW, "审核通过 | "+intentionContractNo);
return getVerifyResultTips(partnerLineId, OperateTypeEnum.QUALIFYVERIFY_PASS, "审核通过 | "+intentionContractNo);
}
return null;
@@ -96,6 +96,15 @@ public class CommonServiceImpl implements CommonService {
}
public String getVerifyResultTips(Long partnerLineId, OperateTypeEnum operateTypeEnum, String action) {
StringBuffer sb = new StringBuffer();
sb.append("").append(StringUtil.REPLACE_0).append(" ").append(action);
String content = sb.toString();
return getSuitableTipsInfo(content, partnerLineId,
operateTypeEnum,
OperateLogFieldValueEnum.OPERATE_TIME.getCode());
}
public String getSuitableTipsInfo(String content, Long partnerLineId, OperateTypeEnum operateTypeEnum, String... replaceKeys) {
List<HyPartnerTaskInfoLogDO> hyPartnerTaskInfoLogDOS = hyPartnerTaskInfoLogMapper.selectByPartnerLineIdAndOperateType(partnerLineId, operateTypeEnum.getCode());
if (CollectionUtils.isEmpty(hyPartnerTaskInfoLogDOS)) {

View File

@@ -6,6 +6,7 @@ import com.cool.store.constants.CommonConstants;
import com.cool.store.dao.HyPartnerInterviewPlanDAO;
import com.cool.store.dao.HyPartnerLineInfoDAO;
import com.cool.store.dto.calendar.UserCalendarsEventDTO;
import com.cool.store.dto.partner.AdvanceLineDTO;
import com.cool.store.dto.partner.SpecialDateRangeInterviewCountDTO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.exception.ApiException;
@@ -24,9 +25,8 @@ import org.apache.http.client.utils.DateUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
/**
* @Author suzhuhong
@@ -48,18 +48,35 @@ public class DeskServiceImpl implements DeskService {
private ISVHttpRequest isvHttpRequest;
@Override
public InterviewPlanVO getInterviewPlan(String userId) {
InterviewPlanVO interviewPlanVO = new InterviewPlanVO();
public HashMap<String, InterviewPlanVO> getInterviewPlan(String userId) {
String currentDate = DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_DAY);
Integer currentDateInterviewCount = hyPartnerInterviewPlanDAO.getCurrentDateInterviewCount(userId, currentDate);
interviewPlanVO.setHasInterview(currentDateInterviewCount>0);
String endDate = DateUtil.format(CoolDateUtils.getDateFormatDay(new Date(), 6), CoolDateUtils.DATE_FORMAT_DAY);
List<AdvanceLineDTO> currentDateInterviewList = hyPartnerInterviewPlanDAO.getCurrentDateInterviewCount(userId, currentDate,endDate);
Map<String, Integer> dateIntegerMap = currentDateInterviewList.stream().collect(Collectors.toMap(AdvanceLineDTO::getDate, AdvanceLineDTO::getCount));
//临期数量
Integer adventLineCount = hyPartnerLineInfoDAO.getAdventLineCount(userId, currentDate);
interviewPlanVO.setHasAdventLine(adventLineCount>0);
return interviewPlanVO;
List<AdvanceLineDTO> adventLineList = hyPartnerLineInfoDAO.getAdventLineCount(userId, currentDate,endDate);
Map<String, Integer> adventLinerMap = adventLineList.stream().collect(Collectors.toMap(AdvanceLineDTO::getDate, AdvanceLineDTO::getCount));
HashMap<String, InterviewPlanVO> resultMap = new HashMap<>();
String tempDate = currentDate;
int i = 0;
while (true){
tempDate = DateUtil.format(CoolDateUtils.getDateFormatDay(new Date(), i++), CoolDateUtils.DATE_FORMAT_DAY);
Integer currentDateInterviewCount = dateIntegerMap.getOrDefault(tempDate, 0);
Integer adventLineCount = adventLinerMap.getOrDefault(tempDate,0);
InterviewPlanVO interviewPlanVO = new InterviewPlanVO();
interviewPlanVO.setHasInterview(currentDateInterviewCount>0);
interviewPlanVO.setHasAdventLine(adventLineCount>0);
resultMap.put(tempDate,interviewPlanVO);
if (tempDate.equals(endDate)){
break;
}
}
return resultMap;
}
@Override
public InterviewScheduleInfoVO interviewSchedule(String userId,String selectedData) {
if (StringUtils.isEmpty(userId)||selectedData==null){

View File

@@ -10,6 +10,7 @@ import com.cool.store.context.LoginUserInfo;
import com.cool.store.dao.EnterpriseUserDAO;
import com.cool.store.dao.HyInterviewDAO;
import com.cool.store.dto.log.CreateQualifyVerifyDTO;
import com.cool.store.dto.log.LogBasicDTO;
import com.cool.store.dto.mdm.AccessTokenDTO;
import com.cool.store.dto.response.MDMResultDTO;
import com.cool.store.entity.*;
@@ -259,7 +260,10 @@ public class FlowServiceImpl implements FlowService {
//3. 生成通过函并修改数据库相关信息
//TODO 问题:如果因为 pdf 生成失败或者其他原因导致异常,但是由于 MDM 只是做回调,不对回调是否成功负责,会导致流程信息缺失
genPassLetterAndUpdateDB(partnerName, verifyCity, passDate, interviewId);
// TODO 4. 修改流程状态到下一阶段 4 分配选址开发经理
//记录日志
LogBasicDTO log = LogBasicDTO.builder().operateTime(DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC))
.build();
logService.recordBizLog(null,hyPartnerInterviewDO.getPartnerLineId(), OperateTypeEnum.QUALIFYVERIFY_PASS,log);
//审核未通过
} else if ("CANCELED".equals(request.getInstanceStatus())) {
CloseFollowRequest closeFollowRequest = new CloseFollowRequest();
@@ -268,6 +272,9 @@ public class FlowServiceImpl implements FlowService {
closeFollowRequest.setType("reject");
hyPartnerLineInfoService.closeOrPassFollow(null,closeFollowRequest);
interviewDAO.updateInterviewWorkflowStatus(interviewPlanId, WorkflowStatusEnum.INTERVIEW_7);
LogBasicDTO log = LogBasicDTO.builder().operateTime(DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC))
.build();
logService.recordBizLog(null,hyPartnerInterviewDO.getPartnerLineId(), OperateTypeEnum.QUALIFYVERIFY_REJECT,log);
}
}

View File

@@ -6,10 +6,12 @@ import com.alibaba.fastjson.JSONObject;
import com.cool.store.constants.RedisConstant;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.context.PartnerUserHolder;
import com.cool.store.dao.*;
import com.cool.store.dto.log.AddTagsDTO;
import com.cool.store.dto.log.BlackListLogDTO;
import com.cool.store.dto.log.LineLogInfo;
import com.cool.store.dto.log.WantInfoUpdateDTO;
import com.cool.store.entity.*;
import com.cool.store.enums.*;
import com.cool.store.exception.ServiceException;
@@ -19,6 +21,7 @@ import com.cool.store.request.PartnerBaseInfoRequest;
import com.cool.store.service.HyPartnerBaseInfoService;
import com.cool.store.service.HyPartnerLineInfoService;
import com.cool.store.service.HyPhoneLocationService;
import com.cool.store.service.LogService;
import com.cool.store.utils.CoolDateUtils;
import com.cool.store.utils.RedisUtilPool;
import com.cool.store.vo.PartnerBaseInfoVO;
@@ -26,6 +29,7 @@ import com.cool.store.vo.PartnerUserInfoVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -76,6 +80,9 @@ public class HyPartnerBaseInfoServiceImpl implements HyPartnerBaseInfoService {
@Resource
HyPartnerCertificationInfoMapper hyPartnerCertificationInfoMapper;
@Autowired
private LogService logService;
@Override
public Boolean addTags(LoginUserInfo user, AddTagsRequest addTagsRequest) {
@@ -115,14 +122,22 @@ public class HyPartnerBaseInfoServiceImpl implements HyPartnerBaseInfoService {
redisUtilPool.setString(cacheKey, JSONObject.toJSONString(request), RedisConstant.ONE_DAY_SECONDS);
return Boolean.TRUE;
}
WantInfoUpdateDTO.BaseInfoUpdate beforeBaseInfoUpdate = new WantInfoUpdateDTO.BaseInfoUpdate();
WantInfoUpdateDTO.BaseInfoUpdate afterBaseInfoUpdate = new WantInfoUpdateDTO.BaseInfoUpdate();
OperateTypeEnum operateTypeEnum = OperateTypeEnum.INTENT_INFO_UPDATE;
HyPartnerBaseInfoDO baseInfoDO = hyPartnerBaseInfoDAO.getByPartnerIdAndLineId(request.getPartnerId(), request.getPartnerLineId());
if(baseInfoDO == null){
baseInfoDO = new HyPartnerBaseInfoDO();
fillBaseInfo(baseInfoDO, request);
hyPartnerBaseInfoDAO.insertSelective(baseInfoDO);
BeanUtil.copyProperties(baseInfoDO, afterBaseInfoUpdate);
operateTypeEnum = OperateTypeEnum.INTENT_INFO_SUBMIT;
}else {
BeanUtil.copyProperties(baseInfoDO, beforeBaseInfoUpdate);
fillBaseInfo(baseInfoDO, request);
hyPartnerBaseInfoDAO.updateByPrimaryKeySelective(baseInfoDO);
BeanUtil.copyProperties(baseInfoDO, afterBaseInfoUpdate);
}
if(request.getSubmitFlag()){
// 更新线索表状态
@@ -146,6 +161,12 @@ public class HyPartnerBaseInfoServiceImpl implements HyPartnerBaseInfoService {
}
// 清空暂存信息
redisUtilPool.delKey(cacheKey);
//记录日志
PartnerUserInfoVO operator = PartnerUserHolder.getUser();
WantInfoUpdateDTO log = WantInfoUpdateDTO.builder().mobile(operator.getMobile()).operateUserId(operator.getPartnerId()).operateUsername(operator.getUsername())
.operateTime(DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC))
.beforeBaseInfoUpdate(beforeBaseInfoUpdate).afterBaseInfoUpdate(afterBaseInfoUpdate).build();
logService.recordPartnerBizLog(operator, baseInfoDO.getPartnerLineId(), operateTypeEnum,log);
return Boolean.TRUE;
}
@@ -201,9 +222,6 @@ public class HyPartnerBaseInfoServiceImpl implements HyPartnerBaseInfoService {
oldBaseInfo.getSex(), oldBaseInfo.getBirthdate(), oldBaseInfo.getNation(), oldBaseInfo.getLiveAddress(), oldBaseInfo.getStatus());
newBaseInfo.setStatus(oldBaseInfo.getStatus());
hyPartnerBaseInfoDAO.updateByPrimaryKeySelective(newBaseInfo);
// 老的身份证信息置空
fillBaseInfoIdCard(oldBaseInfo, null, null, null, null, null, null, null, null, null);
oldBaseInfo.setStatus(Integer.valueOf(WorkflowStatusEnum.INTENT_0.getCode()));
//修改名称
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(newPartnerId);
HyPartnerIntentInfoDO oldIntentInfo = hyPartnerIntentInfoDAO.getByPartnerIdAndLineId(oldLineInfo.getPartnerId(), oldLineInfo.getId());
@@ -214,12 +232,16 @@ public class HyPartnerBaseInfoServiceImpl implements HyPartnerBaseInfoService {
hyPartnerUserInfoDO.setAcceptAdjustType(oldIntentInfo.getAcceptAdjustType());
hyPartnerUserInfoDAO.updateByPrimaryKeySelective(hyPartnerUserInfoDO);
}
// 老的身份证信息置空
fillBaseInfoIdCard(oldBaseInfo, null, null, null, null, null, null, null, null, null);
oldBaseInfo.setStatus(Integer.valueOf(WorkflowStatusEnum.INTENT_0.getCode()));
hyPartnerBaseInfoDAO.updateByPrimaryKey(oldBaseInfo);
hyPartnerIntentInfoDAO.updateLineId(newPartnerId,newLindId,oldLineInfo.getId());
hyPartnerClerkDAO.updateLineId(newPartnerId,newLindId,oldLineInfo.getId());
hyPartnerInterviewPlanDAO.updateLineId(newPartnerId,newLindId,oldLineInfo.getId());
hyInterviewDAO.updateLineId(newPartnerId,newLindId,oldLineInfo.getId());
hyPartnerCertificationInfoMapper.updateLineId(newPartnerId,newLindId,oldLineInfo.getId());
hyPartnerTaskInfoLogDAO.updateLineId(newPartnerId,newLindId,oldLineInfo.getId());
String cacheKeyBaseInfo = MessageFormat.format(RedisConstant.PARTNER_BASEINFO_CACHE_KEY, newPartnerId, newLindId);
String cacheKeyClerkInfo = MessageFormat.format(RedisConstant.PARTNER_CLERKINFO_CACHE_KEY,newPartnerId, newLindId);
String cacheKeyIntentInfo = MessageFormat.format(RedisConstant.PARTNER_INTENTINFO_CACHE_KEY, newPartnerId, newLindId);

View File

@@ -1,26 +1,37 @@
package com.cool.store.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.constants.RedisConstant;
import com.cool.store.context.PartnerUserHolder;
import com.cool.store.dao.HyPartnerClerkDAO;
import com.cool.store.dto.enterprise.SysDepartmentDTO;
import com.cool.store.dto.log.WantInfoUpdateDTO;
import com.cool.store.entity.HyPartnerClerkDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.OperateTypeEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.request.PartnerClerkInfoRequest;
import com.cool.store.service.HyPartnerClerkService;
import com.cool.store.service.LogService;
import com.cool.store.utils.CoolDateUtils;
import com.cool.store.utils.RedisUtilPool;
import com.cool.store.utils.StringUtil;
import com.cool.store.vo.PartnerClerkVO;
import com.cool.store.vo.PartnerUserInfoVO;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@@ -40,6 +51,9 @@ public class HyPartnerClerkServiceImpl implements HyPartnerClerkService {
@Resource
private RedisUtilPool redisUtilPool;
@Autowired
private LogService logService;
@Override
public List<PartnerClerkVO> getPartnerClerkList(Long lineId) {
List<HyPartnerClerkDO> hyPartnerClerkList = hyPartnerClerkDAO.getHyPartnerClerkList(lineId);
@@ -60,15 +74,18 @@ public class HyPartnerClerkServiceImpl implements HyPartnerClerkService {
@Override
public Boolean submitPartnerClerkInfo(PartnerClerkInfoRequest request) {
log.info("HyPartnerClerkServiceImpl#submitPartnerClerkInfo request:{}", JSONObject.toJSONString(request));
if (StringUtil.isBlank(request.getPartnerId()) || Objects.isNull(request.getPartnerLineId())){
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
}
String cacheKey = MessageFormat.format(RedisConstant.PARTNER_CLERKINFO_CACHE_KEY, request.getPartnerId(), request.getPartnerLineId());
if(!request.getSubmitFlag()){
// 自动保存时
redisUtilPool.setString(cacheKey, JSONObject.toJSONString(request), RedisConstant.ONE_DAY_SECONDS);
return Boolean.TRUE;
}
if (StringUtil.isBlank(request.getPartnerId()) || Objects.isNull(request.getPartnerLineId())){
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
}
List<WantInfoUpdateDTO.ClerkUpdate> beforeClerkUpdate = Lists.newArrayList();
List<WantInfoUpdateDTO.ClerkUpdate> afterClerkUpdate = Lists.newArrayList();
List<HyPartnerClerkDO> beforClerkDOList = hyPartnerClerkDAO.listByPartnerIdAndLineId(request.getPartnerId(), request.getPartnerLineId());
hyPartnerClerkDAO.deleteByPartnerIdAndLineId(request.getPartnerId(), request.getPartnerLineId());
List<HyPartnerClerkDO> clerkDOList = new ArrayList<>();
ListUtils.emptyIfNull(request.getPartnerClerkRequestList()).stream().forEach(x->{
@@ -83,8 +100,18 @@ public class HyPartnerClerkServiceImpl implements HyPartnerClerkService {
});
if (CollectionUtils.isNotEmpty(clerkDOList)){
hyPartnerClerkDAO.batchInsert(clerkDOList);
afterClerkUpdate = JSONObject.parseArray(JSONObject.toJSONString(clerkDOList), WantInfoUpdateDTO.ClerkUpdate.class);
}
if (CollectionUtils.isNotEmpty(beforClerkDOList)){
beforeClerkUpdate = JSONObject.parseArray(JSONObject.toJSONString(beforClerkDOList), WantInfoUpdateDTO.ClerkUpdate.class);
}
redisUtilPool.delKey(cacheKey);
//记录日志
PartnerUserInfoVO operator = PartnerUserHolder.getUser();
WantInfoUpdateDTO log = WantInfoUpdateDTO.builder().mobile(operator.getMobile()).operateUserId(operator.getPartnerId()).operateUsername(operator.getUsername())
.operateTime(DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC))
.beforeClerkUpdate(beforeClerkUpdate).afterClerkUpdate(afterClerkUpdate).build();
logService.recordPartnerBizLog(operator, request.getPartnerLineId(), OperateTypeEnum.INTENT_INFO_UPDATE,log);
return true;
}

View File

@@ -193,13 +193,14 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
}
WantInfoUpdateDTO.IntentInfoUpdate beforeIntentInfoUpdate = new WantInfoUpdateDTO.IntentInfoUpdate();
WantInfoUpdateDTO.IntentInfoUpdate afterIntentInfoUpdate = new WantInfoUpdateDTO.IntentInfoUpdate();
OperateTypeEnum operateTypeEnum = OperateTypeEnum.INTENT_INFO_UPDATE;
HyPartnerIntentInfoDO intentInfoDO = hyPartnerIntentInfoDAO.getByPartnerIdAndLineId(request.getPartnerId(), request.getPartnerLineId());
if(intentInfoDO == null){
intentInfoDO = new HyPartnerIntentInfoDO();
fillIntentInfo(intentInfoDO, request);
hyPartnerIntentInfoDAO.insertSelective(intentInfoDO);
BeanUtil.copyProperties(intentInfoDO, beforeIntentInfoUpdate);
BeanUtil.copyProperties(intentInfoDO, afterIntentInfoUpdate);
operateTypeEnum = OperateTypeEnum.INTENT_INFO_SUBMIT;
}else {
BeanUtil.copyProperties(intentInfoDO, beforeIntentInfoUpdate);
fillIntentInfo(intentInfoDO, request);
@@ -231,7 +232,7 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
WantInfoUpdateDTO log = WantInfoUpdateDTO.builder().mobile(operator.getMobile()).operateUserId(operator.getPartnerId()).operateUsername(operator.getUsername())
.operateTime(DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC))
.beforeIntentInfoUpdate(beforeIntentInfoUpdate).afterIntentInfoUpdate(afterIntentInfoUpdate).build();
logService.recordPartnerBizLog(operator,hyPartnerLineInfoDO.getId(), OperateTypeEnum.INTENT_INFO_UPDATE,log);
logService.recordPartnerBizLog(operator,hyPartnerLineInfoDO.getId(), operateTypeEnum, log);
return hyPartnerLineInfoDO.getLineStatus();
}

View File

@@ -198,6 +198,7 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
hyPartnerLineInfoDO.setWorkflowStage(WorkflowStageEnum.INTENT.getCode());
hyPartnerLineInfoDO.setWorkflowStatus(WorkflowStatusEnum.INTENT_0.getCode());
hyPartnerLineInfoDO.setLineStatus(1);
hyPartnerLineInfoDO.setUserChannelId(x.getUserChannelId());
list.add(hyPartnerLineInfoDO);
});
hyPartnerLineInfoDAO.batchInsert(list);

View File

@@ -169,16 +169,7 @@ public class InterviewServiceImpl implements InterviewService {
if(RoomStatus.WAIT_FOR_OPEN.getCode() != Integer.parseInt(interviewInfo.getRoomStatus())){
throw new ApiException(ErrorCodeEnum.ROOM_STATUS_ERROR);
}
//1.面试官日程删除
DeleteCalendarEventDTO deleteCalendarEventDTO = new DeleteCalendarEventDTO();
deleteCalendarEventDTO.setCalendarId(interviewInfo.getFeishuCalendarId());
deleteCalendarEventDTO.setEventId(interviewInfo.getFeishuScheduleId());
deleteCalendarEventDTO.setUserId(interviewInfo.getInterviewerId());
UserCalendarsEventDTO userCalendarsEventDTO = isvHttpRequest.deleteUserCalendarEvent(deleteCalendarEventDTO);
if(userCalendarsEventDTO == null ){
throw new ApiException(ErrorCodeEnum.FEISHU_DELETE_SCHEDULE_ERROR);
}
//2.新面试官日程新增
//1.面试官日程新增
CreateCalendarEventDTO createCalendarEventDTO = new CreateCalendarEventDTO();
createCalendarEventDTO.setStartTime(DateUtil.parse(interviewInfo.getStartTime()).getTime());
createCalendarEventDTO.setEndTime(DateUtil.parse(interviewInfo.getEndTime()).getTime());
@@ -189,18 +180,28 @@ public class InterviewServiceImpl implements InterviewService {
if(userCalendarEvent == null ){
throw new ApiException(ErrorCodeEnum.CREATE_CALENDAR_EVENT_FAIL);
}
// 3.面试信息变更
//2.原面试官日程删除
DeleteCalendarEventDTO deleteCalendarEventDTO = new DeleteCalendarEventDTO();
deleteCalendarEventDTO.setCalendarId(interviewInfo.getFeishuCalendarId());
deleteCalendarEventDTO.setEventId(interviewInfo.getFeishuScheduleId());
deleteCalendarEventDTO.setUserId(interviewInfo.getInterviewerId());
UserCalendarsEventDTO userCalendarsEventDTO = isvHttpRequest.deleteUserCalendarEvent(deleteCalendarEventDTO);
if(userCalendarsEventDTO == null ){
throw new ApiException(ErrorCodeEnum.FEISHU_DELETE_SCHEDULE_ERROR);
}
// 3.面试信息计划变更
HyPartnerInterviewPlanDO record = new HyPartnerInterviewPlanDO();
record.setId(Long.valueOf(request.getInterviewPlanId()));
record.setInterviewer(request.getNewInterviewerId());
record.setUpdateTime(new Date());
hyPartnerInterviewPlanMapper.updateByPrimaryKeySelective(record);
//更新面试计划信息
HyPartnerInterviewDO hyPartnerInterviewDO = new HyPartnerInterviewDO();
hyPartnerInterviewDO.setInterviewPlanId(Long.valueOf(request.getInterviewPlanId()));
record.setFeishuCalendarId(userCalendarEvent.getCalendarId());
record.setFeishuScheduleId(userCalendarEvent.getEventId());
hyPartnerInterviewPlanMapper.updateByPrimaryKeySelective(record);
//更新面试信息
HyPartnerInterviewDO hyPartnerInterviewDO = new HyPartnerInterviewDO();
hyPartnerInterviewDO.setInterviewPlanId(Long.valueOf(request.getInterviewPlanId()));
hyPartnerInterviewDO.setInterviewer(request.getNewInterviewerId());
hyPartnerInterviewDO.setUpdateTime(new Date());
hyPartnerInterviewMapper.updateByPrimaryKeySelective(hyPartnerInterviewDO);

View File

@@ -47,13 +47,20 @@ public class LogServiceImpl implements LogService {
return;
}
HyPartnerLineInfoDO hyPartnerLineInfoDO = lineInfos.get(0);
LineLogInfo lineLogInfo = new LineLogInfo(hyPartnerLineInfoDO.getPartnerId(), lineId, operator.getUserId(),
operator.getName(), operateTypeEnum,
WorkflowStageEnum.getWorkflowStageByCode(hyPartnerLineInfoDO.getWorkflowStage()),
hyPartnerLineInfoDO.getWorkflowStatus(), "");
LineLogInfo lineLogInfo = null;
if(operator!= null){
lineLogInfo = new LineLogInfo(hyPartnerLineInfoDO.getPartnerId(), lineId, operator.getUserId(),
operator.getName(), operateTypeEnum,
WorkflowStageEnum.getWorkflowStageByCode(hyPartnerLineInfoDO.getWorkflowStage()),
hyPartnerLineInfoDO.getWorkflowStatus(), "");
}else {
lineLogInfo = new LineLogInfo(hyPartnerLineInfoDO.getPartnerId(), lineId, null,
null, operateTypeEnum,
WorkflowStageEnum.getWorkflowStageByCode(hyPartnerLineInfoDO.getWorkflowStage()),
hyPartnerLineInfoDO.getWorkflowStatus(), "");
}
lineLogInfo.setData(logData);
hyPartnerTaskInfoLogDAO.addOperateLog(lineLogInfo);
int i =1;
}catch (Exception e){
LOG.error("recordBizLog error",e);
e.printStackTrace();

View File

@@ -64,6 +64,9 @@ public class WechatMiniAppServiceImpl implements WechatMiniAppService {
@Value("${weixin.appSecret}")
private String wxAppSecret;
@Value("${fixMobileOpenid}")
private String fixMobileOpenid;
@Override
public PartnerUserInfoVO miniProgramLogin(MiniProgramLoginDTO param) {
@@ -173,7 +176,7 @@ public class WechatMiniAppServiceImpl implements WechatMiniAppService {
@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) ){
if(fixMobileOpenid.equals(mobile)){
userInfoVO.setMobile(mobile);
userInfoVO.setOpenid(mobile);
userInfoVO.setPartnerId("");

View File

@@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
/**
@@ -92,7 +93,7 @@ public class DeskController {
@GetMapping(path = "/queryInterviewPlan")
@ApiOperation("是否有面试与临期线索")
public ResponseResult<InterviewPlanVO> queryInterviewPlanVO(){
public ResponseResult<HashMap<String, InterviewPlanVO>> queryInterviewPlanVO(){
String userId = CurrentUserHolder.getUserId();
return ResponseResult.success(deskService.getInterviewPlan(userId));
}

View File

@@ -62,7 +62,7 @@ weixin.appId=wx6f984e535e571818
weixin.appSecret=245a483747e6e9f8762d3e8539cf0318
signKey=77fea013c3a6459685b83c21a2fc3411
fixMobileOpenid=HSAY5531DA7
#xxljob配置
xxl.job.admin.addresses = http://10.7.53.224:10001/xxl-job-admin
xxl.job.executor.appname = ${spring.application.name}

View File

@@ -64,7 +64,7 @@ weixin.appId=wx6f984e535e571818
weixin.appSecret=245a483747e6e9f8762d3e8539cf0318
signKey=77fea013c3a6459685b83c21a2fc3411
fixMobileOpenid=HSAY5531DA7
#MDM
hs.mdm.baseUrl=http://10.56.21.30
hs.mdm.appkey = HSAYPartner

View File

@@ -58,7 +58,7 @@ weixin.appId=wx6f984e535e571818
weixin.appSecret=245a483747e6e9f8762d3e8539cf0318
signKey=d851f2a9ac90474abecdc2fbb148d4d7
fixMobileOpenid=HSAY4AF322E
#阿里云ak sk
aliyun.accessKeyId=
aliyun.accessKeySecret=

View File

@@ -61,6 +61,7 @@ weixin.appId=wxb2a0addf956ad4b7
weixin.appSecret=77abdcae754add92889566b543e5ad79
signKey=77fea013c3a6459685b83c21a2fc3411
fixMobileOpenid=HSAY5531DA7
#飞书通知
feishu.notice.link.url = https://applink.feishu.cn/client/web_app/open?appId=cli_a4f3e24dc73a100c&lk_target_url=https%3A%2F%2Ftest-hsay-web.coolstore.cn%2F%23%2Fwork%2Fbench

View File

@@ -63,6 +63,7 @@ weixin.appId=wxb2a0addf956ad4b7
weixin.appSecret=77abdcae754add92889566b543e5ad79
signKey=77fea013c3a6459685b83c21a2fc3411
fixMobileOpenid=HSAY5531DA7
#飞书通知
feishu.notice.link.url = https://applink.feishu.cn/client/web_app/open?appId=cli_a4f3e24dc73a100c&lk_target_url=https%3A%2F%2Ftest-hsay-web.coolstore.cn%2F%23%2Fwork%2Fbench

View File

@@ -55,7 +55,7 @@ weixin.appId=wxb2a0addf956ad4b7
weixin.appSecret=77abdcae754add92889566b543e5ad79
signKey=d851f2a9ac90474abecdc2fbb148d4d7
fixMobileOpenid=HSAY4AF322E
#阿里云ak sk
aliyun.accessKeyId=
aliyun.accessKeySecret=