Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
8timerv2
8timerapiv200
Commits
d35a96de
Commit
d35a96de
authored
Aug 04, 2022
by
翁国栋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
8小时后台--
增员替换已投保bug
parent
12265316
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
15 deletions
+38
-15
src/main/java/cn/timer/api/controller/insure/InsureContorll.java
+38
-15
No files found.
src/main/java/cn/timer/api/controller/insure/InsureContorll.java
View file @
d35a96de
...
@@ -61,6 +61,7 @@ import java.time.format.DateTimeFormatter;
...
@@ -61,6 +61,7 @@ import java.time.format.DateTimeFormatter;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
java.util.stream.IntStream
;
import
java.util.stream.IntStream
;
import
java.util.stream.Stream
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
...
@@ -796,7 +797,7 @@ public class InsureContorll {
...
@@ -796,7 +797,7 @@ public class InsureContorll {
@PostMapping
(
value
=
"/importUser"
)
@PostMapping
(
value
=
"/importUser"
)
@ApiOperation
(
value
=
"12.导入用户--运营后台"
,
httpMethod
=
"POST"
,
notes
=
"导入用户"
)
@ApiOperation
(
value
=
"12.导入用户--运营后台"
,
httpMethod
=
"POST"
,
notes
=
"导入用户"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Result
<
Object
>
importUser
(
@RequestParam
(
"orgCode"
)
String
orgCode
,
@RequestParam
(
"file"
)
MultipartFile
file
)
{
public
Result
<
Object
>
importUser
(
@RequestParam
(
"orgCode"
)
String
orgCode
,
@RequestParam
(
"policyId"
)
Integer
policyId
,
@RequestParam
(
"file"
)
MultipartFile
file
)
{
SimpleDateFormat
dtf
=
new
SimpleDateFormat
(
"yyyyMMdd"
);
SimpleDateFormat
dtf
=
new
SimpleDateFormat
(
"yyyyMMdd"
);
QyzxEntInfoM
company
=
QyzxEntInfoM
.
builder
().
id
(
Integer
.
valueOf
(
orgCode
)).
build
().
selectById
();
QyzxEntInfoM
company
=
QyzxEntInfoM
.
builder
().
id
(
Integer
.
valueOf
(
orgCode
)).
build
().
selectById
();
if
(
company
==
null
)
{
if
(
company
==
null
)
{
...
@@ -889,15 +890,25 @@ public class InsureContorll {
...
@@ -889,15 +890,25 @@ public class InsureContorll {
QyzxEmpLogin
qyzxEmpLogin
=
QyzxEmpLogin
.
builder
().
phone
(
String
.
valueOf
(
System
.
currentTimeMillis
())).
pw
(
Md5
.
md5
(
pwd
)).
regTime
(
new
Date
()).
orgId
(
company
.
getId
()).
username
(
u
.
getName
()).
sts
(
CommonEnum
.
U_STS_ON
.
getType
()).
build
();
QyzxEmpLogin
qyzxEmpLogin
=
QyzxEmpLogin
.
builder
().
phone
(
String
.
valueOf
(
System
.
currentTimeMillis
())).
pw
(
Md5
.
md5
(
pwd
)).
regTime
(
new
Date
()).
orgId
(
company
.
getId
()).
username
(
u
.
getName
()).
sts
(
CommonEnum
.
U_STS_ON
.
getType
()).
build
();
qyzxEmpLogin
.
insert
();
qyzxEmpLogin
.
insert
();
u
.
setEmpNum
(
qyzxEmpLogin
.
getId
());
u
.
setEmpNum
(
qyzxEmpLogin
.
getId
());
u
.
insert
();
});
});
}
}
allList
=
ygglMainEmpMapper
.
selectListByIZjNum
(
yg
.
stream
().
map
(
YgglMainEmp:
:
getZjNum
).
toArray
(
String
[]::
new
),
company
.
getId
());
allList
=
ygglMainEmpMapper
.
selectListByIZjNum
(
yg
.
stream
().
map
(
YgglMainEmp:
:
getZjNum
).
toArray
(
String
[]::
new
),
company
.
getId
());
selectUserList
=
allList
.
stream
().
filter
(
s
->
s
.
getIsInsure
()
==
0
).
collect
(
Collectors
.
toList
());
//
selectUserList = allList.stream().filter(s -> s.getIsInsure() == 0).collect(Collectors.toList());
//假期规则初始化
//假期规则初始化
String
current_time
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
new
Date
());
String
current_time
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
new
Date
());
List
<
KqglAssoLeaveRules
>
rul
=
KqglAssoLeaveRules
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
KqglAssoLeaveRules
>().
lambda
().
eq
(
KqglAssoLeaveRules:
:
getOrgCode
,
orgCode
));
List
<
KqglAssoLeaveRules
>
rul
=
KqglAssoLeaveRules
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
KqglAssoLeaveRules
>().
lambda
().
eq
(
KqglAssoLeaveRules:
:
getOrgCode
,
orgCode
));
/*投保前验证人员当月是否已投保*/
InsurePolicy
policy
=
InsurePolicy
.
builder
().
id
(
policyId
).
build
().
selectById
();
List
<
InsureUser
>
insureUserList
=
insureUserMapper
.
selectListByIds
(
allList
.
stream
().
map
(
YgglMainEmp:
:
getId
).
map
(
String:
:
valueOf
).
toArray
(
String
[]::
new
),
null
,
new
SimpleDateFormat
(
"yyyy-MM"
).
format
(
policy
.
getPolicyDateStart
()));
if
(
insureUserList
.
size
()
>
0
)
{
String
name
=
""
;
for
(
InsureUser
insureUser
:
insureUserList
)
{
name
+=
insureUser
.
getInsuredEContact
()+
','
;
}
return
ResultUtil
.
error
(
"被保人"
+
name
+
"当月已投保"
);
}
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
log
.
error
(
"一键校验异常:"
,
e
);
log
.
error
(
"一键校验异常:"
,
e
);
throw
new
CustomException
(
"一键校验异常"
);
throw
new
CustomException
(
"一键校验异常"
);
...
@@ -913,17 +924,18 @@ public class InsureContorll {
...
@@ -913,17 +924,18 @@ public class InsureContorll {
}
}
}
}
List
<
String
>
message
=
allList
.
stream
().
filter
(
s
->
s
.
getIsInsure
()
==
1
).
map
(
YgglMainEmp:
:
getName
).
collect
(
Collectors
.
toList
());
if
(
message
.
size
()
>
0
)
{
// List<String> message = allList.stream().filter(s -> s.getIsInsure() == 1).map(YgglMainEmp::getName).collect(Collectors.toList());
return
ResultUtil
.
data
(
selectUserList
,
JSONObject
.
toJSONString
(
message
)
+
"已投过保"
);
// if (message.size() > 0) {
}
// return ResultUtil.data(selectUserList, JSONObject.toJSONString(message) + "已投过保");
// }
return
ResultUtil
.
data
(
selectUserList
,
"导入成功"
);
return
ResultUtil
.
data
(
selectUserList
,
"导入成功"
);
}
}
@PostMapping
(
value
=
"/importUserClient"
)
@PostMapping
(
value
=
"/importUserClient"
)
@ApiOperation
(
value
=
"13.导入用户--8小时后台"
,
httpMethod
=
"POST"
,
notes
=
"导入用户"
)
@ApiOperation
(
value
=
"13.导入用户--8小时后台"
,
httpMethod
=
"POST"
,
notes
=
"导入用户"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Result
<
Object
>
importUserClient
(
@CurrentUser
UserBean
userBean
,
@RequestParam
(
"file"
)
MultipartFile
file
)
{
public
Result
<
Object
>
importUserClient
(
@CurrentUser
UserBean
userBean
,
@RequestParam
(
"policyId"
)
Integer
policyId
,
@RequestParam
(
"file"
)
MultipartFile
file
)
{
SimpleDateFormat
dtf
=
new
SimpleDateFormat
(
"yyyyMMdd"
);
SimpleDateFormat
dtf
=
new
SimpleDateFormat
(
"yyyyMMdd"
);
QyzxEntInfoM
company
=
QyzxEntInfoM
.
builder
().
id
(
Integer
.
valueOf
(
userBean
.
getOrgCode
())).
build
().
selectById
();
QyzxEntInfoM
company
=
QyzxEntInfoM
.
builder
().
id
(
Integer
.
valueOf
(
userBean
.
getOrgCode
())).
build
().
selectById
();
if
(
company
==
null
)
{
if
(
company
==
null
)
{
...
@@ -1015,11 +1027,21 @@ public class InsureContorll {
...
@@ -1015,11 +1027,21 @@ public class InsureContorll {
newList
.
forEach
(
u
->
u
.
insert
());
newList
.
forEach
(
u
->
u
.
insert
());
}
}
allList
=
ygglMainEmpMapper
.
selectListByIZjNum
(
yg
.
stream
().
map
(
YgglMainEmp:
:
getZjNum
).
toArray
(
String
[]::
new
),
company
.
getId
());
allList
=
ygglMainEmpMapper
.
selectListByIZjNum
(
yg
.
stream
().
map
(
YgglMainEmp:
:
getZjNum
).
toArray
(
String
[]::
new
),
company
.
getId
());
selectUserList
=
allList
.
stream
().
filter
(
s
->
s
.
getIsInsure
()
==
0
).
collect
(
Collectors
.
toList
());
//
selectUserList = allList.stream().filter(s -> s.getIsInsure() == 0).collect(Collectors.toList());
//假期规则初始化
//假期规则初始化
String
current_time
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
new
Date
());
String
current_time
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
new
Date
());
List
<
KqglAssoLeaveRules
>
rul
=
KqglAssoLeaveRules
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
KqglAssoLeaveRules
>().
lambda
().
eq
(
KqglAssoLeaveRules:
:
getOrgCode
,
userBean
.
getOrgCode
()));
List
<
KqglAssoLeaveRules
>
rul
=
KqglAssoLeaveRules
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
KqglAssoLeaveRules
>().
lambda
().
eq
(
KqglAssoLeaveRules:
:
getOrgCode
,
userBean
.
getOrgCode
()));
/*投保前验证人员当月是否已投保*/
InsurePolicy
policy
=
InsurePolicy
.
builder
().
id
(
policyId
).
build
().
selectById
();
List
<
InsureUser
>
insureUserList
=
insureUserMapper
.
selectListByIds
(
allList
.
stream
().
map
(
YgglMainEmp:
:
getId
).
map
(
String:
:
valueOf
).
toArray
(
String
[]::
new
),
null
,
new
SimpleDateFormat
(
"yyyy-MM"
).
format
(
policy
.
getPolicyDateStart
()));
if
(
insureUserList
.
size
()
>
0
)
{
String
name
=
""
;
for
(
InsureUser
insureUser
:
insureUserList
)
{
name
+=
insureUser
.
getInsuredEContact
()+
','
;
}
return
ResultUtil
.
error
(
"被保人"
+
name
+
"当月已投保"
);
}
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
log
.
error
(
"导入用户:"
,
e
);
log
.
error
(
"导入用户:"
,
e
);
throw
new
CustomException
(
"导入用户"
);
throw
new
CustomException
(
"导入用户"
);
...
@@ -1032,10 +1054,11 @@ public class InsureContorll {
...
@@ -1032,10 +1054,11 @@ public class InsureContorll {
}
}
}
}
}
}
List
<
String
>
message
=
allList
.
stream
().
filter
(
s
->
s
.
getIsInsure
()
==
1
).
map
(
YgglMainEmp:
:
getName
).
collect
(
Collectors
.
toList
());
//
if
(
message
.
size
()
>
0
)
{
// List<String> message = allList.stream().filter(s -> s.getIsInsure() == 1).map(YgglMainEmp::getName).collect(Collectors.toList());
return
ResultUtil
.
data
(
selectUserList
,
JSONObject
.
toJSONString
(
message
)
+
"已投过保"
);
// if (message.size() > 0) {
}
// return ResultUtil.data(selectUserList, JSONObject.toJSONString(message) + "已投过保");
// }
return
ResultUtil
.
data
(
selectUserList
,
"导入成功"
);
return
ResultUtil
.
data
(
selectUserList
,
"导入成功"
);
}
}
...
@@ -1196,9 +1219,9 @@ public class InsureContorll {
...
@@ -1196,9 +1219,9 @@ public class InsureContorll {
policy
.
setUpdateTime
(
new
Date
());
policy
.
setUpdateTime
(
new
Date
());
policy
.
insert
();
policy
.
insert
();
}
else
{
}
else
{
policy
=
oldPolicy
;
oldPolicy
.
setPolicyFile
(
policy
.
getPolicyFile
());
oldPolicy
.
setPolicyFile
(
policy
.
getPolicyFile
());
policy
.
setUpdateTime
(
new
Date
());
policy
.
setUpdateTime
(
new
Date
());
policy
=
oldPolicy
;
policy
.
updateById
();
policy
.
updateById
();
}
}
Result
<
String
>
ossUrl
=
ossService
.
upload
(
policy
.
getId
(),
"policy"
,
file
);
Result
<
String
>
ossUrl
=
ossService
.
upload
(
policy
.
getId
(),
"policy"
,
file
);
...
@@ -1271,7 +1294,7 @@ public class InsureContorll {
...
@@ -1271,7 +1294,7 @@ public class InsureContorll {
}
finally
{
}
finally
{
if
(
xw
!=
null
){
if
(
xw
!=
null
){
try
{
try
{
xw
.
close
();
xw
.
close
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
...
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