员工申请调岗
This commit is contained in:
1 parent
c0161c424f
commit
c2863a1d81
10 files changed
+341
-83
No files matched your search
@@ -7,6 +7,7 @@ DROP TABLE IF EXISTS sys_user_transaction;
|
||||
CREATE TABLE `sys_user_transaction`
|
||||
(
|
||||
id bigint NOT NULL COMMENT '编号',
|
||||
apply_user_id bigint NOT NULL COMMENT '申请用户id',
|
||||
user_id bigint NOT NULL COMMENT '用户id',
|
||||
biz_id bigint DEFAULT NULL COMMENT '业务id',
|
||||
biz_type varchar(32) NOT NULL COMMENT '业务类型',
|
||||
@@ -20,6 +21,7 @@ CREATE TABLE `sys_user_transaction`
|
||||
process_id varchar(256) DEFAULT NULL COMMENT '流程id',
|
||||
process_status varchar(10) DEFAULT NULL COMMENT '审核状体',
|
||||
process_time datetime DEFAULT NULL COMMENT '审核时间',
|
||||
remark varchar(1024) DEFAULT NULL COMMENT '备注',
|
||||
create_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
create_time datetime DEFAULT NULL COMMENT '创建时间',
|
||||
update_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人',
|
||||
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.bsd.pjcloud.admin.api.constant;
|
||||
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 用户调岗类型
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum UserTransactionEnum {
|
||||
|
||||
LEAVE("10", "离职"),
|
||||
TRANSFER("20", "调岗(外地)"),
|
||||
INNER_TRANSFER("30", "调岗(内部)"),
|
||||
;
|
||||
private final String type;
|
||||
private final String description;
|
||||
|
||||
public static UserTransactionEnum valueOfByType(String type) {
|
||||
if (ObjectUtil.isEmpty(type)) return null;
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get();
|
||||
}
|
||||
|
||||
}
|
||||
+90
-75
@@ -3,14 +3,17 @@ package com.bsd.pjcloud.admin.api.entity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.*;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 人员调动表
|
||||
*/
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("sys_user_transaction")
|
||||
@@ -19,112 +22,124 @@ import java.time.LocalDateTime;
|
||||
public class SysUserTransactionEntity extends Model<SysUserTransactionEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description="编号")
|
||||
@Schema(description = "编号")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@Schema(description="用户id")
|
||||
/**
|
||||
* 申请部门用户id
|
||||
*/
|
||||
@Schema(description = "申请部门用户id")
|
||||
private Long applyUserId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@Schema(description = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 业务id
|
||||
*/
|
||||
@Schema(description="业务id")
|
||||
/**
|
||||
* 业务id
|
||||
*/
|
||||
@Schema(description = "业务id")
|
||||
private Long bizId;
|
||||
|
||||
/**
|
||||
* 业务类型
|
||||
*/
|
||||
@Schema(description="业务类型")
|
||||
/**
|
||||
* 业务类型
|
||||
*/
|
||||
@Schema(description = "业务类型")
|
||||
private String bizType;
|
||||
|
||||
/**
|
||||
* 源部门id
|
||||
*/
|
||||
@Schema(description="源部门id")
|
||||
/**
|
||||
* 源部门id
|
||||
*/
|
||||
@Schema(description = "源部门id")
|
||||
private Long sourceDeptId;
|
||||
|
||||
/**
|
||||
* 目标部门id
|
||||
*/
|
||||
@Schema(description="目标部门id")
|
||||
/**
|
||||
* 目标部门id
|
||||
*/
|
||||
@Schema(description = "目标部门id")
|
||||
private Long targetDeptId;
|
||||
|
||||
/**
|
||||
* 是否离职自动转账
|
||||
*/
|
||||
@Schema(description="是否离职自动转账")
|
||||
/**
|
||||
* 是否离职自动转账
|
||||
*/
|
||||
@Schema(description = "是否离职自动转账")
|
||||
private String isWalletTransaction;
|
||||
|
||||
/**
|
||||
* 离职自动转账时间
|
||||
*/
|
||||
@Schema(description="离职自动转账时间")
|
||||
/**
|
||||
* 离职自动转账时间
|
||||
*/
|
||||
@Schema(description = "离职自动转账时间")
|
||||
private LocalDateTime walletTransactionTime;
|
||||
|
||||
/**
|
||||
* 流程id
|
||||
*/
|
||||
@Schema(description="流程id")
|
||||
/**
|
||||
* 流程id
|
||||
*/
|
||||
@Schema(description = "流程id")
|
||||
private String processId;
|
||||
|
||||
/**
|
||||
* 审核状体
|
||||
*/
|
||||
@Schema(description="审核状体")
|
||||
/**
|
||||
* 审核状体
|
||||
*/
|
||||
@Schema(description = "审核状体")
|
||||
private String processStatus;
|
||||
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
@Schema(description="审核时间")
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
@Schema(description = "审核时间")
|
||||
private LocalDateTime processTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建人")
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建时间")
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="修改人")
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="修改时间")
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="删除标记")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@Schema(description="租户ID")
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@Schema(description = "租户ID")
|
||||
private Long tenantId;
|
||||
}
|
||||
+2
@@ -26,4 +26,6 @@ public class SysUserTransactionVo extends SysUserTransactionEntity implements Ba
|
||||
|
||||
private String userAvatar;
|
||||
|
||||
private String applyUsername;
|
||||
|
||||
}
|
||||
+19
-5
@@ -11,6 +11,9 @@ import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.admin.service.SysUserTransactionService;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
import com.bsd.pjcloud.flow.task.dto.ProcessNodeRecordAssignUserParamDto;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
@@ -36,6 +39,14 @@ public class SysUserTransactionController {
|
||||
|
||||
private final SysUserTransactionService sysUserTransactionService;
|
||||
|
||||
/* ************************************* start callback start ************************************* */
|
||||
|
||||
public void applyCallback(@RequestBody ProcessNodeRecordAssignUserParamDto dto, @RequestParam(required = false) Long tenantId) {
|
||||
sysUserTransactionService.applyCallback(dto, tenantId);
|
||||
}
|
||||
|
||||
/* ************************************* end callback end ************************************* */
|
||||
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('admin_sysUserTransaction_view')")
|
||||
@@ -63,16 +74,18 @@ public class SysUserTransactionController {
|
||||
@SysLog("新增人员调动表")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('admin_sysUserTransaction_add')")
|
||||
public R save(@RequestBody SysUserTransactionEntity sysUserTransaction) {
|
||||
return R.ok(sysUserTransactionService.save(sysUserTransaction));
|
||||
public R save(@RequestBody SysUserTransactionDto dto) {
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
return R.ok(sysUserTransactionService.create(dto, user));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改人员调动表", description = "修改人员调动表")
|
||||
@SysLog("修改人员调动表")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('admin_sysUserTransaction_edit')")
|
||||
public R updateById(@RequestBody SysUserTransactionEntity sysUserTransaction) {
|
||||
return R.ok(sysUserTransactionService.updateById(sysUserTransaction));
|
||||
public R updateById(@RequestBody SysUserTransactionDto dto) {
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
return R.ok(sysUserTransactionService.edit(dto, user));
|
||||
}
|
||||
|
||||
@Operation(summary = "通过id删除人员调动表", description = "通过id删除人员调动表")
|
||||
@@ -80,7 +93,8 @@ public class SysUserTransactionController {
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('admin_sysUserTransaction_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(sysUserTransactionService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
sysUserTransactionService.delByIds(CollUtil.toList(ids));
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ResponseExcel
|
||||
|
||||
+1
@@ -14,4 +14,5 @@ public interface SysUserTransactionMapper extends PjcloudBaseMapper<SysUserTrans
|
||||
|
||||
Page<SysUserTransactionVo> scopePageJoin(Page page, @Param("dto") SysUserTransactionDto dto, DataScope dataScope);
|
||||
|
||||
SysUserTransactionVo join(@Param("id") Long userTransactionId);
|
||||
}
|
||||
+26
@@ -6,8 +6,34 @@ import com.bsd.pjcloud.admin.api.dto.SysUserTransactionDto;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysUserTransactionEntity;
|
||||
import com.bsd.pjcloud.admin.api.vo.SysUserTransactionVo;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.flow.task.dto.ProcessNodeRecordAssignUserParamDto;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public interface SysUserTransactionService extends IService<SysUserTransactionEntity> {
|
||||
|
||||
Page<SysUserTransactionVo> scopePageJoin(Page page, SysUserTransactionDto dto, DataScope dataScope);
|
||||
|
||||
SysUserTransactionVo join(Long userTransactionId);
|
||||
|
||||
/**
|
||||
* 新增人员调动
|
||||
*/
|
||||
Long create(SysUserTransactionDto dto, PjcloudUser applyUser);
|
||||
|
||||
/**
|
||||
* 新增人员调动
|
||||
*/
|
||||
Long edit(SysUserTransactionDto dto, PjcloudUser applyUser);
|
||||
|
||||
/**
|
||||
* 删除人员调动
|
||||
*/
|
||||
void delByIds(ArrayList<Long> list);
|
||||
|
||||
/**
|
||||
* 回调
|
||||
*/
|
||||
void applyCallback(ProcessNodeRecordAssignUserParamDto dto, Long tenantId);
|
||||
}
|
||||
+149
@@ -1,16 +1,39 @@
|
||||
package com.bsd.pjcloud.admin.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.admin.api.constant.UserTransactionEnum;
|
||||
import com.bsd.pjcloud.admin.api.dto.SysUserTransactionDto;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysDept;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysUser;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysUserTransactionEntity;
|
||||
import com.bsd.pjcloud.admin.api.vo.SysUserTransactionVo;
|
||||
import com.bsd.pjcloud.admin.mapper.SysUserTransactionMapper;
|
||||
import com.bsd.pjcloud.admin.service.SysDeptService;
|
||||
import com.bsd.pjcloud.admin.service.SysUserService;
|
||||
import com.bsd.pjcloud.admin.service.SysUserTransactionService;
|
||||
import com.bsd.pjcloud.admin.utils.flow.FlowUtil;
|
||||
import com.bsd.pjcloud.admin.utils.flow.dto.UserTransactionFlowDto;
|
||||
import com.bsd.pjcloud.common.core.constant.enums.YesNoEnum;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.data.resolver.ParamResolver;
|
||||
import com.bsd.pjcloud.common.data.tenant.TenantContextHolder;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.flow.task.constant.TaskCheckStatusEnum;
|
||||
import com.bsd.pjcloud.flow.task.dto.ProcessNodeRecordAssignUserParamDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeApplyEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 人员调动表
|
||||
@@ -20,8 +43,134 @@ import org.springframework.stereotype.Service;
|
||||
@AllArgsConstructor
|
||||
public class SysUserTransactionServiceImpl extends ServiceImpl<SysUserTransactionMapper, SysUserTransactionEntity> implements SysUserTransactionService {
|
||||
|
||||
private static final String TAG = "员工申请调岗";
|
||||
|
||||
private final SysUserService sysUserService;
|
||||
private final SysDeptService sysDeptService;
|
||||
|
||||
private final FlowUtil flowUtil;
|
||||
|
||||
@Override
|
||||
public Page<SysUserTransactionVo> scopePageJoin(Page page, SysUserTransactionDto dto, DataScope dataScope) {
|
||||
return baseMapper.scopePageJoin(page, dto, dataScope);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysUserTransactionVo join(Long userTransactionId) {
|
||||
return baseMapper.join(userTransactionId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增人员调动
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long create(SysUserTransactionDto dto, PjcloudUser applyUser) {
|
||||
dto.setApplyUserId(applyUser.getId());
|
||||
if (ObjectUtil.notEqual(dto.getBizType(), UserTransactionEnum.INNER_TRANSFER.getType())) {
|
||||
dto.setIsWalletTransaction(YesNoEnum.YES.getCode());
|
||||
}
|
||||
// 如果是离职或者调岗(外地)自动移动到指定部门
|
||||
if (ObjectUtil.equals(dto.getBizType(), UserTransactionEnum.LEAVE.getType())) {
|
||||
try {
|
||||
String deptId = ParamResolver.getStr("USER_TRANSACTION_LEAVE");
|
||||
dto.setTargetDeptId(Long.valueOf(deptId));
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("请配置离职部门参数");
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.equals(dto.getBizType(), UserTransactionEnum.TRANSFER.getType())) {
|
||||
try {
|
||||
String deptId = ParamResolver.getStr("USER_TRANSACTION_TRANSFER");
|
||||
dto.setTargetDeptId(Long.valueOf(deptId));
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("请配置调岗(外地)部门参数");
|
||||
}
|
||||
}
|
||||
// 查询发起用户
|
||||
SysUser applySysUser = sysUserService.getById(applyUser.getId());
|
||||
SysDept applySysDept = sysDeptService.getById(applyUser.getDeptId());
|
||||
baseMapper.insert(dto);
|
||||
// 发起审批
|
||||
UserTransactionFlowDto flowDto = new UserTransactionFlowDto();
|
||||
flowDto.setApplyDeptName(applySysDept.getName());
|
||||
String processId = flowUtil.startFlow("USER_TRANSATION_APPLY", applySysUser, dto.getId(), flowDto);
|
||||
// 更新审批信息
|
||||
SysUserTransactionEntity updateObj = new SysUserTransactionEntity();
|
||||
updateObj.setId(dto.getId());
|
||||
updateObj.setProcessId(processId);
|
||||
updateObj.setProcessStatus(TaskCheckStatusEnum.PADDING.getCode());
|
||||
baseMapper.updateById(updateObj);
|
||||
return dto.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增人员调动
|
||||
*/
|
||||
@Override
|
||||
public Long edit(SysUserTransactionDto dto, PjcloudUser applyUser) {
|
||||
SysUserTransactionEntity updateObj = BeanUtil.toBean(dto, SysUserTransactionEntity.class);
|
||||
if (ObjectUtil.notEqual(TaskCheckStatusEnum.PADDING.getCode(), dto.getProcessStatus())) {
|
||||
throw new RuntimeException("审批中状态才可以修改");
|
||||
}
|
||||
baseMapper.updateById(updateObj);
|
||||
return dto.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除人员调动
|
||||
*/
|
||||
@Override
|
||||
public void delByIds(ArrayList<Long> list) {
|
||||
if (ObjectUtil.isEmpty(list)) return;
|
||||
List<SysUserTransactionEntity> userList = baseMapper.selectList(new LambdaQueryWrapper<SysUserTransactionEntity>()
|
||||
.in(SysUserTransactionEntity::getId, list)
|
||||
);
|
||||
for (SysUserTransactionEntity v : userList) {
|
||||
if (ObjectUtil.notEqual(TaskCheckStatusEnum.PADDING.getCode(), v.getProcessStatus())) {
|
||||
SysUserTransactionVo detail = join(v.getId());
|
||||
throw new RuntimeException("调动人<" + detail.getUsername() + ">手机号<" + detail.getUserMobile() + ">,审批中状态才可以修改");
|
||||
}
|
||||
}
|
||||
baseMapper.deleteBatchIds(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 回调
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void applyCallback(ProcessNodeRecordAssignUserParamDto dto, Long tenantId) {
|
||||
if (!flowUtil.checkCallback(dto)) {
|
||||
return;
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(tenantId) && ObjectUtil.notEqual(tenantId, 1L)) {
|
||||
TenantContextHolder.setTenantId(tenantId);
|
||||
}
|
||||
String processId = dto.getProcessInstanceId();
|
||||
SysUserTransactionEntity detail = baseMapper.selectOne(new LambdaQueryWrapper<SysUserTransactionEntity>().eq(SysUserTransactionEntity::getProcessId, processId));
|
||||
if (ObjectUtil.isEmpty(detail)) {
|
||||
return;
|
||||
}
|
||||
if (!ObjectUtil.equals(detail.getProcessStatus(), TaskCheckStatusEnum.PADDING.getCode())) {
|
||||
log.error("|{}|重复的回调,dto:|{}|", TAG, JSON.toJSONString(dto));
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Boolean isConsent = flowUtil.isConsent(dto);
|
||||
String processStatus = isConsent ? TaskCheckStatusEnum.RESULT.getCode() : TaskCheckStatusEnum.REJECT.getCode();
|
||||
baseMapper.updateById(SysUserTransactionEntity.builder().id(detail.getId()).processTime(LocalDateTime.now()).processStatus(processStatus).build());
|
||||
if (isConsent) {
|
||||
// 修改部门
|
||||
SysUser userUpdateObj = new SysUser();
|
||||
userUpdateObj.setUserId(detail.getUserId());
|
||||
userUpdateObj.setDeptId(detail.getTargetDeptId());
|
||||
sysUserService.updateById(userUpdateObj);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("|{}|审批回调意外的错误,dto:|{}|error:|{}|", TAG, JSON.toJSONString(dto), e.getMessage());
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.bsd.pjcloud.admin.utils.flow.dto;
|
||||
|
||||
import com.bsd.pjcloud.flow.task.dto.base.FlowBaseDto;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class UserTransactionFlowDto extends FlowBaseDto {
|
||||
}
|
||||
+15
-3
@@ -24,6 +24,7 @@
|
||||
|
||||
<sql id="selectA">
|
||||
select a.id,
|
||||
a.apply_user_id,
|
||||
a.user_id,
|
||||
a.biz_id,
|
||||
a.biz_type,
|
||||
@@ -79,19 +80,30 @@
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="scopePageJoin" resultType="com.bsd.pjcloud.admin.api.vo.SysUserTransactionVo">
|
||||
<sql id="selectJoin">
|
||||
<include refid="selectA"/>
|
||||
soureD.name as sourceDeptName,
|
||||
targetD.name as targetDeptName,
|
||||
u.username as username,
|
||||
u.name as username,
|
||||
u.phone as userMobile,
|
||||
u.avatar as userAvatar
|
||||
u.avatar as userAvatar,
|
||||
applyU.name as applyUsername
|
||||
from sys_user_transaction a
|
||||
left join sys_dept soureD on soureD.dept_id = a.source_dept_id
|
||||
left join sys_dept targetD on targetD.dept_id = a.target_dept_id
|
||||
left join sys_user u on u.user_id = a.user_id
|
||||
left join sys_user applyU on applyU.user_id = a.apply_user_id
|
||||
</sql>
|
||||
|
||||
<select id="scopePageJoin" resultType="com.bsd.pjcloud.admin.api.vo.SysUserTransactionVo">
|
||||
<include refid="selectJoin" />
|
||||
<where>
|
||||
<include refid="whereA"/>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="join" resultType="com.bsd.pjcloud.admin.api.vo.SysUserTransactionVo">
|
||||
<include refid="selectJoin"/>
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in new issue
Block a user