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
905cd3bf
Commit
905cd3bf
authored
Jul 21, 2022
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fdd 代码修改
parent
f469fcf2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
350 additions
and
175 deletions
+350
-175
FddContractAttachInfoController.java
.../archives/controller/FddContractAttachInfoController.java
+3
-8
FddController.java
...cloud/plus/v1/yifu/archives/controller/FddController.java
+4
-4
FddContractAttachInfoService.java
...1/yifu/archives/service/FddContractAttachInfoService.java
+2
-2
FddContractAttachInfoServiceImpl.java
...chives/service/impl/FddContractAttachInfoServiceImpl.java
+271
-154
FddContractInfoServiceImpl.java
...ifu/archives/service/impl/FddContractInfoServiceImpl.java
+42
-6
FddPersonAccountMapper.xml
...-biz/src/main/resources/mapper/FddPersonAccountMapper.xml
+1
-1
CommonConstants.java
...ud.plus.v1/yifu/common/core/constant/CommonConstants.java
+2
-0
ExcelUtil.java
...m/yifu.cloud.plus.v1/yifu/common/core/util/ExcelUtil.java
+20
-0
LocalDateUtil.java
...ifu/cloud/plus/v1/yifu/insurances/util/LocalDateUtil.java
+5
-0
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/FddContractAttachInfoController.java
View file @
905cd3bf
...
...
@@ -174,16 +174,16 @@ public class FddContractAttachInfoController {
List
<
ErrorMessage
>
errorInfo
=
fddContractAttachInfoService
.
batchAdd
(
util1
.
getEntityList
());
Map
<
String
,
Object
>
variableMap
=
new
HashMap
<>();
Map
<
Integer
,
Object
>
map
=
new
HashMap
<>();
boolean
allExitContract
=
errorInfo
.
stream
().
allMatch
(
e
->
checkInfo
(
e
));
boolean
allExitContract
=
errorInfo
.
stream
().
allMatch
(
e
->
e
.
getMessage
().
equals
(
"存在“在用”的合同"
));
if
(
allExitContract
)
{
variableMap
.
put
(
"allMatch"
,
"true"
);
for
(
ErrorMessage
errorMessage
:
errorInfo
){
map
.
put
(
errorMessage
.
getLineNum
(),
util1
.
getEntityList
().
get
(
errorMessage
.
getLineNum
()-
2
));
}
variableMap
.
put
(
"data"
,
map
);
return
R
.
ok
(
variableMap
);
return
R
.
ok
(
variableMap
,
"存在“在用”的合同"
);
}
return
new
R
<>(
CommonConstants
.
dingleDigitIntArray
[
1
],
""
,
errorInfo
);
return
R
.
failed
(
errorInfo
,
""
);
}
else
{
return
R
.
ok
(
null
,
"无数据可导入"
);
}
...
...
@@ -273,9 +273,4 @@ public class FddContractAttachInfoController {
List
<
ErrorMessage
>
errorInfo
=
fddContractAttachInfoService
.
sendTask
(
entityList
);
return
R
.
ok
(
errorInfo
);
}
public
boolean
checkInfo
(
ErrorMessage
errorMessage
)
{
Set
<
String
>
set
=
errorMessage
.
getErrors
();
return
set
.
stream
().
allMatch
(
e
->
e
.
equals
(
"存在“在用”的合同"
));
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/FddController.java
View file @
905cd3bf
...
...
@@ -147,6 +147,7 @@ public class FddController {
@Operation
(
summary
=
"异步通知"
,
description
=
"异步通知"
)
@RequestMapping
(
value
=
"/notifyUrl"
)
public
R
<
String
>
notifyUrl
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
Exception
{
YifuUser
user
=
SecurityUtils
.
getUser
();
checkSign
(
request
);
String
fddEvent
=
request
.
getHeader
(
FDD_EVENT
);
String
fddBizContent
=
request
.
getParameter
(
FDD_BIZ_CONTENT
);
...
...
@@ -159,7 +160,6 @@ public class FddController {
if
(
StringUtils
.
equals
(
CommonConstants
.
TWO_STRING
,
jsonObject
.
getString
(
"status"
)))
{
//成功
FddPersonAccount
entity
=
fddPersonAccountService
.
getById
(
clientId
);
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
entity
!=
null
)
{
entity
.
setRealStatus
(
CommonConstants
.
ONE_STRING
);
entity
.
setUnionid
(
unionId
);
...
...
@@ -221,7 +221,7 @@ public class FddController {
e
.
printStackTrace
();
}
});
return
R
.
ok
(
null
,
"
success
"
);
return
R
.
ok
(
null
,
"
成功
"
);
}
}
}
else
if
(
StringUtils
.
equals
(
fddEvent
,
"sign"
))
{
...
...
@@ -254,7 +254,7 @@ public class FddController {
// 2021-3-15 16:24 hgw 全部签名成功,更新合同的状态:
if
(
CommonConstants
.
TWO_STRING
.
equals
(
fddContractInfo
.
getSendSignStatus
())
&&
CommonConstants
.
TWO_STRING
.
equals
(
fddContractInfo
.
getReceiveSignStatus
()))
{
fddContractAttachInfoService
.
saveEmpAndAttarch
(
fddContractInfo
);
fddContractAttachInfoService
.
saveEmpAndAttarch
(
fddContractInfo
,
user
);
TEmployeeContractInfo
ec
=
employeeContractInfoService
.
getById
(
fddContractInfo
.
getContractId
());
// 如果合同的状态是待电子签,则变更为已电子签
...
...
@@ -263,7 +263,7 @@ public class FddController {
employeeContractInfoService
.
updateById
(
ec
);
}
}
return
R
.
ok
(
null
,
"
success
"
);
return
R
.
ok
(
null
,
"
成功
"
);
}
else
if
(
StringUtils
.
equals
(
fddEvent
,
"notifyUrlVerify"
))
{
return
R
.
ok
(
null
,
"success"
);
}
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/FddContractAttachInfoService.java
View file @
905cd3bf
...
...
@@ -25,8 +25,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractAttachInfo;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractInfo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
import
java.io.InputStream
;
import
java.util.List
;
/**
...
...
@@ -53,7 +53,7 @@ public interface FddContractAttachInfoService extends IService<FddContractAttach
List
<
ErrorMessage
>
sendTask
(
List
<
FddContractAttachInfo
>
entityList
);
R
<
String
>
saveEmpAndAttarch
(
FddContractInfo
fddContractInfo
);
R
<
String
>
saveEmpAndAttarch
(
FddContractInfo
fddContractInfo
,
YifuUser
user
);
List
<
ErrorMessage
>
batchAdd
(
List
<
FddContractAttachInfo
>
entityList
);
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/FddContractAttachInfoServiceImpl.java
View file @
905cd3bf
This diff is collapsed.
Click to expand it.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/FddContractInfoServiceImpl.java
View file @
905cd3bf
...
...
@@ -74,6 +74,7 @@ import java.io.IOException;
import
java.io.InputStream
;
import
java.net.URLEncoder
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.time.ZoneId
;
import
java.time.ZonedDateTime
;
import
java.util.*
;
...
...
@@ -118,9 +119,16 @@ public class FddContractInfoServiceImpl extends ServiceImpl<FddContractInfoMappe
private
OSSUtil
ossUtil
;
@Autowired
private
TSettleDomainService
tSettleDomainService
;
@Autowired
private
TAttaInfoService
tAttaInfoService
;
@Override
public
R
<
String
>
saveEmpContract
(
FddContractAttachInfo
fddContractAttachInfo
,
YifuUser
user
)
throws
ApiException
{
long
haveFddConCount
=
this
.
count
(
Wrappers
.<
FddContractInfo
>
query
().
lambda
().
eq
(
FddContractInfo:
:
getContractId
,
fddContractAttachInfo
.
getContractId
())
.
eq
(
FddContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
));
if
(
haveFddConCount
>
CommonConstants
.
ZERO_INT
)
{
return
R
.
failed
(
"已存在法大大电子合同"
);
}
if
(!
user
.
getId
().
equals
(
fddContractAttachInfo
.
getCreateBy
()))
{
return
R
.
failed
(
"当前用户不是电子合同导入用户,不能操作"
);
}
...
...
@@ -576,17 +584,25 @@ public class FddContractInfoServiceImpl extends ServiceImpl<FddContractInfoMappe
String
key
=
name
+
".zip"
;
ossUtil
.
uploadFileByStream
(
bis
,
key
,
null
);
// 1:保存为
// TEmpAtta empAtta = BasicServiceUtil.initTEmpAttaForInsert(name, key, (long) rspData.getFileBytes().length);
// empAttaService.save(empAtta);
// MEmpContractAtta contractAtta = new MEmpContractAtta();
// contractAtta.setAttaId(empAtta.getId());
// contractAtta.setContractId(employeeContractInfo.getId());
// mempContractAttaService.save(contractAtta);
TAttaInfo
attaInfo
=
initUnitAttaForInsert
(
name
,
key
,
(
long
)
rspData
.
getFileBytes
().
length
);
attaInfo
.
setRelationType
(
CommonConstants
.
FOUR_STRING
);
attaInfo
.
setDomainId
(
fddContractInfo
.
getId
());
tAttaInfoService
.
save
(
attaInfo
);
FddContractAttachInfo
fddContractAttachInfo
=
fddContractAttachInfoMapper
.
selectOne
(
Wrappers
.<
FddContractAttachInfo
>
query
().
lambda
()
.
eq
(
FddContractAttachInfo:
:
getContractId
,
entity
.
getContractId
()).
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
fddContractAttachInfo
!=
null
)
{
fddContractAttachInfo
.
setIsMove
(
CommonConstants
.
ONE_INT
);
fddContractAttachInfoMapper
.
updateById
(
fddContractAttachInfo
);
TEmployeeContractInfo
tEmployeeContractInfo
=
employeeContractInfoService
.
getOne
(
Wrappers
.<
TEmployeeContractInfo
>
query
().
lambda
()
.
eq
(
TEmployeeContractInfo:
:
getId
,
fddContractAttachInfo
.
getContractId
())
.
eq
(
TEmployeeContractInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
)
.
eq
(
TEmployeeContractInfo:
:
getInUse
,
CommonConstants
.
ZERO_STRING
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
tEmployeeContractInfo
.
setIsFile
(
CommonConstants
.
ZERO_STRING
);
employeeContractInfoService
.
updateById
(
tEmployeeContractInfo
);
}
return
R
.
ok
();
}
finally
{
...
...
@@ -921,4 +937,24 @@ public class FddContractInfoServiceImpl extends ServiceImpl<FddContractInfoMappe
return
R
.
failed
(
rsp
.
getMsg
());
}
}
/**
* 对象初始化
* @param fileName
* @param key
* @param fileSize
* @return
*/
private
TAttaInfo
initUnitAttaForInsert
(
String
fileName
,
String
key
,
long
fileSize
)
{
TAttaInfo
unitAtta
=
new
TAttaInfo
();
char
point
=
'.'
;
unitAtta
.
setAttaName
(
fileName
);
unitAtta
.
setAttaSize
(
fileSize
);
unitAtta
.
setAttaSrc
(
key
);
if
(
key
.
lastIndexOf
(
point
)
>=
0
)
{
unitAtta
.
setAttaType
(
key
.
substring
(
key
.
lastIndexOf
(
point
)));
}
unitAtta
.
setCreateTime
(
LocalDateTime
.
now
());
return
unitAtta
;
}
}
yifu-archives/yifu-archives-biz/src/main/resources/mapper/FddPersonAccountMapper.xml
View file @
905cd3bf
...
...
@@ -119,6 +119,6 @@
1=1
<include
refid=
"fddPersonAccount_where"
/>
</where>
GROUP BY a.ID_CARD ORDER BY a.CREATE_TIME desc
GROUP BY a.ID_CARD
,a.MOBLIE
ORDER BY a.CREATE_TIME desc
</select>
</mapper>
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/constant/CommonConstants.java
View file @
905cd3bf
...
...
@@ -124,6 +124,8 @@ public interface CommonConstants {
String
FOUR_STRING
=
"4"
;
String
FIVE_STRING
=
"5"
;
/**
* number 0
*/
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/util/ExcelUtil.java
View file @
905cd3bf
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
core
.
util
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.common.collect.Lists
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
...
...
@@ -950,4 +951,23 @@ public class ExcelUtil <T> implements Serializable {
this
.
setErrorInfo
(
errorList
);
this
.
setErrorMessageHashMap
(
errorMessageHashMap
);
}
/**
* @param clazz
* @Author: wangan
* @Date: 2020/9/28
* @Description: 获取导出中文字段
* @return: com.yifu.cloud.v1.common.core.util.R
**/
public
static
R
<
List
<
String
>>
getExportfieldsName
(
Class
<?>
clazz
){
ArrayList
<
String
>
exportfieldsName
=
Lists
.
newArrayList
();
Field
[]
fields
=
clazz
.
getDeclaredFields
();
for
(
Field
field
:
fields
)
{
ExcelAttribute
annotation
=
field
.
getAnnotation
(
ExcelAttribute
.
class
);
if
(
annotation
!=
null
&&
Common
.
isNotNull
(
annotation
.
name
())
&&
annotation
.
needExport
())
{
exportfieldsName
.
add
(
annotation
.
name
());
}
}
return
R
.
ok
(
exportfieldsName
,
"成功"
);
}
}
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/util/LocalDateUtil.java
View file @
905cd3bf
...
...
@@ -149,6 +149,11 @@ public class LocalDateUtil {
return
flag
;
}
//获取指定时间的指定格式
public
static
String
formatTime
(
LocalDate
time
,
String
pattern
)
{
return
time
.
format
(
DateTimeFormatter
.
ofPattern
(
pattern
));
}
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
isCurrentOrFutureMonth
(
"2023-1"
));
}
...
...
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