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
0fcb3aa0
Commit
0fcb3aa0
authored
2 years ago
by
翁国栋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
8小时后台,单人替换
parent
18a4d8f3
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
129 additions
and
1 deletions
+129
-1
src/main/java/cn/timer/api/controller/insure/InsureContorll.java
+105
-0
src/main/java/cn/timer/api/controller/yggl/YgglController.java
+2
-1
src/main/java/cn/timer/api/dao/insure/InsurePolicyMapper.java
+3
-0
src/main/java/cn/timer/api/dao/insure/InsureUserMapper.java
+1
-0
src/main/resources/mapping/insure/InsurePolicyMapper.xml
+6
-0
src/main/resources/mapping/insure/InsureUserMapper.xml
+11
-0
src/main/resources/mapping/yggl/YgglMainEmpMapper.xml
+1
-0
No files found.
src/main/java/cn/timer/api/controller/insure/InsureContorll.java
View file @
0fcb3aa0
...
@@ -15,6 +15,7 @@ import cn.timer.api.dto.insure.InsureDto;
...
@@ -15,6 +15,7 @@ import cn.timer.api.dto.insure.InsureDto;
import
cn.timer.api.dto.insure.InsureUserDto
;
import
cn.timer.api.dto.insure.InsureUserDto
;
import
cn.timer.api.dto.insure.PlansDto
;
import
cn.timer.api.dto.insure.PlansDto
;
import
cn.timer.api.dto.insure.PolicyDto
;
import
cn.timer.api.dto.insure.PolicyDto
;
import
cn.timer.api.dto.spmk.User
;
import
cn.timer.api.utils.*
;
import
cn.timer.api.utils.*
;
import
com.alibaba.druid.util.Base64
;
import
com.alibaba.druid.util.Base64
;
import
com.aliyun.oss.common.utils.StringUtils
;
import
com.aliyun.oss.common.utils.StringUtils
;
...
@@ -985,6 +986,110 @@ public class InsureContorll {
...
@@ -985,6 +986,110 @@ public class InsureContorll {
return
ResultUtil
.
data
(
selectUserList
,
"导入成功"
);
return
ResultUtil
.
data
(
selectUserList
,
"导入成功"
);
}
}
@PostMapping
(
value
=
"/importUserClient"
)
@ApiOperation
(
value
=
"导入用户--8小时后台"
,
httpMethod
=
"POST"
,
notes
=
"导入用户"
)
public
Result
<
Object
>
importUserClient
(
@CurrentUser
UserBean
userBean
,
@RequestParam
(
"file"
)
MultipartFile
file
)
{
SimpleDateFormat
dtf
=
new
SimpleDateFormat
(
"yyyyMMdd"
);
QyzxEntInfoM
company
=
QyzxEntInfoM
.
builder
().
id
(
Integer
.
valueOf
(
userBean
.
getOrgCode
())).
build
().
selectById
();
if
(
company
==
null
)
{
return
ResultUtil
.
error
(
"该企业不存在"
);
}
if
(
file
.
getSize
()
<=
0
)
{
return
ResultUtil
.
error
(
"请上传文件"
);
}
List
<
YgglMainEmp
>
yg
=
Lists
.
newArrayList
();
List
<
YgglMainEmp
>
selectUserList
=
Lists
.
newArrayList
();
List
<
YgglMainEmp
>
allList
=
Lists
.
newArrayList
();
try
{
XSSFWorkbook
xw
=
new
XSSFWorkbook
(
file
.
getInputStream
());
XSSFSheet
sheetAt
=
xw
.
getSheetAt
(
0
);
//默认第一行为标题行,i = 0
XSSFRow
titleRow
=
sheetAt
.
getRow
(
0
);
YgglMainEmp
y
;
// 循环获取每一行数据
for
(
int
i
=
1
;
i
<
sheetAt
.
getPhysicalNumberOfRows
();
i
++)
{
XSSFRow
row
=
sheetAt
.
getRow
(
i
);
y
=
YgglMainEmp
.
builder
().
build
();
y
.
setOrgCode
(
userBean
.
getOrgCode
());
// 读取每一格内容
for
(
int
index
=
0
;
index
<
row
.
getPhysicalNumberOfCells
();
index
++)
{
XSSFCell
titleCell
=
titleRow
.
getCell
(
index
);
XSSFCell
cell
=
row
.
getCell
(
index
);
cell
.
setCellType
(
CellType
.
STRING
);
if
(
cell
.
getStringCellValue
().
equals
(
""
))
{
continue
;
}
switch
(
ExcelUtils
.
getString
(
titleCell
))
{
case
"姓名(必填)"
:
y
.
setName
(
Optional
.
ofNullable
(
ExcelUtils
.
getString
(
cell
)).
orElse
(
""
));
break
;
case
"手机号"
:
y
.
setPhone
(
Optional
.
ofNullable
(
ExcelUtils
.
getString
(
cell
)).
orElse
(
""
));
break
;
// case "性别":
// y.setSex(Optional.ofNullable(ExcelUtils.getString(cell)).orElse(""));
// break;
// case "证件类型":
// y.setZjType(Optional.ofNullable(ExcelUtils.getString(cell)).orElse(""));
// break;
case
"证件号(必填)"
:
String
idNo
=
Optional
.
ofNullable
(
ExcelUtils
.
getString
(
cell
)).
orElse
(
""
);
if
(
Strings
.
isNullOrEmpty
(
idNo
)
&&
idNo
.
length
()
!=
18
)
{
return
ResultUtil
.
error
(
y
.
getName
()
+
"身份证格式不正确"
);
}
if
(!
idNo
.
matches
(
"^(\\d{6})(\\d{4})(\\d{2})(\\d{2})(\\d{3})([0-9]|X)$"
))
{
return
ResultUtil
.
error
(
y
.
getName
()
+
"身份证格式不正确"
);
}
try
{
y
.
setBirthday
(
dtf
.
parse
(
idNo
.
substring
(
6
,
14
)));
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
y
.
setZjNum
(
idNo
);
break
;
// case "工作性质":
// y.setJobType(Optional.ofNullable(ExcelUtils.getString(cell)).orElse(""));
// break;
// case "试用期":
// y.setSyq(Optional.ofNullable(ExcelUtils.getString(cell)).orElse(""));
// break;
// case "入职日期":
// y.setRzTime(Optional.ofNullable(ExcelUtils.getString(cell)).orElse(""));
// break;
default
:
break
;
}
}
if
(
StringUtils
.
isNullOrEmpty
(
y
.
getName
())
||
StringUtils
.
isNullOrEmpty
(
y
.
getZjNum
()))
{
continue
;
}
yg
.
add
(
y
);
}
List
<
YgglMainEmp
>
userList
=
YgglMainEmp
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
YgglMainEmp
>().
lambda
().
eq
(
YgglMainEmp:
:
getOrgCode
,
userBean
.
getOrgCode
()));
List
<
String
>
idNumList
=
userList
.
stream
().
map
(
YgglMainEmp:
:
getZjNum
).
collect
(
Collectors
.
toList
());
List
<
YgglMainEmp
>
newList
=
yg
.
stream
().
filter
(
v
->
!
idNumList
.
contains
(
v
.
getZjNum
())).
collect
(
Collectors
.
toList
());
if
(
newList
.
size
()
>
0
)
{
newList
.
forEach
(
u
->
u
.
insert
());
}
allList
=
ygglMainEmpMapper
.
selectListByIZjNum
(
yg
.
stream
().
map
(
YgglMainEmp:
:
getZjNum
).
toArray
(
String
[]::
new
),
company
.
getId
());
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
());
List
<
KqglAssoLeaveRules
>
rul
=
KqglAssoLeaveRules
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
KqglAssoLeaveRules
>().
lambda
().
eq
(
KqglAssoLeaveRules:
:
getOrgCode
,
userBean
.
getOrgCode
()));
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
List
<
String
>
message
=
allList
.
stream
().
filter
(
s
->
s
.
getIsInsure
()==
1
).
map
(
YgglMainEmp:
:
getName
).
collect
(
Collectors
.
toList
());
if
(
message
.
size
()>
0
){
return
ResultUtil
.
data
(
selectUserList
,
JSONObject
.
toJSONString
(
message
)+
"已投过保"
);
}
return
ResultUtil
.
data
(
selectUserList
,
"导入成功"
);
}
@PostMapping
(
value
=
"/importPolicy"
)
@PostMapping
(
value
=
"/importPolicy"
)
@ApiOperation
(
value
=
"导入保单--运营后台"
,
httpMethod
=
"POST"
,
notes
=
"导入用户"
)
@ApiOperation
(
value
=
"导入保单--运营后台"
,
httpMethod
=
"POST"
,
notes
=
"导入用户"
)
public
Result
<
Object
>
importPolicy
(
@RequestParam
(
"file"
)
MultipartFile
file
,
@RequestParam
(
"productId"
)
String
productId
)
{
public
Result
<
Object
>
importPolicy
(
@RequestParam
(
"file"
)
MultipartFile
file
,
@RequestParam
(
"productId"
)
String
productId
)
{
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/controller/yggl/YgglController.java
View file @
0fcb3aa0
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
*/
*/
package
cn
.
timer
.
api
.
controller
.
yggl
;
package
cn
.
timer
.
api
.
controller
.
yggl
;
import
java.io.IOException
;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -2079,7 +2080,7 @@ public class YgglController {
...
@@ -2079,7 +2080,7 @@ public class YgglController {
@PostMapping
(
value
=
"/addLzyy"
)
@PostMapping
(
value
=
"/addLzyy"
)
@ApiOperation
(
value
=
"离职原因"
,
httpMethod
=
"POST"
,
notes
=
"离职原因"
)
@ApiOperation
(
value
=
"离职原因"
,
httpMethod
=
"POST"
,
notes
=
"离职原因"
)
public
Result
<
Object
>
getUserList
(
@CurrentUser
UserBean
userBean
,
@RequestBody
YgglEmpLzyy
data
)
{
public
Result
<
Object
>
addLzyy
(
@CurrentUser
UserBean
userBean
,
@RequestBody
YgglEmpLzyy
data
)
{
if
(
StringUtils
.
isEmpty
(
data
.
getValue
())){
if
(
StringUtils
.
isEmpty
(
data
.
getValue
())){
return
ResultUtil
.
error
(
"请输入离职原因"
);
return
ResultUtil
.
error
(
"请输入离职原因"
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/dao/insure/InsurePolicyMapper.java
View file @
0fcb3aa0
...
@@ -9,6 +9,7 @@ import io.swagger.models.auth.In;
...
@@ -9,6 +9,7 @@ import io.swagger.models.auth.In;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -26,4 +27,6 @@ public interface InsurePolicyMapper extends BaseMapper<InsurePolicy> {
...
@@ -26,4 +27,6 @@ public interface InsurePolicyMapper extends BaseMapper<InsurePolicy> {
List
<
PolicyDto
>
policyTotalList
();
List
<
PolicyDto
>
policyTotalList
();
List
<
InsureUserDto
>
selectPlansListByorgCode
(
@Param
(
"orgCode"
)
Integer
id
);
List
<
InsureUserDto
>
selectPlansListByorgCode
(
@Param
(
"orgCode"
)
Integer
id
);
List
<
InsurePolicy
>
selectPolicyListByStatus
(
@Param
(
"date"
)
Date
date
);
}
}
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/dao/insure/InsureUserMapper.java
View file @
0fcb3aa0
...
@@ -25,6 +25,7 @@ public interface InsureUserMapper extends BaseMapper<InsureUser> {
...
@@ -25,6 +25,7 @@ public interface InsureUserMapper extends BaseMapper<InsureUser> {
List
<
InsureUser
>
selectListByIds
(
@Param
(
"array"
)
String
[]
ids
);
List
<
InsureUser
>
selectListByIds
(
@Param
(
"array"
)
String
[]
ids
);
List
<
InsureUserDto
>
selectPlansListByIds
(
@Param
(
"array"
)
String
[]
ids
);
List
<
InsureUserDto
>
selectPlansListByIds
(
@Param
(
"array"
)
String
[]
ids
);
List
<
InsureUserDto
>
selectPlansListById
(
@Param
(
"policyId"
)
String
id
);
List
<
InsureUserDto
>
selectPlansListById
(
@Param
(
"policyId"
)
String
id
);
int
updateInsure
(
@Param
(
"array"
)
Integer
[]
ids
);
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/mapping/insure/InsurePolicyMapper.xml
View file @
0fcb3aa0
...
@@ -347,4 +347,10 @@
...
@@ -347,4 +347,10 @@
iu.benefit_basic_plan,
iu.benefit_basic_plan,
iu.benefit_occupation_category
iu.benefit_occupation_category
</select>
</select>
<select
id=
"selectPolicyListByStatus"
resultType=
"cn.timer.api.bean.insure.InsurePolicy"
>
select * from insure_policy
where status = 1 and
policy_date_end
<![CDATA[ < ]]>
#{date}
</select>
</mapper>
</mapper>
This diff is collapsed.
Click to expand it.
src/main/resources/mapping/insure/InsureUserMapper.xml
View file @
0fcb3aa0
...
@@ -378,4 +378,15 @@
...
@@ -378,4 +378,15 @@
group by benefit_basic_plan, benefit_occupation_category
group by benefit_basic_plan, benefit_occupation_category
</select>
</select>
<update
id=
"updateInsure"
>
UPDATE insure_user
<set>
status = 2,
insure_status=2
</set>
WHERE policy_id IN
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</update>
</mapper>
</mapper>
This diff is collapsed.
Click to expand it.
src/main/resources/mapping/yggl/YgglMainEmpMapper.xml
View file @
0fcb3aa0
...
@@ -251,6 +251,7 @@
...
@@ -251,6 +251,7 @@
<!-- 查询员工信息 搜索 分页 -->
<!-- 查询员工信息 搜索 分页 -->
<select
id=
"queryEmpMessage"
resultType=
"cn.timer.api.dto.yggl.YgQueryDto"
>
<select
id=
"queryEmpMessage"
resultType=
"cn.timer.api.dto.yggl.YgQueryDto"
>
SELECT
SELECT
a.id id,
a.name empName,
a.name empName,
a.emp_num empNum,
a.emp_num empNum,
b.name deptName,
b.name deptName,
...
...
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