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
aaf55d6c
Commit
aaf55d6c
authored
Mar 17, 2022
by
龙于生
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
给国栋提交漏提交的代码
parent
2304e69a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
266 additions
and
257 deletions
+266
-257
src/main/java/cn/timer/api/bean/yggl/YgglMainEmp.java
+230
-230
src/main/java/cn/timer/api/controller/insure/InsureContorll.java
+4
-8
src/main/java/cn/timer/api/utils/HttpUtils.java
+32
-19
No files found.
src/main/java/cn/timer/api/bean/yggl/YgglMainEmp.java
View file @
aaf55d6c
package
cn
.
timer
.
api
.
bean
.
yggl
;
import
java.util.Date
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
javax.persistence.Transient
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.extension.activerecord.Model
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @author Tang 2019-11-15
*/
@Entity
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Table
(
name
=
"yggl_main_emp"
)
@ApiModel
(
"员工档案"
)
public
class
YgglMainEmp
extends
Model
<
YgglMainEmp
>
{
private
static
final
long
serialVersionUID
=
977019534920585689L
;
@Id
@GeneratedValue
@TableId
(
type
=
IdType
.
AUTO
)
@ApiModelProperty
(
value
=
"员工编号 员工编号"
,
example
=
"101"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"员工工号 "
,
example
=
"员工工号"
)
private
Integer
empNum
;
@ApiModelProperty
(
value
=
"手机号码 手机号码"
,
example
=
"101"
)
private
String
phone
;
@ApiModelProperty
(
value
=
"密码 "
,
example
=
"密码"
)
private
String
password
;
@ApiModelProperty
(
value
=
"头像 "
,
example
=
"base64来处理头像"
)
private
String
headUrl
;
@ApiModelProperty
(
value
=
"名称 "
,
example
=
"名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"英文名称 "
,
example
=
"英文名称"
)
private
String
englishName
;
@ApiModelProperty
(
value
=
"性别 0:男;1:女"
,
example
=
"0"
)
private
Integer
sex
;
@ApiModelProperty
(
value
=
"证件类型 0:身份证;1:港澳居民来往内地通行证;2:台湾居民来往大陆通行证;3:外国护照;4:其他"
,
example
=
"101"
)
private
Integer
zjType
;
@ApiModelProperty
(
value
=
"证件号码 "
,
example
=
"证件号码"
)
private
String
zjNum
;
@ApiModelProperty
(
value
=
"身份证有效期 "
,
example
=
"身份证有效到期日"
)
private
Date
sfzyxTime
;
@ApiModelProperty
(
value
=
"出生日期 "
,
example
=
"出生日期"
)
private
Date
birthday
;
@ApiModelProperty
(
value
=
"年龄 年龄"
,
example
=
"101"
)
private
Integer
age
;
@ApiModelProperty
(
value
=
"是否已婚 0:否、1:是"
,
example
=
"101"
)
private
Integer
isMarried
;
@ApiModelProperty
(
value
=
"是否已育 0:否、1:是"
,
example
=
"101"
)
private
Integer
isPregnant
;
@ApiModelProperty
(
value
=
"国家地区 0:中国;1:中国香港;2:中国澳门;3:中国台湾"
,
example
=
"101"
)
private
Integer
area
;
@ApiModelProperty
(
value
=
"民族 56个名族"
,
example
=
"101"
)
private
Integer
mz
;
@ApiModelProperty
(
value
=
"政治面貌 1:中共党员;2:中共预备党员;3共青团员;4:民革党员;5:民盟盟员;6:民建会员;7:民进会员;8:农工党党员;9:致公党党员;10:九三学社社员;11:台盟盟员;12:无党派人士;13:群众"
,
example
=
"101"
)
private
Integer
zzmm
;
@ApiModelProperty
(
value
=
"籍贯 省"
,
example
=
"101"
)
private
String
jg
;
@ApiModelProperty
(
value
=
"籍贯 省id"
,
example
=
"101"
)
private
String
jgId
;
@ApiModelProperty
(
value
=
"省"
)
private
String
province
;
@ApiModelProperty
(
value
=
"省id"
)
private
String
provinceId
;
@ApiModelProperty
(
value
=
"市"
)
private
String
city
;
@ApiModelProperty
(
value
=
"市id"
)
private
String
cityId
;
@ApiModelProperty
(
value
=
"区"
)
private
String
district
;
@ApiModelProperty
(
value
=
"区编号"
)
private
String
districtId
;
@ApiModelProperty
(
value
=
"户口性质 1:城镇户口;2:农村户口;3:居民户口"
,
example
=
"101"
)
private
Integer
hkType
;
@ApiModelProperty
(
value
=
"户籍地址 "
,
example
=
"详细地址"
)
private
String
hkAddress
;
@ApiModelProperty
(
value
=
"QQ QQ"
,
example
=
"101"
)
private
Integer
qq
;
@ApiModelProperty
(
value
=
"微信 "
,
example
=
"微信"
)
private
String
wechat
;
// @ApiModelProperty(value="个人邮箱 ",example="个人邮箱")
// private String email;
@ApiModelProperty
(
value
=
"血型 "
,
example
=
"血型"
)
private
String
bloodType
;
@ApiModelProperty
(
value
=
"语言 "
,
example
=
"语言"
)
private
String
language
;
@ApiModelProperty
(
value
=
"最高学历 1:小学;2:初中;3:高中;4:中专;5:大专;6:本科;7:研究生;8:硕士;9:博士;"
,
example
=
"101"
)
private
Integer
edu
;
@ApiModelProperty
(
value
=
"专业 "
,
example
=
"专业"
)
private
String
zy
;
@ApiModelProperty
(
value
=
"转正备注 "
,
example
=
"转正备注"
)
private
String
zzRemark
;
@ApiModelProperty
(
value
=
"工作性质 0全职、1实习、2兼职、3劳务派遣、4劳务、5派遣、6外包、7退休返聘"
,
example
=
"101"
)
private
Integer
jobType
;
@ApiModelProperty
(
value
=
"员工状态 0试用、1正式、2离职中、3已离职"
,
example
=
"101"
)
private
Integer
jobStatus
;
@ApiModelProperty
(
value
=
"入职日期 "
,
example
=
"客户注册后的时间为入职时间"
)
private
Date
rzTime
;
@ApiModelProperty
(
value
=
"试用期 0:无试用期;1:1个月;2:2个月;3:3个月;4:4个月;5:5个月;6:6个月(有试用期显示选项)"
,
example
=
"101"
)
private
Integer
syq
;
@ApiModelProperty
(
value
=
"应转正日期 "
,
example
=
"人事记录要自动转正的日期"
)
private
Date
zzTime
;
@ApiModelProperty
(
value
=
"实际转正日期 "
,
example
=
"人事手动记录要转正的日期"
)
private
Date
sjzzTime
;
@ApiModelProperty
(
value
=
"是否计入考勤 0:否;1:是"
,
example
=
"101"
)
private
Integer
isJrkq
;
@ApiModelProperty
(
value
=
"公司内部工号 就是公司内部自己设置的工号"
,
example
=
"101"
)
private
String
jobNum
;
@ApiModelProperty
(
value
=
"工作地点 "
,
example
=
"工作地点"
)
private
String
workAddress
;
@ApiModelProperty
(
value
=
"工作电话 工作电话"
,
example
=
"101"
)
private
Integer
workPhone
;
@ApiModelProperty
(
value
=
"工作邮箱 "
,
example
=
"工作邮箱"
)
private
String
workEmail
;
@ApiModelProperty
(
value
=
"招聘渠道 招聘渠道应该是活性的"
,
example
=
"101"
)
private
Integer
zpqd
;
@ApiModelProperty
(
value
=
"部门岗位id 部门岗位id"
,
example
=
"101"
)
private
Integer
bmgwId
;
@ApiModelProperty
(
value
=
"部门名称"
,
example
=
""
)
private
String
bmgwName
;
@ApiModelProperty
(
value
=
"修改时间"
,
example
=
"修改时间"
)
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"修改人"
,
example
=
"修改人"
)
private
Integer
updateMan
;
@ApiModelProperty
(
value
=
"组织机构代码 组织机构代码"
,
example
=
"101"
)
private
Integer
orgCode
;
@ApiModelProperty
(
value
=
"微信id"
,
example
=
"UnionID微信系统唯一id"
)
private
String
unionid
;
@ApiModelProperty
(
value
=
"公众号id"
,
example
=
"openid公众号唯一id"
)
private
String
openid
;
@ApiModelProperty
(
value
=
"小程序id"
,
example
=
"mpopenid小程序"
)
private
String
mpopenid
;
@ApiModelProperty
(
value
=
"手机APPid"
,
example
=
"appopenid手机app"
)
private
String
appopenid
;
// @ApiModelProperty(value="是否企业中心管理员 ",example="0-否 1-主账号 2-子账号")
// private Integer isManager;
@ApiModelProperty
(
value
=
"离职前状态 1试用、2正式 "
,
example
=
"1试用、2正式"
)
private
Integer
beforeLeavingSts
;
@ApiModelProperty
(
value
=
"自定义工号"
,
example
=
""
)
private
String
customNum
;
@Transient
@TableField
(
exist
=
false
)
private
String
workTime
;
//工龄
@Transient
@TableField
(
exist
=
false
)
private
String
error
;
//错误信息提示
@Transient
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
"员工登陆账号(手机号)"
,
example
=
"员工登陆账号(手机号)"
)
private
String
empLoginPhone
;
}
\ No newline at end of file
package
cn
.
timer
.
api
.
bean
.
yggl
;
import
java.util.Date
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
javax.persistence.Transient
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.extension.activerecord.Model
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @author Tang 2019-11-15
*/
@Entity
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Table
(
name
=
"yggl_main_emp"
)
@ApiModel
(
"员工档案"
)
public
class
YgglMainEmp
extends
Model
<
YgglMainEmp
>
{
private
static
final
long
serialVersionUID
=
977019534920585689L
;
@Id
@GeneratedValue
@TableId
(
type
=
IdType
.
AUTO
)
@ApiModelProperty
(
value
=
"员工编号 员工编号"
,
example
=
"101"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"员工工号 "
,
example
=
"员工工号"
)
private
Integer
empNum
;
@ApiModelProperty
(
value
=
"手机号码 手机号码"
,
example
=
"101"
)
private
String
phone
;
@ApiModelProperty
(
value
=
"密码 "
,
example
=
"密码"
)
private
String
password
;
@ApiModelProperty
(
value
=
"头像 "
,
example
=
"base64来处理头像"
)
private
String
headUrl
;
@ApiModelProperty
(
value
=
"名称 "
,
example
=
"名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"英文名称 "
,
example
=
"英文名称"
)
private
String
englishName
;
@ApiModelProperty
(
value
=
"性别 0:男;1:女"
,
example
=
"0"
)
private
Integer
sex
;
@ApiModelProperty
(
value
=
"证件类型 0:身份证;1:港澳居民来往内地通行证;2:台湾居民来往大陆通行证;3:外国护照;4:其他"
,
example
=
"101"
)
private
Integer
zjType
;
@ApiModelProperty
(
value
=
"证件号码 "
,
example
=
"证件号码"
)
private
String
zjNum
;
@ApiModelProperty
(
value
=
"身份证有效期 "
,
example
=
"身份证有效到期日"
)
private
Date
sfzyxTime
;
@ApiModelProperty
(
value
=
"出生日期 "
,
example
=
"出生日期"
)
private
Date
birthday
;
@ApiModelProperty
(
value
=
"年龄 年龄"
,
example
=
"101"
)
private
Integer
age
;
@ApiModelProperty
(
value
=
"是否已婚 0:否、1:是"
,
example
=
"101"
)
private
Integer
isMarried
;
@ApiModelProperty
(
value
=
"是否已育 0:否、1:是"
,
example
=
"101"
)
private
Integer
isPregnant
;
@ApiModelProperty
(
value
=
"国家地区 0:中国;1:中国香港;2:中国澳门;3:中国台湾"
,
example
=
"101"
)
private
Integer
area
;
@ApiModelProperty
(
value
=
"民族 56个名族"
,
example
=
"101"
)
private
Integer
mz
;
@ApiModelProperty
(
value
=
"政治面貌 1:中共党员;2:中共预备党员;3共青团员;4:民革党员;5:民盟盟员;6:民建会员;7:民进会员;8:农工党党员;9:致公党党员;10:九三学社社员;11:台盟盟员;12:无党派人士;13:群众"
,
example
=
"101"
)
private
Integer
zzmm
;
@ApiModelProperty
(
value
=
"籍贯 省"
,
example
=
"101"
)
private
String
jg
;
@ApiModelProperty
(
value
=
"籍贯 省id"
,
example
=
"101"
)
private
String
jgId
;
@ApiModelProperty
(
value
=
"省"
)
private
String
province
;
@ApiModelProperty
(
value
=
"省id"
)
private
String
provinceId
;
@ApiModelProperty
(
value
=
"市"
)
private
String
city
;
@ApiModelProperty
(
value
=
"市id"
)
private
String
cityId
;
@ApiModelProperty
(
value
=
"区"
)
private
String
district
;
@ApiModelProperty
(
value
=
"区编号"
)
private
String
districtId
;
@ApiModelProperty
(
value
=
"户口性质 1:城镇户口;2:农村户口;3:居民户口"
,
example
=
"101"
)
private
Integer
hkType
;
@ApiModelProperty
(
value
=
"户籍地址 "
,
example
=
"详细地址"
)
private
String
hkAddress
;
@ApiModelProperty
(
value
=
"QQ QQ"
,
example
=
"101"
)
private
Integer
qq
;
@ApiModelProperty
(
value
=
"微信 "
,
example
=
"微信"
)
private
String
wechat
;
// @ApiModelProperty(value="个人邮箱 ",example="个人邮箱")
// private String email;
@ApiModelProperty
(
value
=
"血型 "
,
example
=
"血型"
)
private
String
bloodType
;
@ApiModelProperty
(
value
=
"语言 "
,
example
=
"语言"
)
private
String
language
;
@ApiModelProperty
(
value
=
"最高学历 1:小学;2:初中;3:高中;4:中专;5:大专;6:本科;7:研究生;8:硕士;9:博士;"
,
example
=
"101"
)
private
Integer
edu
;
@ApiModelProperty
(
value
=
"专业 "
,
example
=
"专业"
)
private
String
zy
;
@ApiModelProperty
(
value
=
"转正备注 "
,
example
=
"转正备注"
)
private
String
zzRemark
;
@ApiModelProperty
(
value
=
"工作性质 0全职、1实习、2兼职、3劳务派遣、4劳务、5派遣、6外包、7退休返聘"
,
example
=
"101"
)
private
Integer
jobType
;
@ApiModelProperty
(
value
=
"员工状态 0试用、1正式、2离职中、3已离职"
,
example
=
"101"
)
private
Integer
jobStatus
;
@ApiModelProperty
(
value
=
"入职日期 "
,
example
=
"客户注册后的时间为入职时间"
)
private
Date
rzTime
;
@ApiModelProperty
(
value
=
"试用期 0:无试用期;1:1个月;2:2个月;3:3个月;4:4个月;5:5个月;6:6个月(有试用期显示选项)"
,
example
=
"101"
)
private
Integer
syq
;
@ApiModelProperty
(
value
=
"应转正日期 "
,
example
=
"人事记录要自动转正的日期"
)
private
Date
zzTime
;
@ApiModelProperty
(
value
=
"实际转正日期 "
,
example
=
"人事手动记录要转正的日期"
)
private
Date
sjzzTime
;
@ApiModelProperty
(
value
=
"是否计入考勤 0:否;1:是"
,
example
=
"101"
)
private
Integer
isJrkq
;
@ApiModelProperty
(
value
=
"公司内部工号 就是公司内部自己设置的工号"
,
example
=
"101"
)
private
String
jobNum
;
@ApiModelProperty
(
value
=
"工作地点 "
,
example
=
"工作地点"
)
private
String
workAddress
;
@ApiModelProperty
(
value
=
"工作电话 工作电话"
,
example
=
"101"
)
private
Integer
workPhone
;
@ApiModelProperty
(
value
=
"工作邮箱 "
,
example
=
"工作邮箱"
)
private
String
workEmail
;
@ApiModelProperty
(
value
=
"招聘渠道 招聘渠道应该是活性的"
,
example
=
"101"
)
private
Integer
zpqd
;
@ApiModelProperty
(
value
=
"部门岗位id 部门岗位id"
,
example
=
"101"
)
private
Integer
bmgwId
;
@ApiModelProperty
(
value
=
"部门名称"
,
example
=
""
)
private
String
bmgwName
;
@ApiModelProperty
(
value
=
"修改时间"
,
example
=
"修改时间"
)
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"修改人"
,
example
=
"修改人"
)
private
Integer
updateMan
;
@ApiModelProperty
(
value
=
"组织机构代码 组织机构代码"
,
example
=
"101"
)
private
Integer
orgCode
;
@ApiModelProperty
(
value
=
"微信id"
,
example
=
"UnionID微信系统唯一id"
)
private
String
unionid
;
@ApiModelProperty
(
value
=
"公众号id"
,
example
=
"openid公众号唯一id"
)
private
String
openid
;
@ApiModelProperty
(
value
=
"小程序id"
,
example
=
"mpopenid小程序"
)
private
String
mpopenid
;
@ApiModelProperty
(
value
=
"手机APPid"
,
example
=
"appopenid手机app"
)
private
String
appopenid
;
// @ApiModelProperty(value="是否企业中心管理员 ",example="0-否 1-主账号 2-子账号")
// private Integer isManager;
@ApiModelProperty
(
value
=
"离职前状态 1试用、2正式 "
,
example
=
"1试用、2正式"
)
private
Integer
beforeLeavingSts
;
@ApiModelProperty
(
value
=
"自定义工号"
,
example
=
""
)
private
String
customNum
;
@Transient
@TableField
(
exist
=
false
)
private
String
workTime
;
//工龄
@Transient
@TableField
(
exist
=
false
)
private
String
error
;
//错误信息提示
@Transient
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
"员工登陆账号(手机号)"
,
example
=
"员工登陆账号(手机号)"
)
private
String
empLoginPhone
;
@ApiModelProperty
(
value
=
"是否已投保:0否 1是"
,
example
=
""
)
private
int
isInsure
;
}
src/main/java/cn/timer/api/controller/insure/InsureContorll.java
View file @
aaf55d6c
...
...
@@ -5,18 +5,15 @@ import cn.timer.api.bean.qyzx.QyzxEntInfoM;
import
cn.timer.api.bean.yggl.YgglMainEmp
;
import
cn.timer.api.config.annotation.CurrentUser
;
import
cn.timer.api.config.annotation.UserBean
;
import
cn.timer.api.controller.insure.bean.ExcelBean
;
import
cn.timer.api.utils.*
;
import
com.alibaba.druid.util.Base64
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.beust.jcommander.internal.Lists
;
import
com.github.xiaoymin.knife4j.annotations.ApiOperationSupport
;
import
com.google.common.collect.Maps
;
import
com.google.gson.JsonObject
;
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.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -194,7 +191,7 @@ public class InsureContorll {
}
/*测试用生产环境不需要*/
synchronized
private
Object
requestAgent
(
Map
bodyMap
){
String
data
=
HttpUtils
.
sendPost
(
insuredUrl
,
setParams
(
JSONObject
.
toJSONString
(
bodyMap
)),
bodyMap
);
String
data
=
HttpUtils
.
sendPost
(
insuredUrl
,
setParams
(
JSONObject
.
toJSONString
(
bodyMap
)),
bodyMap
);
Map
<
String
,
Object
>
dataMap
=
JSONObject
.
parseObject
(
data
);
if
(
dataMap
.
get
(
"errcode"
).
toString
().
equals
(
"suc"
))
{
return
dataMap
.
get
(
"data"
);
...
...
@@ -235,7 +232,7 @@ public class InsureContorll {
bodyMap
.
put
(
"name"
,
file
.
getName
());
bodyMap
.
put
(
"file"
,
fileBase64
);
/*end*/
String
data
=
HttpUtils
.
sendPost
(
uploadUrl
,
setParams
(
JSONObject
.
toJSONString
(
bodyMap
)),
bodyMap
);
String
data
=
HttpUtils
.
sendPost
(
uploadUrl
,
setParams
(
JSONObject
.
toJSONString
(
bodyMap
)),
bodyMap
);
log
.
info
(
"请求返回的结果====="
+
data
);
/*文件流base64*/
return
ResultUtil
.
data
(
message
(
data
));
...
...
@@ -261,7 +258,7 @@ public class InsureContorll {
// bodyMap.put("name","劳务公司批增-月单(1).xlsx");
bodyMap
.
put
(
"file"
,
fileBase64
);
/*end*/
String
data
=
HttpUtils
.
sendPost
(
uploadUrl2
,
setParams2
(
JSONObject
.
toJSONString
(
bodyMap
)),
bodyMap
);
String
data
=
HttpUtils
.
sendPost
(
uploadUrl2
,
setParams2
(
JSONObject
.
toJSONString
(
bodyMap
)),
bodyMap
);
log
.
info
(
"请求返回的结果====="
+
data
);
/*文件流base64*/
return
ResultUtil
.
data
(
message
(
data
));
...
...
@@ -293,9 +290,8 @@ public class InsureContorll {
public
void
downExcel
(
@CurrentUser
UserBean
userBean
,
HttpServletRequest
request
,
HttpServletResponse
resp
){
LocalDate
localDate
=
LocalDate
.
now
();
/*获取该企业下所有未投保员工*/
List
<
YgglMainEmp
>
ygglMainEmpList
=
YgglMainEmp
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
YgglMainEmp
>().
lambda
().
eq
(
YgglMainEmp:
:
getOrgCode
,
userBean
.
getOrgCode
())
List
<
YgglMainEmp
>
ygglMainEmpList
=
YgglMainEmp
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
YgglMainEmp
>().
lambda
().
eq
(
YgglMainEmp:
:
getOrgCode
,
userBean
.
getOrgCode
())
.
eq
(
YgglMainEmp:
:
getIsInsure
,
0
));
ExcelBean
excelBean
;
List
list
=
Lists
.
newArrayList
();
for
(
YgglMainEmp
y:
ygglMainEmpList
.
subList
(
0
,
5
))
{
String
[]
arr
=
new
String
[]{
String
.
valueOf
(
y
.
getId
()),
y
.
getName
(),
"身份证"
,
y
.
getZjNum
(),
"50万意外/5万医疗/扩展24小时(A类)"
,
""
,
"深圳名邦人力资源管理有限公司"
,
"无"
,
"A类"
};
...
...
src/main/java/cn/timer/api/utils/HttpUtils.java
View file @
aaf55d6c
package
cn
.
timer
.
api
.
utils
;
import
java.io.BufferedReader
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStreamReader
;
import
java.io.PrintWriter
;
import
java.io.*
;
import
java.net.ConnectException
;
import
java.net.SocketTimeoutException
;
import
java.net.URL
;
import
java.net.URLConnection
;
import
java.nio.charset.StandardCharsets
;
import
java.security.cert.X509Certificate
;
import
java.util.Map
;
import
javax.net.ssl.HostnameVerifier
;
import
javax.net.ssl.HttpsURLConnection
;
import
javax.net.ssl.SSLContext
;
import
javax.net.ssl.SSLSession
;
import
javax.net.ssl.TrustManager
;
import
javax.net.ssl.X509TrustManager
;
import
com.alibaba.fastjson.JSONObject
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
/**
* 通用http发送方法
*
*
* @author Tang
*/
public
class
HttpUtils
...
...
@@ -44,10 +44,10 @@ public class HttpUtils
String
urlNameString
=
url
+
"?"
+
param
;
log
.
info
(
"sendGet - {}"
,
urlNameString
);
URL
realUrl
=
new
URL
(
urlNameString
);
URLConnection
connection
=
realUrl
.
openConnection
();
HttpsURLConnection
connection
=
(
HttpsURLConnection
)
realUrl
.
openConnection
();
connection
.
setRequestProperty
(
"accept"
,
"*/*"
);
connection
.
setRequestProperty
(
"connection"
,
"Keep-Alive"
);
connection
.
setRequestProperty
(
"
user-agent"
,
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1
)"
);
connection
.
setRequestProperty
(
"
User-Agent"
,
"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36
)"
);
connection
.
connect
();
in
=
new
BufferedReader
(
new
InputStreamReader
(
connection
.
getInputStream
()));
String
line
;
...
...
@@ -97,11 +97,12 @@ public class HttpUtils
* @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
* @return 所代表远程资源的响应结果
*/
public
static
String
sendPost
(
String
url
,
String
param
)
public
static
String
sendPost
(
String
url
,
Map
paramMap
,
Map
bodyMap
)
{
PrintWriter
out
=
null
;
DataOutputStream
out
=
null
;
BufferedReader
in
=
null
;
StringBuilder
result
=
new
StringBuilder
();
String
param
=
getParamString
(
paramMap
);
try
{
String
urlNameString
=
url
+
"?"
+
param
;
...
...
@@ -110,15 +111,16 @@ public class HttpUtils
URLConnection
conn
=
realUrl
.
openConnection
();
conn
.
setRequestProperty
(
"accept"
,
"*/*"
);
conn
.
setRequestProperty
(
"connection"
,
"Keep-Alive"
);
conn
.
setRequestProperty
(
"
user-agent"
,
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1
)"
);
conn
.
setRequestProperty
(
"
User-Agent"
,
"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36
)"
);
conn
.
setRequestProperty
(
"Accept-Charset"
,
"utf-8"
);
conn
.
setRequestProperty
(
"contentType"
,
"
utf
-8"
);
conn
.
setRequestProperty
(
"contentType"
,
"
text/json;charset=UTF
-8"
);
conn
.
setDoOutput
(
true
);
conn
.
setDoInput
(
true
);
out
=
new
PrintWriter
(
conn
.
getOutputStream
());
out
.
print
(
param
);
out
=
new
DataOutputStream
(
conn
.
getOutputStream
());
String
json
=
JSONObject
.
toJSONString
(
bodyMap
);
out
.
write
(
json
.
getBytes
(
StandardCharsets
.
UTF_8
));
out
.
flush
();
in
=
new
BufferedReader
(
new
InputStreamReader
(
conn
.
getInputStream
()
,
"utf-8"
));
in
=
new
BufferedReader
(
new
InputStreamReader
(
conn
.
getInputStream
()));
String
line
;
while
((
line
=
in
.
readLine
())
!=
null
)
{
...
...
@@ -176,9 +178,9 @@ public class HttpUtils
HttpsURLConnection
conn
=
(
HttpsURLConnection
)
console
.
openConnection
();
conn
.
setRequestProperty
(
"accept"
,
"*/*"
);
conn
.
setRequestProperty
(
"connection"
,
"Keep-Alive"
);
conn
.
setRequestProperty
(
"
user-agent"
,
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1
)"
);
conn
.
setRequestProperty
(
"
User-Agent"
,
"Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt
)"
);
conn
.
setRequestProperty
(
"Accept-Charset"
,
"utf-8"
);
conn
.
setRequestProperty
(
"contentType"
,
"
utf
-8"
);
conn
.
setRequestProperty
(
"contentType"
,
"
text/json;charset=UTF
-8"
);
conn
.
setDoOutput
(
true
);
conn
.
setDoInput
(
true
);
...
...
@@ -245,4 +247,16 @@ public class HttpUtils
return
true
;
}
}
}
\ No newline at end of file
/*参数转为字符串*/
private
static
String
getParamString
(
Map
<
String
,
String
>
paramMap
){
if
(
null
==
paramMap
||
paramMap
.
isEmpty
()){
return
""
;
}
StringBuilder
builder
=
new
StringBuilder
();
for
(
String
key
:
paramMap
.
keySet
()
){
builder
.
append
(
"&"
)
.
append
(
key
).
append
(
"="
).
append
(
paramMap
.
get
(
key
));
}
return
builder
.
deleteCharAt
(
0
).
toString
();
}
}
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