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
8cdc2fb5
Commit
8cdc2fb5
authored
Jul 19, 2022
by
李灿灿
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商险新增接口
parent
6cd41c41
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
487 additions
and
86 deletions
+487
-86
InsurancesConstants.java
...lus/v1/yifu/insurances/constants/InsurancesConstants.java
+44
-0
TInsuranceDetail.java
...loud/plus/v1/yifu/insurances/entity/TInsuranceDetail.java
+24
-6
TInsuranceTypeStandard.java
...lus/v1/yifu/insurances/entity/TInsuranceTypeStandard.java
+1
-1
LocalDateUtil.java
...ifu/cloud/plus/v1/yifu/insurances/util/LocalDateUtil.java
+155
-0
InsuranceAddParam.java
...u/cloud/plus/v1/yifu/insurances/vo/InsuranceAddParam.java
+47
-0
TInsuranceDetailController.java
...ifu/insurances/controller/TInsuranceDetailController.java
+15
-13
TInsuranceDetailService.java
...s/v1/yifu/insurances/service/TInsuranceDetailService.java
+11
-8
TInsuranceDetailServiceImpl.java
.../insurances/service/impl/TInsuranceDetailServiceImpl.java
+182
-53
TInsuranceDetailMapper.xml
...-biz/src/main/resources/mapper/TInsuranceDetailMapper.xml
+7
-4
TInsuranceTypeStandardMapper.xml
...rc/main/resources/mapper/TInsuranceTypeStandardMapper.xml
+1
-1
No files found.
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/constants/InsurancesConstants.java
View file @
8cdc2fb5
...
...
@@ -11,6 +11,10 @@ public class InsurancesConstants {
* 新增投保成功
*/
public
static
final
String
ADD_SUCCESS
=
"新增投保成功"
;
/**
* 投保信息已存在
*/
public
static
final
String
DATA_IS_EXIST
=
"投保信息已存在"
;
/**
* 订单编号不能为空
*/
...
...
@@ -23,6 +27,10 @@ public class InsurancesConstants {
* 员工身份证号不能为空
*/
public
static
final
String
EMP_IDCARD_NO_NOT_EMPTY
=
"员工身份证号不能为空"
;
/**
* 员工身份证号格式有误
*/
public
static
final
String
EMP_IDCARD_NO_NOT_LEGITIMATE
=
"员工身份证号格式有误"
;
/**
* 项目编码不能为空
*/
...
...
@@ -31,18 +39,46 @@ public class InsurancesConstants {
* 保险公司名称不能为空
*/
public
static
final
String
INSURANCE_COMPANY_NAME_NOT_EMPTY
=
"保险公司名称不能为空"
;
/**
* 保险公司不存在
*/
public
static
final
String
INSURANCE_COMPANY_NAME_NOT_EXIST
=
"保险公司不存在"
;
/**
* 险种名称不能为空
*/
public
static
final
String
INSURANCE_TYPE_NAME_NOT_EMPTY
=
"险种名称不能为空"
;
/**
* 险种不存在
*/
public
static
final
String
INSURANCE_TYPE_NAME_NOT_EXIST
=
"险种不存在"
;
/**
* 保单开始时间不能为空
*/
public
static
final
String
POLICY_START_NOT_EMPTY
=
"保单开始时间不能为空"
;
/**
* 保单开始时间格式错误
*/
public
static
final
String
POLICY_START_PARSE_ERROR
=
"保单开始时间格式错误"
;
/**
* 保单开始时间不能小于派单时间
*/
public
static
final
String
POLICY_START_SHOULD_IS_FUTURE
=
"保单开始时间不能小于派单时间"
;
/**
* 保单结束时间不能为空
*/
public
static
final
String
POLICY_END_NOT_EMPTY
=
"保单结束时间不能为空"
;
/**
* 保单结束时间格式错误
*/
public
static
final
String
POLICY_END_PARSE_ERROR
=
"保单结束时间格式错误"
;
/**
* 购买标准不能为空
*/
public
static
final
String
BUY_STANDARD_NOT_EMPTY
=
"购买标准不能为空"
;
/**
* 购买标准不存在
*/
public
static
final
String
BUY_STANDARD_NOT_EXIST
=
"购买标准不存在"
;
/**
* 商险购买地省名称不能为空
*/
...
...
@@ -63,6 +99,14 @@ public class InsurancesConstants {
* 结算月不能为空
*/
public
static
final
String
SETTLE_MONTH_NOT_EMPTY
=
"结算月不能为空"
;
/**
* 结算月格式错误
*/
public
static
final
String
SETTLE_MONTH_PARSE_ERROR
=
"结算月格式错误"
;
/**
* 结算月不能小于派单月
*/
public
static
final
String
SETTLE_MONTH_SHOULD_IS_FUTURE
=
"结算月不能小于派单月"
;
/**
* 岗位不能为空
*/
...
...
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/entity/TInsuranceDetail.java
View file @
8cdc2fb5
...
...
@@ -72,11 +72,17 @@ public class TInsuranceDetail extends BaseEntity {
@Schema
(
description
=
"保险公司名称"
)
private
String
insuranceCompanyName
;
/**
* 险种名称
*/
@Schema
(
description
=
"险种名称"
)
private
String
insuranceTypeName
;
/**
* 险种主键
*/
@Schema
(
description
=
"险种主键"
)
private
Stri
ng
insuranceTypeId
;
private
Lo
ng
insuranceTypeId
;
/**
* 购买标准
...
...
@@ -84,6 +90,18 @@ public class TInsuranceDetail extends BaseEntity {
@Schema
(
description
=
"购买标准"
)
private
String
buyStandard
;
/**
* 医疗额度
*/
@Schema
(
description
=
"医疗额度"
)
private
String
medicalQuota
;
/**
* 身故或残疾额度
*/
@Schema
(
description
=
"身故或残疾额度"
)
private
String
dieDisableQuota
;
/**
* 保单编号
*/
...
...
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/entity/TInsuranceTypeStandard.java
View file @
8cdc2fb5
...
...
@@ -25,7 +25,7 @@ public class TInsuranceTypeStandard extends BaseEntity {
/**
* 险种主键ID
*/
private
Stri
ng
insuranceTypeId
;
private
Lo
ng
insuranceTypeId
;
/**
* 购买标准
...
...
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/util/LocalDateUtil.java
0 → 100644
View file @
8cdc2fb5
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
insurances
.
util
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
java.text.DateFormat
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDate
;
import
java.time.format.DateTimeFormatter
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.Locale
;
/**
* @author licancan
* @description 日期工具类
* @date 2022-07-19 14:20:54
*/
public
class
LocalDateUtil
{
/**
* 年格式:yyyy
*/
public
static
final
String
NORM_YEAR_PATTERN
=
"yyyy"
;
/**
* 年月格式:yyyy-MM
*/
public
static
final
String
NORM_MONTH_PATTERN
=
"yyyy-MM"
;
/**
* 标准日期格式:yyyy-MM-dd
*/
public
static
final
String
NORM_DATE_PATTERN
=
"yyyy-MM-dd"
;
/**
* 标准时间格式:HH:mm:ss
*/
public
static
final
String
NORM_TIME_PATTERN
=
"HH:mm:ss"
;
/**
* 标准日期时间格式,精确到分:yyyy-MM-dd HH:mm
*/
public
static
final
String
NORM_DATETIME_MINUTE_PATTERN
=
"yyyy-MM-dd HH:mm"
;
/**
* 标准日期时间格式,精确到秒:yyyy-MM-dd HH:mm:ss
*/
public
static
final
String
NORM_DATETIME_PATTERN
=
"yyyy-MM-dd HH:mm:ss"
;
/**
* 判断是否是日期
*
* @author licancan
* @param strDate
* @return {@link Boolean}
*/
public
static
Boolean
isDate
(
String
strDate
,
String
pattern
){
if
(
Common
.
isEmpty
(
strDate
)){
return
false
;
}
try
{
DateFormat
dateFormat
=
new
SimpleDateFormat
(
pattern
);
Date
date
=
dateFormat
.
parse
(
strDate
);
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
setTime
(
date
);
return
true
;
}
catch
(
ParseException
pe
){
System
.
out
.
println
(
"日期解析异常,返回false"
);
return
false
;
}
}
/**
* 字符串格式的日期转LocalDate
*
* @author licancan
* @param strDate
* @return {@link LocalDate}
*/
public
static
LocalDate
parseLocalDate
(
String
strDate
){
DateTimeFormatter
dateTimeFormatter
=
DateTimeFormatter
.
ofPattern
(
NORM_DATE_PATTERN
,
Locale
.
CHINA
);
LocalDate
localDate
=
LocalDate
.
parse
(
strDate
,
dateTimeFormatter
);
return
localDate
;
}
/**
* 判断时间是否是将来时间(大于当天)
*
* @author licancan
* @param strDate
* @return {@link boolean}
*/
public
static
boolean
isFutureDate
(
String
strDate
){
boolean
flag
=
false
;
//在日期字符串非空时执行
if
(!
Common
.
isEmpty
(
strDate
))
{
//今日的开始时间
Date
nowDate
=
new
Date
();
Date
pastDate
=
null
;
//格式化日期
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
NORM_DATE_PATTERN
,
Locale
.
CHINA
);
try
{
//将字符串转为日期格式,如果此处字符串为非合法日期就会抛出异常。
pastDate
=
sdf
.
parse
(
strDate
);
//调用Date里面的after方法来做判断
flag
=
pastDate
.
after
(
nowDate
);
if
(
flag
)
{
System
.
out
.
println
(
"该日期晚于今日"
);
}
else
{
System
.
out
.
println
(
"该日期早于今日"
);
}
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
}
else
{
System
.
out
.
println
(
"日期参数不可为空"
);
}
return
flag
;
}
/**
* 判断传入的月份是否大于等于本月(结算月份 >= 派单月份)
*
* @author licancan
* @param strMonth 传入的月份
* @return {@link boolean}
*/
public
static
boolean
isCurrentOrFutureMonth
(
String
strMonth
){
boolean
flag
=
false
;
//在日期字符串非空时执行
if
(!
Common
.
isEmpty
(
strMonth
))
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
NORM_MONTH_PATTERN
,
Locale
.
CHINA
);
try
{
//当前时间
Calendar
cal1
=
Calendar
.
getInstance
();
//传入的字符串解析时间
Calendar
cal2
=
Calendar
.
getInstance
();
Date
parseDate
=
sdf
.
parse
(
strMonth
);
cal2
.
setTime
(
parseDate
);
if
(
cal1
==
null
||
cal2
==
null
)
{
throw
new
IllegalArgumentException
(
"The date must not be null"
);
}
if
(
cal2
.
get
(
Calendar
.
YEAR
)
>
cal1
.
get
(
Calendar
.
YEAR
)){
flag
=
true
;
}
else
if
(
cal2
.
get
(
Calendar
.
YEAR
)
==
cal1
.
get
(
Calendar
.
YEAR
)
&&
cal2
.
get
(
Calendar
.
MONTH
)
>=
cal1
.
get
(
Calendar
.
MONTH
)){
flag
=
true
;
}
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
}
else
{
System
.
out
.
println
(
"年月参数不可为空"
);
}
return
flag
;
}
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
isCurrentOrFutureMonth
(
"2023-1"
));
}
}
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/vo/InsuranceAddParam.java
View file @
8cdc2fb5
...
...
@@ -61,6 +61,12 @@ public class InsuranceAddParam implements Serializable {
@Schema
(
description
=
"保单结束时间"
)
private
String
policyEnd
;
/**
* 购买标准
*/
@Schema
(
description
=
"购买标准"
)
private
String
buyStandard
;
/**
* 商险购买地省名称
*/
...
...
@@ -100,10 +106,51 @@ public class InsuranceAddParam implements Serializable {
/**
* 备注
*/
@Schema
(
description
=
"备注"
)
private
String
remark
;
/**
* 错误信息
*/
private
String
errorMessage
;
/***********************************以下字段由系统算出,前端不用传,是为了方便入库***********************************/
/**
* 结算类型 (1、单独结算 2、合并结算-和工资一起结算)
*/
private
Integer
settleType
;
/**
* 医疗额度
*/
private
String
medicalQuota
;
/**
* 身故或残疾额度
*/
private
String
dieDisableQuota
;
/**
* 险种主键
*/
private
Long
insuranceTypeId
;
/**
* 商险购买地省code
*/
private
Integer
insuranceProvince
;
/**
* 商险购买地市code
*/
private
Integer
insuranceCity
;
/**
* 商险办理省code
*/
private
Integer
insuranceHandleProvince
;
/**
* 商险办理城市code
*/
private
Integer
insuranceHandleCity
;
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/controller/TInsuranceDetailController.java
View file @
8cdc2fb5
...
...
@@ -38,6 +38,21 @@ public class TInsuranceDetailController {
@Resource
private
TInsuranceDetailService
tInsuranceDetailService
;
/***********************商险办理********************************/
/**
* 商险新增
*
* @author licancan
* @param paramList
* @return {@link R<List<InsuranceAddParam>>}
*/
@PostMapping
(
"/addInsurance"
)
public
R
<
List
<
InsuranceAddParam
>>
addInsurance
(
@RequestBody
@Valid
@Size
(
min
=
1
,
message
=
"集合不能为空"
)
List
<
InsuranceAddParam
>
paramList
){
return
tInsuranceDetailService
.
addInsurance
(
paramList
);
}
/***********************减员办理********************************/
/**
* 导入减员校验
* @param insuranceRefundCheckList 导入减员校验
...
...
@@ -50,17 +65,4 @@ public class TInsuranceDetailController {
return
tInsuranceDetailService
.
checkInsuranceRefundList
(
insuranceRefundCheckList
);
}
/**
* 商险新增
*
* @author licancan
* @param paramList
* @return {@link R<List<InsuranceAddParam>>}
*/
@PostMapping
(
"/addInsurance"
)
public
R
<
List
<
InsuranceAddParam
>>
addInsurance
(
@RequestBody
@Valid
@Size
(
min
=
1
,
message
=
"集合不能为空"
)
List
<
InsuranceAddParam
>
paramList
){
return
tInsuranceDetailService
.
addInsurance
(
paramList
);
}
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/TInsuranceDetailService.java
View file @
8cdc2fb5
...
...
@@ -18,15 +18,8 @@ import java.util.List;
* @date 2022-07-18 16:20:16
*/
public
interface
TInsuranceDetailService
extends
IService
<
TInsuranceDetail
>
{
/**
* 减员导入校验
*
* @author zhaji
* @param insuranceRefundCheckList 减员表
* @return {@link R}
*/
R
checkInsuranceRefundList
(
List
<
InsuranceRefundCheck
>
insuranceRefundCheckList
);
/***********************商险办理********************************/
/**
* 商险新增
*
...
...
@@ -35,4 +28,14 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* @return {@link R<List<InsuranceAddParam>>}
*/
R
<
List
<
InsuranceAddParam
>>
addInsurance
(
List
<
InsuranceAddParam
>
paramList
);
/***********************减员办理********************************/
/**
* 减员导入校验
*
* @author zhaji
* @param insuranceRefundCheckList 减员表
* @return {@link R}
*/
R
checkInsuranceRefundList
(
List
<
InsuranceRefundCheck
>
insuranceRefundCheckList
);
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/impl/TInsuranceDetailServiceImpl.java
View file @
8cdc2fb5
This diff is collapsed.
Click to expand it.
yifu-insurances/yifu-insurances-biz/src/main/resources/mapper/TInsuranceDetailMapper.xml
View file @
8cdc2fb5
...
...
@@ -13,8 +13,11 @@
<result
property=
"deptNo"
column=
"DEPT_NO"
jdbcType=
"VARCHAR"
/>
<result
property=
"post"
column=
"POST"
jdbcType=
"VARCHAR"
/>
<result
property=
"insuranceCompanyName"
column=
"INSURANCE_COMPANY_NAME"
jdbcType=
"VARCHAR"
/>
<result
property=
"insuranceTypeId"
column=
"INSURANCE_TYPE_ID"
jdbcType=
"VARCHAR"
/>
<result
property=
"insuranceTypeName"
column=
"INSURANCE_TYPE_NAME"
jdbcType=
"VARCHAR"
/>
<result
property=
"insuranceTypeId"
column=
"INSURANCE_TYPE_ID"
jdbcType=
"BIGINT"
/>
<result
property=
"buyStandard"
column=
"BUY_STANDARD"
jdbcType=
"VARCHAR"
/>
<result
property=
"medicalQuota"
column=
"MEDICAL_QUOTA"
jdbcType=
"VARCHAR"
/>
<result
property=
"dieDisableQuota"
column=
"DIE_DISABLE_QUOTA"
jdbcType=
"VARCHAR"
/>
<result
property=
"policyNo"
column=
"POLICY_NO"
jdbcType=
"VARCHAR"
/>
<result
property=
"policyStart"
column=
"POLICY_START"
jdbcType=
"DATE"
/>
<result
property=
"policyEnd"
column=
"POLICY_END"
jdbcType=
"DATE"
/>
...
...
@@ -52,8 +55,8 @@
<sql
id=
"Base_Column_List"
>
ID,EMP_ID,EMP_NAME,
EMP_IDCARD_NO,ORDER_NO,DEPT_NO,POST,INSURANCE_COMPANY_NAME,
INSURANCE_TYPE_ID,BUY_STANDARD,POLICY_NO,
EMP_IDCARD_NO,ORDER_NO,DEPT_NO,POST,INSURANCE_COMPANY_NAME,
INSURANCE_TYPE_NAME,
INSURANCE_TYPE_ID,BUY_STANDARD,
MEDICAL_QUOTA,DIE_DISABLE_QUOTA,
POLICY_NO,
POLICY_START,POLICY_END,POLICY_EFFECT,
BATCH_DATE,SETTLE_MONTH,INVOICE_NO,
BUY_TYPE,INSURANCE_PROVINCE,INSURANCE_PROVINCE_NAME,INSURANCE_CITY,INSURANCE_CITY_NAME,
...
...
yifu-insurances/yifu-insurances-biz/src/main/resources/mapper/TInsuranceTypeStandardMapper.xml
View file @
8cdc2fb5
...
...
@@ -6,7 +6,7 @@
<resultMap
id=
"BaseResultMap"
type=
"com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeStandard"
>
<id
property=
"id"
column=
"ID"
jdbcType=
"VARCHAR"
/>
<result
property=
"insuranceTypeId"
column=
"INSURANCE_TYPE_ID"
jdbcType=
"
VARCHAR
"
/>
<result
property=
"insuranceTypeId"
column=
"INSURANCE_TYPE_ID"
jdbcType=
"
BIGINT
"
/>
<result
property=
"buyStandard"
column=
"BUY_STANDARD"
jdbcType=
"VARCHAR"
/>
<result
property=
"medicalQuota"
column=
"MEDICAL_QUOTA"
jdbcType=
"VARCHAR"
/>
<result
property=
"dieDisableQuota"
column=
"DIE_DISABLE_QUOTA"
jdbcType=
"VARCHAR"
/>
...
...
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