Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-csf
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
xingmin
yd-csf
Commits
35783e97
Commit
35783e97
authored
Jan 27, 2026
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新单跟进v2
parent
4769acf3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
4 deletions
+65
-4
yd-csf-service/src/main/java/com/yd/csf/service/model/Fortune.java
+1
-1
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneAccountServiceImpl.java
+1
-1
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneServiceImpl.java
+63
-2
No files found.
yd-csf-service/src/main/java/com/yd/csf/service/model/Fortune.java
View file @
35783e97
...
...
@@ -171,7 +171,7 @@ public class Fortune implements Serializable {
/**
* 实际出账日期
*/
private
Local
Date
actualPayoutDate
;
private
Date
actualPayoutDate
;
/**
* 检核人
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneAccountServiceImpl.java
View file @
35783e97
...
...
@@ -284,7 +284,7 @@ public class FortuneAccountServiceImpl extends ServiceImpl<FortuneAccountMapper,
if
(
CollectionUtils
.
isNotEmpty
(
fortunes
))
{
fortunes
.
forEach
(
f
->
{
f
.
setStatus
(
FortuneStatusEnum
.
SENT
.
getItemValue
());
f
.
setActualPayoutDate
(
LocalDate
.
now
());
f
.
setActualPayoutDate
(
new
Date
());
f
.
setUpdaterId
(
loginUserId
.
toString
());
f
.
setUpdateTime
(
new
Date
());
});
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneServiceImpl.java
View file @
35783e97
...
...
@@ -11,11 +11,13 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import
com.google.common.base.Joiner
;
import
com.yd.auth.core.dto.AuthUserDto
;
import
com.yd.auth.core.utils.SecurityUtil
;
import
com.yd.common.constant.RedisConstants
;
import
com.yd.common.enums.CommonEnum
;
import
com.yd.common.enums.ResultCode
;
import
com.yd.common.exception.BusinessException
;
import
com.yd.common.result.Result
;
import
com.yd.common.utils.RandomStringGenerator
;
import
com.yd.common.utils.RedisUtil
;
import
com.yd.csf.service.dto.*
;
import
com.yd.csf.service.enums.FortuneStatusEnum
;
import
com.yd.csf.service.model.*
;
...
...
@@ -64,9 +66,10 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
private
IExpectedFortuneService
expectedFortuneService
;
@Resource
private
PolicyService
policyService
;
@
Autowired
@
Resource
private
ApiSysDictFeignClient
apiSysDictFeignClient
;
@Resource
private
RedisUtil
redisUtil
;
@Override
public
Wrapper
<
Fortune
>
getQueryWrapper
(
FortuneQueryRequest
fortuneQueryRequest
)
{
...
...
@@ -505,12 +508,63 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
@Override
public
Boolean
addFortune
(
FortuneAddRequest
fortuneAddRequest
)
{
if
(
ObjectUtils
.
isEmpty
(
fortuneAddRequest
.
getFortuneBizType
()))
{
throw
new
BusinessException
(
ResultCode
.
FAIL
.
getCode
(),
"出账类型不能为空"
);
}
if
(
ObjectUtils
.
isEmpty
(
fortuneAddRequest
.
getAmount
()))
{
throw
new
BusinessException
(
ResultCode
.
FAIL
.
getCode
(),
"出账金额不能为空"
);
}
if
(
ObjectUtils
.
isEmpty
(
fortuneAddRequest
.
getCurrency
()))
{
throw
new
BusinessException
(
ResultCode
.
FAIL
.
getCode
(),
"出账币种不能为空"
);
}
if
(
ObjectUtils
.
isEmpty
(
fortuneAddRequest
.
getFortuneType
()))
{
throw
new
BusinessException
(
ResultCode
.
FAIL
.
getCode
(),
"出账项目不能为空"
);
}
if
(
ObjectUtils
.
isEmpty
(
fortuneAddRequest
.
getBrokerBizId
()))
{
throw
new
BusinessException
(
ResultCode
.
FAIL
.
getCode
(),
"转介人不能为空"
);
}
// 创建Fortune实体
Fortune
fortune
=
new
Fortune
();
BeanUtil
.
copyProperties
(
fortuneAddRequest
,
fortune
);
if
(
"R"
.
equals
(
fortuneAddRequest
.
getFortuneBizType
()))
{
if
(
ObjectUtils
.
isEmpty
(
fortuneAddRequest
.
getPolicyNo
()))
{
throw
new
BusinessException
(
ResultCode
.
FAIL
.
getCode
(),
"关联保单应付款,保单号不能为空"
);
}
if
(
ObjectUtils
.
isEmpty
(
fortuneAddRequest
.
getFortunePeriod
()))
{
throw
new
BusinessException
(
ResultCode
.
FAIL
.
getCode
(),
"关联保单应付款,佣金期数不能为空"
);
}
ExpectedFortune
expectedFortune
=
expectedFortuneService
.
lambdaQuery
()
.
eq
(
ExpectedFortune:
:
getPolicyNo
,
fortuneAddRequest
.
getPolicyNo
())
.
eq
(
ExpectedFortune:
:
getFortunePeriod
,
fortuneAddRequest
.
getFortunePeriod
())
.
eq
(
ExpectedFortune:
:
getFortuneType
,
fortuneAddRequest
.
getFortuneType
())
.
one
();
if
(
expectedFortune
==
null
)
{
throw
new
BusinessException
(
ResultCode
.
FAIL
.
getCode
(),
"未查询到当前项目对应的预计出账数据"
);
}
fortune
.
setExpectedFortuneBizId
(
expectedFortune
.
getExpectedFortuneBizId
());
fortune
.
setCommissionExpectedBizId
(
expectedFortune
.
getExpectedFortuneBizId
());
fortune
.
setPolicyCurrency
(
expectedFortune
.
getPolicyCurrency
());
fortune
.
setExchangeRate
(
expectedFortune
.
getDefaultExchangeRate
());
fortune
.
setHkdAmount
(
fortuneAddRequest
.
getAmount
().
multiply
(
expectedFortune
.
getDefaultExchangeRate
()));
fortune
.
setCurrentPaymentHkdAmount
(
fortune
.
getHkdAmount
());
fortune
.
setPayoutDate
(
expectedFortune
.
getPayoutDate
());
}
else
{
fortune
.
setExchangeRate
(
queryDefaultExchangeRate
(
fortuneAddRequest
.
getCurrency
()));
fortune
.
setHkdAmount
(
fortuneAddRequest
.
getAmount
().
multiply
(
fortune
.
getExchangeRate
()));
fortune
.
setCurrentPaymentHkdAmount
(
fortune
.
getHkdAmount
());
}
// 生成发佣业务ID
fortune
.
setFortuneBizId
(
RandomStringGenerator
.
generateBizId16
(
CommonEnum
.
UID_TYPE_FORTUNE
.
getCode
()));
fortune
.
setCurrentPaymentAmount
(
fortuneAddRequest
.
getAmount
());
fortune
.
setFortuneName
(
queryByDict
(
fortuneAddRequest
.
getFortuneType
()));
fortune
.
setActualPayoutDate
(
fortuneAddRequest
.
getPayoutDate
());
fortune
.
setIsPart
(
0
);
fortune
.
setStatus
(
FortuneStatusEnum
.
WAIT
.
getItemValue
());
...
...
@@ -518,6 +572,13 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
}
private
String
queryByDict
(
String
fortuneType
)
{
//查询redis缓存的字典列表信息
List
<
GetDictItemListByDictTypeResponse
>
dictTypeResponses
=
redisUtil
.
getCacheObject
(
RedisConstants
.
DICT_LIST
);
String
fortuneName
=
GetDictItemListByDictTypeResponse
.
getItemLabel
(
dictTypeResponses
,
"csf_fortune_type"
,
fortuneType
);
if
(
ObjectUtils
.
isNotEmpty
(
fortuneName
))
{
return
fortuneName
;
}
Result
<
List
<
GetDictItemListByDictTypeResponse
>>
result
=
apiSysDictFeignClient
.
getDictItemListByDictType
(
"csf_fortune_type"
);
if
(
CollectionUtils
.
isNotEmpty
(
result
.
getData
()))
{
for
(
GetDictItemListByDictTypeResponse
dictItem
:
result
.
getData
())
{
...
...
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