Commit 59b4efa4 by Mahjong

专家处理商机,更新预约状态,给客户发送预约成功短信,小程序发送预约成功通知7

parent 3a766eb0
......@@ -1017,7 +1017,12 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
info.setBloodType(mdDropOption.getDropOptionName());
}
String mktCampaign = customer.getMktCampaign();
MktLeadsPool pool = mktLeadsPoolDALService.findByCustomerId(customerId);
MktLeadsPool pool = null;
if(null != requestVO.getSfpMainId()){
pool = mktLeadsPoolDALService.findBySfpMainId(requestVO.getSfpMainId());
}else{
pool = mktLeadsPoolDALService.findByCustomerId(customerId);
}
if (pool != null) {
Integer sourceFrom = pool.getSourceFrom();
String campaign = pool.getMktCampaign();
......@@ -1173,10 +1178,15 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
private List<OpportunityRecordInfo> getOpportunityRecords(OwnOpportunityDetailQueryRequestVO requestVO) {
Long practitionerId = requestVO.getPractitionerId();
Long customerId = requestVO.getOpportunityId();
Long sfpMainId = requestVO.getSfpMainId();
List<OpportunityRecordInfo> infos = new ArrayList<>();
MktLeadsAssignedTrack mktLeadsAssignedTrack = new MktLeadsAssignedTrack();
mktLeadsAssignedTrack.setPractitionerId(practitionerId);
mktLeadsAssignedTrack.setCustomerId(customerId);
if(sfpMainId != null){
mktLeadsAssignedTrack.setSfpMainId(sfpMainId);
}
PageHelper.orderBy("track_time DESC , created_at DESC , updated_at DESC");
List<MktLeadsAssignedTrack> mktLeadsAssignedTracks = mktLeadsAssignedTrackDALService.findByMktLeadsAssignedTrack(mktLeadsAssignedTrack);
List<MdDropOptions> dropOptionsList = mdDropOptionsDALService.findByDropMasterCode("bizchance_promotion_action");
......@@ -5100,7 +5110,12 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
mktLeadsAssigneds.setUpdatedBy(requestVO.getPractitionerId());
mktLeadsAssignedsDALService.updateMktLeadsAssigneds(mktLeadsAssigneds);
MktLeadsPool pool = mktLeadsPoolDALService.findByCustomerId(mktLeadsAssigneds.getCustomerId());
MktLeadsPool pool = null;
if(mktLeadsAssigneds.getSfpMainId() != null){
pool = mktLeadsPoolDALService.findBySfpMainId(mktLeadsAssigneds.getSfpMainId());
}else{
pool = mktLeadsPoolDALService.findByCustomerId(mktLeadsAssigneds.getCustomerId());
}
if (pool != null) {
pool.setIsActive(0);
mktLeadsPoolDALService.updateMktLeadsAssigneds(pool);
......
......@@ -7,4 +7,6 @@ public class OwnOpportunityDetailQueryRequestVO {
private Long practitionerId;
private Long opportunityId;//商机Id,客户的customerId
private Long orderId;
private Long sfpMainId;//sfp商家专用
}
......@@ -110,5 +110,8 @@ public class MktLeadsAssignedTrack implements Serializable {
*/
private String informedStatus;
private Long sfpMainId;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
}
......@@ -15,7 +15,7 @@ public class MktLeadsAssigneds {
* serial id
*/
private Long id;
private Long sfpMainId;
/**
* 经纪人id
*/
......@@ -83,4 +83,4 @@ public class MktLeadsAssigneds {
* 更新者 FK ag_acl_user.id
*/
private Long updatedBy;
}
\ No newline at end of file
}
......@@ -15,4 +15,6 @@ public class OwnOpportunityInfo {
private Double scoreDay;
private Double scoreTotal;
private Long expertType;//0.经纪人指派 1.专家指派
}
\ No newline at end of file
private Long sfpMainId;
}
......@@ -30,5 +30,6 @@ public interface MktLeadsPoolMapper {
List<LeadsStatusInfo> findLeadsStatusMap();
MktLeadsPool findByCustomerIdForSfp(Long customerId);
MktLeadsPool findBySfpMainId(Long sfpMainId);
}
......@@ -67,4 +67,9 @@ public class MktLeadsPoolDALServiceImpl implements MktLeadsPoolDALService {
public MktLeadsPool findByCustomerIdForSfp(Long customerId) {
return mktLeadsPoolMapper.findByCustomerIdForSfp(customerId);
}
@Override
public MktLeadsPool findBySfpMainId(Long sfpMainId) {
return mktLeadsPoolMapper.findBySfpMainId(sfpMainId);
}
}
......@@ -23,5 +23,6 @@ public interface MktLeadsPoolDALService {
void updateMktLeadsAssigneds(MktLeadsPool pool);
MktLeadsPool findByCustomerIdForSfp(Long customerId);
MktLeadsPool findBySfpMainId(Long sfpMainId);
}
......@@ -1516,6 +1516,8 @@
<result column="scoreDay" property="scoreDay" />
<result column="scoreTotal" property="scoreTotal" />
<result column="expertType" property="expertType" />
<result column="sfpMainId" property="sfpMainId" />
</resultMap>
<select id="ownOpportunityQuery" resultMap="opportunityQuery">
SELECT
......@@ -1530,12 +1532,13 @@
(SELECT sum(t.track_score) from ag_mkt_leads_assigned_track t where t.leads_assigned_id = a.id and to_days(track_time) = to_days(now())) scoreDay,
if(ass.id is null ,0,1) expertType ,
p.remark remark,
p.appointment_record_id appointmentRecordId
p.appointment_record_id appointmentRecordId,
p.sfp_main_id sfpMainId
FROM
ag_mkt_leads_assigneds a
left join ag_mkt_leads_expert_request r on r.customer_id = a.customer_id and r.is_active =1
left join ag_mkt_leads_expert_assign ass on ass.leads_expert_request_id = r.id and ass.is_active =1
left join ag_mkt_leads_pool p ON p.customer_id = a.customer_id and p.is_active =1
left join ag_mkt_leads_pool p ON p.customer_id = a.customer_id and p.is_active =1 and p.sfp_main_id = a.sfp_main_id
left join ag_acl_customer c ON c.id = a.customer_id
where a.is_active=1
<if test="practitionerId != null">
......
......@@ -22,6 +22,8 @@
<result column="informed_oss_path" jdbcType="VARCHAR" property="informedOssPath" />
<result column="informed_id" jdbcType="BIGINT" property="informedId" />
<result column="informed_status" jdbcType="VARCHAR" property="informedStatus" />
<result column="sfp_main_id" jdbcType="BIGINT" property="sfpMainId" />
</resultMap>
<sql id="Base_Column_List">
id, order_id, order_no, sales_notice, is_active, created_at, created_by, creator_type,
......@@ -319,6 +321,9 @@
<if test="trackTime != null">
and track_time = #{trackTime,jdbcType=TIMESTAMP}
</if>
<if test="sfpMainId != null">
and sfp_main_id = #{sfpMainId,jdbcType=BIGINT}
</if>
</where>
</select>
<select id="findByTrackTimeForNew" resultMap="BaseResultMap">
......
......@@ -19,11 +19,13 @@
<result column="created_by" jdbcType="BIGINT" property="createdBy" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="updated_by" jdbcType="BIGINT" property="updatedBy" />
<result column="sfp_main_id" jdbcType="BIGINT" property="sfpMainId" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, assigned_practitioner_id, customer_id, FYP, FYC, time_to_close, pieces, remark,
is_active, created_at, created_by, updated_at, updated_by
is_active, created_at, created_by, updated_at, updated_by,sfp_main_id
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
......@@ -309,4 +311,4 @@
where t.md_drop_option_id = #{dropOptionsId,jdbcType=BIGINT}
and a.id = t.leads_assigned_id)
</select>
</mapper>
\ No newline at end of file
</mapper>
......@@ -279,4 +279,12 @@
and a.appointment_record_id is not null
and a.is_active=1
</select>
<select id="findBySfpMainId" resultType="com.yd.dal.entity.marketing.MktLeadsPool">
select
<include refid="Base_Column_List" />
from ag_mkt_leads_pool
where sfp_main_id = #{customerId,jdbcType=BIGINT}
and is_active=1
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment