Commit b49c4138 by wenyang

1.商机可以删除,变成不可见,如果重新建立商机,手机号重复,允许

2.团队业绩,加一个“去年”的时间段
3.团队业绩,进入后,上面的面板增加3列 目标FYP,目标FYC,完成率 。下面的排名,增加1列,目标FYC
parent dc267e14
......@@ -757,4 +757,19 @@ public class PractitionerController {
result.setData(responseVO);
return result;
}
/**
* 逻辑删除商机
* @param OpportunityDeleteRequestVO
* @return CommonResultIDResponseVO
* @author Yan Wenyang
*/
@RequestMapping("/deleteOpportunity")
public Object deleteOpportunity(@RequestBody OpportunityDeleteRequestVO requestVO) {
JsonResult result = new JsonResult();
CommonResultIDResponseVO responseVO = practitionerService.updateOpportunity(requestVO);
result.addResult(responseVO);
result.setData(responseVO);
return result;
}
}
......@@ -274,4 +274,13 @@ public interface PractitionerService {
* @author Yan Wenyang
*/
CommonResultIDResponseVO signUnionSales(SignUnionSalesRequestVO requestVO);
/**
* 逻辑删除商机
* @param OpportunityDeleteRequestVO
* @return CommonResultIDResponseVO
* @author Yan Wenyang
*/
CommonResultIDResponseVO updateOpportunity(OpportunityDeleteRequestVO requestVO);
}
package com.yd.api.practitioner.vo.opportunity;
import lombok.Data;
@Data
public class OpportunityDeleteRequestVO {
private Long practitionerId;//经纪人ID
private Long opportunityId;//商机Id
}
......@@ -12,6 +12,9 @@ public class AclCustomerFortuneStatistics implements Serializable {
private Integer count;
private Double fyp;
private Double fyc;
private Double targetFyc; //目标FYP
private Double targetFyp; //目标FYC
private Integer targetCount;//目标件数
public Integer getRank() {
return rank;
......@@ -92,6 +95,30 @@ public class AclCustomerFortuneStatistics implements Serializable {
public void setFyc(Double fyc) {
this.fyc = fyc;
}
public Double getTargetFyc() {
return targetFyc;
}
private static final long serialVersionUID = 1L;
public void setTargetFyc(Double targetFyc) {
this.targetFyc = targetFyc;
}
public Double getTargetFyp() {
return targetFyp;
}
public void setTargetFyp(Double targetFyp) {
this.targetFyp = targetFyp;
}
public Integer getTargetCount() {
return targetCount;
}
public void setTargetCount(Integer targetCount) {
this.targetCount = targetCount;
}
private static final long serialVersionUID = 1L;
}
......@@ -8,6 +8,9 @@ public class SubordinateSystemMemberInfo {
private Double fyp;
private Double fyc;
private Integer count;
private Double targetFyc; //目标FYP
private Double targetFyp; //目标FYC
private Integer targetCount;//目标件数
public Long getPractitionerId() {
return practitionerId;
......@@ -64,4 +67,29 @@ public class SubordinateSystemMemberInfo {
public void setCount(Integer count) {
this.count = count;
}
public Double getTargetFyc() {
return targetFyc;
}
public void setTargetFyc(Double targetFyc) {
this.targetFyc = targetFyc;
}
public Double getTargetFyp() {
return targetFyp;
}
public void setTargetFyp(Double targetFyp) {
this.targetFyp = targetFyp;
}
public Integer getTargetCount() {
return targetCount;
}
public void setTargetCount(Integer targetCount) {
this.targetCount = targetCount;
}
}
......@@ -2,7 +2,7 @@ package com.yd.api.practitioner.vo.subordinate;
public class SubordinateSystemMemberQueryRequestVO {
private Long practitionerId;
private Integer time;//1=month,3=quarter,2=year
private Integer time;//1=month,3=quarter,2=year,4=去年
private Integer type;//1=online,2=offLine
......
......@@ -5,6 +5,9 @@ public class SubordinateSystemStatisticInfo {
private Double fyp;
private Integer count;
private Double completionRate;
private Double targetFyc;//目标FYP
private Double targetFyp;//目标FYC,目标件数
private Integer targetCount;//目标件数
public Double getFyc() {
return fyc;
......@@ -37,4 +40,29 @@ public class SubordinateSystemStatisticInfo {
public void setCompletionRate(Double completionRate) {
this.completionRate = completionRate;
}
public Double getTargetFyc() {
return targetFyc;
}
public void setTargetFyc(Double targetFyc) {
this.targetFyc = targetFyc;
}
public Double getTargetFyp() {
return targetFyp;
}
public void setTargetFyp(Double targetFyp) {
this.targetFyp = targetFyp;
}
public Integer getTargetCount() {
return targetCount;
}
public void setTargetCount(Integer targetCount) {
this.targetCount = targetCount;
}
}
package com.yd.dal.mapper.marketing;
import com.yd.dal.entity.marketing.MktLeadsExpertAssign;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yd.dal.entity.marketing.MktLeadsExpertAssign;
public interface MktLeadsExpertAssignMapper {
int deleteByPrimaryKey(Long id);
......
package com.yd.dal.service.marketing.Impl;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.yd.dal.entity.marketing.MktLeadsExpertAssign;
import com.yd.dal.mapper.marketing.MktLeadsExpertAssignMapper;
import com.yd.dal.service.marketing.MktLeadsExpertAssignDALService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service("mktLeadsExpertAssignDALService")
public class MktLeadsExpertAssignDALServiceImpl implements MktLeadsExpertAssignDALService {
......@@ -17,4 +18,10 @@ public class MktLeadsExpertAssignDALServiceImpl implements MktLeadsExpertAssignD
public MktLeadsExpertAssign findByLeadsExpertRequestId(Long mktLeadsExpertRequestId) {
return mktLeadsExpertAssignMapper.selectByLeadsExpertRequestId(mktLeadsExpertRequestId);
}
@Override
public int updateByPrimaryKeySelective(MktLeadsExpertAssign mktLeadsExpertAssign) {
return mktLeadsExpertAssignMapper.updateByPrimaryKeySelective(mktLeadsExpertAssign);
}
}
......@@ -27,4 +27,9 @@ public class MktLeadsExpertRequestDALServiceImpl implements MktLeadsExpertReques
public MktLeadsExpertRequest findByCustomerId(Long customerId) {
return mktLeadsExpertRequestMapper.selectByCustomerId(customerId);
}
@Override
public int updateByPrimaryKeySelective(MktLeadsExpertRequest mktLeadsExpertRequest) {
return mktLeadsExpertRequestMapper.updateByPrimaryKeySelective(mktLeadsExpertRequest);
}
}
package com.yd.dal.service.marketing.Impl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yd.api.agms.vo.statistics.LeadsStatisticsInfo;
import com.yd.api.agms.vo.statistics.statementData;
import com.yd.dal.entity.leads.LeadsStatusInfo;
import com.yd.dal.entity.marketing.MktLeadsPool;
import com.yd.dal.mapper.marketing.MktLeadsPoolMapper;
import com.yd.dal.service.marketing.MktLeadsPoolDALService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service("mktLeadsPoolDALService")
public class MktLeadsPoolDALServiceImpl implements MktLeadsPoolDALService {
......@@ -56,4 +57,9 @@ public class MktLeadsPoolDALServiceImpl implements MktLeadsPoolDALService {
PageInfo<LeadsStatisticsInfo> pageInfo = new PageInfo<>(statementData);
return pageInfo;
}
@Override
public void updateMktLeadsAssigneds(MktLeadsPool pool){
mktLeadsPoolMapper.updateByPrimaryKeySelective(pool);
}
}
......@@ -4,4 +4,6 @@ import com.yd.dal.entity.marketing.MktLeadsExpertAssign;
public interface MktLeadsExpertAssignDALService {
MktLeadsExpertAssign findByLeadsExpertRequestId(Long mktLeadsExpertRequestId);
int updateByPrimaryKeySelective(MktLeadsExpertAssign mktLeadsExpertAssign);
}
......@@ -8,4 +8,7 @@ public interface MktLeadsExpertRequestDALService {
MktLeadsExpertRequest findByLeadsAssignedId(Long assignedId);
MktLeadsExpertRequest findByCustomerId(Long customerId);
int updateByPrimaryKeySelective(MktLeadsExpertRequest mktLeadsExpertRequest);
}
package com.yd.dal.service.marketing;
import java.util.List;
import java.util.Map;
import com.github.pagehelper.PageInfo;
import com.yd.api.agms.vo.statistics.LeadsStatisticsInfo;
import com.yd.dal.entity.marketing.MktLeadsPool;
import java.util.List;
import java.util.Map;
public interface MktLeadsPoolDALService {
MktLeadsPool findByCustomerId(Long customerId);
......@@ -19,4 +19,6 @@ public interface MktLeadsPoolDALService {
Map<Long, Long> findLeadsStatusMap();
PageInfo<LeadsStatisticsInfo> findByConditionPage(int pageNum, int size, Integer isStatement, Integer leadsStatus, Integer expertApplyStatus, String leadsStartTime, String leadsEndTime);
void updateMktLeadsAssigneds(MktLeadsPool pool);
}
......@@ -978,7 +978,31 @@
ifnull(COUNT(f.id),0) count ,
ifnull(SUM(f.order_price),0) FYP ,
ifnull(SUM(f.fyc_amount),0) FYC ,
s.practitioner_level practitionerLevelId
s.practitioner_level practitionerLevelId,
(select ifnull(sum(t.commission),0) from ag_mkt_leads_goals t where t.practitioner_id=p.id and t.goals_type=1 and t.is_active=1
<choose>
<when test="time == 1">
and t.statistic_time_unit=3
and t.current_year=year(now())
and t.seq_time=month(now())
</when>
<when test="time == 3">
and t.statistic_time_unit=3
and t.current_year=year(now())
and quarter(concat(t.current_year,'-',t.seq_time,'-01'))=quarter(now())
</when>
<when test="time == 4">
and t.statistic_time_unit=1
and t.current_year=year(now())-1
</when>
<otherwise>
and t.statistic_time_unit=1
and t.current_year=year(now())
</otherwise>
</choose>
) targetFyc,
0 targetFyp,
0 targetCount
FROM
((ag_acl_practitioner_setting s LEFT JOIN ag_acl_practitioner p ON s.practitioner_id = p.id)
INNER JOIN ag_acl_customer_fortune f ON f.customer_id = p.customer_id and f.drop_option_code in('S01','C01') )
......@@ -992,6 +1016,9 @@
<when test="time == 3">
and QUARTER(f.order_date) = QUARTER(NOW()) AND year(f.order_date)=year(now())
</when>
<when test="time == 4">
and YEAR(f.order_date) = YEAR(now())-1
</when>
<otherwise>
and YEAR(f.order_date) = YEAR(now())
</otherwise>
......
......@@ -1504,9 +1504,10 @@
if(ass.id is null ,0,1) expertType
FROM
ag_mkt_leads_assigneds a
left join ag_mkt_leads_expert_request r left join ag_mkt_leads_expert_assign ass on ass.leads_expert_request_id = r.id on r.customer_id = a.customer_id
LEFT JOIN ag_mkt_leads_pool p ON p.customer_id = a.customer_id
LEFT JOIN ag_acl_customer c ON c.id = a.customer_id
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_acl_customer c ON c.id = a.customer_id
where a.is_active=1
<if test="practitionerId != null">
and a.assigned_practitioner_id = #{practitionerId}
......
......@@ -153,6 +153,7 @@
<include refid="Base_Column_List" />
from ag_mkt_leads_pool
where customer_id = #{customerId,jdbcType=BIGINT}
and is_active=1
</select>
<select id="findALLByDate" resultType="com.yd.api.agms.vo.statistics.LeadsStatisticsInfo">
select c.id as leadsCustomerId,
......
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