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
b8cbe22a
Commit
b8cbe22a
authored
Mar 11, 2025
by
fangxinjiang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/MVP1.7.7' into MVP1.7.7
parents
a473f29e
4a046d41
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
244 additions
and
21 deletions
+244
-21
EmpProjectStatusVo.java
...fu/cloud/plus/v1/yifu/archives/vo/EmpProjectStatusVo.java
+1
-0
TEmployeeProjectBelongDeptController.java
...ives/controller/TEmployeeProjectBelongDeptController.java
+16
-0
TEmployeeProjectBelongDeptService.java
...u/archives/service/TEmployeeProjectBelongDeptService.java
+3
-0
TEmployeeProjectBelongDeptServiceImpl.java
...s/service/impl/TEmployeeProjectBelongDeptServiceImpl.java
+18
-0
TEmployeeProjectServiceImpl.java
...fu/archives/service/impl/TEmployeeProjectServiceImpl.java
+6
-1
TEmployeeProjectBelongDeptMapper.xml
...ain/resources/mapper/TEmployeeProjectBelongDeptMapper.xml
+9
-3
TEmployeeProjectMapper.xml
...-biz/src/main/resources/mapper/TEmployeeProjectMapper.xml
+1
-1
ArchivesDaprUtil.java
...cloud/plus/v1/yifu/common/dapr/util/ArchivesDaprUtil.java
+12
-0
UpmsDaprUtils.java
...fu/cloud/plus/v1/yifu/common/dapr/util/UpmsDaprUtils.java
+12
-0
EmployeeRegistration.java
...m/yifu/cloud/plus/v1/csp/entity/EmployeeRegistration.java
+4
-0
EmployeeRegistrationExportVo.java
...fu/cloud/plus/v1/csp/vo/EmployeeRegistrationExportVo.java
+1
-1
EmployeeRegistrationHrExportVo.java
.../cloud/plus/v1/csp/vo/EmployeeRegistrationHrExportVo.java
+1
-1
EmployeeRegistrationServiceImpl.java
.../v1/csp/service/impl/EmployeeRegistrationServiceImpl.java
+32
-6
SysCspDeptVo.java
...om/yifu.cloud.plus.v1/yifu/admin/api/vo/SysCspDeptVo.java
+35
-0
UserController.java
...u/cloud/plus/v1/yifu/admin/controller/UserController.java
+25
-0
SysDeptMapper.java
...m/yifu/cloud/plus/v1/yifu/admin/mapper/SysDeptMapper.java
+2
-0
SysUserDeptPermissionMapper.java
...lus/v1/yifu/admin/mapper/SysUserDeptPermissionMapper.java
+3
-0
SysUserDeptPermissionService.java
...s/v1/yifu/admin/service/SysUserDeptPermissionService.java
+3
-0
SysUserService.java
...yifu/cloud/plus/v1/yifu/admin/service/SysUserService.java
+3
-4
SysDeptServiceImpl.java
...d/plus/v1/yifu/admin/service/impl/SysDeptServiceImpl.java
+3
-1
SysUserDeptPermissionServiceImpl.java
.../admin/service/impl/SysUserDeptPermissionServiceImpl.java
+15
-3
SysUserServiceImpl.java
...d/plus/v1/yifu/admin/service/impl/SysUserServiceImpl.java
+12
-0
SysDeptMapper.xml
...yifu-upms-biz/src/main/resources/mapper/SysDeptMapper.xml
+17
-0
SysUserDeptPermissionMapper.xml
...src/main/resources/mapper/SysUserDeptPermissionMapper.xml
+10
-0
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/EmpProjectStatusVo.java
View file @
b8cbe22a
...
...
@@ -18,4 +18,5 @@ public class EmpProjectStatusVo implements Serializable {
private
String
empIdcard
;
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
LocalDateTime
projectTime
;
private
String
empProjectId
;
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TEmployeeProjectBelongDeptController.java
View file @
b8cbe22a
...
...
@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.controller;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysCspDeptVo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProjectBelongDept
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeProjectBelongDeptService
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectScpVO
;
...
...
@@ -29,6 +30,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.UserPermissionVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
...
...
@@ -98,6 +100,7 @@ public class TEmployeeProjectBelongDeptController {
}
if
(
Common
.
isEmpty
(
tEmployeeProjectBelongDept
.
getEmpDeptid
()))
{
tEmployeeProjectBelongDeptService
.
removeById
(
tEmployeeProjectBelongDept
.
getId
());
return
R
.
ok
(
CommonConstants
.
SAVE_SUCCESS
);
}
else
if
(
Common
.
isEmpty
(
tEmployeeProjectBelongDept
.
getEmpDeptname
()))
{
return
R
.
failed
(
"所属部门名称必填"
);
}
...
...
@@ -182,4 +185,17 @@ public class TEmployeeProjectBelongDeptController {
return
R
.
ok
(
tEmployeeProjectBelongDeptService
.
getNoneDeptCount
(
tEmployeeProjectBelongDept
));
}
/**
* @Author huych
* @Description 根据项目id和用户id查询csp部门信息
* @Date 14:27 2025/3/10
* @Param
* @return
**/
@Inner
@PostMapping
(
"/inner/saveOrDeleteDeptRelation"
)
public
R
<
Boolean
>
saveOrDeleteDeptRelation
(
@RequestBody
SysCspDeptVo
vo
)
{
return
R
.
ok
(
tEmployeeProjectBelongDeptService
.
saveOrDeleteDeptRelation
(
vo
));
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/TEmployeeProjectBelongDeptService.java
View file @
b8cbe22a
...
...
@@ -20,6 +20,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.service;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysCspDeptVo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProjectBelongDept
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectScpVO
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeProjectBelongDeptSearchVo
;
...
...
@@ -76,4 +77,6 @@ public interface TEmployeeProjectBelongDeptService extends IService<TEmployeePro
*/
Integer
getNoneDeptCount
(
TEmployeeProjectBelongDeptSearchVo
tEmployeeProjectBelongDept
);
Boolean
saveOrDeleteDeptRelation
(
SysCspDeptVo
vo
);
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeProjectBelongDeptServiceImpl.java
View file @
b8cbe22a
...
...
@@ -22,6 +22,7 @@ import com.alibaba.excel.write.metadata.WriteSheet;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysCspDeptVo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProjectBelongDept
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectBelongDeptMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeProjectBelongDeptService
;
...
...
@@ -81,6 +82,9 @@ public class TEmployeeProjectBelongDeptServiceImpl extends ServiceImpl<TEmployee
if
(
Common
.
isNotNull
(
tEmployeeProjectBelongDept
.
getEmpDeptId
())
&&
!
"-1"
.
equals
(
tEmployeeProjectBelongDept
.
getEmpDeptId
()))
{
tEmployeeProjectBelongDept
.
setEmpDeptIdArray
(
tEmployeeProjectBelongDept
.
getEmpDeptId
().
split
(
","
));
}
if
(
Common
.
isEmpty
(
tEmployeeProjectBelongDept
.
getEmpDeptId
()))
{
tEmployeeProjectBelongDept
.
setEmpDeptId
(
"不查数据"
);
}
}
/**
...
...
@@ -191,4 +195,18 @@ public class TEmployeeProjectBelongDeptServiceImpl extends ServiceImpl<TEmployee
public
Integer
getNoneDeptCount
(
TEmployeeProjectBelongDeptSearchVo
tEmployeeProjectBelongDept
)
{
return
baseMapper
.
getNoneDeptCount
(
tEmployeeProjectBelongDept
);
}
@Override
public
Boolean
saveOrDeleteDeptRelation
(
SysCspDeptVo
vo
)
{
if
(
Common
.
isNotNull
(
vo
.
getDepartName
()))
{
TEmployeeProjectBelongDept
dept
=
new
TEmployeeProjectBelongDept
();
dept
.
setId
(
vo
.
getProjectId
());
dept
.
setEmpDeptid
(
vo
.
getDepartId
().
toString
());
dept
.
setEmpDeptname
(
vo
.
getDepartName
());
this
.
save
(
dept
);
}
else
{
this
.
removeById
(
vo
.
getProjectId
());
}
return
true
;
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeProjectServiceImpl.java
View file @
b8cbe22a
...
...
@@ -152,9 +152,13 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
.
eq
(
TEmployeeProject:
:
getEmpIdcard
,
vo
.
getEmpIdcard
())
.
eq
(
TEmployeeProject:
:
getDeptNo
,
vo
.
getDeptNo
())
.
eq
(
TEmployeeProject:
:
getDeleteFlag
,
CommonConstants
.
STATUS_NORMAL
)
.
eq
(
TEmployeeProject:
:
getProjectStatus
,
CommonConstants
.
ZERO_INT
).
last
(
CommonConstants
.
LAST_ONE_SQL
));
.
and
(
obj
->
obj
.
ne
(
TEmployeeProject:
:
getProjectSource
,
CommonConstants
.
ONE_STRING
)
.
or
().
eq
(
TEmployeeProject:
:
getProjectSource
,
CommonConstants
.
ONE_STRING
)
.
eq
(
TEmployeeProject:
:
getStatus
,
CommonConstants
.
ONE_INT
))
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Common
.
isNotNull
(
employeeProject
))
{
vo
.
setProjectTime
(
employeeProject
.
getCreateTime
());
vo
.
setEmpProjectId
(
employeeProject
.
getId
());
return
vo
;
}
return
null
;
...
...
@@ -169,6 +173,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
.
eq
(
TEmployeeProject:
:
getProjectStatus
,
CommonConstants
.
ONE_INT
).
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Common
.
isNotNull
(
employeeProject
))
{
vo
.
setProjectTime
(
employeeProject
.
getLeaveTime
());
vo
.
setEmpProjectId
(
employeeProject
.
getId
());
return
vo
;
}
return
null
;
...
...
yifu-archives/yifu-archives-biz/src/main/resources/mapper/TEmployeeProjectBelongDeptMapper.xml
View file @
b8cbe22a
...
...
@@ -36,9 +36,15 @@
<if
test=
"tEmployeeProjectBelongDept.deptId != null and tEmployeeProjectBelongDept.deptId.trim() != ''"
>
AND a.DEPT_ID = #{tEmployeeProjectBelongDept.deptId}
</if>
<if
test=
"tEmployeeProjectBelongDept.empDeptId != null and tEmployeeProjectBelongDept.empDeptId.trim() != ''
and tEmployeeProjectBelongDept.empDeptId.trim() == '-1'"
>
AND b.id is null
<if
test=
"tEmployeeProjectBelongDept.empDeptId != null and tEmployeeProjectBelongDept.empDeptId.trim() != ''"
>
<if
test=
"tEmployeeProjectBelongDept.empDeptId.trim() == '-1'"
>
/* 查询未关联的 */
AND b.id is null
</if>
<if
test=
"tEmployeeProjectBelongDept.empDeptId.trim() == '不查数据'"
>
/* 不查数据 */
AND b.id = '不查数据'
</if>
</if>
<if
test=
"tEmployeeProjectBelongDept.empName != null and tEmployeeProjectBelongDept.empName.trim() != ''"
>
AND a.EMP_NAME like concat('%',#{tEmployeeProjectBelongDept.empName},'%')
...
...
yifu-archives/yifu-archives-biz/src/main/resources/mapper/TEmployeeProjectMapper.xml
View file @
b8cbe22a
...
...
@@ -886,7 +886,7 @@
FROM t_employee_project a left join t_employee_info b on a.EMP_ID = b.id
where
a.DELETE_FLAG = '0' and a.DEPT_NO = #{tEmployeeProject.deptNo}
and
a.PROJECT_STATUS = 0
and
((a.PROJECT_SOURCE = '1' and a.STATUS = 1) or a.PROJECT_SOURCE != '1')
<if
test=
"tEmployeeProject.empIdcard != null and tEmployeeProject.empIdcard.trim() != ''"
>
AND (a.EMP_IDCARD like concat('%',#{tEmployeeProject.empIdcard},'%') or a.EMP_NAME like concat('%',#{tEmployeeProject.empIdcard}))
</if>
...
...
yifu-common/yifu-common-dapr/src/main/java/com/yifu/cloud/plus/v1/yifu/common/dapr/util/ArchivesDaprUtil.java
View file @
b8cbe22a
...
...
@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.yifu.common.dapr.util;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.TypeReference
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysCspDeptVo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TBusinessEmployeeExtendInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo
;
...
...
@@ -518,4 +519,15 @@ public class ArchivesDaprUtil {
public
R
<
Boolean
>
selectExitEmpProject
(
TInsuranceUnpurchasePersonCardVo
cardVo
)
{
return
HttpDaprUtil
.
invokeMethodPost
(
daprArchivesProperties
.
getAppUrl
(),
daprArchivesProperties
.
getAppId
(),
"/temployeeproject/inner/selectExitEmpProject"
,
JSON
.
toJSONString
(
cardVo
),
Boolean
.
class
,
SecurityConstants
.
FROM_IN
);
}
/**
* @Author huyc
* @Description 新增或者删除项目档案与所属部门的关联表
* @Date 17:07 2025/3/10
* @Param
* @return
**/
public
R
<
Boolean
>
saveOrDeleteDeptRelation
(
SysCspDeptVo
vo
)
{
return
HttpDaprUtil
.
invokeMethodPost
(
daprArchivesProperties
.
getAppUrl
(),
daprArchivesProperties
.
getAppId
(),
"/temployeeprojectbelongdept/inner/saveOrDeleteDeptRelation"
,
JSON
.
toJSONString
(
vo
),
Boolean
.
class
,
SecurityConstants
.
FROM_IN
);
}
}
yifu-common/yifu-common-dapr/src/main/java/com/yifu/cloud/plus/v1/yifu/common/dapr/util/UpmsDaprUtils.java
View file @
b8cbe22a
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
dapr
.
util
;
import
com.alibaba.fastjson.JSON
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.*
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants
;
...
...
@@ -129,4 +130,15 @@ public class UpmsDaprUtils {
public
R
<
Boolean
>
selectExitDeptCompany
(
String
deptId
)
{
return
HttpDaprUtil
.
invokeMethodPost
(
daprUpmsProperties
.
getAppUrl
(),
daprUpmsProperties
.
getAppId
(),
"/user/inner/selectExitDeptCompany"
,
deptId
,
Boolean
.
class
,
SecurityConstants
.
FROM_IN
);
}
/**
* @Author huyc
* @Description 判断部门是否属于分公司
* @Date 10:38 2025/1/20
* @Param
* @return
**/
public
R
<
SysCspDeptVo
>
selectCspDeptByUserDeptId
(
SysCspDeptVo
vo
)
{
return
HttpDaprUtil
.
invokeMethodPost
(
daprUpmsProperties
.
getAppUrl
(),
daprUpmsProperties
.
getAppId
(),
"/user/inner/selectInnerCspDeptByUserDeptId"
,
vo
,
SysCspDeptVo
.
class
,
SecurityConstants
.
FROM_IN
);
}
}
yifu-csp/yifu-csp-api/src/main/java/com/yifu/cloud/plus/v1/csp/entity/EmployeeRegistration.java
View file @
b8cbe22a
...
...
@@ -98,6 +98,10 @@ public class EmployeeRegistration extends BaseEntity {
@TableField
(
exist
=
false
)
private
int
outNum
;
@Schema
(
description
=
"项目档案id"
)
@TableField
(
exist
=
false
)
private
String
empProjectId
;
}
yifu-csp/yifu-csp-api/src/main/java/com/yifu/cloud/plus/v1/csp/vo/EmployeeRegistrationExportVo.java
View file @
b8cbe22a
...
...
@@ -17,7 +17,7 @@ import java.util.Date;
* @date 2025-02-25 14:48:11
*/
@Data
@ColumnWidth
(
1
5
)
@ColumnWidth
(
1
7
)
public
class
EmployeeRegistrationExportVo
implements
Serializable
{
@ExcelAttribute
(
name
=
"员工姓名"
)
...
...
yifu-csp/yifu-csp-api/src/main/java/com/yifu/cloud/plus/v1/csp/vo/EmployeeRegistrationHrExportVo.java
View file @
b8cbe22a
...
...
@@ -17,7 +17,7 @@ import java.util.Date;
* @date 2025-02-25 14:48:11
*/
@Data
@ColumnWidth
(
1
5
)
@ColumnWidth
(
1
7
)
public
class
EmployeeRegistrationHrExportVo
implements
Serializable
{
@ExcelAttribute
(
name
=
"项目编码"
)
...
...
yifu-csp/yifu-csp-biz/src/main/java/com/yifu/cloud/plus/v1/csp/service/impl/EmployeeRegistrationServiceImpl.java
View file @
b8cbe22a
...
...
@@ -24,6 +24,7 @@ import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationHrExportVo;
import
com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationSearchVo
;
import
com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationVo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysCspDeptVo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProjectBelongDept
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.EmpProjectStatusVo
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeProjectBelongDeptSearchCspVo
;
...
...
@@ -372,7 +373,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
exit
=
getOutEmpProjectStatus
(
vo
);
}
if
(
Common
.
isNotNull
(
exit
))
{
return
R
.
ok
(
exit
.
getProjectTime
()
);
return
R
.
ok
(
exit
);
}
registrationNow
.
setProcessStatus
(
CommonConstants
.
ZERO_STRING
);
baseMapper
.
updateById
(
registrationNow
);
...
...
@@ -393,6 +394,13 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
logService
.
saveLog
(
registration
.
getId
(),
CommonConstants
.
ZERO_STRING
,
RegistConstants
.
MESSAGE_FINISH
,
registration
.
getProjectCreateTime
(),
user
.
getNickname
(),
CommonConstants
.
ONE_STRING
.
equals
(
registrationNow
.
getFeedbackType
())
?
RegistConstants
.
BEFORE_IN_PROJECT
:
RegistConstants
.
BEFORE_OUT_PROJECT
);
SysCspDeptVo
vo
=
new
SysCspDeptVo
();
if
(
CommonConstants
.
ONE_STRING
.
equals
(
registrationNow
.
getFeedbackType
()))
{
vo
.
setDepartName
(
registrationNow
.
getEmpDeptname
());
vo
.
setDepartId
(
Long
.
valueOf
(
registrationNow
.
getEmpDeptid
()));
}
vo
.
setProjectId
(
registration
.
getEmpProjectId
());
archivesDaprUtil
.
saveOrDeleteDeptRelation
(
vo
);
baseMapper
.
updateById
(
registrationNow
);
return
R
.
ok
();
}
...
...
@@ -459,12 +467,26 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
//数据初始化
private
void
initRegistInfo
(
EmployeeRegistration
insert
,
YifuUser
user
,
TSettleDomainSelectVo
selectVo
)
{
insert
.
setRegistorDeptname
(
user
.
getDeptName
());
insert
.
setRegistorDeptid
(
user
.
getDeptId
().
toString
());
SysCspDeptVo
vo
=
new
SysCspDeptVo
();
vo
.
setUserId
(
user
.
getId
());
vo
.
setProjectId
(
selectVo
.
getId
());
R
<
SysCspDeptVo
>
booleanR
=
upmsDaprUtils
.
selectCspDeptByUserDeptId
(
vo
);
log
.
info
(
"SysCsp:"
+
booleanR
+
"ProjectId:"
+
selectVo
.
getId
()
+
"userId:"
+
user
.
getId
());
if
(
Common
.
isNotNull
(
booleanR
)
&&
Common
.
isNotNull
(
booleanR
.
getData
())
&&
Common
.
isNotNull
(
booleanR
.
getData
().
getDepartId
())
&&
Common
.
isNotNull
(
booleanR
.
getData
().
getDepartName
()))
{
vo
=
booleanR
.
getData
();
insert
.
setRegistorDeptname
(
vo
.
getDepartName
());
insert
.
setRegistorDeptid
(
vo
.
getDepartId
().
toString
());
insert
.
setEmpDeptid
(
vo
.
getDepartId
().
toString
());
insert
.
setEmpDeptname
(
vo
.
getDepartName
());
}
else
{
insert
.
setRegistorDeptname
(
user
.
getDeptName
());
insert
.
setRegistorDeptid
(
user
.
getDeptId
().
toString
());
insert
.
setEmpDeptid
(
user
.
getDeptId
().
toString
());
insert
.
setEmpDeptname
(
user
.
getDeptName
());
}
insert
.
setRegistorUsername
(
user
.
getNickname
());
insert
.
setRegistorPhone
(
user
.
getPhone
());
insert
.
setEmpDeptid
(
user
.
getDeptId
().
toString
());
insert
.
setEmpDeptname
(
user
.
getDeptName
());
insert
.
setCustomerPhone
(
selectVo
.
getCsPhone
());
insert
.
setCustomerUsername
(
selectVo
.
getCsName
());
insert
.
setCustomerUserLoginname
(
selectVo
.
getCsLoginName
());
...
...
@@ -606,7 +628,11 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
}
}
if
(
Common
.
isNotNull
(
authority
)
&&
!
authority
.
isHaveAll
())
{
searchVo
.
setDepartIdSet
(
authority
.
getDepartIdSet
());
if
(
Common
.
isNotNull
(
authority
.
getDepartIdSet
()))
{
searchVo
.
setDepartIdSet
(
authority
.
getDepartIdSet
());
}
else
{
searchVo
.
setId
(
CommonConstants
.
ONE_STRING_NEGATE
);
}
}
}
}
...
...
yifu-upms/yifu-upms-api/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/api/vo/SysCspDeptVo.java
0 → 100644
View file @
b8cbe22a
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
api
.
vo
;
import
lombok.Data
;
/**
* csp部门信息
*
* @author huych
* @since 1.9.7
*/
@Data
public
class
SysCspDeptVo
{
/**
* 部门名称
*/
private
String
departName
;
/**
* 部门id
*/
private
Long
departId
;
/**
* 用户id
*/
private
String
userId
;
/**
* 项目id
*/
private
String
projectId
;
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/controller/UserController.java
View file @
b8cbe22a
...
...
@@ -665,4 +665,29 @@ public class UserController {
@RequestParam
(
required
=
false
)
String
nickname
)
{
return
userService
.
cspUserPage
(
page
,
deptId
,
username
,
nickname
);
}
/**
* @Author huych
* @Description 根据项目id和用户id查询csp部门信息
* @Date 14:27 2025/3/10
* @Param
* @return
**/
@Inner
@PostMapping
(
"/inner/selectInnerCspDeptByUserDeptId"
)
public
SysCspDeptVo
selectInnerCspDeptByUserDeptId
(
@RequestBody
SysCspDeptVo
vo
)
{
return
userService
.
selectCspDeptByUserDeptId
(
vo
);
}
/**
* @Author huych
* @Description 根据项目id和用户id查询csp部门信息
* @Date 14:27 2025/3/10
* @Param
* @return
**/
@PostMapping
(
"/selectCspDeptByUserDeptId"
)
public
R
<
SysCspDeptVo
>
selectCspDeptByUserDeptId
(
@RequestBody
SysCspDeptVo
vo
)
{
return
R
.
ok
(
userService
.
selectCspDeptByUserDeptId
(
vo
));
}
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/mapper/SysDeptMapper.java
View file @
b8cbe22a
...
...
@@ -51,6 +51,8 @@ public interface SysDeptMapper extends BaseMapper<SysDept> {
List
<
SysDept
>
getDeptListByDeptId
(
@Param
(
"deptIdSplit"
)
String
deptIdSplit
,
@Param
(
"deptId"
)
Long
deptId
);
List
<
SysDept
>
getDeptListByDeptIdSet
(
@Param
(
"departIdSet"
)
Set
<
String
>
departIdSet
);
/**
* 客户服务平台——查询部门管理数据
*
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/mapper/SysUserDeptPermissionMapper.java
View file @
b8cbe22a
...
...
@@ -18,6 +18,7 @@ package com.yifu.cloud.plus.v1.yifu.admin.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUserDeptPermission
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysCspDeptVo
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -36,4 +37,6 @@ public interface SysUserDeptPermissionMapper extends BaseMapper<SysUserDeptPermi
List
<
SysUserDeptPermission
>
getUserDeptPermissionList
(
@Param
(
"userId"
)
String
userId
);
SysCspDeptVo
selectCasDeptVo
(
@Param
(
"userId"
)
String
userId
,
@Param
(
"projectId"
)
String
projectId
);
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/service/SysUserDeptPermissionService.java
View file @
b8cbe22a
...
...
@@ -18,6 +18,7 @@ package com.yifu.cloud.plus.v1.yifu.admin.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUserDeptPermission
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysCspDeptVo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.UserCspVO
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.UserPermissionVo
;
...
...
@@ -64,4 +65,6 @@ public interface SysUserDeptPermissionService extends IService<SysUserDeptPermis
R
<
Boolean
>
updateByIdAsso
(
UserCspVO
entity
);
R
<
Boolean
>
removeUserDeptPermissionById
(
String
userId
,
String
projectNo
);
SysCspDeptVo
selectCasDeptVo
(
String
userId
,
String
projectId
);
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/service/SysUserService.java
View file @
b8cbe22a
...
...
@@ -23,10 +23,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import
com.yifu.cloud.plus.v1.yifu.admin.api.dto.UserDTO
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.dto.UserInfo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.BusinessUserVo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.UserExcelVO
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.UserPasswordVo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.UserVO
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.*
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
org.springframework.validation.BindingResult
;
...
...
@@ -215,4 +212,6 @@ public interface SysUserService extends IService<SysUser> {
R
<
IPage
<
SysUser
>>
cspUserPage
(
Page
page
,
String
deptId
,
String
userName
,
String
nickName
);
SysCspDeptVo
selectCspDeptByUserDeptId
(
SysCspDeptVo
vo
);
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/service/impl/SysDeptServiceImpl.java
View file @
b8cbe22a
...
...
@@ -345,6 +345,9 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
// 获取用户部门集合
Set
<
String
>
allDepartIdSet
=
new
HashSet
<>();
Set
<
String
>
departIdSet
=
authority
.
getDepartIdSet
();
if
(
Common
.
isEmpty
(
departIdSet
)){
return
cspDeptTree
;
}
List
<
SysDeptVo
>
deptVoList
=
baseMapper
.
cspDeptListByDeptIdSet
(
dept
,
departIdSet
);
if
(
Common
.
isNotNull
(
deptVoList
)){
// 将指定部门和祖级部门都存到一个集合里
...
...
@@ -629,7 +632,6 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
List
<
DeptSortVo
>
moveVos
=
dept
.
getDeptSortList
();
baseMapper
.
batchUpdateSort
(
moveVos
);
// 清理用户权限
// List<String> userNames = sysUserMapper.getCspUserByDeptId(dept.getDeptId());
List
<
String
>
userNames
=
sysUserMapper
.
getCspUserByProjectNo
(
updateEntity
.
getProjectNo
());
if
(
Common
.
isNotNull
(
userNames
)){
for
(
String
us:
userNames
){
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/service/impl/SysUserDeptPermissionServiceImpl.java
View file @
b8cbe22a
...
...
@@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDept
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUserDeptPermission
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysCspDeptVo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.UserCspVO
;
import
com.yifu.cloud.plus.v1.yifu.admin.constants.UserDeptPermConstants
;
import
com.yifu.cloud.plus.v1.yifu.admin.mapper.SysDeptMapper
;
...
...
@@ -217,16 +218,22 @@ public class SysUserDeptPermissionServiceImpl extends ServiceImpl<SysUserDeptPer
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
tPermissionInfo
.
getPermissionsType
()))
{
// 全部数据
authority
.
setHaveAll
(
true
);
// redisUtil.set(CacheConstants.PROJECT_USER_PERMISSION + projectNoStr +"_"+ userId, authority);
}
else
if
(
CommonConstants
.
THREE_STRING
.
equals
(
tPermissionInfo
.
getPermissionsType
()))
{
// 指定部门权限
if
(
Common
.
isNotKong
(
tPermissionInfo
.
getAppointDeptScope
()))
{
authority
.
setHaveAll
(
false
);
String
[]
appointDeptIdArr
=
tPermissionInfo
.
getAppointDeptScope
().
split
(
CommonConstants
.
COMMA_STRING
);
Set
<
String
>
appointDeptIdSet
=
Arrays
.
stream
(
appointDeptIdArr
).
collect
(
Collectors
.
toSet
());
authority
.
setDepartIdSet
(
appointDeptIdSet
);
// 过滤被删除的数据
sysDeptList
=
sysDeptMapper
.
getDeptListByDeptIdSet
(
appointDeptIdSet
);
Set
<
String
>
normalDeptIdSet
=
new
HashSet
<>();
if
(
Common
.
isNotNull
(
sysDeptList
)){
for
(
SysDept
dept
:
sysDeptList
){
normalDeptIdSet
.
add
(
dept
.
getDeptId
().
toString
());
}
}
authority
.
setDepartIdSet
(
normalDeptIdSet
);
authority
.
setUserId
(
userId
);
// redisUtil.set(CacheConstants.PROJECT_USER_PERMISSION + projectNoStr +"_"+ userId, authority);
}
else
{
log
.
error
(
"获取用户权限失败,该用户指定部门权限为空{}"
,
userId
);
authority
.
setHaveAll
(
false
);
...
...
@@ -408,4 +415,9 @@ public class SysUserDeptPermissionServiceImpl extends ServiceImpl<SysUserDeptPer
}
return
R
.
failed
(
Boolean
.
FALSE
,
CommonConstants
.
RESULT_DATA_FAIL
);
}
@Override
public
SysCspDeptVo
selectCasDeptVo
(
String
userId
,
String
projectId
)
{
return
baseMapper
.
selectCasDeptVo
(
userId
,
projectId
);
}
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/service/impl/SysUserServiceImpl.java
View file @
b8cbe22a
...
...
@@ -1012,4 +1012,16 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
return
R
.
ok
(
baseMapper
.
cspUserPage
(
page
,
deptId
,
userName
,
nickName
,
dept
.
getProjectNo
()));
}
@Override
public
SysCspDeptVo
selectCspDeptByUserDeptId
(
SysCspDeptVo
vo
)
{
SysCspDeptVo
returnVo
=
userDeptPermissionService
.
selectCasDeptVo
(
vo
.
getUserId
(),
vo
.
getProjectId
());
if
(
Common
.
isNotNull
(
returnVo
)
&&
Common
.
isNotNull
(
returnVo
.
getDepartName
())
&&
Common
.
isNotNull
(
returnVo
.
getDepartId
()))
{
vo
.
setDepartName
(
returnVo
.
getDepartName
());
vo
.
setDepartId
(
returnVo
.
getDepartId
());
}
else
{
return
null
;
}
return
vo
;
}
}
yifu-upms/yifu-upms-biz/src/main/resources/mapper/SysDeptMapper.xml
View file @
b8cbe22a
...
...
@@ -63,6 +63,23 @@
and (dept_id = #{deptId} or ancestors like concat(#{deptIdSplit}, '%'))
</select>
<select
id=
"getDeptListByDeptIdSet"
resultType=
"com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDept"
>
select
dept_id as deptId,
name as deptName
from
sys_dept
where
del_flag = '0'
<if
test=
"departIdSet != null and departIdSet.size > 0"
>
AND dept_id in
<foreach
item=
"idStr"
index=
"index"
collection=
"departIdSet"
open=
"("
separator=
","
close=
")"
>
#{idStr}
</foreach>
</if>
</select>
<select
id=
"cspDeptList"
resultType=
"com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysDeptVo"
>
select d.dept_id, d.name, d.parent_id,d.ancestors,sort_order
from sys_dept d
...
...
yifu-upms/yifu-upms-biz/src/main/resources/mapper/SysUserDeptPermissionMapper.xml
View file @
b8cbe22a
...
...
@@ -59,4 +59,14 @@
FROM sys_user_dept_permission a
WHERE a.user_id = #{userId}
</select>
<select
id=
"selectCasDeptVo"
resultType=
"com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysCspDeptVo"
>
SELECT
b.name as departName,
a.dept_id as departId
FROM sys_user_dept_permission a
inner join sys_dept b on a.dept_id = b.dept_id
WHERE a.user_id = #{userId} and a.project_id = #{projectId}
limit 1
</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