Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
3284da9d
Commit
3284da9d
authored
Aug 10, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
05205ae9
42cb5a1d
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
1005 additions
and
443 deletions
+1005
-443
yifu-insurances-deployment.yaml
k8s-bash-test/yifu-insurances-deployment.yaml
+3
-2
pom.xml
pom.xml
+2
-2
TDepartSettlementInfo.java
...d/plus/v1/yifu/archives/entity/TDepartSettlementInfo.java
+188
-0
TSettleDomainSelectVo.java
...cloud/plus/v1/yifu/archives/vo/TSettleDomainSelectVo.java
+4
-0
InsurancesConstants.java
...lus/v1/yifu/insurances/constants/InsurancesConstants.java
+9
-9
TInsuranceDetail.java
...loud/plus/v1/yifu/insurances/entity/TInsuranceDetail.java
+14
-0
EKPUtil.java
.../com/yifu/cloud/plus/v1/yifu/insurances/util/EKPUtil.java
+122
-21
DeptChangeCheckParam.java
...loud/plus/v1/yifu/insurances/vo/DeptChangeCheckParam.java
+24
-0
EKPInteractiveParam.java
...cloud/plus/v1/yifu/insurances/vo/EKPInteractiveParam.java
+9
-2
TInsuranceSettlePushParam.java
...plus/v1/yifu/insurances/vo/TInsuranceSettlePushParam.java
+14
-74
TInsuranceDetailServiceImpl.java
.../insurances/service/impl/TInsuranceDetailServiceImpl.java
+548
-317
TInsuranceDetailMapper.xml
...-biz/src/main/resources/mapper/TInsuranceDetailMapper.xml
+6
-5
TSocialFundInfo.java
...ifu/cloud/plus/v1/yifu/social/entity/TSocialFundInfo.java
+4
-0
TForecastLibraryController.java
...v1/yifu/social/controller/TForecastLibraryController.java
+2
-2
TForecastLibraryService.java
.../plus/v1/yifu/social/service/TForecastLibraryService.java
+1
-1
TForecastLibraryServiceImpl.java
...yifu/social/service/impl/TForecastLibraryServiceImpl.java
+55
-8
No files found.
k8s-bash-test/yifu-insurances-deployment.yaml
View file @
3284da9d
...
...
@@ -44,8 +44,9 @@ spec: # 资源规范字段
kubernetes.io/hostname
:
yfmaster1
containers
:
# 容器
-
name
:
yifu-insurances
# 容器的名字
image
:
192.168.1.110:5500/qas-mvp/yifu-insurances-biz:1.0.0
# 容器镜像地址
imagePullPolicy
:
Never
# 每次Pod启动拉取镜像策略,三个选择 Always、Never、IfNotPresent
image
:
localhost:5000/yifu-insurances-biz:1.0.0
#临时地址
# image: 192.168.1.110:5500/qas-mvp/yifu-insurances-biz:1.0.0 # 容器镜像地址
imagePullPolicy
:
IfNotPresent
# 每次Pod启动拉取镜像策略,三个选择 Always、Never、IfNotPresent
# Always,每次都检查;Never,每次都不检查(不管本地是否有);IfNotPresent,如果本地有就不检查,如果没有就拉取(手动测试时,
# 已经打好镜像存在docker容器中时,使用存在不检查级别,
# 默认为每次都检查,然后会进行拉取新镜像,因镜像仓库不存在,导致部署失败)
...
...
pom.xml
View file @
3284da9d
...
...
@@ -261,7 +261,7 @@
<!-- 环境标识,需要与配置文件的名称相对应 -->
<profiles.active>
dev
</profiles.active>
<!-- 天翼云-->
<my.hub.host>
192.168.1.110
:5500
</my.hub.host>
<my.hub.host>
localhost
:5500
</my.hub.host>
<map.group.name>
qas-mvp
</map.group.name>
<!-- 众多参数配置 -->
</properties>
...
...
@@ -284,7 +284,7 @@
<!-- 环境标识,需要与配置文件的名称相对应 -->
<profiles.active>
test
</profiles.active>
<!-- 天翼云-->
<my.hub.host>
192.168.1.110
:5500
</my.hub.host>
<my.hub.host>
localhost
:5500
</my.hub.host>
<map.group.name>
qas-mvp
</map.group.name>
<!-- 众多参数配置 -->
</properties>
...
...
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/entity/TDepartSettlementInfo.java
0 → 100644
View file @
3284da9d
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.extension.activerecord.Model
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
org.hibernate.validator.constraints.Length
;
import
javax.validation.constraints.DecimalMax
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
/**
* 部门结算信息表
*
* @author wangan
* @date 2019-08-09 12:24:14
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@TableName
(
"t_depart_settlement_info"
)
@Schema
(
description
=
"部门结算信息表"
)
public
class
TDepartSettlementInfo
extends
Model
<
TDepartSettlementInfo
>
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键
*/
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
@Schema
(
description
=
"主键"
,
name
=
"id"
)
private
String
id
;
/**
* 社保卡收取 单位 个人
*/
@Length
(
max
=
1
,
message
=
"社保卡收取不能超过1个字符"
)
@ExcelAttribute
(
name
=
"社保卡收取"
,
maxLength
=
1
)
@Schema
(
description
=
"社保卡收取"
,
name
=
"socialCardTaker"
)
private
String
socialCardTaker
;
/**
* 岗位
*/
@Length
(
max
=
32
,
message
=
"岗位不能超过32个字符"
)
@ExcelAttribute
(
name
=
"岗位"
,
maxLength
=
32
)
@Schema
(
description
=
"岗位"
,
name
=
"station"
)
private
String
station
;
/**
* 管理费是否收费(0收费/1不收费)
*/
@Length
(
max
=
1
,
message
=
"管理费是否收费(0收费/1不收费)不能超过1个字符"
)
@ExcelAttribute
(
name
=
"管理费是否收费(0收费/1不收费)"
,
maxLength
=
1
)
@Schema
(
description
=
"管理费是否收费(0收费/1不收费)"
,
name
=
"managementTag"
)
private
String
managementTag
;
/**
* 管理费收取项目 如:应发工资 单位社保 单位公积金 商险 单位社保卡费 单位代扣 其他费用1 其他费用2 其他费用3
*/
@Length
(
max
=
255
,
message
=
"管理费收取项目不能超过255个字符"
)
@ExcelAttribute
(
name
=
"管理费收取项目"
)
@Schema
(
description
=
"管理费收取项目"
,
name
=
"managementTag"
)
private
String
manageServerItem
;
/**
* 风险金收取项目
*/
@Length
(
max
=
255
,
message
=
"风险金收取项目不能超过255个字符"
)
@ExcelAttribute
(
name
=
"风险金收取项目"
)
@Schema
(
description
=
"风险金收取项目"
,
name
=
"riskServerItem"
)
private
String
riskServerItem
;
/**
* 管理费费率/管理费金额
*/
@DecimalMax
(
value
=
"999999.999"
,
message
=
"管理费费率(管理费金额)不能大于999999.999"
)
@ExcelAttribute
(
name
=
"管理费费率/管理费金额"
)
@Schema
(
description
=
"管理费费率/管理费金额"
,
name
=
"managementFee"
)
private
BigDecimal
managementFee
;
/**
* 管理费收费类型 按固定值 按比例
*/
@Length
(
max
=
32
,
message
=
"管理费收费类型不能超过32个字符"
)
@ExcelAttribute
(
name
=
"管理费收费类型"
,
maxLength
=
32
)
@Schema
(
description
=
"管理费收费类型(0:固定;1:比例)"
,
name
=
"managementType"
)
private
String
managementType
;
/**
* 风险金是否收取
*/
@Length
(
max
=
1
,
message
=
"风险金是否收取不能超过1个字符"
)
@ExcelAttribute
(
name
=
"风险金是否收取"
,
maxLength
=
1
)
@Schema
(
description
=
"风险金是否收取(0收费/1不收费)"
,
name
=
"riskFundTag"
)
private
String
riskFundTag
;
/**
* 风险金收取费用/税率
*/
@DecimalMax
(
value
=
"9999999.99"
,
message
=
"风险金收取费用/税率不能大于9999999.99"
)
@ExcelAttribute
(
name
=
"风险金收取费用/税率"
)
@Schema
(
description
=
"风险金收取费用/税率"
,
name
=
"riskFundFee"
)
private
BigDecimal
riskFundFee
;
/**
* 风险金收取方式
*/
@Length
(
max
=
32
,
message
=
"风险金收取方式不能超过32个字符"
)
@ExcelAttribute
(
name
=
"风险金收取方式"
,
maxLength
=
32
)
@Schema
(
description
=
"风险金收取方式(0:固定;1:比例)"
,
name
=
"riskFundType"
)
private
String
riskFundType
;
/**
* 缴税类型(交税类型) 增值税-专票 增值税-普票 差额纳税-专票 差额纳税-普票
*/
@Length
(
max
=
32
,
message
=
"缴税类型不能超过32个字符"
)
@ExcelAttribute
(
name
=
"缴税类型"
,
maxLength
=
32
)
@Schema
(
description
=
"缴税类型"
,
name
=
"taxType"
)
private
String
taxType
;
/**
* 风险金税收类型
*/
@Length
(
max
=
1
,
message
=
"风险金税收类型不能超过1个字符"
)
@ExcelAttribute
(
name
=
"风险金税收类型"
,
maxLength
=
1
)
@Schema
(
description
=
"风险金税收类型(0:税前;1:税后(需要计算))"
,
name
=
"riskFundTaxTag"
)
private
String
riskFundTaxTag
;
/**
* 管理费税收类型 1含税 0不含税
*/
@Length
(
max
=
1
,
message
=
"管理费税收类型不能超过1个字符"
)
@ExcelAttribute
(
name
=
"管理费税收类型"
,
maxLength
=
1
)
@Schema
(
description
=
"管理费税收类型(0:税前;1:税后(需要计算))"
,
name
=
"managementTaxTag"
)
private
String
managementTaxTag
;
/**
* 单位大病比例
*/
@ExcelAttribute
(
name
=
"单位大病比例"
)
@DecimalMax
(
value
=
"100.00"
,
message
=
"单位大病比例不能大于100.00"
)
@Schema
(
description
=
"单位大病比例"
,
name
=
"unitSeriousIllnessProp"
)
private
BigDecimal
unitSeriousIllnessProp
;
/**
* 创建人
*/
@Length
(
max
=
32
,
message
=
"创建人不能超过32个字符"
)
@ExcelAttribute
(
name
=
"创建人"
,
maxLength
=
32
)
@Schema
(
description
=
"创建人"
,
name
=
"createUser"
)
private
String
createUser
;
/**
* 创建时间
*/
@ExcelAttribute
(
name
=
"创建时间"
)
@Schema
(
description
=
"创建时间"
,
name
=
"createTime"
)
private
LocalDateTime
createTime
;
/**
* 最后更新人
*/
@Length
(
max
=
32
,
message
=
"最后更新人不能超过32个字符"
)
@ExcelAttribute
(
name
=
"最后更新人"
,
maxLength
=
32
)
@Schema
(
description
=
"最后更新人"
,
name
=
"lastUpdateUser"
)
private
String
lastUpdateUser
;
/**
* 最后更新时间
*/
@ExcelAttribute
(
name
=
"最后更新时间"
)
@Schema
(
description
=
"最后更新时间"
,
name
=
"lastUpdateTime"
)
private
LocalDateTime
lastUpdateTime
;
/**
* 结算主体ID
*/
@Length
(
max
=
32
,
message
=
"结算主体ID不能超过32个字符"
)
@ExcelAttribute
(
name
=
"结算主体ID"
,
maxLength
=
32
)
@Schema
(
description
=
"结算主体ID"
,
name
=
"settleId"
)
private
String
settleId
;
/**
* 缴税税率
*/
@DecimalMax
(
value
=
"99.99"
,
message
=
"缴税税率不能大于99.99"
)
@ExcelAttribute
(
name
=
"缴税税率"
)
@Schema
(
description
=
"缴税税率"
,
name
=
"taxFee"
)
private
BigDecimal
taxFee
;
/**
* 管理费是否扣税
* 0是/1否
*
* @Author pwang
* @Date 2020-04-26 9:38
* @param null
* @return
**/
@Length
(
max
=
1
,
message
=
"管理费是否扣税字段不能超过1个字符"
)
@Schema
(
description
=
"管理费是否扣税"
)
private
String
managementExpFlag
;
}
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/TSettleDomainSelectVo.java
View file @
3284da9d
...
...
@@ -23,4 +23,8 @@ public class TSettleDomainSelectVo extends TSettleDomain implements Serializable
*/
private
String
industryBelong
;
//页面名称:商务主体 ————(归属服务公司名称 (商务主体(乙方)名称))
// 薪资用到,作为封面抬头
private
String
businessSubjectName
;
}
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/constants/InsurancesConstants.java
View file @
3284da9d
...
...
@@ -36,17 +36,17 @@ public class InsurancesConstants {
*/
public
static
final
String
CHANGE_ERROR
=
"数据发生变动,请刷新数据后重新办理"
;
/**
* 导出办理
*
投保
导出办理
*/
public
static
final
String
EXPORT
=
"导出办理"
;
public
static
final
String
EXPORT
=
"
投保
导出办理"
;
/**
* 投保退回
*/
public
static
final
String
ROLLBACK
=
"投保退回"
;
/**
* 办理成功
*
投保
办理成功
*/
public
static
final
String
SUCCESSFUL
=
"办理成功"
;
public
static
final
String
SUCCESSFUL
=
"
投保
办理成功"
;
/**
* 登记保单保费
*/
...
...
@@ -687,18 +687,18 @@ public class InsurancesConstants {
public
static
final
String
INSURANCE_REFUND_IMPORT
=
"导入减员数据"
;
/**
*
导出待减员数据
*
减员导出办理
*/
public
static
final
String
INSURANCE_REFUND_EXPORT
=
"
导出待减员数据
"
;
public
static
final
String
INSURANCE_REFUND_EXPORT
=
"
减员导出办理
"
;
/**
* 减员成功
* 减员
办理
成功
*/
public
static
final
String
INSURANCE_REFUND_SUCCESS
=
"减员成功"
;
public
static
final
String
INSURANCE_REFUND_SUCCESS
=
"减员
办理
成功"
;
/**
* 减员退回
* 减员退回
成功
*/
public
static
final
String
INSURANCE_REFUND_FAILED
=
"减员退回"
;
...
...
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/entity/TInsuranceDetail.java
View file @
3284da9d
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
insurances
.
entity
;
import
com.alibaba.excel.annotation.ExcelIgnore
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.baomidou.mybatisplus.annotation.*
;
import
com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity
;
import
io.swagger.v3.oas.annotations.media.Schema
;
...
...
@@ -271,5 +273,17 @@ public class TInsuranceDetail extends BaseEntity {
@Schema
(
description
=
"是否删除 0否/1是"
)
private
Integer
deleteFlag
;
/**
* 商险办理人
*/
@Schema
(
description
=
"商险办理人"
)
private
String
handledBy
;
/**
* 商险办理时间
*/
@Schema
(
description
=
"商险办理时间"
)
private
LocalDateTime
handledTime
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/util/EKPUtil.java
View file @
3284da9d
...
...
@@ -2,13 +2,13 @@ package com.yifu.cloud.plus.v1.yifu.insurances.util;
import
cn.hutool.json.JSONObject
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.insurances.vo.EKPInteractiveParam
;
import
com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceSettlePushParam
;
import
lombok.Getter
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.http.*
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.LinkedMultiValueMap
;
...
...
@@ -94,14 +94,16 @@ public class EKPUtil {
loginName
.
append
(
"LoginName"
,
LoginName
);
String
loginData
=
new
ObjectMapper
().
writeValueAsString
(
loginName
);
MultiValueMap
<
String
,
Object
>
wholeForm
=
new
LinkedMultiValueMap
<>();
wholeForm
.
add
(
"docSubject"
,
new
String
(
docSubject
.
getBytes
(
"UTF-8"
),
"ISO-8859-1"
)
);
//wholeForm.add("docCreator", "{\"LoginName\":\"admin\"}");
wholeForm
.
add
(
"docCreator"
,
loginData
);
//wholeForm.add("docSubject", new String(docSubject.getBytes("UTF-8"),"ISO-8859-1") );
wholeForm
.
add
(
"docSubject"
,
docSubject
);
wholeForm
.
add
(
"docCreator"
,
"{\"LoginName\":\"admin\"}"
);
//wholeForm.add("docCreator", loginData);
wholeForm
.
add
(
"docStatus"
,
docStatus
);
wholeForm
.
add
(
"fdModelId"
,
fdModelId
);
wholeForm
.
add
(
"fdFlowId"
,
fdFlowId
);
//wholeForm.add("formValues", new String(formValues.getBytes("UTF-8"),"ISO-8859-1"));
wholeForm
.
add
(
"formValues"
,
new
String
(
"{\"fd_3adfe6af71a1cc\":\"王五\", \"fd_3adfe658c6229e\":\"2019-03-26\", \"fd_3adfe6592b4158\":\"这里内容\"}"
.
getBytes
(
"UTF-8"
),
"ISO-8859-1"
)
);
wholeForm
.
add
(
"formValues"
,
formValues
);
//wholeForm.add("formValues", new String("{\"fd_3adfe6af71a1cc\":\"王五\", \"fd_3adfe658c6229e\":\"2019-03-26\", \"fd_3adfe6592b4158\":\"这里内容\"}".getBytes("UTF-8"),"ISO-8859-1") );
System
.
out
.
println
(
"wholeForm:"
+
wholeForm
);
HttpHeaders
headers
=
new
HttpHeaders
();
//如果EKP对该接口启用了Basic认证,那么客户端需要加入
...
...
@@ -128,53 +130,152 @@ public class EKPUtil {
}
}
/**
* 将类转换成EKP要求的格式
*
* @author zhaji
* @param param 转换类
* @return {@link TInsuranceSettlePushParam}
*/
public
static
TInsuranceSettlePushParam
InsuranceDetail2PushParam
(
EKPInteractiveParam
param
){
String
format
=
LocalDate
.
now
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
TInsuranceSettlePushParam
pushParam
=
new
TInsuranceSettlePushParam
();
//ekpId
if
(
null
!=
param
.
getId
()
&&
null
!=
param
.
getDefaultSettleId
()){
pushParam
.
setFd_3afa8a70006bea
(
param
.
getId
()+
CommonConstants
.
DOWN_LINE_STRING
+
param
.
getDefaultSettleId
());
}
else
{
pushParam
.
setFd_3afa8a70006bea
(
CommonConstants
.
EMPTY_STRING
);
}
//单据类型
pushParam
.
setFd_3adfe6af71a1cc
(
param
.
getSettleType
());
if
(
null
!=
param
.
getSettleType
()){
pushParam
.
setFd_3adfe6af71a1cc
(
param
.
getSettleType
());
}
else
{
pushParam
.
setFd_3adfe6af71a1cc
(
CommonConstants
.
ZERO_INT
);
}
//项目编码
pushParam
.
setFd_3adfe658c6229e
(
param
.
getDeptNo
());
if
(
null
!=
param
.
getDeptNo
()){
pushParam
.
setFd_3adfe658c6229e
(
param
.
getDeptNo
());
}
else
{
pushParam
.
setFd_3adfe658c6229e
(
CommonConstants
.
EMPTY_STRING
);
}
//项目名称
pushParam
.
setFd_3adfe6592b4158
(
param
.
getDeptName
());
if
(
null
!=
param
.
getDeptName
()){
pushParam
.
setFd_3adfe6592b4158
(
param
.
getDeptName
());
}
else
{
pushParam
.
setFd_3adfe6592b4158
(
CommonConstants
.
EMPTY_STRING
);
}
//客户编码
pushParam
.
setFd_3adfe6598281e8
(
param
.
getCustomerCode
());
if
(
null
!=
param
.
getCustomerCode
()){
pushParam
.
setFd_3adfe6598281e8
(
param
.
getCustomerCode
());
}
else
{
pushParam
.
setFd_3adfe6598281e8
(
CommonConstants
.
EMPTY_STRING
);
}
//客户名称
pushParam
.
setFd_3adfe7a2688902
(
param
.
getCustomerName
());
if
(
null
!=
param
.
getCustomerName
()){
pushParam
.
setFd_3adfe7a2688902
(
param
.
getCustomerName
());
}
else
{
pushParam
.
setFd_3adfe7a2688902
(
CommonConstants
.
EMPTY_STRING
);
}
//发生日期
pushParam
.
setFd_3adfe67c24dace
(
format
);
//姓名
pushParam
.
setFd_3adfe65d759650
(
param
.
getEmpName
());
if
(
null
!=
param
.
getEmpName
()){
pushParam
.
setFd_3adfe65d759650
(
param
.
getEmpName
());
}
else
{
pushParam
.
setFd_3adfe65d759650
(
CommonConstants
.
EMPTY_STRING
);
}
//身份证号
pushParam
.
setFd_3adfe65dbd9f68
(
param
.
getEmpIdcardNo
());
if
(
null
!=
param
.
getEmpIdcardNo
()){
pushParam
.
setFd_3adfe65dbd9f68
(
param
.
getEmpIdcardNo
());
}
else
{
pushParam
.
setFd_3adfe65dbd9f68
(
CommonConstants
.
EMPTY_STRING
);
}
//发票号
pushParam
.
setFd_3adfe65e0cd094
(
param
.
getInvoiceNo
());
if
(
null
!=
param
.
getInvoiceNo
()){
pushParam
.
setFd_3adfe65e0cd094
(
param
.
getInvoiceNo
());
}
else
{
pushParam
.
setFd_3adfe65e0cd094
(
CommonConstants
.
EMPTY_STRING
);
}
//险种
pushParam
.
setFd_3adfe65f6599e4
(
param
.
getInsuranceTypeName
());
if
(
null
!=
param
.
getInsuranceTypeName
()){
pushParam
.
setFd_3adfe65f6599e4
(
param
.
getInsuranceTypeName
());
}
else
{
pushParam
.
setFd_3adfe65f6599e4
(
CommonConstants
.
EMPTY_STRING
);
}
//保险公司
pushParam
.
setFd_3adfe65ea04728
(
param
.
getInsuranceCompanyName
());
if
(
null
!=
param
.
getInsuranceCompanyName
()){
pushParam
.
setFd_3adfe65ea04728
(
param
.
getInsuranceCompanyName
());
}
else
{
pushParam
.
setFd_3adfe65ea04728
(
CommonConstants
.
EMPTY_STRING
);
}
//保单号
pushParam
.
setFd_3adfe65e60e110
(
param
.
getPolicyNo
());
if
(
null
!=
param
.
getPolicyNo
()){
pushParam
.
setFd_3adfe65e60e110
(
param
.
getPolicyNo
());
}
else
{
pushParam
.
setFd_3adfe65e60e110
(
CommonConstants
.
EMPTY_STRING
);
}
//保险开始日期
pushParam
.
setFd_3adfe6b7e0ede8
(
param
.
getPolicyStart
().
toString
());
if
(
null
!=
param
.
getPolicyStart
()){
pushParam
.
setFd_3adfe6b7e0ede8
(
param
.
getPolicyStart
().
toString
());
}
else
{
pushParam
.
setFd_3adfe6b7e0ede8
(
CommonConstants
.
EMPTY_STRING
);
}
//保险结束日期
pushParam
.
setFd_3adfe6b847bfe6
(
param
.
getPolicyEnd
().
toString
());
if
(
null
!=
param
.
getPolicyEnd
()){
pushParam
.
setFd_3adfe6b847bfe6
(
param
.
getPolicyEnd
().
toString
());
}
else
{
pushParam
.
setFd_3adfe6b847bfe6
(
CommonConstants
.
EMPTY_STRING
);
}
//购买标准
pushParam
.
setFd_3adfe6d55384c6
(
param
.
getBuyStandard
());
if
(
null
!=
param
.
getBuyStandard
()){
pushParam
.
setFd_3adfe6d55384c6
(
param
.
getBuyStandard
());
}
else
{
pushParam
.
setFd_3adfe6d55384c6
(
CommonConstants
.
EMPTY_STRING
);
}
//实际保费
pushParam
.
setFd_3adfe6610c0d2c
(
param
.
getActualPremium
());
if
(
null
!=
param
.
getActualPremium
()){
pushParam
.
setFd_3adfe6610c0d2c
(
param
.
getActualPremium
().
toString
());
}
else
{
pushParam
.
setFd_3adfe6610c0d2c
(
CommonConstants
.
EMPTY_STRING
);
}
//医保
pushParam
.
setFd_3adfe66041a996
(
param
.
getMedicalQuota
());
if
(
null
!=
param
.
getMedicalQuota
()){
pushParam
.
setFd_3adfe66041a996
(
param
.
getMedicalQuota
());
}
else
{
pushParam
.
setFd_3adfe66041a996
(
CommonConstants
.
EMPTY_STRING
);
}
//事故或残疾
pushParam
.
setFd_3adfe6609aa810
(
param
.
getDieDisableQuota
());
if
(
null
!=
param
.
getDieDisableQuota
()){
pushParam
.
setFd_3adfe6609aa810
(
param
.
getDieDisableQuota
());
}
else
{
pushParam
.
setFd_3adfe6609aa810
(
CommonConstants
.
EMPTY_STRING
);
}
//预估保费
pushParam
.
setFd_3adfe6e30f2a3c
(
param
.
getEstimatePremium
());
if
(
null
!=
param
.
getEstimatePremium
()){
pushParam
.
setFd_3adfe6e30f2a3c
(
param
.
getEstimatePremium
().
toString
());
}
else
{
pushParam
.
setFd_3adfe6e30f2a3c
(
CommonConstants
.
EMPTY_STRING
);
}
//结算月
pushParam
.
setFd_3aea2f0180eccc
(
param
.
getSettleMonth
());
if
(
null
!=
param
.
getSettleMonth
()){
pushParam
.
setFd_3aea2f0180eccc
(
param
.
getSettleMonth
());
}
else
{
pushParam
.
setFd_3aea2f0180eccc
(
CommonConstants
.
EMPTY_STRING
);
}
//交易类型
if
(
null
!=
param
.
getInteractiveType
()){
pushParam
.
setFd_3af9197b31071c
(
param
.
getInteractiveType
());
}
else
{
pushParam
.
setFd_3af9197b31071c
(
CommonConstants
.
ZERO_INT
);
}
return
pushParam
;
}
...
...
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/vo/DeptChangeCheckParam.java
View file @
3284da9d
...
...
@@ -122,5 +122,29 @@ public class DeptChangeCheckParam implements Serializable {
@Schema
(
description
=
"实际保费"
)
private
BigDecimal
actualPremium
;
/**
* 客户名称
*/
@Schema
(
description
=
"客户名称"
)
private
String
newCustomerName
;
/**
* 客户编码
*/
@Schema
(
description
=
"客户编码"
)
private
String
newCustomerCode
;
/**
* 客户名称
*/
@Schema
(
description
=
"客户名称"
)
private
String
oldCustomerName
;
/**
* 客户编码
*/
@Schema
(
description
=
"客户编码"
)
private
String
oldCustomerCode
;
}
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/vo/EKPInteractiveParam.java
View file @
3284da9d
...
...
@@ -26,10 +26,17 @@ public class EKPInteractiveParam implements Serializable {
@Schema
(
description
=
"主键"
)
private
String
id
;
/**
* 结算id
*/
@Schema
(
description
=
"结算id"
)
private
String
defaultSettleId
;
/**
* 单据类型 (0、与薪资合并结算 1、单独结算)
*/
@Schema
(
description
=
"单据类型 (
0、预估单 1
、实缴单)"
)
@Schema
(
description
=
"单据类型 (
1、预估单 2
、实缴单)"
)
private
Integer
settleType
;
/**
...
...
@@ -149,7 +156,7 @@ public class EKPInteractiveParam implements Serializable {
/**
* 单据状态
*/
@Schema
(
description
=
"状态:1新增结算单,2
作废结算信息,3更新保单
信息"
)
@Schema
(
description
=
"状态:1新增结算单,2
更新保单信息,3作废结算
信息"
)
private
Integer
interactiveType
;
}
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/vo/TInsuranceSettlePushParam.java
View file @
3284da9d
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
insurances
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.databind.annotation.JsonDeserialize
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer
;
import
com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Builder
;
import
lombok.Data
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
java.math.BigDecimal
;
import
java.time.LocalDate
;
import
java.util.Date
;
/**
* @author zhaji
...
...
@@ -19,10 +16,6 @@ import java.util.Date;
*/
@Data
public
class
TInsuranceSettlePushParam
{
/**
* ID主键 36位
*/
private
String
fd_id
;
/**
* 单据类型 200 单选(1,预估单,2,实缴单,3,差异单)
...
...
@@ -42,12 +35,6 @@ public class TInsuranceSettlePushParam{
@Schema
(
description
=
"项目名称"
)
private
String
fd_3adfe6592b4158
;
/**
* 单号 200
*/
@Schema
(
description
=
"单号"
)
private
String
fd_3adfe67a9f6364
;
/**
* 客户编码 200
*/
...
...
@@ -127,7 +114,7 @@ public class TInsuranceSettlePushParam{
* 实际保费 精确到小数点后两位
*/
@Schema
(
description
=
"实际保费"
)
private
BigDecimal
fd_3adfe6610c0d2c
;
private
String
fd_3adfe6610c0d2c
;
/**
* 医保 精确到小数点后两位
...
...
@@ -145,61 +132,8 @@ public class TInsuranceSettlePushParam{
* 预估保费(应收) 精确到小数点后两位
*/
@Schema
(
description
=
"预估保费"
)
private
BigDecimal
fd_3adfe6e30f2a3c
;
/**
* 结算状态 200 单选(1未结算,2结算中,3已结算)
*/
@Schema
(
description
=
"结算状态"
)
private
String
fd_3adfe6ec6a8cbe
;
/**
* 收款状态 200 单选(1未收,2已收)
*/
@Schema
(
description
=
"收款状态"
)
private
String
fd_3adfe6ef5dfaac
;
/**
* 收入结算单号 200
*/
@Schema
(
description
=
"收入结算单号"
)
private
String
fd_3adfe79fd04606
;
/**
* 收款认领单号 200
*/
@Schema
(
description
=
"收款认领单号"
)
private
String
fd_3adfe7a117f086
;
private
String
fd_3adfe6e30f2a3c
;
/**
* 应支出 精确到小数点后两位
*/
@Schema
(
description
=
"应支出"
)
private
Double
fd_3adfe6e3911ffe
;
/**
* 支出结算状态 200 单选(已结算,结算中,未结算)
*/
@Schema
(
description
=
"支出结算状态"
)
private
String
fd_3adfe6eda67236
;
/**
* 付款状态 200 单选(已收,未收)
*/
@Schema
(
description
=
"付款状态"
)
private
String
fd_3adfe6f05531ec
;
/**
* 支出结算单号 200
*/
@Schema
(
description
=
"支出结算单号"
)
private
String
fd_3adfe7a035849c
;
/**
* 付款单号 200
*/
@Schema
(
description
=
"付款单号"
)
private
String
fd_3adfe7a08eba96
;
/**
* 结算月份 200
...
...
@@ -208,10 +142,16 @@ public class TInsuranceSettlePushParam{
private
String
fd_3aea2f0180eccc
;
/**
* 状态 200
* 交易类型 200
*/
@Schema
(
description
=
"交易类型 1新增结算单,2作废结算信息,3更新保单信息"
)
private
Integer
fd_3af9197b31071c
;
/**
* 商险ID 200
*/
@Schema
(
description
=
"
状态1新增结算单,2作废结算信息,3更新保单信息
"
)
private
String
fd_3af
9197b31071c
;
@Schema
(
description
=
"
商险ID(商险id_结算id)
"
)
private
String
fd_3af
a8a70006bea
;
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/impl/TInsuranceDetailServiceImpl.java
View file @
3284da9d
...
...
@@ -837,6 +837,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
// if 投保类型 == 新增,then 更新保单生效日期为:T+1,无需考虑节假日
detail
.
setPolicyEffect
(
LocalDate
.
now
().
plusDays
(
CommonConstants
.
ONE_INT
));
}
detail
.
setHandledBy
(
user
.
getId
());
detail
.
setHandledTime
(
LocalDateTime
.
now
());
detail
.
setUpdateBy
(
user
.
getId
());
detail
.
setUpdateTime
(
LocalDateTime
.
now
());
detailList
.
add
(
detail
);
...
...
@@ -936,7 +938,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if
(
detail
.
getBuyType
()
==
CommonConstants
.
FOUR_INT
){
//替换者有效状态为空
detail
.
setIsEffect
(
null
);
TInsuranceReplace
one
=
tInsuranceReplaceService
.
getOne
(
Wrappers
.<
TInsuranceReplace
>
query
().
lambda
()
.
eq
(
TInsuranceReplace:
:
getToInsuranceDetailId
,
detail
.
getId
())
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
...
...
@@ -953,11 +954,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
}
// 记录状态置为「退回」
detail
.
setBuyHandleStatus
(
CommonConstants
.
FOUR_INT
);
//投保成功后再次投保退回,需要将保单生效日期、是否有效、是否过期置为空
if
(
detail
.
getSignFlag
()
==
CommonConstants
.
ONE_INT
){
detail
.
setHandledTime
(
null
);
detail
.
setHandledBy
(
null
);
detail
.
setPolicyEffect
(
null
);
detail
.
setIsEffect
(
null
);
detail
.
setIsOverdue
(
null
);
...
...
@@ -991,9 +993,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
tInsuranceSettleService
.
save
(
burden
);
//推送负的给ekp
String
s
=
pushEstimate
(
detail
,
CommonConstants
.
THREE_INT
);
//这里退回的时候,必须置为null,防止是实缴的时候,登记保费出错
detail
.
setDefaultSettleId
(
null
);
if
(
StringUtils
.
isNotBlank
(
s
)){
detail
.
setDefaultSettleId
(
null
);
}
}
}
}
...
...
@@ -1017,6 +1021,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/
@Override
public
R
<
List
<
InsuranceListVO
>>
successfulInsurance
(
List
<
String
>
idList
)
{
ThreadPoolExecutor
threadPool
=
new
ThreadPoolExecutor
(
50
,
50
,
100
,
TimeUnit
.
SECONDS
,
new
LinkedBlockingQueue
<>(
10
));
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
user
==
null
||
Common
.
isEmpty
(
user
.
getId
()))
{
return
R
.
failed
(
CommonConstants
.
PLEASE_LOG_IN
);
...
...
@@ -1048,6 +1053,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail
.
setIsOverdue
(
CommonConstants
.
ZERO_INT
);
detail
.
setIsUse
(
CommonConstants
.
ZERO_INT
);
detail
.
setUpdateTime
(
LocalDateTime
.
now
());
detail
.
setUpdateBy
(
user
.
getId
());
successList
.
add
(
detail
);
}
else
{
//根据结算类型判断是否需要计算预估保费
...
...
@@ -1075,16 +1081,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
settle
.
setInsDetailId
(
detail
.
getId
());
settle
.
setSettleType
(
detail
.
getSettleType
());
settle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
settle
.
setCreateTime
(
LocalDateTime
.
now
());
settle
.
setEstimatePremium
(
estimatePremium
);
//调完ekp接口才会是1
settle
.
setIsEstimatePush
(
CommonConstants
.
ONE_INT
);
settle
.
setEstimatePushTime
(
LocalDateTime
.
now
());
settle
.
setCreateTime
(
LocalDateTime
.
now
());
settle
.
setIsEstimatePush
(
CommonConstants
.
ZERO_INT
);
tInsuranceSettleService
.
save
(
settle
);
detail
.
setDefaultSettleId
(
settle
.
getId
());
successList
.
add
(
detail
);
}
else
{
//按天
//计算起止时间的天数
...
...
@@ -1116,7 +1119,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
settle
.
setCreateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
save
(
settle
);
detail
.
setDefaultSettleId
(
settle
.
getId
());
successList
.
add
(
detail
);
}
}
...
...
@@ -1140,9 +1142,28 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
if
(
CollectionUtils
.
isNotEmpty
(
successList
)){
//更新
this
.
saveOrUpdateBatch
(
successList
);
threadPool
.
execute
(()
->
{
for
(
TInsuranceDetail
tInsuranceDetail
:
successList
)
{
Integer
settleType
=
tInsuranceDetail
.
getSettleType
();
//如果是合并计算则推送至EKP
if
(
CommonConstants
.
ZERO_INT
==
settleType
){
//存储成功后发送给EKP
String
s
=
pushEstimate
(
tInsuranceDetail
,
CommonConstants
.
ONE_INT
);
if
(
StringUtils
.
isNotBlank
(
s
)){
LambdaUpdateWrapper
<
TInsuranceSettle
>
settleWrapper
=
new
LambdaUpdateWrapper
<>();
settleWrapper
.
eq
(
TInsuranceSettle
::
getId
,
tInsuranceDetail
.
getDefaultSettleId
())
.
set
(
TInsuranceSettle
::
getIsEstimatePush
,
CommonConstants
.
ONE_INT
)
.
set
(
TInsuranceSettle
::
getEstimatePushTime
,
LocalDateTime
.
now
());
//更新结算信息表
tInsuranceSettleService
.
update
(
settleWrapper
);
//更新保单信息表
updateById
(
tInsuranceDetail
);
}
}
else
{
updateById
(
tInsuranceDetail
);
}
}
});
//todo 根据结算类型是合并结算,推送预估保费到ekp(上面已经算好,这里直接判断有预估保费的就推送)
//结算状态是待结算,结算中、已结算是ekp反馈的,如果结算失败,反馈到我们这边的状态是待结算
}
...
...
@@ -1162,6 +1183,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/
@Override
public
R
<
List
<
InsuranceRegisterParam
>>
registeredPolicyPremium
(
List
<
InsuranceRegisterParam
>
paramList
)
{
ThreadPoolExecutor
threadPool
=
new
ThreadPoolExecutor
(
50
,
50
,
100
,
TimeUnit
.
SECONDS
,
new
LinkedBlockingQueue
<>(
10
));
if
(
CollectionUtils
.
isEmpty
(
paramList
)){
return
R
.
failed
(
CommonConstants
.
DATA_CAN_NOT_EMPTY
);
}
...
...
@@ -1206,13 +1228,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceSettle
settle
=
tInsuranceSettleService
.
getById
(
detail
.
getDefaultSettleId
());
if
(
Optional
.
ofNullable
(
settle
).
isPresent
()){
settle
.
setActualPremium
(
new
BigDecimal
(
success
.
getActualPremium
()));
settle
.
setIsActualPush
(
CommonConstants
.
ONE_INT
);
settle
.
setActualPushTime
(
LocalDateTime
.
now
());
settle
.
setIsActualPush
(
CommonConstants
.
ZERO_INT
);
settle
.
setUpdateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
updateById
(
settle
);
//调更新接口
//调EKP更新实际保费
detail
.
setActualPremium
(
new
BigDecimal
(
success
.
getActualPremium
()));
threadPool
.
execute
(()
->{
String
s
=
pushEstimate
(
detail
,
CommonConstants
.
FOUR_INT
);
if
(
StringUtils
.
isNotBlank
(
s
)){
settle
.
setActualPushTime
(
LocalDateTime
.
now
());
settle
.
setIsActualPush
(
CommonConstants
.
ONE_INT
);
tInsuranceSettleService
.
updateById
(
settle
);
}
});
}
}
else
{
//保费存储
...
...
@@ -1221,22 +1249,26 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
settle
.
setSettleType
(
detail
.
getSettleType
());
settle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
settle
.
setActualPremium
(
new
BigDecimal
(
success
.
getActualPremium
()));
settle
.
setIsActualPush
(
CommonConstants
.
ZERO_INT
);
//调完ekp接口才会是1
settle
.
setIsActualPush
(
CommonConstants
.
ONE_INT
);
settle
.
setActualPushTime
(
LocalDateTime
.
now
());
settle
.
setCreateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
save
(
settle
);
detail
.
setDefaultSettleId
(
settle
.
getId
());
//调新增接口
//调EKP新增实际保费
detail
.
setActualPremium
(
new
BigDecimal
(
success
.
getActualPremium
()));
threadPool
.
execute
(()
->{
String
s
=
pushEstimate
(
detail
,
CommonConstants
.
TWO_INT
);
if
(
StringUtils
.
isNotBlank
(
s
)){
settle
.
setActualPushTime
(
LocalDateTime
.
now
());
settle
.
setIsActualPush
(
CommonConstants
.
ONE_INT
);
tInsuranceSettleService
.
updateById
(
settle
);
}
});
}
}
detail
.
setActualPremium
(
new
BigDecimal
(
success
.
getActualPremium
()));
}
//可以改成批量更新
this
.
updateById
(
detail
);
detailList
.
add
(
detail
);
}
}
...
...
@@ -2159,18 +2191,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
}
//校验当前项目是否在权限范围内
if
(!
deptNoList
.
stream
().
anyMatch
(
u
->
u
.
equals
(
param
.
getDeptNo
()))){
param
.
setErrorMessage
(
InsurancesConstants
.
OLD_DEPT_NO_NOT_IN_DEPT_LIST
);
listResult
.
add
(
param
);
continue
;
}
//校验当前项目是否在权限范围内
if
(!
deptNoList
.
stream
().
anyMatch
(
u
->
u
.
equals
(
param
.
getReplaceDeptNo
()))){
param
.
setErrorMessage
(
InsurancesConstants
.
NEW_DEPT_NO_NOT_IN_DEPT_LIST
);
listResult
.
add
(
param
);
continue
;
}
//原数据查重校验:姓名 + 身份证号 + 项目编码 + 保险公司 + 险种名称 + 保单开始时间 + 保单结束时间
TInsuranceDetail
detail
=
this
.
baseMapper
.
selectOne
(
Wrappers
.<
TInsuranceDetail
>
query
().
lambda
()
.
eq
(
TInsuranceDetail:
:
getEmpName
,
param
.
getEmpName
())
...
...
@@ -2189,6 +2210,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult
.
add
(
param
);
continue
;
}
else
{
//校验当前项目是否在权限范围内
if
(!
deptNoList
.
stream
().
anyMatch
(
u
->
u
.
equals
(
param
.
getDeptNo
()))){
param
.
setErrorMessage
(
InsurancesConstants
.
OLD_DEPT_NO_NOT_IN_DEPT_LIST
);
listResult
.
add
(
param
);
continue
;
}
//校验当前项目是否在权限范围内
if
(!
deptNoList
.
stream
().
anyMatch
(
u
->
u
.
equals
(
param
.
getReplaceDeptNo
()))){
param
.
setErrorMessage
(
InsurancesConstants
.
NEW_DEPT_NO_NOT_IN_DEPT_LIST
);
listResult
.
add
(
param
);
continue
;
}
// 投保状态 待投保 不能替换
if
(
detail
.
getBuyHandleStatus
()
==
CommonConstants
.
ONE_INT
){
param
.
setErrorMessage
(
InsurancesConstants
.
ONE_REPLACE_IS_NOT_ALLOW
);
...
...
@@ -2904,6 +2937,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceRefund
refund
=
new
TInsuranceRefund
();
detail
.
setId
(
record
.
getId
());
//update状态由「待减员」置为「减员中」
detail
.
setUpdateBy
(
user
.
getId
());
detail
.
setUpdateTime
(
LocalDateTime
.
now
());
detail
.
setReduceHandleStatus
(
CommonConstants
.
TWO_INT
);
detailList
.
add
(
detail
);
...
...
@@ -2981,6 +3015,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
else
{
tInsuranceDetail
.
setBuyHandleStatus
(
CommonConstants
.
THREE_INT
);
}
tInsuranceDetail
.
setUpdateBy
(
user
.
getId
());
tInsuranceDetail
.
setUpdateTime
(
LocalDateTime
.
now
());
successList
.
add
(
tInsuranceDetail
);
//更新减员记录
...
...
@@ -3026,18 +3061,63 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
Map
<
String
,
List
<
SettleMonthChangeCheckParam
>>
map
=
settleMonthChangeCheck
(
settleMonthCheckList
,
user
);
//todo 生成EKP通知,通知ekp变更结算月份
List
<
TInsuranceOperate
>
operateList
=
new
ArrayList
<>();
List
<
TInsuranceOperate
>
operateList
=
new
ArrayList
<>(
16
);
List
<
SettleMonthChangeCheckParam
>
successList
=
map
.
get
(
"successList"
);
List
<
SettleMonthChangeCheckParam
>
errorList
=
map
.
get
(
"errorList"
);
if
(
CollectionUtils
.
isNotEmpty
(
successList
)){
//当前保单结算信息不为空且已推送的情况下,推送EKP进行变更
List
<
EKPInteractiveParam
>
deptDetail
=
getDeptDetail
(
successList
);
for
(
EKPInteractiveParam
ekpInteractiveParam
:
deptDetail
)
{
threadPool
.
execute
(()
->
{
String
settleMonth
=
ekpInteractiveParam
.
getSettleMonth
();
TInsuranceDetail
byId
=
getById
(
ekpInteractiveParam
.
getId
());
BeanCopyUtils
.
copyProperties
(
byId
,
ekpInteractiveParam
);
String
body
=
EKPUtil
.
sendToEKP
(
ekpInteractiveParam
);
System
.
out
.
println
(
"变更成功后的id为:"
+
body
);
if
(!
StringUtils
.
isBlank
(
body
)){
String
defaultSettleId
=
byId
.
getDefaultSettleId
();
if
(
StringUtils
.
isNotBlank
(
defaultSettleId
)){
TInsuranceSettle
settle
=
tInsuranceSettleService
.
getById
(
defaultSettleId
);
Integer
isActualPush
=
settle
.
getIsActualPush
();
Integer
isEstimatePush
=
settle
.
getIsEstimatePush
();
if
(
isEstimatePush
==
CommonConstants
.
ONE_INT
||
isActualPush
==
CommonConstants
.
ONE_INT
){
BeanCopyUtils
.
copyProperties
(
byId
,
ekpInteractiveParam
);
ekpInteractiveParam
.
setSettleMonth
(
settleMonth
);
String
body
=
EKPUtil
.
sendToEKP
(
ekpInteractiveParam
);
if
(!
StringUtils
.
isBlank
(
body
)){
LambdaUpdateWrapper
<
TInsuranceDetail
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
TInsuranceDetail
::
getId
,
ekpInteractiveParam
.
getId
())
.
set
(
TInsuranceDetail
::
getSettleMonth
,
ekpInteractiveParam
.
getSettleMonth
())
.
set
(
TInsuranceDetail
::
getUpdateBy
,
user
.
getId
())
.
set
(
TInsuranceDetail
::
getUpdateTime
,
LocalDateTime
.
now
());
update
(
updateWrapper
);
TInsuranceOperate
insuranceOperate
=
new
TInsuranceOperate
();
insuranceOperate
.
setInsuranceDetailId
(
ekpInteractiveParam
.
getId
());
insuranceOperate
.
setCreateBy
(
user
.
getId
());
insuranceOperate
.
setCreateName
(
user
.
getNickname
());
insuranceOperate
.
setCreateTime
(
LocalDateTime
.
now
());
insuranceOperate
.
setOperateDesc
(
InsurancesConstants
.
MONTH_CHANGE
);
tInsuranceOperateService
.
save
(
insuranceOperate
);
}
else
{
for
(
SettleMonthChangeCheckParam
success:
successList
){
if
(
success
.
getId
().
equals
(
ekpInteractiveParam
.
getId
())){
success
.
setErrorMessage
(
"更新EKP结算月份失败"
);
errorList
.
add
(
success
);
}
}
}
}
else
{
LambdaUpdateWrapper
<
TInsuranceDetail
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
TInsuranceDetail
::
getId
,
ekpInteractiveParam
.
getId
())
.
set
(
TInsuranceDetail
::
getSettleMonth
,
ekpInteractiveParam
.
getSettleMonth
())
.
set
(
TInsuranceDetail
::
getUpdateBy
,
user
.
getId
())
.
set
(
TInsuranceDetail
::
getUpdateTime
,
LocalDateTime
.
now
());
update
(
updateWrapper
);
TInsuranceOperate
insuranceOperate
=
new
TInsuranceOperate
();
insuranceOperate
.
setInsuranceDetailId
(
ekpInteractiveParam
.
getId
());
insuranceOperate
.
setCreateBy
(
user
.
getId
());
insuranceOperate
.
setCreateName
(
user
.
getNickname
());
insuranceOperate
.
setCreateTime
(
LocalDateTime
.
now
());
insuranceOperate
.
setOperateDesc
(
InsurancesConstants
.
MONTH_CHANGE
);
tInsuranceOperateService
.
save
(
insuranceOperate
);
}
}
else
{
LambdaUpdateWrapper
<
TInsuranceDetail
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
TInsuranceDetail
::
getId
,
ekpInteractiveParam
.
getId
())
.
set
(
TInsuranceDetail
::
getSettleMonth
,
ekpInteractiveParam
.
getSettleMonth
())
...
...
@@ -3050,21 +3130,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
insuranceOperate
.
setCreateName
(
user
.
getNickname
());
insuranceOperate
.
setCreateTime
(
LocalDateTime
.
now
());
insuranceOperate
.
setOperateDesc
(
InsurancesConstants
.
MONTH_CHANGE
);
operateList
.
add
(
insuranceOperate
);
System
.
out
.
println
(
"返回的id为:"
+
body
);
}
else
{
System
.
out
.
println
(
"更新EKP结算月份失败"
);
for
(
SettleMonthChangeCheckParam
success:
successList
){
if
(
success
.
getId
().
equals
(
ekpInteractiveParam
.
getId
())){
success
.
setErrorMessage
(
"更新EKP结算月份失败"
);
errorList
.
add
(
success
);
}
}
tInsuranceOperateService
.
save
(
insuranceOperate
);
}
});
}
}
tInsuranceOperateService
.
saveBatch
(
operateList
);
return
R
.
ok
(
errorList
,
"导入成功"
);
}
...
...
@@ -3078,84 +3148,41 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
R
deptChange
(
List
<
DeptChangeCheckParam
>
deptChangeCheckList
)
{
//初始化线程池
ThreadPoolExecutor
threadPool
=
new
ThreadPoolExecutor
(
50
,
50
,
100
,
TimeUnit
.
SECONDS
,
new
LinkedBlockingQueue
<>(
10
));
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(!
Common
.
isNotEmpty
(
deptChangeCheckList
)){
return
R
.
failed
(
"当前变更所属项目列表为空"
);
}
Map
<
String
,
List
<
DeptChangeCheckParam
>>
stringListMap
=
deptChangeCheck
(
deptChangeCheckList
,
user
);
//todo 生成EKP通知,通知ekp变更结算所属项目
List
<
DeptChangeCheckParam
>
successList
=
stringListMap
.
get
(
"successList"
);
List
<
TInsuranceOperate
>
operateList
=
new
ArrayList
<>(
16
);
List
<
TInsuranceDetail
>
detailList
=
new
ArrayList
<>(
16
);
if
(
CollectionUtils
.
isNotEmpty
(
successList
)){
threadPool
.
execute
(()
->
{
for
(
DeptChangeCheckParam
success
:
successList
)
{
TInsuranceDetail
one
=
getOne
(
lambdaQuery
().
getWrapper
().
eq
(
TInsuranceDetail:
:
getId
,
success
.
getId
()));
LambdaUpdateWrapper
<
TInsuranceDetail
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
Integer
oldSettleType
=
success
.
getOldSettleType
();
Integer
newSettleType
=
success
.
getNewSettleType
();
updateWrapper
.
eq
(
TInsuranceDetail
::
getId
,
success
.
getId
())
.
set
(
TInsuranceDetail
::
getDeptNo
,
success
.
getNewDeptNo
())
.
set
(
TInsuranceDetail
::
getSettleType
,
success
.
getNewSettleType
())
.
set
(
TInsuranceDetail
::
getUpdateBy
,
user
.
getId
())
.
set
(
TInsuranceDetail
::
getUpdateTime
,
LocalDateTime
.
now
());
String
insuranceDetailId
=
success
.
getId
();
//结算信息id
String
defaultSettleId
=
success
.
getDefaultSettleId
();
//实际保费
BigDecimal
actualPremium
=
success
.
getActualPremium
();
//如果变更前为单独结算
if
(
CommonConstants
.
ONE_INT
==
oldSettleType
){
//登记了保单保费
if
(!
BigDecimalUtils
.
isNullOrZero
(
actualPremium
)){
//变更后为单独结算
if
(
CommonConstants
.
ONE_INT
==
newSettleType
){
EKPInteractiveParam
interactiveParam
=
new
EKPInteractiveParam
();
TInsuranceDetail
one
=
getOne
(
lambdaQuery
().
getWrapper
().
eq
(
TInsuranceDetail:
:
getId
,
success
.
getId
()));
BeanCopyUtils
.
copyProperties
(
one
,
interactiveParam
);
//更新新的客户,项目信息
LambdaUpdateWrapper
<
TInsuranceDetail
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
Integer
oldSettleType
=
success
.
getOldSettleType
();
Integer
newSettleType
=
success
.
getNewSettleType
();
updateWrapper
.
eq
(
TInsuranceDetail
::
getId
,
success
.
getId
())
.
set
(
TInsuranceDetail
::
getDeptNo
,
success
.
getNewDeptNo
())
.
set
(
TInsuranceDetail
::
getSettleType
,
success
.
getNewSettleType
())
.
set
(
TInsuranceDetail
::
getUpdateBy
,
user
.
getId
())
.
set
(
TInsuranceDetail
::
getUpdateTime
,
LocalDateTime
.
now
());
String
insuranceDetailId
=
success
.
getId
();
//结算信息id
String
defaultSettleId
=
success
.
getDefaultSettleId
();
//实际保费
BigDecimal
actualPremium
=
success
.
getActualPremium
();
//如果变更前为单独结算
if
(
CommonConstants
.
ONE_INT
==
oldSettleType
){
//登记了保单保费
if
(!
BigDecimalUtils
.
isNullOrZero
(
actualPremium
))
{
//根据旧的结算id获取旧的结算信息
TInsuranceSettle
byId
=
tInsuranceSettleService
.
getById
(
defaultSettleId
);
//如果已经推送过实际保费,则先作废,再推送新的实际保费
if
(
byId
.
getIsActualPush
()
==
CommonConstants
.
ONE_INT
){
//作废旧的数据,生成作废结算信息记录
TInsuranceSettleCancel
cancel
=
new
TInsuranceSettleCancel
();
cancel
.
setDeptNo
(
success
.
getOldDeptNo
());
cancel
.
setInsDetailId
(
success
.
getId
());
cancel
.
setSettleId
(
defaultSettleId
);
cancel
.
setCreateUesr
(
user
.
getId
());
cancel
.
setCreateTime
(
LocalDateTime
.
now
());
cancel
.
setDeptName
(
success
.
getOldDeptName
());
cancel
.
setIsCancelPush
(
CommonConstants
.
ZERO_INT
);
tInsuranceSettleCancelService
.
save
(
cancel
);
//推送至EKP执行作废操作
//TODO: 2022/8/2
//推送成功更新推送状态
cancel
.
setIsCancelPush
(
CommonConstants
.
ONE_INT
);
tInsuranceSettleCancelService
.
updateById
(
cancel
);
//生成新的结算信息
TInsuranceSettle
newInsuranceSettle
=
new
TInsuranceSettle
();
newInsuranceSettle
.
setInsDetailId
(
insuranceDetailId
);
newInsuranceSettle
.
setSettleType
(
newSettleType
);
newInsuranceSettle
.
setIsEstimatePush
(
CommonConstants
.
ZERO_INT
);
newInsuranceSettle
.
setIsActualPush
(
CommonConstants
.
ZERO_INT
);
newInsuranceSettle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
newInsuranceSettle
.
setCreateTime
(
LocalDateTime
.
now
());
newInsuranceSettle
.
setActualPremium
(
success
.
getActualPremium
());
tInsuranceSettleService
.
save
(
newInsuranceSettle
);
//赋值新的结算信息id
updateWrapper
.
set
(
TInsuranceDetail
::
getDefaultSettleId
,
newInsuranceSettle
.
getId
());
update
(
updateWrapper
);
//推送新的
// TODO: 2022/8/2
//推送成功更新推送状态
newInsuranceSettle
.
setActualPushTime
(
LocalDateTime
.
now
());
newInsuranceSettle
.
setIsActualPush
(
CommonConstants
.
ONE_INT
);
newInsuranceSettle
.
setUpdateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
updateById
(
newInsuranceSettle
);
}
//如果没有推送过实际保费
if
(
byId
.
getIsActualPush
()
==
CommonConstants
.
ZERO_INT
){
//推送新的至EKP
}
}
//变更后为合并结算
if
(
CommonConstants
.
ZERO_INT
==
newSettleType
){
//作废旧的数据,生成作废结算信息记录
TInsuranceSettleCancel
cancel
=
new
TInsuranceSettleCancel
();
cancel
.
setDeptNo
(
success
.
getOldDeptNo
());
...
...
@@ -3166,80 +3193,162 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
cancel
.
setDeptName
(
success
.
getOldDeptName
());
cancel
.
setIsCancelPush
(
CommonConstants
.
ZERO_INT
);
tInsuranceSettleCancelService
.
save
(
cancel
);
//查询旧的结算信息
TInsuranceSettle
byId
=
tInsuranceSettleService
.
getById
(
defaultSettleId
);
//推送EKP
// TODO: 2022/8/2
//推送成功更新作废推送状态
cancel
.
setIsCancelPush
(
CommonConstants
.
ONE_INT
);
tInsuranceSettleCancelService
.
updateById
(
cancel
);
//新增新的结算信息
TInsuranceSettle
newInsuranceSettle
=
new
TInsuranceSettle
();
newInsuranceSettle
.
setInsDetailId
(
insuranceDetailId
);
newInsuranceSettle
.
setSettleType
(
newSettleType
);
newInsuranceSettle
.
setIsEstimatePush
(
CommonConstants
.
ZERO_INT
);
newInsuranceSettle
.
setIsActualPush
(
CommonConstants
.
ZERO_INT
);
newInsuranceSettle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
newInsuranceSettle
.
setCreateTime
(
LocalDateTime
.
now
());
newInsuranceSettle
.
setActualPremium
(
success
.
getActualPremium
());
newInsuranceSettle
.
setEstimatePremium
(
success
.
getEstimatePremium
());
//生成新的结算信息
tInsuranceSettleService
.
save
(
newInsuranceSettle
);
//赋值新的预估费用和新的结算信息
updateWrapper
.
set
(
TInsuranceDetail
::
getEstimatePremium
,
success
.
getEstimatePremium
());
updateWrapper
.
set
(
TInsuranceDetail
::
getDefaultSettleId
,
newInsuranceSettle
.
getId
());
update
(
updateWrapper
);
//推送EKP
// TODO: 2022/8/2
//推送成功后更新本地推送状态
newInsuranceSettle
.
setActualPushTime
(
LocalDateTime
.
now
());
newInsuranceSettle
.
setEstimatePushTime
(
LocalDateTime
.
now
());
newInsuranceSettle
.
setIsActualPush
(
CommonConstants
.
ONE_INT
);
newInsuranceSettle
.
setIsEstimatePush
(
CommonConstants
.
ONE_INT
);
newInsuranceSettle
.
setUpdateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
updateById
(
newInsuranceSettle
);
}
}
//未登记保单保费
if
(
BigDecimalUtils
.
isNullOrZero
(
actualPremium
)){
//变更后为单独结算
if
(
CommonConstants
.
ONE_INT
==
newSettleType
){
//变更项目且不做处理
update
(
updateWrapper
);
//如果已经推送过实际保费,则先作废,再推送新的实际保费
if
(
byId
.
getIsActualPush
()
==
CommonConstants
.
ONE_INT
)
{
//TODO: 2022/8/2
//推送至EKP执行作废操作
interactiveParam
.
setActualPremium
(
one
.
getActualPremium
());
interactiveParam
.
setCustomerCode
(
success
.
getOldCustomerCode
());
interactiveParam
.
setCustomerName
(
success
.
getOldCustomerName
());
interactiveParam
.
setDeptNo
(
success
.
getOldDeptNo
());
interactiveParam
.
setDeptName
(
success
.
getOldDeptName
());
interactiveParam
.
setInteractiveType
(
CommonConstants
.
THREE_INT
);
String
deleteBody
=
EKPUtil
.
sendToEKP
(
interactiveParam
);
if
(
StringUtils
.
isNotBlank
(
deleteBody
))
{
//推送成功更新作废推送状态
cancel
.
setIsCancelPush
(
CommonConstants
.
ONE_INT
);
tInsuranceSettleCancelService
.
updateById
(
cancel
);
//变更后为单独结算
if
(
CommonConstants
.
ONE_INT
==
newSettleType
)
{
//生成新的结算信息
TInsuranceSettle
newInsuranceSettle
=
new
TInsuranceSettle
();
newInsuranceSettle
.
setInsDetailId
(
insuranceDetailId
);
newInsuranceSettle
.
setSettleType
(
newSettleType
);
newInsuranceSettle
.
setIsEstimatePush
(
CommonConstants
.
ZERO_INT
);
newInsuranceSettle
.
setIsActualPush
(
CommonConstants
.
ZERO_INT
);
newInsuranceSettle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
newInsuranceSettle
.
setCreateTime
(
LocalDateTime
.
now
());
newInsuranceSettle
.
setActualPremium
(
success
.
getActualPremium
());
tInsuranceSettleService
.
save
(
newInsuranceSettle
);
//赋值新的结算信息id
updateWrapper
.
set
(
TInsuranceDetail:
:
getDefaultSettleId
,
newInsuranceSettle
.
getId
());
update
(
updateWrapper
);
// TODO: 2022/8/2
//推送新的结算信息至EKP
interactiveParam
.
setSettleType
(
CommonConstants
.
ONE_INT
);
interactiveParam
.
setInteractiveType
(
CommonConstants
.
ONE_INT
);
interactiveParam
.
setCustomerCode
(
success
.
getNewCustomerCode
());
interactiveParam
.
setCustomerName
(
success
.
getNewCustomerName
());
interactiveParam
.
setDeptNo
(
success
.
getNewDeptNo
());
interactiveParam
.
setDeptName
(
success
.
getNewDeptName
());
interactiveParam
.
setActualPremium
(
success
.
getActualPremium
());
String
addBody
=
EKPUtil
.
sendToEKP
(
interactiveParam
);
if
(
StringUtils
.
isNotBlank
(
addBody
)){
newInsuranceSettle
.
setActualPushTime
(
LocalDateTime
.
now
());
newInsuranceSettle
.
setIsActualPush
(
CommonConstants
.
ONE_INT
);
newInsuranceSettle
.
setUpdateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
updateById
(
newInsuranceSettle
);
}
else
{
//异常处理 // TODO: 2022/8/9
}
}
//变更后为合并结算
if
(
CommonConstants
.
ZERO_INT
==
newSettleType
)
{
//新增新的结算信息
TInsuranceSettle
newInsuranceSettle
=
new
TInsuranceSettle
();
newInsuranceSettle
.
setInsDetailId
(
insuranceDetailId
);
newInsuranceSettle
.
setSettleType
(
newSettleType
);
newInsuranceSettle
.
setIsEstimatePush
(
CommonConstants
.
ZERO_INT
);
newInsuranceSettle
.
setIsActualPush
(
CommonConstants
.
ZERO_INT
);
newInsuranceSettle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
newInsuranceSettle
.
setCreateTime
(
LocalDateTime
.
now
());
newInsuranceSettle
.
setActualPremium
(
success
.
getActualPremium
());
newInsuranceSettle
.
setEstimatePremium
(
success
.
getEstimatePremium
());
//生成新的结算信息
tInsuranceSettleService
.
save
(
newInsuranceSettle
);
//赋值新的预估费用和新的结算信息
updateWrapper
.
set
(
TInsuranceDetail:
:
getEstimatePremium
,
success
.
getEstimatePremium
());
updateWrapper
.
set
(
TInsuranceDetail:
:
getDefaultSettleId
,
newInsuranceSettle
.
getId
());
update
(
updateWrapper
);
//推送EKP
// TODO: 2022/8/2
//先推送预估,再推送实际
interactiveParam
.
setCustomerCode
(
success
.
getNewCustomerCode
());
interactiveParam
.
setCustomerName
(
success
.
getNewCustomerName
());
interactiveParam
.
setDeptNo
(
success
.
getNewDeptNo
());
interactiveParam
.
setDeptName
(
success
.
getNewDeptName
());
interactiveParam
.
setInteractiveType
(
CommonConstants
.
ONE_INT
);
//推送预估单
interactiveParam
.
setEstimatePremium
(
success
.
getEstimatePremium
());
interactiveParam
.
setActualPremium
(
null
);
interactiveParam
.
setSettleType
(
CommonConstants
.
ZERO_INT
);
String
estimateBody
=
EKPUtil
.
sendToEKP
(
interactiveParam
);
if
(
StringUtils
.
isNotBlank
(
estimateBody
))
{
newInsuranceSettle
.
setEstimatePushTime
(
LocalDateTime
.
now
());
newInsuranceSettle
.
setIsEstimatePush
(
CommonConstants
.
ONE_INT
);
newInsuranceSettle
.
setUpdateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
updateById
(
newInsuranceSettle
);
//推送实缴单
interactiveParam
.
setSettleType
(
CommonConstants
.
ONE_INT
);
interactiveParam
.
setEstimatePremium
(
null
);
interactiveParam
.
setActualPremium
(
success
.
getActualPremium
());
String
actualBody
=
EKPUtil
.
sendToEKP
(
interactiveParam
);
if
(
StringUtils
.
isNotBlank
(
actualBody
))
{
//推送成功后更新本地推送状态
newInsuranceSettle
.
setActualPushTime
(
LocalDateTime
.
now
());
newInsuranceSettle
.
setIsActualPush
(
CommonConstants
.
ONE_INT
);
newInsuranceSettle
.
setUpdateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
updateById
(
newInsuranceSettle
);
}
else
{
//异常处理 // TODO: 2022/8/9
}
}
}
}
}
else
{
//异常处理 // TODO: 2022/8/9
}
}
//变更后为合并结算
if
(
CommonConstants
.
ZERO_INT
==
newSettleType
){
//生成预估结算信息
TInsuranceSettle
tInsuranceSettle
=
new
TInsuranceSettle
();
tInsuranceSettle
.
setInsDetailId
(
success
.
getId
());
tInsuranceSettle
.
setSettleType
(
success
.
getNewSettleType
());
tInsuranceSettle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
tInsuranceSettle
.
setEstimatePremium
(
success
.
getEstimatePremium
());
tInsuranceSettle
.
setIsActualPush
(
CommonConstants
.
ZERO_INT
);
tInsuranceSettle
.
setIsEstimatePush
(
CommonConstants
.
ZERO_INT
);
tInsuranceSettle
.
setCreateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
save
(
tInsuranceSettle
);
//将结算id赋值给保单信息,并新增预估费用
updateWrapper
.
set
(
TInsuranceDetail
::
getEstimatePremium
,
success
.
getEstimatePremium
())
.
set
(
TInsuranceDetail
::
getDefaultSettleId
,
tInsuranceSettle
.
getId
());
update
(
updateWrapper
);
//推送结算信息至EKP
// TODO: 2022/8/2
//推送成功后更新本地推送状态
tInsuranceSettle
.
setIsEstimatePush
(
CommonConstants
.
ONE_INT
);
tInsuranceSettle
.
setEstimatePushTime
(
LocalDateTime
.
now
());
tInsuranceSettle
.
setUpdateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
updateById
(
tInsuranceSettle
);
//未登记保单保费
if
(
BigDecimalUtils
.
isNullOrZero
(
actualPremium
)){
//变更后为单独结算
if
(
CommonConstants
.
ONE_INT
==
newSettleType
){
//变更项目且不做处理
update
(
updateWrapper
);
}
//变更后为合并结算
if
(
CommonConstants
.
ZERO_INT
==
newSettleType
){
//生成预估结算信息
TInsuranceSettle
tInsuranceSettle
=
new
TInsuranceSettle
();
tInsuranceSettle
.
setInsDetailId
(
success
.
getId
());
tInsuranceSettle
.
setSettleType
(
success
.
getNewSettleType
());
tInsuranceSettle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
tInsuranceSettle
.
setEstimatePremium
(
success
.
getEstimatePremium
());
tInsuranceSettle
.
setIsActualPush
(
CommonConstants
.
ZERO_INT
);
tInsuranceSettle
.
setIsEstimatePush
(
CommonConstants
.
ZERO_INT
);
tInsuranceSettle
.
setCreateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
save
(
tInsuranceSettle
);
//将结算id赋值给保单信息,并新增预估费用
updateWrapper
.
set
(
TInsuranceDetail
::
getEstimatePremium
,
success
.
getEstimatePremium
())
.
set
(
TInsuranceDetail
::
getDefaultSettleId
,
tInsuranceSettle
.
getId
());
update
(
updateWrapper
);
//推送结算信息至EKP
// TODO: 2022/8/2
interactiveParam
.
setCustomerCode
(
success
.
getNewCustomerCode
());
interactiveParam
.
setCustomerName
(
success
.
getNewCustomerName
());
interactiveParam
.
setDeptNo
(
success
.
getNewDeptNo
());
interactiveParam
.
setDeptName
(
success
.
getNewDeptName
());
interactiveParam
.
setInteractiveType
(
CommonConstants
.
ONE_INT
);
interactiveParam
.
setEstimatePremium
(
success
.
getEstimatePremium
());
interactiveParam
.
setActualPremium
(
null
);
interactiveParam
.
setSettleType
(
CommonConstants
.
ZERO_INT
);
String
estimateBody
=
EKPUtil
.
sendToEKP
(
interactiveParam
);
if
(
StringUtils
.
isNotBlank
(
estimateBody
)){
//推送成功后更新本地推送状态
tInsuranceSettle
.
setIsEstimatePush
(
CommonConstants
.
ONE_INT
);
tInsuranceSettle
.
setEstimatePushTime
(
LocalDateTime
.
now
());
tInsuranceSettle
.
setUpdateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
updateById
(
tInsuranceSettle
);
}
else
{
//异常处理 // TODO: 2022/8/9
}
}
}
}
}
//变更前为合并结算
if
(
CommonConstants
.
ZERO_INT
==
oldSettleType
){
//如果已经登记保费
if
(!
BigDecimalUtils
.
isNullOrZero
(
actualPremium
)){
//变更为单独结算
if
(
CommonConstants
.
ONE_INT
==
newSettleType
){
//变更前为合并结算
if
(
CommonConstants
.
ZERO_INT
==
oldSettleType
){
//如果已经登记保费
if
(!
BigDecimalUtils
.
isNullOrZero
(
actualPremium
)){
//作废旧的结算信息
TInsuranceSettleCancel
cancel
=
new
TInsuranceSettleCancel
();
cancel
.
setDeptNo
(
success
.
getOldDeptNo
());
...
...
@@ -3250,82 +3359,104 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
cancel
.
setDeptName
(
success
.
getOldDeptName
());
cancel
.
setIsCancelPush
(
CommonConstants
.
ZERO_INT
);
tInsuranceSettleCancelService
.
save
(
cancel
);
TInsuranceSettle
byId
=
tInsuranceSettleService
.
getById
(
defaultSettleId
);
//推送EKP
// TODO: 2022/8/2
//推送成功更新作废推送状态
cancel
.
setIsCancelPush
(
CommonConstants
.
ONE_INT
);
tInsuranceSettleCancelService
.
updateById
(
cancel
);
//新增新的结算信息
TInsuranceSettle
newInsuranceSettle
=
new
TInsuranceSettle
();
newInsuranceSettle
.
setInsDetailId
(
insuranceDetailId
);
newInsuranceSettle
.
setSettleType
(
newSettleType
);
newInsuranceSettle
.
setIsEstimatePush
(
CommonConstants
.
ZERO_INT
);
newInsuranceSettle
.
setIsActualPush
(
CommonConstants
.
ZERO_INT
);
newInsuranceSettle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
newInsuranceSettle
.
setCreateTime
(
LocalDateTime
.
now
());
newInsuranceSettle
.
setActualPremium
(
success
.
getActualPremium
());
tInsuranceSettleService
.
save
(
newInsuranceSettle
);
//更新预估费用为0.00
updateWrapper
.
set
(
TInsuranceDetail
::
getEstimatePremium
,
new
BigDecimal
(
"0.00"
));
updateWrapper
.
set
(
TInsuranceDetail
::
getDefaultSettleId
,
newInsuranceSettle
.
getId
());
update
(
updateWrapper
);
//推送新的结算信息至EKP
//推送作废结算信息至EKP
// TODO: 2022/8/2
//推送成功,更新推送状态
newInsuranceSettle
.
setIsActualPush
(
CommonConstants
.
ONE_INT
);
newInsuranceSettle
.
setActualPushTime
(
LocalDateTime
.
now
());
newInsuranceSettle
.
setUpdateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
updateById
(
newInsuranceSettle
);
}
//变更为合并结算
if
(
CommonConstants
.
ZERO_INT
==
newSettleType
){
//作废旧的结算信息
TInsuranceSettleCancel
cancel
=
new
TInsuranceSettleCancel
();
cancel
.
setDeptNo
(
success
.
getOldDeptNo
());
cancel
.
setInsDetailId
(
success
.
getId
());
cancel
.
setSettleId
(
defaultSettleId
);
cancel
.
setCreateUesr
(
user
.
getId
());
cancel
.
setCreateTime
(
LocalDateTime
.
now
());
cancel
.
setDeptName
(
success
.
getOldDeptName
());
cancel
.
setIsCancelPush
(
CommonConstants
.
ZERO_INT
);
tInsuranceSettleCancelService
.
save
(
cancel
);
TInsuranceSettle
byId
=
tInsuranceSettleService
.
getById
(
defaultSettleId
);
//推送EKP
// TODO: 2022/8/2
//推送成功更新作废推送状态
cancel
.
setIsCancelPush
(
CommonConstants
.
ONE_INT
);
tInsuranceSettleCancelService
.
updateById
(
cancel
);
//新增新的结算信息
TInsuranceSettle
newInsuranceSettle
=
new
TInsuranceSettle
();
newInsuranceSettle
.
setInsDetailId
(
insuranceDetailId
);
newInsuranceSettle
.
setSettleType
(
newSettleType
);
newInsuranceSettle
.
setIsEstimatePush
(
CommonConstants
.
ZERO_INT
);
newInsuranceSettle
.
setIsActualPush
(
CommonConstants
.
ZERO_INT
);
newInsuranceSettle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
newInsuranceSettle
.
setCreateTime
(
LocalDateTime
.
now
());
newInsuranceSettle
.
setActualPremium
(
success
.
getActualPremium
());
newInsuranceSettle
.
setEstimatePremium
(
success
.
getEstimatePremium
());
tInsuranceSettleService
.
save
(
newInsuranceSettle
);
//更新预估费用为新的预估费用
updateWrapper
.
set
(
TInsuranceDetail
::
getEstimatePremium
,
success
.
getEstimatePremium
());
updateWrapper
.
set
(
TInsuranceDetail
::
getDefaultSettleId
,
newInsuranceSettle
.
getId
());
update
(
updateWrapper
);
//推送新的结算信息
// TODO: 2022/8/2
//推送成功,更新预估和实际保费的推送状态
newInsuranceSettle
.
setIsEstimatePush
(
CommonConstants
.
ONE_INT
);
newInsuranceSettle
.
setEstimatePushTime
(
LocalDateTime
.
now
());
newInsuranceSettle
.
setIsActualPush
(
CommonConstants
.
ONE_INT
);
newInsuranceSettle
.
setActualPushTime
(
LocalDateTime
.
now
());
newInsuranceSettle
.
setUpdateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
updateById
(
newInsuranceSettle
);
interactiveParam
.
setCustomerCode
(
success
.
getOldCustomerCode
());
interactiveParam
.
setCustomerName
(
success
.
getOldCustomerName
());
interactiveParam
.
setDeptNo
(
success
.
getOldDeptNo
());
interactiveParam
.
setDeptName
(
success
.
getOldDeptName
());
interactiveParam
.
setInteractiveType
(
CommonConstants
.
THREE_INT
);
interactiveParam
.
setEstimatePremium
(
one
.
getEstimatePremium
());
interactiveParam
.
setActualPremium
(
one
.
getActualPremium
());
interactiveParam
.
setSettleType
(
CommonConstants
.
ZERO_INT
);
String
deleteBody
=
EKPUtil
.
sendToEKP
(
interactiveParam
);
if
(
StringUtils
.
isNotBlank
(
deleteBody
)){
//推送成功更新作废推送状态
cancel
.
setIsCancelPush
(
CommonConstants
.
ONE_INT
);
tInsuranceSettleCancelService
.
updateById
(
cancel
);
//变更为单独结算
if
(
CommonConstants
.
ONE_INT
==
newSettleType
){
//新增新的结算信息
TInsuranceSettle
newInsuranceSettle
=
new
TInsuranceSettle
();
newInsuranceSettle
.
setInsDetailId
(
insuranceDetailId
);
newInsuranceSettle
.
setSettleType
(
newSettleType
);
newInsuranceSettle
.
setIsEstimatePush
(
CommonConstants
.
ZERO_INT
);
newInsuranceSettle
.
setIsActualPush
(
CommonConstants
.
ZERO_INT
);
newInsuranceSettle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
newInsuranceSettle
.
setCreateTime
(
LocalDateTime
.
now
());
newInsuranceSettle
.
setActualPremium
(
success
.
getActualPremium
());
tInsuranceSettleService
.
save
(
newInsuranceSettle
);
//更新预估费用为0.00
updateWrapper
.
set
(
TInsuranceDetail
::
getEstimatePremium
,
new
BigDecimal
(
"0.00"
));
updateWrapper
.
set
(
TInsuranceDetail
::
getDefaultSettleId
,
newInsuranceSettle
.
getId
());
update
(
updateWrapper
);
//推送新的结算信息至EKP,先推预估单,再推实际保费
// TODO: 2022/8/2
interactiveParam
.
setCustomerCode
(
success
.
getNewCustomerCode
());
interactiveParam
.
setCustomerName
(
success
.
getNewCustomerName
());
interactiveParam
.
setDeptNo
(
success
.
getNewDeptNo
());
interactiveParam
.
setDeptName
(
success
.
getNewDeptName
());
interactiveParam
.
setInteractiveType
(
CommonConstants
.
ONE_INT
);
interactiveParam
.
setEstimatePremium
(
null
);
interactiveParam
.
setActualPremium
(
success
.
getActualPremium
());
interactiveParam
.
setSettleType
(
CommonConstants
.
ONE_INT
);
String
actualBody
=
EKPUtil
.
sendToEKP
(
interactiveParam
);
if
(
StringUtils
.
isNotBlank
(
actualBody
)){
//推送成功,更新推送状态
newInsuranceSettle
.
setIsActualPush
(
CommonConstants
.
ONE_INT
);
newInsuranceSettle
.
setActualPushTime
(
LocalDateTime
.
now
());
newInsuranceSettle
.
setUpdateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
updateById
(
newInsuranceSettle
);
}
else
{
//异常处理 // TODO: 2022/8/9
}
}
//变更为合并结算
if
(
CommonConstants
.
ZERO_INT
==
newSettleType
){
//新增新的结算信息
TInsuranceSettle
newInsuranceSettle
=
new
TInsuranceSettle
();
newInsuranceSettle
.
setInsDetailId
(
insuranceDetailId
);
newInsuranceSettle
.
setSettleType
(
newSettleType
);
newInsuranceSettle
.
setIsEstimatePush
(
CommonConstants
.
ZERO_INT
);
newInsuranceSettle
.
setIsActualPush
(
CommonConstants
.
ZERO_INT
);
newInsuranceSettle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
newInsuranceSettle
.
setCreateTime
(
LocalDateTime
.
now
());
newInsuranceSettle
.
setActualPremium
(
success
.
getActualPremium
());
newInsuranceSettle
.
setEstimatePremium
(
success
.
getEstimatePremium
());
tInsuranceSettleService
.
save
(
newInsuranceSettle
);
//更新预估费用为新的预估费用
updateWrapper
.
set
(
TInsuranceDetail
::
getEstimatePremium
,
success
.
getEstimatePremium
());
updateWrapper
.
set
(
TInsuranceDetail
::
getDefaultSettleId
,
newInsuranceSettle
.
getId
());
update
(
updateWrapper
);
//推送新的结算信息
// TODO: 2022/8/2
interactiveParam
.
setCustomerCode
(
success
.
getNewCustomerCode
());
interactiveParam
.
setCustomerName
(
success
.
getNewCustomerName
());
interactiveParam
.
setDeptNo
(
success
.
getNewDeptNo
());
interactiveParam
.
setDeptName
(
success
.
getNewDeptName
());
interactiveParam
.
setInteractiveType
(
CommonConstants
.
ONE_INT
);
interactiveParam
.
setEstimatePremium
(
null
);
interactiveParam
.
setActualPremium
(
success
.
getActualPremium
());
interactiveParam
.
setSettleType
(
CommonConstants
.
ONE_INT
);
String
actualBody
=
EKPUtil
.
sendToEKP
(
interactiveParam
);
//推送成功,更新预估和实际保费的推送状态
if
(
StringUtils
.
isNotBlank
(
actualBody
)){
newInsuranceSettle
.
setIsEstimatePush
(
CommonConstants
.
ONE_INT
);
newInsuranceSettle
.
setEstimatePushTime
(
LocalDateTime
.
now
());
newInsuranceSettle
.
setIsActualPush
(
CommonConstants
.
ONE_INT
);
newInsuranceSettle
.
setActualPushTime
(
LocalDateTime
.
now
());
newInsuranceSettle
.
setUpdateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
updateById
(
newInsuranceSettle
);
}
else
{
//异常处理 // TODO: 2022/8/9
}
}
}
else
{
//异常处理 // TODO: 2022/8/9
}
}
}
//如果没有登记保费
if
(
BigDecimalUtils
.
isNullOrZero
(
actualPremium
)){
//变更为单独结算
if
(
CommonConstants
.
ONE_INT
==
newSettleType
){
//如果没有登记保费
if
(
BigDecimalUtils
.
isNullOrZero
(
actualPremium
)){
//作废旧的结算信息
TInsuranceSettleCancel
cancel
=
new
TInsuranceSettleCancel
();
cancel
.
setDeptNo
(
success
.
getOldDeptNo
());
...
...
@@ -3338,56 +3469,68 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceSettleCancelService
.
save
(
cancel
);
//推送至EKP
// TODO: 2022/8/2
//推送成功后更新作废信息推送状态
cancel
.
setIsCancelPush
(
CommonConstants
.
ONE_INT
);
tInsuranceSettleCancelService
.
updateById
(
cancel
);
//删除预估费用和结算id
updateWrapper
.
set
(
TInsuranceDetail
::
getEstimatePremium
,
new
BigDecimal
(
"0.00"
));
updateWrapper
.
set
(
TInsuranceDetail
::
getDefaultSettleId
,
null
);
update
(
updateWrapper
);
}
//变更为合并结算
if
(
CommonConstants
.
ZERO_INT
==
newSettleType
){
//作废旧的结算信息
TInsuranceSettleCancel
cancel
=
new
TInsuranceSettleCancel
();
cancel
.
setDeptNo
(
success
.
getOldDeptNo
());
cancel
.
setInsDetailId
(
success
.
getId
());
cancel
.
setSettleId
(
defaultSettleId
);
cancel
.
setCreateUesr
(
user
.
getId
());
cancel
.
setCreateTime
(
LocalDateTime
.
now
());
cancel
.
setDeptName
(
success
.
getOldDeptName
());
cancel
.
setIsCancelPush
(
CommonConstants
.
ZERO_INT
);
tInsuranceSettleCancelService
.
save
(
cancel
);
TInsuranceSettle
byId
=
tInsuranceSettleService
.
getById
(
defaultSettleId
);
//推送至EKP作废
// TODO: 2022/8/2
//推送成功更新作废推送状态
cancel
.
setIsCancelPush
(
CommonConstants
.
ONE_INT
);
tInsuranceSettleCancelService
.
updateById
(
cancel
);
//新增新的结算信息
TInsuranceSettle
newInsuranceSettle
=
new
TInsuranceSettle
();
newInsuranceSettle
.
setInsDetailId
(
insuranceDetailId
);
newInsuranceSettle
.
setSettleType
(
newSettleType
);
newInsuranceSettle
.
setIsEstimatePush
(
CommonConstants
.
ZERO_INT
);
newInsuranceSettle
.
setIsActualPush
(
CommonConstants
.
ZERO_INT
);
newInsuranceSettle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
newInsuranceSettle
.
setCreateTime
(
LocalDateTime
.
now
());
newInsuranceSettle
.
setEstimatePremium
(
success
.
getEstimatePremium
());
tInsuranceSettleService
.
save
(
newInsuranceSettle
);
//更新预估费用
updateWrapper
.
set
(
TInsuranceDetail
::
getEstimatePremium
,
success
.
getEstimatePremium
());
updateWrapper
.
set
(
TInsuranceDetail
::
getDefaultSettleId
,
newInsuranceSettle
.
getId
());
update
(
updateWrapper
);
//推送新的结算信息至EKP
// TODO: 2022/8/2
//推送成功更新预估推送状态
newInsuranceSettle
.
setIsEstimatePush
(
CommonConstants
.
ONE_INT
);
newInsuranceSettle
.
setEstimatePushTime
(
LocalDateTime
.
now
());
newInsuranceSettle
.
setUpdateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
updateById
(
newInsuranceSettle
);
interactiveParam
.
setCustomerCode
(
success
.
getOldCustomerCode
());
interactiveParam
.
setCustomerName
(
success
.
getOldCustomerName
());
interactiveParam
.
setDeptNo
(
success
.
getOldDeptNo
());
interactiveParam
.
setDeptName
(
success
.
getOldDeptName
());
interactiveParam
.
setInteractiveType
(
CommonConstants
.
THREE_INT
);
interactiveParam
.
setEstimatePremium
(
one
.
getEstimatePremium
());
interactiveParam
.
setSettleType
(
CommonConstants
.
ZERO_INT
);
String
deleteBody
=
EKPUtil
.
sendToEKP
(
interactiveParam
);
if
(
StringUtils
.
isNotBlank
(
deleteBody
)){
//推送成功后更新作废信息推送状态
cancel
.
setIsCancelPush
(
CommonConstants
.
ONE_INT
);
tInsuranceSettleCancelService
.
updateById
(
cancel
);
//变更为单独结算
if
(
CommonConstants
.
ONE_INT
==
newSettleType
){
//删除预估费用和结算id
updateWrapper
.
set
(
TInsuranceDetail
::
getEstimatePremium
,
new
BigDecimal
(
"0.00"
));
updateWrapper
.
set
(
TInsuranceDetail
::
getDefaultSettleId
,
null
);
update
(
updateWrapper
);
}
//变更为合并结算
if
(
CommonConstants
.
ZERO_INT
==
newSettleType
){
//新增新的结算信息
TInsuranceSettle
newInsuranceSettle
=
new
TInsuranceSettle
();
newInsuranceSettle
.
setInsDetailId
(
insuranceDetailId
);
newInsuranceSettle
.
setSettleType
(
newSettleType
);
newInsuranceSettle
.
setIsEstimatePush
(
CommonConstants
.
ZERO_INT
);
newInsuranceSettle
.
setIsActualPush
(
CommonConstants
.
ZERO_INT
);
newInsuranceSettle
.
setSettleHandleStatus
(
CommonConstants
.
ONE_STRING
);
newInsuranceSettle
.
setCreateTime
(
LocalDateTime
.
now
());
newInsuranceSettle
.
setEstimatePremium
(
success
.
getEstimatePremium
());
tInsuranceSettleService
.
save
(
newInsuranceSettle
);
//更新预估费用
updateWrapper
.
set
(
TInsuranceDetail
::
getEstimatePremium
,
success
.
getEstimatePremium
());
updateWrapper
.
set
(
TInsuranceDetail
::
getDefaultSettleId
,
newInsuranceSettle
.
getId
());
update
(
updateWrapper
);
//推送新的结算信息至EKP
// TODO: 2022/8/2
interactiveParam
.
setCustomerCode
(
success
.
getNewCustomerCode
());
interactiveParam
.
setCustomerName
(
success
.
getNewCustomerName
());
interactiveParam
.
setDeptNo
(
success
.
getNewDeptNo
());
interactiveParam
.
setDeptName
(
success
.
getNewDeptName
());
interactiveParam
.
setInteractiveType
(
CommonConstants
.
ONE_INT
);
interactiveParam
.
setEstimatePremium
(
success
.
getEstimatePremium
());
interactiveParam
.
setActualPremium
(
null
);
interactiveParam
.
setSettleType
(
CommonConstants
.
ONE_INT
);
String
estimateBody
=
EKPUtil
.
sendToEKP
(
interactiveParam
);
if
(
StringUtils
.
isNotBlank
(
estimateBody
)){
//推送成功更新预估推送状态
newInsuranceSettle
.
setIsEstimatePush
(
CommonConstants
.
ONE_INT
);
newInsuranceSettle
.
setEstimatePushTime
(
LocalDateTime
.
now
());
newInsuranceSettle
.
setUpdateTime
(
LocalDateTime
.
now
());
tInsuranceSettleService
.
updateById
(
newInsuranceSettle
);
}
else
{
//异常处理 // TODO: 2022/8/9
}
}
}
else
{
//异常处理 // TODO: 2022/8/9
}
}
}
}
//新增操作信息
TInsuranceOperate
insuranceOperate
=
new
TInsuranceOperate
();
insuranceOperate
.
setInsuranceDetailId
(
success
.
getId
());
...
...
@@ -3396,12 +3539,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
insuranceOperate
.
setCreateTime
(
LocalDateTime
.
now
());
insuranceOperate
.
setOperateDesc
(
InsurancesConstants
.
DEPT_CHANGE
);
operateList
.
add
(
insuranceOperate
);
detailList
.
add
(
one
);
}
});
}
tInsuranceOperateService
.
saveBatch
(
operateList
);
List
<
DeptChangeCheckParam
>
errorList
=
stringListMap
.
get
(
"errorList"
);
//EKPUtil.testAddNewsInRestTemplate(detailList);
return
R
.
ok
(
errorList
,
"导入成功"
);
}
...
...
@@ -3892,7 +4034,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.
eq
(
TInsuranceDetail
::
getEmpName
,
empName
)
.
eq
(
TInsuranceDetail
::
getEmpIdcardNo
,
empIdCardNo
)
.
eq
(
TInsuranceDetail
::
getInsuranceCompanyName
,
insuranceCompanyName
)
.
eq
(
TInsuranceDetail
::
getDeptNo
,
deptNo
).
eq
(
TInsuranceDetail
::
getBuyStandard
,
buyStandard
)
.
eq
(
TInsuranceDetail
::
getDeptNo
,
deptNo
)
.
eq
(
TInsuranceDetail
::
getBuyStandard
,
buyStandard
)
.
eq
(
TInsuranceDetail
::
getInsuranceTypeName
,
insuranceTypeName
)
.
eq
(
TInsuranceDetail
::
getPolicyStart
,
LocalDateUtil
.
parseLocalDate
(
policyStart
)
)
.
eq
(
TInsuranceDetail
::
getPolicyEnd
,
LocalDateUtil
.
parseLocalDate
(
policyEnd
))
...
...
@@ -3953,7 +4096,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if
(
StringUtils
.
isNotEmpty
(
defaultSettleId
)){
//查询结算状态
LambdaQueryWrapper
<
TInsuranceSettle
>
insuranceSettleQuery
=
new
LambdaQueryWrapper
<>();
insuranceSettleQuery
.
eq
(
TInsuranceSettle
::
getI
nsDetailId
,
insuranceDetail
.
getId
()
);
insuranceSettleQuery
.
eq
(
TInsuranceSettle
::
getI
d
,
defaultSettleId
);
TInsuranceSettle
insuranceSettle
=
tInsuranceSettleService
.
getOne
(
insuranceSettleQuery
);
if
(!
Common
.
isEmpty
(
insuranceSettle
)){
//当前结算状态为结算中时,不能变更结算月
...
...
@@ -4115,7 +4258,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue
;
}
param
.
setOldDeptName
(
oldJsonObject
.
getDepartName
());
param
.
setOldCustomerCode
(
oldJsonObject
.
getCustomerCode
());
param
.
setOldCustomerName
(
oldJsonObject
.
getCustomerName
());
param
.
setNewDeptName
(
jsonObject
.
getDepartName
());
param
.
setNewCustomerName
(
jsonObject
.
getCustomerName
());
param
.
setOldCustomerCode
(
jsonObject
.
getCustomerCode
());
String
settleType
=
jsonObject
.
getInsuranceSettleType
();
if
(
StringUtils
.
isEmpty
(
settleType
)){
param
.
setErrorMessage
(
InsurancesConstants
.
PROJECT_NOT_FIND_SETTLE_TYPE
);
...
...
@@ -4164,6 +4311,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList
.
add
(
param
);
continue
;
}
//旧项目ID不在当前权限范围内
if
(!
deptNoList
.
stream
().
anyMatch
(
u
->
u
.
equals
(
oldDeptNo
))){
param
.
setErrorMessage
(
InsurancesConstants
.
OLD_DEPT_NO_NOT_IN_DEPT_LIST
);
errorList
.
add
(
param
);
continue
;
}
//新项目ID不在当前权限范围内
if
(!
deptNoList
.
stream
().
anyMatch
(
u
->
u
.
equals
(
newDeptNo
))){
param
.
setErrorMessage
(
InsurancesConstants
.
NEW_DEPT_NO_NOT_IN_DEPT_LIST
);
errorList
.
add
(
param
);
continue
;
}
//替换类型的保单不能变更所属项目
Integer
buyType
=
insuranceDetail
.
getBuyType
();
if
(
CommonConstants
.
FOUR_INT
==
buyType
){
...
...
@@ -4377,6 +4536,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
/**
* 获取项目权限
*
* @author zhaji
* @param user
* @return {@link List< String>}
*/
public
List
<
String
>
getDeptNoList
(
YifuUser
user
){
List
<
String
>
deptList
=
new
ArrayList
<>(
16
);
String
id
=
user
.
getId
();
...
...
@@ -4408,6 +4574,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return
deptList
;
}
/**
* 获取地市权限
*
* @author zhaji
* @param user
* @return {@link String}
*/
public
String
getRegionSQL
(
YifuUser
user
){
String
id
=
user
.
getId
();
String
sql
;
...
...
@@ -4444,6 +4617,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
for
(
SettleMonthChangeCheckParam
param
:
list
)
{
ProjectSetInfoVo
projectSetInfoVo
=
data
.
get
(
param
.
getDeptNo
());
ekpInteractiveParam
.
setId
(
param
.
getId
());
ekpInteractiveParam
.
setSettleMonth
(
param
.
getSettleMonth
());
ekpInteractiveParam
.
setDeptName
(
projectSetInfoVo
.
getDepartName
());
ekpInteractiveParam
.
setCustomerName
(
projectSetInfoVo
.
getCustomerName
());
ekpInteractiveParam
.
setCustomerCode
(
projectSetInfoVo
.
getCustomerCode
());
...
...
@@ -4454,4 +4628,61 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
/**
* 投保成功后推送预估保费
*
* @author zhaji
* @param
* @return {@link String}
*/
public
String
pushEstimate
(
TInsuranceDetail
tInsuranceDetail
,
Integer
pushType
){
//1,推送预估保费,2,推送实际保费,3推送预估冲正保费,4更新实际保费
EKPInteractiveParam
param
=
new
EKPInteractiveParam
();
List
<
String
>
deptNoList
=
new
ArrayList
<>();
deptNoList
.
add
(
tInsuranceDetail
.
getDeptNo
());
BeanCopyUtils
.
copyProperties
(
tInsuranceDetail
,
param
);
//获取当前项目的名称,客户名称和客户编码
R
<
SetInfoVo
>
setInfoByCodes
=
archivesDaprUtil
.
getSetInfoByCodes
(
deptNoList
);
if
(
null
!=
setInfoByCodes
&&
setInfoByCodes
.
getCode
()
==
CommonConstants
.
SUCCESS
&&
Common
.
isNotNull
(
setInfoByCodes
.
getData
()))
{
SetInfoVo
data
=
setInfoByCodes
.
getData
();
Map
<
String
,
ProjectSetInfoVo
>
projectSetInfoVoMap
=
data
.
getProjectSetInfoVoMap
();
ProjectSetInfoVo
projectSetInfoVo
=
projectSetInfoVoMap
.
get
(
tInsuranceDetail
.
getDeptNo
());
param
.
setDeptName
(
projectSetInfoVo
.
getDepartName
());
param
.
setCustomerName
(
projectSetInfoVo
.
getCustomerName
());
param
.
setCustomerCode
(
projectSetInfoVo
.
getCustomerCode
());
}
//1,推送预估保费(用户办理成功,推送预估保费)
if
(
CommonConstants
.
ONE_INT
==
pushType
){
param
.
setInteractiveType
(
CommonConstants
.
ONE_INT
);
param
.
setSettleType
(
CommonConstants
.
ONE_INT
);
}
//2,推送实际保费(用于登记保单保费未推送过实缴保费)
if
(
CommonConstants
.
TWO_INT
==
pushType
){
param
.
setInteractiveType
(
CommonConstants
.
ONE_INT
);
param
.
setSettleType
(
CommonConstants
.
TWO_INT
);
}
//3推送预估冲正保费(用于投保退回场景)
if
(
CommonConstants
.
THREE_INT
==
pushType
){
String
defaultSettleId
=
tInsuranceDetail
.
getDefaultSettleId
();
TInsuranceSettle
byId
=
tInsuranceSettleService
.
getById
(
defaultSettleId
);
//冲正取负数
if
(
null
!=
byId
.
getEstimatePremium
()){
param
.
setEstimatePremium
(
byId
.
getEstimatePremium
().
negate
());
}
if
(
null
!=
byId
.
getActualPremium
()){
param
.
setActualPremium
(
byId
.
getActualPremium
().
negate
());
}
param
.
setInteractiveType
(
CommonConstants
.
ONE_INT
);
param
.
setSettleType
(
CommonConstants
.
ONE_INT
);
}
//4更新实际保费(用于登记保单保费场景推送过实缴保费)
if
(
CommonConstants
.
FOUR_INT
==
pushType
){
param
.
setInteractiveType
(
CommonConstants
.
TWO_INT
);
param
.
setSettleType
(
CommonConstants
.
ONE_INT
);
}
String
body
=
EKPUtil
.
sendToEKP
(
param
);
return
body
;
}
}
yifu-insurances/yifu-insurances-biz/src/main/resources/mapper/TInsuranceDetailMapper.xml
View file @
3284da9d
...
...
@@ -51,7 +51,9 @@
<result
property=
"updateBy"
column=
"UPDATE_BY"
jdbcType=
"VARCHAR"
/>
<result
property=
"updateTime"
column=
"UPDATE_TIME"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"deleteFlag"
column=
"DELETE_FLAG"
jdbcType=
"TINYINT"
/>
</resultMap>
<result
property=
"handledBy"
column=
"HANDLED_BY"
jdbcType=
"VARCHAR"
/>
<result
property=
"handledTime"
column=
"HANDLED_TIME"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
ID,EMP_NAME,
...
...
@@ -65,8 +67,8 @@
BUY_HANDLE_STATUS,DEFAULT_SETTLE_ID,REDUCE_HANDLE_STATUS,
IS_USE,IS_EFFECT,IS_OVERDUE,REMARK,
CREATE_BY,CREATE_NAME,CREATE_TIME,
UPDATE_BY,UPDATE_TIME,DELETE_FLAG,DEFAULT_SETTLE_ID
</sql>
UPDATE_BY,UPDATE_TIME,DELETE_FLAG,DEFAULT_SETTLE_ID
,HANDLED_BY,HANDLED_TIME
</sql>
<!--投保办理分页查询-->
<select
id=
"getInsuranceListPage"
resultType=
"com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceListVO"
>
select detail.id as id,
...
...
@@ -167,7 +169,7 @@
and ${param.regionSql}
</if>
<if
test=
"param.updateBy != null and param.updateBy.trim() != ''"
>
and detail.
UPDATE
_BY = #{param.updateBy}
and detail.
HANDLED
_BY = #{param.updateBy}
</if>
ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC
</select>
...
...
@@ -886,7 +888,6 @@
<where>
1=1
AND EMP_IDCARD_NO = #{idCard}
AND IS_EFFECT = 0
</where>
ORDER BY CREATE_TIME desc
</select>
...
...
yifu-social/yifu-social-api/src/main/java/com/yifu/cloud/plus/v1/yifu/social/entity/TSocialFundInfo.java
View file @
3284da9d
...
...
@@ -1038,4 +1038,8 @@ public class TSocialFundInfo extends BaseEntity {
@Schema
(
description
=
"派单ID"
)
@ExcelProperty
(
"派单ID"
)
private
String
dispatchId
;
// 执行月份,整体调基使用的
@TableField
(
exist
=
false
)
private
String
doMonth
;
}
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/controller/TForecastLibraryController.java
View file @
3284da9d
...
...
@@ -160,7 +160,7 @@ public class TForecastLibraryController {
@Operation
(
summary
=
"每日定时刷新社保公积金信息、预估数据,根据新增的户数据"
,
description
=
"每日定时刷新社保公积金信息、预估数据,根据新增的户数据"
)
@SysLog
(
"每日定时刷新社保公积金信息、预估数据,根据新增的户数据"
)
@Inner
@
Ge
tMapping
(
"/inner/updateForecastLibaryBySysBase"
)
@
Pos
tMapping
(
"/inner/updateForecastLibaryBySysBase"
)
public
void
updateForecastLibaryBySysBase
()
{
tForecastLibraryService
.
updateForecastLibaryBySysBase
(
null
);
}
...
...
@@ -174,7 +174,7 @@ public class TForecastLibraryController {
@Operation
(
summary
=
"每月定时生成下月预估库数据"
,
description
=
"每月定时生成下月预估库数据"
)
@SysLog
(
"每月定时生成下月预估库数据"
)
@Inner
@
Ge
tMapping
(
"/inner/everyMonthCreateForecastLibary"
)
@
Pos
tMapping
(
"/inner/everyMonthCreateForecastLibary"
)
public
void
everyMonthCreateForecastLibary
()
{
tForecastLibraryService
.
everyMonthCreateForecastLibary
();
}
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/TForecastLibraryService.java
View file @
3284da9d
...
...
@@ -97,7 +97,7 @@ public interface TForecastLibraryService extends IService<TForecastLibrary> {
void
updateForecastLibaryBySysBase
(
SysBaseSetInfo
newSysBaseSetInfo
);
/**
* @Description: 每月定时预估库
TODO-加定时器
* @Description: 每月定时预估库
* @Author: hgw
* @Date: 2022/7/26 19:09
* @return: void
...
...
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TForecastLibraryServiceImpl.java
View file @
3284da9d
...
...
@@ -27,6 +27,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.*
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
com.yifu.cloud.plus.v1.yifu.social.constants.SocialConstants
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.SysBaseSetInfo
;
import
com.yifu.cloud.plus.v1.yifu.social.entity.TAgentConfig
;
...
...
@@ -749,6 +751,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
// 大病处理: 0 收取 按派单的社保里的基数和比例来
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
sysBaseSetInfo
.
getIsIllness
()))
{
// 大病收取方式 0.按年 判断当前月份是否收取大病 按年收大病起缴月份收取一次,非当年的 大病 按实际收取月份收取大病金额
this
.
setBigMoney
(
library
,
socialInfo
,
sysBaseSetInfo
,
socialInfo
.
getPaymentType
());
// 大病处理: 1 不收取
}
else
{
...
...
@@ -1427,20 +1430,34 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
if
(
sysBaseSetInfoList
!=
null
&&
!
sysBaseSetInfoList
.
isEmpty
())
{
Map
<
String
,
TSocialFundInfo
>
socialFundInfoMap
=
new
HashMap
<>();
List
<
TSocialFundInfo
>
socialFundInfoList
;
Date
startDate
;
for
(
SysBaseSetInfo
sysBaseSetInfo
:
sysBaseSetInfoList
)
{
// 社保
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
sysBaseSetInfo
.
getBaseType
()))
{
socialFundInfoList
=
socialFundInfoMapper
.
selectList
(
Wrappers
.<
TSocialFundInfo
>
query
().
lambda
()
.
eq
(
TSocialFundInfo:
:
getSocialHousehold
,
sysBaseSetInfo
.
getDepartId
()));
.
eq
(
TSocialFundInfo:
:
getSocialHousehold
,
sysBaseSetInfo
.
getDepartId
())
.
in
(
TSocialFundInfo:
:
getSocialStatus
,
CommonConstants
.
dingleDigitStrArray
[
3
],
CommonConstants
.
dingleDigitStrArray
[
4
])
.
isNotNull
(
TSocialFundInfo:
:
getSocialId
)
);
for
(
TSocialFundInfo
socialFundInfo
:
socialFundInfoList
)
{
// 2022-8-9 15:26:20 新增逻辑:从不收取变为收取
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
sysBaseSetInfo
.
getIsIllness
())
&&
socialFundInfo
.
getBigailmentStart
()
==
null
)
{
startDate
=
DateUtil
.
stringToDate
(
sysBaseSetInfo
.
getDoMonth
(),
"yyyyMM"
);
socialFundInfo
.
setBigailmentHandle
(
CommonConstants
.
ONE_STRING
);
socialFundInfo
.
setBigailmentStart
(
startDate
);
}
this
.
changeSocialInfoByBase
(
socialFundInfo
,
sysBaseSetInfo
);
socialFundInfo
.
setDoMonth
(
sysBaseSetInfo
.
getDoMonth
());
socialFundInfoMap
.
put
(
socialFundInfo
.
getId
(),
socialFundInfo
);
}
}
// 公积金
if
(
CommonConstants
.
ONE_STRING
.
equals
(
sysBaseSetInfo
.
getBaseType
()))
{
socialFundInfoList
=
socialFundInfoMapper
.
selectList
(
Wrappers
.<
TSocialFundInfo
>
query
().
lambda
()
.
eq
(
TSocialFundInfo:
:
getProvidentHousehold
,
sysBaseSetInfo
.
getDepartId
()));
.
eq
(
TSocialFundInfo:
:
getProvidentHousehold
,
sysBaseSetInfo
.
getDepartId
())
.
eq
(
TSocialFundInfo:
:
getFundStatus
,
CommonConstants
.
dingleDigitStrArray
[
3
])
.
isNotNull
(
TSocialFundInfo:
:
getFundId
)
);
for
(
TSocialFundInfo
socialFundInfo
:
socialFundInfoList
)
{
this
.
changeFundInfoByBase
(
socialFundInfo
,
sysBaseSetInfo
);
socialFundInfoMap
.
put
(
socialFundInfo
.
getId
(),
socialFundInfo
);
...
...
@@ -1448,7 +1465,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
}
}
for
(
TSocialFundInfo
socialFundInfo
:
socialFundInfoMap
.
values
())
{
this
.
updateForecastLibaryCore
(
socialFundInfo
,
null
);
this
.
updateForecastLibaryCore
(
socialFundInfo
,
socialFundInfo
.
getDoMonth
(),
true
);
socialFundInfoMapper
.
updateById
(
socialFundInfo
);
}
}
...
...
@@ -1463,7 +1480,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
**/
@Override
public
R
<
String
>
updateToneForecastLibary
(
TSocialFundInfo
socialFundInfo
,
String
doMonth
)
{
return
this
.
updateForecastLibaryCore
(
socialFundInfo
,
doMonth
);
return
this
.
updateForecastLibaryCore
(
socialFundInfo
,
doMonth
,
false
);
}
/**
...
...
@@ -1475,7 +1492,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
**/
@Override
public
R
<
String
>
updateForecastLibaryByDispatch
(
TSocialFundInfo
socialFundInfo
)
{
return
this
.
updateForecastLibaryCore
(
socialFundInfo
,
null
);
return
this
.
updateForecastLibaryCore
(
socialFundInfo
,
null
,
false
);
}
/**
...
...
@@ -1595,13 +1612,14 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
}
/**
* @param isOnly 是否仅更新传过来的社保公积金,true:是
* @param socialFundInfo
* @Description: 根据社保公积金信息表更新预估库
* @Author: hgw
* @Date: 2022/7/26 19:01
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
private
R
<
String
>
updateForecastLibaryCore
(
TSocialFundInfo
socialFundInfo
,
String
doMonth
)
{
private
R
<
String
>
updateForecastLibaryCore
(
TSocialFundInfo
socialFundInfo
,
String
doMonth
,
boolean
isOnly
)
{
String
empIdCard
=
socialFundInfo
.
getEmpIdcard
();
//定义未推送的按条件查询得到的预估数据
List
<
TForecastLibrary
>
librarySocialList
=
null
;
...
...
@@ -1630,6 +1648,9 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
monthDiff
=
DateUtil
.
getMonthDiff
(
minStartDate
,
new
Date
())
+
2
;
}
List
<
String
>
payMonthList
=
new
ArrayList
<>();
if
(
monthDiff
<=
0
)
{
return
R
.
failed
(
"同步预估库,起缴月份无法生成,monthDiff="
+
monthDiff
);
}
for
(
int
i
=
0
;
i
<
monthDiff
;
i
++)
{
payMonthList
.
add
(
DateUtil
.
addMonth
(
1
-
i
));
}
...
...
@@ -1666,8 +1687,19 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
.
eq
(
TForecastLibrary:
:
getDataType
,
CommonConstants
.
ONE_INT
)
.
in
(
TForecastLibrary:
:
getProvidentPayMonth
,
payMonthList
)
.
eq
(
TForecastLibrary:
:
getDataPush
,
CommonConstants
.
ONE_INT
));
socialInfoList
=
socialFundInfoMapper
.
getSocialList
(
empIdCard
,
null
);
fundList
=
socialFundInfoMapper
.
getFundList
(
empIdCard
,
null
);
if
(
isOnly
)
{
if
(
Common
.
isNotNull
(
socialFundInfo
.
getSocialId
()))
{
socialInfoList
=
new
ArrayList
<>();
socialInfoList
.
add
(
socialFundInfo
);
}
if
(
Common
.
isNotNull
(
socialFundInfo
.
getFundId
()))
{
fundList
=
new
ArrayList
<>();
fundList
.
add
(
socialFundInfo
);
}
}
else
{
socialInfoList
=
socialFundInfoMapper
.
getSocialList
(
empIdCard
,
null
);
fundList
=
socialFundInfoMapper
.
getFundList
(
empIdCard
,
null
);
}
}
if
(
Common
.
isEmpty
(
socialInfoList
)
&&
Common
.
isEmpty
(
fundList
))
{
...
...
@@ -1697,16 +1729,27 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
,
fundHistoryMap
,
socialPushMap
,
fundPushMap
,
saveLibraryMap
,
isReduceSocial
,
isReduceFund
);
if
(
coreR
!=
null
)
return
coreR
;
boolean
isSaveAndUpdate
=
false
;
YifuUser
user
=
SecurityUtils
.
getUser
();
String
userId
=
"305"
;
String
userName
=
"系统"
;
if
(
user
!=
null
)
{
userId
=
user
.
getId
();
userName
=
user
.
getNickname
();
}
for
(
TForecastLibrary
library
:
saveLibraryMap
.
values
())
{
if
(
Common
.
isEmpty
(
library
.
getSocialId
())
&&
Common
.
isEmpty
(
library
.
getProvidentId
()))
{
continue
;
}
if
(
Common
.
isNotNull
(
library
.
getId
()))
{
library
.
setUpdateBy
(
userId
);
library
.
setUpdateTime
(
LocalDateTime
.
now
());
baseMapper
.
updateById
(
library
);
isSaveAndUpdate
=
true
;
}
else
{
if
(
BigDecimal
.
ZERO
.
compareTo
(
BigDecimalUtils
.
isNullToZero
(
library
.
getUnitSocialSum
()))
!=
CommonConstants
.
ZERO_INT
||
BigDecimal
.
ZERO
.
compareTo
(
BigDecimalUtils
.
isNullToZero
(
library
.
getUnitFundSum
()))
!=
CommonConstants
.
ZERO_INT
)
{
library
.
setCreateBy
(
userId
);
library
.
setCreateName
(
userName
);
library
.
setCreateTime
(
LocalDateTime
.
now
());
baseMapper
.
insert
(
library
);
isSaveAndUpdate
=
true
;
...
...
@@ -1983,8 +2026,12 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
continue
;
}
if
(
Common
.
isNotNull
(
library
.
getId
()))
{
library
.
setUpdateBy
(
"305"
);
library
.
setUpdateTime
(
LocalDateTime
.
now
());
baseMapper
.
updateById
(
library
);
}
else
{
library
.
setCreateBy
(
"305"
);
library
.
setCreateName
(
"定时生成"
);
library
.
setCreateTime
(
LocalDateTime
.
now
());
baseMapper
.
insert
(
library
);
}
...
...
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