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
36d734f4
Commit
36d734f4
authored
May 09, 2020
by
yao.xiao
Browse files
Options
Browse Files
Download
Plain Diff
解决冲突-merge dev
parents
b3d10881
cbefadda
Show whitespace changes
Inline
Side-by-side
Showing
70 changed files
with
3418 additions
and
388 deletions
+3418
-388
yd-api/src/main/java/com/yd/api/commission/service/CommissionServiceImpl.java
+1
-1
yd-api/src/main/java/com/yd/api/customer/service/CustomerService.java
+4
-0
yd-api/src/main/java/com/yd/api/customer/service/CustomerServiceImpl.java
+80
-4
yd-api/src/main/java/com/yd/api/customer/vo/register/RegisterRequestVO.java
+40
-0
yd-api/src/main/java/com/yd/api/customer/vo/register/RegisterResponseVO.java
+24
-0
yd-api/src/main/java/com/yd/api/practitioner/PractitionerController.java
+61
-6
yd-api/src/main/java/com/yd/api/practitioner/service/PractitionerService.java
+27
-0
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerServiceImpl.java
+160
-25
yd-api/src/main/java/com/yd/api/practitioner/vo/login/PractitionerLoginBasicInfo.java
+1
-1
yd-api/src/main/java/com/yd/api/practitioner/vo/login/PractitionerLoginResponseVO.java
+12
-3
yd-api/src/main/java/com/yd/api/practitioner/vo/rank/PractitionerRankRequestVO.java
+1
-1
yd-api/src/main/java/com/yd/api/practitioner/vo/recruit/AddRecruitTrackRequestVO.java
+40
-0
yd-api/src/main/java/com/yd/api/practitioner/vo/recruit/AddRecruitTrackResponseVO.java
+33
-0
yd-api/src/main/java/com/yd/api/practitioner/vo/recruit/PractitionerPotentialInfo.java
+211
-0
yd-api/src/main/java/com/yd/api/practitioner/vo/recruit/RecruitListRequestVO.java
+22
-0
yd-api/src/main/java/com/yd/api/practitioner/vo/recruit/RecruitListResponseVO.java
+37
-0
yd-api/src/main/java/com/yd/api/practitioner/vo/recruit/RecruitRequestVO.java
+139
-0
yd-api/src/main/java/com/yd/api/practitioner/vo/recruit/RecruitResponseVO.java
+33
-0
yd-api/src/main/java/com/yd/api/practitioner/vo/recruit/RecruitTrackQueryRequestVO.java
+22
-0
yd-api/src/main/java/com/yd/api/practitioner/vo/recruit/RecruitTrackQueryResponseVO.java
+67
-0
yd-api/src/main/java/com/yd/dal/entity/customer/AclPractitioner.java
+207
-0
yd-api/src/main/java/com/yd/dal/entity/customer/AclPractitionerPotential.java
+121
-0
yd-api/src/main/java/com/yd/dal/entity/customer/AclPractitionerPotentialAssignedTrack.java
+71
-0
yd-api/src/main/java/com/yd/dal/entity/customer/AclPractitionerSubordinateSystem.java
+89
-0
yd-api/src/main/java/com/yd/dal/entity/customer/practitioner/AclPractitionerInfo.java
+1
-1
yd-api/src/main/java/com/yd/dal/entity/customer/practitioner/PractitionerBasicInfo.java
+1
-1
yd-api/src/main/java/com/yd/dal/entity/customer/practitioner/PractitionerInfo.java
+1
-1
yd-api/src/main/java/com/yd/dal/entity/customer/practitioner/PractitionerRankInfo.java
+1
-1
yd-api/src/main/java/com/yd/dal/entity/customer/practitioner/PractitionerSubordinateInfo.java
+1
-1
yd-api/src/main/java/com/yd/dal/mapper/customer/AclCustomerMapper.java
+5
-0
yd-api/src/main/java/com/yd/dal/mapper/customer/AclPractitionerMapper.java
+23
-6
yd-api/src/main/java/com/yd/dal/mapper/customer/AclPractitionerPotentialAssignedTrackMapper.java
+22
-0
yd-api/src/main/java/com/yd/dal/mapper/customer/AclPractitionerPotentialMapper.java
+23
-0
yd-api/src/main/java/com/yd/dal/mapper/customer/AclPractitionerSubordinateSystemMapper.java
+21
-0
yd-api/src/main/java/com/yd/dal/mapper/practitioner/AclPractitionerMapper.java
+0
-18
yd-api/src/main/java/com/yd/dal/mapper/practitioner/PractitionerSubordinateMapper.java
+0
-9
yd-api/src/main/java/com/yd/dal/mapper/tencent/TenInterfRecordMapper.java
+5
-0
yd-api/src/main/java/com/yd/dal/service/commission/CommissionEGoldenDAImpl.java
+1
-1
yd-api/src/main/java/com/yd/dal/service/commission/CommissionServiceDAImpl.java
+1
-1
yd-api/src/main/java/com/yd/dal/service/customer/AclCustomerDALService.java
+27
-0
yd-api/src/main/java/com/yd/dal/service/customer/AclPractitionerDALService.java
+19
-14
yd-api/src/main/java/com/yd/dal/service/customer/AclPractitionerPotentialAssignedTrackDALService.java
+12
-0
yd-api/src/main/java/com/yd/dal/service/customer/AclPractitionerPotentialDALService.java
+23
-0
yd-api/src/main/java/com/yd/dal/service/customer/AclPractitionerSubordinateSystemDALService.java
+9
-0
yd-api/src/main/java/com/yd/dal/service/customer/impl/AclCustomerDALServiceImpl.java
+27
-2
yd-api/src/main/java/com/yd/dal/service/customer/impl/AclPractitionerDALServiceImpl.java
+25
-24
yd-api/src/main/java/com/yd/dal/service/customer/impl/AclPractitionerPotentialAssignedTrackDALServiceImpl.java
+20
-0
yd-api/src/main/java/com/yd/dal/service/customer/impl/AclPractitionerPotentialDALServiceImpl.java
+24
-0
yd-api/src/main/java/com/yd/dal/service/customer/impl/AclPractitionerSubordinateSystemDALServiceImpl.java
+11
-10
yd-api/src/main/java/com/yd/dal/service/practitioner/PractitionerSubordinateDALService.java
+0
-9
yd-api/src/main/java/com/yd/dal/service/tencent/Impl/TenInterfRecordDALServiceImpl.java
+10
-0
yd-api/src/main/java/com/yd/dal/service/tencent/TenInterfRecordDALService.java
+4
-0
yd-api/src/main/java/com/yd/rmi/tencent/wechat/WechatController.java
+82
-0
yd-api/src/main/java/com/yd/rmi/tencent/wechat/service/WechatService.java
+20
-0
yd-api/src/main/java/com/yd/rmi/tencent/wechat/service/impl/WechatServiceImpl.java
+146
-0
yd-api/src/main/java/com/yd/rmi/tencent/wechat/vo/WeChatInfoByENV.java
+31
-0
yd-api/src/main/java/com/yd/rmi/tencent/wechat/vo/accesstoken/AccessTokenByCodeRequest.java
+91
-0
yd-api/src/main/java/com/yd/rmi/tencent/wechat/vo/accesstoken/AccessTokenByCodeResponse.java
+69
-0
yd-api/src/main/java/com/yd/rmi/tencent/wechatinterf/service/WechatInterfService.java
+27
-0
yd-api/src/main/java/com/yd/rmi/tencent/wechatinterf/service/impl/WechatInterfServiceImpl.java
+142
-0
yd-api/src/main/java/com/yd/util/HttpUtil.java
+36
-0
yd-api/src/main/resources/i18n/messages_zh_CN.properties
+7
-0
yd-api/src/main/resources/mapper/customer/AclCustomerMapper.xml
+7
-0
yd-api/src/main/resources/mapper/customer/AclPractitionerMapper.xml
+225
-6
yd-api/src/main/resources/mapper/customer/AclPractitionerPotentialAssignedTrackMapper.xml
+174
-0
yd-api/src/main/resources/mapper/customer/AclPractitionerPotentialMapper.xml
+275
-0
yd-api/src/main/resources/mapper/customer/AclPractitionerSubordinateSystemMapper.xml
+246
-0
yd-api/src/main/resources/mapper/practitioner/PractitionerMapper.xml
+0
-208
yd-api/src/main/resources/mapper/practitioner/PractitionerSubordinateMapper.xml
+0
-34
yd-api/src/main/resources/mapper/tencent/TenInterfRecordMapper.xml
+20
-0
No files found.
yd-api/src/main/java/com/yd/api/commission/service/CommissionServiceImpl.java
View file @
36d734f4
...
...
@@ -14,7 +14,7 @@ import com.yd.dal.entity.commission.CommissionEGolden;
import
com.yd.dal.service.commission.CommissionEGoldenDA
;
import
com.yd.dal.service.commission.CommissionServiceDA
;
@Service
(
"commissionService
Impl
"
)
@Service
(
"commissionService"
)
public
class
CommissionServiceImpl
implements
CommissionService
{
@Autowired
...
...
yd-api/src/main/java/com/yd/api/customer/service/CustomerService.java
View file @
36d734f4
...
...
@@ -7,6 +7,8 @@ import com.yd.api.customer.vo.CustomerFortuneResponseVO;
import
com.yd.api.customer.vo.CustomerQueryRequestVO
;
import
com.yd.api.customer.vo.CustomerQueryResponseVO
;
import
com.yd.api.customer.vo.CustomerVO
;
import
com.yd.api.customer.vo.register.RegisterRequestVO
;
import
com.yd.api.customer.vo.register.RegisterResponseVO
;
public
interface
CustomerService
{
...
...
@@ -15,4 +17,6 @@ public interface CustomerService {
CustomerQueryResponseVO
findByPage
(
CustomerQueryRequestVO
customerQueryRequestVO
);
CustomerFortuneResponseVO
selectByCustomerId
(
CustomerFortuneRequestVO
customer
);
RegisterResponseVO
register
(
RegisterRequestVO
register
);
}
yd-api/src/main/java/com/yd/api/customer/service/CustomerServiceImpl.java
View file @
36d734f4
package
com
.
yd
.
api
.
customer
.
service
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
com.google.common.base.Strings
;
import
com.yd.api.customer.vo.register.RegisterRequestVO
;
import
com.yd.api.customer.vo.register.RegisterResponseVO
;
import
com.yd.api.result.CommonResult
;
import
com.yd.dal.entity.customer.AclCustomer
;
import
com.yd.dal.service.customer.AclCustomerDALService
;
import
com.yd.dal.service.customer.CustomerDALService
;
import
com.yd.util.EncryptUtil
;
import
com.yd.util.config.ZHBErrorConfig
;
import
com.yd.util.deshandler.DESTypeHandler
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -16,7 +27,6 @@ import com.yd.api.customer.vo.CustomerQueryResponseVO;
import
com.yd.api.customer.vo.CustomerVO
;
import
com.yd.dal.entity.customer.Customer
;
import
com.yd.dal.entity.customer.CustomerFortune
;
import
com.yd.dal.mapper.customer.CustomerFortuneMapper
;
@Service
(
"customerServiceImpl"
)
public
class
CustomerServiceImpl
implements
CustomerService
{
...
...
@@ -25,12 +35,12 @@ public class CustomerServiceImpl implements CustomerService{
private
CustomerDALService
customerServiceDA
;
@Autowired
private
CustomerFortuneMapper
customerFortuneMapper
;
private
AclCustomerDALService
aclCustomerDALService
;
@Override
public
List
<
CustomerVO
>
listAllCustomer
()
{
List
<
CustomerVO
>
listTo
=
new
ArrayList
<
CustomerVO
>();
List
<
Customer
>
list
=
new
ArrayList
<
Customer
>()
;
List
<
CustomerVO
>
listTo
=
new
ArrayList
<>();
List
<
Customer
>
list
;
list
=
customerServiceDA
.
listAllCustomers
();
CustomerVO
oneDestVO
;
for
(
Customer
oneSrc:
list
)
...
...
@@ -74,5 +84,71 @@ public class CustomerServiceImpl implements CustomerService{
return
customerQueryResponseVO
;
}
@Override
public
RegisterResponseVO
register
(
RegisterRequestVO
requestVO
)
{
RegisterResponseVO
registerResponseVO
=
new
RegisterResponseVO
();
String
mobileNo
=
requestVO
.
getMobileNo
();
String
checkResult
=
paramCheck
(
mobileNo
);
//入参校验
if
(
Strings
.
isNullOrEmpty
(
checkResult
)){
String
accountId
=
createAccountId
(
mobileNo
);
List
<
AclCustomer
>
aclCustomerList
=
aclCustomerDALService
.
findByLogin
(
mobileNo
);
if
(
aclCustomerList
.
isEmpty
()){
DESTypeHandler
jpaCryptoConverter
=
new
DESTypeHandler
();
AclCustomer
aclCustomer
=
new
AclCustomer
();
aclCustomer
.
setRole
(
2
);
//1= Staff 2=Customer 3=Partner
aclCustomer
.
setAccountId
(
accountId
);
aclCustomer
.
setLogin
(
mobileNo
);
aclCustomer
.
setMobileNo
(
jpaCryptoConverter
.
encode
(
mobileNo
));
aclCustomer
.
setPassword
(
EncryptUtil
.
encrypt
(
requestVO
.
getPassword
(),
null
));
aclCustomer
.
setEmail
(
requestVO
.
getEmail
());
aclCustomer
.
setCusLevel
(
1
);
aclCustomer
.
setName
(
requestVO
.
getName
());
aclCustomer
.
setIsActive
(
1
);
aclCustomer
.
setRoleId
(
3L
);
aclCustomer
.
setWithdrawType
(
0
);
aclCustomer
.
setCreatedAt
(
new
Date
());
aclCustomer
.
setCreatedBy
(-
1L
);
aclCustomer
.
setUpdatedAt
(
new
Date
());
aclCustomer
.
setUpdatedBy
(-
1L
);
aclCustomer
.
setChannelReferralRateId
(
3L
);
aclCustomerDALService
.
save
(
aclCustomer
);
//202003对新注册的客户还需保存至ag_mkt_leads_pool
// saveLeadsPool(aclCustomer);
registerResponseVO
.
setCustomerId
(
aclCustomer
.
getId
());
registerResponseVO
.
setCommonResult
(
new
CommonResult
(
true
,
ZHBErrorConfig
.
getErrorInfo
(
"800000"
)));
}
else
{
String
[]
params
=
{
mobileNo
};
registerResponseVO
.
setCommonResult
(
new
CommonResult
(
false
,
ZHBErrorConfig
.
getErrorInfo
(
"630002"
,
params
)));
registerResponseVO
.
setCustomerId
(
aclCustomerList
.
get
(
0
).
getId
());
}
}
else
{
registerResponseVO
.
setCommonResult
(
new
CommonResult
(
false
,
checkResult
));
}
return
registerResponseVO
;
}
private
String
createAccountId
(
String
mobileNo
)
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyyMMddHHmmss"
);
String
sub
=
null
;
if
(
mobileNo
!=
null
&&
!
""
.
equals
(
mobileNo
)){
sub
=
mobileNo
.
substring
(
mobileNo
.
length
()-
6
);
}
return
"C_"
+
sub
+
"_"
+
sdf
.
format
(
new
Date
());
}
private
String
paramCheck
(
String
mobileNo
)
{
if
(
Strings
.
isNullOrEmpty
(
mobileNo
)){
String
[]
params
={
"mobileNo"
};
return
ZHBErrorConfig
.
getErrorInfo
(
"610002"
,
params
);
}
else
{
if
(
mobileNo
.
length
()
!=
11
||
!
mobileNo
.
startsWith
(
"1"
)){
String
[]
params
=
{
mobileNo
};
return
ZHBErrorConfig
.
getErrorInfo
(
"630001"
,
params
);
}
}
return
null
;
}
}
yd-api/src/main/java/com/yd/api/customer/vo/register/RegisterRequestVO.java
0 → 100644
View file @
36d734f4
package
com
.
yd
.
api
.
customer
.
vo
.
register
;
public
class
RegisterRequestVO
{
private
String
name
;
private
String
mobileNo
;
private
String
email
;
private
String
password
;
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getMobileNo
()
{
return
mobileNo
;
}
public
void
setMobileNo
(
String
mobileNo
)
{
this
.
mobileNo
=
mobileNo
;
}
public
String
getEmail
()
{
return
email
;
}
public
void
setEmail
(
String
email
)
{
this
.
email
=
email
;
}
public
String
getPassword
()
{
return
password
;
}
public
void
setPassword
(
String
password
)
{
this
.
password
=
password
;
}
}
yd-api/src/main/java/com/yd/api/customer/vo/register/RegisterResponseVO.java
0 → 100644
View file @
36d734f4
package
com
.
yd
.
api
.
customer
.
vo
.
register
;
import
com.yd.api.result.CommonResult
;
public
class
RegisterResponseVO
{
private
Long
customerId
;
private
CommonResult
commonResult
;
public
Long
getCustomerId
()
{
return
customerId
;
}
public
void
setCustomerId
(
Long
customerId
)
{
this
.
customerId
=
customerId
;
}
public
CommonResult
getCommonResult
()
{
return
commonResult
;
}
public
void
setCommonResult
(
CommonResult
commonResult
)
{
this
.
commonResult
=
commonResult
;
}
}
yd-api/src/main/java/com/yd/api/practitioner/PractitionerController.java
View file @
36d734f4
...
...
@@ -11,6 +11,7 @@ import com.yd.api.practitioner.vo.opportunity.OwnOpportunityQueryRequestVO;
import
com.yd.api.practitioner.vo.opportunity.OwnOpportunityQueryResponseVO
;
import
com.yd.api.practitioner.vo.rank.PractitionerRankRequestVO
;
import
com.yd.api.practitioner.vo.rank.PractitionerRankResponseVO
;
import
com.yd.api.practitioner.vo.recruit.*
;
import
com.yd.api.practitioner.vo.setting.*
;
import
com.yd.api.result.JsonResult
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -29,8 +30,8 @@ public class PractitionerController {
/**
* 经纪人登录
* @param requestVO
* @return
* @param requestVO
请求数据
* @return
响应数据
*/
@RequestMapping
(
"/login"
)
public
Object
practitionerLogin
(
@RequestBody
PractitionerLoginRequestVO
requestVO
){
...
...
@@ -43,7 +44,7 @@ public class PractitionerController {
/**
* 经纪人(排行榜) + (保费+佣金+件数)查询
* @param requestVO
* @param requestVO
请求数据
* @return Object
*/
@RequestMapping
(
"/rank"
)
...
...
@@ -57,7 +58,7 @@ public class PractitionerController {
/**
* 查询经纪人的个人设置
* @param requestVO
* @param requestVO
请求数据
* @return responseVO
*/
@RequestMapping
(
"/settingQuery"
)
...
...
@@ -71,7 +72,7 @@ public class PractitionerController {
/**
* 保存经纪人的个人设置
* @param requestVO
* @param requestVO
请求数据
* @return responseVO
*/
@RequestMapping
(
"/settingSave"
)
...
...
@@ -96,7 +97,7 @@ public class PractitionerController {
}
@RequestMapping
(
"/mediaGet"
)
public
Object
mediaGet
(
@RequestBody
MediaGetReqVO
requestVO
)
throws
Exception
{
public
Object
mediaGet
(
@RequestBody
MediaGetReqVO
requestVO
){
JsonResult
result
=
new
JsonResult
();
MediaGetRespVO
responseVO
=
practitionerService
.
mediaGet
(
requestVO
);
result
.
addResult
(
responseVO
);
...
...
@@ -117,6 +118,19 @@ public class PractitionerController {
result
.
setData
(
responseVO
);
return
result
;
}
/**
* 团队长--新增增员
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping
(
"/recruit"
)
public
Object
recruit
(
@RequestBody
RecruitRequestVO
requestVO
){
JsonResult
result
=
new
JsonResult
();
RecruitResponseVO
responseVO
=
practitionerService
.
recruit
(
requestVO
);
result
.
addResult
(
responseVO
);
result
.
setData
(
responseVO
);
return
result
;
}
/***
* 经纪人查询自己的商机详情查询
...
...
@@ -131,4 +145,45 @@ public class PractitionerController {
result
.
setData
(
responseVO
);
return
result
;
}
/**
* 团队长--新增增员记录
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping
(
"/addRecruitTrack"
)
public
Object
addRecruitTrack
(
@RequestBody
AddRecruitTrackRequestVO
requestVO
){
JsonResult
result
=
new
JsonResult
();
AddRecruitTrackResponseVO
responseVO
=
practitionerService
.
addRecruitTrack
(
requestVO
);
result
.
addResult
(
responseVO
);
result
.
setData
(
responseVO
);
return
result
;
}
/**
* 团队长--增员记录查询
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping
(
"/recruitTrackQuery"
)
public
Object
recruitTrackQuery
(
@RequestBody
RecruitTrackQueryRequestVO
requestVO
){
JsonResult
result
=
new
JsonResult
();
RecruitTrackQueryResponseVO
responseVO
=
practitionerService
.
recruitTrackQuery
(
requestVO
);
result
.
addResult
(
responseVO
);
result
.
setData
(
responseVO
);
return
result
;
}
/**
* 团队长--增员列表查询
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping
(
"/recruitListQuery"
)
public
Object
recruitListQuery
(
@RequestBody
RecruitListRequestVO
requestVO
){
JsonResult
result
=
new
JsonResult
();
RecruitListResponseVO
responseVO
=
practitionerService
.
recruitListQuery
(
requestVO
);
result
.
addResult
(
responseVO
);
result
.
setData
(
responseVO
);
return
result
;
}
}
yd-api/src/main/java/com/yd/api/practitioner/service/PractitionerService.java
View file @
36d734f4
...
...
@@ -10,6 +10,7 @@ import com.yd.api.practitioner.vo.opportunity.OwnOpportunityQueryRequestVO;
import
com.yd.api.practitioner.vo.opportunity.OwnOpportunityQueryResponseVO
;
import
com.yd.api.practitioner.vo.rank.PractitionerRankRequestVO
;
import
com.yd.api.practitioner.vo.rank.PractitionerRankResponseVO
;
import
com.yd.api.practitioner.vo.recruit.*
;
import
com.yd.api.practitioner.vo.setting.*
;
import
org.springframework.stereotype.Service
;
...
...
@@ -71,4 +72,30 @@ public interface PractitionerService {
* @return
*/
OwnOpportunityDetailQueryResponseVO
ownOpportunityDetailQuery
(
OwnOpportunityDetailQueryRequestVO
requestVO
);
/**
* 团队长--增员
* @param requestVO 请求信息
* @return responseVO
*/
RecruitResponseVO
recruit
(
RecruitRequestVO
requestVO
);
/**
* 团队长--新增增员记录
* @param requestVO 请求信息
* @return responseVO
*/
AddRecruitTrackResponseVO
addRecruitTrack
(
AddRecruitTrackRequestVO
requestVO
);
/**
* 团队长--增员记录查询
* @param requestVO 请求信息
* @return responseVO
*/
RecruitTrackQueryResponseVO
recruitTrackQuery
(
RecruitTrackQueryRequestVO
requestVO
);
/**
* 团队长--增员列表查询
* @param requestVO 请求信息
* @return responseVO
*/
RecruitListResponseVO
recruitListQuery
(
RecruitListRequestVO
requestVO
);
}
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerServiceImpl.java
View file @
36d734f4
package
com
.
yd
.
api
.
practitioner
.
service
.
impl
;
import
com.github.pagehelper.PageHelper
;
import
com.yd.api.customer.service.CustomerService
;
import
com.yd.api.customer.vo.register.RegisterRequestVO
;
import
com.yd.api.customer.vo.register.RegisterResponseVO
;
import
com.yd.api.practitioner.vo.login.PractitionerLoginBasicInfo
;
import
com.yd.api.practitioner.vo.login.PractitionerLoginRequestVO
;
import
com.yd.api.practitioner.vo.login.PractitionerLoginResponseVO
;
import
com.yd.api.practitioner.vo.media.MediaGetReqVO
;
...
...
@@ -10,6 +14,7 @@ import com.yd.api.practitioner.vo.rank.AclCustomerFortuneStatistics;
import
com.yd.api.practitioner.vo.rank.PractitionerRankRequestVO
;
import
com.yd.api.practitioner.vo.rank.PractitionerRankResponseVO
;
import
com.yd.api.practitioner.vo.rank.PractitionerInfoForAchievement
;
import
com.yd.api.practitioner.vo.recruit.*
;
import
com.yd.api.practitioner.vo.setting.*
;
import
com.yd.api.result.CommonResult
;
import
com.yd.dal.entity.customer.*
;
...
...
@@ -30,11 +35,13 @@ import com.yd.dal.service.meta.MdMkCampaignDALService;
import
com.yd.dal.service.meta.MdTagDALService
;
import
com.yd.dal.service.meta.ObjectCollectionTaggedDALService
;
import
com.yd.dal.service.order.PoOrderDALService
;
import
com.yd.dal.service.practitioner.PractitionerDALService
;
import
com.yd.dal.service.practitioner.PractitionerSubordinateDALService
;
import
com.yd.dal.service.survey.SurveyCustomerAnswersDALService
;
import
com.yd.dal.entity.customer.practitioner.*
;
import
com.yd.dal.service.customer.*
;
import
com.yd.dal.service.meta.MdCodeDALService
;
import
com.yd.rmi.ali.oss.service.OssService
;
import
com.yd.rmi.tencent.wechat.service.WechatService
;
import
com.yd.rmi.tencent.wechat.vo.WeChatInfoByENV
;
import
com.yd.rmi.tencent.wechatinterf.pojo.ticket.TicketRequest
;
import
com.yd.rmi.tencent.wechatinterf.pojo.token.TokenRequest
;
import
com.yd.util.CommonUtil
;
...
...
@@ -51,10 +58,8 @@ import org.springframework.transaction.annotation.Transactional;
import
javax.imageio.ImageIO
;
import
java.awt.*
;
import
java.awt.image.BufferedImage
;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.*
;
import
java.net.URLEncoder
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.List
;
...
...
@@ -63,13 +68,13 @@ import java.util.List;
public
class
PractitionerServiceImpl
implements
com
.
yd
.
api
.
practitioner
.
service
.
PractitionerService
{
@Autowired
private
PractitionerDALService
p
ractitionerDALService
;
private
AclPractitionerDALService
aclP
ractitionerDALService
;
@Autowired
private
MdCodeDALService
mdCodeDALService
;
@Autowired
private
AclFileUploadDALService
aclFileUploadDALService
;
@Autowired
private
PractitionerSubordinateDALService
practitionerSubordinate
DALService
;
private
AclPractitionerSubordinateSystemDALService
aclPractitionerSubordinateSystem
DALService
;
@Autowired
private
AclCustomerLogDALService
aclCustomerLogDALService
;
@Autowired
...
...
@@ -96,6 +101,14 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
private
AclCustomerMembershipDALService
aclCustomerMembershipDALService
;
@Autowired
private
SurveyCustomerAnswersDALService
surveyCustomerAnswersDALService
;
@Autowired
private
CustomerService
customerService
;
@Autowired
private
AclPractitionerPotentialDALService
aclPractitionerPotentialDALService
;
@Autowired
private
AclPractitionerPotentialAssignedTrackDALService
aclPractitionerPotentialAssignedTrackDALService
;
@Override
public
PractitionerLoginResponseVO
practitionerLogin
(
PractitionerLoginRequestVO
requestVO
)
{
PractitionerLoginResponseVO
responseVO
=
new
PractitionerLoginResponseVO
();
...
...
@@ -107,7 +120,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
return
responseVO
;
}
//2、检查是否在ag_acl_customer表中存在该用户,如果不存在就注册,然后直接抛错,该用户未注册为经纪人
PractitionerInfo
practitionerInfo
=
p
ractitionerDALService
.
findPractitionerInfoByLogin
(
mobileNo
);
PractitionerInfo
practitionerInfo
=
aclP
ractitionerDALService
.
findPractitionerInfoByLogin
(
mobileNo
);
if
(
practitionerInfo
!=
null
){
Long
practitionerType
=
practitionerInfo
.
getPractitionerType
();
//处理特殊人员
...
...
@@ -120,7 +133,8 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
if
(
28L
==
practitionerType
||
isSpecial
){
//只有寿险的经纪人和注册为经纪人的员工才能登录
Long
practitionerId
=
practitionerInfo
.
getPractitionerId
();
Long
customerId
=
practitionerInfo
.
getCustomerId
();
com
.
yd
.
api
.
practitioner
.
vo
.
login
.
PractitionerBasicInfo
basicInfo
=
new
com
.
yd
.
api
.
practitioner
.
vo
.
login
.
PractitionerBasicInfo
();
AclCustomer
customer
=
aclCustomerDALService
.
findById
(
customerId
);
PractitionerLoginBasicInfo
basicInfo
=
new
PractitionerLoginBasicInfo
();
BeanUtils
.
copyProperties
(
practitionerInfo
,
basicInfo
);
//获取头像
Integer
targetType
=
1
,
targetUseFor
=
1
;
...
...
@@ -130,7 +144,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
//获取体系信息
Long
subordinateId
=
practitionerInfo
.
getSubordinateId
();
if
(
subordinateId
!=
null
){
PractitionerSubordinateInfo
subordinateInfo
=
practitionerSubordinate
DALService
.
findSubordinateInfo
(
subordinateId
);
PractitionerSubordinateInfo
subordinateInfo
=
aclPractitionerSubordinateSystem
DALService
.
findSubordinateInfo
(
subordinateId
);
if
(
subordinateInfo
!=
null
){
basicInfo
.
setSubordinateName
(
subordinateInfo
.
getSubordinateName
());
basicInfo
.
setSubordinateLeader
(
subordinateInfo
.
getSubordinateLeader
());
...
...
@@ -141,6 +155,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
int
logTimes
=
(
customerLogList
.
isEmpty
())
?
0
:
customerLogList
.
size
();
//保存用户的登录记录
aclCustomerLogDALService
.
saveCustomerLog
(
customerId
,
2
);
getOpenIdUrl
(
responseVO
,
customer
);
responseVO
.
setCustomerId
(
customerId
);
responseVO
.
setPractitionerId
(
practitionerId
);
responseVO
.
setPractitionerBasicInfo
(
basicInfo
);
...
...
@@ -153,6 +168,30 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
return
responseVO
;
}
private
void
getOpenIdUrl
(
PractitionerLoginResponseVO
responseVO
,
AclCustomer
customer
)
{
String
openId
=
customer
.
getYdWechatOpenid
();
if
(
Strings
.
isNullOrEmpty
(
openId
))
{
WeChatInfoByENV
weChatInfo
=
wechatService
.
getWeChatInfoByENV
(
"YDBJ"
,
false
);
String
appId
=
weChatInfo
.
getAppId
(),
secret
=
weChatInfo
.
getSecret
();
if
(!
Strings
.
isNullOrEmpty
(
appId
)
&&
!
Strings
.
isNullOrEmpty
(
secret
))
{
try
{
String
info
=
appId
+
","
+
customer
.
getId
();
String
redirectUri
=
mdCodeDALService
.
findCodeByType
(
"FilePathPrefix"
)+
"ydapi/getOpenId?info="
+
info
;
redirectUri
=
URLEncoder
.
encode
(
redirectUri
,
"UTF-8"
);
String
url
=
"https://open.weixin.qq.com/connect/oauth2/authorize?"
+
"appid="
+
appId
+
"&redirect_uri="
+
redirectUri
+
"&response_type=code&scope=snsapi_base&state=123#wechat_redirect"
;
System
.
out
.
println
(
">>>>>url>>>>>>>:"
+
url
);
responseVO
.
setGetOpenIdUrl
(
url
);
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
}
}
}
}
@Override
public
PractitionerRankResponseVO
practitionerRank
(
PractitionerRankRequestVO
requestVO
)
{
PractitionerRankResponseVO
responseVO
=
new
PractitionerRankResponseVO
();
...
...
@@ -188,16 +227,16 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
List
<
PractitionerRankInfo
>
rankInfoList
;
if
(
platform
==
1
){
Long
practitionerTypeId
=
28L
;
rankInfoList
=
p
ractitionerDALService
.
getPractitionerRankInfoForOnline
(
time
,
practitionerTypeId
);
rankInfoList
=
aclP
ractitionerDALService
.
getPractitionerRankInfoForOnline
(
time
,
practitionerTypeId
);
//特殊人员处理
String
mobileSpecialStr
=
mdCodeDALService
.
findCodeByType
(
"special_practitioner_mobile"
);
if
(!
Strings
.
isNullOrEmpty
(
mobileSpecialStr
)){
List
<
String
>
mobileSpecials
=
Arrays
.
asList
(
mobileSpecialStr
.
split
(
","
));
List
<
PractitionerRankInfo
>
rankInfoListSpecials
=
p
ractitionerDALService
.
getPractitionerRankInfoForSpecials
(
mobileSpecials
,
time
);
List
<
PractitionerRankInfo
>
rankInfoListSpecials
=
aclP
ractitionerDALService
.
getPractitionerRankInfoForSpecials
(
mobileSpecials
,
time
);
rankInfoList
.
addAll
(
rankInfoListSpecials
);
}
}
else
{
rankInfoList
=
p
ractitionerDALService
.
getPractitionerRankInfoForOffline
(
time
);
rankInfoList
=
aclP
ractitionerDALService
.
getPractitionerRankInfoForOffline
(
time
);
}
return
rankInfoList
;
}
...
...
@@ -205,7 +244,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
private
PractitionerBasicInfo
getPractitionerBasicInfo
(
String
mobileNo
,
Integer
platform
)
{
PractitionerBasicInfo
practitionerBasicInfo
;
if
(
platform
==
1
){
practitionerBasicInfo
=
p
ractitionerDALService
.
getPractitionerBasicInfoForOnline
(
mobileNo
);
practitionerBasicInfo
=
aclP
ractitionerDALService
.
getPractitionerBasicInfoForOnline
(
mobileNo
);
if
(
practitionerBasicInfo
!=
null
){
Long
practitionerId
=
practitionerBasicInfo
.
getPractitionerIdForOnline
();
if
(
practitionerId
!=
null
){
...
...
@@ -213,7 +252,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
}
}
}
else
{
practitionerBasicInfo
=
p
ractitionerDALService
.
getPractitionerBasicInfoForOffline
(
mobileNo
);
practitionerBasicInfo
=
aclP
ractitionerDALService
.
getPractitionerBasicInfoForOffline
(
mobileNo
);
}
return
practitionerBasicInfo
;
}
...
...
@@ -268,7 +307,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
Long
practitionerId
=
requestVO
.
getPractitionerId
();
//入参经纪人id
//需要查询的信息 1.自我介绍 2.我的设置 3.头像 4.个人微信二位码 5.生活照
//1.2均在ag_acl_practitioner表中查询
AclPractitioner
Info
practitioner
=
p
ractitionerDALService
.
findPractitionerById
(
practitionerId
);
AclPractitioner
practitioner
=
aclP
ractitionerDALService
.
findPractitionerById
(
practitionerId
);
String
bioIntro
=
practitioner
.
getBioIntro
();
//经纪人个人介绍
Integer
isMobileShow
=
practitioner
.
getIsMobileShow
();
Integer
isNameShow
=
practitioner
.
getIsNameShow
();
...
...
@@ -430,7 +469,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
OwnOpportunityQueryResponseVO
responseVO
=
new
OwnOpportunityQueryResponseVO
();
Long
practitionerId
=
requestVO
.
getPractitionerId
();
//经纪人查询通过自己分享成为自己商机的客户
AclPractitioner
Info
practitioner
=
p
ractitionerDALService
.
findPractitionerById
(
practitionerId
);
AclPractitioner
practitioner
=
aclP
ractitionerDALService
.
findPractitionerById
(
practitionerId
);
Long
customerId
=
practitioner
.
getCustomerId
();
//查询自己的分享码,仅银盾服务产品
List
<
AclCustomerShare
>
aclCustomerShareList
=
aclCustomerShareDALService
.
findByCustomerIdAndInsurerId
(
customerId
,
888L
);
...
...
@@ -451,7 +490,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
opportunityDateMap
.
put
(
poOrder
.
getCustomerId
(),
poOrder
.
getId
());
}
}
List
<
OwnOpportunityInfo
>
ownOpportunityInfos
=
p
ractitionerDALService
.
ownOpportunityQuery
(
practitionerId
);
List
<
OwnOpportunityInfo
>
ownOpportunityInfos
=
aclP
ractitionerDALService
.
ownOpportunityQuery
(
practitionerId
);
for
(
OwnOpportunityInfo
info
:
ownOpportunityInfos
){
info
.
setOrderId
(
opportunityDateMap
.
get
(
info
.
getOpportunityId
()));
}
...
...
@@ -615,16 +654,112 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
mktLeadsAssignedTrack
.
setCustomerId
(
customerId
);
PageHelper
.
orderBy
(
"created_at DESC , updated_at DESC"
);
List
<
MktLeadsAssignedTrack
>
mktLeadsAssignedTracks
=
mktLeadsAssignedTrackDALService
.
findByMktLeadsAssignedTrack
(
mktLeadsAssignedTrack
);
for
(
MktLeadsAssignedTrack
track:
mktLeadsAssignedTracks
)
{
for
(
MktLeadsAssignedTrack
track
:
mktLeadsAssignedTracks
)
{
OpportunityRecordInfo
info
=
new
OpportunityRecordInfo
();
CommonUtil
.
simpleObjectCopy
(
track
,
info
);
CommonUtil
.
simpleObjectCopy
(
track
,
info
);
info
.
setOpportunityId
(
track
.
getCustomerId
());
info
.
setNoticeDate
(
CommonUtil
.
dateParseString
(
track
.
getCreatedAt
(),
"yyyy-MM-dd"
));
info
.
setNoticeDate
(
CommonUtil
.
dateParseString
(
track
.
getCreatedAt
(),
"yyyy-MM-dd"
));
infos
.
add
(
info
);
}
return
infos
;
}
public
RecruitResponseVO
recruit
(
RecruitRequestVO
requestVO
)
{
RecruitResponseVO
responseVO
=
new
RecruitResponseVO
();
String
name
=
requestVO
.
getName
();
String
mobileNo
=
requestVO
.
getMobileNo
();
Long
practitionerId
=
requestVO
.
getPractitionerId
();
if
(!
Strings
.
isNullOrEmpty
(
name
)
&&
!
Strings
.
isNullOrEmpty
(
mobileNo
)
&&
practitionerId
!=
null
){
if
(
mobileNo
.
length
()
!=
11
||
mobileNo
.
startsWith
(
"1"
)){
RegisterRequestVO
register
=
new
RegisterRequestVO
();
register
.
setMobileNo
(
mobileNo
);
register
.
setName
(
name
);
//将增员对象进行注册
RegisterResponseVO
registerResp
=
customerService
.
register
(
register
);
Long
customerId
=
registerResp
.
getCustomerId
();
//判断是否已经为银盾经纪人
AclPractitioner
practitioner
=
aclPractitionerDALService
.
findByCustomerIdIsActive
(
customerId
,
1
);
if
(
practitioner
==
null
){
//判断该增员是否已存在
Long
potentialId
=
requestVO
.
getPotentialId
();
List
<
AclPractitionerPotential
>
practitionerPotentialList
=
aclPractitionerPotentialDALService
.
findByMobileNo
(
mobileNo
,
1
);
if
(
potentialId
!=
null
||
practitionerPotentialList
.
isEmpty
()){
AclPractitionerPotential
practitionerPotential
=
new
AclPractitionerPotential
();
BeanUtils
.
copyProperties
(
requestVO
,
practitionerPotential
);
practitionerPotential
.
setCustomerId
(
customerId
);
practitionerPotential
.
setPractitionerAssignedIds
(
practitionerId
.
toString
());
practitionerPotential
.
setCreatedAt
(
new
Date
());
practitionerPotential
.
setCreatedBy
(
practitionerId
);
practitionerPotential
.
setCreatorType
(
2
);
practitionerPotential
.
setIsActive
(
1
);
if
(
potentialId
!=
null
){
practitionerPotential
.
setId
(
potentialId
);
}
aclPractitionerPotentialDALService
.
save
(
practitionerPotential
);
potentialId
=
practitionerPotential
.
getId
();
//如果已经分配团队长,则在追踪表中增加记录
List
<
Long
>
practitionerPotentialIdList
=
new
ArrayList
<>();
practitionerPotentialIdList
.
add
(
potentialId
);
addPractitionerPotentialTrack
(
practitionerPotentialIdList
,
practitionerId
);
responseVO
.
setPotentialCustomerId
(
customerId
);
responseVO
.
setPotentialId
(
potentialId
);
responseVO
.
setCommonResult
(
new
CommonResult
(
true
,
ZHBErrorConfig
.
getErrorInfo
(
"800000"
)));
}
else
{
responseVO
.
setPotentialCustomerId
(
customerId
);
responseVO
.
setPotentialId
(
practitionerPotentialList
.
get
(
0
).
getId
());
responseVO
.
setCommonResult
(
new
CommonResult
(
false
,
ZHBErrorConfig
.
getErrorInfo
(
"830011"
)));
}
}
else
{
responseVO
.
setCommonResult
(
new
CommonResult
(
false
,
ZHBErrorConfig
.
getErrorInfo
(
"830010"
)));
}
}
else
{
String
[]
paras
=
{
mobileNo
};
responseVO
.
setCommonResult
(
new
CommonResult
(
false
,
ZHBErrorConfig
.
getErrorInfo
(
"630001"
,
paras
)));
}
}
else
{
String
[]
paras
=
{
"name,mobileNo,practitionerId"
};
responseVO
.
setCommonResult
(
new
CommonResult
(
false
,
ZHBErrorConfig
.
getErrorInfo
(
"610002"
,
paras
)));
}
return
responseVO
;
}
private
void
addPractitionerPotentialTrack
(
List
<
Long
>
practitionerPotentialIdList
,
Long
practitionerId
)
{
if
(
practitionerId
!=
null
&&
!
practitionerPotentialIdList
.
isEmpty
())
{
List
<
AclPractitionerPotentialAssignedTrack
>
potentialAssignedTrackList
=
new
ArrayList
<>();
AclPractitionerPotentialAssignedTrack
potentialAssignedTrack
;
for
(
Long
potentialId
:
practitionerPotentialIdList
)
{
potentialAssignedTrack
=
new
AclPractitionerPotentialAssignedTrack
();
potentialAssignedTrack
.
setPractitionerPotentialId
(
potentialId
);
potentialAssignedTrack
.
setPractitionerAssignedId
(
practitionerId
);
potentialAssignedTrack
.
setTrackStatusId
(
112L
);
//待跟进
potentialAssignedTrack
.
setIsActive
(
1
);
potentialAssignedTrack
.
setIsLasted
(
1
);
potentialAssignedTrack
.
setCreatedAt
(
new
Date
());
potentialAssignedTrack
.
setCreatedBy
(
practitionerId
);
potentialAssignedTrack
.
setCreatorType
(
2
);
potentialAssignedTrackList
.
add
(
potentialAssignedTrack
);
}
aclPractitionerPotentialAssignedTrackDALService
.
saveAll
(
potentialAssignedTrackList
);
}
}
@Override
public
AddRecruitTrackResponseVO
addRecruitTrack
(
AddRecruitTrackRequestVO
requestVO
)
{
return
null
;
}
@Override
public
RecruitTrackQueryResponseVO
recruitTrackQuery
(
RecruitTrackQueryRequestVO
requestVO
)
{
return
null
;
}
@Override
public
RecruitListResponseVO
recruitListQuery
(
RecruitListRequestVO
requestVO
)
{
return
null
;
}
private
CommonResult
paramCheck
(
SettingSaveRequestVO
requestVO
)
{
//检查入参判断
Long
practitionerId
=
requestVO
.
getPractitionerId
();
...
...
@@ -658,14 +793,14 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
String
settingSave
=
requestVO
.
getSettingSave
();
if
(
settingSave
.
equalsIgnoreCase
(
"isShow"
)||
settingSave
.
equalsIgnoreCase
(
"intro"
)){
Long
practitionerId
=
requestVO
.
getPractitionerId
();
AclPractitioner
Info
practitioner
=
p
ractitionerDALService
.
findPractitionerById
(
practitionerId
);
AclPractitioner
practitioner
=
aclP
ractitionerDALService
.
findPractitionerById
(
practitionerId
);
if
(
settingSave
.
equalsIgnoreCase
(
"intro"
)){
practitioner
.
setBioIntro
(
requestVO
.
getBioIntro
());
}
else
if
(
settingSave
.
equalsIgnoreCase
(
"isShow"
)){
practitioner
.
setIsNameShow
(
requestVO
.
getIsNameShow
());
practitioner
.
setIsMobileShow
(
requestVO
.
getIsMobileShow
());
}
p
ractitionerDALService
.
updatePractitioner
(
practitioner
);
aclP
ractitionerDALService
.
updatePractitioner
(
practitioner
);
}
}
...
...
@@ -748,7 +883,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
updateImgOld
(
practitionerId
,
targetUseFor
);
}
//保存到数据库
AclPractitioner
Info
practitioner
=
p
ractitionerDALService
.
findPractitionerById
(
practitionerId
);
AclPractitioner
practitioner
=
aclP
ractitionerDALService
.
findPractitionerById
(
practitionerId
);
AclFileUpload
aclFileUpload
=
new
AclFileUpload
();
aclFileUpload
.
setTargetType
(
1
);
aclFileUpload
.
setTargetId
(
practitioner
.
getId
());
...
...
yd-api/src/main/java/com/yd/api/practitioner/vo/login/PractitionerBasicInfo.java
→
yd-api/src/main/java/com/yd/api/practitioner/vo/login/Practitioner
Login
BasicInfo.java
View file @
36d734f4
package
com
.
yd
.
api
.
practitioner
.
vo
.
login
;
public
class
PractitionerBasicInfo
{
public
class
Practitioner
Login
BasicInfo
{
private
String
name
;
//姓名
private
String
headImagePath
;
//头像
private
String
levelCode
;
//级别code
...
...
yd-api/src/main/java/com/yd/api/practitioner/vo/login/PractitionerLoginResponseVO.java
View file @
36d734f4
...
...
@@ -7,7 +7,8 @@ public class PractitionerLoginResponseVO {
private
Long
customerId
;
private
Long
practitionerId
;
private
Integer
loginTimes
;
private
PractitionerBasicInfo
practitionerBasicInfo
;
private
String
getOpenIdUrl
;
private
PractitionerLoginBasicInfo
practitionerBasicInfo
;
private
CommonResult
commonResult
;
public
Long
getCustomerId
()
{
...
...
@@ -34,14 +35,22 @@ public class PractitionerLoginResponseVO {
this
.
loginTimes
=
loginTimes
;
}
public
PractitionerBasicInfo
getPractitionerBasicInfo
()
{
public
Practitioner
Login
BasicInfo
getPractitionerBasicInfo
()
{
return
practitionerBasicInfo
;
}
public
void
setPractitionerBasicInfo
(
PractitionerBasicInfo
practitionerBasicInfo
)
{
public
void
setPractitionerBasicInfo
(
Practitioner
Login
BasicInfo
practitionerBasicInfo
)
{
this
.
practitionerBasicInfo
=
practitionerBasicInfo
;
}
public
String
getGetOpenIdUrl
()
{
return
getOpenIdUrl
;
}
public
void
setGetOpenIdUrl
(
String
getOpenIdUrl
)
{
this
.
getOpenIdUrl
=
getOpenIdUrl
;
}
public
CommonResult
getCommonResult
()
{
return
commonResult
;
}
...
...
yd-api/src/main/java/com/yd/api/practitioner/vo/rank/PractitionerRankRequestVO.java
View file @
36d734f4
...
...
@@ -3,7 +3,7 @@ package com.yd.api.practitioner.vo.rank;
public
class
PractitionerRankRequestVO
{
private
String
mobileNo
;
private
Integer
platform
;
//1-online,2-offline
private
Integer
time
;
//1-month,2-year
private
Integer
time
;
//1-month,2-year
,3-quarter
private
Integer
type
;
//1-保费,2-佣金,3-件数
public
String
getMobileNo
()
{
...
...
yd-api/src/main/java/com/yd/api/practitioner/vo/recruit/AddRecruitTrackRequestVO.java
0 → 100644
View file @
36d734f4
package
com
.
yd
.
api
.
practitioner
.
vo
.
recruit
;
public
class
AddRecruitTrackRequestVO
{
private
Long
trackId
;
private
Long
trackStatusId
;
private
String
notice
;
private
Integer
isActive
;
public
Long
getTrackId
()
{
return
trackId
;
}
public
void
setTrackId
(
Long
trackId
)
{
this
.
trackId
=
trackId
;
}
public
Long
getTrackStatusId
()
{
return
trackStatusId
;
}
public
void
setTrackStatusId
(
Long
trackStatusId
)
{
this
.
trackStatusId
=
trackStatusId
;
}
public
String
getNotice
()
{
return
notice
;
}
public
void
setNotice
(
String
notice
)
{
this
.
notice
=
notice
;
}
public
Integer
getIsActive
()
{
return
isActive
;
}
public
void
setIsActive
(
Integer
isActive
)
{
this
.
isActive
=
isActive
;
}
}
yd-api/src/main/java/com/yd/api/practitioner/vo/recruit/AddRecruitTrackResponseVO.java
0 → 100644
View file @
36d734f4
package
com
.
yd
.
api
.
practitioner
.
vo
.
recruit
;
import
com.yd.api.result.CommonResult
;
public
class
AddRecruitTrackResponseVO
{
private
Long
trackId
;
private
Integer
isActive
;
private
CommonResult
commonResult
;
public
Long
getTrackId
()
{
return
trackId
;
}
public
void
setTrackId
(
Long
trackId
)
{
this
.
trackId
=
trackId
;
}
public
Integer
getIsActive
()
{
return
isActive
;
}
public
void
setIsActive
(
Integer
isActive
)
{
this
.
isActive
=
isActive
;
}
public
CommonResult
getCommonResult
()
{
return
commonResult
;
}
public
void
setCommonResult
(
CommonResult
commonResult
)
{
this
.
commonResult
=
commonResult
;
}
}
yd-api/src/main/java/com/yd/api/practitioner/vo/recruit/PractitionerPotentialInfo.java
0 → 100644
View file @
36d734f4
package
com
.
yd
.
api
.
practitioner
.
vo
.
recruit
;
public
class
PractitionerPotentialInfo
{
private
Long
potentialId
;
private
String
name
;
private
Integer
gender
;
private
Long
age
;
private
String
mobileNo
;
private
String
wechatId
;
private
String
qqId
;
private
String
othersContacts
;
private
String
educationLevel
;
private
Long
resourceDropMasterId
;
private
String
resourceDropMasterName
;
private
String
introducer
;
private
String
tag
;
private
String
remark
;
private
String
ossPathResume
;
private
String
assignedId
;
private
String
assignedName
;
private
Long
trackStatusId
;
private
String
trackStatus
;
private
Long
trackId
;
private
Long
operateUserId
;
private
String
operateUserName
;
private
String
createdAt
;
public
Long
getPotentialId
()
{
return
potentialId
;
}
public
void
setPotentialId
(
Long
potentialId
)
{
this
.
potentialId
=
potentialId
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
Integer
getGender
()
{
return
gender
;
}
public
void
setGender
(
Integer
gender
)
{
this
.
gender
=
gender
;
}
public
Long
getAge
()
{
return
age
;
}
public
void
setAge
(
Long
age
)
{
this
.
age
=
age
;
}
public
String
getMobileNo
()
{
return
mobileNo
;
}
public
void
setMobileNo
(
String
mobileNo
)
{
this
.
mobileNo
=
mobileNo
;
}
public
String
getWechatId
()
{
return
wechatId
;
}
public
void
setWechatId
(
String
wechatId
)
{
this
.
wechatId
=
wechatId
;
}
public
String
getQqId
()
{
return
qqId
;
}
public
void
setQqId
(
String
qqId
)
{
this
.
qqId
=
qqId
;
}
public
String
getOthersContacts
()
{
return
othersContacts
;
}
public
void
setOthersContacts
(
String
othersContacts
)
{
this
.
othersContacts
=
othersContacts
;
}
public
String
getEducationLevel
()
{
return
educationLevel
;
}
public
void
setEducationLevel
(
String
educationLevel
)
{
this
.
educationLevel
=
educationLevel
;
}
public
Long
getResourceDropMasterId
()
{
return
resourceDropMasterId
;
}
public
void
setResourceDropMasterId
(
Long
resourceDropMasterId
)
{
this
.
resourceDropMasterId
=
resourceDropMasterId
;
}
public
String
getResourceDropMasterName
()
{
return
resourceDropMasterName
;
}
public
void
setResourceDropMasterName
(
String
resourceDropMasterName
)
{
this
.
resourceDropMasterName
=
resourceDropMasterName
;
}
public
String
getIntroducer
()
{
return
introducer
;
}
public
void
setIntroducer
(
String
introducer
)
{
this
.
introducer
=
introducer
;
}
public
String
getTag
()
{
return
tag
;
}
public
void
setTag
(
String
tag
)
{
this
.
tag
=
tag
;
}
public
String
getRemark
()
{
return
remark
;
}
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
}
public
String
getOssPathResume
()
{
return
ossPathResume
;
}
public
void
setOssPathResume
(
String
ossPathResume
)
{
this
.
ossPathResume
=
ossPathResume
;
}
public
String
getAssignedId
()
{
return
assignedId
;
}
public
void
setAssignedId
(
String
assignedId
)
{
this
.
assignedId
=
assignedId
;
}
public
String
getAssignedName
()
{
return
assignedName
;
}
public
void
setAssignedName
(
String
assignedName
)
{
this
.
assignedName
=
assignedName
;
}
public
Long
getTrackStatusId
()
{
return
trackStatusId
;
}
public
void
setTrackStatusId
(
Long
trackStatusId
)
{
this
.
trackStatusId
=
trackStatusId
;
}
public
String
getTrackStatus
()
{
return
trackStatus
;
}
public
void
setTrackStatus
(
String
trackStatus
)
{
this
.
trackStatus
=
trackStatus
;
}
public
Long
getTrackId
()
{
return
trackId
;
}
public
void
setTrackId
(
Long
trackId
)
{
this
.
trackId
=
trackId
;
}
public
Long
getOperateUserId
()
{
return
operateUserId
;
}
public
void
setOperateUserId
(
Long
operateUserId
)
{
this
.
operateUserId
=
operateUserId
;
}
public
String
getOperateUserName
()
{
return
operateUserName
;
}
public
void
setOperateUserName
(
String
operateUserName
)
{
this
.
operateUserName
=
operateUserName
;
}
public
String
getCreatedAt
()
{
return
createdAt
;
}
public
void
setCreatedAt
(
String
createdAt
)
{
this
.
createdAt
=
createdAt
;
}
}
yd-api/src/main/java/com/yd/api/practitioner/vo/recruit/RecruitListRequestVO.java
0 → 100644
View file @
36d734f4
package
com
.
yd
.
api
.
practitioner
.
vo
.
recruit
;
public
class
RecruitListRequestVO
{
private
Long
assignedId
;
private
Integer
status
;
//1-待跟进,2-跟进中,3-以完成
public
Long
getAssignedId
()
{
return
assignedId
;
}
public
void
setAssignedId
(
Long
assignedId
)
{
this
.
assignedId
=
assignedId
;
}
public
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
}
yd-api/src/main/java/com/yd/api/practitioner/vo/recruit/RecruitListResponseVO.java
0 → 100644
View file @
36d734f4
package
com
.
yd
.
api
.
practitioner
.
vo
.
recruit
;
import
com.github.pagehelper.PageInfo
;
import
com.yd.api.result.CommonResult
;
import
com.yd.dal.entity.customer.Customer
;
import
java.util.List
;
public
class
RecruitListResponseVO
{
private
List
<
PractitionerPotentialInfo
>
practitionerPotentialInfoList
;
private
PageInfo
<
PractitionerPotentialInfo
>
page
;
private
CommonResult
commonResult
;
public
List
<
PractitionerPotentialInfo
>
getPractitionerPotentialInfoList
()
{
return
practitionerPotentialInfoList
;
}
public
void
setPractitionerPotentialInfoList
(
List
<
PractitionerPotentialInfo
>
practitionerPotentialInfoList
)
{
this
.
practitionerPotentialInfoList
=
practitionerPotentialInfoList
;
}
public
PageInfo
<
PractitionerPotentialInfo
>
getPage
()
{
return
page
;
}
public
void
setPage
(
PageInfo
<
PractitionerPotentialInfo
>
page
)
{
this
.
page
=
page
;
}
public
CommonResult
getCommonResult
()
{
return
commonResult
;
}
public
void
setCommonResult
(
CommonResult
commonResult
)
{
this
.
commonResult
=
commonResult
;
}
}
yd-api/src/main/java/com/yd/api/practitioner/vo/recruit/RecruitRequestVO.java
0 → 100644
View file @
36d734f4
package
com
.
yd
.
api
.
practitioner
.
vo
.
recruit
;
public
class
RecruitRequestVO
{
private
Long
potentialId
;
private
String
name
;
private
Integer
gender
;
private
Long
age
;
private
String
mobileNo
;
private
String
wechatId
;
private
String
qqId
;
private
String
othersContacts
;
private
String
educationLevel
;
private
Long
resourceDropMasterId
;
private
String
introducer
;
private
String
tag
;
private
String
remark
;
private
String
ossPathResume
;
private
Long
practitionerId
;
public
Long
getPotentialId
()
{
return
potentialId
;
}
public
void
setPotentialId
(
Long
potentialId
)
{
this
.
potentialId
=
potentialId
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
Integer
getGender
()
{
return
gender
;
}
public
void
setGender
(
Integer
gender
)
{
this
.
gender
=
gender
;
}
public
Long
getAge
()
{
return
age
;
}
public
void
setAge
(
Long
age
)
{
this
.
age
=
age
;
}
public
String
getMobileNo
()
{
return
mobileNo
;
}
public
void
setMobileNo
(
String
mobileNo
)
{
this
.
mobileNo
=
mobileNo
;
}
public
String
getWechatId
()
{
return
wechatId
;
}
public
void
setWechatId
(
String
wechatId
)
{
this
.
wechatId
=
wechatId
;
}
public
String
getQqId
()
{
return
qqId
;
}
public
void
setQqId
(
String
qqId
)
{
this
.
qqId
=
qqId
;
}
public
String
getOthersContacts
()
{
return
othersContacts
;
}
public
void
setOthersContacts
(
String
othersContacts
)
{
this
.
othersContacts
=
othersContacts
;
}
public
String
getEducationLevel
()
{
return
educationLevel
;
}
public
void
setEducationLevel
(
String
educationLevel
)
{
this
.
educationLevel
=
educationLevel
;
}
public
Long
getResourceDropMasterId
()
{
return
resourceDropMasterId
;
}
public
void
setResourceDropMasterId
(
Long
resourceDropMasterId
)
{
this
.
resourceDropMasterId
=
resourceDropMasterId
;
}
public
String
getIntroducer
()
{
return
introducer
;
}
public
void
setIntroducer
(
String
introducer
)
{
this
.
introducer
=
introducer
;
}
public
String
getTag
()
{
return
tag
;
}
public
void
setTag
(
String
tag
)
{
this
.
tag
=
tag
;
}
public
String
getRemark
()
{
return
remark
;
}
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
}
public
String
getOssPathResume
()
{
return
ossPathResume
;
}
public
void
setOssPathResume
(
String
ossPathResume
)
{
this
.
ossPathResume
=
ossPathResume
;
}
public
Long
getPractitionerId
()
{
return
practitionerId
;
}
public
void
setPractitionerId
(
Long
practitionerId
)
{
this
.
practitionerId
=
practitionerId
;
}
}
yd-api/src/main/java/com/yd/api/practitioner/vo/recruit/RecruitResponseVO.java
0 → 100644
View file @
36d734f4
package
com
.
yd
.
api
.
practitioner
.
vo
.
recruit
;
import
com.yd.api.result.CommonResult
;
public
class
RecruitResponseVO
{
private
Long
potentialCustomerId
;
private
Long
potentialId
;
private
CommonResult
commonResult
;
public
Long
getPotentialCustomerId
()
{
return
potentialCustomerId
;
}
public
void
setPotentialCustomerId
(
Long
potentialCustomerId
)
{
this
.
potentialCustomerId
=
potentialCustomerId
;
}
public
Long
getPotentialId
()
{
return
potentialId
;
}
public
void
setPotentialId
(
Long
potentialId
)
{
this
.
potentialId
=
potentialId
;
}
public
CommonResult
getCommonResult
()
{
return
commonResult
;
}
public
void
setCommonResult
(
CommonResult
commonResult
)
{
this
.
commonResult
=
commonResult
;
}
}
yd-api/src/main/java/com/yd/api/practitioner/vo/recruit/RecruitTrackQueryRequestVO.java
0 → 100644
View file @
36d734f4
package
com
.
yd
.
api
.
practitioner
.
vo
.
recruit
;
public
class
RecruitTrackQueryRequestVO
{
private
Long
potentialId
;
private
Long
assignedId
;
public
Long
getPotentialId
()
{
return
potentialId
;
}
public
void
setPotentialId
(
Long
potentialId
)
{
this
.
potentialId
=
potentialId
;
}
public
Long
getAssignedId
()
{
return
assignedId
;
}
public
void
setAssignedId
(
Long
assignedId
)
{
this
.
assignedId
=
assignedId
;
}
}
yd-api/src/main/java/com/yd/api/practitioner/vo/recruit/RecruitTrackQueryResponseVO.java
0 → 100644
View file @
36d734f4
package
com
.
yd
.
api
.
practitioner
.
vo
.
recruit
;
public
class
RecruitTrackQueryResponseVO
{
private
Long
trackId
;
private
Long
trackStatusId
;
private
String
trackStatus
;
private
String
notice
;
private
String
createAt
;
private
Long
operateUserId
;
private
String
operateUserName
;
public
Long
getTrackId
()
{
return
trackId
;
}
public
void
setTrackId
(
Long
trackId
)
{
this
.
trackId
=
trackId
;
}
public
Long
getTrackStatusId
()
{
return
trackStatusId
;
}
public
void
setTrackStatusId
(
Long
trackStatusId
)
{
this
.
trackStatusId
=
trackStatusId
;
}
public
String
getTrackStatus
()
{
return
trackStatus
;
}
public
void
setTrackStatus
(
String
trackStatus
)
{
this
.
trackStatus
=
trackStatus
;
}
public
String
getNotice
()
{
return
notice
;
}
public
void
setNotice
(
String
notice
)
{
this
.
notice
=
notice
;
}
public
String
getCreateAt
()
{
return
createAt
;
}
public
void
setCreateAt
(
String
createAt
)
{
this
.
createAt
=
createAt
;
}
public
Long
getOperateUserId
()
{
return
operateUserId
;
}
public
void
setOperateUserId
(
Long
operateUserId
)
{
this
.
operateUserId
=
operateUserId
;
}
public
String
getOperateUserName
()
{
return
operateUserName
;
}
public
void
setOperateUserName
(
String
operateUserName
)
{
this
.
operateUserName
=
operateUserName
;
}
}
yd-api/src/main/java/com/yd/dal/entity/customer/AclPractitioner.java
0 → 100644
View file @
36d734f4
package
com
.
yd
.
dal
.
entity
.
customer
;
import
java.io.Serializable
;
import
java.util.Date
;
import
lombok.Data
;
/**
* ag_acl_practitioner
* @author
*/
@Data
public
class
AclPractitioner
implements
Serializable
{
/**
* serial id
*/
private
Long
id
;
/**
* FK ag_acl_insurer.id
*/
private
Long
insurerId
;
/**
* FK ag_acl_insurer_branch.id
*/
private
Long
insurerBranchId
;
/**
* FK ag_acl_insurer_branch_dept.id 所属部门id
*/
private
Long
deptId
;
/**
* FK ag_acl_practitioner_subordinate_system.id 所属部门id
*/
private
Long
subordinateSystemId
;
/**
* 从业人员编号
*/
private
String
practitionerCode
;
/**
* 从业人员姓名
*/
private
String
name
;
/**
* 从业人员电话
*/
private
String
mobileNo
;
/**
* FK ag_md_id_type.id
*/
private
Long
idTypeId
;
/**
* 从业人员证件类型
*/
private
String
idType
;
/**
* 从业人员证件号
*/
private
String
idNo
;
/**
* 从业人员生日
*/
private
Date
practitionerBirthdate
;
/**
* 从业人员执业证编号
*/
private
String
practitionerRegNo
;
/**
* 从业人员所属公司
*/
private
String
practitionerRegCompany
;
/**
* 有效起日
*/
private
Date
effectiveStartDate
;
/**
* 有效终日
*/
private
Date
effectiveEndDate
;
/**
* 备注
*/
private
String
remark
;
/**
* FK ag_acl_customer.id
*/
private
Long
customerId
;
/**
* 公司员工编码
*/
private
String
employeeNo
;
/**
* 0=No, 1=Yes
*/
private
Integer
isActive
;
/**
* 建置日
*/
private
Date
createdAt
;
/**
* 建置者
*/
private
Long
createdBy
;
/**
* 更新日
*/
private
Date
updatedAt
;
private
Long
updatedBy
;
/**
* 从业人员所属区域-省份 FK ag_md_province.id
*/
private
Long
provinceId
;
/**
* 所属区域省份名
*/
private
String
provinceName
;
/**
* 从业人员所属区域-城市 FK ag_md_city.id
*/
private
Long
cityId
;
/**
* 所属区域城市名
*/
private
String
cityName
;
/**
* 从业人员证照/荣誉列 FK ag_md_certificate.id
*/
private
String
certList
;
/**
* 从业人员自我简介
*/
private
String
bioIntro
;
/**
* 从业人员微信号
*/
private
String
wechatId
;
/**
* 从业人员QQ号
*/
private
String
qqId
;
/**
* 查询是否显示 0=No=不显示 1=Yes=显示
*/
private
Integer
isProfileShow
;
/**
* 姓名是否显示 0=No=不显示 1=Yes=显示
*/
private
Integer
isNameShow
;
/**
* 电话是否显示 0=No=不显示 1=Yes=显示
*/
private
Integer
isMobileShow
;
/**
* 教育程度
*/
private
String
educationLevel
;
/**
* FK ag_acl_practitioner.id 辅导人
*/
private
Long
mentorId
;
/**
* FK ag_acl_practitioner.id 介绍人
*/
private
Long
introducerId
;
/**
* 1=Male, 2=Female
*/
private
Integer
gender
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
yd-api/src/main/java/com/yd/dal/entity/customer/AclPractitionerPotential.java
0 → 100644
View file @
36d734f4
package
com
.
yd
.
dal
.
entity
.
customer
;
import
java.io.Serializable
;
import
java.util.Date
;
import
lombok.Data
;
/**
* ag_acl_practitioner_potential
* @author
*/
@Data
public
class
AclPractitionerPotential
implements
Serializable
{
/**
* serial id
*/
private
Long
id
;
/**
* 姓名
*/
private
String
name
;
/**
* 年龄
*/
private
Long
age
;
/**
* 1=Male, 2=Female
*/
private
Integer
gender
;
/**
* 从业人员电话
*/
private
String
mobileNo
;
/**
* 从业人员微信号
*/
private
String
wechatId
;
/**
* 从业人员QQ号
*/
private
String
qqId
;
/**
* 其他联系方式
*/
private
String
othersContacts
;
/**
* 教育程度
*/
private
String
educationLevel
;
/**
* 介绍人
*/
private
String
introducer
;
/**
* 标签
*/
private
String
tag
;
/**
* 备注
*/
private
String
remark
;
/**
* FK ag_drop_master.id 来源
*/
private
Long
resourceDropMasterId
;
/**
* 简历附件
*/
private
String
ossPathResume
;
/**
* FK ag_acl_practitioner.id 指派团队长
*/
private
String
practitionerAssignedIds
;
/**
* 0=No, 1=Yes
*/
private
Integer
isActive
;
/**
* 分析建置时间
*/
private
Date
createdAt
;
/**
* 建置者 FK ag_acl_user.id
*/
private
Long
createdBy
;
/**
* 更新时间
*/
private
Date
updatedAt
;
/**
* 更新者 FK ag_acl_user.id
*/
private
Long
updatedBy
;
private
static
final
long
serialVersionUID
=
1L
;
private
Integer
creatorType
;
private
Integer
updatorType
;
private
Long
customerId
;
}
\ No newline at end of file
yd-api/src/main/java/com/yd/dal/entity/customer/AclPractitionerPotentialAssignedTrack.java
0 → 100644
View file @
36d734f4
package
com
.
yd
.
dal
.
entity
.
customer
;
import
java.io.Serializable
;
import
java.util.Date
;
import
lombok.Data
;
/**
* ag_acl_practitioner_potential_assigned_track
* @author
*/
@Data
public
class
AclPractitionerPotentialAssignedTrack
implements
Serializable
{
/**
* serial id
*/
private
Long
id
;
/**
* FK ag_mkt_practitioner_potential.id 线索指派表
*/
private
Long
practitionerPotentialId
;
/**
* FK ag_acl_practitioner.id 指派团队长id
*/
private
Long
practitionerAssignedId
;
/**
* FK ag_md_drop_options.id 团队长增员状态
*/
private
Long
trackStatusId
;
/**
* 潜在经纪人增员(团队长)类似回访记录
*/
private
String
notice
;
/**
* 0=No, 1=Yes
*/
private
Integer
isActive
;
/**
* 分析建置时间
*/
private
Date
createdAt
;
/**
* 建置者 FK ag_acl_user.id
*/
private
Long
createdBy
;
/**
* 更新时间
*/
private
Date
updatedAt
;
/**
* 更新者 FK ag_acl_user.id
*/
private
Long
updatedBy
;
private
Integer
creatorType
;
private
Integer
updatorType
;
private
Integer
isLasted
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
yd-api/src/main/java/com/yd/dal/entity/customer/AclPractitionerSubordinateSystem.java
0 → 100644
View file @
36d734f4
package
com
.
yd
.
dal
.
entity
.
customer
;
import
java.io.Serializable
;
import
java.util.Date
;
import
lombok.Data
;
/**
* ag_acl_practitioner_subordinate_system
* @author
*/
@Data
public
class
AclPractitionerSubordinateSystem
implements
Serializable
{
/**
* serial id
*/
private
Long
id
;
/**
* FK ag_acl_insurer.id
*/
private
Long
insurerId
;
/**
* FK ag_acl_insurer.id
*/
private
Long
insurerBranchId
;
/**
* FK ag_acl_insurer_branch_dept.id 所属部门id
*/
private
Long
deptId
;
/**
* 编码
*/
private
String
subordinateSystemCode
;
/**
* dept name
*/
private
String
name
;
/**
* dept english name
*/
private
String
nameEn
;
/**
* FK ag_acl_practitioner.id,体系主管
*/
private
Long
ownerPractitionerId
;
/**
* 联系人
*/
private
String
contactName
;
/**
* 联系电话
*/
private
String
contactNo
;
/**
* memo or tips
*/
private
String
remark
;
/**
* 0=No, 1=Yes
*/
private
Integer
isActive
;
private
Date
createdAt
;
/**
* FK ag_acl_user.id
*/
private
Long
createdBy
;
private
Date
updatedAt
;
/**
* FK ag_acl_user.id
*/
private
Long
updatedBy
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
yd-api/src/main/java/com/yd/dal/entity/practitioner/AclPractitionerInfo.java
→
yd-api/src/main/java/com/yd/dal/entity/
customer/
practitioner/AclPractitionerInfo.java
View file @
36d734f4
package
com
.
yd
.
dal
.
entity
.
practitioner
;
package
com
.
yd
.
dal
.
entity
.
customer
.
practitioner
;
import
java.io.Serializable
;
import
java.util.Date
;
...
...
yd-api/src/main/java/com/yd/dal/entity/practitioner/PractitionerBasicInfo.java
→
yd-api/src/main/java/com/yd/dal/entity/
customer/
practitioner/PractitionerBasicInfo.java
View file @
36d734f4
package
com
.
yd
.
dal
.
entity
.
practitioner
;
package
com
.
yd
.
dal
.
entity
.
customer
.
practitioner
;
public
class
PractitionerBasicInfo
{
private
Long
customerId
;
...
...
yd-api/src/main/java/com/yd/dal/entity/practitioner/PractitionerInfo.java
→
yd-api/src/main/java/com/yd/dal/entity/
customer/
practitioner/PractitionerInfo.java
View file @
36d734f4
package
com
.
yd
.
dal
.
entity
.
practitioner
;
package
com
.
yd
.
dal
.
entity
.
customer
.
practitioner
;
public
class
PractitionerInfo
{
private
Long
customerId
;
...
...
yd-api/src/main/java/com/yd/dal/entity/practitioner/PractitionerRankInfo.java
→
yd-api/src/main/java/com/yd/dal/entity/
customer/
practitioner/PractitionerRankInfo.java
View file @
36d734f4
package
com
.
yd
.
dal
.
entity
.
practitioner
;
package
com
.
yd
.
dal
.
entity
.
customer
.
practitioner
;
public
class
PractitionerRankInfo
{
private
Long
customerId
;
...
...
yd-api/src/main/java/com/yd/dal/entity/practitioner/PractitionerSubordinateInfo.java
→
yd-api/src/main/java/com/yd/dal/entity/
customer/
practitioner/PractitionerSubordinateInfo.java
View file @
36d734f4
package
com
.
yd
.
dal
.
entity
.
practitioner
;
package
com
.
yd
.
dal
.
entity
.
customer
.
practitioner
;
public
class
PractitionerSubordinateInfo
{
private
Long
subordinateId
;
...
...
yd-api/src/main/java/com/yd/dal/mapper/customer/AclCustomerMapper.java
View file @
36d734f4
...
...
@@ -2,6 +2,8 @@ package com.yd.dal.mapper.customer;
import
com.yd.dal.entity.customer.AclCustomer
;
import
java.util.List
;
public
interface
AclCustomerMapper
{
int
deleteByPrimaryKey
(
Long
id
);
...
...
@@ -14,4 +16,6 @@ public interface AclCustomerMapper {
int
updateByPrimaryKeySelective
(
AclCustomer
record
);
int
updateByPrimaryKey
(
AclCustomer
record
);
List
<
AclCustomer
>
findByLogin
(
String
mobileNo
);
}
\ No newline at end of file
yd-api/src/main/java/com/yd/dal/mapper/
practitioner/
PractitionerMapper.java
→
yd-api/src/main/java/com/yd/dal/mapper/
customer/Acl
PractitionerMapper.java
View file @
36d734f4
package
com
.
yd
.
dal
.
mapper
.
practition
er
;
package
com
.
yd
.
dal
.
mapper
.
custom
er
;
import
com.yd.dal.entity.customer.AclPractitioner
;
import
com.yd.dal.entity.customer.practitioner.AclPractitionerInfo
;
import
com.yd.dal.entity.customer.practitioner.PractitionerBasicInfo
;
import
com.yd.dal.entity.customer.practitioner.PractitionerInfo
;
import
com.yd.dal.entity.customer.practitioner.PractitionerRankInfo
;
import
com.yd.dal.entity.practitioner.opportunity.OwnOpportunityInfo
;
import
com.yd.dal.entity.practitioner.PractitionerBasicInfo
;
import
com.yd.dal.entity.practitioner.PractitionerInfo
;
import
com.yd.dal.entity.practitioner.PractitionerRankInfo
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
PractitionerMapper
{
public
interface
AclPractitionerMapper
{
int
deleteByPrimaryKey
(
Long
id
);
int
insert
(
AclPractitioner
record
);
int
insertSelective
(
AclPractitioner
record
);
AclPractitioner
selectByPrimaryKey
(
Long
id
);
int
updateByPrimaryKeySelective
(
AclPractitioner
record
);
int
updateByPrimaryKey
(
AclPractitioner
record
);
PractitionerBasicInfo
getPractitionerInfoByMobileNoForOffline
(
String
mobileNo
);
List
<
PractitionerRankInfo
>
getPractitionerRankInfoForOffline
(
@Param
(
"time"
)
Integer
time
);
...
...
@@ -21,5 +35,7 @@ public interface PractitionerMapper {
PractitionerInfo
findPractitionerInfoByLogin
(
@Param
(
"mobileNo"
)
String
mobileNo
);
List
<
OwnOpportunityInfo
>
ownOpportunityQuery
(
@Param
(
"practitionerId"
)
Long
practitionerId
);
AclPractitioner
findByCustomerIdIsActive
(
@Param
(
"customerId"
)
Long
customerId
,
@Param
(
"isActive"
)
int
isActive
);
List
<
OwnOpportunityInfo
>
ownOpportunityQuery
(
Long
practitionerId
);
}
\ No newline at end of file
yd-api/src/main/java/com/yd/dal/mapper/customer/AclPractitionerPotentialAssignedTrackMapper.java
0 → 100644
View file @
36d734f4
package
com
.
yd
.
dal
.
mapper
.
customer
;
import
com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
AclPractitionerPotentialAssignedTrackMapper
{
int
deleteByPrimaryKey
(
Long
id
);
int
insert
(
AclPractitionerPotentialAssignedTrack
record
);
int
insertSelective
(
AclPractitionerPotentialAssignedTrack
record
);
AclPractitionerPotentialAssignedTrack
selectByPrimaryKey
(
Long
id
);
int
updateByPrimaryKeySelective
(
AclPractitionerPotentialAssignedTrack
record
);
int
updateByPrimaryKey
(
AclPractitionerPotentialAssignedTrack
record
);
void
insertList
(
@Param
(
"potentialAssignedTrackList"
)
List
<
AclPractitionerPotentialAssignedTrack
>
potentialAssignedTrackList
);
}
\ No newline at end of file
yd-api/src/main/java/com/yd/dal/mapper/customer/AclPractitionerPotentialMapper.java
0 → 100644
View file @
36d734f4
package
com
.
yd
.
dal
.
mapper
.
customer
;
import
com.yd.dal.entity.customer.AclPractitionerPotential
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
AclPractitionerPotentialMapper
{
int
deleteByPrimaryKey
(
Long
id
);
int
insert
(
AclPractitionerPotential
record
);
int
insertSelective
(
AclPractitionerPotential
record
);
AclPractitionerPotential
selectByPrimaryKey
(
Long
id
);
int
updateByPrimaryKeySelective
(
AclPractitionerPotential
record
);
int
updateByPrimaryKey
(
AclPractitionerPotential
record
);
List
<
AclPractitionerPotential
>
findByMobileNo
(
@Param
(
"mobileNo"
)
String
mobileNo
,
@Param
(
"isActive"
)
Integer
isActive
);
}
\ No newline at end of file
yd-api/src/main/java/com/yd/dal/mapper/customer/AclPractitionerSubordinateSystemMapper.java
0 → 100644
View file @
36d734f4
package
com
.
yd
.
dal
.
mapper
.
customer
;
import
com.yd.dal.entity.customer.AclPractitionerSubordinateSystem
;
import
com.yd.dal.entity.customer.practitioner.PractitionerSubordinateInfo
;
public
interface
AclPractitionerSubordinateSystemMapper
{
int
deleteByPrimaryKey
(
Long
id
);
int
insert
(
AclPractitionerSubordinateSystem
record
);
int
insertSelective
(
AclPractitionerSubordinateSystem
record
);
AclPractitionerSubordinateSystem
selectByPrimaryKey
(
Long
id
);
int
updateByPrimaryKeySelective
(
AclPractitionerSubordinateSystem
record
);
int
updateByPrimaryKey
(
AclPractitionerSubordinateSystem
record
);
PractitionerSubordinateInfo
findSubordinateInfo
(
Long
subordinateId
);
}
\ No newline at end of file
yd-api/src/main/java/com/yd/dal/mapper/practitioner/AclPractitionerMapper.java
deleted
100644 → 0
View file @
b3d10881
package
com
.
yd
.
dal
.
mapper
.
practitioner
;
import
com.yd.dal.entity.practitioner.AclPractitionerInfo
;
public
interface
AclPractitionerMapper
{
int
deleteByPrimaryKey
(
Long
id
);
int
insert
(
AclPractitionerInfo
record
);
int
insertSelective
(
AclPractitionerInfo
record
);
AclPractitionerInfo
selectByPrimaryKey
(
Long
id
);
int
updateByPrimaryKeySelective
(
AclPractitionerInfo
record
);
int
updateByPrimaryKey
(
AclPractitionerInfo
record
);
}
\ No newline at end of file
yd-api/src/main/java/com/yd/dal/mapper/practitioner/PractitionerSubordinateMapper.java
deleted
100644 → 0
View file @
b3d10881
package
com
.
yd
.
dal
.
mapper
.
practitioner
;
import
com.yd.dal.entity.practitioner.PractitionerSubordinateInfo
;
import
org.apache.ibatis.annotations.Param
;
public
interface
PractitionerSubordinateMapper
{
PractitionerSubordinateInfo
findSubordinateInfo
(
@Param
(
"subordinateId"
)
Long
subordinateId
);
}
yd-api/src/main/java/com/yd/dal/mapper/tencent/TenInterfRecordMapper.java
View file @
36d734f4
...
...
@@ -19,4 +19,8 @@ public interface TenInterfRecordMapper {
int
updateByPrimaryKey
(
TenInterfRecord
record
);
List
<
TenInterfRecord
>
findByTenInterfRecordOrderBy
(
@Param
(
"info"
)
TenInterfRecord
tencentInterfRecord
,
@Param
(
"orderBy"
)
String
orderBy
);
List
<
TenInterfRecord
>
findByAppIdAndGrantType
(
@Param
(
"appId"
)
String
appId
,
@Param
(
"grantType"
)
String
grantType
,
@Param
(
"type"
)
String
type
);
List
<
TenInterfRecord
>
findByAccessTokenAndIType
(
@Param
(
"accessToken"
)
String
accessToken
,
@Param
(
"pType"
)
String
pType
,
@Param
(
"type"
)
String
type
);
}
\ No newline at end of file
yd-api/src/main/java/com/yd/dal/service/commission/CommissionEGoldenDAImpl.java
View file @
36d734f4
...
...
@@ -17,7 +17,7 @@ import java.util.List;
* @author Simon
* @version 1.0
*/
@Service
(
"commissionEGoldenDA
Impl
"
)
@Service
(
"commissionEGoldenDA"
)
public
class
CommissionEGoldenDAImpl
implements
CommissionEGoldenDA
{
private
static
final
Logger
LOG
=
Logger
.
getLogger
(
CommissionEGoldenDAImpl
.
class
);
...
...
yd-api/src/main/java/com/yd/dal/service/commission/CommissionServiceDAImpl.java
View file @
36d734f4
...
...
@@ -20,7 +20,7 @@ import java.util.List;
* @author Simon
* @version 1.0
*/
@Service
(
"commissionServiceDA
Impl
"
)
@Service
(
"commissionServiceDA"
)
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
rollbackFor
=
Exception
.
class
)
public
class
CommissionServiceDAImpl
implements
CommissionServiceDA
{
...
...
yd-api/src/main/java/com/yd/dal/service/customer/AclCustomerDALService.java
View file @
36d734f4
...
...
@@ -2,6 +2,33 @@ package com.yd.dal.service.customer;
import
com.yd.dal.entity.customer.AclCustomer
;
import
java.util.List
;
public
interface
AclCustomerDALService
{
/**
* 通过登录号进行查找
* @param mobileNo 手机号
* @return
*/
List
<
AclCustomer
>
findByLogin
(
String
mobileNo
);
/**
* 保存数据
* @param aclCustomer
* @return
*/
void
update
(
AclCustomer
aclCustomer
);
/**
* 获取用户信息
* @param customerId
* @return
*/
AclCustomer
findById
(
Long
customerId
);
void
save
(
AclCustomer
aclCustomer
);
AclCustomer
findByCustomerId
(
Long
customerId
);
}
yd-api/src/main/java/com/yd/dal/service/
practitioner/
PractitionerDALService.java
→
yd-api/src/main/java/com/yd/dal/service/
customer/Acl
PractitionerDALService.java
View file @
36d734f4
package
com
.
yd
.
dal
.
service
.
practition
er
;
package
com
.
yd
.
dal
.
service
.
custom
er
;
import
com.yd.dal.entity.customer.AclFileUpload
;
import
com.yd.dal.entity.practitioner.AclPractitionerInfo
;
import
com.yd.dal.entity.practitioner.PractitionerBasicInfo
;
import
com.yd.dal.entity.practitioner.PractitionerInfo
;
import
com.yd.dal.entity.practitioner.PractitionerRankInfo
;
import
com.yd.dal.entity.practitioner.opportunity.OwnOpportunityInfo
;
import
com.yd.dal.entity.customer.AclPractitioner
;
import
com.yd.dal.entity.customer.practitioner.AclPractitionerInfo
;
import
com.yd.dal.entity.customer.practitioner.PractitionerBasicInfo
;
import
com.yd.dal.entity.customer.practitioner.PractitionerInfo
;
import
com.yd.dal.entity.customer.practitioner.PractitionerRankInfo
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
public
interface
PractitionerDALService
{
@Service
(
"aclPractitionerDALService"
)
public
interface
AclPractitionerDALService
{
/**
* 通过customerId 和is_active 获取用户
* @param customerId
* @param i
* @return
*/
AclPractitioner
findByCustomerIdIsActive
(
Long
customerId
,
int
i
);
/**
* 线下--通过手机号码获取经纪人的基础信息
* @param mobileNo
...
...
@@ -56,13 +66,7 @@ public interface PractitionerDALService {
* @param practitionerId
* @return
*/
AclPractitionerInfo
findPractitionerById
(
Long
practitionerId
);
/**
* 通过id更新practitioner
* @param practitioner
*/
void
updatePractitioner
(
AclPractitionerInfo
practitioner
);
AclPractitioner
findPractitionerById
(
Long
practitionerId
);
/**
* 经纪人查询自己的商机
...
...
@@ -70,4 +74,5 @@ public interface PractitionerDALService {
* @return
*/
List
<
OwnOpportunityInfo
>
ownOpportunityQuery
(
Long
practitionerId
);
void
updatePractitioner
(
AclPractitioner
practitioner
);
}
yd-api/src/main/java/com/yd/dal/service/customer/AclPractitionerPotentialAssignedTrackDALService.java
0 → 100644
View file @
36d734f4
package
com
.
yd
.
dal
.
service
.
customer
;
import
com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
@Service
(
"aclPractitionerPotentialAssignedTrackDALService"
)
public
interface
AclPractitionerPotentialAssignedTrackDALService
{
void
saveAll
(
List
<
AclPractitionerPotentialAssignedTrack
>
potentialAssignedTrackList
);
}
yd-api/src/main/java/com/yd/dal/service/customer/AclPractitionerPotentialDALService.java
0 → 100644
View file @
36d734f4
package
com
.
yd
.
dal
.
service
.
customer
;
import
com.yd.dal.entity.customer.AclPractitionerPotential
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
@Service
(
"aclPractitionerPotentialDALService"
)
public
interface
AclPractitionerPotentialDALService
{
/**
* 根据手机号查询
* @param mobileNo
* @return
*/
List
<
AclPractitionerPotential
>
findByMobileNo
(
String
mobileNo
,
Integer
isActive
);
/**
* 保存
* @param practitionerPotential
* @return
*/
int
save
(
AclPractitionerPotential
practitionerPotential
);
}
yd-api/src/main/java/com/yd/dal/service/customer/AclPractitionerSubordinateSystemDALService.java
0 → 100644
View file @
36d734f4
package
com
.
yd
.
dal
.
service
.
customer
;
import
com.yd.dal.entity.customer.practitioner.PractitionerSubordinateInfo
;
import
org.springframework.stereotype.Service
;
@Service
(
"aclPractitionerSubordinateSystemDALService"
)
public
interface
AclPractitionerSubordinateSystemDALService
{
PractitionerSubordinateInfo
findSubordinateInfo
(
Long
subordinateId
);
}
yd-api/src/main/java/com/yd/dal/service/customer/impl/AclCustomerDALServiceImpl.java
View file @
36d734f4
...
...
@@ -6,14 +6,39 @@ import com.yd.dal.service.customer.AclCustomerDALService;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
@Service
(
"aclCustomerD
AL
Service"
)
@Service
(
"aclCustomerD
al
Service"
)
public
class
AclCustomerDALServiceImpl
implements
AclCustomerDALService
{
@Resource
@Autowired
private
AclCustomerMapper
aclCustomerMapper
;
@Override
public
List
<
AclCustomer
>
findByLogin
(
String
mobileNo
)
{
return
aclCustomerMapper
.
findByLogin
(
mobileNo
);
}
@Override
public
void
update
(
AclCustomer
aclCustomer
)
{
aclCustomerMapper
.
updateByPrimaryKeySelective
(
aclCustomer
);
}
@Override
public
AclCustomer
findById
(
Long
customerId
)
{
return
aclCustomerMapper
.
selectByPrimaryKey
(
customerId
);
}
@Override
public
void
save
(
AclCustomer
aclCustomer
)
{
aclCustomerMapper
.
insertSelective
(
aclCustomer
);
}
@Override
public
AclCustomer
findByCustomerId
(
Long
customerId
)
{
return
aclCustomerMapper
.
selectByPrimaryKey
(
customerId
);
}
}
yd-api/src/main/java/com/yd/dal/service/
practitioner/impl/
PractitionerDALServiceImpl.java
→
yd-api/src/main/java/com/yd/dal/service/
customer/impl/Acl
PractitionerDALServiceImpl.java
View file @
36d734f4
package
com
.
yd
.
dal
.
service
.
practition
er
.
impl
;
package
com
.
yd
.
dal
.
service
.
custom
er
.
impl
;
import
com.google.common.base.Strings
;
import
com.yd.dal.entity.practitioner.AclPractitionerInfo
;
import
com.yd.dal.entity.practitioner.PractitionerBasicInfo
;
import
com.yd.dal.entity.practitioner.PractitionerInfo
;
import
com.yd.dal.entity.practitioner.PractitionerRankInfo
;
import
com.yd.dal.entity.customer.practitioner.AclPractitionerInfo
;
import
com.yd.dal.entity.practitioner.opportunity.OwnOpportunityInfo
;
import
com.yd.dal.mapper.practitioner.AclPractitionerMapper
;
import
com.yd.dal.mapper.practitioner.PractitionerMapper
;
import
com.yd.dal.service.customer.impl.CustomerDALServiceImpl
;
import
com.yd.dal.service.practitioner.PractitionerDALService
;
import
com.yd.dal.entity.customer.AclPractitioner
;
import
com.yd.dal.entity.customer.practitioner.PractitionerBasicInfo
;
import
com.yd.dal.entity.customer.practitioner.PractitionerInfo
;
import
com.yd.dal.entity.customer.practitioner.PractitionerRankInfo
;
import
com.yd.dal.mapper.customer.AclPractitionerMapper
;
import
com.yd.dal.service.customer.AclPractitionerDALService
;
import
com.yd.util.intercept.annotation.TargetDataSource
;
import
com.yd.util.intercept.commons.DataSourceKey
;
import
org.apache.log4j.Logger
;
...
...
@@ -17,19 +16,21 @@ import org.springframework.stereotype.Service;
import
javax.annotation.Resource
;
import
java.util.List
;
@Service
(
"practitionerServiceDAL"
)
public
class
PractitionerDALServiceImpl
implements
PractitionerDALService
{
private
static
final
Logger
LOG
=
Logger
.
getLogger
(
CustomerDALServiceImpl
.
class
);
@Resource
private
PractitionerMapper
practitionerMapper
;
@Service
(
"aclPractitionerDALService"
)
public
class
AclPractitionerDALServiceImpl
implements
AclPractitionerDALService
{
private
static
final
Logger
LOG
=
Logger
.
getLogger
(
AclPractitionerDALServiceImpl
.
class
);
@Resource
private
AclPractitionerMapper
aclPractitionerMapper
;
@Override
public
AclPractitioner
findByCustomerIdIsActive
(
Long
customerId
,
int
isActive
)
{
return
aclPractitionerMapper
.
findByCustomerIdIsActive
(
customerId
,
isActive
);
}
@Override
@TargetDataSource
(
dataSourceKey
=
DataSourceKey
.
DB_EGOLDEN
)
public
PractitionerBasicInfo
getPractitionerBasicInfoForOffline
(
String
mobileNo
)
{
if
(!
Strings
.
isNullOrEmpty
(
mobileNo
)){
return
p
ractitionerMapper
.
getPractitionerInfoByMobileNoForOffline
(
mobileNo
);
return
aclP
ractitionerMapper
.
getPractitionerInfoByMobileNoForOffline
(
mobileNo
);
}
else
{
LOG
.
error
(
"mobileNo is null!"
);
}
...
...
@@ -39,7 +40,7 @@ public class PractitionerDALServiceImpl implements PractitionerDALService {
@Override
public
PractitionerBasicInfo
getPractitionerBasicInfoForOnline
(
String
mobileNo
)
{
if
(!
Strings
.
isNullOrEmpty
(
mobileNo
)){
return
p
ractitionerMapper
.
getPractitionerInfoByMobileNoForOnline
(
mobileNo
);
return
aclP
ractitionerMapper
.
getPractitionerInfoByMobileNoForOnline
(
mobileNo
);
}
else
{
LOG
.
error
(
"mobileNo is null!"
);
}
...
...
@@ -49,38 +50,38 @@ public class PractitionerDALServiceImpl implements PractitionerDALService {
@Override
@TargetDataSource
(
dataSourceKey
=
DataSourceKey
.
DB_EGOLDEN
)
public
List
<
PractitionerRankInfo
>
getPractitionerRankInfoForOffline
(
Integer
time
)
{
return
p
ractitionerMapper
.
getPractitionerRankInfoForOffline
(
time
);
return
aclP
ractitionerMapper
.
getPractitionerRankInfoForOffline
(
time
);
}
@Override
public
List
<
PractitionerRankInfo
>
getPractitionerRankInfoForOnline
(
Integer
time
,
Long
practitionerTypeId
)
{
return
p
ractitionerMapper
.
getPractitionerRankInfoForOnline
(
time
,
practitionerTypeId
);
return
aclP
ractitionerMapper
.
getPractitionerRankInfoForOnline
(
time
,
practitionerTypeId
);
}
@Override
public
List
<
PractitionerRankInfo
>
getPractitionerRankInfoForSpecials
(
List
<
String
>
mobileSpecials
,
Integer
time
)
{
return
p
ractitionerMapper
.
getPractitionerRankInfoForSpecials
(
mobileSpecials
,
time
);
return
aclP
ractitionerMapper
.
getPractitionerRankInfoForSpecials
(
mobileSpecials
,
time
);
}
@Override
public
PractitionerInfo
findPractitionerInfoByLogin
(
String
mobileNo
)
{
return
p
ractitionerMapper
.
findPractitionerInfoByLogin
(
mobileNo
);
return
aclP
ractitionerMapper
.
findPractitionerInfoByLogin
(
mobileNo
);
}
@Override
@TargetDataSource
(
dataSourceKey
=
DataSourceKey
.
DB_MASTER
)
public
AclPractitioner
Info
findPractitionerById
(
Long
practitionerId
)
{
public
AclPractitioner
findPractitionerById
(
Long
practitionerId
)
{
return
aclPractitionerMapper
.
selectByPrimaryKey
(
practitionerId
);
}
@Override
@TargetDataSource
(
dataSourceKey
=
DataSourceKey
.
DB_MASTER
)
public
void
updatePractitioner
(
AclPractitioner
Info
practitioner
)
{
public
void
updatePractitioner
(
AclPractitioner
practitioner
)
{
aclPractitionerMapper
.
updateByPrimaryKeySelective
(
practitioner
);
}
@Override
public
List
<
OwnOpportunityInfo
>
ownOpportunityQuery
(
Long
practitionerId
)
{
return
p
ractitionerMapper
.
ownOpportunityQuery
(
practitionerId
);
return
aclP
ractitionerMapper
.
ownOpportunityQuery
(
practitionerId
);
}
}
yd-api/src/main/java/com/yd/dal/service/customer/impl/AclPractitionerPotentialAssignedTrackDALServiceImpl.java
0 → 100644
View file @
36d734f4
package
com
.
yd
.
dal
.
service
.
customer
.
impl
;
import
com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack
;
import
com.yd.dal.mapper.customer.AclPractitionerPotentialAssignedTrackMapper
;
import
com.yd.dal.service.customer.AclPractitionerPotentialAssignedTrackDALService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
@Service
(
"aclPractitionerPotentialAssignedTrackDALService"
)
public
class
AclPractitionerPotentialAssignedTrackDALServiceImpl
implements
AclPractitionerPotentialAssignedTrackDALService
{
@Autowired
private
AclPractitionerPotentialAssignedTrackMapper
aclPractitionerPotentialAssignedTrackMapper
;
@Override
public
void
saveAll
(
List
<
AclPractitionerPotentialAssignedTrack
>
potentialAssignedTrackList
)
{
aclPractitionerPotentialAssignedTrackMapper
.
insertList
(
potentialAssignedTrackList
);
}
}
yd-api/src/main/java/com/yd/dal/service/customer/impl/AclPractitionerPotentialDALServiceImpl.java
0 → 100644
View file @
36d734f4
package
com
.
yd
.
dal
.
service
.
customer
.
impl
;
import
com.yd.dal.entity.customer.AclPractitionerPotential
;
import
com.yd.dal.mapper.customer.AclPractitionerPotentialMapper
;
import
com.yd.dal.service.customer.AclPractitionerPotentialDALService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
@Service
(
"aclPractitionerPotentialDALService"
)
public
class
AclPractitionerPotentialDALServiceImpl
implements
AclPractitionerPotentialDALService
{
@Autowired
private
AclPractitionerPotentialMapper
aclPractitionerPotentialMapper
;
@Override
public
List
<
AclPractitionerPotential
>
findByMobileNo
(
String
mobileNo
,
Integer
isActive
)
{
return
aclPractitionerPotentialMapper
.
findByMobileNo
(
mobileNo
,
isActive
);
}
@Override
public
int
save
(
AclPractitionerPotential
practitionerPotential
)
{
return
aclPractitionerPotentialMapper
.
insert
(
practitionerPotential
);
}
}
yd-api/src/main/java/com/yd/dal/service/
practitioner/impl/PractitionerSubordinate
DALServiceImpl.java
→
yd-api/src/main/java/com/yd/dal/service/
customer/impl/AclPractitionerSubordinateSystem
DALServiceImpl.java
View file @
36d734f4
package
com
.
yd
.
dal
.
service
.
practition
er
.
impl
;
package
com
.
yd
.
dal
.
service
.
custom
er
.
impl
;
import
com.yd.dal.entity.practitioner.PractitionerSubordinateInfo
;
import
com.yd.dal.mapper.practitioner.PractitionerSubordinateMapper
;
import
com.yd.dal.service.practitioner.PractitionerSubordinateDALService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
com.yd.dal.entity.customer.practitioner.PractitionerSubordinateInfo
;
import
com.yd.dal.mapper.customer.AclPractitionerSubordinateSystemMapper
;
import
com.yd.dal.service.customer.AclPractitionerSubordinateSystemDALService
;
import
org.springframework.stereotype.Service
;
@Service
(
"practitionerSubordinateDALService"
)
public
class
PractitionerSubordinateDALServiceImpl
implements
PractitionerSubordinateDALService
{
import
javax.annotation.Resource
;
@Autowired
private
PractitionerSubordinateMapper
practitionerSubordinateMapper
;
@Service
(
"aclPractitionerSubordinateSystemDALService"
)
public
class
AclPractitionerSubordinateSystemDALServiceImpl
implements
AclPractitionerSubordinateSystemDALService
{
@Resource
private
AclPractitionerSubordinateSystemMapper
aclPractitionerSubordinateSystemMapper
;
/**
* 根据体系ID获取体系相关信息
* @param subordinateId 体系ID
...
...
@@ -19,7 +20,7 @@ public class PractitionerSubordinateDALServiceImpl implements PractitionerSubord
public
PractitionerSubordinateInfo
findSubordinateInfo
(
Long
subordinateId
)
{
PractitionerSubordinateInfo
subordinateInfo
=
null
;
if
(
subordinateId
!=
null
){
subordinateInfo
=
practitionerSubordinate
Mapper
.
findSubordinateInfo
(
subordinateId
);
subordinateInfo
=
aclPractitionerSubordinateSystem
Mapper
.
findSubordinateInfo
(
subordinateId
);
}
return
subordinateInfo
;
}
...
...
yd-api/src/main/java/com/yd/dal/service/practitioner/PractitionerSubordinateDALService.java
deleted
100644 → 0
View file @
b3d10881
package
com
.
yd
.
dal
.
service
.
practitioner
;
import
com.yd.dal.entity.practitioner.PractitionerSubordinateInfo
;
import
org.springframework.stereotype.Service
;
@Service
(
"practitionerSubordinateDALService"
)
public
interface
PractitionerSubordinateDALService
{
PractitionerSubordinateInfo
findSubordinateInfo
(
Long
subordinateId
);
}
yd-api/src/main/java/com/yd/dal/service/tencent/Impl/TenInterfRecordDALServiceImpl.java
View file @
36d734f4
...
...
@@ -23,4 +23,14 @@ public class TenInterfRecordDALServiceImpl implements TenInterfRecordDALService
public
List
<
TenInterfRecord
>
findByTenInterfRecordOrderBy
(
TenInterfRecord
tencentInterfRecord
,
String
orderBy
)
{
return
tenInterfRecordMapper
.
findByTenInterfRecordOrderBy
(
tencentInterfRecord
,
orderBy
);
}
@Override
public
List
<
TenInterfRecord
>
findByAppIdAndGrantType
(
String
appId
,
String
grantType
)
{
return
tenInterfRecordMapper
.
findByAppIdAndGrantType
(
appId
,
grantType
,
"TOKEN"
);
}
@Override
public
List
<
TenInterfRecord
>
findByAccessTokenAndIType
(
String
accessToken
,
String
pType
)
{
return
tenInterfRecordMapper
.
findByAccessTokenAndIType
(
accessToken
,
pType
,
"TICKET"
);
}
}
yd-api/src/main/java/com/yd/dal/service/tencent/TenInterfRecordDALService.java
View file @
36d734f4
...
...
@@ -8,4 +8,8 @@ public interface TenInterfRecordDALService {
void
saveTenInterfRecord
(
TenInterfRecord
tencentInterfRecord
);
List
<
TenInterfRecord
>
findByTenInterfRecordOrderBy
(
TenInterfRecord
tencentInterfRecord
,
String
orderBy
);
List
<
TenInterfRecord
>
findByAppIdAndGrantType
(
String
appId
,
String
grantType
);
List
<
TenInterfRecord
>
findByAccessTokenAndIType
(
String
accessToken
,
String
pType
);
}
yd-api/src/main/java/com/yd/rmi/tencent/wechat/WechatController.java
View file @
36d734f4
package
com
.
yd
.
rmi
.
tencent
.
wechat
;
import
com.google.common.base.Strings
;
import
com.yd.api.result.JsonResult
;
import
com.yd.dal.entity.customer.AclCustomer
;
import
com.yd.dal.entity.customer.AclCustomerLog
;
import
com.yd.dal.service.customer.AclCustomerDALService
;
import
com.yd.dal.service.customer.AclCustomerLogDALService
;
import
com.yd.rmi.cache.SystemConfigService
;
import
com.yd.rmi.tencent.wechat.service.WechatService
;
import
com.yd.rmi.tencent.wechat.vo.accesstoken.AccessTokenByCodeRequest
;
import
com.yd.rmi.tencent.wechat.vo.accesstoken.AccessTokenByCodeResponse
;
import
com.yd.rmi.tencent.wechatinterf.pojo.ticket.TicketRequest
;
import
com.yd.rmi.tencent.wechatinterf.pojo.token.TokenRequest
;
import
com.yd.rmi.tencent.wechatinterf.pojo.wechatpay.WxConfigRequestVO
;
import
com.yd.rmi.tencent.wechatinterf.pojo.wechatpay.WxConfigResponseVO
;
import
com.yd.rmi.tencent.wechatinterf.service.WechatInterfService
;
import
com.yd.util.SpringContextUtil
;
import
com.yd.util.config.ZHBErrorConfig
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -15,9 +23,15 @@ import org.springframework.web.bind.annotation.CrossOrigin;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.servlet.ModelAndView
;
import
org.springframework.web.servlet.view.RedirectView
;
import
javax.servlet.ServletException
;
import
javax.servlet.http.HttpServletRequest
;
import
java.io.IOException
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLDecoder
;
import
java.util.List
;
import
java.util.Map
;
@Controller
...
...
@@ -27,6 +41,12 @@ public class WechatController {
private
WechatService
wechatService
;
@Autowired
private
SystemConfigService
systemConfigService
;
@Autowired
private
AclCustomerDALService
aclCustomerDALService
;
@Autowired
private
WechatInterfService
wechatInterfService
;
@Autowired
private
AclCustomerLogDALService
aclCustomerLogDALService
;
/**
* 微信分享时授权
* @param wxConfigRequestVO
...
...
@@ -58,4 +78,66 @@ public class WechatController {
result
.
setMessage
(
ZHBErrorConfig
.
getErrorInfo
(
"800000"
));
return
result
;
}
/**
* 获取用户的openID
* @param request
* @return
* @throws ServletException
* @throws IOException
*/
@RequestMapping
(
"/getOpenId"
)
@ResponseBody
public
Object
getOpenId
(
HttpServletRequest
request
)
{
String
code
=
request
.
getParameter
(
"code"
);
String
info
=
request
.
getParameter
(
"info"
);
System
.
out
.
println
(
">>>>>>code>>>>>>"
+
code
);
System
.
out
.
println
(
">>>>>>info>>>>>>"
+
info
);
String
jumpUrl
=
systemConfigService
.
getSingleConfigValue
(
"YdLifeIndex"
);
//https://mdev.zuihuibi.cn/ydLife/my
if
(!
Strings
.
isNullOrEmpty
(
code
)
&&
!
Strings
.
isNullOrEmpty
(
info
))
{
String
[]
infoArr
=
info
.
split
(
","
);
String
appId
=
infoArr
[
0
];
String
customerIdStr
=
infoArr
[
1
];
AccessTokenByCodeResponse
accessTokenByCodeResponse
=
getAccessTokenByCode
(
code
,
appId
);
if
(!
Strings
.
isNullOrEmpty
(
customerIdStr
)
&&
accessTokenByCodeResponse
!=
null
)
{
Long
customerId
=
Long
.
parseLong
(
customerIdStr
);
String
openId
=
accessTokenByCodeResponse
.
getOpenid
();
AclCustomer
customer
=
aclCustomerDALService
.
findById
(
customerId
);
customer
.
setYdWechatOpenid
(
openId
);
aclCustomerDALService
.
update
(
customer
);
List
<
AclCustomerLog
>
customerLogList
=
aclCustomerLogDALService
.
findLogInfoByCustomerId
(
customerId
);
int
logTimes
=
(
customerLogList
.
isEmpty
())
?
0
:
customerLogList
.
size
();
jumpUrl
=
(
logTimes
<
2
)
?
systemConfigService
.
getSingleConfigValue
(
"YdLifeThanksPage"
)
:
jumpUrl
;
}
}
return
new
ModelAndView
(
new
RedirectView
(
jumpUrl
));
}
private
AccessTokenByCodeResponse
getAccessTokenByCode
(
String
code
,
String
appId
)
{
AccessTokenByCodeResponse
accessTokenByCodeResponse
=
null
;
String
appIdZHB
=
systemConfigService
.
getSingleConfigValue
(
"TENCENT_WECHAT_APPID"
);
//最惠比公众账号id
String
appIdYD
=
systemConfigService
.
getSingleConfigValue
(
"YD-TENCENT_WECHAT_APPID"
);
//银盾公众账号id
String
appIdAJB
=
systemConfigService
.
getSingleConfigValue
(
"AJB-TENCENT_WECHAT_APPID"
);
//安吉保公众账号id
String
appIdYD2
=
systemConfigService
.
getSingleConfigValue
(
"YD2-TENCENT_WECHAT_MINIPRO_APPID"
);
//银盾公众账号id--小程序福利产品
String
secret
=
null
;
if
(
appId
.
equals
(
appIdYD
)){
//银盾
secret
=
systemConfigService
.
getSingleConfigValue
(
"YD-TENCENT_WECHAT_APP_SECRET"
);
//第三方用户唯一凭证密钥
}
else
if
(
appId
.
equals
(
appIdAJB
)){
//安吉保
secret
=
systemConfigService
.
getSingleConfigValue
(
"AJB-TENCENT_WECHAT_APP_SECRET"
);
//第三方用户唯一凭证密钥
}
else
if
(
appId
.
equals
(
appIdYD2
)){
//银盾2--福利产品支付
secret
=
systemConfigService
.
getSingleConfigValue
(
"YD2-TENCENT_WECHAT_APP_SECRET"
);
//第三方用户唯一凭证密钥
}
else
if
(
appId
.
equals
(
appIdZHB
)){
//最惠比--appid
secret
=
systemConfigService
.
getSingleConfigValue
(
"TENCENT_WECHAT_APP_SECRET"
);
//第三方用户唯一凭证密钥
}
if
(!
Strings
.
isNullOrEmpty
(
secret
)){
String
grantType
=
systemConfigService
.
getSingleConfigValue
(
"TENCENT_WECHAT_ACCESS_TOKEN_GRANT_TYPE"
);
AccessTokenByCodeRequest
accessTokenByCodeRequest
=
new
AccessTokenByCodeRequest
();
accessTokenByCodeRequest
.
setCode
(
code
);
accessTokenByCodeRequest
.
setAppid
(
appId
);
accessTokenByCodeRequest
.
setSecret
(
secret
);
accessTokenByCodeRequest
.
setGrant_type
(
grantType
);
accessTokenByCodeResponse
=
wechatInterfService
.
getAccessTokenByCode
(
accessTokenByCodeRequest
);
}
return
accessTokenByCodeResponse
;
}
}
yd-api/src/main/java/com/yd/rmi/tencent/wechat/service/WechatService.java
View file @
36d734f4
package
com
.
yd
.
rmi
.
tencent
.
wechat
.
service
;
import
com.yd.rmi.tencent.wechat.vo.WeChatInfoByENV
;
import
com.yd.rmi.tencent.wechat.vo.WxNATIVEPayQueryReqVO
;
import
com.yd.rmi.tencent.wechat.vo.WxNATIVEPayQueryRespVO
;
import
com.yd.rmi.tencent.wechat.vo.WxUserInfo
;
import
com.yd.rmi.tencent.wechatinterf.pojo.accesstoken.AccessTokenRequest
;
import
com.yd.rmi.tencent.wechatinterf.pojo.accesstoken.AccessTokenResponse
;
import
com.yd.rmi.tencent.wechatinterf.pojo.ticket.TicketRequest
;
import
com.yd.rmi.tencent.wechatinterf.pojo.token.TokenRequest
;
...
...
@@ -11,6 +13,15 @@ import com.yd.rmi.tencent.wechatinterf.pojo.unifiedorder.UnifiedorderResponse;
import
java.util.Map
;
public
interface
WechatService
{
/**
* 微信接口交互 -- access_token
* access_token是公众号的全局唯一接口调用凭据,公众号调用各接口时都需使用access_token。
* 注意这和网页授权部分的access_token不是一回事!该接口有调用次数限制,且独立(不依赖于authorize接口)
* @param accessTokenRequest
* @return
*/
String
getAccessToken
(
AccessTokenRequest
accessTokenRequest
);
public
String
obtainToken
(
TokenRequest
tokenRequest
);
public
String
obtainTicket
(
TicketRequest
ticketRequest
);
public
UnifiedorderResponse
unifiedorder
(
String
appId
,
String
openId
,
String
wCpayMethod
,
String
timeExpire
,
String
mchId
,
Double
orderPrice
,
String
planName
,
String
orderNo
,
String
notifyUrl
);
...
...
@@ -69,4 +80,13 @@ public interface WechatService {
*/
public
WxUserInfo
getWxUserInfo
(
String
openId
,
String
accessToken
);
/**
* 通过环境来获取公众号的access_token
* 在正式环境有两个公众号,银盾保险在线--YDZX 银盾保险经纪--YDBJ
* 测试环境只有一个公众号
* @param gzhName 在正式环境有两个公众号,银盾保险在线--YDZX 银盾保险经纪--YDBJ
* @return
*/
WeChatInfoByENV
getWeChatInfoByENV
(
String
gzhName
,
boolean
getAccessToken
);
}
yd-api/src/main/java/com/yd/rmi/tencent/wechat/service/impl/WechatServiceImpl.java
View file @
36d734f4
package
com
.
yd
.
rmi
.
tencent
.
wechat
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.common.base.Strings
;
import
com.yd.api.result.CommonResult
;
import
com.yd.rmi.cache.SystemConfigService
;
import
com.yd.dal.entity.tencent.TenInterfRecord
;
...
...
@@ -7,9 +10,11 @@ import com.yd.dal.entity.transaction.TranLog;
import
com.yd.dal.service.tencent.TenInterfRecordDALService
;
import
com.yd.dal.service.transaction.TranLogDALService
;
import
com.yd.rmi.tencent.wechat.service.WechatService
;
import
com.yd.rmi.tencent.wechat.vo.WeChatInfoByENV
;
import
com.yd.rmi.tencent.wechat.vo.WxNATIVEPayQueryReqVO
;
import
com.yd.rmi.tencent.wechat.vo.WxNATIVEPayQueryRespVO
;
import
com.yd.rmi.tencent.wechat.vo.WxUserInfo
;
import
com.yd.rmi.tencent.wechatinterf.pojo.accesstoken.AccessTokenRequest
;
import
com.yd.rmi.tencent.wechatinterf.pojo.accesstoken.AccessTokenResponse
;
import
com.yd.rmi.tencent.wechatinterf.pojo.ticket.TicketRequest
;
import
com.yd.rmi.tencent.wechatinterf.pojo.ticket.TicketResponse
;
...
...
@@ -571,6 +576,142 @@ public class WechatServiceImpl implements WechatService {
}
@Override
public
WeChatInfoByENV
getWeChatInfoByENV
(
String
gzhName
,
boolean
getAccessToken
)
{
WeChatInfoByENV
weChatInfoByENV
=
new
WeChatInfoByENV
();
boolean
isProd
=
SpringContextUtil
.
isProd
();
boolean
isLocal
=
SpringContextUtil
.
isLocal
();
String
appId
,
secret
,
accessToken
;
String
grantType
=
systemConfigService
.
getSingleConfigValue
(
"TENCENT_WECHAT_TOKEN_GRANT_TYPE"
);
//根据不同环境和不同公众号获取公众号的appId和secret
if
(
"YDBJ"
.
equals
(
gzhName
)){
appId
=
systemConfigService
.
getSingleConfigValue
(
"YD-TENCENT_WECHAT_APPID"
);
secret
=
systemConfigService
.
getSingleConfigValue
(
"YD-TENCENT_WECHAT_APP_SECRET"
);
}
else
{
if
(
isProd
){
appId
=
systemConfigService
.
getSingleConfigValue
(
"TENCENT_WECHAT_APPID"
);
secret
=
systemConfigService
.
getSingleConfigValue
(
"TENCENT_WECHAT_APP_SECRET"
);
}
else
{
appId
=
systemConfigService
.
getSingleConfigValue
(
"AJB-TENCENT_WECHAT_APPID"
);
secret
=
systemConfigService
.
getSingleConfigValue
(
"AJB-TENCENT_WECHAT_APP_SECRET"
);
}
}
// if(isProd){
// if("YDBJ".equals(gzhName)){
// appId = systemConfigService.getSingleConfigValue("YD-TENCENT_WECHAT_APPID");
// secret = systemConfigService.getSingleConfigValue("YD-TENCENT_WECHAT_APP_SECRET");
// }else{
// appId = systemConfigService.getSingleConfigValue("TENCENT_WECHAT_APPID");
// secret = systemConfigService.getSingleConfigValue("TENCENT_WECHAT_APP_SECRET");
// }
// }else{
// appId = systemConfigService.getSingleConfigValue("AJB-TENCENT_WECHAT_APPID");
// secret = systemConfigService.getSingleConfigValue("AJB-TENCENT_WECHAT_APP_SECRET");
// }
if
(
getAccessToken
){
AccessTokenRequest
accessTokenRequest
=
new
AccessTokenRequest
();
accessTokenRequest
.
setAppid
(
appId
);
accessTokenRequest
.
setSecret
(
secret
);
accessTokenRequest
.
setGrant_type
(
grantType
);
//本地环境需要通过dev环境去获取
accessToken
=
isLocal
?
getAccessTokenByDEV
(
accessTokenRequest
)
:
getAccessToken
(
accessTokenRequest
);
weChatInfoByENV
.
setAccessToken
(
accessToken
);
}
weChatInfoByENV
.
setAppId
(
appId
);
weChatInfoByENV
.
setSecret
(
secret
);
return
weChatInfoByENV
;
}
/**
* 在本地开发时,通过dev去获取access_token
* @param accessTokenRequest
* @return
*/
private
String
getAccessTokenByDEV
(
AccessTokenRequest
accessTokenRequest
)
{
String
requestJson
=
JsonUtil
.
objToJson
(
accessTokenRequest
);
String
responseJson
=
HttpUtil
.
postForJson
(
"https://mdev.zuihuibi.cn/api/getAccessToken"
,
requestJson
);
JSONObject
result
=
JSON
.
parseObject
(
responseJson
);
return
result
.
getString
(
"data"
);
}
@Override
public
String
getAccessToken
(
AccessTokenRequest
accessTokenRequest
)
{
refactorRequest
(
accessTokenRequest
);
String
grantType
=
accessTokenRequest
.
getGrant_type
();
String
appId
=
accessTokenRequest
.
getAppid
();
String
secret
=
accessTokenRequest
.
getSecret
();
//1、查询数据库是否存在
String
accessToken
=
getAccessTokenOrTicketByDB
(
grantType
,
appId
,
secret
,
null
,
null
,
"TOKEN"
);
//2、如果不存在则重新生成
if
(
Strings
.
isNullOrEmpty
(
accessToken
)){
AccessTokenResponse
accessTokenResponse
=
wechatInterfService
.
getAccessToken
(
accessTokenRequest
);
accessToken
=
accessTokenResponse
.
getAccess_token
();
//保存数据进数据库
String
expiresInStr
=
accessTokenResponse
.
getExpires_in
();
Long
expiresIn
=
Strings
.
isNullOrEmpty
(
expiresInStr
)
?
null
:
Long
.
parseLong
(
expiresInStr
);
TenInterfRecord
tenCentRecord
=
new
TenInterfRecord
();
tenCentRecord
.
setInterfType
(
"TOKEN"
);
tenCentRecord
.
setGrantType
(
grantType
);
tenCentRecord
.
setAppid
(
appId
);
tenCentRecord
.
setSecret
(
secret
);
tenCentRecord
.
setAccessToken
(
accessToken
);
tenCentRecord
.
setExpiresIn
(
expiresIn
);
tenCentRecord
.
setErrcode
(
accessTokenResponse
.
getErrcode
());
tenCentRecord
.
setErrmsg
(
accessTokenResponse
.
getErrmsg
());
tenCentRecord
.
setCreatedAt
(
new
Date
());
tenInterfRecordDALService
.
saveTenInterfRecord
(
tenCentRecord
);
}
return
accessToken
;
}
private
void
refactorRequest
(
AccessTokenRequest
accessTokenRequest
)
{
String
appId
=
accessTokenRequest
.
getAppid
();
String
secret
=
accessTokenRequest
.
getSecret
();
if
(
Strings
.
isNullOrEmpty
(
appId
)
||
Strings
.
isNullOrEmpty
(
secret
))
{
appId
=
systemConfigService
.
getSingleConfigValue
(
"TENCENT_WECHAT_APPID"
);
secret
=
systemConfigService
.
getSingleConfigValue
(
"TENCENT_WECHAT_APP_SECRET"
);
String
grantType
=
systemConfigService
.
getSingleConfigValue
(
"TENCENT_WECHAT_TOKEN_GRANT_TYPE"
);
accessTokenRequest
.
setAppid
(
appId
);
accessTokenRequest
.
setGrant_type
(
grantType
);
accessTokenRequest
.
setSecret
(
secret
);
}
}
/**
* 获取获取access_token或者ticket时 查询数据库是否存在相关记录
* @param grantType
* @param appId
* @param secret
* @param pType
* @param accessToken
* @param type "TOKEN":获取access_token TICKET:获取ticket
* @return
*/
private
String
getAccessTokenOrTicketByDB
(
String
grantType
,
String
appId
,
String
secret
,
String
pType
,
String
accessToken
,
String
type
)
{
String
result
=
null
;
TenInterfRecord
tenCentRecord
=
new
TenInterfRecord
();
tenCentRecord
.
setInterfType
(
type
);
List
<
TenInterfRecord
>
tenCentInterfaceRecordList
=
null
;
/** 查询最近一天(24H)内 有效期(expires_in)不为空的数据(倒序) **/
if
(
"TOKEN"
.
equals
(
type
)){
tenCentInterfaceRecordList
=
tenInterfRecordDALService
.
findByAppIdAndGrantType
(
appId
,
grantType
);
}
else
if
(
"TICKET"
.
equals
(
type
)){
tenCentInterfaceRecordList
=
tenInterfRecordDALService
.
findByAccessTokenAndIType
(
accessToken
,
pType
);
}
if
(
tenCentInterfaceRecordList
!=
null
&&
tenCentInterfaceRecordList
.
size
()
>
0
){
tenCentRecord
=
tenCentInterfaceRecordList
.
get
(
0
);
Long
expiresIn
=
tenCentRecord
.
getExpiresIn
();
Date
createAt
=
tenCentRecord
.
getCreatedAt
();
if
(
expiresIn
!=
null
){
Date
overdueDate
=
CommonUtil
.
dateOperation
(
createAt
,
"ADD"
,
"S"
,
expiresIn
.
intValue
());
if
(
new
Date
().
compareTo
(
overdueDate
)
<
0
){
result
=
(
"TOKEN"
.
equals
(
type
))
?
tenCentRecord
.
getAccessToken
()
:
(
"TICKET"
.
equals
(
type
))
?
tenCentRecord
.
getTicket
()
:
null
;
}
}
}
return
result
;
}
@Override
public
Map
<
String
,
String
>
jsapiTicketSign
(
String
jsapiTicket
,
String
url
)
{
Map
<
String
,
String
>
ret
=
new
HashMap
<
String
,
String
>();
String
nonceStr
=
createNonceStr
();
...
...
@@ -613,6 +754,11 @@ public class WechatServiceImpl implements WechatService {
return
Long
.
toString
(
System
.
currentTimeMillis
()
/
1000
);
}
// private String transaction(String httpURL,String requestXML,String requestMethod){
// HttpsURLConnection conn = null;
// OutputStream out = null;
...
...
yd-api/src/main/java/com/yd/rmi/tencent/wechat/vo/WeChatInfoByENV.java
0 → 100644
View file @
36d734f4
package
com
.
yd
.
rmi
.
tencent
.
wechat
.
vo
;
public
class
WeChatInfoByENV
{
private
String
appId
;
private
String
secret
;
private
String
accessToken
;
public
String
getAppId
()
{
return
appId
;
}
public
void
setAppId
(
String
appId
)
{
this
.
appId
=
appId
;
}
public
String
getSecret
()
{
return
secret
;
}
public
void
setSecret
(
String
secret
)
{
this
.
secret
=
secret
;
}
public
String
getAccessToken
()
{
return
accessToken
;
}
public
void
setAccessToken
(
String
accessToken
)
{
this
.
accessToken
=
accessToken
;
}
}
yd-api/src/main/java/com/yd/rmi/tencent/wechat/vo/accesstoken/AccessTokenByCodeRequest.java
0 → 100644
View file @
36d734f4
package
com
.
yd
.
rmi
.
tencent
.
wechat
.
vo
.
accesstoken
;
/**
* https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1419318590&token=&lang=zh_CN
* 代公众号发起网页授权
简介
在公众号授权托管给第三方平台后,第三方平台可以根据本文档相关说明,代替授权公众号发起网页授权。关于OAuth2.0的详细介绍,可以参考OAuth2.0协议标准
作为第三方平台开发商,需要拥有自己的appid以及secret(在创建第三方平台并获得审核成功后可以获取),以及确保授权的公众号具备授权作用域的权限,以及用于回调的域名。
授权流程
微信目前支持Authorization code授权模式,主要流程分为两步:
1. 获取code
2. 通过code换取accesstoken
*
*/
public
class
AccessTokenByCodeRequest
{
/*
!!! 开放平台的文档中对于这个接口的描述和公众平台有差异!下面是开放平台中截取的(在公众平台中入参没有component_appid和component_access_token,有secret)
第二步:通过code换取access_token
请求方法
获取第一步的code后,请求以下链接获取access_token:
https://api.weixin.qq.com/sns/oauth2/component/access_token?appid=APPID&code=CODE&grant_type=authorization_code&component_appid=COMPONENT_APPID&component_access_token=COMPONENT_ACCESS_TOKEN
需要注意的是,由于安全方面的考虑,对访问该链接的客户端有IP白名单的要求。
参数说明
参数 是否必须 说明
appid 是 公众号的appid
code 是 填写第一步获取的code参数
grant_type 是 填authorization_code
component_appid 是 服务开发方的appid
component_access_token 是 服务开发方的access_token
返回说明
正确的返回:
{
"access_token":"ACCESS_TOKEN",
"expires_in":7200,
"refresh_token":"REFRESH_TOKEN",
"openid":"OPENID",
"scope":"SCOPE"
}
参数 说明
access_token 接口调用凭证
expires_in access_token接口调用凭证超时时间,单位(秒)
refresh_token 用户刷新access_token
openid 授权用户唯一标识
scope 用户授权的作用域,使用逗号(,)分隔
错误返回样例:
{"errcode":40029,"errmsg":"invalid code"}
*/
private
String
appid
;
private
String
secret
;
private
String
code
;
private
String
grant_type
;
private
String
component_appid
;
private
String
component_access_token
;
public
String
getAppid
()
{
return
appid
;
}
public
void
setAppid
(
String
appid
)
{
this
.
appid
=
appid
;
}
public
String
getSecret
()
{
return
secret
;
}
public
void
setSecret
(
String
secret
)
{
this
.
secret
=
secret
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
String
getGrant_type
()
{
return
grant_type
;
}
public
void
setGrant_type
(
String
grant_type
)
{
this
.
grant_type
=
grant_type
;
}
public
String
getComponent_appid
()
{
return
component_appid
;
}
public
void
setComponent_appid
(
String
component_appid
)
{
this
.
component_appid
=
component_appid
;
}
public
String
getComponent_access_token
()
{
return
component_access_token
;
}
public
void
setComponent_access_token
(
String
component_access_token
)
{
this
.
component_access_token
=
component_access_token
;
}
}
\ No newline at end of file
yd-api/src/main/java/com/yd/rmi/tencent/wechat/vo/accesstoken/AccessTokenByCodeResponse.java
0 → 100644
View file @
36d734f4
package
com
.
yd
.
rmi
.
tencent
.
wechat
.
vo
.
accesstoken
;
public
class
AccessTokenByCodeResponse
{
// {
// "access_token":"ACCESS_TOKEN",
// "expires_in":7200,
// "refresh_token":"REFRESH_TOKEN",
// "openid":"OPENID",
// "scope":"SCOPE",
// "unionid":"o6_bmasdasdsad6_2sgVt7hMZOPfL"
// }
private
String
access_token
;
private
String
expires_in
;
private
String
refresh_token
;
private
String
openid
;
private
String
scope
;
private
String
unionid
;
private
String
errcode
;
private
String
errmsg
;
public
String
getAccess_token
()
{
return
access_token
;
}
public
void
setAccess_token
(
String
access_token
)
{
this
.
access_token
=
access_token
;
}
public
String
getExpires_in
()
{
return
expires_in
;
}
public
void
setExpires_in
(
String
expires_in
)
{
this
.
expires_in
=
expires_in
;
}
public
String
getRefresh_token
()
{
return
refresh_token
;
}
public
void
setRefresh_token
(
String
refresh_token
)
{
this
.
refresh_token
=
refresh_token
;
}
public
String
getOpenid
()
{
return
openid
;
}
public
void
setOpenid
(
String
openid
)
{
this
.
openid
=
openid
;
}
public
String
getScope
()
{
return
scope
;
}
public
void
setScope
(
String
scope
)
{
this
.
scope
=
scope
;
}
public
String
getUnionid
()
{
return
unionid
;
}
public
void
setUnionid
(
String
unionid
)
{
this
.
unionid
=
unionid
;
}
public
String
getErrcode
()
{
return
errcode
;
}
public
void
setErrcode
(
String
errcode
)
{
this
.
errcode
=
errcode
;
}
public
String
getErrmsg
()
{
return
errmsg
;
}
public
void
setErrmsg
(
String
errmsg
)
{
this
.
errmsg
=
errmsg
;
}
}
yd-api/src/main/java/com/yd/rmi/tencent/wechatinterf/service/WechatInterfService.java
View file @
36d734f4
package
com
.
yd
.
rmi
.
tencent
.
wechatinterf
.
service
;
import
com.yd.rmi.tencent.wechat.vo.accesstoken.AccessTokenByCodeRequest
;
import
com.yd.rmi.tencent.wechat.vo.accesstoken.AccessTokenByCodeResponse
;
import
com.yd.rmi.tencent.wechatinterf.pojo.accesstoken.AccessTokenRequest
;
import
com.yd.rmi.tencent.wechatinterf.pojo.accesstoken.AccessTokenResponse
;
import
com.yd.rmi.tencent.wechatinterf.pojo.authorize.AuthorizeRequest
;
...
...
@@ -63,4 +65,29 @@ public interface WechatInterfService {
public
String
transaction
(
String
url
,
String
object
,
String
object2
);
/**
* 微信接口交互 -- 获取access_token
* 获取公众号的access_token
* 注意这和网页授权部分的access_token不是一回事!该接口有调用次数限制,且独立(不依赖于authorize接口)
* @param accessTokenRequest
* @return
*/
AccessTokenResponse
getAccessToken
(
AccessTokenRequest
accessTokenRequest
);
/**
* 微信交互接口
* @param url 交互地址
* @param requestInfo 请求报文
* @return
*/
String
weChatTransaction
(
String
url
,
String
requestInfo
);
/**
* 公众号支付时网页授权 -- 通过code获取accessToken
* 这里返回值包含openid
* @param accessTokenByCodeRequest
* @return
*/
AccessTokenByCodeResponse
getAccessTokenByCode
(
AccessTokenByCodeRequest
accessTokenByCodeRequest
);
}
yd-api/src/main/java/com/yd/rmi/tencent/wechatinterf/service/impl/WechatInterfServiceImpl.java
View file @
36d734f4
...
...
@@ -2,6 +2,8 @@ package com.yd.rmi.tencent.wechatinterf.service.impl;
import
com.yd.rmi.cache.SystemConfigService
;
import
com.yd.dal.service.transaction.TranLogDALService
;
import
com.yd.rmi.tencent.wechat.vo.accesstoken.AccessTokenByCodeRequest
;
import
com.yd.rmi.tencent.wechat.vo.accesstoken.AccessTokenByCodeResponse
;
import
com.yd.rmi.tencent.wechatinterf.pojo.accesstoken.AccessTokenRequest
;
import
com.yd.rmi.tencent.wechatinterf.pojo.accesstoken.AccessTokenResponse
;
import
com.yd.rmi.tencent.wechatinterf.pojo.authorize.AuthorizeRequest
;
...
...
@@ -26,6 +28,7 @@ import javax.net.ssl.SSLSession;
import
java.io.*
;
import
java.net.URL
;
import
java.net.URLEncoder
;
import
java.nio.charset.StandardCharsets
;
import
java.util.*
;
import
java.util.Map.Entry
;
...
...
@@ -325,4 +328,142 @@ public class WechatInterfServiceImpl implements WechatInterfService {
}
return
sbf
.
toString
();
}
/**
* 获取access_token:access_token是公众号的全局唯一接口调用凭据,公众号调用各接口时都需使用access_token
*/
@Override
public
AccessTokenResponse
getAccessToken
(
AccessTokenRequest
accessTokenRequest
)
{
String
appId
=
accessTokenRequest
.
getAppid
();
String
grantType
=
accessTokenRequest
.
getGrant_type
();
String
secret
=
accessTokenRequest
.
getSecret
();
String
url
=
systemConfigService
.
getSingleConfigValue
(
"TENCENT_WECHAT_TOKEN_URL"
)+
"?"
+
"grant_type="
+
grantType
+
"&appid="
+
appId
+
"&secret="
+
secret
;
System
.
out
.
println
(
"【》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》【微信分享 --4--token-url】"
+
url
+
"】"
);
tranLogDALService
.
logDB
(
"wechat"
,
"accessToken"
,
"in"
,
accessTokenRequest
.
getAppid
(),
url
,
null
,
null
);
String
responseStr
=
weChatTransaction
(
url
,
null
);
tranLogDALService
.
logDB
(
"wechat"
,
"accessToken"
,
"out"
,
accessTokenRequest
.
getAppid
(),
responseStr
,
null
,
null
);
return
(
AccessTokenResponse
)
JsonUtil
.
jsonToObj
(
responseStr
,
AccessTokenResponse
.
class
);
}
/**
* 通过code换取accessToken,公众号支付时网页授权,这里返回值有openid
*/
@Override
public
AccessTokenByCodeResponse
getAccessTokenByCode
(
AccessTokenByCodeRequest
accessTokenByCodeRequest
)
{
String
appId
=
accessTokenByCodeRequest
.
getAppid
();
String
secret
=
accessTokenByCodeRequest
.
getSecret
();
String
grantType
=
accessTokenByCodeRequest
.
getGrant_type
();
String
url
=
systemConfigService
.
getSingleConfigValue
(
"TENCENT_WECHAT_ACCESS_TOKEN_URL"
)+
"?"
+
"appid="
+
appId
+
"&secret="
+
secret
+
"&code="
+
accessTokenByCodeRequest
.
getCode
()
+
"&grant_type="
+
grantType
;
tranLogDALService
.
logDB
(
"wechat"
,
"accessTokenByCode"
,
"in"
,
accessTokenByCodeRequest
.
getCode
(),
url
,
null
,
null
);
String
responseStr
=
weChatTransaction
(
url
,
null
);
tranLogDALService
.
logDB
(
"wechat"
,
"accessTokenByCode"
,
"out"
,
accessTokenByCodeRequest
.
getCode
(),
responseStr
,
null
,
null
);
return
(
AccessTokenByCodeResponse
)
JsonUtil
.
jsonToObj
(
responseStr
,
AccessTokenByCodeResponse
.
class
);
}
/**
* 微信接口交互
*/
@Override
public
String
weChatTransaction
(
String
httpURL
,
String
requestXML
){
String
responseXML
;
OutputStream
output
=
null
;
InputStream
input
=
null
;
try
{
URL
url
=
new
URL
(
httpURL
);
HttpsURLConnection
connection
=
(
HttpsURLConnection
)
url
.
openConnection
();
connection
.
setReadTimeout
(
30000
);
connection
.
setDoInput
(
true
);
connection
.
setDoOutput
(
true
);
connection
.
setAllowUserInteraction
(
true
);
connection
.
setRequestProperty
(
"Accept-Charset"
,
"utf-8"
);
connection
.
setRequestProperty
(
"contentType"
,
"utf-8"
);
connection
.
setHostnameVerifier
(
new
HostnameVerifier
()
{
@Override
public
boolean
verify
(
String
hostname
,
SSLSession
session
)
{
return
true
;
}
});
connection
.
connect
();
if
(
requestXML
!=
null
&&
!
""
.
equals
(
requestXML
))
{
output
=
connection
.
getOutputStream
();
output
.
write
(
requestXML
.
getBytes
(
StandardCharsets
.
UTF_8
));
}
input
=
connection
.
getInputStream
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
try
{
if
(
output
!=
null
)
{
output
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
StringBuilder
stringBuffer
=
new
StringBuilder
();
if
(
input
!=
null
)
{
try
{
BufferedReader
reader
=
new
BufferedReader
(
new
InputStreamReader
(
input
,
StandardCharsets
.
UTF_8
));
String
string
;
while
((
string
=
reader
.
readLine
())
!=
null
)
{
stringBuffer
.
append
(
string
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
responseXML
=
stringBuffer
.
toString
();
return
responseXML
;
/*
InputStream in = null;
String responseXML = null;
try {
URL url = new URL(httpURL);
StringBuilder sbf = new StringBuilder();
HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
conn.setReadTimeout(30000);
conn.setDoInput(true);
conn.setDoOutput(true);
conn.setAllowUserInteraction(true);
conn.setRequestProperty("Accept-Charset", "utf-8");
conn.setRequestProperty("contentType", "utf-8");
conn.setHostnameVerifier((arg0, arg1) -> true);
conn.connect();
in = conn.getInputStream();
if(in != null){
BufferedReader reader = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8));
String str;
while((str = reader.readLine()) != null){
sbf.append(str);
}
responseXML = sbf.toString();
}
} catch (Exception e) {
e.printStackTrace();
}finally{
try {
if(in != null){in.close();}
} catch (Exception e3) {
e3.printStackTrace();
}
}
return responseXML;
*/
}
}
\ No newline at end of file
yd-api/src/main/java/com/yd/util/HttpUtil.java
View file @
36d734f4
package
com
.
yd
.
util
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.HttpResponse
;
import
org.apache.http.client.methods.HttpPost
;
import
org.apache.http.entity.StringEntity
;
import
org.apache.http.impl.client.CloseableHttpClient
;
import
org.apache.http.impl.client.HttpClients
;
import
org.apache.http.util.EntityUtils
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.net.HttpURLConnection
;
...
...
@@ -8,6 +16,8 @@ import java.util.HashMap;
import
java.util.Map
;
public
class
HttpUtil
{
public
static
String
defaultEncoding
=
"utf-8"
;
/**
* 通过url取得文件返回InputStream类型数据
*
...
...
@@ -35,4 +45,30 @@ public class HttpUtil {
return
resp
;
}
}
/**
* http交互方法---post请求 json类型
* @param url 地址
* @param json json字符串
* @return
*/
public
static
String
postForJson
(
String
url
,
String
json
)
{
String
responseJson
=
null
;
HttpPost
httpPost
=
new
HttpPost
(
url
);
CloseableHttpClient
client
=
HttpClients
.
createDefault
();
StringEntity
entity
=
new
StringEntity
(
json
,
defaultEncoding
);
entity
.
setContentEncoding
(
defaultEncoding
);
entity
.
setContentType
(
"application/json"
);
httpPost
.
setEntity
(
entity
);
try
{
HttpResponse
response
=
client
.
execute
(
httpPost
);
if
(
response
.
getStatusLine
().
getStatusCode
()
==
200
){
HttpEntity
httpEntity
=
response
.
getEntity
();
responseJson
=
EntityUtils
.
toString
(
httpEntity
,
defaultEncoding
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
responseJson
;
}
}
yd-api/src/main/resources/i18n/messages_zh_CN.properties
View file @
36d734f4
...
...
@@ -3,7 +3,11 @@
600000
=
参数检验成功!
610001
=
入参中[{0}]不能为空!
610002
=
入参中[{0}]不能同时为空!
##用户信息校验
630001
=
用户的手机号码[{0}]格式不正确!
630002
=
手机号[{0}]已被注册,请勿重复注册!
######################用户提示信息########################
800000
=
执行成功!
##系统提示信息
810001
=
token无效或者错误!
...
...
@@ -17,5 +21,7 @@
830007
=
上传头像失败,请重新上传!
830008
=
上传生活照失败,请重新上传!
830009
=
上传微信二维码失败,请重新上传!
830010
=
该用户已经注册为银盾经纪人
830011
=
该增员已存在!
900003
=
保险公司响应报文为空!
\ No newline at end of file
yd-api/src/main/resources/mapper/customer/AclCustomerMapper.xml
View file @
36d734f4
...
...
@@ -726,4 +726,10 @@
age = #{age,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
<select
id=
"findByLogin"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from ag_acl_customer
where login = #{mobileNo,jdbcType=VARCHAR}
</select>
</mapper>
\ No newline at end of file
yd-api/src/main/resources/mapper/
practition
er/AclPractitionerMapper.xml
→
yd-api/src/main/resources/mapper/
custom
er/AclPractitionerMapper.xml
View file @
36d734f4
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yd.dal.mapper.
practition
er.AclPractitionerMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.yd.dal.entity.
practitioner.AclPractitionerInfo
"
>
<mapper
namespace=
"com.yd.dal.mapper.
custom
er.AclPractitionerMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.yd.dal.entity.
customer.AclPractitioner
"
>
<id
column=
"id"
jdbcType=
"BIGINT"
property=
"id"
/>
<result
column=
"insurer_id"
jdbcType=
"BIGINT"
property=
"insurerId"
/>
<result
column=
"insurer_branch_id"
jdbcType=
"BIGINT"
property=
"insurerBranchId"
/>
...
...
@@ -60,7 +60,7 @@
delete from ag_acl_practitioner
where id = #{id,jdbcType=BIGINT}
</delete>
<insert
id=
"insert"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.yd.dal.entity.
practitioner.AclPractitionerInfo
"
useGeneratedKeys=
"true"
>
<insert
id=
"insert"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.yd.dal.entity.
customer.AclPractitioner
"
useGeneratedKeys=
"true"
>
insert into ag_acl_practitioner (insurer_id, insurer_branch_id, dept_id,
subordinate_system_id, practitioner_code, `name`,
mobile_no, id_type_id, id_type,
...
...
@@ -90,7 +90,7 @@
#{mentorId,jdbcType=BIGINT}, #{introducerId,jdbcType=BIGINT}, #{gender,jdbcType=INTEGER}
)
</insert>
<insert
id=
"insertSelective"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.yd.dal.entity.
practitioner.AclPractitionerInfo
"
useGeneratedKeys=
"true"
>
<insert
id=
"insertSelective"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.yd.dal.entity.
customer.AclPractitioner
"
useGeneratedKeys=
"true"
>
insert into ag_acl_practitioner
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"insurerId != null"
>
...
...
@@ -325,7 +325,7 @@
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.yd.dal.entity.
practitioner.AclPractitionerInfo
"
>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.yd.dal.entity.
customer.AclPractitioner
"
>
update ag_acl_practitioner
<set>
<if
test=
"insurerId != null"
>
...
...
@@ -445,7 +445,7 @@
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.yd.dal.entity.
practitioner.AclPractitionerInfo
"
>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.yd.dal.entity.
customer.AclPractitioner
"
>
update ag_acl_practitioner
set insurer_id = #{insurerId,jdbcType=BIGINT},
insurer_branch_id = #{insurerBranchId,jdbcType=BIGINT},
...
...
@@ -487,4 +487,222 @@
gender = #{gender,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
<resultMap
id=
"base_result_map_practitioner_info"
type=
"com.yd.dal.entity.customer.practitioner.PractitionerBasicInfo"
>
<result
column=
"customerId"
property=
"customerId"
/>
<result
column=
"practitionerIdForOnline"
property=
"practitionerIdForOnline"
/>
<result
column=
"practitionerId"
property=
"practitionerId"
/>
<result
column=
"name"
property=
"name"
/>
<result
column=
"titleCode"
property=
"titleCode"
/>
<!-- <result column="mobile_no" property="titleCode" typeHandler="com.yd.util.deshandler.DESTypeHandler"/>-->
<result
column=
"titleName"
property=
"titleName"
/>
<result
column=
"gender"
property=
"gender"
/>
</resultMap>
<select
id=
"getPractitionerInfoByMobileNoForOffline"
resultMap=
"base_result_map_practitioner_info"
>
SELECT
p.SAL_MST_ID as practitionerId,
p.SAL_MST_NAME as name,
p.SAL_MST_GENDER as gender,
md.DRP_TITLE_LEVEL as titleCode,
md.DRP_TITLE_NAME as titleName
FROM sal001 p left join DRP003 md on md.DRP_TITLE_CODE = p.FK_DRP_TITLE_CODE
where p.SAL_MST_MOBILE = #{mobileNo}
</select>
<select
id=
"getPractitionerInfoByMobileNoForOnline"
resultMap=
"base_result_map_practitioner_info"
>
select
p.customer_id as customerId,
p.id as practitionerIdForOnline,
p.name as name,
o.drop_option_code as titleCode,
o.drop_option_name as titleName,
p.gender as gender
from ag_acl_customer c inner join ag_acl_practitioner p on c.id = p.customer_id
left join ag_acl_insurer_branch b on p.insurer_branch_id = b.id
left join ag_acl_practitioner_setting s on p.id = s.practitioner_id
inner join ag_md_drop_options o on s.practitioner_level = o.id
where c.login = #{mobileNo};
</select>
<resultMap
id=
"practitioner_rank_map"
type=
"com.yd.dal.entity.customer.practitioner.PractitionerRankInfo"
>
<result
column=
"customerId"
property=
"customerId"
/>
<result
column=
"practitionerIdForOnLine"
property=
"practitionerIdForOnLine"
/>
<result
column=
"practitionerId"
property=
"practitionerId"
/>
<result
column=
"name"
property=
"name"
/>
<result
column=
"titleCode"
property=
"titleCode"
/>
<result
column=
"titleName"
property=
"titleName"
/>
<result
column=
"count"
property=
"count"
/>
<result
column=
"fyp"
property=
"fyp"
/>
<result
column=
"fyc"
property=
"fyc"
/>
</resultMap>
<select
id=
"getPractitionerRankInfoForOffline"
resultMap=
"practitioner_rank_map"
resultType=
"java.lang.Integer"
>
SELECT
p.SAL_MST_ID as practitionerId ,
p.SAL_MST_NAME as name ,-- 姓名
md.DRP_TITLE_LEVEL as titleCode,-- 职称code
md.DRP_TITLE_NAME as titleName,-- 职称名称
spc.SPC_DIV_NAME as spcDivName,-- 体系id
count(m.MON025_002) as count,-- 保单id
sum(m.MON025_401) as fyp,-- 保费
sum(m.MON025_405) as fyc -- 应发佣金
FROM MON025 m INNER JOIN sal001 p on m.MON025_007 = p.SAL_MST_ID -- 业务员id
left join DRP003 md on p.FK_DRP_TITLE_CODE = md.DRP_TITLE_CODE
inner JOIN ins001 policy on m.MON025_002 = policy.INS_MST_ID -- 保单id
inner join spc004 spc on m.MON025_006 = spc.SPC_DIV_ID -- 体系
WHERE m.MON025_109 IN (1,2,3) AND m.MON025_303 = 1
<choose>
<when
test=
"time == 1"
>
and DATE_FORMAT(policy.INS_MST_ACCEPT_DATE, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</when>
<when
test=
"time == 3"
>
and QUARTER(policy.INS_MST_ACCEPT_DATE) = QUARTER(NOW()) AND year(policy.INS_MST_ACCEPT_DATE)=year(now())
</when>
<otherwise>
and YEAR(policy.INS_MST_ACCEPT_DATE) = YEAR(now())
</otherwise>
</choose>
group by p.SAL_MST_ID;
</select>
<select
id=
"getPractitionerRankInfoForOnline"
resultMap=
"practitioner_rank_map"
>
SELECT
p.customer_id as customerId,
p.id as practitionerIdForOnLine ,
p.name as name ,-- 姓名
ss.name as spcDivName,-- 体系id
count(f.id) as count,-- 保单id
sum(f.order_price) as fyp,-- 保费
sum(f.referral_amount) as fyc -- 应发佣金
FROM ag_acl_customer_fortune f INNER JOIN ag_po_order o ON f.order_id = o.id
inner JOIN ag_acl_practitioner p ON f.customer_id = p.customer_id
left join ag_acl_practitioner_setting s on p.id = s.practitioner_id
left join ag_acl_practitioner_subordinate_system ss on p.subordinate_system_id = ss.id
WHERE o.status = 3 and o.order_price > 0
<if
test=
"practitionerTypeId != null"
>
and s.practitioner_type_id = #{practitionerTypeId}
</if>
<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>
<otherwise>
and YEAR(f.order_date) = YEAR(now())
</otherwise>
</choose>
group by p.id;
</select>
<select
id=
"getPractitionerRankInfoForSpecials"
resultMap=
"practitioner_rank_map"
resultType=
"java.util.List"
>
SELECT
p.customer_id as customerId,
p.id as practitionerIdForOnLine ,
p.name as name ,-- 姓名
ss.name as spcDivName,-- 体系id
count(f.id) as count,-- 保单id
sum(f.order_price) as fyp,-- 保费
sum(f.referral_amount) as fyc -- 应发佣金
FROM ag_acl_customer_fortune f INNER JOIN ag_po_order o ON f.order_id = o.id
inner JOIN ag_acl_practitioner p ON f.customer_id = p.customer_id
left join ag_acl_customer c on p.customer_id = c.id
left join ag_acl_practitioner_subordinate_system ss on p.subordinate_system_id = ss.id
WHERE o.status = 3 and o.order_price > 0
and c.login in
<foreach
collection=
"mobileSpecials"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
<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>
<otherwise>
and YEAR(f.order_date) = YEAR(now())
</otherwise>
</choose>
group by p.id;
</select>
<resultMap
id=
"practitioner_info_map"
type=
"com.yd.dal.entity.customer.practitioner.PractitionerInfo"
>
<result
column=
"customerId"
property=
"customerId"
/>
<result
column=
"practitionerId"
property=
"practitionerId"
/>
<result
column=
"name"
property=
"name"
/>
<result
column=
"gender"
property=
"gender"
/>
<result
column=
"practitionerType"
property=
"practitionerType"
/>
<result
column=
"levelCode"
property=
"levelCode"
/>
<result
column=
"levelName"
property=
"levelName"
/>
<result
column=
"insurerBranchName"
property=
"insurerBranchName"
/>
<result
column=
"subordinateId"
property=
"subordinateId"
/>
<result
column=
"weChatId"
property=
"weChatId"
/>
<result
column=
"qqId"
property=
"qqId"
/>
<result
column=
"practitionerRegNo"
property=
"practitionerRegNo"
/>
</resultMap>
<select
id=
"findPractitionerInfoByLogin"
resultMap=
"practitioner_info_map"
>
select
p.customer_id as customerId,
p.id as practitionerId,
p.name as name,
p.gender as gender,
s.practitioner_type_id as practitionerType,
o.drop_option_code as levelCode,
o.drop_option_name as levelName,
b.branch_name as insurerBranchName,
p.subordinate_system_id as subordinateId,
p.wechat_id as weChatId,
p.qq_id as qqId,
p.practitioner_reg_no as practitionerRegNo
from ag_acl_customer c inner join ag_acl_practitioner p on c.id = p.customer_id
left join ag_acl_insurer_branch b on p.insurer_branch_id = b.id
left join ag_acl_practitioner_setting s on p.id = s.practitioner_id
inner join ag_md_drop_options o on s.practitioner_level = o.id
where c.login = #{mobileNo};
</select>
<select
id=
"findByCustomerIdIsActive"
resultType=
"com.yd.dal.entity.customer.AclPractitioner"
>
select
<include
refid=
"Base_Column_List"
/>
from ag_acl_practitioner
where customer_id = #{customerId,jdbcType=BIGINT}
and is_active = #{isActive,jdbcType=INTEGER}
</select>
<resultMap
id=
"opportunityQuery"
type=
"com.yd.dal.entity.practitioner.opportunity.OwnOpportunityInfo"
>
<result
column=
"opportunityId"
property=
"opportunityId"
/>
<result
column=
"name"
property=
"name"
/>
<result
column=
"mobileNo"
property=
"mobileNo"
typeHandler=
"com.yd.util.deshandler.DESTypeHandler"
/>
<result
column=
"opportunityFrom"
property=
"opportunityFrom"
/>
<result
column=
"opportunityDate"
property=
"opportunityDate"
/>
<result
column=
"mdDropOptionId"
property=
"mdDropOptionId"
/>
<result
column=
"leadsAssignedId"
property=
"leadsAssignedId"
/>
</resultMap>
<select
id=
"ownOpportunityQuery"
resultMap=
"opportunityQuery"
>
SELECT
a.customer_id opportunityId,
c.NAME name,
c.mobile_no mobileNo,
p.mkt_campaign opportunityFrom,
date_format(a.created_at, '%Y-%m-%d %H:%i:%s') opportunityDate,
if (p.mkt_campaign is null ,'',(SELECT cam.name from ag_md_mk_campaign cam where cam.id = p.mkt_campaign )) mdDropOptionId,
a.id leadsAssignedId
FROM
ag_mkt_leads_assigneds a
LEFT JOIN ag_mkt_leads_pool p ON p.customer_id = a.customer_id
LEFT JOIN ag_acl_customer c ON c.id = a.customer_id
where a.is_active=1
<if
test=
"practitionerId != null"
>
and a.assigned_practitioner_id = #{practitionerId}
</if>
</select>
</mapper>
\ No newline at end of file
yd-api/src/main/resources/mapper/customer/AclPractitionerPotentialAssignedTrackMapper.xml
0 → 100644
View file @
36d734f4
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yd.dal.mapper.customer.AclPractitionerPotentialAssignedTrackMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack"
>
<id
column=
"id"
jdbcType=
"BIGINT"
property=
"id"
/>
<result
column=
"practitioner_potential_id"
jdbcType=
"BIGINT"
property=
"practitionerPotentialId"
/>
<result
column=
"practitioner_assigned_id"
jdbcType=
"BIGINT"
property=
"practitionerAssignedId"
/>
<result
column=
"track_status_id"
jdbcType=
"BIGINT"
property=
"trackStatusId"
/>
<result
column=
"notice"
jdbcType=
"VARCHAR"
property=
"notice"
/>
<result
column=
"is_active"
jdbcType=
"INTEGER"
property=
"isActive"
/>
<result
column=
"created_at"
jdbcType=
"TIMESTAMP"
property=
"createdAt"
/>
<result
column=
"created_by"
jdbcType=
"BIGINT"
property=
"createdBy"
/>
<result
column=
"updated_at"
jdbcType=
"TIMESTAMP"
property=
"updatedAt"
/>
<result
column=
"updated_by"
jdbcType=
"BIGINT"
property=
"updatedBy"
/>
<result
column=
"updator_type"
jdbcType=
"INTEGER"
property=
"updatorType"
/>
<result
column=
"creator_type"
jdbcType=
"INTEGER"
property=
"creatorType"
/>
<result
column=
"is_lasted"
jdbcType=
"INTEGER"
property=
"isLasted"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, practitioner_potential_id, practitioner_assigned_id, track_status_id, notice,
is_active, created_at, created_by, updated_at, updated_by, creator_type, updator_type,is_lasted
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Long"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from ag_acl_practitioner_potential_assigned_track
where id = #{id,jdbcType=BIGINT}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete from ag_acl_practitioner_potential_assigned_track
where id = #{id,jdbcType=BIGINT}
</delete>
<insert
id=
"insert"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack"
useGeneratedKeys=
"true"
>
insert into ag_acl_practitioner_potential_assigned_track (practitioner_potential_id, practitioner_assigned_id,
track_status_id, notice, is_active,
created_at, created_by, updated_at,
updated_by, updator_type,creator_type,is_lasted )
values (#{practitionerPotentialId,jdbcType=BIGINT}, #{practitionerAssignedId,jdbcType=BIGINT},
#{trackStatusId,jdbcType=BIGINT}, #{notice,jdbcType=VARCHAR}, #{isActive,jdbcType=INTEGER},
#{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP},
#{updatedBy,jdbcType=BIGINT},#{updatorType,jdbcType=INTEGER}, #{creatorType,jdbcType=INTEGER},#{isLasted,jdbcType=INTEGER})
</insert>
<insert
id=
"insertSelective"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack"
useGeneratedKeys=
"true"
>
insert into ag_acl_practitioner_potential_assigned_track
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"practitionerPotentialId != null"
>
practitioner_potential_id,
</if>
<if
test=
"practitionerAssignedId != null"
>
practitioner_assigned_id,
</if>
<if
test=
"trackStatusId != null"
>
track_status_id,
</if>
<if
test=
"notice != null"
>
notice,
</if>
<if
test=
"isActive != null"
>
is_active,
</if>
<if
test=
"createdAt != null"
>
created_at,
</if>
<if
test=
"createdBy != null"
>
created_by,
</if>
<if
test=
"updatedAt != null"
>
updated_at,
</if>
<if
test=
"updatedBy != null"
>
updated_by,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"practitionerPotentialId != null"
>
#{practitionerPotentialId,jdbcType=BIGINT},
</if>
<if
test=
"practitionerAssignedId != null"
>
#{practitionerAssignedId,jdbcType=BIGINT},
</if>
<if
test=
"trackStatusId != null"
>
#{trackStatusId,jdbcType=BIGINT},
</if>
<if
test=
"notice != null"
>
#{notice,jdbcType=VARCHAR},
</if>
<if
test=
"isActive != null"
>
#{isActive,jdbcType=INTEGER},
</if>
<if
test=
"createdAt != null"
>
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if
test=
"createdBy != null"
>
#{createdBy,jdbcType=BIGINT},
</if>
<if
test=
"updatedAt != null"
>
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if
test=
"updatedBy != null"
>
#{updatedBy,jdbcType=BIGINT},
</if>
</trim>
</insert>
<insert
id=
"insertList"
parameterType=
"java.util.List"
useGeneratedKeys=
"true"
>
insert into ag_acl_practitioner_potential_assigned_track(practitioner_potential_id, practitioner_assigned_id,
track_status_id, notice, is_active,
created_at, created_by, updated_at,
updated_by, updator_type,creator_type,is_lasted )
values
<foreach
collection=
"potentialAssignedTrackList"
item=
"item"
index=
"index"
separator=
","
>
(
#{item.practitionerPotentialId},
#{item.practitionerAssignedId},
#{item.trackStatusId},
#{item.notice},
#{item.isActive},
#{item.createdAt},
#{item.createdBy},
#{item.updatedAt},
#{item.updatedBy},
#{item.updatorType},
#{item.creatorType},
#{item.isLasted}
)
</foreach>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack"
>
update ag_acl_practitioner_potential_assigned_track
<set>
<if
test=
"practitionerPotentialId != null"
>
practitioner_potential_id = #{practitionerPotentialId,jdbcType=BIGINT},
</if>
<if
test=
"practitionerAssignedId != null"
>
practitioner_assigned_id = #{practitionerAssignedId,jdbcType=BIGINT},
</if>
<if
test=
"trackStatusId != null"
>
track_status_id = #{trackStatusId,jdbcType=BIGINT},
</if>
<if
test=
"notice != null"
>
notice = #{notice,jdbcType=VARCHAR},
</if>
<if
test=
"isActive != null"
>
is_active = #{isActive,jdbcType=INTEGER},
</if>
<if
test=
"createdAt != null"
>
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if
test=
"createdBy != null"
>
created_by = #{createdBy,jdbcType=BIGINT},
</if>
<if
test=
"updatedAt != null"
>
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if
test=
"updatedBy != null"
>
updated_by = #{updatedBy,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.yd.dal.entity.customer.AclPractitionerPotentialAssignedTrack"
>
update ag_acl_practitioner_potential_assigned_track
set practitioner_potential_id = #{practitionerPotentialId,jdbcType=BIGINT},
practitioner_assigned_id = #{practitionerAssignedId,jdbcType=BIGINT},
track_status_id = #{trackStatusId,jdbcType=BIGINT},
notice = #{notice,jdbcType=VARCHAR},
is_active = #{isActive,jdbcType=INTEGER},
created_at = #{createdAt,jdbcType=TIMESTAMP},
created_by = #{createdBy,jdbcType=BIGINT},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
updated_by = #{updatedBy,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
yd-api/src/main/resources/mapper/customer/AclPractitionerPotentialMapper.xml
0 → 100644
View file @
36d734f4
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yd.dal.mapper.customer.AclPractitionerPotentialMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.yd.dal.entity.customer.AclPractitionerPotential"
>
<id
column=
"id"
jdbcType=
"BIGINT"
property=
"id"
/>
<result
column=
"name"
jdbcType=
"VARCHAR"
property=
"name"
/>
<result
column=
"age"
jdbcType=
"BIGINT"
property=
"age"
/>
<result
column=
"customer_id"
jdbcType=
"BIGINT"
property=
"customerId"
/>
<result
column=
"gender"
jdbcType=
"INTEGER"
property=
"gender"
/>
<result
column=
"mobile_no"
jdbcType=
"VARCHAR"
property=
"mobileNo"
/>
<result
column=
"wechat_id"
jdbcType=
"VARCHAR"
property=
"wechatId"
/>
<result
column=
"qq_id"
jdbcType=
"VARCHAR"
property=
"qqId"
/>
<result
column=
"others_contacts"
jdbcType=
"VARCHAR"
property=
"othersContacts"
/>
<result
column=
"education_level"
jdbcType=
"VARCHAR"
property=
"educationLevel"
/>
<result
column=
"introducer"
jdbcType=
"VARCHAR"
property=
"introducer"
/>
<result
column=
"tag"
jdbcType=
"VARCHAR"
property=
"tag"
/>
<result
column=
"remark"
jdbcType=
"VARCHAR"
property=
"remark"
/>
<result
column=
"resource_drop_master_id"
jdbcType=
"BIGINT"
property=
"resourceDropMasterId"
/>
<result
column=
"oss_path_resume"
jdbcType=
"VARCHAR"
property=
"ossPathResume"
/>
<result
column=
"practitioner_assigned_ids"
jdbcType=
"VARCHAR"
property=
"practitionerAssignedIds"
/>
<result
column=
"is_active"
jdbcType=
"INTEGER"
property=
"isActive"
/>
<result
column=
"created_at"
jdbcType=
"TIMESTAMP"
property=
"createdAt"
/>
<result
column=
"created_by"
jdbcType=
"BIGINT"
property=
"createdBy"
/>
<result
column=
"updated_at"
jdbcType=
"TIMESTAMP"
property=
"updatedAt"
/>
<result
column=
"updated_by"
jdbcType=
"BIGINT"
property=
"updatedBy"
/>
<result
column=
"creator_type"
jdbcType=
"BIGINT"
property=
"creatorType"
/>
<result
column=
"updator_type"
jdbcType=
"BIGINT"
property=
"updatorType"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, customer_id,`name`, age, gender, mobile_no, wechat_id, qq_id, others_contacts, education_level,
introducer, tag, remark, resource_drop_master_id, oss_path_resume, practitioner_assigned_ids,
is_active, created_at, created_by, updated_at, updated_by,creator_type,updator_type
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Long"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from ag_acl_practitioner_potential
where id = #{id,jdbcType=BIGINT}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete from ag_acl_practitioner_potential
where id = #{id,jdbcType=BIGINT}
</delete>
<insert
id=
"insert"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.yd.dal.entity.customer.AclPractitionerPotential"
useGeneratedKeys=
"true"
>
insert into ag_acl_practitioner_potential (`name`,customer_id, age, gender,
mobile_no, wechat_id, qq_id,
others_contacts, education_level, introducer,
tag, remark, resource_drop_master_id,
oss_path_resume, practitioner_assigned_ids, is_active,
created_at, created_by, updated_at,
updated_by)
values (#{name,jdbcType=VARCHAR},#{customerId,jdbcType=BIGINT}, #{age,jdbcType=BIGINT}, #{gender,jdbcType=INTEGER},
#{mobileNo,jdbcType=VARCHAR}, #{wechatId,jdbcType=VARCHAR}, #{qqId,jdbcType=VARCHAR},
#{othersContacts,jdbcType=VARCHAR}, #{educationLevel,jdbcType=VARCHAR}, #{introducer,jdbcType=VARCHAR},
#{tag,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{resourceDropMasterId,jdbcType=BIGINT},
#{ossPathResume,jdbcType=VARCHAR}, #{practitionerAssignedIds,jdbcType=VARCHAR}, #{isActive,jdbcType=INTEGER},
#{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP},
#{updatedBy,jdbcType=BIGINT})
</insert>
<insert
id=
"insertSelective"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.yd.dal.entity.customer.AclPractitionerPotential"
useGeneratedKeys=
"true"
>
insert into ag_acl_practitioner_potential
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"name != null"
>
`name`,
</if>
<if
test=
"age != null"
>
age,
</if>
<if
test=
"gender != null"
>
gender,
</if>
<if
test=
"mobileNo != null"
>
mobile_no,
</if>
<if
test=
"wechatId != null"
>
wechat_id,
</if>
<if
test=
"qqId != null"
>
qq_id,
</if>
<if
test=
"othersContacts != null"
>
others_contacts,
</if>
<if
test=
"educationLevel != null"
>
education_level,
</if>
<if
test=
"introducer != null"
>
introducer,
</if>
<if
test=
"tag != null"
>
tag,
</if>
<if
test=
"remark != null"
>
remark,
</if>
<if
test=
"resourceDropMasterId != null"
>
resource_drop_master_id,
</if>
<if
test=
"ossPathResume != null"
>
oss_path_resume,
</if>
<if
test=
"practitionerAssignedIds != null"
>
practitioner_assigned_ids,
</if>
<if
test=
"isActive != null"
>
is_active,
</if>
<if
test=
"createdAt != null"
>
created_at,
</if>
<if
test=
"createdBy != null"
>
created_by,
</if>
<if
test=
"updatedAt != null"
>
updated_at,
</if>
<if
test=
"updatedBy != null"
>
updated_by,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"name != null"
>
#{name,jdbcType=VARCHAR},
</if>
<if
test=
"age != null"
>
#{age,jdbcType=BIGINT},
</if>
<if
test=
"gender != null"
>
#{gender,jdbcType=INTEGER},
</if>
<if
test=
"mobileNo != null"
>
#{mobileNo,jdbcType=VARCHAR},
</if>
<if
test=
"wechatId != null"
>
#{wechatId,jdbcType=VARCHAR},
</if>
<if
test=
"qqId != null"
>
#{qqId,jdbcType=VARCHAR},
</if>
<if
test=
"othersContacts != null"
>
#{othersContacts,jdbcType=VARCHAR},
</if>
<if
test=
"educationLevel != null"
>
#{educationLevel,jdbcType=VARCHAR},
</if>
<if
test=
"introducer != null"
>
#{introducer,jdbcType=VARCHAR},
</if>
<if
test=
"tag != null"
>
#{tag,jdbcType=VARCHAR},
</if>
<if
test=
"remark != null"
>
#{remark,jdbcType=VARCHAR},
</if>
<if
test=
"resourceDropMasterId != null"
>
#{resourceDropMasterId,jdbcType=BIGINT},
</if>
<if
test=
"ossPathResume != null"
>
#{ossPathResume,jdbcType=VARCHAR},
</if>
<if
test=
"practitionerAssignedIds != null"
>
#{practitionerAssignedIds,jdbcType=BIGINT},
</if>
<if
test=
"isActive != null"
>
#{isActive,jdbcType=INTEGER},
</if>
<if
test=
"createdAt != null"
>
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if
test=
"createdBy != null"
>
#{createdBy,jdbcType=BIGINT},
</if>
<if
test=
"updatedAt != null"
>
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if
test=
"updatedBy != null"
>
#{updatedBy,jdbcType=BIGINT},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.yd.dal.entity.customer.AclPractitionerPotential"
>
update ag_acl_practitioner_potential
<set>
<if
test=
"name != null"
>
`name` = #{name,jdbcType=VARCHAR},
</if>
<if
test=
"age != null"
>
age = #{age,jdbcType=BIGINT},
</if>
<if
test=
"gender != null"
>
gender = #{gender,jdbcType=INTEGER},
</if>
<if
test=
"mobileNo != null"
>
mobile_no = #{mobileNo,jdbcType=VARCHAR},
</if>
<if
test=
"wechatId != null"
>
wechat_id = #{wechatId,jdbcType=VARCHAR},
</if>
<if
test=
"qqId != null"
>
qq_id = #{qqId,jdbcType=VARCHAR},
</if>
<if
test=
"othersContacts != null"
>
others_contacts = #{othersContacts,jdbcType=VARCHAR},
</if>
<if
test=
"educationLevel != null"
>
education_level = #{educationLevel,jdbcType=VARCHAR},
</if>
<if
test=
"introducer != null"
>
introducer = #{introducer,jdbcType=VARCHAR},
</if>
<if
test=
"tag != null"
>
tag = #{tag,jdbcType=VARCHAR},
</if>
<if
test=
"remark != null"
>
remark = #{remark,jdbcType=VARCHAR},
</if>
<if
test=
"resourceDropMasterId != null"
>
resource_drop_master_id = #{resourceDropMasterId,jdbcType=BIGINT},
</if>
<if
test=
"ossPathResume != null"
>
oss_path_resume = #{ossPathResume,jdbcType=VARCHAR},
</if>
<if
test=
"practitionerAssignedId != null"
>
practitioner_assigned_ids = #{practitionerAssignedIds,jdbcType=BIGINT},
</if>
<if
test=
"isActive != null"
>
is_active = #{isActive,jdbcType=INTEGER},
</if>
<if
test=
"createdAt != null"
>
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if
test=
"createdBy != null"
>
created_by = #{createdBy,jdbcType=BIGINT},
</if>
<if
test=
"updatedAt != null"
>
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if
test=
"updatedBy != null"
>
updated_by = #{updatedBy,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.yd.dal.entity.customer.AclPractitionerPotential"
>
update ag_acl_practitioner_potential
set `name` = #{name,jdbcType=VARCHAR},
age = #{age,jdbcType=BIGINT},
gender = #{gender,jdbcType=INTEGER},
mobile_no = #{mobileNo,jdbcType=VARCHAR},
wechat_id = #{wechatId,jdbcType=VARCHAR},
qq_id = #{qqId,jdbcType=VARCHAR},
others_contacts = #{othersContacts,jdbcType=VARCHAR},
education_level = #{educationLevel,jdbcType=VARCHAR},
introducer = #{introducer,jdbcType=VARCHAR},
tag = #{tag,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
resource_drop_master_id = #{resourceDropMasterId,jdbcType=BIGINT},
oss_path_resume = #{ossPathResume,jdbcType=VARCHAR},
practitioner_assigned_ids = #{practitionerAssignedIds,jdbcType=VARCHAR},
is_active = #{isActive,jdbcType=INTEGER},
created_at = #{createdAt,jdbcType=TIMESTAMP},
created_by = #{createdBy,jdbcType=BIGINT},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
updated_by = #{updatedBy,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
<select
id=
"findByMobileNo"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from ag_acl_practitioner_potential
where mobile_no = #{mobileNo,jdbcType=VARCHAR}
and is_active = #{isActive,jdbcType=INTEGER}
</select>
</mapper>
\ No newline at end of file
yd-api/src/main/resources/mapper/customer/AclPractitionerSubordinateSystemMapper.xml
0 → 100644
View file @
36d734f4
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yd.dal.mapper.customer.AclPractitionerSubordinateSystemMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.yd.dal.entity.customer.AclPractitionerSubordinateSystem"
>
<id
column=
"id"
jdbcType=
"BIGINT"
property=
"id"
/>
<result
column=
"insurer_id"
jdbcType=
"BIGINT"
property=
"insurerId"
/>
<result
column=
"insurer_branch_id"
jdbcType=
"BIGINT"
property=
"insurerBranchId"
/>
<result
column=
"dept_id"
jdbcType=
"BIGINT"
property=
"deptId"
/>
<result
column=
"subordinate_system_code"
jdbcType=
"VARCHAR"
property=
"subordinateSystemCode"
/>
<result
column=
"name"
jdbcType=
"VARCHAR"
property=
"name"
/>
<result
column=
"name_en"
jdbcType=
"VARCHAR"
property=
"nameEn"
/>
<result
column=
"owner_practitioner_id"
jdbcType=
"BIGINT"
property=
"ownerPractitionerId"
/>
<result
column=
"contact_name"
jdbcType=
"VARCHAR"
property=
"contactName"
/>
<result
column=
"contact_no"
jdbcType=
"VARCHAR"
property=
"contactNo"
/>
<result
column=
"remark"
jdbcType=
"VARCHAR"
property=
"remark"
/>
<result
column=
"is_active"
jdbcType=
"INTEGER"
property=
"isActive"
/>
<result
column=
"created_at"
jdbcType=
"TIMESTAMP"
property=
"createdAt"
/>
<result
column=
"created_by"
jdbcType=
"BIGINT"
property=
"createdBy"
/>
<result
column=
"updated_at"
jdbcType=
"TIMESTAMP"
property=
"updatedAt"
/>
<result
column=
"updated_by"
jdbcType=
"BIGINT"
property=
"updatedBy"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, insurer_id, insurer_branch_id, dept_id, subordinate_system_code, `name`, name_en,
owner_practitioner_id, contact_name, contact_no, remark, is_active, created_at, created_by,
updated_at, updated_by
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Long"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from ag_acl_practitioner_subordinate_system
where id = #{id,jdbcType=BIGINT}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete from ag_acl_practitioner_subordinate_system
where id = #{id,jdbcType=BIGINT}
</delete>
<insert
id=
"insert"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.yd.dal.entity.customer.AclPractitionerSubordinateSystem"
useGeneratedKeys=
"true"
>
insert into ag_acl_practitioner_subordinate_system (insurer_id, insurer_branch_id, dept_id,
subordinate_system_code, `name`, name_en,
owner_practitioner_id, contact_name, contact_no,
remark, is_active, created_at,
created_by, updated_at, updated_by
)
values (#{insurerId,jdbcType=BIGINT}, #{insurerBranchId,jdbcType=BIGINT}, #{deptId,jdbcType=BIGINT},
#{subordinateSystemCode,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{nameEn,jdbcType=VARCHAR},
#{ownerPractitionerId,jdbcType=BIGINT}, #{contactName,jdbcType=VARCHAR}, #{contactNo,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR}, #{isActive,jdbcType=INTEGER}, #{createdAt,jdbcType=TIMESTAMP},
#{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=BIGINT}
)
</insert>
<insert
id=
"insertSelective"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.yd.dal.entity.customer.AclPractitionerSubordinateSystem"
useGeneratedKeys=
"true"
>
insert into ag_acl_practitioner_subordinate_system
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"insurerId != null"
>
insurer_id,
</if>
<if
test=
"insurerBranchId != null"
>
insurer_branch_id,
</if>
<if
test=
"deptId != null"
>
dept_id,
</if>
<if
test=
"subordinateSystemCode != null"
>
subordinate_system_code,
</if>
<if
test=
"name != null"
>
`name`,
</if>
<if
test=
"nameEn != null"
>
name_en,
</if>
<if
test=
"ownerPractitionerId != null"
>
owner_practitioner_id,
</if>
<if
test=
"contactName != null"
>
contact_name,
</if>
<if
test=
"contactNo != null"
>
contact_no,
</if>
<if
test=
"remark != null"
>
remark,
</if>
<if
test=
"isActive != null"
>
is_active,
</if>
<if
test=
"createdAt != null"
>
created_at,
</if>
<if
test=
"createdBy != null"
>
created_by,
</if>
<if
test=
"updatedAt != null"
>
updated_at,
</if>
<if
test=
"updatedBy != null"
>
updated_by,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"insurerId != null"
>
#{insurerId,jdbcType=BIGINT},
</if>
<if
test=
"insurerBranchId != null"
>
#{insurerBranchId,jdbcType=BIGINT},
</if>
<if
test=
"deptId != null"
>
#{deptId,jdbcType=BIGINT},
</if>
<if
test=
"subordinateSystemCode != null"
>
#{subordinateSystemCode,jdbcType=VARCHAR},
</if>
<if
test=
"name != null"
>
#{name,jdbcType=VARCHAR},
</if>
<if
test=
"nameEn != null"
>
#{nameEn,jdbcType=VARCHAR},
</if>
<if
test=
"ownerPractitionerId != null"
>
#{ownerPractitionerId,jdbcType=BIGINT},
</if>
<if
test=
"contactName != null"
>
#{contactName,jdbcType=VARCHAR},
</if>
<if
test=
"contactNo != null"
>
#{contactNo,jdbcType=VARCHAR},
</if>
<if
test=
"remark != null"
>
#{remark,jdbcType=VARCHAR},
</if>
<if
test=
"isActive != null"
>
#{isActive,jdbcType=INTEGER},
</if>
<if
test=
"createdAt != null"
>
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if
test=
"createdBy != null"
>
#{createdBy,jdbcType=BIGINT},
</if>
<if
test=
"updatedAt != null"
>
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if
test=
"updatedBy != null"
>
#{updatedBy,jdbcType=BIGINT},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.yd.dal.entity.customer.AclPractitionerSubordinateSystem"
>
update ag_acl_practitioner_subordinate_system
<set>
<if
test=
"insurerId != null"
>
insurer_id = #{insurerId,jdbcType=BIGINT},
</if>
<if
test=
"insurerBranchId != null"
>
insurer_branch_id = #{insurerBranchId,jdbcType=BIGINT},
</if>
<if
test=
"deptId != null"
>
dept_id = #{deptId,jdbcType=BIGINT},
</if>
<if
test=
"subordinateSystemCode != null"
>
subordinate_system_code = #{subordinateSystemCode,jdbcType=VARCHAR},
</if>
<if
test=
"name != null"
>
`name` = #{name,jdbcType=VARCHAR},
</if>
<if
test=
"nameEn != null"
>
name_en = #{nameEn,jdbcType=VARCHAR},
</if>
<if
test=
"ownerPractitionerId != null"
>
owner_practitioner_id = #{ownerPractitionerId,jdbcType=BIGINT},
</if>
<if
test=
"contactName != null"
>
contact_name = #{contactName,jdbcType=VARCHAR},
</if>
<if
test=
"contactNo != null"
>
contact_no = #{contactNo,jdbcType=VARCHAR},
</if>
<if
test=
"remark != null"
>
remark = #{remark,jdbcType=VARCHAR},
</if>
<if
test=
"isActive != null"
>
is_active = #{isActive,jdbcType=INTEGER},
</if>
<if
test=
"createdAt != null"
>
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if
test=
"createdBy != null"
>
created_by = #{createdBy,jdbcType=BIGINT},
</if>
<if
test=
"updatedAt != null"
>
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if
test=
"updatedBy != null"
>
updated_by = #{updatedBy,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.yd.dal.entity.customer.AclPractitionerSubordinateSystem"
>
update ag_acl_practitioner_subordinate_system
set insurer_id = #{insurerId,jdbcType=BIGINT},
insurer_branch_id = #{insurerBranchId,jdbcType=BIGINT},
dept_id = #{deptId,jdbcType=BIGINT},
subordinate_system_code = #{subordinateSystemCode,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
name_en = #{nameEn,jdbcType=VARCHAR},
owner_practitioner_id = #{ownerPractitionerId,jdbcType=BIGINT},
contact_name = #{contactName,jdbcType=VARCHAR},
contact_no = #{contactNo,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
is_active = #{isActive,jdbcType=INTEGER},
created_at = #{createdAt,jdbcType=TIMESTAMP},
created_by = #{createdBy,jdbcType=BIGINT},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
updated_by = #{updatedBy,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
<resultMap
id=
"practitioner_subordinate_map"
type=
"com.yd.dal.entity.customer.practitioner.PractitionerSubordinateInfo"
>
<result
column=
"subordinateId"
property=
"subordinateId"
/>
<result
column=
"subordinateName"
property=
"subordinateName"
/>
<result
column=
"subordinateCode"
property=
"subordinateCode"
/>
<result
column=
"ownerId"
property=
"ownerId"
/>
<result
column=
"subordinateLeader"
property=
"subordinateLeader"
/>
<result
column=
"contactName"
property=
"contactName"
/>
<result
column=
"contactNo"
property=
"contactNo"
/>
<result
column=
"remark"
property=
"remark"
/>
</resultMap>
<select
id=
"findSubordinateInfo"
resultMap=
"practitioner_subordinate_map"
>
SELECT
s.id as subordinateId,
s.name as subordinateName,
s.subordinate_system_code as subordinateCode,
s.owner_practitioner_id as ownerId,
p.name as subordinateLeader,
s.contact_name as contactName,
s.contact_no as contactNo,
s.remark as remark
FROM ag_acl_practitioner_subordinate_system s left join ag_acl_practitioner p on s.owner_practitioner_id = p.id
where s.is_active = 1
and s.id = #{subordinateId}
</select>
</mapper>
\ No newline at end of file
yd-api/src/main/resources/mapper/practitioner/PractitionerMapper.xml
deleted
100644 → 0
View file @
b3d10881
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.yd.dal.mapper.practitioner.PractitionerMapper"
>
<resultMap
id=
"base_result_map_practitioner_info"
type=
"com.yd.dal.entity.practitioner.PractitionerBasicInfo"
>
<result
column=
"customerId"
property=
"customerId"
/>
<result
column=
"practitionerIdForOnline"
property=
"practitionerIdForOnline"
/>
<result
column=
"practitionerId"
property=
"practitionerId"
/>
<result
column=
"name"
property=
"name"
/>
<result
column=
"titleCode"
property=
"titleCode"
/>
<!-- <result column="mobile_no" property="titleCode" typeHandler="com.yd.util.deshandler.DESTypeHandler"/>-->
<result
column=
"titleName"
property=
"titleName"
/>
<result
column=
"gender"
property=
"gender"
/>
</resultMap>
<select
id=
"getPractitionerInfoByMobileNoForOffline"
resultMap=
"base_result_map_practitioner_info"
>
SELECT
p.SAL_MST_ID as practitionerId,
p.SAL_MST_NAME as name,
p.SAL_MST_GENDER as gender,
md.DRP_TITLE_LEVEL as titleCode,
md.DRP_TITLE_NAME as titleName
FROM sal001 p left join DRP003 md on md.DRP_TITLE_CODE = p.FK_DRP_TITLE_CODE
where p.SAL_MST_MOBILE = #{mobileNo}
</select>
<select
id=
"getPractitionerInfoByMobileNoForOnline"
resultMap=
"base_result_map_practitioner_info"
>
select
p.customer_id as customerId,
p.id as practitionerIdForOnline,
p.name as name,
o.drop_option_code as titleCode,
o.drop_option_name as titleName,
p.gender as gender
from ag_acl_customer c inner join ag_acl_practitioner p on c.id = p.customer_id
left join ag_acl_insurer_branch b on p.insurer_branch_id = b.id
left join ag_acl_practitioner_setting s on p.id = s.practitioner_id
inner join ag_md_drop_options o on s.practitioner_level = o.id
where c.login = #{mobileNo};
</select>
<resultMap
id=
"practitioner_rank_map"
type=
"com.yd.dal.entity.practitioner.PractitionerRankInfo"
>
<result
column=
"customerId"
property=
"customerId"
/>
<result
column=
"practitionerIdForOnLine"
property=
"practitionerIdForOnLine"
/>
<result
column=
"practitionerId"
property=
"practitionerId"
/>
<result
column=
"name"
property=
"name"
/>
<result
column=
"titleCode"
property=
"titleCode"
/>
<result
column=
"titleName"
property=
"titleName"
/>
<result
column=
"count"
property=
"count"
/>
<result
column=
"fyp"
property=
"fyp"
/>
<result
column=
"fyc"
property=
"fyc"
/>
</resultMap>
<select
id=
"getPractitionerRankInfoForOffline"
resultMap=
"practitioner_rank_map"
resultType=
"java.lang.Integer"
>
SELECT
p.SAL_MST_ID as practitionerId ,
p.SAL_MST_NAME as name ,-- 姓名
md.DRP_TITLE_LEVEL as titleCode,-- 职称code
md.DRP_TITLE_NAME as titleName,-- 职称名称
spc.SPC_DIV_NAME as spcDivName,-- 体系id
count(m.MON025_002) as count,-- 保单id
sum(m.MON025_401) as fyp,-- 保费
sum(m.MON025_405) as fyc -- 应发佣金
FROM MON025 m INNER JOIN sal001 p on m.MON025_007 = p.SAL_MST_ID -- 业务员id
left join DRP003 md on p.FK_DRP_TITLE_CODE = md.DRP_TITLE_CODE
inner JOIN ins001 policy on m.MON025_002 = policy.INS_MST_ID -- 保单id
inner join spc004 spc on m.MON025_006 = spc.SPC_DIV_ID -- 体系
WHERE m.MON025_109 IN (1,2,3) AND m.MON025_303 = 1
<choose>
<when
test=
"time == 1"
>
and DATE_FORMAT(policy.INS_MST_ACCEPT_DATE, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</when>
<otherwise>
and YEAR(policy.INS_MST_ACCEPT_DATE) = YEAR(now())
</otherwise>
</choose>
group by p.SAL_MST_ID;
</select>
<select
id=
"getPractitionerRankInfoForOnline"
resultMap=
"practitioner_rank_map"
>
SELECT
p.customer_id as customerId,
p.id as practitionerIdForOnLine ,
p.name as name ,-- 姓名
ss.name as spcDivName,-- 体系id
count(f.id) as count,-- 保单id
sum(f.order_price) as fyp,-- 保费
sum(f.referral_amount) as fyc -- 应发佣金
FROM ag_acl_customer_fortune f INNER JOIN ag_po_order o ON f.order_id = o.id
inner JOIN ag_acl_practitioner p ON f.customer_id = p.customer_id
left join ag_acl_practitioner_setting s on p.id = s.practitioner_id
left join ag_acl_practitioner_subordinate_system ss on p.subordinate_system_id = ss.id
WHERE o.status = 3 and o.order_price > 0
<if
test=
"practitionerTypeId != null"
>
and s.practitioner_type_id = #{practitionerTypeId}
</if>
<choose>
<when
test=
"time == 1"
>
and DATE_FORMAT(f.order_date, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</when>
<otherwise>
and YEAR(f.order_date) = YEAR(now())
</otherwise>
</choose>
group by p.id;
</select>
<select
id=
"getPractitionerRankInfoForSpecials"
resultMap=
"practitioner_rank_map"
resultType=
"java.util.List"
>
SELECT
p.customer_id as customerId,
p.id as practitionerIdForOnLine ,
p.name as name ,-- 姓名
ss.name as spcDivName,-- 体系id
count(f.id) as count,-- 保单id
sum(f.order_price) as fyp,-- 保费
sum(f.referral_amount) as fyc -- 应发佣金
FROM ag_acl_customer_fortune f INNER JOIN ag_po_order o ON f.order_id = o.id
inner JOIN ag_acl_practitioner p ON f.customer_id = p.customer_id
left join ag_acl_customer c on p.customer_id = c.id
left join ag_acl_practitioner_subordinate_system ss on p.subordinate_system_id = ss.id
WHERE o.status = 3 and o.order_price > 0
and c.login in
<foreach
collection=
"mobileSpecials"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
<choose>
<when
test=
"time == 1"
>
and DATE_FORMAT(f.order_date, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</when>
<otherwise>
and YEAR(f.order_date) = YEAR(now())
</otherwise>
</choose>
group by p.id;
</select>
<resultMap
id=
"practitioner_info_map"
type=
"com.yd.dal.entity.practitioner.PractitionerInfo"
>
<result
column=
"customerId"
property=
"customerId"
/>
<result
column=
"practitionerId"
property=
"practitionerId"
/>
<result
column=
"name"
property=
"name"
/>
<result
column=
"gender"
property=
"gender"
/>
<result
column=
"practitionerType"
property=
"practitionerType"
/>
<result
column=
"levelCode"
property=
"levelCode"
/>
<result
column=
"levelName"
property=
"levelName"
/>
<result
column=
"insurerBranchName"
property=
"insurerBranchName"
/>
<result
column=
"subordinateId"
property=
"subordinateId"
/>
<result
column=
"weChatId"
property=
"weChatId"
/>
<result
column=
"qqId"
property=
"qqId"
/>
<result
column=
"practitionerRegNo"
property=
"practitionerRegNo"
/>
</resultMap>
<select
id=
"findPractitionerInfoByLogin"
resultMap=
"practitioner_info_map"
>
select
p.customer_id as customerId,
p.id as practitionerId,
p.name as name,
p.gender as gender,
s.practitioner_type_id as practitionerType,
o.drop_option_code as levelCode,
o.drop_option_name as levelName,
b.branch_name as insurerBranchName,
p.subordinate_system_id as subordinateId,
p.wechat_id as weChatId,
p.qq_id as qqId,
p.practitioner_reg_no as practitionerRegNo
from ag_acl_customer c inner join ag_acl_practitioner p on c.id = p.customer_id
left join ag_acl_insurer_branch b on p.insurer_branch_id = b.id
left join ag_acl_practitioner_setting s on p.id = s.practitioner_id
inner join ag_md_drop_options o on s.practitioner_level = o.id
where c.login = #{mobileNo};
</select>
<resultMap
id=
"opportunityQuery"
type=
"com.yd.dal.entity.practitioner.opportunity.OwnOpportunityInfo"
>
<result
column=
"opportunityId"
property=
"opportunityId"
/>
<result
column=
"name"
property=
"name"
/>
<result
column=
"mobileNo"
property=
"mobileNo"
typeHandler=
"com.yd.util.deshandler.DESTypeHandler"
/>
<result
column=
"opportunityFrom"
property=
"opportunityFrom"
/>
<result
column=
"opportunityDate"
property=
"opportunityDate"
/>
<result
column=
"mdDropOptionId"
property=
"mdDropOptionId"
/>
<result
column=
"leadsAssignedId"
property=
"leadsAssignedId"
/>
</resultMap>
<select
id=
"ownOpportunityQuery"
resultMap=
"opportunityQuery"
>
SELECT
a.customer_id opportunityId,
c.NAME name,
c.mobile_no mobileNo,
p.mkt_campaign opportunityFrom,
date_format(a.created_at, '%Y-%m-%d %H:%i:%s') opportunityDate,
if (p.mkt_campaign is null ,'',(SELECT cam.name from ag_md_mk_campaign cam where cam.id = p.mkt_campaign )) mdDropOptionId,
a.id leadsAssignedId
FROM
ag_mkt_leads_assigneds a
LEFT JOIN ag_mkt_leads_pool p ON p.customer_id = a.customer_id
LEFT JOIN ag_acl_customer c ON c.id = a.customer_id
where a.is_active=1
<if
test=
"practitionerId != null"
>
and a.assigned_practitioner_id = #{practitionerId}
</if>
</select>
</mapper>
yd-api/src/main/resources/mapper/practitioner/PractitionerSubordinateMapper.xml
deleted
100644 → 0
View file @
b3d10881
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.yd.dal.mapper.practitioner.PractitionerSubordinateMapper"
>
<resultMap
id=
"practitioner_subordinate_map"
type=
"com.yd.dal.entity.practitioner.PractitionerSubordinateInfo"
>
<result
column=
"subordinateId"
property=
"subordinateId"
/>
<result
column=
"subordinateName"
property=
"subordinateName"
/>
<result
column=
"subordinateCode"
property=
"subordinateCode"
/>
<result
column=
"ownerId"
property=
"ownerId"
/>
<result
column=
"subordinateLeader"
property=
"subordinateLeader"
/>
<result
column=
"contactName"
property=
"contactName"
/>
<result
column=
"contactNo"
property=
"contactNo"
/>
<result
column=
"remark"
property=
"remark"
/>
</resultMap>
<select
id=
"findSubordinateInfo"
resultMap=
"practitioner_subordinate_map"
>
SELECT
s.id as subordinateId,
s.name as subordinateName,
s.subordinate_system_code as subordinateCode,
s.owner_practitioner_id as ownerId,
p.name as subordinateLeader,
s.contact_name as contactName,
s.contact_no as contactNo,
s.remark as remark
FROM ag_acl_practitioner_subordinate_system s left join ag_acl_practitioner p on s.owner_practitioner_id = p.id
where s.is_active = 1
and s.id = #{subordinateId}
</select>
</mapper>
yd-api/src/main/resources/mapper/tencent/TenInterfRecordMapper.xml
View file @
36d734f4
...
...
@@ -96,6 +96,26 @@
order by ${orderBy}
</if>
</select>
<select
id=
"findByAppIdAndGrantType"
resultType=
"com.yd.dal.entity.tencent.TenInterfRecord"
>
select
<include
refid=
"Base_Column_List"
></include>
from ag_ten_interf_record t
where t.interf_type = #{type}
and t.appid = #{appId}
and t.grant_type = #{grantType}
and t.expires_in is not null
and t.created_at >(NOW() - INTERVAL 1 DAY) order by created_at desc
</select>
<select
id=
"findByAccessTokenAndIType"
resultType=
"com.yd.dal.entity.tencent.TenInterfRecord"
>
select
<include
refid=
"Base_Column_List"
></include>
from ag_ten_interf_record t
where t.interf_type = #{type}
and t.access_token = #{accessToken}
and t.i_type = #{pType}
and t.expires_in is not null
and t.created_at >(NOW() - INTERVAL 1 DAY) order by created_at desc
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete from ag_ten_interf_record
where id = #{id,jdbcType=BIGINT}
...
...
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