Commit 59b4efa4 by Mahjong

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

parent 3a766eb0
...@@ -1017,7 +1017,12 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -1017,7 +1017,12 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
info.setBloodType(mdDropOption.getDropOptionName()); info.setBloodType(mdDropOption.getDropOptionName());
} }
String mktCampaign = customer.getMktCampaign(); 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) { if (pool != null) {
Integer sourceFrom = pool.getSourceFrom(); Integer sourceFrom = pool.getSourceFrom();
String campaign = pool.getMktCampaign(); String campaign = pool.getMktCampaign();
...@@ -1173,10 +1178,15 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -1173,10 +1178,15 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
private List<OpportunityRecordInfo> getOpportunityRecords(OwnOpportunityDetailQueryRequestVO requestVO) { private List<OpportunityRecordInfo> getOpportunityRecords(OwnOpportunityDetailQueryRequestVO requestVO) {
Long practitionerId = requestVO.getPractitionerId(); Long practitionerId = requestVO.getPractitionerId();
Long customerId = requestVO.getOpportunityId(); Long customerId = requestVO.getOpportunityId();
Long sfpMainId = requestVO.getSfpMainId();
List<OpportunityRecordInfo> infos = new ArrayList<>(); List<OpportunityRecordInfo> infos = new ArrayList<>();
MktLeadsAssignedTrack mktLeadsAssignedTrack = new MktLeadsAssignedTrack(); MktLeadsAssignedTrack mktLeadsAssignedTrack = new MktLeadsAssignedTrack();
mktLeadsAssignedTrack.setPractitionerId(practitionerId); mktLeadsAssignedTrack.setPractitionerId(practitionerId);
mktLeadsAssignedTrack.setCustomerId(customerId); mktLeadsAssignedTrack.setCustomerId(customerId);
if(sfpMainId != null){
mktLeadsAssignedTrack.setSfpMainId(sfpMainId);
}
PageHelper.orderBy("track_time DESC , created_at DESC , updated_at DESC"); PageHelper.orderBy("track_time DESC , created_at DESC , updated_at DESC");
List<MktLeadsAssignedTrack> mktLeadsAssignedTracks = mktLeadsAssignedTrackDALService.findByMktLeadsAssignedTrack(mktLeadsAssignedTrack); List<MktLeadsAssignedTrack> mktLeadsAssignedTracks = mktLeadsAssignedTrackDALService.findByMktLeadsAssignedTrack(mktLeadsAssignedTrack);
List<MdDropOptions> dropOptionsList = mdDropOptionsDALService.findByDropMasterCode("bizchance_promotion_action"); List<MdDropOptions> dropOptionsList = mdDropOptionsDALService.findByDropMasterCode("bizchance_promotion_action");
...@@ -5100,7 +5110,12 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -5100,7 +5110,12 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
mktLeadsAssigneds.setUpdatedBy(requestVO.getPractitionerId()); mktLeadsAssigneds.setUpdatedBy(requestVO.getPractitionerId());
mktLeadsAssignedsDALService.updateMktLeadsAssigneds(mktLeadsAssigneds); 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) { if (pool != null) {
pool.setIsActive(0); pool.setIsActive(0);
mktLeadsPoolDALService.updateMktLeadsAssigneds(pool); mktLeadsPoolDALService.updateMktLeadsAssigneds(pool);
......
...@@ -7,4 +7,6 @@ public class OwnOpportunityDetailQueryRequestVO { ...@@ -7,4 +7,6 @@ public class OwnOpportunityDetailQueryRequestVO {
private Long practitionerId; private Long practitionerId;
private Long opportunityId;//商机Id,客户的customerId private Long opportunityId;//商机Id,客户的customerId
private Long orderId; private Long orderId;
private Long sfpMainId;//sfp商家专用
} }
...@@ -110,5 +110,8 @@ public class MktLeadsAssignedTrack implements Serializable { ...@@ -110,5 +110,8 @@ public class MktLeadsAssignedTrack implements Serializable {
*/ */
private String informedStatus; private String informedStatus;
private Long sfpMainId;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
...@@ -15,7 +15,7 @@ public class MktLeadsAssigneds { ...@@ -15,7 +15,7 @@ public class MktLeadsAssigneds {
* serial id * serial id
*/ */
private Long id; private Long id;
private Long sfpMainId;
/** /**
* 经纪人id * 经纪人id
*/ */
......
...@@ -15,4 +15,6 @@ public class OwnOpportunityInfo { ...@@ -15,4 +15,6 @@ public class OwnOpportunityInfo {
private Double scoreDay; private Double scoreDay;
private Double scoreTotal; private Double scoreTotal;
private Long expertType;//0.经纪人指派 1.专家指派 private Long expertType;//0.经纪人指派 1.专家指派
private Long sfpMainId;
} }
...@@ -30,5 +30,6 @@ public interface MktLeadsPoolMapper { ...@@ -30,5 +30,6 @@ public interface MktLeadsPoolMapper {
List<LeadsStatusInfo> findLeadsStatusMap(); List<LeadsStatusInfo> findLeadsStatusMap();
MktLeadsPool findByCustomerIdForSfp(Long customerId); MktLeadsPool findByCustomerIdForSfp(Long customerId);
MktLeadsPool findBySfpMainId(Long sfpMainId);
} }
...@@ -67,4 +67,9 @@ public class MktLeadsPoolDALServiceImpl implements MktLeadsPoolDALService { ...@@ -67,4 +67,9 @@ public class MktLeadsPoolDALServiceImpl implements MktLeadsPoolDALService {
public MktLeadsPool findByCustomerIdForSfp(Long customerId) { public MktLeadsPool findByCustomerIdForSfp(Long customerId) {
return mktLeadsPoolMapper.findByCustomerIdForSfp(customerId); return mktLeadsPoolMapper.findByCustomerIdForSfp(customerId);
} }
@Override
public MktLeadsPool findBySfpMainId(Long sfpMainId) {
return mktLeadsPoolMapper.findBySfpMainId(sfpMainId);
}
} }
...@@ -23,5 +23,6 @@ public interface MktLeadsPoolDALService { ...@@ -23,5 +23,6 @@ public interface MktLeadsPoolDALService {
void updateMktLeadsAssigneds(MktLeadsPool pool); void updateMktLeadsAssigneds(MktLeadsPool pool);
MktLeadsPool findByCustomerIdForSfp(Long customerId); MktLeadsPool findByCustomerIdForSfp(Long customerId);
MktLeadsPool findBySfpMainId(Long sfpMainId);
} }
...@@ -1516,6 +1516,8 @@ ...@@ -1516,6 +1516,8 @@
<result column="scoreDay" property="scoreDay" /> <result column="scoreDay" property="scoreDay" />
<result column="scoreTotal" property="scoreTotal" /> <result column="scoreTotal" property="scoreTotal" />
<result column="expertType" property="expertType" /> <result column="expertType" property="expertType" />
<result column="sfpMainId" property="sfpMainId" />
</resultMap> </resultMap>
<select id="ownOpportunityQuery" resultMap="opportunityQuery"> <select id="ownOpportunityQuery" resultMap="opportunityQuery">
SELECT SELECT
...@@ -1530,12 +1532,13 @@ ...@@ -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, (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 , if(ass.id is null ,0,1) expertType ,
p.remark remark, p.remark remark,
p.appointment_record_id appointmentRecordId p.appointment_record_id appointmentRecordId,
p.sfp_main_id sfpMainId
FROM FROM
ag_mkt_leads_assigneds a 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_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_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 left join ag_acl_customer c ON c.id = a.customer_id
where a.is_active=1 where a.is_active=1
<if test="practitionerId != null"> <if test="practitionerId != null">
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
<result column="informed_oss_path" jdbcType="VARCHAR" property="informedOssPath" /> <result column="informed_oss_path" jdbcType="VARCHAR" property="informedOssPath" />
<result column="informed_id" jdbcType="BIGINT" property="informedId" /> <result column="informed_id" jdbcType="BIGINT" property="informedId" />
<result column="informed_status" jdbcType="VARCHAR" property="informedStatus" /> <result column="informed_status" jdbcType="VARCHAR" property="informedStatus" />
<result column="sfp_main_id" jdbcType="BIGINT" property="sfpMainId" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, order_id, order_no, sales_notice, is_active, created_at, created_by, creator_type, id, order_id, order_no, sales_notice, is_active, created_at, created_by, creator_type,
...@@ -319,6 +321,9 @@ ...@@ -319,6 +321,9 @@
<if test="trackTime != null"> <if test="trackTime != null">
and track_time = #{trackTime,jdbcType=TIMESTAMP} and track_time = #{trackTime,jdbcType=TIMESTAMP}
</if> </if>
<if test="sfpMainId != null">
and sfp_main_id = #{sfpMainId,jdbcType=BIGINT}
</if>
</where> </where>
</select> </select>
<select id="findByTrackTimeForNew" resultMap="BaseResultMap"> <select id="findByTrackTimeForNew" resultMap="BaseResultMap">
......
...@@ -19,11 +19,13 @@ ...@@ -19,11 +19,13 @@
<result column="created_by" jdbcType="BIGINT" property="createdBy" /> <result column="created_by" jdbcType="BIGINT" property="createdBy" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" /> <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="updated_by" jdbcType="BIGINT" property="updatedBy" /> <result column="updated_by" jdbcType="BIGINT" property="updatedBy" />
<result column="sfp_main_id" jdbcType="BIGINT" property="sfpMainId" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
<!--@mbg.generated--> <!--@mbg.generated-->
id, assigned_practitioner_id, customer_id, FYP, FYC, time_to_close, pieces, remark, 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> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated--> <!--@mbg.generated-->
......
...@@ -279,4 +279,12 @@ ...@@ -279,4 +279,12 @@
and a.appointment_record_id is not null and a.appointment_record_id is not null
and a.is_active=1 and a.is_active=1
</select> </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> </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