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
60e9aa9e
Commit
60e9aa9e
authored
Jul 05, 2021
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
续年佣金计算-来佣比对优化
parent
949389f6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
901 additions
and
42 deletions
+901
-42
yd-api/src/main/java/com/yd/api/commission/service/impl/LifeCommissionServiceImpl.java
+69
-31
yd-api/src/main/java/com/yd/api/commission/vo/lifecommission/CheckComeCommissionRequestVO.java
+3
-11
yd-api/src/main/java/com/yd/api/commission/vo/lifecommission/ComeCommissionParams.java
+10
-0
yd-api/src/main/java/com/yd/dal/entity/commission/AgPoOrderCommission.java
+446
-0
yd-api/src/main/java/com/yd/dal/mapper/commission/AgPoOrderCommissionMapper.java
+23
-0
yd-api/src/main/resources/src/main/resources/commission/AgPoOrderCommissionMapper.xml
+350
-0
No files found.
yd-api/src/main/java/com/yd/api/commission/service/impl/LifeCommissionServiceImpl.java
View file @
60e9aa9e
...
...
@@ -7,14 +7,17 @@ import com.yd.api.commission.service.LifeCommissionService;
import
com.yd.api.commission.vo.lifecommission.*
;
import
com.yd.api.result.CommonResult
;
import
com.yd.dal.entity.agms.fortune.FortunePayToOrderInfo
;
import
com.yd.dal.entity.commission.AgPoOrderCommission
;
import
com.yd.dal.entity.commission.OrderCommissonCheck
;
import
com.yd.dal.entity.customer.AclCustomerFortune
;
import
com.yd.dal.entity.order.PoOrder
;
import
com.yd.dal.mapper.commission.AgPoOrderCommissionMapper
;
import
com.yd.dal.mapper.lifecommission.LifeCommissionMapper
;
import
com.yd.dal.service.customer.AclCustomerFortuneDALService
;
import
com.yd.dal.service.order.PoOrderDALService
;
import
com.yd.rmi.ali.send.service.SendService
;
import
com.yd.rmi.cache.SystemConfigService
;
import
com.yd.util.CommonUtil
;
import
com.yd.util.config.ZHBErrorConfig
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
...
...
@@ -40,6 +43,8 @@ public class LifeCommissionServiceImpl implements LifeCommissionService {
private
SystemConfigService
systemConfigService
;
@Autowired
private
SendService
sendService
;
@Autowired
private
AgPoOrderCommissionMapper
orderCommissionMapper
;
@Override
...
...
@@ -71,46 +76,21 @@ public class LifeCommissionServiceImpl implements LifeCommissionService {
@Override
public
CheckComeCommissionResponseVO
updateCommissionCheckStatus
(
CheckComeCommissionRequestVO
requestVO
)
{
CheckComeCommissionResponseVO
resp
=
new
CheckComeCommissionResponseVO
();
List
<
Long
>
orderIds
=
requestVO
.
getOrderIds
();
List
<
ComeCommissionParams
>
paramsList
=
requestVO
.
getOrderIds
();
String
status
=
requestVO
.
getCheckStatus
();
String
loginId
=
requestVO
.
getLoginId
();
String
checkBatch
=
requestVO
.
getCheckBatch
();
List
<
String
>
commissionNos
=
requestVO
.
getCommissionNos
();
if
(
StringUtils
.
isBlank
(
checkBatch
))
{
resp
.
setCommonResult
(
new
CommonResult
(
false
,
"检核日期不能为空"
));
return
resp
;
}
try
{
// 操作前先检查是否已关账
// 查询对应订单记录
List
<
PoOrder
>
orders
=
poOrderDALService
.
findByIds
(
orderIds
);
// 查询保单下的所有寿险经纪人的fortune记录
List
<
AclCustomerFortune
>
fortuneList
=
customerFortuneDalService
.
queryLifeFortuneListByOrderIds
(
orderIds
);
// 已关帐的订单,则该笔订单来佣比对状态不能改为待来佣和已比对,但能改为已退保
// 处理历史记录,暂时关闭
// this.validateClosed(orders, fortuneList, status);
String
fortuneCommissionPayoutStatus
;
if
(
"2"
.
equals
(
status
))
{
//已比对
fortuneCommissionPayoutStatus
=
"2"
;
}
else
if
(
"3"
.
equals
(
status
))
{
//已退保
fortuneCommissionPayoutStatus
=
"1"
;
// 1.更新财富等信息
this
.
processOrderAndFortune
(
paramsList
,
status
,
loginId
,
checkBatch
);
}
else
{
//待来佣
fortuneCommissionPayoutStatus
=
"1"
;
}
this
.
updateOrderAndFortune
(
orderIds
,
fortuneList
,
status
,
fortuneCommissionPayoutStatus
,
loginId
,
checkBatch
);
// 更新多年期佣金
this
.
updateOrderCommission
(
commissionNos
,
status
,
loginId
,
checkBatch
);
// 订单已退保后发送邮件通知运营
if
(
"3"
.
equals
(
status
))
{
//已比对
this
.
orderCommissionCheckCancelSendMail
(
orders
);
}
// 2.更新多年期佣金
this
.
updateOrderCommission
(
paramsList
,
status
,
loginId
,
checkBatch
);
resp
.
setCommonResult
(
new
CommonResult
(
true
,
ZHBErrorConfig
.
getErrorInfo
(
"800000"
)));
...
...
@@ -121,10 +101,68 @@ public class LifeCommissionServiceImpl implements LifeCommissionService {
return
resp
;
}
private
void
updateOrderCommission
(
List
<
String
>
commissionNos
,
String
status
,
String
loginId
,
String
checkBatch
)
{
private
void
processOrderAndFortune
(
List
<
ComeCommissionParams
>
paramsList
,
String
status
,
String
loginId
,
String
checkBatch
)
{
// 获取首年度佣金的orderId
List
<
Long
>
orderIds
=
new
ArrayList
<>();
for
(
ComeCommissionParams
params:
paramsList
)
{
if
(
"1"
.
equals
(
params
.
getCommissionPeriod
()))
{
orderIds
.
add
(
params
.
getOrderId
());
}
}
// 操作前先检查是否已关账
// 查询对应订单记录
List
<
PoOrder
>
orders
=
poOrderDALService
.
findByIds
(
orderIds
);
// 查询保单下的所有寿险经纪人的fortune记录
List
<
AclCustomerFortune
>
fortuneList
=
customerFortuneDalService
.
queryLifeFortuneListByOrderIds
(
orderIds
);
// 已关帐的订单,则该笔订单来佣比对状态不能改为待来佣和已比对,但能改为已退保
// 处理历史记录,暂时关闭
// this.validateClosed(orders, fortuneList, status);
String
fortuneCommissionPayoutStatus
;
if
(
"2"
.
equals
(
status
))
{
//已比对
fortuneCommissionPayoutStatus
=
"2"
;
}
else
if
(
"3"
.
equals
(
status
))
{
//已退保
fortuneCommissionPayoutStatus
=
"1"
;
}
else
{
//待来佣
fortuneCommissionPayoutStatus
=
"1"
;
}
this
.
updateOrderAndFortune
(
orderIds
,
fortuneList
,
status
,
fortuneCommissionPayoutStatus
,
loginId
,
checkBatch
);
// 订单已退保后发送邮件通知运营
if
(
"3"
.
equals
(
status
))
{
//已比对
this
.
orderCommissionCheckCancelSendMail
(
orders
);
}
}
private
void
updateOrderCommission
(
List
<
ComeCommissionParams
>
paramsList
,
String
status
,
String
loginId
,
String
checkBatch
)
{
if
(!
"2"
.
equals
(
status
))
{
return
;
}
// 获取续年度来佣编号
List
<
String
>
commissionNos
=
new
ArrayList
<>();
for
(
ComeCommissionParams
params:
paramsList
)
{
if
(
StringUtils
.
isNotBlank
(
params
.
getCommissionNo
()))
{
commissionNos
.
add
(
params
.
getCommissionNo
());
}
}
// 获取批次号(如2020-11的字符串)
Long
checkBatchId
=
this
.
getOrderCommissionCheckBatch
(
checkBatch
,
loginId
);
AgPoOrderCommission
orderCommission
=
new
AgPoOrderCommission
();
orderCommission
.
setCommissionCheckId
(
checkBatchId
);
orderCommission
.
setCommissionStatus
(
"1"
);
orderCommission
.
setCommissionTime
(
CommonUtil
.
dateParseString
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
));
orderCommission
.
setUpdatedBy
(
Long
.
valueOf
(
loginId
));
orderCommission
.
setUpdatedAt
(
new
Date
());
orderCommissionMapper
.
updateBatchBycommissionNo
(
commissionNos
,
orderCommission
);
}
...
...
yd-api/src/main/java/com/yd/api/commission/vo/lifecommission/CheckComeCommissionRequestVO.java
View file @
60e9aa9e
...
...
@@ -3,20 +3,19 @@ package com.yd.api.commission.vo.lifecommission;
import
java.util.List
;
public
class
CheckComeCommissionRequestVO
{
private
List
<
Long
>
orderIds
;
private
List
<
ComeCommissionParams
>
orderIds
;
private
String
checkStatus
;
private
List
<
String
>
commissionNos
;
private
String
loginId
;
/**
* 来佣比对批次
*/
private
String
checkBatch
;
public
List
<
Long
>
getOrderIds
()
{
public
List
<
ComeCommissionParams
>
getOrderIds
()
{
return
orderIds
;
}
public
void
setOrderIds
(
List
<
Long
>
orderIds
)
{
public
void
setOrderIds
(
List
<
ComeCommissionParams
>
orderIds
)
{
this
.
orderIds
=
orderIds
;
}
...
...
@@ -44,11 +43,4 @@ public class CheckComeCommissionRequestVO {
this
.
checkBatch
=
checkBatch
;
}
public
List
<
String
>
getCommissionNos
()
{
return
commissionNos
;
}
public
void
setCommissionNos
(
List
<
String
>
commissionNos
)
{
this
.
commissionNos
=
commissionNos
;
}
}
yd-api/src/main/java/com/yd/api/commission/vo/lifecommission/ComeCommissionParams.java
0 → 100644
View file @
60e9aa9e
package
com
.
yd
.
api
.
commission
.
vo
.
lifecommission
;
import
lombok.Data
;
@Data
public
class
ComeCommissionParams
{
private
Long
orderId
;
private
String
commissionNo
;
private
String
commissionPeriod
;
}
yd-api/src/main/java/com/yd/dal/entity/commission/AgPoOrderCommission.java
0 → 100644
View file @
60e9aa9e
package
com
.
yd
.
dal
.
entity
.
commission
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* ag_po_order_commission
* @author
*/
public
class
AgPoOrderCommission
implements
Serializable
{
/**
* serial id
*/
private
Long
id
;
/**
* 来佣编号
*/
private
String
commissionNo
;
/**
* 佣金类别(1=佣金; 2=公告佣金; 3=B2C佣金, 4=推荐佣金、以此类推N)
*/
private
Integer
commissionType
;
/**
* 经纪人customerID
*/
private
Long
customerId
;
/**
* practitioner_id
*/
private
Long
practitionerId
;
/**
* 订单ID
*/
private
Long
orderId
;
/**
* 保单号
*/
private
String
policyNo
;
/**
* 产品名称
*/
private
String
productName
;
/**
* 预计来佣时间(用于查询与结算)
*/
private
Date
commissionYear
;
/**
* 缴费年限
*/
private
Integer
paymentTerm
;
/**
* 保费
*/
private
BigDecimal
premium
;
/**
* 来佣项目;0=首年佣金; 1=续年佣金
*/
private
String
commissionCategory
;
/**
* 旧的费用率
*/
private
BigDecimal
oldrate
;
/**
* 最新费用率
*/
private
BigDecimal
rate
;
/**
* 来佣金额
*/
private
BigDecimal
amount
;
/**
* 来佣结算状态,0=未结算; 1=已结算;
*/
private
String
commissionStatus
;
/**
* 结算时间
*/
private
String
commissionTime
;
/**
* 佣金期数(1=第一年; 2=第二年; 3=第三年; 4=第四年; 5=第五年)
*/
private
Integer
commissionPeriod
;
/**
* FK ag_po_order_commission_check.id
*/
private
Long
commissionCheckId
;
/**
* 1=active 2=inactive
*/
private
Integer
isActive
;
/**
* 备注
*/
private
String
remark
;
/**
* 创建时间
*/
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
;
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
String
getCommissionNo
()
{
return
commissionNo
;
}
public
void
setCommissionNo
(
String
commissionNo
)
{
this
.
commissionNo
=
commissionNo
;
}
public
Integer
getCommissionType
()
{
return
commissionType
;
}
public
void
setCommissionType
(
Integer
commissionType
)
{
this
.
commissionType
=
commissionType
;
}
public
Long
getCustomerId
()
{
return
customerId
;
}
public
void
setCustomerId
(
Long
customerId
)
{
this
.
customerId
=
customerId
;
}
public
Long
getPractitionerId
()
{
return
practitionerId
;
}
public
void
setPractitionerId
(
Long
practitionerId
)
{
this
.
practitionerId
=
practitionerId
;
}
public
Long
getOrderId
()
{
return
orderId
;
}
public
void
setOrderId
(
Long
orderId
)
{
this
.
orderId
=
orderId
;
}
public
String
getPolicyNo
()
{
return
policyNo
;
}
public
void
setPolicyNo
(
String
policyNo
)
{
this
.
policyNo
=
policyNo
;
}
public
String
getProductName
()
{
return
productName
;
}
public
void
setProductName
(
String
productName
)
{
this
.
productName
=
productName
;
}
public
Date
getCommissionYear
()
{
return
commissionYear
;
}
public
void
setCommissionYear
(
Date
commissionYear
)
{
this
.
commissionYear
=
commissionYear
;
}
public
Integer
getPaymentTerm
()
{
return
paymentTerm
;
}
public
void
setPaymentTerm
(
Integer
paymentTerm
)
{
this
.
paymentTerm
=
paymentTerm
;
}
public
BigDecimal
getPremium
()
{
return
premium
;
}
public
void
setPremium
(
BigDecimal
premium
)
{
this
.
premium
=
premium
;
}
public
String
getCommissionCategory
()
{
return
commissionCategory
;
}
public
void
setCommissionCategory
(
String
commissionCategory
)
{
this
.
commissionCategory
=
commissionCategory
;
}
public
BigDecimal
getOldrate
()
{
return
oldrate
;
}
public
void
setOldrate
(
BigDecimal
oldrate
)
{
this
.
oldrate
=
oldrate
;
}
public
BigDecimal
getRate
()
{
return
rate
;
}
public
void
setRate
(
BigDecimal
rate
)
{
this
.
rate
=
rate
;
}
public
BigDecimal
getAmount
()
{
return
amount
;
}
public
void
setAmount
(
BigDecimal
amount
)
{
this
.
amount
=
amount
;
}
public
String
getCommissionStatus
()
{
return
commissionStatus
;
}
public
void
setCommissionStatus
(
String
commissionStatus
)
{
this
.
commissionStatus
=
commissionStatus
;
}
public
String
getCommissionTime
()
{
return
commissionTime
;
}
public
void
setCommissionTime
(
String
commissionTime
)
{
this
.
commissionTime
=
commissionTime
;
}
public
Integer
getCommissionPeriod
()
{
return
commissionPeriod
;
}
public
void
setCommissionPeriod
(
Integer
commissionPeriod
)
{
this
.
commissionPeriod
=
commissionPeriod
;
}
public
Long
getCommissionCheckId
()
{
return
commissionCheckId
;
}
public
void
setCommissionCheckId
(
Long
commissionCheckId
)
{
this
.
commissionCheckId
=
commissionCheckId
;
}
public
Integer
getIsActive
()
{
return
isActive
;
}
public
void
setIsActive
(
Integer
isActive
)
{
this
.
isActive
=
isActive
;
}
public
String
getRemark
()
{
return
remark
;
}
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
}
public
Date
getCreatedAt
()
{
return
createdAt
;
}
public
void
setCreatedAt
(
Date
createdAt
)
{
this
.
createdAt
=
createdAt
;
}
public
Long
getCreatedBy
()
{
return
createdBy
;
}
public
void
setCreatedBy
(
Long
createdBy
)
{
this
.
createdBy
=
createdBy
;
}
public
Date
getUpdatedAt
()
{
return
updatedAt
;
}
public
void
setUpdatedAt
(
Date
updatedAt
)
{
this
.
updatedAt
=
updatedAt
;
}
public
Long
getUpdatedBy
()
{
return
updatedBy
;
}
public
void
setUpdatedBy
(
Long
updatedBy
)
{
this
.
updatedBy
=
updatedBy
;
}
@Override
public
boolean
equals
(
Object
that
)
{
if
(
this
==
that
)
{
return
true
;
}
if
(
that
==
null
)
{
return
false
;
}
if
(
getClass
()
!=
that
.
getClass
())
{
return
false
;
}
AgPoOrderCommission
other
=
(
AgPoOrderCommission
)
that
;
return
(
this
.
getId
()
==
null
?
other
.
getId
()
==
null
:
this
.
getId
().
equals
(
other
.
getId
()))
&&
(
this
.
getCommissionNo
()
==
null
?
other
.
getCommissionNo
()
==
null
:
this
.
getCommissionNo
().
equals
(
other
.
getCommissionNo
()))
&&
(
this
.
getCommissionType
()
==
null
?
other
.
getCommissionType
()
==
null
:
this
.
getCommissionType
().
equals
(
other
.
getCommissionType
()))
&&
(
this
.
getCustomerId
()
==
null
?
other
.
getCustomerId
()
==
null
:
this
.
getCustomerId
().
equals
(
other
.
getCustomerId
()))
&&
(
this
.
getPractitionerId
()
==
null
?
other
.
getPractitionerId
()
==
null
:
this
.
getPractitionerId
().
equals
(
other
.
getPractitionerId
()))
&&
(
this
.
getOrderId
()
==
null
?
other
.
getOrderId
()
==
null
:
this
.
getOrderId
().
equals
(
other
.
getOrderId
()))
&&
(
this
.
getPolicyNo
()
==
null
?
other
.
getPolicyNo
()
==
null
:
this
.
getPolicyNo
().
equals
(
other
.
getPolicyNo
()))
&&
(
this
.
getProductName
()
==
null
?
other
.
getProductName
()
==
null
:
this
.
getProductName
().
equals
(
other
.
getProductName
()))
&&
(
this
.
getCommissionYear
()
==
null
?
other
.
getCommissionYear
()
==
null
:
this
.
getCommissionYear
().
equals
(
other
.
getCommissionYear
()))
&&
(
this
.
getPaymentTerm
()
==
null
?
other
.
getPaymentTerm
()
==
null
:
this
.
getPaymentTerm
().
equals
(
other
.
getPaymentTerm
()))
&&
(
this
.
getPremium
()
==
null
?
other
.
getPremium
()
==
null
:
this
.
getPremium
().
equals
(
other
.
getPremium
()))
&&
(
this
.
getCommissionCategory
()
==
null
?
other
.
getCommissionCategory
()
==
null
:
this
.
getCommissionCategory
().
equals
(
other
.
getCommissionCategory
()))
&&
(
this
.
getOldrate
()
==
null
?
other
.
getOldrate
()
==
null
:
this
.
getOldrate
().
equals
(
other
.
getOldrate
()))
&&
(
this
.
getRate
()
==
null
?
other
.
getRate
()
==
null
:
this
.
getRate
().
equals
(
other
.
getRate
()))
&&
(
this
.
getAmount
()
==
null
?
other
.
getAmount
()
==
null
:
this
.
getAmount
().
equals
(
other
.
getAmount
()))
&&
(
this
.
getCommissionStatus
()
==
null
?
other
.
getCommissionStatus
()
==
null
:
this
.
getCommissionStatus
().
equals
(
other
.
getCommissionStatus
()))
&&
(
this
.
getCommissionTime
()
==
null
?
other
.
getCommissionTime
()
==
null
:
this
.
getCommissionTime
().
equals
(
other
.
getCommissionTime
()))
&&
(
this
.
getCommissionPeriod
()
==
null
?
other
.
getCommissionPeriod
()
==
null
:
this
.
getCommissionPeriod
().
equals
(
other
.
getCommissionPeriod
()))
&&
(
this
.
getCommissionCheckId
()
==
null
?
other
.
getCommissionCheckId
()
==
null
:
this
.
getCommissionCheckId
().
equals
(
other
.
getCommissionCheckId
()))
&&
(
this
.
getIsActive
()
==
null
?
other
.
getIsActive
()
==
null
:
this
.
getIsActive
().
equals
(
other
.
getIsActive
()))
&&
(
this
.
getRemark
()
==
null
?
other
.
getRemark
()
==
null
:
this
.
getRemark
().
equals
(
other
.
getRemark
()))
&&
(
this
.
getCreatedAt
()
==
null
?
other
.
getCreatedAt
()
==
null
:
this
.
getCreatedAt
().
equals
(
other
.
getCreatedAt
()))
&&
(
this
.
getCreatedBy
()
==
null
?
other
.
getCreatedBy
()
==
null
:
this
.
getCreatedBy
().
equals
(
other
.
getCreatedBy
()))
&&
(
this
.
getUpdatedAt
()
==
null
?
other
.
getUpdatedAt
()
==
null
:
this
.
getUpdatedAt
().
equals
(
other
.
getUpdatedAt
()))
&&
(
this
.
getUpdatedBy
()
==
null
?
other
.
getUpdatedBy
()
==
null
:
this
.
getUpdatedBy
().
equals
(
other
.
getUpdatedBy
()));
}
@Override
public
int
hashCode
()
{
final
int
prime
=
31
;
int
result
=
1
;
result
=
prime
*
result
+
((
getId
()
==
null
)
?
0
:
getId
().
hashCode
());
result
=
prime
*
result
+
((
getCommissionNo
()
==
null
)
?
0
:
getCommissionNo
().
hashCode
());
result
=
prime
*
result
+
((
getCommissionType
()
==
null
)
?
0
:
getCommissionType
().
hashCode
());
result
=
prime
*
result
+
((
getCustomerId
()
==
null
)
?
0
:
getCustomerId
().
hashCode
());
result
=
prime
*
result
+
((
getPractitionerId
()
==
null
)
?
0
:
getPractitionerId
().
hashCode
());
result
=
prime
*
result
+
((
getOrderId
()
==
null
)
?
0
:
getOrderId
().
hashCode
());
result
=
prime
*
result
+
((
getPolicyNo
()
==
null
)
?
0
:
getPolicyNo
().
hashCode
());
result
=
prime
*
result
+
((
getProductName
()
==
null
)
?
0
:
getProductName
().
hashCode
());
result
=
prime
*
result
+
((
getCommissionYear
()
==
null
)
?
0
:
getCommissionYear
().
hashCode
());
result
=
prime
*
result
+
((
getPaymentTerm
()
==
null
)
?
0
:
getPaymentTerm
().
hashCode
());
result
=
prime
*
result
+
((
getPremium
()
==
null
)
?
0
:
getPremium
().
hashCode
());
result
=
prime
*
result
+
((
getCommissionCategory
()
==
null
)
?
0
:
getCommissionCategory
().
hashCode
());
result
=
prime
*
result
+
((
getOldrate
()
==
null
)
?
0
:
getOldrate
().
hashCode
());
result
=
prime
*
result
+
((
getRate
()
==
null
)
?
0
:
getRate
().
hashCode
());
result
=
prime
*
result
+
((
getAmount
()
==
null
)
?
0
:
getAmount
().
hashCode
());
result
=
prime
*
result
+
((
getCommissionStatus
()
==
null
)
?
0
:
getCommissionStatus
().
hashCode
());
result
=
prime
*
result
+
((
getCommissionTime
()
==
null
)
?
0
:
getCommissionTime
().
hashCode
());
result
=
prime
*
result
+
((
getCommissionPeriod
()
==
null
)
?
0
:
getCommissionPeriod
().
hashCode
());
result
=
prime
*
result
+
((
getCommissionCheckId
()
==
null
)
?
0
:
getCommissionCheckId
().
hashCode
());
result
=
prime
*
result
+
((
getIsActive
()
==
null
)
?
0
:
getIsActive
().
hashCode
());
result
=
prime
*
result
+
((
getRemark
()
==
null
)
?
0
:
getRemark
().
hashCode
());
result
=
prime
*
result
+
((
getCreatedAt
()
==
null
)
?
0
:
getCreatedAt
().
hashCode
());
result
=
prime
*
result
+
((
getCreatedBy
()
==
null
)
?
0
:
getCreatedBy
().
hashCode
());
result
=
prime
*
result
+
((
getUpdatedAt
()
==
null
)
?
0
:
getUpdatedAt
().
hashCode
());
result
=
prime
*
result
+
((
getUpdatedBy
()
==
null
)
?
0
:
getUpdatedBy
().
hashCode
());
return
result
;
}
@Override
public
String
toString
()
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
getClass
().
getSimpleName
());
sb
.
append
(
" ["
);
sb
.
append
(
"Hash = "
).
append
(
hashCode
());
sb
.
append
(
", id="
).
append
(
id
);
sb
.
append
(
", commissionNo="
).
append
(
commissionNo
);
sb
.
append
(
", commissionType="
).
append
(
commissionType
);
sb
.
append
(
", customerId="
).
append
(
customerId
);
sb
.
append
(
", practitionerId="
).
append
(
practitionerId
);
sb
.
append
(
", orderId="
).
append
(
orderId
);
sb
.
append
(
", policyNo="
).
append
(
policyNo
);
sb
.
append
(
", productName="
).
append
(
productName
);
sb
.
append
(
", commissionYear="
).
append
(
commissionYear
);
sb
.
append
(
", paymentTerm="
).
append
(
paymentTerm
);
sb
.
append
(
", premium="
).
append
(
premium
);
sb
.
append
(
", commissionCategory="
).
append
(
commissionCategory
);
sb
.
append
(
", oldrate="
).
append
(
oldrate
);
sb
.
append
(
", rate="
).
append
(
rate
);
sb
.
append
(
", amount="
).
append
(
amount
);
sb
.
append
(
", commissionStatus="
).
append
(
commissionStatus
);
sb
.
append
(
", commissionTime="
).
append
(
commissionTime
);
sb
.
append
(
", commissionPeriod="
).
append
(
commissionPeriod
);
sb
.
append
(
", commissionCheckId="
).
append
(
commissionCheckId
);
sb
.
append
(
", isActive="
).
append
(
isActive
);
sb
.
append
(
", remark="
).
append
(
remark
);
sb
.
append
(
", createdAt="
).
append
(
createdAt
);
sb
.
append
(
", createdBy="
).
append
(
createdBy
);
sb
.
append
(
", updatedAt="
).
append
(
updatedAt
);
sb
.
append
(
", updatedBy="
).
append
(
updatedBy
);
sb
.
append
(
", serialVersionUID="
).
append
(
serialVersionUID
);
sb
.
append
(
"]"
);
return
sb
.
toString
();
}
}
\ No newline at end of file
yd-api/src/main/java/com/yd/dal/mapper/commission/AgPoOrderCommissionMapper.java
0 → 100644
View file @
60e9aa9e
package
com
.
yd
.
dal
.
mapper
.
commission
;
import
com.yd.dal.entity.commission.AgPoOrderCommission
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
AgPoOrderCommissionMapper
{
int
deleteByPrimaryKey
(
Long
id
);
int
insert
(
AgPoOrderCommission
record
);
int
insertSelective
(
AgPoOrderCommission
record
);
AgPoOrderCommission
selectByPrimaryKey
(
Long
id
);
int
updateByPrimaryKeySelective
(
AgPoOrderCommission
record
);
int
updateByPrimaryKey
(
AgPoOrderCommission
record
);
void
updateBatchBycommissionNo
(
@Param
(
"list"
)
List
<
String
>
commissionNos
,
AgPoOrderCommission
orderCommission
);
}
\ No newline at end of file
yd-api/src/main/resources/src/main/resources/commission/AgPoOrderCommissionMapper.xml
0 → 100644
View file @
60e9aa9e
<?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.commission.AgPoOrderCommissionMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.yd.dal.entity.commission.AgPoOrderCommission"
>
<id
column=
"id"
jdbcType=
"BIGINT"
property=
"id"
/>
<result
column=
"commission_no"
jdbcType=
"VARCHAR"
property=
"commissionNo"
/>
<result
column=
"commission_type"
jdbcType=
"INTEGER"
property=
"commissionType"
/>
<result
column=
"customer_id"
jdbcType=
"BIGINT"
property=
"customerId"
/>
<result
column=
"practitioner_id"
jdbcType=
"BIGINT"
property=
"practitionerId"
/>
<result
column=
"order_id"
jdbcType=
"BIGINT"
property=
"orderId"
/>
<result
column=
"policy_no"
jdbcType=
"VARCHAR"
property=
"policyNo"
/>
<result
column=
"product_name"
jdbcType=
"VARCHAR"
property=
"productName"
/>
<result
column=
"commission_year"
jdbcType=
"TIMESTAMP"
property=
"commissionYear"
/>
<result
column=
"payment_term"
jdbcType=
"INTEGER"
property=
"paymentTerm"
/>
<result
column=
"premium"
jdbcType=
"DECIMAL"
property=
"premium"
/>
<result
column=
"commission_category"
jdbcType=
"VARCHAR"
property=
"commissionCategory"
/>
<result
column=
"oldrate"
jdbcType=
"DECIMAL"
property=
"oldrate"
/>
<result
column=
"rate"
jdbcType=
"DECIMAL"
property=
"rate"
/>
<result
column=
"amount"
jdbcType=
"DECIMAL"
property=
"amount"
/>
<result
column=
"commission_status"
jdbcType=
"VARCHAR"
property=
"commissionStatus"
/>
<result
column=
"commission_time"
jdbcType=
"VARCHAR"
property=
"commissionTime"
/>
<result
column=
"commission_period"
jdbcType=
"INTEGER"
property=
"commissionPeriod"
/>
<result
column=
"commission_check_id"
jdbcType=
"BIGINT"
property=
"commissionCheckId"
/>
<result
column=
"is_active"
jdbcType=
"INTEGER"
property=
"isActive"
/>
<result
column=
"remark"
jdbcType=
"VARCHAR"
property=
"remark"
/>
<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, commission_no, commission_type, customer_id, practitioner_id, order_id, policy_no,
product_name, commission_year, payment_term, premium, commission_category, oldrate,
rate, amount, commission_status, commission_time, commission_period, commission_check_id,
is_active, remark, 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_po_order_commission
where id = #{id,jdbcType=BIGINT}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete from ag_po_order_commission
where id = #{id,jdbcType=BIGINT}
</delete>
<insert
id=
"insert"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.yd.dal.entity.commission.AgPoOrderCommission"
useGeneratedKeys=
"true"
>
insert into ag_po_order_commission (commission_no, commission_type, customer_id,
practitioner_id, order_id, policy_no,
product_name, commission_year, payment_term,
premium, commission_category, oldrate,
rate, amount, commission_status,
commission_time, commission_period, commission_check_id,
is_active, remark, created_at,
created_by, updated_at, updated_by
)
values (#{commissionNo,jdbcType=VARCHAR}, #{commissionType,jdbcType=INTEGER}, #{customerId,jdbcType=BIGINT},
#{practitionerId,jdbcType=BIGINT}, #{orderId,jdbcType=BIGINT}, #{policyNo,jdbcType=VARCHAR},
#{productName,jdbcType=VARCHAR}, #{commissionYear,jdbcType=TIMESTAMP}, #{paymentTerm,jdbcType=INTEGER},
#{premium,jdbcType=DECIMAL}, #{commissionCategory,jdbcType=VARCHAR}, #{oldrate,jdbcType=DECIMAL},
#{rate,jdbcType=DECIMAL}, #{amount,jdbcType=DECIMAL}, #{commissionStatus,jdbcType=VARCHAR},
#{commissionTime,jdbcType=VARCHAR}, #{commissionPeriod,jdbcType=INTEGER}, #{commissionCheckId,jdbcType=BIGINT},
#{isActive,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}, #{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.commission.AgPoOrderCommission"
useGeneratedKeys=
"true"
>
insert into ag_po_order_commission
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"commissionNo != null"
>
commission_no,
</if>
<if
test=
"commissionType != null"
>
commission_type,
</if>
<if
test=
"customerId != null"
>
customer_id,
</if>
<if
test=
"practitionerId != null"
>
practitioner_id,
</if>
<if
test=
"orderId != null"
>
order_id,
</if>
<if
test=
"policyNo != null"
>
policy_no,
</if>
<if
test=
"productName != null"
>
product_name,
</if>
<if
test=
"commissionYear != null"
>
commission_year,
</if>
<if
test=
"paymentTerm != null"
>
payment_term,
</if>
<if
test=
"premium != null"
>
premium,
</if>
<if
test=
"commissionCategory != null"
>
commission_category,
</if>
<if
test=
"oldrate != null"
>
oldrate,
</if>
<if
test=
"rate != null"
>
rate,
</if>
<if
test=
"amount != null"
>
amount,
</if>
<if
test=
"commissionStatus != null"
>
commission_status,
</if>
<if
test=
"commissionTime != null"
>
commission_time,
</if>
<if
test=
"commissionPeriod != null"
>
commission_period,
</if>
<if
test=
"commissionCheckId != null"
>
commission_check_id,
</if>
<if
test=
"isActive != null"
>
is_active,
</if>
<if
test=
"remark != null"
>
remark,
</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=
"commissionNo != null"
>
#{commissionNo,jdbcType=VARCHAR},
</if>
<if
test=
"commissionType != null"
>
#{commissionType,jdbcType=INTEGER},
</if>
<if
test=
"customerId != null"
>
#{customerId,jdbcType=BIGINT},
</if>
<if
test=
"practitionerId != null"
>
#{practitionerId,jdbcType=BIGINT},
</if>
<if
test=
"orderId != null"
>
#{orderId,jdbcType=BIGINT},
</if>
<if
test=
"policyNo != null"
>
#{policyNo,jdbcType=VARCHAR},
</if>
<if
test=
"productName != null"
>
#{productName,jdbcType=VARCHAR},
</if>
<if
test=
"commissionYear != null"
>
#{commissionYear,jdbcType=TIMESTAMP},
</if>
<if
test=
"paymentTerm != null"
>
#{paymentTerm,jdbcType=INTEGER},
</if>
<if
test=
"premium != null"
>
#{premium,jdbcType=DECIMAL},
</if>
<if
test=
"commissionCategory != null"
>
#{commissionCategory,jdbcType=VARCHAR},
</if>
<if
test=
"oldrate != null"
>
#{oldrate,jdbcType=DECIMAL},
</if>
<if
test=
"rate != null"
>
#{rate,jdbcType=DECIMAL},
</if>
<if
test=
"amount != null"
>
#{amount,jdbcType=DECIMAL},
</if>
<if
test=
"commissionStatus != null"
>
#{commissionStatus,jdbcType=VARCHAR},
</if>
<if
test=
"commissionTime != null"
>
#{commissionTime,jdbcType=VARCHAR},
</if>
<if
test=
"commissionPeriod != null"
>
#{commissionPeriod,jdbcType=INTEGER},
</if>
<if
test=
"commissionCheckId != null"
>
#{commissionCheckId,jdbcType=BIGINT},
</if>
<if
test=
"isActive != null"
>
#{isActive,jdbcType=INTEGER},
</if>
<if
test=
"remark != null"
>
#{remark,jdbcType=VARCHAR},
</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.commission.AgPoOrderCommission"
>
update ag_po_order_commission
<set>
<if
test=
"commissionNo != null"
>
commission_no = #{commissionNo,jdbcType=VARCHAR},
</if>
<if
test=
"commissionType != null"
>
commission_type = #{commissionType,jdbcType=INTEGER},
</if>
<if
test=
"customerId != null"
>
customer_id = #{customerId,jdbcType=BIGINT},
</if>
<if
test=
"practitionerId != null"
>
practitioner_id = #{practitionerId,jdbcType=BIGINT},
</if>
<if
test=
"orderId != null"
>
order_id = #{orderId,jdbcType=BIGINT},
</if>
<if
test=
"policyNo != null"
>
policy_no = #{policyNo,jdbcType=VARCHAR},
</if>
<if
test=
"productName != null"
>
product_name = #{productName,jdbcType=VARCHAR},
</if>
<if
test=
"commissionYear != null"
>
commission_year = #{commissionYear,jdbcType=TIMESTAMP},
</if>
<if
test=
"paymentTerm != null"
>
payment_term = #{paymentTerm,jdbcType=INTEGER},
</if>
<if
test=
"premium != null"
>
premium = #{premium,jdbcType=DECIMAL},
</if>
<if
test=
"commissionCategory != null"
>
commission_category = #{commissionCategory,jdbcType=VARCHAR},
</if>
<if
test=
"oldrate != null"
>
oldrate = #{oldrate,jdbcType=DECIMAL},
</if>
<if
test=
"rate != null"
>
rate = #{rate,jdbcType=DECIMAL},
</if>
<if
test=
"amount != null"
>
amount = #{amount,jdbcType=DECIMAL},
</if>
<if
test=
"commissionStatus != null"
>
commission_status = #{commissionStatus,jdbcType=VARCHAR},
</if>
<if
test=
"commissionTime != null"
>
commission_time = #{commissionTime,jdbcType=VARCHAR},
</if>
<if
test=
"commissionPeriod != null"
>
commission_period = #{commissionPeriod,jdbcType=INTEGER},
</if>
<if
test=
"commissionCheckId != null"
>
commission_check_id = #{commissionCheckId,jdbcType=BIGINT},
</if>
<if
test=
"isActive != null"
>
is_active = #{isActive,jdbcType=INTEGER},
</if>
<if
test=
"remark != null"
>
remark = #{remark,jdbcType=VARCHAR},
</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.commission.AgPoOrderCommission"
>
update ag_po_order_commission
set commission_no = #{commissionNo,jdbcType=VARCHAR},
commission_type = #{commissionType,jdbcType=INTEGER},
customer_id = #{customerId,jdbcType=BIGINT},
practitioner_id = #{practitionerId,jdbcType=BIGINT},
order_id = #{orderId,jdbcType=BIGINT},
policy_no = #{policyNo,jdbcType=VARCHAR},
product_name = #{productName,jdbcType=VARCHAR},
commission_year = #{commissionYear,jdbcType=TIMESTAMP},
payment_term = #{paymentTerm,jdbcType=INTEGER},
premium = #{premium,jdbcType=DECIMAL},
commission_category = #{commissionCategory,jdbcType=VARCHAR},
oldrate = #{oldrate,jdbcType=DECIMAL},
rate = #{rate,jdbcType=DECIMAL},
amount = #{amount,jdbcType=DECIMAL},
commission_status = #{commissionStatus,jdbcType=VARCHAR},
commission_time = #{commissionTime,jdbcType=VARCHAR},
commission_period = #{commissionPeriod,jdbcType=INTEGER},
commission_check_id = #{commissionCheckId,jdbcType=BIGINT},
is_active = #{isActive,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR},
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>
<update
id=
"updateBatchBycommissionNo"
>
update ag_po_order_commission
<set>
<if
test=
" commissionStatus != null"
>
commission_status = #{commissionStatus,jdbcType=BIGINT},
</if>
<if
test=
"commissionTime != null"
>
commission_time = #{commissionTime,jdbcType=VARCHAR},
</if>
<if
test=
"commissionCheckId != null"
>
commission_check_id = #{commissionCheckId,jdbcType=VARCHAR},
</if>
<if
test=
"updatedBy != null"
>
updated_by = #{updatedBy,jdbcType=TIMESTAMP},
</if>
<if
test=
"updatedAt != null"
>
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
</set>
where commission_no in
<foreach
collection=
"list"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</update>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment