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
bd909e43
Commit
bd909e43
authored
3 years ago
by
翁国栋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
运营后台--
企业用户列表,增删改 用户批量投保
parent
9e21787f
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
227 additions
and
161 deletions
+227
-161
src/main/java/cn/timer/api/bean/insure/InsureApplicant.java
+3
-1
src/main/java/cn/timer/api/controller/insure/InsureApplicantController.java
+9
-69
src/main/java/cn/timer/api/controller/insure/InsureContorll.java
+66
-43
src/main/java/cn/timer/api/controller/qyzx/QyzxController.java
+45
-16
src/main/java/cn/timer/api/controller/superadmin/SuperLoginController.java
+1
-1
src/main/java/cn/timer/api/controller/yggl/YgglController.java
+15
-8
src/main/java/cn/timer/api/dao/qyzx/QyzxEntInfoMMapper.java
+10
-1
src/main/java/cn/timer/api/dao/yggl/YgglMainEmpMapper.java
+1
-1
src/main/java/cn/timer/api/dto/qyzx/EntInfoDto.java
+29
-0
src/main/java/cn/timer/api/dto/yggl/YgQueryDto.java
+2
-0
src/main/java/cn/timer/api/utils/ExcelUtils.java
+3
-18
src/main/resources/mapping/insure/InsureApplicantMapper.xml
+7
-3
src/main/resources/mapping/qyzx/QyzxEntInfoMMapper.xml
+32
-0
src/main/resources/mapping/yggl/YgglMainEmpMapper.xml
+4
-0
No files found.
src/main/java/cn/timer/api/bean/insure/InsureApplicant.java
View file @
bd909e43
...
...
@@ -48,7 +48,7 @@ public class InsureApplicant extends Model<InsureApplicant> {
/**
* 企业/网点名称
*/
@ApiModelProperty
(
value
=
"
目录
名称"
)
@ApiModelProperty
(
value
=
"
企业/网点
名称"
)
private
String
applicantEName
;
/**
* 企业/网点地址
...
...
@@ -132,6 +132,8 @@ public class InsureApplicant extends Model<InsureApplicant> {
private
String
applicantInvoicedAmount
;
@ApiModelProperty
(
value
=
"企业id"
,
example
=
""
)
private
Integer
orgCode
;
@ApiModelProperty
(
value
=
"银行账号"
)
private
String
applicantCorporateBankAccount
;
/**
* 设置:id
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/controller/insure/InsureApplicantController.java
View file @
bd909e43
...
...
@@ -44,88 +44,28 @@ import org.springframework.web.multipart.MultipartFile;
@Transactional
@RequestMapping
(
value
=
"/insureApplicant"
,
produces
=
{
"application/json"
})
public
class
InsureApplicantController
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
InsureApplicantController
.
class
);
@Autowired
private
InsureApplicantMapper
insureApplicantMapper
;
@Value
(
"insure.type.test.appid"
)
private
String
appid
;
@Value
(
"insure.type.test.secret"
)
private
String
secret
;
@Value
(
"insure.type.test.appidq"
)
private
String
appidq
;
@Value
(
"insure.type.test.secretq"
)
private
String
secretq
;
@Value
(
"insure.type.test.uploadUrl"
)
private
String
uploadUrl
;
@Value
(
"insure.type.test.insuredUrl"
)
private
String
insuredUrl
;
@Value
(
"insure.type.test.uploadUrlq"
)
private
String
uploadUrl2
;
@PostMapping
(
"/insureApplicationSetting"
)
@ApiOperation
(
value
=
"设置投保人"
,
httpMethod
=
"POST"
,
notes
=
"投保申请"
)
private
Result
<
Object
>
insureApplicationSetting
(
@CurrentUser
UserBean
userBean
,
@RequestBody
InsureApplicant
params
)
{
InsureApplicant
insureApplicant
=
InsureApplicant
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
InsureApplicant
>().
lambda
().
eq
(
InsureApplicant:
:
getOrgCode
,
userBean
.
getOrgCode
()));
if
(
insureApplicant
==
null
){
private
Result
<
Object
>
insureApplicationSetting
(
@RequestBody
InsureApplicant
params
)
{
InsureApplicant
insureApplicant
=
InsureApplicant
.
builder
().
id
(
1
).
build
().
selectById
();
if
(
insureApplicant
==
null
){
params
.
insert
();
return
ResultUtil
.
data
(
params
);
}
BeanUtils
.
copyProperties
(
params
,
insureApplicant
);
insureApplicant
.
updateById
();
return
ResultUtil
.
data
(
insureApplicant
);
params
.
setId
(
insureApplicant
.
getId
()
);
params
.
updateById
();
return
ResultUtil
.
data
(
params
);
}
@
Pos
tMapping
(
"/getApplicant"
)
@ApiOperation
(
value
=
"获取投保人"
,
httpMethod
=
"
POST
"
,
notes
=
"获取投保人"
)
private
Result
<
Object
>
getApplicant
(
@CurrentUser
UserBean
userBean
)
{
InsureApplicant
insureApplicant
=
InsureApplicant
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
InsureApplicant
>().
lambda
().
eq
(
InsureApplicant:
:
getOrgCode
,
userBean
.
getOrgCode
())
);
@
Ge
tMapping
(
"/getApplicant"
)
@ApiOperation
(
value
=
"获取投保人"
,
httpMethod
=
"
Get
"
,
notes
=
"获取投保人"
)
private
Result
<
Object
>
getApplicant
()
{
InsureApplicant
insureApplicant
=
InsureApplicant
.
builder
().
id
(
1
).
build
().
selectById
(
);
if
(
insureApplicant
==
null
){
return
ResultUtil
.
data
(
null
);
}
return
ResultUtil
.
data
(
insureApplicant
);
}
/**
* 设置链接参数
*
* @param sign
* @return
*/
private
Map
setParams
(
String
sign
)
{
/*当前时间戳*/
long
timestamp
=
System
.
currentTimeMillis
()/
1000
;
log
.
info
(
"时间戳"
+
timestamp
);
Map
paramsMap
=
Maps
.
newHashMap
();
paramsMap
.
put
(
"pid"
,
appidq
);
paramsMap
.
put
(
"timestamp"
,
String
.
valueOf
(
timestamp
));
paramsMap
.
put
(
"trace_id"
,
appidq
+
timestamp
+
new
Random
().
nextInt
((
9999
-
100
)
+
1
)
+
10
);
// paramsMap.put("sign",Md5.md5(appid+secret+timestamp+sign.trim()));
String
value
=
appidq
+
secretq
+
timestamp
+
sign
;
log
.
info
(
"body参数======"
+
sign
);
paramsMap
.
put
(
"sign"
,
DigestUtils
.
md5Hex
(
value
));
log
.
info
(
"params参数======"
+
JSONObject
.
toJSONString
(
paramsMap
));
return
paramsMap
;
}
/**
* 设置返回信息
*
* @param data
* @return
*/
private
Object
message
(
String
data
)
{
Map
<
String
,
Object
>
dataMap
=
JSONObject
.
parseObject
(
data
);
if
(
dataMap
.
get
(
"errcode"
).
toString
().
equals
(
"suc"
))
{
return
dataMap
.
get
(
"data"
);
}
return
dataMap
.
get
(
"errmsg"
);
}
}
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/controller/insure/InsureContorll.java
View file @
bd909e43
...
...
@@ -2,6 +2,7 @@ package cn.timer.api.controller.insure;
//import cn.timer.api.bean.insure.InsuredUser;
import
cn.timer.api.bean.crm.CrmBusinessGroupMember
;
import
cn.timer.api.bean.insure.InsureApplicant
;
import
cn.timer.api.bean.insure.InsurePolicy
;
import
cn.timer.api.bean.insure.InsureUser
;
import
cn.timer.api.bean.qyzx.QyzxEntInfoM
;
...
...
@@ -17,6 +18,7 @@ import cn.timer.api.dto.insure.PolicyDto;
import
cn.timer.api.utils.*
;
import
com.alibaba.druid.util.Base64
;
import
com.alibaba.fastjson.TypeReference
;
import
com.aliyuncs.http.HttpRequest
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.beust.jcommander.internal.Lists
;
...
...
@@ -27,6 +29,8 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.codec.digest.DigestUtils
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.eclipse.jetty.util.StringUtil
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -131,8 +135,8 @@ public class InsureContorll {
@PostMapping
(
value
=
"/insured_add"
)
@ApiOperation
(
value
=
"1.投保申请"
,
httpMethod
=
"Post"
,
notes
=
"投保申请"
)
@ApiOperationSupport
(
order
=
2
)
public
Result
<
Object
>
insured_add
(
@
CurrentUser
UserBean
userBean
,
@RequestParam
(
required
=
true
)
String
url
,
@
RequestBody
InsureDto
insureDto
)
{
QyzxEntInfoM
qyzxEntInfoM
=
QyzxEntInfoM
.
builder
().
id
(
userBean
.
getOrgCode
(
)).
build
().
selectById
();
// 企业信息
public
Result
<
Object
>
insured_add
(
@RequestBody
InsureDto
insureDto
)
{
QyzxEntInfoM
qyzxEntInfoM
=
QyzxEntInfoM
.
builder
().
id
(
Integer
.
parseInt
(
insureDto
.
getOrgCode
()
)).
build
().
selectById
();
// 企业信息
DateTimeFormatter
dtf2
=
DateTimeFormatter
.
ofPattern
(
"yyyyMMddHHmmss"
);
DateFormat
dtf3
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
LocalDateTime
now
=
LocalDateTime
.
now
();
...
...
@@ -151,6 +155,30 @@ public class InsureContorll {
quotations
.
put
(
"from_source"
,
""
);
/*币种:5人民币*/
quotations
.
put
(
"operator_name"
,
""
);
/*币种:5人民币*/
/*企业信息*/
InsureApplicant
insureApplicant
=
InsureApplicant
.
builder
().
id
(
1
).
build
().
selectById
();
if
(
insureApplicant
==
null
){
return
ResultUtil
.
error
(
"未设置投保人"
);
}
Map
companyApplicantMap
=
Maps
.
newHashMap
();
companyApplicantMap
.
put
(
"applicant_e_name"
,
insureApplicant
.
getApplicantEName
());
/*企业/网点名称*/
companyApplicantMap
.
put
(
"applicant_e_address"
,
insureApplicant
.
getApplicantEAddress
());
/*企业/网点地址*/
companyApplicantMap
.
put
(
"applicant_e_contacts"
,
insureApplicant
.
getApplicantEContacts
());
/*企业授权操作人姓名*/
companyApplicantMap
.
put
(
"applicant_e_phone"
,
insureApplicant
.
getApplicantEPhone
());
/*操作人的联系电话*/
companyApplicantMap
.
put
(
"applicant_e_no_type"
,
insureApplicant
.
getApplicantENoType
());
/*企业证件类型*/
companyApplicantMap
.
put
(
"applicant_e_no"
,
insureApplicant
.
getApplicantENo
());
/*企业证件号码*/
companyApplicantMap
.
put
(
"applicant_e_mail"
,
insureApplicant
.
getApplicantEMail
());
/*企业邮箱*/
companyApplicantMap
.
put
(
"applicant_province_city"
,
"21721"
);
/*省市区*/
/*人员清单填被保人员*/
String
url
=
creaXSSFWorkbook
(
insureDto
.
getUserIds
());
if
(!
StringUtil
.
isNotBlank
(
url
)){
return
ResultUtil
.
error
(
"文件错误"
);
}
companyApplicantMap
.
put
(
"applicant_employee_list"
,
url
);
quotations
.
put
(
"company_applicant"
,
companyApplicantMap
);
Map
basicMap
=
Maps
.
newHashMap
();
basicMap
.
put
(
"partner_pid"
,
"1231"
);
/*分销商pid*/
basicMap
.
put
(
"plan_code_id"
,
"61b85207b73d2ab09fb2959"
);
/*计划代码,选项值:61b85207b73d2ab09fb2959 (生产环境) 61b85207b73d2ab09fb2959 (沙箱环境)*/
...
...
@@ -168,26 +196,14 @@ public class InsureContorll {
quotations
.
put
(
"basic"
,
basicMap
);
quotations
.
put
(
"individual_applicant"
,
Maps
.
newHashMap
());
/*企业信息*/
Map
companyApplicantMap
=
Maps
.
newHashMap
();
companyApplicantMap
.
put
(
"applicant_e_name"
,
"测试企业一"
);
/*企业/网点名称*/
companyApplicantMap
.
put
(
"applicant_e_address"
,
"测试地址"
);
/*企业/网点地址*/
companyApplicantMap
.
put
(
"applicant_e_contacts"
,
"测试人"
);
/*企业授权操作人姓名*/
companyApplicantMap
.
put
(
"applicant_e_phone"
,
"13800138000"
);
/*操作人的联系电话*/
companyApplicantMap
.
put
(
"applicant_e_no_type"
,
"3646"
);
/*企业证件类型*/
companyApplicantMap
.
put
(
"applicant_e_no"
,
"91310230MA1JXL5059"
);
/*企业证件号码*/
companyApplicantMap
.
put
(
"applicant_e_mail"
,
"123@123.com"
);
/*企业邮箱*/
companyApplicantMap
.
put
(
"applicant_province_city"
,
"21721"
);
/*省市区*/
/*人员清单填被保人员*/
companyApplicantMap
.
put
(
"applicant_employee_list"
,
url
);
quotations
.
put
(
"company_applicant"
,
companyApplicantMap
);
/*被保人员 填被保企业信息*/
ArrayList
<
Map
>
insuredArray
=
new
ArrayList
<>();
Map
insured
=
Maps
.
newHashMap
();
insured
.
put
(
"trans_id"
,
"P_"
+
qyzxEntInfoM
.
getId
()+
"_"
+
dtf2
.
format
(
now
));
insured
.
put
(
"price"
,
"75"
);
/*根据基础计划生成*/
insured
.
put
(
"price"
,
insureDto
.
getUserIds
().
length
*
15
);
/*根据基础计划生成*/
insured
.
put
(
"insured_applicant_relations"
,
"36960"
);
insured
.
put
(
"insured_mobile"
,
qyzxEntInfoM
.
getLinkManPhone
());
insured
.
put
(
"insured_e_contact"
,
qyzxEntInfoM
.
getLinkMan
());
...
...
@@ -246,7 +262,7 @@ public class InsureContorll {
insurePolicy
.
setStatus
(
"1"
);
insurePolicy
.
setPolicyFile
(
policyMap
.
get
(
"policy_file"
).
toString
());
insurePolicy
.
setKitUrl
(
policyMap
.
get
(
"kit_url"
).
toString
());
insurePolicy
.
setOrgCode
(
userBean
.
getOrgCode
());
insurePolicy
.
setOrgCode
(
qyzxEntInfoM
.
getId
());
insurePolicy
.
setCreateTime
(
new
Date
());
insurePolicy
.
setSchemeName
(
"【新】-安诚-雇主责任险(劳务公司)预付款"
);
/*先写死*/
insurePolicy
.
insert
();
...
...
@@ -255,12 +271,8 @@ public class InsureContorll {
insurePolicy
.
setPolicyDateEnd
(
null
);
e
.
printStackTrace
();
}
}
return
ResultUtil
.
data
(
""
);
return
ResultUtil
.
error
(
""
);
}
/*测试用生产环境不需要*/
...
...
@@ -272,7 +284,7 @@ public class InsureContorll {
}
else
{
if
(
dataMap
.
get
(
"errcode"
).
toString
().
equals
(
"e1"
)&&
dataMap
.
get
(
"errmsg"
).
toString
().
equals
(
"出单中"
)){
try
{
Thread
.
sleep
(
6
0000
);
Thread
.
sleep
(
3
0000
);
return
requestAgent
(
bodyMap
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
...
...
@@ -358,51 +370,62 @@ public class InsureContorll {
return
dataMap
.
get
(
"errmsg"
);
}
@GetMapping
(
value
=
"/downExcel"
)
@ApiOperation
(
value
=
"2.核保"
,
httpMethod
=
"Get"
,
notes
=
"下载投保文件"
)
@ApiOperationSupport
(
order
=
2
)
public
void
downExcel
(
@CurrentUser
UserBean
userBean
,
HttpServletRequest
request
,
HttpServletResponse
resp
,
@RequestParam
(
"ids"
)
String
[]
ids
){
public
String
creaXSSFWorkbook
(
String
[]
ids
){
if
(
ids
.
length
<=
0
){
return
;
return
"error"
;
}
LocalDate
localDate
=
LocalDate
.
now
();
/*获取该企业下所有未投保员工 测试用*/
// List<YgglMainEmp> ygglMainEmpList =YgglMainEmp.builder().build().selectList(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode,userBean.getOrgCode())
// .eq(YgglMainEmp::getIsInsure,0));
List
<
YgglMainEmp
>
ygglMainEmpList
=
ygglMainEmpMapper
.
selectListByIds
(
ids
);
ExcelBean
excelBean
;
List
list
=
Lists
.
newArrayList
();
for
(
YgglMainEmp
y:
ygglMainEmpList
)
{
String
[]
arr
=
new
String
[]{
String
.
valueOf
(
y
.
getId
()),
y
.
getName
(),
"身份证"
,
y
.
getZjNum
(),
"50万意外/5万医疗/扩展24小时(A类)"
,
""
,
"深圳名邦人力资源管理有限公司"
,
"无"
,
"A类"
};
list
.
add
(
arr
);
}
String
[]
rowName
=
new
String
[]{
"ID"
,
"name"
,
"ID_type"
,
"ID_number"
,
"Scheme_name"
,
"Date_start"
,
"Branch"
,
"Tricycle_frame_number"
,
"benefit_occupation_category"
};
/*随机抽取五名幸运用户投保*/
OutputStream
os
=
null
;
XSSFWorkbook
xssfWorkbook
=
ExcelUtils
.
exportExcel
(
localDate
+
"_"
+
list
.
size
()+
"名人员清单.xlsx"
,
rowName
,
list
);
ByteArrayOutputStream
byteArrayOutputStream
=
new
ByteArrayOutputStream
();
try
{
resp
.
setContentType
(
"application/octet-stream"
);
resp
.
setHeader
(
"content-disposition"
,
"attachment; filename="
+
URLEncoder
.
encode
(
localDate
+
"_"
+
list
.
size
()+
"名人员清单.xlsx"
,
"UTF-8"
));
resp
.
setCharacterEncoding
(
"UTF-8"
);
os
=
resp
.
getOutputStream
();
ExcelUtils
.
exportExcel
(
localDate
+
"_"
+
list
.
size
()+
"名人员清单.xlsx"
,
rowName
,
list
,
os
);
}
catch
(
FileNotFoundException
e
)
{
e
.
printStackTrace
();
xssfWorkbook
.
write
(
byteArrayOutputStream
);
byte
[]
bytes
=
byteArrayOutputStream
.
toByteArray
();
String
fileBase64
=
Base64
.
byteArrayToBase64
(
bytes
);
/*body参数 begin*/
Map
bodyMap
=
Maps
.
newHashMap
();
bodyMap
.
put
(
"app"
,
"mall"
);
bodyMap
.
put
(
"name"
,
localDate
+
"_"
+
list
.
size
()+
"名人员清单.xlsx"
);
bodyMap
.
put
(
"file"
,
fileBase64
);
/*end*/
String
data
=
HttpUtils
.
sendPost
(
uploadUrl
,
setParams
(
JSONObject
.
toJSONString
(
bodyMap
)),
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
));
return
map
.
get
(
"url"
).
toString
();
}
/*文件流base64*/
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
finally
{
try
{
os
.
close
();
xssfWorkbook
.
close
();
byteArrayOutputStream
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
return
"suc"
;
}
@PostMapping
(
value
=
"/policyList"
)
@ApiOperation
(
value
=
"3.保单列表"
,
httpMethod
=
"Post"
,
notes
=
"保单列表"
)
@ApiOperationSupport
(
order
=
2
)
public
Result
<
Object
>
policyList
(
@RequestBody
PolicyDto
policyDto
)
{
List
<
PolicyDto
>
list
=
insureUserMapper
.
selectPolicyList
(
String
.
valueOf
(
policyDto
.
getId
()));
return
ResultUtil
.
data
(
list
);
return
ResultUtil
.
data
(
Optional
.
ofNullable
(
list
).
orElse
(
Lists
.
newArrayList
())
);
}
@PostMapping
(
value
=
"/policyListAdmin"
)
@ApiOperation
(
value
=
"4.保单列表--运营后台端"
,
httpMethod
=
"Post"
,
notes
=
"保单列表"
)
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/controller/qyzx/QyzxController.java
View file @
bd909e43
package
cn
.
timer
.
api
.
controller
.
qyzx
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
javax.servlet.http.HttpSession
;
import
cn.timer.api.dto.qyzx.*
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
...
...
@@ -57,12 +52,6 @@ import cn.timer.api.dao.qyzx.QyzxOperLogMapper;
import
cn.timer.api.dao.qyzx.QyzxPayServeMapper
;
import
cn.timer.api.dao.zzgl.ZzglBmgwMMapper
;
import
cn.timer.api.dto.login.QysDto
;
import
cn.timer.api.dto.qyzx.AdminListDto
;
import
cn.timer.api.dto.qyzx.AttaFpglQueryDto
;
import
cn.timer.api.dto.qyzx.EntauthDto
;
import
cn.timer.api.dto.qyzx.LogBuyDto
;
import
cn.timer.api.dto.qyzx.MenuStructureDto
;
import
cn.timer.api.dto.qyzx.QyzxOperLogQuaryDto
;
import
cn.timer.api.utils.Result
;
import
cn.timer.api.utils.ResultUtil
;
import
io.swagger.annotations.Api
;
...
...
@@ -617,4 +606,44 @@ public class QyzxController {
return
ResultUtil
.
data
(
delCount
,
"操作成功!"
);
}
/**
* 运营后台---企业信息列表
* @param
* @param cdys
* @return
*/
@PostMapping
(
value
=
"/companyAdminList"
)
@ApiOperation
(
value
=
"运营后台---企业信息列表"
,
httpMethod
=
"POST"
,
notes
=
""
)
public
Result
<
Object
>
companyAdminList
(
@RequestBody
cn
.
timer
.
api
.
utils
.
Page
page
)
{
Map
map
=
Maps
.
newHashMap
();
List
<
EntInfoDto
>
list
=
Optional
.
ofNullable
(
qyzxEntInfoMMapper
.
companyAdminList
(
page
)).
orElse
(
Lists
.
newArrayList
());
Integer
count
=
qyzxEntInfoMMapper
.
companyAdminCount
();
map
.
put
(
"list"
,
list
);
map
.
put
(
"count"
,
count
);
return
ResultUtil
.
data
(
map
);
}
@GetMapping
(
value
=
"/selectentbyId"
)
@ApiOperation
(
value
=
"运营后台---获取企业信息"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
public
Result
<
Object
>
selectentbyId
(
@RequestParam
(
"id"
)
String
id
)
{
QyzxEntInfoM
qyzxEntInfoM
=
QyzxEntInfoM
.
builder
().
id
(
Integer
.
parseInt
(
id
)).
build
().
selectById
();
return
ResultUtil
.
data
(
qyzxEntInfoM
,
"获取企业信息成功"
);
}
@PostMapping
(
value
=
"/aeCompamy"
)
@ApiOperation
(
value
=
"运营后台---添加/修改企业信息"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@Log
(
title
=
"运营后台---添加/修改-企业信息"
,
businessType
=
BusinessType
.
UPDATE
)
public
Result
<
QyzxEntInfoM
>
aeCompamy
(
@RequestBody
QyzxEntInfoM
qyzxEntInfoM
)
{
QyzxEntInfoM
q
=
new
LambdaQueryChainWrapper
<
QyzxEntInfoM
>(
qyzxEntInfoMMapper
)
.
eq
(
QyzxEntInfoM:
:
getId
,
qyzxEntInfoM
.
getId
()).
one
();
if
(
q
!=
null
){
qyzxEntInfoM
.
setRegisterTime
(
q
.
getRegisterTime
());
}
qyzxEntInfoM
.
insertOrUpdate
();
return
ResultUtil
.
data
(
qyzxEntInfoM
,
"添加/修改企业"
);
}
@GetMapping
(
value
=
"/getCompanySelect"
)
@ApiOperation
(
value
=
"运营后台---获取选择框下的企业信息"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
public
Result
<
Object
>
getCompanySelect
()
{
return
ResultUtil
.
data
(
qyzxEntInfoMMapper
.
getCompanyList
(),
"获取成功"
);
}
}
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/controller/superadmin/SuperLoginController.java
View file @
bd909e43
...
...
@@ -35,7 +35,7 @@ public class SuperLoginController {
private
HttpSession
session
;
@PostMapping
(
value
=
"/adminLogin"
)
@ApiOperation
(
value
=
"运营后台登录"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
public
Result
<
AdminAccoun
t
>
adminLogin
(
@RequestBody
EntRegisterDto
entRegisterDto
,
HttpServletRequest
request
){
public
Result
<
Objec
t
>
adminLogin
(
@RequestBody
EntRegisterDto
entRegisterDto
,
HttpServletRequest
request
){
String
ip
=
UserIp
.
getIpAddr
(
request
);
AdminAccount
adminAccount
=
AdminAccount
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
AdminAccount
>().
lambda
()
.
eq
(
AdminAccount:
:
getAccount
,
entRegisterDto
.
getPhone
())
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/controller/yggl/YgglController.java
View file @
bd909e43
...
...
@@ -33,13 +33,7 @@ import org.springframework.util.LinkedMultiValueMap;
import
org.springframework.util.MultiValueMap
;
import
org.springframework.util.StringUtils
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.client.RestTemplate
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
...
@@ -1596,7 +1590,7 @@ public class YgglController {
@ApiOperation
(
value
=
"62.查询员工列表"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
62
)
public
Result
<
List
<
YgQueryDto
>>
queryEmpMessage
(
@CurrentUser
UserBean
userBean
)
{
List
<
YgQueryDto
>
ygQueryDto
=
ygglMainEmpMapper
.
queryEmpMessage
(
userBean
.
getOrgCode
());
List
<
YgQueryDto
>
ygQueryDto
=
ygglMainEmpMapper
.
queryEmpMessage
(
userBean
.
getOrgCode
()
,
null
);
for
(
YgQueryDto
yg
:
ygQueryDto
)
{
if
(
StringUtil
.
isEmpty
(
yg
.
getHeadUrl
()))
{
yg
.
setHeadUrl
(
""
);
...
...
@@ -2034,5 +2028,18 @@ public class YgglController {
}
@GetMapping
(
value
=
"/getUserList"
)
@ApiOperation
(
value
=
"62-1.运营后台--查询员工列表"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
62
)
public
Result
<
List
<
YgQueryDto
>>
getUserList
(
@RequestParam
(
"companyId"
)
String
companyId
)
{
List
<
YgQueryDto
>
ygQueryDto
=
ygglMainEmpMapper
.
queryEmpMessage
(
Integer
.
parseInt
(
companyId
),
0
);
for
(
YgQueryDto
yg
:
ygQueryDto
)
{
if
(
StringUtil
.
isEmpty
(
yg
.
getHeadUrl
()))
{
yg
.
setHeadUrl
(
""
);
}
}
return
ResultUtil
.
data
(
ygQueryDto
);
}
}
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/dao/qyzx/QyzxEntInfoMMapper.java
View file @
bd909e43
package
cn
.
timer
.
api
.
dao
.
qyzx
;
import
cn.timer.api.dto.qyzx.EntInfoDto
;
import
cn.timer.api.utils.Page
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
cn.timer.api.bean.qyzx.QyzxEntInfoM
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -14,6 +18,11 @@ import cn.timer.api.bean.qyzx.QyzxEntInfoM;
*/
@Repository
public
interface
QyzxEntInfoMMapper
extends
BaseMapper
<
QyzxEntInfoM
>
{
public
List
<
EntInfoDto
>
companyAdminList
(
@Param
(
"page"
)
Page
page
);
public
Integer
companyAdminCount
();
public
List
<
Map
<
String
,
String
>>
getCompanyList
();
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/dao/yggl/YgglMainEmpMapper.java
View file @
bd909e43
...
...
@@ -49,7 +49,7 @@ public interface YgglMainEmpMapper extends BaseMapper<YgglMainEmp> {
* @param userBean
* @return
*/
List
<
YgQueryDto
>
queryEmpMessage
(
@Param
(
"orgCode"
)
Integer
orgCode
);
List
<
YgQueryDto
>
queryEmpMessage
(
@Param
(
"orgCode"
)
Integer
orgCode
,
@Param
(
"isInsure"
)
Integer
isInsure
);
/**
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/dto/qyzx/EntInfoDto.java
0 → 100644
View file @
bd909e43
package
cn
.
timer
.
api
.
dto
.
qyzx
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
/**
* @Description TODO
* @Author wgd
* @Date 2022/3/17 10:09
*/
@Data
public
class
EntInfoDto
{
private
Integer
id
;
private
String
name
;
private
String
linkMan
;
private
String
linkManPhone
;
private
String
areaName
;
private
String
totalNum
;
private
String
logoUrl
;
private
String
registerTime
;
private
String
endTime
;
private
Integer
totlaSpmk
;
private
Integer
totlaCc
;
}
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/dto/yggl/YgQueryDto.java
View file @
bd909e43
...
...
@@ -27,6 +27,8 @@ import lombok.NoArgsConstructor;
public
class
YgQueryDto
extends
Page
{
// private static final long serialVersionUID = -1230023773946170942L;
@ApiModelProperty
private
Integer
id
;
@ApiModelProperty
(
value
=
"员工姓名"
,
example
=
"华仔"
)
private
String
empName
;
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/utils/ExcelUtils.java
View file @
bd909e43
...
...
@@ -291,11 +291,11 @@ public class ExcelUtils {
* @param out 输出流
* @throws Exception
*/
public
static
void
exportExcel
(
String
title
,
String
[]
rowName
,
List
<
Object
[]>
dataList
,
OutputStream
ou
t
)
{
public
static
XSSFWorkbook
exportExcel
(
String
title
,
String
[]
rowName
,
List
<
Object
[]>
dataLis
t
)
{
logger
.
info
(
"========================= ExcelUtils.java ->> exportExcel()导出数据到Excel中 ->> 开始 ========================="
);
XSSFWorkbook
workbook
=
null
;
try
{
/*
1,创建工作簿对象,然后创建大标题行,并设置标题
*/
...
...
@@ -417,22 +417,7 @@ public class ExcelUtils {
sheet
.
setColumnWidth
(
colNum
,
(
columnWidth
+
4
)
*
256
);
}
}
workbook
.
write
(
out
);
}
catch
(
Exception
e
)
{
logger
.
info
(
"ExcelUtils.java ->> exportExcel() ->> 异常信息:"
+
e
);
throw
new
RuntimeException
(
e
);
}
finally
{
try
{
if
(
workbook
!=
null
)
{
workbook
.
close
();
logger
.
info
(
"ExcelUtils.java ->> exportExcel() ->> 关闭Workbook资源"
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
logger
.
info
(
"========================= ExcelUtils.java ->> exportExcel()导出数据到Excel中 ->> 结束 ========================="
);
}
return
workbook
;
}
/**
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/mapping/insure/InsureApplicantMapper.xml
View file @
bd909e43
...
...
@@ -23,6 +23,7 @@
<result
property=
"transId"
column=
"trans_id"
/>
<result
property=
"currency"
column=
"currency"
/>
<result
property=
"applicantInvoicedAmount"
column=
"applicant_invoiced_amount"
/>
<result
property=
"applicantCorporateBankAccount"
column=
"applicant_corporate_bank_account"
/>
</resultMap>
<select
id=
"queryObject"
resultType=
"cn.timer.api.bean.insure.InsureApplicant"
>
...
...
@@ -145,7 +146,8 @@
`applicant_type`,
`trans_id`,
`currency`,
`applicant_invoiced_amount`)
`applicant_invoiced_amount`,
`applicant_corporate_bank_account`)
values (#{applicantEName},
#{applicantEAddress},
#{applicantEmployeeList},
...
...
@@ -162,7 +164,7 @@
#{applicantType},
#{transId},
#{currency},
#{applicant
InvoicedAm
ount})
#{applicant
CorporateBankAcc
ount})
</insert>
<insert
id=
"saveSelective"
parameterType=
"cn.timer.api.bean.insure.InsureApplicant"
useGeneratedKeys=
"true"
...
...
@@ -186,6 +188,7 @@
<if
test=
"transId != null"
>
,`trans_id`
</if>
<if
test=
"currency != null"
>
,`currency`
</if>
<if
test=
"applicantInvoicedAmount != null"
>
,`applicant_invoiced_amount`
</if>
<if
test=
"applicantCorporateBankAccount != null"
>
,`applicant_corporate_bank_account`
</if>
)
values
(
...
...
@@ -205,7 +208,7 @@
<if
test=
"applicantType != null"
>
,#{applicantType}
</if>
<if
test=
"transId != null"
>
,#{transId}
</if>
<if
test=
"currency != null"
>
,#{currency}
</if>
<if
test=
"applicant
InvoicedAmount != null"
>
,#{applicantInvoicedAm
ount}
</if>
<if
test=
"applicant
CorporateBankAccount != null"
>
,#{applicantCorporateBankAcc
ount}
</if>
)
</insert>
...
...
@@ -283,6 +286,7 @@
<if
test=
"transId != null"
>
`trans_id` = #{transId},
</if>
<if
test=
"currency != null"
>
`currency` = #{currency},
</if>
<if
test=
"applicantInvoicedAmount != null"
>
`applicant_invoiced_amount` = #{applicantInvoicedAmount}
</if>
<if
test=
"applicantCorporateBankAccount != null"
>
`applicant_corporate_bank_account` = #{applicantCorporateBankAccount}
</if>
</set>
where id = #{id}
</update>
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/mapping/qyzx/QyzxEntInfoMMapper.xml
View file @
bd909e43
...
...
@@ -199,5 +199,37 @@
</select>
-->
<select
id=
"companyAdminList"
resultType=
"cn.timer.api.dto.qyzx.EntInfoDto"
>
SELECT
qeim.id AS id,
qeim.logo_url AS logoUrl,
qeim.NAME AS NAME,
qeim.link_man AS linkMan,
qeim.phone AS linkManPhone,
qeim.area_name AS areaName,
count( yme.id ) AS totalNum,
qeim.register_time AS registerTime,
qeim.end_time AS endTime,
IFNULL(a.totlaSpmk,0) as totlaSpmk,
IFNULL(b.totlaCc,0) as totlaCc
FROM
qyzx_ent_info_m qeim
LEFT JOIN yggl_main_emp yme ON yme.org_code = qeim.id
LEFT JOIN ( SELECT sas.org_code AS oid, count( sas.id ) AS totlaSpmk FROM spmk_approve_summary sas GROUP BY sas.org_code ) AS a ON a.oid = qeim.id
LEFT JOIN ( SELECT cc.organization_id AS oid, count( cc.id ) AS totlaCc FROM cms_content cc GROUP BY cc.organization_id ) AS b ON b.oid = qeim.id
GROUP BY
qeim.id
<if
test=
"page.offset != null and page.totalPage !=null"
>
limit #{page.offset},#{page.totalPage}
</if>
</select>
<select
id=
"companyAdminCount"
resultType=
"java.lang.Integer"
>
select count(qeim.id) from qyzx_ent_info_m qeim
</select>
<select
id =
"getCompanyList"
resultType=
"java.util.HashMap"
>
select id as value , name as label from qyzx_ent_info_m
</select>
</mapper>
This diff is collapsed.
Click to expand it.
src/main/resources/mapping/yggl/YgglMainEmpMapper.xml
View file @
bd909e43
...
...
@@ -231,6 +231,7 @@
<!-- 查询员工信息 搜索 分页 -->
<select
id=
"queryEmpMessage"
resultType=
"cn.timer.api.dto.yggl.YgQueryDto"
>
SELECT
a.id,
a.name empName,
a.emp_num empNum,
b.name deptName,
...
...
@@ -247,6 +248,9 @@
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>
...
...
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