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
1b78ec24
Commit
1b78ec24
authored
Apr 27, 2023
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
项目档案新增字段“标签”
parent
3fc42607
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
103 additions
and
12 deletions
+103
-12
TEmployeeProject.java
.../cloud/plus/v1/yifu/archives/entity/TEmployeeProject.java
+7
-0
EmployeeProjectExportParamVO.java
...lus/v1/yifu/archives/vo/EmployeeProjectExportParamVO.java
+8
-0
EmployeeProjectExportVO.java
...oud/plus/v1/yifu/archives/vo/EmployeeProjectExportVO.java
+7
-1
EmployeeProjectUpdateVO.java
...oud/plus/v1/yifu/archives/vo/EmployeeProjectUpdateVO.java
+10
-0
EmployeeProjectVO.java
...ifu/cloud/plus/v1/yifu/archives/vo/EmployeeProjectVO.java
+10
-1
TEmployeeInfoController.java
.../v1/yifu/archives/controller/TEmployeeInfoController.java
+26
-1
TEmployeeProjectServiceImpl.java
...fu/archives/service/impl/TEmployeeProjectServiceImpl.java
+1
-1
application-prd.yml
.../yifu-archives-biz/src/main/resources/application-prd.yml
+4
-4
TEmployeeProjectMapper.xml
...-biz/src/main/resources/mapper/TEmployeeProjectMapper.xml
+27
-4
CacheConstants.java
...oud/plus/v1/yifu/common/core/constant/CacheConstants.java
+3
-0
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/entity/TEmployeeProject.java
View file @
1b78ec24
...
...
@@ -364,6 +364,13 @@ public class TEmployeeProject extends BaseEntity {
@TableField
(
exist
=
false
)
private
String
changeStartMonth
;
/**
* 标签
*/
@Schema
(
description
=
"标签"
)
@Size
(
max
=
20
,
message
=
"标签不可超过20位"
)
private
String
empLabel
;
/**
* 员工合同状态(字典)
* 0 无合同
...
...
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/EmployeeProjectExportParamVO.java
View file @
1b78ec24
...
...
@@ -474,6 +474,14 @@ public class EmployeeProjectExportParamVO extends BaseEntity {
@ExcelProperty
(
value
=
"社保所在县"
)
private
String
socialTown
;
/**
* 标签
*/
@ExcelAttribute
(
name
=
"标签"
,
maxLength
=
20
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
value
=
"标签"
)
private
String
empLabel
;
private
String
[]
socialStatusArray
;
private
String
[]
fundStatusArray
;
...
...
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/EmployeeProjectExportVO.java
View file @
1b78ec24
...
...
@@ -479,7 +479,13 @@ public class EmployeeProjectExportVO {
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
value
=
"社保所在市"
)
private
String
socialCity
;
/**
* 标签
*/
@ExcelAttribute
(
name
=
"标签"
,
maxLength
=
20
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
value
=
"标签"
)
private
String
empLabel
;
/**
* 社保-县
*/
...
...
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/EmployeeProjectUpdateVO.java
View file @
1b78ec24
...
...
@@ -23,10 +23,12 @@ import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Past
;
import
javax.validation.constraints.Size
;
import
java.io.Serializable
;
import
java.util.Date
;
...
...
@@ -142,4 +144,12 @@ public class EmployeeProjectUpdateVO extends RowIndex implements Serializable {
@ExcelProperty
(
value
=
"试用期"
)
private
String
tryPeriod
;
/**
* 标签
*/
@ExcelAttribute
(
name
=
"标签"
,
maxLength
=
20
)
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
value
=
"标签"
)
private
String
empLabel
;
}
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/EmployeeProjectVO.java
View file @
1b78ec24
...
...
@@ -23,10 +23,12 @@ import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Past
;
import
javax.validation.constraints.Size
;
import
java.io.Serializable
;
import
java.util.Date
;
...
...
@@ -141,5 +143,12 @@ public class EmployeeProjectVO extends RowIndex implements Serializable {
@ExcelProperty
(
value
=
"试用期"
)
@ExcelAttribute
(
name
=
"试用期"
,
maxLength
=
4
)
private
String
tryPeriod
;
/**
* 标签
*/
@HeadFontStyle
(
fontHeightInPoints
=
11
)
@ExcelProperty
(
value
=
"标签"
)
@ExcelAttribute
(
name
=
"标签"
,
maxLength
=
20
,
errorInfo
=
"标签不超过20个字"
)
@Schema
(
description
=
"标签"
)
private
String
empLabel
;
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TEmployeeInfoController.java
View file @
1b78ec24
...
...
@@ -23,7 +23,10 @@ import com.pig4cloud.plugin.excel.vo.ErrorMessage;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.*
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ResultConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.redis.RedisDistributedLock
;
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.vo.YifuUser
;
...
...
@@ -185,7 +188,29 @@ public class TEmployeeInfoController {
@PostMapping
(
"/addNewEmployee"
)
//@PreAuthorize("@pms.hasPermission('temployeeinfo_add')")
public
R
<
String
>
addNewEmployee
(
@Valid
@RequestBody
TEmployeeInfo
tEmployeeInfo
)
{
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
Common
.
isEmpty
(
user
)){
return
R
.
failed
(
CommonConstants
.
USER_FAIL
);
}
// 获取redis分布式事务锁
String
key
=
CacheConstants
.
EMP_ADD_LOCK
+
CommonConstants
.
DOWN_LINE_STRING
+
user
.
getId
();
String
requestId
;
try
{
requestId
=
RedisDistributedLock
.
getLock
(
key
,
"10"
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
ResultConstants
.
NO_GETLOCK_DATA
+
CommonConstants
.
DOWN_LINE_STRING
+
e
.
getMessage
());
}
try
{
if
(
Common
.
isNotNull
(
requestId
))
{
return
tEmployeeInfoService
.
addNewEmployee
(
tEmployeeInfo
);
}
else
{
return
R
.
failed
(
ResultConstants
.
NO_GETLOCK_DATA
);
}
}
finally
{
//主动释放锁
RedisDistributedLock
.
unlock
(
key
,
requestId
);
}
}
/**
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeProjectServiceImpl.java
View file @
1b78ec24
...
...
@@ -791,7 +791,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
//根据身份证获取人员档案
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectOne
(
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
excel
.
getEmpIdcard
())
.
eq
(
TEmployeeInfo:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
));
.
eq
(
TEmployeeInfo:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
)
);
//根据身份证和项目编码获取项目档案
tEmployeeProject
=
baseMapper
.
selectOne
(
Wrappers
.<
TEmployeeProject
>
query
().
lambda
()
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
excel
.
getEmpIdcard
())
...
...
yifu-archives/yifu-archives-biz/src/main/resources/application-prd.yml
View file @
1b78ec24
...
...
@@ -6,15 +6,15 @@ spring:
activate
:
on-profile
:
prd
redis
:
host
:
1
92.168.0.153
port
:
22
379
password
:
'
@yf_20
22
'
host
:
1
27.0.0.1
port
:
6
379
password
:
'
@yf_20
17
'
datasource
:
type
:
com.zaxxer.hikari.HikariDataSource
driver-class-name
:
com.mysql.cj.jdbc.Driver
username
:
root
password
:
yf_zsk
url
:
jdbc:mysql://1
92.168.0.222
:22306/mvp_archives?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
url
:
jdbc:mysql://1
19.96.147.6
:22306/mvp_archives?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
hikari
:
driver-class-name
:
${spring.datasource.driver-class-name}
jdbc-url
:
${spring.datasource.url}
...
...
yifu-archives/yifu-archives-biz/src/main/resources/mapper/TEmployeeProjectMapper.xml
View file @
1b78ec24
...
...
@@ -56,6 +56,7 @@
<result
property=
"socialStatus"
column=
"SOCIAL_STATUS"
/>
<result
property=
"fundStatus"
column=
"FUND_STATUS"
/>
<result
property=
"contractStatus"
column=
"CONTRACT_STATUS"
/>
<result
property=
"empLabel"
column=
"EMP_LABEL"
/>
</resultMap>
<resultMap
id=
"tEmployeeProjectExportMap"
type=
"com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectExportVO"
>
...
...
@@ -115,6 +116,7 @@
<result
property=
"createName"
column=
"CREATE_NAME"
/>
<result
property=
"createTime"
column=
"CREATE_TIME"
/>
<result
property=
"contractStatus"
column=
"CONTRACT_STATUS"
/>
<result
property=
"empLabel"
column=
"EMP_LABEL"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
...
...
@@ -168,7 +170,8 @@
a.SOCIAL_PROVINCE,
a.SOCIAL_CITY,
a.SOCIAL_TOWN,
a.SALARY_STATUS
a.SALARY_STATUS,
a.EMP_LABEL
</sql>
<sql
id=
"Base_Export_List"
>
...
...
@@ -231,7 +234,8 @@
a.CREATE_NAME,
a.CREATE_TIME,
b.EMP_EMAIL,
b.EMP_NATRUE AS PROEMP_NATRUE
b.EMP_NATRUE AS PROEMP_NATRUE,
a.EMP_LABEL
</sql>
<sql
id=
"tEmployeeProject_where"
>
...
...
@@ -421,6 +425,9 @@
#{idStr}
</foreach>
</if>
<if
test=
"tEmployeeProject.empLabel != null"
>
AND a.EMP_LABEL = #{tEmployeeProject.empLabel}
</if>
</if>
</sql>
...
...
@@ -581,12 +588,22 @@
#{idStr}
</foreach>
</if>
<if
test=
"tEmployeeProject.empLabel != null"
>
AND a.EMP_LABEL = #{tEmployeeProject.empLabel}
</if>
</if>
</sql>
<update
id=
"updateExcelEmpProject"
parameterType=
"java.util.List"
>
update t_employee_project
<trim
prefix=
"set"
suffixOverrides=
","
>
<trim
prefix=
"EMP_LABEL =case"
suffix=
"end,"
>
<foreach
collection=
"list"
item=
"i"
index=
"index"
>
<if
test=
"i.empLabel!=null"
>
when ID=#{i.id} then #{i.empLabel}
</if>
</foreach>
</trim>
<trim
prefix=
"EMP_NATRUE =case"
suffix=
"end,"
>
<foreach
collection=
"list"
item=
"i"
index=
"index"
>
<if
test=
"i.empNatrue!=null"
>
...
...
@@ -692,7 +709,7 @@
(ID,EMP_ID,EMP_NATRUE,EMP_NAME,EMP_IDCARD,STATUS,PROJECT_STATUS,EMP_CODE,DEPT_NO,CONTRACT_TYPE,POST,
DEPT_ID,DEPT_NAME,UNIT_ID,UNIT_NAME,UNIT_NO,EMP_NO,TRY_PERIOD,ENJOIN_DATE,BANK_NAME,BANK_NO,BANK_SUB_NAME,
BUSINESS_PRIMARY_TYPE,BUSINESS_SECOND_TYPE,BUSINESS_THIRD_TYPE,WORKING_HOURS,PROJECT_SOURCE,DELETE_FLAG,
CREATE_BY,CREATE_NAME,CREATE_TIME,INSURANCE_STATUS,SOCIAL_STATUS,FUND_STATUS)
CREATE_BY,CREATE_NAME,CREATE_TIME,INSURANCE_STATUS,SOCIAL_STATUS,FUND_STATUS
,EMP_LABEL
)
VALUES
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(
...
...
@@ -729,13 +746,19 @@
now(),
0,
0,
0
0,
#{item.empLabel,jdbcType=VARCHAR}
)
</foreach>
</insert>
<update
id=
"updateReduceEmpProject"
parameterType=
"java.util.List"
>
update t_employee_project
<trim
prefix=
"set"
suffixOverrides=
","
>
<trim
prefix=
"EMP_LABEL =case"
suffix=
"end,"
>
<foreach
collection=
"list"
item=
"i"
index=
"index"
>
when ID=#{i.id} then #{i.empLabel}
</foreach>
</trim>
<trim
prefix=
"LEAVE_TIME =case"
suffix=
"end,"
>
<foreach
collection=
"list"
item=
"i"
index=
"index"
>
when ID=#{i.id} then now()
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/constant/CacheConstants.java
View file @
1b78ec24
...
...
@@ -154,4 +154,7 @@ public interface CacheConstants {
//社保公积金派单
String
PAYMENT_DISPATCH_BATCH_IMPORT
=
"payment_dispatch_batch_import"
;
String
EMP_ADD_LOCK
=
"emp_add_lock"
;
}
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