15 Commits

Author SHA1 Message Date
pan
a2b843bdf3 1、部门名称 2024-09-02 10:41:34 +08:00
hanjian
2e06c76916 update 2024-09-02 08:39:58 +08:00
pan
10ee4fbc4d 1、文档中心权限调整
2、下载权限调整
3、消息中心
4、修复预览关闭窗口时视屏播放暂停不了问题
2024-09-01 10:58:06 +08:00
晴朗
7820d4907f 增加文件统计后端 2024-08-31 17:58:10 +08:00
pan
2561546ac2 Merge remote-tracking branch 'origin/v1.0' into v1.0 2024-08-31 16:11:30 +08:00
pan
b6a66db6cb 统计代码 2024-08-31 16:11:20 +08:00
晴朗
9331b57b58 新增菜单,业务字典,去掉导出按钮;在字典类型列表不能新增、修改、删除; 点击类型进入字典列表内可以操作 2024-08-31 15:18:27 +08:00
pan
d732771032 1、新增评论、回复功能
2、工具发布权限完善一部分
2024-08-30 19:47:45 +08:00
pan
f0a14bcd3c 1、发布工具流程-关联工具细节调整
2、文档资源管理调整
2024-08-29 22:01:03 +08:00
pan
f1b84cb823 Merge remote-tracking branch 'origin/v1.0_lukg' into v1.0 2024-08-28 17:41:26 +08:00
pan
a272e06018 1、新增文档分类管理
2、新增资源管理开发
2024-08-28 17:40:03 +08:00
liukang
423c2ad275 工具发布流程和使用申请流程细节优化 2024-08-28 17:28:04 +08:00
liukang
a230a1c2d8 工具发布流程和使用申请流程细节优化 2024-08-28 14:50:05 +08:00
liukang
0e18f96534 工具发布流程和使用申请流程细节优化 2024-08-27 18:17:42 +08:00
liukang
fbc96e81e3 工具发布流程和使用申请流程 2024-08-21 18:06:12 +08:00
93 changed files with 8022 additions and 479 deletions

View File

@@ -3,14 +3,14 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.rzdata</groupId>
<artifactId>tool-tech</artifactId>
<version>3.8.8</version>
<name>tool-tech</name>
<description>工具与技术交流管理系统</description>
<properties>
<tool-tech.version>3.8.8</tool-tech.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -285,4 +285,4 @@
</pluginRepository>
</pluginRepositories>
</project>
</project>

View File

@@ -16,7 +16,26 @@
</description>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>21.0</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.9.2</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.76</version>
</dependency>
<dependency>
<groupId>com.blueland.bpmclient</groupId>
<artifactId>workflow-sdk</artifactId>
<version>0.1.5</version>
</dependency>
<!-- 核心模块-->
<dependency>
<groupId>com.rzdata</groupId>
@@ -85,17 +104,17 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.1.0</version>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<warName>${project.artifactId}</warName>
</configuration>
</plugin>
</configuration>
</plugin>
</plugins>
<finalName>${project.artifactId}</finalName>
</build>
</project>
</project>

View File

@@ -1,18 +1,5 @@
package com.rzdata.web.controller.common;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.rzdata.common.config.JaConfig;
import com.rzdata.common.constant.Constants;
import com.rzdata.common.core.domain.AjaxResult;
@@ -20,6 +7,22 @@ import com.rzdata.common.utils.StringUtils;
import com.rzdata.common.utils.file.FileUploadUtils;
import com.rzdata.common.utils.file.FileUtils;
import com.rzdata.framework.config.ServerConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.util.*;
/**
* 通用请求处理
@@ -84,7 +87,8 @@ public class CommonController
String url = serverConfig.getUrl() + fileName;
AjaxResult ajax = AjaxResult.success();
ajax.put("url", url);
ajax.put("fileName", fileName);
ajax.put("filePath", fileName);
ajax.put("suffixType", FileUploadUtils.extractSuffix(fileName));
ajax.put("newFileName", FileUtils.getName(fileName));
ajax.put("originalFilename", file.getOriginalFilename());
return ajax;
@@ -160,4 +164,70 @@ public class CommonController
log.error("下载文件失败", e);
}
}
@PostMapping("/initUpload")
public ResponseEntity<Map<String, String>> initUpload(@RequestParam("fileName") String fileName) {
// 上传文件路径
String filePath = JaConfig.getUploadPath();
String uploadId = UUID.randomUUID().toString();
// 创建临时目录用于存放分片文件
new File(filePath + "/" + uploadId).mkdirs();
Map<String, String> response = new HashMap<>();
response.put("uploadId", uploadId);
return ResponseEntity.ok(response);
}
@PostMapping("/uploadChunk")
public ResponseEntity<Map<String, String>> uploadChunk(
@RequestParam("chunkFile") MultipartFile chunkFile,
@RequestParam("uploadId") String uploadId,
@RequestParam("chunkId") int chunkId) {
String filePath = JaConfig.getUploadPath();
String chunkFilePath = filePath + "/" + uploadId + "/" + chunkId;
try {
chunkFile.transferTo(new File(chunkFilePath));
Map<String, String> response = new HashMap<>();
response.put("status", "200");
return ResponseEntity.ok(response);
} catch (IOException e) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
}
}
@PostMapping("/mergeFile")
public ResponseEntity<Map<String, String>> mergeFile(@RequestParam("uploadId") String uploadId,
@RequestParam("fileName") String fileName) {
String filePath = JaConfig.getUploadPath();
//String finalFilePath = FileUploadUtils.generateMergedFilePath(filePath, fileName);
String fileNamePath = FileUploadUtils.getFilePath(filePath, fileName);
String finalFilePath = filePath + fileNamePath.replace("profile/upload/", "") ;
File dir = new File(filePath + "/" + uploadId);
File[] chunkFiles = dir.listFiles();
// 按文件名即chunkId排序
Arrays.sort(chunkFiles, Comparator.comparingInt(f -> Integer.parseInt(f.getName())));
try (FileOutputStream fos = new FileOutputStream(finalFilePath)) {
for (File chunk : chunkFiles) {
Files.copy(chunk.toPath(), fos);
}
Map<String, String> response = new HashMap<>();
String url = serverConfig.getUrl() + fileNamePath;
response.put("url", url);
response.put("filePath", fileNamePath);
response.put("suffixType", FileUploadUtils.extractSuffix(fileNamePath));
response.put("newFileName", FileUtils.getName(fileNamePath));
response.put("originalFilename", fileName);
return ResponseEntity.ok(response);
} catch (IOException e) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
} finally {
// 清理临时文件
Arrays.stream(chunkFiles).forEach(File::delete);
dir.delete();
}
}
}

View File

@@ -0,0 +1,115 @@
package com.rzdata.web.controller.document;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.rzdata.common.core.domain.DocumentCategory;
import com.rzdata.web.service.IDocumentCategoryService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.rzdata.common.annotation.Log;
import com.rzdata.common.core.controller.BaseController;
import com.rzdata.common.core.domain.AjaxResult;
import com.rzdata.common.enums.BusinessType;
import com.rzdata.common.utils.poi.ExcelUtil;
import com.rzdata.common.core.page.TableDataInfo;
/**
* 文档资源分类管理Controller
*
* @author spongepan
* @date 2024-08-27
*/
@RestController
@RequestMapping("/system/category")
public class DocumentCategoryController extends BaseController
{
@Autowired
private IDocumentCategoryService documentCategoryService;
/**
* 查询文档资源分类管理列表
*/
@PreAuthorize("@ss.hasPermi('system:category:list')")
@GetMapping("/list")
public TableDataInfo list(DocumentCategory documentCategory)
{
startPage();
List<DocumentCategory> list = documentCategoryService.selectDocumentCategoryList(documentCategory);
return getDataTable(list);
}
/**
* 导出文档资源分类管理列表
*/
@PreAuthorize("@ss.hasPermi('system:category:export')")
@Log(title = "文档资源分类管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DocumentCategory documentCategory)
{
List<DocumentCategory> list = documentCategoryService.selectDocumentCategoryList(documentCategory);
ExcelUtil<DocumentCategory> util = new ExcelUtil<DocumentCategory>(DocumentCategory.class);
util.exportExcel(response, list, "文档资源分类管理数据");
}
/**
* 获取文档资源分类管理详细信息
*/
@PreAuthorize("@ss.hasPermi('system:category:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return success(documentCategoryService.selectDocumentCategoryById(id));
}
/**
* 新增文档资源分类管理
*/
@PreAuthorize("@ss.hasPermi('system:category:add')")
@Log(title = "文档资源分类管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DocumentCategory documentCategory)
{
return toAjax(documentCategoryService.insertDocumentCategory(documentCategory));
}
/**
* 修改文档资源分类管理
*/
@PreAuthorize("@ss.hasPermi('system:category:edit')")
@Log(title = "文档资源分类管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody DocumentCategory documentCategory)
{
return toAjax(documentCategoryService.updateDocumentCategory(documentCategory));
}
/**
* 删除文档资源分类管理
*/
@PreAuthorize("@ss.hasPermi('system:category:remove')")
@Log(title = "文档资源分类管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(documentCategoryService.deleteDocumentCategoryByIds(ids));
}
/**
* 获取文档分类树列表
*/
@GetMapping("/documentTree")
public AjaxResult deptTree(DocumentCategory documentCategory)
{
return success(documentCategoryService.selectDocumentTreeList(documentCategory));
}
}

View File

@@ -32,6 +32,7 @@ public class DocumentController extends BaseController
/**
* 查询【文档资源信息】列表
*/
@PreAuthorize("@ss.hasPermi('document:list')")
@GetMapping("/list")
public TableDataInfo list(Document Document)
{
@@ -44,12 +45,13 @@ public class DocumentController extends BaseController
* 导出【文档资源信息】列表
*/
@Log(title = "【文档资源信息】", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('document:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, Document Document)
public void export(HttpServletResponse response, Document document)
{
List<Document> list = documentService.selectDocumentList(Document);
List<Document> list = documentService.selectDocumentList(document);
ExcelUtil<Document> util = new ExcelUtil<Document>(Document.class);
util.exportExcel(response, list, "【文档资源信息】数据");
util.exportExcel(response, list, "【文档资源信息】数据", document.getExcludeFields());
}
/**
@@ -65,6 +67,7 @@ public class DocumentController extends BaseController
* 新增【文档资源信息】
*/
@Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
@PreAuthorize("@ss.hasPermi('document:add')")
@PostMapping
public AjaxResult add(@RequestBody Document Document)
{
@@ -79,6 +82,7 @@ public class DocumentController extends BaseController
* 修改【文档资源信息】
*/
@Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
@PreAuthorize("@ss.hasPermi('document:edit')")
@PutMapping
public AjaxResult edit(@RequestBody Document Document)
{
@@ -88,10 +92,32 @@ public class DocumentController extends BaseController
/**
* 删除【文档资源信息】
*/
@Log(title = "请填写功能名称", businessType = BusinessType.DELETE)
@Log(title = "逻辑删除-文档资源信息", businessType = BusinessType.DELETE)
@PreAuthorize("@ss.hasPermi('document:remove')")
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(documentService.deleteDocumentByIds(ids));
}
/**
* 发布文档
*/
@Log(title = "【发布逻辑】", businessType = BusinessType.UPDATE)
@PreAuthorize("@ss.hasPermi('document:push')")
@PutMapping("/pushDoc/{ids}")
public AjaxResult pushDoc(@PathVariable String[] ids)
{
return toAjax(documentService.pushDoc(ids));
}
/**
* 文档统计,涉及文档类别统计、文档来源统计
*/
@GetMapping("/statistics")
public AjaxResult statistics()
{
return AjaxResult.success(documentService.statistics());
}
}

View File

@@ -43,6 +43,16 @@ public class SysDictTypeController extends BaseController
return getDataTable(list);
}
@PreAuthorize("@ss.hasPermi('system:bizlist:list')")
@GetMapping("/bizlist")
public TableDataInfo bizlist(SysDictType dictType)
{
startPage();
List<SysDictType> list = dictTypeService.selectBizDictTypeList(dictType);
return getDataTable(list);
}
@Log(title = "字典类型", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:dict:export')")
@PostMapping("/export")

View File

@@ -55,7 +55,6 @@ public class SysUserController extends BaseController
/**
* 获取用户列表
*/
@PreAuthorize("@ss.hasPermi('system:user:list')")
@GetMapping("/list")
public TableDataInfo list(SysUser user)
{
@@ -246,7 +245,7 @@ public class SysUserController extends BaseController
/**
* 获取部门树列表
*/
@PreAuthorize("@ss.hasPermi('system:user:list')")
//@PreAuthorize("@ss.hasPermi('system:user:list')")
@GetMapping("/deptTree")
public AjaxResult deptTree(SysDept dept)
{

View File

@@ -0,0 +1,105 @@
package com.rzdata.web.controller.tool;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.rzdata.web.domain.Attachment;
import com.rzdata.web.service.IAttachmentService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.rzdata.common.annotation.Log;
import com.rzdata.common.core.controller.BaseController;
import com.rzdata.common.core.domain.AjaxResult;
import com.rzdata.common.enums.BusinessType;
import com.rzdata.common.utils.poi.ExcelUtil;
import com.rzdata.common.core.page.TableDataInfo;
/**
* 附件Controller
*
* @author panchichun
* @date 2024-08-28
*/
@RestController
@RequestMapping("/system/attachment")
public class AttachmentController extends BaseController
{
@Autowired
private IAttachmentService attachmentService;
/**
* 查询附件列表
*/
@PreAuthorize("@ss.hasPermi('system:attachment:list')")
@GetMapping("/list")
public TableDataInfo list(Attachment attachment)
{
startPage();
List<Attachment> list = attachmentService.selectAttachmentList(attachment);
return getDataTable(list);
}
/**
* 导出附件列表
*/
@PreAuthorize("@ss.hasPermi('system:attachment:export')")
@Log(title = "附件", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, Attachment attachment)
{
List<Attachment> list = attachmentService.selectAttachmentList(attachment);
ExcelUtil<Attachment> util = new ExcelUtil<Attachment>(Attachment.class);
util.exportExcel(response, list, "附件数据");
}
/**
* 获取附件详细信息
*/
@PreAuthorize("@ss.hasPermi('system:attachment:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return success(attachmentService.selectAttachmentById(id));
}
/**
* 新增附件
*/
@PreAuthorize("@ss.hasPermi('system:attachment:add')")
@Log(title = "附件", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody Attachment attachment)
{
return toAjax(attachmentService.insertAttachment(attachment));
}
/**
* 修改附件
*/
@PreAuthorize("@ss.hasPermi('system:attachment:edit')")
@Log(title = "附件", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody Attachment attachment)
{
return toAjax(attachmentService.updateAttachment(attachment));
}
/**
* 删除附件
*/
@PreAuthorize("@ss.hasPermi('system:attachment:remove')")
@Log(title = "附件", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(attachmentService.deleteAttachmentByIds(ids));
}
}

View File

@@ -0,0 +1,102 @@
package com.rzdata.web.controller.tool;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.rzdata.web.domain.Discussions;
import com.rzdata.web.service.IDiscussionsService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.rzdata.common.annotation.Log;
import com.rzdata.common.core.controller.BaseController;
import com.rzdata.common.core.domain.AjaxResult;
import com.rzdata.common.enums.BusinessType;
import com.rzdata.common.utils.poi.ExcelUtil;
import com.rzdata.common.core.page.TableDataInfo;
/**
* 讨论Controller
*
* @author panchichun
* @date 2024-08-30
*/
@RestController
@RequestMapping("/discussions")
public class DiscussionsController extends BaseController
{
@Autowired
private IDiscussionsService discussionsService;
/**
* 查询讨论列表
*/
@GetMapping("/list")
public TableDataInfo list(Discussions discussions)
{
List<Discussions> list = discussionsService.selectDiscussionsList(discussions);
return getDataTable(list);
}
/**
* 导出讨论列表
*/
@PreAuthorize("@ss.hasPermi('system:discussions:export')")
@Log(title = "讨论", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, Discussions discussions)
{
List<Discussions> list = discussionsService.selectDiscussionsList(discussions);
ExcelUtil<Discussions> util = new ExcelUtil<Discussions>(Discussions.class);
util.exportExcel(response, list, "讨论数据");
}
/**
* 获取讨论详细信息
*/
@PreAuthorize("@ss.hasPermi('system:discussions:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return success(discussionsService.selectDiscussionsById(id));
}
/**
* 新增讨论
*/
@Log(title = "讨论", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody Discussions discussions)
{
return toAjax(discussionsService.insertDiscussions(discussions));
}
/**
* 修改讨论
*/
@PreAuthorize("@ss.hasPermi('system:discussions:edit')")
@Log(title = "讨论", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody Discussions discussions)
{
return toAjax(discussionsService.updateDiscussions(discussions));
}
/**
* 删除讨论
*/
@PreAuthorize("@ss.hasPermi('system:discussions:remove')")
@Log(title = "讨论", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(discussionsService.deleteDiscussionsByIds(ids));
}
}

View File

@@ -0,0 +1,118 @@
package com.rzdata.web.controller.tool;
import javax.servlet.http.HttpServletResponse;
import com.rzdata.common.utils.poi.ExcelUtil;
import com.rzdata.web.domain.DownloadCount;
import com.rzdata.web.service.IDownloadCountService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.rzdata.common.annotation.Log;
import com.rzdata.common.core.controller.BaseController;
import com.rzdata.common.core.domain.AjaxResult;
import com.rzdata.common.enums.BusinessType;
import com.rzdata.common.core.page.TableDataInfo;
import java.util.List;
/**
* 工具下载统计Controller
*
* @author 潘驰春
* @date 2024-08-31
*/
@RestController
@RequestMapping("/system/count")
public class DownloadCountController extends BaseController
{
@Autowired
private IDownloadCountService downloadCountService;
/**
* 查询工具下载统计列表
*/
@GetMapping("/list")
public TableDataInfo list(DownloadCount downloadCount)
{
startPage();
List<DownloadCount> list = downloadCountService.selectDownloadCountList(downloadCount);
return getDataTable(list);
}
/**
* 根据详情统计
*/
@GetMapping("/user/down/list")
public TableDataInfo userDownList(DownloadCount downloadCount)
{
startPage();
List<DownloadCount> list = downloadCountService.userDownList(downloadCount);
return getDataTable(list);
}
/**
* 导出工具下载统计列表
*/
@PreAuthorize("@ss.hasPermi('system:count:export')")
@Log(title = "工具下载统计", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DownloadCount downloadCount)
{
List<DownloadCount> list = downloadCountService.selectDownloadCountList(downloadCount);
ExcelUtil<DownloadCount> util = new ExcelUtil<DownloadCount>(DownloadCount.class);
util.exportExcel(response, list, "工具下载统计数据");
}
/**
* 获取工具下载统计详细信息
*/
@PreAuthorize("@ss.hasPermi('system:count:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return success(downloadCountService.selectDownloadCountById(id));
}
/**
* 新增工具下载统计
*/
@PreAuthorize("@ss.hasPermi('system:count:add')")
@Log(title = "工具下载统计", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DownloadCount downloadCount)
{
return toAjax(downloadCountService.insertDownloadCount(downloadCount));
}
/**
* 修改工具下载统计
*/
@PreAuthorize("@ss.hasPermi('system:count:edit')")
@Log(title = "工具下载统计", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody DownloadCount downloadCount)
{
return toAjax(downloadCountService.updateDownloadCount(downloadCount));
}
/**
* 删除工具下载统计
*/
@PreAuthorize("@ss.hasPermi('system:count:remove')")
@Log(title = "工具下载统计", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(downloadCountService.deleteDownloadCountByIds(ids));
}
}

View File

@@ -0,0 +1,104 @@
package com.rzdata.web.controller.tool;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.rzdata.web.domain.Replies;
import com.rzdata.web.service.IRepliesService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.rzdata.common.annotation.Log;
import com.rzdata.common.core.controller.BaseController;
import com.rzdata.common.core.domain.AjaxResult;
import com.rzdata.common.enums.BusinessType;
import com.rzdata.common.utils.poi.ExcelUtil;
import com.rzdata.common.core.page.TableDataInfo;
/**
* 回复Controller
*
* @author panchichun
* @date 2024-08-30
*/
@RestController
@RequestMapping("/replies")
public class RepliesController extends BaseController
{
@Autowired
private IRepliesService repliesService;
/**
* 查询回复列表
*/
@PreAuthorize("@ss.hasPermi('system:replies:list')")
@GetMapping("/list")
public TableDataInfo list(Replies replies)
{
startPage();
List<Replies> list = repliesService.selectRepliesList(replies);
return getDataTable(list);
}
/**
* 导出回复列表
*/
@PreAuthorize("@ss.hasPermi('system:replies:export')")
@Log(title = "回复", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, Replies replies)
{
List<Replies> list = repliesService.selectRepliesList(replies);
ExcelUtil<Replies> util = new ExcelUtil<Replies>(Replies.class);
util.exportExcel(response, list, "回复数据");
}
/**
* 获取回复详细信息
*/
@PreAuthorize("@ss.hasPermi('system:replies:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return success(repliesService.selectRepliesById(id));
}
/**
* 新增回复
*/
@Log(title = "回复", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody Replies replies)
{
return toAjax(repliesService.insertReplies(replies));
}
/**
* 修改回复
*/
@PreAuthorize("@ss.hasPermi('system:replies:edit')")
@Log(title = "回复", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody Replies replies)
{
return toAjax(repliesService.updateReplies(replies));
}
/**
* 删除回复
*/
@PreAuthorize("@ss.hasPermi('system:replies:remove')")
@Log(title = "回复", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(repliesService.deleteRepliesByIds(ids));
}
}

View File

@@ -0,0 +1,175 @@
package com.rzdata.web.controller.tool;
import cn.hutool.core.util.BooleanUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.blueland.bpmclient.model.BpmClientInputModel;
import com.blueland.bpmclient.model.ProcessInstanceModel;
import com.rzdata.common.annotation.Log;
import com.rzdata.common.constant.Constants;
import com.rzdata.common.core.controller.BaseController;
import com.rzdata.common.core.domain.AjaxResult;
import com.rzdata.common.core.page.TableDataInfo;
import com.rzdata.common.enums.BusinessType;
import com.rzdata.common.enums.RecordStatusEnum;
import com.rzdata.common.utils.DateUtils;
import com.rzdata.common.utils.StringUtils;
import com.rzdata.common.utils.poi.ExcelUtil;
import com.rzdata.web.domain.ToolApply;
import com.rzdata.web.domain.bo.BpmClientInputModelBo;
import com.rzdata.web.service.IToolApplyService;
import com.rzdata.web.service.IUseApplyItemService;
import com.rzdata.web.service.WorkflowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 申请Controller
*
* @author ja
* @date 2024-08-21
*/
@RestController
@RequestMapping("/tool/apply")
public class ToolApplyController extends BaseController
{
@Autowired
private IToolApplyService toolApplyService;
@Autowired
private WorkflowService workflowService;
@Autowired
private IUseApplyItemService useApplyItemService;
/**
* 查询使用申请列表
*/
@PreAuthorize("@ss.hasPermi('system:apply:list')")
@GetMapping("/list")
public TableDataInfo list(ToolApply toolApply)
{
startPage();
List<ToolApply> list = toolApplyService.selectToolApplyList(toolApply);
return getDataTable(list);
}
/**
* 获取工具信息详细信息
*/
@GetMapping(value = "/bpmc/{bpmcId}")
public AjaxResult getInfoByBpmcId(@PathVariable("bpmcId") String bpmcId)
{
return success(toolApplyService.getInfoByBpmcId(bpmcId));
}
/**
* 导出使用申请列表
*/
@PreAuthorize("@ss.hasPermi('system:apply:export')")
@Log(title = "使用申请", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ToolApply toolApply)
{
List<ToolApply> list = toolApplyService.selectToolApplyList(toolApply);
ExcelUtil<ToolApply> util = new ExcelUtil<ToolApply>(ToolApply.class);
util.exportExcel(response, list, "使用申请数据");
}
/**
* 获取使用申请详细信息
*/
@PreAuthorize("@ss.hasPermi('system:apply:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return success(toolApplyService.selectToolApplyById(id));
}
/**
* 新增使用申请
*/
@Log(title = "使用申请", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ToolApply toolApply)
{
boolean add = false;
if (StringUtils.isEmpty(toolApply.getId())) {
toolApply.setId(IdUtil.simpleUUID());
add = true;
}
ProcessInstanceModel processInstanceModel = null;
try {
if(StringUtils.equals(toolApply.getRecordStatus(), RecordStatusEnum.DRAFT.getCode())){
processInstanceModel = workflowService.saveExecute(toolApply.getBpmClientInputModel(), toolApply.getId());
}else if (StringUtils.equals(toolApply.getRecordStatus(), RecordStatusEnum.CANCEL.getCode())){
processInstanceModel = workflowService.cancelExecute(toolApply.getBpmClientInputModel(), toolApply.getId());
}else{
processInstanceModel = workflowService.nextExecute(toolApply.getBpmClientInputModel(), toolApply.getId());
}
} catch (Exception e) {
e.printStackTrace();
}
if (processInstanceModel != null && StringUtils.isNotEmpty(processInstanceModel.getProcInstId())) {
if (add) {
BpmClientInputModelBo bpmClientInputModelBo = toolApply.getBpmClientInputModel();
if(null != bpmClientInputModelBo){
BpmClientInputModel bpmClientInputModel = bpmClientInputModelBo.getModel();
toolApply.setProcTitle(StrUtil.isNotEmpty(bpmClientInputModel.getWf_procTitle()) ? bpmClientInputModel.getWf_procTitle() : "");
}
if(toolApply.getItemList().size() > 0){
toolApply.setToolId(toolApply.getItemList().get(0).getToolId());
}
toolApply.setApplyType(Constants.TOOL_APPLY_TYPE_USE);
toolApply.setProcInstId(processInstanceModel.getProcInstId());
toolApplyService.insertToolApply(toolApply);
useApplyItemService.updateItemList(toolApply.getItemList(), toolApply.getId());
}else if (BooleanUtil.isTrue(toolApply.getEditStatus())){
toolApplyService.updateToolApply(toolApply);
useApplyItemService.updateItemList(toolApply.getItemList(), toolApply.getId());
}else {
ToolApply updateStatus = new ToolApply();
updateStatus.setId(toolApply.getId());
updateStatus.setRecordStatus(toolApply.getRecordStatus());
if("done".equals(toolApply.getRecordStatus())){
toolApply.setEndTime(DateUtils.getNowDate());
}
toolApplyService.updateToolApply(updateStatus);
}
//办结
if(RecordStatusEnum.DONE.getCode().equals(toolApply)){
//给消息中心发送消息
toolApplyService.sendTzMessage(toolApply);
}
return AjaxResult.success("操作成功",processInstanceModel);
}else {
return AjaxResult.error();
}
}
/**
* 修改使用申请
*/
@Log(title = "使用申请", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
public AjaxResult edit(@RequestBody ToolApply toolApply)
{
return toAjax(toolApplyService.updateToolApply(toolApply));
}
/**
* 删除使用申请
*/
@PreAuthorize("@ss.hasPermi('system:apply:remove')")
@Log(title = "使用申请", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(toolApplyService.deleteToolApplyByIds(ids));
}
}

View File

@@ -1,21 +1,35 @@
package com.rzdata.web.controller.tool;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.BooleanUtil;
import cn.hutool.core.util.IdUtil;
import com.blueland.bpmclient.model.ProcessInstanceModel;
import com.rzdata.common.annotation.Log;
import com.rzdata.common.constant.Constants;
import com.rzdata.common.core.controller.BaseController;
import com.rzdata.common.core.domain.AjaxResult;
import com.rzdata.common.core.page.TableDataInfo;
import com.rzdata.common.enums.BizExceptionCodeEnum;
import com.rzdata.common.enums.BusinessType;
import com.rzdata.common.exception.RestException;
import com.rzdata.common.enums.RecordStatusEnum;
import com.rzdata.common.utils.DateUtils;
import com.rzdata.common.utils.SecurityUtils;
import com.rzdata.common.utils.StringUtils;
import com.rzdata.common.utils.poi.ExcelUtil;
import com.rzdata.system.service.ISysDeptService;
import com.rzdata.web.domain.Tool;
import com.rzdata.web.domain.ToolApply;
import com.rzdata.web.service.IDocumentService;
import com.rzdata.web.service.IToolApplyService;
import com.rzdata.web.service.IToolService;
import com.rzdata.web.service.WorkflowService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 工具信息Controller
@@ -30,14 +44,41 @@ public class ToolController extends BaseController
@Autowired
private IToolService toolService;
@Autowired
private WorkflowService workflowService;
@Autowired
private IToolApplyService iToolApplyService;
@Autowired
private ISysDeptService iSysDeptService;
@Autowired
private IDocumentService iDocumentService;
@Autowired
private IToolApplyService toolApplyService;
/**
* 查询工具信息列表
*/
@PreAuthorize("@ss.hasPermi('tool:list')")
@GetMapping("/list")
public TableDataInfo list(Tool tool)
{
startPage();
List<Tool> list = toolService.selectToolList(tool);
//前端传传参开启下载权限验证
if (BooleanUtil.isTrue(tool.getDownloadCheck())) {
String userId = SecurityUtils.getUserId().toString();
for (Tool vo:list) {
//已发布的工具 是创建人 或者 配置了下载权限 或者 通过了使用申请的
vo.setDownloadStatus(RecordStatusEnum.DONE.getCode().equals(vo.getRecordStatus())&&
(userId.equals(vo.getCreateBy())||
SecurityUtils.hasPermi(Constants.DOWNLOAD_TOOL_PERMISSION)||
iToolApplyService.checkToolApply(vo.getToolId(),userId)));
}
}
return getDataTable(list);
}
@@ -50,7 +91,7 @@ public class ToolController extends BaseController
{
List<Tool> list = toolService.selectToolList(tTool);
ExcelUtil<Tool> util = new ExcelUtil<Tool>(Tool.class);
util.exportExcel(response, list, "工具信息数据");
util.exportExcel(response, list, "工具信息数据",tTool.getExcludeFields());
}
/**
@@ -62,6 +103,23 @@ public class ToolController extends BaseController
return success(toolService.selectToolByToolId(toolId));
}
/**
* 获取工具信息详细信息
*/
@GetMapping(value = "/bpmc/{bpmcId}")
public AjaxResult getInfoByBpmcId(@PathVariable("bpmcId") String bpmcId)
{
Tool tool= toolService.getInfoByBpmcId(bpmcId);
tool.setToolRespDeptName(iSysDeptService.getDeptName(tool.getToolRespDept()));
return success(tool);
}
@ApiOperation("判断文件名称是否存在 true 存在 false 不存在")
@GetMapping("/checkToolExist")
public AjaxResult checkToolExist(Tool tTool) {
return AjaxResult.success(toolService.checkToolExist(tTool));
}
/**
* 新增工具信息
*/
@@ -69,17 +127,69 @@ public class ToolController extends BaseController
@PostMapping
public AjaxResult add(@RequestBody Tool tTool)
{
if(toolService.checkToolExist(tTool.getToolCode(), tTool.getToolRespDept())){
throw new RestException(BizExceptionCodeEnum.A400001001.getCode(), BizExceptionCodeEnum.A400001001.getMessage());
boolean add = false;
if (StringUtils.isEmpty(tTool.getToolId())) {
tTool.setToolId(IdUtil.simpleUUID());
add = true;
}
ProcessInstanceModel processInstanceModel = null;
try {
if(StringUtils.equals(tTool.getRecordStatus(), RecordStatusEnum.DRAFT.getCode())){
processInstanceModel = workflowService.saveExecute(tTool.getBpmClientInputModel(), tTool.getToolId());
}else if (StringUtils.equals(tTool.getRecordStatus(), RecordStatusEnum.CANCEL.getCode())){
processInstanceModel = workflowService.cancelExecute(tTool.getBpmClientInputModel(), tTool.getToolId());
}else{
processInstanceModel = workflowService.nextExecute(tTool.getBpmClientInputModel(), tTool.getToolId());
}
} catch (Exception e) {
e.printStackTrace();
}
if (processInstanceModel != null && StringUtils.isNotEmpty(processInstanceModel.getProcInstId())) {
if (add) {
tTool.setProcInstId(processInstanceModel.getProcInstId());
toolService.insertTool(tTool);
//保存文档和附件
toolService.addDocAndAtt(tTool);
//记录申请数据
toolService.recordToolApply(tTool);
} else if (BooleanUtil.isTrue(tTool.getEditStatus())){
toolService.updateTool(tTool);
//删除文档和附件
toolService.deleteDocAndAtt(tTool);
//保存文档和附件
toolService.addDocAndAtt(tTool);
} else {
Tool tool = new Tool();
tool.setToolId(tTool.getToolId());
tool.setRecordStatus(tTool.getRecordStatus());
if("done".equals(tTool.getRecordStatus())){
ToolApply toolApply = toolApplyService.getInfoByBpmcId(tTool.getProcInstId());
toolApply.setRecordStatus(tTool.getRecordStatus());
toolApply.setEndTime(DateUtils.getNowDate());
toolApplyService.updateToolApply(toolApply);
}
toolService.updateTool(tool);
}
//办结
if(RecordStatusEnum.DONE.getCode().equals(tTool.getRecordStatus())){
//更新文档状态
toolService.updateDocPushStatus(tTool);
//给消息中心发送消息
toolService.sendTzMessage(tTool);
}
return AjaxResult.success("操作成功",processInstanceModel);
}else {
return AjaxResult.error();
}
return toAjax(toolService.insertTool(tTool));
}
/**
* 修改工具信息
*/
@Log(title = "工具信息", businessType = BusinessType.UPDATE)
@PutMapping
@PostMapping("/edit")
public AjaxResult edit(@RequestBody Tool tTool)
{
return toAjax(toolService.updateTool(tTool));
@@ -94,4 +204,14 @@ public class ToolController extends BaseController
{
return toAjax(toolService.deleteToolByToolIds(toolIds));
}
/**
* 工具统计
*/
@GetMapping("/statistics")
public AjaxResult statistics()
{
return AjaxResult.success(toolService.statistics());
}
}

View File

@@ -0,0 +1,112 @@
package com.rzdata.web.controller.tool;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.rzdata.web.domain.TzMessage;
import com.rzdata.web.service.ITzMessageService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.rzdata.common.annotation.Log;
import com.rzdata.common.core.controller.BaseController;
import com.rzdata.common.core.domain.AjaxResult;
import com.rzdata.common.enums.BusinessType;
import com.rzdata.common.utils.poi.ExcelUtil;
import com.rzdata.common.core.page.TableDataInfo;
/**
* 消息Controller
*
* @author ja
* @date 2024-08-31
*/
@RestController
@RequestMapping("/system/message")
public class TzMessageController extends BaseController
{
@Autowired
private ITzMessageService tzMessageService;
/**
* 查询消息列表
*/
@PreAuthorize("@ss.hasPermi('system:message:list')")
@GetMapping("/list")
public TableDataInfo list(TzMessage tzMessage)
{
startPage();
List<TzMessage> list = tzMessageService.selectTzMessageList(tzMessage);
return getDataTable(list);
}
/**
* 导出消息列表
*/
@Log(title = "消息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TzMessage tzMessage)
{
List<TzMessage> list = tzMessageService.selectTzMessageList(tzMessage);
ExcelUtil<TzMessage> util = new ExcelUtil<TzMessage>(TzMessage.class);
util.exportExcel(response, list, "消息数据");
}
/**
* 获取消息详细信息
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return success(tzMessageService.selectTzMessageById(id));
}
/**
* 新增消息
*/
@PreAuthorize("@ss.hasPermi('system:message:add')")
@Log(title = "消息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TzMessage tzMessage)
{
return toAjax(tzMessageService.insertTzMessage(tzMessage));
}
/**
* 修改消息
*/
@Log(title = "消息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TzMessage tzMessage)
{
return toAjax(tzMessageService.updateTzMessage(tzMessage));
}
/**
* 删除消息
*/
@Log(title = "消息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(tzMessageService.deleteTzMessageByIds(ids));
}
/**
* 全部标记已读
*/
@Log(title = "全部标记已读", businessType = BusinessType.UPDATE)
@PostMapping("/allMarkedRead")
public AjaxResult allMarkedRead(@RequestBody TzMessage tzMessage)
{
return toAjax(tzMessageService.allMarkedRead(tzMessage));
}
}

View File

@@ -0,0 +1,110 @@
package com.rzdata.web.controller.tool;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.rzdata.common.annotation.Log;
import com.rzdata.common.core.controller.BaseController;
import com.rzdata.common.core.domain.AjaxResult;
import com.rzdata.common.enums.BusinessType;
import com.rzdata.web.domain.UseApplyItem;
import com.rzdata.web.service.IUseApplyItemService;
import com.rzdata.common.utils.poi.ExcelUtil;
import com.rzdata.common.core.page.TableDataInfo;
/**
* 使用申请详情Controller
*
* @author ja
* @date 2024-08-21
*/
@RestController
@RequestMapping("/use/apply/item")
public class UseApplyItemController extends BaseController
{
@Autowired
private IUseApplyItemService useApplyItemService;
/**
* 查询使用申请详情列表
*/
@PreAuthorize("@ss.hasPermi('system:item:list')")
@GetMapping("/page")
public TableDataInfo page(UseApplyItem useApplyItem)
{
startPage();
List<UseApplyItem> list = useApplyItemService.selectUseApplyItemList(useApplyItem);
return getDataTable(list);
}
@GetMapping("/list")
public AjaxResult list(UseApplyItem useApplyItem)
{
return AjaxResult.success(useApplyItemService.selectUseApplyItemList(useApplyItem));
}
/**
* 导出使用申请详情列表
*/
@PreAuthorize("@ss.hasPermi('system:item:export')")
@Log(title = "使用申请详情", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, UseApplyItem useApplyItem)
{
List<UseApplyItem> list = useApplyItemService.selectUseApplyItemList(useApplyItem);
ExcelUtil<UseApplyItem> util = new ExcelUtil<UseApplyItem>(UseApplyItem.class);
util.exportExcel(response, list, "使用申请详情数据");
}
/**
* 获取使用申请详情详细信息
*/
@PreAuthorize("@ss.hasPermi('system:item:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return success(useApplyItemService.selectUseApplyItemById(id));
}
/**
* 新增使用申请详情
*/
@PreAuthorize("@ss.hasPermi('system:item:add')")
@Log(title = "使用申请详情", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody UseApplyItem useApplyItem)
{
return toAjax(useApplyItemService.insertUseApplyItem(useApplyItem));
}
/**
* 修改使用申请详情
*/
@PreAuthorize("@ss.hasPermi('system:item:edit')")
@Log(title = "使用申请详情", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody UseApplyItem useApplyItem)
{
return toAjax(useApplyItemService.updateUseApplyItem(useApplyItem));
}
/**
* 删除使用申请详情
*/
@PreAuthorize("@ss.hasPermi('system:item:remove')")
@Log(title = "使用申请详情", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(useApplyItemService.deleteUseApplyItemByIds(ids));
}
}

View File

@@ -0,0 +1,619 @@
package com.rzdata.web.controller.tool;
import com.blueland.bpmclient.model.*;
import com.rzdata.common.core.controller.BaseController;
import com.rzdata.common.core.domain.AjaxResult;
import com.rzdata.common.core.domain.entity.SysUser;
import com.rzdata.common.utils.SecurityUtils;
import com.rzdata.common.utils.StringUtils;
import com.rzdata.system.service.ISysConfigService;
import com.rzdata.system.service.ISysUserService;
import com.rzdata.web.core.config.BpmcConfig;
import com.rzdata.web.domain.bo.BpmClientInputModelBo;
import com.rzdata.web.domain.vo.WorkFlowPageVo;
import com.rzdata.web.service.WorkflowService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.compress.utils.Lists;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Validated
@Slf4j
@RestController
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RequestMapping(value = "/workflow")
@Api(value = "流程服务", tags = {"流程服务"})
public class WorkflowController extends BaseController {
private final WorkflowService workflowService;
private final ISysUserService userService;
private final ISysConfigService sysConfigService;
private final BpmcConfig bpmcConfig;
@CrossOrigin
@ApiOperation(value = "获取流程待选人员展示方式", notes = "获取流程待选人员展示方式")
@GetMapping(value = "selectUserStyle")
@ResponseBody
public AjaxResult selectUserStyle() throws Exception {
String result = "tree";
String value = this.sysConfigService.selectConfigByKey("DMS_FLOW_SELECT_USER_STYLE");
if(StringUtils.isNotEmpty(value)) {
result = value;
}
return AjaxResult.success("",result);
}
@CrossOrigin
@ApiOperation(value = "根据流程定义Key获取流程定义信息", notes = "根据流程定义Key获取流程定义信息")
@ApiImplicitParams({@ApiImplicitParam(name = "procDefKey", value = "流程定义key", dataType = "string", paramType = "path") })
@GetMapping(value = "process/key/{procDefKey}")
@ResponseBody
public AjaxResult getProcessDefinitionModel(@PathVariable("procDefKey") String procDefKey) throws Exception {
ProcessDefinitionModel processDefinitionModel = workflowService.getProcessDefinitionModel(
procDefKey);
return AjaxResult.success(processDefinitionModel);
}
@CrossOrigin
@ApiOperation(value = "获取流程第一个人工环节定义", notes = "获取流程第一个人工环节定义")
@GetMapping(value = "startactdef/{procDefId}")
@ResponseBody
public AjaxResult getStartActdef(
@PathVariable("procDefId") String procDefId) throws Exception{
ActivityDefinitionModel activityDefinitionModel = workflowService.getStartactDef(procDefId);
return AjaxResult.success(activityDefinitionModel);
}
@CrossOrigin
@ApiOperation(value = "新建流程,获取下一环节流程定义信息", notes = "新建流程,获取下一环节流程定义信息")
@PostMapping(value = "nextacts/new")
@ResponseBody
public AjaxResult getNextActsByNew(@RequestBody SearchQuery searchQuery) {
List<ActivityDefinitionModel> list = workflowService.getNextActs(searchQuery);
return AjaxResult.success(list);
}
/**
* 获取下一环节集合,并可以标识已办和自动将未办理环节优先排序
*
* @param searchQuery
* @return
*/
@CrossOrigin
@ApiOperation(value = "新建流程,获取下一环节流程定义信息", notes = "新建流程,获取下一环节流程定义信息")
@PostMapping(value = "nextacts/new2")
@ResponseBody
public AjaxResult getNextActsByNew2(@RequestBody SearchQuery searchQuery) {
List<ActivityDefinitionModel> list = workflowService.getNextActs(searchQuery);
return AjaxResult.success(list);
}
@CrossOrigin
@ApiOperation(value = "待办流程,获取下一环节流程定义信息", notes = "待办流程,获取下一环节流程定义信息")
@PostMapping(value = "nextacts/pending")
@ResponseBody
public AjaxResult getNextActsByPending(@RequestBody SearchQuery searchQuery) {
List<ActivityDefinitionModel> list = workflowService.getNextActs(searchQuery);
return AjaxResult.success(list);
}
@CrossOrigin
@ApiOperation(value = "新建流程,获取下一环节用户定义信息", notes = "新建流程,获取下一环节用户定义信息")
@GetMapping(value = "nextactuser/new")
@ResponseBody
public AjaxResult getNextActUsersByNew(
@RequestParam(value = "userOrgId") String userOrgId,
@RequestParam(value = "curActDefId") String curActDefId,
@RequestParam(value = "destActDefId") String destActDefId,
@RequestParam(value = "procDefId") String procDefId, HttpServletRequest request) {
String userId = SecurityUtils.getLoginUser().getUsername();
SearchQuery searchQuery = new SearchQuery();
searchQuery.setUserId(userId);
searchQuery.setUserOrgId(userOrgId);
searchQuery.setCurActDefId(curActDefId);
searchQuery.setDestActDefId(destActDefId);
searchQuery.setProcDefId(procDefId);
List<ActivityResourceModel> rs = workflowService.getNextActUsers(searchQuery);
return AjaxResult.success(rs);
}
@CrossOrigin
@ApiOperation(value = "新建流程,获取下一环节用户定义信息", notes = "新建流程,获取下一环节用户定义信息")
@PostMapping(value = "nextactuser/new")
@ResponseBody
public AjaxResult getNextActUsersByNew(
@RequestParam(value = "userOrgId") String userOrgId,
@RequestParam(value = "curActDefId") String curActDefId,
@RequestParam(value = "destActDefId") String destActDefId,
@RequestParam(value = "procDefId") String procDefId, @RequestBody SearchQuery searchQuery,
HttpServletRequest request) {
String userId = SecurityUtils.getLoginUser().getUsername();
searchQuery.setUserId(userId);
searchQuery.setUserOrgId(userOrgId);
searchQuery.setCurActDefId(curActDefId);
searchQuery.setDestActDefId(destActDefId);
searchQuery.setProcDefId(procDefId);
List<ActivityResourceModel> rs = workflowService.getNextActUsers(searchQuery);
return AjaxResult.success(rs);
}
@CrossOrigin
@ApiOperation(value = "待办流程,获取下一环节用户定义信息", notes = "待办流程,获取下一环节用户定义信息")
@GetMapping(value = "nextactuser/pending")
@ResponseBody
public AjaxResult getNextActUsersByPending(
@RequestParam(value = "userOrgId") String userOrgId,
@RequestParam(value = "curActInstId") String curActInstId,
@RequestParam(value = "destActDefId") String destActDefId,
@RequestParam(value = "curActDefId") String curActDefId,
@RequestParam(value = "procDefKey") String procDefKey,
@RequestParam(value = "procInstId") String procInstId,
HttpServletRequest request) {
String userId = SecurityUtils.getLoginUser().getUsername();
SearchQuery searchQuery = new SearchQuery();
searchQuery.setTenantId(bpmcConfig.getTenantId());
searchQuery.setUserId(userId);
searchQuery.setUserOrgId(userOrgId);
searchQuery.setDestActDefId(destActDefId);
searchQuery.setCurActInstId(curActInstId);
List<ActivityResourceModel> rs = workflowService.getNextActUsers(searchQuery);
return AjaxResult.success(rs);
}
@CrossOrigin
@ApiOperation(value = "待办流程,获取下一环节用户定义信息", notes = "待办流程,获取下一环节用户定义信息")
@PostMapping(value = "nextactuser/pending")
@ResponseBody
public AjaxResult getNextActUsersByPending(
@RequestParam(value = "userOrgId") String userOrgId,
@RequestParam(value = "curActInstId") String curActInstId,
@RequestParam(value = "destActDefId") String destActDefId, @RequestBody SearchQuery searchQuery,
HttpServletRequest request) {
String userId = SecurityUtils.getLoginUser().getUsername();
searchQuery.setUserId(userId);
searchQuery.setUserOrgId(userOrgId);
searchQuery.setDestActDefId(destActDefId);
searchQuery.setCurActInstId(curActInstId);
List<ActivityResourceModel> rs = workflowService.getNextActUsers(searchQuery);
return AjaxResult.success(rs);
}
@CrossOrigin
@ApiOperation(value = "获取待办实例信息", notes = "获取待办实例信息")
@GetMapping(value = "flowinfo/pending")
@ResponseBody
public AjaxResult getPendingFlowInstance(
@RequestParam(value = "curActInstId") String curActInstId, HttpServletRequest request) throws Exception{
String userId = SecurityUtils.getLoginUser().getUsername();
SysUser user = userService.selectUserByUserName(userId);
SearchQuery searchQuery = new SearchQuery();
searchQuery.setUserId(userId);
searchQuery.setUserOrgId(user.getDeptId().toString());
searchQuery.setCurActInstId(curActInstId);
searchQuery.setStatus(1);
HashMap<String, Object> flowInfoMap = workflowService.getFLowInfo(searchQuery);
return AjaxResult.success(flowInfoMap);
}
@CrossOrigin
@ApiOperation(value = "获取已办实例信息", notes = "获取已办实例信息")
@GetMapping(value = "flowinfo/yiban")
@ResponseBody
public AjaxResult getYiBanFlowInstance(
@RequestParam(value = "curActInstId") String curActInstId, HttpServletRequest request) throws Exception{
String userId = SecurityUtils.getLoginUser().getUsername();
SysUser user = userService.selectUserByUserName(userId);
SearchQuery searchQuery = new SearchQuery();
searchQuery.setUserId(userId);
searchQuery.setUserOrgId(user.getDeptId().toString());
searchQuery.setCurActInstId(curActInstId);
searchQuery.setStatus(2);
HashMap<String, Object> flowInfoMap = workflowService.getFLowInfo(searchQuery);
return AjaxResult.success(flowInfoMap);
}
@CrossOrigin
@ApiOperation(value = "获取办结实例信息", notes = "获取办结实例信息")
@GetMapping(value = "flowinfo/banjie")
@ResponseBody
public AjaxResult getBanJieFlowInstance(
@RequestParam(value = "procInstId") String procInstId,
HttpServletRequest request) throws Exception{
String userId = SecurityUtils.getLoginUser().getUsername();
SysUser user = userService.selectUserByUserName(userId);
SearchQuery searchQuery = new SearchQuery();
searchQuery.setUserId(userId);
searchQuery.setUserOrgId(user.getDeptId().toString());
searchQuery.setProcInstId(procInstId);
searchQuery.setStatus(3);
HashMap<String, Object> flowInfoMap = workflowService.getFLowInfo(searchQuery);
return AjaxResult.success(flowInfoMap);
}
@CrossOrigin
@ApiOperation(value = "新建页面,判断下一环节是否自动提交", notes = "新建页面,判断下一环节是否自动提交")
@GetMapping(value = "autocommit/new/{procDefId}/{curActDefId}")
@ResponseBody
public AjaxResult checkAutoCommitByNew(
@PathVariable("procDefId") String procDefId, @PathVariable("curActDefId") String curActDefId) throws Exception{
SearchQuery searchQuery = new SearchQuery();
searchQuery.setProcDefId(procDefId);
searchQuery.setCurActDefId(curActDefId);
String actDefId = workflowService.checkAutoCommit(searchQuery);
return AjaxResult.success("",actDefId);
}
@CrossOrigin
@ApiOperation(value = "待办页面,判断下一环节是否自动提交", notes = "待办页面,判断下一环节是否自动提交")
@GetMapping(value = "autocommit/pending/{curActInstId}")
@ResponseBody
public AjaxResult checkAutoCommitByPending(
@PathVariable("curActInstId") String curActInstId) throws Exception{
SearchQuery searchQuery = new SearchQuery();
searchQuery.setCurActInstId(curActInstId);
String actDefId = workflowService.checkAutoCommit(searchQuery);
return AjaxResult.success("",actDefId);
}
@CrossOrigin
@ApiOperation(value = "待办页面,判断下一环节是否自动跳转", notes = "待办页面,判断下一环节是否自动跳转")
@GetMapping(value = "autoJump/pending/{curActInstId}")
@ResponseBody
public AjaxResult checkAutoJumpByPending(
@PathVariable("curActInstId") String curActInstId) throws Exception{
SearchQuery searchQuery = new SearchQuery();
searchQuery.setCurActInstId(curActInstId);
Map<String, Object> actDefId = workflowService.checkAutoJump(searchQuery);
return AjaxResult.success("",actDefId);
}
@CrossOrigin
@ApiOperation(value = "新建页面,判断下一环节是否自动提交", notes = "新建页面,判断下一环节是否自动提交")
@GetMapping(value = "autoJump/new/{procDefId}/{curActDefId}")
@ResponseBody
public AjaxResult checkAutoJumpByNew(
@PathVariable("procDefId") String procDefId, @PathVariable("curActDefId") String curActDefId) throws Exception{
SearchQuery searchQuery = new SearchQuery();
searchQuery.setProcDefId(procDefId);
searchQuery.setCurActDefId(curActDefId);
Map<String, Object> actDefId = workflowService.checkAutoJump(searchQuery);
return AjaxResult.success("",actDefId);
}
@CrossOrigin
@ApiOperation(value = "提交流程", notes = "提交流程")
@PostMapping(value = "submit")
@ResponseBody
public AjaxResult submitNewFLowInstance(@RequestBody BpmClientInputModelBo bpmClientInputModelBo) throws Exception{
ProcessInstanceModel processInstanceModel = workflowService.processProcInst(bpmClientInputModelBo,
WorkflowService.ENUM_ACTION.submit.name());
return AjaxResult.success(processInstanceModel);
}
@CrossOrigin
@ApiOperation(value = "暂存流程", notes = "暂存流程")
@PostMapping(value = "save")
@ResponseBody
public AjaxResult saveFLowInstance(
@RequestBody BpmClientInputModelBo bpmClientInputModelBo) throws Exception{
ProcessInstanceModel processInstanceModel = workflowService.processProcInst(bpmClientInputModelBo,
WorkflowService.ENUM_ACTION.save.name());
return AjaxResult.success(processInstanceModel);
}
/**
* 流程作废
*
* @param bpmClientInputModelBo
* @return
*/
@ApiOperation(value = "作废流程", notes = "作废流程")
@PostMapping(value = "cancel")
@ResponseBody
@CrossOrigin
public AjaxResult cancelFlowInstance(
@RequestBody BpmClientInputModelBo bpmClientInputModelBo) throws Exception{
ProcessInstanceModel processInstanceModel = workflowService.processProcInst(bpmClientInputModelBo,
WorkflowService.ENUM_ACTION.cancel.name());
return AjaxResult.success(processInstanceModel);
}
/**
* 流程实例撤回到拟稿人环节
*
* @param bpmClientInputModelBo
* @return
*/
@ApiOperation(value = "流程实例撤回到拟稿人环节", notes = "流程实例撤回到拟稿人环节")
@PostMapping(value = "backtostart")
@ResponseBody
@CrossOrigin
public AjaxResult callBackStartFlowInstance(
@RequestBody BpmClientInputModelBo bpmClientInputModelBo) throws Exception{
ProcessInstanceModel processInstanceModel = workflowService.processProcInst(bpmClientInputModelBo,
WorkflowService.ENUM_ACTION.backtostart.name());
return AjaxResult.success(processInstanceModel);
}
/**
* 流程实例撤回到上一环节
*
* @param bpmClientInputModelBo
* @return
*/
@ApiOperation(value = "流程实例撤回到上一环节", notes = "流程实例撤回到上一环节")
@PostMapping(value = "backtoprev")
@ResponseBody
@CrossOrigin
public AjaxResult backToPrevFlowInstance(
@RequestBody BpmClientInputModelBo bpmClientInputModelBo) throws Exception{
ProcessInstanceModel processInstanceModel = workflowService.processProcInst(bpmClientInputModelBo,
WorkflowService.ENUM_ACTION.backtoprev.name());
return AjaxResult.success(processInstanceModel);
}
/**
* 提交流程驳回参数
*
* @param bpmClientInputModelBo
* @return
*/
@CrossOrigin
@ApiOperation(value = "流程驳回", notes = "流程驳回")
@PostMapping(value = "reject")
@ResponseBody
public AjaxResult rejectFlowInstance(
@RequestBody BpmClientInputModelBo bpmClientInputModelBo) throws Exception{
ProcessInstanceModel processInstanceModel = workflowService.processProcInst(bpmClientInputModelBo,
WorkflowService.ENUM_ACTION.reject.name());
return AjaxResult.success(processInstanceModel);
}
/**
* 流程撤回
*
* @param bpmClientInputModelBo
* @return
*/
@CrossOrigin
@ApiOperation(value = "流程撤回", notes = "流程撤回")
@PostMapping(value = "back")
@ResponseBody
public AjaxResult backFlowInstance(
@RequestBody BpmClientInputModelBo bpmClientInputModelBo) throws Exception{
ProcessInstanceModel processInstanceModel = workflowService.processProcInst(bpmClientInputModelBo,
WorkflowService.ENUM_ACTION.back.name());
return AjaxResult.success(processInstanceModel);
}
@ApiOperation(value = "流程转派", notes = "流程转派")
@PostMapping(value = "transfer")
@ResponseBody
@CrossOrigin
public AjaxResult transferFlowInstance(
@RequestBody BpmClientInputModelBo bpmClientInputModelBo) throws Exception{
ProcessInstanceModel processInstanceModel = workflowService.processProcInst(bpmClientInputModelBo,
WorkflowService.ENUM_ACTION.transfer.name());
return AjaxResult.success(processInstanceModel);
}
@ApiOperation(value = "流程日志", notes = "流程日志")
@PostMapping(value = "getLog")
@ResponseBody
@CrossOrigin
public AjaxResult getProcInstLog(
@RequestBody BpmClientInputModel bpmClientInputModel) {
HashMap<String, Object> procInstLog = workflowService.getProcInstLog(bpmClientInputModel);
return AjaxResult.success(procInstLog);
}
@ApiOperation(value = "办件阅件列表查询", notes = "办件阅件列表查询")
@PostMapping(value = "/list")
@ResponseBody
@CrossOrigin
public AjaxResult getRecordList(@RequestBody SearchQuery searchQuery) {
PageResultModel pageResult = workflowService.findRecordList(searchQuery);
return AjaxResult.success(pageResult);
}
@ApiOperation(value = "待办/已办列表查询", notes = "待办/已办列表查询")
@PostMapping(value = "/toDoList")
@ResponseBody
@CrossOrigin
public AjaxResult getToDoList(@RequestBody SearchQuery searchQuery) throws Exception{
//接收人
WorkFlowPageVo pageResult = workflowService.findToDoList(searchQuery);
return AjaxResult.success(pageResult);
}
@ApiOperation(value = "获取流程实例图形监控链接地址", notes = "获取流程实例图形监控链接地址")
@GetMapping(value = "histasklogurl/{procInstId}")
@ResponseBody
@CrossOrigin
public AjaxResult getHistasklogurl( @PathVariable String procInstId) throws Exception{
String url = workflowService.getHistasklogurl(procInstId);
return AjaxResult.success("",url);
}
@ApiOperation(value = "获取流程实例图形链接地址", notes = "获取流程实例图形监控链接地址")
@GetMapping(value = "getImageUrl/{procDefId}")
@ResponseBody
@CrossOrigin
public AjaxResult getProcessImageUrl( @PathVariable String procDefId) throws Exception{
String url = workflowService.getImageUrl( procDefId);
return AjaxResult.success("",url);
}
/**
* 获取流程状态
*
* @param procInstId
* @param curActInstId
* @return
*/
@ApiOperation(value = "获取流程状态", notes = "获取流程状态")
@ApiImplicitParams({
@ApiImplicitParam(name = "procInstId", value = "流程实例id", dataType = "string", paramType = "path"),
@ApiImplicitParam(name = "curActInstId", value = "当前环节实例id", dataType = "string", paramType = "path") })
@GetMapping(value = "/getFlowStatus/{procInstId}/{curActInstId}")
@ResponseBody
@CrossOrigin
public AjaxResult getFlowStatus( @PathVariable String procInstId,
@PathVariable String curActInstId) throws Exception{
int flowStatus = workflowService.getFlowStatus(procInstId, curActInstId);
return AjaxResult.success(flowStatus);
}
@ApiOperation(value = "获取流程实例信息,包含当前用户所对应实例状态", notes = "获取流程实例信息,包含当前用户所对应实例状态")
@ApiImplicitParams({
@ApiImplicitParam(name = "procInstId", value = "流程实例id", dataType = "string", paramType = "path"),
@ApiImplicitParam(name = "curActInstId", value = "当前环节实例id", dataType = "string", paramType = "path") })
@GetMapping(value = "instance/{procInstId}/{curActInstId}")
@ResponseBody
@CrossOrigin
public AjaxResult getFlowProcessInstance(@PathVariable String procInstId, @PathVariable String curActInstId, HttpServletRequest request) throws Exception{
String userId = SecurityUtils.getLoginUser().getUsername();
ProcessInstanceModel procInst = workflowService.getProcessInstance(procInstId, curActInstId,
userId);
return AjaxResult.success(procInst);
}
@ApiOperation(value = "获取流程环节定义信息", notes = "获取流程环节定义信息")
@GetMapping(value = "activitydefinition/{procDefId}/{actDefId}")
@ResponseBody
@CrossOrigin
public AjaxResult getFlowActDef(
@PathVariable String procDefId, @PathVariable String actDefId) throws Exception{
ActivityDefinitionModel activityDefinitionModel = workflowService.getActDef( procDefId, actDefId);
return AjaxResult.success(activityDefinitionModel);
}
@ApiOperation(value = "获取流程环节配置的表单", notes = "获取流程环节配置的表单")
@GetMapping(value = "getFlowActForm/{procDefId}/{actDefId}")
@ResponseBody
@CrossOrigin
public AjaxResult getFlowActForm(
@PathVariable String procDefId, @PathVariable String actDefId) throws Exception{
Map<String, String> formUrl = workflowService.getFlowActForm( procDefId, actDefId);
return AjaxResult.success(formUrl);
}
@ApiOperation(value = "根据流程实例id获取流程实例信息", notes = "根据流程实例id获取流程实例信息")
@GetMapping(value = "/procInstInfo/{procInstId}")
@ResponseBody
@CrossOrigin
public AjaxResult getProcInstInfo(@PathVariable String procInstId)throws Exception {
Map<String, Object> procInst = workflowService.getProcessInstById( procInstId);
return AjaxResult.success(procInst);
}
@ApiOperation(value = "根据流程实例id获取流程实例信息和流程状态", notes = "根据流程实例id获取流程实例信息")
@GetMapping(value = "/procInstInfoAndStatus/{procInstId}")
@ResponseBody
@CrossOrigin
public Map<String, Object> procInstInfoAndStatus( @PathVariable String procInstId,
HttpServletRequest request) {
try {
String userId = SecurityUtils.getLoginUser().getUsername();
SearchQuery searchQuery = new SearchQuery();
searchQuery.setRecUserId(userId);
searchQuery.setStatus(1);
searchQuery.setProcInstId(procInstId);
PageResultModel pageResultModel = workflowService.findRecordList(searchQuery);
if (pageResultModel == null || pageResultModel.getTotalCount() == 0) {
return null;
}else {
return pageResultModel.getResult().get(0);
}
} catch (Exception ex) {
log.error("获取流程信息 该用户的流程是待办还是已办", ex);
return null;
}
}
@ApiOperation(value = "获取当前用户流程实例数量", notes = "获取当前用户流程实例数量。status状态值{1:待办2:已办3:办结}")
@GetMapping(value = "/count/{status}")
@ResponseBody
public Map<String, Integer> getRecordCount( @PathVariable int status,
HttpServletRequest request) {
try {
String userId = SecurityUtils.getLoginUser().getUsername();
SearchQuery searchQuery = new SearchQuery();
searchQuery.setRecUserId(userId);
searchQuery.setStatus(status);
return workflowService.getRecordCount(searchQuery);
} catch (Exception ex) {
log.error("获取当前用户流程实例数量", ex);
Map<String, Integer> result = new HashMap<>();
result.put("count", 0);
return result;
}
}
@ApiOperation(value = "根据父流程实例id获取该流程的子流程从而处理子流程", notes = "根据父流程实例id获取该流程的子流程从而处理子流程")
@GetMapping(value = "/subprocess/{status}/{procInstId}")
public List<Map<String, Object>> getSubprocess( @PathVariable String status,
@PathVariable String procInstId) {
try {
return workflowService.getSubprocess( status, procInstId);
} catch (Exception ex) {
log.error("根据父流程实例id获取该流程的子流程从而处理子流程", ex);
return Lists.newArrayList();
}
}
@CrossOrigin
@ApiOperation(value = "获取该用户是否处理过该流程", notes = "获取该用户是否处理该流程")
@GetMapping(value = "/flowinfo/user/deal/{procInstId}")
@ResponseBody
public AjaxResult getUserIsDealFlow( @PathVariable String procInstId,
HttpServletRequest request) throws Exception{
String userId = SecurityUtils.getLoginUser().getUsername();
SearchQuery searchQuery = new SearchQuery();
searchQuery.setRecUserId(userId);
searchQuery.setProcInstId(procInstId);
searchQuery.setStatus(1);
Map<String, Integer> result = workflowService.getRecordCount(searchQuery);
return AjaxResult.success(Integer.valueOf(result.get("count").toString()));
}
@CrossOrigin
@ApiOperation(value = "获取扩展属性", notes = "获取扩展属性")
@GetMapping("/getExtAttributeModel")
public AjaxResult getExtAttributeModel(@RequestParam("procDefId") String procDefId, @RequestParam("actDefId") String actDefId){
return AjaxResult.success(workflowService.getExtAttributeModel(procDefId, actDefId));
}
@ApiOperation(value = "待办列表查询", notes = "待办列表查询")
@GetMapping(value = "/getRecord/{procInstId}")
@ResponseBody
@CrossOrigin
public AjaxResult getRecordbyPorcInstId(@PathVariable String procInstId) throws Exception{
return AjaxResult.success(workflowService.getRecordbyPorcInstId(procInstId));
}
}

View File

@@ -0,0 +1,110 @@
package com.rzdata.web.controller.tool;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.rzdata.common.annotation.Log;
import com.rzdata.common.core.controller.BaseController;
import com.rzdata.common.core.domain.AjaxResult;
import com.rzdata.common.enums.BusinessType;
import com.rzdata.web.domain.WorkflowLog;
import com.rzdata.web.service.IWorkflowLogService;
import com.rzdata.common.utils.poi.ExcelUtil;
import com.rzdata.common.core.page.TableDataInfo;
/**
* 流程审批记录Controller
*
* @author ja
* @date 2024-08-21
*/
@RestController
@RequestMapping("/web/log")
public class WorkflowLogController extends BaseController
{
@Autowired
private IWorkflowLogService workflowLogService;
/**
* 查询流程审批记录列表
*/
@PreAuthorize("@ss.hasPermi('web:log:list')")
@GetMapping("/page")
public TableDataInfo page(WorkflowLog workflowLog)
{
startPage();
List<WorkflowLog> list = workflowLogService.selectWorkflowLogList(workflowLog);
return getDataTable(list);
}
@GetMapping("/list")
public AjaxResult list(WorkflowLog workflowLog)
{
return AjaxResult.success(workflowLogService.selectWorkflowLogList(workflowLog));
}
/**
* 导出流程审批记录列表
*/
@PreAuthorize("@ss.hasPermi('web:log:export')")
@Log(title = "流程审批记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WorkflowLog workflowLog)
{
List<WorkflowLog> list = workflowLogService.selectWorkflowLogList(workflowLog);
ExcelUtil<WorkflowLog> util = new ExcelUtil<WorkflowLog>(WorkflowLog.class);
util.exportExcel(response, list, "流程审批记录数据");
}
/**
* 获取流程审批记录详细信息
*/
@PreAuthorize("@ss.hasPermi('web:log:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return success(workflowLogService.selectWorkflowLogById(id));
}
/**
* 新增流程审批记录
*/
@PreAuthorize("@ss.hasPermi('web:log:add')")
@Log(title = "流程审批记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WorkflowLog workflowLog)
{
return toAjax(workflowLogService.insertWorkflowLog(workflowLog));
}
/**
* 修改流程审批记录
*/
@PreAuthorize("@ss.hasPermi('web:log:edit')")
@Log(title = "流程审批记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WorkflowLog workflowLog)
{
return toAjax(workflowLogService.updateWorkflowLog(workflowLog));
}
/**
* 删除流程审批记录
*/
@PreAuthorize("@ss.hasPermi('web:log:remove')")
@Log(title = "流程审批记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(workflowLogService.deleteWorkflowLogByIds(ids));
}
}

View File

@@ -0,0 +1,34 @@
package com.rzdata.web.core.config;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* 读取项目相关配置
*
* @author Lion Li
*/
@Data
@Accessors(chain = true)
@Component
@ConfigurationProperties(prefix = "bpmc")
public class BpmcConfig {
/**
* 流程平台下应用租户id
*/
private String tenantId;
/**
* 流程平台服务接口地址
*/
private String serviceUrl;
/**
* 待办地址前缀
*/
private String uniteWorkUrl;
}

View File

@@ -0,0 +1,83 @@
package com.rzdata.web.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.rzdata.common.annotation.Excel;
import com.rzdata.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
import java.util.List;
/**
* 附件对象 t_attachment
*
* @author panchichun
* @date 2024-08-28
*/
@Data
public class Attachment extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private String id;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String fileType;
/** 业务类型 */
@Excel(name = "业务类型")
private String bizType;
/** 文件URL */
@Excel(name = "文件URL")
private String fileUrl;
/** 文件源名称 */
@Excel(name = "文件源名称")
private String fileOldName;
/** 文件新名称 */
@Excel(name = "文件新名称")
private String fileNewName;
/** 文件后缀 */
@Excel(name = "文件后缀")
private String suffixType;
/** 文件大小 */
@Excel(name = "文件大小")
private Long fileSize;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String businessId;
/** 序号 */
@Excel(name = "序号")
private Long sorts;
/** 删除;1是, 0:否 */
@Excel(name = "删除;1是, 0:否")
private String del;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date createDate;
/** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date updateDate;
/** 失效时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "失效时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date failureTime;
private List<String> businessIds;
}

View File

@@ -0,0 +1,51 @@
package com.rzdata.web.domain;
import com.rzdata.common.annotation.Excel;
import com.rzdata.common.core.domain.BaseEntity;
import lombok.Data;
import java.util.List;
/**
* 讨论对象 t_discussions
*
* @author panchichun
* @date 2024-08-30
*/
@Data
public class Discussions extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private String id;
/** 业务id */
@Excel(name = "业务id")
private String businessId;
/** 业务类型;doc:文档tool:工具) */
@Excel(name = "业务类型;", readConverterExp = "d=oc:文档tool:工具")
private String type;
/** 内容 */
@Excel(name = "内容")
private String content;
/** 逻辑删除;1删除0未删除 */
@Excel(name = "逻辑删除;", readConverterExp = "1=删除0未删除")
private String isDelete;
/** 创建人id */
@Excel(name = "创建人id")
private String createById;
/** 更新人id */
@Excel(name = "更新人id")
private String updateById;
private String nickName;
private List<Replies> repliesList;
}

View File

@@ -1,17 +1,24 @@
package com.rzdata.web.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.rzdata.common.annotation.Excel;
import com.rzdata.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
import java.util.List;
/**
* 【请填写功能名称】对象 t_document
*
* @author ja
* @date 2024-07-08
*/
@Data
public class Document extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 主键 */
@@ -26,129 +33,75 @@ public class Document extends BaseEntity {
private String docName;
/** 文档类别 */
@Excel(name = "文档类别")
@Excel(name = "类别", dictType="doc_class")
private String docType;
/** 文档负责人 */
@Excel(name = "文档负责人")
@Excel(name = "负责人")
private String docPrincipals;
/** 归属单位 **/
@Excel(name = "归属单位")
private String docRespDeptName;
/** 文档归属部门 */
@Excel(name = "文档归属部门")
private String docRespDept;
/** 文档来源 */
@Excel(name = "文档来源")
@Excel(name = "来源", dictType="doc_source")
private String docSource;
/**
* 工具名称
*/
@Excel(name = "工具名称")
private String toolName;
/** 文档状态 */
@Excel(name = "文档状态")
@Excel(name = "上传状态", dictType="doc_upload_status")
private String docStatus;
/** 文档地址 */
@Excel(name = "文档地址")
private String docUrl;
public void setDocId(String docId)
{
this.docId = docId;
}
/** 备注 */
private String remark;
public String getDocId()
{
return docId;
}
public void setDocCode(String docCode)
{
this.docCode = docCode;
}
/** 文档分类id */
private String docCategoryId;
public String getDocCode()
{
return docCode;
}
public void setDocName(String docName)
{
this.docName = docName;
}
/** 创建人id */
private String createById;
/** 更新人id */
private String updateById;
/** 逻辑删除1删除0未删除 */
private String isDeleted;
public String getDocName()
{
return docName;
}
public void setDocType(String docType)
{
this.docType = docType;
}
/** 主键 **/
private List<String> ids;
public String getDocType()
{
return docType;
}
public void setDocPrincipals(String docPrincipals)
{
this.docPrincipals = docPrincipals;
}
/** 附件名称 **/
private Attachment attachment;
public String getDocPrincipals()
{
return docPrincipals;
}
public void setDocRespDept(String docRespDept)
{
this.docRespDept = docRespDept;
}
/** 关联工具id对象 */
private String toolId;
public String getDocRespDept()
{
return docRespDept;
}
public void setDocSource(String docSource)
{
this.docSource = docSource;
}
/** 工具信息 **/
private Tool tool;
public String getDocSource()
{
return docSource;
}
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "创建时间", dateFormat="yyyy-MM-dd")
private Date createTime;
public void setDocStatus(String docStatus)
{
this.docStatus = docStatus;
}
public String getDocStatus()
{
return docStatus;
}
private List<String> excludeFields;
public void setDocUrl(String docUrl)
{
this.docUrl = docUrl;
}
private Boolean downloadCheck;
public String getDocUrl()
{
return docUrl;
}
private Boolean downloadStatus;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("docId", getDocId())
.append("docCode", getDocCode())
.append("docName", getDocName())
.append("docType", getDocType())
.append("docPrincipals", getDocPrincipals())
.append("docRespDept", getDocRespDept())
.append("docSource", getDocSource())
.append("docStatus", getDocStatus())
.append("docUrl", getDocUrl())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
private Boolean permissionCheck;
private Boolean permission;
}

View File

@@ -0,0 +1,43 @@
package com.rzdata.web.domain;
import com.rzdata.common.annotation.Excel;
import com.rzdata.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 工具下载统计对象 t_download_count
*
* @author 潘驰春
* @date 2024-08-31
*/
@Data
public class DownloadCount extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private String id;
/** 工具id */
@Excel(name = "工具id")
private String toolId;
/** 创建人id */
@Excel(name = "创建人id")
private String createById;
/** 更新人id */
@Excel(name = "更新人id")
private String updateById;
/** 工具code */
private String toolCode;
/** 工具名称 */
private String toolName;
/** 工具下载数量 */
private String toolDownNum;
private String nickName;
}

View File

@@ -0,0 +1,46 @@
package com.rzdata.web.domain;
import com.rzdata.common.annotation.Excel;
import com.rzdata.common.core.domain.BaseEntity;
import lombok.Data;
import java.util.List;
/**
* 回复对象 t_replies
*
* @author panchichun
* @date 2024-08-30
*/
@Data
public class Replies extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private String id;
/** 讨论表id */
@Excel(name = "讨论表id")
private String discussionId;
/** 内容 */
@Excel(name = "内容")
private String content;
/** 逻辑删除;1删除0未删除 */
@Excel(name = "逻辑删除;", readConverterExp = "1=删除0未删除")
private String isDelete;
/** 创建人id */
@Excel(name = "创建人id")
private String createById;
/** 更新人id */
@Excel(name = "更新人id")
private String updateById;
private String nickName;
private List<String> discussionIdList;
}

View File

@@ -1,11 +1,11 @@
package com.rzdata.web.domain;
import com.rzdata.common.annotation.Excel;
import com.rzdata.common.annotation.Excels;
import com.rzdata.common.core.domain.BaseEntity;
import com.rzdata.common.core.domain.entity.SysDept;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.rzdata.web.domain.bo.BpmClientInputModelBo;
import lombok.Data;
import java.util.List;
/**
* 工具信息对象 t_tool
@@ -13,6 +13,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
* @author ja
* @date 2024-07-15
*/
@Data
public class Tool extends BaseEntity
{
private static final long serialVersionUID = 1L;
@@ -21,223 +22,82 @@ public class Tool extends BaseEntity
private String toolId;
/** 工具编号 */
@Excel(name = "工具编号")
private String toolCode;
/** 工具名称 */
@Excel(name = "工具名称")
@Excel(name = "工具名称",sort=1)
private String toolName;
/** 工具类别 */
@Excel(name = "工具类别")
@Excel(name = "工具类别",dictType="tool_type",sort=2)
private String toolType;
/** 来源 */
@Excel(name = "来源")
@Excel(name = "工具来源",sort=3)
private String toolSource;
/** 用途 */
@Excel(name = "用途")
@Excel(name = "工具用途",sort=7)
private String toolUse;
/** 测试情况 */
@Excel(name = "情况")
@Excel(name = "情况",sort=8)
private String testSituation;
/** 功能描述 */
@Excel(name = "功能描述")
@Excel(name = "功能描述",sort=9)
private String functionDesc;
/** 适用条件 */
@Excel(name = "适用条件")
@Excel(name = "适用条件",sort=10)
private String applyCondition;
/** 操作说明 */
@Excel(name = "操作说明")
@Excel(name = "操作说明",sort=11)
private String operateExplain;
/** 负责人 */
@Excel(name = "负责人")
private String toolPrincipals;
/** 负责人名称 */
@Excel(name = "负责人")
@Excel(name = "负责人",sort=4)
private String toolPrincipalsName;
/** 归属单位 */
@Excel(name = "归属单位")
private String toolRespDept;
@Excel(name = "归属单位",sort=5)
private String toolRespDeptName;
/** 状态 */
@Excel(name = "状态")
@Excel(name = "状态",dictType="sys_normal_disable",sort=6)
private String status;
/** 部门对象 */
@Excels({
@Excel(name = "部门名称", targetAttr = "deptName", type = Excel.Type.EXPORT),
@Excel(name = "部门负责人", targetAttr = "leader", type = Excel.Type.EXPORT)
})
private SysDept dept;
/** 备注 */
@Excel(name = "备注",sort=12)
private String remark;
public void setToolId(String toolId)
{
this.toolId = toolId;
}
/** 关联工具 */
private String association;
public String getToolId()
{
return toolId;
}
private BpmClientInputModelBo bpmClientInputModel;
public void setToolCode(String toolCode)
{
this.toolCode = toolCode;
}
/** done办结doing进行中**/
private String recordStatus;
public String getToolCode()
{
return toolCode;
}
public void setToolName(String toolName)
{
this.toolName = toolName;
}
private Boolean editStatus;
public String getToolName()
{
return toolName;
}
public void setToolType(String toolType)
{
this.toolType = toolType;
}
private String procInstId;
public String getToolType()
{
return toolType;
}
public void setToolSource(String toolSource)
{
this.toolSource = toolSource;
}
private Boolean permissionCheck;
public String getToolSource()
{
return toolSource;
}
public void setToolUse(String toolUse)
{
this.toolUse = toolUse;
}
private Boolean permission;
public String getToolUse()
{
return toolUse;
}
public void setTestSituation(String testSituation)
{
this.testSituation = testSituation;
}
private Boolean downloadCheck;
public String getTestSituation()
{
return testSituation;
}
public void setFunctionDesc(String functionDesc)
{
this.functionDesc = functionDesc;
}
private Boolean downloadStatus;
public String getFunctionDesc()
{
return functionDesc;
}
public void setApplyCondition(String applyCondition)
{
this.applyCondition = applyCondition;
}
private List<String> excludeFields;
public String getApplyCondition()
{
return applyCondition;
}
public void setOperateExplain(String operateExplain)
{
this.operateExplain = operateExplain;
}
public String getOperateExplain()
{
return operateExplain;
}
public void setToolPrincipals(String toolPrincipals)
{
this.toolPrincipals = toolPrincipals;
}
public String getToolPrincipals()
{
return toolPrincipals;
}
public void setToolPrincipalsName(String toolPrincipalsName)
{
this.toolPrincipalsName = toolPrincipalsName;
}
public String getToolPrincipalsName()
{
return toolPrincipalsName;
}
public void setToolRespDept(String toolRespDept)
{
this.toolRespDept = toolRespDept;
}
public String getToolRespDept()
{
return toolRespDept;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public SysDept getDept()
{
return dept;
}
public void setDept(SysDept dept)
{
this.dept = dept;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("toolId", getToolId())
.append("toolName", getToolName())
.append("toolType", getToolType())
.append("toolSource", getToolSource())
.append("toolUse", getToolUse())
.append("testSituation", getTestSituation())
.append("functionDesc", getFunctionDesc())
.append("applyCondition", getApplyCondition())
.append("operateExplain", getOperateExplain())
.append("toolPrincipals", getToolPrincipals())
.append("toolRespDept", getToolRespDept())
.append("status", getStatus())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
private List<Document> documentList;
}

View File

@@ -0,0 +1,65 @@
package com.rzdata.web.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.rzdata.common.annotation.Excel;
import com.rzdata.common.core.domain.BaseEntity;
import com.rzdata.web.domain.bo.BpmClientInputModelBo;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* 使用申请对象 t_use_apply
*
* @author ja
* @date 2024-08-21
*/
@Data
public class ToolApply extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private String id;
@Excel(name = "申请人id")
private String userId;
@Excel(name = "工具ID")
private String toolId;
@Excel(name = "流程标题")
private String procTitle;
@Excel(name = "申请类型")
private String applyType;
@Excel(name = "申请人名称")
private String nickName;
/** 申请部门 */
@Excel(name = "申请部门id")
private String deptId;
@Excel(name = "申请部门名称")
private String deptName;
/** 申请理由 */
@Excel(name = "申请理由")
private String reason;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endTime;
private BpmClientInputModelBo bpmClientInputModel;
private String recordStatus;
private Boolean editStatus;
private String procInstId;
private List<UseApplyItem> itemList;
}

View File

@@ -0,0 +1,38 @@
package com.rzdata.web.domain;
import com.rzdata.common.annotation.Excel;
import com.rzdata.common.core.domain.BaseEntity;
import lombok.Data;
/**
* 消息对象 tz_message
*
* @author ja
* @date 2024-08-31
*/
@Data
public class TzMessage extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 消息id */
private String id;
/** 消息接收者id */
@Excel(name = "消息接收者id")
private String receiverId;
/** 状态2已读1未读 */
@Excel(name = "状态", readConverterExp = "2=已读1未读")
private Integer states;
/** 消息推送内容 */
@Excel(name = "消息推送内容")
private String content;
/** 逻辑删除标记:1删除;0未删除 */
@Excel(name = "逻辑删除标记:1删除;0未删除")
private String deleted;
private String createById;
private String updateById;
}

View File

@@ -0,0 +1,52 @@
package com.rzdata.web.domain;
import com.rzdata.common.annotation.Excel;
import com.rzdata.common.core.domain.BaseEntity;
import lombok.Data;
/**
* 使用申请详情对象 t_use_apply_item
*
* @author ja
* @date 2024-08-21
*/
@Data
public class UseApplyItem extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private String id;
/** 申请主键 */
@Excel(name = "申请主键")
private String applyId;
/** 工具id */
@Excel(name = "工具id")
private String toolId;
/** 工具编号 */
@Excel(name = "工具编号")
private String toolCode;
/** 工具名称 */
@Excel(name = "工具名称")
private String toolName;
/** 工具类别 */
@Excel(name = "工具类别")
private String toolType;
/** 负责人 */
@Excel(name = "负责人")
private String toolPrincipals;
/** 负责人名称 */
@Excel(name = "负责人名称")
private String toolPrincipalsName;
/** 归属单位 */
@Excel(name = "归属单位")
private String toolRespDept;
}

View File

@@ -0,0 +1,129 @@
package com.rzdata.web.domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @auther xcy
* @create 2021-12-30 15:41
*/
@Data
public class WorkFlowInfo {
@ApiModelProperty("主键")
private String id;
@ApiModelProperty("当前活动定义名称")
private String curActDefName;
@ApiModelProperty("父流程Id")
private String parentProcInstId;
@ApiModelProperty("接收人姓名")
private String recUserName;
@ApiModelProperty("前一活动名称")
private String prevActDefName;
@ApiModelProperty("流程定义key")
private String procDefKey;
@ApiModelProperty("接收人Id")
private String recUserId;
@ApiModelProperty("发送人组织名称")
private String sendOrgName;
@ApiModelProperty("流程定义Id")
private String procDefId;
@ApiModelProperty("发送时间")
private String sendTime;
@ApiModelProperty("处理时间")
private String dealTime;
@ApiModelProperty("流程定义名称")
private String procDefName;
private String dataSource;
@ApiModelProperty("待办1 已办2 办结3 待阅4 已阅5 作废6 删除7")
private String status;
@ApiModelProperty("桌面端访问协议")
private String cportalProtocol;
@ApiModelProperty("发送人组织Id")
private String sendOrgId;
private String serviceCode;
@ApiModelProperty("前一活动定义Id")
private String prevActDefId;
@ApiModelProperty("手机端访问协议")
private String mportalProtocol;
@ApiModelProperty("标题")
private String title;
@ApiModelProperty("手机端URL")
private String mportalUrl;
@ApiModelProperty("顶级流程Id")
private String topProcInstId;
@ApiModelProperty("内容")
private String content;
@ApiModelProperty("发送人Id")
private String sendUserId;
@ApiModelProperty("流程起草人Id")
private String startUserId;
@ApiModelProperty("流程起草人姓名")
private String startUserName;
@ApiModelProperty("当前活动处理时限")
private String curActLimitTime;
@ApiModelProperty("发送人姓名")
private String sendUserName;
@ApiModelProperty("当前活动实例Id")
private String curActInstId;
@ApiModelProperty("起草时间")
private String startTime;
@ApiModelProperty("前一活动实例Id")
private String prevActInstId;
@ApiModelProperty("流程实例Id")
private String procInstId;
@ApiModelProperty("桌面端URL")
private String url;
private String wportalProtocol;
@ApiModelProperty("接收人组织名称")
private String recOrgName;
@ApiModelProperty("接收人组织Id")
private String recOrgId;
@ApiModelProperty("当前活动定义Id")
private String curActDefId;
@ApiModelProperty("业务数据")
private Object businessData;
//是否删除,1:正常 0删除
private Integer flag = 1;
private String docName;
}

View File

@@ -0,0 +1,88 @@
package com.rzdata.web.domain;
import com.rzdata.common.annotation.Excel;
import com.rzdata.common.core.domain.BaseEntity;
import lombok.Data;
/**
* 流程审批记录对象 t_workflow_log
*
* @author ja
* @date 2024-08-21
*/
@Data
public class WorkflowLog extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private String id;
/** 流程实例ID */
@Excel(name = "流程实例ID")
private String procInstId;
/** 流程实例key */
@Excel(name = "流程实例key")
private String procDefKey;
/** 业务ID */
@Excel(name = "业务ID")
private String businessId;
/** 当前环节定义Id */
@Excel(name = "当前环节定义Id")
private String actDefId;
/** 当前环节定义名称 */
@Excel(name = "当前环节定义名称")
private String actDefName;
/** 下一环节定义Id */
@Excel(name = "下一环节定义Id")
private String nextDefId;
/** 下一环节定义名称 */
@Excel(name = "下一环节定义名称")
private String nextDefName;
/** 环节实例ID */
@Excel(name = "环节实例ID")
private String actInstId;
/** 意见 */
@Excel(name = "意见")
private String opinion;
/** 发送人 */
@Excel(name = "发送人")
private String sender;
/** 发送人部门 */
@Excel(name = "发送人部门")
private String senderDeptId;
/** 接收人 */
@Excel(name = "接收人")
private String receiver;
/** 环节处理状态 */
@Excel(name = "环节处理状态")
private String actStatus;
/** 是否通过 */
@Excel(name = "是否通过")
private Boolean pass;
/** 租户id */
@Excel(name = "租户id")
private String tenantId;
/** 是否审核 */
@Excel(name = "是否审核")
private Boolean review;
/** 批次 */
@Excel(name = "批次")
private String batch;
}

View File

@@ -0,0 +1,33 @@
package com.rzdata.web.domain.bo;
import com.blueland.bpmclient.model.BpmClientInputModel;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @Author WangYang
* @Date 2022/2/11 15:12
* @Version 1.0
* @Description
*/
@Data
public class BpmClientInputModelBo implements Serializable {
private BpmClientInputModel model;
/**
* 申请结果
*/
private Boolean applyStatus;
private String type;
/**
* 是否有审核
*/
private Boolean review;
}

View File

@@ -0,0 +1,28 @@
package com.rzdata.web.domain.vo;
import com.rzdata.web.domain.WorkFlowInfo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @auther xcy
* @create 2021-12-31 10:49
*/
@Data
public class WorkFlowPageVo {
@ApiModelProperty("分页大小")
private Integer pageSize;
@ApiModelProperty("总数")
private Integer totalCount;
@ApiModelProperty("页码")
private Integer pageNumber;
@ApiModelProperty("流程详情信息")
private List<WorkFlowInfo> result;
}

View File

@@ -0,0 +1,71 @@
package com.rzdata.web.mapper;
import com.rzdata.web.domain.Attachment;
import java.util.List;
/**
* 附件Mapper接口
*
* @author panchichun
* @date 2024-08-28
*/
public interface AttachmentMapper
{
/**
* 查询附件
*
* @param id 附件主键
* @return 附件
*/
public Attachment selectAttachmentById(String id);
/**
* 查询附件列表
*
* @param attachment 附件
* @return 附件集合
*/
public List<Attachment> selectAttachmentList(Attachment attachment);
/**
* 新增附件
*
* @param attachment 附件
* @return 结果
*/
public int insertAttachment(Attachment attachment);
/**
* 修改附件
*
* @param attachment 附件
* @return 结果
*/
public int updateAttachment(Attachment attachment);
/**
* 根据业务id更新附件
* @param attachment
* @return
*/
public int updateAttachmentByBusinessId(Attachment attachment);
/**
* 删除附件
*
* @param id 附件主键
* @return 结果
*/
public int deleteAttachmentById(String id);
/**
* 批量删除附件
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteAttachmentByIds(String[] ids);
public int deleteAttachmentByBusinessId(List<String> list);
}

View File

@@ -0,0 +1,62 @@
package com.rzdata.web.mapper;
import com.rzdata.web.domain.Discussions;
import java.util.List;
/**
* 讨论Mapper接口
*
* @author panchichun
* @date 2024-08-30
*/
public interface DiscussionsMapper
{
/**
* 查询讨论
*
* @param id 讨论主键
* @return 讨论
*/
public Discussions selectDiscussionsById(String id);
/**
* 查询讨论列表
*
* @param discussions 讨论
* @return 讨论集合
*/
public List<Discussions> selectDiscussionsList(Discussions discussions);
/**
* 新增讨论
*
* @param discussions 讨论
* @return 结果
*/
public int insertDiscussions(Discussions discussions);
/**
* 修改讨论
*
* @param discussions 讨论
* @return 结果
*/
public int updateDiscussions(Discussions discussions);
/**
* 删除讨论
*
* @param id 讨论主键
* @return 结果
*/
public int deleteDiscussionsById(String id);
/**
* 批量删除讨论
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteDiscussionsByIds(String[] ids);
}

View File

@@ -0,0 +1,62 @@
package com.rzdata.web.mapper;
import com.rzdata.common.core.domain.DocumentCategory;
import java.util.List;
/**
* 文档资源分类管理Mapper接口
*
* @author spongepan
* @date 2024-08-27
*/
public interface DocumentCategoryMapper
{
/**
* 查询文档资源分类管理
*
* @param id 文档资源分类管理主键
* @return 文档资源分类管理
*/
public DocumentCategory selectDocumentCategoryById(String id);
/**
* 查询文档资源分类管理列表
*
* @param documentCategory 文档资源分类管理
* @return 文档资源分类管理集合
*/
public List<DocumentCategory> selectDocumentCategoryList(DocumentCategory documentCategory);
/**
* 新增文档资源分类管理
*
* @param documentCategory 文档资源分类管理
* @return 结果
*/
public int insertDocumentCategory(DocumentCategory documentCategory);
/**
* 修改文档资源分类管理
*
* @param documentCategory 文档资源分类管理
* @return 结果
*/
public int updateDocumentCategory(DocumentCategory documentCategory);
/**
* 删除文档资源分类管理
*
* @param id 文档资源分类管理主键
* @return 结果
*/
public int deleteDocumentCategoryById(String id);
/**
* 批量删除文档资源分类管理
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteDocumentCategoryByIds(String[] ids);
}

View File

@@ -3,6 +3,7 @@ package com.rzdata.web.mapper;
import com.rzdata.web.domain.Document;
import java.util.List;
import java.util.Map;
/**
* 【请填写功能名称】Mapper接口
@@ -53,10 +54,18 @@ public interface DocumentMapper
public int deleteDocumentById(String id);
/**
* 批量删除【请填写功能名称】
* 逻辑删除
*
* @param ids 需要删除的数据主键集合
* @param Document 需要删除的数据主键集合
* @return 结果
*/
public int deleteDocumentByIds(String[] ids);
public int isDeleteDocumentByIds(Document Document);
public int updatePushDoc(Document doc);
public int batchDeleteById(List<String> list);
List<Map<String, Object>> countType();
List<Map<String, Object>> countSource();
}

View File

@@ -0,0 +1,64 @@
package com.rzdata.web.mapper;
import com.rzdata.web.domain.DownloadCount;
import java.util.List;
/**
* 工具下载统计Mapper接口
*
* @author 潘驰春
* @date 2024-08-31
*/
public interface DownloadCountMapper
{
/**
* 查询工具下载统计
*
* @param id 工具下载统计主键
* @return 工具下载统计
*/
public DownloadCount selectDownloadCountById(String id);
/**
* 查询工具下载统计列表
*
* @param downloadCount 工具下载统计
* @return 工具下载统计集合
*/
public List<DownloadCount> selectDownloadCountList(DownloadCount downloadCount);
/**
* 新增工具下载统计
*
* @param downloadCount 工具下载统计
* @return 结果
*/
public int insertDownloadCount(DownloadCount downloadCount);
/**
* 修改工具下载统计
*
* @param downloadCount 工具下载统计
* @return 结果
*/
public int updateDownloadCount(DownloadCount downloadCount);
/**
* 删除工具下载统计
*
* @param id 工具下载统计主键
* @return 结果
*/
public int deleteDownloadCountById(String id);
/**
* 批量删除工具下载统计
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteDownloadCountByIds(String[] ids);
List<DownloadCount> userDownList(DownloadCount downloadCount);
}

View File

@@ -0,0 +1,62 @@
package com.rzdata.web.mapper;
import com.rzdata.web.domain.Replies;
import java.util.List;
/**
* 回复Mapper接口
*
* @author panchichun
* @date 2024-08-30
*/
public interface RepliesMapper
{
/**
* 查询回复
*
* @param id 回复主键
* @return 回复
*/
public Replies selectRepliesById(String id);
/**
* 查询回复列表
*
* @param replies 回复
* @return 回复集合
*/
public List<Replies> selectRepliesList(Replies replies);
/**
* 新增回复
*
* @param replies 回复
* @return 结果
*/
public int insertReplies(Replies replies);
/**
* 修改回复
*
* @param replies 回复
* @return 结果
*/
public int updateReplies(Replies replies);
/**
* 删除回复
*
* @param id 回复主键
* @return 结果
*/
public int deleteRepliesById(String id);
/**
* 批量删除回复
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteRepliesByIds(String[] ids);
}

View File

@@ -0,0 +1,67 @@
package com.rzdata.web.mapper;
import com.rzdata.web.domain.ToolApply;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 使用申请Mapper接口
*
* @author ja
* @date 2024-08-21
*/
public interface ToolApplyMapper
{
/**
* 查询使用申请
*
* @param id 使用申请主键
* @return 使用申请
*/
public ToolApply selectToolApplyById(String id);
ToolApply getInfoByBpmcId(String bpmcId);
/**
* 查询使用申请列表
*
* @param toolApply 使用申请
* @return 使用申请集合
*/
public List<ToolApply> selectToolApplyList(ToolApply toolApply);
/**
* 新增使用申请
*
* @param toolApply 使用申请
* @return 结果
*/
public int insertToolApply(ToolApply toolApply);
/**
* 修改使用申请
*
* @param toolApply 使用申请
* @return 结果
*/
public int updateToolApply(ToolApply toolApply);
/**
* 删除使用申请
*
* @param id 使用申请主键
* @return 结果
*/
public int deleteToolApplyById(String id);
/**
* 批量删除使用申请
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteToolApplyByIds(String[] ids);
int checkToolApply(@Param("toolId") String toolId, @Param("userId") String userId);
}

View File

@@ -3,6 +3,7 @@ package com.rzdata.web.mapper;
import com.rzdata.web.domain.Tool;
import java.util.List;
import java.util.Map;
/**
* 工具信息Mapper接口
@@ -20,6 +21,10 @@ public interface ToolMapper
*/
public Tool selectToolByToolId(String toolId);
Tool getInfoByBpmcId(String bpmcId);
int checkToolExist(Tool tool);
/**
* 查询工具信息列表
*
@@ -59,4 +64,8 @@ public interface ToolMapper
* @return 结果
*/
public int deleteToolByToolIds(String[] toolIds);
List<Map<String, Object>> countToolType();
List<Map<String, Object>> toolSource();
List<Map<String, Object>> recordStatus();
}

View File

@@ -0,0 +1,77 @@
package com.rzdata.web.mapper;
import com.rzdata.web.domain.TzMessage;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 消息Mapper接口
*
* @author ja
* @date 2024-08-31
*/
public interface TzMessageMapper
{
/**
* 查询消息
*
* @param id 消息主键
* @return 消息
*/
public TzMessage selectTzMessageById(String id);
/**
* 查询消息列表
*
* @param tzMessage 消息
* @return 消息集合
*/
public List<TzMessage> selectTzMessageList(TzMessage tzMessage);
/**
* 新增消息
*
* @param tzMessage 消息
* @return 结果
*/
public int insertTzMessage(TzMessage tzMessage);
/**
* 修改消息
*
* @param tzMessage 消息
* @return 结果
*/
public int updateTzMessage(TzMessage tzMessage);
/**
* 删除消息
*
* @param id 消息主键
* @return 结果
*/
public int deleteTzMessageById(String id);
/**
* 批量删除消息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteTzMessageByIds(String[] ids);
/**
* 更新所有的消息为已读
* @param tzMessage
* @return
*/
public int updateAllMarkedRead(TzMessage tzMessage);
/**
* 批量插入
* @param tzMessageList
* @return
*/
public int batchInsert(@Param("tzMessageList") List<TzMessage> tzMessageList);
}

View File

@@ -0,0 +1,63 @@
package com.rzdata.web.mapper;
import java.util.List;
import com.rzdata.web.domain.UseApplyItem;
/**
* 使用申请详情Mapper接口
*
* @author ja
* @date 2024-08-21
*/
public interface UseApplyItemMapper
{
/**
* 查询使用申请详情
*
* @param id 使用申请详情主键
* @return 使用申请详情
*/
public UseApplyItem selectUseApplyItemById(String id);
/**
* 查询使用申请详情列表
*
* @param useApplyItem 使用申请详情
* @return 使用申请详情集合
*/
public List<UseApplyItem> selectUseApplyItemList(UseApplyItem useApplyItem);
/**
* 新增使用申请详情
*
* @param useApplyItem 使用申请详情
* @return 结果
*/
public int insertUseApplyItem(UseApplyItem useApplyItem);
/**
* 修改使用申请详情
*
* @param useApplyItem 使用申请详情
* @return 结果
*/
public int updateUseApplyItem(UseApplyItem useApplyItem);
/**
* 删除使用申请详情
*
* @param id 使用申请详情主键
* @return 结果
*/
public int deleteUseApplyItemById(String id);
/**
* 批量删除使用申请详情
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteUseApplyItemByIds(String[] ids);
int deleteByApplyId(String applyId);
}

View File

@@ -0,0 +1,61 @@
package com.rzdata.web.mapper;
import java.util.List;
import com.rzdata.web.domain.WorkflowLog;
/**
* 流程审批记录Mapper接口
*
* @author ja
* @date 2024-08-21
*/
public interface WorkflowLogMapper
{
/**
* 查询流程审批记录
*
* @param id 流程审批记录主键
* @return 流程审批记录
*/
public WorkflowLog selectWorkflowLogById(String id);
/**
* 查询流程审批记录列表
*
* @param workflowLog 流程审批记录
* @return 流程审批记录集合
*/
public List<WorkflowLog> selectWorkflowLogList(WorkflowLog workflowLog);
/**
* 新增流程审批记录
*
* @param workflowLog 流程审批记录
* @return 结果
*/
public int insertWorkflowLog(WorkflowLog workflowLog);
/**
* 修改流程审批记录
*
* @param workflowLog 流程审批记录
* @return 结果
*/
public int updateWorkflowLog(WorkflowLog workflowLog);
/**
* 删除流程审批记录
*
* @param id 流程审批记录主键
* @return 结果
*/
public int deleteWorkflowLogById(String id);
/**
* 批量删除流程审批记录
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteWorkflowLogByIds(String[] ids);
}

View File

@@ -0,0 +1,70 @@
package com.rzdata.web.service;
import com.rzdata.web.domain.Attachment;
import java.util.List;
/**
* 附件Service接口
*
* @author panchichun
* @date 2024-08-28
*/
public interface IAttachmentService
{
/**
* 查询附件
*
* @param id 附件主键
* @return 附件
*/
public Attachment selectAttachmentById(String id);
/**
* 查询附件列表
*
* @param attachment 附件
* @return 附件集合
*/
public List<Attachment> selectAttachmentList(Attachment attachment);
/**
* 新增附件
*
* @param attachment 附件
* @return 结果
*/
public int insertAttachment(Attachment attachment);
/**
* 修改附件
*
* @param attachment 附件
* @return 结果
*/
public int updateAttachment(Attachment attachment);
public int updateAttachmentByBusinessId(Attachment attachment);
/**
* 批量删除附件
*
* @param ids 需要删除的附件主键集合
* @return 结果
*/
public int deleteAttachmentByIds(String[] ids);
/**
* 根据业务id批量删除
* @param businessIds
* @return
*/
public int deleteAttachmentByBusinessId(List<String> businessIds);
/**
* 删除附件信息
*
* @param id 附件主键
* @return 结果
*/
public int deleteAttachmentById(String id);
}

View File

@@ -0,0 +1,62 @@
package com.rzdata.web.service;
import com.rzdata.web.domain.Discussions;
import java.util.List;
/**
* 讨论Service接口
*
* @author panchichun
* @date 2024-08-30
*/
public interface IDiscussionsService
{
/**
* 查询讨论
*
* @param id 讨论主键
* @return 讨论
*/
public Discussions selectDiscussionsById(String id);
/**
* 查询讨论列表
*
* @param discussions 讨论
* @return 讨论集合
*/
public List<Discussions> selectDiscussionsList(Discussions discussions);
/**
* 新增讨论
*
* @param discussions 讨论
* @return 结果
*/
public int insertDiscussions(Discussions discussions);
/**
* 修改讨论
*
* @param discussions 讨论
* @return 结果
*/
public int updateDiscussions(Discussions discussions);
/**
* 批量删除讨论
*
* @param ids 需要删除的讨论主键集合
* @return 结果
*/
public int deleteDiscussionsByIds(String[] ids);
/**
* 删除讨论信息
*
* @param id 讨论主键
* @return 结果
*/
public int deleteDiscussionsById(String id);
}

View File

@@ -0,0 +1,71 @@
package com.rzdata.web.service;
import com.rzdata.common.core.domain.TreeSelect;
import com.rzdata.common.core.domain.DocumentCategory;
import java.util.List;
/**
* 文档资源分类管理Service接口
*
* @author spongepan
* @date 2024-08-27
*/
public interface IDocumentCategoryService
{
/**
* 查询文档资源分类管理
*
* @param id 文档资源分类管理主键
* @return 文档资源分类管理
*/
public DocumentCategory selectDocumentCategoryById(String id);
/**
* 查询文档资源分类管理列表
*
* @param documentCategory 文档资源分类管理
* @return 文档资源分类管理集合
*/
public List<DocumentCategory> selectDocumentCategoryList(DocumentCategory documentCategory);
/**
* 新增文档资源分类管理
*
* @param documentCategory 文档资源分类管理
* @return 结果
*/
public int insertDocumentCategory(DocumentCategory documentCategory);
/**
* 修改文档资源分类管理
*
* @param documentCategory 文档资源分类管理
* @return 结果
*/
public int updateDocumentCategory(DocumentCategory documentCategory);
/**
* 批量删除文档资源分类管理
*
* @param ids 需要删除的文档资源分类管理主键集合
* @return 结果
*/
public int deleteDocumentCategoryByIds(String[] ids);
/**
* 删除文档资源分类管理信息
*
* @param id 文档资源分类管理主键
* @return 结果
*/
public int deleteDocumentCategoryById(String id);
/**
* 获取文档资源树
* @param documentCategory
* @return
*/
List<TreeSelect> selectDocumentTreeList(DocumentCategory documentCategory);
}

View File

@@ -3,6 +3,7 @@ package com.rzdata.web.service;
import com.rzdata.web.domain.Document;
import java.util.List;
import java.util.Map;
/**
* 【请填写功能名称】Service接口
@@ -28,6 +29,9 @@ public interface IDocumentService
*/
public List<Document> selectDocumentList(Document document);
public List<Document> selectDocumentListAll(Document document);
/**
* 新增【请填写功能名称】
*
@@ -62,4 +66,15 @@ public interface IDocumentService
* @return 结果
*/
public int deleteDocumentById(String id);
/**
* 发布文档
* @param ids
* @return
*/
int pushDoc(String[] ids);
public int batchDeleteById(List<String> docIds);
Map<String, Object> statistics();
}

View File

@@ -0,0 +1,69 @@
package com.rzdata.web.service;
import com.rzdata.web.domain.DownloadCount;
import java.util.List;
/**
* 工具下载统计Service接口
*
* @author 潘驰春
* @date 2024-08-31
*/
public interface IDownloadCountService
{
/**
* 查询工具下载统计
*
* @param id 工具下载统计主键
* @return 工具下载统计
*/
public DownloadCount selectDownloadCountById(String id);
/**
* 查询工具下载统计列表
*
* @param downloadCount 工具下载统计
* @return 工具下载统计集合
*/
public List<DownloadCount> selectDownloadCountList(DownloadCount downloadCount);
/**
* 新增工具下载统计
*
* @param downloadCount 工具下载统计
* @return 结果
*/
public int insertDownloadCount(DownloadCount downloadCount);
/**
* 修改工具下载统计
*
* @param downloadCount 工具下载统计
* @return 结果
*/
public int updateDownloadCount(DownloadCount downloadCount);
/**
* 批量删除工具下载统计
*
* @param ids 需要删除的工具下载统计主键集合
* @return 结果
*/
public int deleteDownloadCountByIds(String[] ids);
/**
* 删除工具下载统计信息
*
* @param id 工具下载统计主键
* @return 结果
*/
public int deleteDownloadCountById(String id);
/**
* 用户下载列表
* @param downloadCount
* @return
*/
List<DownloadCount> userDownList(DownloadCount downloadCount);
}

View File

@@ -0,0 +1,62 @@
package com.rzdata.web.service;
import com.rzdata.web.domain.Replies;
import java.util.List;
/**
* 回复Service接口
*
* @author panchichun
* @date 2024-08-30
*/
public interface IRepliesService
{
/**
* 查询回复
*
* @param id 回复主键
* @return 回复
*/
public Replies selectRepliesById(String id);
/**
* 查询回复列表
*
* @param replies 回复
* @return 回复集合
*/
public List<Replies> selectRepliesList(Replies replies);
/**
* 新增回复
*
* @param replies 回复
* @return 结果
*/
public int insertReplies(Replies replies);
/**
* 修改回复
*
* @param replies 回复
* @return 结果
*/
public int updateReplies(Replies replies);
/**
* 批量删除回复
*
* @param ids 需要删除的回复主键集合
* @return 结果
*/
public int deleteRepliesByIds(String[] ids);
/**
* 删除回复信息
*
* @param id 回复主键
* @return 结果
*/
public int deleteRepliesById(String id);
}

View File

@@ -0,0 +1,67 @@
package com.rzdata.web.service;
import java.util.List;
import com.rzdata.web.domain.ToolApply;
/**
* 使用申请Service接口
*
* @author ja
* @date 2024-08-21
*/
public interface IToolApplyService
{
/**
* 查询使用申请
*
* @param id 使用申请主键
* @return 使用申请
*/
public ToolApply selectToolApplyById(String id);
ToolApply getInfoByBpmcId(String bpmcId);
/**
* 查询使用申请列表
*
* @param toolApply 使用申请
* @return 使用申请集合
*/
public List<ToolApply> selectToolApplyList(ToolApply toolApply);
/**
* 新增使用申请
*
* @param toolApply 使用申请
* @return 结果
*/
public int insertToolApply(ToolApply toolApply);
/**
* 修改使用申请
*
* @param toolApply 使用申请
* @return 结果
*/
public int updateToolApply(ToolApply toolApply);
/**
* 批量删除使用申请
*
* @param ids 需要删除的使用申请主键集合
* @return 结果
*/
public int deleteToolApplyByIds(String[] ids);
/**
* 删除使用申请信息
*
* @param id 使用申请主键
* @return 结果
*/
public int deleteToolApplyById(String id);
boolean checkToolApply(String toolId, String userId);
void sendTzMessage(ToolApply toolApply);
}

View File

@@ -3,6 +3,7 @@ package com.rzdata.web.service;
import com.rzdata.web.domain.Tool;
import java.util.List;
import java.util.Map;
/**
* 工具信息Service接口
@@ -20,6 +21,8 @@ public interface IToolService
*/
public Tool selectToolByToolId(String toolId);
Tool getInfoByBpmcId(String bpmcId);
/**
* 查询工具信息列表
*
@@ -36,7 +39,7 @@ public interface IToolService
*/
public int insertTool(Tool tool);
public boolean checkToolExist(String toolCode, String toolRespDept);
public boolean checkToolExist(Tool tTool);
/**
* 修改工具信息
@@ -61,4 +64,24 @@ public interface IToolService
* @return 结果
*/
public int deleteToolByToolId(String toolId);
/**
* 删除文档和附件
* @param tool
*/
public void deleteDocAndAtt(Tool tool);
/**
* 新增文档和附件
* @param tool
*/
public void addDocAndAtt(Tool tool);
void recordToolApply(Tool tool);
void updateDocPushStatus(Tool tTool);
void sendTzMessage(Tool tTool);
Map<String, Object> statistics();
}

View File

@@ -0,0 +1,67 @@
package com.rzdata.web.service;
import com.rzdata.web.domain.TzMessage;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
/**
* 消息Service接口
*
* @author ja
* @date 2024-08-31
*/
public interface ITzMessageService
{
/**
* 查询消息
*
* @param id 消息主键
* @return 消息
*/
public TzMessage selectTzMessageById(String id);
/**
* 查询消息列表
*
* @param tzMessage 消息
* @return 消息集合
*/
public List<TzMessage> selectTzMessageList(TzMessage tzMessage);
/**
* 新增消息
*
* @param tzMessage 消息
* @return 结果
*/
public int insertTzMessage(TzMessage tzMessage);
/**
* 修改消息
*
* @param tzMessage 消息
* @return 结果
*/
public int updateTzMessage(TzMessage tzMessage);
/**
* 批量删除消息
*
* @param ids 需要删除的消息主键集合
* @return 结果
*/
public int deleteTzMessageByIds(String[] ids);
/**
* 删除消息信息
*
* @param id 消息主键
* @return 结果
*/
public int deleteTzMessageById(String id);
int allMarkedRead(TzMessage tzMessage);
public int batchInsert(List<TzMessage> tzMessageList);
}

View File

@@ -0,0 +1,63 @@
package com.rzdata.web.service;
import java.util.List;
import com.rzdata.web.domain.UseApplyItem;
/**
* 使用申请详情Service接口
*
* @author ja
* @date 2024-08-21
*/
public interface IUseApplyItemService
{
/**
* 查询使用申请详情
*
* @param id 使用申请详情主键
* @return 使用申请详情
*/
public UseApplyItem selectUseApplyItemById(String id);
/**
* 查询使用申请详情列表
*
* @param useApplyItem 使用申请详情
* @return 使用申请详情集合
*/
public List<UseApplyItem> selectUseApplyItemList(UseApplyItem useApplyItem);
/**
* 新增使用申请详情
*
* @param useApplyItem 使用申请详情
* @return 结果
*/
public int insertUseApplyItem(UseApplyItem useApplyItem);
/**
* 修改使用申请详情
*
* @param useApplyItem 使用申请详情
* @return 结果
*/
public int updateUseApplyItem(UseApplyItem useApplyItem);
/**
* 批量删除使用申请详情
*
* @param ids 需要删除的使用申请详情主键集合
* @return 结果
*/
public int deleteUseApplyItemByIds(String[] ids);
/**
* 删除使用申请详情信息
*
* @param id 使用申请详情主键
* @return 结果
*/
public int deleteUseApplyItemById(String id);
void updateItemList(List<UseApplyItem> list, String applyId);
}

View File

@@ -0,0 +1,66 @@
package com.rzdata.web.service;
import java.util.List;
import com.blueland.bpmclient.model.ProcessInstanceModel;
import com.rzdata.web.domain.WorkflowLog;
import com.rzdata.web.domain.bo.BpmClientInputModelBo;
/**
* 流程审批记录Service接口
*
* @author ja
* @date 2024-08-21
*/
public interface IWorkflowLogService
{
/**
* 查询流程审批记录
*
* @param id 流程审批记录主键
* @return 流程审批记录
*/
public WorkflowLog selectWorkflowLogById(String id);
/**
* 查询流程审批记录列表
*
* @param workflowLog 流程审批记录
* @return 流程审批记录集合
*/
public List<WorkflowLog> selectWorkflowLogList(WorkflowLog workflowLog);
/**
* 新增流程审批记录
*
* @param workflowLog 流程审批记录
* @return 结果
*/
public int insertWorkflowLog(WorkflowLog workflowLog);
/**
* 修改流程审批记录
*
* @param workflowLog 流程审批记录
* @return 结果
*/
public int updateWorkflowLog(WorkflowLog workflowLog);
/**
* 批量删除流程审批记录
*
* @param ids 需要删除的流程审批记录主键集合
* @return 结果
*/
public int deleteWorkflowLogByIds(String[] ids);
/**
* 删除流程审批记录信息
*
* @param id 流程审批记录主键
* @return 结果
*/
public int deleteWorkflowLogById(String id);
void saveProcLog(BpmClientInputModelBo bpmClientInputModelBo, ProcessInstanceModel processInst, String action);
}

View File

@@ -0,0 +1,793 @@
package com.rzdata.web.service;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.blueland.bpmclient.BpmClient;
import com.blueland.bpmclient.model.*;
import com.rzdata.common.core.domain.entity.SysUser;
import com.rzdata.common.utils.SecurityUtils;
import com.rzdata.common.utils.StringUtils;
import com.rzdata.system.service.ISysConfigService;
import com.rzdata.system.service.ISysDeptService;
import com.rzdata.system.service.ISysUserService;
import com.rzdata.web.core.config.BpmcConfig;
import com.rzdata.web.domain.WorkFlowInfo;
import com.rzdata.web.domain.bo.BpmClientInputModelBo;
import com.rzdata.web.domain.vo.WorkFlowPageVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.compress.utils.Lists;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Slf4j
@Service("workflowService")
public class WorkflowService {
private static int FLOW_STATUS_ERROR = 0;// 异常
private static int FLOW_STATUS_UNREAD = 1;// 待办
private static int FLOW_STATUS_READ = 2;// 已办
private static int FLOW_STATUS_FINISH = 3;// 办结
private static String END_ACT_NAME = "结束";
/**
* 是否从通讯录选择下一步人员
*/
private static String SHOW_TXL_SELECT = "show_txl_select";
@Autowired
private BpmcConfig bpmcConfig;
@Autowired
ISysConfigService configService;
@Autowired
ISysDeptService sysDeptService;
@Autowired
ISysUserService sysUserService;
@Autowired
IWorkflowLogService iWorkflowLogService;
private final static String CUR_ACT_DEF_KEY = "curActDef";
private final static String CUR_ACT_INST_KEY = "curActInst";
private final static String PROC_INST_KEY = "procInst";
private final static String PROC_DEF_KEY = "procDef";
private final static String ACT_OPPOWERS = "actOppowers";// 下一环节显示按钮
public enum ENUM_ACTION {
/**
* // 暂存
*/
save,
/**
* // 提交
*/
submit,
/**
* // 作废
*/
cancel,
/**
* // 转派
*/
transfer,
/**
* // 退回拟稿人
*/
backtostart,
/**
* // 退回上一步
*/
backtoprev,
/**
* // 撤回
*/
back,
/**
* // 驳回
*/
reject,
}
;
BpmClient getBpmClient() {
WorkflowConfig workflowConfig = new WorkflowConfig();
workflowConfig.setTenantId(bpmcConfig.getTenantId());
workflowConfig.setBaseURL(bpmcConfig.getServiceUrl());
BpmClient bpmClient = new BpmClient(workflowConfig);
return bpmClient;
}
/**
* 暂存流程
*
* @param bpmClientInputModelBo
* @param businessId 业务id
* @return
* @throws Exception
*/
public ProcessInstanceModel saveExecute(BpmClientInputModelBo bpmClientInputModelBo, String businessId) throws Exception {
bpmClientInputModelBo.getModel().setWf_businessKey(businessId);
return processProcInst(bpmClientInputModelBo, ENUM_ACTION.save.name());
}
/**
* 下一步流程
*
* @param bpmClientInputModelBo
* @param businessId 业务id
* @return
* @throws Exception
*/
public ProcessInstanceModel nextExecute(BpmClientInputModelBo bpmClientInputModelBo, String businessId) throws Exception {
bpmClientInputModelBo.getModel().setWf_businessKey(businessId);
return processProcInst(bpmClientInputModelBo, ENUM_ACTION.submit.name());
}
public ProcessInstanceModel cancelExecute(BpmClientInputModelBo bpmClientInputModelBo, String businessId) throws Exception {
bpmClientInputModelBo.getModel().setWf_businessKey(businessId);
return processProcInst(bpmClientInputModelBo, ENUM_ACTION.cancel.name());
}
/**
* 处理流程实例
*
* @param action 处理操作类型
* @return
*/
public ProcessInstanceModel processProcInst(BpmClientInputModelBo bpmClientInputModelBo, String action)
throws Exception {
ProcessInstanceModel processInst = new ProcessInstanceModel();
BpmClientInputModel bpmClientInputModel = bpmClientInputModelBo.getModel();
// 待办URL
String url = this.bpmcConfig.getUniteWorkUrl()+ "?businessKey=" + bpmClientInputModel.getWf_businessKey()+ "&type=" + bpmClientInputModelBo.getType();
bpmClientInputModel.setWf_uniteworkUrl(url);
BpmClient bpmClient = getBpmClient();
switch (ENUM_ACTION.valueOf(action)) {
case cancel:// 作废
processInst = bpmClient.cancelProcInst(bpmClientInputModel);
break;
case backtostart:// 返回拟稿人
processInst = bpmClient.callBackStart(bpmClientInputModel);
bpmClientInputModel.setWf_nextActDefName(processInst.getNextActInsts().get(0).getActDefName());
break;
case backtoprev:// 返回上一步
processInst = bpmClient.backToPrev(bpmClientInputModel);
break;
case back:// 撤回
processInst = bpmClient.callBack(bpmClientInputModel);
break;
case transfer:// 转派
processInst = bpmClient.transfer(bpmClientInputModel);
break;
case reject:// 驳回
processInst = bpmClient.rejectFlow(bpmClientInputModel);
break;
case save:
processInst = bpmClient.saveFlowInstance(bpmClientInputModel);
break;
case submit:
processInst = bpmClient.submitFlowInstance(bpmClientInputModel);
break;
default:
break;
}
if (processInst!=null&& StringUtils.isNotEmpty(processInst.getProcInstId())) {
iWorkflowLogService.saveProcLog(bpmClientInputModelBo, processInst,action);
}
return processInst;
}
/**
* 获取流程实例完整信息,包含流程实例、当前环节实例、流程定义等信息
*
* @return
*/
public HashMap<String, Object> getFLowInfo(SearchQuery searchQuery) throws Exception {
// TODO Auto-generated method stub
HashMap<String, Object> returnDataMap = new HashMap<>();
BpmClient bpmClient = getBpmClient();
JSONObject jo = new JSONObject();
try {
jo = getFlowInfo(searchQuery);
if (jo == null) {
return null;
}
if (!jo.containsKey(CUR_ACT_DEF_KEY) || !jo.containsKey(CUR_ACT_INST_KEY) || !jo.containsKey(PROC_INST_KEY)
|| !jo.containsKey(PROC_DEF_KEY)) {
throw new Exception("返回的数据不完整");
}
returnDataMap.put(CUR_ACT_DEF_KEY, jo.getJSONObject(CUR_ACT_DEF_KEY));
returnDataMap.put(CUR_ACT_INST_KEY, jo.getJSONObject(CUR_ACT_INST_KEY));
returnDataMap.put(PROC_INST_KEY, jo.getJSONObject(PROC_INST_KEY));
returnDataMap.put(PROC_DEF_KEY, jo.getJSONObject(PROC_DEF_KEY));
returnDataMap.put(ACT_OPPOWERS, jo.getJSONArray(ACT_OPPOWERS));
/**
* JSONArray ja_log = jo.getJSONArray("procLogs"); ArrayList<HashMap<String,
* Object>> list_log = Lists.newArrayList(); for (int i = 0; i < ja_log.size();
* i++) { HashMap<String, Object> commentMap = Maps.newHashMap();
* commentMap.put("actDefName",
* ja_log.getJSONObject(i).getString("prevActDefName"));
* commentMap.put("commentTime", ja_log.getJSONObject(i).get("startTime"));
* commentMap.put("actDefId", ja_log.getJSONObject(i).get("prevActDefId"));
* String orgId = ja_log.getJSONObject(i).getString("sendOrgId"); PubOrgEntity
* deptEntry = pubOrgDao.get(orgId); String userName =
* String.format("(%s-%s)%s", deptEntry.getCompanyName(),
* deptEntry.getOrgName(), ja_log.getJSONObject(i).getString("sendUserName"));
* commentMap.put("commentUserName", userName); commentMap.put("userName",
* ja_log.getJSONObject(i).getString("sendUserName"));
* commentMap.put("commentFullMessage",
* ja_log.getJSONObject(i).get("commentFullMessage")); list_log.add(commentMap);
* } returnDataMap.put("procLogs", list_log);
*/
// returnDataMap.put("transferLog",
// projectCommentEntryMapper.findCommentListByParams(params));//获取流程实例转派审批日志
} catch (Exception ex) {
log.error("getFLowInfo==============" + JSON.toJSONString(searchQuery), ex);
}
return returnDataMap;
}
JSONObject getFlowInfo(SearchQuery searchQuery) {
String returnData = "";
BpmClient bpmClient = getBpmClient();
try {
switch (searchQuery.getStatus()) {
case 1:
returnData = bpmClient.getToDoFlowInfo(searchQuery);
break;
case 2:
returnData = bpmClient.getYibanFlowInfo(searchQuery);
break;
case 3:
returnData = bpmClient.getBanJieFlowInfo(searchQuery);
break;
default:
break;
}
return JSON.parseObject(returnData);
} catch (Exception ex) {
log.error("=======流程平台返回信息:" + JSON.toJSONString(searchQuery), ex);
}
return null;
}
/**
* 获取流程实例日志
*
* @param bpmClientInputModel
* @return
*/
public HashMap<String, Object> getProcInstLog(BpmClientInputModel bpmClientInputModel) {
HashMap<String, Object> returnDataMap = new HashMap<>();
List<Map<String, Object>> procLog;
BpmClient bpmClient = getBpmClient();
try {
if (StrUtil.isNotBlank(bpmClientInputModel.getWf_procInstId())) {
String returnData = bpmClient.getProcInstLog(bpmClientInputModel.getWf_procInstId());
Map<String, Object> procInstLog = JSONObject.parseObject(returnData, Map.class);
if (null != procInstLog && procInstLog.containsKey("procLogs")) {
// 获取日志实例
procLog = (List<Map<String, Object>>) procInstLog.get("procLogs");
procLog = dealEchoMap(procLog);
JSONObject jo = JSON.parseObject(returnData);
returnDataMap.put("procInst", jo.getJSONObject("procInst"));
returnDataMap.put("procLogs", procLog);
}
}
} catch (Exception ex) {
log.error("getProcInstLog==============" + JSON.toJSONString(bpmClientInputModel), ex);
}
return returnDataMap;
}
/**
* 去掉相关部门重复数据
*
* @param procLog
* @return
*/
private List<Map<String, Object>> dealEchoMap(List<Map<String, Object>> procLog) {
List<Map<String, Object>> newList = new ArrayList<Map<String, Object>>();
// 去重
for (int i = 0; i < procLog.size(); i++) {
Map<String, Object> oldMap = procLog.get(i);
if (newList.size() > 0) {
boolean isContain = false;
for (int j = 0; j < newList.size(); j++) {
Map<String, Object> newMap = newList.get(j);
if (newMap.get("prevActInstId").equals(oldMap.get("prevActInstId"))) {
for (String k : oldMap.keySet()) {
newMap.put(k, oldMap.get(k));
}
isContain = true;
break;
}
}
if (!isContain) {
newList.add(oldMap);
}
} else {
newList.add(oldMap);
}
}
return newList;
}
/**
* 查询待办列表
*
* @param searchQuery
* @return
*/
public PageResultModel findRecordList(SearchQuery searchQuery) {
// TODO Auto-generated method stub
BpmClient bpmClient = getBpmClient();
try {
return bpmClient.getRecordList(searchQuery);
} catch (Exception ex) {
log.error("findRecordList===" + JSON.toJSONString(searchQuery), ex);
}
return null;
}
/**
* 查询待办列表
*
* @param searchQuery
* @return
*/
public WorkFlowPageVo findToDoList(SearchQuery searchQuery) {
BpmClient bpmClient = getBpmClient();
WorkFlowPageVo pageVo = new WorkFlowPageVo();
try {
// 所属流程平台租户
searchQuery.setTenantId(bpmcConfig.getTenantId());
searchQuery.setRecUserId(SecurityUtils.getUsername());
PageResultModel pageResultModel = bpmClient.getRecordList(searchQuery);
pageVo.setPageSize(pageResultModel.getPageSize());
pageVo.setPageNumber(pageResultModel.getThisPageNumber());
pageVo.setTotalCount(pageResultModel.getTotalCount());
List<WorkFlowInfo> workFlowInfos = JSONUtil.toList(JSONUtil.toJsonStr(pageResultModel.getResult()), WorkFlowInfo.class);
for(WorkFlowInfo workFlowInfo : workFlowInfos){
SysUser startSysUser = sysUserService.selectUserByUserName(workFlowInfo.getStartUserId());
if(null != startSysUser){
workFlowInfo.setStartUserName(startSysUser.getUserName());
}
SysUser sendSysUser = sysUserService.selectUserByUserName(workFlowInfo.getSendUserId());
if(null != sendSysUser){
workFlowInfo.setSendUserName(sendSysUser.getUserName());
}
}
pageVo.setResult(workFlowInfos);
return pageVo;
} catch (Exception ex) {
log.error("findRecordList===" + JSON.toJSONString(searchQuery), ex);
}
return pageVo;
}
/**
* 获取下一环节定义
*
* @param searchQuery
* @return
*/
public List<ActivityDefinitionModel> getNextActs(SearchQuery searchQuery) {
BpmClient bpmClient = getBpmClient();
List<ActivityDefinitionModel> actDefList = Lists.newArrayList();
try {
List<ActivityDefinitionModel> nextacts = bpmClient.getNextacts(searchQuery);
for (ActivityDefinitionModel activityDefinitionModel : nextacts) {
activityDefinitionModel.setShowTxlSelect("N");
// 流程平台如果有输出线名称 返回当前环节名称自动为输出线名称 由于其他业务系统已经使用 该处做特殊处理 (不读输出线名称)
/*
* if (StrUtil.isNotBlank(activityDefinitionModel.getDescription())) {
* // 描述名称 为流程平台返回的当前环节名称
* activityDefinitionModel.setActDefName(activityDefinitionModel.getDescription(
* ));
* }
*/
if (END_ACT_NAME.equalsIgnoreCase(activityDefinitionModel.getActDefName())) {
actDefList.add(activityDefinitionModel);
continue;
}
List<ExtAttributeModel> extAttrlist = bpmClient.getActDefExtAttrs(searchQuery.getProcDefId(),
activityDefinitionModel.getActDefId());
for (ExtAttributeModel extMap : extAttrlist) {
// 根据流程环节自定义标签判断是否显示“通讯录选择人员”按钮
if (SHOW_TXL_SELECT.equalsIgnoreCase(extMap.getObjKey().trim())) {
activityDefinitionModel.setShowTxlSelect(extMap.getObjValue());
break;
}
}
actDefList.add(activityDefinitionModel);
}
} catch (Exception e) {
log.error("获取下一步环节定义列表失败,参数:" + JSON.toJSONString(searchQuery), e);
}
return actDefList;
}
/**
* 获取下一环节用户信息
*
* @param searchQuery
* @return
*/
public List<ActivityResourceModel> getNextActUsers(SearchQuery searchQuery) {
BpmClient bpmClient = getBpmClient();
List<ActivityResourceModel> nextactUsers = Lists.newArrayList();
try {
nextactUsers = bpmClient.getNextactUsers(searchQuery);
} catch (Exception e) {
log.error("获取下一步环节用户列表失败,参数:" + JSON.toJSONString(searchQuery), e);
}
return nextactUsers;
}
public List<ExtAttributeModel> getExtAttributeModel(String procDefId, String actDefId) {
BpmClient bpmClient = getBpmClient();
List<ExtAttributeModel> list = Lists.newArrayList();
try {
list = bpmClient.getActDefExtAttrs(procDefId, actDefId);
} catch (Exception e) {
log.error("获取扩展属性失败", e);
}
return list;
}
/**
* 判断下一环节是否支持自动提交
*
* @param searchQuery
* @return
*/
public String checkAutoCommit(SearchQuery searchQuery) throws Exception {
BpmClient bpmClient = getBpmClient();
try {
String actDefId = "";
String procDefId = "";
// 待办提交
if (StrUtil.isNotBlank(searchQuery.getCurActInstId())) {
ActivitiInstanceModel activitiInstanceModel = bpmClient
.getActivityInstance(searchQuery.getCurActInstId());
actDefId = activitiInstanceModel.getActDefId();
procDefId = activitiInstanceModel.getProcDefId();
} else { // 新建提交
ActivityDefinitionModel activityDefinitionModel = bpmClient.getActDef(searchQuery.getProcDefId(),
searchQuery.getCurActDefId());
actDefId = activityDefinitionModel.getActDefId();
procDefId = activityDefinitionModel.getProcDefId();
}
List<ActivityDefinitionModel> netxtActDefList = bpmClient.getNextacts(searchQuery);
if (netxtActDefList != null && netxtActDefList.size() == 1) {
ActivityDefinitionModel netxtActDef = netxtActDefList.get(0);
ActivityDefinitionModel actDef = bpmClient.getActDef(procDefId, actDefId);
if (("auto".equalsIgnoreCase(actDef.getJumpType()) || netxtActDef.isNotSelectReceiver()
|| "endEvent".equals(netxtActDef.getActDefType()))) {
return netxtActDef.getActDefId();
}
}
} catch (Exception ex) {
log.error("checkAutoCommit==" + JSON.toJSONString(searchQuery), ex);
throw new Exception(ex);
}
return "";
}
/**
* 获取第一个环节定义信息
*
* @param procDefId
* @return
*/
public ActivityDefinitionModel getStartactDef(String procDefId) throws Exception {
BpmClient bpmClient = getBpmClient();
try {
return bpmClient.getStartactDef(procDefId);
} catch (Exception ex) {
// TODO Auto-generated catch block
log.error("getStartactDef==" + procDefId, ex);
throw new Exception(ex);
}
}
/**
* 获取环节定义信息
* @param procDefId 流程定义Id
* @param actDefId 环节定义Id
* @return
* @throws Exception
*/
public ActivityDefinitionModel getActDef(String procDefId,String actDefId) throws Exception {
BpmClient bpmClient = getBpmClient();
try {
return bpmClient.getActDef(procDefId, actDefId);
} catch (Exception ex) {
// TODO Auto-generated catch block
log.error("getActDef==" + procDefId+"===="+actDefId, ex);
throw new Exception(ex);
}
}
/**
* 获取环节定义信息
* @param procDefId 流程定义Id
* @return
* @throws Exception
*/
public List<ActivityDefinitionModel> getActDef(String procDefId) throws Exception {
BpmClient bpmClient = getBpmClient();
try {
return bpmClient.getActDef(procDefId);
} catch (Exception ex) {
log.error("getActDef==" + procDefId, ex);
throw new Exception(ex);
}
}
/**
* 根据流程定义Key获取流程定义信息
*
* @param procDefKey
* @return
*/
public ProcessDefinitionModel getProcessDefinitionModel(String procDefKey) throws Exception {
BpmClient bpmClient = getBpmClient();
try {
return bpmClient.getProcessDef(procDefKey);
} catch (Exception ex) {
// TODO Auto-generated catch block
log.error("getProcessDefinitionModel==" + procDefKey, ex);
throw new Exception(ex);
}
}
public String getHistasklogurl(String procInstId) throws Exception {
BpmClient bpmClient = getBpmClient();
try {
Map<String, String> param = bpmClient.getHistoryUrl(procInstId);
return param.get("url");
} catch (Exception ex) {
log.error("getHistasklogurl==" + ex);
throw new Exception(ex);
}
}
public String getImageUrl(String procDefId) throws Exception {
BpmClient bpmClient = getBpmClient();
try {
Map<String, String> param = bpmClient.getImageUrl(procDefId);
return param.get("url");
} catch (Exception ex) {
log.error("getImageUrl==" + ex);
throw new Exception(ex);
}
}
/**
* 查询流程实例状态
*
* @param procInstId
* @param curActInstId
* @return
*/
public int getFlowStatus(String procInstId, String curActInstId) {
BpmClient bpmClient = getBpmClient();
try {
ActivitiInstanceModel actInstMap = bpmClient.getActivityInstance(curActInstId);
if (actInstMap != null && actInstMap.getFinishTime() != null && actInstMap.getFinishTime().length() > 0) {
ProcessInstanceModel procInst = bpmClient.getProcessInstById(procInstId);
if (procInst != null && procInst.getFinishTime() != null) {
return FLOW_STATUS_FINISH;
}
return FLOW_STATUS_READ;
}
return FLOW_STATUS_UNREAD;
} catch (Exception ex) {
log.error("getFlowStatus===procInstId=" + procInstId + ",curActInstId==" + curActInstId, ex);
}
return FLOW_STATUS_ERROR;
}
/**
* 查询流程实例状态,并判断当前用户是否有权限打开待办
*
* @param procInstId
* @param curActInstId
* @param userId
* @return
*/
public ProcessInstanceModel getProcessInstance(String procInstId, String curActInstId,
String userId) throws Exception {
BpmClient bpmClient = getBpmClient();
ProcessInstanceModel procInst = null;
ActivitiInstanceModel actInst = bpmClient.getActivityInstance(curActInstId);
if (actInst == null || !StrUtil.equals(actInst.getReceiverUserId(), userId)) {
throw new Exception("没有找到环节实例");
}
procInst = bpmClient.getProcessInstById(procInstId);
procInst.setCurrentActivitiInstance(actInst);
Map<String, String> formUrlMap = getFlowActForm(procInst.getProcDefId(), actInst.getActDefId());
if (formUrlMap.containsKey("formUrl")) {
procInst.setFormUrl(formUrlMap.get("formUrl"));
}
procInst.setProcInstState(FLOW_STATUS_ERROR + "");
if (actInst.getFinishTime() == null || actInst.getFinishTime().length() == 0) {
procInst.setProcInstState(FLOW_STATUS_UNREAD + "");
return procInst;
}
if (procInst.getFinishTime() != null) {
procInst.setProcInstState(FLOW_STATUS_FINISH + "");
} else {
procInst.setProcInstState(FLOW_STATUS_READ + "");
}
return procInst;
}
public Map<String, String> getFlowActForm(String procDefId, String actDefId) throws Exception {
BpmClient bpmClient = getBpmClient();
Map<String, String> result = new HashMap<>();
try {
ActivityDefinitionModel act = bpmClient.getActDef(procDefId, actDefId);
result.put("formUrl", act.getPageUrl());
result.put("appFormUrl", act.getMportalUrl());
} catch (Exception ex) {
log.error("getFlowActForm==" + ex);
throw new Exception(ex);
}
return result;
}
public Map<String, Object> getProcessInstById(String procInstId) {
BpmClient bpmClient = getBpmClient();
ProcessInstanceModel procInst = null;
Map<String, Object> result = new HashMap<>();
try {
procInst = bpmClient.getProcessInstById(procInstId);
result = BeanUtil.beanToMap(procInst);
Map<String, Object> curActInfo = this.getCurActInfo(procInstId);
result.put("curActInstId", curActInfo.get("curActInstId").toString());
result.put("curActDefId", curActInfo.get("curActDefId").toString());
result.put("curActDefName", curActInfo.get("curActDefName").toString());
result.put("prevActDefId", curActInfo.get("prevActDefId").toString());
result.put("sendUserId", curActInfo.get("receiveUserId").toString());
result.put("sendUserOrgId", curActInfo.get("receiveOrgId").toString());
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return result;
}
private Map<String, Object> getCurActInfo(String procInstId) throws Exception {
BpmClient bpmClient = getBpmClient();
Map<String, Object> result = new HashMap<String, Object>();
// 根据流程实例id获取流程实例日志
String logStr = bpmClient.getProcInstLog(procInstId);
List<Map<String, Object>> procLog = new ArrayList<Map<String, Object>>();
Map<String, Object> procInstLog = JSONObject.parseObject(logStr, Map.class);
if (null != procInstLog && procInstLog.containsKey("procLogs")) {
// 获取日志实例
procLog = (List<Map<String, Object>>) procInstLog.get("procLogs");
for (Map<String, Object> map : procLog) {
if (null == map.get("endTime")) {
if ("pms_zhsqlc-03".equals(map.get("prevActDefId"))) {
result = map;
} else {
result = map;
break;
}
}
}
}
return result;
}
public Map<String, Object> procInstInfoAndStatus(String procInstId) {
Map<String, Object> procInst = this.getProcessInstById(procInstId);
int status = 0;
try {
status = this.getFlowStatus(procInstId, procInst.get("curActInstId").toString());
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
procInst.put("status", status + "");
return procInst;
}
public Map<String, Object> checkAutoJump(SearchQuery searchQuery) throws Exception {
BpmClient bpmClient = getBpmClient();
ActivityDefinitionModel actDef = new ActivityDefinitionModel();
try {
String actDefId = "";
String procDefId = "";
// 待办提交
if (StrUtil.isNotBlank(searchQuery.getCurActInstId())) {
ActivitiInstanceModel activitiInstanceModel = bpmClient
.getActivityInstance(searchQuery.getCurActInstId());
actDefId = activitiInstanceModel.getActDefId();
procDefId = activitiInstanceModel.getProcDefId();
actDef = bpmClient.getActDef(procDefId, actDefId);
} else { // 新建提交
actDef = bpmClient.getActDef(searchQuery.getProcDefId(), searchQuery.getCurActDefId());
}
Map<String, Object> result = new HashMap<String, Object>();
if ("auto".equalsIgnoreCase(actDef.getJumpType())) {
result.put("flag", true);
} else {
result.put("flag", false);
}
return result;
} catch (Exception ex) {
log.error("checkAutoCommit==" + JSON.toJSONString(searchQuery), ex);
throw new Exception(ex);
}
}
public Map<String, Integer> getRecordCount(SearchQuery searchQuery) throws Exception {
BpmClient bpmClient = getBpmClient();
try {
return bpmClient.getRecordCount(searchQuery);
} catch (Exception ex) {
log.error("getRecordCount==" + JSON.toJSONString(searchQuery), ex);
throw new Exception(ex);
}
}
/**
* 根据父流程实例id获取该流程的子流程从而处理子流程。
*
* @param procInstId 父流程实例id
* @return
* @throws Exception
*/
public List<Map<String, Object>> getSubprocess(String status, String procInstId) throws Exception {
BpmClient bpmClient = getBpmClient();
try {
return bpmClient.getSubprocess(status, procInstId);
} catch (Exception ex) {
log.error("getSubprocess==" + procInstId, ex);
throw new Exception(ex);
}
}
public boolean isYiBanTaskByTopId(String procInstId, String sourceActId, String targerActId) throws Exception {
return getBpmClient().isYiBanTaskByTopId(procInstId,sourceActId,targerActId);
}
public boolean isYiBanTask(String procInstId, String sourceActId, String targerActId) throws Exception {
return getBpmClient().isYiBanTask(procInstId,sourceActId,targerActId);
}
public JSONArray getRecordbyPorcInstId(String porcInstId) throws Exception {
WorkflowConfig workflowConfig = new WorkflowConfig();
String url = String.format("%s/%s?procInstId=%s", bpmcConfig.getServiceUrl(), workflowConfig.getRecordQueryUrl(), porcInstId);
return JSONArray.parseArray(getBpmClient().get(url));
}
}

View File

@@ -0,0 +1,117 @@
package com.rzdata.web.service.impl;
import java.util.List;
import com.rzdata.web.domain.Attachment;
import com.rzdata.web.mapper.AttachmentMapper;
import com.rzdata.web.service.IAttachmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 附件Service业务层处理
*
* @author panchichun
* @date 2024-08-28
*/
@Service
public class AttachmentServiceImpl implements IAttachmentService
{
@Autowired
private AttachmentMapper attachmentMapper;
/**
* 查询附件
*
* @param id 附件主键
* @return 附件
*/
@Override
public Attachment selectAttachmentById(String id)
{
return attachmentMapper.selectAttachmentById(id);
}
/**
* 查询附件列表
*
* @param attachment 附件
* @return 附件
*/
@Override
public List<Attachment> selectAttachmentList(Attachment attachment)
{
return attachmentMapper.selectAttachmentList(attachment);
}
/**
* 新增附件
*
* @param attachment 附件
* @return 结果
*/
@Override
public int insertAttachment(Attachment attachment)
{
return attachmentMapper.insertAttachment(attachment);
}
/**
* 修改附件
*
* @param attachment 附件
* @return 结果
*/
@Override
public int updateAttachment(Attachment attachment)
{
return attachmentMapper.updateAttachment(attachment);
}
/**
* 修改附件
*
* @param attachment 附件
* @return 结果
*/
@Override
public int updateAttachmentByBusinessId(Attachment attachment)
{
return attachmentMapper.updateAttachmentByBusinessId(attachment);
}
/**
* 批量删除附件
*
* @param ids 需要删除的附件主键
* @return 结果
*/
@Override
public int deleteAttachmentByIds(String[] ids)
{
return attachmentMapper.deleteAttachmentByIds(ids);
}
/**
* 批量删除附件
*
* @param ids 需要删除的附件主键
* @return 结果
*/
@Override
public int deleteAttachmentByBusinessId(List<String> businessIds)
{
return attachmentMapper.deleteAttachmentByBusinessId(businessIds);
}
/**
* 删除附件信息
*
* @param id 附件主键
* @return 结果
*/
@Override
public int deleteAttachmentById(String id)
{
return attachmentMapper.deleteAttachmentById(id);
}
}

View File

@@ -0,0 +1,142 @@
package com.rzdata.web.service.impl;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.Snowflake;
import com.rzdata.common.constant.Constants;
import com.rzdata.common.utils.DateUtils;
import com.rzdata.common.utils.SecurityUtils;
import com.rzdata.web.domain.Discussions;
import com.rzdata.web.domain.Replies;
import com.rzdata.web.mapper.DiscussionsMapper;
import com.rzdata.web.service.IDiscussionsService;
import com.rzdata.web.service.IRepliesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 讨论Service业务层处理
*
* @author panchichun
* @date 2024-08-30
*/
@Service
public class DiscussionsServiceImpl implements IDiscussionsService
{
@Autowired
private DiscussionsMapper discussionsMapper;
@Autowired
private Snowflake snowflake;
@Autowired
private IRepliesService iRepliesService;
/**
* 查询讨论
*
* @param id 讨论主键
* @return 讨论
*/
@Override
public Discussions selectDiscussionsById(String id)
{
return discussionsMapper.selectDiscussionsById(id);
}
/**
* 查询讨论列表
*
* @param discussions 讨论
* @return 讨论
*/
@Override
public List<Discussions> selectDiscussionsList(Discussions discussions)
{
List<Discussions> discussionsList = discussionsMapper.selectDiscussionsList(discussions);
//组装回复对象数据
assembleReplies(discussionsList);
return discussionsList;
}
/**
* 组装回复对象数据
* @param discussionsList
*/
private void assembleReplies(List<Discussions> discussionsList) {
List<String> idList = discussionsList.stream().map(Discussions::getId).collect(Collectors.toList());
Replies replies = new Replies();
replies.setDiscussionIdList(idList);
List<Replies> repliesList = iRepliesService.selectRepliesList(replies);
if(CollUtil.isNotEmpty(repliesList)){
for (Discussions disItem : discussionsList) {
List<Replies> addList = new ArrayList<>();
for (Replies repItem : repliesList) {
if(repItem.getDiscussionId().equals(disItem.getId())){
addList.add(repItem);
}
}
if(CollUtil.isNotEmpty(addList)){
disItem.setRepliesList(addList);
}
}
}
}
/**
* 新增讨论
*
* @param discussions 讨论
* @return 结果
*/
@Override
public int insertDiscussions(Discussions discussions)
{
discussions.setId(String.valueOf(snowflake.nextId()));
discussions.setCreateTime(DateUtils.getNowDate());
discussions.setCreateBy(SecurityUtils.getLoginUser().getUsername());
discussions.setCreateById(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
discussions.setIsDelete(Constants.STR_ZERO);
return discussionsMapper.insertDiscussions(discussions);
}
/**
* 修改讨论
*
* @param discussions 讨论
* @return 结果
*/
@Override
public int updateDiscussions(Discussions discussions)
{
discussions.setUpdateTime(DateUtils.getNowDate());
return discussionsMapper.updateDiscussions(discussions);
}
/**
* 批量删除讨论
*
* @param ids 需要删除的讨论主键
* @return 结果
*/
@Override
public int deleteDiscussionsByIds(String[] ids)
{
return discussionsMapper.deleteDiscussionsByIds(ids);
}
/**
* 删除讨论信息
*
* @param id 讨论主键
* @return 结果
*/
@Override
public int deleteDiscussionsById(String id)
{
return discussionsMapper.deleteDiscussionsById(id);
}
}

View File

@@ -0,0 +1,183 @@
package com.rzdata.web.service.impl;
import cn.hutool.core.lang.Snowflake;
import com.rzdata.common.core.domain.TreeSelect;
import com.rzdata.common.utils.DateUtils;
import com.rzdata.common.utils.SecurityUtils;
import com.rzdata.common.utils.StringUtils;
import com.rzdata.common.core.domain.DocumentCategory;
import com.rzdata.web.mapper.DocumentCategoryMapper;
import com.rzdata.web.service.IDocumentCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;
/**
* 文档资源分类管理Service业务层处理
*
* @author spongepan
* @date 2024-08-27
*/
@Service
public class DocumentCategoryServiceImpl implements IDocumentCategoryService
{
@Autowired
private DocumentCategoryMapper documentCategoryMapper;
@Autowired
private Snowflake snowflake;
/**
* 查询文档资源分类管理
*
* @param id 文档资源分类管理主键
* @return 文档资源分类管理
*/
@Override
public DocumentCategory selectDocumentCategoryById(String id)
{
return documentCategoryMapper.selectDocumentCategoryById(id);
}
/**
* 查询文档资源分类管理列表
*
* @param documentCategory 文档资源分类管理
* @return 文档资源分类管理
*/
@Override
public List<DocumentCategory> selectDocumentCategoryList(DocumentCategory documentCategory)
{
return documentCategoryMapper.selectDocumentCategoryList(documentCategory);
}
/**
* 新增文档资源分类管理
*
* @param documentCategory 文档资源分类管理
* @return 结果
*/
@Override
public int insertDocumentCategory(DocumentCategory documentCategory)
{
documentCategory.setId(String.valueOf(snowflake.nextId()));
documentCategory.setCreateTime(DateUtils.getNowDate());
documentCategory.setCreateBy(SecurityUtils.getLoginUser().getUsername());
documentCategory.setCreateById(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
return documentCategoryMapper.insertDocumentCategory(documentCategory);
}
/**
* 修改文档资源分类管理
*
* @param documentCategory 文档资源分类管理
* @return 结果
*/
@Override
public int updateDocumentCategory(DocumentCategory documentCategory)
{
documentCategory.setUpdateTime(DateUtils.getNowDate());
return documentCategoryMapper.updateDocumentCategory(documentCategory);
}
/**
* 批量删除文档资源分类管理
*
* @param ids 需要删除的文档资源分类管理主键
* @return 结果
*/
@Override
public int deleteDocumentCategoryByIds(String[] ids)
{
return documentCategoryMapper.deleteDocumentCategoryByIds(ids);
}
/**
* 删除文档资源分类管理信息
*
* @param id 文档资源分类管理主键
* @return 结果
*/
@Override
public int deleteDocumentCategoryById(String id)
{
return documentCategoryMapper.deleteDocumentCategoryById(id);
}
@Override
public List<TreeSelect> selectDocumentTreeList(DocumentCategory documentCategory) {
List<DocumentCategory> documentCategoryList = documentCategoryMapper.selectDocumentCategoryList(documentCategory);
return buildDeptTreeSelect(documentCategoryList);
}
public List<TreeSelect> buildDeptTreeSelect(List<DocumentCategory> documentCategory)
{
List<DocumentCategory> docCategoryTree = buildDeptTree(documentCategory);
return docCategoryTree.stream().map(TreeSelect::new).collect(Collectors.toList());
}
public List<DocumentCategory> buildDeptTree(List<DocumentCategory> documentCategoryList)
{
List<DocumentCategory> returnList = new ArrayList<DocumentCategory>();
List<String> tempList = documentCategoryList.stream().map(DocumentCategory::getId).collect(Collectors.toList());
for (DocumentCategory documentCategory : documentCategoryList)
{
// 如果是顶级节点, 遍历该父节点的所有子节点
if (!tempList.contains(documentCategory.getParentId()))
{
recursionFn(documentCategoryList, documentCategory);
returnList.add(documentCategory);
}
}
if (returnList.isEmpty())
{
returnList = documentCategoryList;
}
return returnList;
}
/**
* 递归列表
*/
private void recursionFn(List<DocumentCategory> list, DocumentCategory t)
{
// 得到子节点列表
List<DocumentCategory> childList = getChildList(list, t);
t.setChildren(childList);
for (DocumentCategory tChild : childList)
{
if (hasChild(list, tChild))
{
recursionFn(list, tChild);
}
}
}
private List<DocumentCategory> getChildList(List<DocumentCategory> list, DocumentCategory t)
{
List<DocumentCategory> tlist = new ArrayList<DocumentCategory>();
Iterator<DocumentCategory> it = list.iterator();
while (it.hasNext())
{
DocumentCategory n = (DocumentCategory) it.next();
if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().equals(t.getId()))
{
tlist.add(n);
}
}
return tlist;
}
/**
* 判断是否有子节点
*/
private boolean hasChild(List<DocumentCategory> list, DocumentCategory t)
{
return getChildList(list, t).size() > 0;
}
}

View File

@@ -1,14 +1,28 @@
package com.rzdata.web.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.BooleanUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.rzdata.common.constant.Constants;
import com.rzdata.common.core.domain.entity.SysDictData;
import com.rzdata.common.core.domain.entity.SysUser;
import com.rzdata.common.utils.DateUtils;
import com.rzdata.common.utils.SecurityUtils;
import com.rzdata.system.service.ISysDictTypeService;
import com.rzdata.web.domain.Attachment;
import com.rzdata.web.domain.Document;
import com.rzdata.web.domain.Tool;
import com.rzdata.web.mapper.DocumentMapper;
import com.rzdata.web.service.IDocumentService;
import com.rzdata.web.service.IToolApplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
/**
* 【请填写功能名称】Service业务层处理
@@ -21,6 +35,16 @@ public class DocumentServiceImpl implements IDocumentService
{
@Autowired
private DocumentMapper documentMapper;
@Autowired
private AttachmentServiceImpl attachmentService;
@Autowired
private ToolServiceImpl toolService;
@Autowired
private IToolApplyService iUseApplyService;
@Autowired
private ISysDictTypeService sysDictTypeService;
/**
* 查询【请填写功能名称】
@@ -31,19 +55,85 @@ public class DocumentServiceImpl implements IDocumentService
@Override
public Document selectDocumentById(String docId)
{
return documentMapper.selectDocumentById(docId);
Document document = documentMapper.selectDocumentById(docId);
if(StrUtil.isNotBlank(document.getToolId())){
Tool tool = toolService.selectToolByToolId(document.getToolId());
document.setToolName(tool.getToolName());
}
Attachment attachment = new Attachment();
attachment.setBusinessId(document.getDocId());
attachment.setDel(Constants.STR_ZERO);
List<Attachment> attachments = attachmentService.selectAttachmentList(attachment);
if(CollUtil.isNotEmpty(attachments)){
document.setAttachment(attachments.get(0));
}
return document;
}
/**
* 查询【请填写功能名称】列表
*
* @param Document 【请填写功能名称】
* @param document 【请填写功能名称】
* @return 【请填写功能名称】
*/
@Override
public List<Document> selectDocumentList(Document Document)
public List<Document> selectDocumentList(Document document)
{
return documentMapper.selectDocumentList(Document);
if (BooleanUtil.isTrue(document.getPermissionCheck())) {
if(!SysUser.isAdmin(SecurityUtils.getUserId())){
document.setPermission(SecurityUtils.hasPermi(Constants.DOC_VIEW_PERMISSION));
}
}
List<Document> documents = documentMapper.selectDocumentList(document);
if(CollUtil.isEmpty(documents)){
return documents;
}
List<String> docIds = documents.stream().map(Document::getDocId).collect(Collectors.toList());
Attachment attachment = new Attachment();
attachment.setBusinessIds(docIds);
attachment.setDel(Constants.STR_ZERO);
List<Attachment> attachments = attachmentService.selectAttachmentList(attachment);
if(CollUtil.isEmpty(attachments)){
return documents;
}
for (Document doc : documents) {
for (Attachment att : attachments) {
if(doc.getDocId().equals(att.getBusinessId())){
doc.setAttachment(att);
break;
}
}
}
//前端传传参开启下载权限验证
if (BooleanUtil.isTrue(document.getDownloadCheck())) {
String userId = SecurityUtils.getUserId().toString();
for (Document dc: documents) {
//文档中 是创建人 或者 配置了下载权限
boolean downStatus = false;
if(SecurityUtils.hasPermi(Constants.DOC_DOWNLOAD_PERMISSION) || userId.equals(dc.getCreateById()) || SysUser.isAdmin(SecurityUtils.getUserId())){
downStatus = true;
}else if(StrUtil.isNotBlank(dc.getToolId()) && iUseApplyService.checkToolApply(dc.getToolId(),userId)){
downStatus = true;
}
dc.setDownloadStatus(downStatus);
}
}
return documents;
}
/**
* 查询【请填写功能名称】列表
*
* @param document 【请填写功能名称】
* @return 【请填写功能名称】
*/
@Override
public List<Document> selectDocumentListAll(Document document)
{
List<Document> documents = documentMapper.selectDocumentList(document);
return documents;
}
/**
@@ -60,11 +150,26 @@ public class DocumentServiceImpl implements IDocumentService
return documentMapper.insertDocument(document);
}
@Override
@Transactional(rollbackFor = Exception.class)
public String saveDocument(Document document){
document.setCreateTime(DateUtils.getNowDate());
String docId = IdUtil.simpleUUID();
document.setDocId(docId);
document.setCreateBy(SecurityUtils.getLoginUser().getUsername());
document.setCreateById(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
document.setIsDeleted(Constants.STR_ZERO);
document.setCreateTime(new Date());
int result = documentMapper.insertDocument(document);
if(ObjectUtil.isNotEmpty(document.getAttachment())){
Attachment attachment = document.getAttachment();
attachment.setId(IdUtil.simpleUUID());
attachment.setCreateBy(SecurityUtils.getLoginUser().getUsername());
attachment.setBusinessId(docId);
attachment.setBizType(Constants.DOC_TYPE_DOC);
attachment.setDel(Constants.STR_ZERO);
attachment.setCreateDate(new Date());
attachmentService.insertAttachment(attachment);
}
if(result > 0){
return docId;
}
@@ -74,14 +179,36 @@ public class DocumentServiceImpl implements IDocumentService
/**
* 修改【请填写功能名称】
*
* @param Document 【请填写功能名称】
* @param document 【请填写功能名称】
* @return 结果
*/
@Override
public int updateDocument(Document Document)
@Transactional(rollbackFor = Exception.class)
public int updateDocument(Document document)
{
Document.setUpdateTime(DateUtils.getNowDate());
return documentMapper.updateDocument(Document);
document.setUpdateBy(SecurityUtils.getLoginUser().getUsername());
document.setUpdateById(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
document.setUpdateTime(new Date());
int result = documentMapper.updateDocument(document);
Attachment attParam = document.getAttachment();
if(ObjectUtil.isNotEmpty(attParam) && StrUtil.isBlank(attParam.getId())){
Attachment att = new Attachment();
att.setBusinessId(document.getDocId());
att.setDel(Constants.STR_ONE);
attachmentService.updateAttachmentByBusinessId(att);
Attachment attachment = document.getAttachment();
attachment.setId(IdUtil.simpleUUID());
attachment.setCreateBy(SecurityUtils.getLoginUser().getUsername());
attachment.setBusinessId(document.getDocId());
attachment.setBizType(Constants.DOC_TYPE_DOC);
attachment.setDel(Constants.STR_ZERO);
attachment.setCreateDate(new Date());
attachmentService.insertAttachment(attachment);
}
return result;
}
/**
@@ -93,7 +220,12 @@ public class DocumentServiceImpl implements IDocumentService
@Override
public int deleteDocumentByIds(String[] ids)
{
return documentMapper.deleteDocumentByIds(ids);
Document doc = new Document();
doc.setIds(Arrays.asList(ids));
doc.setUpdateBy(SecurityUtils.getLoginUser().getUsername());
doc.setUpdateById(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
doc.setUpdateTime(new Date());
return documentMapper.isDeleteDocumentByIds(doc);
}
/**
@@ -107,5 +239,71 @@ public class DocumentServiceImpl implements IDocumentService
{
return documentMapper.deleteDocumentById(id);
}
/**
* 发布文档
* @param ids
* @return
*/
@Override
public int pushDoc(String[] ids) {
Document doc = new Document();
doc.setIds(Arrays.asList(ids));
doc.setUpdateBy(SecurityUtils.getLoginUser().getUsername());
doc.setUpdateById(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
doc.setDocStatus(Constants.DOC_STATUS_YFB);
doc.setUpdateTime(new Date());
return documentMapper.updatePushDoc(doc);
}
/**
* 删除附件
* @param docIds
* @return
*/
@Override
public int batchDeleteById(List<String> docIds){
return documentMapper.batchDeleteById(docIds);
}
@Override
public Map<String, Object> statistics() {
Map<String, Object> result = new HashMap<>();
List<Map<String, Object>> countType = this.documentMapper.countType();
List<Map<String, Object>> countSource = this.documentMapper.countSource();
//组织数据
assembleData(countType, countSource);
result.put("countType", countType);
result.put("countSource", countSource);
return result;
}
private void assembleData(List<Map<String, Object>> countType, List<Map<String, Object>> countSource) {
//
List<SysDictData> toolTypeList = sysDictTypeService.selectDictDataByType("doc_class");
List<SysDictData> toolSourceList = sysDictTypeService.selectDictDataByType("doc_source");
if(CollUtil.isNotEmpty(countType)){
for (Map<String, Object> map : countType) {
map.put("value", map.get("statistics"));
for (SysDictData sysDictData : toolTypeList) {
if(sysDictData.getDictValue().equals(map.get("types"))){
map.put("name", sysDictData.getDictLabel());
break;
}
}
}
}
if(CollUtil.isNotEmpty(countSource)){
for (Map<String, Object> map : countSource) {
map.put("value", map.get("statistics"));
for (SysDictData sysDictData : toolSourceList) {
if(sysDictData.getDictValue().equals(map.get("types"))){
map.put("name", sysDictData.getDictLabel());
break;
}
}
}
}
}
}

View File

@@ -0,0 +1,110 @@
package com.rzdata.web.service.impl;
import java.util.List;
import cn.hutool.core.lang.Snowflake;
import com.rzdata.common.utils.DateUtils;
import com.rzdata.common.utils.SecurityUtils;
import com.rzdata.web.domain.DownloadCount;
import com.rzdata.web.mapper.DownloadCountMapper;
import com.rzdata.web.service.IDownloadCountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 工具下载统计Service业务层处理
*
* @author 潘驰春
* @date 2024-08-31
*/
@Service
public class DownloadCountServiceImpl implements IDownloadCountService
{
@Autowired
private DownloadCountMapper downloadCountMapper;
@Autowired
private Snowflake snowflake;
/**
* 查询工具下载统计
*
* @param id 工具下载统计主键
* @return 工具下载统计
*/
@Override
public DownloadCount selectDownloadCountById(String id)
{
return downloadCountMapper.selectDownloadCountById(id);
}
/**
* 查询工具下载统计列表
*
* @param downloadCount 工具下载统计
* @return 工具下载统计
*/
@Override
public List<DownloadCount> selectDownloadCountList(DownloadCount downloadCount)
{
return downloadCountMapper.selectDownloadCountList(downloadCount);
}
/**
* 新增工具下载统计
*
* @param downloadCount 工具下载统计
* @return 结果
*/
@Override
public int insertDownloadCount(DownloadCount downloadCount)
{
downloadCount.setId(String.valueOf(snowflake.nextId()));
downloadCount.setCreateTime(DateUtils.getNowDate());
downloadCount.setCreateBy(SecurityUtils.getLoginUser().getUsername());
downloadCount.setCreateById(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
return downloadCountMapper.insertDownloadCount(downloadCount);
}
/**
* 修改工具下载统计
*
* @param downloadCount 工具下载统计
* @return 结果
*/
@Override
public int updateDownloadCount(DownloadCount downloadCount)
{
downloadCount.setUpdateTime(DateUtils.getNowDate());
return downloadCountMapper.updateDownloadCount(downloadCount);
}
/**
* 批量删除工具下载统计
*
* @param ids 需要删除的工具下载统计主键
* @return 结果
*/
@Override
public int deleteDownloadCountByIds(String[] ids)
{
return downloadCountMapper.deleteDownloadCountByIds(ids);
}
/**
* 删除工具下载统计信息
*
* @param id 工具下载统计主键
* @return 结果
*/
@Override
public int deleteDownloadCountById(String id)
{
return downloadCountMapper.deleteDownloadCountById(id);
}
@Override
public List<DownloadCount> userDownList(DownloadCount downloadCount) {
return downloadCountMapper.userDownList(downloadCount);
}
}

View File

@@ -0,0 +1,108 @@
package com.rzdata.web.service.impl;
import java.util.Date;
import java.util.List;
import cn.hutool.core.lang.Snowflake;
import com.rzdata.common.constant.Constants;
import com.rzdata.common.utils.DateUtils;
import com.rzdata.common.utils.SecurityUtils;
import com.rzdata.web.domain.Replies;
import com.rzdata.web.mapper.RepliesMapper;
import com.rzdata.web.service.IRepliesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 回复Service业务层处理
*
* @author panchichun
* @date 2024-08-30
*/
@Service
public class RepliesServiceImpl implements IRepliesService
{
@Autowired
private RepliesMapper repliesMapper;
@Autowired
private Snowflake snowflake;
/**
* 查询回复
*
* @param id 回复主键
* @return 回复
*/
@Override
public Replies selectRepliesById(String id)
{
return repliesMapper.selectRepliesById(id);
}
/**
* 查询回复列表
*
* @param replies 回复
* @return 回复
*/
@Override
public List<Replies> selectRepliesList(Replies replies)
{
return repliesMapper.selectRepliesList(replies);
}
/**
* 新增回复
*
* @param replies 回复
* @return 结果
*/
@Override
public int insertReplies(Replies replies)
{
replies.setId(String.valueOf(snowflake.nextId()));
replies.setCreateBy(SecurityUtils.getLoginUser().getUsername());
replies.setCreateById(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
replies.setCreateTime(new Date());
replies.setIsDelete(Constants.STR_ZERO);
return repliesMapper.insertReplies(replies);
}
/**
* 修改回复
*
* @param replies 回复
* @return 结果
*/
@Override
public int updateReplies(Replies replies)
{
replies.setUpdateTime(DateUtils.getNowDate());
return repliesMapper.updateReplies(replies);
}
/**
* 批量删除回复
*
* @param ids 需要删除的回复主键
* @return 结果
*/
@Override
public int deleteRepliesByIds(String[] ids)
{
return repliesMapper.deleteRepliesByIds(ids);
}
/**
* 删除回复信息
*
* @param id 回复主键
* @return 结果
*/
@Override
public int deleteRepliesById(String id)
{
return repliesMapper.deleteRepliesById(id);
}
}

View File

@@ -0,0 +1,151 @@
package com.rzdata.web.service.impl;
import cn.hutool.core.lang.Snowflake;
import com.rzdata.common.core.domain.entity.SysUser;
import com.rzdata.common.utils.DateUtils;
import com.rzdata.common.utils.SecurityUtils;
import com.rzdata.system.service.ISysUserService;
import com.rzdata.web.domain.ToolApply;
import com.rzdata.web.domain.TzMessage;
import com.rzdata.web.domain.UseApplyItem;
import com.rzdata.web.mapper.ToolApplyMapper;
import com.rzdata.web.service.IToolApplyService;
import com.rzdata.web.service.ITzMessageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 使用申请Service业务层处理
*
* @author ja
* @date 2024-08-21
*/
@Slf4j
@Service
public class ToolApplyServiceImpl implements IToolApplyService
{
@Autowired
private ToolApplyMapper toolApplyMapper;
@Autowired
private ISysUserService sysUserService;
@Autowired
private Snowflake snowflake;
@Autowired
private ITzMessageService tzMessageService;
/**
* 查询使用申请
*
* @param id 使用申请主键
* @return 使用申请
*/
@Override
public ToolApply selectToolApplyById(String id)
{
return toolApplyMapper.selectToolApplyById(id);
}
@Override
public ToolApply getInfoByBpmcId(String bpmcId){
return toolApplyMapper.getInfoByBpmcId(bpmcId);
}
/**
* 查询使用申请列表
*
* @param toolApply 使用申请
* @return 使用申请
*/
@Override
public List<ToolApply> selectToolApplyList(ToolApply toolApply)
{
return toolApplyMapper.selectToolApplyList(toolApply);
}
/**
* 新增使用申请
*
* @param toolApply 使用申请
* @return 结果
*/
@Override
public int insertToolApply(ToolApply toolApply)
{
toolApply.setCreateBy(SecurityUtils.getUserId().toString());
toolApply.setCreateTime(DateUtils.getNowDate());
return toolApplyMapper.insertToolApply(toolApply);
}
/**
* 修改使用申请
*
* @param toolApply 使用申请
* @return 结果
*/
@Override
public int updateToolApply(ToolApply toolApply)
{
toolApply.setUpdateBy(SecurityUtils.getUserId().toString());
toolApply.setUpdateTime(DateUtils.getNowDate());
return toolApplyMapper.updateToolApply(toolApply);
}
/**
* 批量删除使用申请
*
* @param ids 需要删除的使用申请主键
* @return 结果
*/
@Override
public int deleteToolApplyByIds(String[] ids)
{
return toolApplyMapper.deleteToolApplyByIds(ids);
}
/**
* 删除使用申请信息
*
* @param id 使用申请主键
* @return 结果
*/
@Override
public int deleteToolApplyById(String id)
{
return toolApplyMapper.deleteToolApplyById(id);
}
public boolean checkToolApply(String toolId, String userId){
return toolApplyMapper.checkToolApply(toolId, userId)>0;
}
@Override
public void sendTzMessage(ToolApply toolApply) {
try{
SysUser sysUser = sysUserService.selectUserById(Long.valueOf(toolApply.getUserId()));
UseApplyItem useApplyItem = toolApply.getItemList().get(0);
String toolName = useApplyItem.getToolName();
String content = toolName + "下载权限已通过";
TzMessage tzMessage = new TzMessage();
//雪花
tzMessage.setId(String.valueOf(snowflake.nextId()));
tzMessage.setReceiverId(String.valueOf(sysUser.getUserId()));
tzMessage.setStates(1);
tzMessage.setContent(content);
tzMessage.setDeleted("0");
tzMessageService.insertTzMessage(tzMessage);
}catch (Exception e){
log.error("UseApplyServiceImpl-->sendTzMessage--发送消息中心异常--e###", e);
}
}
}

View File

@@ -1,14 +1,39 @@
package com.rzdata.web.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.BooleanUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.blueland.bpmclient.model.BpmClientInputModel;
import com.rzdata.common.annotation.DataScope;
import com.rzdata.common.constant.Constants;
import com.rzdata.common.core.domain.entity.SysDept;
import com.rzdata.common.core.domain.entity.SysDictData;
import com.rzdata.common.core.domain.entity.SysUser;
import com.rzdata.common.utils.DateUtils;
import com.rzdata.common.utils.SecurityUtils;
import com.rzdata.system.service.ISysDeptService;
import com.rzdata.system.service.ISysDictTypeService;
import com.rzdata.system.service.ISysUserService;
import com.rzdata.web.domain.Document;
import com.rzdata.web.domain.Tool;
import com.rzdata.web.domain.ToolApply;
import com.rzdata.web.domain.TzMessage;
import com.rzdata.web.domain.bo.BpmClientInputModelBo;
import com.rzdata.web.mapper.ToolMapper;
import com.rzdata.web.service.IToolService;
import com.rzdata.web.service.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
/**
* 工具信息Service业务层处理
@@ -16,12 +41,40 @@ import java.util.List;
* @author ja
* @date 2024-07-15
*/
@Slf4j
@Service
public class ToolServiceImpl implements IToolService
{
@Autowired
private ToolMapper toolMapper;
@Autowired
private IAttachmentService iAttachmentService;
@Autowired
private IDocumentService documentService;
@Autowired
private ISysUserService sysUserService;
@Autowired
private Snowflake snowflake;
@Autowired
private ITzMessageService tzMessageService;
@Autowired
private ISysDictTypeService sysDictTypeService;
@Autowired
private IToolApplyService toolApplyService;
@Autowired
private ISysDeptService sysDeptService;
/**
* 查询工具信息
*
@@ -31,7 +84,14 @@ public class ToolServiceImpl implements IToolService
@Override
public Tool selectToolByToolId(String toolId)
{
return toolMapper.selectToolByToolId(toolId);
Tool tool = toolMapper.selectToolByToolId(toolId);
tool.setToolRespDeptName(sysDeptService.getDeptName(tool.getToolRespDept()));
return tool;
}
@Override
public Tool getInfoByBpmcId(String bpmcId){
return toolMapper.getInfoByBpmcId(bpmcId);
}
/**
@@ -41,8 +101,12 @@ public class ToolServiceImpl implements IToolService
* @return 工具信息
*/
@Override
@DataScope(deptAlias = "d")
public List<Tool> selectToolList(Tool tool)
{
if (BooleanUtil.isTrue(tool.getPermissionCheck())) {
tool.setPermission(SecurityUtils.hasPermi(Constants.VIEW_TOOL_PERMISSION));
}
return toolMapper.selectToolList(tool);
}
@@ -55,19 +119,15 @@ public class ToolServiceImpl implements IToolService
@Override
public int insertTool(Tool tool)
{
tool.setCreateBy(SecurityUtils.getUserId().toString());
tool.setCreateTime(DateUtils.getNowDate());
tool.setToolId(IdUtil.simpleUUID());
return toolMapper.insertTool(tool);
}
@Override
public boolean checkToolExist(String toolCode, String toolRespDept)
public boolean checkToolExist(Tool tTool)
{
Tool tool = new Tool();
tool.setToolCode(toolCode);
tool.setToolRespDept(toolRespDept);
List<Tool> toolList = toolMapper.selectToolList(tool);
return toolList.size() > 0;
return toolMapper.checkToolExist(tTool)> 0;
}
/**
@@ -77,10 +137,71 @@ public class ToolServiceImpl implements IToolService
* @return 结果
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int updateTool(Tool tool)
{
tool.setUpdateBy(SecurityUtils.getUserId().toString());
tool.setUpdateTime(DateUtils.getNowDate());
return toolMapper.updateTool(tool);
int result = toolMapper.updateTool(tool);
deleteDocAndAtt(tool);
addDocAndAtt(tool);
return result;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteDocAndAtt(Tool tool) {
List<Document> documentList = tool.getDocumentList();
if(CollUtil.isEmpty(documentList)){
return;
}
//先删除,后新增
List<String> docIds = documentList.stream().map(Document::getDocId).collect(Collectors.toList());
iAttachmentService.deleteAttachmentByBusinessId(docIds);
documentService.batchDeleteById(docIds);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void addDocAndAtt(Tool tool) {
List<Document> documentList = tool.getDocumentList();
if(CollUtil.isEmpty(documentList)){
return;
}
//新增
for (Document document : documentList) {
document.setToolId(tool.getToolId());
document.setDocStatus(Constants.DOC_STATUS_SHZ);
documentService.saveDocument(document);
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void recordToolApply(Tool tool) {
ToolApply toolApply = new ToolApply();
toolApply.setId(IdUtil.simpleUUID());
toolApply.setApplyType(Constants.TOOL_APPLY_TYPE_PUBLISH);
toolApply.setToolId(tool.getToolId());
toolApply.setDeptId(String.valueOf(SecurityUtils.getDeptId()));
toolApply.setProcInstId(tool.getProcInstId());
toolApply.setRecordStatus(tool.getRecordStatus());
toolApply.setUserId(String.valueOf(SecurityUtils.getUserId()));
BpmClientInputModelBo bpmClientInputModelBo = tool.getBpmClientInputModel();
if(null != bpmClientInputModelBo){
BpmClientInputModel bpmClientInputModel = bpmClientInputModelBo.getModel();
toolApply.setProcTitle(StrUtil.isNotEmpty(bpmClientInputModel.getWf_procTitle()) ? bpmClientInputModel.getWf_procTitle() : "");
}
SysDept sysDept = sysDeptService.selectDeptById(SecurityUtils.getDeptId());
if(null != sysDept){
toolApply.setDeptName(sysDept.getDeptName());
}
SysUser sysUser = sysUserService.selectUserById(SecurityUtils.getUserId());
if(null != sysUser){
toolApply.setNickName(sysUser.getNickName());
}
toolApplyService.insertToolApply(toolApply);
}
/**
@@ -106,4 +227,116 @@ public class ToolServiceImpl implements IToolService
{
return toolMapper.deleteToolByToolId(toolId);
}
@Override
public void updateDocPushStatus(Tool tTool) {
Document document = new Document();
document.setToolId(tTool.getToolId());
List<Document> documents = documentService.selectDocumentListAll(document);
if(CollUtil.isEmpty(documents)){
return;
}
List<String> ids = documents.stream().map(Document::getDocId).collect(Collectors.toList());
String[] idsArray = ids.stream().toArray(String[]::new);
documentService.pushDoc(idsArray);
}
/**
* 给消息中心发送消息
*/
@Override
public void sendTzMessage(Tool tTool) {
try{
SysUser sysUser = new SysUser();
sysUser.setStatus("0");
sysUser.setDelFlag("0");
String content = tTool.getToolName() + "已发布";
List<SysUser> sysUsers = sysUserService.selectUserList(sysUser);
List<TzMessage> addList = new ArrayList<>();
for (SysUser user : sysUsers) {
TzMessage tzMessage = new TzMessage();
//雪花
tzMessage.setId(String.valueOf(snowflake.nextId()));
tzMessage.setReceiverId(String.valueOf(user.getUserId()));
tzMessage.setStates(1);
tzMessage.setContent(content);
tzMessage.setDeleted("0");
tzMessage.setCreateTime(DateUtils.getNowDate());
tzMessage.setCreateBy(SecurityUtils.getLoginUser().getUsername());
tzMessage.setCreateById(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
addList.add(tzMessage);
}
// 使用AtomicInteger来跟踪索引
AtomicInteger counter = new AtomicInteger(0);
// 使用Stream API进行分组
Map<Integer, List<TzMessage>> grouped = addList.stream()
.collect(Collectors.groupingBy(
e -> counter.getAndIncrement() / 500
));
// 对每个子列表进行批量插入
grouped.values().forEach(batch -> tzMessageService.batchInsert(batch));
}catch (Exception e){
log.error("UseApplyServiceImpl-->sendTzMessage--发送消息中心异常--e###", e);
}
}
@Override
public Map<String, Object> statistics() {
Map<String, Object> result = new HashMap<>();
List<Map<String, Object>> countToolType = toolMapper.countToolType();
List<Map<String, Object>> toolSource = toolMapper.toolSource();
List<Map<String, Object>> recordStatus = toolMapper.recordStatus();
//组织数据
assembleData(countToolType, toolSource, recordStatus);
result.put("countToolType", countToolType);
result.put("toolSource", toolSource);
result.put("recordStatus", recordStatus);
return result;
}
private void assembleData(List<Map<String, Object>> countToolType, List<Map<String, Object>> toolSource, List<Map<String, Object>> recordStatus) {
List<SysDictData> toolTypeList = sysDictTypeService.selectDictDataByType("tool_type");
List<SysDictData> flowStatusList = sysDictTypeService.selectDictDataByType("flow_status");
List<SysDictData> toolSourceList = sysDictTypeService.selectDictDataByType("tool_source");
if(CollUtil.isNotEmpty(countToolType)){
for (Map<String, Object> map : countToolType) {
map.put("value", map.get("statistics"));
for (SysDictData sysDictData : toolTypeList) {
if(sysDictData.getDictValue().equals(map.get("types"))){
map.put("name", sysDictData.getDictLabel());
break;
}
}
}
}
if(CollUtil.isNotEmpty(toolSource)){
for (Map<String, Object> map : toolSource) {
map.put("value", map.get("statistics"));
for (SysDictData sysDictData : toolSourceList) {
if(sysDictData.getDictValue().equals(map.get("types"))){
map.put("name", sysDictData.getDictLabel());
break;
}
}
}
}
if(CollUtil.isNotEmpty(recordStatus)){
for (Map<String, Object> map : recordStatus) {
map.put("value", map.get("statistics"));
for (SysDictData sysDictData : flowStatusList) {
if(sysDictData.getDictValue().equals(map.get("types"))){
map.put("name", sysDictData.getDictLabel());
break;
}
}
}
}
}
}

View File

@@ -0,0 +1,120 @@
package com.rzdata.web.service.impl;
import java.util.List;
import com.rzdata.common.utils.DateUtils;
import com.rzdata.common.utils.SecurityUtils;
import com.rzdata.web.domain.TzMessage;
import com.rzdata.web.mapper.TzMessageMapper;
import com.rzdata.web.service.ITzMessageService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
/**
* 消息Service业务层处理
*
* @author ja
* @date 2024-08-31
*/
@Service
public class TzMessageServiceImpl implements ITzMessageService
{
@Autowired
private TzMessageMapper tzMessageMapper;
/**
* 查询消息
*
* @param id 消息主键
* @return 消息
*/
@Override
public TzMessage selectTzMessageById(String id)
{
return tzMessageMapper.selectTzMessageById(id);
}
/**
* 查询消息列表
*
* @param tzMessage 消息
* @return 消息
*/
@Override
public List<TzMessage> selectTzMessageList(TzMessage tzMessage)
{
return tzMessageMapper.selectTzMessageList(tzMessage);
}
/**
* 新增消息
*
* @param tzMessage 消息
* @return 结果
*/
@Override
public int insertTzMessage(TzMessage tzMessage)
{
tzMessage.setCreateTime(DateUtils.getNowDate());
tzMessage.setCreateBy(SecurityUtils.getLoginUser().getUsername());
tzMessage.setCreateById(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
return tzMessageMapper.insertTzMessage(tzMessage);
}
/**
* 修改消息
*
* @param tzMessage 消息
* @return 结果
*/
@Override
public int updateTzMessage(TzMessage tzMessage)
{
tzMessage.setUpdateTime(DateUtils.getNowDate());
tzMessage.setUpdateBy(SecurityUtils.getLoginUser().getUsername());
tzMessage.setUpdateById(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
return tzMessageMapper.updateTzMessage(tzMessage);
}
/**
* 批量删除消息
*
* @param ids 需要删除的消息主键
* @return 结果
*/
@Override
public int deleteTzMessageByIds(String[] ids)
{
return tzMessageMapper.deleteTzMessageByIds(ids);
}
/**
* 删除消息信息
*
* @param id 消息主键
* @return 结果
*/
@Override
public int deleteTzMessageById(String id)
{
return tzMessageMapper.deleteTzMessageById(id);
}
/**
* 全部标记已读
* @param tzMessage
* @return
*/
@Override
public int allMarkedRead( TzMessage tzMessage) {
tzMessage.setCreateById(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
return tzMessageMapper.updateAllMarkedRead(tzMessage);
}
@Override
public int batchInsert(List<TzMessage> tzMessageList) {
return tzMessageMapper.batchInsert(tzMessageList);
}
}

View File

@@ -0,0 +1,110 @@
package com.rzdata.web.service.impl;
import java.util.List;
import cn.hutool.core.util.IdUtil;
import com.rzdata.web.mapper.UseApplyItemMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.rzdata.web.mapper.UseApplyItemMapper;
import com.rzdata.web.domain.UseApplyItem;
import com.rzdata.web.service.IUseApplyItemService;
import org.springframework.transaction.annotation.Transactional;
/**
* 使用申请详情Service业务层处理
*
* @author ja
* @date 2024-08-21
*/
@Service
public class UseApplyItemServiceImpl implements IUseApplyItemService
{
@Autowired
private UseApplyItemMapper useApplyItemMapper;
/**
* 查询使用申请详情
*
* @param id 使用申请详情主键
* @return 使用申请详情
*/
@Override
public UseApplyItem selectUseApplyItemById(String id)
{
return useApplyItemMapper.selectUseApplyItemById(id);
}
/**
* 查询使用申请详情列表
*
* @param useApplyItem 使用申请详情
* @return 使用申请详情
*/
@Override
public List<UseApplyItem> selectUseApplyItemList(UseApplyItem useApplyItem)
{
return useApplyItemMapper.selectUseApplyItemList(useApplyItem);
}
/**
* 新增使用申请详情
*
* @param useApplyItem 使用申请详情
* @return 结果
*/
@Override
public int insertUseApplyItem(UseApplyItem useApplyItem)
{
return useApplyItemMapper.insertUseApplyItem(useApplyItem);
}
/**
* 修改使用申请详情
*
* @param useApplyItem 使用申请详情
* @return 结果
*/
@Override
public int updateUseApplyItem(UseApplyItem useApplyItem)
{
return useApplyItemMapper.updateUseApplyItem(useApplyItem);
}
/**
* 批量删除使用申请详情
*
* @param ids 需要删除的使用申请详情主键
* @return 结果
*/
@Override
public int deleteUseApplyItemByIds(String[] ids)
{
return useApplyItemMapper.deleteUseApplyItemByIds(ids);
}
/**
* 删除使用申请详情信息
*
* @param id 使用申请详情主键
* @return 结果
*/
@Override
public int deleteUseApplyItemById(String id)
{
return useApplyItemMapper.deleteUseApplyItemById(id);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updateItemList(List<UseApplyItem> list, String applyId){
useApplyItemMapper.deleteByApplyId(applyId);
if (list!=null&&list.size()>0) {
for (UseApplyItem item: list) {
item.setApplyId(applyId);
item.setId(IdUtil.simpleUUID());
useApplyItemMapper.insertUseApplyItem(item);
}
}
}
}

View File

@@ -0,0 +1,125 @@
package com.rzdata.web.service.impl;
import java.util.List;
import cn.hutool.core.util.IdUtil;
import cn.hutool.json.JSONUtil;
import com.blueland.bpmclient.model.BpmClientInputModel;
import com.blueland.bpmclient.model.ProcessInstanceModel;
import com.rzdata.common.utils.DateUtils;
import com.rzdata.web.domain.bo.BpmClientInputModelBo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.rzdata.web.mapper.WorkflowLogMapper;
import com.rzdata.web.domain.WorkflowLog;
import com.rzdata.web.service.IWorkflowLogService;
/**
* 流程审批记录Service业务层处理
*
* @author ja
* @date 2024-08-21
*/
@Service
public class WorkflowLogServiceImpl implements IWorkflowLogService
{
@Autowired
private WorkflowLogMapper workflowLogMapper;
/**
* 查询流程审批记录
*
* @param id 流程审批记录主键
* @return 流程审批记录
*/
@Override
public WorkflowLog selectWorkflowLogById(String id)
{
return workflowLogMapper.selectWorkflowLogById(id);
}
/**
* 查询流程审批记录列表
*
* @param workflowLog 流程审批记录
* @return 流程审批记录
*/
@Override
public List<WorkflowLog> selectWorkflowLogList(WorkflowLog workflowLog)
{
return workflowLogMapper.selectWorkflowLogList(workflowLog);
}
/**
* 新增流程审批记录
*
* @param workflowLog 流程审批记录
* @return 结果
*/
@Override
public int insertWorkflowLog(WorkflowLog workflowLog)
{
workflowLog.setCreateTime(DateUtils.getNowDate());
return workflowLogMapper.insertWorkflowLog(workflowLog);
}
/**
* 修改流程审批记录
*
* @param workflowLog 流程审批记录
* @return 结果
*/
@Override
public int updateWorkflowLog(WorkflowLog workflowLog)
{
workflowLog.setUpdateTime(DateUtils.getNowDate());
return workflowLogMapper.updateWorkflowLog(workflowLog);
}
/**
* 批量删除流程审批记录
*
* @param ids 需要删除的流程审批记录主键
* @return 结果
*/
@Override
public int deleteWorkflowLogByIds(String[] ids)
{
return workflowLogMapper.deleteWorkflowLogByIds(ids);
}
/**
* 删除流程审批记录信息
*
* @param id 流程审批记录主键
* @return 结果
*/
@Override
public int deleteWorkflowLogById(String id)
{
return workflowLogMapper.deleteWorkflowLogById(id);
}
@Override
public void saveProcLog(BpmClientInputModelBo bpmClientInputModelBo, ProcessInstanceModel processInst, String action){
BpmClientInputModel bpmClientInputModel = bpmClientInputModelBo.getModel();
WorkflowLog workflowLog = new WorkflowLog();
workflowLog.setId(IdUtil.simpleUUID());
workflowLog.setPass(bpmClientInputModelBo.getApplyStatus());
workflowLog.setProcInstId(processInst.getProcInstId());
workflowLog.setBusinessId(processInst.getBusinessKey());
workflowLog.setActDefId(bpmClientInputModel.getWf_curActDefId());
workflowLog.setActDefName(bpmClientInputModel.getWf_curActDefName());
workflowLog.setNextDefId(bpmClientInputModel.getWf_nextActDefId());
workflowLog.setNextDefName(bpmClientInputModel.getWf_nextActDefName());
workflowLog.setActInstId(bpmClientInputModel.getWf_curActInstId());
workflowLog.setOpinion(bpmClientInputModel.getWf_curComment());
workflowLog.setSender(bpmClientInputModel.getWf_sendUserId());
workflowLog.setSenderDeptId(bpmClientInputModel.getWf_sendUserOrgId());
workflowLog.setReceiver(JSONUtil.toJsonStr(bpmClientInputModel.getWf_receivers()));
workflowLog.setActStatus(action);
workflowLog.setProcDefKey(bpmClientInputModel.getWf_procDefKey());
workflowLog.setReview(bpmClientInputModelBo.getReview());
workflowLogMapper.insertWorkflowLog(workflowLog);
}
}

View File

@@ -15,6 +15,7 @@ ja:
# 开发环境配置
server:
address: 0.0.0.0
# 服务器的HTTP端口默认为8080
port: 8080
servlet:
@@ -127,3 +128,13 @@ xss:
excludes: /system/notice
# 匹配链接
urlPatterns: /system/*,/monitor/*,/tool/*
# 用于雪花算法生成id
application:
datacenterId: 2
workerId: 1
bpmc:
tenantId: TLTC_SYS
serviceUrl: http://124.223.108.21:9081/ebpm-process-rest/
uniteWorkUrl: http://localhost/tool-tech/workflowRouter

View File

@@ -0,0 +1,161 @@
<?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">
<mapper namespace="com.rzdata.web.mapper.AttachmentMapper">
<resultMap type="Attachment" id="AttachmentResult">
<result property="id" column="id" />
<result property="bizType" column="biz_type" />
<result property="fileUrl" column="file_url" />
<result property="fileOldName" column="file_old_name" />
<result property="fileNewName" column="file_new_name" />
<result property="suffixType" column="suffix_type" />
<result property="fileSize" column="file_size" />
<result property="businessId" column="business_id" />
<result property="sorts" column="sorts" />
<result property="remark" column="remark" />
<result property="del" column="del" />
<result property="createBy" column="create_by" />
<result property="createDate" column="create_date" />
<result property="updateBy" column="update_by" />
<result property="updateDate" column="update_date" />
<result property="failureTime" column="failure_time" />
</resultMap>
<sql id="selectAttachmentVo">
select id, biz_type, file_url, file_old_name, file_new_name, suffix_type, file_size, business_id, sorts, remark, del, create_by, create_date, update_by, update_date, failure_time from t_attachment
</sql>
<select id="selectAttachmentList" parameterType="Attachment" resultMap="AttachmentResult">
<include refid="selectAttachmentVo"/>
<where>
<if test="bizType != null and bizType != ''"> and biz_type = #{bizType}</if>
<if test="fileUrl != null and fileUrl != ''"> and file_url = #{fileUrl}</if>
<if test="fileOldName != null and fileOldName != ''"> and file_old_name like concat('%', #{fileOldName}, '%')</if>
<if test="fileNewName != null and fileNewName != ''"> and file_new_name like concat('%', #{fileNewName}, '%')</if>
<if test="suffixType != null and suffixType != ''"> and suffix_type = #{suffixType}</if>
<if test="fileSize != null "> and file_size = #{fileSize}</if>
<if test="businessId != null and businessId != ''"> and business_id = #{businessId}</if>
<if test="sorts != null "> and sorts = #{sorts}</if>
<if test="del != null "> and del = #{del}</if>
<if test="createDate != null "> and create_date = #{createDate}</if>
<if test="updateDate != null "> and update_date = #{updateDate}</if>
<if test="failureTime != null "> and failure_time = #{failureTime}</if>
<if test="businessIds != null and businessIds.size() > 0">
and business_id in
<foreach item="id" index="index" collection="businessIds" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</where>
</select>
<select id="selectAttachmentById" parameterType="String" resultMap="AttachmentResult">
<include refid="selectAttachmentVo"/>
where id = #{id}
</select>
<insert id="insertAttachment" parameterType="Attachment">
insert into t_attachment
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="bizType != null">biz_type,</if>
<if test="fileUrl != null">file_url,</if>
<if test="fileOldName != null">file_old_name,</if>
<if test="fileNewName != null">file_new_name,</if>
<if test="suffixType != null">suffix_type,</if>
<if test="fileSize != null">file_size,</if>
<if test="businessId != null">business_id,</if>
<if test="sorts != null">sorts,</if>
<if test="remark != null">remark,</if>
<if test="del != null">del,</if>
<if test="createBy != null">create_by,</if>
<if test="createDate != null">create_date,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateDate != null">update_date,</if>
<if test="failureTime != null">failure_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="bizType != null">#{bizType},</if>
<if test="fileUrl != null">#{fileUrl},</if>
<if test="fileOldName != null">#{fileOldName},</if>
<if test="fileNewName != null">#{fileNewName},</if>
<if test="suffixType != null">#{suffixType},</if>
<if test="fileSize != null">#{fileSize},</if>
<if test="businessId != null">#{businessId},</if>
<if test="sorts != null">#{sorts},</if>
<if test="remark != null">#{remark},</if>
<if test="del != null">#{del},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createDate != null">#{createDate},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateDate != null">#{updateDate},</if>
<if test="failureTime != null">#{failureTime},</if>
</trim>
</insert>
<update id="updateAttachment" parameterType="Attachment">
update t_attachment
<trim prefix="SET" suffixOverrides=",">
<if test="bizType != null">biz_type = #{bizType},</if>
<if test="fileUrl != null">file_url = #{fileUrl},</if>
<if test="fileOldName != null">file_old_name = #{fileOldName},</if>
<if test="fileNewName != null">file_new_name = #{fileNewName},</if>
<if test="suffixType != null">suffix_type = #{suffixType},</if>
<if test="fileSize != null">file_size = #{fileSize},</if>
<if test="businessId != null">business_id = #{businessId},</if>
<if test="sorts != null">sorts = #{sorts},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="del != null">del = #{del},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createDate != null">create_date = #{createDate},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateDate != null">update_date = #{updateDate},</if>
<if test="failureTime != null">failure_time = #{failureTime},</if>
</trim>
where id = #{id}
</update>
<update id="updateAttachmentByBusinessId" parameterType="Attachment">
update t_attachment
<trim prefix="SET" suffixOverrides=",">
<if test="bizType != null">biz_type = #{bizType},</if>
<if test="fileUrl != null">file_url = #{fileUrl},</if>
<if test="fileOldName != null">file_old_name = #{fileOldName},</if>
<if test="fileNewName != null">file_new_name = #{fileNewName},</if>
<if test="suffixType != null">suffix_type = #{suffixType},</if>
<if test="fileSize != null">file_size = #{fileSize},</if>
<if test="sorts != null">sorts = #{sorts},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="del != null">del = #{del},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createDate != null">create_date = #{createDate},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateDate != null">update_date = #{updateDate},</if>
<if test="failureTime != null">failure_time = #{failureTime},</if>
</trim>
where business_id = #{businessId}
</update>
<delete id="deleteAttachmentById" parameterType="String">
delete from t_attachment where id = #{id}
</delete>
<delete id="deleteAttachmentByIds" parameterType="String">
delete from t_attachment where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteAttachmentByBusinessId" parameterType="java.util.List">
delete from t_attachment where business_id in
<foreach item="id" collection="list" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,103 @@
<?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">
<mapper namespace="com.rzdata.web.mapper.DiscussionsMapper">
<resultMap type="Discussions" id="DiscussionsResult">
<result property="id" column="id" />
<result property="businessId" column="business_id" />
<result property="type" column="type" />
<result property="content" column="content" />
<result property="isDelete" column="is_delete" />
<result property="createBy" column="create_by" />
<result property="createById" column="create_by_id" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateById" column="update_by_id" />
<result property="updateTime" column="update_time" />
<result property="nickName" column="nick_name" />
</resultMap>
<sql id="selectDiscussionsVo">
select id, business_id, type, content, is_delete, create_by, create_by_id, create_time, update_by, update_by_id, update_time from t_discussions
</sql>
<select id="selectDiscussionsList" parameterType="Discussions" resultMap="DiscussionsResult">
select td.*,su.nick_name
from t_discussions td
left join sys_user su on su.user_id = td.create_by_id
<where>
<if test="businessId != null and businessId != ''"> and td.business_id = #{businessId}</if>
<if test="type != null and type != ''"> and td.type = #{type}</if>
<if test="content != null and content != ''"> and td.content = #{content}</if>
<if test="isDelete != null and isDelete != ''"> and td.is_delete = #{isDelete}</if>
<if test="createById != null and createById != ''"> and td.create_by_id = #{createById}</if>
<if test="updateById != null and updateById != ''"> and td.update_by_id = #{updateById}</if>
and td.is_delete = '0'
</where>
</select>
<select id="selectDiscussionsById" parameterType="String" resultMap="DiscussionsResult">
<include refid="selectDiscussionsVo"/>
where id = #{id}
</select>
<insert id="insertDiscussions" parameterType="Discussions">
insert into t_discussions
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="businessId != null">business_id,</if>
<if test="type != null">type,</if>
<if test="content != null">content,</if>
<if test="isDelete != null">is_delete,</if>
<if test="createBy != null">create_by,</if>
<if test="createById != null">create_by_id,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateById != null">update_by_id,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="businessId != null">#{businessId},</if>
<if test="type != null">#{type},</if>
<if test="content != null">#{content},</if>
<if test="isDelete != null">#{isDelete},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createById != null">#{createById},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateById != null">#{updateById},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateDiscussions" parameterType="Discussions">
update t_discussions
<trim prefix="SET" suffixOverrides=",">
<if test="businessId != null">business_id = #{businessId},</if>
<if test="type != null">type = #{type},</if>
<if test="content != null">content = #{content},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createById != null">create_by_id = #{createById},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateById != null">update_by_id = #{updateById},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteDiscussionsById" parameterType="String">
delete from t_discussions where id = #{id}
</delete>
<delete id="deleteDiscussionsByIds" parameterType="String">
delete from t_discussions where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,100 @@
<?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">
<mapper namespace="com.rzdata.web.mapper.DocumentCategoryMapper">
<resultMap type="DocumentCategory" id="DocumentCategoryResult">
<result property="id" column="id" />
<result property="categoryName" column="category_name" />
<result property="categoryDescription" column="category_description" />
<result property="parentId" column="parent_id" />
<result property="createBy" column="create_by" />
<result property="createById" column="create_by_id" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateById" column="update_by_id" />
<result property="updateTime" column="update_time" />
<result property="types" column="types" />
</resultMap>
<sql id="selectDocumentCategoryVo">
select id, category_name, category_description, parent_id, create_by, create_by_id, create_time,
update_by, update_by_id, update_time, types from t_document_category
</sql>
<select id="selectDocumentCategoryList" parameterType="DocumentCategory" resultMap="DocumentCategoryResult">
<include refid="selectDocumentCategoryVo"/>
<where>
<if test="categoryName != null and categoryName != ''"> and category_name like concat('%', #{categoryName}, '%')</if>
<if test="categoryDescription != null and categoryDescription != ''"> and category_description = #{categoryDescription}</if>
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId}</if>
<if test="createById != null and createById != ''"> and create_by_id = #{createById}</if>
<if test="updateById != null and updateById != ''"> and update_by_id = #{updateById}</if>
<if test="types != null and types != ''"> and types = #{types}</if>
</where>
</select>
<select id="selectDocumentCategoryById" parameterType="String" resultMap="DocumentCategoryResult">
<include refid="selectDocumentCategoryVo"/>
where id = #{id}
</select>
<insert id="insertDocumentCategory" parameterType="DocumentCategory">
insert into t_document_category
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="categoryName != null and categoryName != ''">category_name,</if>
<if test="categoryDescription != null">category_description,</if>
<if test="parentId != null">parent_id,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createById != null and createById != ''">create_by_id,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateById != null">update_by_id,</if>
<if test="updateTime != null">update_time,</if>
<if test="types != null">types,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="categoryName != null and categoryName != ''">#{categoryName},</if>
<if test="categoryDescription != null">#{categoryDescription},</if>
<if test="parentId != null">#{parentId},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createById != null and createById != ''">#{createById},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateById != null">#{updateById},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="types != null">#{types},</if>
</trim>
</insert>
<update id="updateDocumentCategory" parameterType="DocumentCategory">
update t_document_category
<trim prefix="SET" suffixOverrides=",">
<if test="categoryName != null and categoryName != ''">category_name = #{categoryName},</if>
<if test="categoryDescription != null">category_description = #{categoryDescription},</if>
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createById != null and createById != ''">create_by_id = #{createById},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateById != null">update_by_id = #{updateById},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="types != null">types = #{types},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteDocumentCategoryById" parameterType="String">
delete from t_document_category where id = #{id}
</delete>
<delete id="deleteDocumentCategoryByIds" parameterType="String">
delete from t_document_category where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -18,23 +18,47 @@
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="docCategoryId" column="doc_category_id" />
<result property="isDeleted" column="is_deleted" />
<result property="toolId" column="tool_id" />
<result property="toolName" column="tool_name" />
<result property="docRespDeptName" column="doc_resp_dept_name" />
</resultMap>
<sql id="selectDocumentVo">
select doc_id, doc_code, doc_name, doc_type, doc_principals, doc_resp_dept, doc_source, doc_status, doc_url, create_by, create_time, update_by, update_time from t_document
select doc_id, doc_code, doc_name, doc_type, doc_principals, doc_resp_dept,
doc_source, doc_status, doc_url, create_by, create_time,
update_by, update_time, remark, doc_category_id,is_deleted,tool_id from t_document
</sql>
<select id="selectDocumentList" parameterType="Document" resultMap="DocumentResult">
<include refid="selectDocumentVo"/>
select td.*, t_tool.tool_name as tool_name,sys_dept.dept_name as doc_resp_dept_name
from t_document td
left join t_tool on t_tool.tool_id = td.tool_id
left join sys_dept on sys_dept.dept_id = td.doc_resp_dept
<where>
<if test="docCode != null and docCode != ''"> and doc_code = #{docCode}</if>
<if test="docName != null and docName != ''"> and doc_name like concat('%', #{docName}, '%')</if>
<if test="docType != null and docType != ''"> and doc_type = #{docType}</if>
<if test="docPrincipals != null and docPrincipals != ''"> and doc_principals = #{docPrincipals}</if>
<if test="docRespDept != null and docRespDept != ''"> and doc_resp_dept = #{docRespDept}</if>
<if test="docSource != null and docSource != ''"> and doc_source = #{docSource}</if>
<if test="docStatus != null and docStatus != ''"> and doc_status = #{docStatus}</if>
<if test="docCode != null and docCode != ''"> and td.doc_code like concat('%', #{docCode}, '%')</if>
<if test="docName != null and docName != ''"> and td.doc_name like concat('%', #{docName}, '%')</if>
<if test="docType != null and docType != ''"> and td.doc_type = #{docType}</if>
<if test="docPrincipals != null and docPrincipals != ''"> and td.doc_principals like concat('%', #{docPrincipals}, '%')</if>
<if test="docRespDept != null and docRespDept != ''"> and td.doc_resp_dept = #{docRespDept}</if>
<if test="docSource != null and docSource != ''"> and td.doc_source = #{docSource}</if>
<if test="docStatus != null and docStatus != ''"> and td.doc_status = #{docStatus}</if>
<if test="toolId != null and toolId != ''"> and td.tool_id = #{toolId}</if>
<if test="docCategoryId != null and docCategoryId != ''"> and td.doc_category_id = #{docCategoryId}</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(td.create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(td.create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
<if test="createById != null and createById != '' and permission != true">
AND (td.create_by_id = #{createById} or td.doc_status = 'yfb')
</if>
and td.is_deleted = '0'
</where>
order by td.create_time desc
</select>
<select id="selectDocumentById" parameterType="String" resultMap="DocumentResult">
@@ -58,6 +82,12 @@
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="docCategoryId != null">doc_category_id,</if>
<if test="createById != null and createById != ''">create_by_id,</if>
<if test="updateById != null">update_by_id,</if>
<if test="isDeleted != null">is_deleted,</if>
<if test="toolId != null">tool_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="docId != null">#{docId},</if>
@@ -73,6 +103,12 @@
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="docCategoryId != null">#{docCategoryId},</if>
<if test="createById != null and createById != ''">#{createById},</if>
<if test="updateById != null">#{updateById},</if>
<if test="isDeleted != null">#{isDeleted},</if>
<if test="toolId != null">#{toolId},</if>
</trim>
</insert>
@@ -91,6 +127,12 @@
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="docCategoryId != null">doc_category_id = #{docCategoryId},</if>
<if test="isDeleted != null">is_deleted = #{isDeleted},</if>
<if test="updateById != null">update_by_id = #{updateById},</if>
<if test="createById != null">create_by_id = #{createById},</if>
<if test="toolId != null">tool_id = #{toolId},</if>
</trim>
where doc_id = #{docId}
</update>
@@ -99,10 +141,39 @@
delete from t_document where doc_id = #{id}
</delete>
<delete id="deleteDocumentByIds" parameterType="String">
<delete id="isDeleteDocumentByIds" parameterType="Document">
<if test="ids != null and ids.size() > 0">
update t_document set is_deleted = '1' ,update_by_id = #{updateById},update_by = #{updateBy},update_time = #{updateTime} where doc_id in
<foreach item="id" index="index" collection="ids" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</delete>
<update id="updatePushDoc" parameterType="Document">
<if test="ids != null and ids.size() > 0">
update t_document set doc_status = #{docStatus} ,update_by_id = #{updateById},update_by = #{updateBy},update_time = #{updateTime} where doc_id in
<foreach item="id" index="index" collection="ids" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</update>
<delete id="batchDeleteById" parameterType="java.util.List">
delete from t_document where doc_id in
<foreach item="id" collection="array" open="(" separator="," close=")">
<foreach item="id" collection="list" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<!-- 文档类型统计-->
<select id="countType" resultType="java.util.Map">
select t.doc_type as types, sum(1) as statistics from t_document t where t.is_deleted = '0' group by t.doc_type;
</select>
<!-- 文档来源统计-->
<select id="countSource" resultType="java.util.Map">
select t.doc_source as types, sum(1) as statistics from t_document t where t.is_deleted = '0' group by t.doc_source;
</select>
</mapper>

View File

@@ -0,0 +1,110 @@
<?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">
<mapper namespace="com.rzdata.web.mapper.DownloadCountMapper">
<resultMap type="DownloadCount" id="DownloadCountResult">
<result property="id" column="id" />
<result property="toolId" column="tool_id" />
<result property="createBy" column="create_by" />
<result property="createById" column="create_by_id" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateById" column="update_by_id" />
<result property="updateTime" column="update_time" />
<result property="toolCode" column="tool_code" />
<result property="toolName" column="tool_name" />
<result property="toolDownNum" column="tool_down_num" />
<result property="nickName" column="nick_name" />
</resultMap>
<sql id="selectDownloadCountVo">
select id, tool_id, create_by, create_by_id, create_time, update_by, update_by_id, update_time from t_download_count
</sql>
<select id="selectDownloadCountList" parameterType="DownloadCount" resultMap="DownloadCountResult">
select
tdc.tool_id,tl.tool_code,tl.tool_name,sum(1) as tool_down_num
from t_download_count tdc
left join t_tool tl on tdc.tool_id = tl.tool_id
<where>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(tdc.create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(tdc.create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
</where>
group by tdc.tool_id,tl.tool_code,tl.tool_name
</select>
<select id="selectDownloadCountById" parameterType="String" resultMap="DownloadCountResult">
<include refid="selectDownloadCountVo"/>
where id = #{id}
</select>
<insert id="insertDownloadCount" parameterType="DownloadCount">
insert into t_download_count
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="toolId != null">tool_id,</if>
<if test="createBy != null">create_by,</if>
<if test="createById != null">create_by_id,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateById != null">update_by_id,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="toolId != null">#{toolId},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createById != null">#{createById},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateById != null">#{updateById},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateDownloadCount" parameterType="DownloadCount">
update t_download_count
<trim prefix="SET" suffixOverrides=",">
<if test="toolId != null">tool_id = #{toolId},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createById != null">create_by_id = #{createById},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateById != null">update_by_id = #{updateById},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteDownloadCountById" parameterType="String">
delete from t_download_count where id = #{id}
</delete>
<delete id="deleteDownloadCountByIds" parameterType="String">
delete from t_download_count where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="userDownList" parameterType="DownloadCount" resultMap="DownloadCountResult">
select
tdc.tool_id,su.nick_name,tdc.create_time,sum(1) as tool_down_num
from t_download_count tdc
left join sys_user su on tdc.create_by_id = su.user_id
<where>
<if test="toolId != null and toolId != ''">
AND tool_id = #{toolId}
</if>
</where>
group by su.nick_name
</select>
</mapper>

View File

@@ -0,0 +1,103 @@
<?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">
<mapper namespace="com.rzdata.web.mapper.RepliesMapper">
<resultMap type="Replies" id="RepliesResult">
<result property="id" column="id" />
<result property="discussionId" column="discussion_id" />
<result property="content" column="content" />
<result property="isDelete" column="is_delete" />
<result property="createBy" column="create_by" />
<result property="createById" column="create_by_id" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateById" column="update_by_id" />
<result property="updateTime" column="update_time" />
<result property="nickName" column="nick_name" />
</resultMap>
<sql id="selectRepliesVo">
select id, discussion_id, content, is_delete, create_by, create_by_id, create_time, update_by, update_by_id, update_time from t_replies
</sql>
<select id="selectRepliesList" parameterType="Replies" resultMap="RepliesResult">
select tr.*,su.nick_name
from t_replies tr
left join sys_user su on su.user_id = tr.create_by_id
<where>
<if test="discussionId != null and discussionId != ''"> and tr.discussion_id = #{discussionId}</if>
<if test="content != null and content != ''"> and tr.content = #{content}</if>
<if test="createById != null and createById != ''"> and tr.create_by_id = #{createById}</if>
<if test="updateById != null and updateById != ''"> and tr.update_by_id = #{updateById}</if>
<if test="discussionIdList != null and discussionIdList.size() > 0">
and tr.discussion_id in
<foreach item="id" index="index" collection="discussionIdList" open="(" separator="," close=")">
#{id}
</foreach>
</if>
and tr.is_delete = '0'
</where>
</select>
<select id="selectRepliesById" parameterType="String" resultMap="RepliesResult">
<include refid="selectRepliesVo"/>
where id = #{id}
</select>
<insert id="insertReplies" parameterType="Replies">
insert into t_replies
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="discussionId != null">discussion_id,</if>
<if test="content != null">content,</if>
<if test="isDelete != null">is_delete,</if>
<if test="createBy != null">create_by,</if>
<if test="createById != null">create_by_id,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateById != null">update_by_id,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="discussionId != null">#{discussionId},</if>
<if test="content != null">#{content},</if>
<if test="isDelete != null">#{isDelete},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createById != null">#{createById},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateById != null">#{updateById},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateReplies" parameterType="Replies">
update t_replies
<trim prefix="SET" suffixOverrides=",">
<if test="discussionId != null">discussion_id = #{discussionId},</if>
<if test="content != null">content = #{content},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createById != null">create_by_id = #{createById},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateById != null">update_by_id = #{updateById},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteRepliesById" parameterType="String">
delete from t_replies where id = #{id}
</delete>
<delete id="deleteRepliesByIds" parameterType="String">
delete from t_replies where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,138 @@
<?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">
<mapper namespace="com.rzdata.web.mapper.ToolApplyMapper">
<resultMap type="ToolApply" id="ToolApplyResult">
<result property="id" column="id" />
<result property="userId" column="user_id" />
<result property="toolId" column="tool_id" />
<result property="procTitle" column="proc_title" />
<result property="applyType" column="apply_type" />
<result property="nickName" column="nick_name" />
<result property="deptId" column="dept_id" />
<result property="deptName" column="dept_name" />
<result property="reason" column="reason" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="procInstId" column="proc_inst_id" />
<result property="endTime" column="end_time" />
<result property="recordStatus" column="record_status" />
</resultMap>
<sql id="selectToolApplyVo">
select id, user_id, nick_name, tool_id, apply_type, proc_title, proc_inst_id, end_time, dept_id, record_status, dept_name, reason, create_by, create_time, update_by, update_time from t_tool_apply
</sql>
<select id="selectToolApplyList" parameterType="ToolApply" resultMap="ToolApplyResult">
<include refid="selectToolApplyVo"/>
<where>
<if test="userId != null and userId != ''"> and user_id like concat('%', #{userId}, '%')</if>
<if test="deptId != null and deptId != ''"> and dept_id = #{deptId}</if>
<if test="applyType != null and applyType != ''"> and apply_type = #{applyType}</if>
<if test="reason != null and reason != ''"> and reason = #{reason}</if>
<if test="recordStatus != null and recordStatus != ''"> and record_status = #{recordStatus}</if>
<if test="procTitle != null and procTitle != ''"> and proc_title like concat('%', #{procTitle}, '%')</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
</where>
order by create_time desc
</select>
<select id="selectToolApplyById" parameterType="String" resultMap="ToolApplyResult">
<include refid="selectToolApplyVo"/>
where id = #{id}
</select>
<select id="getInfoByBpmcId" parameterType="String" resultMap="ToolApplyResult">
<include refid="selectToolApplyVo"/>
where proc_inst_id = #{bpmcId}
</select>
<insert id="insertToolApply" parameterType="ToolApply">
insert into t_tool_apply
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="userId != null">user_id,</if>
<if test="toolId != null">tool_id,</if>
<if test="procTitle != null">proc_title,</if>
<if test="applyType != null">apply_type,</if>
<if test="nickName != null">nick_name,</if>
<if test="deptId != null">dept_id,</if>
<if test="deptName != null">dept_name,</if>
<if test="reason != null">reason,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="procInstId != null">proc_inst_id,</if>
<if test="endTime != null">end_time,</if>
<if test="recordStatus != null">record_status,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="userId != null">#{userId},</if>
<if test="toolId != null">#{toolId},</if>
<if test="procTitle != null">#{procTitle},</if>
<if test="applyType != null">#{applyType},</if>
<if test="nickName != null">#{nickName},</if>
<if test="deptId != null">#{deptId},</if>
<if test="deptName != null">#{deptName},</if>
<if test="reason != null">#{reason},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="endTime != null">#{endTime},</if>
<if test="procInstId != null">#{procInstId},</if>
<if test="recordStatus != null">#{recordStatus},</if>
</trim>
</insert>
<update id="updateToolApply" parameterType="ToolApply">
update t_tool_apply
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null">user_id = #{userId},</if>
<if test="nickName != null">nick_name = #{nickName},</if>
<if test="toolId != null">tool_id = #{toolId},</if>
<if test="procTitle != null">proc_title = #{procTitle},</if>
<if test="applyType != null">apply_type = #{applyType},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="deptName != null">dept_name = #{deptName},</if>
<if test="reason != null">reason = #{reason},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="endTime != null">end_time = #{endTime},</if>
<if test="recordStatus != null">record_status = #{recordStatus},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteToolApplyById" parameterType="String">
delete from t_tool_apply where id = #{id}
</delete>
<delete id="deleteToolApplyByIds" parameterType="String">
delete from t_tool_apply where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="checkToolApply" resultType="int">
SELECT count(*) FROM `t_tool_apply_item` uai
left join `t_tool_apply` ua on uai.apply_id = ua.id
WHERE ua.record_status = 'done'
and uai.tool_id = #{toolId}
and ua.user_id = #{userId}
</select>
</mapper>

View File

@@ -18,13 +18,15 @@
<result property="toolPrincipals" column="tool_principals" />
<result property="toolPrincipalsName" column="tool_principals_name" />
<result property="toolRespDept" column="tool_resp_dept" />
<result property="toolRespDeptName" column="tool_resp_dept_name" />
<result property="status" column="status" />
<result property="remark" column="remark" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<association property="dept" javaType="SysDept" resultMap="deptResult" />
<result property="procInstId" column="proc_inst_id" />
<result property="recordStatus" column="record_status" />
</resultMap>
<resultMap id="deptResult" type="SysDept">
@@ -38,7 +40,7 @@
</resultMap>
<sql id="selectToolVo">
select tool_id, tool_code, tool_name, tool_type, tool_source, tool_use, test_situation, function_desc, apply_condition, operate_explain, tool_principals, tool_principals_name, tool_resp_dept, status, remark, create_by, create_time, update_by, update_time from t_tool
select tool_id, tool_code, tool_name, tool_type, tool_source, tool_use, test_situation, function_desc, apply_condition, operate_explain, tool_principals, tool_principals_name, tool_resp_dept, status, remark, create_by, create_time, update_by, update_time,proc_inst_id,record_status,association from t_tool
</sql>
<select id="selectToolByToolId" parameterType="String" resultMap="ToolResult">
@@ -46,6 +48,11 @@
where tool_id = #{toolId}
</select>
<select id="getInfoByBpmcId" parameterType="String" resultMap="ToolResult">
<include refid="selectToolVo"/>
where proc_inst_id = #{bpmcId}
</select>
<insert id="insertTool" parameterType="Tool">
insert into t_tool
<trim prefix="(" suffix=")" suffixOverrides=",">
@@ -68,6 +75,9 @@
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="procInstId != null">proc_inst_id,</if>
<if test="recordStatus != null">record_status,</if>
<if test="association != null">association,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="toolId != null">#{toolId},</if>
@@ -89,12 +99,16 @@
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="procInstId != null">#{procInstId},</if>
<if test="recordStatus != null">#{recordStatus},</if>
<if test="association != null">#{association},</if>
</trim>
</insert>
<update id="updateTool" parameterType="Tool">
update t_tool
<trim prefix="SET" suffixOverrides=",">
<if test="toolCode != null">tool_code = #{toolCode},</if>
<if test="toolName != null">tool_name = #{toolName},</if>
<if test="toolType != null">tool_type = #{toolType},</if>
<if test="toolSource != null">tool_source = #{toolSource},</if>
@@ -112,15 +126,32 @@
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="recordStatus != null">record_status = #{recordStatus},</if>
<if test="association != null">association = #{association},</if>
</trim>
where tool_id = #{toolId}
</update>
<select id="checkToolExist" parameterType="Tool" resultType="int">
select count(*) from t_tool t
<where>
t.tool_code = #{toolCode} and t.tool_resp_dept = #{toolRespDept}
and (t.record_status = 'doing' or t.record_status = 'done')
<if test="toolId!=null and toolId!=''">
and t.tool_id != #{toolId}
</if>
</where>
</select>
<select id="selectToolList" parameterType="Tool" resultMap="ToolResult">
select u.tool_id, u.tool_code, u.tool_name, u.tool_type, u.tool_source, u.tool_use, u.test_situation, u.function_desc, u.apply_condition, u.operate_explain,
u.tool_principals, u.tool_principals_name, u.tool_resp_dept, u.status, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from t_tool u
left join sys_dept d on u.tool_resp_dept = d.dept_id
select u.tool_id, u.tool_code, u.tool_name, u.tool_type, u.tool_source, u.tool_use, u.test_situation, u.function_desc, u.apply_condition, u.operate_explain,u.record_status,u.proc_inst_id,
u.tool_principals, u.tool_principals_name, u.tool_resp_dept, u.status, u.create_by, u.create_time, u.remark, sd.dept_name as tool_resp_dept_name,u.association
from t_tool u
left join sys_user su on u.create_by = su.user_id
left join sys_dept d on d.dept_id = su.dept_Id
left join sys_dept sd on u.tool_resp_dept = sd.dept_id
where 1=1
and u.record_status != 'cancel'
<if test="toolId != null and toolId != ''">
AND u.tool_id = #{toolId}
</if>
@@ -142,6 +173,14 @@
<if test="toolRespDept != null and toolRespDept != ''">
AND u.tool_resp_dept = #{toolRespDept}
</if>
<if test="createBy != null and createBy != '' and permission != true">
AND (u.create_by = #{createBy} or u.record_status = 'done')
</if>
<if test="recordStatus != null and recordStatus != ''">
AND u.record_status = #{recordStatus}
</if>
${params.dataScope}
order by create_time desc
</select>
<delete id="deleteToolByToolId" parameterType="String">
@@ -154,4 +193,14 @@
#{toolId}
</foreach>
</delete>
</mapper>
<select id="countToolType" resultType="java.util.Map">
select tool_type as types,sum(1) as statistics from t_tool where record_status != 'cancel' group by tool_type;
</select>
<select id="toolSource" resultType="java.util.Map">
select tool_source as types,sum(1) as statistics from t_tool where record_status != 'cancel' group by tool_source;
</select>
<select id="recordStatus" resultType="java.util.Map">
select record_status as types,sum(1) as statistics from t_tool where record_status != 'cancel' group by record_status;
</select>
</mapper>

View File

@@ -0,0 +1,115 @@
<?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">
<mapper namespace="com.rzdata.web.mapper.TzMessageMapper">
<resultMap type="TzMessage" id="TzMessageResult">
<result property="id" column="id" />
<result property="receiverId" column="receiver_id" />
<result property="states" column="states" />
<result property="content" column="content" />
<result property="deleted" column="deleted" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="createById" column="create_by_id" />
<result property="updateById" column="update_by_id" />
</resultMap>
<sql id="selectTzMessageVo">
select id, receiver_id, states, content, deleted, create_by, create_time, update_by, update_time, remark,create_by_id,update_by_id from tz_message
</sql>
<select id="selectTzMessageList" parameterType="TzMessage" resultMap="TzMessageResult">
<include refid="selectTzMessageVo"/>
<where>
<if test="receiverId != null and receiverId != ''"> and receiver_id = #{receiverId}</if>
<if test="states != null "> and states = #{states}</if>
<if test="content != null and content != ''"> and content like concat('%', #{content}, '%')</if>
<if test="createById != null and deleted != ''"> and create_by_id = #{createById}</if>
and deleted = '0'
</where>
</select>
<select id="selectTzMessageById" parameterType="String" resultMap="TzMessageResult">
<include refid="selectTzMessageVo"/>
where id = #{id}
</select>
<insert id="insertTzMessage" parameterType="TzMessage">
insert into tz_message
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="receiverId != null">receiver_id,</if>
<if test="states != null">states,</if>
<if test="content != null and content != ''">content,</if>
<if test="deleted != null and deleted != ''">deleted,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="createById != null">create_by_id,</if>
<if test="updateById != null">update_by_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="receiverId != null">#{receiverId},</if>
<if test="states != null">#{states},</if>
<if test="content != null and content != ''">#{content},</if>
<if test="deleted != null and deleted != ''">#{deleted},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="createById != null">#{create_by_id},</if>
<if test="updateById != null">#{update_by_id},</if>
</trim>
</insert>
<update id="updateTzMessage" parameterType="TzMessage">
update tz_message
<trim prefix="SET" suffixOverrides=",">
<if test="receiverId != null">receiver_id = #{receiverId},</if>
<if test="states != null">states = #{states},</if>
<if test="content != null and content != ''">content = #{content},</if>
<if test="deleted != null and deleted != ''">deleted = #{deleted},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createById != null">create_by_id = #{createById},</if>
<if test="updateById != null">update_by_id = #{updateById},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteTzMessageById" parameterType="String">
delete from tz_message where id = #{id}
</delete>
<delete id="deleteTzMessageByIds" parameterType="String">
delete from tz_message where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="updateAllMarkedRead" parameterType="TzMessage">
update tz_message set states = '2' where create_by_id = #{createById}
</update>
<!-- 批量插入 -->
<insert id="batchInsert" parameterType="java.util.List">
insert into tz_message (id, receiver_id, states, content, deleted, create_by, create_time
values
<foreach item="item" index="index" collection="tzMessageList" open="(" separator="),(" close=")">
#{item.id}, #{item.receiverId}, #{item.states}, #{item.content}, #{item.deleted}, #{item.createBy}, #{item.createTime}
</foreach>
</insert>
</mapper>

View File

@@ -0,0 +1,97 @@
<?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">
<mapper namespace="com.rzdata.web.mapper.UseApplyItemMapper">
<resultMap type="UseApplyItem" id="UseApplyItemResult">
<result property="id" column="id" />
<result property="applyId" column="apply_id" />
<result property="toolId" column="tool_id" />
<result property="toolCode" column="tool_code" />
<result property="toolName" column="tool_name" />
<result property="toolType" column="tool_type" />
<result property="toolPrincipals" column="tool_principals" />
<result property="toolPrincipalsName" column="tool_principals_name" />
<result property="toolRespDept" column="tool_resp_dept" />
</resultMap>
<sql id="selectUseApplyItemVo">
select id, apply_id, tool_id, tool_code, tool_name, tool_type, tool_principals, tool_principals_name, tool_resp_dept from t_use_apply_item
</sql>
<select id="selectUseApplyItemList" parameterType="UseApplyItem" resultMap="UseApplyItemResult">
<include refid="selectUseApplyItemVo"/>
<where>
<if test="applyId != null and applyId != ''"> and apply_id = #{applyId}</if>
<if test="toolId != null and toolId != ''"> and tool_id = #{toolId}</if>
<if test="toolCode != null and toolCode != ''"> and tool_code = #{toolCode}</if>
<if test="toolName != null and toolName != ''"> and tool_name like concat('%', #{toolName}, '%')</if>
<if test="toolType != null and toolType != ''"> and tool_type = #{toolType}</if>
<if test="toolPrincipals != null and toolPrincipals != ''"> and tool_principals = #{toolPrincipals}</if>
<if test="toolPrincipalsName != null and toolPrincipalsName != ''"> and tool_principals_name like concat('%', #{toolPrincipalsName}, '%')</if>
<if test="toolRespDept != null and toolRespDept != ''"> and tool_resp_dept = #{toolRespDept}</if>
</where>
</select>
<select id="selectUseApplyItemById" parameterType="String" resultMap="UseApplyItemResult">
<include refid="selectUseApplyItemVo"/>
where id = #{id}
</select>
<insert id="insertUseApplyItem" parameterType="UseApplyItem">
insert into t_use_apply_item
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="applyId != null">apply_id,</if>
<if test="toolId != null">tool_id,</if>
<if test="toolCode != null">tool_code,</if>
<if test="toolName != null">tool_name,</if>
<if test="toolType != null">tool_type,</if>
<if test="toolPrincipals != null">tool_principals,</if>
<if test="toolPrincipalsName != null">tool_principals_name,</if>
<if test="toolRespDept != null">tool_resp_dept,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="applyId != null">#{applyId},</if>
<if test="toolId != null">#{toolId},</if>
<if test="toolCode != null">#{toolCode},</if>
<if test="toolName != null">#{toolName},</if>
<if test="toolType != null">#{toolType},</if>
<if test="toolPrincipals != null">#{toolPrincipals},</if>
<if test="toolPrincipalsName != null">#{toolPrincipalsName},</if>
<if test="toolRespDept != null">#{toolRespDept},</if>
</trim>
</insert>
<update id="updateUseApplyItem" parameterType="UseApplyItem">
update t_use_apply_item
<trim prefix="SET" suffixOverrides=",">
<if test="applyId != null">apply_id = #{applyId},</if>
<if test="toolId != null">tool_id = #{toolId},</if>
<if test="toolCode != null">tool_code = #{toolCode},</if>
<if test="toolName != null">tool_name = #{toolName},</if>
<if test="toolType != null">tool_type = #{toolType},</if>
<if test="toolPrincipals != null">tool_principals = #{toolPrincipals},</if>
<if test="toolPrincipalsName != null">tool_principals_name = #{toolPrincipalsName},</if>
<if test="toolRespDept != null">tool_resp_dept = #{toolRespDept},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteUseApplyItemById" parameterType="String">
delete from t_use_apply_item where id = #{id}
</delete>
<delete id="deleteUseApplyItemByIds" parameterType="String">
delete from t_use_apply_item where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteByApplyId" parameterType="String">
delete from t_use_apply_item where apply_id = #{applyId}
</delete>
</mapper>

View File

@@ -0,0 +1,147 @@
<?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">
<mapper namespace="com.rzdata.web.mapper.WorkflowLogMapper">
<resultMap type="WorkflowLog" id="WorkflowLogResult">
<result property="id" column="id" />
<result property="procInstId" column="proc_inst_id" />
<result property="procDefKey" column="proc_def_key" />
<result property="businessId" column="business_id" />
<result property="actDefId" column="act_def_id" />
<result property="actDefName" column="act_def_name" />
<result property="nextDefId" column="next_def_id" />
<result property="nextDefName" column="next_def_name" />
<result property="actInstId" column="act_inst_id" />
<result property="opinion" column="opinion" />
<result property="sender" column="sender" />
<result property="senderDeptId" column="sender_dept_id" />
<result property="receiver" column="receiver" />
<result property="actStatus" column="act_status" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="pass" column="pass" />
<result property="tenantId" column="tenant_id" />
<result property="review" column="review" />
<result property="batch" column="batch" />
</resultMap>
<sql id="selectWorkflowLogVo">
select id, proc_inst_id, proc_def_key, business_id, act_def_id, act_def_name, next_def_id, next_def_name, act_inst_id, opinion, sender, sender_dept_id, receiver, act_status, create_time, update_time, pass, tenant_id, review, batch from t_workflow_log
</sql>
<select id="selectWorkflowLogList" parameterType="WorkflowLog" resultMap="WorkflowLogResult">
<include refid="selectWorkflowLogVo"/>
<where>
<if test="procInstId != null and procInstId != ''"> and proc_inst_id = #{procInstId}</if>
<if test="procDefKey != null and procDefKey != ''"> and proc_def_key = #{procDefKey}</if>
<if test="businessId != null and businessId != ''"> and business_id = #{businessId}</if>
<if test="actDefId != null and actDefId != ''"> and act_def_id = #{actDefId}</if>
<if test="actDefName != null and actDefName != ''"> and act_def_name like concat('%', #{actDefName}, '%')</if>
<if test="nextDefId != null and nextDefId != ''"> and next_def_id = #{nextDefId}</if>
<if test="nextDefName != null and nextDefName != ''"> and next_def_name like concat('%', #{nextDefName}, '%')</if>
<if test="actInstId != null and actInstId != ''"> and act_inst_id = #{actInstId}</if>
<if test="opinion != null and opinion != ''"> and opinion = #{opinion}</if>
<if test="sender != null and sender != ''"> and sender = #{sender}</if>
<if test="senderDeptId != null and senderDeptId != ''"> and sender_dept_id = #{senderDeptId}</if>
<if test="receiver != null and receiver != ''"> and receiver = #{receiver}</if>
<if test="actStatus != null and actStatus != ''"> and act_status = #{actStatus}</if>
<if test="pass != null "> and pass = #{pass}</if>
<if test="tenantId != null and tenantId != ''"> and tenant_id = #{tenantId}</if>
<if test="review != null "> and review = #{review}</if>
<if test="batch != null and batch != ''"> and batch = #{batch}</if>
</where>
order by create_time desc
</select>
<select id="selectWorkflowLogById" parameterType="String" resultMap="WorkflowLogResult">
<include refid="selectWorkflowLogVo"/>
where id = #{id}
</select>
<insert id="insertWorkflowLog" parameterType="WorkflowLog">
insert into t_workflow_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="procInstId != null">proc_inst_id,</if>
<if test="procDefKey != null">proc_def_key,</if>
<if test="businessId != null">business_id,</if>
<if test="actDefId != null">act_def_id,</if>
<if test="actDefName != null">act_def_name,</if>
<if test="nextDefId != null">next_def_id,</if>
<if test="nextDefName != null">next_def_name,</if>
<if test="actInstId != null">act_inst_id,</if>
<if test="opinion != null">opinion,</if>
<if test="sender != null">sender,</if>
<if test="senderDeptId != null">sender_dept_id,</if>
<if test="receiver != null">receiver,</if>
<if test="actStatus != null">act_status,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="pass != null">pass,</if>
<if test="tenantId != null">tenant_id,</if>
<if test="review != null">review,</if>
<if test="batch != null">batch,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="procInstId != null">#{procInstId},</if>
<if test="procDefKey != null">#{procDefKey},</if>
<if test="businessId != null">#{businessId},</if>
<if test="actDefId != null">#{actDefId},</if>
<if test="actDefName != null">#{actDefName},</if>
<if test="nextDefId != null">#{nextDefId},</if>
<if test="nextDefName != null">#{nextDefName},</if>
<if test="actInstId != null">#{actInstId},</if>
<if test="opinion != null">#{opinion},</if>
<if test="sender != null">#{sender},</if>
<if test="senderDeptId != null">#{senderDeptId},</if>
<if test="receiver != null">#{receiver},</if>
<if test="actStatus != null">#{actStatus},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="pass != null">#{pass},</if>
<if test="tenantId != null">#{tenantId},</if>
<if test="review != null">#{review},</if>
<if test="batch != null">#{batch},</if>
</trim>
</insert>
<update id="updateWorkflowLog" parameterType="WorkflowLog">
update t_workflow_log
<trim prefix="SET" suffixOverrides=",">
<if test="procInstId != null">proc_inst_id = #{procInstId},</if>
<if test="procDefKey != null">proc_def_key = #{procDefKey},</if>
<if test="businessId != null">business_id = #{businessId},</if>
<if test="actDefId != null">act_def_id = #{actDefId},</if>
<if test="actDefName != null">act_def_name = #{actDefName},</if>
<if test="nextDefId != null">next_def_id = #{nextDefId},</if>
<if test="nextDefName != null">next_def_name = #{nextDefName},</if>
<if test="actInstId != null">act_inst_id = #{actInstId},</if>
<if test="opinion != null">opinion = #{opinion},</if>
<if test="sender != null">sender = #{sender},</if>
<if test="senderDeptId != null">sender_dept_id = #{senderDeptId},</if>
<if test="receiver != null">receiver = #{receiver},</if>
<if test="actStatus != null">act_status = #{actStatus},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="pass != null">pass = #{pass},</if>
<if test="tenantId != null">tenant_id = #{tenantId},</if>
<if test="review != null">review = #{review},</if>
<if test="batch != null">batch = #{batch},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWorkflowLogById" parameterType="String">
delete from t_workflow_log where id = #{id}
</delete>
<delete id="deleteWorkflowLogByIds" parameterType="String">
delete from t_workflow_log where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,26 @@
package com.rzdata.common.config;
import cn.hutool.core.lang.Snowflake;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* 雪花算法订单号生成
* @author lanhai
*/
@Configuration
public class SnowflakeConfig {
@Value("${application.datacenterId}")
private Long datacenterId;
@Value("${application.workerId}")
private Long workerId;
@Bean
public Snowflake snowflake() {
return new Snowflake(workerId, datacenterId);
}
}

View File

@@ -5,7 +5,7 @@ import io.jsonwebtoken.Claims;
/**
* 通用常量信息
*
*
* @author jian
*/
public class Constants
@@ -170,4 +170,43 @@ public class Constants
*/
public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
"org.springframework", "org.apache", "com.rzdata.common.utils.file", "com.rzdata.common.config", "com.rzdata.generator" };
/**
* 查看审批中的工具权限
*/
public static final String VIEW_TOOL_PERMISSION = "view:doing:tool";
/**
* 查看审批中的工具权限
*/
public static final String DOWNLOAD_TOOL_PERMISSION = "download:done:tool";
/** 文档-状态-已发布 **/
public static final String DOC_STATUS_YFB = "yfb";
/** 文档-状态-已上传 **/
public static final String DOC_STATUS_YSC = "ysc";
/** 文档-状态-审核中 **/
public static final String DOC_STATUS_SHZ = "shz";
/** 文档-doc **/
public static final String DOC_TYPE_DOC = "doc";
public static final String STR_ZERO = "0";
public static final String STR_ONE = "1";
/**
* 申请类型-发布申请
*/
public static final String TOOL_APPLY_TYPE_PUBLISH = "publish";
/**
* 申请类型-使用申请
*/
public static final String TOOL_APPLY_TYPE_USE = "use";
public static final String DOC_DOWNLOAD_PERMISSION = "document:download";
public static final String DOC_VIEW_PERMISSION = "document:query:data:all";
}

View File

@@ -0,0 +1,54 @@
package com.rzdata.common.core.domain;
import com.rzdata.common.annotation.Excel;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
* 文档资源分类管理对象 t_document_category
*
* @author spongepan
* @date 2024-08-27
*/
@Data
public class DocumentCategory extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private String id;
/** 分类名称 */
@Excel(name = "分类名称")
private String categoryName;
/** 分类描述 */
@Excel(name = "分类描述")
private String categoryDescription;
/** 父分类ID如果是一级分类则为空 */
@Excel(name = "父分类ID如果是一级分类则为空")
private String parentId;
/** 创建人id */
@Excel(name = "创建人id")
private String createById;
/** 更新人id */
@Excel(name = "更新人id")
private String updateById;
/** 类型system:系统user:用户创建) */
@Excel(name = "类型")
private String types;
/** 文档分类id */
@Excel(name = "文档分类id")
private String docCategoryId;
/** 子分类 */
private List<DocumentCategory> children = new ArrayList<DocumentCategory>();
}

View File

@@ -6,12 +6,14 @@ import java.util.stream.Collectors;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.rzdata.common.core.domain.entity.SysDept;
import com.rzdata.common.core.domain.entity.SysMenu;
import lombok.Data;
/**
* Treeselect树结构实体类
*
* @author ruoyi
*/
@Data
public class TreeSelect implements Serializable
{
private static final long serialVersionUID = 1L;
@@ -22,6 +24,9 @@ public class TreeSelect implements Serializable
/** 节点名称 */
private String label;
/** 类型 */
private String types;
/** 子节点 */
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private List<TreeSelect> children;
@@ -45,33 +50,14 @@ public class TreeSelect implements Serializable
this.children = menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
}
public Long getId()
public TreeSelect(DocumentCategory docCategory)
{
return id;
this.id = Long.valueOf(docCategory.getId());
this.label = docCategory.getCategoryName();
this.types = docCategory.getTypes();
this.children = docCategory.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
}
public void setId(Long id)
{
this.id = id;
}
public String getLabel()
{
return label;
}
public void setLabel(String label)
{
this.label = label;
}
public List<TreeSelect> getChildren()
{
return children;
}
public void setChildren(List<TreeSelect> children)
{
this.children = children;
}
}

View File

@@ -0,0 +1,49 @@
package com.rzdata.common.enums;
public enum RecordStatusEnum {
/**
* 草稿
*/
DRAFT("draft","草稿"),
/**
* 进行中
*/
DOING("doing","进行中"),
/**
* 已完成
*/
DONE("done","已办结"),
/**
* 作废
*/
CANCEL("cancel","已撤销");
RecordStatusEnum(String code, String msg) {
this.code = code;
this.msg = msg;
}
private String code;
private String msg;
public String getCode() {
return code;
}
public String getMsg() {
return msg;
}
public static String getMsg(String code){
for (RecordStatusEnum recordStatusEnum : RecordStatusEnum.values()){
if(recordStatusEnum.getCode().equals(code)){
return recordStatusEnum.getMsg();
}
}
return "";
}
}

View File

@@ -5,6 +5,8 @@ import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Objects;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.rzdata.common.listener.PutObjectProgressListener;
import org.apache.commons.io.FilenameUtils;
import org.springframework.util.Assert;
@@ -280,4 +282,58 @@ public class FileUploadUtils
}
return extension;
}
/**
* 生成合并后的文件路径
*
* @param baseDir 文件存储根目录
* @param fileName 上传的文件名
* @return 合并后文件的完整路径
*/
public static String generateMergedFilePath(String baseDir, String fileName) {
// 获取当前日期路径
String datePath = DateUtil.today().replace("-", "/");
// 获取文件的基本名称和扩展名
String baseName = StrUtil.subBefore(fileName, ".", true);
String extension = StrUtil.subAfter(fileName, ".", true);
// 生成唯一文件名,使用时间戳
String uniqueFileName = baseName + "_" + System.currentTimeMillis() + "." + extension;
// 合并文件路径: baseDir/yyyy/MM/dd/uploadId/uniqueFileName
String mergedFilePath = Paths.get(baseDir, datePath, uniqueFileName).toString();
return mergedFilePath;
}
/**
* 获取文件名称
*
* @param baseDir 文件存储根目录
* @param fileNames 上传的文件名
* @return 合并后文件的完整路径
*/
public static String getFilePath(String baseDir, String fileNames) {
String extension = StrUtil.subAfter(fileNames, ".", true);
String fileName = StringUtils.format("{}/{}_{}.{}", DateUtils.datePath(),
FilenameUtils.getBaseName(fileNames), Seq.getId(Seq.uploadSeqType), extension);;
try {
return getPathFileName(baseDir, fileName);
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
public static String extractSuffix(String filePath) {
int lastDotIndex = filePath.lastIndexOf('.');
if (lastDotIndex == -1) {
return ""; // 没有后缀
}
return filePath.substring(lastDotIndex + 1); // 去掉点(.
}
}

View File

@@ -88,7 +88,7 @@ import com.rzdata.common.utils.reflect.ReflectUtils;
/**
* Excel相关处理
*
*
* @author ruoyi
*/
public class ExcelUtil<T>
@@ -210,9 +210,11 @@ public class ExcelUtil<T>
* @param fields 列属性名 示例[单个"name"/多个"id","name"]
* @throws Exception
*/
public void hideColumn(String... fields)
public void hideColumn(List<String> fields)
{
this.excludeFields = fields;
if (fields!=null) {
this.excludeFields = fields.toArray(new String[0]);
}
}
public void init(List<T> list, String sheetName, String title, Type type)
@@ -285,7 +287,7 @@ public class ExcelUtil<T>
/**
* 对excel表单默认第一个索引名转换成list
*
*
* @param is 输入流
* @return 转换后集合
*/
@@ -310,7 +312,7 @@ public class ExcelUtil<T>
/**
* 对excel表单默认第一个索引名转换成list
*
*
* @param is 输入流
* @param titleNum 标题占用行数
* @return 转换后集合
@@ -322,7 +324,7 @@ public class ExcelUtil<T>
/**
* 对excel表单指定表格索引名转换成list
*
*
* @param sheetName 表格索引名
* @param titleNum 标题占用行数
* @param is 输入流
@@ -506,7 +508,7 @@ public class ExcelUtil<T>
/**
* 对list数据源将其里面的数据导入到excel表单
*
*
* @param list 导出数据集合
* @param sheetName 工作表的名称
* @return 结果
@@ -518,7 +520,7 @@ public class ExcelUtil<T>
/**
* 对list数据源将其里面的数据导入到excel表单
*
*
* @param list 导出数据集合
* @param sheetName 工作表的名称
* @param title 标题
@@ -532,7 +534,7 @@ public class ExcelUtil<T>
/**
* 对list数据源将其里面的数据导入到excel表单
*
*
* @param response 返回数据
* @param list 导出数据集合
* @param sheetName 工作表的名称
@@ -545,7 +547,21 @@ public class ExcelUtil<T>
/**
* 对list数据源将其里面的数据导入到excel表单
*
*
* @param response 返回数据
* @param list 导出数据集合
* @param sheetName 工作表的名称
* @return 结果
*/
public void exportExcel(HttpServletResponse response, List<T> list, String sheetName,List<String> excludeFields)
{
hideColumn(excludeFields);
exportExcel(response, list, sheetName, StringUtils.EMPTY);
}
/**
* 对list数据源将其里面的数据导入到excel表单
*
* @param response 返回数据
* @param list 导出数据集合
* @param sheetName 工作表的名称
@@ -562,7 +578,7 @@ public class ExcelUtil<T>
/**
* 对list数据源将其里面的数据导入到excel表单
*
*
* @param sheetName 工作表的名称
* @return 结果
*/
@@ -573,7 +589,7 @@ public class ExcelUtil<T>
/**
* 对list数据源将其里面的数据导入到excel表单
*
*
* @param sheetName 工作表的名称
* @param title 标题
* @return 结果
@@ -586,7 +602,7 @@ public class ExcelUtil<T>
/**
* 对list数据源将其里面的数据导入到excel表单
*
*
* @param sheetName 工作表的名称
* @return 结果
*/
@@ -597,7 +613,7 @@ public class ExcelUtil<T>
/**
* 对list数据源将其里面的数据导入到excel表单
*
*
* @param sheetName 工作表的名称
* @param title 标题
* @return 结果
@@ -612,7 +628,7 @@ public class ExcelUtil<T>
/**
* 对list数据源将其里面的数据导入到excel表单
*
*
* @return 结果
*/
public void exportExcel(HttpServletResponse response)
@@ -634,7 +650,7 @@ public class ExcelUtil<T>
/**
* 对list数据源将其里面的数据导入到excel表单
*
*
* @return 结果
*/
public AjaxResult exportExcel()
@@ -702,7 +718,7 @@ public class ExcelUtil<T>
/**
* 填充excel数据
*
*
* @param index 序号
* @param row 单元格行
*/
@@ -773,7 +789,7 @@ public class ExcelUtil<T>
/**
* 创建表格样式
*
*
* @param wb 工作薄对象
* @return 样式列表
*/
@@ -828,7 +844,7 @@ public class ExcelUtil<T>
/**
* 根据Excel注解创建表格头样式
*
*
* @param wb 工作薄对象
* @return 自定义样式列表
*/
@@ -864,7 +880,7 @@ public class ExcelUtil<T>
/**
* 根据Excel注解创建表格列样式
*
*
* @param wb 工作薄对象
* @return 自定义样式列表
*/
@@ -896,7 +912,7 @@ public class ExcelUtil<T>
/**
* 根据Excel注解创建表格列样式
*
*
* @param styles 自定义样式列表
* @param field 属性列信息
* @param excel 注解信息
@@ -958,7 +974,7 @@ public class ExcelUtil<T>
/**
* 设置单元格信息
*
*
* @param value 单元格值
* @param attr 注解相关
* @param cell 单元格信息
@@ -1138,7 +1154,7 @@ public class ExcelUtil<T>
/**
* 设置 POI XSSFSheet 单元格提示或选择框
*
*
* @param sheet 表单
* @param textlist 下拉框显示的内容
* @param promptContent 提示内容
@@ -1175,7 +1191,7 @@ public class ExcelUtil<T>
/**
* 设置某些列的值只能输入预制的数据,显示下拉框(兼容超出一定数量的下拉框).
*
*
* @param sheet 要设置的sheet.
* @param textlist 下拉框显示的内容
* @param promptContent 提示内容
@@ -1227,7 +1243,7 @@ public class ExcelUtil<T>
/**
* 解析导出值 0=男,1=女,2=未知
*
*
* @param propertyValue 参数值
* @param converterExp 翻译注解
* @param separator 分隔符
@@ -1264,7 +1280,7 @@ public class ExcelUtil<T>
/**
* 反向解析值 男=0,女=1,未知=2
*
*
* @param propertyValue 参数值
* @param converterExp 翻译注解
* @param separator 分隔符
@@ -1301,7 +1317,7 @@ public class ExcelUtil<T>
/**
* 解析字典值
*
*
* @param dictValue 字典值
* @param dictType 字典类型
* @param separator 分隔符
@@ -1314,7 +1330,7 @@ public class ExcelUtil<T>
/**
* 反向解析值字典值
*
*
* @param dictLabel 字典标签
* @param dictType 字典类型
* @param separator 分隔符
@@ -1327,7 +1343,7 @@ public class ExcelUtil<T>
/**
* 数据处理器
*
*
* @param value 数据值
* @param excel 数据注解
* @return
@@ -1404,7 +1420,7 @@ public class ExcelUtil<T>
/**
* 获取下载路径
*
*
* @param filename 文件名称
*/
public String getAbsoluteFile(String filename)
@@ -1420,7 +1436,7 @@ public class ExcelUtil<T>
/**
* 获取bean中的属性值
*
*
* @param vo 实体对象
* @param field 字段
* @param excel 注解
@@ -1451,7 +1467,7 @@ public class ExcelUtil<T>
/**
* 以类的属性的get方法方法形式获取值
*
*
* @param o
* @param name
* @return value
@@ -1557,7 +1573,7 @@ public class ExcelUtil<T>
/**
* 创建工作表
*
*
* @param sheetNo sheet数量
* @param index 序号
*/
@@ -1574,7 +1590,7 @@ public class ExcelUtil<T>
/**
* 获取单元格值
*
*
* @param row 获取的行
* @param column 获取单元格列号
* @return 单元格值
@@ -1634,7 +1650,7 @@ public class ExcelUtil<T>
/**
* 判断是否是空行
*
*
* @param row 判断的行
* @return
*/
@@ -1722,7 +1738,7 @@ public class ExcelUtil<T>
/**
* 格式化不同类型的日期对象
*
*
* @param dateFormat 日期格式
* @param val 被格式化的日期对象
* @return 格式化后的日期字符
@@ -1788,7 +1804,7 @@ public class ExcelUtil<T>
/**
* 获取对象的子列表方法
*
*
* @param name 名称
* @param pojoClass 类对象
* @return 子列表方法

View File

@@ -6,14 +6,14 @@ import com.rzdata.common.core.domain.entity.SysDept;
/**
* 部门管理 数据层
*
*
* @author jian
*/
public interface SysDeptMapper
{
/**
* 查询部门管理数据
*
*
* @param dept 部门信息
* @return 部门信息集合
*/
@@ -21,7 +21,7 @@ public interface SysDeptMapper
/**
* 根据角色ID查询部门树信息
*
*
* @param roleId 角色ID
* @param deptCheckStrictly 部门树选择项是否关联显示
* @return 选中部门列表
@@ -30,7 +30,7 @@ public interface SysDeptMapper
/**
* 根据部门ID查询信息
*
*
* @param deptId 部门ID
* @return 部门信息
*/
@@ -38,7 +38,7 @@ public interface SysDeptMapper
/**
* 根据ID查询所有子部门
*
*
* @param deptId 部门ID
* @return 部门列表
*/
@@ -46,7 +46,7 @@ public interface SysDeptMapper
/**
* 根据ID查询所有子部门正常状态
*
*
* @param deptId 部门ID
* @return 子部门数
*/
@@ -54,7 +54,7 @@ public interface SysDeptMapper
/**
* 是否存在子节点
*
*
* @param deptId 部门ID
* @return 结果
*/
@@ -62,7 +62,7 @@ public interface SysDeptMapper
/**
* 查询部门是否存在用户
*
*
* @param deptId 部门ID
* @return 结果
*/
@@ -70,7 +70,7 @@ public interface SysDeptMapper
/**
* 校验部门名称是否唯一
*
*
* @param deptName 部门名称
* @param parentId 父部门ID
* @return 结果
@@ -79,7 +79,7 @@ public interface SysDeptMapper
/**
* 新增部门信息
*
*
* @param dept 部门信息
* @return 结果
*/
@@ -87,7 +87,7 @@ public interface SysDeptMapper
/**
* 修改部门信息
*
*
* @param dept 部门信息
* @return 结果
*/
@@ -95,14 +95,14 @@ public interface SysDeptMapper
/**
* 修改所在部门正常状态
*
*
* @param deptIds 部门ID组
*/
public void updateDeptStatusNormal(Long[] deptIds);
/**
* 修改子元素关系
*
*
* @param depts 子元素
* @return 结果
*/
@@ -110,9 +110,11 @@ public interface SysDeptMapper
/**
* 删除部门管理信息
*
*
* @param deptId 部门ID
* @return 结果
*/
public int deleteDeptById(Long deptId);
String getDeptNameByDeptId(String deptId);
}

View File

@@ -18,6 +18,14 @@ public interface SysDictTypeMapper
*/
public List<SysDictType> selectDictTypeList(SysDictType dictType);
/**
* 根据条件分页查询字典类型
*
* @param dictType 字典类型信息
* @return 字典类型集合信息
*/
public List<SysDictType> selectBizDictTypeList(SysDictType dictType);
/**
* 根据所有字典类型
*

View File

@@ -6,14 +6,14 @@ import com.rzdata.common.core.domain.entity.SysDept;
/**
* 部门管理 服务层
*
*
* @author jian
*/
public interface ISysDeptService
{
/**
* 查询部门管理数据
*
*
* @param dept 部门信息
* @return 部门信息集合
*/
@@ -21,7 +21,7 @@ public interface ISysDeptService
/**
* 查询部门树结构信息
*
*
* @param dept 部门信息
* @return 部门树信息集合
*/
@@ -29,7 +29,7 @@ public interface ISysDeptService
/**
* 构建前端所需要树结构
*
*
* @param depts 部门列表
* @return 树结构列表
*/
@@ -37,7 +37,7 @@ public interface ISysDeptService
/**
* 构建前端所需要下拉树结构
*
*
* @param depts 部门列表
* @return 下拉树结构列表
*/
@@ -45,7 +45,7 @@ public interface ISysDeptService
/**
* 根据角色ID查询部门树信息
*
*
* @param roleId 角色ID
* @return 选中部门列表
*/
@@ -53,7 +53,7 @@ public interface ISysDeptService
/**
* 根据部门ID查询信息
*
*
* @param deptId 部门ID
* @return 部门信息
*/
@@ -61,7 +61,7 @@ public interface ISysDeptService
/**
* 根据ID查询所有子部门正常状态
*
*
* @param deptId 部门ID
* @return 子部门数
*/
@@ -69,7 +69,7 @@ public interface ISysDeptService
/**
* 是否存在部门子节点
*
*
* @param deptId 部门ID
* @return 结果
*/
@@ -77,7 +77,7 @@ public interface ISysDeptService
/**
* 查询部门是否存在用户
*
*
* @param deptId 部门ID
* @return 结果 true 存在 false 不存在
*/
@@ -85,7 +85,7 @@ public interface ISysDeptService
/**
* 校验部门名称是否唯一
*
*
* @param dept 部门信息
* @return 结果
*/
@@ -93,14 +93,14 @@ public interface ISysDeptService
/**
* 校验部门是否有数据权限
*
*
* @param deptId 部门id
*/
public void checkDeptDataScope(Long deptId);
/**
* 新增保存部门信息
*
*
* @param dept 部门信息
* @return 结果
*/
@@ -108,7 +108,7 @@ public interface ISysDeptService
/**
* 修改保存部门信息
*
*
* @param dept 部门信息
* @return 结果
*/
@@ -116,9 +116,11 @@ public interface ISysDeptService
/**
* 删除部门管理信息
*
*
* @param deptId 部门ID
* @return 结果
*/
public int deleteDeptById(Long deptId);
String getDeptName(String deptId);
}

View File

@@ -19,6 +19,14 @@ public interface ISysDictTypeService
*/
public List<SysDictType> selectDictTypeList(SysDictType dictType);
/**
* 根据条件分页查询字典类型
*
* @param dictType 字典类型信息
* @return 字典类型集合信息
*/
public List<SysDictType> selectBizDictTypeList(SysDictType dictType);
/**
* 根据所有字典类型
*

View File

@@ -23,7 +23,7 @@ import com.rzdata.system.service.ISysDeptService;
/**
* 部门管理 服务实现
*
*
* @author ruoyi
*/
@Service
@@ -37,12 +37,11 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 查询部门管理数据
*
*
* @param dept 部门信息
* @return 部门信息集合
*/
@Override
@DataScope(deptAlias = "d")
public List<SysDept> selectDeptList(SysDept dept)
{
return deptMapper.selectDeptList(dept);
@@ -50,20 +49,20 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 查询部门树结构信息
*
*
* @param dept 部门信息
* @return 部门树信息集合
*/
@Override
public List<TreeSelect> selectDeptTreeList(SysDept dept)
{
List<SysDept> depts = SpringUtils.getAopProxy(this).selectDeptList(dept);
List<SysDept> depts = this.selectDeptList(dept);
return buildDeptTreeSelect(depts);
}
/**
* 构建前端所需要树结构
*
*
* @param depts 部门列表
* @return 树结构列表
*/
@@ -90,7 +89,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 构建前端所需要下拉树结构
*
*
* @param depts 部门列表
* @return 下拉树结构列表
*/
@@ -103,7 +102,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 根据角色ID查询部门树信息
*
*
* @param roleId 角色ID
* @return 选中部门列表
*/
@@ -116,7 +115,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 根据部门ID查询信息
*
*
* @param deptId 部门ID
* @return 部门信息
*/
@@ -128,7 +127,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 根据ID查询所有子部门正常状态
*
*
* @param deptId 部门ID
* @return 子部门数
*/
@@ -140,7 +139,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 是否存在子节点
*
*
* @param deptId 部门ID
* @return 结果
*/
@@ -153,7 +152,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 查询部门是否存在用户
*
*
* @param deptId 部门ID
* @return 结果 true 存在 false 不存在
*/
@@ -166,7 +165,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 校验部门名称是否唯一
*
*
* @param dept 部门信息
* @return 结果
*/
@@ -184,7 +183,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 校验部门是否有数据权限
*
*
* @param deptId 部门id
*/
@Override
@@ -204,7 +203,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 新增保存部门信息
*
*
* @param dept 部门信息
* @return 结果
*/
@@ -223,7 +222,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 修改保存部门信息
*
*
* @param dept 部门信息
* @return 结果
*/
@@ -251,7 +250,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 修改该部门的父级部门状态
*
*
* @param dept 当前部门
*/
private void updateParentDeptStatusNormal(SysDept dept)
@@ -263,7 +262,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 修改子元素关系
*
*
* @param deptId 被修改的部门ID
* @param newAncestors 新的父ID集合
* @param oldAncestors 旧的父ID集合
@@ -283,7 +282,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 删除部门管理信息
*
*
* @param deptId 部门ID
* @return 结果
*/
@@ -335,4 +334,9 @@ public class SysDeptServiceImpl implements ISysDeptService
{
return getChildList(list, t).size() > 0;
}
@Override
public String getDeptName(String deptId){
return deptMapper.getDeptNameByDeptId(deptId);
}
}

View File

@@ -53,6 +53,18 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
return dictTypeMapper.selectDictTypeList(dictType);
}
/**
* 根据条件分页查询字典类型
*
* @param dictType 字典类型信息
* @return 字典类型集合信息
*/
@Override
public List<SysDictType> selectBizDictTypeList(SysDictType dictType)
{
return dictTypeMapper.selectBizDictTypeList(dictType);
}
/**
* 根据所有字典类型
*

View File

@@ -69,7 +69,6 @@ public class SysUserServiceImpl implements ISysUserService
* @return 用户信息集合信息
*/
@Override
@DataScope(deptAlias = "d", userAlias = "u")
public List<SysUser> selectUserList(SysUser user)
{
return userMapper.selectUserList(user);

View File

@@ -21,12 +21,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectDeptVo">
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
from sys_dept d
</sql>
<select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult">
<include refid="selectDeptVo"/>
where d.del_flag = '0'
@@ -46,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
${params.dataScope}
order by d.parent_id, d.order_num
</select>
<select id="selectDeptListByRoleId" resultType="Long">
select d.dept_id
from sys_dept d
@@ -57,36 +57,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
order by d.parent_id, d.order_num
</select>
<select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status,
(select dept_name from sys_dept where dept_id = d.parent_id) parent_name
from sys_dept d
where d.dept_id = #{deptId}
</select>
<select id="checkDeptExistUser" parameterType="Long" resultType="int">
select count(1) from sys_user where dept_id = #{deptId} and del_flag = '0'
</select>
<select id="hasChildByDeptId" parameterType="Long" resultType="int">
select count(1) from sys_dept
where del_flag = '0' and parent_id = #{deptId} limit 1
</select>
<select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult">
select * from sys_dept where find_in_set(#{deptId}, ancestors)
</select>
<select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int">
select count(*) from sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors)
</select>
<select id="checkDeptNameUnique" resultMap="SysDeptResult">
<include refid="selectDeptVo"/>
where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
</select>
<insert id="insertDept" parameterType="SysDept">
insert into sys_dept(
<if test="deptId != null and deptId != 0">dept_id,</if>
@@ -114,7 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sysdate()
)
</insert>
<update id="updateDept" parameterType="SysDept">
update sys_dept
<set>
@@ -131,7 +131,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</set>
where dept_id = #{deptId}
</update>
<update id="updateDeptChildren" parameterType="java.util.List">
update sys_dept set ancestors =
<foreach collection="depts" item="item" index="index"
@@ -144,16 +144,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{item.deptId}
</foreach>
</update>
<update id="updateDeptStatusNormal" parameterType="Long">
update sys_dept set status = '0' where dept_id in
update sys_dept set status = '0' where dept_id in
<foreach collection="array" item="deptId" open="(" separator="," close=")">
#{deptId}
</foreach>
</update>
<delete id="deleteDeptById" parameterType="Long">
update sys_dept set del_flag = '2' where dept_id = #{deptId}
</delete>
</mapper>
<select id="getDeptNameByDeptId" resultType="string" >
select dept_name from sys_dept where dept_id = #{deptId}
</select>
</mapper>

View File

@@ -40,6 +40,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
</where>
</select>
<!-- 业务字典查询方法-->
<select id="selectBizDictTypeList" parameterType="SysDictType" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>
<where>
<if test="dictName != null and dictName != ''">
AND dict_name like concat('%', #{dictName}, '%')
</if>
<if test="status != null and status != ''">
AND status = #{status}
</if>
<if test="dictType != null and dictType != ''">
AND dict_type like concat('%', #{dictType}, '%')
</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
<!-- 锁定某些字段类型 -->
AND dict_type in ('tool_type','msg_status','tool_source','tool_status','doc_class','doc_source','doc_upload_status','flow_status')
</where>
</select>
<select id="selectDictTypeAll" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>