Merge branch 'dev' of http://git.znkjfw.com/ak/zn-cloud into dev
This commit is contained in:
commit
ada0c8d0ba
@ -66,6 +66,7 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode MODEL_DEPLOY_FAIL_TASK_ASSIGN_RULE_NOT_CONFIG = new ErrorCode(1_009_002_004, "部署流程失败," +
|
ErrorCode MODEL_DEPLOY_FAIL_TASK_ASSIGN_RULE_NOT_CONFIG = new ErrorCode(1_009_002_004, "部署流程失败," +
|
||||||
"原因:用户任务({})未配置分配规则,请点击【修改流程】按钮进行配置");
|
"原因:用户任务({})未配置分配规则,请点击【修改流程】按钮进行配置");
|
||||||
ErrorCode MODEL_DEPLOY_FAIL_TASK_INFO_EQUALS = new ErrorCode(1_009_003_005, "流程定义部署失败,原因:信息未发生变化");
|
ErrorCode MODEL_DEPLOY_FAIL_TASK_INFO_EQUALS = new ErrorCode(1_009_003_005, "流程定义部署失败,原因:信息未发生变化");
|
||||||
|
ErrorCode PROCESS_CC_NOT_EXISTS = new ErrorCode(1_009_003_006, "BPM 流程抄送配置不存在");
|
||||||
|
|
||||||
// ========== 流程定义 1-009-003-000 ==========
|
// ========== 流程定义 1-009-003-000 ==========
|
||||||
ErrorCode PROCESS_DEFINITION_KEY_NOT_MATCH = new ErrorCode(1_009_003_000, "流程定义的标识期望是({}),当前是({}),请修改 BPMN 流程图");
|
ErrorCode PROCESS_DEFINITION_KEY_NOT_MATCH = new ErrorCode(1_009_003_000, "流程定义的标识期望是({}),当前是({}),请修改 BPMN 流程图");
|
||||||
|
@ -0,0 +1,68 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.definition;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.filter.BpmInstallFilterRespVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.filter.BpmInstanceFilterPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group.BpmUserGroupCreateReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group.BpmUserGroupPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group.BpmUserGroupRespVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group.BpmUserGroupUpdateReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.convert.definition.BpmInstallFilterConvert;
|
||||||
|
import cn.iocoder.yudao.module.bpm.convert.definition.BpmUserGroupConvert;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmInstanceFilterDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmUserGroupDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.service.definition.BpmInstanceFilterService;
|
||||||
|
import cn.iocoder.yudao.module.bpm.service.definition.BpmUserGroupService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 流程实例过滤")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/bpm/instance-filter")
|
||||||
|
@Validated
|
||||||
|
public class BpmInstanceFilterController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmInstanceFilterService instanceFilterService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "添加需要过滤的流程实例")
|
||||||
|
public CommonResult<Long> createInstanceFilter(@RequestParam("processInstanceId")String processInstanceId) {
|
||||||
|
return success(instanceFilterService.createInstanceFilter(processInstanceId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新流程实例是否需要过滤")
|
||||||
|
public CommonResult<Boolean> updateInstanceFilterStatus(@RequestParam("id")Long id, @RequestParam("status") Integer status) {
|
||||||
|
instanceFilterService.updateInstanceFilterStatus(id, status);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除过滤")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
public CommonResult<Boolean> deleteUserGroup(@RequestParam("id") Long id) {
|
||||||
|
instanceFilterService.deleteInstanceFilter(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得流程实例过滤分页")
|
||||||
|
public CommonResult<PageResult<BpmInstanceFilterDO>> getInstanceFilterPage(@Valid @ModelAttribute BpmInstanceFilterPageReqVO pageVO) {
|
||||||
|
PageResult<BpmInstanceFilterDO> pageResult = instanceFilterService.getInstanceFilterPage(pageVO);
|
||||||
|
return success(pageResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,111 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.definition;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.cc.BpmProcessCcPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.cc.BpmProcessCcRespVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.cc.BpmProcessCcSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessCcDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmUserGroupDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.service.definition.BpmProcessCcService;
|
||||||
|
import cn.iocoder.yudao.module.bpm.service.definition.BpmUserGroupService;
|
||||||
|
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||||
|
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - BPM 流程抄送配置")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/bpm/process-cc")
|
||||||
|
@Validated
|
||||||
|
public class BpmProcessCcController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmProcessCcService processCcService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmUserGroupService groupService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private DeptApi deptApi;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建BPM 流程抄送配置")
|
||||||
|
@PreAuthorize("@ss.hasPermission('bpm:process-cc:create')")
|
||||||
|
public CommonResult<Long> createProcessCc(@Valid @RequestBody BpmProcessCcSaveReqVO createReqVO) {
|
||||||
|
return success(processCcService.createProcessCc(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新BPM 流程抄送配置")
|
||||||
|
@PreAuthorize("@ss.hasPermission('bpm:process-cc:update')")
|
||||||
|
public CommonResult<Boolean> updateProcessCc(@Valid @RequestBody BpmProcessCcSaveReqVO updateReqVO) {
|
||||||
|
processCcService.updateProcessCc(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除BPM 流程抄送配置")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('bpm:process-cc:delete')")
|
||||||
|
public CommonResult<Boolean> deleteProcessCc(@RequestParam("id") Long id) {
|
||||||
|
processCcService.deleteProcessCc(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得BPM 流程抄送配置")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('bpm:process-cc:query')")
|
||||||
|
public CommonResult<BpmProcessCcRespVO> getProcessCc(@RequestParam("id") Long id) {
|
||||||
|
BpmProcessCcDO processCc = processCcService.getProcessCc(id);
|
||||||
|
BpmProcessCcRespVO respVO = BeanUtils.toBean(processCc, BpmProcessCcRespVO.class);
|
||||||
|
|
||||||
|
return success(respVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得BPM 流程抄送配置分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('bpm:process-cc:query')")
|
||||||
|
public CommonResult<PageResult<BpmProcessCcRespVO>> getProcessCcPage(@Valid BpmProcessCcPageReqVO pageReqVO) {
|
||||||
|
PageResult<BpmProcessCcDO> pageResult = processCcService.getProcessCcPage(pageReqVO);
|
||||||
|
PageResult<BpmProcessCcRespVO> respVOPageResult = BeanUtils.toBean(pageResult, BpmProcessCcRespVO.class);
|
||||||
|
|
||||||
|
// 获取公司部门Map
|
||||||
|
Map<Long, DeptRespDTO> deptMap = convertMap(deptApi.getCompanyDept().getCheckedData(), DeptRespDTO::getId);
|
||||||
|
// 获取列表中所有用户组详情
|
||||||
|
List<BpmUserGroupDO> groupDOS = groupService.getUserGroupList(
|
||||||
|
respVOPageResult.getList().stream()
|
||||||
|
.flatMap(item -> item.getUserGroupId().stream())
|
||||||
|
.collect(Collectors.toSet()));
|
||||||
|
// 转换Map
|
||||||
|
Map<Long, String> groupNameMap = convertMap(groupDOS, BpmUserGroupDO::getId, BpmUserGroupDO::getName);
|
||||||
|
|
||||||
|
respVOPageResult.getList().forEach(data -> {
|
||||||
|
|
||||||
|
// 设置用户组名称
|
||||||
|
data.setGroupName(data.getUserGroupId().stream()
|
||||||
|
.map(groupNameMap::get)
|
||||||
|
.collect(Collectors.joining("、")));
|
||||||
|
// 设置公司名称
|
||||||
|
data.setCompanyName(data.getCompanyDeptId().stream()
|
||||||
|
.map(item -> deptMap.get(item).getName())
|
||||||
|
.collect(Collectors.joining("、")));
|
||||||
|
});
|
||||||
|
return success(respVOPageResult);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.cc;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - BPM 流程抄送配置分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class BpmProcessCcPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "流程实例的名字", example = "请假")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "用户组编号", example = "114")
|
||||||
|
private String userGroupId;
|
||||||
|
|
||||||
|
@Schema(description = "公司部门编号", example = "114")
|
||||||
|
private String companyDeptId;
|
||||||
|
|
||||||
|
@Schema(description = "状态(0正常 1停用)")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.cc;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - BPM 流程抄送配置 Response VO")
|
||||||
|
@Data
|
||||||
|
public class BpmProcessCcRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "抄送配置表单主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "流程实例的名字", example = "请假")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "公司部门编号", example = "114")
|
||||||
|
private Set<Long> companyDeptId;
|
||||||
|
|
||||||
|
@Schema(description = "公司部门名称", example = "114")
|
||||||
|
private String companyName;
|
||||||
|
|
||||||
|
@Schema(description = "绑定用户组编号")
|
||||||
|
private Set<Long> userGroupId;
|
||||||
|
|
||||||
|
@Schema(description = "用户组名称")
|
||||||
|
private String groupName;
|
||||||
|
|
||||||
|
@Schema(description = "描述", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@Schema(description = "状态(0正常 1停用)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.cc;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - BPM 流程抄送配置新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class BpmProcessCcSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "抄送配置表单主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "流程实例的名字", example = "请假")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "公司部门编号", example = "114")
|
||||||
|
private Set<Long> companyDeptId;
|
||||||
|
|
||||||
|
@Schema(description = "绑定用户组编号")
|
||||||
|
private Set<Long> userGroupId;
|
||||||
|
|
||||||
|
@Schema(description = "描述", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "描述不能为空")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@Schema(description = "状态(0正常 1停用)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "状态(0正常 1停用)不能为空")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.filter;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group.BpmUserGroupBaseVO;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 流程实例过滤 Response VO")
|
||||||
|
@Data
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class BpmInstallFilterRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.filter;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 流程实例过滤分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class BpmInstanceFilterPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "流程实例ID", example = "xxxxxxx")
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
@Schema(description = "状态", example = "1")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.convert.definition;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.filter.BpmInstallFilterRespVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group.BpmUserGroupCreateReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group.BpmUserGroupRespVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group.BpmUserGroupUpdateReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmInstanceFilterDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmUserGroupDO;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.Named;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户组 Convert
|
||||||
|
*
|
||||||
|
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BpmInstallFilterConvert {
|
||||||
|
|
||||||
|
BpmInstallFilterConvert INSTANCE = Mappers.getMapper(BpmInstallFilterConvert.class);
|
||||||
|
|
||||||
|
PageResult<BpmInstallFilterRespVO> convertPage(PageResult<BpmInstanceFilterDO> page);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.dal.dataobject.definition;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.type.JsonLongSetTypeHandler;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bpm 流程实例过滤
|
||||||
|
*
|
||||||
|
|
||||||
|
*/
|
||||||
|
@TableName(value = "bpm_instance_filter", autoResultMap = true)
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class BpmInstanceFilterDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编号,自增
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例ID
|
||||||
|
*/
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*
|
||||||
|
* 枚举 {@link CommonStatusEnum}
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,54 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.dal.dataobject.definition;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.type.JsonLongSetTypeHandler;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BPM 流程抄送配置 DO
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
*/
|
||||||
|
@TableName(value = "bpm_process_cc", autoResultMap = true)
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class BpmProcessCcDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 抄送配置表单主键
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 流程实例的名字
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 公司部门编号列表
|
||||||
|
*/
|
||||||
|
@TableField(typeHandler = JsonLongSetTypeHandler.class)
|
||||||
|
private Set<Long> companyDeptId;
|
||||||
|
/**
|
||||||
|
* 绑定用户组编号列表
|
||||||
|
*/
|
||||||
|
@TableField(typeHandler = JsonLongSetTypeHandler.class)
|
||||||
|
private Set<Long> userGroupId;
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
private String description;
|
||||||
|
/**
|
||||||
|
* 状态(0正常 1停用)
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.dal.mysql.definition;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.filter.BpmInstanceFilterPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group.BpmUserGroupPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmInstanceFilterDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmUserGroupDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例过滤 Mapper
|
||||||
|
*
|
||||||
|
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BpmInstanceFilterMapper extends BaseMapperX<BpmInstanceFilterDO> {
|
||||||
|
|
||||||
|
default PageResult<BpmInstanceFilterDO> selectPage(BpmInstanceFilterPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<BpmInstanceFilterDO>()
|
||||||
|
.eqIfPresent(BpmInstanceFilterDO::getProcessInstanceId, reqVO.getProcessInstanceId())
|
||||||
|
.eqIfPresent(BpmInstanceFilterDO::getStatus, reqVO.getStatus())
|
||||||
|
.betweenIfPresent(BpmInstanceFilterDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(BpmInstanceFilterDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.dal.mysql.definition;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.cc.BpmProcessCcPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessCcDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BPM 流程抄送配置 Mapper
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BpmProcessCcMapper extends BaseMapperX<BpmProcessCcDO> {
|
||||||
|
|
||||||
|
default PageResult<BpmProcessCcDO> selectPage(BpmProcessCcPageReqVO reqVO) {
|
||||||
|
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<BpmProcessCcDO>()
|
||||||
|
.likeIfPresent(BpmProcessCcDO::getName, reqVO.getName())
|
||||||
|
.likeIfPresent(BpmProcessCcDO::getUserGroupId, reqVO.getUserGroupId())
|
||||||
|
.eqIfPresent(BpmProcessCcDO::getCompanyDeptId, reqVO.getCompanyDeptId())
|
||||||
|
.eqIfPresent(BpmProcessCcDO::getStatus, reqVO.getStatus())
|
||||||
|
.orderByDesc(BpmProcessCcDO::getId));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.service.definition;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.filter.BpmInstanceFilterPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmInstanceFilterDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例过滤 Service 接口
|
||||||
|
*
|
||||||
|
|
||||||
|
*/
|
||||||
|
public interface BpmInstanceFilterService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增需要过滤的流程实例ID
|
||||||
|
*
|
||||||
|
* @param processInstanceId 流程实例ID
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createInstanceFilter(String processInstanceId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例显示开关
|
||||||
|
*
|
||||||
|
* @param id 主键ID
|
||||||
|
* @param status 开关状态
|
||||||
|
*/
|
||||||
|
void updateInstanceFilterStatus(Long id, Integer status);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除用户组
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteInstanceFilter(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得用户组分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 用户组分页
|
||||||
|
*/
|
||||||
|
PageResult<BpmInstanceFilterDO> getInstanceFilterPage(BpmInstanceFilterPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,53 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.service.definition;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.filter.BpmInstanceFilterPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmInstanceFilterDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.mysql.definition.BpmInstanceFilterMapper;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例过滤 Service 接口
|
||||||
|
*
|
||||||
|
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
@Slf4j
|
||||||
|
public class BpmInstanceFilterServiceImpl implements BpmInstanceFilterService{
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmInstanceFilterMapper instanceFilterMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createInstanceFilter(String processInstanceId) {
|
||||||
|
// 插入
|
||||||
|
BpmInstanceFilterDO instanceFilter = new BpmInstanceFilterDO() ;
|
||||||
|
instanceFilter.setProcessInstanceId(processInstanceId) ;
|
||||||
|
instanceFilter.setStatus(1) ;
|
||||||
|
instanceFilterMapper.insert(instanceFilter);
|
||||||
|
// 返回
|
||||||
|
return instanceFilter.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateInstanceFilterStatus(Long id, Integer status) {
|
||||||
|
BpmInstanceFilterDO result = instanceFilterMapper.selectById(id);
|
||||||
|
result.setStatus(status) ;
|
||||||
|
instanceFilterMapper.updateById(result) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteInstanceFilter(Long id) {
|
||||||
|
instanceFilterMapper.deleteById(id) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<BpmInstanceFilterDO> getInstanceFilterPage(BpmInstanceFilterPageReqVO pageReqVO) {
|
||||||
|
return instanceFilterMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,63 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.service.definition;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.cc.BpmProcessCcPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.cc.BpmProcessCcSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessCcDO;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BPM 流程抄送配置 Service 接口
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
*/
|
||||||
|
public interface BpmProcessCcService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建BPM 流程抄送配置
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createProcessCc(@Valid BpmProcessCcSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新BPM 流程抄送配置
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateProcessCc(@Valid BpmProcessCcSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除BPM 流程抄送配置
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteProcessCc(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得BPM 流程抄送配置
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return BPM 流程抄送配置
|
||||||
|
*/
|
||||||
|
BpmProcessCcDO getProcessCc(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得BPM 流程抄送配置分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return BPM 流程抄送配置分页
|
||||||
|
*/
|
||||||
|
PageResult<BpmProcessCcDO> getProcessCcPage(BpmProcessCcPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据流程名称查询抄送信息
|
||||||
|
* @param name 流程名称
|
||||||
|
* @param userId 用户编号
|
||||||
|
* @return 抄送信息
|
||||||
|
*/
|
||||||
|
List<BpmProcessCcDO> getCCListByName(String name, Long userId);
|
||||||
|
}
|
@ -0,0 +1,88 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.service.definition;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.cc.BpmProcessCcPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.cc.BpmProcessCcSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessCcDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.mysql.definition.BpmProcessCcMapper;
|
||||||
|
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||||
|
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.PROCESS_CC_NOT_EXISTS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BPM 流程抄送配置 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class BpmProcessCcServiceImpl implements BpmProcessCcService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmProcessCcMapper processCcMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private DeptApi deptApi;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createProcessCc(BpmProcessCcSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
BpmProcessCcDO processCc = BeanUtils.toBean(createReqVO, BpmProcessCcDO.class);
|
||||||
|
processCcMapper.insert(processCc);
|
||||||
|
// 返回
|
||||||
|
return processCc.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateProcessCc(BpmProcessCcSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateProcessCcExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
BpmProcessCcDO updateObj = BeanUtils.toBean(updateReqVO, BpmProcessCcDO.class);
|
||||||
|
processCcMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteProcessCc(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateProcessCcExists(id);
|
||||||
|
// 删除
|
||||||
|
processCcMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateProcessCcExists(Long id) {
|
||||||
|
if (processCcMapper.selectById(id) == null) {
|
||||||
|
throw exception(PROCESS_CC_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BpmProcessCcDO getProcessCc(Long id) {
|
||||||
|
return processCcMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<BpmProcessCcDO> getProcessCcPage(BpmProcessCcPageReqVO pageReqVO) {
|
||||||
|
return processCcMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BpmProcessCcDO> getCCListByName(String name, Long userId) {
|
||||||
|
|
||||||
|
// 获取用户所在公司编号
|
||||||
|
DeptRespDTO dto = deptApi.getUserCompanyDept(userId).getCheckedData();
|
||||||
|
|
||||||
|
return processCcMapper.selectList(new LambdaQueryWrapperX<BpmProcessCcDO>()
|
||||||
|
.likeIfPresent(BpmProcessCcDO::getName, name)
|
||||||
|
.eqIfPresent(BpmProcessCcDO::getCompanyDeptId, dto.getId()));
|
||||||
|
}
|
||||||
|
}
|
@ -9,7 +9,6 @@ import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOAFinanceMapper;
|
|||||||
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||||
import cn.iocoder.yudao.module.bpm.service.task.BpmHistoryProcessInstanceService;
|
import cn.iocoder.yudao.module.bpm.service.task.BpmHistoryProcessInstanceService;
|
||||||
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
|
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
|
||||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@ -23,7 +22,7 @@ import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionU
|
|||||||
import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_FINANCE_NOT_EXISTS;
|
import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_FINANCE_NOT_EXISTS;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OA 外出申请 Service 实现类
|
* OA 活动经费申请 Service 实现类
|
||||||
*
|
*
|
||||||
* @author 符溶馨
|
* @author 符溶馨
|
||||||
|
|
||||||
@ -33,7 +32,7 @@ import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_FINANCE_NO
|
|||||||
public class BpmOAFinanceServiceImpl extends BpmOABaseService implements BpmOAFinanceService{
|
public class BpmOAFinanceServiceImpl extends BpmOABaseService implements BpmOAFinanceService{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OA 外出对应的流程定义 KEY
|
* OA 活动经费的流程定义 KEY
|
||||||
*/
|
*/
|
||||||
public static final String PROCESS_KEY = "oa_finance_2";
|
public static final String PROCESS_KEY = "oa_finance_2";
|
||||||
|
|
||||||
|
@ -71,6 +71,12 @@ public class BpmOAReplacementCardServiceImpl extends BpmOABaseService implements
|
|||||||
@Override
|
@Override
|
||||||
public Long createReplacementCard(Long userId, BpmOAReplacementCardCreateReqVO createReqVO) {
|
public Long createReplacementCard(Long userId, BpmOAReplacementCardCreateReqVO createReqVO) {
|
||||||
|
|
||||||
|
// 获取用户可补卡次数
|
||||||
|
Integer count = attendanceApi.getReplacementCardNum().getCheckedData();
|
||||||
|
if (count <= 0) {
|
||||||
|
throw exception(INSUFFICIENT_NUMBER_OF_CARD_REFILLS);
|
||||||
|
}
|
||||||
|
|
||||||
//插入OA 补卡申请
|
//插入OA 补卡申请
|
||||||
BpmOAReplacementCardDO replacementCard = BeanUtils.toBean(createReqVO, BpmOAReplacementCardDO.class)
|
BpmOAReplacementCardDO replacementCard = BeanUtils.toBean(createReqVO, BpmOAReplacementCardDO.class)
|
||||||
.setUserId(userId)
|
.setUserId(userId)
|
||||||
|
File diff suppressed because one or more lines are too long
@ -95,4 +95,9 @@ public interface DeptApi {
|
|||||||
@GetMapping("/getCompanyDept")
|
@GetMapping("/getCompanyDept")
|
||||||
@Operation(summary = "获取部门类型为公司的部门信息")
|
@Operation(summary = "获取部门类型为公司的部门信息")
|
||||||
CommonResult<List<DeptRespDTO>> getCompanyDept();
|
CommonResult<List<DeptRespDTO>> getCompanyDept();
|
||||||
|
|
||||||
|
@GetMapping("/getUserCompanyDept")
|
||||||
|
@Operation(summary = "获取用户所在公司的信息")
|
||||||
|
@Parameter(name = "userId", description = "用户编号", example = "1024", required = true)
|
||||||
|
CommonResult<DeptRespDTO> getUserCompanyDept(@RequestParam("userId") Long userId);
|
||||||
}
|
}
|
||||||
|
@ -39,4 +39,8 @@ public class SubscribeMessageReqDTO {
|
|||||||
public void addData(MsgData data) {
|
public void addData(MsgData data) {
|
||||||
this.data.add(data);
|
this.data.add(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Schema(description = "模版类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1:小程序模版:2:公众号模版")
|
||||||
|
@NotNull(message = "模版类型不能为空")
|
||||||
|
private String minOrMpType = "1" ;
|
||||||
}
|
}
|
||||||
|
@ -134,4 +134,12 @@ public class DeptApiImpl implements DeptApi {
|
|||||||
List<DeptDO> deptDOS = deptService.getCompanyDept();
|
List<DeptDO> deptDOS = deptService.getCompanyDept();
|
||||||
return success(BeanUtils.toBean(deptDOS, DeptRespDTO.class));
|
return success(BeanUtils.toBean(deptDOS, DeptRespDTO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@DataPermission(enable = false)
|
||||||
|
public CommonResult<DeptRespDTO> getUserCompanyDept(Long userId) {
|
||||||
|
|
||||||
|
DeptDO deptDO = deptService.getUserCompanyDept(userId);
|
||||||
|
return success(BeanUtils.toBean(deptDO, DeptRespDTO.class));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,10 +7,13 @@ import cn.iocoder.yudao.module.system.api.subscribe.dto.SubscribeMessageReqDTO;
|
|||||||
import cn.iocoder.yudao.module.system.service.social.SocialClientService;
|
import cn.iocoder.yudao.module.system.service.social.SocialClientService;
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import me.chanjar.weixin.mp.bean.template.WxMpTemplateData;
|
||||||
|
import me.chanjar.weixin.mp.bean.template.WxMpTemplateMessage;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
@ -32,14 +35,27 @@ public class SubscribeMessageSendApiImpl implements SubscribeMessageSendApi {
|
|||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
@Override
|
@Override
|
||||||
public CommonResult<Long> sendApprovalResultNotification(SubscribeMessageReqDTO reqDTO) {
|
public CommonResult<Long> sendApprovalResultNotification(SubscribeMessageReqDTO reqDTO) {
|
||||||
socialClientService.getWxMaService().getMsgService().sendSubscribeMsg(initWxMaSubscribeMessage(reqDTO));
|
//发送审批结果通知
|
||||||
|
String type = reqDTO.getMinOrMpType() ;
|
||||||
|
if( type == null || type.equals("1") ) {
|
||||||
|
socialClientService.getWxMaService().getMsgService().sendSubscribeMsg(initWxMaSubscribeMessage(reqDTO));
|
||||||
|
} else {
|
||||||
|
socialClientService.getWxMpService().getTemplateMsgService().sendTemplateMsg(initWxMpSubscribeMessage(reqDTO)) ;
|
||||||
|
}
|
||||||
return success(1L);
|
return success(1L);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
@Override
|
@Override
|
||||||
public CommonResult<Long> sendProcessToDoReminder(SubscribeMessageReqDTO reqDTO) {
|
public CommonResult<Long> sendProcessToDoReminder(SubscribeMessageReqDTO reqDTO) {
|
||||||
socialClientService.getWxMaService().getMsgService().sendSubscribeMsg(initWxMaSubscribeMessage(reqDTO));
|
//发送OA流程待办提醒
|
||||||
|
String type = reqDTO.getMinOrMpType() ;
|
||||||
|
if( type == null || type.equals("1") ) {
|
||||||
|
socialClientService.getWxMaService().getMsgService().sendSubscribeMsg(initWxMaSubscribeMessage(reqDTO));
|
||||||
|
} else {
|
||||||
|
socialClientService.getWxMpService().getTemplateMsgService().sendTemplateMsg(initWxMpSubscribeMessage(reqDTO)) ;
|
||||||
|
|
||||||
|
}
|
||||||
return success(1L);
|
return success(1L);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,4 +100,21 @@ public class SubscribeMessageSendApiImpl implements SubscribeMessageSendApi {
|
|||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private WxMpTemplateMessage initWxMpSubscribeMessage(SubscribeMessageReqDTO reqDTO){
|
||||||
|
List<MsgData> dataList = reqDTO.getData();
|
||||||
|
List<WxMpTemplateData> data = new ArrayList<>();
|
||||||
|
for (MsgData msgData : dataList) {
|
||||||
|
WxMpTemplateData wxMpTemplateData = new WxMpTemplateData();
|
||||||
|
wxMpTemplateData.setName(msgData.getName());
|
||||||
|
wxMpTemplateData.setValue(msgData.getValue());
|
||||||
|
data.add(wxMpTemplateData) ;
|
||||||
|
}
|
||||||
|
WxMpTemplateMessage templateMessage = WxMpTemplateMessage.builder()
|
||||||
|
.toUser(reqDTO.getToUser())
|
||||||
|
.templateId(reqDTO.getTemplateId())
|
||||||
|
.data(data)
|
||||||
|
.build();
|
||||||
|
return templateMessage ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
package cn.iocoder.yudao.module.system.dal.mysql.dept;
|
package cn.iocoder.yudao.module.system.dal.mysql.dept;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO;
|
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@ -46,4 +49,15 @@ public interface DeptMapper extends BaseMapperX<DeptDO> {
|
|||||||
|
|
||||||
return selectList(new LambdaQueryWrapperX<DeptDO>().orderByAsc(DeptDO::getFlag));
|
return selectList(new LambdaQueryWrapperX<DeptDO>().orderByAsc(DeptDO::getFlag));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default DeptDO selectDeptByUserId(Long userId) {
|
||||||
|
|
||||||
|
MPJLambdaWrapperX<DeptDO> query = new MPJLambdaWrapperX<DeptDO>();
|
||||||
|
query.selectAll(DeptDO.class);
|
||||||
|
query.innerJoin(AdminUserDO.class, on -> on
|
||||||
|
.eq(AdminUserDO::getDeptId, DeptDO::getId)
|
||||||
|
.eq(AdminUserDO::getId, userId));
|
||||||
|
|
||||||
|
return selectJoinOne(DeptDO.class, query);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,6 @@ public class DataPermissionConfiguration {
|
|||||||
// dept
|
// dept
|
||||||
rule.addDeptColumn(AdminUserDO.class);
|
rule.addDeptColumn(AdminUserDO.class);
|
||||||
rule.addDeptColumn(DeptDO.class, "id");
|
rule.addDeptColumn(DeptDO.class, "id");
|
||||||
rule.addDeptColumn(LogUseDO.class, "use_user_dept");
|
|
||||||
rule.addDeptColumn(LogStatisticsDO.class, "dept_id");
|
rule.addDeptColumn(LogStatisticsDO.class, "dept_id");
|
||||||
rule.addDeptColumn(LogInstanceDO.class, "dept_id");
|
rule.addDeptColumn(LogInstanceDO.class, "dept_id");
|
||||||
rule.addDeptColumn(DeptAssetsDO.class, "dept_id");
|
rule.addDeptColumn(DeptAssetsDO.class, "dept_id");
|
||||||
@ -31,7 +30,6 @@ public class DataPermissionConfiguration {
|
|||||||
|
|
||||||
// user
|
// user
|
||||||
rule.addUserColumn(AdminUserDO.class, "id");
|
rule.addUserColumn(AdminUserDO.class, "id");
|
||||||
rule.addUserColumn(LogUseDO.class, "use_user_id");
|
|
||||||
rule.addUserColumn(LogStatisticsDO.class, "user_id");
|
rule.addUserColumn(LogStatisticsDO.class, "user_id");
|
||||||
rule.addUserColumn(LogInstanceDO.class, "start_user_id");
|
rule.addUserColumn(LogInstanceDO.class, "start_user_id");
|
||||||
};
|
};
|
||||||
|
@ -160,4 +160,11 @@ public interface DeptService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<DeptDO> getDeptListByFactoryIds(List<Long> factoryIds);
|
List<DeptDO> getDeptListByFactoryIds(List<Long> factoryIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户所在公司的信息
|
||||||
|
* @param userId 用户编号
|
||||||
|
* @return 公司信息
|
||||||
|
*/
|
||||||
|
DeptDO getUserCompanyDept(Long userId);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package cn.iocoder.yudao.module.system.service.dept;
|
package cn.iocoder.yudao.module.system.service.dept;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
@ -24,6 +25,7 @@ import java.util.*;
|
|||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
|
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
|
||||||
|
import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.TASK_OPERATE_FAIL_USER_NO_DEPT;
|
||||||
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*;
|
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -319,6 +321,7 @@ public class DeptServiceImpl implements DeptService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@DataPermission(enable = false)
|
||||||
public List<DeptDO> getCompanyDept() {
|
public List<DeptDO> getCompanyDept() {
|
||||||
|
|
||||||
return deptMapper.selectList(new LambdaQueryWrapperX<DeptDO>()
|
return deptMapper.selectList(new LambdaQueryWrapperX<DeptDO>()
|
||||||
@ -345,4 +348,27 @@ public class DeptServiceImpl implements DeptService {
|
|||||||
return deptMapper.selectList(new LambdaQueryWrapper<DeptDO>()
|
return deptMapper.selectList(new LambdaQueryWrapper<DeptDO>()
|
||||||
.in(DeptDO::getFactoryId, factoryIds));
|
.in(DeptDO::getFactoryId, factoryIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@DataPermission(enable = false)
|
||||||
|
public DeptDO getUserCompanyDept(Long userId) {
|
||||||
|
|
||||||
|
// 获取用户所在部门信息
|
||||||
|
DeptDO deptDo = deptMapper.selectDeptByUserId(userId);
|
||||||
|
|
||||||
|
if (deptDo == null) {
|
||||||
|
throw exception(TASK_OPERATE_FAIL_USER_NO_DEPT);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据所在部门信息获取 所在公司信息
|
||||||
|
List<DeptDO> companyDeptList = deptMapper.selectList(new LambdaQueryWrapperX<DeptDO>()
|
||||||
|
.likeIfPresent(DeptDO::getFlag, deptDo.getFlag())
|
||||||
|
.eq(DeptDO::getType, 0));
|
||||||
|
|
||||||
|
if (CollectionUtil.isEmpty(companyDeptList)) {
|
||||||
|
return new DeptDO();
|
||||||
|
}
|
||||||
|
|
||||||
|
return companyDeptList.get(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@ import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialClientDO;
|
|||||||
import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum;
|
import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum;
|
||||||
import com.xingyuv.jushauth.model.AuthUser;
|
import com.xingyuv.jushauth.model.AuthUser;
|
||||||
import me.chanjar.weixin.common.bean.WxJsapiSignature;
|
import me.chanjar.weixin.common.bean.WxJsapiSignature;
|
||||||
|
import me.chanjar.weixin.mp.api.WxMpService;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
|
||||||
@ -52,6 +53,12 @@ public interface SocialClientService {
|
|||||||
*/
|
*/
|
||||||
WxJsapiSignature createWxMpJsapiSignature(Integer userType, String url);
|
WxJsapiSignature createWxMpJsapiSignature(Integer userType, String url);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取WxMpService
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
WxMpService getWxMpService() ;
|
||||||
|
|
||||||
// =================== 微信小程序独有 ===================
|
// =================== 微信小程序独有 ===================
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -68,6 +68,11 @@ public class SocialClientServiceImpl implements SocialClientService {
|
|||||||
private WxMpProperties wxMpProperties;
|
private WxMpProperties wxMpProperties;
|
||||||
@Resource
|
@Resource
|
||||||
private StringRedisTemplate stringRedisTemplate; // WxMpService 需要使用到,所以在 Service 注入了它
|
private StringRedisTemplate stringRedisTemplate; // WxMpService 需要使用到,所以在 Service 注入了它
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WxMpService getWxMpService() {
|
||||||
|
return getWxMpService(2) ;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 缓存 WxMpService 对象
|
* 缓存 WxMpService 对象
|
||||||
*
|
*
|
||||||
|
@ -127,8 +127,8 @@ wx:
|
|||||||
mp: # 公众号配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md 文档
|
mp: # 公众号配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md 文档
|
||||||
# app-id: wx041349c6f39b268b
|
# app-id: wx041349c6f39b268b
|
||||||
# secret: 5abee519483bc9f8cb37ce280e814bd0
|
# secret: 5abee519483bc9f8cb37ce280e814bd0
|
||||||
app-id: wx5b23ba7a5589ecbb # 测试号
|
app-id: wx9943f95048ba8472
|
||||||
secret: 2a7b3b20c537e52e74afd395eb85f61f
|
secret: f1f5625f210142b6ae31a06c699826df
|
||||||
# 存储配置,解决 AccessToken 的跨节点的共享
|
# 存储配置,解决 AccessToken 的跨节点的共享
|
||||||
config-storage:
|
config-storage:
|
||||||
type: RedisTemplate # 采用 RedisTemplate 操作 Redis,会自动从 Spring 中获取
|
type: RedisTemplate # 采用 RedisTemplate 操作 Redis,会自动从 Spring 中获取
|
||||||
|
@ -140,8 +140,8 @@ wx:
|
|||||||
mp: # 公众号配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md 文档
|
mp: # 公众号配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md 文档
|
||||||
# app-id: wx041349c6f39b268b
|
# app-id: wx041349c6f39b268b
|
||||||
# secret: 5abee519483bc9f8cb37ce280e814bd0
|
# secret: 5abee519483bc9f8cb37ce280e814bd0
|
||||||
app-id: wx5b23ba7a5589ecbb # 测试号
|
app-id: wx9943f95048ba8472
|
||||||
secret: 2a7b3b20c537e52e74afd395eb85f61f
|
secret: f1f5625f210142b6ae31a06c699826df
|
||||||
# 存储配置,解决 AccessToken 的跨节点的共享
|
# 存储配置,解决 AccessToken 的跨节点的共享
|
||||||
config-storage:
|
config-storage:
|
||||||
type: RedisTemplate # 采用 RedisTemplate 操作 Redis,会自动从 Spring 中获取
|
type: RedisTemplate # 采用 RedisTemplate 操作 Redis,会自动从 Spring 中获取
|
||||||
|
Loading…
Reference in New Issue
Block a user