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
15eebdbe
Commit
15eebdbe
authored
Jun 23, 2022
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
huyc 项目档案代码提交
parent
c036e161
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
48 deletions
+57
-48
TEmployeeProjectController.java
.../yifu/archives/controller/TEmployeeProjectController.java
+1
-37
TEmployeeProjectService.java
...lus/v1/yifu/archives/service/TEmployeeProjectService.java
+3
-0
TEmployeeProjectServiceImpl.java
...fu/archives/service/impl/TEmployeeProjectServiceImpl.java
+53
-11
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TEmployeeProjectController.java
View file @
15eebdbe
...
...
@@ -19,23 +19,15 @@ package com.yifu.cloud.plus.v1.yifu.archives.controller;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.pig4cloud.plugin.excel.annotation.RequestExcel
;
import
com.pig4cloud.plugin.excel.annotation.ResponseExcel
;
import
com.pig4cloud.plugin.excel.vo.ErrorMessage
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TCustomerInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TCustomerInfoMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeProjectService
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TSettleDomainService
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectExportVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectVO
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
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.log.annotation.SysLog
;
import
io.swagger.v3.oas.annotations.Operation
;
...
...
@@ -46,9 +38,7 @@ import org.springframework.validation.BindingResult;
import
org.springframework.web.bind.annotation.*
;
import
javax.validation.Valid
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -65,12 +55,6 @@ public class TEmployeeProjectController {
private
final
TEmployeeProjectService
tEmployeeProjectService
;
private
final
TSettleDomainService
tSettleDomainService
;
private
final
TEmployeeInfoMapper
tEmployeeInfoMapper
;
private
final
TCustomerInfoMapper
tCustomerInfoMapper
;
/**
* @param empId 人员档案id
* @Description: 根据人员档案id获取项目list
...
...
@@ -261,26 +245,6 @@ public class TEmployeeProjectController {
@Operation
(
summary
=
"通过项目编码查询项目信息"
,
description
=
"通过项目编码查询项目信息"
)
@PostMapping
(
"/getItemInfo"
)
public
R
getItemByEmpNo
(
@RequestParam
String
empIdcard
,
@RequestParam
String
empNo
)
{
TSettleDomain
tSettleDomain
=
tSettleDomainService
.
getOne
(
Wrappers
.<
TSettleDomain
>
query
().
lambda
()
.
eq
(
TSettleDomain:
:
getDepartNo
,
empNo
));
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectOne
(
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
empIdcard
));
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
String
empCode
=
""
;
if
(
Common
.
isNotNull
(
tEmployeeInfo
))
{
empCode
=
tEmployeeInfo
.
getEmpCode
();
}
String
customerName
=
""
;
if
(
Common
.
isNotNull
(
tSettleDomain
))
{
TCustomerInfo
tCustomerInfo
=
tCustomerInfoMapper
.
selectOne
(
Wrappers
.<
TCustomerInfo
>
query
().
lambda
()
.
eq
(
TCustomerInfo:
:
getId
,
tSettleDomain
.
getCustomerId
()));
if
(
Common
.
isNotNull
(
tCustomerInfo
))
{
customerName
=
tCustomerInfo
.
getCustomerName
();
}
}
map
.
put
(
"empCode"
,
empCode
);
map
.
put
(
"itemInfo"
,
tSettleDomain
);
map
.
put
(
"customerName"
,
customerName
);
return
R
.
ok
(
map
);
return
tEmployeeProjectService
.
getItemByEmpNo
(
empIdcard
,
empNo
);
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/TEmployeeProjectService.java
View file @
15eebdbe
...
...
@@ -28,6 +28,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectExportVO;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectVO
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.List
;
...
...
@@ -115,4 +116,6 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> {
* @Date: 2022/6/23 18:06
**/
void
saveEmployeeProjectInfo
(
TEmployeeInfo
employeeInfo
);
R
getItemByEmpNo
(
String
empIdcard
,
String
empNo
);
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeProjectServiceImpl.java
View file @
15eebdbe
...
...
@@ -25,12 +25,16 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.pig4cloud.plugin.excel.vo.ErrorMessage
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TCustomerInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TCustomerInfoMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeLogService
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeProjectService
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TSettleDomainService
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectExportVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectVO
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
...
...
@@ -45,7 +49,6 @@ import org.springframework.cache.CacheManager;
import
org.springframework.stereotype.Service
;
import
org.springframework.validation.BindingResult
;
import
java.io.IOException
;
import
java.time.LocalDateTime
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -64,7 +67,9 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
private
final
TEmployeeInfoMapper
tEmployeeInfoMapper
;
private
final
TEmployeeProjectMapper
tEmployeeProjectMapper
;
private
final
TSettleDomainService
tSettleDomainService
;
private
final
TCustomerInfoMapper
tCustomerInfoMapper
;
// 缓存信息
private
final
CacheManager
cacheManager
;
...
...
@@ -97,7 +102,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if
(!
Common
.
isEmpty
(
tEmployeeInfo
))
{
map
.
put
(
"empProId"
,
tEmployeeProject
.
getId
());
if
(
CommonConstants
.
STATUS_NORMAL
.
equals
(
tEmployeeInfo
.
getFileStatus
()))
{
map
.
put
(
"code"
,
"201"
);
return
R
.
ok
(
map
,
"该人员已减项,是否“复项”"
);
}
else
{
map
.
put
(
"code"
,
"202"
);
...
...
@@ -291,13 +295,13 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
tEmployeeInfoMapper
.
updateExcelEmployeeInfo
(
updateList
);
}
if
(
proInsList
.
size
()
>
CommonConstants
.
dingleDigitIntArray
[
0
])
{
tEmployeeProject
Mapper
.
insertExcelEmpProject
(
proInsList
);
base
Mapper
.
insertExcelEmpProject
(
proInsList
);
List
<
String
>
idList
=
proInsList
.
stream
().
map
(
TEmployeeProject:
:
getEmpIdcard
).
collect
(
Collectors
.
toList
());
List
<
TEmployeeInfo
>
updList
=
tEmployeeInfoMapper
.
selectList
(
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
().
in
(
TEmployeeInfo:
:
getEmpIdcard
,
idList
));
tEmployeeProject
Mapper
.
updateEmpIdById
(
updList
);
base
Mapper
.
updateEmpIdById
(
updList
);
}
if
(
proupdateList
.
size
()
>
CommonConstants
.
dingleDigitIntArray
[
0
])
{
tEmployeeProject
Mapper
.
updateExcelEmpProject
(
proupdateList
);
base
Mapper
.
updateExcelEmpProject
(
proupdateList
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"数据更新异常"
,
e
);
...
...
@@ -363,7 +367,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
try
{
if
(
updateList
.
size
()
>
CommonConstants
.
dingleDigitIntArray
[
0
])
{
tEmployeeProject
Mapper
.
updateExcelEmpProject
(
updateList
);
base
Mapper
.
updateExcelEmpProject
(
updateList
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"数据更新异常"
,
e
);
...
...
@@ -404,7 +408,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
insTEmployeePro
.
setEmpId
(
CommonConstants
.
EMPTY_STRING
);
String
str
=
""
;
String
EmpNo
=
tEmployeeProject
Mapper
.
findEmployeeMaxOnlyNoByDepId
(
insTEmployeePro
.
getDeptNo
());
String
EmpNo
=
base
Mapper
.
findEmployeeMaxOnlyNoByDepId
(
insTEmployeePro
.
getDeptNo
());
if
(!
Common
.
isEmpty
(
EmpNo
))
{
str
=
NoUtil
.
productionNo
(
EmpNo
,
CommonConstants
.
EMPLOYEE_INIT_NO_START
);
}
else
{
...
...
@@ -540,20 +544,34 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
public
void
saveEmployeeProjectInfo
(
TEmployeeInfo
employeeInfo
)
{
TEmployeeProject
tEmployeeProject
=
new
TEmployeeProject
();
tEmployeeProject
.
setEmpId
(
employeeInfo
.
getId
());
tEmployeeProject
.
setEmpCode
(
employeeInfo
.
getEmp
Code
());
tEmployeeProject
.
setEmpCode
(
this
.
get
Code
());
tEmployeeProject
.
setEmpNatrue
(
employeeInfo
.
getEmpNatrue
());
tEmployeeProject
.
setEmpName
(
employeeInfo
.
getEmpName
());
tEmployeeProject
.
setEmpIdcard
(
employeeInfo
.
getEmpIdcard
());
tEmployeeProject
.
setPost
(
employeeInfo
.
getPost
());
String
str
=
""
;
String
EmpNo
=
tEmployeeProject
Mapper
.
findEmployeeMaxOnlyNoByDepId
(
employeeInfo
.
getDeptNo
());
String
EmpNo
=
base
Mapper
.
findEmployeeMaxOnlyNoByDepId
(
employeeInfo
.
getDeptNo
());
if
(!
Common
.
isEmpty
(
EmpNo
))
{
str
=
NoUtil
.
productionNo
(
EmpNo
,
CommonConstants
.
EMPLOYEE_INIT_NO_START
);
}
else
{
str
=
employeeInfo
.
getDeptNo
()
+
CommonConstants
.
EMPLOYEE_INIT_NO
;
}
tEmployeeProject
.
setEmpNo
(
str
);
tEmployeeProjectMapper
.
insert
(
tEmployeeProject
);
tEmployeeProject
.
setDeptNo
(
employeeInfo
.
getDeptNo
());
TSettleDomain
tSettleDomain
=
tSettleDomainService
.
getOne
(
Wrappers
.<
TSettleDomain
>
query
().
lambda
()
.
eq
(
TSettleDomain:
:
getDepartNo
,
employeeInfo
.
getDeptNo
()).
eq
(
TSettleDomain:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
));
if
(
Common
.
isNotNull
(
tSettleDomain
))
{
tEmployeeProject
.
setDeptId
(
tSettleDomain
.
getId
());
tEmployeeProject
.
setDeptName
(
tSettleDomain
.
getDepartName
());
TCustomerInfo
tCustomerInfo
=
tCustomerInfoMapper
.
selectById
(
tSettleDomain
.
getCustomerId
());
if
(
Common
.
isNotNull
(
tCustomerInfo
))
{;
tEmployeeProject
.
setUnitId
(
tCustomerInfo
.
getId
());
tEmployeeProject
.
setUnitNo
(
tCustomerInfo
.
getCustomerCode
());
tEmployeeProject
.
setUnitName
(
tCustomerInfo
.
getCustomerName
());
}
}
baseMapper
.
insert
(
tEmployeeProject
);
}
/**
...
...
@@ -608,5 +626,29 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
return
this
.
list
(
Wrappers
.
query
(
project
));
}
@Override
public
R
getItemByEmpNo
(
String
empIdcard
,
String
empNo
)
{
TSettleDomain
tSettleDomain
=
tSettleDomainService
.
getOne
(
Wrappers
.<
TSettleDomain
>
query
().
lambda
()
.
eq
(
TSettleDomain:
:
getDepartNo
,
empNo
));
TEmployeeInfo
tEmployeeInfo
=
tEmployeeInfoMapper
.
selectOne
(
Wrappers
.<
TEmployeeInfo
>
query
().
lambda
()
.
eq
(
TEmployeeInfo:
:
getEmpIdcard
,
empIdcard
));
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
String
empCode
=
""
;
if
(
Common
.
isNotNull
(
tEmployeeInfo
))
{
empCode
=
tEmployeeInfo
.
getEmpCode
();
}
String
customerName
=
""
;
if
(
Common
.
isNotNull
(
tSettleDomain
))
{
TCustomerInfo
tCustomerInfo
=
tCustomerInfoMapper
.
selectOne
(
Wrappers
.<
TCustomerInfo
>
query
().
lambda
()
.
eq
(
TCustomerInfo:
:
getId
,
tSettleDomain
.
getCustomerId
()));
if
(
Common
.
isNotNull
(
tCustomerInfo
))
{
customerName
=
tCustomerInfo
.
getCustomerName
();
}
}
map
.
put
(
"empCode"
,
empCode
);
map
.
put
(
"itemInfo"
,
tSettleDomain
);
map
.
put
(
"customerName"
,
customerName
);
return
R
.
ok
(
map
);
}
}
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