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
ab920b18
Commit
ab920b18
authored
Jul 27, 2022
by
李灿灿
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
编辑接口调试
parent
1b289500
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
280 additions
and
64 deletions
+280
-64
InsurancesConstants.java
...lus/v1/yifu/insurances/constants/InsurancesConstants.java
+8
-0
TInsuranceDetail.java
...loud/plus/v1/yifu/insurances/entity/TInsuranceDetail.java
+1
-1
TInsuranceSettle.java
...loud/plus/v1/yifu/insurances/entity/TInsuranceSettle.java
+1
-1
LocalDateUtil.java
...ifu/cloud/plus/v1/yifu/insurances/util/LocalDateUtil.java
+81
-1
InsuranceListVO.java
...ifu/cloud/plus/v1/yifu/insurances/vo/InsuranceListVO.java
+6
-0
TInsuranceDetailController.java
...ifu/insurances/controller/TInsuranceDetailController.java
+4
-4
TInsuranceDetailService.java
...s/v1/yifu/insurances/service/TInsuranceDetailService.java
+4
-4
TInsuranceDetailServiceImpl.java
.../insurances/service/impl/TInsuranceDetailServiceImpl.java
+175
-53
No files found.
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/constants/InsurancesConstants.java
View file @
ab920b18
...
@@ -120,6 +120,10 @@ public class InsurancesConstants {
...
@@ -120,6 +120,10 @@ public class InsurancesConstants {
* 当前记录在减员流程中,无法替换
* 当前记录在减员流程中,无法替换
*/
*/
public
static
final
String
REDUCE_REPLACE_IS_NOT_ALLOW
=
"当前记录在减员流程中,无法替换"
;
public
static
final
String
REDUCE_REPLACE_IS_NOT_ALLOW
=
"当前记录在减员流程中,无法替换"
;
/**
* 已减员,无法退回
*/
public
static
final
String
REDUCE_ROLLBACK_IS_NOT_ALLOW
=
"已减员,无法退回"
;
/**
/**
* 员工姓名不能为空
* 员工姓名不能为空
*/
*/
...
@@ -184,6 +188,10 @@ public class InsurancesConstants {
...
@@ -184,6 +188,10 @@ public class InsurancesConstants {
* 险种不存在
* 险种不存在
*/
*/
public
static
final
String
INSURANCE_TYPE_NAME_NOT_EXIST
=
"险种不存在"
;
public
static
final
String
INSURANCE_TYPE_NAME_NOT_EXIST
=
"险种不存在"
;
/**
* 费率不存在
*/
public
static
final
String
INSURANCE_TYPE_RATE_NOT_EXIST
=
"费率不存在"
;
/**
/**
* 保单开始时间不能为空
* 保单开始时间不能为空
*/
*/
...
...
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/entity/TInsuranceDetail.java
View file @
ab920b18
...
@@ -213,7 +213,7 @@ public class TInsuranceDetail extends BaseEntity {
...
@@ -213,7 +213,7 @@ public class TInsuranceDetail extends BaseEntity {
* 默认结算信息id
* 默认结算信息id
*/
*/
@Schema
(
description
=
"默认结算信息id"
)
@Schema
(
description
=
"默认结算信息id"
)
private
Integer
defaultSettleId
;
private
String
defaultSettleId
;
/**
/**
* 减员状态 1待减员 2减员中3减员退回
* 减员状态 1待减员 2减员中3减员退回
...
...
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/entity/TInsuranceSettle.java
View file @
ab920b18
...
@@ -35,7 +35,7 @@ public class TInsuranceSettle implements Serializable {
...
@@ -35,7 +35,7 @@ public class TInsuranceSettle implements Serializable {
/**
/**
* 结算状态
* 结算状态
*/
*/
@Schema
(
description
=
"结算状态"
)
@Schema
(
description
=
"结算状态
1、待结算,2、结算中,3、已结算
"
)
private
String
settleHandleStatus
;
private
String
settleHandleStatus
;
/**
/**
...
...
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/util/LocalDateUtil.java
View file @
ab920b18
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
insurances
.
util
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
insurances
.
util
;
import
cn.hutool.core.date.DateUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
java.text.DateFormat
;
import
java.text.DateFormat
;
...
@@ -185,7 +186,86 @@ public class LocalDateUtil {
...
@@ -185,7 +186,86 @@ public class LocalDateUtil {
return
flag
;
return
flag
;
}
}
/**
* 计算相差多少天,如果开始时间晚于结束时间会对调
*
* @author licancan
* @param startDate
* @param endDate
* @return {@link long}
*/
public
static
long
betweenDay
(
String
startDate
,
String
endDate
){
long
dif
=
0
;
//在日期字符串非空时执行
if
(!
Common
.
isEmpty
(
startDate
)
&&
!
Common
.
isEmpty
(
endDate
))
{
Date
parseStartDate
=
null
;
Date
parseEndDate
=
null
;
//格式化日期
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
NORM_DATE_PATTERN
,
Locale
.
CHINA
);
try
{
//将字符串转为日期格式,如果此处字符串为非合法日期就会抛出异常。
parseStartDate
=
sdf
.
parse
(
startDate
);
parseEndDate
=
sdf
.
parse
(
endDate
);
//调用hutool里面的DateUtil.betweenDay方法来做判断
dif
=
DateUtil
.
betweenDay
(
parseStartDate
,
parseEndDate
,
true
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
}
else
{
System
.
out
.
println
(
"日期参数不可为空"
);
}
return
dif
+
1
;
}
/**
* 计算相差月份,如果开始时间晚于结束时间会对调
* 公式:(endYear - starYear) * 12 + endMonth - startMonth + (endDay >= startDay ? 1 : 0)
* @author licancan
* @param startDate
* @param endDate
* @return {@link long}
*/
public
static
long
betweenMonth
(
String
startDate
,
String
endDate
){
long
dif
=
0
;
//在日期字符串非空时执行
if
(!
Common
.
isEmpty
(
startDate
)
&&
!
Common
.
isEmpty
(
endDate
))
{
Date
parseStartDate
=
null
;
Date
parseEndDate
=
null
;
//格式化日期
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
NORM_DATE_PATTERN
,
Locale
.
CHINA
);
try
{
//将字符串转为日期格式,如果此处字符串为非合法日期就会抛出异常。
parseStartDate
=
sdf
.
parse
(
startDate
);
parseEndDate
=
sdf
.
parse
(
endDate
);
//如果开始时间晚于结束时间对调
if
(
parseStartDate
.
after
(
parseEndDate
))
{
Date
t
=
parseStartDate
;
parseStartDate
=
parseEndDate
;
parseEndDate
=
t
;
}
Calendar
starCalendar
=
Calendar
.
getInstance
();
starCalendar
.
setTime
(
parseStartDate
);
Calendar
endCalendar
=
Calendar
.
getInstance
();
endCalendar
.
setTime
(
parseEndDate
);
int
starYear
=
starCalendar
.
get
(
Calendar
.
YEAR
);
int
startMonth
=
starCalendar
.
get
(
Calendar
.
MONTH
);
int
startDay
=
starCalendar
.
get
(
Calendar
.
DATE
);
int
endYear
=
endCalendar
.
get
(
Calendar
.
YEAR
);
int
endMonth
=
endCalendar
.
get
(
Calendar
.
MONTH
);
int
endDay
=
endCalendar
.
get
(
Calendar
.
DATE
);
dif
=
(
endYear
-
starYear
)
*
12
+
endMonth
-
startMonth
+
(
endDay
>=
startDay
?
1
:
0
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
}
else
{
System
.
out
.
println
(
"日期参数不可为空"
);
}
return
dif
;
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
compareDate
(
"2022-07-26"
,
"2022-07-27
"
));
System
.
out
.
println
(
betweenMonth
(
"2022-10-03"
,
"2022-08-03
"
));
}
}
}
}
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/vo/InsuranceListVO.java
View file @
ab920b18
...
@@ -115,4 +115,10 @@ public class InsuranceListVO implements Serializable {
...
@@ -115,4 +115,10 @@ public class InsuranceListVO implements Serializable {
*/
*/
@Schema
(
description
=
"结算月"
)
@Schema
(
description
=
"结算月"
)
private
String
settleMonth
;
private
String
settleMonth
;
/**
* 错误信息
*/
@Schema
(
description
=
"错误信息"
)
private
String
errorMessage
;
}
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/controller/TInsuranceDetailController.java
View file @
ab920b18
...
@@ -160,11 +160,11 @@ public class TInsuranceDetailController {
...
@@ -160,11 +160,11 @@ public class TInsuranceDetailController {
*
*
* @author licancan
* @author licancan
* @param idList
* @param idList
* @return {@link R<List<
TInsuranceDetail
>>}
* @return {@link R<List<
InsuranceListVO
>>}
*/
*/
@Operation
(
summary
=
"投保退回"
,
description
=
"投保退回"
)
@Operation
(
summary
=
"投保退回"
,
description
=
"投保退回"
)
@PostMapping
(
"/rollBackInsurance"
)
@PostMapping
(
"/rollBackInsurance"
)
public
R
<
List
<
TInsuranceDetail
>>
rollBackInsurance
(
@RequestBody
@Valid
@Size
(
min
=
1
,
message
=
"集合不能为空"
)
List
<
String
>
idList
){
public
R
<
List
<
InsuranceListVO
>>
rollBackInsurance
(
@RequestBody
@Valid
@Size
(
min
=
1
,
message
=
"集合不能为空"
)
List
<
String
>
idList
){
return
tInsuranceDetailService
.
rollBackInsurance
(
idList
);
return
tInsuranceDetailService
.
rollBackInsurance
(
idList
);
}
}
...
@@ -173,11 +173,11 @@ public class TInsuranceDetailController {
...
@@ -173,11 +173,11 @@ public class TInsuranceDetailController {
*
*
* @author licancan
* @author licancan
* @param idList
* @param idList
* @return {@link R<List<
TInsuranceDetail
>>}
* @return {@link R<List<
InsuranceListVO
>>}
*/
*/
@Operation
(
summary
=
"办理成功"
,
description
=
"办理成功"
)
@Operation
(
summary
=
"办理成功"
,
description
=
"办理成功"
)
@PostMapping
(
"/successfulInsurance"
)
@PostMapping
(
"/successfulInsurance"
)
public
R
<
List
<
TInsuranceDetail
>>
successfulInsurance
(
@RequestBody
@Valid
@Size
(
min
=
1
,
message
=
"集合不能为空"
)
List
<
String
>
idList
){
public
R
<
List
<
InsuranceListVO
>>
successfulInsurance
(
@RequestBody
@Valid
@Size
(
min
=
1
,
message
=
"集合不能为空"
)
List
<
String
>
idList
){
return
tInsuranceDetailService
.
successfulInsurance
(
idList
);
return
tInsuranceDetailService
.
successfulInsurance
(
idList
);
}
}
...
...
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/TInsuranceDetailService.java
View file @
ab920b18
...
@@ -104,18 +104,18 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
...
@@ -104,18 +104,18 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
*
*
* @author licancan
* @author licancan
* @param idList
* @param idList
* @return {@link R<List<
TInsuranceDetail
>>}
* @return {@link R<List<
InsuranceListVO
>>}
*/
*/
R
<
List
<
TInsuranceDetail
>>
rollBackInsurance
(
List
<
String
>
idList
);
R
<
List
<
InsuranceListVO
>>
rollBackInsurance
(
List
<
String
>
idList
);
/**
/**
* 办理成功
* 办理成功
*
*
* @author licancan
* @author licancan
* @param idList
* @param idList
* @return {@link R<List<
TInsuranceDetail
>>}
* @return {@link R<List<
InsuranceListVO
>>}
*/
*/
R
<
List
<
TInsuranceDetail
>>
successfulInsurance
(
List
<
String
>
idList
);
R
<
List
<
InsuranceListVO
>>
successfulInsurance
(
List
<
String
>
idList
);
/**
/**
* 登记保单保费
* 登记保单保费
...
...
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/impl/TInsuranceDetailServiceImpl.java
View file @
ab920b18
This diff is collapsed.
Click to expand it.
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