Commit 610b93da by jianan

个人得分详情mdDropOptionId通过查询获取

parent ab855d8d
...@@ -335,12 +335,11 @@ public class ScheduleTrackServiceImpl implements ScheduleTrackService { ...@@ -335,12 +335,11 @@ public class ScheduleTrackServiceImpl implements ScheduleTrackService {
Long practitionerId = requestVO.getPractitionerId(); Long practitionerId = requestVO.getPractitionerId();
String time = requestVO.getTime(); String time = requestVO.getTime();
Calendar cal = Calendar.getInstance(); // 根据time获取查询起始日期和结束日期,默认当天
// 根据time获取查询起始日期,默认当天
Date startDate = new Date(); Date startDate = new Date();
// 根据time获取查询结束日期,默认当天
Date endDate = new Date(); Date endDate = new Date();
Calendar cal = Calendar.getInstance();
if ("w".equalsIgnoreCase(time)) { if ("w".equalsIgnoreCase(time)) {
cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY); cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.HOUR_OF_DAY, 0);
...@@ -359,8 +358,8 @@ public class ScheduleTrackServiceImpl implements ScheduleTrackService { ...@@ -359,8 +358,8 @@ public class ScheduleTrackServiceImpl implements ScheduleTrackService {
// 根据经纪人id查询个人所有日程 // 根据经纪人id查询个人所有日程
List<ScheduleTrack> scheduleList = scheduleTrackMapper.queryPersonalScheduleListByTime(practitionerId, time); List<ScheduleTrack> scheduleList = scheduleTrackMapper.queryPersonalScheduleListByTime(practitionerId, time);
// 计算增员日程和销售日程的得分 // 计算增员日程和销售日程的得分
List<Integer> saleOption = Arrays.asList(95,96,97,98,99,101,228); List<Long> saleOption = mdDropOptionsDALService.queryIdByByDropMasterCode("bizchance_promotion_action");
List<Integer> RecruitOption = Arrays.asList(107,108,109,110,111,112); List<Long> RecruitOption = mdDropOptionsDALService.queryIdByByDropMasterCode("team_building_track");
Long recruitScore = 0L; Long recruitScore = 0L;
Long saleScore = 0L; Long saleScore = 0L;
...@@ -368,11 +367,11 @@ public class ScheduleTrackServiceImpl implements ScheduleTrackService { ...@@ -368,11 +367,11 @@ public class ScheduleTrackServiceImpl implements ScheduleTrackService {
Long trainScore = 0L; Long trainScore = 0L;
Long meetingScore = 0L; Long meetingScore = 0L;
for (ScheduleTrack schedule : scheduleList) { for (ScheduleTrack schedule : scheduleList) {
if (saleOption.contains(schedule.getMdDropOptionId().intValue())) { if (saleOption.contains(schedule.getMdDropOptionId())) {
saleScore += schedule.getTrackScore(); saleScore += schedule.getTrackScore();
continue; continue;
} }
if (RecruitOption.contains(schedule.getMdDropOptionId().intValue())) { if (RecruitOption.contains(schedule.getMdDropOptionId())) {
recruitScore += schedule.getTrackScore(); recruitScore += schedule.getTrackScore();
continue; continue;
} }
......
...@@ -44,4 +44,8 @@ public interface MdDropOptionsDALService { ...@@ -44,4 +44,8 @@ public interface MdDropOptionsDALService {
List<MdDropOptions> findByDropMasterCodes(List<String> asList); List<MdDropOptions> findByDropMasterCodes(List<String> asList);
Map<Long, MdDropOptions> queryIdObjMapByByDropMasterCode(String masterCode); Map<Long, MdDropOptions> queryIdObjMapByByDropMasterCode(String masterCode);
List<Long> queryIdByByDropMasterCodes(List<String> masterCodeList);
List<Long> queryIdByByDropMasterCode(String masterCode);
} }
...@@ -11,6 +11,7 @@ import com.yd.util.intercept.annotation.TargetDataSource; ...@@ -11,6 +11,7 @@ import com.yd.util.intercept.annotation.TargetDataSource;
import com.yd.util.intercept.commons.DataSourceKey; import com.yd.util.intercept.commons.DataSourceKey;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -121,4 +122,20 @@ public class MdDropOptionsDALServiceImpl implements MdDropOptionsDALService { ...@@ -121,4 +122,20 @@ public class MdDropOptionsDALServiceImpl implements MdDropOptionsDALService {
dropOptionsList.forEach(i->optMap.put(i.getId(), i)); dropOptionsList.forEach(i->optMap.put(i.getId(), i));
return optMap; return optMap;
} }
@Override
public List<Long> queryIdByByDropMasterCodes(List<String> masterCodeList) {
List<Long> idList = new ArrayList<>();
List<MdDropOptions> options = mdDropOptionsMapper.findByDropMasterCodes(masterCodeList);
options.forEach(i->idList.add(i.getId()));
return idList;
}
@Override
public List<Long> queryIdByByDropMasterCode(String masterCode) {
List<Long> idList = new ArrayList<>();
List<MdDropOptions> options = mdDropOptionsMapper.findByMasterCode(masterCode);
options.forEach(i->idList.add(i.getId()));
return idList;
}
} }
...@@ -204,7 +204,6 @@ ...@@ -204,7 +204,6 @@
created_at, created_by, updated_at, updated_by, updator_type, creator_type created_at, created_by, updated_at, updated_by, updator_type, creator_type
from ag_mkt_schedule_task_tracking t from ag_mkt_schedule_task_tracking t
where t.practitioner_id = #{practitionerId,jdbcType=BIGINT} where t.practitioner_id = #{practitionerId,jdbcType=BIGINT}
and md_drop_option_id not in (223,224,225,226,227)
and to_days(t.track_time) &lt;= to_days(now()) and to_days(t.track_time) &lt;= to_days(now())
<if test="time != null"> <if test="time != null">
<choose> <choose>
...@@ -219,7 +218,7 @@ ...@@ -219,7 +218,7 @@
</when> </when>
</choose> </choose>
</if> </if>
union all union
select id, notice, task_type, refer_leads_id, refer_potential_id, select id, notice, task_type, refer_leads_id, refer_potential_id,
task_important_tag, task_routine_at_week7,task_routine_at_week6, task_routine_at_week5, task_important_tag, task_routine_at_week7,task_routine_at_week6, task_routine_at_week5,
task_routine_at_week4, task_routine_at_week3, task_routine_at_week2, task_routine_at_week1, task_routine_at_week4, task_routine_at_week3, task_routine_at_week2, task_routine_at_week1,
...@@ -228,10 +227,8 @@ ...@@ -228,10 +227,8 @@
from ag_mkt_schedule_task_tracking t from ag_mkt_schedule_task_tracking t
where t.practitioner_id = #{practitionerId,jdbcType=BIGINT} where t.practitioner_id = #{practitionerId,jdbcType=BIGINT}
and md_drop_option_id in and md_drop_option_id in
(SELECT o.id (SELECT o.id FROM ag_md_drop_options o LEFT JOIN ag_md_drop_master m ON m.id = o.drop_master_id
FROM ag_md_drop_options o WHERE m.scenario_code = 'pep_schedule_task_others'
LEFT JOIN ag_md_drop_master m ON m.id = o.drop_master_id
WHERE m.scenario_code = ''
) )
</select> </select>
......
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