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
08df2c37
Commit
08df2c37
authored
Jun 29, 2022
by
翁国栋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
8小时后台--
修改投保条件为不同月份可重复投递一个人
parent
c5a0d90b
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
232 additions
and
109 deletions
+232
-109
src/main/java/cn/timer/api/bean/insure/InsureUser.java
+6
-1
src/main/java/cn/timer/api/controller/insure/InsureContorll.java
+172
-105
src/main/java/cn/timer/api/controller/yggl/YgglController.java
+11
-2
src/main/java/cn/timer/api/dao/insure/InsureUserMapper.java
+1
-1
src/main/java/cn/timer/api/dao/yggl/YgglMainEmpMapper.java
+3
-0
src/main/java/cn/timer/api/dto/yggl/YgQueryDto.java
+2
-0
src/main/resources/mapping/insure/InsureUserMapper.xml
+7
-0
src/main/resources/mapping/yggl/YgglMainEmpMapper.xml
+30
-0
No files found.
src/main/java/cn/timer/api/bean/insure/InsureUser.java
View file @
08df2c37
...
@@ -10,7 +10,7 @@ import lombok.AllArgsConstructor;
...
@@ -10,7 +10,7 @@ import lombok.AllArgsConstructor;
import
lombok.Builder
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.NoArgsConstructor
;
import
org.springframework.data.annotation
.Transient
;
import
javax.persistence
.Transient
;
import
javax.persistence.Entity
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GeneratedValue
;
...
@@ -167,4 +167,9 @@ public class InsureUser extends Model<InsureUser> {
...
@@ -167,4 +167,9 @@ public class InsureUser extends Model<InsureUser> {
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
"导入备注"
)
@ApiModelProperty
(
value
=
"导入备注"
)
private
String
remake
;
private
String
remake
;
@Transient
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
"新被保人"
,
example
=
"新被保人"
)
private
InsureUser
replaceUser
;
}
}
src/main/java/cn/timer/api/controller/insure/InsureContorll.java
View file @
08df2c37
...
@@ -170,9 +170,22 @@ public class InsureContorll {
...
@@ -170,9 +170,22 @@ public class InsureContorll {
if
(
qyzxEntInfoM
==
null
)
{
if
(
qyzxEntInfoM
==
null
)
{
return
ResultUtil
.
error
(
"企业不存在"
);
return
ResultUtil
.
error
(
"企业不存在"
);
}
}
try
{
try
{
DateTimeFormatter
dtf2
=
DateTimeFormatter
.
ofPattern
(
"yyyyMMddHHmmss"
);
DateTimeFormatter
dtf2
=
DateTimeFormatter
.
ofPattern
(
"yyyyMMddHHmmss"
);
DateTimeFormatter
ym
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM"
);
LocalDateTime
now
=
LocalDateTime
.
now
();
LocalDateTime
now
=
LocalDateTime
.
now
();
/*投保前验证人员当月是否已投保*/
for
(
PlansDto
p
:
insureDto
.
getPlans
())
{
List
<
InsureUser
>
insureUserList
=
insureUserMapper
.
selectListByIds
(
p
.
getUserIds
(),
null
,
insureDto
.
getPolicyDateStart
().
substring
(
0
,
7
));
if
(
insureUserList
.
size
()
>
0
)
{
String
name
=
""
;
for
(
InsureUser
insureUser
:
insureUserList
)
{
name
+=
insureUser
.
getInsuredEContact
()+
','
;
}
return
ResultUtil
.
error
(
"被保人"
+
name
+
"当月已投保"
);
}
}
Date
date
=
Date
.
from
(
now
.
atZone
(
ZoneId
.
systemDefault
()).
toInstant
());
Date
date
=
Date
.
from
(
now
.
atZone
(
ZoneId
.
systemDefault
()).
toInstant
());
Map
bodyMap
=
Maps
.
newHashMap
();
Map
bodyMap
=
Maps
.
newHashMap
();
ArrayList
<
Map
>
quotationsArry
=
new
ArrayList
<
Map
>();
ArrayList
<
Map
>
quotationsArry
=
new
ArrayList
<
Map
>();
...
@@ -564,7 +577,7 @@ public class InsureContorll {
...
@@ -564,7 +577,7 @@ public class InsureContorll {
insureDto
.
setUserIds
(
new
String
[]{
String
.
valueOf
(
y
.
getId
())});
insureDto
.
setUserIds
(
new
String
[]{
String
.
valueOf
(
y
.
getId
())});
}
}
}
}
List
<
InsureUser
>
oldInsureUserList
=
insureUserMapper
.
selectListByIds
(
insureDto
.
getOldIds
());
List
<
InsureUser
>
oldInsureUserList
=
insureUserMapper
.
selectListByIds
(
insureDto
.
getOldIds
()
,
insurePolicy
.
getId
(),
null
);
String
[]
oldUser
=
new
String
[
oldInsureUserList
.
size
()];
String
[]
oldUser
=
new
String
[
oldInsureUserList
.
size
()];
for
(
int
i
=
0
;
i
<
oldInsureUserList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
oldInsureUserList
.
size
();
i
++)
{
oldUser
[
i
]
=
oldInsureUserList
.
get
(
i
).
getUserId
().
toString
();
oldUser
[
i
]
=
oldInsureUserList
.
get
(
i
).
getUserId
().
toString
();
...
@@ -1225,6 +1238,9 @@ public class InsureContorll {
...
@@ -1225,6 +1238,9 @@ public class InsureContorll {
@ApiOperation
(
value
=
"15.导入被保人员--运营后台"
,
httpMethod
=
"POST"
,
notes
=
"导入用户"
)
@ApiOperation
(
value
=
"15.导入被保人员--运营后台"
,
httpMethod
=
"POST"
,
notes
=
"导入用户"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Result
<
Object
>
importUserPolicy
(
@RequestParam
(
"file"
)
MultipartFile
file
,
@RequestParam
(
"orgCode"
)
Integer
orgCode
)
{
public
Result
<
Object
>
importUserPolicy
(
@RequestParam
(
"file"
)
MultipartFile
file
,
@RequestParam
(
"orgCode"
)
Integer
orgCode
)
{
Date
now
=
new
Date
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM"
);
/*当前年月*/
if
(
file
.
getSize
()
<=
0
)
{
if
(
file
.
getSize
()
<=
0
)
{
return
ResultUtil
.
error
(
"未上传文件"
);
return
ResultUtil
.
error
(
"未上传文件"
);
}
}
...
@@ -1310,7 +1326,7 @@ public class InsureContorll {
...
@@ -1310,7 +1326,7 @@ public class InsureContorll {
y
=
YgglMainEmp
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
YgglMainEmp
>().
lambda
().
eq
(
YgglMainEmp:
:
getZjNum
,
iu
.
getInsuredNo
())
y
=
YgglMainEmp
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
YgglMainEmp
>().
lambda
().
eq
(
YgglMainEmp:
:
getZjNum
,
iu
.
getInsuredNo
())
.
eq
(
YgglMainEmp:
:
getName
,
iu
.
getInsuredEContact
()).
eq
(
YgglMainEmp:
:
getOrgCode
,
qyzxEntInfoM
.
getId
()));
.
eq
(
YgglMainEmp:
:
getName
,
iu
.
getInsuredEContact
()).
eq
(
YgglMainEmp:
:
getOrgCode
,
qyzxEntInfoM
.
getId
()));
if
(
y
==
null
)
{
if
(
y
==
null
)
{
QyzxEmpLogin
qyzxEmpLogin
=
QyzxEmpLogin
.
builder
().
pw
(
Md5
.
md5
(
pwd
)).
phone
(
String
.
valueOf
(
System
.
currentTimeMillis
())).
regTime
(
n
ew
Date
()
).
orgId
(
qyzxEntInfoM
.
getId
()).
username
(
iu
.
getInsuredEContact
()).
sts
(
CommonEnum
.
U_STS_ON
.
getType
()).
build
();
QyzxEmpLogin
qyzxEmpLogin
=
QyzxEmpLogin
.
builder
().
pw
(
Md5
.
md5
(
pwd
)).
phone
(
String
.
valueOf
(
System
.
currentTimeMillis
())).
regTime
(
n
ow
).
orgId
(
qyzxEntInfoM
.
getId
()).
username
(
iu
.
getInsuredEContact
()).
sts
(
CommonEnum
.
U_STS_ON
.
getType
()).
build
();
qyzxEmpLogin
.
insert
();
qyzxEmpLogin
.
insert
();
y
=
new
YgglMainEmp
();
y
=
new
YgglMainEmp
();
y
.
setEmpNum
(
qyzxEmpLogin
.
getId
());
y
.
setEmpNum
(
qyzxEmpLogin
.
getId
());
...
@@ -1320,10 +1336,6 @@ public class InsureContorll {
...
@@ -1320,10 +1336,6 @@ public class InsureContorll {
y
.
setOrgCode
(
qyzxEntInfoM
.
getId
());
y
.
setOrgCode
(
qyzxEntInfoM
.
getId
());
y
.
setIsInsure
(
0
);
y
.
setIsInsure
(
0
);
y
.
insert
();
y
.
insert
();
}
else
{
if
(
y
.
getIsInsure
()
==
1
)
{
return
ResultUtil
.
error
(
y
.
getName
()
+
"已经投保"
);
}
}
}
iu
.
setOrgCode
(
qyzxEntInfoM
.
getId
());
iu
.
setOrgCode
(
qyzxEntInfoM
.
getId
());
iu
.
setUserId
(
y
.
getId
());
iu
.
setUserId
(
y
.
getId
());
...
@@ -1554,7 +1566,7 @@ public class InsureContorll {
...
@@ -1554,7 +1566,7 @@ public class InsureContorll {
Map
<
String
,
Object
>
map
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
o
));
Map
<
String
,
Object
>
map
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
o
));
url
=
map
.
get
(
"file_url"
).
toString
();
url
=
map
.
get
(
"file_url"
).
toString
();
}
}
InsureLog
.
builder
().
requestParam
(
JSONObject
.
toJSONString
(
setParams
(
JSONObject
.
toJSONString
(
bodyMap
),
appid
,
secret
))).
type
(
5
)
InsureLog
.
builder
().
requestParam
(
JSONObject
.
toJSONString
(
setParams
(
JSONObject
.
toJSONString
(
bodyMap
),
appid
q
,
secretq
))).
type
(
5
)
.
requestData
(
JSONObject
.
toJSONString
(
bodyMap
)).
createTime
(
new
Date
()).
requestType
(
1
).
returnBody
(
data
).
requestPath
(
uploadUrl2
)
.
requestData
(
JSONObject
.
toJSONString
(
bodyMap
)).
createTime
(
new
Date
()).
requestType
(
1
).
returnBody
(
data
).
requestPath
(
uploadUrl2
)
.
returnCode
(
dataMap
.
get
(
"errcode"
).
toString
()).
returnMsg
(
dataMap
.
get
(
"errmsg"
).
toString
()).
fileUrl
(
url
).
build
().
insert
();
.
returnCode
(
dataMap
.
get
(
"errcode"
).
toString
()).
returnMsg
(
dataMap
.
get
(
"errmsg"
).
toString
()).
fileUrl
(
url
).
build
().
insert
();
/*文件流base64*/
/*文件流base64*/
...
@@ -1617,7 +1629,7 @@ public class InsureContorll {
...
@@ -1617,7 +1629,7 @@ public class InsureContorll {
Map
<
String
,
Object
>
map
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
o
));
Map
<
String
,
Object
>
map
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
o
));
url
=
map
.
get
(
"file_url"
).
toString
();
url
=
map
.
get
(
"file_url"
).
toString
();
}
}
InsureLog
.
builder
().
requestParam
(
JSONObject
.
toJSONString
(
setParams
(
JSONObject
.
toJSONString
(
bodyMap
),
appid
,
secret
))).
type
(
6
)
InsureLog
.
builder
().
requestParam
(
JSONObject
.
toJSONString
(
setParams
(
JSONObject
.
toJSONString
(
bodyMap
),
appid
q
,
secretq
))).
type
(
6
)
.
requestData
(
JSONObject
.
toJSONString
(
bodyMap
)).
createTime
(
new
Date
()).
requestType
(
1
).
returnBody
(
data
).
requestPath
(
uploadUrl2
)
.
requestData
(
JSONObject
.
toJSONString
(
bodyMap
)).
createTime
(
new
Date
()).
requestType
(
1
).
returnBody
(
data
).
requestPath
(
uploadUrl2
)
.
returnCode
(
dataMap
.
get
(
"errcode"
).
toString
()).
returnMsg
(
dataMap
.
get
(
"errmsg"
).
toString
()).
fileUrl
(
url
).
build
().
insert
();
.
returnCode
(
dataMap
.
get
(
"errcode"
).
toString
()).
returnMsg
(
dataMap
.
get
(
"errmsg"
).
toString
()).
fileUrl
(
url
).
build
().
insert
();
/*文件流base64*/
/*文件流base64*/
...
@@ -1687,103 +1699,158 @@ public class InsureContorll {
...
@@ -1687,103 +1699,158 @@ public class InsureContorll {
}
}
// @PostMapping(value = "/replaceUserPolicy")
@PostMapping
(
value
=
"/replaceUserPolicy"
)
// @ApiOperation(value = "18.导入替换人员", httpMethod = "POST", notes = "导入用户")
@ApiOperation
(
value
=
"18.导入替换人员"
,
httpMethod
=
"POST"
,
notes
=
"导入用户"
)
// @Transactional(rollbackFor = Exception.class)
@Transactional
(
rollbackFor
=
Exception
.
class
)
// public Result<Object> replaceUserPolicy(@RequestParam("file") MultipartFile file, @RequestParam("policyId") Integer policyId){
public
Result
<
Object
>
replaceUserPolicy
(
@RequestParam
(
"file"
)
MultipartFile
file
,
@RequestParam
(
"policyId"
)
Integer
policyId
){
// InsurePolicy insurePolicy = InsurePolicy.builder().id(policyId).build().selectById();
InsurePolicy
insurePolicy
=
InsurePolicy
.
builder
().
id
(
policyId
).
build
().
selectById
();
// try {
try
{
// XSSFWorkbook xw = new XSSFWorkbook(file.getInputStream());
XSSFWorkbook
xw
=
new
XSSFWorkbook
(
file
.
getInputStream
());
// XSSFSheet sheetAt = xw.getSheetAt(0);
XSSFSheet
sheetAt
=
xw
.
getSheetAt
(
0
);
// //默认第一行为标题行,i = 0
//默认第一行为标题行,i = 0
// XSSFRow titleRow = sheetAt.getRow(0);
XSSFRow
titleRow
=
sheetAt
.
getRow
(
0
);
// YgglMainEmp y;
InsureUser
originalUser
;
// InsureUser ru;
InsureUser
replaceUser
;
// /*原被保人*/
/*原被保人集合*/
// List<InsureUser> originalList;
List
<
InsureUser
>
originalList
=
Lists
.
newArrayList
();
// List<InsureUser> replaceList;
// 循环获取每一行数据
// // 循环获取每一行数据
for
(
int
i
=
1
;
i
<
sheetAt
.
getPhysicalNumberOfRows
();
i
++)
{
// for (int i = 1; i < sheetAt.getPhysicalNumberOfRows(); i++) {
XSSFRow
row
=
sheetAt
.
getRow
(
i
);
// XSSFRow row = sheetAt.getRow(i);
originalUser
=
InsureUser
.
builder
().
build
();
// y = YgglMainEmp.builder().build();
replaceUser
=
InsureUser
.
builder
().
build
();
// ru=InsureUser.builder().build();
// 读取每一格内容
// // 读取每一格内容
for
(
int
index
=
0
;
index
<
row
.
getPhysicalNumberOfCells
();
index
++)
{
// for (int index = 0; index < row.getPhysicalNumberOfCells(); index++) {
XSSFCell
titleCell
=
titleRow
.
getCell
(
index
);
// XSSFCell titleCell = titleRow.getCell(index);
XSSFCell
cell
=
row
.
getCell
(
index
);
// XSSFCell cell = row.getCell(index);
if
(
cell
==
null
)
{
// if (cell == null) {
continue
;
// continue;
}
else
{
// } else {
cell
.
setCellType
(
CellType
.
STRING
);
// cell.setCellType(CellType.STRING);
}
// }
if
(
cell
.
getStringCellValue
().
equals
(
""
))
{
// if (cell.getStringCellValue().equals("")) {
continue
;
// continue;
}
// }
switch
(
ExcelUtils
.
getString
(
titleCell
))
{
// switch (ExcelUtils.getString(titleCell)) {
// case "ID":/*不重要*/
// case "ID":/*不重要*/
// break;
// break;
// case "name":
case
"name"
:
// if (StringUtils.isNullOrEmpty(ExcelUtils.getString(cell))) {
if
(
StringUtils
.
isNullOrEmpty
(
ExcelUtils
.
getString
(
cell
)))
{
// return ResultUtil.error("第" + i + "行第" + index + "列被保人姓名不能为空");
return
ResultUtil
.
error
(
"第"
+
i
+
"行第"
+
index
+
"列被保人姓名不能为空"
);
// }
}
// ru.setInsuredName(ExcelUtils.getString(cell).trim());
originalUser
.
setInsuredEContact
(
ExcelUtils
.
getString
(
cell
).
trim
());
// break;
break
;
// case "ID_type":
case
"ID_type"
:
// if (StringUtils.isNullOrEmpty(ExcelUtils.getString(cell))) {
if
(
StringUtils
.
isNullOrEmpty
(
ExcelUtils
.
getString
(
cell
)))
{
// return ResultUtil.error("第" + i + "行第" + index + "列证件类型不能为空");
return
ResultUtil
.
error
(
"第"
+
i
+
"行第"
+
index
+
"列证件类型不能为空"
);
// }
}
// break;
break
;
// case "ID_number":
case
"ID_number"
:
// if (StringUtils.isNullOrEmpty(ExcelUtils.getString(cell))) {
if
(
StringUtils
.
isNullOrEmpty
(
ExcelUtils
.
getString
(
cell
)))
{
// return ResultUtil.error("第" + i + "行第" + index + "列证件号码不能为空");
return
ResultUtil
.
error
(
"第"
+
i
+
"行第"
+
index
+
"列证件号码不能为空"
);
// }
}
// ru.setInsuredNo(ExcelUtils.getString(cell));
originalUser
.
setInsuredNo
(
ExcelUtils
.
getString
(
cell
));
// break;
break
;
// case "Update_date":
case
"Update_date"
:
// if (StringUtils.isNullOrEmpty(ExcelUtils.getString(cell))) {
if
(
StringUtils
.
isNullOrEmpty
(
ExcelUtils
.
getString
(
cell
)))
{
// return ResultUtil.error("第" + i + "行第" + index + "列批改生效日不能为空");
return
ResultUtil
.
error
(
"第"
+
i
+
"行第"
+
index
+
"列批改生效日不能为空"
);
// }
}
// break;
break
;
// case "replace_name":
case
"replace_name"
:
// if (StringUtils.isNullOrEmpty(ExcelUtils.getString(cell))) {
if
(
StringUtils
.
isNullOrEmpty
(
ExcelUtils
.
getString
(
cell
)))
{
// return ResultUtil.error("第" + i + "行第" + index + "列新保人员姓名不能为空");
return
ResultUtil
.
error
(
"第"
+
i
+
"行第"
+
index
+
"列新保人员姓名不能为空"
);
// }
}
// break;
replaceUser
.
setInsuredEContact
(
ExcelUtils
.
getString
(
cell
));
// case "replace_ID_type":
break
;
// if (StringUtils.isNullOrEmpty(ExcelUtils.getString(cell))) {
case
"replace_ID_type"
:
// return ResultUtil.error("第" + i + "行第" + index + "列新保人员证件类型不能为空");
if
(
StringUtils
.
isNullOrEmpty
(
ExcelUtils
.
getString
(
cell
)))
{
// }
return
ResultUtil
.
error
(
"第"
+
i
+
"行第"
+
index
+
"列新保人员证件类型不能为空"
);
// break;
}
// case "replace_ID_number":
break
;
// if (StringUtils.isNullOrEmpty(ExcelUtils.getString(cell))) {
case
"replace_ID_number"
:
// return ResultUtil.error("第" + i + "行第" + index + "列新保人员证件号不能为空");
if
(
StringUtils
.
isNullOrEmpty
(
ExcelUtils
.
getString
(
cell
)))
{
// }
return
ResultUtil
.
error
(
"第"
+
i
+
"行第"
+
index
+
"列新保人员证件号不能为空"
);
// break;
}
// case "Date_of_birth":
replaceUser
.
setInsuredNo
(
ExcelUtils
.
getString
(
cell
));
// break;
break
;
// case "insured_type":
case
"Date_of_birth"
:
// break;
break
;
// case "insured_relationship":
case
"insured_type"
:
// break;
break
;
// case "cert_type_related_insured":
case
"insured_relationship"
:
// break;
break
;
// case "insured_relationship_id":
case
"cert_type_related_insured"
:
// break;
break
;
// case "Branch":
case
"insured_relationship_id"
:
// break;
break
;
// case "Tricycle_frame_number":
case
"Branch"
:
// break;
break
;
// case "insured_number":
case
"Tricycle_frame_number"
:
// break;
replaceUser
.
setTricycleFrameNumber
(
ExcelUtils
.
getString
(
cell
));
// case "benefit_occupation_category":
break
;
// break;
case
"insured_number"
:
//
break
;
// }
case
"benefit_occupation_category"
:
// }
replaceUser
.
setBenefitOccupationCategory
(
ExcelUtils
.
getString
(
cell
));
// }
break
;
// }catch (Exception e){
// throw new CustomException("导入异常");
}
// }
originalUser
.
setReplaceUser
(
replaceUser
);
// return ResultUtil.success();
originalList
.
add
(
originalUser
);
// }
}
}
/*验证表格信息*/
for
(
InsureUser
insureUser
:
originalList
)
{
InsureUser
getInsureUser
=
InsureUser
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
InsureUser
>().
lambda
()
.
eq
(
InsureUser:
:
getInsuredEContact
,
insureUser
.
getInsuredEContact
()).
eq
(
InsureUser:
:
getInsuredNo
,
insureUser
.
getInsuredNo
())
.
eq
(
InsureUser:
:
getInsureStatus
,
1
).
eq
(
InsureUser:
:
getStatus
,
1
).
eq
(
InsureUser:
:
getPolicyId
,
policyId
));
if
(
getInsureUser
==
null
){
return
ResultUtil
.
error
(
insureUser
.
getInsuredName
()+
"未投保"
);
}
YgglMainEmp
ygglMainEmp
=
YgglMainEmp
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
YgglMainEmp
>().
lambda
()
.
eq
(
YgglMainEmp:
:
getName
,
insureUser
.
getReplaceUser
().
getInsuredName
())
.
eq
(
YgglMainEmp:
:
getZjNum
,
insureUser
.
getReplaceUser
().
getInsuredNo
()));
if
(
ygglMainEmp
==
null
){
QyzxEmpLogin
qyzxEmpLogin
=
QyzxEmpLogin
.
builder
().
phone
(
String
.
valueOf
(
System
.
currentTimeMillis
())).
pw
(
Md5
.
md5
(
pwd
)).
regTime
(
new
Date
()).
orgId
(
insurePolicy
.
getOrgCode
()).
username
(
insureUser
.
getInsuredEContact
()).
sts
(
CommonEnum
.
U_STS_ON
.
getType
()).
build
();
qyzxEmpLogin
.
insert
();
ygglMainEmp
=
new
YgglMainEmp
();
ygglMainEmp
.
setEmpNum
(
qyzxEmpLogin
.
getId
());
ygglMainEmp
.
setName
(
insureUser
.
getInsuredEContact
());
ygglMainEmp
.
setZjType
(
0
);
ygglMainEmp
.
setZjNum
(
insureUser
.
getInsuredNo
());
ygglMainEmp
.
setOrgCode
(
insurePolicy
.
getOrgCode
());
ygglMainEmp
.
setIsInsure
(
0
);
ygglMainEmp
.
insert
();
}
}
/*上传替换文件到保司服务器*/
ByteArrayOutputStream
byteArrayOutputStream
=
new
ByteArrayOutputStream
();
/*保司返回地址*/
String
url
=
""
;
xw
.
write
(
byteArrayOutputStream
);
byte
[]
bytes
=
byteArrayOutputStream
.
toByteArray
();
String
fileBase64
=
Base64
.
byteArrayToBase64
(
bytes
);
/*body参数 begin*/
Map
bodyMap
=
Maps
.
newHashMap
();
bodyMap
.
put
(
"media"
,
fileBase64
);
/*end*/
String
data
=
HttpUtils
.
sendPost
(
uploadUrl2
,
setParams
(
JSONObject
.
toJSONString
(
bodyMap
),
appidq
,
secretq
),
bodyMap
);
Map
<
String
,
Object
>
dataMap
=
JSONObject
.
parseObject
(
data
);
if
(
dataMap
.
get
(
"errcode"
).
toString
().
equals
(
"suc"
))
{
Object
o
=
dataMap
.
get
(
"data"
);
Map
<
String
,
Object
>
map
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
o
));
url
=
map
.
get
(
"file_url"
).
toString
();
}
InsureLog
.
builder
().
requestParam
(
JSONObject
.
toJSONString
(
setParams
(
JSONObject
.
toJSONString
(
bodyMap
),
appidq
,
secretq
))).
type
(
6
)
.
requestData
(
JSONObject
.
toJSONString
(
bodyMap
)).
createTime
(
new
Date
()).
requestType
(
1
).
returnBody
(
data
).
requestPath
(
uploadUrl2
)
.
returnCode
(
dataMap
.
get
(
"errcode"
).
toString
()).
returnMsg
(
dataMap
.
get
(
"errmsg"
).
toString
()).
fileUrl
(
url
).
build
().
insert
();
/*替换逻辑*/
}
catch
(
Exception
e
){
throw
new
CustomException
(
"导入异常"
);
}
return
ResultUtil
.
success
();
}
}
}
src/main/java/cn/timer/api/controller/yggl/YgglController.java
View file @
08df2c37
...
@@ -22,6 +22,7 @@ import javax.servlet.ServletOutputStream;
...
@@ -22,6 +22,7 @@ import javax.servlet.ServletOutputStream;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.transaction.Transactional
;
import
javax.transaction.Transactional
;
import
cn.timer.api.bean.insure.InsurePolicy
;
import
cn.timer.api.bean.yggl.*
;
import
cn.timer.api.bean.yggl.*
;
import
cn.timer.api.bean.zzgl.ZzglLogDgjl
;
import
cn.timer.api.bean.zzgl.ZzglLogDgjl
;
import
cn.timer.api.dao.zzgl.ZzglLogDgjlMapper
;
import
cn.timer.api.dao.zzgl.ZzglLogDgjlMapper
;
...
@@ -2084,8 +2085,16 @@ public class YgglController {
...
@@ -2084,8 +2085,16 @@ public class YgglController {
@GetMapping
(
value
=
"/getUserList"
)
@GetMapping
(
value
=
"/getUserList"
)
@ApiOperation
(
value
=
"62-1.运营后台--查询员工列表"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperation
(
value
=
"62-1.运营后台--查询员工列表"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
62
)
@ApiOperationSupport
(
order
=
62
)
public
Result
<
List
<
YgQueryDto
>>
getUserList
(
@RequestParam
(
"companyId"
)
String
companyId
)
{
public
Result
<
List
<
YgQueryDto
>>
getUserList
(
@RequestParam
(
"companyId"
)
String
companyId
,
@RequestParam
(
"policyId"
)
Integer
policyId
)
{
List
<
YgQueryDto
>
ygQueryDto
=
ygglMainEmpMapper
.
queryEmpMessage
(
Integer
.
parseInt
(
companyId
),
0
);
SimpleDateFormat
dtf3
=
new
SimpleDateFormat
(
"yyyy-MM"
);
List
<
YgQueryDto
>
ygQueryDto
=
Lists
.
newArrayList
();
if
(
policyId
!=
null
&&
policyId
>
0
){
InsurePolicy
insurePolicy
=
InsurePolicy
.
builder
().
id
(
policyId
).
build
().
selectById
();
insurePolicy
.
getPolicyDateStart
();
ygQueryDto
=
ygglMainEmpMapper
.
getInusrtUser
(
Integer
.
parseInt
(
companyId
),
null
,
dtf3
.
format
(
insurePolicy
.
getPolicyDateEnd
()));
}
else
{
ygQueryDto
=
ygglMainEmpMapper
.
queryEmpMessage
(
Integer
.
parseInt
(
companyId
),
null
);
}
for
(
YgQueryDto
yg
:
ygQueryDto
)
{
for
(
YgQueryDto
yg
:
ygQueryDto
)
{
if
(
StringUtil
.
isEmpty
(
yg
.
getHeadUrl
()))
{
if
(
StringUtil
.
isEmpty
(
yg
.
getHeadUrl
()))
{
yg
.
setHeadUrl
(
""
);
yg
.
setHeadUrl
(
""
);
...
...
src/main/java/cn/timer/api/dao/insure/InsureUserMapper.java
View file @
08df2c37
...
@@ -22,7 +22,7 @@ import java.util.List;
...
@@ -22,7 +22,7 @@ import java.util.List;
public
interface
InsureUserMapper
extends
BaseMapper
<
InsureUser
>
{
public
interface
InsureUserMapper
extends
BaseMapper
<
InsureUser
>
{
List
<
PolicyDto
>
selectPolicyList
(
@Param
(
"policyDto"
)
PolicyDto
policyDto
);
List
<
PolicyDto
>
selectPolicyList
(
@Param
(
"policyDto"
)
PolicyDto
policyDto
);
Integer
totalUser
(
@Param
(
"policyDto"
)
PolicyDto
policyDto
);
Integer
totalUser
(
@Param
(
"policyDto"
)
PolicyDto
policyDto
);
List
<
InsureUser
>
selectListByIds
(
@Param
(
"array"
)
String
[]
ids
);
List
<
InsureUser
>
selectListByIds
(
@Param
(
"array"
)
String
[]
ids
,
@Param
(
"policyId"
)
Integer
policyId
,
@Param
(
"createTime"
)
String
createTime
);
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
);
int
updateInsure
(
@Param
(
"array"
)
Integer
[]
ids
);
...
...
src/main/java/cn/timer/api/dao/yggl/YgglMainEmpMapper.java
View file @
08df2c37
...
@@ -146,4 +146,7 @@ public interface YgglMainEmpMapper extends BaseMapper<YgglMainEmp> {
...
@@ -146,4 +146,7 @@ public interface YgglMainEmpMapper extends BaseMapper<YgglMainEmp> {
List
<
YgglMainEmp
>
selectListByIZjNum
(
@Param
(
"array"
)
String
[]
zjNum
,
@Param
(
"orgCode"
)
Integer
orgCode
);
List
<
YgglMainEmp
>
selectListByIZjNum
(
@Param
(
"array"
)
String
[]
zjNum
,
@Param
(
"orgCode"
)
Integer
orgCode
);
int
updateInsure
(
@Param
(
"array"
)
Integer
[]
ids
);
int
updateInsure
(
@Param
(
"array"
)
Integer
[]
ids
);
/*查询当月已投保人*/
List
<
YgQueryDto
>
getInusrtUser
(
@Param
(
"orgCode"
)
Integer
orgCode
,
@Param
(
"isInsure"
)
Integer
isInsure
,
@Param
(
"createTime"
)
String
createTime
);
}
}
src/main/java/cn/timer/api/dto/yggl/YgQueryDto.java
View file @
08df2c37
...
@@ -80,4 +80,6 @@ public class YgQueryDto extends Page {
...
@@ -80,4 +80,6 @@ public class YgQueryDto extends Page {
@ApiModelProperty
(
value
=
"证件号码 "
,
example
=
"证件号码"
)
@ApiModelProperty
(
value
=
"证件号码 "
,
example
=
"证件号码"
)
private
String
zjNum
;
private
String
zjNum
;
private
Integer
insureId
;
}
}
src/main/resources/mapping/insure/InsureUserMapper.xml
View file @
08df2c37
...
@@ -394,6 +394,13 @@
...
@@ -394,6 +394,13 @@
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
#{id}
</foreach>
</foreach>
<if
test=
"policyId!=null and policyId !=''"
>
and policy_id =#{policyId}
</if>
<if
test=
"createTime!=null and createTime !=''"
>
and date_format(create_time,'%Y-%m') = #{createTime}
</if>
and status = 1 and insure_status = 1
</select>
</select>
<!--根据id数组查询员工-->
<!--根据id数组查询员工-->
...
...
src/main/resources/mapping/yggl/YgglMainEmpMapper.xml
View file @
08df2c37
...
@@ -483,4 +483,34 @@
...
@@ -483,4 +483,34 @@
</foreach>
</foreach>
</update>
</update>
<select
id=
"getInusrtUser"
resultType=
"cn.timer.api.dto.yggl.YgQueryDto"
>
SELECT
a.id id,
a.name empName,
a.emp_num empNum,
b.name deptName,
a.rz_time rzTime,
a.job_type jobType,
a.phone phone,
a.job_status jobStatus,
a.head_url headUrl,
a.sex sex,
a.is_insure isInsure,
a.zj_num zjNum,
iu.id insureId
FROM
yggl_main_emp a
LEFT JOIN zzgl_bmgw_m b ON a.bmgw_id = b.id
LEFT JOIN insure_user iu on iu.user_id=a.id AND date_format(iu.create_time,'%Y-%m') = #{createTime} and iu.insure_status=1 and iu.`status`=1
WHERE
a.org_code = #{orgCode}
AND
a.job_status in (0,1,2)
<if
test=
"isInsure!=null and isInsure != ''"
>
AND a.is_insure=#{isInsure}
</if>
ORDER BY
emp_num DESC
</select>
</mapper>
</mapper>
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