拆分 bpm 到独立的库中
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,30 @@
|
||||
package com.zt.plat.module.bpm;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* 项目的启动类
|
||||
*
|
||||
* 如果你碰到启动的问题,请认真阅读 http://172.16.46.63:30888/quick-start/ 文章
|
||||
* 如果你碰到启动的问题,请认真阅读 http://172.16.46.63:30888/quick-start/ 文章
|
||||
* 如果你碰到启动的问题,请认真阅读 http://172.16.46.63:30888/quick-start/ 文章
|
||||
*
|
||||
* @author ZT
|
||||
*/
|
||||
@SpringBootApplication
|
||||
public class BpmServerApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
// 如果你碰到启动的问题,请认真阅读 http://172.16.46.63:30888/quick-start/ 文章
|
||||
// 如果你碰到启动的问题,请认真阅读 http://172.16.46.63:30888/quick-start/ 文章
|
||||
// 如果你碰到启动的问题,请认真阅读 http://172.16.46.63:30888/quick-start/ 文章
|
||||
|
||||
SpringApplication.run(BpmServerApplication.class, args);
|
||||
|
||||
// 如果你碰到启动的问题,请认真阅读 http://172.16.46.63:30888/quick-start/ 文章
|
||||
// 如果你碰到启动的问题,请认真阅读 http://172.16.46.63:30888/quick-start/ 文章
|
||||
// 如果你碰到启动的问题,请认真阅读 http://172.16.46.63:30888/quick-start/ 文章
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.zt.plat.module.bpm.api.definition;
|
||||
|
||||
import com.zt.plat.framework.common.enums.CommonStatusEnum;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.module.bpm.api.definition.dto.BpmCategoryPageReqDTO;
|
||||
import com.zt.plat.module.bpm.api.definition.dto.BpmCategoryRespDTO;
|
||||
import com.zt.plat.module.bpm.api.definition.dto.BpmCategorySaveReqDTO;
|
||||
import com.zt.plat.module.bpm.controller.admin.definition.vo.category.BpmCategoryPageReqVO;
|
||||
import com.zt.plat.module.bpm.controller.admin.definition.vo.category.BpmCategorySaveReqVO;
|
||||
import com.zt.plat.module.bpm.dal.dataobject.definition.BpmCategoryDO;
|
||||
import com.zt.plat.module.bpm.service.definition.BpmCategoryService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* BPM 流程分类 Api 实现类
|
||||
*
|
||||
* @author ZT
|
||||
*/
|
||||
@RestController
|
||||
@Validated
|
||||
public class BpmCategoryApiImpl implements BpmCategoryApi {
|
||||
|
||||
@Resource
|
||||
private BpmCategoryService categoryService;
|
||||
|
||||
@Override
|
||||
public CommonResult<Long> createCategory(@Valid BpmCategorySaveReqDTO createReqDTO) {
|
||||
BpmCategorySaveReqVO createReqVO = BeanUtils.toBean(createReqDTO, BpmCategorySaveReqVO.class);
|
||||
return success(categoryService.createCategory(createReqVO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> updateCategory(@Valid BpmCategorySaveReqDTO updateReqDTO) {
|
||||
BpmCategorySaveReqVO updateReqVO = BeanUtils.toBean(updateReqDTO, BpmCategorySaveReqVO.class);
|
||||
categoryService.updateCategory(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> updateCategorySortBatch(List<Long> ids) {
|
||||
categoryService.updateCategorySortBatch(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> deleteCategory(Long id) {
|
||||
categoryService.deleteCategory(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<BpmCategoryRespDTO> getCategory(Long id) {
|
||||
BpmCategoryDO category = categoryService.getCategory(id);
|
||||
return success(BeanUtils.toBean(category, BpmCategoryRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<PageResult<BpmCategoryRespDTO>> getCategoryPage(@Valid BpmCategoryPageReqDTO pageReqDTO) {
|
||||
BpmCategoryPageReqVO pageReqVO = BeanUtils.toBean(pageReqDTO, BpmCategoryPageReqVO.class);
|
||||
PageResult<BpmCategoryDO> pageResult = categoryService.getCategoryPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, BpmCategoryRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<BpmCategoryRespDTO>> getCategorySimpleList() {
|
||||
List<BpmCategoryDO> list = categoryService.getCategoryListByStatus(CommonStatusEnum.ENABLE.getStatus());
|
||||
return success(BeanUtils.toBean(list, BpmCategoryRespDTO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.zt.plat.module.bpm.api.definition;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.module.bpm.api.definition.dto.BpmFormPageReqDTO;
|
||||
import com.zt.plat.module.bpm.api.definition.dto.BpmFormRespDTO;
|
||||
import com.zt.plat.module.bpm.api.definition.dto.BpmFormSaveReqDTO;
|
||||
import com.zt.plat.module.bpm.controller.admin.definition.vo.form.BpmFormPageReqVO;
|
||||
import com.zt.plat.module.bpm.controller.admin.definition.vo.form.BpmFormSaveReqVO;
|
||||
import com.zt.plat.module.bpm.dal.dataobject.definition.BpmFormDO;
|
||||
import com.zt.plat.module.bpm.service.definition.BpmFormService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 动态表单 Api 实现类
|
||||
*
|
||||
* @author ZT
|
||||
*/
|
||||
@RestController
|
||||
@Validated
|
||||
public class BpmFormApiImpl implements BpmFormApi {
|
||||
|
||||
@Resource
|
||||
private BpmFormService formService;
|
||||
|
||||
@Override
|
||||
public CommonResult<Long> createForm(@Valid BpmFormSaveReqDTO createReqDTO) {
|
||||
BpmFormSaveReqVO createReqVO = BeanUtils.toBean(createReqDTO, BpmFormSaveReqVO.class);
|
||||
return success(formService.createForm(createReqVO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> updateForm(@Valid BpmFormSaveReqDTO updateReqDTO) {
|
||||
BpmFormSaveReqVO updateReqVO = BeanUtils.toBean(updateReqDTO, BpmFormSaveReqVO.class);
|
||||
formService.updateForm(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> deleteForm(Long id) {
|
||||
formService.deleteForm(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<BpmFormRespDTO> getForm(Long id) {
|
||||
BpmFormDO form = formService.getForm(id);
|
||||
return success(BeanUtils.toBean(form, BpmFormRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<PageResult<BpmFormRespDTO>> getFormPage(BpmFormPageReqDTO pageReqDTO) {
|
||||
BpmFormPageReqVO pageReqVO = BeanUtils.toBean(pageReqDTO, BpmFormPageReqVO.class);
|
||||
PageResult<BpmFormDO> pageResult = formService.getFormPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, BpmFormRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<BpmFormRespDTO>> getFormSimpleList() {
|
||||
List<BpmFormDO> list = formService.getFormList();
|
||||
// 只返回 id、name 字段
|
||||
List<BpmFormRespDTO> dtoList = list.stream()
|
||||
.map(formDO -> new BpmFormRespDTO().setId(formDO.getId()).setName(formDO.getName()))
|
||||
.collect(java.util.stream.Collectors.toList());
|
||||
return success(dtoList);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.zt.plat.module.bpm.api.definition;
|
||||
|
||||
import com.zt.plat.framework.common.enums.CommonStatusEnum;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.module.bpm.api.definition.dto.BpmUserGroupRespDTO;
|
||||
import com.zt.plat.module.bpm.dal.dataobject.definition.BpmUserGroupDO;
|
||||
import com.zt.plat.module.bpm.service.definition.BpmUserGroupService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 用户组 Api 实现类
|
||||
*
|
||||
* @author ZT
|
||||
*/
|
||||
@RestController
|
||||
@Validated
|
||||
public class BpmUserGroupApiImpl implements BpmUserGroupApi {
|
||||
|
||||
@Resource
|
||||
private BpmUserGroupService userGroupService;
|
||||
|
||||
@Override
|
||||
public CommonResult<BpmUserGroupRespDTO> getUserGroup(Long id) {
|
||||
BpmUserGroupDO userGroup = userGroupService.getUserGroup(id);
|
||||
return success(BeanUtils.toBean(userGroup, BpmUserGroupRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<BpmUserGroupRespDTO>> getUserGroupSimpleList() {
|
||||
List<BpmUserGroupDO> list = userGroupService.getUserGroupListByStatus(CommonStatusEnum.ENABLE.getStatus());
|
||||
return success(BeanUtils.toBean(list, BpmUserGroupRespDTO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* bpm API 实现类,定义暴露给其它模块的 API
|
||||
*/
|
||||
package com.zt.plat.module.bpm.api;
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,15 @@
|
||||
package com.zt.plat.module.bpm.controller.admin.base.dept;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "部门精简信息 VO")
|
||||
@Data
|
||||
public class DeptSimpleBaseVO {
|
||||
|
||||
@Schema(description = "部门编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long id;
|
||||
@Schema(description = "部门名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "技术部")
|
||||
private String name;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 基础包,放一些通用的 VO 类
|
||||
*/
|
||||
package com.zt.plat.module.bpm.controller.admin.base;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user