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
6276df5c
Commit
6276df5c
authored
Feb 22, 2021
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
N22保单列表查询
parent
1c0779c9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
127 additions
and
11 deletions
+127
-11
yd-api/src/main/java/com/yd/api/practitioner/PractitionerController.java
+10
-7
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerBasicInfoServiceImpl.java
+45
-3
yd-api/src/main/java/com/yd/dal/entity/order/CustomerPolicyInfo.java
+1
-1
yd-api/src/main/java/com/yd/util/CommonUtil.java
+71
-0
No files found.
yd-api/src/main/java/com/yd/api/practitioner/PractitionerController.java
View file @
6276df5c
...
...
@@ -31,15 +31,14 @@ import com.yd.api.practitioner.vo.subordinate.QueryTeamMemberDetailResponseVO;
import
com.yd.api.practitioner.vo.subordinate.SubordinateSystemMemberQueryRequestVO
;
import
com.yd.api.practitioner.vo.subordinate.SubordinateSystemMemberQueryResponseVO
;
import
com.yd.api.result.JsonResult
;
import
com.yd.rmi.n22.policy.pojo.policylist.PolicyListQueryRequestBody
;
import
com.yd.rmi.n22.policy.service.N22PolicyService
;
import
com.yd.rmi.n22.staff.pojo.GetStaffNewRequestBody
;
import
com.yd.rmi.n22.staff.pojo.GetStaffNewResponseVO
;
import
com.yd.rmi.n22.staff.service.N22StaffService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
import
java.awt.*
;
...
...
@@ -56,6 +55,8 @@ public class PractitionerController {
private
ScheduleTrackService
scheduleTrackService
;
@Autowired
private
N22PolicyService
n22PolicyService
;
@Autowired
private
N22StaffService
n22StaffService
;
/**
* 经纪人登录
* @param requestVO 请求数据
...
...
@@ -623,13 +624,15 @@ public class PractitionerController {
}
/**
* test
* @param obj
* @return
*/
@RequestMapping
(
"/test"
)
public
Object
test
(
@RequestBody
PolicyListQueryRequestBody
obj
){
com
.
yd
.
rmi
.
n22
.
policy
.
pojo
.
policylist
.
PolicyListQueryResponseVO
policyListQueryResponseVO
=
n22PolicyService
.
policyList
(
obj
);
return
policyListQueryResponseVO
;
public
Object
test
(
@RequestBody
PolicyListQueryRequestVO
requestVO
)
throws
Exception
{
JsonResult
result
=
new
JsonResult
();
PolicyListQueryResponseVO
responseVO
=
practitionerBasicInfoService
.
policyListQuery
(
requestVO
);
result
.
setData
(
responseVO
);
result
.
addResult
(
responseVO
);
return
result
;
}
...
...
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerBasicInfoServiceImpl.java
View file @
6276df5c
...
...
@@ -112,7 +112,13 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
getPolicyListForYD
(
policyInfoList
,
practitionerId
,
time
);
//2、线下
// getPolicyListForEGolden(policyInfoList,mobileNo,time);
// getPolicyListFromN22(policyInfoList, mobileNo, time);
try
{
getPolicyListFromN22
(
policyInfoList
,
mobileNo
,
time
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
responseVO
.
setCommonResult
(
new
CommonResult
(
false
,
e
.
getMessage
()));
return
responseVO
;
}
responseVO
.
setPolicyInfoList
(
policyInfoList
);
Collections
.
sort
(
policyInfoList
);
...
...
@@ -128,12 +134,12 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
}
private
void
getPolicyListFromN22
(
List
<
PolicyInfo
>
policyInfoList
,
String
mobileNo
,
Integer
time
)
throws
Exception
{
// TODO N22Service
// 1.根据手机号查询经纪人在N22系统的Agent_id
GetStaffNewRequestBody
getStaffNewRequestBody
=
new
GetStaffNewRequestBody
();
getStaffNewRequestBody
.
setMobile
(
mobileNo
);
GetStaffNewResponseVO
resp
=
n22StaffService
.
getStaffNew
(
getStaffNewRequestBody
);
if
(
"查询成功"
.
equals
(
resp
.
getResponseHead
().
getMessage
())){
if
(
!
"查询成功"
.
equals
(
resp
.
getResponseHead
().
getMessage
())){
throw
new
Exception
(
"查询N22的Agent_id错误"
);
}
List
<
Staff
>
staffList
=
resp
.
getResponseBody
().
getStaff
();
...
...
@@ -146,6 +152,24 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
// 2.根据Agent_id查询N22中的保单列表
PolicyListQueryRequestBody
policyListQueryRequestBody
=
new
PolicyListQueryRequestBody
();
policyListQueryRequestBody
.
setStaffInfo
(
agent_id
);
policyListQueryRequestBody
.
setMyPolicyType
(
"2"
);
// 根据查询时间范围获取查询开始时间和结束时间
String
startTime
;
String
endTime
;
if
(
Integer
.
valueOf
(
"1"
)
==
time
)
{
startTime
=
CommonUtil
.
getBeginDayOfMonth
();
endTime
=
CommonUtil
.
getEndDayOfMonth
();
}
else
if
(
Integer
.
valueOf
(
"3"
)
==
time
)
{
startTime
=
CommonUtil
.
getStartOrEndDayOfQuarter
(
true
);
endTime
=
CommonUtil
.
getStartOrEndDayOfQuarter
(
false
);
}
else
{
startTime
=
CommonUtil
.
getBeginDayOfYear
();
endTime
=
CommonUtil
.
getEndDayOfYear
();
}
policyListQueryRequestBody
.
setStarttime
(
startTime
);
policyListQueryRequestBody
.
setEndtime
(
endTime
);
com
.
yd
.
rmi
.
n22
.
policy
.
pojo
.
policylist
.
PolicyListQueryResponseVO
policyListQueryResponseVO
=
n22PolicyService
.
policyList
(
policyListQueryRequestBody
);
if
(!
"查询成功"
.
equals
(
policyListQueryResponseVO
.
getResponseHead
().
getMessage
())){
...
...
@@ -153,6 +177,24 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
}
List
<
PolicyInfoN22
>
policyList
=
policyListQueryResponseVO
.
getResponseBody
().
getPolicyList
();
this
.
translatePolicyInfoN22
(
policyList
,
policyInfoList
);
}
private
void
translatePolicyInfoN22
(
List
<
PolicyInfoN22
>
policyList
,
List
<
PolicyInfo
>
policyInfoList
)
{
for
(
PolicyInfoN22
item:
policyList
)
{
PolicyInfo
policyInfo
=
new
PolicyInfo
();
policyInfo
.
setPlatform
(
2
);
policyInfo
.
setOrderNo
(
item
.
getAppNum
());
policyInfo
.
setHolderName
(
item
.
getInsuranceName
());
policyInfo
.
setPlanName
(
item
.
getPolNameChn
());
policyInfo
.
setProductName
(
item
.
getProductName
());
policyInfo
.
setPolicyNo
(
item
.
getPolicyNo
());
policyInfo
.
setOrderPrice
(
Double
.
valueOf
(
item
.
getPremium
()));
policyInfo
.
setOrderDate
(
item
.
getPolAppDate
());
policyInfoList
.
add
(
policyInfo
);
}
}
@Override
...
...
yd-api/src/main/java/com/yd/dal/entity/order/CustomerPolicyInfo.java
View file @
6276df5c
...
...
@@ -19,7 +19,7 @@ public class CustomerPolicyInfo implements Comparable<CustomerPolicyInfo>{
private
Double
referralAmount
;
private
Double
orderPrice
;
private
boolean
noPlanProduct
;
private
Integer
platform
;
//1、银盾在线,2、EGolden
private
Integer
platform
;
//1、银盾在线,2、
N22//
EGolden
private
Long
planId
;
private
Long
productId
;
private
Long
fortuneId
;
...
...
yd-api/src/main/java/com/yd/util/CommonUtil.java
View file @
6276df5c
...
...
@@ -20,6 +20,7 @@ import java.text.DateFormat;
import
java.text.DecimalFormat
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.time.*
;
import
java.util.*
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
...
...
@@ -1525,4 +1526,74 @@ public class CommonUtil {
return
line
;
}
/**
* 获取本月开始日期
* @return
*/
public
static
String
getBeginDayOfMonth
()
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
add
(
Calendar
.
MONTH
,
0
);
int
actualMinimum
=
calendar
.
getActualMinimum
(
Calendar
.
DAY_OF_MONTH
);
calendar
.
set
(
calendar
.
get
(
Calendar
.
YEAR
),
calendar
.
get
(
Calendar
.
MONDAY
),
actualMinimum
,
00
,
00
,
00
);
System
.
out
.
println
(
"本月开始时间------"
+
dateParseString
(
calendar
.
getTime
(),
"yyyy-MM-dd"
));
return
dateParseString
(
calendar
.
getTime
(),
"yyyy-MM-dd"
);
}
/**
* 获取本月结束日期
* @return
*/
public
static
String
getEndDayOfMonth
()
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
new
Date
());
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
calendar
.
getActualMaximum
(
Calendar
.
DAY_OF_MONTH
));
System
.
out
.
println
(
"本月结束时间------"
+
dateParseString
(
calendar
.
getTime
(),
"yyyy-MM-dd"
));
return
dateParseString
(
calendar
.
getTime
(),
"yyyy-MM-dd"
);
}
/**
* 获取当前日期所在季度的开始日期和结束日期
* 季度一年四季, 第一季度:1月-3月, 第二季度:4月-6月, 第三季度:7月-9月, 第四季度:10月-12月
* @param isFirst true表示查询本季度开始日期 false表示查询本季度结束日期
* @return
*/
public
static
String
getStartOrEndDayOfQuarter
(
Boolean
isFirst
)
{
LocalDate
today
=
LocalDate
.
now
();
LocalDate
resDate
=
LocalDate
.
now
();
if
(
today
==
null
)
{
today
=
resDate
;
}
Month
month
=
today
.
getMonth
();
Month
firstMonthOfQuarter
=
month
.
firstMonthOfQuarter
();
Month
endMonthOfQuarter
=
Month
.
of
(
firstMonthOfQuarter
.
getValue
()
+
2
);
if
(
isFirst
)
{
resDate
=
LocalDate
.
of
(
today
.
getYear
(),
firstMonthOfQuarter
,
1
);
}
else
{
resDate
=
LocalDate
.
of
(
today
.
getYear
(),
endMonthOfQuarter
,
endMonthOfQuarter
.
length
(
today
.
isLeapYear
()));
}
System
.
out
.
println
(
"本季度时间------"
+
resDate
.
toString
());
return
resDate
.
toString
();
}
//获取本年的开始时间
public
static
String
getBeginDayOfYear
()
{
Calendar
c
=
Calendar
.
getInstance
();
c
.
set
(
Calendar
.
MONTH
,
0
);
c
.
set
(
Calendar
.
DATE
,
1
);
System
.
out
.
println
(
"本年开始时间------"
+
dateParseString
(
c
.
getTime
(),
"yyyy-MM-dd"
));
return
dateParseString
(
c
.
getTime
(),
"yyyy-MM-dd"
);
}
//获取本年的结束时间
public
static
String
getEndDayOfYear
()
{
Calendar
c
=
Calendar
.
getInstance
();
c
.
set
(
Calendar
.
MONTH
,
11
);
c
.
set
(
Calendar
.
DATE
,
31
);
System
.
out
.
println
(
"本年结束时间------"
+
dateParseString
(
c
.
getTime
(),
"yyyy-MM-dd"
));
return
dateParseString
(
c
.
getTime
(),
"yyyy-MM-dd"
);
}
}
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