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
acf55213
Commit
acf55213
authored
Apr 13, 2022
by
wenyang
Committed by
akexiu
Apr 14, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.团队成员活动量得分排序【 1:天;2:周;3:月(不传默认2:周)】
2.团队业绩完成率统计根据该团队下经纪人设置的目标fyc计算
parent
461c5ad0
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
59 deletions
+42
-59
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerServiceImpl.java
+7
-0
yd-api/src/main/java/com/yd/dal/mapper/customer/AclCustomerFortuneMapper.java
+2
-0
yd-api/src/main/java/com/yd/dal/service/customer/AclCustomerFortuneDALService.java
+2
-0
yd-api/src/main/java/com/yd/dal/service/customer/impl/AclCustomerFortuneDALServiceImpl.java
+5
-0
yd-api/src/main/resources/mapper/customer/AclCustomerFortuneMapper.xml
+26
-59
No files found.
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerServiceImpl.java
View file @
acf55213
...
...
@@ -3366,6 +3366,10 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
// for(AclCustomer item : customerList){
// practitionerIdMobileNoMap.put(customerMap.get(item.getId()),item.getMobileNo());
// }
//6、查询该体系下经纪人设置的目标
List
<
AclCustomerFortuneStatistics
>
customerTarget
=
aclCustomerFortuneDALService
.
findTargetBypractitionerIds
(
practitionerIds
,
time
);
Map
<
Long
,
AclCustomerFortuneStatistics
>
customerTargetMap
=
new
HashMap
<>();
customerTarget
.
forEach
(
i
->
customerTargetMap
.
put
(
i
.
getPractitionerId
(),
i
));
SubordinateSystemMemberInfo
memberInfo
;
Long
practitionerIdForMember
,
practitionerLevelId
;
AclCustomerFortuneStatistics
customerFortuneStatisticsItem
;
...
...
@@ -3387,6 +3391,9 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
fyc
=
Double
.
valueOf
(
customerFortuneStatisticsItem
.
getFyc
());
fyp
=
Double
.
valueOf
(
customerFortuneStatisticsItem
.
getFyp
());
count
=
Integer
.
valueOf
(
customerFortuneStatisticsItem
.
getCount
());
}
if
(
customerTargetMap
.
containsKey
(
practitionerIdForMember
))
{
customerFortuneStatisticsItem
=
customerTargetMap
.
get
(
practitionerIdForMember
);
targetFyc
=
Double
.
valueOf
(
customerFortuneStatisticsItem
.
getTargetFyc
());
targetFyp
=
Double
.
valueOf
(
customerFortuneStatisticsItem
.
getTargetFyp
());
targetCount
=
Integer
.
valueOf
(
customerFortuneStatisticsItem
.
getTargetCount
());
...
...
yd-api/src/main/java/com/yd/dal/mapper/customer/AclCustomerFortuneMapper.java
View file @
acf55213
...
...
@@ -37,6 +37,8 @@ public interface AclCustomerFortuneMapper {
List
<
AclCustomerFortuneStatistics
>
findBypractitionerIds
(
@Param
(
"list"
)
List
<
Long
>
practitionerIds
,
@Param
(
"time"
)
Integer
time
);
List
<
AclCustomerFortuneStatistics
>
findTargetBypractitionerIds
(
@Param
(
"list"
)
List
<
Long
>
practitionerIds
,
@Param
(
"time"
)
Integer
time
);
List
<
AclCustomerFortune
>
queryLifeFortuneListByOrderId
(
Long
orderId
);
List
<
AclCustomerFortune
>
queryLifeFortuneListByCommissionId
(
Long
commissionId
);
...
...
yd-api/src/main/java/com/yd/dal/service/customer/AclCustomerFortuneDALService.java
View file @
acf55213
...
...
@@ -28,6 +28,8 @@ public interface AclCustomerFortuneDALService {
List
<
AclCustomerFortuneStatistics
>
findBypractitionerIds
(
List
<
Long
>
practitionerIds
,
Integer
time
);
List
<
AclCustomerFortuneStatistics
>
findTargetBypractitionerIds
(
List
<
Long
>
practitionerIds
,
Integer
time
);
List
<
AclCustomerFortune
>
queryLifeFortuneListByOrderId
(
Long
orderId
);
List
<
AclCustomerFortune
>
queryLifeFortuneListByCommissionId
(
Long
commissionId
);
...
...
yd-api/src/main/java/com/yd/dal/service/customer/impl/AclCustomerFortuneDALServiceImpl.java
View file @
acf55213
...
...
@@ -56,6 +56,11 @@ public class AclCustomerFortuneDALServiceImpl implements AclCustomerFortuneDALSe
}
@Override
public
List
<
AclCustomerFortuneStatistics
>
findTargetBypractitionerIds
(
List
<
Long
>
practitionerIds
,
Integer
time
)
{
return
aclCustomerFortuneMapper
.
findTargetBypractitionerIds
(
practitionerIds
,
time
);
}
@Override
public
List
<
AclCustomerFortune
>
queryLifeFortuneListByOrderId
(
Long
orderId
)
{
return
aclCustomerFortuneMapper
.
queryLifeFortuneListByOrderId
(
orderId
);
}
...
...
yd-api/src/main/resources/mapper/customer/AclCustomerFortuneMapper.xml
View file @
acf55213
...
...
@@ -978,52 +978,40 @@
ifnull(COUNT(f.id),0) count ,
ifnull(SUM(f.order_price),0) FYP ,
ifnull(SUM(f.fyc_amount),0) FYC ,
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,
(select ifnull(sum(t.premium),0) from ag_mkt_leads_goals t where t.practitioner_id=p.id and t.goals_type=1 and t.is_active=1
s.practitioner_level practitionerLevelId
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') )
INNER JOIN ag_po_order o ON f.order_id = o.id
WHERE
o.status = 3 and o.payment_status = 3 and o.order_price
>
0
<choose>
<when
test=
"time == 1"
>
and t.statistic_time_unit=3
and t.current_year=year(now())
and t.seq_time=month(now())
and DATE_FORMAT(f.order_date, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</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())
and QUARTER(f.order_date) = QUARTER(NOW()) AND year(f.order_date)=year(now())
</when>
<when
test=
"time == 4"
>
and t.statistic_time_unit=1
and t.current_year=year(now())-1
and YEAR(f.order_date) = YEAR(now())-1
</when>
<otherwise>
and t.statistic_time_unit=1
and t.current_year=year(now())
and YEAR(f.order_date) = YEAR(now())
</otherwise>
</choose>
) targetFyp,
(select ifnull(sum(t.pieces),0) from ag_mkt_leads_goals t where t.practitioner_id=p.id and t.goals_type=1 and t.is_active=1
and p.id in
<foreach
collection=
"list"
item=
"practitionerId"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{practitionerId,jdbcType=BIGINT}
</foreach>
GROUP BY f.customer_id
</select>
<select
id=
"findTargetBypractitionerIds"
resultType=
"com.yd.api.practitioner.vo.rank.AclCustomerFortuneStatistics"
>
select ifnull(sum(t.commission),0) targetFyc,
ifnull(sum(t.premium),0) targetFyp,
ifnull(sum(t.pieces),0) targetCount,
t.practitioner_id practitionerId
from ag_mkt_leads_goals t where t.goals_type=1 and t.is_active=1
<choose>
<when
test=
"time == 1"
>
and t.statistic_time_unit=3
...
...
@@ -1044,32 +1032,11 @@
and t.current_year=year(now())
</otherwise>
</choose>
) 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') )
INNER JOIN ag_po_order o ON f.order_id = o.id
WHERE
o.status = 3 and o.payment_status = 3 and o.order_price
>
0
<choose>
<when
test=
"time == 1"
>
and DATE_FORMAT(f.order_date, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</when>
<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>
</choose>
and p.id in
and t.practitioner_id in
<foreach
collection=
"list"
item=
"practitionerId"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{practitionerId,jdbcType=BIGINT}
</foreach>
GROUP BY f.custom
er_id
group by t.practition
er_id
</select>
<select
id=
"queryLifeFortuneListByOrderId"
resultMap=
"BaseResultMap"
>
...
...
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