Compare commits

...

235 Commits

Author SHA1 Message Date
wanjia9506 574ca0d845 Merge pull request '疑修列表入参丰富' (#973) from wanjia9506/microservices:dev_issues_transform into master 2025-07-30 15:04:15 +08:00
wanjia c6ac0f4a98 feat(社区版项目管理):#3676 疑修列表入参丰富 2025-07-30 15:03:05 +08:00
wanjia9506 30463e9113 Merge pull request '疑修列表接口' (#972) from wanjia9506/microservices:dev_issues_transform into master 2025-07-30 14:38:29 +08:00
wanjia 113a84b023 feat(社区版项目管理):#3676 疑修列表接口 2025-07-30 14:37:23 +08:00
wanjia9506 428af3495a Merge pull request '仓库列表、疑修列表接口' (#971) from wanjia9506/microservices:dev_issues_transform into master 2025-07-30 14:17:42 +08:00
wanjia 5122204fe8 feat(社区版项目管理):#3676 仓库列表、疑修列表接口 2025-07-30 14:16:38 +08:00
wanjia9506 bbb4e50f80 Merge pull request '查看社区疑修与项目工作项关联接口' (#970) from wanjia9506/microservices:dev_issues_transform into master 2025-07-30 11:25:34 +08:00
wanjia 987af70ec3 feat(社区版项目管理):#3676 查看社区疑修与项目工作项关联接口 2025-07-30 11:24:14 +08:00
wanjia9506 9936c21594 Merge pull request '查看社区疑修与项目工作项关联接口' (#969) from wanjia9506/microservices:dev_issues_transform into master 2025-07-30 11:01:53 +08:00
wanjia d56f171922 feat(社区版项目管理):#3676 查看社区疑修与项目工作项关联接口 2025-07-30 11:00:35 +08:00
wanjia9506 4c00fadd0c Merge pull request '转发forge评论相关接口' (#967) from wanjia9506/microservices:dev_issues_transform into master 2025-07-29 14:53:28 +08:00
wanjia d42947ad9d feat(社区版项目管理):#3676 转发forge评论相关接口 2025-07-29 14:52:22 +08:00
wanjia9506 ca80c905d5 Merge pull request '转发forge删除疑修接口' (#966) from wanjia9506/microservices:dev_issues_transform into master 2025-07-29 14:14:53 +08:00
wanjia 225b2f3a24 feat(社区版项目管理):#3676 转发forge删除疑修接口 2025-07-29 14:13:36 +08:00
wanjia9506 9d0a36f804 Merge pull request '转发forge代码库相关接口' (#961) from wanjia9506/microservices:dev_issues_transform into master 2025-07-28 16:34:04 +08:00
wanjia 1ed8d87c80 feat(社区版项目管理):#3676 转发forge代码库相关接口 2025-07-28 16:31:16 +08:00
wanjia9506 a1fdb1ed31 Merge pull request '社区版项目管理' (#960) from wanjia9506/microservices:dev_issues_transform into master 2025-07-28 14:22:51 +08:00
wanjia ef61378cc4 feat(社区版项目管理):#3676 转发forge代码库、疑修相关接口 2025-07-28 14:19:45 +08:00
wanjia 7388abeee8 feat(社区版项目管理):#3676 添加社区疑修与项目工作项关联 2025-07-28 10:38:44 +08:00
wanjia9506 7bf6b6bde0 Merge pull request '知识库名称长度修改' (#957) from wanjia9506/microservices:dev_weeklyReport_refact into master 2025-07-25 10:44:45 +08:00
wanjia 4ce61b09bf fix(项目仪表盘):#3689 知识库名称长度修改 2025-07-25 10:41:26 +08:00
wanjia9506 a2801fc599 Merge pull request '知识库日志title更改' (#954) from wanjia9506/microservices:dev_weeklyReport_refact into master 2025-07-24 15:24:18 +08:00
wanjia 2ce483f737 feat(项目仪表盘):#132587 知识库日志title更改 2025-07-24 15:22:57 +08:00
wanjia9506 8e6f27e158 Merge pull request '知识库动态添加上传文件、更新动态' (#950) from wanjia9506/microservices:dev_weeklyReport_refact into master 2025-07-24 14:36:03 +08:00
wanjia 83447dc34a feat(项目仪表盘):#132587 知识库动态添加上传文件、更新动态 2025-07-24 14:34:40 +08:00
wanjia9506 4f306a4b19 Merge pull request '工作项负责人排序+项目仪表盘中动态记录补充知识库类型' (#948) from wanjia9506/microservices:dev_weeklyReport_refact into master 2025-07-23 17:08:44 +08:00
wanjia 9b12911095 feat(项目仪表盘):#132587 加注释 2025-07-23 17:03:30 +08:00
wanjia 30daa7b00c feat(项目仪表盘):#132587 项目仪表盘中知识库类型动态转换 2025-07-23 14:21:59 +08:00
wanjia 6dc2dda918 feat(项目仪表盘):#132587 项目仪表盘中动态记录补充知识库类型 2025-07-22 16:50:33 +08:00
wanjia 3982b5dd9a feat(工作项列表):工作项负责人升序/降序 2025-07-22 11:43:08 +08:00
wanjia9506 c750f1b26e Merge pull request '修改测试用例导出内容排序' (#940) from zwz into master 2025-07-21 13:51:54 +08:00
曾威嶂 986ac5bc96 修改测试用例导出内容排序 2025-07-21 13:50:48 +08:00
wanjia9506 851cfd5599 Merge pull request '修改测试用例导出格式' (#939) from zwz into master 2025-07-21 11:22:19 +08:00
曾威嶂 d67058a2d7 修改测试用例导出表格格式 2025-07-21 11:18:02 +08:00
wanjia9506 63da653833 Merge pull request '项目周报统计加时间区间传参' (#938) from wanjia9506/microservices:dev_weeklyReport_refact into master 2025-07-21 09:52:05 +08:00
wanjia ae700d51d0 Merge remote-tracking branch 'main/master' into dev_weeklyReport_refact 2025-07-21 09:50:19 +08:00
wanjia 12c3f0be2a feat(周报):项目周报统计加时间区间传参 2025-07-21 09:39:34 +08:00
wanjia9506 d4feb0614c Merge pull request '个人周报统计加用户传参和时间区间' (#925) from wanjia9506/microservices:dev_weeklyReport_refact into master 2025-07-02 14:27:20 +08:00
wanjia cc97f13a1f feat(周报):#128808 个人周报统计加用户传参和时间区间 2025-07-02 14:25:40 +08:00
wanjia9506 1e200bf8f2 Merge pull request 'fix 测试用例导入兼容格式问题;新增部分用例导入接口' (#924) from zwz into master 2025-07-02 10:43:19 +08:00
曾威嶂 8045096c02 fix 测试用例导入兼容格式问题;新增部分用例导入接口 2025-07-02 10:39:49 +08:00
wanjia9506 3b17e0c729 Merge pull request 'feat(资源库) 区块链相关' (#918) from liuhuazhong/microservices:feat_chievements_dev into master 2025-06-24 09:05:53 +08:00
13036795865 e5698ae5c8 修复了一些bug 2025-06-23 11:22:01 +08:00
wanjia9506 0d206b0050 Merge pull request '个人周报统计加用户传参' (#916) from wanjia9506/microservices:dev_weeklyReport_refact into master 2025-06-21 14:09:34 +08:00
wanjia 7691eed48d Merge remote-tracking branch 'main/master' into dev_weeklyReport_refact 2025-06-21 14:07:46 +08:00
wanjia 9a032cb840 feat(周报):个人周报统计加用户传参 2025-06-21 14:07:30 +08:00
13036795865 93c3a48b35 修复了一些bug 2025-06-21 13:53:00 +08:00
13036795865 d8531a429a 修复了一些bug 2025-06-21 11:34:28 +08:00
13036795865 322f986170 Merge remote-tracking branch 'origin/feat_chievements_dev' into feat_chievements_dev 2025-06-21 08:58:45 +08:00
13036795865 5bdf65a200 修复了一些bug 2025-06-21 08:58:33 +08:00
刘华中 7b3023c56e fix【资源库】 修复一个bug 2025-06-20 16:34:09 +08:00
13036795865 aa593e1583 修复了一些bug 2025-06-20 09:28:03 +08:00
13036795865 987150e01d 修复了一些bug 2025-06-20 08:57:04 +08:00
13036795865 8673006247 Merge remote-tracking branch 'origin/feat_chievements_dev' into feat_chievements_dev
# Conflicts:
#	microservices-modules/microservices-modules-dms/src/main/java/com/microservices/dms/achievementLibrary/service/BlockChainService.java
2025-06-19 20:27:23 +08:00
13036795865 ce5a07c755 修复了一些bug 2025-06-19 20:25:08 +08:00
刘华中 6ae585bb5b fix【资源库】 修复一些bug 2025-06-19 15:37:39 +08:00
13036795865 7a7e5350fb bug 3353\3337\3232\3341 2025-06-18 17:01:48 +08:00
13036795865 f53c9b74f4 bug 3334\3319\3332 2025-06-18 10:13:50 +08:00
13036795865 47cb86ad7c bug 3328\3326 2025-06-17 15:35:38 +08:00
13036795865 4a07c4b8d3 bug 3327\3320\3321 2025-06-17 15:06:23 +08:00
13036795865 26f6534bc1 Merge remote-tracking branch 'origin/feat_chievements_dev' into feat_chievements_dev 2025-06-17 10:27:36 +08:00
13036795865 f3ce9cb56f bug 3321\3292\3289\3305\3294 2025-06-17 10:27:24 +08:00
wanjia9506 f51dbdccef Merge pull request '个人周报完成情况置空' (#915) from wanjia9506/microservices:dev_weeklyReport_refact into master 2025-06-16 16:59:47 +08:00
wanjia e3037b03a0 feat(周报):个人周报完成情况置空 2025-06-16 16:58:39 +08:00
刘华中 54c2216c1a fix【资源库】 修复一些bug 2025-06-16 16:47:24 +08:00
13036795865 15bab4fe0a bug 3305\3205\3230\3294 2025-06-16 10:41:15 +08:00
wanjia9506 57d4171442 Merge pull request '周报优化' (#914) from wanjia9506/microservices:dev_weeklyReport_refact into master 2025-06-16 10:05:44 +08:00
wanjia bb9a5ec58b feat(周报):#128092 个人周报完成情况查询逻辑优化 2025-06-13 09:10:51 +08:00
wanjia 506c54ef5f feat(周报):#128092 个人周报中添加工作项完成情况 2025-06-12 19:36:15 +08:00
13036795865 80ac027567 bug 3221 【资源库】每日查看专家数量为0未计数 2025-06-12 15:36:00 +08:00
13036795865 b93b249ae6 bug 3218 2025-06-11 09:17:18 +08:00
wanjia9506 6dfe866c93 Merge pull request '历史周报中个人/项目组工作项列表加时间区间入参' (#913) from wanjia9506/microservices:master into master 2025-06-09 14:35:31 +08:00
wanjia 6f7612780f Merge remote-tracking branch 'main/master' 2025-06-09 14:27:19 +08:00
wanjia c41974784b fix(周报):历史周报中个人/项目组工作项列表加时间区间入参 2025-06-09 14:26:59 +08:00
otto e8b3de286d Merge pull request '支持航天院自动伸缩功能' (#912) from otto/microservices:master into master 2025-06-07 15:10:19 +08:00
OTTO 357b4be19d feat(航天院自动伸缩功能): 打印接口请求消息 2025-06-07 14:40:44 +08:00
wanjia cf4c55877c updare README 2025-06-07 09:11:08 +08:00
wanjia9506 2f11e78844 Merge pull request '测试用例导入导出' (#911) from dev_testCase_export into master 2025-06-06 16:55:09 +08:00
wanjia9506 e78ae3c29c Merge pull request '更新需求' (#910) from zengweizhang/microservices:master into dev_testCase_export 2025-06-06 16:12:56 +08:00
zwz 60eeb05560 新增导出测试用例章节模板 2025-06-06 15:44:52 +08:00
13036795865 c0270f3f74 区块链交易信息查询 2025-06-05 20:02:29 +08:00
13036795865 7cad1a7005 区块链交易信息查询 2025-06-05 19:12:22 +08:00
13036795865 ac132e8256 区块链交易信息查询 2025-06-04 20:28:55 +08:00
wanjia9506 c001df36d8 Merge pull request '同步更新issue企业标识' (#908) from wanjia9506/microservices:dev_data_compatible_127659 into master 2025-06-04 09:03:08 +08:00
wanjia d216d3d0b8 fix(数据同步):同步更新issue企业标识 2025-06-04 08:58:29 +08:00
zengweizhang 743cb69663 Merge pull request '修复1、测试用例导出时表格章节号不对问题;2、部分章节测试用例没有导出的问题' (#906) from zengweizhang/microservices:master into dev_testCase_export 2025-06-03 08:34:22 +08:00
zwz 77381ea173 修复1、测试用例导出时表格章节号不对问题;2、部分章节测试用例没有导出的问题 2025-06-02 22:39:02 +08:00
13036795865 99073851b4 fiscobocs 接口调用需要的认证文件 2025-05-30 16:17:03 +08:00
刘华中 6cf191de76 feat【资源库-专家推荐】数据类型修改 2025-05-30 11:28:35 +08:00
zengweizhang 49bdd12ff3 Merge pull request '修复test_tracking错误' (#905) from zengweizhang/microservices:master into dev_testCase_export 2025-05-30 11:00:55 +08:00
zwz b079d42fcd 修复test_tracking错误 2025-05-30 11:00:17 +08:00
zengweizhang 1ab2d600de Merge pull request '修复test_tracking错误' (#904) from zengweizhang/microservices:master into dev_testCase_export 2025-05-30 10:46:45 +08:00
zwz 4ca5dd0c51 修复test_tracking错误 2025-05-30 10:45:54 +08:00
刘华中 cdeb638f78 feat【资源库-专家推荐】任务推荐增加状态和领域得分累加 2025-05-30 10:30:56 +08:00
zengweizhang 1f55b9878e Merge pull request '修复test_tracking错误' (#903) from zengweizhang/microservices:master into dev_testCase_export 2025-05-30 10:28:48 +08:00
zwz 34867e4580 修复test_tracking错误 2025-05-30 10:27:03 +08:00
zengweizhang 06825e82c1 Merge pull request '修复映射问题' (#902) from zengweizhang/microservices:master into dev_testCase_export 2025-05-30 09:42:38 +08:00
zwz 2f06bf137d 修复test_tracking错误 2025-05-30 09:40:26 +08:00
zengweizhang d887c6cf1b Merge pull request '获取测试用例管理详细信息 错误修复' (#901) from zengweizhang/microservices:master into dev_testCase_export 2025-05-29 19:50:20 +08:00
zwz 51fe5866e3 获取测试用例管理详细信息,用户未找到问题修复 2025-05-29 19:35:30 +08:00
wanjia9506 03abc0cf28 Merge pull request '获取测试用例管理详细信息 错误修复' (#898) from zengweizhang/microservices:master into dev_testCase_export 2025-05-29 17:21:49 +08:00
刘华中 5d1752e890 feat【资源库-数据产权子系统】增加用户列表查询接口 2025-05-29 17:00:39 +08:00
zwz 2218278c58 获取测试用例管理详细信息 错误修复 2025-05-29 16:59:06 +08:00
otto bd9382cf1c Merge pull request '新增测试用例 "测试追踪"、"是否导入" 字段,修复导入测试用例后列表刷新问题' (#895) from zengweizhang/microservices:master into dev_testCase_export 2025-05-29 15:18:08 +08:00
zwz 618b62d22d 新增测试用例 "测试追踪"、"是否导入" 字段,修复导入测试用例后列表刷新问题 2025-05-29 14:53:32 +08:00
zwz e8a6db6ac8 新增测试用例 "测试追踪"、"是否导入" 字段,修复导入测试用例后列表刷新问题 2025-05-29 14:48:42 +08:00
刘华中 70d8a56eaa fix【资源库-数据产权子系统】token分配增加数量验证 2025-05-29 10:22:25 +08:00
刘华中 9c78405699 fix【资源库-数据产权子系统】v2 2025-05-28 18:03:30 +08:00
刘华中 2724d66a09 fix【资源库-数据产权子系统】v1 2025-05-28 16:36:53 +08:00
otto 35f94f3ac5 Merge pull request '制品库支持外网访问' (#891) from dev_zpk into master 2025-05-28 16:11:02 +08:00
otto fb850bad71 Merge pull request '制品库支持外网访问' (#890) from otto/microservices:dev_zpk into dev_zpk 2025-05-28 15:54:02 +08:00
OTTO 2fef3cbc24 feat(项目管理模块): 制品库支持外网访问 2025-05-28 15:52:20 +08:00
刘华中 4044add373 Merge remote-tracking branch 'origin/feat_chievements_dev' into feat_chievements_dev 2025-05-28 15:48:14 +08:00
13036795865 1c21b04b52 成果聚类详情 2025-05-28 15:35:45 +08:00
OTTO 9786975fe1 Merge branch 'master' of code.gitlink.org.cn:Gitlink/microservices 2025-05-28 14:29:14 +08:00
刘华中 2a21d804f8 fix【资源库-成果推荐】专家推荐增加过滤条件 2025-05-28 14:22:52 +08:00
wanjia9506 dbcdb468ab Merge pull request 'fix(需求纳入计划): 计划中自动填充企业标识' (#889) from wanjia9506/microservices:dev_weeklyReport_wikiPrevision_merge into master 2025-05-28 11:04:22 +08:00
wanjia 7d16bccea8 fix(需求纳入计划): 计划中自动填充企业标识 2025-05-28 11:01:54 +08:00
wanjia9506 85913c605a Merge pull request 'wiki历史版本+周报改版' (#888) from wanjia9506/microservices:dev_weeklyReport_wikiPrevision_merge into master 2025-05-28 08:31:34 +08:00
wanjia 79136717ef Merge branch 'dev_weeklyReport_refact' into dev_weeklyReport_wikiPrevision_merge 2025-05-27 17:28:00 +08:00
wanjia 64b4c36635 Merge branch 'feat_wiki_prevision_126382' into dev_weeklyReport_wikiPrevision_merge 2025-05-27 17:27:44 +08:00
刘华中 8b70cf3815 fix【资源库-成果推荐】任务成果推荐修改 2025-05-27 17:27:15 +08:00
wanjia9506 a41c0192f2 Merge pull request '新增测试用例导入、导出功能,优化部分代码' (#887) from zengweizhang/microservices:master into dev_testCase_export 2025-05-27 16:54:12 +08:00
zwz bfa4e01372 Merge branch 'master' of https://gitlink.org.cn/Gitlink/microservices 2025-05-27 16:16:09 +08:00
zwz 72cb98c592 新增测试用例导入、导出功能,优化部分代码 2025-05-27 16:00:22 +08:00
wanjia db6b1cfe10 fix(新建项目): #127249 创建项目时关联代码仓后,项目数据新增成果后添加项目-仓库关联数据时去除项目存在性校验 2025-05-27 15:38:38 +08:00
wanjia9506 af7cd7d006 Merge pull request '【资源库-成果库】成果详情增加用户对接的时间' (#883) from liuhuazhong/microservices:feat_chievements_dev into master 2025-05-27 15:16:59 +08:00
刘华中 fa41454534 【资源库-成果库】成果详情增加用户对接的时间 2025-05-27 15:07:26 +08:00
wanjia f459e84521 Merge remote-tracking branch 'origin/dev_weeklyReport_refact' into dev_weeklyReport_refact
# Conflicts:
#	microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/PmsProjectIssuesService.java
2025-05-27 14:59:01 +08:00
wanjia 6f63a0de72 feat(周报功能重构):查看他人项目组周报权限控制去除 2025-05-27 14:56:22 +08:00
wanjia e6322835db feat(周报功能重构):周报-个人工作项列表项目信息补全 2025-05-27 14:55:36 +08:00
wanjia 0e83fa62ce feat(周报功能重构):周报-个人工作项列表 2025-05-27 14:55:35 +08:00
刘华中 5232236167 【资源库-成果库】成果详情增加用户对接的时间 2025-05-27 14:23:58 +08:00
13036795865 ce1692ac66 删除无用的方法 2025-05-27 11:50:49 +08:00
13036795865 65e66013cf 成果征集信息下载 2025-05-27 11:44:06 +08:00
13036795865 bd0b24eb1a 对接数据填充 2025-05-27 11:21:03 +08:00
13036795865 154e139f59 对接数据填充 2025-05-27 11:20:01 +08:00
13036795865 e7fb87c759 对接数据填充 2025-05-27 09:53:34 +08:00
13036795865 879133b8c7 活跃用户统计修改;资源库首页来源统计(统计上架数据) 2025-05-27 08:41:06 +08:00
wanjia9506 93185be706 Merge pull request '【资源库-成果库】详情增加用户对接数量' (#882) from liuhuazhong/microservices:feat_chievements_dev into master 2025-05-26 19:47:24 +08:00
刘华中 d5d4fa4805 【资源库-成果库】详情增加用户对接数量 2025-05-26 19:45:41 +08:00
wanjia ea2d703a5e feat(Wiki历史版本):周报-个人工作项列表 2025-05-26 19:17:29 +08:00
wanjia9506 1b8f1ea253 Merge pull request '【资源库-成果库】 一些改动' (#881) from liuhuazhong/microservices:feat_chievements_dev into master 2025-05-26 19:02:16 +08:00
刘华中 8acecc5f13 【资源库-成果库】 列表增加用户相关信息 2025-05-26 17:26:02 +08:00
wanjia 143fa631ce feat(Wiki历史版本):历史版本列表用户名显示昵称 2025-05-26 16:00:50 +08:00
13036795865 f4dd5ce278 Merge remote-tracking branch 'origin/feat_chievements_dev' into feat_chievements_dev 2025-05-26 15:52:10 +08:00
13036795865 b24412a1b3 专家实名认证率bug修改 2025-05-26 15:52:00 +08:00
wanjia e48ce7f4b0 feat(Wiki历史版本):历史版本列表用户名显示昵称 2025-05-26 15:43:55 +08:00
刘华中 7a1306929b 【资源库-成果库】 列表增加用户相关信息 2025-05-26 15:37:22 +08:00
13036795865 6e2b1f348f bug 3061、3059 修改 2025-05-26 14:36:11 +08:00
wanjia f61b11bc93 feat(周报功能重构):个人周报统计工作项列表信息补全 2025-05-26 14:18:54 +08:00
wanjia 83f86f623d feat(周报功能重构):个人周报统计工作项分页参数添加 2025-05-26 14:07:36 +08:00
13036795865 a3fc3246fc 成果字典增删查改,成果聚类分析 2025-05-26 13:58:11 +08:00
wanjia 6e7ae41dac feat(周报功能重构):补全项目名空值处理 2025-05-26 13:50:12 +08:00
13036795865 311383d2a3 成果字典增删查改,成果聚类分析 2025-05-26 11:10:37 +08:00
13036795865 5dd17b1142 成果字典增删查改,成果聚类分析 2025-05-26 11:08:23 +08:00
13036795865 7c6617626a 没有的字典值新增 2025-05-26 09:34:34 +08:00
13036795865 d815c57f12 Merge remote-tracking branch 'origin/feat_chievements_dev' into feat_chievements_dev 2025-05-26 09:03:55 +08:00
13036795865 b266bb82d6 新增成果字典管理;校企成果新增相关字段 2025-05-26 09:03:37 +08:00
刘华中 e77576f085 【资源库-成果库】一些调整 2025-05-23 16:42:22 +08:00
wanjia e9137d30ba feat(周报功能重构):周报中项目组工作项列表 2025-05-23 16:39:59 +08:00
zwz 7b1c5fe622 增加测试用例批量导出功能 2025-05-23 15:54:52 +08:00
13036795865 5ae151e360 Merge remote-tracking branch 'origin/feat_chievements_dev' into feat_chievements_dev 2025-05-23 14:28:25 +08:00
13036795865 b7b21b1f35 区块链方法常量 2025-05-23 14:28:13 +08:00
wanjia 0b69e3bafa feat(Wiki历史版本):项目层级名修正 2025-05-23 13:58:55 +08:00
刘华中 ee3d983c49 【资源库-推荐】issue\pr推荐联调改动 2025-05-23 11:17:14 +08:00
wanjia dcea028be3 feat(周报功能重构):今日待办返回是否为项目负责人 2025-05-23 10:19:38 +08:00
wanjia 5199a829f5 feat(周报功能重构):工作项列表传企业标识 2025-05-23 10:19:38 +08:00
wanjia 1354a2b7a0 feat(周报功能重构):空值处理 2025-05-23 10:19:38 +08:00
wanjia e6413d1efe feat(周报功能重构):生产个人周报时返回项目名 2025-05-22 16:26:29 +08:00
wanjia fe7c642a08 feat(周报功能重构):周报操作去除项目编号绑定 2025-05-22 14:17:28 +08:00
wanjia 3c2b288068 feat(周报功能重构):周报列表入参加企业标识 2025-05-22 11:03:00 +08:00
wanjia 71e5c84a1a feat(周报功能重构):周报个人统计、项目组统计 2025-05-22 09:57:23 +08:00
刘华中 d49f0621c8 【资源库-大屏展示】成果大屏的需求调整改动 2025-05-21 19:28:40 +08:00
13036795865 f05d5cf548 Merge remote-tracking branch 'origin/feat_chievements_dev' into feat_chievements_dev 2025-05-21 17:04:14 +08:00
13036795865 6faba9a9c5 专家评审数据排序 2025-05-21 17:03:33 +08:00
刘华中 d6141fe73d 【资源库-大屏展示】成果大屏的需求调整改动 2025-05-21 16:48:32 +08:00
刘华中 fd54700340 Merge remote-tracking branch 'origin/feat_chievements_dev' into feat_chievements_dev 2025-05-21 16:43:21 +08:00
13036795865 b429ce6563 根据用户id查询用户收藏、点赞、关注的数据 2025-05-21 16:28:37 +08:00
13036795865 618e3a7731 专家领域去掉为空数据 2025-05-21 15:00:10 +08:00
刘华中 73ba9c53e7 Merge remote-tracking branch 'origin/feat_chievements_dev' into feat_chievements_dev 2025-05-21 14:59:13 +08:00
刘华中 611b59a533 Merge remote-tracking branch 'origin/feat_chievements_dev' into feat_chievements_dev 2025-05-21 14:54:06 +08:00
13036795865 de64d3c4c6 Merge remote-tracking branch 'origin/feat_chievements_dev' into feat_chievements_dev 2025-05-21 14:51:55 +08:00
13036795865 070a404685 成果聚类 2025-05-21 14:51:29 +08:00
刘华中 7f54998e61 【资源库-推荐管理】开源竞赛评审专家推荐 2025-05-20 17:08:38 +08:00
刘华中 79e05c109c 【资源库-推荐管理】创客任务评审专家推荐 2025-05-20 14:56:27 +08:00
xxq250 562469eccb Merge pull request '根据项目ID查询所属组织标识,取消权限拦截,手动注入上下文' (#876) from xxq250/microservices:master into master 2025-05-20 11:18:51 +08:00
刘华中 99952b884f 【资源库-推荐管理】创客任务成果推荐 2025-05-20 11:15:09 +08:00
xxq250 911aae3355 Merge pull request '根据项目ID查询所属组织标识,取消权限拦截' (#875) from xxq250/microservices:master into master 2025-05-20 10:32:29 +08:00
xxq250 743f799e86 Merge pull request '根据项目ID查询所属组织标识,取消权限拦截' (#874) from xxq250/microservices:master into master 2025-05-20 10:26:46 +08:00
xxq250 43946c05f1 Merge pull request 'fixed 根据项目ID查询所属组织标识' (#873) from xxq250/microservices:master into master 2025-05-20 10:09:21 +08:00
xxq250 b2d3d413be Merge pull request 'fixed 工作项增加企业标识' (#872) from xxq250/microservices:master into master 2025-05-20 09:51:39 +08:00
刘华中 900122d258 【资源库-推荐管理】推荐相关逻辑修改 2025-05-20 08:31:45 +08:00
刘华中 f6e0b6083a feat: 【资源库-推荐管理】完成创客任务成果推荐后端V1 2025-05-17 16:12:16 +08:00
wanjia9506 8f3331c079 Merge pull request 'dss:已支付金额以万为单位' (#871) from wanjia9506/microservices:dev_data_statistics into master 2025-05-17 14:34:06 +08:00
刘华中 0297b476eb 【资源库-成果管理】统计优质专家时需要优化SQL、需要记录创建人,校企成果列表仅展示当前用户创建的数据 2025-05-17 10:39:50 +08:00
刘华中 10e80dbf49 feat【资源库】首页统计增加上下架的过滤 2025-05-17 09:46:35 +08:00
13036795865 f1da2939c6 领域排序 2025-05-17 09:32:59 +08:00
13036795865 a3542daa9f 专家统计优化 2025-05-17 09:29:46 +08:00
wanjia 405cc2da3e feat(创客空间全局资源获取):已支付金额以万为单位 2025-05-17 08:38:26 +08:00
wanjia 4cef9d6a44 feat(创客空间全局资源获取):已支付金额以万为单位 2025-05-17 08:17:31 +08:00
wanjia9506 c28381b7bc Merge pull request '已支付金额以万为单位' (#870) from wanjia9506/microservices:dev_data_statistics into master 2025-05-17 08:14:48 +08:00
刘华中 ee97b24e51 feat【资源库】创客成果数统计SQL错误、【资源库】参与评审竞赛数统计错误 2025-05-16 16:26:10 +08:00
13036795865 fad993e486 Merge remote-tracking branch 'origin/feat_chievements_dev' into feat_chievements_dev 2025-05-16 14:13:29 +08:00
13036795865 11e8f2efb9 帖子原创非原创 2025-05-16 14:00:09 +08:00
刘华中 a708082d1e feat【资源库】竞赛和创客任务:相关成果展示、专家:专家审核数据展示 2025-05-15 16:46:13 +08:00
13036795865 4d7bb9184a Merge remote-tracking branch 'origin/feat_chievements_dev' into feat_chievements_dev 2025-05-15 16:42:45 +08:00
13036795865 aaf956a352 活跃用户:项目、任务、竞赛不同时为0的数据 2025-05-15 16:42:35 +08:00
xxq250 1bf0146cc5 Merge pull request 'issue add statusMsg' (#869) from xxq250/microservices:master into master 2025-05-15 15:56:11 +08:00
刘华中 4b97dd9521 fix 【资源库】 sql字段匹配 2025-05-15 11:08:36 +08:00
13036795865 855c2e9e53 资源库前端成果名称查询 2025-05-14 20:57:08 +08:00
13036795865 f2d1fc350d Merge remote-tracking branch 'origin/feat_chievements_dev' into feat_chievements_dev 2025-05-14 20:50:37 +08:00
13036795865 5e3ccaf4e7 专家性别获取 2025-05-14 20:50:26 +08:00
刘华中 e69a54033e fix 【资源库】 专家详情页的7天成果每日浏览折线图接口调整 2025-05-14 20:36:33 +08:00
13036795865 0429fe5ab7 资源库前端展示成果名称 2025-05-14 20:04:22 +08:00
13036795865 876cdd9eed 资源库前端展示成果名称 2025-05-14 19:55:25 +08:00
13036795865 1d8b646876 资源库前端展示成果名称 2025-05-14 19:40:32 +08:00
13036795865 3ea6352091 Merge remote-tracking branch 'origin/feat_chievements_dev' into feat_chievements_dev 2025-05-14 19:21:24 +08:00
13036795865 bd89d8bbc9 资源库前端展示成果名称 2025-05-14 19:21:12 +08:00
13036795865 06b334e782 资源库前端展示成果名称 2025-05-14 19:21:00 +08:00
刘华中 99c4842442 fix 【资源库】过滤 2025-05-14 19:07:04 +08:00
13036795865 31da182157 获取热门成果的人员图片和信息 2025-05-14 10:53:32 +08:00
13036795865 7707757ac4 swagger添加注释 2025-05-13 15:50:32 +08:00
13036795865 4d08c973fe 数据仓库上下架 2025-05-13 11:34:54 +08:00
13036795865 cca9296f5b Merge remote-tracking branch 'origin/feat_chievements_dev' into feat_chievements_dev 2025-05-13 11:14:52 +08:00
13036795865 f6eb2f9901 如果登录人为空获取对应负责人的值 2025-05-13 11:14:38 +08:00
wanjia 6f7d969ce9 feat(Wiki历史版本):wiki历史版本列表及历史版本详情 2025-05-13 10:46:07 +08:00
liuhuazhong 9d6bbe5785 fix 【资源库】图片地址拼接 2025-05-12 17:06:49 +08:00
OTTO 992a07f154 feat(项目管理知识库优化): 知识库直接创建的文档需要能下载
Signed-off-by: OTTO <731554297@qq.com>
2025-04-09 14:33:26 +08:00
OTTO 94061dc01c Merge branch 'third-party-tool-forward' of code.gitlink.org.cn:Gitlink/microservices 2025-04-07 14:37:52 +08:00
otto 713104e353 Merge pull request 'feat(微服务治理工具): 优化portainer转发逻辑' (#836) from otto/microservices:third-party-tool-forward into third-party-tool-forward 2025-03-07 11:04:59 +08:00
otto 05533c9475 Merge pull request '当Nacos返回异常状态码时,且body数据类型为JSON时,从JSON中取出message字段作为异常响应信息,若不存在该字段则返回默认的错误信息' (#835) from otto/microservices:third-party-tool-forward into third-party-tool-forward 2025-03-07 08:52:29 +08:00
otto 63e9d65b60 Merge pull request 'feat(微服务治理工具): 登录状态异常拦截处理' (#834) from otto/microservices:third-party-tool-forward into third-party-tool-forward 2025-03-06 16:48:57 +08:00
otto 103beae4d8 Merge pull request '限制仅当异常响应时才对错误信息进行标准化处理' (#832) from otto/microservices:third-party-tool-forward into third-party-tool-forward 2025-02-25 10:38:09 +08:00
otto edb5e65035 Merge pull request '当请求为Nacos时,Nacos返回的所有非JSON响应都会被自动转换为结构化的错误信息,同时将HTTP状态码设置为200,适合用于规范化微服务架构的响应格式。' (#831) from otto/microservices:third-party-tool-forward into third-party-tool-forward 2025-02-24 17:02:22 +08:00
174 changed files with 8669 additions and 504 deletions

View File

@ -0,0 +1,36 @@
## 系统模块
~~~
com.microservices
├── microservices-ui // 前端框架
├── microservices-gateway // 网关模块
├── microservices-auth // 认证中心
├── microservices-api // 接口模块
│ └── microservices-api-system // 系统接口
├── microservices-common // 通用模块
│ └── microservices-common-async // 异步线程池配置
│ └── microservices-common-core // 核心模块
│ └── microservices-common-datascope // 权限范围
│ └── microservices-common-datasource // 多数据源
│ └── microservices-common-httpClient // http调用
│ └── microservices-common-log // 日志记录
│ └── microservices-common-redis // 缓存服务
│ └── microservices-common-seata // seata分布式事务
│ └── microservices-common-security // 安全模块
│ └── microservices-common-swagger // 系统接口
├── microservices-modules // 业务模块
│ └── microservices-cms // 内容管理模块
│ └── microservices-dms // 数据管理体系模块
│ └── microservices-dss // 数据统计系统模块
│ └── microservices-file // 文件服务
│ └── microservices-gen // 代码生成
│ └── microservices-job // 定时任务
│ └── microservices-pms // 项目管理系统模块
│ └── microservices-system // 系统模块
│ └── microservices-wiki // Wiki模块
│ └── microservices-zone // 特色专区系统模块
├── microservices-visual // 图形化管理模块
│ └── microservices-visual-monitor // 监控中心
├──pom.xml // 公共依赖
~~~

View File

@ -7,9 +7,9 @@ import com.microservices.system.api.domain.SysLogininfor;
import com.microservices.system.api.domain.SysOperLog;
import com.microservices.system.api.factory.RemoteLogFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 日志服务
@ -38,4 +38,20 @@ public interface RemoteLogService
*/
@PostMapping("/logininfor")
public R<Boolean> saveLogininfor(@RequestBody SysLogininfor sysLogininfor, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/**
* 获取操作日志列表
*
* @param title 日志标题
* @param operUrl 操作地址
* @param status 操作状态
* @param topN 获取最新N条
* @return 操作日志列表
*/
@GetMapping("/operlog/latest")
R<List<SysOperLog>> getLatestOperLogList(@RequestParam(value = "title", required = false) String title,
@RequestParam(value = "operUrl", required = false) String operUrl,
@RequestParam(value = "status", required = false) Integer status,
@RequestParam(value = "topN") Integer topN,
@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}

View File

@ -9,6 +9,8 @@ import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* 日志服务降级处理
*
@ -36,6 +38,12 @@ public class RemoteLogFallbackFactory implements FallbackFactory<RemoteLogServic
{
return null;
}
@Override
public R<List<SysOperLog>> getLatestOperLogList(String title, String operUrl, Integer status, Integer topN, String source)
{
return R.fail("获取最新操作日志失败:" + throwable.getMessage());
}
};
}

View File

@ -26,6 +26,8 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
public static String YYYY_MM_DD_HH_MM = "yyyy-MM-dd HH:mm";
private static String[] parsePatterns = {
"yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
"yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
@ -265,4 +267,9 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
cal.add(Calendar.DATE, -7 * times);
return DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, cal.getTime());
}
public static long dateTimeToUnix(Date date) {
// date.getTime() 返回当前 Date 对象表示的毫秒数除以 1000 后得到以秒为单位的时间戳 10 位时间戳
return date.getTime() / 1000;
}
}

View File

@ -0,0 +1,125 @@
package com.microservices.dms.achievementLibrary.controller;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.microservices.common.core.utils.StringUtils;
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
import com.microservices.system.api.domain.SysDictData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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.microservices.common.log.annotation.Log;
import com.microservices.common.log.enums.BusinessType;
import com.microservices.common.security.annotation.RequiresPermissions;
import com.microservices.dms.achievementLibrary.domain.AchievementDictData;
import com.microservices.dms.achievementLibrary.service.IAchievementDictDataService;
import com.microservices.common.core.web.controller.BaseController;
import com.microservices.common.core.web.domain.AjaxResult;
import com.microservices.common.core.utils.poi.ExcelUtil;
import com.microservices.common.core.web.page.TableDataInfo;
/**
* 成果相关字典Controller
*
* @author microservices
* @date 2025-05-23
*/
@Api(tags = "数据管理体系-成果字典管理")
@RestController
@RequestMapping("/achDict")
public class AchievementDictDataController extends BaseController
{
@Autowired
private IAchievementDictDataService achievementDictDataService;
/**
* 查询成果相关字典列表
*/
@GetMapping("/list")
public TableDataInfo list(AchievementDictData achievementDictData)
{
startPage();
List<AchievementDictData> list = achievementDictDataService.selectAchievementDictDataList(achievementDictData);
return getDataTable(list);
}
/**
* 导出成果相关字典列表
*/
@Log(title = "成果相关字典", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, AchievementDictData achievementDictData)
{
List<AchievementDictData> list = achievementDictDataService.selectAchievementDictDataList(achievementDictData);
ExcelUtil<AchievementDictData> util = new ExcelUtil<AchievementDictData>(AchievementDictData.class);
util.exportExcel(response, list, "成果相关字典数据");
}
/**
* 获取成果相关字典详细信息
*/
@GetMapping(value = "/{dictCode}")
public AjaxResult getInfo(@PathVariable("dictCode") Long dictCode)
{
return success(achievementDictDataService.selectAchievementDictDataByDictCode(dictCode));
}
/**
* 新增成果相关字典
*/
@Log(title = "成果相关字典", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody AchievementDictData achievementDictData)
{
return toAjax(achievementDictDataService.insertAchievementDictData(achievementDictData));
}
/**
* 修改成果相关字典
*/
@Log(title = "成果相关字典", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody AchievementDictData achievementDictData)
{
return toAjax(achievementDictDataService.updateAchievementDictData(achievementDictData));
}
/**
* 删除成果相关字典
*/
@Log(title = "成果相关字典", businessType = BusinessType.DELETE)
@DeleteMapping("/{dictCodes}")
public AjaxResult remove(@PathVariable Long[] dictCodes)
{
return toAjax(achievementDictDataService.deleteAchievementDictDataByDictCodes(dictCodes));
}
/**
* 根据字典类型查询字典数据信息
*/
@ApiOperation("根据成果字典分类查询成果值")
@GetMapping(value = "/getDictDateByType")
public AjaxResult getDictDateByType(String dictType)
{
List<KeyValueVo> data = achievementDictDataService.selectDictDataByType(dictType);
return success(data);
}
@ApiOperation("根据成果字典分类")
@GetMapping(value = "/getDictTypes")
public AjaxResult getDictTypes()
{
List<String> data = achievementDictDataService.getDictTypes();
return success(data);
}
}

View File

@ -86,6 +86,13 @@ public class AchievementsController extends BaseController {
return toAjax(achievementsService.deleteAchievementsByIds(ids));
}
@ApiOperation("删除成果数据")
@DeleteMapping("/deleteById")
public AjaxResult deleteById(Long id) {
return toAjax(achievementsService.deleteAchievementsById(id));
}
/**
* 获取精选成果
*
@ -210,8 +217,17 @@ public class AchievementsController extends BaseController {
}
@ApiOperation("根据成果ID获取近7日成果点击数量折线图")
@GetMapping("/get7AddClickById")
public AjaxResult get7AddClickById(String id) {
return success(achievementsService.get7AddClickById(id));
public AjaxResult get7AddClickById(String id,@RequestParam(value = "clickType",required = false, defaultValue = "Achievements")
String clickType) {
return success(achievementsService.get7AddClickById(id,clickType));
}
@ApiOperation("根据专家id获取近7日成果点击数量折线图")
@GetMapping("/getExpert7AddClickById")
public AjaxResult getExpert7AddClickById(String id,@RequestParam(value = "clickType",required = false, defaultValue = "Experts")
String clickType) {
return success(achievementsService.get7AddClickById(id,clickType));
}
@ApiOperation("根据成果ID,获取成果的相关行为数据统计(点击量、搜索量、附件下载量、收藏、关注)")
@ -219,16 +235,31 @@ public class AchievementsController extends BaseController {
public AjaxResult getActDataStatisticById(Long id) {
return success(achievementsService.getActDataStatisticById(id));
}
/**
* 根据领域将成果数据进行分类
*
*/
@ApiOperation("根据领域来源、领域分类名称,获取领域相关数据")
@GetMapping("/getAllAreas")
public AjaxResult getAllAreas(String areaName) {
return success(achievementsService.getAllAreas(areaName));
}
@ApiOperation("根据领域,将成果数据进行分类")
@GetMapping("/getAreaStatistic")
public AjaxResult getAreaStatistic(String areaKey)
{
return success(achievementsService.getAreaStatistic(areaKey));
}
@ApiOperation("根据领域获取领域详情")
@GetMapping("/getAreaDetail")
public AjaxResult getAreaDetail(String areaKey,String kyxmSum,String source)
{
return success(achievementsService.getAreaDetail(areaKey,kyxmSum,source));
}
/**
* 获取开源项目的相关成果
*/
@ -239,10 +270,41 @@ public class AchievementsController extends BaseController {
return success(achievementsService.getRelatedAch(id,sourceId));
}
@ApiOperation(value = "获取开源竞赛的相关成果")
@GetMapping("/getRelatedAchCompetition")
public AjaxResult getRelatedAchCompetition(Long id,Long sourceId)
{
return success(achievementsService.getRelatedAchCompetition(id,sourceId));
}
@ApiOperation(value = "获取创客任务的相关成果")
@GetMapping("/getRelatedAchTask")
public AjaxResult getRelatedAchTask(Long id,Long sourceId)
{
return success(achievementsService.getRelatedAchTask(id,sourceId));
}
@ApiOperation(value = "获取专家-创客任务的相关成果")
@GetMapping("/getRelatedAchTaskOfExpert")
public AjaxResult getRelatedAchTaskOfExpert(Long expertId)
{
return success(achievementsService.getRelatedAchTaskOfExpert(expertId));
}
@ApiOperation(value = "获取专家-开源竞赛的相关成果")
@GetMapping("/getRelatedAchCompetitionOfExpert")
public AjaxResult getRelatedAchCompetitionOfExpert(Long expertId)
{
return success(achievementsService.getRelatedAchCompetitionOfExpert(expertId));
}
@ApiOperation(value = "搜索行为数据记录")
@GetMapping("/getSearchResult")
public AjaxResult getSearchResult(String achName,Long userId)
{
return success(achievementsService.getSearchResult(achName,userId));
}
}

View File

@ -0,0 +1,116 @@
package com.microservices.dms.achievementLibrary.controller;
import com.microservices.common.core.web.controller.BaseController;
import com.microservices.common.core.web.domain.AjaxResult;
import com.microservices.common.core.web.page.TableDataInfo;
import com.microservices.dms.achievementLibrary.domain.BlockchainListQueryVo;
import com.microservices.dms.achievementLibrary.domain.TokenListVo;
import com.microservices.dms.achievementLibrary.domain.blockchain.InBlockchainData;
import com.microservices.dms.achievementLibrary.domain.blockchain.InLinkProjectVo;
import com.microservices.dms.achievementLibrary.domain.blockchain.UserVo;
import com.microservices.dms.achievementLibrary.service.BlockChainService;
import com.microservices.dms.achievementLibrary.service.InBlockchainDataServiceImpl;
import com.microservices.dms.common.vo.UserCreateVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/blockChain")
@Api(tags = "数据管理体系-数据产权子系统")
public class BlockChainController extends BaseController {
@Autowired
private BlockChainService blockChainService;
@Autowired
private InBlockchainDataServiceImpl inBlockchainDataService;
@GetMapping("/projectTokenList")
@ApiOperation(value = "项目token列表")
public TableDataInfo projectTokenList(String projectName) {
startPage();
List<TokenListVo> list = blockChainService.projectTokenList(projectName);
return getDataTable(list);
}
@GetMapping("/projectTokenDistribute")
@ApiOperation(value = "项目token分配、点击token分配按钮弹出框展示相关数据项目名称、分配token、被分配人")
public AjaxResult projectTokenDistribute(InLinkProjectVo projectVo) {
return blockChainService.projectTokenDistribute(projectVo);
}
@GetMapping("/issueDataList")
@ApiOperation(value = "入链issue列表")
public TableDataInfo issueDataList(BlockchainListQueryVo queryVo) {
startPage();
List<Map<String, Object>> list = blockChainService.issueDataList(queryVo);
return getDataTable(list);
}
@GetMapping("/commitDataList")
@ApiOperation(value = "入链commit列表")
public TableDataInfo commitDataList(BlockchainListQueryVo queryVo) {
startPage();
List<Map<String, Object>> list = blockChainService.commitDataList(queryVo);
return getDataTable(list);
}
@GetMapping("/prDataList")
@ApiOperation(value = "入链PR列表")
public TableDataInfo prDataList(BlockchainListQueryVo queryVo) {
startPage();
List<Map<String, Object>> list = blockChainService.prDataList(queryVo);
return getDataTable(list);
}
@GetMapping("/userDataList")
@ApiOperation(value = "入链user列表")
public TableDataInfo userDataList(BlockchainListQueryVo queryVo) {
startPage();
List<Map> list = blockChainService.userDataList(queryVo);
return getDataTable(list);
}
@GetMapping("/userList")
@ApiOperation(value = "用户列表列表")
public TableDataInfo userList(UserVo userVo) {
startPage();
List<UserVo> list = blockChainService.userList(userVo);
return getDataTable(list);
}
@GetMapping("/InBlockchainDataList")
@ApiOperation(value = "查询区块链数据入链列表")
public TableDataInfo list(InBlockchainData inBlockchainData) {
startPage();
List<InBlockchainData> list = inBlockchainDataService.selectInBlockchainDataList(inBlockchainData);
return getDataTable(list);
}
@ApiOperation("提供入链项目信息查询")
@GetMapping("/queryBlockInfo")
public AjaxResult queryBlockInfo (String type,String typeId) {
return blockChainService.queryBlockInfo(type,typeId);
}
@ApiOperation("根据项目id获取用户对应的token")
@GetMapping("/getUserTokenByProjectId")
public AjaxResult getUserTokenByProjectId (String type,String userName,String tokenName) {
return blockChainService.getUserTokenByProjectId(type,userName,tokenName);
}
@ApiOperation("获取用户对应的所有项目token")
@GetMapping("/getUserAllProjectToken")
public AjaxResult getUserAllProjectToken (String userName) {
return blockChainService.getUserAllProjectToken(userName);
}
}

View File

@ -0,0 +1,51 @@
package com.microservices.dms.achievementLibrary.controller;
import com.microservices.common.core.web.domain.AjaxResult;
import com.microservices.dms.achievementLibrary.service.BlockChainService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("/blockFisco")
@Api(tags = "数据管理体系-数据产权入链交易")
public class BlockFiscoController {
@Autowired
private BlockChainService blockChainService;
@GetMapping("/getTransactionByHash")
@ApiOperation(value = "通过交易哈希获取交易详情")
public AjaxResult getTransactionByHash(String txHash) {
return AjaxResult.success(blockChainService.getTransactionByHash(txHash));
}
@ApiOperation(value = "交易哈希获取交易回执")
@GetMapping("/getTransactionReceipt")
public AjaxResult getTransactionReceipt(String txHash) {
return AjaxResult.success(blockChainService.getTransactionReceipt(txHash));
}
@ApiOperation(value = "获取最新区块号")
@GetMapping("/blockNumber")
public AjaxResult getBlockNumber() {
return AjaxResult.success(blockChainService.getBlockNumber());
}
@ApiOperation(value = "获取区块链总交易数")
@GetMapping("/getTotalTransactionCount")
public AjaxResult getTotalTransactionCount() {
return AjaxResult.success(blockChainService.getTotalTransactionCount());
}
}

View File

@ -37,7 +37,7 @@ public class ExpertDashboardController {
}
@GetMapping(value = "getExpertAduit")
@ApiOperation(value = "近一年专家评审作品数")
@ApiOperation(value = "专家评审作品数排序")
public AjaxResult getExpertAduit() {
return AjaxResult.success(expertDashboardService.getExpertAduit());
}

View File

@ -36,25 +36,25 @@ public class MemoDashboardController {
return AjaxResult.success(memoDashboardService.getMemoTotalByYear());
}
@GetMapping(value = "getForumSectionStatistic(")
@GetMapping(value = "getForumSectionStatistic")
@ApiOperation(value = "帖子分类")
public AjaxResult getForumSectionStatistic() {
return AjaxResult.success(memoDashboardService.getForumSectionStatistic());
}
@GetMapping(value = "getAddMemoStatistic(")
@GetMapping(value = "getAddMemoStatistic")
@ApiOperation(value = "近一年新增帖子数")
public AjaxResult getAddMemoStatistic() {
return AjaxResult.success(memoDashboardService.getAddMemoStatistic());
}
@GetMapping(value = "getTop5Memos(")
@GetMapping(value = "getTop5Memos")
@ApiOperation(value = "年度帖子热度top5")
public AjaxResult getTop5Memos() {
return AjaxResult.success(memoDashboardService.getTop5Memos());
}
@GetMapping(value = "get7DayPaise(")
@GetMapping(value = "get7DayPaise")
@ApiOperation(value = "近7日帖子点赞数")
public AjaxResult get7DayPaise() {
return AjaxResult.success(memoDashboardService.get7DayPaise());

View File

@ -43,6 +43,17 @@ public class SchoolEnterpriseAchievementsController extends BaseController
return getDataTable(list);
}
/**
* 查询校企成果列表
*/
@GetMapping("/listFront")
public TableDataInfo listFront(SchoolEnterpriseAchievements schoolEnterpriseAchievements)
{
startPage();
List<SchoolEnterpriseAchievements> list = schoolEnterpriseAchievementsService.listFront(schoolEnterpriseAchievements);
return getDataTable(list);
}
/**
* 导出校企成果列表
*/

View File

@ -0,0 +1,15 @@
package com.microservices.dms.achievementLibrary.domain;
import lombok.Data;
import java.util.List;
@Data
public class AchDetailVo {
private List<Achievements> achievementsList;
private long clickSum;
private long dockSum;
private long favoriteSum;
private long watcherSum;
private String remark;
}

View File

@ -6,6 +6,7 @@ public class AchQueryVo {
private String source;//来源
private String achievementName;//名称
private Long userId;
private String showAchievementName;
public String getAreaQuery() {
return areaQuery;
}
@ -29,4 +30,20 @@ public class AchQueryVo {
public void setAchievementName(String achievementName) {
this.achievementName = achievementName;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getShowAchievementName() {
return showAchievementName;
}
public void setShowAchievementName(String showAchievementName) {
this.showAchievementName = showAchievementName;
}
}

View File

@ -9,6 +9,7 @@ public class AchRelatedVo {
private String source;
private Long sourceId;
private String achRelateName;
private String showAchievementName;
public Long getId() {
return id;
@ -73,4 +74,12 @@ public class AchRelatedVo {
public void setAchRelateName(String achRelateName) {
this.achRelateName = achRelateName;
}
public String getShowAchievementName() {
return showAchievementName;
}
public void setShowAchievementName(String showAchievementName) {
this.showAchievementName = showAchievementName;
}
}

View File

@ -0,0 +1,112 @@
package com.microservices.dms.achievementLibrary.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.microservices.common.core.annotation.Excel;
import com.microservices.common.core.web.domain.BaseEntity;
/**
* 成果相关字典对象 achievement_dict_data
*
* @author microservices
* @date 2025-05-23
*/
public class AchievementDictData extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 字典编码 */
private Long dictCode;
/** 字典排序 */
@Excel(name = "字典排序")
private Integer dictSort;
/** 字典标签 */
@Excel(name = "字典标签")
private String dictLabel;
/** 字典键值 */
@Excel(name = "字典键值")
private String dictValue;
/** 字典类型 */
@Excel(name = "字典类型")
private String dictType;
/** 状态0正常 1停用 */
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
private String status;
public void setDictCode(Long dictCode)
{
this.dictCode = dictCode;
}
public Long getDictCode()
{
return dictCode;
}
public void setDictSort(Integer dictSort)
{
this.dictSort = dictSort;
}
public Integer getDictSort()
{
return dictSort;
}
public void setDictLabel(String dictLabel)
{
this.dictLabel = dictLabel;
}
public String getDictLabel()
{
return dictLabel;
}
public void setDictValue(String dictValue)
{
this.dictValue = dictValue;
}
public String getDictValue()
{
return dictValue;
}
public void setDictType(String dictType)
{
this.dictType = dictType;
}
public String getDictType()
{
return dictType;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("dictCode", getDictCode())
.append("dictSort", getDictSort())
.append("dictLabel", getDictLabel())
.append("dictValue", getDictValue())
.append("dictType", getDictType())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@ -2,6 +2,7 @@ package com.microservices.dms.achievementLibrary.domain;
import java.util.Date;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
@ -29,6 +30,10 @@ public class Achievements extends BaseEntity {
*/
@Excel(name = "成果名称")
private String achievementName;
/**
* 成果展示名称
*/
private String showAchievementName;
/**
* 成果领域1
@ -171,9 +176,18 @@ public class Achievements extends BaseEntity {
@Excel(name = "成果附件")
private String attachments;
//成果小类
private String ext1;
//成果状态
private String ext2;
//成果团队名称
private String ext3;
private Long clickSum;
private Long watcherSum;
private Long favoriteSum;
private Long dockSum;
private String filedDesc;
private Float hotRank;
private Long attachmentCount;
private Integer isExpertAudit;
@ -181,6 +195,63 @@ public class Achievements extends BaseEntity {
private String userNickName;
public String gender;
private String userLogin;
private List<Map<String,Object>> dockingUserInfo;
public String getExt1() {
return ext1;
}
public void setExt1(String ext1) {
this.ext1 = ext1;
}
public String getExt2() {
return ext2;
}
public void setExt2(String ext2) {
this.ext2 = ext2;
}
public String getExt3() {
return ext3;
}
public void setExt3(String ext3) {
this.ext3 = ext3;
}
public List<Map<String, Object>> getDockingUserInfo() {
return dockingUserInfo;
}
public void setDockingUserInfo(List<Map<String, Object>> dockingUserInfo) {
this.dockingUserInfo = dockingUserInfo;
}
public String getFiledDesc() {
return filedDesc;
}
public void setFiledDesc(String filedDesc) {
this.filedDesc = filedDesc;
}
public Long getDockSum() {
return dockSum;
}
public void setDockSum(Long dockSum) {
this.dockSum = dockSum;
}
public String getShowAchievementName() {
return showAchievementName;
}
public void setShowAchievementName(String showAchievementName) {
this.showAchievementName = showAchievementName;
}
public String getUserImg() {
return userImg;
@ -480,38 +551,4 @@ public class Achievements extends BaseEntity {
return attachments;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("achievementName", getAchievementName())
.append("field1", getField1())
.append("field2", getField2())
.append("field3", getField3())
.append("achievementType", getAchievementType())
.append("source", getSource())
.append("sourceId", getSourceId())
.append("sourceLink", getSourceLink())
.append("tags", getTags())
.append("summary", getSummary())
.append("publishingUnit", getPublishingUnit())
.append("address", getAddress())
.append("isFeatured", getIsFeatured())
.append("contactPerson", getContactPerson())
.append("contactNumber", getContactNumber())
.append("ownerId", getOwnerId())
.append("ownerName", getOwnerName())
.append("status", getStatus())
.append("details", getDetails())
.append("reviewer", getReviewer())
.append("reviewDate", getReviewDate())
.append("reviewComments", getReviewComments())
.append("images", getImages())
.append("attachments", getAttachments())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -15,6 +15,15 @@ public class AreaStatisticVo {
private Long kfjsSum;
//校企成果汇总
private Long xqcgSum;
private String source;
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public String getAreaName() {
return areaName;

View File

@ -0,0 +1,12 @@
package com.microservices.dms.achievementLibrary.domain;
import lombok.Data;
@Data
public class BlockchainListQueryVo {
private String projectName;
private String issueName;
private String prName;
private String userName;
private Long userId;
}

View File

@ -0,0 +1,95 @@
package com.microservices.dms.achievementLibrary.domain;
public class HotAchVo {
private int watcher;
private int faviter;
private int total;
private String gender;
private String name;
private String showAchievementName;
private Long id;
private String userNickName;
private String userName;
private String userImg;
public String getUserImg() {
return userImg;
}
public void setUserImg(String userImg) {
this.userImg = userImg;
}
public int getWatcher() {
return watcher;
}
public void setWatcher(int watcher) {
this.watcher = watcher;
}
public int getFaviter() {
return faviter;
}
public void setFaviter(int faviter) {
this.faviter = faviter;
}
public int getTotal() {
return total;
}
public void setTotal(int total) {
this.total = total;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUserNickName() {
return userNickName;
}
public void setUserNickName(String userNickName) {
this.userNickName = userNickName;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getShowAchievementName() {
return showAchievementName;
}
public void setShowAchievementName(String showAchievementName) {
this.showAchievementName = showAchievementName;
}
}

View File

@ -1,6 +1,7 @@
package com.microservices.dms.achievementLibrary.domain;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
@ -145,8 +146,8 @@ public class SchoolEnterpriseAchievements extends BaseEntity {
/**
* 成果审核时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "成果审核时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "成果审核时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date reviewDate;
/**
@ -167,6 +168,46 @@ public class SchoolEnterpriseAchievements extends BaseEntity {
@Excel(name = "成果附件")
private String attachments;
private Integer achievementStatus;
//成果小类型
private String achievementLittleType;
//成果状态
private String achievementCurStatus;
//团队名称
private String teamName;
private List<AchievementTeam> teamList;
public List<AchievementTeam> getTeamList() {
return teamList;
}
public void setTeamList(List<AchievementTeam> teamList) {
this.teamList = teamList;
}
public String getTeamName() {
return teamName;
}
public void setTeamName(String teamName) {
this.teamName = teamName;
}
public String getAchievementLittleType() {
return achievementLittleType;
}
public void setAchievementLittleType(String achievementLittleType) {
this.achievementLittleType = achievementLittleType;
}
public String getAchievementCurStatus() {
return achievementCurStatus;
}
public void setAchievementCurStatus(String achievementCurStatus) {
this.achievementCurStatus = achievementCurStatus;
}
public Integer getAchievementStatus() {
return achievementStatus;

View File

@ -0,0 +1,24 @@
package com.microservices.dms.achievementLibrary.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
@Data
public class TokenListVo {
private Long id; // 项目ID
private String name; // 项目名称
private String userId;//用户id
private Long totalToken; // 项目总Token
private String createBy; // 创建人
private Long issueToken;//issueToken
private Long currentToken; // 当前Token
private String repositoryName; // 仓库名称
private Long repositoryId; // 仓库名称
private Long applyToken;//已分配token
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createdOn; // 项目创建时间
private Long ableApplyToken;//责任人可分配token
}

View File

@ -0,0 +1,81 @@
package com.microservices.dms.achievementLibrary.domain.blockchain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.microservices.common.core.annotation.Excel;
import com.microservices.common.core.web.domain.BaseEntity;
/**
* 区块链数据入链对象 in_blockchain_data
*
* @author microservices
* @date 2025-05-27
*/
public class InBlockchainData extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** 数据类型pr、issue、commit */
@Excel(name = "数据类型pr、issue、commit")
private String type;
/** 关联类型的唯一标识符 */
@Excel(name = "关联类型的唯一标识符")
private String typeId;
/** 交易哈希值 */
@Excel(name = "交易哈希值")
private String txHash;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setType(String type)
{
this.type = type;
}
public String getType()
{
return type;
}
public void setTypeId(String typeId)
{
this.typeId = typeId;
}
public String getTypeId()
{
return typeId;
}
public void setTxHash(String txHash)
{
this.txHash = txHash;
}
public String getTxHash()
{
return txHash;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("type", getType())
.append("typeId", getTypeId())
.append("txHash", getTxHash())
.append("createTime", getCreateTime())
.append("createBy", getCreateBy())
.toString();
}
}

View File

@ -0,0 +1,35 @@
package com.microservices.dms.achievementLibrary.domain.blockchain;
import java.io.Serializable;
public class InLinkProjectVo implements Serializable {
private Long amount;
private String projectId;
private String userId;
public Long getAmount() {
return this.amount;
}
public void setAmount(Long amount) {
this.amount = amount;
}
public String getProjectId() {
return this.projectId;
}
public void setProjectId(String projectId) {
this.projectId = projectId;
}
public String getUserId() {
return this.userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
}

View File

@ -0,0 +1,152 @@
package com.microservices.dms.achievementLibrary.domain.blockchain;
import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.microservices.common.core.annotation.Excel;
import com.microservices.common.core.web.domain.BaseEntity;
/**
* 用户/项目转账信息记录对象 user_project_transfer_records
*
* @author microservices
* @date 2025-05-27
*/
public class UserProjectTransferRecords extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 唯一标识每条记录 */
private Long id;
/** 付款方ID */
@Excel(name = "付款方ID")
private String payerId;
/** 项目ID */
@Excel(name = "项目ID")
private String projectId;
/** 转账金额,支持高精度数值 */
@Excel(name = "转账金额,支持高精度数值")
private BigDecimal token;
/** 收款方ID */
@Excel(name = "收款方ID")
private String payeeId;
/** 交易哈希值,确保每一笔交易唯一 */
@Excel(name = "交易哈希值,确保每一笔交易唯一")
private String txHash;
/** 转账类型project、user */
@Excel(name = "转账类型project、user")
private String type;
/** 备用字段1 */
@Excel(name = "备用字段1")
private String reserve1;
/** 备用字段2 */
@Excel(name = "备用字段2")
private String reserve2;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setPayerId(String payerId)
{
this.payerId = payerId;
}
public String getPayerId()
{
return payerId;
}
public void setProjectId(String projectId)
{
this.projectId = projectId;
}
public String getProjectId()
{
return projectId;
}
public void setToken(BigDecimal token)
{
this.token = token;
}
public BigDecimal getToken()
{
return token;
}
public void setPayeeId(String payeeId)
{
this.payeeId = payeeId;
}
public String getPayeeId()
{
return payeeId;
}
public void setTxHash(String txHash)
{
this.txHash = txHash;
}
public String getTxHash()
{
return txHash;
}
public void setType(String type)
{
this.type = type;
}
public String getType()
{
return type;
}
public void setReserve1(String reserve1)
{
this.reserve1 = reserve1;
}
public String getReserve1()
{
return reserve1;
}
public void setReserve2(String reserve2)
{
this.reserve2 = reserve2;
}
public String getReserve2()
{
return reserve2;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("payerId", getPayerId())
.append("projectId", getProjectId())
.append("token", getToken())
.append("payeeId", getPayeeId())
.append("txHash", getTxHash())
.append("createTime", getCreateTime())
.append("createBy", getCreateBy())
.append("type", getType())
.append("reserve1", getReserve1())
.append("reserve2", getReserve2())
.toString();
}
}

View File

@ -0,0 +1,22 @@
package com.microservices.dms.achievementLibrary.domain.blockchain;
public class UserVo {
private Long id;
private String nickname;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
}

View File

@ -0,0 +1,74 @@
package com.microservices.dms.achievementLibrary.mapper;
import java.util.List;
import com.microservices.common.datasource.annotation.Slave;
import com.microservices.dms.achievementLibrary.domain.AchievementDictData;
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 成果相关字典Mapper接口
*
* @author microservices
* @date 2025-05-23
*/
@Mapper
@Slave
public interface AchievementDictDataMapper
{
/**
* 查询成果相关字典
*
* @param dictCode 成果相关字典主键
* @return 成果相关字典
*/
public AchievementDictData selectAchievementDictDataByDictCode(Long dictCode);
/**
* 查询成果相关字典列表
*
* @param achievementDictData 成果相关字典
* @return 成果相关字典集合
*/
public List<AchievementDictData> selectAchievementDictDataList(AchievementDictData achievementDictData);
/**
* 新增成果相关字典
*
* @param achievementDictData 成果相关字典
* @return 结果
*/
public int insertAchievementDictData(AchievementDictData achievementDictData);
/**
* 修改成果相关字典
*
* @param achievementDictData 成果相关字典
* @return 结果
*/
public int updateAchievementDictData(AchievementDictData achievementDictData);
/**
* 删除成果相关字典
*
* @param dictCode 成果相关字典主键
* @return 结果
*/
public int deleteAchievementDictDataByDictCode(Long dictCode);
/**
* 批量删除成果相关字典
*
* @param dictCodes 需要删除的数据主键集合
* @return 结果
*/
public int deleteAchievementDictDataByDictCodes(Long[] dictCodes);
List<KeyValueVo> selectDictDataByType(@Param("dictType") String dictType);
int selectDictDataByLabel(@Param("label") String label,@Param("type") String type);
List<String> getDictTypes();
}

View File

@ -66,4 +66,6 @@ public interface AchievementTeamMapper
public int deleteAchievementTeamByIds(Long[] ids);
void deleteAchievementTeamByAId(@Param("aid") Long aid);
List<AchievementTeam> selectAchievementTeamByAchId(@Param("achId") Long achId);
}

View File

@ -1,18 +1,18 @@
package com.microservices.dms.achievementLibrary.mapper;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.*;
import com.microservices.common.datasource.annotation.Master;
import com.microservices.common.datasource.annotation.Slave;
import com.microservices.dms.achievementLibrary.domain.*;
import com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo;
import com.microservices.dms.resourceLibrary.domain.CompetitionResourceLibrary;
import com.microservices.dms.resourceLibrary.domain.TaskResourceLibrary;
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.PropertyValues;
/**
* 成果Mapper接口
@ -91,7 +91,7 @@ public interface AchievementsMapper {
List<KeyValVo<String, Long>> getAchievement(@Param("s") Date s, @Param("e") Date e, @Param("t") String source);
List<Map<String, String>> getHotAchievement();
List<HotAchVo> getHotAchievement();
Map<String, Long> indexProjectStatistic();
@ -115,7 +115,7 @@ public interface AchievementsMapper {
List<Map<String, Object>> getAchievementType();
List<KeyValueVo> getAchievementActData();
List<KeyValueVo> getAchievementActData(@Param("s") Date s, @Param("e") Date e);
List<Map<String, Object>> getAchievementDomain();
@ -125,7 +125,7 @@ public interface AchievementsMapper {
List<Long> getAllId();
List<AreaStatisticVo> getAreaStatistic(@Param("areaKey") String areaKey);
List<AreaStatisticVo> getAreaStatistic(@Param("source")String source,@Param("areaKey") String areaKey);
List<AchRelatedVo> getRelatedAch(@Param("id")Long id, @Param("sourceId") List<Long> sourceId, @Param("paramYear")String paramYear);
@ -140,4 +140,35 @@ public interface AchievementsMapper {
List<String> getExpertAreasByName(@Param("areaName") String areaName);
List<Long> getAllSourceId(@Param("id")Long id, @Param("sourceId")Long sourceId);
List<Long> getAllSourceIdCompetition(@Param("id")Long id, @Param("sourceId")Long sourceId);
List<Long> getAllSourceIdTask(@Param("id")Long id, @Param("sourceId")Long sourceId);
List<TaskResourceLibrary> getRelatedAchTaskOfExpert(@Param("id")Long id);
List<CompetitionResourceLibrary> getRelatedAchCompetitionOfExpert(@Param("id")Long id);
List<KeyValVo<String,Long>> getAchievementAddYearlyData(@Param("s") Date s, @Param("e") Date e);
List<KeyValueVo> getAchievementActDataW(@Param("s") Date s, @Param("e") Date e);
List<KeyValueVo> getAchievementActDataC(@Param("s") Date s, @Param("e") Date e);
List<KeyValueVo> getAchievementActDataD(@Param("s") Date s, @Param("e") Date e);
List<KeyValueVo> getAchievementActDataF(@Param("s") Date s, @Param("e") Date e);
List<Map<String, Object>> getDockingUserInfo(@Param("id") Long id);
List<Achievements> selectAchievementsByArea(AchQueryVo achQueryVo);
List<KeyValVo<String, Long>> getExperts(@Param("s") Date s, @Param("e") Date e);
List<KeyValueVo> getAllAreas(@Param("areaName") String areaName);
void updateRelationAchievements(@Param("source") String source,@Param("sourceId") Long sourceId);
List<Map<String, Object>> getDockingUserInfoList(@Param("id") Long id);
String getField1RemarkByParam(@Param("source")String source,@Param("areaKey") String areaKey);
}

View File

@ -0,0 +1,82 @@
package com.microservices.dms.achievementLibrary.mapper;
import java.util.List;
import java.util.Map;
import com.microservices.common.datasource.annotation.Slave;
import com.microservices.dms.achievementLibrary.domain.BlockchainListQueryVo;
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
import com.microservices.dms.achievementLibrary.domain.blockchain.InBlockchainData;
import com.microservices.dms.common.vo.CommitCreateVo;
import com.microservices.dms.common.vo.CommitResultVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 区块链数据入链Mapper接口
*
* @author microservices
* @date 2025-05-27
*/
@Mapper
@Slave
public interface InBlockchainDataMapper
{
/**
* 查询区块链数据入链
*
* @param id 区块链数据入链主键
* @return 区块链数据入链
*/
public InBlockchainData selectInBlockchainDataById(Long id);
/**
* 查询区块链数据入链列表
*
* @param inBlockchainData 区块链数据入链
* @return 区块链数据入链集合
*/
public List<InBlockchainData> selectInBlockchainDataList(InBlockchainData inBlockchainData);
/**
* 新增区块链数据入链
*
* @param inBlockchainData 区块链数据入链
* @return 结果
*/
public int insertInBlockchainData(InBlockchainData inBlockchainData);
/**
* 修改区块链数据入链
*
* @param inBlockchainData 区块链数据入链
* @return 结果
*/
public int updateInBlockchainData(InBlockchainData inBlockchainData);
/**
* 删除区块链数据入链
*
* @param id 区块链数据入链主键
* @return 结果
*/
public int deleteInBlockchainDataById(Long id);
/**
* 批量删除区块链数据入链
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteInBlockchainDataByIds(Long[] ids);
List<Map<String, Object>> issueDataList(BlockchainListQueryVo queryVo);
List<Map<String, Object>> commitDataList(BlockchainListQueryVo queryVo);
List<Map<String, Object>> prDataList(BlockchainListQueryVo queryVo);
List<String> getNeedToBlockCommitList();
List<CommitResultVo> getCommitListById(@Param("projectId") String projectId);
}

View File

@ -0,0 +1,73 @@
package com.microservices.dms.achievementLibrary.mapper;
import java.util.List;
import java.util.Map;
import com.microservices.common.datasource.annotation.Slave;
import com.microservices.dms.achievementLibrary.domain.BlockchainListQueryVo;
import com.microservices.dms.achievementLibrary.domain.blockchain.UserProjectTransferRecords;
import com.microservices.dms.achievementLibrary.domain.blockchain.UserVo;
import org.apache.ibatis.annotations.Mapper;
/**
* 用户/项目转账信息记录Mapper接口
*
* @author microservices
* @date 2025-05-27
*/
@Mapper
@Slave
public interface UserProjectTransferRecordsMapper
{
/**
* 查询用户/项目转账信息记录
*
* @param id 用户/项目转账信息记录主键
* @return 用户/项目转账信息记录
*/
public UserProjectTransferRecords selectUserProjectTransferRecordsById(Long id);
/**
* 查询用户/项目转账信息记录列表
*
* @param userProjectTransferRecords 用户/项目转账信息记录
* @return 用户/项目转账信息记录集合
*/
public List<UserProjectTransferRecords> selectUserProjectTransferRecordsList(UserProjectTransferRecords userProjectTransferRecords);
/**
* 新增用户/项目转账信息记录
*
* @param userProjectTransferRecords 用户/项目转账信息记录
* @return 结果
*/
public int insertUserProjectTransferRecords(UserProjectTransferRecords userProjectTransferRecords);
/**
* 修改用户/项目转账信息记录
*
* @param userProjectTransferRecords 用户/项目转账信息记录
* @return 结果
*/
public int updateUserProjectTransferRecords(UserProjectTransferRecords userProjectTransferRecords);
/**
* 删除用户/项目转账信息记录
*
* @param id 用户/项目转账信息记录主键
* @return 结果
*/
public int deleteUserProjectTransferRecordsById(Long id);
/**
* 批量删除用户/项目转账信息记录
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteUserProjectTransferRecordsByIds(Long[] ids);
List<Map> userDataList(BlockchainListQueryVo queryVo);
List<UserVo> userList(UserVo userVo);
}

View File

@ -1,5 +1,6 @@
package com.microservices.dms.achievementLibrary.service;
import com.alibaba.nacos.shaded.com.google.common.collect.Maps;
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
import com.microservices.dms.achievementLibrary.mapper.AchievementsMapper;
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
@ -20,14 +21,17 @@ public class BigScreenStatisticService {
private final CompetitionResourceLibraryMapper competitionResourceLibraryMapper;
public Map<String, Object> getAchievementTopStatistic(String source) {
//获取本周近7天)的数据
Date[] days = DateUtil.getDays(0, 6);
Map<String, Long> m = achievementsMapper.getAchievement(days[0], days[1], source)
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
List<String> dateStr = DateUtil.getDateStrYYYYMMDD(days[0], days[1]);
List<String> dateStr = DateUtil.getDateStrMMDD(days[0], days[1]);
//获取上周7-14天前的数据
Date[] lastDays = DateUtil.getDays(7, 13);
long lastSum = Optional.ofNullable(achievementsMapper.countAchievementBySource(lastDays[0], lastDays[1], source)).orElse(0L);
long sum = Optional.ofNullable(achievementsMapper.countAchievementBySource(null, null, source)).orElse(0L);
long cSum = m.values().stream().mapToLong(Long::longValue).sum();
//计算本周/上周增长%
double rate;
if (lastSum == 0) rate = 100D;
else {
@ -58,18 +62,99 @@ public class BigScreenStatisticService {
return achievementsMapper.getAchievementType();
}
public Map<String, List<KeyValueVo>> getAchievementActData() {
List<KeyValueVo> list = achievementsMapper.getAchievementActData();
Map<String, List<KeyValueVo>> res = list.stream().collect(Collectors.groupingBy(KeyValueVo::getKey));
return res;
public List<Map<String,Object>> getAchievementActData() {
Date[] days = DateUtil.getDays(0, 6);
Map<String, Long> wlist = achievementsMapper.getAchievementActDataW(days[0], days[1]).stream().collect(Collectors.toMap(KeyValueVo::getName, KeyValueVo::getValue));
Map<String, Long> clist = achievementsMapper.getAchievementActDataC(days[0], days[1]).stream().collect(Collectors.toMap(KeyValueVo::getName, KeyValueVo::getValue));
Map<String, Long> dlist = achievementsMapper.getAchievementActDataD(days[0], days[1]).stream().collect(Collectors.toMap(KeyValueVo::getName, KeyValueVo::getValue));
Map<String, Long> flist = achievementsMapper.getAchievementActDataF(days[0], days[1]).stream().collect(Collectors.toMap(KeyValueVo::getName, KeyValueVo::getValue));
List<String> dateStr = DateUtil.getDateStrMMDD(days[0], days[1]);
List<KeyValueVo> wres = new ArrayList<>();
List<KeyValueVo> cres = new ArrayList<>();
List<KeyValueVo> dres = new ArrayList<>();
List<KeyValueVo> fres = new ArrayList<>();
for (String s : dateStr) {
Long a = wlist.getOrDefault(s, 0L);
KeyValueVo k1 = new KeyValueVo();
k1.setKey(s);
k1.setValue(a);
k1.setName("关注");
wres.add(k1);
}
for (String s : dateStr) {
Long a = clist.getOrDefault(s, 0L);
KeyValueVo k1 = new KeyValueVo();
k1.setKey(s);
k1.setValue(a);
k1.setName("浏览");
cres.add(k1);
}
for (String s : dateStr) {
Long a = dlist.getOrDefault(s, 0L);
KeyValueVo k1 = new KeyValueVo();
k1.setKey(s);
k1.setValue(a);
k1.setName("下载");
dres.add(k1);
}
for (String s : dateStr) {
Long a = flist.getOrDefault(s, 0L);
KeyValueVo k1 = new KeyValueVo();
k1.setKey(s);
k1.setValue(a);
k1.setName("收藏");
fres.add(k1);
}
List<Map<String, Object>> r = new ArrayList<>();
Map<String, Object> w = new HashMap<>();
w.put("key", "关注");
w.put("value", wres);
Map<String, Object> c = new HashMap<>();
c.put("key","浏览");
c.put("value", cres);
Map<String, Object> d = new HashMap<>();
d.put("key","下载");
d.put("value", dres);
Map<String, Object> f = new HashMap<>();
f.put("key", "收藏");
f.put("value", fres);
r.add(w);
r.add(c);
r.add(d);
r.add(f);
return r;
}
public List<Map<String, Object>> getAchievementDomain() {
return achievementsMapper.getAchievementDomain();
}
public List<Map<String, Object>> getAchievementAddYearly() {
return achievementsMapper.getAchievementAddYearly();
public Object getAchievementAddYearly() {
Date[] currentYear = DateUtil.getLast12Months();
Map<String, Long> m = achievementsMapper.getAchievementAddYearlyData(currentYear[0],currentYear[1])
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
List<String> dateStr = DateUtil.getDateStrYYYYMM(currentYear[0], currentYear[1]);
List<KeyValVo<String, Long>> res = new ArrayList<>();
for (String s : dateStr) {
Long a = m.getOrDefault(s, 0L);
KeyValVo<String, Long> k1 = new KeyValVo<>();
k1.setK(s);
k1.setV(a);
res.add(k1);
}
return res;
}
public List<Map<String, Object>> getAchievementHotRank() {
@ -101,12 +186,13 @@ public class BigScreenStatisticService {
return competitionResourceLibraryMapper.getCompetitionHot();
}
public List<KeyValVo<String, Long>> getCompetitionYearlyPaperAdd() {
Date[] currentYear = DateUtil.getCurrentYear();
Date[] currentYear = DateUtil.getLast12Months();
Map<String, Long> m = competitionResourceLibraryMapper.getCompetitionYearlyPaperAdd(currentYear[0],currentYear[1])
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
List<String> dateStr = DateUtil.getDateStrMMDD(currentYear[0], currentYear[1]);
List<String> dateStr = DateUtil.getDateStrYYYYMM(currentYear[0], currentYear[1]);
List<KeyValVo<String, Long>> res = new ArrayList<>();
for (String s : dateStr) {
Long a = m.getOrDefault(s, 0L);
@ -119,12 +205,11 @@ public class BigScreenStatisticService {
}
public List<KeyValVo<String, Long>> getCompetitionYearlyFinish() {
Date[] currentYear = DateUtil.getCurrentYear();
Date[] YearEndOfCur = DateUtil.getCurrentYearEndOf(LocalDate.now());
Date[] currentYear = DateUtil.getLast12Months();
Map<String, Long> m = competitionResourceLibraryMapper.getCompetitionYearlyFinish(YearEndOfCur[0],YearEndOfCur[1])
Map<String, Long> m = competitionResourceLibraryMapper.getCompetitionYearlyFinish(currentYear[0],currentYear[1])
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
List<String> dateStr = DateUtil.getDateStrMMDD(currentYear[0], currentYear[1]);
List<String> dateStr = DateUtil.getDateStrYYYYMM(currentYear[0], currentYear[1]);
List<KeyValVo<String, Long>> res = new ArrayList<>();
for (String s : dateStr) {
Long a = m.getOrDefault(s, 0L);

View File

@ -0,0 +1,595 @@
package com.microservices.dms.achievementLibrary.service;
import com.alibaba.fastjson2.JSONObject;
import com.microservices.common.core.exception.ServiceException;
import com.microservices.common.core.utils.DateUtils;
import com.microservices.common.core.web.domain.AjaxResult;
import com.microservices.common.httpClient.service.HttpAPIService;
import com.microservices.common.security.utils.SecurityUtils;
import com.microservices.dms.achievementLibrary.domain.Achievements;
import com.microservices.dms.achievementLibrary.domain.BlockchainListQueryVo;
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
import com.microservices.dms.achievementLibrary.domain.TokenListVo;
import com.microservices.dms.achievementLibrary.domain.blockchain.InBlockchainData;
import com.microservices.dms.achievementLibrary.domain.blockchain.InLinkProjectVo;
import com.microservices.dms.achievementLibrary.domain.blockchain.UserProjectTransferRecords;
import com.microservices.dms.achievementLibrary.domain.blockchain.UserVo;
import com.microservices.dms.achievementLibrary.mapper.InBlockchainDataMapper;
import com.microservices.dms.achievementLibrary.mapper.UserProjectTransferRecordsMapper;
import com.microservices.dms.behaviorImage.domain.AchievementImageVo;
import com.microservices.dms.common.vo.*;
import com.microservices.dms.referral.mapper.TalentReferralMapper;
import com.microservices.dms.resourceLibrary.mapper.ProjectResourceLibraryMapper;
import com.microservices.dms.utils.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
//import org.fisco.bcos.sdk.client.Client;
//import org.fisco.bcos.sdk.client.protocol.request.Transaction;
//import org.fisco.bcos.sdk.client.protocol.response.BcosTransaction;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import static com.microservices.common.core.utils.DateUtils.YYYY_MM_DD_HH_MM_SS;
import static com.microservices.dms.constant.BlockChainFunConstants.*;
import static com.microservices.dms.utils.DateUtil.formatLocalDateTimePlusH;
@Service
@Slf4j
public class BlockChainService {
@Autowired
private ProjectResourceLibraryMapper projectResourceLibraryMapper;
@Value("${gitlink.fiscobcosUrl:localhost}")
public String fiscobcosUrl;
@Autowired
private HttpAPIService httpAPIService;
@Autowired
private InBlockchainDataMapper inBlockchainDataMapper;
@Autowired
private UserProjectTransferRecordsMapper userProjectTransferRecordsMapper;
@Autowired
private TalentReferralMapper talentReferralMapper;
public List<TokenListVo> projectTokenList(String projectName) {
List<TokenListVo> list = projectResourceLibraryMapper.selectProjectInfos(projectName);
for (TokenListVo v : list) {
JSONObject param = queryProjectInfo(v);
if(param != null) {
Long issueTokenSum = projectResourceLibraryMapper.sumProjectIssueToken(v.getId());
v.setIssueToken(issueTokenSum);
long totalToken = Long.parseLong(param.getString("total_supply"));//总token
v.setTotalToken(totalToken);
//根据创建人login获取对应的用户id
String userName = v.getUserId();
//根据创建人项目Id,获取创建人拥有token
String tokenName = param.getString("token_name");
Long applyToken= getUserBlanaceProjectId("userSingleInfo",userName,tokenName);
v.setApplyToken(applyToken);
v.setCurrentToken(totalToken - applyToken);
}
v.setCreatedOn(DateUtil.plusHours(v.getCreatedOn(), 8));
}
return list;
}
public Long getUserBlanaceProjectId(String type,String userName,String tokenName) {
JSONObject params = new JSONObject();
if(type.equals(USER_SINGLE_INFO)){
params.put(REQUEST_TYPE, USER_SINGLE_REPO);
params.put("token_name", tokenName);
params.put("username", userName);
}else if(type.equals(USER_ALL_INFO)){
params.put(REQUEST_TYPE, USER_ALL_REPOS);
params.put("username", userName);
}
Map<String, String> p = convertParams(params);
params = JSONObject.from(p);
JSONObject rsp = queryFiscobcos(params);
if (rsp != null) {
return Long.parseLong(rsp.getString("balance"));
}
return -1L;
}
private JSONObject queryProjectInfo(TokenListVo v) {
JSONObject param = new JSONObject();
param.put(REQUEST_TYPE, QUERY_REPO);
param.put("token_name", String.valueOf(v.getId()));
JSONObject jsonObject = queryFiscobcos(param);
if (jsonObject != null) {
return jsonObject;
}
return null;
}
private JSONObject queryFiscobcos(JSONObject param) {
try {
// Map<String,String> p = convertParams(param);
// JSONObject from = JSONObject.from(p);
JSONObject reps = httpAPIService.doPost(fiscobcosUrl, param);
// if (result.getCode() != 200) {
// return null;
// }
// JSONObject reps = JSONObject.parseObject(result.getContent());
if (reps.containsKey(RESP_STATUS) && reps.getString(RESP_STATUS).equals("0")) {
return reps;
}
} catch (Exception e) {
log.error("区块链接口请求失败", e);
return null;
}
return null;
}
private Map<String, String> convertParams(JSONObject param) {
Set<String> keys = param.keySet();
Map<String, String> r = new HashMap<>();
// 遍历 key 集合并获取对应的 value
for (String key : keys) {
Object o = param.get(key);
if (o != null) {
if (o instanceof String || o instanceof Integer || o instanceof Long || o instanceof BigDecimal || o instanceof Double) {
r.put(key, param.getString(key));
} else if (o instanceof LocalDateTime) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
String format = formatter.format(LocalDateTime.parse(o.toString(), formatter));
r.put(key, format);
} else if (o instanceof Date) {
String s = DateUtils.parseDateToStr(YYYY_MM_DD_HH_MM_SS, (Date) o);
r.put(key, s);
} else if (o instanceof List || o instanceof Map) {
String jsonString = JSONObject.toJSONString(o);
r.put(key, jsonString);
}else {
r.put(key, o.toString());
}
}else {
r.put(key, null);
}
}
return r;
}
public AjaxResult projectTokenDistribute(InLinkProjectVo vo) {
//根据项目ID获取用户ID
//根据项目id获取项目创建人
String userId = projectResourceLibraryMapper.getProjectUserIdById(vo.getProjectId());
validTokenCount(vo.getProjectId(), vo.getAmount(),userId);
JSONObject params = new JSONObject();
params.put(REQUEST_TYPE, TRANSFER_AMOUNT);
params.put("token_name", vo.getProjectId());
params.put("amount", vo.getAmount());
params.put("payee", vo.getUserId());
params.put("payer", userId);
JSONObject rsp = queryFiscobcos(params);
if (rsp != null) {
String txHash = rsp.getString(TX_HASH);
// insert to db 4将3入链成功的数据存入表 用户/项目转账信息记录表 type:project payer_idusername)
if (StringUtils.isNotEmpty(txHash)) {
UserProjectTransferRecords records = new UserProjectTransferRecords();
records.setPayerId(params.getString("payer"));//转账人
records.setPayeeId(params.getString("payee"));//收款人
records.setProjectId(vo.getProjectId());
records.setToken(BigDecimal.valueOf(vo.getAmount()));
records.setType("projectApply");//项目分配
records.setCreateTime(DateUtils.getNowDate());
records.setTxHash(txHash);
records.setCreateBy(SecurityUtils.getUsername());
userProjectTransferRecordsMapper.insertUserProjectTransferRecords(records);
}
return AjaxResult.success();
}
return AjaxResult.error();
}
public AjaxResult userCreate(UserCreateVo userCreateVo) {
//根据项目id获取项目创建人
String userId = projectResourceLibraryMapper.getUserIdBYLogin(userCreateVo.getPayee());//收款人ID
userCreateVo.setPayee(userId);
String payerId = projectResourceLibraryMapper.getUserIdBYLogin(userCreateVo.getPayer());//转账人ID
userCreateVo.setPayer(payerId);
//转账人token充足
validUserTokenCount(userCreateVo);
//进行转账
JSONObject params = JSONObject.from(userCreateVo);
params.put(REQUEST_TYPE, TRANSFER_AMOUNT);
JSONObject rsp = queryFiscobcos(params);
if (rsp != null) {
String txHash = rsp.getString(TX_HASH);
// insert to db 将2入链成功的数据新增到用户/项目转账信息记录表 type:user payer_idpayer)
if (StringUtils.isNotEmpty(txHash)) {
UserProjectTransferRecords records = new UserProjectTransferRecords();
records.setPayerId(params.getString("payer"));
records.setPayeeId(params.getString("payee"));
records.setProjectId(params.getString("token_name"));
records.setToken(params.getBigDecimal("amount"));
records.setType("userTransfer");//用户转账
records.setTxHash(txHash);
records.setCreateTime(DateUtils.getNowDate());
records.setCreateBy(SecurityUtils.getUsername());
userProjectTransferRecordsMapper.insertUserProjectTransferRecords(records);
return AjaxResult.success(rsp);
}
}
return AjaxResult.error();
}
//判断用户当前项目剩余token是否还支持分配
private void validUserTokenCount(UserCreateVo userCreateVo) {
//现根据用户id,以及项目名称查询对应用户拥有的token
JSONObject params = new JSONObject();
params.put(REQUEST_TYPE, USER_SINGLE_REPO);
params.put("token_name", userCreateVo.getToken_name());
params.put("username", userCreateVo.getPayer());
Map<String, String> p = convertParams(params);
params = JSONObject.from(p);
JSONObject rsp = queryFiscobcos(params);
if(rsp != null) {
long curToken = Long.parseLong(rsp.getString("balance"));
Long amount = userCreateVo.getAmount();
if (curToken <amount) {
throw new ServiceException("token数量不足");
}
}
}
//判断项目剩余token是否还支持分配
private void validTokenCount(String tokenName, Long amount,String userName) {
TokenListVo v = new TokenListVo();
if(StringUtils.isEmpty(tokenName)) {
throw new ServiceException("项目ID不能为空");
}
v.setId(Long.parseLong(Optional.ofNullable(tokenName).orElse("-1")));
Long issueTokenSum = projectResourceLibraryMapper.sumProjectIssueToken(v.getId());
v.setIssueToken(issueTokenSum);
//根据创建人项目Id,获取创建人拥有token
Long applyToken= getUserBlanaceProjectId("userSingleInfo",userName,tokenName);
v.setApplyToken(applyToken);
long curToken = applyToken - issueTokenSum;
if (curToken < amount) {
throw new ServiceException("token数量不足");
}
}
private Long queryTotalToken(TokenListVo v) {
if(v.getName().equals("区块链测试")){
System.out.println("zzz");
}
JSONObject param = new JSONObject();
param.put(REQUEST_TYPE, QUERY_REPO);
param.put("token_name", String.valueOf(v.getId()));
JSONObject jsonObject = queryFiscobcos(param);
if (jsonObject != null) {
return jsonObject.getLong("total_supply");
}
return -1L;
}
public AjaxResult prCreate(PrCreateVo prCreateVo) {
Map<String, Object> res = projectResourceLibraryMapper.selectPrInfo(prCreateVo.getPr_id());
if (res != null) {
JSONObject params = JSONObject.from(res);
Map<String, String> p = convertParams(params);
params = JSONObject.from(p);
params.put("updated_at", DataUtilsStr());
params.put("pull_request_number", params.getLong("pull_request_number"));
params.put(REQUEST_TYPE, CREATE_PR);
JSONObject rsp = queryFiscobcos(params);
if (rsp != null) {
String txHash = rsp.getString(TX_HASH);
//将对应的token todo
// insert to db 新增表pr入链关联id,type,type_id,tx_hash,create_time (type:pr,type_id:"pull_request_id)
if (StringUtils.isNotEmpty(txHash)) {
InBlockchainData inBlockchainData = new InBlockchainData();
inBlockchainData.setType("pr");
inBlockchainData.setTxHash(txHash);
inBlockchainData.setTypeId(prCreateVo.getPr_id());
inBlockchainData.setCreateTime(DateUtils.getNowDate());
inBlockchainData.setCreateBy(SecurityUtils.getUsername());
inBlockchainDataMapper.insertInBlockchainData(inBlockchainData);
return AjaxResult.success(rsp);
}
}
}
return AjaxResult.error();
}
private String DataUtilsStr() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.format(DateUtils.getNowDate());
}
public AjaxResult issueCreateUpdate(IssueCreateVo issueCreateVo) {
Map<String, Object> res = projectResourceLibraryMapper.selectIssueInfo(issueCreateVo.getIssue_id());
if (res != null) {
JSONObject params = JSONObject.from(res);
params.put(REQUEST_TYPE, CREATE_UPDATE_ISSUE);
params.put("updated_at", DataUtilsStr());
Map<String, String> p = convertParams(params);
params = JSONObject.from(p);
JSONObject rsp = queryFiscobcos(params);
if (rsp != null) {
String txHash = rsp.getString(TX_HASH);
// insert to db 4 数据入链表id,type,type_id,tx_hash,create_time (type:issue,type_id:issue_id)
if (StringUtils.isNotEmpty(txHash)) {
InBlockchainData inBlockchainData = new InBlockchainData();
inBlockchainData.setType("issue");
inBlockchainData.setTxHash(txHash);
inBlockchainData.setTypeId(issueCreateVo.getIssue_id());
inBlockchainData.setCreateTime(DateUtils.getNowDate());
inBlockchainData.setCreateBy(SecurityUtils.getUsername());
inBlockchainDataMapper.insertInBlockchainData(inBlockchainData);
return AjaxResult.success(rsp);
}
}
}
return AjaxResult.error();
}
public List<Map<String, Object>> issueDataList(BlockchainListQueryVo queryVo) {
List<Map<String, Object>> maps = inBlockchainDataMapper.issueDataList(queryVo);
handleForgeDate(maps);
return maps;
}
private void handleForgeDate(List<Map<String, Object>> maps){
for (Map<String, Object> m : maps) {
LocalDateTime updatedAt = (LocalDateTime) m.get("updated_at");
LocalDateTime createdAt = (LocalDateTime) m.get("created_at");
m.put("updated_at",formatLocalDateTimePlusH(updatedAt,8));
m.put("created_at",formatLocalDateTimePlusH(createdAt,8));
if (m.containsKey("committer_time")) {
LocalDateTime committer_time = (LocalDateTime) m.get("committer_time");
m.put("committer_time",formatLocalDateTimePlusH(committer_time,8));
}
}
}
//定时任务将commit数据入链
// @Scheduled(cron = "${cron.commitPushBlock}")
public void commitPushBlock() {
//先查询需要入链的数据
List<String> commitIdList = inBlockchainDataMapper.getNeedToBlockCommitList();
if(commitIdList!=null && commitIdList.size()>0) {
//遍历数据入区块链
for(String commitId : commitIdList) {
CommitCreateVo commitCreateVo = new CommitCreateVo();
commitCreateVo.setCommit_id(commitId);
commitCreate(commitCreateVo);
}
}
}
public AjaxResult commitCreate(CommitCreateVo commitCreateVo) {
List<CommitResultVo> CommitCreateVoList = new ArrayList<>();
if(StringUtils.isEmpty(commitCreateVo.getCommit_id())) {
String projectId = commitCreateVo.getProject_id();
if (StringUtils.isNotEmpty(projectId)) {
CommitCreateVoList = inBlockchainDataMapper.getCommitListById(projectId);
}
}else{
CommitResultVo resultVo = new CommitResultVo();
resultVo.setCommitId(commitCreateVo.getCommit_id());
resultVo.setCommitDiff(commitCreateVo.getCommit_diff());
CommitCreateVoList.add(resultVo);
}
if(CommitCreateVoList!=null && CommitCreateVoList.size()>0) {
for(CommitResultVo commit : CommitCreateVoList) {
commitDataTnBlock(commit);
}
}
return AjaxResult.success();
}
private AjaxResult commitDataTnBlock(CommitResultVo commitCreateVo) {
String commitId = commitCreateVo.getCommitId();
//根据项目id,查询对应的需要入链的commit
Map<String, Object> res = projectResourceLibraryMapper.selectCommitInfo(commitId,commitCreateVo.getCommitDiff());
JSONObject params = JSONObject.from(res);
params.put(REQUEST_TYPE, CREATE_COMMIT);
Map<String, String> p = convertParams(params);
params = JSONObject.from(p);
JSONObject rsp = queryFiscobcos(params);
if (rsp != null) {
String txHash = rsp.getString(TX_HASH);
// insert to db 4 数据入链表id,type,type_id,tx_hash,create_time (type:issue,type_id:issue_id)
if (StringUtils.isNotEmpty(txHash)) {
InBlockchainData inBlockchainData = new InBlockchainData();
inBlockchainData.setType("commit");
inBlockchainData.setTxHash(txHash);
inBlockchainData.setTypeId(commitId);
inBlockchainData.setCreateTime(DateUtils.getNowDate());
inBlockchainData.setCreateBy(SecurityUtils.getUsername());
inBlockchainDataMapper.insertInBlockchainData(inBlockchainData);
return AjaxResult.success(rsp);
}
}
return AjaxResult.error();
}
public List<Map<String, Object>> commitDataList(BlockchainListQueryVo queryVo) {
List<Map<String, Object>> maps = inBlockchainDataMapper.commitDataList(queryVo);
handleForgeDate(maps);
return maps;
}
public List<Map<String, Object>> prDataList(BlockchainListQueryVo queryVo) {
List<Map<String, Object>> maps = inBlockchainDataMapper.prDataList(queryVo);
handleForgeDate(maps);
return maps;
}
//产权转让
public List<Map> userDataList(BlockchainListQueryVo queryVo) {
Long gitlinkUserId = SecurityUtils.getGitlinkUserId();
Map<String, Object> stringObjectMap = Optional.ofNullable(talentReferralMapper.selectUsersById(gitlinkUserId)).orElse(new HashMap<>());
if (!Objects.equals(stringObjectMap.get("admin"), "1")) {
queryVo.setUserId(gitlinkUserId);
}
return userProjectTransferRecordsMapper.userDataList(queryVo);
}
public List<UserVo> userList(UserVo userVo) {
return userProjectTransferRecordsMapper.userList(userVo);
}
public AjaxResult projectCreate(ProjectCreateVo projectCreateVo) {
//先根据项目id(token_name)判断项目是否存在存在才入链
String tokenName = projectCreateVo.getToken_name();
int num = talentReferralMapper.selectProjectById(tokenName);
if(num>0) {
JSONObject params = new JSONObject();
params.put(REQUEST_TYPE, CREATE_REPO);
params.put("owner", projectCreateVo.getOwner());
params.put("token_name", projectCreateVo.getToken_name());
// params.put("cur_supply", projectCreateVo.getCur_supply());
Map<String, String> p = convertParams(params);
params = JSONObject.from(p);
params.put("total_supply", projectCreateVo.getTotal_supply());
JSONObject rsp = queryFiscobcos(params);
if (rsp != null) {
String txHash = rsp.getString(TX_HASH);
// insert to db 4 数据入链表id,type,type_id,tx_hash,create_time (type:issue,type_id:issue_id)
if (StringUtils.isNotEmpty(txHash)) {
InBlockchainData inBlockchainData = new InBlockchainData();
inBlockchainData.setType("project");
inBlockchainData.setTxHash(txHash);
inBlockchainData.setTypeId(projectCreateVo.getToken_name());
inBlockchainData.setCreateTime(DateUtils.getNowDate());
inBlockchainData.setCreateBy(SecurityUtils.getUsername());
inBlockchainDataMapper.insertInBlockchainData(inBlockchainData);
return AjaxResult.success(rsp);
}
}
}
return AjaxResult.error();
}
public AjaxResult queryBlockInfo(String type,String typeId) {
JSONObject params = paramsQuery(type,typeId);
Map<String, String> p = convertParams(params);
params = JSONObject.from(p);
JSONObject rsp = queryFiscobcos(params);
return AjaxResult.success(rsp);
}
private JSONObject paramsQuery(String type, String typeId) {
JSONObject params = new JSONObject();
if(type.equals(PROJECT_INFO)){
params.put(REQUEST_TYPE, QUERY_REPO);
params.put("token_name", typeId);
}else if(type.equals(COMMIT_INTO)){
params.put(REQUEST_TYPE, QUERY_COMMIT);
params.put("commit_hash", typeId);
}else if(type.equals(PR_LATEST_INFO)){
params.put(REQUEST_TYPE, QUERY_PR_LATEST);
params.put("pull_request_id", typeId);
}else if(type.equals(PR_ALL_INFO)){
params.put(REQUEST_TYPE, QUERY_PR_ALL);
params.put("pull_request_id", typeId);
}else if(type.equals(ISSUE_LATEST_INFO)){
params.put(REQUEST_TYPE, QUERY_ISSUE_LATEST);
params.put("issue_id", typeId);
}else if(type.equals(ISSUE_ALL_INFO)){
params.put(REQUEST_TYPE, QUERY_ISSUE_ALL);
params.put("issue_id", typeId);
}
return params;
}
public AjaxResult getTransactionByHash(String txHash) {
JSONObject params = new JSONObject();
params.put(REQUEST_TYPE, GET_TRANSACTION_BYHASH);
params.put("tx_hash", txHash);
Map<String, String> p = convertParams(params);
params = JSONObject.from(p);
JSONObject rsp = queryFiscobcos(params);
return AjaxResult.success(rsp);
}
public AjaxResult getTransactionReceipt(String txHash) {
JSONObject params = new JSONObject();
params.put(REQUEST_TYPE, GET_TRANSACTION_RECEIPT);
params.put("tx_hash", txHash);
Map<String, String> p = convertParams(params);
params = JSONObject.from(p);
JSONObject rsp = queryFiscobcos(params);
return AjaxResult.success(rsp);
}
public AjaxResult getTotalTransactionCount() {
JSONObject params = new JSONObject();
params.put(REQUEST_TYPE, GET_TOTAL_TRANSACTION_COUNTT);
Map<String, String> p = convertParams(params);
params = JSONObject.from(p);
JSONObject rsp = queryFiscobcos(params);
return AjaxResult.success(rsp);
}
public AjaxResult getBlockNumber() {
JSONObject params = new JSONObject();
params.put(REQUEST_TYPE, GET_BLOCK_NUM);
Map<String, String> p = convertParams(params);
params = JSONObject.from(p);
JSONObject rsp = queryFiscobcos(params);
if (rsp != null) {
return AjaxResult.success(rsp);
}
return AjaxResult.error();
}
public AjaxResult getUserTokenByProjectId(String type,String userName,String tokenName) {
JSONObject params = new JSONObject();
if(type.equals(USER_SINGLE_INFO)){
params.put(REQUEST_TYPE, USER_SINGLE_REPO);
params.put("token_name", tokenName);
params.put("username", userName);
}else if(type.equals(USER_ALL_INFO)){
params.put(REQUEST_TYPE, USER_ALL_REPOS);
params.put("username", userName);
}
Map<String, String> p = convertParams(params);
params = JSONObject.from(p);
JSONObject rsp = queryFiscobcos(params);
if (rsp != null) {
return AjaxResult.success(rsp);
}
return AjaxResult.error();
}
//
public AjaxResult getUserAllProjectToken(String userName) {
JSONObject params = new JSONObject();
params.put(REQUEST_TYPE, USER_ALL_REPOS);
params.put("username", userName);
Map<String, String> p = convertParams(params);
params = JSONObject.from(p);
JSONObject rsp = queryFiscobcos(params);
if (rsp != null) {
return AjaxResult.success(rsp);
}
return AjaxResult.error();
}
}

View File

@ -0,0 +1,67 @@
package com.microservices.dms.achievementLibrary.service;
import java.util.List;
import com.microservices.dms.achievementLibrary.domain.AchievementDictData;
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
import org.apache.ibatis.annotations.Param;
/**
* 成果相关字典Service接口
*
* @author microservices
* @date 2025-05-23
*/
public interface IAchievementDictDataService
{
/**
* 查询成果相关字典
*
* @param dictCode 成果相关字典主键
* @return 成果相关字典
*/
public AchievementDictData selectAchievementDictDataByDictCode(Long dictCode);
/**
* 查询成果相关字典列表
*
* @param achievementDictData 成果相关字典
* @return 成果相关字典集合
*/
public List<AchievementDictData> selectAchievementDictDataList(AchievementDictData achievementDictData);
/**
* 新增成果相关字典
*
* @param achievementDictData 成果相关字典
* @return 结果
*/
public int insertAchievementDictData(AchievementDictData achievementDictData);
/**
* 修改成果相关字典
*
* @param achievementDictData 成果相关字典
* @return 结果
*/
public int updateAchievementDictData(AchievementDictData achievementDictData);
/**
* 批量删除成果相关字典
*
* @param dictCodes 需要删除的成果相关字典主键集合
* @return 结果
*/
public int deleteAchievementDictDataByDictCodes(Long[] dictCodes);
/**
* 删除成果相关字典信息
*
* @param dictCode 成果相关字典主键
* @return 结果
*/
public int deleteAchievementDictDataByDictCode(Long dictCode);
List<KeyValueVo> selectDictDataByType(String dictType);
List<String> getDictTypes();
}

View File

@ -5,6 +5,8 @@ import java.util.Map;
import com.microservices.dms.achievementLibrary.domain.*;
import com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo;
import com.microservices.dms.resourceLibrary.domain.CompetitionResourceLibrary;
import com.microservices.dms.resourceLibrary.domain.TaskResourceLibrary;
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
/**
@ -76,7 +78,7 @@ public interface IAchievementsService {
Map<String, Object> getUerActionData();
List<Map<String, String>> getHotAchievement();
List<HotAchVo> getHotAchievement();
List<KeyValVo<String, Long>> get7DayAdd(AchQueryVo achQueryVo);
@ -94,7 +96,7 @@ public interface IAchievementsService {
AchievementBehaviorSumVo getActDataStatisticById(Long id);
List<KeyValVo<String, Long>> get7AddClickById(String id);
List<KeyValVo<String, Long>> get7AddClickById(String id, String clickType);
AchievementBehaviorSumVo getWatchFavoriteStatusById(Long id, Long userId);
@ -107,4 +109,19 @@ public interface IAchievementsService {
List<KeyValueVo> getProjectAreasByName(String areaName);
List<String> getExpertAreasByName(String areaName);
List<AchRelatedResult> getRelatedAchCompetition(Long id, Long sourceId);
List<AchRelatedResult> getRelatedAchTask(Long id, Long sourceId);
List<TaskResourceLibrary> getRelatedAchTaskOfExpert(Long id);
List<CompetitionResourceLibrary> getRelatedAchCompetitionOfExpert(Long id);
AchDetailVo getAreaDetail(String areaKey,String kyxmSum, String source);
List<KeyValVo<String, Long>> get7DayAddExport(AchQueryVo achQueryVo);
List<KeyValueVo> getAllAreas(String areaName);
}

View File

@ -60,4 +60,6 @@ public interface ISchoolEnterpriseAchievementsService
public int deleteSchoolEnterpriseAchievementsById(Long id);
Long topStatistic(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
List<SchoolEnterpriseAchievements> listFront(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
}

View File

@ -0,0 +1,95 @@
package com.microservices.dms.achievementLibrary.service;
import java.util.List;
import com.microservices.common.core.utils.DateUtils;
import com.microservices.dms.achievementLibrary.domain.blockchain.InBlockchainData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.microservices.dms.achievementLibrary.mapper.InBlockchainDataMapper;
/**
* 区块链数据入链Service业务层处理
*
* @author microservices
* @date 2025-05-27
*/
@Service
public class InBlockchainDataServiceImpl
{
@Autowired
private InBlockchainDataMapper inBlockchainDataMapper;
/**
* 查询区块链数据入链
*
* @param id 区块链数据入链主键
* @return 区块链数据入链
*/
public InBlockchainData selectInBlockchainDataById(Long id)
{
return inBlockchainDataMapper.selectInBlockchainDataById(id);
}
/**
* 查询区块链数据入链列表
*
* @param inBlockchainData 区块链数据入链
* @return 区块链数据入链
*/
public List<InBlockchainData> selectInBlockchainDataList(InBlockchainData inBlockchainData)
{
return inBlockchainDataMapper.selectInBlockchainDataList(inBlockchainData);
}
/**
* 新增区块链数据入链
*
* @param inBlockchainData 区块链数据入链
* @return 结果
*/
public int insertInBlockchainData(InBlockchainData inBlockchainData)
{
inBlockchainData.setCreateTime(DateUtils.getNowDate());
return inBlockchainDataMapper.insertInBlockchainData(inBlockchainData);
}
/**
* 修改区块链数据入链
*
* @param inBlockchainData 区块链数据入链
* @return 结果
*/
public int updateInBlockchainData(InBlockchainData inBlockchainData)
{
return inBlockchainDataMapper.updateInBlockchainData(inBlockchainData);
}
/**
* 批量删除区块链数据入链
*
* @param ids 需要删除的区块链数据入链主键
* @return 结果
*/
public int deleteInBlockchainDataByIds(Long[] ids)
{
return inBlockchainDataMapper.deleteInBlockchainDataByIds(ids);
}
/**
* 删除区块链数据入链信息
*
* @param id 区块链数据入链主键
* @return 结果
*/
public int deleteInBlockchainDataById(Long id)
{
return inBlockchainDataMapper.deleteInBlockchainDataById(id);
}
}

View File

@ -1,5 +1,6 @@
package com.microservices.dms.achievementLibrary.service;
import com.microservices.common.core.utils.StringUtils;
import com.microservices.dms.achievementLibrary.domain.AchQueryVo;
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
import com.microservices.dms.achievementLibrary.domain.MemoTotalVo;
@ -33,7 +34,7 @@ public class MemoDashboardService {
* 原创非原创
* @return
*/
public KeyValueVo getIsOriginalStatistic() {
public List<KeyValueVo> getIsOriginalStatistic() {
return memoResourceLibraryMapper.getIsOriginalStatistic();
}
@ -58,9 +59,11 @@ public class MemoDashboardService {
* @return
*/
public List<KeyValueVo> getAddMemoStatistic() {
return memoResourceLibraryMapper.getAddMemoStatistic();
Date[] currentYear = DateUtil.getLast12Months();
return memoResourceLibraryMapper.getAddMemoStatistic(currentYear[0],currentYear[1]);
}
/**
* 本年帖子热度top5论坛评论点击点赞
* @return
@ -74,7 +77,7 @@ public class MemoDashboardService {
* @return
*/
public List<KeyValVo<String, Long>> get7DayPaise() {
Date[] days = DateUtil.getDays(1, 7);
Date[] days = DateUtil.getDays(0, 6);
Map<String, Long> w = memoResourceLibraryMapper.get7DayPaise(days[0], days[1])
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));

View File

@ -0,0 +1,88 @@
package com.microservices.dms.achievementLibrary.service;
import java.util.List;
import com.microservices.common.core.utils.DateUtils;
import com.microservices.dms.achievementLibrary.domain.blockchain.UserProjectTransferRecords;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.microservices.dms.achievementLibrary.mapper.UserProjectTransferRecordsMapper;
/**
* 用户/项目转账信息记录Service业务层处理
*
* @author microservices
* @date 2025-05-27
*/
@Service
public class UserProjectTransferRecordsServiceImpl
{
@Autowired
private UserProjectTransferRecordsMapper userProjectTransferRecordsMapper;
/**
* 查询用户/项目转账信息记录
*
* @param id 用户/项目转账信息记录主键
* @return 用户/项目转账信息记录
*/
public UserProjectTransferRecords selectUserProjectTransferRecordsById(Long id)
{
return userProjectTransferRecordsMapper.selectUserProjectTransferRecordsById(id);
}
/**
* 查询用户/项目转账信息记录列表
*
* @param userProjectTransferRecords 用户/项目转账信息记录
* @return 用户/项目转账信息记录
*/
public List<UserProjectTransferRecords> selectUserProjectTransferRecordsList(UserProjectTransferRecords userProjectTransferRecords)
{
return userProjectTransferRecordsMapper.selectUserProjectTransferRecordsList(userProjectTransferRecords);
}
/**
* 新增用户/项目转账信息记录
*
* @param userProjectTransferRecords 用户/项目转账信息记录
* @return 结果
*/
public int insertUserProjectTransferRecords(UserProjectTransferRecords userProjectTransferRecords)
{
userProjectTransferRecords.setCreateTime(DateUtils.getNowDate());
return userProjectTransferRecordsMapper.insertUserProjectTransferRecords(userProjectTransferRecords);
}
/**
* 修改用户/项目转账信息记录
*
* @param userProjectTransferRecords 用户/项目转账信息记录
* @return 结果
*/
public int updateUserProjectTransferRecords(UserProjectTransferRecords userProjectTransferRecords)
{
return userProjectTransferRecordsMapper.updateUserProjectTransferRecords(userProjectTransferRecords);
}
/**
* 批量删除用户/项目转账信息记录
*
* @param ids 需要删除的用户/项目转账信息记录主键
* @return 结果
*/
public int deleteUserProjectTransferRecordsByIds(Long[] ids)
{
return userProjectTransferRecordsMapper.deleteUserProjectTransferRecordsByIds(ids);
}
/**
* 删除用户/项目转账信息记录信息
*
* @param id 用户/项目转账信息记录主键
* @return 结果
*/
public int deleteUserProjectTransferRecordsById(Long id)
{
return userProjectTransferRecordsMapper.deleteUserProjectTransferRecordsById(id);
}
}

View File

@ -0,0 +1,116 @@
package com.microservices.dms.achievementLibrary.service.impl;
import java.util.Collections;
import java.util.List;
import com.microservices.common.core.utils.DateUtils;
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.microservices.dms.achievementLibrary.mapper.AchievementDictDataMapper;
import com.microservices.dms.achievementLibrary.domain.AchievementDictData;
import com.microservices.dms.achievementLibrary.service.IAchievementDictDataService;
/**
* 成果相关字典Service业务层处理
*
* @author microservices
* @date 2025-05-23
*/
@Service
public class AchievementDictDataServiceImpl implements IAchievementDictDataService
{
@Autowired
private AchievementDictDataMapper achievementDictDataMapper;
/**
* 查询成果相关字典
*
* @param dictCode 成果相关字典主键
* @return 成果相关字典
*/
@Override
public AchievementDictData selectAchievementDictDataByDictCode(Long dictCode)
{
return achievementDictDataMapper.selectAchievementDictDataByDictCode(dictCode);
}
/**
* 查询成果相关字典列表
*
* @param achievementDictData 成果相关字典
* @return 成果相关字典
*/
@Override
public List<AchievementDictData> selectAchievementDictDataList(AchievementDictData achievementDictData)
{
return achievementDictDataMapper.selectAchievementDictDataList(achievementDictData);
}
/**
* 新增成果相关字典
*
* @param achievementDictData 成果相关字典
* @return 结果
*/
@Override
public int insertAchievementDictData(AchievementDictData achievementDictData)
{
//判断字典是否存在存在则不管不存在则新增
String label = achievementDictData.getDictLabel();
String type = achievementDictData.getDictType();
int num = achievementDictDataMapper.selectDictDataByLabel(label,type);
if (num > 0){
return 0;
}else{
achievementDictData.setCreateTime(DateUtils.getNowDate());
return achievementDictDataMapper.insertAchievementDictData(achievementDictData);
}
}
/**
* 修改成果相关字典
*
* @param achievementDictData 成果相关字典
* @return 结果
*/
@Override
public int updateAchievementDictData(AchievementDictData achievementDictData)
{
achievementDictData.setUpdateTime(DateUtils.getNowDate());
return achievementDictDataMapper.updateAchievementDictData(achievementDictData);
}
/**
* 批量删除成果相关字典
*
* @param dictCodes 需要删除的成果相关字典主键
* @return 结果
*/
@Override
public int deleteAchievementDictDataByDictCodes(Long[] dictCodes)
{
return achievementDictDataMapper.deleteAchievementDictDataByDictCodes(dictCodes);
}
/**
* 删除成果相关字典信息
*
* @param dictCode 成果相关字典主键
* @return 结果
*/
@Override
public int deleteAchievementDictDataByDictCode(Long dictCode)
{
return achievementDictDataMapper.deleteAchievementDictDataByDictCode(dictCode);
}
@Override
public List<KeyValueVo> selectDictDataByType(String dictType) {
return achievementDictDataMapper.selectDictDataByType(dictType);
}
@Override
public List<String> getDictTypes() {
return achievementDictDataMapper.getDictTypes();
}
}

View File

@ -5,20 +5,28 @@ import java.util.stream.Collectors;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.alibaba.fastjson2.JSONObject;
import com.microservices.common.core.utils.DateUtils;
import com.microservices.common.core.utils.StringUtils;
import com.microservices.common.httpClient.service.HttpAPIService;
import com.microservices.common.security.utils.SecurityUtils;
import com.microservices.dms.achievementLibrary.domain.*;
import com.microservices.dms.achievementLibrary.mapper.SchoolEnterpriseAchievementsMapper;
import com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo;
import com.microservices.dms.behaviorImage.domain.AchievementImageVo;
import com.microservices.dms.behaviorImage.service.IBehaviorImageService;
import com.microservices.dms.resourceLibrary.domain.Clicker;
import com.microservices.dms.resourceLibrary.domain.CompetitionResourceLibrary;
import com.microservices.dms.resourceLibrary.domain.Searcher;
import com.microservices.dms.resourceLibrary.domain.TaskResourceLibrary;
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
import com.microservices.dms.resourceLibrary.mapper.CompetitionResourceLibraryMapper;
import com.microservices.dms.resourceLibrary.mapper.ExpertResourceLibraryMapper;
import com.microservices.dms.resourceLibrary.mapper.ProjectResourceLibraryMapper;
import com.microservices.dms.resourceLibrary.mapper.TaskResourceLibraryMapper;
import com.microservices.dms.utils.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.K;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
@ -26,6 +34,7 @@ import org.springframework.stereotype.Service;
import com.microservices.dms.achievementLibrary.mapper.AchievementsMapper;
import com.microservices.dms.achievementLibrary.service.IAchievementsService;
import static com.microservices.dms.constant.BlockChainFunConstants.QUERY_REPO;
import static com.microservices.dms.utils.UrlUtil.getUrlPath;
/**
@ -35,6 +44,7 @@ import static com.microservices.dms.utils.UrlUtil.getUrlPath;
* @date 2025-04-02
*/
@Service
@Slf4j
public class AchievementsServiceImpl implements IAchievementsService {
@Autowired
private AchievementsMapper achievementsMapper;
@ -45,8 +55,6 @@ public class AchievementsServiceImpl implements IAchievementsService {
@Autowired
private ExpertResourceLibraryMapper expertResourceLibraryMapper;
@Autowired
private ProjectResourceLibraryMapper projectResourceLibraryMapper;
@Autowired
private IBehaviorImageService behaviorImageService;
@ -60,7 +68,6 @@ public class AchievementsServiceImpl implements IAchievementsService {
@Value("${http.gatewayUrl}")
public String gatewayUrl;
/**
* 查询成果
*
@ -70,20 +77,25 @@ public class AchievementsServiceImpl implements IAchievementsService {
@Override
public Achievements selectAchievementsById(Long id) {
Achievements a = achievementsMapper.selectAchievementsById(id);
if(StringUtils.isNotNull(a)){
if (StringUtils.isNotNull(a)) {
String gender = a.getGender();
String img = "images/avatars/User/boy.jpg";
if(StringUtils.isNotEmpty(gender) && gender.equals("1")){
String img = "";
if (StringUtils.isNotEmpty(gender) && gender.equals("1")) {
img = "images/avatars/User/girl.jpg";
} else if (StringUtils.isNotEmpty(gender) && gender.equals("0")) {
img = "images/avatars/User/boy.jpg";
}
a.setUserImg(img);
if(StringUtils.isNotEmpty(a.getField1())) {
if (StringUtils.isNotEmpty(a.getField1())) {
String field1Name = achievementsMapper.getField1NameByParam(a.getSource(), a.getId());
if (StringUtils.isNotNull(field1Name)) {
a.setField1Name(field1Name);
}
}
a.setUserImg(img);
a.setImages(buildFileInfoByIdents(a.getImages(), a.getSource()));
a.setAttachments(buildFileInfoByIdents(a.getAttachments(), a.getSource()));
}
return a;
}
@ -99,13 +111,15 @@ public class AchievementsServiceImpl implements IAchievementsService {
List<Achievements> list = achievementsMapper.selectAchievementsList(achievements);
for (Achievements a : list) {
String gender = a.getGender();
String img = "images/avatars/User/boy.jpg";
if(StringUtils.isNotEmpty(gender) && gender.equals("1")){
String img = "";
if (StringUtils.isNotEmpty(gender) && gender.equals("1")) {
img = "images/avatars/User/girl.jpg";
} else if (StringUtils.isNotEmpty(gender) && gender.equals("0")) {
img = "images/avatars/User/boy.jpg";
}
a.setUserImg(img);
//根据id获取领域名称
if(StringUtils.isNotEmpty(a.getField1())) {
if (StringUtils.isNotEmpty(a.getField1())) {
String field1Name = achievementsMapper.getField1NameByParam(a.getSource(), a.getId());
if (StringUtils.isNotNull(field1Name)) {
a.setField1Name(field1Name);
@ -113,6 +127,10 @@ public class AchievementsServiceImpl implements IAchievementsService {
}
a.setImages(buildFileInfoByIdents(a.getImages(), a.getSource()));
a.setAttachments(buildFileInfoByIdents(a.getAttachments(), a.getSource()));
//拼接对接的用户信息
List<Map<String,Object>> dockingUserInfo = achievementsMapper.getDockingUserInfoList(a.getId());
a.setDockingUserInfo(dockingUserInfo);
}
return list;
}
@ -174,6 +192,14 @@ public class AchievementsServiceImpl implements IAchievementsService {
*/
@Override
public int deleteAchievementsById(Long id) {
//根据id获取数据仓库该数据信息
Achievements achievements = achievementsMapper.selectAchievementsById(id);
if(achievements != null){
String source = achievements.getSource();
if(StringUtils.isNotEmpty(source)) {
achievementsMapper.updateRelationAchievements(source,achievements.getSourceId());
}
}
return achievementsMapper.deleteAchievementsById(id);
}
@ -183,25 +209,26 @@ public class AchievementsServiceImpl implements IAchievementsService {
return aStr;
}
List<Map<String,String>> list = JSON.parseObject(aStr,new TypeReference<List<Map<String,String>>>() {});
List<Map<String, String>> list = JSON.parseObject(aStr, new TypeReference<List<Map<String, String>>>() {
});
if (Objects.equals(source, "1") || Objects.equals(source, "3")) {
concatUrl(list,gitLinkUrl);
concatUrl(list, gitLinkUrl);
}
if (Objects.equals(source, "2")) {
concatUrl(list,markerSpaceUrl);
concatUrl(list, markerSpaceUrl);
}
if (Objects.equals(source, "4")) {
concatUrl(list,gatewayUrl);
concatUrl(list, gatewayUrl);
}
return JSON.toJSONString(list);
}
private void concatUrl(List<Map<String, String>> list, String url) {
for (Map<String,String> map : list) {
for (Map<String, String> map : list) {
String v = map.getOrDefault("v", "");
String urlPath = getUrlPath(v);
map.put("v", url + urlPath);
@ -231,13 +258,15 @@ public class AchievementsServiceImpl implements IAchievementsService {
//遍历成果数据获取对应成果的点击数
for (Achievements a : list) {
String gender = a.getGender();
String img = "images/avatars/User/boy.jpg";
if(StringUtils.isNotEmpty(gender) && gender.equals("1")){
String img = "";
if (StringUtils.isNotEmpty(gender) && gender.equals("1")) {
img = "images/avatars/User/girl.jpg";
} else if (StringUtils.isNotEmpty(gender) && gender.equals("0")) {
img = "images/avatars/User/boy.jpg";
}
a.setUserImg(img);
//根据id获取领域名称
if(StringUtils.isEmpty(achQueryVo.getSource()) && StringUtils.isNotEmpty(a.getField1())) {
if (StringUtils.isEmpty(achQueryVo.getSource()) && StringUtils.isNotEmpty(a.getField1())) {
String field1Name = achievementsMapper.getField1NameByParam(a.getSource(), a.getId());
if (StringUtils.isNotNull(field1Name)) {
a.setField1Name(field1Name);
@ -281,8 +310,21 @@ public class AchievementsServiceImpl implements IAchievementsService {
}
@Override
public List<Map<String, String>> getHotAchievement() {
return achievementsMapper.getHotAchievement();
public List<HotAchVo> getHotAchievement() {
//根据查询条件获取所有的成果数据
List<HotAchVo> resultList = achievementsMapper.getHotAchievement();
//遍历成果数据获取对应成果的点击数
for (HotAchVo a : resultList) {
String gender = a.getGender();
String img = "";
if (StringUtils.isNotEmpty(gender) && gender.equals("1")) {
img = "images/avatars/User/girl.jpg";
} else if (StringUtils.isNotEmpty(gender) && gender.equals("0")) {
img = "images/avatars/User/boy.jpg";
}
a.setUserImg(img);
}
return resultList;
}
@Override
@ -304,6 +346,24 @@ public class AchievementsServiceImpl implements IAchievementsService {
return res;
}
@Override
public List<KeyValVo<String, Long>> get7DayAddExport(AchQueryVo achQueryVo) {
Date[] days = DateUtil.getDays(0, 6);
Map<String, Long> w = achievementsMapper.getExperts(days[0], days[1])
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
List<String> dateStr = DateUtil.getDateStrMMDD(days[0], days[1]);
List<KeyValVo<String, Long>> res = new ArrayList<>();
for (String s : dateStr) {
Long a = w.getOrDefault(s, 0L);
KeyValVo<String, Long> k1 = new KeyValVo<>();
k1.setK(s);
k1.setV(a);
res.add(k1);
}
return res;
}
@Override
public Map<String, Long> indexProjectStatistic() {
Map<String, Long> res = achievementsMapper.indexProjectStatistic();
@ -313,7 +373,7 @@ public class AchievementsServiceImpl implements IAchievementsService {
@Override
public Map<String, Object> indexTaskStatistic() {
Map<String, Object> res = achievementsMapper.indexTaskStatistic();
double convertedTaskAmount = taskResourceLibraryMapper.getConvertedTaskAmount();
double convertedTaskAmount = taskResourceLibraryMapper.getConvertedTaskAmount2();
res.put("convertedTaskAmount", convertedTaskAmount);
return res;
}
@ -367,10 +427,13 @@ public class AchievementsServiceImpl implements IAchievementsService {
}
@Override
public List<KeyValVo<String, Long>> get7AddClickById(String id) {
public List<KeyValVo<String, Long>> get7AddClickById(String id, String clickType) {
if (StringUtils.isEmpty(clickType)) {
clickType = "Achievements";
}
Date[] days = DateUtil.getDays(0, 6);
Map<String, Long> w = achievementsMapper.get7AddClickById(days[0], days[1], "Achievements", id)
Map<String, Long> w = achievementsMapper.get7AddClickById(days[0], days[1], clickType, id)
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
List<String> dateStr = DateUtil.getDateStrMMDD(days[0], days[1]);
@ -407,7 +470,19 @@ public class AchievementsServiceImpl implements IAchievementsService {
@Override
public List<AreaStatisticVo> getAreaStatistic(String areaKey) {
return achievementsMapper.getAreaStatistic(areaKey);
List<AreaStatisticVo> areaStatisticVoList = new ArrayList<>();
if(StringUtils.isNotEmpty(areaKey)) {
//根据逗号进行分割
String[] res =areaKey.split(",");
for (String s : res) {
String[] ss = s.split("_");
List<AreaStatisticVo> tmpList = achievementsMapper.getAreaStatistic(ss[1],ss[0]);
areaStatisticVoList.addAll(tmpList);
}
return areaStatisticVoList;
}else{
return achievementsMapper.getAreaStatistic(null,areaKey);
}
}
@Override
@ -429,6 +504,55 @@ public class AchievementsServiceImpl implements IAchievementsService {
return relatedResultList;
}
@Override
public List<AchRelatedResult> getRelatedAchCompetition(Long id, Long sourceId) {
List<AchRelatedResult> relatedResultList = new ArrayList<>();
//想根据开源项目id获取对应的年度信息
List<Long> allSourceId = achievementsMapper.getAllSourceIdCompetition(id, sourceId);
List<String> allYear = achievementsMapper.getDistinctYear(id, allSourceId);
if (StringUtils.isNotNull(allYear)) {
//遍历年度信息获取年度成果数据
for (String paramYear : allYear) {
AchRelatedResult relatedResult = new AchRelatedResult();
relatedResult.setYear(paramYear);
List<AchRelatedVo> tmpList = achievementsMapper.getRelatedAch(id, allSourceId, paramYear);
relatedResult.setAchRelatedVoList(tmpList);
relatedResultList.add(relatedResult);
}
}
return relatedResultList;
}
@Override
public List<AchRelatedResult> getRelatedAchTask(Long id, Long sourceId) {
List<AchRelatedResult> relatedResultList = new ArrayList<>();
//想根据开源项目id获取对应的年度信息
List<Long> allSourceId = achievementsMapper.getAllSourceIdTask(id, sourceId);
List<String> allYear = achievementsMapper.getDistinctYear(id, allSourceId);
if (StringUtils.isNotNull(allYear)) {
//遍历年度信息获取年度成果数据
for (String paramYear : allYear) {
AchRelatedResult relatedResult = new AchRelatedResult();
relatedResult.setYear(paramYear);
List<AchRelatedVo> tmpList = achievementsMapper.getRelatedAch(id, allSourceId, paramYear);
relatedResult.setAchRelatedVoList(tmpList);
relatedResultList.add(relatedResult);
}
}
return relatedResultList;
}
@Override
public List<TaskResourceLibrary> getRelatedAchTaskOfExpert(Long id) {
return achievementsMapper.getRelatedAchTaskOfExpert(id);
}
@Override
public List<CompetitionResourceLibrary> getRelatedAchCompetitionOfExpert(Long id) {
return achievementsMapper.getRelatedAchCompetitionOfExpert(id);
}
/**
* 根据查询内容调用搜索行为接口
*
@ -466,4 +590,37 @@ public class AchievementsServiceImpl implements IAchievementsService {
public List<String> getExpertAreasByName(String areaName) {
return achievementsMapper.getExpertAreasByName(areaName);
}
@Override
public AchDetailVo getAreaDetail(String areaKey,String kyxmSum, String source) {
AchDetailVo achDetailVo = new AchDetailVo();
AchQueryVo achQueryVo = new AchQueryVo();
achQueryVo.setAreaQuery(areaKey);
achQueryVo.setSource(source);
//根据kye,和source,查询领域描述
String remark = achievementsMapper.getField1RemarkByParam(source,areaKey);
achDetailVo.setRemark(remark);
List<Achievements> achievementsList = achievementsMapper.selectAchievementsByArea(achQueryVo);
if(achievementsList!=null && achievementsList.size()>0) {
achDetailVo.setAchievementsList(achievementsList);
long clickSum = achievementsList.stream().mapToLong(Achievements::getClickSum).sum();
achDetailVo.setClickSum(clickSum);
long dockSum = achievementsList.stream().mapToLong(Achievements::getDockSum).sum();
achDetailVo.setDockSum(dockSum);
long favoriteSum = achievementsList.stream().mapToLong(Achievements::getFavoriteSum).sum();
achDetailVo.setFavoriteSum(favoriteSum);
long watcherSum = achievementsList.stream().mapToLong(Achievements::getWatcherSum).sum();
achDetailVo.setWatcherSum(watcherSum);
}
return achDetailVo;
}
@Override
public List<KeyValueVo> getAllAreas(String areaName) {
List<KeyValueVo> resultVal = achievementsMapper.getAllAreas(areaName);
return resultVal;
}
}

View File

@ -1,14 +1,13 @@
package com.microservices.dms.achievementLibrary.service.impl;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.*;
import java.util.stream.Collectors;
import com.microservices.common.core.exception.ServiceException;
import com.microservices.common.core.utils.DateUtils;
import com.microservices.common.core.utils.StringUtils;
import com.microservices.common.security.utils.SecurityUtils;
import com.microservices.dms.achievementLibrary.domain.AchievementTeam;
import com.microservices.dms.achievementLibrary.domain.Achievements;
import com.microservices.dms.achievementLibrary.mapper.AchievementTeamMapper;
import com.microservices.dms.achievementLibrary.mapper.AchievementsMapper;
@ -49,7 +48,15 @@ public class SchoolEnterpriseAchievementsServiceImpl implements ISchoolEnterpris
@Override
public SchoolEnterpriseAchievements selectSchoolEnterpriseAchievementsById(Long id)
{
return schoolEnterpriseAchievementsMapper.selectSchoolEnterpriseAchievementsById(id);
SchoolEnterpriseAchievements sAchievements = schoolEnterpriseAchievementsMapper.selectSchoolEnterpriseAchievementsById(id);
if(StringUtils.isNotNull(sAchievements)){
Long achId = sAchievements.getId();
List<AchievementTeam> teamList = achievementTeamMapper.selectAchievementTeamByAchId(achId);
if(StringUtils.isNotNull(teamList) && teamList.size() > 0){
sAchievements.setTeamList(teamList);
}
}
return sAchievements;
}
/**
@ -74,6 +81,16 @@ public class SchoolEnterpriseAchievementsServiceImpl implements ISchoolEnterpris
return list;
}
@Override
public List<SchoolEnterpriseAchievements> listFront(SchoolEnterpriseAchievements schoolEnterpriseAchievements) {
LoginUser loginUser = SecurityUtils.getLoginUser();
if (loginUser != null) {
String username = loginUser.getUsername();
schoolEnterpriseAchievements.setCreateBy(username);
}
return selectSchoolEnterpriseAchievementsList(schoolEnterpriseAchievements);
}
/**
* 新增校企成果
*
@ -103,6 +120,13 @@ public class SchoolEnterpriseAchievementsServiceImpl implements ISchoolEnterpris
public int updateSchoolEnterpriseAchievements(SchoolEnterpriseAchievements schoolEnterpriseAchievements)
{
schoolEnterpriseAchievements.setUpdateTime(DateUtils.getNowDate());
String status = schoolEnterpriseAchievements.getStatus();
if(StringUtils.isNotEmpty(status)){
schoolEnterpriseAchievements.setReviewDate(DateUtils.getNowDate());
if (SecurityUtils.getLoginUser() != null) {
schoolEnterpriseAchievements.setReviewer(SecurityUtils.getLoginUser().getUsername());
}
}
return schoolEnterpriseAchievementsMapper.updateSchoolEnterpriseAchievements(schoolEnterpriseAchievements);
}

View File

@ -116,9 +116,8 @@ public class BehaviorImageController extends BaseController {
List<ActivityUserLibrary> list = behaviorImageService.selectActivityUserLibraryList(activityUserLibrary);
return getDataTable(list);
}
/**
* 根据用户ID,获取用户对应的成果汇总
*/
@ApiOperation("/根据用户ID,获取用户对应的成果汇总")
@GetMapping(value = "/getUserTypeStatistic")
public AjaxResult getUserTypeStatistic(@PathVariable("userId") Long userId)
{
@ -171,4 +170,12 @@ public class BehaviorImageController extends BaseController {
{
return AjaxResult.success(behaviorImageService.getActivityStatistic());
}
@GetMapping(value = "/getUserBehaviorSum")
@ApiOperation("获取用户的所有关注、点赞数")
public AjaxResult getUserBehaviorSum(Long userId)
{
return AjaxResult.success(behaviorImageService.getUserBehaviorSum(userId));
}
}

View File

@ -11,6 +11,16 @@ public class AchievementBehaviorSumVo {
private Long favoriteSum;
//下载量
private Long downloadSum;
//成果用户对接
private Long userDockingSum;
public Long getUserDockingSum() {
return userDockingSum;
}
public void setUserDockingSum(Long userDockingSum) {
this.userDockingSum = userDockingSum;
}
public Long getClickSum() {
return clickSum;

View File

@ -0,0 +1,36 @@
package com.microservices.dms.behaviorImage.domain;
import lombok.Data;
public class ActivityUserTotal {
//活跃用户
private Long totalUser;
//活跃用户专家数
private Long totalExpert;
//活跃用户实名认证
private Long authTotal;
public Long getTotalUser() {
return totalUser;
}
public void setTotalUser(Long totalUser) {
this.totalUser = totalUser;
}
public Long getTotalExpert() {
return totalExpert;
}
public void setTotalExpert(Long totalExpert) {
this.totalExpert = totalExpert;
}
public Long getAuthTotal() {
return authTotal;
}
public void setAuthTotal(Long authTotal) {
this.authTotal = authTotal;
}
}

View File

@ -2,10 +2,7 @@ package com.microservices.dms.behaviorImage.mapper;
import com.microservices.common.datasource.annotation.Slave;
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
import com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo;
import com.microservices.dms.behaviorImage.domain.ActivityUserLibrary;
import com.microservices.dms.behaviorImage.domain.BehaviorImageWeight;
import com.microservices.dms.behaviorImage.domain.UserTypeTotalVo;
import com.microservices.dms.behaviorImage.domain.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -98,5 +95,9 @@ public interface BehaviorImageMapper {
List<UserTypeTotalVo> getUserTypeStatistic(@Param("userId")Long userId);
List<KeyValueVo> getActivityStatistic();
ActivityUserTotal getActivityStatistic();
List<ActivityUserLibrary> selectActivityUserLibraryListAll(ActivityUserLibrary activityUserLibrary);
UserTypeTotalVo getUserBehaviorSum(@Param("userId")Long userId);
}

View File

@ -75,5 +75,7 @@ public interface IBehaviorImageService {
UserExpertTotalVo getUserExpertStatistic(Long userId);
List<KeyValueVo> getActivityStatistic();
ActivityUserTotal getActivityStatistic();
UserTypeTotalVo getUserBehaviorSum(Long userId);
}

View File

@ -309,7 +309,7 @@ public class BehaviorImageServiceImpl implements IBehaviorImageService {
}
@Override
public List<KeyValueVo> getActivityStatistic() {
public ActivityUserTotal getActivityStatistic() {
return behaviorImageMapper.getActivityStatistic();
}
@ -318,19 +318,30 @@ public class BehaviorImageServiceImpl implements IBehaviorImageService {
* @param activityUserLibrary 活跃用户资源库
* @return
*/
// @Override
// public List<ActivityUserLibrary> selectActivityUserLibraryList(ActivityUserLibrary activityUserLibrary) {
// List<ActivityUserLibrary> list = behaviorImageMapper.selectActivityUserLibraryList(activityUserLibrary);
// for (ActivityUserLibrary a : list) {
// Long relatedProject= behaviorImageMapper.getrelatedProjectCount(a.getUserId());
// a.setRelatedProject(relatedProject);
// Long relatedTask= behaviorImageMapper.getrelatedTaskCount(a.getUserId());
// a.setRelatedTask(relatedTask);
// Long relatedCompetition= behaviorImageMapper.getrelatedCompetitionCount(a.getUserId());
// a.setRelatedCompetition(relatedCompetition);
// Long relatedMemo= behaviorImageMapper.getrelatedMemoCount(a.getUserId());
// a.setRelatedMemo(relatedMemo);
// }
// return list;
// }
@Override
public List<ActivityUserLibrary> selectActivityUserLibraryList(ActivityUserLibrary activityUserLibrary) {
List<ActivityUserLibrary> list = behaviorImageMapper.selectActivityUserLibraryList(activityUserLibrary);
for (ActivityUserLibrary a : list) {
Long relatedProject= behaviorImageMapper.getrelatedProjectCount(a.getUserId());
a.setRelatedProject(relatedProject);
Long relatedTask= behaviorImageMapper.getrelatedTaskCount(a.getUserId());
a.setRelatedTask(relatedTask);
Long relatedCompetition= behaviorImageMapper.getrelatedCompetitionCount(a.getUserId());
a.setRelatedCompetition(relatedCompetition);
Long relatedMemo= behaviorImageMapper.getrelatedMemoCount(a.getUserId());
a.setRelatedMemo(relatedMemo);
}
List<ActivityUserLibrary> list = behaviorImageMapper.selectActivityUserLibraryListAll(activityUserLibrary);
return list;
}
@Override
public UserTypeTotalVo getUserBehaviorSum(Long userId) {
return behaviorImageMapper.getUserBehaviorSum(userId);
}
}

View File

@ -4,17 +4,25 @@ import com.microservices.common.core.web.controller.BaseController;
import com.microservices.common.core.web.domain.AjaxResult;
import com.microservices.common.core.web.page.TableDataInfo;
import com.microservices.dms.achievementLibrary.domain.AchQueryVo;
import com.microservices.dms.achievementLibrary.service.BlockChainService;
import com.microservices.dms.achievementLibrary.service.IAchievementsService;
import com.microservices.dms.common.vo.*;
import com.microservices.dms.resourceLibrary.domain.ExpertResourceLibrary;
import com.microservices.dms.resourceLibrary.service.IExpertResourceLibraryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.List;
/**
@ -32,6 +40,9 @@ public class OpenController extends BaseController {
@Autowired
private IExpertResourceLibraryService expertResourceLibraryService;
@Autowired
private BlockChainService blockChainService;
/**
* 获取精选成果
*
@ -114,6 +125,11 @@ public class OpenController extends BaseController {
return success(achievementsService.get7DayAdd(achQueryVo));
}
@ApiOperation("七日新增专家")
@GetMapping("/achievements/get7DayAddExpert")
public AjaxResult get7DayAddExport(AchQueryVo achQueryVo) {
return success(achievementsService.get7DayAddExport(achQueryVo));
}
@ApiOperation("首页项目统计")
@GetMapping("/achievements/indexProjectStatistic")
@ -157,4 +173,51 @@ public class OpenController extends BaseController {
return getDataTable(list);
}
@GetMapping("/downloadAch")
@ApiOperation("成果征集信息下载")
public ResponseEntity<Resource> downloadAch() throws IOException {
String fileName = "红山开源优秀科研成果信息征集.zip";
Resource resource = new ClassPathResource(fileName);
if (!resource.exists()) {
throw new RuntimeException("文件不存在: " + fileName);
}
String encodedFileName = URLEncoder.encode(fileName, String.valueOf(StandardCharsets.UTF_8))
.replace("+", "%20");
return ResponseEntity.ok()
.header(HttpHeaders.CONTENT_DISPOSITION,
"attachment; filename*=UTF-8''" + encodedFileName)
.contentType(MediaType.APPLICATION_OCTET_STREAM)
.body(resource);
}
// @ApiOperation("提供给开源项目那边新建项目并且use_blockchain='1'的项目数据")
// @PostMapping("/blockChain/projectCreate")
// public AjaxResult projectCreate (@RequestBody ProjectCreateVo projectCreateVo) {
// return blockChainService.projectCreate(projectCreateVo);
// }
@ApiOperation("提供给开源项目那边新建issue、更新issue时调用调用方法时传入相关数据(项目入链并且悬赏金额不为空的issue数据才调用封装方法)")
@PostMapping("/blockChain/issueCreateUpdate")
public AjaxResult issueCreateUpdate (@RequestBody IssueCreateVo issueCreateVo) {
return blockChainService.issueCreateUpdate(issueCreateVo);
}
@ApiOperation("提供给开源项目那边提交commit调用调用方法时传入相关数据(入链项目提交commit才调用)")
@PostMapping("/blockChain/commitCreate")
public AjaxResult commitCreate(@RequestBody CommitCreateVo commitCreateVo) {
return blockChainService.commitCreate(commitCreateVo);
}
@ApiOperation("提供给开源项目那边新建pr时调用调用方法时传入相关数据(入链项目pr_合并代码才调用))")
@PostMapping("/blockChain/prCreate")
public AjaxResult prCreate(@RequestBody PrCreateVo prCreateVo) {
return blockChainService.prCreate(prCreateVo);
}
@ApiOperation("封装方法userCreate入链项目2519用户1向用户2转帐10个金币")
@PostMapping("/blockChain/userCreate")
public AjaxResult userCreate(@RequestBody UserCreateVo userCreateVo) {
return blockChainService.userCreate(userCreateVo);
}
}

View File

@ -0,0 +1,12 @@
package com.microservices.dms.common.vo;
import lombok.Data;
@Data
public class CommitCreateVo {
private String commit_id;
private String project_id;
private String commit_diff;
}

View File

@ -0,0 +1,10 @@
package com.microservices.dms.common.vo;
import lombok.Data;
@Data
public class CommitResultVo {
private String commitId;
private String commitDiff;
}

View File

@ -0,0 +1,14 @@
package com.microservices.dms.common.vo;
public class IssueCreateVo {
public String getIssue_id() {
return issue_id;
}
public void setIssue_id(String issue_id) {
this.issue_id = issue_id;
}
private String issue_id;
}

View File

@ -0,0 +1,137 @@
package com.microservices.dms.common.vo;
import lombok.Data;
public class PrCreateQueryVo {
private String merge_user;
private String target_branch;
private String created_at;
private String title;
private String pull_request_id;
private String content;
private String source_branch;
private String reponame;
private String updated_at;
private String repo_id;
private Long pull_request_number;
private String action;
private String username;
public String getMerge_user() {
return merge_user;
}
public void setMerge_user(String merge_user) {
this.merge_user = merge_user;
}
public String getTarget_branch() {
return target_branch;
}
public void setTarget_branch(String target_branch) {
this.target_branch = target_branch;
}
public String getCreated_at() {
return created_at;
}
public void setCreated_at(String created_at) {
this.created_at = created_at;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getPull_request_id() {
return pull_request_id;
}
public void setPull_request_id(String pull_request_id) {
this.pull_request_id = pull_request_id;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getSource_branch() {
return source_branch;
}
public void setSource_branch(String source_branch) {
this.source_branch = source_branch;
}
public String getReponame() {
return reponame;
}
public void setReponame(String reponame) {
this.reponame = reponame;
}
public String getUpdated_at() {
return updated_at;
}
public void setUpdated_at(String updated_at) {
this.updated_at = updated_at;
}
public String getRepo_id() {
return repo_id;
}
public void setRepo_id(String repo_id) {
this.repo_id = repo_id;
}
public Long getPull_request_number() {
return pull_request_number;
}
public void setPull_request_number(Long pull_request_number) {
this.pull_request_number = pull_request_number;
}
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
}

View File

@ -0,0 +1,13 @@
package com.microservices.dms.common.vo;
public class PrCreateVo {
private String pr_id;
public String getPr_id() {
return pr_id;
}
public void setPr_id(String pr_id) {
this.pr_id = pr_id;
}
}

View File

@ -0,0 +1,11 @@
package com.microservices.dms.common.vo;
import lombok.Data;
@Data
public class ProjectCreateVo {
private String owner;//项目创建者nickname
private String token_name;//项目id
private Long cur_supply;//项目创建者的初始token
private Long total_supply;
}

View File

@ -0,0 +1,64 @@
package com.microservices.dms.common.vo;
public class UserCreateVo {
private String payee;
private Long amount;
private String token_name;
private String payer;
private String actionType;
private String typeId;
public String getPayee() {
return this.payee;
}
public void setPayee(String payee) {
this.payee = payee;
}
public Long getAmount() {
return this.amount;
}
public void setAmount(Long amount) {
this.amount = amount;
}
public String getToken_name() {
return this.token_name;
}
public void setToken_name(String token_name) {
this.token_name = token_name;
}
public String getPayer() {
return this.payer;
}
public void setPayer(String payer) {
this.payer = payer;
}
public String getActionType() {
return actionType;
}
public void setActionType(String actionType) {
this.actionType = actionType;
}
public String getTypeId() {
return typeId;
}
public void setTypeId(String typeId) {
this.typeId = typeId;
}
}

View File

@ -0,0 +1,50 @@
package com.microservices.dms.constant;
/**
* 区块链方法常量
*/
public class BlockChainFunConstants {
public static final String CREATE_REPO = "create repo"; //项目入链
public static final String QUERY_REPO = "query repo basic info"; //项目入链信息查询
public static final String USER_SINGLE_REPO = "query user balance of single repo"; //单个项目某个用户token
public static final String USER_ALL_REPOS = "query user balance of all repos"; //某个用户所有项目token
public static final String CREATE_COMMIT = "upload commit info"; //Commit新增入链
public static final String QUERY_COMMIT = "query commit info"; //Commit入链信息查询
public static final String CREATE_PR = "upload pull request info"; //Pr新增入链
public static final String QUERY_PR_LATEST = "query pull request latest info"; //单个pr入链所有信息
public static final String QUERY_PR_ALL = "query pull request all info"; //单个pr最后一次入链信息
public static final String CREATE_UPDATE_ISSUE = "upload issue info"; //Issue新增修改入链
public static final String QUERY_ISSUE_LATEST = "query issue latest info"; //单个Issue最后一次入链信息
public static final String QUERY_ISSUE_ALL = "query issue all info"; //单个Issue入链所有信息
public static final String ADD_USER_BALANCE = "add user balance"; //项目分配token用户token新增
public static final String MINUS_USER_BALANCE = "minus user balance"; //项目分配token-用户token减少
public static final String LOCK_USER_BALANCE = "lock user balance"; //用户转账token-将自己token分配给本项目中的其他用户
public static final String TRANSFER_AMOUNT = "transfer amount";
public static final String REQUEST_TYPE = "request-type";
public static final String TX_HASH = "tx_hash";
public static final String RESP_STATUS = "status";
public static final String GET_BLOCK_NUM = "getBlockNum";
public static final String GET_TOTAL_TRANSACTION_COUNTT = "getTotalTransactionCountT";
public static final String GET_TRANSACTION_BYHASH = "getTransactionByHash";
public static final String GET_TRANSACTION_RECEIPT = "getTransactionReceipt";
public static final String PROJECT_INFO = "projectInfo";
public static final String COMMIT_INTO = "commitInfo";
public static final String PR_LATEST_INFO = "prLatestInfo";
public static final String PR_ALL_INFO = "prAllInfo";
public static final String ISSUE_LATEST_INFO = "issueLatestInfo";
public static final String ISSUE_ALL_INFO = "issueAllInfo";
public static final String USER_SINGLE_INFO = "userSingleInfo";
public static final String USER_ALL_INFO = "userAllInfo";
}

View File

@ -2,7 +2,8 @@ package com.microservices.dms.constant;
public class TaskConstant {
private TaskConstant() {}
private TaskConstant() {
}
public static final String TASK_TYPE_WATCHERS = "MakerTask";
public static final String TASK_TYPE_JOURNALS = "makerSpaceTask";
@ -22,4 +23,16 @@ public class TaskConstant {
public static final String EXPERTS = "Experts";
public static final String ACHIEVEMENTS = "Achievements";
// task status dict
public static final int DRAFT_STATUS = 0; //草稿状态
public static final int TO_BE_REVIEWED_STATUS = 1; //待审核状态
public static final int REFUSED_STATUS = 2; //已拒绝状态
public static final int TASK_PAPER_COLLECTING_STATUS = 3; //成果征集中状态
public static final int TASK_PAPER_CHOOSING_STATUS = 4; //成果评选中状态
public static final int TASK_RESULT_PROOF_STATUS = 5; //公示中状态
public static final int TASK_SIGNING_STATUS = 6; //协议签定中状态
public static final int TASK_PAYING_STATUS = 7; //支付中状态
public static final int TASK_COMPLETE_STATUS = 8; //任务完成状态
public static final int TASK_TO_BE_REPAIRED_STATUS = 9; //待修缮状态
}

View File

@ -4,13 +4,17 @@ import com.microservices.common.core.web.domain.AjaxResult;
import com.microservices.dms.referral.service.TalentReferralService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.RequiredArgsConstructor;
import lombok.ToString;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@Api(tags = "数据管理体系-人才推荐接口")
@Data
@Api(tags = "数据管理体系-推荐接口")
@RestController
@RequestMapping("/talentReferral")
@RequiredArgsConstructor
@ -21,12 +25,33 @@ public class TalentReferralController {
@GetMapping("/issueTalentReferral")
@ApiOperation(value = "疑修人才推荐")
public AjaxResult issueTalentReferral(@RequestParam("issueId") Long issueId, @RequestParam("projectId") Long projectId) {
return AjaxResult.success(talentReferralService.issueTalentReferral(issueId, projectId));
return AjaxResult.success(talentReferralService.doIssueTalentReferral(issueId, projectId));
}
@GetMapping("/pullRequestTalentReferral")
@ApiOperation(value = "PR人才推荐")
public AjaxResult pullRequestTalentReferral(@RequestParam("prId") Long prId, @RequestParam("projectId") Long projectId) {
return AjaxResult.success(talentReferralService.PRTalentReferral(prId, projectId));
return AjaxResult.success(talentReferralService.doPRTalentReferral(prId, projectId));
}
@GetMapping("/taskAchievementTalentReferral")
@ApiOperation(value = "任务成果推荐")
public AjaxResult taskAchievementTalentReferral(@RequestParam("taskId") Long taskId) {
return AjaxResult.success(talentReferralService.taskAchievementTalentReferral(taskId));
}
@GetMapping("/taskExpertTalentReferral")
@ApiOperation(value = "任务专家推荐")
public AjaxResult taskExpertTalentReferral(@RequestParam("taskId") Long taskId) {
return AjaxResult.success(talentReferralService.taskExpertTalentReferral(taskId));
}
@GetMapping("/competitionExpertTalentReferral")
@ApiOperation(value = "竞赛专家推荐")
public AjaxResult competitionExpertTalentReferral(@RequestParam("competitionId") Long competitionId) {
return AjaxResult.success(talentReferralService.competitionExpertTalentReferral(competitionId));
}
}

View File

@ -1,12 +1,14 @@
package com.microservices.dms.referral.mapper;
import com.microservices.common.datasource.annotation.Slave;
import com.microservices.dms.referral.vo.IssuesVo;
import com.microservices.dms.referral.vo.PullRequestVo;
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
import com.microservices.dms.referral.vo.*;
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
@Mapper
@Slave
@ -27,4 +29,22 @@ public interface TalentReferralMapper {
String selectRepositoriesUrl(@Param("id") Long id);
Long selectIdByLogin(@Param("login") String login);
List<TaskVo> selectTaskByStatus(@Param("statusIds") List<Integer> statusIds);
Map<String, Object> selectUsersById(@Param("id") Long id);
TaskVo selectTaskById(@Param("id") Long id);
List<ExpertVo> selectExpertsBy(ExpertVo expertVo);
List<KeyValVo<Long,String>> allTaskWithExpertIds(@Param("type") String type);
TaskVo selectCompetitionById(Long competitionId);
List<TaskVo> selectCompetitionIdByStatus();
PrInfoVo selectPRInfoById(@Param("id") Integer id);
int selectProjectById(@Param("tokenName") String tokenName);
}

View File

@ -2,14 +2,17 @@ package com.microservices.dms.referral.service;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.google.common.collect.Lists;
import com.microservices.common.core.exception.ServiceException;
import com.microservices.common.core.utils.StringUtils;
import com.microservices.common.httpClient.util.GitLinkRequestHelper;
import com.microservices.dms.achievementLibrary.domain.Achievements;
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
import com.microservices.dms.achievementLibrary.mapper.AchievementsMapper;
import com.microservices.dms.constant.ReferralConstant;
import com.microservices.dms.constant.TaskConstant;
import com.microservices.dms.referral.mapper.TalentReferralMapper;
import com.microservices.dms.referral.vo.IssueDto;
import com.microservices.dms.referral.vo.IssuesVo;
import com.microservices.dms.referral.vo.PullRequestVo;
import com.microservices.dms.referral.vo.*;
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
import com.microservices.dms.utils.DmsGitLinkRequestUrl;
import com.microservices.dms.utils.DmsRequestHelper;
import com.microservices.dms.utils.SimilarityService;
@ -21,6 +24,8 @@ import org.springframework.stereotype.Service;
import java.util.*;
import java.util.stream.Collectors;
import static com.microservices.dms.constant.TaskConstant.*;
/**
* 人才推荐服务
*/
@ -33,15 +38,17 @@ public class TalentReferralService {
@Autowired
private DmsRequestHelper dmsRequestHelper;
@Autowired
private AchievementsMapper achievementsMapper;
private static final Logger logger = LoggerFactory.getLogger(TalentReferralService.class);
public Set<Long> getContributors(String projectFullName) {
try {
// 获取项目贡献者数量
JSONArray contributorsArray = dmsRequestHelper.getAllDataByPage(DmsGitLinkRequestUrl.CONTRIBUTORS(projectFullName), "list","total_count");
JSONArray contributorsArray = dmsRequestHelper.getAllDataByPage(DmsGitLinkRequestUrl.CONTRIBUTORS(projectFullName), "list", "total_count");
return contributorsArray.stream().map(o -> (JSONObject) o).map(s -> s.getString("contributions")).filter(StringUtils::isNotBlank)
.mapToLong(Long::parseLong).boxed().collect(Collectors.toSet());
return contributorsArray.stream().map(o -> (JSONObject) o).map(s -> s.getString("id")).filter(StringUtils::isNotBlank).mapToLong(Long::parseLong).boxed().collect(Collectors.toSet());
} catch (ServiceException e) {
logger.error("【{}】获取项目贡献者数量失败:{}", projectFullName, e.getMessage());
@ -52,10 +59,9 @@ public class TalentReferralService {
public Set<Long> getCollaborators(String projectFullName) {
try {
// 获取项目成员者数量
JSONArray contributorsArray = dmsRequestHelper.getAllDataByPage(DmsGitLinkRequestUrl.QUERY_USER_FROM_PROJECT(projectFullName), "members","total_count");
JSONArray contributorsArray = dmsRequestHelper.getAllDataByPage(DmsGitLinkRequestUrl.QUERY_USER_FROM_PROJECT(projectFullName), "members", "total_count");
return contributorsArray.stream().map(o -> (JSONObject) o).map(s -> s.getString("id"))
.filter(StringUtils::isNotBlank).mapToLong(Long::parseLong).boxed().collect(Collectors.toSet());
return contributorsArray.stream().map(o -> (JSONObject) o).map(s -> s.getString("id")).filter(StringUtils::isNotBlank).mapToLong(Long::parseLong).boxed().collect(Collectors.toSet());
} catch (ServiceException e) {
logger.error("【{}】获取项目成员者数量失败:{}", projectFullName, e.getMessage());
@ -87,6 +93,14 @@ public class TalentReferralService {
return collaborators;
}
public List<Map<String, Object>> doIssueTalentReferral(Long issueId, Long projectId) {
List<Map.Entry<Long, Double>> entries = issueTalentReferral(projectId, issueId);
return entries.stream().limit(3).map(s -> {
Map<String, Object> mm = talentReferralMapper.selectUsersById(s.getKey());
return mm;
}).collect(Collectors.toList());
}
public List<Map.Entry<Long, Double>> issueTalentReferral(Long projectId, Long issueId) {
IssuesVo curIssue = talentReferralMapper.selectIssuesById(issueId);
@ -96,12 +110,13 @@ public class TalentReferralService {
List<Long> curIssueAssigners = talentReferralMapper.selectIssuesAssigners(curIssue.getId());
if (!curIssueAssigners.isEmpty()) {
return new ArrayList<>();
// return new ArrayList<>();
}
IssuesVo vo = new IssuesVo();
vo.setProjectId(projectId);
vo.setStatusIds(Collections.singletonList(ReferralConstant.ISSUE_CLOSED));
vo.setStatusIds(Lists.newArrayList(ReferralConstant.ISSUE_CLOSED, ReferralConstant.ISSUE_RESOLVED));
vo.setIssueClassify("issue");
List<IssuesVo> issuesVos = talentReferralMapper.selectIssuesCondition(vo);
Map<Long, Double> userFractionMap = new HashMap<>();
// 计算与解决issue的相似度 标题+描述
@ -138,37 +153,41 @@ public class TalentReferralService {
Map<Long, Double> userFractionMap = new HashMap<>();
Map<String, Double> userNameFractionMap = new HashMap<>();
Map<String, Set<String>> PRFilesMap = new HashMap<>();
List<IssueDto> closedPullRequests = getPullRequests(projectId, "11");
List<IssueDto> closedPullRequests = getPullRequests(projectId, "11").stream()
.filter(e -> StringUtils.isNotBlank(e.getAssignUserLogin())).collect(Collectors.toList());
for (IssueDto pr : prs) {
PrInfoVo curPrInfoVo = talentReferralMapper.selectPRInfoById(pr.getPullRequestId());
//关闭PR的对比
for (IssueDto dto : closedPullRequests) {
List<String> reviewers = dto.getReviewers();
for (String reviewer : reviewers) {
Set<String> prFiles = getPRFiles(projectId, dto.getPullRequestNumber());
PRFilesMap.merge(reviewer, prFiles, (a, b) -> {
HashSet<String> set = new HashSet<>();
set.addAll(a);
set.addAll(b);
return set;
});
}
String reviewer = dto.getAssignUserLogin();
Set<String> prFiles = getPRFiles(projectId, dto.getPullRequestNumber());
PRFilesMap.merge(reviewer, prFiles, (a, b) -> {
HashSet<String> set = new HashSet<>();
set.addAll(a);
set.addAll(b);
return set;
});
//标题content匹配
PrInfoVo prInfoVo = talentReferralMapper.selectPRInfoById(dto.getPullRequestId());
double subjectFraction = SimilarityService.sentence(curPrInfoVo.getTitle(), prInfoVo.getTitle());
double descFraction = SimilarityService.text(curPrInfoVo.getContent(), prInfoVo.getContent());
//这个数据可以缓存下来
userNameFractionMap.merge(dto.getAssignUserLogin(), (subjectFraction + descFraction) * 40.0D, Double::sum);
}
Set<String> curPrFiles = getPRFiles(projectId, pr.getPullRequestNumber());
for (String curPrFile : curPrFiles) {
PRFilesMap.forEach((k, v) -> {
if (v.contains(curPrFile)) {
userNameFractionMap.merge(k, 60.0D, Double::sum);
userNameFractionMap.merge(k, 30.0D, Double::sum);
}
});
}
// 计算每个负责人关闭的 PR数量
closedPullRequests.stream().map(IssueDto::getReviewers).flatMap(List::stream)
.forEach(s -> userNameFractionMap.merge(s, 40.0D, Double::sum));
closedPullRequests.stream().map(IssueDto::getAssignUserLogin).forEach(s -> userNameFractionMap.merge(s, 30.0D, Double::sum));
}
userNameFractionMap.forEach((k, v) -> {
@ -210,7 +229,7 @@ public class TalentReferralService {
}
try {
JSONArray allDataByPage = dmsRequestHelper.getAllDataByPage(DmsGitLinkRequestUrl.GET_PR_FILES(projectFullName, PRNum), "issues", "files");
JSONArray allDataByPage = dmsRequestHelper.getAllDataByPage(DmsGitLinkRequestUrl.GET_PR_FILES(projectFullName, PRNum), "files", "file_nums");
return allDataByPage.stream().map(o -> (JSONObject) o).map(o -> (String) o.get("filename")).collect(Collectors.toSet());
} catch (ServiceException e) {
logger.error("【{}】获取PR文件失败{}", projectFullName, e.getMessage());
@ -218,25 +237,179 @@ public class TalentReferralService {
return new HashSet<>();
}
public List<Map<String, Object>> doPRTalentReferral(Long prId, Long projectId) {
List<Map.Entry<Long, Double>> entries = PRTalentReferral(projectId, prId);
return entries.stream().limit(3).map(s -> {
Map<String, Object> mm = talentReferralMapper.selectUsersById(s.getKey());
return mm;
}).collect(Collectors.toList());
}
public List<Map.Entry<Long, Double>> PRTalentReferral(Long projectId, Long prId) {
List<IssueDto> openPullRequests = getPullRequests(projectId, "1");
openPullRequests = openPullRequests.stream().filter(e -> e.getReviewers().isEmpty())
.collect(Collectors.toList());
openPullRequests = openPullRequests.stream().filter(e -> StringUtils.isEmpty(e.getAssignUserLogin())).collect(Collectors.toList());
if (prId != null) {
openPullRequests = openPullRequests.stream().filter(e -> Objects.equals((long) (e.getId()), prId))
.filter(e -> e.getReviewers().isEmpty())
.collect(Collectors.toList());
openPullRequests = openPullRequests.stream().filter(e -> Objects.equals((long) (e.getPullRequestId()), prId)).collect(Collectors.toList());
return PRTalentReferral(projectId, prId, openPullRequests);
}
return PRTalentReferral(projectId, prId, openPullRequests);
return PRTalentReferral(projectId, null, openPullRequests);
}
//定时统计
public void projectsStatistic(){
public void projectsStatistic() {
}
/**
* 1先查找任务状态为成果征集中成果评选中的数据新增存储到数据表中
* 2获取系统中的任务领域和数据仓库中的领域是一样 50%
* 3根据1中任务标题和任务正文 与数据仓库中名称和简介详情比较 取前10获取对比计算分值大于0的结果
* 4将2和3的结果相加取前5个成果进行推荐
*/
public List<Achievements> taskAchievementTalentReferral(Long taskId) {
TaskVo task = talentReferralMapper.selectTaskById(taskId);
Achievements tCond = new Achievements();
// tCond.setSourceId(taskId);
tCond.setSource("2");
tCond.setStatus("1");
List<Achievements> taskAchievements = achievementsMapper.selectAchievementsList(tCond);
List<Achievements> result;
List<Long> trTaskIds = doTaskTalentReferral(task, taskAchievements);
result = trTaskIds.stream().map(s -> taskAchievements.stream().filter(e -> e.getId().equals(s)).findFirst().orElse(null)).filter(Objects::nonNull).limit(5).collect(Collectors.toList());
return result;
}
private List<Long> doTaskTalentReferral(TaskVo task, List<Achievements> taskVos) {
Long taskDomain = task.getCategoryId();
Map<Long, Double> step1Map = new TreeMap<>();
Map<Long, Double> step2Map = new TreeMap<>();
for (Achievements t1 : taskVos) {
if (Objects.equals(String.valueOf(taskDomain), t1.getField1())) {
step1Map.put(t1.getId(), 50.0D);
}
double subjectFraction = SimilarityService.sentence(task.getName(), t1.getAchievementName());
double descFraction = SimilarityService.text(t1.getSummary(), task.getDescription());
step2Map.put(t1.getId(), (subjectFraction + descFraction) * 50.0D);
}
step1Map.forEach((k, v) -> step2Map.merge(k, v, Double::sum));
step2Map.keySet().removeIf(step -> Double.compare(step2Map.get(step), 0.0D) <= 0.0D);
List<Map.Entry<Long, Double>> entryList = new ArrayList<>(step2Map.entrySet());
entryList.sort((entry1, entry2) -> Double.compare(entry2.getValue(), entry1.getValue()));
return entryList.stream().map(Map.Entry::getKey).collect(Collectors.toList());
}
/**
* 创客任务评审专家推荐
* 1先查找创客任务状态未结束并且已加入评审的数据新增存储到数据表中
* 2技术匹配度系统中专家领域 任务是一样的领域 20%
* 3根据1中任务标题和任务描述 与专家简介进行比较 匹配结果分数取前1030%
* 4根据1中任务标题和任务描述 与已完成的任务标题与任务描述比较匹配结果分数取前3 前3个竞赛中对应的专家 分数*50%
*/
public Object taskExpertTalentReferral(Long taskId) {
TaskVo task = talentReferralMapper.selectTaskById(taskId);
List<KeyValueVo> categories = achievementsMapper.getAreasByName(null);
List<TaskVo> completedTasks = talentReferralMapper.selectTaskByStatus(Lists.newArrayList(TASK_COMPLETE_STATUS,TASK_PAPER_CHOOSING_STATUS,TASK_RESULT_PROOF_STATUS,TASK_SIGNING_STATUS,TASK_PAYING_STATUS));
List<ExpertVo> allExperts = talentReferralMapper.selectExpertsBy(new ExpertVo());
List<Long> expertIds = doTaskExpertTalentReferral(task, categories, completedTasks, allExperts);
return expertIds.stream().map(s -> allExperts.stream().filter(e -> e.getId().equals(s)).findFirst().orElse(null)).filter(Objects::nonNull).limit(3).collect(Collectors.toList());
}
private List<Long> doTaskExpertTalentReferral(TaskVo task, List<KeyValueVo> categories, List<TaskVo> completedTasks, List<ExpertVo> allExperts) {
Map<Long, String> v2k = categories.stream().collect(Collectors.toMap(KeyValueVo::getValue, KeyValueVo::getKey, (o, n) -> n));
String taskDomain = v2k.get(task.getCategoryId());
Map<Long, Double> step1Map = new TreeMap<>();
Map<Long, Double> step2Map = new TreeMap<>();
for (ExpertVo t1 : allExperts) {
if (Objects.equals(taskDomain, t1.getReviewAreaOne())) {
step1Map.merge(t1.getId(), 50.0D, Double::sum);
}
if (Objects.equals(taskDomain, t1.getReviewAreaTwo())) {
step1Map.merge(t1.getId(), 50.0D, Double::sum);
}
if (Objects.equals(taskDomain, t1.getReviewAreaThree())) {
step1Map.merge(t1.getId(), 50.0D, Double::sum);
}
}
List<KeyValVo<Long, String>> allTaskWithExpertIds = talentReferralMapper.allTaskWithExpertIds("1");
Map<Long, String> t2e = allTaskWithExpertIds.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV, (o, n) -> n));
for (TaskVo t2 : completedTasks) {
double subjectFraction = SimilarityService.sentence(task.getName(), t2.getName());
double descFraction = SimilarityService.text(t2.getDescription(), task.getDescription());
String[] split = t2e.getOrDefault(t2.getId(), "").split(",");
for (String s : split) {
if (StringUtils.isNotBlank(s)) {
step2Map.put(Long.parseLong(s), (subjectFraction + descFraction) * 50.0D);
}
}
}
step1Map.forEach((k, v) -> step2Map.merge(k, v, Double::sum));
List<Map.Entry<Long, Double>> entryList = new ArrayList<>(step2Map.entrySet());
entryList.sort((entry1, entry2) -> Double.compare(entry2.getValue(), entry1.getValue()));
return entryList.stream().map(Map.Entry::getKey).collect(Collectors.toList());
}
/**
* 开源竞赛评审专家推荐
* 1先查找开放竞赛状态未结束并且已提交评审的数据新增存储到数据表中
* 2技术匹配度系统中专家领域 竞赛是一样的领域 20%
* 3根据1中竞赛标题和竞赛描述 与专家简介进行比较 匹配结果分数取前1030%
* 4根据1中竞赛标题和竞赛描述 与已完成的竞赛标题与竞赛描述比较匹配结果分数取前3 前3个竞赛中对应的专家*50%
*/
public Object competitionExpertTalentReferral(Long competitionId) {
TaskVo task = talentReferralMapper.selectCompetitionById(competitionId);
List<KeyValueVo> categories = new ArrayList<>();
List<TaskVo> completedTasks = talentReferralMapper.selectCompetitionIdByStatus();
List<ExpertVo> allExperts = talentReferralMapper.selectExpertsBy(new ExpertVo());
List<Long> expertIds = doCompetitionExpertTalentReferral(task, categories, completedTasks, allExperts);
return expertIds.stream().map(s -> allExperts.stream().filter(e -> e.getId().equals(s)).findFirst().orElse(null)).filter(Objects::nonNull).limit(3).collect(Collectors.toList());
}
private List<Long> doCompetitionExpertTalentReferral(TaskVo task, List<KeyValueVo> categories, List<TaskVo> completedTasks, List<ExpertVo> allExperts) {
Map<Long, Double> step1Map = new TreeMap<>();
Map<Long, Double> step2Map = new TreeMap<>();
List<KeyValVo<Long, String>> allTaskWithExpertIds = talentReferralMapper.allTaskWithExpertIds("2");
Map<Long, String> t2e = allTaskWithExpertIds.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV, (o, n) -> n));
for (TaskVo t2 : completedTasks) {
double subjectFraction = SimilarityService.sentence(task.getName(), t2.getName());
double descFraction = SimilarityService.text(t2.getDescription(), task.getDescription());
String[] split = t2e.getOrDefault(t2.getId(), "").split(",");
for (String s : split) {
if (StringUtils.isNotBlank(s)) {
step2Map.put(Long.parseLong(s), (subjectFraction + descFraction) * 100.0D);
}
}
}
step1Map.forEach((k, v) -> step2Map.merge(k, v, Double::sum));
List<Map.Entry<Long, Double>> entryList = new ArrayList<>(step2Map.entrySet());
entryList.sort((entry1, entry2) -> Double.compare(entry2.getValue(), entry1.getValue()));
return entryList.stream().map(Map.Entry::getKey).collect(Collectors.toList());
}
}

View File

@ -0,0 +1,15 @@
package com.microservices.dms.referral.vo;
import lombok.Data;
@Data
public class ExpertVo {
Long id;
Long userId;
String expertName;
String nickname;
String reviewAreaOne;
String reviewAreaTwo;
String reviewAreaThree;
Integer status;
}

View File

@ -13,4 +13,5 @@ public class IssuesVo {
private Long statusId;
private List<Long> statusIds;
private Long num;
private String issueClassify;
}

View File

@ -0,0 +1,10 @@
package com.microservices.dms.referral.vo;
import lombok.Data;
@Data
public class PrInfoVo {
private Long id;
private String title;
private String content;
}

View File

@ -0,0 +1,13 @@
package com.microservices.dms.referral.vo;
import lombok.Data;
@Data
public class TaskVo {
private Long id;
private Long taskId;
private String name;
private String description;
private Long categoryId;
private String identifier;
}

View File

@ -21,7 +21,7 @@ public class CollectUserActDataController {
@PostMapping("/addClicker")
@ApiImplicitParams({
@ApiImplicitParam(name = "clickType", value = "点击类型(任务makerSpaceTask、竞赛CompetitionInfo、项目Project、成果Achievements、专家Experts,校企schoolEnterprise)", paramType = "query", dataTypeClass = String.class),
@ApiImplicitParam(name = "clickType", value = "点击类型(任务makerSpaceTask、竞赛CompetitionInfo、项目Project、成果Achievements、专家Experts,校企schoolEnterprise,成果用户对接userDocking)", paramType = "query", dataTypeClass = String.class),
@ApiImplicitParam(name = "clickId", value = "点击对象ID", paramType = "query", dataTypeClass = Integer.class),
@ApiImplicitParam(name = "userId", value = "用户ID", paramType = "query", dataTypeClass = Integer.class),
@ApiImplicitParam(name = "extInfo", value = "补充信息", paramType = "query", dataTypeClass = String.class)

View File

@ -6,6 +6,7 @@ import com.microservices.common.core.web.domain.AjaxResult;
import com.microservices.common.core.web.page.TableDataInfo;
import com.microservices.common.log.annotation.Log;
import com.microservices.common.log.enums.BusinessType;
import com.microservices.dms.achievementLibrary.domain.AchQueryVo;
import com.microservices.dms.resourceLibrary.domain.ExpertResourceLibrary;
import com.microservices.dms.resourceLibrary.service.IExpertResourceLibraryService;
import io.swagger.annotations.Api;
@ -138,4 +139,5 @@ public class ExpertResourceLibraryController extends BaseController
public AjaxResult getActDataStatisticById(Long id) {
return success(expertResourceLibraryService.getActDataStatisticById(id));
}
}

View File

@ -33,7 +33,7 @@ public class CompetitionResourceLibrary extends BaseEntity {
*/
private String competitionField;
/**
* 竞赛状态 0进行中 1已结束
* 竞赛状态 status: 0 未上架 1上架
*/
private String competitionStatus;
/**

View File

@ -1,10 +1,14 @@
package com.microservices.dms.resourceLibrary.domain;
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.microservices.common.core.annotation.Excel;
import com.microservices.common.core.web.domain.BaseEntity;
import java.util.ArrayList;
import java.util.List;
/**
* 专家资源库对象 expert_resource_library
*
@ -48,7 +52,7 @@ public class ExpertResourceLibrary extends BaseEntity {
private String expertDomain;
private String titleRank;
//准入状态
private Long status;
//评审领域1
private String reviewAreaOne;
@ -78,6 +82,26 @@ public class ExpertResourceLibrary extends BaseEntity {
private String userNickName;
private String otherAttachments;
private String fullFileIds;
private List<KeyValVo<String, String>> attachmentList = new ArrayList<>();
public List<KeyValVo<String, String>> getAttachmentList() {
return attachmentList;
}
public void setAttachmentList(List<KeyValVo<String, String>> attachmentList) {
this.attachmentList = attachmentList;
}
public String getFullFileIds() {
return fullFileIds;
}
public void setFullFileIds(String fullFileIds) {
this.fullFileIds = fullFileIds;
}
public String getOtherAttachments() {
return otherAttachments;
}

View File

@ -14,6 +14,7 @@ import com.microservices.dms.resourceLibrary.domain.vo.ExpertAttachmentVo;
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.PropertyValues;
/**
* 专家资源库Mapper接口
@ -112,13 +113,13 @@ public interface ExpertResourceLibraryMapper
List<KeyValueVo> getMemoAduit();
KeyValueVo getIsOriginalStatistic();
List<KeyValueVo> getIsOriginalStatistic();
List<KeyValueVo> getMemoTotalByYear();
List<KeyValueVo> getForumSectionStatistic();
List<KeyValueVo> getAddMemoStatistic();
// List<KeyValueVo> getAddMemoStatistic();
List<MemoTotalVo> getTop5Memos();
@ -127,4 +128,8 @@ public interface ExpertResourceLibraryMapper
ExpertAttachmentVo getExpertInfoById(@Param("expertId") Long expertId);
Map<String, Object> getAttachmentInfo(@Param("id") Long id);
List<KeyValueVo> getAddMemoStatistic(@Param("s") Date s, @Param("e") Date e);
List<KeyValVo<String, String>> getAttachments(@Param("fullFileIds") String fullFileIds);
}

View File

@ -1,6 +1,8 @@
package com.microservices.dms.resourceLibrary.mapper;
import com.microservices.common.datasource.annotation.Slave;
import com.microservices.dms.achievementLibrary.domain.TokenListVo;
import com.microservices.dms.common.vo.PrCreateQueryVo;
import com.microservices.dms.resourceLibrary.domain.ProjectResourceLibrary;
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
import com.microservices.dms.resourceLibrary.domain.vo.ProjectListVo;
@ -9,6 +11,7 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
@Mapper
@Slave
@ -51,4 +54,20 @@ public interface ProjectResourceLibraryMapper {
List<KeyValVo<String,String>> getAttachments(@Param("containerId") Long containerId);
String getProjectDomainNameByKey(@Param("projectDomain") String projectDomain );
List<TokenListVo> selectProjectInfos(@Param("name") String projectName);
Long sumProjectIssueToken(@Param("id") Long id);
Map<String, Object> selectCommitInfo(@Param("commitId") String commitId,@Param("commitDiff") String commitDiff);
Map<String, Object> selectPrInfo(@Param("prId") String prId);
Map<String, Object> selectIssueInfo(@Param("issueId") String issueId);
String getProjectUserIdById(@Param("tokenName")String tokenName);
Long getUsedApplyToken(@Param("tokenName")String tokenName,@Param("userName") String userName);
String getUserIdBYLogin(@Param("userId")String userId);
}

View File

@ -108,4 +108,6 @@ public interface TaskResourceLibraryMapper {
int delFavorite(Favorite favorite);
int delWatcher(Watcher watcher);
double getConvertedTaskAmount2();
}

View File

@ -10,6 +10,7 @@ import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
import com.microservices.dms.resourceLibrary.mapper.CompetitionResourceLibraryMapper;
import com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo;
import com.microservices.dms.resourceLibrary.mapper.TaskResourceLibraryMapper;
import com.microservices.dms.utils.DateUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@ -71,6 +72,7 @@ public class CompetitionResourceLibraryService {
a.setV(String.format(PROJECT_DOWNLOAD_API, gitLinkUrl, v));
}
l.setAttachmentList(attachments);
l.setSubmissionTime(DateUtil.plusHours(l.getSubmissionTime(), 8));
}
}
return list;

View File

@ -83,7 +83,7 @@ public class ProjectResourceLibraryService {
if (v.startsWith("http")) {
String urlPath = getUrlPath(v);
if (StringUtils.isNotEmpty(urlPath)) {
if (urlPath.startsWith("/")) {
if (urlPath.startsWith("/api")) {
a.setV(gitLinkUrl + urlPath);
}else {
a.setV(gitLinkUrl +"/api"+ urlPath);

View File

@ -122,6 +122,8 @@ public class TaskResourceLibraryService {
public int updateTaskResourceLibrary(TaskResourceLibrary taskResourceLibrary) {
taskResourceLibrary.setUpdateTime(DateUtils.getNowDate());
taskResourceLibrary.setUpdateBy(SecurityUtils.getUsername());
return taskResourceLibraryMapper.updateTaskResourceLibrary(taskResourceLibrary);
}

View File

@ -6,6 +6,7 @@ import com.microservices.common.core.utils.StringUtils;
import com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo;
import com.microservices.dms.resourceLibrary.domain.ExpertResourceLibrary;
import com.microservices.dms.resourceLibrary.domain.vo.ExpertAttachmentVo;
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
import com.microservices.dms.resourceLibrary.mapper.ExpertResourceLibraryMapper;
import com.microservices.dms.resourceLibrary.service.IExpertResourceLibraryService;
import org.springframework.beans.factory.annotation.Autowired;
@ -17,6 +18,8 @@ import java.util.List;
import java.util.Map;
import static com.microservices.dms.constant.TaskConstant.MARKER_SPACE_DOWNLOAD_API_BY_ID;
import static com.microservices.dms.constant.TaskConstant.PROJECT_DOWNLOAD_API;
import static com.microservices.dms.utils.UrlUtil.getUrlPath;
/**
* 专家资源库Service业务层处理
@ -78,6 +81,8 @@ public class ExpertResourceLibraryServiceImpl implements IExpertResourceLibraryS
}
}
@Value("${http.gitLinkUrl}")
public String gitLinkUrl;
/**
* 查询专家资源库列表
*
@ -88,6 +93,31 @@ public class ExpertResourceLibraryServiceImpl implements IExpertResourceLibraryS
public List<ExpertResourceLibrary> selectExpertResourceLibraryList(ExpertResourceLibrary expertResourceLibrary) {
List<ExpertResourceLibrary> expertResourceLibraryList = expertResourceLibraryMapper.selectExpertResourceLibraryList(expertResourceLibrary);
for (ExpertResourceLibrary a : expertResourceLibraryList) {
//附件组装
String fullFileIds = a.getFullFileIds();
if(StringUtils.isNotEmpty(fullFileIds)){
List<KeyValVo<String, String>> attachments = expertResourceLibraryMapper.getAttachments(fullFileIds);
for (KeyValVo<String, String> f: attachments) {
String v = String.valueOf(f.getV());
if (StringUtils.isNotEmpty(v)) {
if (v.startsWith("http")) {
String urlPath = getUrlPath(v);
if (StringUtils.isNotEmpty(urlPath)) {
if (urlPath.startsWith("/api")) {
f.setV(gitLinkUrl + urlPath);
}else {
f.setV(gitLinkUrl +"/api"+ urlPath);
}
}
} else {
f.setV(String.format(MARKER_SPACE_DOWNLOAD_API_BY_ID, gitLinkUrl, v));
}
}
}
a.setAttachmentList(attachments);
a.setAttachments(JSON.toJSONString(attachments));
}
//头像组装
String gender = a.getGender();
String img = "images/avatars/User/boy.jpg";
if(StringUtils.isNotEmpty(gender) && gender.equals("1")){

View File

@ -42,6 +42,20 @@ public class DateUtil {
};
}
public static Date[] getLast12Months() {
LocalDate endDate = LocalDate.now();
LocalDate startDate = endDate.minusMonths(11);
LocalDateTime startDateTime = LocalDateTime.of(startDate.getYear(),startDate.getMonth(),1,0,0,0);
LocalDateTime endDateTime = endDate.atTime(23, 59, 59);
return new Date[]{
Date.from(startDateTime.atZone(ZoneId.systemDefault()).toInstant()),
Date.from(endDateTime.atZone(ZoneId.systemDefault()).toInstant())
};
}
public static Date[] getCurrentYearEndOf(LocalDate endDate) {
Year year = Year.now();
@ -68,6 +82,19 @@ public class DateUtil {
.collect(Collectors.toList());
}
public static List<String> getDateStrYYYYMM(Date start, Date end) {
LocalDate s = start.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime().toLocalDate();
LocalDate e = end.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime().toLocalDate();
String pattern = "yyyy-MM";
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
return LongStream.range(0, s.until(e).getMonths() + 1)
.mapToObj(s::plusMonths)
.map(formatter::format)
.collect(Collectors.toList());
}
public static List<String> getDateStrYYYYMMDD(Date start, Date end) {
LocalDate s = start.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime().toLocalDate();
LocalDate e = end.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime().toLocalDate();
@ -85,4 +112,28 @@ public class DateUtil {
LocalDateTime s = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
return Date.from(s.plusHours(plusHours).atZone(ZoneId.systemDefault()).toInstant());
}
public static String formatLocalDateTimePlusH(LocalDateTime dateTime,long h) {
if (dateTime == null) {return null;}
LocalDateTime localDateTime8 = dateTime.plusHours(h);
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
return formatter.format(localDateTime8);
}
public Date addHoursToDate(Date date, int hours) {
if (date == null) {return null;}
// 转换为LocalDateTime
LocalDateTime localDateTime = date.toInstant()
.atZone(ZoneId.systemDefault())
.toLocalDateTime();
// 增加小时
localDateTime = localDateTime.plusHours(hours);
// 转回Date
return Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
}
}

View File

@ -46,7 +46,7 @@ public class DmsRequestHelper extends GitLinkRequestHelper {
int pageNum = 1;
// 循环分页获取gitlink组织下所有成员
while (!isAllData) {
JSONObject result = doGet(GitLinkRequestUrl.GET_LIST_BY_PAGES(url, pageNum, 50)
JSONObject result = doGet(GET_LIST_BY_PAGES(url, pageNum, 50)
);
allList.addAll(result.getList(listKey, tClass));
long total = result.getLong("search_count");
@ -84,7 +84,7 @@ public class DmsRequestHelper extends GitLinkRequestHelper {
public static GitLinkRequestUrl GET_LIST_BY_PAGES(String url, Integer page, Integer limit) {
String p = url.contains("?")? "&page=%d&limit=%d": "%s?page=%d&limit=%d";
String p = url.contains("?")? "%s&page=%s&limit=%s": "%s?page=%s&limit=%s";
return getAdminGitLinkRequestUrl(String.format(p, url, page, limit));
}

View File

@ -0,0 +1,108 @@
<?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.microservices.dms.achievementLibrary.mapper.AchievementDictDataMapper">
<resultMap type="AchievementDictData" id="AchievementDictDataResult">
<result property="dictCode" column="dict_code" />
<result property="dictSort" column="dict_sort" />
<result property="dictLabel" column="dict_label" />
<result property="dictValue" column="dict_value" />
<result property="dictType" column="dict_type" />
<result property="status" column="status" />
<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" />
</resultMap>
<sql id="selectAchievementDictDataVo">
select dict_code, dict_sort, dict_label, dict_value, dict_type, status, create_by, create_time, update_by, update_time, remark from achievement_dict_data
</sql>
<select id="selectAchievementDictDataList" parameterType="AchievementDictData" resultMap="AchievementDictDataResult">
<include refid="selectAchievementDictDataVo"/>
<where>
<if test="dictSort != null "> and dict_sort = #{dictSort}</if>
<if test="dictLabel != null and dictLabel != ''"> and dict_label = #{dictLabel}</if>
<if test="dictValue != null and dictValue != ''"> and dict_value = #{dictValue}</if>
<if test="dictType != null and dictType != ''"> and dict_type = #{dictType}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
</select>
<select id="selectAchievementDictDataByDictCode" parameterType="Long" resultMap="AchievementDictDataResult">
<include refid="selectAchievementDictDataVo"/>
where dict_code = #{dictCode}
</select>
<insert id="insertAchievementDictData" parameterType="AchievementDictData" useGeneratedKeys="true" keyProperty="dictCode">
insert into achievement_dict_data
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="dictSort != null">dict_sort,</if>
<if test="dictLabel != null">dict_label,</if>
<if test="dictValue != null">dict_value,</if>
<if test="dictType != null">dict_type,</if>
<if test="status != null">status,</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>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="dictSort != null">#{dictSort},</if>
<if test="dictLabel != null">#{dictLabel},</if>
<if test="dictValue != null">#{dictValue},</if>
<if test="dictType != null">#{dictType},</if>
<if test="status != null">#{status},</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>
</trim>
</insert>
<update id="updateAchievementDictData" parameterType="AchievementDictData">
update achievement_dict_data
<trim prefix="SET" suffixOverrides=",">
<if test="dictSort != null">dict_sort = #{dictSort},</if>
<if test="dictLabel != null">dict_label = #{dictLabel},</if>
<if test="dictValue != null">dict_value = #{dictValue},</if>
<if test="dictType != null">dict_type = #{dictType},</if>
<if test="status != null">status = #{status},</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>
</trim>
where dict_code = #{dictCode}
</update>
<delete id="deleteAchievementDictDataByDictCode" parameterType="Long">
delete from achievement_dict_data where dict_code = #{dictCode}
</delete>
<delete id="deleteAchievementDictDataByDictCodes" parameterType="String">
delete from achievement_dict_data where dict_code in
<foreach item="dictCode" collection="array" open="(" separator="," close=")">
#{dictCode}
</foreach>
</delete>
<select id="selectDictDataByType" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
select dict_code as "key",dict_label as "name" from achievement_dict_data where dict_type = #{dictType}
</select>
<select id="selectDictDataByLabel" resultType="int">
select count(1) from achievement_dict_data where dict_type = #{type} and dict_label = #{label}
</select>
<select id="getDictTypes" resultType="String">
select distinct dict_type from achievement_dict_data
</select>
</mapper>

View File

@ -125,4 +125,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from achievement_team
where achievement_id = #{aid}
</delete>
<select id="selectAchievementTeamByAchId" resultMap="AchievementTeamResult">
<include refid="selectAchievementTeamVo"/>
where achievement_id = #{achId}
</select>
</mapper>

View File

@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="Achievements" id="AchievementsResult">
<result property="id" column="id" />
<result property="showAchievementName" column="showAchievementName" />
<result property="achievementName" column="achievement_name" />
<result property="field1" column="field_1" />
<result property="field2" column="field_2" />
@ -37,15 +38,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="attachmentCount" column="attachment_count" />
<result property="isExpertAudit" column="is_expert_audit" />
<result property="hotRank" column="hot_rank" />
<result property="ext1" column="ext1" />
<result property="ext2" column="ext2" />
<result property="ext3" column="ext3" />
</resultMap>
<sql id="selectAchievementsVo">
select id, achievement_name,hot_rank, field_1, field_2, field_3, attachment_count,is_expert_audit,achievement_type, source, source_id, source_link, tags, summary, publishing_unit, address, is_featured, contact_person, contact_number, owner_id, owner_name, status, details, reviewer, review_date, review_comments, images, attachments, create_by, create_time, update_by, update_time from achievements
select id, IFNULL(show_ach_name,achievement_name) as "showAchievementName", achievement_name,hot_rank, field_1, field_2, field_3,
attachment_count,is_expert_audit,achievement_type, source, source_id, source_link, tags, summary, publishing_unit, address,
is_featured, contact_person, contact_number, owner_id, owner_name, status, details, reviewer, review_date, review_comments, images,
attachments, create_by, create_time, update_by, update_time,ext1,ext2,ext3 from achievements
</sql>
<select id="selectAchievementsList" parameterType="Achievements" resultMap="AchievementsResult">
<include refid="selectAchievementsVo"/>
<where>
<if test="showAchievementName != null and showAchievementName != ''"> and show_ach_name like concat('%', #{showAchievementName}, '%')</if>
<if test="achievementName != null and achievementName != ''"> and achievement_name like concat('%', #{achievementName}, '%')</if>
<if test="field1 != null and field1 != ''"> and field_1 = #{field1}</if>
<if test="field2 != null and field2 != ''"> and field_2 = #{field2}</if>
@ -73,10 +81,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="hotRank != null and hotRank != ''"> and hot_rank = #{hotRank}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
</where>
order by create_time desc
</select>
<select id="selectAchievementsById" parameterType="Long" resultType="com.microservices.dms.achievementLibrary.domain.Achievements">
select a.id,a.achievement_name,a.hot_rank,a.field_1,a.field_2,a.field_3,a.attachment_count,a.is_expert_audit,a.achievement_type,a.source,a.source_id
select a.id,IFNULL(a.show_ach_name,a.achievement_name) as "showAchievementName",a.achievement_name,a.hot_rank,a.field_1,a.field_2,a.field_3,a.attachment_count,
a.is_expert_audit,a.achievement_type,a.source,a.source_id,a.ext1,a.ext2,a.ext3
,u.login as "userLogin",IFNULL(u.nickname,owner_name) as "userNickName",ue.gender as "gender",
a.source_link,a.tags,a.summary,a.publishing_unit,a.address,a.is_featured,a.contact_person,a.contact_number,a.owner_id,a.owner_name, a.status,a.details,
a.reviewer,a.review_date,a.review_comments, a.images,a.attachments,a.create_by,a.create_time,a.update_by,a.update_time
@ -97,6 +107,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertAchievements" parameterType="Achievements" useGeneratedKeys="true" keyProperty="id">
insert into achievements
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="showAchievementName != null">show_ach_name,</if>
<if test="achievementName != null">achievement_name,</if>
<if test="field1 != null">field_1,</if>
<if test="field2 != null">field_2,</if>
@ -128,8 +139,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="attachmentCount != null">attachment_count,</if>
<if test="isExpertAudit != null">is_expert_audit,</if>
<if test="hotRank != null">hot_rank,</if>
<if test="ext1 != null">ext1,</if>
<if test="ext2 != null">ext2,</if>
<if test="ext3 != null">ext3,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="showAchievementName != null">#{showAchievementName},</if>
<if test="achievementName != null">#{achievementName},</if>
<if test="field1 != null">#{field1},</if>
<if test="field2 != null">#{field2},</if>
@ -161,12 +176,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="attachmentCount != null">#{attachmentCount},</if>
<if test="isExpertAudit != null">#{isExpertAudit},</if>
<if test="hotRank != null">#{hotRank},</if>
<if test="ext1 != null">#{ext1},</if>
<if test="ext2 != null">#{ext2},</if>
<if test="ext3 != null">#{ext3},</if>
</trim>
</insert>
<update id="updateAchievements" parameterType="Achievements">
update achievements
<trim prefix="SET" suffixOverrides=",">
<if test="showAchievementName != null">show_ach_name = #{showAchievementName},</if>
<if test="achievementName != null">achievement_name = #{achievementName},</if>
<if test="field1 != null">field_1 = #{field1},</if>
<if test="field2 != null">field_2 = #{field2},</if>
@ -198,6 +217,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="attachmentCount != null">attachment_count = #{attachmentCount},</if>
<if test="isExpertAudit != null">is_expert_audit = #{isExpertAudit},</if>
<if test="hotRank != null">hot_rank = #{hotRank},</if>
<if test="ext3 != null">ext3 = #{ext3},</if>
<if test="ext2 != null">ext2 = #{ext2},</if>
<if test="ext1 != null">ext1 = #{ext1},</if>
</trim>
where id = #{id}
</update>
@ -214,7 +236,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<select id="getChoiceImport" resultType="com.microservices.dms.achievementLibrary.domain.Achievements">
select id, achievement_name,images,field_1,field_2,field_3,source,source_id
select id,IFNULL(show_ach_name,achievement_name) as "showAchievementName",achievement_name,images,field_1,field_2,field_3,summary,source,source_id
from achievements
where is_featured ='1'
order by update_time desc
@ -224,46 +246,50 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getTjBySources" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
select sum(1) as "value",source as "key"
from achievements
where status='1'
group by source
</select>
<select id="getTjByAreas" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
select c.id as "key", c.name as "name", f.value as "value"
from (select a.domain_value as "name", sum(a.countResult) as "value"
from (select 'field_1' as domain_type, field_1 as domain_value, count(field_1) as countResult
from achievements
group by field_1
union all
select 'field_2' as domain_type, field_2 as domain_value, count(field_2) as countResult
from achievements
group by field_2
union all
select 'field_3' as domain_type, field_3 as domain_value, count(field_3) as countResult
from achievements
group by field_3) a
group by a.domain_value
order by sum(a.countResult) desc) f
right join categories c on c.id = f.name
select r.name as "name",count(1) as "value" from (
select c.name,a.source, a.field_1,c.remark
from achievements a
left join project_categories c on a.field_1 = c.id
where a.source='1' and a.status='1' and a.field_1 is not null and a.field_1 !=""
union all
select c.name, a.source, a.field_1, c.remark
from achievements a
left join categories c on a.field_1 = c.id
where a.source in ('2','3','4') and a.status='1' and a.field_1 is not null and a.field_1 !=""
)r
group by r.name
order by count(1) desc
limit 0,5
</select>
<select id="selectAchievementsByParam" parameterType="com.microservices.dms.achievementLibrary.domain.AchQueryVo" resultType="com.microservices.dms.achievementLibrary.domain.Achievements">
<if test="source == '' or source == null">
select a.id, a.achievement_name,a.summary,a.create_time,a.owner_name,a.tags,a.field_1,a.field_2,a.field_3,a.source,a.source_id,
u.login as "userLogin",u.nickname as "userNickName",ue.gender as "gender",
select a.id,IFNULL(a.show_ach_name,a.achievement_name) as "showAchievementName",a.achievement_name,a.summary,a.create_time,a.owner_name,a.tags,a.field_1,a.field_2,a.field_3,a.source,a.source_id,
u.login as "userLogin",
IFNULL(u.nickname,a.owner_name) as "userNickName",
ue.gender as "gender",
(select IFNULL(count(*), 0) from favorites where favorite_type = 'Achievements' and favorite_id = id) as watcherSum,
(select IFNULL(count(*), 0) from watchers where watchable_type = 'Achievements' and watchable_id = id) as favoriteSum
from achievements a
left join users u on a.owner_name = u.login
left join user_extensions ue on u.id = ue.user_id
<where>
and a.status='1'
<if test="achievementName != null and achievementName != ''"> and a.achievement_name like concat('%', #{achievementName}, '%')</if>
<if test="showAchievementName != null and showAchievementName != ''"> and a.show_ach_name like concat('%', #{showAchievementName}, '%')</if>
</where>
order by a.create_time desc
</if>
<if test='source=="1"'>
select a.id, a.achievement_name, a.summary, a.create_time, a.owner_name, a.tags, a.field_1, a.field_2, a.field_3, a.source, a.source_id,
c.name as "field1Name",u.login as "userLogin",u.nickname as "userNickName",ue.gender as "gender",
select a.id,IFNULL(a.show_ach_name,a.achievement_name) as "showAchievementName", a.achievement_name, a.summary, a.create_time, a.owner_name, a.tags, a.field_1, a.field_2, a.field_3, a.source, a.source_id,
c.name as "field1Name",u.login as "userLogin",
IFNULL(u.nickname,a.owner_name) as "userNickName",
ue.gender as "gender",
(select IFNULL(count(*), 0) from favorites where favorite_type = 'Achievements' and favorite_id = a.id) as watcherSum,
(select IFNULL(count(*), 0) from watchers where watchable_type = 'Achievements' and watchable_id = a.id) as favoriteSum
from achievements a
@ -271,7 +297,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join user_extensions ue on u.id = ue.user_id
left join project_categories c on a.field_1 = c.id
<where>
and a.status='1'
<if test="achievementName != null and achievementName != ''"> and a.achievement_name like concat('%', #{achievementName}, '%')</if>
<if test="showAchievementName != null and showAchievementName != ''"> and a.show_ach_name like concat('%', #{showAchievementName}, '%')</if>
<if test="source != null and source != ''"> and a.source = #{source}</if>
<if test='areaQuery != null and areaQuery != "" '>
and (a.field_1 = #{areaQuery} or a.field_2 = #{areaQuery} or a.field_3 = #{areaQuery})
@ -280,8 +308,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by create_time desc
</if>
<if test='source=="2" or source=="3" or source=="4" '>
select a.id, a.achievement_name, a.summary, a.create_time, a.owner_name, a.tags, a.field_1, a.field_2, a.field_3, a.source, a.source_id,
c.name as "field1Name",u.login as "userLogin",u.nickname as "userNickName",ue.gender as "gender",
select a.id, IFNULL(a.show_ach_name,a.achievement_name) as "showAchievementName", a.achievement_name, a.summary, a.create_time, a.owner_name, a.tags, a.field_1, a.field_2, a.field_3, a.source, a.source_id,
c.name as "field1Name",u.login as "userLogin",
IFNULL(u.nickname,a.owner_name) as "userNickName",
ue.gender as "gender",
(select IFNULL(count(*), 0) from favorites where favorite_type = 'Achievements' and favorite_id = a.id) as watcherSum,
(select IFNULL(count(*), 0) from watchers where watchable_type = 'Achievements' and watchable_id = a.id) as favoriteSum
from achievements a
@ -289,7 +319,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join user_extensions ue on u.id = ue.user_id
left join categories c on a.field_1 = c.id
<where>
and a.status='1'
<if test="achievementName != null and achievementName != ''"> and a.achievement_name like concat('%', #{achievementName}, '%')</if>
<if test="showAchievementName != null and showAchievementName != ''"> and a.show_ach_name like concat('%', #{showAchievementName}, '%')</if>
<if test="source != null and source != ''"> and a.source = #{source}</if>
<if test='areaQuery != null and areaQuery != "" '>
and (a.field_1 = #{areaQuery} or a.field_2 = #{areaQuery} or a.field_3 = #{areaQuery})
@ -306,32 +338,43 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getaWatcher" resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
select DATE_FORMAT(created_at, '%m-%d') as 'k', count(*) as 'v'
from watchers
from watchers w
inner join achievements a on w.watchable_id = a.id
where created_at &gt;= #{s}
and created_at &lt;= #{e}
and watchable_type = #{t}
and a.status='1'
group by DATE_FORMAT(created_at, '%m-%d')
order by DATE_FORMAT(created_at, '%m-%d')
</select>
<select id="getFavorite" resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
select DATE_FORMAT(created_at, '%m-%d') as 'k', count(*) as 'v'
from favorites
from favorites f
inner join achievements a on f.favorite_id = a.id
where created_at &gt;= #{s}
and created_at &lt;= #{e}
and favorite_type = #{t}
and a.status='1'
group by DATE_FORMAT(created_at, '%m-%d')
order by DATE_FORMAT(created_at, '%m-%d')
</select>
<select id="getHotAchievement" resultType="java.util.Map">
select t.achievement_name as name, t.w as watcher, t.f as faviter, (t.w + t.f) as total, t.id as `id`,t.owner_name
as userName
<select id="getHotAchievement" resultType="com.microservices.dms.achievementLibrary.domain.HotAchVo">
select t.show_ach_name as "showAchievementName",t.achievement_name as name, t.w as watcher, t.f as faviter, (t.w + t.f) as total, t.id as `id`,t.owner_name
as userName,t.gender,t.userNickName
from (select a.achievement_name,
IFNULL(a.show_ach_name,a.achievement_name) as "show_ach_name",
a.id,a.owner_name,
IFNULL(u.nickname,a.owner_name) as "userNickName",
ue.gender as "gender",
(select IFNULL(count(*), 0) from favorites where favorite_type = 'Achievements' and favorite_id = a.id) as f,
(select IFNULL(count(*), 0) from watchers where watchable_type = 'Achievements' and watchable_id = a.id) as w
from achievements a) as t
from achievements a
left join users u on a.owner_name = u.login
left join user_extensions ue on u.id = ue.user_id
where a.status = '1'
) as t
order by (f+w) desc
limit 0,3
</select>
@ -341,7 +384,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from achievements
where create_time &gt;= #{s}
and create_time &lt;= #{e}
and source = #{t}
and source = #{t} and status='1'
group by DATE_FORMAT(create_time, '%m-%d')
order by DATE_FORMAT(create_time, '%m-%d')
</select>
<select id="getExperts" resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
select DATE_FORMAT(create_time, '%m-%d') as 'k', count(*) as 'v'
from expert_resource_library
where create_time &gt;= #{s}
and create_time &lt;= #{e} and status='1'
group by DATE_FORMAT(create_time, '%m-%d')
order by DATE_FORMAT(create_time, '%m-%d')
</select>
@ -349,33 +402,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="indexProjectStatistic" resultType="java.util.Map">
select COUNT(*) as projectAchievementCount,
IFNULL(SUM(attachment_count), 0) as attachmentCount,
(select count(1) from clickers c inner join achievements a ON a.id = c.click_id where click_type = 'Achievements' and a.source='1') as clickCount,
(select COUNT(distinct project_id) from project_resource_library) as projectCount
(select count(1) from clickers c inner join achievements a ON a.id = c.click_id where click_type = 'Achievements' and a.source='1' and a.status='1') as clickCount,
(select count(distinct a.source_id) from achievements a join project_resource_library prl on a.source_id = prl.id where a.source='1' and a.status='1') as projectCount
from achievements
where source = '1'
where source = '1' and status='1'
</select>
<select id="indexTaskStatistic" resultType="java.util.Map">
select (select count(distinct trl.task_id) from achievements a join task_resource_library trl on a.source_id = trl.id where a.source='2') as taskCount,
(select count(1) from clickers c inner join achievements a ON a.id = c.click_id where click_type = 'Achievements' and a.source='2') as clickCount,
select (select count(distinct trl.task_id) from achievements a join task_resource_library trl on a.source_id = trl.id where a.source='2' and a.status=1) as taskCount,
(select count(1) from clickers c inner join achievements a ON a.id = c.click_id where click_type = 'Achievements' and a.source='2' and a.status=1) as clickCount,
COUNT(*) as expertAuditCount
from achievements
where source = '2'
where source = '2' and status=1
</select>
<select id="indexCompetitionStatistic" resultType="java.util.Map">
select COUNT(*) as CompetitionCountAchievementCount,
IFNULL(SUM(is_expert_audit), 0) as expertAuditCount,
(select count(1) from clickers c inner join achievements a ON a.id = c.click_id where click_type = 'Achievements' and a.source='3') as clickCount,
(select COUNT(distinct open_competition_id) from competition_resource_library) as CompetitionCount
(select COUNT(distinct crl.open_competition_id) from achievements a join competition_resource_library crl
on a.source_id = crl.id where source = '3' and a.is_expert_audit = 1 and a.status='1') as expertAuditCount,
(select count(1) from clickers c inner join achievements a ON a.id = c.click_id where click_type = 'Achievements' and a.source='3' and a.status='1') as clickCount,
(select COUNT(distinct open_competition_id) from competition_resource_library crl inner join achievements a on a.source_id=crl.id where a.status='1') as CompetitionCount
from achievements
where source = '3'
where source = '3' and status='1'
</select>
<select id="indexSchoolEnterpriseStatistic" resultType="java.lang.Long">
select COUNT(*)
from achievements a
where source = #{s}
and tags = #{t}
and a.status = '1'
<if test="t != null and t != ''">
and tags = #{t}
</if>
</select>
<select id="getAreasByName" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
@ -406,6 +463,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
union all
select review_area_one as "domainName" from experts
)a
where a.domainName is not null and a.domainName !=""
</select>
<select id="getActDataStatisticById"
@ -432,10 +490,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="getWatchFavoriteStatusById" resultType="com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo">
select b.watchSum, d.favoriteSum
select b.watchSum, d.favoriteSum,c.userDockingSum
from (
(select count(1) as watchSum from watchers where watchable_type = 'Achievements' and watchable_id = #{id} and user_id=#{userId}) b,
(select count(1) as favoriteSum from favorites where favorite_type = 'Achievements' and favorite_id = #{id} and user_id=#{userId}) d
(select count(1) as favoriteSum from favorites where favorite_type = 'Achievements' and favorite_id = #{id} and user_id=#{userId}) d,
(select count(1) as userDockingSum from clickers where click_type = 'userDocking' and click_id = #{id} and user_id=#{userId}) c
)
</select>
@ -443,7 +502,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select count(*)
from achievements
<where>
<if test="source != null and source != ''">and `source` = #{source}</if>
<if test="t != null and t != ''">and `source` = #{t}</if>
<if test="s != null">and create_time &gt;= #{s}</if>
<if test="e != null">and create_time &lt;= #{e}</if>
</where>
@ -458,40 +517,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getAchievementType" resultType="java.util.Map">
select achievement_type as 'k', count(*) as 'v'
from achievements
from achievements where achievement_type is not null
group by achievement_type
</select>
<select id="getAchievementActData" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
select * from (
select 'w' as `key`, DATE_FORMAT(created_at, '%Y') as name ,COUNT(*) as value from watchers where watchable_type = 'Achievements' group by DATE_FORMAT(created_at, '%Y')
select '关注' as `key`, DATE_FORMAT(created_at, '%m-%d') as name ,COUNT(*) as value from watchers where watchable_type = 'Achievements' and created_at &gt;= #{s} and created_at &lt;= #{e} group by DATE_FORMAT(created_at, '%m-%d')
union all
select 'c' as `key`, DATE_FORMAT(created_at, '%Y') as name,COUNT(*) as value from clickers where click_type = 'Achievements' group by DATE_FORMAT(created_at, '%Y')
select '浏览' as `key`, DATE_FORMAT(created_at, '%m-%d') as name,COUNT(*) as value from clickers where click_type = 'Achievements' and created_at &gt;= #{s} and created_at &lt;= #{e} group by DATE_FORMAT(created_at, '%m-%d')
union all
select 'd' as `key`, DATE_FORMAT(created_at, '%Y') as name,COUNT(*) as value from downloads where download_type = 'Achievements' group by DATE_FORMAT(created_at, '%Y')
select '下载' as `key`, DATE_FORMAT(created_at, '%m-%d') as name,COUNT(*) as value from downloads where download_type = 'Achievements' and created_at &gt;= #{s} and created_at &lt;= #{e} group by DATE_FORMAT(created_at, '%m-%d')
union all
select 'f' as `key`, DATE_FORMAT(created_at, '%Y') as name,COUNT(*) as value from favorites where favorite_type = 'Achievements' group by DATE_FORMAT(created_at, '%Y'))t
select '收藏' as `key`, DATE_FORMAT(created_at, '%m-%d') as name,COUNT(*) as value from favorites where favorite_type = 'Achievements' and created_at &gt;= #{s} and created_at &lt;= #{e} group by DATE_FORMAT(created_at, '%m-%d'))t
order by t.name
</select>
<select id="getAchievementDomain" resultType="java.util.Map">
select c.id as "key", c.name as "name", f.value as "value"
from (select a.domain_value as "name", sum(a.countResult) as "value"
from (select 'field_1' as domain_type, field_1 as domain_value, count(field_1) as countResult
from achievements
group by field_1
union all
select 'field_2' as domain_type, field_2 as domain_value, count(field_2) as countResult
from achievements
group by field_2
union all
select 'field_3' as domain_type, field_3 as domain_value, count(field_3) as countResult
from achievements
group by field_3) a
group by a.domain_value
order by sum(a.countResult) desc) f
right join categories c on c.id = f.name
select r.name as "name",count(1) as "value" from (
select
c.name,a.source, a.field_1,c.remark
from achievements a
left join project_categories c on a.field_1 = c.id
where a.source='1' and a.field_1 is not null and a.field_1 !=""
union all
select
c.name, a.source, a.field_1, c.remark
from achievements a
left join categories c on a.field_1 = c.id
where a.source in ('2','3','4') and a.field_1 is not null and a.field_1 !=""
)r
group by r.name
</select>
<select id="getAchievementAddYearly" resultType="java.util.Map">
@ -501,7 +557,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by DATE_FORMAT(create_time, '%Y')
</select>
<select id="getAchievementHotRank" resultType="java.util.Map">
select achievement_name as name, create_time as reelaseTime, hot_rank from achievements
select IFNULL(show_ach_name,achievement_name) as name, create_time as reelaseTime, hot_rank from achievements
order by hot_rank desc
</select>
@ -510,30 +566,117 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="getAreaStatistic" resultType="com.microservices.dms.achievementLibrary.domain.AreaStatisticVo">
select z.name as "areaName",
z.field_1 as "areaKey",
z.remark as "remark",
sum(z.kyxm) as "kyxmSum",
sum(z.ckrw) as "ckrwSum",
sum(z.kfjs) as "kfjsSum",
sum(z.xqcg) as "xqcgSum"
from (select r.name,
r.field_1,
r.remark,
case when r.source = 1 then tmp else 0 end as "kyxm",
case when r.source = 2 then tmp else 0 end as "ckrw",
case when r.source = 3 then tmp else 0 end as "kfjs",
case when r.source = 4 then tmp else 0 end as "xqcg"
from (select c.name, a.source, count(1) as "tmp", a.field_1, c.remark
from achievements a
inner join categories c on a.field_1 = c.id
group by c.name, a.source, a.field_1, c.remark) r) z
<where>
<if test="areaKey != null and areaKey != ''">
and z.field_1 = #{areaKey}
</if>
</where>
group by z.name, z.field_1, z.remark
<if test="source == '' or source == null">
select
z.name as "areaName",
z.field_1 as "areaKey",
z.remark as "remark",
z.source as "source",
sum(z.kyxm) as "kyxmSum",
sum(z.ckrw) as "ckrwSum",
sum(z.kfjs) as "kfjsSum",
sum(z.xqcg) as "xqcgSum"
from (
select
r.name,
r.field_1,
r.remark,
r.sorceType as "source",
case when r.source = 1 then tmp else 0 end as "kyxm",
case when r.source = 2 then tmp else 0 end as "ckrw",
case when r.source = 3 then tmp else 0 end as "kfjs",
case when r.source = 4 then tmp else 0 end as "xqcg"
from (
select
t.name,t.source,count(1) as "tmp",t.field_1,t.remark,t.sorceType
from (
select c.name,a.source, a.field_1,c.remark,"1" as sorceType
from achievements a
left join project_categories c on a.field_1 = c.id where a.source='1' and c.name is not null
union all
select c.name, a.source, a.field_1, c.remark,"2" as sorceType
from achievements a
left join categories c on a.field_1 = c.id where a.source in ('2','3','4') and c.name is not null
)t
where t.field_1 is not null and t.field_1 !=""
group by t.name, t.source, t.field_1, t.remark,t.sorceType
) r
) z
<where>
<if test="areaKey != null and areaKey != ''">
and z.field_1 = #{areaKey}
</if>
</where>
group by z.name, z.field_1, z.remark, z.source
</if>
<if test='source=="1"'>
select
z.name as "areaName",
z.field_1 as "areaKey",
z.remark as "remark",
sum(z.kyxm) as "kyxmSum",
sum(z.ckrw) as "ckrwSum",
sum(z.kfjs) as "kfjsSum",
sum(z.xqcg) as "xqcgSum",
"1" as source
from (
select
r.name,
r.field_1,
r.remark,
case when r.source = 1 then tmp else 0 end as "kyxm",
case when r.source = 2 then tmp else 0 end as "ckrw",
case when r.source = 3 then tmp else 0 end as "kfjs",
case when r.source = 4 then tmp else 0 end as "xqcg"
from (
select c.name,a.source, a.field_1,c.remark,count(1) as "tmp"
from achievements a
left join project_categories c on a.field_1 = c.id
where a.source='1' and a.field_1 is not null and a.field_1 !=""
group by c.name, a.source, a.field_1, c.remark
) r
) z
<where>
<if test="areaKey != null and areaKey != ''">
and z.field_1 = #{areaKey}
</if>
</where>
group by z.name, z.field_1, z.remark
</if>
<if test='source=="2" or source=="3" or source=="4" '>
select
z.name as "areaName",
z.field_1 as "areaKey",
z.remark as "remark",
sum(z.kyxm) as "kyxmSum",
sum(z.ckrw) as "ckrwSum",
sum(z.kfjs) as "kfjsSum",
sum(z.xqcg) as "xqcgSum",
"2" as source
from (
select
r.name,
r.field_1,
r.remark,
case when r.source = 1 then tmp else 0 end as "kyxm",
case when r.source = 2 then tmp else 0 end as "ckrw",
case when r.source = 3 then tmp else 0 end as "kfjs",
case when r.source = 4 then tmp else 0 end as "xqcg"
from (
select c.name, a.source, a.field_1, c.remark,count(1) as tmp
from achievements a
left join categories c on a.field_1 = c.id
where a.source in ('2','3','4') and a.field_1 is not null and a.field_1 !=""
group by c.name, a.source, a.field_1, c.remark
) r
) z
<where>
<if test="areaKey != null and areaKey != ''">
and z.field_1 = #{areaKey}
</if>
</where>
group by z.name, z.field_1, z.remark
</if>
</select>
<select id="getAllSourceId" resultType="java.lang.Long">
@ -542,6 +685,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where project_id = (select project_id from project_resource_library where id = #{sourceId})
</select>
<select id="getAllSourceIdCompetition" resultType="java.lang.Long">
select id
from competition_resource_library
where open_competition_id = (select open_competition_id from competition_resource_library where id = #{sourceId})
</select>
<select id="getAllSourceIdTask" resultType="java.lang.Long">
select id
from task_resource_library
where task_id = (select task_id from task_resource_library where id = #{sourceId})
</select>
<select id="getDistinctYear" resultType="String">
select distinct DATE_FORMAT(create_time, '%Y')
from achievements
@ -561,6 +714,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
source as "source",
source_id as "sourceId" ,
achievement_name as "achRelateName",
show_ach_name as "showAchievementName",
#{paramYear} as resultYear
from achievements
where source_id in
@ -570,6 +724,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and DATE_FORMAT(create_time, '%Y') = #{paramYear}
order by DATE_FORMAT(create_time, '%m-%d')
</select>
<select id="getRelatedAchTaskOfExpert"
resultType="com.microservices.dms.resourceLibrary.domain.TaskResourceLibrary">
select *
from task_resource_library erl
join
(select container_id
from task_expert
where container_type = 1
and `status` in (1, 2) and expert_id = #{id}
group by container_id
having count(*) > 0) as tmp
on erl.task_id = tmp.container_id
</select>
<select id="getRelatedAchCompetitionOfExpert"
resultType="com.microservices.dms.resourceLibrary.domain.CompetitionResourceLibrary">
select *
from competition_resource_library erl
join
(select container_id
from task_expert
where container_type = 2
and `status` in (1, 2) and expert_id = #{id}
group by container_id
having count(*) > 0) as tmp
on erl.open_competition_id = tmp.container_id
</select>
<select id="selectAchievementsByName" resultType="Long">
select id
from achievements
@ -600,4 +784,148 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where a.id=#{id}
</if>
</select>
<select id="getField1RemarkByParam" resultType="String">
<if test='source != null and source == "1"'>
select remark from project_categories where id=#{areaKey}
</if>
<if test='source != null and source == "2"'>
select remark from categories where id =#{areaKey}
</if>
</select>
<select id="getAchievementAddYearlyData" resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
select DATE_FORMAT(create_time, '%Y-%m') as 'k', count(*) as 'v'
from achievements
where create_time &gt;= #{s}
and create_time &lt;= #{e}
group by DATE_FORMAT(create_time, '%Y-%m')
order by DATE_FORMAT(create_time, '%Y-%m')
</select>
<select id="getAchievementActDataW"
resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
select '关注' as `key`, DATE_FORMAT(created_at, '%m-%d') as name ,COUNT(*) as value from watchers where watchable_type = 'Achievements' and created_at &gt;= #{s} and created_at &lt;= #{e} group by DATE_FORMAT(created_at, '%m-%d')
</select>
<select id="getAchievementActDataC"
resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
select '浏览' as `key`, DATE_FORMAT(created_at, '%m-%d') as name,COUNT(*) as value from clickers where click_type = 'Achievements' and created_at &gt;= #{s} and created_at &lt;= #{e} group by DATE_FORMAT(created_at, '%m-%d')
</select>
<select id="getAchievementActDataD"
resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
select '下载' as `key`, DATE_FORMAT(created_at, '%m-%d') as name,COUNT(*) as value from downloads where download_type = 'Achievements' and created_at &gt;= #{s} and created_at &lt;= #{e} group by DATE_FORMAT(created_at, '%m-%d')
</select>
<select id="getAchievementActDataF"
resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
select '收藏' as `key`, DATE_FORMAT(created_at, '%m-%d') as name,COUNT(*) as value from favorites where favorite_type = 'Achievements' and created_at &gt;= #{s} and created_at &lt;= #{e} group by DATE_FORMAT(created_at, '%m-%d')
</select>
<select id="getDockingUserInfo" resultType="java.util.Map">
select * from (
select u.id,u.login,u.nickname,p.name as "lastname,",u.phone,u.company_name,u.mail,p.card as "idNumber",e.entity_type,DATE_FORMAT(c.created_at,'%Y-%m-%d %H:%i:%s') as created_at
from users u
inner join entities e on u.id = e.user_id
inner join personalities p on e.id = p.entity_id
inner join (select created_at, user_id from clickers where click_id = #{id} and click_type ='userDocking' ) c on u.id = c.user_id
where u.authentication='1'
union all
select u.id,u.login,u.nickname,u.lastname,u.phone,en.name as "company_name",u.mail,en.credit_code as "idNumber",e.entity_type,DATE_FORMAT(c.created_at,'%Y-%m-%d %H:%i:%s') as created_at
from users u
inner join entities e on u.id = e.user_id
inner join enterprises en on e.id = en.entity_id
inner join (select created_at,user_id from clickers where click_id = #{id} and click_type ='userDocking') c on u.id = c.user_id
where u.enterprise_certification='1') t
order by t.created_at
</select>
<select id="selectAchievementsByArea" parameterType="com.microservices.dms.achievementLibrary.domain.AchQueryVo" resultType="com.microservices.dms.achievementLibrary.domain.Achievements">
<if test='source=="2"'>
select a.id, IFNULL(a.show_ach_name,a.achievement_name) as "showAchievementName", a.achievement_name, a.summary, a.create_time, a.owner_name, a.tags, a.field_1, a.field_2, a.field_3, a.source, a.source_id,
c.name as "field1Name",u.login as "userLogin",
IFNULL(u.nickname,a.owner_name) as "userNickName",
ue.gender as "gender",c.remark as "filedDesc",
(select IFNULL(count(*), 0) from favorites where favorite_type = 'Achievements' and favorite_id = a.id) as watcherSum,
(select IFNULL(count(*), 0) from watchers where watchable_type = 'Achievements' and watchable_id = a.id) as favoriteSum,
(select IFNULL(count(*), 0) from clickers where click_type = 'Achievements' and click_id = a.id) as clickSum,
(select IFNULL(count(*), 0) from clickers where click_type = 'userDocking' and click_id = a.id) as dockSum
from achievements a
left join users u on a.owner_name = u.login
left join user_extensions ue on u.id = ue.user_id
left join categories c on a.field_1 = c.id
<where>
and a.status='1' and a.source !='1'
<if test="achievementName != null and achievementName != ''"> and a.achievement_name like concat('%', #{achievementName}, '%')</if>
<if test="showAchievementName != null and showAchievementName != ''"> and a.show_ach_name like concat('%', #{showAchievementName}, '%')</if>
<if test='areaQuery != null and areaQuery != "" '>
and (a.field_1 = #{areaQuery} or a.field_2 = #{areaQuery} or a.field_3 = #{areaQuery})
</if>
</where>
order by a.create_time desc
</if>
<if test='source=="1"'>
select a.id,IFNULL(a.show_ach_name,a.achievement_name) as "showAchievementName", a.achievement_name, a.summary, a.create_time, a.owner_name, a.tags, a.field_1, a.field_2, a.field_3, a.source, a.source_id,
c.name as "field1Name",u.login as "userLogin",
IFNULL(u.nickname,a.owner_name) as "userNickName",
ue.gender as "gender",c.remark as "filedDesc",
(select IFNULL(count(*), 0) from favorites where favorite_type = 'Achievements' and favorite_id = a.id) as watcherSum,
(select IFNULL(count(*), 0) from watchers where watchable_type = 'Achievements' and watchable_id = a.id) as favoriteSum,
(select IFNULL(count(*), 0) from clickers where click_type = 'Achievements' and click_id = a.id) as clickSum,
(select IFNULL(count(*), 0) from clickers where click_type = 'userDocking' and click_id = a.id) as dockSum
from achievements a
left join users u on a.owner_name = u.login
left join user_extensions ue on u.id = ue.user_id
left join project_categories c on a.field_1 = c.id
<where>
and a.status='1'
<if test="achievementName != null and achievementName != ''"> and a.achievement_name like concat('%', #{achievementName}, '%')</if>
<if test="showAchievementName != null and showAchievementName != ''"> and a.show_ach_name like concat('%', #{showAchievementName}, '%')</if>
<if test="source != null and source != ''"> and a.source = #{source}</if>
<if test='areaQuery != null and areaQuery != "" '>
and (a.field_1 = #{areaQuery} or a.field_2 = #{areaQuery} or a.field_3 = #{areaQuery})
</if>
</where>
order by create_time desc
</if>
</select>
<select id="getAllAreas" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
select r.name as "name",GROUP_CONCAT( r.source SEPARATOR ',') as "result"
from (
select name,CONCAT(id, '_', '2')as source from categories
union all
select name,CONCAT(id, '_', '1') as source from project_categories
)r
<where>
<if test="areaName != null and areaName != ''">and r.name = #{areaName}</if></where>
GROUP BY r.name
</select>
<update id="updateRelationAchievements">
<if test='source != null and source == "1"'>
update project_resource_library set is_transferred_to_achievement='0' ,transfer_date=null where id = #{sourceId}
</if>
<if test='source != null and source == "2"'>
update task_resource_library set is_transferred_to_results_library='0' ,transfer_to_results_date=null where id = #{sourceId}
</if>
<if test='source != null and source == "3"'>
update competition_resource_library set is_transferred_to_result_library='0' ,transferred_to_result_library_time=null where id = #{sourceId}
</if>
<if test='source != null and source == "4"'>
update school_enterprise_achievements set status=null ,review_comments=null,review_date=null,reviewer=null where id = #{sourceId}
</if>
</update>
<select id="getDockingUserInfoList" resultType="java.util.Map">
select u.id,u.login,u.nickname,p.name as "lastname,",u.phone,u.company_name,u.mail,p.card as "idNumber",e.entity_type,DATE_FORMAT(ck.created_at,'%Y-%m-%d %H:%i:%s') as created_at
from clickers ck
inner join users u on ck.user_id = u.id
left join entities e on u.id = e.user_id
left join personalities p on e.id = p.entity_id
where click_type='userDocking' and click_id = #{id}
</select>
</mapper>

View File

@ -139,21 +139,42 @@
</where>
</select>
<select id="selectActivityUserLibraryListAll" resultType="com.microservices.dms.behaviorImage.domain.ActivityUserLibrary" parameterType="com.microservices.dms.behaviorImage.domain.ActivityUserLibrary">
select res.userId,res.loginName,res.userName,res.isExpert,res.isAuth,res.relatedCompetition,res.relatedTask,res.p1+res.p2+res.p3 as "relatedProject" from (
select u.id as "userId",u.login as "loginName",u.nickname as "userName",u.is_expert as "isExpert",u.authentication as "isAuth",
(select count(1) as "value" from tasks where is_delete='0' and status between 3 and 8 and user_id =u.id) as "relatedTask",
(select count(1) from competition_infos ci inner join competition_users cu on ci.id = cu.competition_info_id where cu.user_id =u.id) as "relatedCompetition",
(SELECT count(1) as "pCount" FROM `projects` WHERE id != 0 AND user_id =u.id) as p1,
( SELECT count(1) as "pCount"
FROM `projects`
INNER JOIN `members` ON `members`.`project_id` = `projects`.`id`
WHERE `projects`.`id` != 0 AND `projects`.`user_id` !=u.id AND `members`.`user_id` =u.id) as p2,
(SELECT count(1) as "pCount"
FROM `projects`
INNER JOIN `team_projects` ON `team_projects`.`project_id` = `projects`.`id`
INNER JOIN `teams` ON `teams`.`id` = `team_projects`.`team_id`
INNER JOIN `team_users` ON `team_users`.`team_id` = `teams`.`id`
WHERE `projects`.`id` != 0 AND `team_users`.`user_id` =u.id) as p3
from users u) res
where (res.relatedCompetition >0 or res.relatedTask >0 or res.p1+res.p2+res.p3>0)
<if test="userName != null and userName != ''"> and res.userName like concat('%', #{userName}, '%')</if>
</select>
<select id="getrelatedProjectCount" resultType="long">
select sum(r.pCount) from (
SELECT count(1) as "pCount" FROM `projects` WHERE id != 0 AND user_id = 1
SELECT count(1) as "pCount" FROM `projects` WHERE id != 0 AND user_id = #{userId}
union all
SELECT count(1) as "pCount"
FROM `projects`
INNER JOIN `members` ON `members`.`project_id` = `projects`.`id`
WHERE `projects`.`id` != 0 AND `projects`.`user_id` != 1 AND `members`.`user_id` = 1
WHERE `projects`.`id` != 0 AND `projects`.`user_id` != #{userId} AND `members`.`user_id` = #{userId}
union all
SELECT count(1) as "pCount"
FROM `projects`
INNER JOIN `team_projects` ON `team_projects`.`project_id` = `projects`.`id`
INNER JOIN `teams` ON `teams`.`id` = `team_projects`.`team_id`
INNER JOIN `team_users` ON `team_users`.`team_id` = `teams`.`id`
WHERE `projects`.`id` != 0 AND `team_users`.`user_id` = 1
WHERE `projects`.`id` != 0 AND `team_users`.`user_id` = #{userId}
)r
</select>
@ -286,13 +307,32 @@
)t group by t.resultType
</select>
<select id="getActivityStatistic" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
select 'totalUser' as `key`, count(1) as " value" from users
union all
select'authTotal' as `key`,sum(u.authentication) as "value" from users u
union all
select 'totalexpert' as `key`, count(1) as " value"from users u
inner join experts e on u.id = e.user_id
where e.is_delete='0' and e.status = 1
<select id="getActivityStatistic" resultType="com.microservices.dms.behaviorImage.domain.ActivityUserTotal">
select count(1) as "totalUser",sum(r.isExpert) as "totalExpert",sum(r.enterprise_certification+r.authentication) as "authTotal" from (
select res.userId,res.loginName,res.userName,res.isExpert,res.authentication,res.enterprise_certification,res.relatedCompetition,res.relatedTask,res.p1+res.p2+res.p3 as "relatedProject" from (
select u.id as "userId",u.login as "loginName",u.nickname as "userName",u.is_expert as "isExpert",u.authentication,u.enterprise_certification,
(select count(1) as "value" from tasks where is_delete='0' and status between 3 and 8 and user_id =u.id) as "relatedTask",
(select count(1) from competition_infos ci inner join competition_users cu on ci.id = cu.competition_info_id where cu.user_id =u.id) as "relatedCompetition",
(SELECT count(1) as "pCount" FROM `projects` WHERE id != 0 AND user_id =u.id) as p1,
( SELECT count(1) as "pCount"
FROM `projects` INNER JOIN `members` ON `members`.`project_id` = `projects`.`id`
WHERE `projects`.`id` != 0 AND `projects`.`user_id` !=u.id AND `members`.`user_id` =u.id) as p2,
(SELECT count(1) as "pCount"
FROM `projects`
INNER JOIN `team_projects` ON `team_projects`.`project_id` = `projects`.`id`
INNER JOIN `teams` ON `teams`.`id` = `team_projects`.`team_id`
INNER JOIN `team_users` ON `team_users`.`team_id` = `teams`.`id`
WHERE `projects`.`id` != 0 AND `team_users`.`user_id` =u.id) as p3
from users u) res
where res.relatedCompetition >0 or res.relatedTask >0 or res.p1+res.p2+res.p3>0 )r
</select>
<select id="getUserBehaviorSum" resultType="com.microservices.dms.behaviorImage.domain.UserTypeTotalVo">
select
(select count(1) as "resultCount" from watchers where user_id = u.id ) as "watchSum",
(select count(1) as "resultCount" from favorites where user_id = u.id ) as "favoriteSum",
(select count(1) as "resultCount" from praise_treads where user_id = u.id ) as "praiseSum"
from users u
where u.id = #{userId}
</select>
</mapper>

View File

@ -130,7 +130,7 @@
ci.status as competition_status,
cu.works_name as competition_submission_name,
cu.created_at as submission_time,
cu.leader as submitter,
IFNULL(cu.leader,us.nickname) as submitter,
submission_type,
cu.org_name as submitting_unit,
IFNULL(crl.submission_summary,cu.sub_item) as submission_summary,
@ -151,6 +151,7 @@
ci.is_expert_audit
from competition_infos ci
join (select * from competition_users where `status` = 3) cu on ci.id = cu.competition_info_id
inner join users us on cu.user_id=us.id
left join competition_resource_library crl on crl.competition_user_id = cu.id
<where>
<if test="openCompetitionId != null ">and open_competition_id = #{openCompetitionId}</if>
@ -189,7 +190,7 @@
<if test="image != null and image != ''">and image = #{image}</if>
<if test="attachment != null and attachment != ''">and attachment = #{attachment}</if>
</where>
order by is_transferred_to_result_library
order by is_transferred_to_result_library,create_time desc,submission_time desc
</select>
<select id="selectCompetitionResourceLibraryById" parameterType="Long" resultMap="CompetitionResourceLibraryResult">
@ -253,9 +254,9 @@
</select>
<select id="getCompetitionTransferCount" resultType="java.lang.Long">
select COUNT(*)
from achievements
where source = '3'
select count(1) from competition_users cu
inner join competition_infos ci on cu.competition_info_id = ci.id
inner join attachments at on cu.id=at.container_id
</select>
<select id="getCompetitionNeedAuditCount" resultType="java.lang.Long">
@ -274,31 +275,32 @@
select t.title as name, achievementCount, enrollCount, paperCount, t.id as `id`,(achievementCount+enrollCount+paperCount) as total
from (select c.title,
c.id,
c.updated_at,
(select count(*) from achievements a where source='3' and a.source_id = c.id ) as achievementCount,
(select count(*) from competition_users cu where cu.competition_info_id = c.id) as enrollCount,
(select count(*) from (select * from competition_users) cu inner join attachments on container_type = 'CompetitionUser' and container_id=cu.id where cu.competition_info_id=c.id) as paperCount
from competition_infos c ) as t
order by total desc
order by total desc,updated_at desc
limit 0,10
</select>
<select id="getCompetitionYearlyPaperAdd"
resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
select DATE_FORMAT(created_at, '%m-%d') as 'k', count(*) as 'v'
select DATE_FORMAT(created_at, '%Y-%m') as 'k', count(*) as 'v'
from competition_infos
where created_at &gt;= #{s}
and created_at &lt;= #{e}
group by DATE_FORMAT(created_at, '%m-%d')
order by DATE_FORMAT(created_at, '%m-%d')
group by DATE_FORMAT(created_at, '%Y-%m')
order by DATE_FORMAT(created_at, '%Y-%m')
</select>
<select id="getCompetitionYearlyFinish"
resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
select DATE_FORMAT(upload_date, '%m-%d') as 'k', count(*) as 'v'
select DATE_FORMAT(upload_date, '%Y-%m') as 'k', count(*) as 'v'
from competition_infos
where upload_date &gt;= #{s}
and upload_date &lt;= #{e}
group by DATE_FORMAT(upload_date, '%m-%d')
order by DATE_FORMAT(upload_date, '%m-%d')
group by DATE_FORMAT(upload_date, '%Y-%m')
order by DATE_FORMAT(upload_date, '%Y-%m')
</select>
<insert id="insertCompetitionResourceLibrary" parameterType="CompetitionResourceLibrary" useGeneratedKeys="true"

View File

@ -72,15 +72,16 @@
<select id="selectExpertResourceLibraryList" parameterType="ExpertResourceLibrary"
resultType="com.microservices.dms.resourceLibrary.domain.ExpertResourceLibrary">
select * from ( select erl.id, e.id as expert_id,e.user_id, e.expert_name, e.highest_degree, e.graduated_from,
u.nickname as "userNickName",ue.gender as "gender",
u.nickname as "userNickName", IFNULL(erl.gender, ue.gender) as "gender",
e.id_number,images, attachments,
e.major, e.workplace, e.phone,
CONCAT_WS(',',resume, title_certificate,academic_achievements,honors) AS fullFileIds,
e.workplace_type, e.expert_email, erl.expert_summary, erl.expert_detail, e.professional_title, e.expert_type,
expert_domain,u.authentication as expertAuth,
e.title_rank, erl.status, e.review_area_one, e.review_area_two, e.review_area_three, e.is_delete, erl.create_by,
erl.create_time,
(select COUNT(*) from task_expert where expert_id = e.id and container_type = 1 and `status` in (1,2)) as taskAuditCount,
(select COUNT(*) from task_expert where expert_id = e.id and container_type = 2 and `status` in (1,2)) as competitionAuditCount,
(select COUNT(distinct container_id) from task_expert where expert_id = e.id and container_type = 1 and `status` in (1,2)) as taskAuditCount,
(select COUNT(distinct container_id) from task_expert where expert_id = e.id and container_type = 2 and `status` in (1,2)) as competitionAuditCount,
erl.update_by, erl.update_time,erl.sort_no
from experts e
inner join users u on e.user_id = u.id
@ -121,7 +122,7 @@
<select id="selectExpertResourceLibraryList2" parameterType="ExpertResourceLibrary"
resultMap="ExpertResourceLibraryResult">
select erl.id, e.id as expert_id,e.user_id, e.expert_name, e.highest_degree, e.graduated_from, e.id_number,
e.major, e.workplace, e.phone,
e.major, e.workplace, e.phone,u.nickname as "userNickName", IFNULL(erl.gender, ue.gender) as "gender",
e.workplace_type, e.expert_email, erl.expert_summary, erl.expert_detail, e.professional_title, e.expert_type,
expert_domain,images, attachments,
e.title_rank, erl.status, e.review_area_one, e.review_area_two, e.review_area_three, e.is_delete, erl.create_by,
@ -131,8 +132,12 @@
(select count(*) as watchSum from watchers where watchable_type = 'Experts' and watchable_id = erl.id) as watcherSum,
(select count(*) as favoriteSum from favorites where favorite_type = 'Experts' and favorite_id = erl.id) as favoriteSum,
erl.update_by, erl.update_time,erl.sort_no
from expert_resource_library erl left join experts e on e.id = erl.expert_id
from expert_resource_library erl
left join experts e on e.id = erl.expert_id
left join users u on e.user_id = u.id
left join user_extensions ue on u.id = ue.user_id
<where>
and erl.status ='1'
<if test="userId != null ">and user_id = #{userId}</if>
<if test="expertName != null and expertName != ''">and erl.expert_name like concat('%', #{expertName}, '%')
</if>
@ -158,6 +163,7 @@
</if>
<if test="isDelete != null ">and erl.is_delete = #{isDelete}</if>
</where>
order by erl.sort_no
</select>
<select id="selectExpertResourceLibraryById" parameterType="Long" resultMap="ExpertResourceLibraryResult">
@ -179,15 +185,15 @@
<select id="competitionAuditCount" resultType="java.lang.Long">
select IFNULL(SUM(competitionAuditCount), 0)
from (select (select COUNT(distinct container_id)
from task_expert
where expert_id = e.id and container_type = 2 and `status` in (1,2)) as competitionAuditCount
from experts e) tmp
from (select COUNT(distinct container_id) as competitionAuditCount
from task_expert te
join experts e on e.id = te.expert_id and te.container_type = 2 and te.`status` in (1, 2)) tmp
</select>
<select id="taskAuditCount" resultType="java.lang.Long">
select IFNULL(SUM(taskAuditCount), 0)
from (select (select COUNT(distinct container_id) from task_expert where expert_id = e.id and container_type = 1 and `status` in (1,2)) as taskAuditCount
from experts e) tmp
from (select COUNT(distinct container_id) as taskAuditCount
from task_expert te
join experts e on e.id = te.expert_id and te.container_type = 1 and te.`status` in (1, 2)) tmp
</select>
<select id="auditCompetitionAuditExpertCount" resultType="java.lang.Long">
select count(*)
@ -367,12 +373,12 @@
select b.expertTotal as "total", d.expertAuth as "value"
from (
(select count(1) as "expertTotal" from experts where is_delete = '0' and status = 1) b,
(select count(1) as "expertAuth"
from experts e
inner join users u on e.user_id = u.id
where e.is_delete = '0'
and e.status = 1
and u.authentication = true) d
(select count(1) as "expertAuth"
from experts e
inner join users u on e.user_id = u.id
where e.is_delete = '0'
and e.status = 1
and (u.authentication = true or u.enterprise_certification='1')) d
)
</select>
@ -415,6 +421,8 @@
and review_area_three is not null
and review_area_three != '') a
group by a.domain_value
order by count(a.domain_value) desc
limit 0,9
</select>
<select id="getExpertAduit" resultType="com.microservices.dms.achievementLibrary.domain.ExpertTotallVo">
@ -422,19 +430,15 @@
tmp.taskAuditCount as "taskAuditSum",
tmp.competitionAuditCount as "competitionAuditSum",
(tmp.taskAuditCount + tmp.competitionAuditCount) as "total"
from (select e.expert_name,
from (select e.expert_name,e.created_on,
(select COUNT(distinct container_id) from task_expert where expert_id = e.id and container_type = 1 and `status` in (1,2)) as taskAuditCount,
(select COUNT(distinct container_id)
from task_expert
where expert_id = e.id
and container_type = 2 and `status` in (1,2)) as competitionAuditCount
(select COUNT(distinct container_id) from task_expert where expert_id = e.id and container_type = 2 and `status` in (1,2)) as competitionAuditCount
from experts e
inner join users u on e.user_id = u.id
left join expert_resource_library erl on e.id = erl.user_id
left join users u on e.user_id = u.id
where e.is_delete = '0'
and e.status = 1) tmp
order by (tmp.taskAuditCount + tmp.competitionAuditCount) desc
limit 0,9
order by (tmp.taskAuditCount + tmp.competitionAuditCount) desc,tmp.created_on desc
limit 0,12
</select>
@ -451,10 +455,11 @@
</select>
<select id="getWatchFavoriteStatusById" resultType="com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo">
select b.watchSum, d.favoriteSum
select b.watchSum, d.favoriteSum,c.userDockingSum
from (
(select count(1) as watchSum from watchers where watchable_type = 'Experts' and watchable_id = #{id} and user_id=#{userId}) b,
(select count(1) as favoriteSum from favorites where favorite_type = 'Experts' and favorite_id = #{id} and user_id=#{userId}) d
(select count(1) as favoriteSum from favorites where favorite_type = 'Experts' and favorite_id = #{id} and user_id=#{userId}) d,
(select count(1) as userDockingSum from clickers where click_type = 'userDocking' and click_id = #{id} and user_id=#{userId}) c
)
</select>
@ -494,28 +499,31 @@
<select id="getForumSectionStatistic" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
select a.ancestry as "key", fs.title as "name", a.tmp as "value"
from (select f.ancestry, count(1) as "tmp"
from memos m
left join forum_sections f on m.forum_section_id = f.id
where m.destroy_status is null
and m.hidden = 0
and m.published_at is not null
group by f.ancestry) a
left join forum_sections fs on fs.id = a.ancestry
from (
select IFNULL(f.ancestry, m.forum_section_id) as"ancestry",count(1) as "tmp" from memos m
inner join forum_sections f on m.forum_section_id = f.id
where m.destroy_status is null
and m.hidden = 0
and m.published_at is not null
group by IFNULL(f.ancestry, m.forum_section_id)
) a
left join forum_sections fs on fs.id = a.ancestry
ORDER BY a.ancestry DESC
</select>
<select id="getAddMemoStatistic" resultType="com.microservices.dms.achievementLibrary.domain.KeyValueVo">
select a.currentMonth as "name", a.tag_id as "key", sum(a.countTag) as "value"
from (select DATE_FORMAT(published_at, '%m') as "currentMonth", tag_id, count(1) as "countTag"
from memos
where DATE_FORMAT(published_at, '%Y') = YEAR (NOW()) and destroy_status is null and hidden=0 and published_at is not null
group by DATE_FORMAT(published_at, '%m'), tag_id
) a
from (select DATE_FORMAT(published_at, '%Y-%m') as "currentMonth", tag_id, count(1) as "countTag"
from memos
where destroy_status is null and hidden=0 and published_at is not null
and published_at &gt;= #{s} and published_at &lt;= #{e}
group by DATE_FORMAT(published_at, '%Y-%m'), tag_id
) a
group by a.currentMonth, a.tag_id
order by a.tag_id, a.currentMonth asc
</select>
<select id="getTop5Memos" resultType="com.microservices.dms.achievementLibrary.domain.MemoTotalVo">
select id as "id",subject as "subject",published_at as "publishedAt",viewed_count as "viewedCount",praises_count as "praisesCount",replies_count as "repliesCount",(viewed_count+praises_count+replies_count) as "behavioreSum"
from memos where destroy_status is null and hidden=0 and published_at is not null and DATE_FORMAT(published_at, '%Y') = YEAR (NOW())
@ -524,13 +532,13 @@
</select>
<select id="get7DayPaise" resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
select DATE_FORMAT(created_at, '%Y-%m-%d') as 'k', count(*) as 'v'
select DATE_FORMAT(created_at, '%m-%d') as 'k', count(*) as 'v'
from praise_treads
where praise_tread_object_type='Memo'
and created_at &gt;= #{s}
and created_at &lt;= #{e}
group by DATE_FORMAT(created_at, '%Y-%m-%d')
order by DATE_FORMAT(created_at, '%Y-%m-%d')
group by DATE_FORMAT(created_at, '%m-%d')
order by DATE_FORMAT(created_at, '%m-%d')
</select>
<select id="getExpertInfoById" resultType="com.microservices.dms.resourceLibrary.domain.vo.ExpertAttachmentVo">
@ -542,4 +550,9 @@
<select id="getAttachmentInfo" resultType="java.util.Map">
select file_name,id,unique_file_name from busi_attachments where id = #{id} limit 1
</select>
<select id="getAttachments" resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
select id as v, file_name as k from busi_attachments where FIND_IN_SET (id,#{fullFileIds})
</select>
</mapper>

View File

@ -0,0 +1,169 @@
<?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.microservices.dms.achievementLibrary.mapper.InBlockchainDataMapper">
<resultMap type="InBlockchainData" id="InBlockchainDataResult">
<result property="id" column="id" />
<result property="type" column="type" />
<result property="typeId" column="type_id" />
<result property="txHash" column="tx_hash" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
</resultMap>
<sql id="selectInBlockchainDataVo">
select id, type, type_id, tx_hash, create_time, create_by from in_blockchain_data
</sql>
<select id="selectInBlockchainDataList" parameterType="InBlockchainData" resultMap="InBlockchainDataResult">
<include refid="selectInBlockchainDataVo"/>
<where>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="typeId != null and typeId != ''"> and type_id = #{typeId}</if>
<if test="txHash != null and txHash != ''"> and tx_hash = #{txHash}</if>
</where>
</select>
<select id="selectInBlockchainDataById" parameterType="Long" resultMap="InBlockchainDataResult">
<include refid="selectInBlockchainDataVo"/>
where id = #{id}
</select>
<select id="issueDataList" resultType="java.util.Map">
select i.id as "issue_id",
i.project_issues_index as "issue_number",
i.status_id as "action",
it.name as "issueStatusName",
i.subject as "title",
i.subject as "issueName",
i.project_id,
r.id as "repo_id",
p.name as "projectName",
r.identifier as "reponame",
i.created_on as "created_at",
i.updated_on as "updated_at",
i.description as "content",
i.author_id as "author_id",
i.blockchain_token_num as "blockchain_token_num",
(select IFNULL(NULLIF(nickname,'') ,login) from users where id = i.author_id) as "createBy",
i.due_date,
(select GROUP_CONCAT(assigner_id SEPARATOR ', ')
from issue_assigners
where issue_id = i.id) as "ownername"
from issues i
inner join issue_statuses it on i.status_id = it.id
inner join projects p on i.project_id = p.id
inner join repositories r on p.id = r.project_id
where p.use_blockchain='1' and i.project_issues_index is not null
<if test="projectName != null and projectName != ''">and p.name like concat('%', #{projectName}, '%')</if>
<if test="issueName != null and issueName != ''">and i.subject like concat('%', #{issueName}, '%')</if>
</select>
<select id="commitDataList" resultType="java.util.Map">
select cl.commit_id as "commit_id",
re.id as "repo_id",
cl.user_id as "committer",
(select IFNULL(NULLIF(nickname, ''),login) from users where id = cl.user_id) as "createBy",
cl.project_id,p.name as "project_name",
cl.message as "content",
cl.created_at as "committer_time",
cl.message as "content",
re.user_id as "author",
ibd.tx_hash as "commitHash",
cl.ref as "commit_diff"
from commit_logs cl
inner join projects p on cl.project_id = p.id
inner join repositories re on p.id = re.project_id
inner join in_blockchain_data ibd on cl.commit_id = ibd.type_id
where p.use_blockchain = '1'
<if test="projectName != null and projectName != ''">and p.name like concat('%', #{projectName}, '%')</if>
order by ibd.create_time desc,cl.created_at desc
</select>
<select id="prDataList" resultType="java.util.Map">
select pr.id as "pull_request_id",
pr.gitea_number as "pull_request_number",
pr.status as "prStatus",
pr.project_id,
source.id as "repo_id",
source.url as "reponame",
pr.user_id as "username",
pr.title as "title",
pr.body as "content",
pr.head "source_branch",
pr.base as "target_branch",
target.id as "target_repo_id",
pr.created_at,
pr.updated_at,p.name as "projectName",(select IFNULL(NULLIF(nickname, ''),login) from users where id = pr.user_id) as "createBy"
from pull_requests pr
inner join projects p on pr.project_id = p.id
inner join repositories source on p.id = source.project_id
left join repositories target on pr.fork_project_id = target.project_id
where p.use_blockchain = '1'
<if test="projectName != null and projectName != ''">and p.name like concat('%', #{projectName}, '%')</if>
<if test="prName != null and prName != ''">and pr.title like concat('%', #{prName}, '%')</if>
</select>
<insert id="insertInBlockchainData" parameterType="InBlockchainData" useGeneratedKeys="true" keyProperty="id">
insert into in_blockchain_data
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="type != null and type != ''">type,</if>
<if test="typeId != null and typeId != ''">type_id,</if>
<if test="txHash != null and txHash != ''">tx_hash,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="type != null and type != ''">#{type},</if>
<if test="typeId != null and typeId != ''">#{typeId},</if>
<if test="txHash != null and txHash != ''">#{txHash},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
</trim>
</insert>
<update id="updateInBlockchainData" parameterType="InBlockchainData">
update in_blockchain_data
<trim prefix="SET" suffixOverrides=",">
<if test="type != null and type != ''">type = #{type},</if>
<if test="typeId != null and typeId != ''">type_id = #{typeId},</if>
<if test="txHash != null and txHash != ''">tx_hash = #{txHash},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteInBlockchainDataById" parameterType="Long">
delete from in_blockchain_data where id = #{id}
</delete>
<delete id="deleteInBlockchainDataByIds" parameterType="String">
delete from in_blockchain_data where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="getNeedToBlockCommitList" resultType="String">
select
cl.commit_id as "commit_id"
from commit_logs cl
inner join projects p on cl.project_id = p.id
left join repositories re on cl.repository_id = re.id
left join in_blockchain_data ibd on cl.commit_id = ibd.type_id
where p.use_blockchain = '1' and ibd.tx_hash is null
</select>
<select id="getCommitListById" resultType="com.microservices.dms.common.vo.CommitResultVo">
select
cl.commit_id as "commit_id",cl.ref as "commit_diff"
from commit_logs cl
inner join projects p on cl.project_id = p.id
left join in_blockchain_data ibd on cl.commit_id = ibd.type_id
where p.use_blockchain = '1' and ibd.tx_hash is null and p.id = #{projectId}
</select>
</mapper>

View File

@ -216,7 +216,7 @@
<if test="attachments != null and attachments != ''">and attachments = #{attachments}</if>
<if test="projectDomain != null and projectDomain != ''">and project_domain = #{projectDomain}</if>
</where>
order by is_transferred_to_achievement
order by is_transferred_to_achievement,create_time desc,release_date desc
</select>
<select id="selectProjectResourceLibraryById" parameterType="Long" resultMap="ProjectResourceLibraryResult">
@ -369,4 +369,96 @@
select name from project_categories where id=#{projectDomain}
</select>
<select id="selectProjectInfos" resultType="com.microservices.dms.achievementLibrary.domain.TokenListVo">
select p.id, p.name, created_on createdOn, r.identifier repositoryName, r.id as repositoryId,p.user_id as "userId",
(select IFNULL(NULLIF(nickname,''),login) from users where id = p.user_id) as createBy
from projects p
join repositories r on p.id = r.project_id
where p.use_blockchain = 1
<if test="name != null and name != ''">and p.name like concat('%', #{name}, '%')</if>
</select>
<select id="sumProjectIssueToken" resultType="java.lang.Long">
select IFNULL(sum(i.blockchain_token_num),0)
from issues i
inner join projects p on i.project_id = p.id
where p.id=#{id}
</select>
<select id="selectCommitInfo" resultType="java.util.Map">
select cl.commit_id as "commit_hash",
cl.repository_id as "repo_id",
cl.user_id as "committer",
cl.project_id,
cl.message as "content",
cl.created_at as "committer_time",
cl.message as "content",
re.user_id as "author",
'' as "committer_time",
cl.ref as "commit_diff"
from commit_logs cl
inner join projects p on cl.project_id = p.id
left join repositories re on cl.repository_id = re.id
where p.use_blockchain = '1'
and cl.commit_id = #{commitId} and cl.ref = #{commitDiff}
</select>
<select id="selectPrInfo" resultType="java.util.Map">
select pr.id as "pull_request_id",
pr.gitea_number as "pull_request_number",
pr.status as "action",
source.id as "repo_id",
source.url as "reponame",
pr.user_id as "username",
pr.title as "title",
pr.body as "content",
pr.head "source_branch",
pr.base as "target_branch",
pr.issue_id as "issue_id",
target.id as "target_repo_id",
pr.created_at,
pr.updated_at,
'' as "merge_user"
from pull_requests pr
inner join projects p on pr.project_id = p.id
inner join repositories source on p.id = source.project_id
left join repositories target on pr.fork_project_id = target.project_id
where p.use_blockchain = '1'
and pr.id = #{prId}
</select>
<select id="selectIssueInfo" resultType="java.util.Map">
select i.id as "issue_id",
i.status_id as "action",
i.subject as "title",
i.project_id,
r.id as "repo_id",
r.identifier as "reponame",
i.created_on as "created_at",
i.updated_on as "updated_at",
i.description as "content",
i.author_id as "username",
i.due_date,
(select GROUP_CONCAT(assigner_id SEPARATOR ', ')
from issue_assigners
where issue_id = i.id) as "ownername"
from issues i
inner join projects p on i.project_id = p.id
inner join repositories r on p.id = r.project_id
where p.use_blockchain='1' and i.id = #{issueId}
</select>
<select id="getProjectUserIdById" resultType="String">
select u.id from projects p
inner join users u on p.user_id=u.id
where p.id = #{tokenName}
</select>
<select id="getUsedApplyToken" resultType="Long">
select IFNULL(sum(token),0) as "totalSum" from user_project_transfer_records where project_id =#{tokenName} and payee_id !=#{userName}
</select>
<select id="getUserIdBYLogin" resultType="String">
select id from users where login=#{userId}
</select>
</mapper>

View File

@ -35,10 +35,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="achievementStatus" column="achievement_status" />
<result property="achievementLittleType" column="achievement_little_type" />
<result property="achievementCurStatus" column="achievement_cur_status" />
<result property="teamName" column="team_name" />
</resultMap>
<sql id="selectSchoolEnterpriseAchievementsVo">
select id, achievement_name, achievement_status,field_1, field_2, field_3, achievement_type, source, source_id, source_link, tags, summary, publishing_unit, address, is_featured, contact_person, contact_number, owner_id, owner_name, status, details, reviewer, review_date, review_comments, images, attachments, create_by, create_time, update_by, update_time from school_enterprise_achievements
select id, achievement_name, achievement_status,field_1, field_2, field_3,
achievement_type, source, source_id, source_link, tags, summary, publishing_unit,
address, is_featured, contact_person, contact_number, owner_id, owner_name, status, achievement_little_type,
details, reviewer, review_date, review_comments, images, attachments, create_by, create_time, achievement_cur_status,team_name,
update_by, update_time from school_enterprise_achievements
</sql>
<select id="selectSchoolEnterpriseAchievementsList" parameterType="SchoolEnterpriseAchievements" resultMap="SchoolEnterpriseAchievementsResult">
@ -70,7 +77,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="images != null and images != ''"> and images = #{images}</if>
<if test="attachments != null and attachments != ''"> and attachments = #{attachments}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
<if test="achievementCurStatus != null and achievementCurStatus != ''"> and achievement_cur_status = #{achievementCurStatus}</if>
<if test="achievementLittleType != null and achievementLittleType != ''"> and achievement_little_type = #{achievementLittleType}</if>
<if test="teamName != null and teamName != ''"> and team_name = #{teamName}</if>
</where>
order by status desc,create_time desc
</select>
<select id="selectSchoolEnterpriseAchievementsById" parameterType="Long" resultMap="SchoolEnterpriseAchievementsResult">
@ -105,6 +116,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="reviewComments != null and reviewComments != ''"> and review_comments = #{reviewComments}</if>
<if test="images != null and images != ''"> and images = #{images}</if>
<if test="attachments != null and attachments != ''"> and attachments = #{attachments}</if>
<if test="achievementCurStatus != null and achievementCurStatus != ''"> and achievement_cur_status = #{achievementCurStatus}</if>
<if test="achievementLittleType != null and achievementLittleType != ''"> and achievement_little_type = #{achievementLittleType}</if>
<if test="teamName != null and teamName != ''"> and team_name = #{teamName}</if>
</where>
</select>
@ -140,6 +154,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="achievementStatus != null">achievement_status,</if>
<if test="achievementCurStatus != null">achievement_cur_status,</if>
<if test="achievementLittleType != null">achievement_little_type,</if>
<if test="teamName != null">team_name,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="achievementName != null">#{achievementName},</if>
@ -171,6 +188,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="achievementStatus != null">#{achievementStatus},</if>
<if test="achievementCurStatus != null">#{achievementCurStatus},</if>
<if test="achievementLittleType != null">#{achievementLittleType},</if>
<if test="teamName != null">#{teamName},</if>
</trim>
</insert>
@ -206,6 +226,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="achievementStatus != null">achievement_status = #{achievementStatus},</if>
<if test="achievementCurStatus != null">achievement_cur_status = #{achievementCurStatus},</if>
<if test="achievementLittleType != null">achievement_little_type = #{achievementLittleType},</if>
<if test="teamName != null">team_name = #{teamName},</if>
</trim>
where id = #{id}
</update>

View File

@ -4,11 +4,12 @@
<mapper namespace="com.microservices.dms.referral.mapper.TalentReferralMapper">
<select id="selectIssuesCondition" resultType="com.microservices.dms.referral.vo.IssuesVo">
select project_id,`subject`,description,status_id from issues
select id,project_id,`subject`,description,status_id from issues
<where>
<if test="id != null ">and id = #{id}</if>
<if test="projectId != null ">and project_id = #{projectId}</if>
<if test="subject != null ">and `subject` = #{subject}</if>
<if test="subject != null and subject != ''">and `subject` = #{subject}</if>
<if test="issueClassify != null and issueClassify != ''">and `issue_classify` = #{issueClassify}</if>
<if test="statusIds != null and statusIds.size() > 0">and status_id in
<foreach item="item" collection="statusIds" open="(" separator="," close=")">
#{item}
@ -66,5 +67,63 @@
select id from users where login = #{login} limit 1
</select>
<select id="selectTaskByStatus" resultType="com.microservices.dms.referral.vo.TaskVo">
select t.id,td.task_id, name, status, category_id, description
from tasks t
join task_details td on t.id = td.task_id
where status in
<foreach collection="statusIds" item="item" close=")" index="idx" open="(" separator=",">
#{item}
</foreach>
</select>
<select id="selectUsersById" resultType="java.util.Map">
select id,login,nickname,admin from users where id = #{id}
</select>
<select id="selectTaskById" resultType="com.microservices.dms.referral.vo.TaskVo">
select t.id,td.task_id, name, status, category_id, description
from tasks t
join task_details td on t.id = td.task_id
where t.id =#{id}
</select>
<select id="selectExpertsBy" resultType="com.microservices.dms.referral.vo.ExpertVo">
select id,
user_id,
review_area_one,
review_area_two,
review_area_three,
(select IFNULL(nickname,login) from users u where u.id = e.user_id) as nickname,
expert_name
from experts e
where is_delete = 0 and status = 1
</select>
<select id="allTaskWithExpertIds" resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
select container_id as 'k', group_concat(expert_id) as v from task_expert where container_type = #{type}
group by container_id
</select>
<select id="selectCompetitionById" resultType="com.microservices.dms.referral.vo.TaskVo">
select t.id, title as name, status, description
from competition_infos t
where t.id =#{id}
</select>
<select id="selectCompetitionIdByStatus" resultType="com.microservices.dms.referral.vo.TaskVo">
select t.id, title as name, status, description,identifier
from competition_infos t
where upload_date &lt; now()
</select>
<select id="selectPRInfoById" resultType="com.microservices.dms.referral.vo.PrInfoVo">
select pr.id,pr.title as "title",pr.body as "content"
from pull_requests pr
where pr.id= #{id}
</select>
<select id="selectProjectById" resultType="int">
select count(1) from projects where id = #{tokenName}
</select>
</mapper>

View File

@ -42,10 +42,12 @@
</trim>
</insert>
<select id="countClicker" resultType="java.lang.Long">
select count(*) from clickers c inner join achievements a ON a.id = c.click_id
select count(*) from clickers c
inner join achievements a ON a.id = c.click_id
<where>
and a.status='1'
<if test="null != clickType and '' != clickType">
c.click_type = #{clickType}
and c.click_type = #{clickType}
</if>
and a.source='4'
</where>
@ -500,7 +502,7 @@
<if test="imageUrl != null and imageUrl != ''">and image_url = #{imageUrl}</if>
<if test="attachmentUrl != null and attachmentUrl != ''">and attachment_url = #{attachmentUrl}</if>
</where>
order by is_transferred_to_results_library
order by is_transferred_to_results_library,create_time desc,submission_date desc
</select>
<select id="selectTaskResourceLibraryById" parameterType="Long" resultMap="TaskResourceLibraryResult">
@ -522,11 +524,22 @@
</select>
<select id="getConvertedTaskAmount" resultType="java.lang.Double">
select IFNULL(sum(t.bounty), 0)
from tasks t
join (select distinct task_id from papers where status = 2) p on t.id = p.task_id
join task_resource_library on t.id = task_resource_library.task_id
where is_transferred_to_results_library = 1
select IFNULL(SUM(bounty), 0)
from (select distinct t.id, t.bounty
from tasks t
join (select distinct task_id from papers where status = 2) p on t.id = p.task_id
join task_resource_library on t.id = task_resource_library.task_id
where is_transferred_to_results_library = 1) tmp
</select>
<select id="getConvertedTaskAmount2" resultType="java.lang.Double">
select IFNULL(SUM(bounty), 0)
from (select distinct t.id, t.bounty
from tasks t
join (select task_id from papers where status = 2) p on t.id = p.task_id
join task_resource_library on t.id = task_resource_library.task_id
join achievements a on a.source_id = task_resource_library.id and a.source='2' and a.status= '1'
where is_transferred_to_results_library = 1) tmp
</select>
<select id="getConvertedTasksCount" resultType="java.lang.Long">

View File

@ -0,0 +1,141 @@
<?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.microservices.dms.achievementLibrary.mapper.UserProjectTransferRecordsMapper">
<resultMap type="UserProjectTransferRecords" id="UserProjectTransferRecordsResult">
<result property="id" column="id"/>
<result property="payerId" column="payer_id"/>
<result property="projectId" column="project_id"/>
<result property="token" column="token"/>
<result property="payeeId" column="payee_id"/>
<result property="txHash" column="tx_hash"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>
<result property="type" column="type"/>
<result property="reserve1" column="reserve_1"/>
<result property="reserve2" column="reserve_2"/>
</resultMap>
<sql id="selectUserProjectTransferRecordsVo">
select id,
payer_id,
project_id,
token,
payee_id,
tx_hash,
create_time,
create_by,
type,
reserve_1,
reserve_2
from user_project_transfer_records
</sql>
<select id="selectUserProjectTransferRecordsList" parameterType="UserProjectTransferRecords"
resultMap="UserProjectTransferRecordsResult">
<include refid="selectUserProjectTransferRecordsVo"/>
<where>
<if test="payerId != null and payerId != ''">and payer_id = #{payerId}</if>
<if test="projectId != null and projectId != ''">and project_id = #{projectId}</if>
<if test="token != null ">and token = #{token}</if>
<if test="payeeId != null and payeeId != ''">and payee_id = #{payeeId}</if>
<if test="txHash != null and txHash != ''">and tx_hash = #{txHash}</if>
<if test="type != null and type != ''">and type = #{type}</if>
<if test="reserve1 != null and reserve1 != ''">and reserve_1 = #{reserve1}</if>
<if test="reserve2 != null and reserve2 != ''">and reserve_2 = #{reserve2}</if>
</where>
</select>
<select id="selectUserProjectTransferRecordsById" parameterType="Long" resultMap="UserProjectTransferRecordsResult">
<include refid="selectUserProjectTransferRecordsVo"/>
where id = #{id}
</select>
<select id="userDataList" resultType="java.util.Map">
select * from ( select p.name projectName,payer_id,payee_id,uptr.token,uptr.tx_hash,uptr.type,
(select IFNULL(lastname,login) from users where id = uptr.payer_id) as "payerName" ,
(select IFNULL(lastname,login) from users where id = uptr.payee_id) as "payeeName"
from user_project_transfer_records uptr join projects p on uptr.project_id = p.id)tmp
<where>
<if test="projectName != null and projectName != ''">and tmp.projectName like concat('%', #{projectName}, '%')
</if>
<if test="userName != null and userName != ''">and (tmp.payerName like concat('%', #{userName}, '%') OR
tmp.payeeName like concat('%', #{userName}, '%'))
</if>
<if test="userId != null ">and (tmp.payer_id = #{userId} OR
tmp.payee_id = #{userId})
</if>
</where>
</select>
<select id="userList" resultType="com.microservices.dms.achievementLibrary.domain.blockchain.UserVo">
select * from (select id,IFNULL(nickname,login) as "nickname" from users where status=1) tmp
<where>
<if test="nickname != null and nickname != ''">
and tmp.nickname like concat('%', #{nickname}, '%'))
</if>
</where>
</select>
<insert id="insertUserProjectTransferRecords" parameterType="UserProjectTransferRecords" useGeneratedKeys="true"
keyProperty="id">
insert into user_project_transfer_records
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="payerId != null and payerId != ''">payer_id,</if>
<if test="projectId != null and projectId != ''">project_id,</if>
<if test="token != null">token,</if>
<if test="payeeId != null and payeeId != ''">payee_id,</if>
<if test="txHash != null and txHash != ''">tx_hash,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="type != null">type,</if>
<if test="reserve1 != null">reserve_1,</if>
<if test="reserve2 != null">reserve_2,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="payerId != null and payerId != ''">#{payerId},</if>
<if test="projectId != null and projectId != ''">#{projectId},</if>
<if test="token != null">#{token},</if>
<if test="payeeId != null and payeeId != ''">#{payeeId},</if>
<if test="txHash != null and txHash != ''">#{txHash},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="type != null">#{type},</if>
<if test="reserve1 != null">#{reserve1},</if>
<if test="reserve2 != null">#{reserve2},</if>
</trim>
</insert>
<update id="updateUserProjectTransferRecords" parameterType="UserProjectTransferRecords">
update user_project_transfer_records
<trim prefix="SET" suffixOverrides=",">
<if test="payerId != null and payerId != ''">payer_id = #{payerId},</if>
<if test="projectId != null and projectId != ''">project_id = #{projectId},</if>
<if test="token != null">token = #{token},</if>
<if test="payeeId != null and payeeId != ''">payee_id = #{payeeId},</if>
<if test="txHash != null and txHash != ''">tx_hash = #{txHash},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="type != null">type = #{type},</if>
<if test="reserve1 != null">reserve_1 = #{reserve1},</if>
<if test="reserve2 != null">reserve_2 = #{reserve2},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteUserProjectTransferRecordsById" parameterType="Long">
delete
from user_project_transfer_records
where id = #{id}
</delete>
<delete id="deleteUserProjectTransferRecordsByIds" parameterType="String">
delete from user_project_transfer_records where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -12,7 +12,7 @@ public class MakerSpaceTotalDataVo {
private int totalApplicants;
private int currentTotalAwardAmount;
private float currentTotalAwardAmount;
private float paidAwardAmount;

View File

@ -17,7 +17,7 @@ public interface TasksMapper{
int getTotalApplicantCount();
int getCurrentTotalAwardAmount();
float getCurrentTotalAwardAmount();
List<Object> getTaskPublishedCountsByYear();

View File

@ -40,7 +40,7 @@ public class TasksServiceImpl implements ITasksService {
MakerSpaceTotalDataVo makerSpaceTotalDataVo = new MakerSpaceTotalDataVo();
makerSpaceTotalDataVo.setTotalTasks(tasksMapper.getTotalTaskCount());
makerSpaceTotalDataVo.setTotalApplicants(tasksMapper.getTotalApplicantCount());
makerSpaceTotalDataVo.setCurrentTotalAwardAmount(tasksMapper.getCurrentTotalAwardAmount()/10000);
makerSpaceTotalDataVo.setCurrentTotalAwardAmount(tasksMapper.getCurrentTotalAwardAmount() /10000L);
makerSpaceTotalDataVo.setPaidAwardAmount(tasksMapper.getPaidAwardAmount()/10000);
makerSpaceTotalDataVo.setTotalVisits(tasksMapper.getTotalVisits());
makerSpaceTotalDataVo.setTaskPublishedCountsByYear(tasksMapper.getTaskPublishedCountsByYear());

View File

@ -53,8 +53,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from papers
where is_delete = 0 and parent_id = 0
</select>
<select id="getCurrentTotalAwardAmount" resultType="java.lang.Integer">
select sum(bounty)
<select id="getCurrentTotalAwardAmount" resultType="java.lang.Float">
select COALESCE(SUM(bounty), 0)
from tasks
where is_delete = 0 and `status` between 3 and 8
</select>

View File

@ -142,7 +142,7 @@ public class CommonController extends BaseController {
@ApiOperation("通用上传请求")
@ApiImplicitParams({
@ApiImplicitParam(name = "file", value = "文件实体", paramType = "form", dataType = "_file"),
@ApiImplicitParam(name = "type", value = "文件类型zone-identifier专区下支持文件标识的附件cms内容管理resource专区资源pms项目管理pms-gitlink项目管理gitlink附件gitlinkgitlink附件", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "type", value = "文件类型zone-identifier专区下支持文件标识的附件dms资源库cms内容管理resource专区资源pms项目管理pms-gitlink项目管理gitlink附件gitlinkgitlink附件", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "hierarchy", value = "层级结构eg: pms项目管理中{enterpriseIdentifier}/products,{enterpriseIdentifier}/projects,{enterpriseIdentifier}/docs/{projectId}", paramType = "query", dataType = "String")
})
public AjaxResult uploadFile(@RequestPart("file") MultipartFile file, String type, String hierarchy) {
@ -168,7 +168,7 @@ public class CommonController extends BaseController {
@DeleteMapping("/byIdentifier/{fileIdentifier}")
@ApiOperation("通用删除请求")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "文件类型cms内容管理resource专区资源pms项目管理pms-gitlink项目管理gitlink附件", paramType = "query", dataType = "String")
@ApiImplicitParam(name = "type", value = "文件类型cms内容管理dms资源库resource专区资源pms项目管理pms-gitlink项目管理gitlink附件", paramType = "query", dataType = "String")
})
public AjaxResult deleteFile(@PathVariable("fileIdentifier") String fileIdentifier, @RequestParam("type") String type) {
return toAjax(sysFileInfoService.deleteFile(fileIdentifier, type));

View File

@ -121,6 +121,12 @@
<artifactId>httpclient</artifactId>
<version>4.5.14</version>
</dependency>
<!-- Apache POI for Word processing -->
<!-- <dependency>-->
<!-- <groupId>org.apache.poi</groupId>-->
<!-- <artifactId>poi-ooxml</artifactId>-->
<!-- <version>5.4.0</version>-->
<!-- </dependency>-->
<!-- 自然语言处理,用于自动提取文章概要 -->
<dependency>
<groupId>com.hankcs</groupId>
@ -139,6 +145,12 @@
<version>0.4.8</version>
<scope>compile</scope>
</dependency>
<!-- 文件导入、导出库 -->
<!-- <dependency>-->
<!-- <groupId>com.github.ben-manes.caffeine</groupId>-->
<!-- <artifactId>Java2Word</artifactId>-->
<!-- <version>1.0.0</version>-->
<!-- </dependency>-->
</dependencies>
<build>

View File

@ -39,6 +39,7 @@ public class OpenController extends BaseController {
@GetMapping("/loginUrl")
@ApiOperation(value = "获取登录地址")
public AjaxResult loginUrl() {
logger.info("调用接口:获取登录地址");
return success(
(Object) EscapeUtil.removeExtraSlashOfUrl(gitLinkUrl + "/login")
);

View File

@ -32,6 +32,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@ -172,6 +173,12 @@ public class PmsDashboardController extends BaseController {
}
todoProjectIssuesSearchVo.setPmProjectIds(StringUtils.join(projectList.stream().map(PmsProject::getId).toArray(), ","));
JSONObject result = pmsProjectIssuesService.selectMyTodoPmsProjectIssuesList(todoProjectIssuesSearchVo);
// 判断projectList中是否存在projectAssigneeId和当前用户id相等
Long currentUserId = SecurityUtils.getGitlinkUserId();
boolean isProjectAssigner = projectList.stream()
.anyMatch(project -> currentUserId != null && currentUserId.equals(project.getProjectAssigneeId()));
result.put("isProjectAssigner", isProjectAssigner);
return success(result);
}

View File

@ -20,7 +20,7 @@ import java.util.List;
/**
* 项目管理-文档库Controller
*
*
* @author wanjia
* @date 2024-01-08
*/
@ -30,8 +30,7 @@ import java.util.List;
@ApiImplicitParams({
@ApiImplicitParam(name = "enterpriseIdentifier", value = "企业标识", paramType = "path", dataType = "String")
})
public class PmsDocumentController extends BaseController
{
public class PmsDocumentController extends BaseController {
@Autowired
private IPmsDocumentService pmsDocumentService;
@ -46,8 +45,7 @@ public class PmsDocumentController extends BaseController
@ApiImplicitParam(name = "orderByColumn", value = "排序列更新时间updateTime创建时间createTime", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "isAsc", value = "排序的方向desc或者asc,默认asc", paramType = "query", dataType = "String")
})
public GenericsTableDataInfo<PmsDocumentVo> list( @Validated PmsDocumentSearchVo pmsDocumentSearchVo)
{
public GenericsTableDataInfo<PmsDocumentVo> list(@Validated PmsDocumentSearchVo pmsDocumentSearchVo) {
return pmsDocumentService.selectPmsDocumentVoList(pmsDocumentSearchVo);
}
@ -58,8 +56,7 @@ public class PmsDocumentController extends BaseController
@Log(title = "项目管理-文档库", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ApiOperation(value = "导出项目管理-文档库列表", hidden = true)
public void export(HttpServletResponse response, PmsDocument pmsDocument)
{
public void export(HttpServletResponse response, PmsDocument pmsDocument) {
List<PmsDocument> list = pmsDocumentService.selectPmsDocumentList(pmsDocument);
ExcelUtil<PmsDocument> util = new ExcelUtil<PmsDocument>(PmsDocument.class);
util.exportExcel(response, list, "项目管理-文档库数据");
@ -71,8 +68,7 @@ public class PmsDocumentController extends BaseController
// @RequiresPermissions("pms:document:query")
@GetMapping(value = "/{id}")
@ApiOperation(value = "获取项目管理-文档库详细信息")
public AjaxResult getInfo(@PathVariable("id") Long id, @ApiParam("企业id") @RequestParam(name = "enterpriseId") Long enterpriseId)
{
public AjaxResult getInfo(@PathVariable("id") Long id, @ApiParam("企业id") @RequestParam(name = "enterpriseId") Long enterpriseId) {
return success(pmsDocumentService.selectPmsDocumentDetailVoByIdAndEnterpriseId(id, enterpriseId));
}
@ -83,8 +79,7 @@ public class PmsDocumentController extends BaseController
@Log(title = "项目管理-文档库", businessType = BusinessType.INSERT)
@PostMapping
@ApiOperation(value = "新增项目管理-文档库")
public AjaxResult add(@RequestBody @Validated PmsDocumentInputVo pmsDocumentInputVo)
{
public AjaxResult add(@RequestBody @Validated PmsDocumentInputVo pmsDocumentInputVo) {
return toAjax(pmsDocumentService.insertPmsDocument(pmsDocumentInputVo.toPmsDocument()));
}
@ -92,11 +87,10 @@ public class PmsDocumentController extends BaseController
* 新增附件类型文档
*/
// @RequiresPermissions("pms:document:add")
@Log(title = "新增附件类型文档", businessType = BusinessType.INSERT)
@Log(title = "项目管理-文档库", businessType = BusinessType.INSERT)
@PostMapping("/fileType")
@ApiOperation(value = "新增附件类型文档")
public AjaxResult addFileTypeDoc(@RequestBody @Validated PmsFileTypeDocumentInputVo pmsFileTypeDocumentInputVo)
{
public AjaxResult addFileTypeDoc(@RequestBody @Validated PmsFileTypeDocumentInputVo pmsFileTypeDocumentInputVo) {
return toAjax(pmsDocumentService.insertPmsFileTypeDocument(pmsFileTypeDocumentInputVo));
}
@ -107,8 +101,7 @@ public class PmsDocumentController extends BaseController
@Log(title = "项目管理-文档库", businessType = BusinessType.UPDATE)
@PutMapping
@ApiOperation(value = "修改项目管理-文档库")
public AjaxResult edit(@RequestBody PmsDocumentUpdateVo pmsDocumentUpdateVo)
{
public AjaxResult edit(@RequestBody PmsDocumentUpdateVo pmsDocumentUpdateVo) {
return toAjax(pmsDocumentService.updatePmsDocument(pmsDocumentUpdateVo.toPmsDocument()));
}
@ -117,12 +110,13 @@ public class PmsDocumentController extends BaseController
*/
// @RequiresPermissions("pms:document:remove")
@Log(title = "项目管理-文档库", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
@DeleteMapping("/{ids}")
@ApiOperation(value = "删除项目管理-文档库")
public AjaxResult remove(@PathVariable Long[] ids,
@ApiParam("企业id") @RequestParam(name = "enterpriseId") Long enterpriseId,
@ApiParam("项目id") @RequestParam(name = "pmsProjectId", defaultValue = "0") Long pmsProjectId)
{
@ApiParam("项目id") @RequestParam(name = "pmsProjectId", defaultValue = "0") Long pmsProjectId,
@ApiParam("文档名称,多个逗号分隔") @RequestParam(name = "names", required = false) String names,
@ApiParam("文件类型 1-文档目录 2-文档 3-附件 4-wiki库多个逗号分隔") @RequestParam(name = "docTypes", required = false) String docTypes) {
return toAjax(pmsDocumentService.deletePmsDocumentByIds(ids, enterpriseId, pmsProjectId));
}
@ -131,8 +125,16 @@ public class PmsDocumentController extends BaseController
*/
@GetMapping(value = "/optionalWikiRepoList")
@ApiOperation(value = "导入wiki时可选的仓库列表")
public AjaxResult getOptionalWikiRepoList(@Validated OptionalWikiReposSearchVo optionalWikiReposSearchVo)
{
public AjaxResult getOptionalWikiRepoList(@Validated OptionalWikiReposSearchVo optionalWikiReposSearchVo) {
return success(pmsDocumentService.getOptionalWikiRepoList(optionalWikiReposSearchVo));
}
/**
* 下载文档类型文件
*/
@GetMapping(value = "/downloadDoc/{docId}")
@ApiOperation(value = "下载文档类型文件")
public void downloadDoc(@PathVariable String enterpriseIdentifier, @PathVariable Long docId, HttpServletResponse response) {
pmsDocumentService.downloadDoc(response, enterpriseIdentifier, docId);
}
}

View File

@ -23,7 +23,7 @@ public class PmsDocumentUpdateVo
/** 文档名称 */
@ApiModelProperty(value = "文档名称")
@Size(min = 1, max = 50)
@Size(min = 1, max = 101)
private String name;
/** 文档内容 */

Some files were not shown because too many files have changed in this diff Show More