Commit 14e45a0c by Water Wang

optimize

parent aade45f4
...@@ -104,7 +104,7 @@ public class AgmsStatisticsServiceImpl implements AgmsStatisticsService { ...@@ -104,7 +104,7 @@ public class AgmsStatisticsServiceImpl implements AgmsStatisticsService {
Map<Long,Long> leadsStatusMap = mktLeadsPoolDALService.findLeadsStatusMap(); Map<Long,Long> leadsStatusMap = mktLeadsPoolDALService.findLeadsStatusMap();
//4、商机状态信息 //4、商机状态信息
List<MdDropOptions> dropList = mdDropOptionsDALService.findByDropMasterCodes(Arrays.asList("leads_manual_blood_type","leads_manual_zodiac_type","leads_manual_source","action_code")); List<MdDropOptions> dropList = mdDropOptionsDALService.findByDropMasterCodes(Arrays.asList("leads_manual_blood_type","leads_manual_zodiac_type","leads_manual_source","bizchance_promotion_action"));
Map<Long,String> dropMap = new HashMap<>(); Map<Long,String> dropMap = new HashMap<>();
if(dropList != null && dropList.size() > 0){ if(dropList != null && dropList.size() > 0){
dropList.forEach(i->dropMap.put(i.getId(),i.getDropOptionName())); dropList.forEach(i->dropMap.put(i.getId(),i.getDropOptionName()));
...@@ -145,39 +145,37 @@ public class AgmsStatisticsServiceImpl implements AgmsStatisticsService { ...@@ -145,39 +145,37 @@ public class AgmsStatisticsServiceImpl implements AgmsStatisticsService {
*/ */
private List<LeadsStatisticsInfo> screenResult(List<LeadsStatisticsInfo> resultList, Integer leadsStatus, Integer expertApplyStatus) { private List<LeadsStatisticsInfo> screenResult(List<LeadsStatisticsInfo> resultList, Integer leadsStatus, Integer expertApplyStatus) {
List<LeadsStatisticsInfo> isAssignList,unapplyList,applyingList,isAssignExpertList; List<LeadsStatisticsInfo> isAssignList,unapplyList,applyingList,isAssignExpertList;
if(leadsStatus == 2){ isAssignList = new ArrayList<>();
isAssignList = new ArrayList<>(); for(LeadsStatisticsInfo item : resultList){
for(LeadsStatisticsInfo item : resultList){ if(item.getAssignId() != null){
if(item.getAssignId() != null){ isAssignList.add(item);
isAssignList.add(item);
}
} }
if(expertApplyStatus == null || expertApplyStatus == 0){//已派遣的全部 }
return isAssignList; if(expertApplyStatus == null || expertApplyStatus == 0){//已派遣的全部
}else if(!isAssignList.isEmpty()){ return isAssignList;
unapplyList = new ArrayList<>(); }else if(!isAssignList.isEmpty()){
applyingList = new ArrayList<>(); unapplyList = new ArrayList<>();
isAssignExpertList = new ArrayList<>(); applyingList = new ArrayList<>();
for(LeadsStatisticsInfo item : isAssignList) { isAssignExpertList = new ArrayList<>();
if (item.getRequestSMEDate() == null) { for(LeadsStatisticsInfo item : isAssignList) {
unapplyList.add(item);//未申请 if (item.getRequestSMEDate() == null) {
unapplyList.add(item);//未申请
}else{
if(item.getAssignSMEDate() == null){
applyingList.add(item);//申请中
}else{ }else{
if(item.getAssignSMEDate() == null){ isAssignExpertList.add(item);//已派遣专家
applyingList.add(item);//申请中
}else{
isAssignExpertList.add(item);//已派遣专家
}
} }
} }
if(expertApplyStatus == 1){//未申请 }
return unapplyList; if(expertApplyStatus == 1){//未申请
}else if(expertApplyStatus == 2){//申请中 return unapplyList;
return applyingList; }else if(expertApplyStatus == 2){//申请中
}else if(expertApplyStatus == 3){//已指派 return applyingList;
return isAssignExpertList; }else if(expertApplyStatus == 3){//已指派
}else{//全部 return isAssignExpertList;
return isAssignList; }else{//全部
} return isAssignList;
} }
} }
return resultList; return resultList;
......
...@@ -2,7 +2,7 @@ package com.yd.dal.entity.leads; ...@@ -2,7 +2,7 @@ package com.yd.dal.entity.leads;
public class LeadsStatusInfo { public class LeadsStatusInfo {
private Long leadsCustomerId; private Long leadsCustomerId;
private Long leadsStatus; private Long leadsStatusId;
public Long getLeadsCustomerId() { public Long getLeadsCustomerId() {
return leadsCustomerId; return leadsCustomerId;
...@@ -12,11 +12,11 @@ public class LeadsStatusInfo { ...@@ -12,11 +12,11 @@ public class LeadsStatusInfo {
this.leadsCustomerId = leadsCustomerId; this.leadsCustomerId = leadsCustomerId;
} }
public Long getLeadsStatus() { public Long getLeadsStatusId() {
return leadsStatus; return leadsStatusId;
} }
public void setLeadsStatus(Long leadsStatus) { public void setLeadsStatusId(Long leadsStatusId) {
this.leadsStatus = leadsStatus; this.leadsStatusId = leadsStatusId;
} }
} }
...@@ -51,7 +51,7 @@ public class MktLeadsPoolDALServiceImpl implements MktLeadsPoolDALService { ...@@ -51,7 +51,7 @@ public class MktLeadsPoolDALServiceImpl implements MktLeadsPoolDALService {
public Map<Long, Long> findLeadsStatusMap() { public Map<Long, Long> findLeadsStatusMap() {
Map<Long, Long> leadsMap = new HashMap<>(); Map<Long, Long> leadsMap = new HashMap<>();
List<LeadsStatusInfo> leadsStatusInfoList = mktLeadsPoolMapper.findLeadsStatusMap(); List<LeadsStatusInfo> leadsStatusInfoList = mktLeadsPoolMapper.findLeadsStatusMap();
leadsStatusInfoList.forEach(i->leadsMap.put(i.getLeadsCustomerId(),i.getLeadsStatus())); leadsStatusInfoList.forEach(i->leadsMap.put(i.getLeadsCustomerId(),i.getLeadsStatusId()));
return leadsMap; return leadsMap;
} }
} }
...@@ -919,7 +919,7 @@ ...@@ -919,7 +919,7 @@
left join ag_mkt_leads_assigneds a on a.assigned_practitioner_id = p.id left join ag_mkt_leads_assigneds a on a.assigned_practitioner_id = p.id
where a.id = #{leadsAssignedId,jdbcType=BIGINT} where a.id = #{leadsAssignedId,jdbcType=BIGINT}
</select> </select>
<select id="findAll" resultType="com.yd.dal.entity.customer.AclPractitioner"> <select id="findAll" parameterType="java.lang.Long" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from ag_acl_practitioner from ag_acl_practitioner
......
...@@ -164,7 +164,7 @@ ...@@ -164,7 +164,7 @@
c.blood_type_id as leadsBloodTypeId, c.blood_type_id as leadsBloodTypeId,
c.zodiac_type_id as leadsZodiacTypeId, c.zodiac_type_id as leadsZodiacTypeId,
IF(c.gender = 1, '男', '女') as leadsGender, IF(c.gender = 1, '男', '女') as leadsGender,
date_format(pool.added_at , '%Y-%m-%d %H:%i:%s') as leadsCreatTime, date_format(pool.added_at , '%Y-%m-%d %H:%i:%s') as leadsCreateTime,
assign.id as assignId, assign.id as assignId,
assign.assigned_practitioner_id as practitionerId, assign.assigned_practitioner_id as practitionerId,
pool.source_from as leadsSourceId, pool.source_from as leadsSourceId,
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
<select id="findLeadsStatusMap" resultType="com.yd.dal.entity.leads.LeadsStatusInfo"> <select id="findLeadsStatusMap" resultType="com.yd.dal.entity.leads.LeadsStatusInfo">
SELECT maxt.customer_id as leadsCustomerId, SELECT maxt.customer_id as leadsCustomerId,
# tr.leads_assigned_id as assignId, # tr.leads_assigned_id as assignId,
tr.md_drop_option_id as statusId -- 商机状态id tr.md_drop_option_id as leadsStatusId -- 商机状态id
FROM(SELECT customer_id,max(updated_at) as track_time FROM ag_mkt_leads_assigned_track tr GROUP BY tr.customer_id) maxt FROM(SELECT customer_id,max(updated_at) as track_time FROM ag_mkt_leads_assigned_track tr GROUP BY tr.customer_id) maxt
INNER JOIN ag_mkt_leads_assigned_track tr on maxt.customer_id=tr.customer_id AND maxt.track_time = tr.updated_at order by tr.leads_assigned_id; INNER JOIN ag_mkt_leads_assigned_track tr on maxt.customer_id=tr.customer_id AND maxt.track_time = tr.updated_at order by tr.leads_assigned_id;
......
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