Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-backend
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AutogeneralShanghai
yd-backend
Commits
3531023d
Commit
3531023d
authored
Sep 17, 2020
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PEP个人得分详情查询接口
parent
57192da0
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
146 additions
and
9 deletions
+146
-9
yd-api/src/main/java/com/yd/api/practitioner/PractitionerController.java
+14
-0
yd-api/src/main/java/com/yd/api/practitioner/service/ScheduleTrackService.java
+3
-0
yd-api/src/main/java/com/yd/api/practitioner/service/impl/ScheduleTrackServiceImpl.java
+77
-5
yd-api/src/main/java/com/yd/api/practitioner/vo/sechedule/QueryPEPScoreDetailResponseVO.java
+12
-0
yd-api/src/main/java/com/yd/api/practitioner/vo/sechedule/ScheduleTrackVO.java
+0
-1
yd-api/src/main/java/com/yd/dal/entity/practitioner/PEPScoreDetail.java
+13
-0
yd-api/src/main/java/com/yd/dal/mapper/marketing/ScheduleTrackMapper.java
+3
-3
yd-api/src/main/resources/mapper/marketing/ScheduleTrackMapper.xml
+24
-0
No files found.
yd-api/src/main/java/com/yd/api/practitioner/PractitionerController.java
View file @
3531023d
...
@@ -551,4 +551,18 @@ public class PractitionerController {
...
@@ -551,4 +551,18 @@ public class PractitionerController {
return
result
;
return
result
;
}
}
/**
* 查询个人PEP得分详情
* @param practitionerId
* @return
*/
@RequestMapping
(
"/queryPEPScoreDetail"
)
public
Object
queryPEPScoreDetail
(
String
practitionerId
,
String
time
){
JsonResult
result
=
new
JsonResult
();
QueryPEPScoreDetailResponseVO
responseVO
=
scheduleTrackService
.
queryPEPScoreDetail
(
Long
.
parseLong
(
practitionerId
),
time
);
result
.
addResult
(
responseVO
);
result
.
setData
(
responseVO
);
return
result
;
}
}
}
yd-api/src/main/java/com/yd/api/practitioner/service/ScheduleTrackService.java
View file @
3531023d
...
@@ -8,4 +8,7 @@ public interface ScheduleTrackService {
...
@@ -8,4 +8,7 @@ public interface ScheduleTrackService {
QueryScheduleTrackListResponseVO
queryScheduleTrackList
(
QueryScheduleTrackListRequestVO
requestVO
);
QueryScheduleTrackListResponseVO
queryScheduleTrackList
(
QueryScheduleTrackListRequestVO
requestVO
);
QueryPEPScoreResponseVO
queryPEPScore
(
Long
practitionerId
);
QueryPEPScoreResponseVO
queryPEPScore
(
Long
practitionerId
);
QueryPEPScoreDetailResponseVO
queryPEPScoreDetail
(
Long
practitionerId
,
String
time
);
}
}
yd-api/src/main/java/com/yd/api/practitioner/service/impl/ScheduleTrackServiceImpl.java
View file @
3531023d
...
@@ -6,6 +6,7 @@ import com.yd.api.result.CommonResult;
...
@@ -6,6 +6,7 @@ import com.yd.api.result.CommonResult;
import
com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack
;
import
com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack
;
import
com.yd.dal.entity.marketing.MktLeadsAssignedTrack
;
import
com.yd.dal.entity.marketing.MktLeadsAssignedTrack
;
import
com.yd.dal.entity.meta.MdDropOptions
;
import
com.yd.dal.entity.meta.MdDropOptions
;
import
com.yd.dal.entity.practitioner.PEPScoreDetail
;
import
com.yd.dal.entity.practitioner.PersonalPEPScore
;
import
com.yd.dal.entity.practitioner.PersonalPEPScore
;
import
com.yd.dal.entity.practitioner.PersonalSchedule
;
import
com.yd.dal.entity.practitioner.PersonalSchedule
;
import
com.yd.dal.entity.practitioner.ScheduleTrack
;
import
com.yd.dal.entity.practitioner.ScheduleTrack
;
...
@@ -21,8 +22,6 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -21,8 +22,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.text.DecimalFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
@Service
@Service
...
@@ -84,7 +83,7 @@ public class ScheduleTrackServiceImpl implements ScheduleTrackService {
...
@@ -84,7 +83,7 @@ public class ScheduleTrackServiceImpl implements ScheduleTrackService {
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
();
resp
.
setCommonResult
(
new
CommonResult
(
false
,
ZHBErrorConfig
.
getErrorInfo
(
"800001"
)));
resp
.
setCommonResult
(
new
CommonResult
(
false
,
e
.
getMessage
(
)));
}
}
return
resp
;
return
resp
;
}
}
...
@@ -169,7 +168,7 @@ public class ScheduleTrackServiceImpl implements ScheduleTrackService {
...
@@ -169,7 +168,7 @@ public class ScheduleTrackServiceImpl implements ScheduleTrackService {
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
();
resp
.
setCommonResult
(
new
CommonResult
(
false
,
ZHBErrorConfig
.
getErrorInfo
(
"800001"
)));
resp
.
setCommonResult
(
new
CommonResult
(
false
,
e
.
getMessage
(
)));
}
}
return
resp
;
return
resp
;
}
}
...
@@ -261,7 +260,78 @@ public class ScheduleTrackServiceImpl implements ScheduleTrackService {
...
@@ -261,7 +260,78 @@ public class ScheduleTrackServiceImpl implements ScheduleTrackService {
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
();
resp
.
setCommonResult
(
new
CommonResult
(
false
,
ZHBErrorConfig
.
getErrorInfo
(
"800001"
)));
resp
.
setCommonResult
(
new
CommonResult
(
false
,
e
.
getMessage
()));
}
return
resp
;
}
@Override
public
QueryPEPScoreDetailResponseVO
queryPEPScoreDetail
(
Long
practitionerId
,
String
time
)
{
QueryPEPScoreDetailResponseVO
resp
=
new
QueryPEPScoreDetailResponseVO
();
Calendar
cal
=
Calendar
.
getInstance
();
// 根据time获取查询起始日期,默认当天
Date
startDate
=
new
Date
();
// 根据time获取查询结束日期,默认当天
Date
endDate
=
new
Date
();
if
(
"w"
.
equalsIgnoreCase
(
time
))
{
cal
.
set
(
Calendar
.
DAY_OF_WEEK
,
Calendar
.
MONDAY
);
cal
.
set
(
Calendar
.
HOUR_OF_DAY
,
0
);
cal
.
set
(
Calendar
.
MINUTE
,
0
);
cal
.
set
(
Calendar
.
SECOND
,
0
);
startDate
=
cal
.
getTime
();
}
if
(
"m"
.
equalsIgnoreCase
(
time
))
{
cal
.
add
(
Calendar
.
MONTH
,
0
);
// 获取到本月起始日
int
actualMinimum
=
cal
.
getActualMinimum
(
Calendar
.
DAY_OF_MONTH
);
cal
.
set
(
cal
.
get
(
Calendar
.
YEAR
),
cal
.
get
(
Calendar
.
MONDAY
),
actualMinimum
,
00
,
00
,
00
);
startDate
=
cal
.
getTime
();
}
try
{
// 根据经纪人id查询个人所有日程
List
<
ScheduleTrack
>
scheduleList
=
scheduleTrackMapper
.
queryPersonalScheduleListByTime
(
practitionerId
,
time
);
// 计算增员日程和销售日程的得分
List
<
Integer
>
saleOption
=
Arrays
.
asList
(
95
,
96
,
97
,
98
,
99
,
101
,
228
);
List
<
Integer
>
RecruitOption
=
Arrays
.
asList
(
107
,
108
,
109
,
110
,
111
,
112
);
Long
recruitScore
=
0L
;
Long
saleScore
=
0L
;
Long
coachScore
=
0L
;
Long
trainScore
=
0L
;
Long
meetingScore
=
0L
;
for
(
ScheduleTrack
schedule
:
scheduleList
)
{
if
(
saleOption
.
contains
(
schedule
.
getMdDropOptionId
().
intValue
()))
{
saleScore
+=
schedule
.
getTrackScore
();
}
if
(
RecruitOption
.
contains
(
schedule
.
getMdDropOptionId
().
intValue
()))
{
recruitScore
+=
schedule
.
getTrackScore
();
}
if
(
223
==
schedule
.
getMdDropOptionId
())
{
coachScore
+=
this
.
calculateScheduleDisplayCount
(
schedule
,
startDate
,
endDate
)
*
schedule
.
getTrackScore
();
}
if
(
224
==
schedule
.
getMdDropOptionId
())
{
coachScore
+=
this
.
calculateScheduleDisplayCount
(
schedule
,
startDate
,
endDate
)
*
schedule
.
getTrackScore
();
}
if
(
226
==
schedule
.
getMdDropOptionId
())
{
coachScore
+=
this
.
calculateScheduleDisplayCount
(
schedule
,
startDate
,
endDate
)
*
schedule
.
getTrackScore
();
}
}
PEPScoreDetail
PEPScoreDetail
=
new
PEPScoreDetail
();
PEPScoreDetail
.
setRecruitScore
(
recruitScore
);
PEPScoreDetail
.
setSaleScore
(
saleScore
);
PEPScoreDetail
.
setCoachScore
(
coachScore
);
PEPScoreDetail
.
setTrainScore
(
trainScore
);
PEPScoreDetail
.
setMeetingScore
(
meetingScore
);
resp
.
setDetail
(
PEPScoreDetail
);
resp
.
setCommonResult
(
new
CommonResult
(
true
,
ZHBErrorConfig
.
getErrorInfo
(
"800000"
)));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
resp
.
setCommonResult
(
new
CommonResult
(
false
,
e
.
getMessage
()));
}
}
return
resp
;
return
resp
;
}
}
...
@@ -387,4 +457,6 @@ public class ScheduleTrackServiceImpl implements ScheduleTrackService {
...
@@ -387,4 +457,6 @@ public class ScheduleTrackServiceImpl implements ScheduleTrackService {
return
count
;
return
count
;
}
}
}
}
yd-api/src/main/java/com/yd/api/practitioner/vo/sechedule/QueryPEPScoreDetailResponseVO.java
0 → 100644
View file @
3531023d
package
com
.
yd
.
api
.
practitioner
.
vo
.
sechedule
;
import
com.yd.api.result.CommonResult
;
import
com.yd.dal.entity.practitioner.PEPScoreDetail
;
import
lombok.Data
;
@Data
public
class
QueryPEPScoreDetailResponseVO
{
private
PEPScoreDetail
detail
;
private
CommonResult
commonResult
;
}
yd-api/src/main/java/com/yd/api/practitioner/vo/sechedule/ScheduleTrackVO.java
View file @
3531023d
...
@@ -2,7 +2,6 @@ package com.yd.api.practitioner.vo.sechedule;
...
@@ -2,7 +2,6 @@ package com.yd.api.practitioner.vo.sechedule;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Data
;
import
lombok.Data
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.util.Date
;
import
java.util.Date
;
@Data
@Data
...
...
yd-api/src/main/java/com/yd/dal/entity/practitioner/PEPScoreDetail.java
0 → 100644
View file @
3531023d
package
com
.
yd
.
dal
.
entity
.
practitioner
;
import
lombok.Data
;
@Data
public
class
PEPScoreDetail
{
private
Long
recruitScore
;
private
Long
saleScore
;
private
Long
coachScore
;
private
Long
trainScore
;
private
Long
meetingScore
;
}
yd-api/src/main/java/com/yd/dal/mapper/marketing/ScheduleTrackMapper.java
View file @
3531023d
package
com
.
yd
.
dal
.
mapper
.
marketing
;
package
com
.
yd
.
dal
.
mapper
.
marketing
;
import
com.yd.dal.entity.practitioner.PEPScoreDetail
;
import
com.yd.dal.entity.practitioner.PersonalPEPScore
;
import
com.yd.dal.entity.practitioner.PersonalPEPScore
;
import
com.yd.dal.entity.practitioner.PersonalSchedule
;
import
com.yd.dal.entity.practitioner.PersonalSchedule
;
import
com.yd.dal.entity.practitioner.ScheduleTrack
;
import
com.yd.dal.entity.practitioner.ScheduleTrack
;
...
@@ -7,7 +8,6 @@ import org.apache.ibatis.annotations.Param;
...
@@ -7,7 +8,6 @@ import org.apache.ibatis.annotations.Param;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
public
interface
ScheduleTrackMapper
{
public
interface
ScheduleTrackMapper
{
...
@@ -21,10 +21,10 @@ public interface ScheduleTrackMapper {
...
@@ -21,10 +21,10 @@ public interface ScheduleTrackMapper {
List
<
PersonalPEPScore
>
querySaleRecuitScoreFYC
(
@Param
(
"practitionerId"
)
Long
practitionerId
,
@Param
(
"firstDay"
)
Date
firstDay
,
List
<
PersonalPEPScore
>
querySaleRecuitScoreFYC
(
@Param
(
"practitionerId"
)
Long
practitionerId
,
@Param
(
"firstDay"
)
Date
firstDay
,
@Param
(
"lastDay"
)
Date
lastDay
);
@Param
(
"lastDay"
)
Date
lastDay
);
List
<
Map
<
String
,
Object
>>
queryOtherScore
(
@Param
(
"practitionerId"
)
Long
practitionerId
);
List
<
Long
>
queryTeamAllPractitionerId
(
@Param
(
"practitionerId"
)
Long
practitionerId
);
List
<
Long
>
queryTeamAllPractitionerId
(
@Param
(
"practitionerId"
)
Long
practitionerId
);
List
<
PersonalSchedule
>
queryPersonalScheduleList
(
List
<
Long
>
practitionerIdList
);
List
<
PersonalSchedule
>
queryPersonalScheduleList
(
List
<
Long
>
practitionerIdList
);
List
<
ScheduleTrack
>
queryPersonalScheduleListByTime
(
@Param
(
"practitionerId"
)
Long
practitionerId
,
@Param
(
"time"
)
String
time
);
}
}
yd-api/src/main/resources/mapper/marketing/ScheduleTrackMapper.xml
View file @
3531023d
...
@@ -174,4 +174,27 @@
...
@@ -174,4 +174,27 @@
</foreach>
</foreach>
</select>
</select>
<select
id=
"queryPersonalScheduleListByTime"
resultMap=
"ScheduleTrackResultMap"
>
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_routine_at_week4, task_routine_at_week3, task_routine_at_week2, task_routine_at_week1,
task_time_from, task_time_end, is_active, practitioner_id, customer_id, md_drop_option_id, track_score, track_time,
created_at, created_by, updated_at, updated_by, updator_type, creator_type
from ag_mkt_schedule_task_tracking t
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>
</select>
</mapper>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment