Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
806eaa2f
Commit
806eaa2f
authored
Jun 28, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
68e80d39
f942dabe
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
393 additions
and
150 deletions
+393
-150
TEmployeeInfo.java
...ifu/cloud/plus/v1/yifu/archives/entity/TEmployeeInfo.java
+7
-7
EmployeeProjectExportVO.java
...oud/plus/v1/yifu/archives/vo/EmployeeProjectExportVO.java
+16
-3
FileUploadController.java
...lus/v1/yifu/archives/controller/FileUploadController.java
+6
-77
TElecEmployeeInfoController.java
...yifu/archives/controller/TElecEmployeeInfoController.java
+2
-13
TEmployeeInfoController.java
.../v1/yifu/archives/controller/TEmployeeInfoController.java
+1
-1
TEmployeeProjectController.java
.../yifu/archives/controller/TEmployeeProjectController.java
+2
-2
FileUploadService.java
...loud/plus/v1/yifu/archives/service/FileUploadService.java
+18
-0
TElecEmployeeInfoService.java
...us/v1/yifu/archives/service/TElecEmployeeInfoService.java
+10
-0
FileUploadServiceImpl.java
.../v1/yifu/archives/service/impl/FileUploadServiceImpl.java
+105
-0
TElecEmployeeInfoServiceImpl.java
...u/archives/service/impl/TElecEmployeeInfoServiceImpl.java
+210
-41
TEmployeeInfoServiceImpl.java
.../yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
+6
-0
TEmployeeProjectServiceImpl.java
...fu/archives/service/impl/TEmployeeProjectServiceImpl.java
+1
-1
TEmployeeProjectMapper.xml
...-biz/src/main/resources/mapper/TEmployeeProjectMapper.xml
+8
-4
DictController.java
...u.cloud.plus.v1/yifu/admin/controller/DictController.java
+1
-1
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/entity/TEmployeeInfo.java
View file @
806eaa2f
...
@@ -259,31 +259,31 @@ public class TEmployeeInfo extends BaseEntity {
...
@@ -259,31 +259,31 @@ public class TEmployeeInfo extends BaseEntity {
/**
/**
* 员工合同状态(字典)
* 员工合同状态(字典)
*/
*/
@Schema
(
description
=
"员工合同状态(字典)"
)
@Schema
(
description
=
"员工合同状态(字典)
0初始状态
"
)
private
Integer
contractStatus
;
private
Integer
contractStatus
;
/**
/**
* 商险状态(字典)
* 商险状态(字典)
*/
*/
@Schema
(
description
=
"商险状态(字典)"
)
@Schema
(
description
=
"商险状态(字典)
0初始状态
"
)
private
Integer
insuranceStatus
;
private
Integer
insuranceStatus
;
/**
/**
* 社保状态(字典)
* 社保状态(字典)
*/
*/
@Schema
(
description
=
"社保状态(字典)"
)
@Schema
(
description
=
"社保状态(字典)
0初始状态
"
)
private
Integer
socialStatus
;
private
Integer
socialStatus
;
/**
/**
* 公积金状态(字典)
* 公积金状态(字典)
0初始状态
*/
*/
@Schema
(
description
=
"公积金状态(字典)"
)
@Schema
(
description
=
"公积金状态(字典)
0初始状态
"
)
private
Integer
fundStatus
;
private
Integer
fundStatus
;
/**
/**
* 近3个月发薪(0
否;1是
)
* 近3个月发薪(0
无;1是;2否
)
*/
*/
@Schema
(
description
=
"近3个月发薪(0
否;1是
)"
)
@Schema
(
description
=
"近3个月发薪(0
无;1是;2否
)"
)
private
Integer
salaryStatus
;
private
Integer
salaryStatus
;
/**
/**
...
...
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/EmployeeProjectExportVO.java
View file @
806eaa2f
...
@@ -18,6 +18,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo;
...
@@ -18,6 +18,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.alibaba.excel.annotation.write.style.ColumnWidth
;
import
com.alibaba.excel.annotation.write.style.ColumnWidth
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
lombok.Data
;
import
javax.validation.constraints.Past
;
import
javax.validation.constraints.Past
;
...
@@ -309,10 +310,22 @@ public class EmployeeProjectExportVO{
...
@@ -309,10 +310,22 @@ public class EmployeeProjectExportVO{
private
Integer
contractStatus
;
private
Integer
contractStatus
;
/**
/**
* 业务类型
* 业务类型
一级分类
*/
*/
@ExcelProperty
(
value
=
"业务类型"
)
@ExcelProperty
(
value
=
"业务类型一级分类"
)
private
String
businessType
;
private
String
businessPrimaryType
;
/**
* 业务类型二级分类
*/
@ExcelProperty
(
value
=
"业务类型二级分类"
)
private
String
businessSecondType
;
/**
* 业务类型三级分类
*/
@ExcelProperty
(
value
=
"业务类型三级分类"
)
private
String
businessThirdType
;
/**
/**
* 商险状态(字典)
* 商险状态(字典)
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/FileUploadController.java
View file @
806eaa2f
...
@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.controller;
...
@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.controller;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.FileUploadService
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TAttaInfoService
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TAttaInfoService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil
;
...
@@ -17,7 +18,6 @@ import org.springframework.web.multipart.MultipartFile;
...
@@ -17,7 +18,6 @@ import org.springframework.web.multipart.MultipartFile;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.net.URL
;
import
java.net.URL
;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -36,6 +36,9 @@ public class FileUploadController {
...
@@ -36,6 +36,9 @@ public class FileUploadController {
@Autowired
@Autowired
private
TAttaInfoService
tAttaInfoService
;
private
TAttaInfoService
tAttaInfoService
;
@Autowired
private
FileUploadService
fileUploadService
;
/**
/**
* @Author fxj
* @Author fxj
* @Description
* @Description
...
@@ -52,60 +55,12 @@ public class FileUploadController {
...
@@ -52,60 +55,12 @@ public class FileUploadController {
/*@ApiImplicitParams({
/*@ApiImplicitParams({
@ApiImplicitParam(name = "file", value = "Form文件上传", required = true, dataType = "__file", paramType = "form"),
@ApiImplicitParam(name = "file", value = "Form文件上传", required = true, dataType = "__file", paramType = "form"),
@ApiImplicitParam(name = "filePath", value = "文件上传路径", required = false, dataType = "String", paramType = "form"),
@ApiImplicitParam(name = "filePath", value = "文件上传路径", required = false, dataType = "String", paramType = "form"),
@ApiImplicitParam(name = "type", value = "关系类型(0客户附件1联系人附件2跟进记录附件3合同附件4合同归档附件5报价单6招标信息7业务评估)", required = true, dataType = "int", paramType = "form"),
@ApiImplicitParam(name = "type", value = "关系类型(0客户附件1联系人附件2跟进记录附件3合同附件4合同归档附件5报价单6招标信息7业务评估
8电子档案
)", required = true, dataType = "int", paramType = "form"),
@ApiImplicitParam(name = "domain", value = "实体id(传入就插入对应关系,用于编辑)", required = false, paramType = "form")
@ApiImplicitParam(name = "domain", value = "实体id(传入就插入对应关系,用于编辑)", required = false, paramType = "form")
})*/
})*/
@PostMapping
(
value
=
"/ossUploadFile"
)
@PostMapping
(
value
=
"/ossUploadFile"
)
public
R
<
FileVo
>
uploadImg
(
@RequestBody
MultipartFile
file
,
String
filePath
,
Integer
type
,
String
domain
)
throws
IOException
{
public
R
<
FileVo
>
uploadImg
(
@RequestBody
MultipartFile
file
,
String
filePath
,
Integer
type
,
String
domain
)
throws
IOException
{
if
(
null
==
file
)
{
return
fileUploadService
.
uploadImg
(
file
,
filePath
,
type
,
domain
);
return
R
.
failed
(
"文件删除异常,请重新上传!"
);
}
String
fileName
=
file
.
getOriginalFilename
();
if
(
Common
.
isEmpty
(
fileName
))
{
return
R
.
failed
(
"文件名不能为空!"
);
}
if
(
fileName
.
length
()
>
100
)
{
return
R
.
failed
(
"文件名不能超过100个字符!"
);
}
//filePath不传默认存储空间的根目录
//jpg,jpeg,png,bmp
String
key
=
""
;
if
(
Common
.
isNotNull
(
filePath
))
{
key
=
filePath
+
"/"
+
System
.
currentTimeMillis
()
+
fileName
;
}
else
{
key
=
System
.
currentTimeMillis
()
+
fileName
;
}
if
(!
Common
.
checkFile
(
key
))
{
return
R
.
failed
(
"非法上传类型!"
);
}
boolean
flag
=
ossUtil
.
uploadFileByStream
(
file
.
getInputStream
(),
key
,
null
);
FileVo
fileVo
;
TAttaInfo
attaInfo
;
URL
url
;
if
(
flag
)
{
log
.
info
(
"文件:"
+
fileName
+
"上传至存储空间"
+
ossUtil
.
getBucketName
()
+
"成功!"
);
attaInfo
=
initUnitAttaForInsert
(
fileName
,
key
,
file
.
getSize
());
attaInfo
.
setRelationType
(
String
.
valueOf
(
type
));
try
{
attaInfo
.
setDomainId
(
domain
);
attaInfo
=
tAttaInfoService
.
add
(
attaInfo
);
}
catch
(
Exception
e
)
{
log
.
error
(
"OSS文件上传接口异常:"
+
e
.
getMessage
());
ossUtil
.
deleteObject
(
null
,
key
);
return
R
.
failed
(
"fail:"
+
e
.
getMessage
());
}
//有实体id则插入关系,用于编辑
if
(
Common
.
isNotNull
(
domain
))
{
url
=
ossUtil
.
getObjectUrl
(
null
,
attaInfo
.
getAttaSrc
());
fileVo
=
new
FileVo
(
attaInfo
.
getId
(),
attaInfo
.
getAttaName
(),
url
.
toString
());
return
R
.
ok
(
fileVo
,
"success"
);
}
url
=
ossUtil
.
getObjectUrl
(
null
,
attaInfo
.
getAttaSrc
());
fileVo
=
new
FileVo
(
attaInfo
.
getId
(),
attaInfo
.
getAttaName
(),
url
.
toString
());
return
R
.
ok
(
fileVo
,
"success"
);
}
else
{
return
R
.
failed
(
"fail:上传失败"
);
}
}
}
...
@@ -137,32 +92,6 @@ public class FileUploadController {
...
@@ -137,32 +92,6 @@ public class FileUploadController {
return
R
.
ok
(
null
,
"删除失败!"
);
return
R
.
ok
(
null
,
"删除失败!"
);
}
}
/**
* 对象初始化
* @param fileName
* @param key
* @param fileSize
* @return
*/
private
TAttaInfo
initUnitAttaForInsert
(
String
fileName
,
String
key
,
long
fileSize
)
{
TAttaInfo
unitAtta
=
new
TAttaInfo
();
char
slash
=
'/'
;
char
point
=
'.'
;
if
(
fileName
.
lastIndexOf
(
slash
)
>=
0
)
{
unitAtta
.
setAttaName
(
fileName
.
substring
(
fileName
.
lastIndexOf
(
slash
)));
}
else
{
unitAtta
.
setAttaName
(
fileName
);
}
unitAtta
.
setAttaSize
(
fileSize
);
unitAtta
.
setAttaSrc
(
key
);
if
(
key
.
lastIndexOf
(
point
)
>=
0
)
{
unitAtta
.
setAttaType
(
key
.
substring
(
key
.
lastIndexOf
(
point
)));
}
unitAtta
.
setCreateTime
(
LocalDateTime
.
now
());
return
unitAtta
;
}
/**
/**
* 获取附件下载地址
* 获取附件下载地址
*
*
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TElecEmployeeInfoController.java
View file @
806eaa2f
...
@@ -17,13 +17,9 @@
...
@@ -17,13 +17,9 @@
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
controller
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
controller
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TElecEmployeeInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TElecEmployeeInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TElecEmployeeInfoService
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TElecEmployeeInfoService
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.Operation
;
...
@@ -50,8 +46,6 @@ public class TElecEmployeeInfoController {
...
@@ -50,8 +46,6 @@ public class TElecEmployeeInfoController {
private
final
TElecEmployeeInfoService
tElecEmployeeInfoService
;
private
final
TElecEmployeeInfoService
tElecEmployeeInfoService
;
private
final
TEmployeeInfoService
tEmployeeInfoService
;
/**
/**
* 分页查询
* 分页查询
* @param page 分页对象
* @param page 分页对象
...
@@ -126,12 +120,7 @@ public class TElecEmployeeInfoController {
...
@@ -126,12 +120,7 @@ public class TElecEmployeeInfoController {
@SysLog
(
"通过身份证号查询人员档案"
)
@SysLog
(
"通过身份证号查询人员档案"
)
@PostMapping
(
"/getEmpInfo"
)
@PostMapping
(
"/getEmpInfo"
)
public
R
getEmpInfoByCard
(
@RequestParam
String
idCard
)
{
public
R
getEmpInfoByCard
(
@RequestParam
String
idCard
)
{
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoService
.
getOne
((
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
return
R
.
ok
(
tElecEmployeeInfoService
.
getEmpInfoByCard
(
idCard
));
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
idCard
)));
if
(
Common
.
isNotNull
(
tEmployeeInfo
))
{
return
R
.
ok
(
tEmployeeInfo
);
}
return
R
.
failed
(
"未找到身份证号对应的档案信息"
);
}
}
/**
/**
...
@@ -142,7 +131,7 @@ public class TElecEmployeeInfoController {
...
@@ -142,7 +131,7 @@ public class TElecEmployeeInfoController {
@PostMapping
(
"/importZip"
)
@PostMapping
(
"/importZip"
)
@Operation
(
summary
=
"批量导入电子档案"
,
description
=
"批量导入电子档案"
)
@Operation
(
summary
=
"批量导入电子档案"
,
description
=
"批量导入电子档案"
)
@SysLog
(
"批量导入电子档案"
)
@SysLog
(
"批量导入电子档案"
)
public
R
<
Boolean
>
importZip
(
@Request
Param
(
"file"
)
MultipartFile
file
)
{
public
R
<
Boolean
>
importZip
(
@Request
Body
MultipartFile
file
)
{
return
this
.
tElecEmployeeInfoService
.
importZip
(
file
);
return
this
.
tElecEmployeeInfoService
.
importZip
(
file
);
}
}
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TEmployeeInfoController.java
View file @
806eaa2f
...
@@ -279,7 +279,7 @@ public class TEmployeeInfoController {
...
@@ -279,7 +279,7 @@ public class TEmployeeInfoController {
* @Date: 2022/6/23 17:40
* @Date: 2022/6/23 17:40
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
**/
@Operation
(
summary
=
"档案复档"
,
description
=
"档案复档 projectIds:项目档案ids"
)
@Operation
(
summary
=
"档案复档
temployeeinfo_restore
"
,
description
=
"档案复档 projectIds:项目档案ids"
)
@SysLog
(
"档案复档"
)
@SysLog
(
"档案复档"
)
@GetMapping
(
"/restoreEmployee"
)
@GetMapping
(
"/restoreEmployee"
)
@PreAuthorize
(
"@pms.hasPermission('temployeeinfo_restore')"
)
@PreAuthorize
(
"@pms.hasPermission('temployeeinfo_restore')"
)
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TEmployeeProjectController.java
View file @
806eaa2f
...
@@ -230,8 +230,8 @@ public class TEmployeeProjectController {
...
@@ -230,8 +230,8 @@ public class TEmployeeProjectController {
* @Date 2022-06-21
* @Date 2022-06-21
**/
**/
@PostMapping
(
"/export"
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
EmployeeProjectExportVO
projectDTO
,
@RequestParam
(
name
=
"idstr"
,
required
=
false
)
String
idstr
,
public
void
export
(
HttpServletResponse
response
,
@RequestParam
(
name
=
"idstr"
,
required
=
false
)
String
idstr
,
@RequestBody
List
<
String
>
exportFields
)
{
@RequestBody
List
<
String
>
exportFields
,
EmployeeProjectExportVO
projectDTO
)
{
tEmployeeProjectService
.
listExportProject
(
response
,
projectDTO
,
idstr
,
exportFields
);
tEmployeeProjectService
.
listExportProject
(
response
,
projectDTO
,
idstr
,
exportFields
);
}
}
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/FileUploadService.java
0 → 100644
View file @
806eaa2f
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
service
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.FileVo
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.IOException
;
/**
* 文件上传
*
* @author pwang
* @date 2022-07-27 16:16:07
*/
public
interface
FileUploadService
{
R
<
FileVo
>
uploadImg
(
MultipartFile
file
,
String
filePath
,
Integer
type
,
String
domain
)
throws
IOException
;
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/TElecEmployeeInfoService.java
View file @
806eaa2f
...
@@ -42,4 +42,14 @@ public interface TElecEmployeeInfoService extends IService<TElecEmployeeInfo> {
...
@@ -42,4 +42,14 @@ public interface TElecEmployeeInfoService extends IService<TElecEmployeeInfo> {
* @date: 2022/6/24
* @date: 2022/6/24
*/
*/
R
<
Boolean
>
importZip
(
MultipartFile
file
);
R
<
Boolean
>
importZip
(
MultipartFile
file
);
/**
* @description: 通过身份证号查询人员档案
* @param idCard 身份证号
* @return: R
* @author: huyc
* @date: 2022/6/27
*/
R
getEmpInfoByCard
(
String
idCard
);
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/FileUploadServiceImpl.java
0 → 100644
View file @
806eaa2f
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
service
.
impl
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.FileUploadService
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TAttaInfoService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.FileVo
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.IOException
;
import
java.net.URL
;
import
java.time.LocalDateTime
;
@Service
@RequiredArgsConstructor
@Slf4j
public
class
FileUploadServiceImpl
implements
FileUploadService
{
private
final
OSSUtil
ossUtil
;
private
final
TAttaInfoService
tAttaInfoService
;
@Override
public
R
<
FileVo
>
uploadImg
(
MultipartFile
file
,
String
filePath
,
Integer
type
,
String
domain
)
throws
IOException
{
if
(
null
==
file
)
{
return
R
.
failed
(
"文件删除异常,请重新上传!"
);
}
String
fileName
=
file
.
getOriginalFilename
();
if
(
Common
.
isEmpty
(
fileName
))
{
return
R
.
failed
(
"文件名不能为空!"
);
}
if
(
fileName
.
length
()
>
100
)
{
return
R
.
failed
(
"文件名不能超过100个字符!"
);
}
//filePath不传默认存储空间的根目录
//jpg,jpeg,png,bmp
String
key
=
""
;
if
(
Common
.
isNotNull
(
filePath
))
{
key
=
filePath
+
"/"
+
System
.
currentTimeMillis
()
+
fileName
;
}
else
{
key
=
System
.
currentTimeMillis
()
+
fileName
;
}
if
(!
Common
.
checkFile
(
key
))
{
return
R
.
failed
(
"非法上传类型!"
);
}
boolean
flag
=
ossUtil
.
uploadFileByStream
(
file
.
getInputStream
(),
key
,
null
);
FileVo
fileVo
;
TAttaInfo
attaInfo
;
URL
url
;
if
(
flag
)
{
log
.
info
(
"文件:"
+
fileName
+
"上传至存储空间"
+
ossUtil
.
getBucketName
()
+
"成功!"
);
attaInfo
=
initUnitAttaForInsert
(
fileName
,
key
,
file
.
getSize
());
attaInfo
.
setRelationType
(
String
.
valueOf
(
type
));
try
{
attaInfo
.
setDomainId
(
domain
);
attaInfo
=
tAttaInfoService
.
add
(
attaInfo
);
}
catch
(
Exception
e
)
{
log
.
error
(
"OSS文件上传接口异常:"
+
e
.
getMessage
());
ossUtil
.
deleteObject
(
null
,
key
);
return
R
.
failed
(
"fail:"
+
e
.
getMessage
());
}
//有实体id则插入关系,用于编辑
if
(
Common
.
isNotNull
(
domain
))
{
url
=
ossUtil
.
getObjectUrl
(
null
,
attaInfo
.
getAttaSrc
());
fileVo
=
new
FileVo
(
attaInfo
.
getId
(),
attaInfo
.
getAttaName
(),
url
.
toString
());
return
R
.
ok
(
fileVo
,
"success"
);
}
url
=
ossUtil
.
getObjectUrl
(
null
,
attaInfo
.
getAttaSrc
());
fileVo
=
new
FileVo
(
attaInfo
.
getId
(),
attaInfo
.
getAttaName
(),
url
.
toString
());
return
R
.
ok
(
fileVo
,
"success"
);
}
else
{
return
R
.
failed
(
"fail:上传失败"
);
}
}
/**
* 对象初始化
* @param fileName
* @param key
* @param fileSize
* @return
*/
private
TAttaInfo
initUnitAttaForInsert
(
String
fileName
,
String
key
,
long
fileSize
)
{
TAttaInfo
unitAtta
=
new
TAttaInfo
();
char
slash
=
'/'
;
char
point
=
'.'
;
if
(
fileName
.
lastIndexOf
(
slash
)
>=
0
)
{
unitAtta
.
setAttaName
(
fileName
.
substring
(
fileName
.
lastIndexOf
(
slash
)));
}
else
{
unitAtta
.
setAttaName
(
fileName
);
}
unitAtta
.
setAttaSize
(
fileSize
);
unitAtta
.
setAttaSrc
(
key
);
if
(
key
.
lastIndexOf
(
point
)
>=
0
)
{
unitAtta
.
setAttaType
(
key
.
substring
(
key
.
lastIndexOf
(
point
)));
}
unitAtta
.
setCreateTime
(
LocalDateTime
.
now
());
return
unitAtta
;
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TElecEmployeeInfoServiceImpl.java
View file @
806eaa2f
This diff is collapsed.
Click to expand it.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
View file @
806eaa2f
...
@@ -892,6 +892,12 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
...
@@ -892,6 +892,12 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
employeeInfo
.
setFileStatus
(
CommonConstants
.
ZERO_INT
);
employeeInfo
.
setFileStatus
(
CommonConstants
.
ZERO_INT
);
employeeInfo
.
setProjectNum
(
CommonConstants
.
ONE_INT
);
employeeInfo
.
setProjectNum
(
CommonConstants
.
ONE_INT
);
employeeInfo
.
setDeleteFlag
(
CommonConstants
.
STATUS_NORMAL
);
employeeInfo
.
setDeleteFlag
(
CommonConstants
.
STATUS_NORMAL
);
employeeInfo
.
setContractStatus
(
CommonConstants
.
ZERO_INT
);
employeeInfo
.
setInsuranceStatus
(
CommonConstants
.
ZERO_INT
);
employeeInfo
.
setSocialStatus
(
CommonConstants
.
ZERO_INT
);
employeeInfo
.
setFundStatus
(
CommonConstants
.
ZERO_INT
);
employeeInfo
.
setSalaryStatus
(
CommonConstants
.
ZERO_INT
);
// 生成性别年龄等:
// 生成性别年龄等:
this
.
setBaseSexInfo
(
employeeInfo
);
this
.
setBaseSexInfo
(
employeeInfo
);
}
}
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeProjectServiceImpl.java
View file @
806eaa2f
...
@@ -587,7 +587,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
...
@@ -587,7 +587,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
response
.
setCharacterEncoding
(
"utf-8"
);
response
.
setCharacterEncoding
(
"utf-8"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename*=utf-8'zh_cn'"
+
URLEncoder
.
encode
(
fileName
,
"UTF-8"
));
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename*=utf-8'zh_cn'"
+
URLEncoder
.
encode
(
fileName
,
"UTF-8"
));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
EasyExcel
.
write
(
fileName
,
EmployeeProjectExportVO
.
class
).
includeColumnFiledNames
(
includeColumnFiledNames
).
sheet
(
"项目档案"
)
EasyExcel
.
write
(
out
,
EmployeeProjectExportVO
.
class
).
includeColumnFiledNames
(
includeColumnFiledNames
).
sheet
(
"项目档案"
)
.
doWrite
(
list
);
.
doWrite
(
list
);
out
.
flush
();
out
.
flush
();
}
}
...
...
yifu-archives/yifu-archives-biz/src/main/resources/mapper/TEmployeeProjectMapper.xml
View file @
806eaa2f
...
@@ -88,7 +88,9 @@
...
@@ -88,7 +88,9 @@
<result
property=
"unitNo"
column=
"UNIT_NO"
/>
<result
property=
"unitNo"
column=
"UNIT_NO"
/>
<result
property=
"deptName"
column=
"DEPT_NAME"
/>
<result
property=
"deptName"
column=
"DEPT_NAME"
/>
<result
property=
"deptNo"
column=
"DEPT_NO"
/>
<result
property=
"deptNo"
column=
"DEPT_NO"
/>
<result
property=
"businessType"
column=
"BUSINESS_TYPE"
/>
<result
property=
"businessPrimaryType"
column=
"BUSINESS_PRIMARY_TYPE"
/>
<result
property=
"businessSecondType"
column=
"BUSINESS_SECOND_TYPE"
/>
<result
property=
"businessThirdType"
column=
"BUSINESS_THIRD_TYPE"
/>
<result
property=
"contractType"
column=
"CONTRACT_TYPE"
/>
<result
property=
"contractType"
column=
"CONTRACT_TYPE"
/>
<result
property=
"workingHours"
column=
"WORKING_HOURS"
/>
<result
property=
"workingHours"
column=
"WORKING_HOURS"
/>
<result
property=
"post"
column=
"POST"
/>
<result
property=
"post"
column=
"POST"
/>
...
@@ -175,7 +177,9 @@
...
@@ -175,7 +177,9 @@
a.UNIT_NO,
a.UNIT_NO,
a.DEPT_NAME,
a.DEPT_NAME,
a.DEPT_NO,
a.DEPT_NO,
concat(a.BUSINESS_PRIMARY_TYPE,'/',BUSINESS_SECOND_TYPE,'/',a.BUSINESS_THIRD_TYPE) AS BUSINESS_TYPE,
a.BUSINESS_PRIMARY_TYPE,
a.BUSINESS_SECOND_TYPE,
a.BUSINESS_THIRD_TYPE,
a.CONTRACT_TYPE,
a.CONTRACT_TYPE,
a.WORKING_HOURS,
a.WORKING_HOURS,
a.POST,
a.POST,
...
@@ -462,9 +466,9 @@
...
@@ -462,9 +466,9 @@
<if
test=
"tEmployeeProject.fileTown != null"
>
<if
test=
"tEmployeeProject.fileTown != null"
>
AND b.FILE_TOWN = #{tEmployeeProject.fileTown}
AND b.FILE_TOWN = #{tEmployeeProject.fileTown}
</if>
</if>
<if
test=
"tEmployee
Info
.idList != null"
>
<if
test=
"tEmployee
Project
.idList != null"
>
AND a.id in
AND a.id in
<foreach
item=
"idStr"
index=
"index"
collection=
"tEmployee
Info
.idList"
open=
"("
separator=
","
close=
")"
>
<foreach
item=
"idStr"
index=
"index"
collection=
"tEmployee
Project
.idList"
open=
"("
separator=
","
close=
")"
>
#{idStr}
#{idStr}
</foreach>
</foreach>
</if>
</if>
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/controller/DictController.java
View file @
806eaa2f
...
@@ -311,7 +311,7 @@ public class DictController {
...
@@ -311,7 +311,7 @@ public class DictController {
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.Map < java.lang.String, java.util.Map < java.lang.String, java.lang.String>>>
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.Map < java.lang.String, java.util.Map < java.lang.String, java.lang.String>>>
**/
**/
@Inner
@Inner
@
Ge
tMapping
(
"/inner/getDictToLable"
)
@
Pos
tMapping
(
"/inner/getDictToLable"
)
public
R
<
Map
<
String
,
Map
<
String
,
String
>>>
getDictToLable
()
{
public
R
<
Map
<
String
,
Map
<
String
,
String
>>>
getDictToLable
()
{
return
sysDictItemService
.
getDictToLable
();
return
sysDictItemService
.
getDictToLable
();
}
}
...
...
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