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
cb057e5e
Commit
cb057e5e
authored
Jan 16, 2025
by
chenyuxi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 审批代码+流程配置提交
parent
89fcbc77
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
1021 additions
and
558 deletions
+1021
-558
ProcessDaprUtils.java
...cloud/plus/v1/yifu/common/dapr/util/ProcessDaprUtils.java
+36
-4
UpmsDaprUtils.java
...fu/cloud/plus/v1/yifu/common/dapr/util/UpmsDaprUtils.java
+9
-4
spring.factories
...-common-dapr/src/main/resources/META-INF/spring.factories
+2
-1
daprConfig.properties
...yifu-common-dapr/src/main/resources/daprConfig.properties
+5
-1
ProcessConstants.java
...cloud/plus/v1/yifu/process/constant/ProcessConstants.java
+2
-6
TNodePrimission.java
...fu/cloud/plus/v1/yifu/process/entity/TNodePrimission.java
+1
-1
CommonProcessUserUtil.java
...loud/plus/v1/yifu/process/util/CommonProcessUserUtil.java
+0
-36
ProcessAuditUtil.java
...ifu/cloud/plus/v1/yifu/process/util/ProcessAuditUtil.java
+38
-35
TProcessApprovalConfController.java
...fu/process/controller/TProcessApprovalConfController.java
+0
-47
TProcessController.java
...d/plus/v1/yifu/process/controller/TProcessController.java
+20
-11
TProcessService.java
...u/cloud/plus/v1/yifu/process/service/TProcessService.java
+7
-8
TProcessServiceImpl.java
...lus/v1/yifu/process/service/impl/TProcessServiceImpl.java
+51
-58
TAuditNodeProcess.java
...u/cloud/plus/v1/yifu/salary/entity/TAuditNodeProcess.java
+2
-2
WxConfig.java
...a/com/yifu/cloud/plus/v1/yifu/salary/config/WxConfig.java
+194
-0
TAuditNodeProocessController.java
.../yifu/salary/controller/TAuditNodeProocessController.java
+12
-12
TAuditNodeProcessMapper.java
...d/plus/v1/yifu/salary/mapper/TAuditNodeProcessMapper.java
+2
-2
TAuditNodeProcessService.java
...plus/v1/yifu/salary/service/TAuditNodeProcessService.java
+2
-2
AbastractAuditProcess.java
...us/v1/yifu/salary/service/impl/AbastractAuditProcess.java
+266
-223
TAuditNodeProcessServiceImpl.java
...ifu/salary/service/impl/TAuditNodeProcessServiceImpl.java
+21
-0
TInsuranceUnpurchaseApplyServiceImpl.java
...ry/service/impl/TInsuranceUnpurchaseApplyServiceImpl.java
+28
-10
TInsuranceUnpurchaseApplyAuditProcess.java
...e/impl/process/TInsuranceUnpurchaseApplyAuditProcess.java
+107
-94
application-test.yml
...y/yifu-salary-biz/src/main/resources/application-test.yml
+7
-1
TAuditNodeProcessMapper.xml
...biz/src/main/resources/mapper/TAuditNodeProcessMapper.xml
+105
-0
UserApprovalRoleVO.java
...u.cloud.plus.v1/yifu/admin/api/vo/UserApprovalRoleVO.java
+21
-0
UserController.java
...u/cloud/plus/v1/yifu/admin/controller/UserController.java
+27
-0
SysUserMapper.java
...m/yifu/cloud/plus/v1/yifu/admin/mapper/SysUserMapper.java
+4
-0
SysUserService.java
...yifu/cloud/plus/v1/yifu/admin/service/SysUserService.java
+5
-0
SysUserServiceImpl.java
...d/plus/v1/yifu/admin/service/impl/SysUserServiceImpl.java
+10
-0
SysUserMapper.xml
...yifu-upms-biz/src/main/resources/mapper/SysUserMapper.xml
+37
-0
No files found.
yifu-common/yifu-common-dapr/src/main/java/com/yifu/cloud/plus/v1/yifu/common/dapr/util/ProcessDaprUtils.java
View file @
cb057e5e
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
dapr
.
util
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
dapr
.
util
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants
;
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.dapr.config.DaprProcessProperties
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprProcessProperties
;
import
com.yifu.cloud.plus.v1.yifu.process.vo.ProcessVo
;
import
lombok.extern.log4j.Log4j2
;
import
lombok.extern.log4j.Log4j2
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
/**
/**
*
@Author huyc
*
流程
* @
Date 2022-07-18
* @
author chenyuxi
* @
Description
* @
date 2025-01-10 17:47:32
* @
Version 1.0
* @
since 1.7.5
*/
*/
@Log4j2
@Log4j2
@EnableConfigurationProperties
(
DaprProcessProperties
.
class
)
@EnableConfigurationProperties
(
DaprProcessProperties
.
class
)
...
@@ -18,4 +22,32 @@ public class ProcessDaprUtils {
...
@@ -18,4 +22,32 @@ public class ProcessDaprUtils {
@Autowired
@Autowired
private
DaprProcessProperties
daprProcessProperties
;
private
DaprProcessProperties
daprProcessProperties
;
/**
* 根据流程类型查询ProcessVo
* @param processType 流程类型
* @return R<ProcessVo>
* @since mvp1.7.5
**/
public
R
<
ProcessVo
>
getProcessVoByType
(
String
processType
)
{
R
<
ProcessVo
>
processVoR
=
HttpDaprUtil
.
invokeMethodPost
(
daprProcessProperties
.
getAppUrl
(),
daprProcessProperties
.
getAppId
(),
"/tprocess/inner/getProcessVoByType"
,
processType
,
ProcessVo
.
class
,
SecurityConstants
.
FROM_IN
);
if
(
Common
.
isEmpty
(
processVoR
)){
return
R
.
failed
(
"根据流程类型查询ProcessVo失败!"
);
}
return
processVoR
;
}
/**
* 根据流程Id查询ProcessVo
* @param processId 流程ID
* @return R<ProcessVo>
* @since mvp1.7.5
**/
public
R
<
ProcessVo
>
getProcessVoById
(
String
processId
)
{
R
<
ProcessVo
>
processVoR
=
HttpDaprUtil
.
invokeMethodPost
(
daprProcessProperties
.
getAppUrl
(),
daprProcessProperties
.
getAppId
(),
"/tprocess/inner/getProcessVoByProcessId"
,
processId
,
ProcessVo
.
class
,
SecurityConstants
.
FROM_IN
);
if
(
Common
.
isEmpty
(
processVoR
)){
return
R
.
failed
(
"根据流程ID查询ProcessVo失败!"
);
}
return
processVoR
;
}
}
}
yifu-common/yifu-common-dapr/src/main/java/com/yifu/cloud/plus/v1/yifu/common/dapr/util/UpmsDaprUtils.java
View file @
cb057e5e
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
dapr
.
util
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
dapr
.
util
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.AllUserNaVo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.*
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.AreaMap
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.AreaVo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysUserListVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants
;
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.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
...
@@ -113,4 +110,12 @@ public class UpmsDaprUtils {
...
@@ -113,4 +110,12 @@ public class UpmsDaprUtils {
}
}
return
userR
;
return
userR
;
}
}
public
R
<
SysUserListVo
>
getUserByRoleIdForCrm
(
UserApprovalRoleVO
userByApprovalRole
)
{
R
<
SysUserListVo
>
allUserVoR
=
HttpDaprUtil
.
invokeMethodPost
(
daprUpmsProperties
.
getAppUrl
(),
daprUpmsProperties
.
getAppId
(),
"/user/inner/getUser/getUserByRoleIdForCrm"
,
userByApprovalRole
,
SysUserListVo
.
class
,
SecurityConstants
.
FROM_IN
);
if
(
Common
.
isEmpty
(
allUserVoR
)){
return
R
.
failed
(
"查询流程配置审批角色对应的审批人失败!"
);
}
return
allUserVoR
;
}
}
}
yifu-common/yifu-common-dapr/src/main/resources/META-INF/spring.factories
View file @
cb057e5e
...
@@ -7,4 +7,5 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
...
@@ -7,4 +7,5 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.yifu.cloud.plus.v1.yifu.common.dapr.util.InsuranceDaprUtil,\
com.yifu.cloud.plus.v1.yifu.common.dapr.util.InsuranceDaprUtil,\
com.yifu.cloud.plus.v1.yifu.common.dapr.util.SalaryDaprUtil,\
com.yifu.cloud.plus.v1.yifu.common.dapr.util.SalaryDaprUtil,\
com.yifu.cloud.plus.v1.yifu.common.dapr.util.EkpDaprUtils,\
com.yifu.cloud.plus.v1.yifu.common.dapr.util.EkpDaprUtils,\
com.yifu.cloud.plus.v1.yifu.common.dapr.util.PermissionDaprUtil
com.yifu.cloud.plus.v1.yifu.common.dapr.util.PermissionDaprUtil,\
com.yifu.cloud.plus.v1.yifu.common.dapr.util.ProcessDaprUtils
yifu-common/yifu-common-dapr/src/main/resources/daprConfig.properties
View file @
cb057e5e
...
@@ -38,10 +38,14 @@ dapr.permission.appId=yifu-permission
...
@@ -38,10 +38,14 @@ dapr.permission.appId=yifu-permission
dapr.ekp.appUrl
=
http://yifu-ekp.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
dapr.ekp.appUrl
=
http://yifu-ekp.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
dapr.ekp.appId
=
yifu-ekp
dapr.ekp.appId
=
yifu-ekp
dapr.process.appUrl
=
http://yifu-process.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
dapr.process.appId
=
yifu-process
#\u6D4B\u8BD5\u73AF\u5883-\u85AA\u8D44\u670D\u52A1
#\u6D4B\u8BD5\u73AF\u5883-\u85AA\u8D44\u670D\u52A1
#dapr.salary.appUrl=http://yifu-salary.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
#dapr.salary.appUrl=http://yifu-salary.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
#dapr.salary.appId=yifu-salary
#dapr.salary.appId=yifu-salary
#\u6D4B\u8BD5\u73AF\u5883-\u793E\u4FDD\u670D\u52A1
#\u6D4B\u8BD5\u73AF\u5883-\u793E\u4FDD\u670D\u52A1
#dapr.social.appUrl=http://yifu-social.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
#dapr.social.appUrl=http://yifu-social.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
#
dapr.social.appId
=
yifu-social
#dapr.social.appId=yifu-social
\ No newline at end of file
yifu-common/yifu-common-process/src/main/java/com/yifu/cloud/plus/v1/yifu/process/constant/ProcessConstants.java
View file @
cb057e5e
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
process
.
constant
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
process
.
constant
;
/**
/**
* @auth
er wangan
* @auth
or chenyuxi
* @
date 2020/9/17
* @
since 1.7.5
*/
*/
public
class
ProcessConstants
{
public
class
ProcessConstants
{
//审批中心各个节点类型
//审批中心各个节点类型
...
@@ -14,9 +13,6 @@ public class ProcessConstants {
...
@@ -14,9 +13,6 @@ public class ProcessConstants {
public
static
final
String
PROCESS_NODE_EMBED
=
"embed"
;
public
static
final
String
PROCESS_NODE_EMBED
=
"embed"
;
public
static
final
String
PROCESS_NODE_SERVICE
=
"service"
;
public
static
final
String
PROCESS_NODE_SERVICE
=
"service"
;
// 【含风险项目商险不购买申请流程】条件判断审批节点名称
// 【含风险项目商险不购买申请流程】条件判断审批节点名称
public
static
final
String
PROCESS_NODE_INSURANCEUNPURCHASE_REASON_TYPE
=
"是否为已购买社保"
;
public
static
final
String
PROCESS_NODE_INSURANCEUNPURCHASE_REASON_TYPE
=
"是否为已购买社保"
;
public
static
final
String
PROCESS_NODE_INSURANCEUNPURCHASE_DEPT_PROPERTY
=
"是否属于子分公司"
;
public
static
final
String
PROCESS_NODE_INSURANCEUNPURCHASE_DEPT_PROPERTY
=
"是否属于子分公司"
;
...
...
yifu-common/yifu-common-process/src/main/java/com/yifu/cloud/plus/v1/yifu/process/entity/TNodePrimission.java
View file @
cb057e5e
...
@@ -84,7 +84,7 @@ public class TNodePrimission extends Model<TNodePrimission> {
...
@@ -84,7 +84,7 @@ public class TNodePrimission extends Model<TNodePrimission> {
private
String
approvalRole
;
private
String
approvalRole
;
@Length
(
max
=
10
,
message
=
"指定事业部配置表负责人标识不能超过10个字符"
)
@Length
(
max
=
10
,
message
=
"指定事业部配置表负责人标识不能超过10个字符"
)
@Schema
(
description
=
"指定事业部配置表负责人标识"
)
@Schema
(
description
=
"指定事业部配置表负责人标识
(0事业部条线负责人;1事业部负责人;2分管副总)
"
)
private
String
divisionIdentification
;
private
String
divisionIdentification
;
@Length
(
max
=
1
,
message
=
"是否允许直接通过不能超过1个字符"
)
@Length
(
max
=
1
,
message
=
"是否允许直接通过不能超过1个字符"
)
...
...
yifu-common/yifu-common-process/src/main/java/com/yifu/cloud/plus/v1/yifu/process/util/CommonProcessUserUtil.java
View file @
cb057e5e
...
@@ -23,40 +23,4 @@ public class CommonProcessUserUtil {
...
@@ -23,40 +23,4 @@ public class CommonProcessUserUtil {
public
static
final
String
FEGIN_USER_FAIL
=
"调用用户服务失败"
;
public
static
final
String
FEGIN_USER_FAIL
=
"调用用户服务失败"
;
public
static
final
String
FEGIN_USER_RETURN_FAIL
=
"调用用户服务回失败"
;
public
static
final
String
FEGIN_USER_RETURN_FAIL
=
"调用用户服务回失败"
;
/**
* 获取crm部门审核人
* @param nodePrimission
* @param departId
* @return List<SysUser>
**/
public
static
List
<
SysUser
>
getDepartAuditUser
(
TNodePrimission
nodePrimission
,
String
departId
)
{
SysUser
remoteSysUser
=
null
;
List
<
SysUser
>
remoteSysUserList
=
new
ArrayList
<>();
if
(
CommonConstants
.
THREE_INT
==
nodePrimission
.
getType
().
intValue
())
{
//3.指定用户
if
(
Common
.
isEmpty
(
nodePrimission
.
getUser
()))
{
throw
new
CheckedException
(
"未查询当前流程权限对应的用户"
);
}
// 查找当前用户
// todo 通过用户id查询用户角色
// remoteSysUser = RemoteRequestUtil.getSysUser(remoteUserService, Integer.parseInt(nodePrimission.getUser()));
remoteSysUserList
.
add
(
remoteSysUser
);
}
else
if
(
CommonConstants
.
TWO_INT
==
nodePrimission
.
getType
().
intValue
())
{
//2.指定角色
if
(
Common
.
isEmpty
(
nodePrimission
.
getRole
()))
{
throw
new
CheckedException
(
"未查询当前流程对应的组织权限"
);
}
//如果下个节点是角色这要取下个角色是否存在
// remoteSysUser = RemoteRequestUtil.getUserManagerByRoleAndDepartId(remoteUserService, departId, nodePrimission.getRole());
remoteSysUserList
.
add
(
remoteSysUser
);
}
else
if
(
CommonConstants
.
FIVE_INT
==
nodePrimission
.
getType
().
intValue
()){
// 5.指定角色(crm)
if
(
Common
.
isEmpty
(
nodePrimission
.
getApprovalRole
()))
{
throw
new
CheckedException
(
"未查询当前节点配置的审核角色"
);
}
// remoteSysUserList = RemoteRequestUtil.getUserByRoleIdForCrm(remoteUserService, departId, nodePrimission.getApprovalRole());
}
return
remoteSysUserList
;
}
}
}
yifu-common/yifu-common-process/src/main/java/com/yifu/cloud/plus/v1/yifu/process/util/ProcessAuditUtil.java
View file @
cb057e5e
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
process
.
util
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
process
.
util
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysUserListVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.exception.CheckedException
;
import
com.yifu.cloud.plus.v1.yifu.common.core.exception.CheckedException
;
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.process.constant.ProcessConstants
;
import
com.yifu.cloud.plus.v1.yifu.process.constant.ProcessConstants
;
import
com.yifu.cloud.plus.v1.yifu.process.entity.TNodeRoute
;
import
com.yifu.cloud.plus.v1.yifu.process.entity.TNodeRoute
;
...
@@ -10,6 +12,7 @@ import com.yifu.cloud.plus.v1.yifu.process.entity.TProcessNode;
...
@@ -10,6 +12,7 @@ import com.yifu.cloud.plus.v1.yifu.process.entity.TProcessNode;
import
com.yifu.cloud.plus.v1.yifu.process.vo.ProcessVo
;
import
com.yifu.cloud.plus.v1.yifu.process.vo.ProcessVo
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Method
;
...
@@ -30,41 +33,43 @@ public class ProcessAuditUtil {
...
@@ -30,41 +33,43 @@ public class ProcessAuditUtil {
public
static
final
String
BEGIN_NODE_NO_FOUND
=
"未找到开始节点"
;
public
static
final
String
BEGIN_NODE_NO_FOUND
=
"未找到开始节点"
;
/**
* @param
* @param processId
* @Author: wangan
* @Date: 2020/9/21
* @Description: 获通过流程id, 获取流程
* @return: com.yifu.cloud.plus.v1.process.api.vo.ProcessVo
**/
public
static
ProcessVo
getProcessVo
(
String
processId
)
{
// todo 改成dapr请求
//R<ProcessVo> processVoR = remoteProcessService.getProcessVoByName(processId, SecurityConstants.FROM_IN);
R
<
ProcessVo
>
processVoR
=
new
R
<>();
if
(
processVoR
==
null
)
{
/**
throw
new
CheckedException
(
"调用流程服务返回为空"
);
* 根据流程类型查询ProcessVo
}
* @param processType 流程类型
if
(
CommonConstants
.
SUCCESS
!=
processVoR
.
getCode
())
{
* @return R<ProcessVo>
throw
new
CheckedException
(
"调用流程服务返回失败"
);
* @since mvp1.7.5
}
**/
ProcessVo
processVo
=
processVoR
.
getData
();
// public static ProcessVo getProcessVoByType(ProcessDaprUtils processDaprUtils, String processType) {
if
(
processVo
==
null
)
{
// // todo 改成dapr请求
throw
new
CheckedException
(
"调用流程服务返回数据为空"
);
// //R<ProcessVo> processVoR = remoteProcessService.getProcessVoByName(processId, SecurityConstants.FROM_IN);
}
// R<SysUserListVo> res = upmsDaprUtils.getUserIdsByUserNames(domain.getServiceTeam());
return
processVo
;
// if (Common.isNotNull(res) && Common.isNotNull(res.getData()) && Common.isNotNull(res.getData().getUserList())){
}
// // 先清理缓存
// this.removeSettleCache(null, res.getData().getUserIds());
// saveForEkp(res.getData().getUserList(), domain);
// }
// R<ProcessVo> processVoR = new R<>();
//
// if (processVoR == null) {
// throw new CheckedException("调用流程服务返回为空");
// }
// if (CommonConstants.SUCCESS != processVoR.getCode()) {
// throw new CheckedException("调用流程服务返回失败");
// }
// ProcessVo processVo = processVoR.getData();
// if (processVo == null) {
// throw new CheckedException("调用流程服务返回数据为空");
// }
// return processVo;
// }
/**
/**
* @param nodeRouteList
* 通过条件表达式判断路由的下一个节点
* @param nodeRouteList
* @param nodeRouteConditionList
* @param nodeRouteConditionList
* @param object
* @param object
* @Author: wangan
* @Date: 2020/9/17
* @Description: 条件节点:通过条件表达式判断路由的下一个节点
* @return: com.yifu.cloud.plus.v1.process.api.entity.TNodeRoute
**/
**/
public
static
TNodeRoute
getTNodeRoteByExpress
(
List
<
TNodeRoute
>
nodeRouteList
,
List
<
TNodeRouteCondition
>
nodeRouteConditionList
,
Object
object
,
Class
<?>
parameterTypes
)
{
public
static
TNodeRoute
getTNodeRoteByExpress
(
List
<
TNodeRoute
>
nodeRouteList
,
List
<
TNodeRouteCondition
>
nodeRouteConditionList
,
Object
object
,
Class
<?>
parameterTypes
)
{
TNodeRoute
matchNodeRoute
=
null
;
TNodeRoute
matchNodeRoute
=
null
;
...
@@ -149,10 +154,8 @@ public class ProcessAuditUtil {
...
@@ -149,10 +154,8 @@ public class ProcessAuditUtil {
throw
new
CheckedException
(
END_PRE_NODE_NO_FOUND
);
throw
new
CheckedException
(
END_PRE_NODE_NO_FOUND
);
}
}
return
preEndTProcessNode
;
return
preEndTProcessNode
;
}
}
/**
/**
* @param processVo
* @param processVo
* @Author: wangan
* @Author: wangan
...
@@ -164,16 +167,16 @@ public class ProcessAuditUtil {
...
@@ -164,16 +167,16 @@ public class ProcessAuditUtil {
//获取当前节点的下个节点
//获取当前节点的下个节点
List
<
TProcessNode
>
processNodeList
=
processVo
.
getProcessNodeList
();
List
<
TProcessNode
>
processNodeList
=
processVo
.
getProcessNodeList
();
//开始节点
//开始节点
TProcessNode
start
T
ProcessNode
=
null
;
TProcessNode
startProcessNode
=
null
;
for
(
TProcessNode
processNode
:
processNodeList
)
{
for
(
TProcessNode
processNode
:
processNodeList
)
{
if
(
StringUtils
.
equals
(
ProcessConstants
.
PROCESS_NODE_BEGIN
,
processNode
.
getType
()))
{
if
(
StringUtils
.
equals
(
ProcessConstants
.
PROCESS_NODE_BEGIN
,
processNode
.
getType
()))
{
startT
ProcessNode
=
processNode
;
start
ProcessNode
=
processNode
;
}
}
}
}
if
(
start
T
ProcessNode
==
null
)
{
if
(
startProcessNode
==
null
)
{
throw
new
CheckedException
(
BEGIN_NODE_NO_FOUND
);
throw
new
CheckedException
(
BEGIN_NODE_NO_FOUND
);
}
}
return
start
T
ProcessNode
;
return
startProcessNode
;
}
}
...
...
yifu-process/yifu-process-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/process/controller/TProcessApprovalConfController.java
View file @
cb057e5e
...
@@ -99,53 +99,6 @@ public class TProcessApprovalConfController {
...
@@ -99,53 +99,6 @@ public class TProcessApprovalConfController {
return
new
R
<>(
tProcessApprovalConfService
.
removeById
(
id
));
return
new
R
<>(
tProcessApprovalConfService
.
removeById
(
id
));
}
}
/**
* todo
* @param type
* @param parentId
* @Author: wangan
* @Date: 2020/12/7
* @Description: 通过类型和父类名称去获取字段名称
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<TProcessApprovalConf>
* @see com.yifu.cloud.plus.v1.process.controller
**/
@Inner
@GetMapping
(
"/inner/getRecord/byTypeAndParentId"
)
public
R
<
TProcessApprovalConf
>
getRecordbyTypeAndParentId
(
@RequestParam
(
"type"
)
String
type
,
@RequestParam
(
"parentId"
)
String
parentId
)
{
List
<
TProcessApprovalConf
>
list
=
tProcessApprovalConfService
.
list
(
Wrappers
.<
TProcessApprovalConf
>
query
().
lambda
()
.
eq
(
TProcessApprovalConf:
:
getType
,
type
)
.
eq
(
TProcessApprovalConf:
:
getParentId
,
parentId
)
.
eq
(
TProcessApprovalConf:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
));
if
(
list
.
isEmpty
())
{
return
new
R
<>(
null
);
}
return
new
R
<>(
list
.
get
(
CommonConstants
.
ZERO_INT
));
}
/**
* todo
* @param type
* @param parentId
* @Author: wangan
* @Date: 2020/12/7
* @Description: 通过相关条件获取正确的一个主流程
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<TProcessApprovalConf>
* @see com.yifu.cloud.plus.v1.process.controller
**/
@Inner
@GetMapping
(
"/inner/getRecord/byCondition"
)
public
R
<
TProcessApprovalConf
>
getRecordByCondition
(
@RequestParam
(
"type"
)
String
type
,
@RequestParam
(
"parentId"
)
String
parentId
,
@RequestParam
(
"fieldName"
)
String
fieldName
,
@RequestParam
(
"fieldValue"
)
String
fieldValue
)
{
return
tProcessApprovalConfService
.
getRecordByCondition
(
type
,
parentId
,
fieldName
,
fieldValue
);
}
/**
/**
* todo
* todo
* @param processId
* @param processId
...
...
yifu-process/yifu-process-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/process/controller/TProcessController.java
View file @
cb057e5e
...
@@ -26,7 +26,7 @@ import java.time.LocalDateTime;
...
@@ -26,7 +26,7 @@ import java.time.LocalDateTime;
/**
/**
* 主流程表
* 主流程表
*
*
* @author
hgw
* @author
chenyuxi
* @date 2020-07-16 15:44:02
* @date 2020-07-16 15:44:02
*/
*/
@RestController
@RestController
...
@@ -89,20 +89,29 @@ public class TProcessController {
...
@@ -89,20 +89,29 @@ public class TProcessController {
}
}
/**
/**
* todo
* 根据流程类型查询ProcessVo
* @param processId 流程名称
* @param processType 流程类型
* @Description: 根据流程名称查询ProcessVo
* @return R<ProcessVo>
* @Author: hgw
* @since mvp1.7.5
* @Date: 2020-7-22 18:17:29
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<ProcessVo>
**/
**/
@Operation
(
summary
=
"根据流程名称查询ProcessVo"
)
@PostMapping
(
"/inner/getProcessVoByType"
)
@PostMapping
(
"/inner/getProcessVoByName"
)
@Inner
@Inner
public
R
<
ProcessVo
>
getProcessVoByName
(
String
processId
)
{
public
ProcessVo
getProcessVoByType
(
String
processType
)
{
return
tProcessService
.
getProcessVoBy
Name
(
processId
);
return
tProcessService
.
getProcessVoBy
Type
(
processType
);
}
}
/**
* 根据流程Id查询ProcessVo
* @param processId 流程类型
* @return R<ProcessVo>
* @since mvp1.7.5
**/
@PostMapping
(
"/inner/getProcessVoByProcessId"
)
@Inner
public
ProcessVo
getProcessVoByProcessId
(
String
processId
)
{
return
tProcessService
.
getProcessVoById
(
processId
);
}
/**
/**
* 新增记录
* 新增记录
* @param processVo
* @param processVo
...
...
yifu-process/yifu-process-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/process/service/TProcessService.java
View file @
cb057e5e
...
@@ -33,14 +33,13 @@ public interface TProcessService extends IService<TProcess> {
...
@@ -33,14 +33,13 @@ public interface TProcessService extends IService<TProcess> {
**/
**/
ProcessVo
getProcessVoById
(
String
id
);
ProcessVo
getProcessVoById
(
String
id
);
/**
/**
* @param processId
* 根据流程类型查询ProcessVo
* @Description: 返回ProcessVo
* @param processType 流程类型
* @Author: hgw
*
* @Date: 2020-7-22 18:18:42
* @return R<ProcessVo>
* @return: ProcessVo
**/
**/
ProcessVo
getProcessVoByType
(
String
processType
);
R
<
ProcessVo
>
getProcessVoByName
(
String
processId
);
/**
/**
* @param processVo
* @param processVo
...
...
yifu-process/yifu-process-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/process/service/impl/TProcessServiceImpl.java
View file @
cb057e5e
...
@@ -26,6 +26,7 @@ import com.yifu.cloud.plus.v1.yifu.process.vo.DeleteProcessIdsVo;
...
@@ -26,6 +26,7 @@ import com.yifu.cloud.plus.v1.yifu.process.vo.DeleteProcessIdsVo;
import
com.yifu.cloud.plus.v1.yifu.process.vo.ProcessVo
;
import
com.yifu.cloud.plus.v1.yifu.process.vo.ProcessVo
;
import
com.yifu.cloud.plus.v1.yifu.process.vo.TProcessViewVo
;
import
com.yifu.cloud.plus.v1.yifu.process.vo.TProcessViewVo
;
import
com.yifu.cloud.plus.v1.yifu.process.service.*
;
import
com.yifu.cloud.plus.v1.yifu.process.service.*
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -44,6 +45,7 @@ import static com.yifu.cloud.plus.v1.yifu.common.core.constant.ResultConstants.F
...
@@ -44,6 +45,7 @@ import static com.yifu.cloud.plus.v1.yifu.common.core.constant.ResultConstants.F
* @date 2020-07-16 15:44:02
* @date 2020-07-16 15:44:02
*/
*/
@Service
@Service
@Slf4j
public
class
TProcessServiceImpl
extends
ServiceImpl
<
TProcessMapper
,
TProcess
>
implements
TProcessService
{
public
class
TProcessServiceImpl
extends
ServiceImpl
<
TProcessMapper
,
TProcess
>
implements
TProcessService
{
@Resource
@Resource
...
@@ -230,76 +232,67 @@ public class TProcessServiceImpl extends ServiceImpl<TProcessMapper, TProcess> i
...
@@ -230,76 +232,67 @@ public class TProcessServiceImpl extends ServiceImpl<TProcessMapper, TProcess> i
return
processVo
;
return
processVo
;
}
}
/**
/**
* @param processId
* 根据流程类型查询ProcessVo
* @Description: 获取包装类
* @param processType 流程类型
* @Author: hgw
* @return R<ProcessVo>
* @Date: 2020/7/17 11:05
* @since mvp1.7.5
* @return: ProcessVo
**/
**/
@Override
@Override
public
R
<
ProcessVo
>
getProcessVoByName
(
String
processId
)
{
public
ProcessVo
getProcessVoByType
(
String
processType
)
{
// 主流程表
TProcessApprovalConf
approvalConf
=
processApprovalConfService
.
getOne
(
Wrappers
.<
TProcessApprovalConf
>
query
().
lambda
()
.
eq
(
TProcessApprovalConf:
:
getType
,
processType
)
.
eq
(
TProcessApprovalConf:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
).
last
(
CommonConstants
.
SQL_LIMIT_ONE
));
if
(
Common
.
isEmpty
(
approvalConf
)){
log
.
error
(
"根据类型获取流程配置失败>>processType={}"
,
processType
);
return
null
;
}
// 获取主流程信息
ProcessVo
processVo
=
new
ProcessVo
();
ProcessVo
processVo
=
new
ProcessVo
();
TProcess
process
=
this
.
getById
(
processId
);
TProcess
process
=
this
.
getById
(
approvalConf
.
getProcessId
());
if
(
process
==
null
)
{
if
(
Common
.
isEmpty
(
process
))
{
return
R
.
failed
(
"获取流程失败"
);
log
.
error
(
"获取主流程信息失败>>processId={}"
,
approvalConf
.
getProcessId
());
return
null
;
}
}
String
processId
=
process
.
getId
();
processVo
.
setProcessId
(
processId
);
processVo
.
setProcessId
(
processId
);
processVo
.
setName
(
process
.
getName
());
processVo
.
setName
(
process
.
getName
());
// 节点
TProcessNode
processNode
=
new
TProcessNode
();
// 获取节点列表信息
processNode
.
setProcessId
(
processId
);
List
<
TProcessNode
>
processNodeList
=
processNodeService
.
list
(
Wrappers
.<
TProcessNode
>
query
().
lambda
()
// 节点查询
.
eq
(
TProcessNode:
:
getProcessId
,
processId
));
QueryWrapper
<
TProcessNode
>
queryWrapperPn
=
new
QueryWrapper
<>();
if
(
Common
.
isNotNull
(
processNodeList
))
{
queryWrapperPn
.
setEntity
(
processNode
);
// 定义审批用户列表
// 节点列表
List
<
TProcessNode
>
processNodeList
=
processNodeService
.
list
(
queryWrapperPn
);
if
(
processNodeList
!=
null
&&
!
processNodeList
.
isEmpty
())
{
// 权限
TNodePrimission
nodePrimission
;
// 权限查询
QueryWrapper
<
TNodePrimission
>
queryWrapperNp
;
// 权限列表
List
<
TNodePrimission
>
nodePrimissionList
;
List
<
TNodePrimission
>
nodePrimissionList
;
// 抄送
// 定义抄送用户列表
TNodeReaderPromission
nodeReaderPromission
;
// 抄送查询
QueryWrapper
<
TNodeReaderPromission
>
queryWrapperNrp
;
// 抄送列表
List
<
TNodeReaderPromission
>
nodeReaderPromissionList
;
List
<
TNodeReaderPromission
>
nodeReaderPromissionList
;
for
(
TProcessNode
proNode
:
processNodeList
)
{
nodePrimission
=
new
TNodePrimission
();
nodePrimission
.
setNodeId
(
proNode
.
getId
());
queryWrapperNp
=
new
QueryWrapper
<>();
queryWrapperNp
.
setEntity
(
nodePrimission
);
nodePrimissionList
=
nodePrimissionService
.
list
(
queryWrapperNp
);
proNode
.
setNodePrimissionList
(
nodePrimissionList
);
nodeReaderPromission
=
new
TNodeReaderPromission
();
nodeReaderPromission
.
setNodeId
(
proNode
.
getId
());
queryWrapperNrp
=
new
QueryWrapper
<>();
queryWrapperNrp
.
setEntity
(
nodeReaderPromission
);
nodeReaderPromissionList
=
nodeReaderPromissionService
.
list
(
queryWrapperNrp
);
proNode
.
setNodeReaderPromissionList
(
nodeReaderPromissionList
);
//子流程
proNode
.
setNodeTransferConfigs
(
nodeTransferConfigService
.
list
(
Wrappers
.<
TNodeTransferConfig
>
query
().
lambda
().
eq
(
TNodeTransferConfig:
:
getNodeId
,
proNode
.
getId
())));
for
(
TProcessNode
nodeInfo
:
processNodeList
)
{
// 赋值审批用户列表
nodePrimissionList
=
nodePrimissionService
.
list
(
Wrappers
.<
TNodePrimission
>
query
().
lambda
()
.
eq
(
TNodePrimission:
:
getNodeId
,
nodeInfo
.
getId
()));
nodeInfo
.
setNodePrimissionList
(
nodePrimissionList
);
// 赋值抄送用户列表
nodeReaderPromissionList
=
nodeReaderPromissionService
.
list
(
Wrappers
.<
TNodeReaderPromission
>
query
().
lambda
()
.
eq
(
TNodeReaderPromission:
:
getNodeId
,
nodeInfo
.
getId
()));
nodeInfo
.
setNodeReaderPromissionList
(
nodeReaderPromissionList
);
}
}
}
}
processVo
.
setProcessNodeList
(
processNodeList
);
processVo
.
setProcessNodeList
(
processNodeList
);
// 路由
TNodeRoute
nodeRoute
=
new
TNodeRoute
();
nodeRoute
.
setProcessId
(
processId
);
// 路由查询
QueryWrapper
<
TNodeRoute
>
queryWrapperNr
=
new
QueryWrapper
<>();
queryWrapperNr
.
setEntity
(
nodeRoute
);
// 路由列表
// 路由列表
List
<
TNodeRoute
>
nodeRouteList
=
nodeRouteService
.
list
(
queryWrapperNr
);
List
<
TNodeRoute
>
nodeRouteList
=
nodeRouteService
.
list
(
Wrappers
.<
TNodeRoute
>
query
().
lambda
()
for
(
TNodeRoute
tNodeRoute
:
nodeRouteList
)
{
tNodeRoute
.
setNodeRouteConditionList
(
nodeRouteConditionService
.
list
(
Wrappers
.<
TNodeRouteCondition
>
query
().
lambda
().
eq
(
TNodeRouteCondition:
:
getNodeRouteId
,
tNodeRoute
.
getId
())));
.
eq
(
TNodeRoute:
:
getProcessId
,
processId
));
}
// 路由条件判断列表
processVo
.
setNodeRouteList
(
nodeRouteList
);
if
(
Common
.
isNotNull
(
nodeRouteList
))
{
return
new
R
<>(
processVo
);
List
<
TNodeRouteCondition
>
nodeRouteConditionList
;
for
(
TNodeRoute
tNodeRoute
:
nodeRouteList
)
{
nodeRouteConditionList
=
nodeRouteConditionService
.
list
(
Wrappers
.<
TNodeRouteCondition
>
query
().
lambda
().
eq
(
TNodeRouteCondition:
:
getNodeRouteId
,
tNodeRoute
.
getId
()));
tNodeRoute
.
setNodeRouteConditionList
(
nodeRouteConditionList
);
}
processVo
.
setNodeRouteList
(
nodeRouteList
);
}
return
processVo
;
}
}
/**
/**
...
...
yifu-salary/yifu-salary-api/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/entity/TAuditNodePro
o
cess.java
→
yifu-salary/yifu-salary-api/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/entity/TAuditNodeProcess.java
View file @
cb057e5e
...
@@ -21,10 +21,10 @@ import java.time.LocalDateTime;
...
@@ -21,10 +21,10 @@ import java.time.LocalDateTime;
* @since 1.7.5
* @since 1.7.5
*/
*/
@Data
@Data
@TableName
(
"t_audit_node_pro
o
cess"
)
@TableName
(
"t_audit_node_process"
)
@EqualsAndHashCode
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@Schema
(
description
=
"审批主流程记录表节点表"
)
@Schema
(
description
=
"审批主流程记录表节点表"
)
public
class
TAuditNodePro
o
cess
extends
BaseEntity
{
public
class
TAuditNodeProcess
extends
BaseEntity
{
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
@Schema
(
description
=
"主键"
)
@Schema
(
description
=
"主键"
)
...
...
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/config/WxConfig.java
0 → 100644
View file @
cb057e5e
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
salary
.
config
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.gson.Gson
;
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.SecurityConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.exception.CheckedException
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
lombok.Data
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.security.authentication.AuthenticationServiceException
;
import
org.springframework.web.client.RestTemplate
;
import
java.util.Map
;
import
java.util.concurrent.TimeUnit
;
/**
* @Author: huyc
* @Date: 2023/7/28
* @Description:
* @return: 企业微信配置
**/
@Configuration
@Data
@Slf4j
public
class
WxConfig
{
@Value
(
"${wx.corpid}"
)
private
String
corpid
;
@Value
(
"${wx.corpsecret}"
)
private
String
corpsecret
;
@Value
(
"${wx.agentid}"
)
private
String
agentid
;
@Value
(
"${wx.authUrl}"
)
private
String
authUrl
;
@Autowired
private
RedisTemplate
redisTemplate
;
//未授权
private
String
accossTokenInvliad
=
"40014"
;
/**
* @param
* @Author: huyc
* @Date: 2023/7/28
* @Description: 获取微信accos_token
* @return: java.lang.String
**/
public
String
getAccessToken
(
RestTemplate
restTemplate
)
{
if
(
Common
.
isNotNull
(
agentid
))
{
return
this
.
getToken
(
restTemplate
,
CacheConstants
.
WX_ACCOSS_TOKEN
.
concat
(
agentid
),
corpsecret
);
}
return
this
.
getToken
(
restTemplate
,
CacheConstants
.
WX_ACCOSS_TOKEN
,
corpsecret
);
}
public
String
getAccessToken
(
RestTemplate
restTemplate
,
String
corpsecret
)
throws
AuthenticationServiceException
{
if
(
Common
.
isEmpty
(
corpsecret
)){
throw
new
AuthenticationServiceException
(
"未找到对应的corpsecret请联系管理员配置"
);
}
return
this
.
getToken
(
restTemplate
,
CacheConstants
.
WX_ACCOSS_TOKEN
.
concat
(
agentid
),
corpsecret
);
}
/**
* @param restTemplate
* @param tokenKey
* @param corpsecretKey
* @Description: 获取token
* @Author: huyc
* @Date: 2023/7/28 14:46
* @return: java.lang.String
**/
public
String
getToken
(
RestTemplate
restTemplate
,
String
tokenKey
,
String
corpsecretKey
)
{
Object
wxToken
=
redisTemplate
.
opsForValue
().
get
(
tokenKey
);
if
(
null
!=
wxToken
)
{
return
String
.
valueOf
(
wxToken
);
}
String
requestTokenUrl
=
String
.
format
(
SecurityConstants
.
WX_GET_ACCOSS_TOKEN
,
corpid
,
corpsecretKey
);
String
result
=
restTemplate
.
getForObject
(
requestTokenUrl
,
String
.
class
);
if
(
Common
.
isEmpty
(
result
))
{
throw
new
CheckedException
(
"微信授权失败"
);
}
String
token
=
JSON
.
parseObject
(
result
).
getString
(
"access_token"
);
if
(
Common
.
isEmpty
(
token
))
{
log
.
info
(
result
);
throw
new
CheckedException
(
"获取微信token失败"
);
}
redisTemplate
.
opsForValue
().
set
(
tokenKey
,
token
);
redisTemplate
.
expire
(
tokenKey
,
3600
,
TimeUnit
.
SECONDS
);
return
token
;
}
/**
* @param
* @Author: huyc
* @Date: 2023/7/28 14:43
* @Description: 移除微信accossToken
* @return: java.lang.String
**/
public
void
removeAccessToken
()
{
redisTemplate
.
delete
(
CacheConstants
.
WX_ACCOSS_TOKEN
);
}
/**
* @param restTemplate
* @param requestMap 请求内容
* @Author: huyc
* @Date: 2023/7/28 14:48
* @Description: 发送卡片消息
* @return: java.lang.String
**/
public
boolean
sendTextCard
(
RestTemplate
restTemplate
,
Map
<
String
,
Object
>
requestMap
)
{
// 必须加上header说明
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
setContentType
(
MediaType
.
APPLICATION_JSON_UTF8
);
Gson
gson
=
new
Gson
();
log
.
info
(
gson
.
toJson
(
requestMap
));
HttpEntity
<
String
>
requestEntity
=
new
HttpEntity
<>(
gson
.
toJson
(
requestMap
),
headers
);
String
accessToken
=
getAccessToken
(
restTemplate
);
ResponseEntity
<
String
>
responseEntity
=
restTemplate
.
postForEntity
(
String
.
format
(
SecurityConstants
.
WX_SEND_MESSAGE
,
accessToken
),
requestEntity
,
String
.
class
);
log
.
info
(
JSON
.
toJSONString
(
responseEntity
));
JSONObject
jsonObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
responseEntity
));
JSONObject
jsonBody
=
jsonObject
.
getJSONObject
(
"body"
);
if
(
jsonBody
!=
null
)
{
String
errcode
=
jsonBody
.
getString
(
"errcode"
);
if
(
accossTokenInvliad
.
equals
(
errcode
))
{
//删除accossToken缓存
removeAccessToken
();
return
false
;
}
if
(!
CommonConstants
.
ZERO_STRING
.
equals
(
errcode
))
{
//非正常,则打印错误日志
log
.
info
(
jsonObject
.
toJSONString
());
}
}
else
{
log
.
info
(
jsonObject
.
toJSONString
());
}
return
true
;
}
/**
* @param restTemplate
* @param requestMap 请求内容
* @Author: huyc
* @Date: 2023/7/28 14:50
* @Description: 发送卡片消息
* @return: java.lang.String
**/
public
boolean
sendAppTextCard
(
RestTemplate
restTemplate
,
Map
<
String
,
Object
>
requestMap
)
{
// 必须加上header说明
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
setContentType
(
MediaType
.
APPLICATION_JSON_UTF8
);
Gson
gson
=
new
Gson
();
log
.
info
(
"发企业微信===请求:{}"
,
gson
.
toJson
(
requestMap
));
HttpEntity
<
String
>
requestEntity
=
new
HttpEntity
<>(
gson
.
toJson
(
requestMap
),
headers
);
String
accessToken
=
getAppAccessToken
(
restTemplate
);
ResponseEntity
<
String
>
responseEntity
=
restTemplate
.
postForEntity
(
String
.
format
(
SecurityConstants
.
WX_SEND_MESSAGE
,
accessToken
),
requestEntity
,
String
.
class
);
log
.
info
(
"发企业微信===返回:{}"
,
JSON
.
toJSONString
(
responseEntity
));
JSONObject
jsonObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
responseEntity
));
JSONObject
jsonBody
=
jsonObject
.
getJSONObject
(
"body"
);
if
(
jsonBody
!=
null
)
{
String
errcode
=
jsonBody
.
getString
(
"errcode"
);
if
(
accossTokenInvliad
.
equals
(
errcode
))
{
//删除accossToken缓存
removeAccessToken
();
return
false
;
}
if
(!
CommonConstants
.
ZERO_STRING
.
equals
(
errcode
))
{
//非正常,则打印错误日志
log
.
info
(
jsonObject
.
toJSONString
());
}
}
else
{
log
.
info
(
jsonObject
.
toJSONString
());
}
return
true
;
}
/**
* 功能描述: 获取微信accos_token
* @Author: huyc
* @Date: 2023/7/28 14:50
* @return: java.lang.String
*/
public
String
getAppAccessToken
(
RestTemplate
restTemplate
)
{
return
this
.
getToken
(
restTemplate
,
CacheConstants
.
WX_ACCOSS_TOKEN
,
corpsecret
);
}
}
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/controller/TAuditNodeProocessController.java
View file @
cb057e5e
...
@@ -2,8 +2,8 @@ package com.yifu.cloud.plus.v1.yifu.salary.controller;
...
@@ -2,8 +2,8 @@ package com.yifu.cloud.plus.v1.yifu.salary.controller;
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
com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditNodePro
o
cess
;
import
com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditNodeProcess
;
import
com.yifu.cloud.plus.v1.yifu.salary.service.TAuditNodePro
o
cessService
;
import
com.yifu.cloud.plus.v1.yifu.salary.service.TAuditNodeProcessService
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
...
@@ -24,7 +24,7 @@ import org.springframework.web.bind.annotation.*;
...
@@ -24,7 +24,7 @@ import org.springframework.web.bind.annotation.*;
@Tag
(
name
=
"审批主流程记录表节点表管理"
)
@Tag
(
name
=
"审批主流程记录表节点表管理"
)
public
class
TAuditNodeProocessController
{
public
class
TAuditNodeProocessController
{
private
final
TAuditNodeProocessService
tAuditNodePro
ocessService
;
private
final
TAuditNodeProcessService
tAuditNodePr
ocessService
;
/**
/**
* 通过id查询审批主流程记录表节点表
* 通过id查询审批主流程记录表节点表
...
@@ -34,34 +34,34 @@ public class TAuditNodeProocessController {
...
@@ -34,34 +34,34 @@ public class TAuditNodeProocessController {
@Operation
(
summary
=
"通过id查询"
,
description
=
"通过id查询:hasPermission('insurances_tauditnodeproocess_get')"
)
@Operation
(
summary
=
"通过id查询"
,
description
=
"通过id查询:hasPermission('insurances_tauditnodeproocess_get')"
)
@GetMapping
(
"/{id}"
)
@GetMapping
(
"/{id}"
)
@PreAuthorize
(
"@pms.hasPermission('insurances_tauditnodeproocess_get')"
)
@PreAuthorize
(
"@pms.hasPermission('insurances_tauditnodeproocess_get')"
)
public
R
<
TAuditNodePro
o
cess
>
getById
(
@PathVariable
(
"id"
)
String
id
)
{
public
R
<
TAuditNodeProcess
>
getById
(
@PathVariable
(
"id"
)
String
id
)
{
return
R
.
ok
(
tAuditNodePro
o
cessService
.
getById
(
id
));
return
R
.
ok
(
tAuditNodeProcessService
.
getById
(
id
));
}
}
/**
/**
* 新增审批主流程记录表节点表
* 新增审批主流程记录表节点表
* @param tAuditNodePro
o
cess 审批主流程记录表节点表
* @param tAuditNodeProcess 审批主流程记录表节点表
* @return R
* @return R
*/
*/
@Operation
(
summary
=
"新增审批主流程记录表节点表"
,
description
=
"新增审批主流程记录表节点表:hasPermission('insurances_tauditnodeproocess_add')"
)
@Operation
(
summary
=
"新增审批主流程记录表节点表"
,
description
=
"新增审批主流程记录表节点表:hasPermission('insurances_tauditnodeproocess_add')"
)
@SysLog
(
"新增审批主流程记录表节点表"
)
@SysLog
(
"新增审批主流程记录表节点表"
)
@PostMapping
@PostMapping
@PreAuthorize
(
"@pms.hasPermission('insurances_tauditnodeproocess_add')"
)
@PreAuthorize
(
"@pms.hasPermission('insurances_tauditnodeproocess_add')"
)
public
R
<
Boolean
>
save
(
@RequestBody
TAuditNodePro
ocess
tAuditNodePro
ocess
)
{
public
R
<
Boolean
>
save
(
@RequestBody
TAuditNodePro
cess
tAuditNodePr
ocess
)
{
return
R
.
ok
(
tAuditNodePro
ocessService
.
save
(
tAuditNodePro
ocess
));
return
R
.
ok
(
tAuditNodePro
cessService
.
save
(
tAuditNodePr
ocess
));
}
}
/**
/**
* 修改审批主流程记录表节点表
* 修改审批主流程记录表节点表
* @param tAuditNodePro
o
cess 审批主流程记录表节点表
* @param tAuditNodeProcess 审批主流程记录表节点表
* @return R
* @return R
*/
*/
@Operation
(
summary
=
"修改审批主流程记录表节点表"
,
description
=
"修改审批主流程记录表节点表:hasPermission('insurances_tauditnodeproocess_edit')"
)
@Operation
(
summary
=
"修改审批主流程记录表节点表"
,
description
=
"修改审批主流程记录表节点表:hasPermission('insurances_tauditnodeproocess_edit')"
)
@SysLog
(
"修改审批主流程记录表节点表"
)
@SysLog
(
"修改审批主流程记录表节点表"
)
@PutMapping
@PutMapping
@PreAuthorize
(
"@pms.hasPermission('insurances_tauditnodeproocess_edit')"
)
@PreAuthorize
(
"@pms.hasPermission('insurances_tauditnodeproocess_edit')"
)
public
R
<
Boolean
>
updateById
(
@RequestBody
TAuditNodePro
ocess
tAuditNodePro
ocess
)
{
public
R
<
Boolean
>
updateById
(
@RequestBody
TAuditNodePro
cess
tAuditNodePr
ocess
)
{
return
R
.
ok
(
tAuditNodePro
ocessService
.
updateById
(
tAuditNodePro
ocess
));
return
R
.
ok
(
tAuditNodePro
cessService
.
updateById
(
tAuditNodePr
ocess
));
}
}
/**
/**
...
@@ -74,7 +74,7 @@ public class TAuditNodeProocessController {
...
@@ -74,7 +74,7 @@ public class TAuditNodeProocessController {
@DeleteMapping
(
"/{id}"
)
@DeleteMapping
(
"/{id}"
)
@PreAuthorize
(
"@pms.hasPermission('insurances_tauditnodeproocess_del')"
)
@PreAuthorize
(
"@pms.hasPermission('insurances_tauditnodeproocess_del')"
)
public
R
<
Boolean
>
removeById
(
@PathVariable
String
id
)
{
public
R
<
Boolean
>
removeById
(
@PathVariable
String
id
)
{
return
R
.
ok
(
tAuditNodePro
o
cessService
.
removeById
(
id
));
return
R
.
ok
(
tAuditNodeProcessService
.
removeById
(
id
));
}
}
}
}
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/mapper/TAuditNodePro
o
cessMapper.java
→
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/mapper/TAuditNodeProcessMapper.java
View file @
cb057e5e
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
salary
.
mapper
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
salary
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditNodePro
o
cess
;
import
com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditNodeProcess
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
/**
/**
...
@@ -12,5 +12,5 @@ import org.apache.ibatis.annotations.Mapper;
...
@@ -12,5 +12,5 @@ import org.apache.ibatis.annotations.Mapper;
* @since 1.7.5
* @since 1.7.5
*/
*/
@Mapper
@Mapper
public
interface
TAuditNodePro
ocessMapper
extends
BaseMapper
<
TAuditNodePro
ocess
>
{
public
interface
TAuditNodePro
cessMapper
extends
BaseMapper
<
TAuditNodePr
ocess
>
{
}
}
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/TAuditNodePro
o
cessService.java
→
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/TAuditNodeProcessService.java
View file @
cb057e5e
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
salary
.
service
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
salary
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditNodePro
o
cess
;
import
com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditNodeProcess
;
/**
/**
* 审批主流程记录表节点表
* 审批主流程记录表节点表
...
@@ -10,6 +10,6 @@ import com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditNodeProocess;
...
@@ -10,6 +10,6 @@ import com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditNodeProocess;
* @date 2025-01-10 17:47:32
* @date 2025-01-10 17:47:32
* @since 1.7.5
* @since 1.7.5
*/
*/
public
interface
TAuditNodePro
ocessService
extends
IService
<
TAuditNodePro
ocess
>
{
public
interface
TAuditNodePro
cessService
extends
IService
<
TAuditNodePr
ocess
>
{
}
}
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/AbastractAuditProcess.java
View file @
cb057e5e
This diff is collapsed.
Click to expand it.
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TAuditNodePro
o
cessServiceImpl.java
→
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TAuditNodeProcessServiceImpl.java
View file @
cb057e5e
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
salary
.
service
.
impl
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
salary
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditNodePro
o
cess
;
import
com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditNodeProcess
;
import
com.yifu.cloud.plus.v1.yifu.salary.mapper.TAuditNodePro
o
cessMapper
;
import
com.yifu.cloud.plus.v1.yifu.salary.mapper.TAuditNodeProcessMapper
;
import
com.yifu.cloud.plus.v1.yifu.salary.service.TAuditNodePro
o
cessService
;
import
com.yifu.cloud.plus.v1.yifu.salary.service.TAuditNodeProcessService
;
import
lombok.extern.log4j.Log4j2
;
import
lombok.extern.log4j.Log4j2
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -16,6 +16,6 @@ import org.springframework.stereotype.Service;
...
@@ -16,6 +16,6 @@ import org.springframework.stereotype.Service;
*/
*/
@Log4j2
@Log4j2
@Service
@Service
public
class
TAuditNodePro
ocessServiceImpl
extends
ServiceImpl
<
TAuditNodeProocessMapper
,
TAuditNodeProocess
>
implements
TAuditNodePro
ocessService
{
public
class
TAuditNodePro
cessServiceImpl
extends
ServiceImpl
<
TAuditNodeProcessMapper
,
TAuditNodeProcess
>
implements
TAuditNodePr
ocessService
{
}
}
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TInsuranceUnpurchaseApplyServiceImpl.java
View file @
cb057e5e
...
@@ -8,9 +8,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
...
@@ -8,9 +8,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
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.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
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.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ResultConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ResultConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.exception.CheckedException
;
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.DateUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil
;
...
@@ -500,7 +502,7 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
...
@@ -500,7 +502,7 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
if
(
entity
==
null
){
if
(
entity
==
null
){
return
R
.
failed
(
ResultConstants
.
FAIL_INFO_NO_MODEL
);
return
R
.
failed
(
ResultConstants
.
FAIL_INFO_NO_MODEL
);
}
}
if
(!
StringUtils
.
equals
(
entity
.
getStatus
(),
CommonConstants
.
ONE_STRING
)){
if
(!
CommonConstants
.
ONE_STRING
.
equals
(
entity
.
getStatus
()
)){
return
R
.
failed
(
"当前记录不为待提交状态"
);
return
R
.
failed
(
"当前记录不为待提交状态"
);
}
}
String
[]
reasonType
=
{
"1"
,
"2"
};
String
[]
reasonType
=
{
"1"
,
"2"
};
...
@@ -518,12 +520,29 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
...
@@ -518,12 +520,29 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
if
(
Common
.
isEmpty
(
entity
.
getCreateUserDeptId
())){
if
(
Common
.
isEmpty
(
entity
.
getCreateUserDeptId
())){
return
R
.
failed
(
"申请人所属部门id不能为空"
);
return
R
.
failed
(
"申请人所属部门id不能为空"
);
}
}
// 传流程类型 1不购买商险申请,审核类型 0不购买商险审核
// 传:流程类型 1不购买商险申请;审核类型 0不购买商险审核
// R<List<SysUser>> auditUserListR = tInsuranceUnpurchaseApplyAuditProcess.commitAuditUserList(id, user, entity.getCreateUserDeptId(), CommonConstants.ONE_STRING, CommonConstants.ZERO_STRING,
R
<
List
<
SysUser
>>
auditUserListR
=
tInsuranceUnpurchaseApplyAuditProcess
.
getAuditUserList
(
id
,
user
,
entity
.
getCreateUserDeptId
(),
// "",entity.getApplyNo(),entity,TInsuranceUnpurchaseApply.class);
CommonConstants
.
ONE_STRING
,
CommonConstants
.
ZERO_STRING
,
// if (auditUserListR == null || auditUserListR.getCode() != CommonConstants.SUCCESS || auditUserListR.getData() == null) {
""
,
entity
.
getApplyNo
(),
entity
,
TInsuranceUnpurchaseApply
.
class
);
// throw new CheckedException("获取审批人失败,请联系管理员");
if
(
auditUserListR
==
null
||
auditUserListR
.
getCode
()
!=
CommonConstants
.
SUCCESS
||
auditUserListR
.
getData
()
==
null
)
{
// }
throw
new
CheckedException
(
"获取审批人失败,请联系管理员"
);
}
// 存即将审批人的信息
String
auditUserNameStrs
=
""
;
String
auditUserIdStrs
=
""
;
for
(
SysUser
userInfo
:
auditUserListR
.
getData
()){
auditUserIdStrs
=
auditUserIdStrs
.
concat
(
";"
).
concat
(
userInfo
.
getUserId
());
auditUserNameStrs
=
auditUserNameStrs
.
concat
(
";"
).
concat
(
userInfo
.
getNickname
());
}
if
(
Common
.
isNotNull
(
auditUserNameStrs
)){
auditUserNameStrs
=
auditUserNameStrs
.
substring
(
1
);
}
if
(
Common
.
isNotNull
(
auditUserIdStrs
)){
auditUserIdStrs
=
auditUserIdStrs
.
substring
(
1
);
}
entity
.
setAuditUser
(
auditUserNameStrs
);
entity
.
setAuditUserId
(
auditUserIdStrs
);
entity
.
setStatus
(
CommonConstants
.
TWO_STRING
);
entity
.
setStatus
(
CommonConstants
.
TWO_STRING
);
this
.
updateById
(
entity
);
this
.
updateById
(
entity
);
return
R
.
ok
(
null
,
"提交成功"
);
return
R
.
ok
(
null
,
"提交成功"
);
...
@@ -532,9 +551,8 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
...
@@ -532,9 +551,8 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
@Override
@Override
@Transactional
@Transactional
public
R
<
String
>
auditAndCommit
(
TInsuranceUnpurchaseApply
insuranceUnpurchaseApply
,
String
approvalResult
,
String
approvalOpinion
,
YifuUser
user
)
{
public
R
<
String
>
auditAndCommit
(
TInsuranceUnpurchaseApply
insuranceUnpurchaseApply
,
String
approvalResult
,
String
approvalOpinion
,
YifuUser
user
)
{
return
R
.
ok
(
"审核完毕"
);
return
tInsuranceUnpurchaseApplyAuditProcess
.
auditUserList
(
insuranceUnpurchaseApply
.
getId
(),
approvalResult
,
approvalOpinion
,
user
,
CommonConstants
.
ZERO_STRING
,
// return tInsuranceUnpurchaseApplyAuditProcess.auditUserList(insuranceUnpurchaseApply.getId(), approvalResult, approvalOpinion, user, CommonConstants.ZERO_STRING,
insuranceUnpurchaseApply
,
insuranceUnpurchaseApply
.
getCreateUserDeptId
());
// insuranceUnpurchaseApply, insuranceUnpurchaseApply.getCreateUserDeptId());
}
}
}
}
yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/process/TInsuranceUnpurchaseApplyAuditProcess.java
View file @
cb057e5e
This diff is collapsed.
Click to expand it.
yifu-salary/yifu-salary-biz/src/main/resources/application-test.yml
View file @
cb057e5e
...
@@ -25,4 +25,10 @@ spring:
...
@@ -25,4 +25,10 @@ spring:
idle-timeout
:
60000
# 空闲连接存活最大时间,默认600000(10分钟)
idle-timeout
:
60000
# 空闲连接存活最大时间,默认600000(10分钟)
maximum-pool-size
:
12
# 连接池最大连接数,默认是10
maximum-pool-size
:
12
# 连接池最大连接数,默认是10
auto-commit
:
true
#此属性控制从池返回的连接的默认自动提交行为,默认值:true
auto-commit
:
true
#此属性控制从池返回的连接的默认自动提交行为,默认值:true
max-lifetime
:
0
#此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟
max-lifetime
:
0
#此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟
\ No newline at end of file
wx
:
corpid
:
wwbcb090af0dfe50e5
corpsecret
:
16kqEL_eU-ARwYyqLgEBWHgxm8gXVnkzv_eJMLy9NpU
agentid
:
1000010
authUrl
:
https://test-worfu.com/yifu-auth/method/oauth/wxLogin
yifu-salary/yifu-salary-biz/src/main/resources/mapper/TAuditNodePro
o
cessMapper.xml
→
yifu-salary/yifu-salary-biz/src/main/resources/mapper/TAuditNodeProcessMapper.xml
View file @
cb057e5e
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yifu.cloud.plus.v1.yifu.salary.mapper.TAuditNodePro
o
cessMapper"
>
<mapper
namespace=
"com.yifu.cloud.plus.v1.yifu.salary.mapper.TAuditNodeProcessMapper"
>
<resultMap
id=
"tAuditNodePro
ocessMap"
type=
"com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditNodePro
ocess"
>
<resultMap
id=
"tAuditNodePro
cessMap"
type=
"com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditNodePr
ocess"
>
<id
property=
"id"
column=
"id"
/>
<id
property=
"id"
column=
"id"
/>
<result
property=
"processId"
column=
"process_id"
/>
<result
property=
"processId"
column=
"process_id"
/>
<result
property=
"nodeId"
column=
"node_id"
/>
<result
property=
"nodeId"
column=
"node_id"
/>
...
@@ -43,61 +43,61 @@
...
@@ -43,61 +43,61 @@
a.add_sign_approval_man,
a.add_sign_approval_man,
a.add_sign_approval_man_name
a.add_sign_approval_man_name
</sql>
</sql>
<sql
id=
"tAuditNodePro
o
cess_where"
>
<sql
id=
"tAuditNodeProcess_where"
>
<if
test=
"tAuditNodePro
o
cess != null"
>
<if
test=
"tAuditNodeProcess != null"
>
<if
test=
"tAuditNodePro
ocess.id != null and tAuditNodePro
ocess.id.trim() != ''"
>
<if
test=
"tAuditNodePro
cess.id != null and tAuditNodePr
ocess.id.trim() != ''"
>
AND a.id = #{tAuditNodePro
o
cess.id}
AND a.id = #{tAuditNodeProcess.id}
</if>
</if>
<if
test=
"tAuditNodePro
ocess.processId != null and tAuditNodePro
ocess.processId.trim() != ''"
>
<if
test=
"tAuditNodePro
cess.processId != null and tAuditNodePr
ocess.processId.trim() != ''"
>
AND a.process_id = #{tAuditNodePro
o
cess.processId}
AND a.process_id = #{tAuditNodeProcess.processId}
</if>
</if>
<if
test=
"tAuditNodePro
ocess.nodeId != null and tAuditNodePro
ocess.nodeId.trim() != ''"
>
<if
test=
"tAuditNodePro
cess.nodeId != null and tAuditNodePr
ocess.nodeId.trim() != ''"
>
AND a.node_id = #{tAuditNodePro
o
cess.nodeId}
AND a.node_id = #{tAuditNodeProcess.nodeId}
</if>
</if>
<if
test=
"tAuditNodePro
ocess.nodeType != null and tAuditNodePro
ocess.nodeType.trim() != ''"
>
<if
test=
"tAuditNodePro
cess.nodeType != null and tAuditNodePr
ocess.nodeType.trim() != ''"
>
AND a.node_type = #{tAuditNodePro
o
cess.nodeType}
AND a.node_type = #{tAuditNodeProcess.nodeType}
</if>
</if>
<if
test=
"tAuditNodePro
o
cess.createTime != null"
>
<if
test=
"tAuditNodeProcess.createTime != null"
>
AND a.create_time = #{tAuditNodePro
o
cess.createTime}
AND a.create_time = #{tAuditNodeProcess.createTime}
</if>
</if>
<if
test=
"tAuditNodePro
ocess.domainId != null and tAuditNodePro
ocess.domainId.trim() != ''"
>
<if
test=
"tAuditNodePro
cess.domainId != null and tAuditNodePr
ocess.domainId.trim() != ''"
>
AND a.domain_id = #{tAuditNodePro
o
cess.domainId}
AND a.domain_id = #{tAuditNodeProcess.domainId}
</if>
</if>
<if
test=
"tAuditNodePro
ocess.mainType != null and tAuditNodePro
ocess.mainType.trim() != ''"
>
<if
test=
"tAuditNodePro
cess.mainType != null and tAuditNodePr
ocess.mainType.trim() != ''"
>
AND a.main_type = #{tAuditNodePro
o
cess.mainType}
AND a.main_type = #{tAuditNodeProcess.mainType}
</if>
</if>
<if
test=
"tAuditNodePro
ocess.logoTitle != null and tAuditNodePro
ocess.logoTitle.trim() != ''"
>
<if
test=
"tAuditNodePro
cess.logoTitle != null and tAuditNodePr
ocess.logoTitle.trim() != ''"
>
AND a.logo_title = #{tAuditNodePro
o
cess.logoTitle}
AND a.logo_title = #{tAuditNodeProcess.logoTitle}
</if>
</if>
<if
test=
"tAuditNodePro
ocess.nodeName != null and tAuditNodePro
ocess.nodeName.trim() != ''"
>
<if
test=
"tAuditNodePro
cess.nodeName != null and tAuditNodePr
ocess.nodeName.trim() != ''"
>
AND a.node_name = #{tAuditNodePro
o
cess.nodeName}
AND a.node_name = #{tAuditNodeProcess.nodeName}
</if>
</if>
<if
test=
"tAuditNodePro
ocess.processName != null and tAuditNodePro
ocess.processName.trim() != ''"
>
<if
test=
"tAuditNodePro
cess.processName != null and tAuditNodePr
ocess.processName.trim() != ''"
>
AND a.process_name = #{tAuditNodePro
o
cess.processName}
AND a.process_name = #{tAuditNodeProcess.processName}
</if>
</if>
<if
test=
"tAuditNodePro
ocess.parentProcessId != null and tAuditNodePro
ocess.parentProcessId.trim() != ''"
>
<if
test=
"tAuditNodePro
cess.parentProcessId != null and tAuditNodePr
ocess.parentProcessId.trim() != ''"
>
AND a.parent_process_id = #{tAuditNodePro
o
cess.parentProcessId}
AND a.parent_process_id = #{tAuditNodeProcess.parentProcessId}
</if>
</if>
<if
test=
"tAuditNodePro
ocess.deleteFlag != null and tAuditNodePro
ocess.deleteFlag.trim() != ''"
>
<if
test=
"tAuditNodePro
cess.deleteFlag != null and tAuditNodePr
ocess.deleteFlag.trim() != ''"
>
AND a.delete_flag = #{tAuditNodePro
o
cess.deleteFlag}
AND a.delete_flag = #{tAuditNodeProcess.deleteFlag}
</if>
</if>
<if
test=
"tAuditNodePro
ocess.type != null and tAuditNodePro
ocess.type.trim() != ''"
>
<if
test=
"tAuditNodePro
cess.type != null and tAuditNodePr
ocess.type.trim() != ''"
>
AND a.type = #{tAuditNodePro
o
cess.type}
AND a.type = #{tAuditNodeProcess.type}
</if>
</if>
<if
test=
"tAuditNodePro
ocess.addSignParentNodeId != null and tAuditNodePro
ocess.addSignParentNodeId.trim() != ''"
>
<if
test=
"tAuditNodePro
cess.addSignParentNodeId != null and tAuditNodePr
ocess.addSignParentNodeId.trim() != ''"
>
AND a.add_sign_parent_node_id = #{tAuditNodePro
o
cess.addSignParentNodeId}
AND a.add_sign_parent_node_id = #{tAuditNodeProcess.addSignParentNodeId}
</if>
</if>
<if
test=
"tAuditNodePro
ocess.addSignDepartmentId != null and tAuditNodePro
ocess.addSignDepartmentId.trim() != ''"
>
<if
test=
"tAuditNodePro
cess.addSignDepartmentId != null and tAuditNodePr
ocess.addSignDepartmentId.trim() != ''"
>
AND a.add_sign_department_id = #{tAuditNodePro
o
cess.addSignDepartmentId}
AND a.add_sign_department_id = #{tAuditNodeProcess.addSignDepartmentId}
</if>
</if>
<if
test=
"tAuditNodePro
ocess.domainName != null and tAuditNodePro
ocess.domainName.trim() != ''"
>
<if
test=
"tAuditNodePro
cess.domainName != null and tAuditNodePr
ocess.domainName.trim() != ''"
>
AND a.domain_name = #{tAuditNodePro
o
cess.domainName}
AND a.domain_name = #{tAuditNodeProcess.domainName}
</if>
</if>
<if
test=
"tAuditNodePro
ocess.addSignApprovalMan != null and tAuditNodePro
ocess.addSignApprovalMan.trim() != ''"
>
<if
test=
"tAuditNodePro
cess.addSignApprovalMan != null and tAuditNodePr
ocess.addSignApprovalMan.trim() != ''"
>
AND a.add_sign_approval_man = #{tAuditNodePro
o
cess.addSignApprovalMan}
AND a.add_sign_approval_man = #{tAuditNodeProcess.addSignApprovalMan}
</if>
</if>
<if
test=
"tAuditNodePro
ocess.addSignApprovalManName != null and tAuditNodePro
ocess.addSignApprovalManName.trim() != ''"
>
<if
test=
"tAuditNodePro
cess.addSignApprovalManName != null and tAuditNodePr
ocess.addSignApprovalManName.trim() != ''"
>
AND a.add_sign_approval_man_name = #{tAuditNodePro
o
cess.addSignApprovalManName}
AND a.add_sign_approval_man_name = #{tAuditNodeProcess.addSignApprovalManName}
</if>
</if>
</if>
</if>
</sql>
</sql>
...
...
yifu-upms/yifu-upms-api/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/api/vo/UserApprovalRoleVO.java
0 → 100644
View file @
cb057e5e
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
api
.
vo
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @author chenyuxi
* @date 2025/01/15
* @since 1.7.5
*/
@Data
public
class
UserApprovalRoleVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
String
departId
;
private
String
roleId
;
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/controller/UserController.java
View file @
cb057e5e
...
@@ -589,4 +589,31 @@ public class UserController {
...
@@ -589,4 +589,31 @@ public class UserController {
public
R
<
String
>
updateUserAndDept
(
HttpServletRequest
request
,
@RequestBody
JSONObject
json
)
{
public
R
<
String
>
updateUserAndDept
(
HttpServletRequest
request
,
@RequestBody
JSONObject
json
)
{
return
userService
.
updateUserAndDept
(
request
,
json
);
return
userService
.
updateUserAndDept
(
request
,
json
);
}
}
/**
* 查询流程配置审批角色对应的审批人
*
* @param userByApprovalRole
* @author chenyuxi
* @date 2025-01-10 17:47:32
* @since 1.7.5
**/
@Inner
@PostMapping
(
"/inner/getUser/getUserByRoleIdForCrm"
)
public
SysUserListVo
getUserByRoleIdForCrm
(
UserApprovalRoleVO
userByApprovalRole
)
{
SysUserListVo
naVo
=
new
SysUserListVo
();
if
(
Common
.
isEmpty
(
userByApprovalRole
.
getDepartId
())
||
Common
.
isEmpty
(
userByApprovalRole
.
getRoleId
()))
{
return
naVo
;
}
List
<
SysUser
>
sysUsers
=
userService
.
getUserByRoleIdForCrm
(
Integer
.
parseInt
(
userByApprovalRole
.
getDepartId
()),
userByApprovalRole
.
getRoleId
());
if
(
Common
.
isEmpty
(
sysUsers
))
{
//如果不存在则取上级所在部门负责人
sysUsers
=
userService
.
getUserManagerByUpDepartIdUp
(
Integer
.
parseInt
(
userByApprovalRole
.
getDepartId
()),
userByApprovalRole
.
getRoleId
());
}
if
(
Common
.
isNotEmpty
(
sysUsers
))
{
naVo
.
setUserList
(
sysUsers
);
}
return
naVo
;
}
}
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/mapper/SysUserMapper.java
View file @
cb057e5e
...
@@ -77,4 +77,8 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
...
@@ -77,4 +77,8 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
void
updateUser
(
@Param
(
"list"
)
List
<
Map
<
String
,
Object
>>
list
);
void
updateUser
(
@Param
(
"list"
)
List
<
Map
<
String
,
Object
>>
list
);
Page
<
BusinessUserVo
>
getBusinessUserVoPage
(
Page
page
,
@Param
(
"query"
)
BusinessUserVo
user
);
Page
<
BusinessUserVo
>
getBusinessUserVoPage
(
Page
page
,
@Param
(
"query"
)
BusinessUserVo
user
);
List
<
SysUser
>
getUserByRoleIdForCrm
(
@Param
(
"departId"
)
Integer
departId
,
@Param
(
"roleId"
)
String
roleId
);
List
<
SysUser
>
getUserManagerByUpDepartIdUp
(
@Param
(
"departId"
)
Integer
departId
,
@Param
(
"roleId"
)
String
roleId
);
}
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/service/SysUserService.java
View file @
cb057e5e
...
@@ -185,4 +185,9 @@ public interface SysUserService extends IService<SysUser> {
...
@@ -185,4 +185,9 @@ public interface SysUserService extends IService<SysUser> {
* @return R
* @return R
*/
*/
R
<
String
>
updateUserAndDept
(
HttpServletRequest
request
,
JSONObject
json
);
R
<
String
>
updateUserAndDept
(
HttpServletRequest
request
,
JSONObject
json
);
List
<
SysUser
>
getUserByRoleIdForCrm
(
Integer
departId
,
String
roleId
);
List
<
SysUser
>
getUserManagerByUpDepartIdUp
(
Integer
departId
,
String
roleId
);
}
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/service/impl/SysUserServiceImpl.java
View file @
cb057e5e
...
@@ -942,4 +942,14 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
...
@@ -942,4 +942,14 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
}
}
}
}
@Override
public
List
<
SysUser
>
getUserByRoleIdForCrm
(
Integer
departId
,
String
roleId
)
{
return
baseMapper
.
getUserByRoleIdForCrm
(
departId
,
roleId
);
}
@Override
public
List
<
SysUser
>
getUserManagerByUpDepartIdUp
(
Integer
departId
,
String
roleId
)
{
return
baseMapper
.
getUserManagerByUpDepartIdUp
(
departId
,
roleId
);
}
}
}
yifu-upms/yifu-upms-biz/src/main/resources/mapper/SysUserMapper.xml
View file @
cb057e5e
...
@@ -342,4 +342,41 @@
...
@@ -342,4 +342,41 @@
</where>
</where>
ORDER BY `user`.create_time DESC
ORDER BY `user`.create_time DESC
</select>
</select>
<select
id=
"getUserByRoleIdForCrm"
resultType=
"com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser"
>
SELECT
*
FROM
sys_user
WHERE
user_id IN (
SELECT
b.user_id
FROM
sys_approval_role a
LEFT JOIN sys_approval_role_user_dept b ON a.role_id = b.approval_role_id
WHERE
b.dept_id = #{departId}
AND approval_role_id = #{roleId}
)
</select>
<select
id=
"getUserManagerByUpDepartIdUp"
resultType=
"com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser"
>
SELECT * FROM sys_user WHERE user_id IN(
SELECT
user_id
FROM
sys_approval_role_user_dept
WHERE
dept_id = (
SELECT
ORGAN_PARENT
FROM
sys_organization_info
WHERE
id = #{departId}
)
AND approval_role_id = #{roleId}
)
</select>
</mapper>
</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