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
45e23745
Commit
45e23745
authored
Jul 05, 2022
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
合同-导出
parent
350e7a65
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
15 deletions
+65
-15
ErrorVO.java
...java/com/yifu/cloud/plus/v1/yifu/archives/vo/ErrorVO.java
+2
-6
TEmployeeContractInfoMapper.java
.../v1/yifu/archives/mapper/TEmployeeContractInfoMapper.java
+9
-0
TEmployeeContractInfoServiceImpl.java
...chives/service/impl/TEmployeeContractInfoServiceImpl.java
+14
-7
TEmployeeContractInfoMapper.xml
...src/main/resources/mapper/TEmployeeContractInfoMapper.xml
+40
-2
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/ErrorVO.java
View file @
45e23745
...
...
@@ -20,7 +20,6 @@ import io.swagger.v3.oas.annotations.media.Schema;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Set
;
/**
* 封装-返回给前端的错误信息-简化版
...
...
@@ -36,11 +35,8 @@ public class ErrorVO implements Serializable {
@Schema
(
description
=
"行号"
)
private
int
lineNum
;
@Schema
(
description
=
"员工姓名"
)
private
String
empName
;
@Schema
(
description
=
"身份证号"
)
private
String
empIdCard
;
@Schema
(
description
=
"唯一的名称(例如:合同的申请编码)"
)
private
String
mainName
;
@Schema
(
description
=
"结果:0错误;1正确(例如:是否允许删除:0否;1是)"
)
private
int
result
;
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/mapper/TEmployeeContractInfoMapper.java
View file @
45e23745
...
...
@@ -72,4 +72,13 @@ public interface TEmployeeContractInfoMapper extends BaseMapper<TEmployeeContrac
**/
String
getMaxContractCode
();
/**
* @param applyNo
* @Description: 查询编码是否已存在
* @Author: hgw
* @Date: 2022/7/5 9:37
* @return: java.lang.String
**/
String
getContractByApplyNo
(
@Param
(
"applyNo"
)
String
applyNo
);
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeContractInfoServiceImpl.java
View file @
45e23745
...
...
@@ -54,9 +54,7 @@ import java.io.InputStream;
import
java.net.URLEncoder
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* 员工合同
...
...
@@ -308,6 +306,16 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
}
if
(
Common
.
isEmpty
(
tEmployeeContractInfo
.
getId
()))
{
// 针对编码再做一次重复性校验
String
isCur
=
baseMapper
.
getContractByApplyNo
(
tEmployeeContractInfo
.
getApplyNo
());
if
(
Common
.
isNotNull
(
isCur
))
{
String
code
=
this
.
getCode
();
isCur
=
baseMapper
.
getContractByApplyNo
(
tEmployeeContractInfo
.
getApplyNo
());
if
(
Common
.
isNotNull
(
isCur
))
{
return
false
;
}
tEmployeeContractInfo
.
setApplyNo
(
code
);
}
baseMapper
.
insert
(
tEmployeeContractInfo
);
if
(
Common
.
isNotNull
(
tEmployeeContractInfo
.
getAttaList
())
&&
Common
.
isNotNull
(
tEmployeeContractInfo
.
getId
()))
{
List
<
String
>
attaList
=
tEmployeeContractInfo
.
getAttaList
();
...
...
@@ -434,8 +442,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if
(
contractInfo
==
null
)
{
errorVo
.
setErrorInfo
(
EmployeeContractConstants
.
NO_INFO
);
}
else
{
errorVo
.
setEmpName
(
contractInfo
.
getEmpName
());
errorVo
.
setEmpIdCard
(
contractInfo
.
getEmpIdcard
());
errorVo
.
setMainName
(
contractInfo
.
getApplyNo
());
if
(!
user
.
getId
().
equals
(
contractInfo
.
getCreateBy
()))
{
errorVo
.
setErrorInfo
(
EmployeeContractConstants
.
NOT_CREATE_USER
);
}
else
if
(
contractInfo
.
getAuditStatus
()
!=
CommonConstants
.
ZERO_INT
...
...
@@ -571,7 +578,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
EmployeeContractConstants
.
NO_INFO
));
}
}
else
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
()
,
EmployeeContractConstants
.
NO_INFO
));
errorMessageList
.
add
(
new
ErrorMessage
(
CommonConstants
.
ZERO_INT
,
EmployeeContractConstants
.
NO_INFO
));
}
}
}
...
...
@@ -717,7 +724,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
try
{
ExcelUtil
<
EmployeeContractExportVO
>
util
=
new
ExcelUtil
<>(
EmployeeContractExportVO
.
class
);
for
(
EmployeeContractExportVO
vo
:
list
)
{
util
.
convertEntity
(
vo
,
null
,
null
,
null
);
util
.
convertEntity
(
vo
,
null
,
null
,
null
);
}
out
=
response
.
getOutputStream
();
response
.
setContentType
(
"multipart/form-data"
);
...
...
@@ -756,7 +763,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
try
{
ExcelUtil
<
EmployeeContractExportVO
>
util
=
new
ExcelUtil
<>(
EmployeeContractExportVO
.
class
);
for
(
EmployeeContractExportVO
vo
:
list
)
{
util
.
convertEntity
(
vo
,
null
,
null
,
null
);
util
.
convertEntity
(
vo
,
null
,
null
,
null
);
}
out
=
response
.
getOutputStream
();
response
.
setContentType
(
"multipart/form-data"
);
...
...
yifu-archives/yifu-archives-biz/src/main/resources/mapper/TEmployeeContractInfoMapper.xml
View file @
45e23745
...
...
@@ -174,6 +174,35 @@
a.REASON,
a.AUDIT_TIME_LAST
</sql>
<!-- 导出 -->
<sql
id=
"Base_Export_Column_List"
>
a.APPLY_NO,
a.EMP_NO,
a.EMP_NAME,
a.EMP_IDCARD,
a.CONTRACT_START,
a.CONTRACT_END,
a.FILE_PROVINCE,
a.FILE_CITY,
a.FILE_TOWN,
a.SUBJECT_DEPART,
a.DEPT_NO,
a.EMP_NATRUE,
a.CONTRACT_NAME,
a.CONTRACT_SUB_NAME,
a.SITUATION,
a.CONTRACT_TYPE,
a.CONTRACT_PARTY,
a.SUBJECT_UNIT,
a.AUDIT_STATUS,
a.IN_USE,
if(a.IS_FILE = 0,'有附件','无附件') FILES,
a.IS_FILE,
a.CREATE_NAME,
a.CREATE_TIME
</sql>
<sql
id=
"tEmployeeContractInfo_where"
>
<if
test=
"tEmployeeContractInfo != null"
>
...
...
@@ -351,6 +380,7 @@
a.DELETE_FLAG = 0
<include
refid=
"tEmployeeContractInfo_where"
/>
</where>
order by a.CREATE_TIME desc
</select>
<!--list-->
...
...
@@ -362,28 +392,31 @@
a.DELETE_FLAG = 0
<include
refid=
"tEmployeeContractInfo_where"
/>
</where>
order by a.CREATE_TIME desc
</select>
<!--导出-->
<select
id=
"getTEmployeeContractExport"
resultMap=
"tEmployeeContrctInfoExportMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_
Export_
Column_List"
/>
FROM t_employee_contract_info a
<where>
a.DELETE_FLAG = 0
<include
refid=
"tEmployeeContractInfo_where"
/>
</where>
order by a.CREATE_TIME desc
</select>
<!--导出历史合并-->
<select
id=
"getTEmployeeContractExportHistory"
resultMap=
"tEmployeeContrctInfoExportMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_
Export_
Column_List"
/>
FROM t_employee_contract_info a
<where>
a.DELETE_FLAG = 0
<include
refid=
"tEmployeeContractInfo_where"
/>
</where>
order by a.CREATE_TIME desc
</select>
<!--tEmployeeContractInfo简单分页查询-->
...
...
@@ -407,4 +440,9 @@
SELECT ifnull(max(right(e.APPLY_NO,5)),0) APPLY_NO FROM t_employee_contract_info e where e.DELETE_FLAG = 0 and e.CREATE_TIME>DATE_FORMAT(now(),'%Y-%m-%d')
</select>
<!-- 根据编码获取数据 -->
<select
id=
"getContractByApplyNo"
resultType=
"java.lang.String"
>
SELECT e.id FROM t_employee_contract_info e where e.APPLY_NO = #{applyNo}
</select>
</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