Commit bb634d94 by jianan

PEP得分查询加个人得分

parent 7255e78e
...@@ -17,6 +17,7 @@ import com.yd.dal.service.marketing.MktLeadsAssignedTrackDALService; ...@@ -17,6 +17,7 @@ import com.yd.dal.service.marketing.MktLeadsAssignedTrackDALService;
import com.yd.dal.service.meta.MdDropOptionsDALService; import com.yd.dal.service.meta.MdDropOptionsDALService;
import com.yd.util.CommonUtil; import com.yd.util.CommonUtil;
import com.yd.util.config.ZHBErrorConfig; import com.yd.util.config.ZHBErrorConfig;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -244,12 +245,16 @@ public class ScheduleTrackServiceImpl implements ScheduleTrackService { ...@@ -244,12 +245,16 @@ public class ScheduleTrackServiceImpl implements ScheduleTrackService {
cal.set(Calendar.SECOND, 0); cal.set(Calendar.SECOND, 0);
Date weekOne = cal.getTime(); Date weekOne = cal.getTime();
List<Long> practitionerIdList = scheduleTrackMapper.queryTeamAllPractitionerId(practitionerId);
if (CollectionUtils.isEmpty(practitionerIdList)) {
// 集合为空,说明该经纪人不是团队长
practitionerIdList.add(practitionerId);
}
// 根据团队长经纪人id查询团队每个成员本日,本周,本月得分以及本月FYC // 根据团队长经纪人id查询团队每个成员本日,本周,本月得分以及本月FYC
List<PersonalPEPScore> saleAndRecuit = scheduleTrackMapper.querySaleRecuitScoreFYC(practitionerId, monthOne, today); List<PersonalPEPScore> saleAndRecuit = scheduleTrackMapper.querySaleRecuitScoreFYC(practitionerIdList, monthOne, today);
// 其他活动有长期固定,通过计算时间段内展示次数,算得总分 // 其他活动有长期固定,通过计算时间段内展示次数,算得总分
// 先获得每个人所有的其他活动 // 先获得每个人所有的其他活动
List<Long> practitionerIdList = scheduleTrackMapper.queryTeamAllPractitionerId(practitionerId);
List<PersonalSchedule> personalScheduleList = scheduleTrackMapper.queryPersonalScheduleList(practitionerIdList); List<PersonalSchedule> personalScheduleList = scheduleTrackMapper.queryPersonalScheduleList(practitionerIdList);
// 根据活动算本日,本周,本月的分数 // 根据活动算本日,本周,本月的分数
...@@ -261,6 +266,11 @@ public class ScheduleTrackServiceImpl implements ScheduleTrackService { ...@@ -261,6 +266,11 @@ public class ScheduleTrackServiceImpl implements ScheduleTrackService {
resp.setPersonalList(saleAndRecuit); resp.setPersonalList(saleAndRecuit);
resp.setAverage(average); resp.setAverage(average);
for (PersonalPEPScore s: saleAndRecuit) {
if (s.getPractitionerId().equals(practitionerId)) {
resp.setPerson(s);
}
}
resp.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000"))); resp.setCommonResult(new CommonResult(true, ZHBErrorConfig.getErrorInfo("800000")));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
......
...@@ -10,6 +10,7 @@ import java.util.Map; ...@@ -10,6 +10,7 @@ import java.util.Map;
@Data @Data
public class QueryPEPScoreResponseVO { public class QueryPEPScoreResponseVO {
private Map<String, Object> average; private Map<String, Object> average;
private PersonalPEPScore person;
private List<PersonalPEPScore> personalList; private List<PersonalPEPScore> personalList;
private CommonResult commonResult; private CommonResult commonResult;
} }
...@@ -17,7 +17,7 @@ public interface ScheduleTrackMapper { ...@@ -17,7 +17,7 @@ public interface ScheduleTrackMapper {
int checkTimePeriodConflict(@Param("taskTimeFrom")String taskTimeFrom, @Param("taskTimeEnd")String taskTimeEnd, int checkTimePeriodConflict(@Param("taskTimeFrom")String taskTimeFrom, @Param("taskTimeEnd")String taskTimeEnd,
@Param("practitionerId")Long practitionerId); @Param("practitionerId")Long practitionerId);
List<PersonalPEPScore> querySaleRecuitScoreFYC(@Param("practitionerId")Long practitionerId, @Param("firstDay")Date firstDay, List<PersonalPEPScore> querySaleRecuitScoreFYC(@Param("list")List<Long> practitionerIdList, @Param("firstDay")Date firstDay,
@Param("lastDay")Date lastDay); @Param("lastDay")Date lastDay);
List<Long> queryTeamAllPractitionerId(@Param("practitionerId")Long practitionerId); List<Long> queryTeamAllPractitionerId(@Param("practitionerId")Long practitionerId);
......
...@@ -99,10 +99,12 @@ ...@@ -99,10 +99,12 @@
left join (select practitioner_id, created_at, track_score left join (select practitioner_id, created_at, track_score
from ag_mkt_schedule_task_tracking where md_drop_option_id not in (223,224,225,226,227) from ag_mkt_schedule_task_tracking where md_drop_option_id not in (223,224,225,226,227)
) t on p.id = t.practitioner_id ) t on p.id = t.practitioner_id
left join ag_acl_practitioner_subordinate_system s on s.id = p.subordinate_system_id where 1=1
where s.owner_practitioner_id = #{practitionerId,jdbcType=BIGINT}
and s.is_active=1
and p.is_active=1 and p.is_active=1
and p.id in
<foreach collection="list" item="practitionerId" index="index" open="(" close=")" separator=",">
#{practitionerId,jdbcType=BIGINT}
</foreach>
group by p.id group by p.id
) s ) s
LEFT JOIN LEFT JOIN
......
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