Merge remote-tracking branch 'origin/cc_20230520_partner' into cc_20230520_partner

This commit is contained in:
zhangchenbiao
2023-06-26 10:41:15 +08:00
13 changed files with 161 additions and 48 deletions

View File

@@ -7,6 +7,7 @@ import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
@Repository
public class HyInterviewDAO {
@@ -31,4 +32,18 @@ public class HyInterviewDAO {
lineInfoMapper.updateWorkflowStatus(lineId, status.getCode());
}
/**
* 根据线索id批量修改面试状态和线索表子流程状态
* @param lineIds
* @param status
*/
@Transactional
public void batchUpdateInterviewWorkflowStatus(List<Long> lineIds, Integer status){
//修改面试状态
interviewMapper.batchUpdateStatusByLineIds(lineIds, status);
//修改线索表子流程状态
lineInfoMapper.batchUpdateStatusByLineIds(lineIds, status);
}
}

View File

@@ -69,7 +69,11 @@ public interface HyPartnerInterviewMapper {
* @return
*/
List<HyPartnerInterviewDO> getInterviewBaseInfoList(@Param("record") GetInterviewListReq request);
void batchUpdateInterviewStatus(@Param("interviewIds") List<Long> interviewIdList, @Param("interviewStatus") Integer interviewStatus);
List<HyPartnerInterviewDO> getInterviewBaseInfoListByLineIds(@Param("lineIds") List<Long> lineIds);
void batchUpdateInterviewStatus(@Param("interviewIds") List<Long> interviewIdList, @Param("status") Integer interviewStatus,@Param("deleted") Integer deleted);
void batchUpdateStatusByLineIds(@Param("lineIds") List<Long> lineIds, @Param("status") Integer interviewStatus);
HyPartnerInterviewDO getInterviewInfoByInterviewPlanId(@Param("interviewPlanId") String interviewPlanId);

View File

@@ -119,10 +119,9 @@ public interface HyPartnerInterviewPlanMapper {
/**
* 仅适用于开启面试房间
* @param record
* @param roomStatus
* @param lineIds
*/
void openInterviewRoom(@Param("record") HyPartnerInterviewPlanDO record,@Param("roomStatus")Integer roomStatus);
void openInterviewRoom(@Param("lineIds") List<Long> lineIds,@Param("roomStatus")Integer roomStatu);
/**
* 仅适用于关闭面试房间
@@ -142,4 +141,5 @@ public interface HyPartnerInterviewPlanMapper {
*/
Integer getRoomStatus(@Param("interviewPlanId") String interviewPlanId);
}

View File

@@ -215,4 +215,13 @@ public interface HyPartnerLineInfoMapper {
* 修改线索状态
*/
void updateWorkflowStatus(@Param("lineId") String lineId, @Param("status") String status);
List<HyPartnerLineInfoDO> getOverTimeReserveLineList(@Param("deadlineEnd") Date deadlineEnd,
@Param("workflowStage") String workflowStage,
@Param("workflowStatus") String workflowStatus);
List<HyPartnerLineInfoDO> getWaitForOpenInterviewLineList(@Param("startTime") Date startTime,
@Param("endTime") Date endTime);
void batchUpdateStatusByLineIds(@Param("lineIds") List<Long> lineIds, @Param("status")Integer status);
}

View File

@@ -363,8 +363,11 @@
<update id="batchUpdateInterviewStatus">
UPDATE hy_partner_interview
<set>
<if test="interviewStatus != null and interviewStatus != ''">
status = #{status}
<if test="status != null and status != ''">
status = #{status},
</if>
<if test="deleted != null ">
deleted = #{deleted},
</if>
</set>
WHERE id in
@@ -389,7 +392,7 @@
</select>
<select id="getInterviewBaseInfoList" resultType="com.cool.store.entity.HyPartnerInterviewDO">
select
<include refid="Base_Column_List"/>
*
from hy_partner_interview_plan hpip
left join hy_partner_interview hpi on hpi.interview_plan_id = hpip.id
<where>
@@ -412,6 +415,17 @@
</select>
<select id="getOverTimeReserveInterviewList" resultType="com.cool.store.entity.HyPartnerInterviewDO">
SELECT
<include refid="Base_Column_List"></include>
FROM hy_partner_interview_plan where
partner_line_id in ( select id from hy_partner_line_info
WHERE workflow_flow_stage = #{workflowStage}
AND workflow_flow_status = #{workflowStatus}
AND deadline &lt;= NOW()
AND deleted = 0) and deleted = 0
</select>
<!-- 根据面试计划id获取面试信息 -->
<select id="getInterviewInfoByInterviewPlanId" resultType="com.cool.store.entity.HyPartnerInterviewDO">
select
@@ -428,6 +442,20 @@
SET status = #{status}
WHERE interview_plan_id = #{interviewPlanId}
</update>
<update id="batchUpdateStatusByLineIds">
UPDATE hy_partner_interview
<set>
<if test="status != null and status != ''">
status = #{status}
</if>
</set>
WHERE partner_line_id in
<foreach collection="lineIds" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
and deleted = 0
</update>
<!-- 获取面试对应的线索id -->
<select id="getLineId" resultType="java.lang.String">
@@ -435,5 +463,12 @@
FROM hy_partner_interview
WHERE interview_plan_id = #{interviewPlanId}
</select>
<select id="getInterviewBaseInfoListByLineIds" resultType="com.cool.store.entity.HyPartnerInterviewDO">
select <include refid="Base_Column_List"/> from hy_partner_interview where partner_line_id in
<foreach collection="lineIds" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
and deleted = 0
</select>
</mapper>

View File

@@ -221,18 +221,11 @@
update hy_partner_interview_plan
set room_status = #{roomStatus},update_time = now()
<where>
<if test="record.roomStatus !=null and record.roomStatus!=''">
and room_status = #{record.roomStatus}
</if>
<if test="record.startTime !=null">
and start_time &gt;= #{record.startTime}
</if>
<if test="record.endTime !=null">
and start_time &lt;= #{record.endTime}
</if>
<if test="record.deleted !=null and record.deleted!=''">
and deleted = #{deleted}
</if>
partner_line_id in
<foreach collection="lineIds" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
and deleted = 0
</where>
</update>
@@ -277,11 +270,11 @@
<select id="getInterviewCount" resultType="com.cool.store.dto.partner.SpecialDateRangeInterviewCountDTO">
select
ifnull(sum(if(interview_date=#{currentDate},1,0)),0) as currentDayInterviewCount,
ifnull(sum(if(start_time>now() or (start_time<![CDATA[<]]>now() and room_status!=2),1,0)),0) as currentDayInterviewCount,
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 application_approved = 0
and application_approved = 1
</select>
<select id="getInterviewPlanList" resultMap="BaseResultMap">
@@ -294,7 +287,7 @@
and interview_date = #{currentDate}
</if>
and (start_time>now() or (start_time<![CDATA[<]]>now() and room_status!=2))
and application_approved = 0
and application_approved = 1
order by start_time
</where>
</select>

View File

@@ -457,12 +457,14 @@
hpuinfo.mobile as partnerUserPhone,
hpuinfo.shop_name as storeName,
hpuinfo.recommend_partner_name as recommendPartnerName,
eu.name as investmentManagerName
eu.name as investmentManagerName,
hpip.id as interviewPlanId
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
LEFT JOIN hy_partner_interview_plan hpip on hpli.id = hpip.partner_line_id
WHERE line_status in (1,2)
<if test="keyword!=null and keyword!='' and keywordType!=null and keywordType=='name'">
AND (eu.name like concat('%',#{keyword},'%') or hpuinfo.username like concat('%',#{keyword},'%'))
@@ -538,6 +540,7 @@
<select id="getFollowCountList" resultType="com.cool.store.dto.partner.LineCountDTO">
SELECT partner_id, IFNULL(COUNT(1), 0) AS followCount
FROM hy_partner_line_info
where deleted = 1
GROUP BY partner_id;
</select>
@@ -572,11 +575,44 @@
WHERE id = #{interviewPlanId}
)
</select>
<select id="getWaitForOpenInterviewLineList" resultType="com.cool.store.entity.HyPartnerLineInfoDO">
SELECT <include refid="Base_Column_List"></include>
FROM hy_partner_line_info hpli
WHERE line_status = 1
AND workflow_stage = 3
AND workflow_status = 2
AND hpli.deleted = 0
AND id IN (
SELECT partner_line_id
FROM hy_partner_interview_plan
WHERE start_time &gt;= #{startTime}
AND start_time &lt;= #{endTime}
AND room_status = 0
AND deleted = 0
)
</select>
<select id="getOverTimeReserveLineList" resultType="com.cool.store.entity.HyPartnerLineInfoDO">
SELECT <include refid="Base_Column_List"></include>
FROM hy_partner_line_info hpli
WHERE line_status = 1
AND workflow_stage = #{workflowStage}
AND workflow_status = #{workflowStatus}
AND hpli.deleted = 0
AND deadline &lt;= #{deadlineEnd}
</select>
<update id="updateWorkflowStatus">
UPDATE hy_partner_line_info
SET workflow_status = #{status}
WHERE id = #{lineId}
</update>
<update id="batchUpdateStatusByLineIds">
UPDATE hy_partner_line_info
SET workflow_status = #{status}
WHERE id IN
<foreach collection="lineIds" item="lineId" open="(" close=")" separator=",">
#{lineId}
</foreach>
</update>
</mapper>