Commit 4b318b44 by yao.xiao

增加-经纪人查看自己销售活动量分值详情

parent 67186862
...@@ -395,4 +395,17 @@ public class PractitionerController { ...@@ -395,4 +395,17 @@ public class PractitionerController {
result.addResult(responseVO); result.addResult(responseVO);
return result; return result;
} }
/**
* 经纪人-查看自己销售活动量分值详情
*/
@RequestMapping("salesScoreDetailQuery")
public Object salesScoreDetailQuery (@RequestBody SalesScoreDetailQueryRequestVO requestVO ){
JsonResult result = new JsonResult();
SalesScoreDetailQueryResponseVO responseVO = practitionerService.salesScoreDetailQuery(requestVO);
result.setData(responseVO);
result.addResult(responseVO);
return result;
}
} }
...@@ -202,4 +202,11 @@ public interface PractitionerService { ...@@ -202,4 +202,11 @@ public interface PractitionerService {
* @return 响应数据 * @return 响应数据
*/ */
PotentialActivityQueryResponseVO potentialActivityQuery(PotentialActivityQueryRequestVO requestVO); PotentialActivityQueryResponseVO potentialActivityQuery(PotentialActivityQueryRequestVO requestVO);
/**
* 经纪人-查看自己销售活动量分值详情
* @param requestVO 请求数据
* @return 响应数据
*/
SalesScoreDetailQueryResponseVO salesScoreDetailQuery(SalesScoreDetailQueryRequestVO requestVO);
} }
...@@ -2486,6 +2486,18 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service. ...@@ -2486,6 +2486,18 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
return responseVO; return responseVO;
} }
@Override
public SalesScoreDetailQueryResponseVO salesScoreDetailQuery(SalesScoreDetailQueryRequestVO requestVO) {
SalesScoreDetailQueryResponseVO responseVO = new SalesScoreDetailQueryResponseVO();
Long practitionerId = requestVO.getPractitionerId();
String time = requestVO.getTime();
//根据经纪人id及时间范围统计跟进状态次数
List<SalesScoreDetail> salesScoreDetails = mktLeadsAssignedTrackDALService.getSalesScoreDetailByPractitionerId(practitionerId,time);
responseVO.setSalesScoreDetails(salesScoreDetails);
responseVO.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
return responseVO;
}
private Date getTimeStartDate(Calendar calendar, String time) { private Date getTimeStartDate(Calendar calendar, String time) {
if(calendar != null){ if(calendar != null){
switch (time) { switch (time) {
......
package com.yd.api.practitioner.vo.opportunity;
import lombok.Data;
@Data
public class SalesScoreDetail {
private Long dropOptionsId;
private String dropOptionsName;
private Long number;
}
package com.yd.api.practitioner.vo.opportunity;
import lombok.Data;
@Data
public class SalesScoreDetailQueryRequestVO {
private Long practitionerId;
private String time;//D:今天 W:周 M:月
}
package com.yd.api.practitioner.vo.opportunity;
import com.yd.api.result.CommonResult;
import lombok.Data;
import java.util.List;
@Data
public class SalesScoreDetailQueryResponseVO {
private List<SalesScoreDetail> salesScoreDetails;
private CommonResult commonResult;
}
package com.yd.dal.mapper.marketing; package com.yd.dal.mapper.marketing;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.yd.api.practitioner.vo.opportunity.SalesScoreDetail;
import com.yd.dal.entity.marketing.MktLeadsAssignedTrack; import com.yd.dal.entity.marketing.MktLeadsAssignedTrack;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.HashMap; import java.util.HashMap;
...@@ -27,4 +29,6 @@ public interface MktLeadsAssignedTrackMapper { ...@@ -27,4 +29,6 @@ public interface MktLeadsAssignedTrackMapper {
HashMap<String, BigDecimal> totalStatisticsForTeam(List<Long> practitionerIds); HashMap<String, BigDecimal> totalStatisticsForTeam(List<Long> practitionerIds);
MktLeadsAssignedTrack findByListNotesForCustomerId(Long customerId); MktLeadsAssignedTrack findByListNotesForCustomerId(Long customerId);
List<SalesScoreDetail> getSalesScoreDetailByPractitionerId(@Param("practitionerId") Long practitionerId,@Param("time") String time);
} }
\ No newline at end of file
...@@ -2,6 +2,7 @@ package com.yd.dal.service.marketing.Impl; ...@@ -2,6 +2,7 @@ package com.yd.dal.service.marketing.Impl;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.yd.api.practitioner.vo.opportunity.SalesScoreDetail;
import com.yd.dal.entity.marketing.MktLeadsAssignedTrack; import com.yd.dal.entity.marketing.MktLeadsAssignedTrack;
import com.yd.dal.mapper.marketing.MktLeadsAssignedTrackMapper; import com.yd.dal.mapper.marketing.MktLeadsAssignedTrackMapper;
import com.yd.dal.service.marketing.MktLeadsAssignedTrackDALService; import com.yd.dal.service.marketing.MktLeadsAssignedTrackDALService;
...@@ -49,4 +50,9 @@ public class MktLeadsAssignedTrackDALServiceImpl implements MktLeadsAssignedTrac ...@@ -49,4 +50,9 @@ public class MktLeadsAssignedTrackDALServiceImpl implements MktLeadsAssignedTrac
public MktLeadsAssignedTrack findByListNotesForCustomerId(Long customerId) { public MktLeadsAssignedTrack findByListNotesForCustomerId(Long customerId) {
return mktLeadsAssignedTrackMapper.findByListNotesForCustomerId(customerId); return mktLeadsAssignedTrackMapper.findByListNotesForCustomerId(customerId);
} }
@Override
public List<SalesScoreDetail> getSalesScoreDetailByPractitionerId(Long practitionerId, String time) {
return mktLeadsAssignedTrackMapper.getSalesScoreDetailByPractitionerId(practitionerId, time);
}
} }
package com.yd.dal.service.marketing; package com.yd.dal.service.marketing;
import com.yd.api.practitioner.vo.opportunity.SalesScoreDetail;
import com.yd.dal.entity.marketing.MktLeadsAssignedTrack; import com.yd.dal.entity.marketing.MktLeadsAssignedTrack;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -23,4 +24,12 @@ public interface MktLeadsAssignedTrackDALService { ...@@ -23,4 +24,12 @@ public interface MktLeadsAssignedTrackDALService {
HashMap<String, BigDecimal> totalStatisticsForTeam(List<Long> practitionerIds); HashMap<String, BigDecimal> totalStatisticsForTeam(List<Long> practitionerIds);
MktLeadsAssignedTrack findByListNotesForCustomerId(Long customerId); MktLeadsAssignedTrack findByListNotesForCustomerId(Long customerId);
/**
* 根据经纪人id及时间范围统计跟进状态次数
* @param practitionerId 经纪人id
* @param time 时间范围 今天:d 周:w 月:m
* @return 跟进状态详情
*/
List<SalesScoreDetail> getSalesScoreDetailByPractitionerId(Long practitionerId, String time);
} }
...@@ -342,4 +342,32 @@ ...@@ -342,4 +342,32 @@
order by id desc order by id desc
limit 0,1 limit 0,1
</select> </select>
<resultMap id="SalesScoreDetailMap" type="com.yd.api.practitioner.vo.opportunity.SalesScoreDetail">
<id column="dropOptionsId" jdbcType="BIGINT" property="dropOptionsId" />
<result column="dropOptionsName" jdbcType="BIGINT" property="dropOptionsName" />
<result column="number" jdbcType="BIGINT" property="number" />
</resultMap>
<select id="getSalesScoreDetailByPractitionerId" resultMap="SalesScoreDetailMap">
select o.id dropOptionsId,
o.drop_option_name dropOptionsName,
count(t.id) number
from ag_mkt_leads_assigned_track t
left join ag_md_drop_options o on o.id = t.md_drop_option_id
where t.practitioner_id = #{practitionerId,jdbcType=BIGINT}
<if test="time != null">
<choose>
<when test="time == 'd'.toString() || time == 'D'.toString()">
and to_days(t.track_time) = to_days(now())
</when>
<when test="time == 'w'.toString() || time == 'W'.toString()">
and YEARWEEK(date_format(t.track_time, '%Y-%m-%d')) = YEARWEEK(now())
</when>
<when test="time == 'm'.toString() || time == 'M'.toString()">
and date_format(t.track_time, '%Y-%m') = date_format(now(), '%Y-%m')
</when>
</choose>
</if>
group by t.md_drop_option_id,o.drop_option_order
ORDER BY o.drop_option_order
</select>
</mapper> </mapper>
\ No newline at end of file
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