forked from Gitlink/microservices
Compare commits
386 Commits
feat_chiev
...
master
| Author | SHA1 | Date |
|---|---|---|
|
|
c001df36d8 | |
|
|
d216d3d0b8 | |
|
|
35f94f3ac5 | |
|
|
fb850bad71 | |
|
|
2fef3cbc24 | |
|
|
9786975fe1 | |
|
|
dbcdb468ab | |
|
|
7d16bccea8 | |
|
|
85913c605a | |
|
|
79136717ef | |
|
|
64b4c36635 | |
|
|
db6b1cfe10 | |
|
|
af7cd7d006 | |
|
|
fa41454534 | |
|
|
f459e84521 | |
|
|
6f63a0de72 | |
|
|
e6322835db | |
|
|
0e83fa62ce | |
|
|
5232236167 | |
|
|
ce1692ac66 | |
|
|
65e66013cf | |
|
|
bd0b24eb1a | |
|
|
154e139f59 | |
|
|
e7fb87c759 | |
|
|
879133b8c7 | |
|
|
93185be706 | |
|
|
d5d4fa4805 | |
|
|
ea2d703a5e | |
|
|
1b8f1ea253 | |
|
|
8acecc5f13 | |
|
|
143fa631ce | |
|
|
f4dd5ce278 | |
|
|
b24412a1b3 | |
|
|
e48ce7f4b0 | |
|
|
7a1306929b | |
|
|
6e2b1f348f | |
|
|
f61b11bc93 | |
|
|
83f86f623d | |
|
|
a3fc3246fc | |
|
|
6e7ae41dac | |
|
|
311383d2a3 | |
|
|
5dd17b1142 | |
|
|
7c6617626a | |
|
|
d815c57f12 | |
|
|
b266bb82d6 | |
|
|
e77576f085 | |
|
|
e9137d30ba | |
|
|
5ae151e360 | |
|
|
b7b21b1f35 | |
|
|
0b69e3bafa | |
|
|
ee3d983c49 | |
|
|
dcea028be3 | |
|
|
5199a829f5 | |
|
|
1354a2b7a0 | |
|
|
e6413d1efe | |
|
|
fe7c642a08 | |
|
|
3c2b288068 | |
|
|
71e5c84a1a | |
|
|
562469eccb | |
|
|
5dc02cdd33 | |
|
|
890d0d9f50 | |
|
|
911aae3355 | |
|
|
9455497795 | |
|
|
743f799e86 | |
|
|
31ca5d313e | |
|
|
43946c05f1 | |
|
|
5838b0db3f | |
|
|
f96ae2ce8f | |
|
|
b2d3d413be | |
|
|
a78c9c2b5d | |
|
|
8f3331c079 | |
|
|
405cc2da3e | |
|
|
4cef9d6a44 | |
|
|
c28381b7bc | |
|
|
1bf0146cc5 | |
|
|
4a8f9b971f | |
|
|
0f689986f2 | |
|
|
cd6a2275b8 | |
|
|
6f7d969ce9 | |
|
|
5dae889f13 | |
|
|
06944e2357 | |
|
|
15bbfc6d2d | |
|
|
a36e4b7256 | |
|
|
24ecd3953c | |
|
|
992a07f154 | |
|
|
94061dc01c | |
|
|
de54dfff7a | |
|
|
e866c11d46 | |
|
|
09d4401583 | |
|
|
ec3db48214 | |
|
|
75c8d48860 | |
|
|
3c29e65c46 | |
|
|
97a016361d | |
|
|
b2d98dabc9 | |
|
|
99d58df966 | |
|
|
83fd822d0e | |
|
|
759922b3db | |
|
|
7e37ef0a36 | |
|
|
e40d9bf5c0 | |
|
|
e791a3f02a | |
|
|
ceca31cb5c | |
|
|
105ce14327 | |
|
|
6a46e8dfdf | |
|
|
e1f73ed177 | |
|
|
1eacfa7e9e | |
|
|
67318f6d0f | |
|
|
f460559674 | |
|
|
5c67195157 | |
|
|
24b98366ab | |
|
|
c0a5ff23fe | |
|
|
8da6005d9f | |
|
|
b5b228a3da | |
|
|
40b6256204 | |
|
|
08096df571 | |
|
|
f0e01ecaf6 | |
|
|
cf9c1b5ade | |
|
|
03a11ab7df | |
|
|
123d967254 | |
|
|
729cdb8017 | |
|
|
689229801c | |
|
|
1498f93a06 | |
|
|
904a1b551c | |
|
|
06bf1c2910 | |
|
|
509de16d62 | |
|
|
713104e353 | |
|
|
05533c9475 | |
|
|
63e9d65b60 | |
|
|
2e44e2b24e | |
|
|
d759a5d913 | |
|
|
103beae4d8 | |
|
|
edb5e65035 | |
|
|
e21c8b451e | |
|
|
2a7ab04e08 | |
|
|
6d547cd0df | |
|
|
601f87273f | |
|
|
65ea36f889 | |
|
|
9ed4ce2cc2 | |
|
|
48ddc9ccdb | |
|
|
2b7bbdf512 | |
|
|
44d78caca1 | |
|
|
de1bb39187 | |
|
|
8e51a872ba | |
|
|
133d821023 | |
|
|
f2238aec52 | |
|
|
041ca0c542 | |
|
|
efa45f7d79 | |
|
|
ac5f3d9821 | |
|
|
4058e652a0 | |
|
|
b8e13f2b97 | |
|
|
a55a4985d9 | |
|
|
03edc8ac49 | |
|
|
c50f157682 | |
|
|
bda485b970 | |
|
|
bc183b6c25 | |
|
|
3dea48610d | |
|
|
e5c3e2d999 | |
|
|
ed33e52aaa | |
|
|
2d4392bfb2 | |
|
|
294e60a961 | |
|
|
8ad3f51ce8 | |
|
|
911205db54 | |
|
|
74112e2f35 | |
|
|
abd7ef7e82 | |
|
|
20ecc7157f | |
|
|
68fdfdcd5c | |
|
|
ba1e16337d | |
|
|
7a0ca0bef4 | |
|
|
d58e359798 | |
|
|
f72c3684fe | |
|
|
9870f0f376 | |
|
|
1000c7fed5 | |
|
|
5d05da7d03 | |
|
|
c271179b43 | |
|
|
9e898e64c8 | |
|
|
ef8590c387 | |
|
|
8c97e600a1 | |
|
|
4ae505ae40 | |
|
|
9cdc4622ad | |
|
|
ef9c77e842 | |
|
|
573c97f4d9 | |
|
|
79fe1c2515 | |
|
|
6fc19138bb | |
|
|
b197668782 | |
|
|
adba40d1b5 | |
|
|
cc679fed0a | |
|
|
782e2e7e5a | |
|
|
e3e6d37fd4 | |
|
|
3268dc9fb8 | |
|
|
b6e5742188 | |
|
|
a528956dd5 | |
|
|
366118bca0 | |
|
|
f484b14bcd | |
|
|
8e6620ad2e | |
|
|
0d63456fb9 | |
|
|
9a1b5e0125 | |
|
|
5b8524936a | |
|
|
a56a63ca78 | |
|
|
bf5e152432 | |
|
|
2b915c52a2 | |
|
|
bdb9b6ea6d | |
|
|
a0a1ec3d3d | |
|
|
67dae46b22 | |
|
|
83f65cfd3d | |
|
|
40bc06fc11 | |
|
|
1d99323465 | |
|
|
de1832bdd8 | |
|
|
8d4c00c9a0 | |
|
|
ef476d06a8 | |
|
|
730b8b30ed | |
|
|
9cb2ca13cb | |
|
|
01bf425689 | |
|
|
e488744927 | |
|
|
c28437cdd0 | |
|
|
9a43dd80fe | |
|
|
9c89e97287 | |
|
|
4ea5406c48 | |
|
|
6235bb6fe0 | |
|
|
85905bb92d | |
|
|
8707f0ee89 | |
|
|
182db3e872 | |
|
|
a9a75dc100 | |
|
|
cc455e7d9f | |
|
|
a71d14b570 | |
|
|
96dfb1d856 | |
|
|
6bb968ec5e | |
|
|
33ffe1bfb4 | |
|
|
feb40410f8 | |
|
|
24c1bfedba | |
|
|
beac1b54bb | |
|
|
f695700777 | |
|
|
7956e028a9 | |
|
|
0d27d82964 | |
|
|
e85f79e67e | |
|
|
5a20b86f8b | |
|
|
bd8e09598f | |
|
|
a53437d060 | |
|
|
74d2fd9979 | |
|
|
ec209cb0e0 | |
|
|
9a4e79098c | |
|
|
0076b07114 | |
|
|
25ce8e1e7c | |
|
|
0d3539a669 | |
|
|
fa69d53648 | |
|
|
0265c2bd08 | |
|
|
d491612296 | |
|
|
e2c802ceef | |
|
|
3371917732 | |
|
|
a59591b5a5 | |
|
|
08a6720443 | |
|
|
1c3806ebf8 | |
|
|
3bd42cd20e | |
|
|
5ae947073b | |
|
|
76f8f05147 | |
|
|
f3ce62e437 | |
|
|
f25cefe93f | |
|
|
7a124aa4d0 | |
|
|
248aa2cb6c | |
|
|
c4748ba4c1 | |
|
|
0f85f633d8 | |
|
|
87debbe223 | |
|
|
87c17a2c7d | |
|
|
feba3b82ed | |
|
|
18b5545d88 | |
|
|
9e236c206d | |
|
|
15e656fb4d | |
|
|
4b357605e5 | |
|
|
dbd21d9aa8 | |
|
|
db27fac652 | |
|
|
f4bbc53d65 | |
|
|
f71e7450dd | |
|
|
55c0d58722 | |
|
|
0fbd7abc10 | |
|
|
11c43c7510 | |
|
|
e063d79c50 | |
|
|
56fc58cf3b | |
|
|
0e71af317b | |
|
|
c19bc29443 | |
|
|
3e97db926c | |
|
|
07dcaec093 | |
|
|
6bffcc147f | |
|
|
7edccfc637 | |
|
|
c68a4c4459 | |
|
|
e6efd421d4 | |
|
|
33f0d37136 | |
|
|
fee590430e | |
|
|
92f0b0bd5a | |
|
|
6456fa4976 | |
|
|
156a32c6ac | |
|
|
81234a1d23 | |
|
|
e7a3f47115 | |
|
|
16c14e9c44 | |
|
|
ec27bfb786 | |
|
|
9b75b09f1a | |
|
|
f7c68e3c14 | |
|
|
ffbe18645c | |
|
|
e2a592a799 | |
|
|
f93f802671 | |
|
|
acfda75cf3 | |
|
|
ffc71ba7b6 | |
|
|
dd05fb00cf | |
|
|
fbb84122ab | |
|
|
ee9fbf2328 | |
|
|
d9fb54e364 | |
|
|
cd68826944 | |
|
|
f8b066ac54 | |
|
|
614651327d | |
|
|
2dcb7146ed | |
|
|
421b0f7e40 | |
|
|
87de8b7f90 | |
|
|
4b5e075d52 | |
|
|
3f9fd173c6 | |
|
|
fe8ce59629 | |
|
|
7efd45c462 | |
|
|
3e8a2d4c8b | |
|
|
be55a0d4e5 | |
|
|
8ae43e5dc2 | |
|
|
413c11d98c | |
|
|
464ce4e286 | |
|
|
4cca1bf205 | |
|
|
63c5fc1b7f | |
|
|
c7cc7a9111 | |
|
|
d596005853 | |
|
|
6d92f87851 | |
|
|
298a74075a | |
|
|
22c5efd140 | |
|
|
168f60234d | |
|
|
0417d51f25 | |
|
|
b0f325370f | |
|
|
d836f0f95d | |
|
|
59cb39ee83 | |
|
|
dbceb01ce0 | |
|
|
c67da2401c | |
|
|
96c5a2b687 | |
|
|
0eb2ab2786 | |
|
|
e1b377ceef | |
|
|
95ad6b83b4 | |
|
|
42b5dd4530 | |
|
|
c7c3f53f91 | |
|
|
83e86c89ad | |
|
|
290b42333f | |
|
|
0af814be0d | |
|
|
5bc5185882 | |
|
|
8398ec6966 | |
|
|
a46d7e65cf | |
|
|
44069a7c55 | |
|
|
643a0fdb47 | |
|
|
f3f051dc5b | |
|
|
2c2870b71b | |
|
|
454f992a98 | |
|
|
9564179914 | |
|
|
7026580e8b | |
|
|
306a7c2558 | |
|
|
85d4a23ef6 | |
|
|
57daea3681 | |
|
|
e2dfb6a5d7 | |
|
|
33a7f4c069 | |
|
|
dc7dfaf463 | |
|
|
4c7ffcc5d6 | |
|
|
f3b2b8cc01 | |
|
|
3d59e04e09 | |
|
|
bccc9b8e12 | |
|
|
05a7dab7bd | |
|
|
f12fac99e7 | |
|
|
f50d4ef1a8 | |
|
|
1e222677d2 | |
|
|
ab971d7278 | |
|
|
a4662b16f6 | |
|
|
553d4a1887 | |
|
|
a2b1e49610 | |
|
|
3b9ba3e395 | |
|
|
e2e603267f | |
|
|
4d0c043197 | |
|
|
882dd33346 | |
|
|
895be1aefe | |
|
|
be54bc56d8 | |
|
|
8f69ef0d20 | |
|
|
85388b896e | |
|
|
56a4621aff | |
|
|
99cd28b6b6 | |
|
|
52e4c771fa | |
|
|
804309d5d7 | |
|
|
b764f24b8e | |
|
|
da27fed59d | |
|
|
6347cb1680 | |
|
|
b987518add | |
|
|
60cf5b9cba |
|
|
@ -107,4 +107,24 @@ public interface RemoteFileService {
|
|||
@RequestParam("type") String type,
|
||||
@RequestParam("hierarchy") String hierarchy,
|
||||
@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
/**
|
||||
* 通过Url下载文件到本地
|
||||
*/
|
||||
@PostMapping(value = "/common/downloadFileByUrl")
|
||||
R<String> downloadFileByUrl(
|
||||
@RequestParam("fileUrl") String fileUrl
|
||||
, @RequestParam("type") String type
|
||||
, @RequestParam("hierarchy") String hierarchy,
|
||||
@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
/**
|
||||
* 上传本地文件到Forge
|
||||
*
|
||||
* @param fileIdentifiers 文件标识列表,逗号分隔
|
||||
* @return Forge文件标识列表
|
||||
*/
|
||||
@PostMapping(value = "/common/uploadFileToForge/{fileIdentifiers}")
|
||||
R<List<String>> uploadFileToForge(@PathVariable("fileIdentifiers") String fileIdentifiers,
|
||||
@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,6 +70,16 @@ public class RemoteFileFallbackFactory implements FallbackFactory<RemoteFileServ
|
|||
public R<String> packagedFile(HashMap<String, String> packagedStructure, String zipFileName, String type, String hierarchy, String source) {
|
||||
return R.fail("打包文件失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<String> downloadFileByUrl(String fileUrl, String type, String hierarchy, String source) {
|
||||
return R.fail("通过Url下载文件到本地失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<List<String>> uploadFileToForge(String fileIdentifiers, String source) {
|
||||
return R.fail("上传本地文件到Forge失败:" + throwable.getMessage());
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ public class CacheConstants {
|
|||
/**
|
||||
* Gitlink组织开通企业是否完成 Key前缀
|
||||
*/
|
||||
public final static String GITLINK_ORG_ID_OPEN_ENTERPRISE_KEY = "gitlink_org_id_open_enterprise_key:";
|
||||
private final static String GITLINK_ORG_ID_OPEN_ENTERPRISE_KEY = "gitlink_org_id_open_enterprise_key:";
|
||||
|
||||
public static String getGitlinkOrgIdOpenEnterpriseKey(Long gitlinkOrgId) {
|
||||
return GITLINK_ORG_ID_OPEN_ENTERPRISE_KEY + gitlinkOrgId;
|
||||
|
|
@ -227,11 +227,11 @@ public class CacheConstants {
|
|||
/**
|
||||
* 专区项目Gitlink信息 Key前缀
|
||||
*/
|
||||
public final static String ZONE_PROJECT_GITLINK_INFO = "zone_project_gitlink_info:";
|
||||
private final static String ZONE_PROJECT_GITLINK_INFO = "zone_project_gitlink_info:";
|
||||
/**
|
||||
* 专区下项目分数排序 Key前缀
|
||||
*/
|
||||
public final static String ZONE_PROJECT_SORT_BY_SCORE = "zone_project_sort_by_score:";
|
||||
private final static String ZONE_PROJECT_SORT_BY_SCORE = "zone_project_sort_by_score:";
|
||||
|
||||
public static String getZoneProjectGitlinkInfo(Long gitlinkProjectId) {
|
||||
return ZONE_PROJECT_GITLINK_INFO + gitlinkProjectId;
|
||||
|
|
@ -245,6 +245,15 @@ public class CacheConstants {
|
|||
return ZONE_PROJECT_SORT_BY_SCORE + "*:" + zoneId + ":*";
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件打包是否完成(0:代表未完成;1:代表已完成;-1:代表打包失败,需要重新打包)
|
||||
*/
|
||||
private final static String PACKAGE_FILE_IS_FINISH = "packageFileIsFinish:";
|
||||
|
||||
public static String getPackageFileIsFinish(String fileIdentifier) {
|
||||
return PACKAGE_FILE_IS_FINISH + fileIdentifier;
|
||||
}
|
||||
|
||||
// 全局资源数据缓存,最近一年统计数据
|
||||
public final static String GLOBAL_RESOURCES_DATA_KEY = "GLOBAL_RESOURCES_DATA:";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.microservices.common.core.utils;
|
||||
|
||||
import com.microservices.common.core.exception.ServiceException;
|
||||
import net.sourceforge.pinyin4j.PinyinHelper;
|
||||
import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
|
||||
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
|
||||
|
|
@ -29,7 +30,7 @@ public class PinYinStringUtils {
|
|||
try {
|
||||
pinyinStr += PinyinHelper.toHanyuPinyinStringArray(newChar[i], defaultFormat)[0].charAt(0);
|
||||
} catch (BadHanyuPinyinOutputFormatCombination e) {
|
||||
e.printStackTrace();
|
||||
throw new ServiceException("转换拼音失败");
|
||||
}
|
||||
} else {
|
||||
pinyinStr += newChar[i];
|
||||
|
|
@ -55,7 +56,7 @@ public class PinYinStringUtils {
|
|||
try {
|
||||
pinyinStr += PinyinHelper.toHanyuPinyinStringArray(newChar[i], defaultFormat)[0];
|
||||
} catch (BadHanyuPinyinOutputFormatCombination e) {
|
||||
e.printStackTrace();
|
||||
throw new ServiceException("转换拼音失败");
|
||||
}
|
||||
} else {
|
||||
pinyinStr += newChar[i];
|
||||
|
|
@ -88,8 +89,7 @@ public class PinYinStringUtils {
|
|||
}
|
||||
return result.toString();
|
||||
} catch (BadHanyuPinyinOutputFormatCombination e1) {
|
||||
e1.printStackTrace();
|
||||
throw new ServiceException("转换拼音失败");
|
||||
}
|
||||
return result.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -218,17 +218,18 @@ public class ServletUtils {
|
|||
}
|
||||
|
||||
/**
|
||||
* 内容编码(排除斜杠)
|
||||
* 内容编码(排除斜杠并且支持重复编码)
|
||||
*
|
||||
* @param str 内容
|
||||
* @return 编码后的内容
|
||||
*/
|
||||
public static String urlEncodeExcludeSlashes(String str) {
|
||||
public static String urlEncodeExcludeSlashesApplyDuplicate(String str) {
|
||||
try {
|
||||
StringBuilder stringBuffer = new StringBuilder();
|
||||
String[] strings = str.split("/");
|
||||
for (String string : strings) {
|
||||
stringBuffer.append("/").append(URLEncoder.encode(string, Constants.UTF8));
|
||||
string = URLEncoder.encode(string, Constants.UTF8);
|
||||
stringBuffer.append("/").append(string);
|
||||
}
|
||||
return stringBuffer.toString().replaceAll("\\+", "%20");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
|
|
@ -236,6 +237,22 @@ public class ServletUtils {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断字符串是否经过URLEncode
|
||||
* 1. 使用URLDecoder.decode对字符串进行解码。
|
||||
* 2. 再使用URLEncoder.encode对解码后的字符串重新编码。
|
||||
* 3. 如果重新编码后的字符串与原始字符串相同,则说明原始字符串是经过URL编码的
|
||||
*
|
||||
* @param encodedString 需encode的字符串
|
||||
* @return 是否经过URLEncode
|
||||
* @throws UnsupportedEncodingException 编码异常
|
||||
*/
|
||||
public static boolean isUrlEncoded(String encodedString) throws UnsupportedEncodingException {
|
||||
String decodedString = URLDecoder.decode(encodedString, "UTF-8");
|
||||
String reencodedString = URLEncoder.encode(decodedString, "UTF-8");
|
||||
return encodedString.equalsIgnoreCase(reencodedString);
|
||||
}
|
||||
|
||||
/**
|
||||
* 内容解码
|
||||
*
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.microservices.common.core.web.domain;
|
|||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.microservices.common.core.utils.DateUtils;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
|
@ -63,4 +64,12 @@ public class BaseEntity implements Serializable
|
|||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
public void setCreateAndUpdate(String username) {
|
||||
Date nowDate = DateUtils.getNowDate();
|
||||
this.createBy = username;
|
||||
this.updateBy = username;
|
||||
this.createTime = nowDate;
|
||||
this.updateTime = nowDate;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.alibaba.fastjson2.JSONArray;
|
|||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.microservices.common.core.constant.Constants;
|
||||
import com.microservices.common.core.constant.HttpStatus;
|
||||
import com.microservices.common.core.exception.ServiceException;
|
||||
import com.microservices.common.httpClient.domain.CustomHttpDelete;
|
||||
import com.microservices.system.api.domain.SysFileBytes;
|
||||
import org.apache.commons.collections4.MapUtils;
|
||||
|
|
@ -281,6 +282,10 @@ public class HttpAPIService {
|
|||
long length = httpEntity.getContentLength();
|
||||
if (length != 0L) {
|
||||
String result = EntityUtils.toString(httpEntity);
|
||||
if (!JSON.isValid(result)) {
|
||||
logger.error("平台接口响应格式异常,状态码:{},响应内容:{}", httpStatusCode, result);
|
||||
throw new ServiceException("平台接口响应格式异常");
|
||||
}
|
||||
Object resultObj = JSON.parse(result);
|
||||
if (resultObj instanceof JSONArray) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.microservices.dms.achievementLibrary.controller;
|
||||
|
||||
import com.microservices.common.core.web.controller.BaseController;
|
||||
import com.microservices.common.core.web.page.TableDataInfo;
|
||||
import com.microservices.dms.achievementLibrary.domain.TokenListVo;
|
||||
import com.microservices.dms.achievementLibrary.service.IAchievementsService;
|
||||
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("/blockChain")
|
||||
@Api(tags = "数据产权子系统")
|
||||
public class BlockChainController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IAchievementsService achievementsService;
|
||||
|
||||
// @GetMapping("/projectTokenList")
|
||||
// @ApiOperation(value = "项目token列表")
|
||||
// public TableDataInfo projectTokenList() {
|
||||
// startPage();
|
||||
// List<TokenListVo> list = achievementsService.projectTokenList();
|
||||
// return getDataTable(list);
|
||||
// }
|
||||
}
|
||||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
@ -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;
|
||||
|
|
@ -185,6 +186,15 @@ public class Achievements extends BaseEntity {
|
|||
private String userNickName;
|
||||
public String gender;
|
||||
private String userLogin;
|
||||
private List<Map<String,Object>> dockingUserInfo;
|
||||
|
||||
public List<Map<String, Object>> getDockingUserInfo() {
|
||||
return dockingUserInfo;
|
||||
}
|
||||
|
||||
public void setDockingUserInfo(List<Map<String, Object>> dockingUserInfo) {
|
||||
this.dockingUserInfo = dockingUserInfo;
|
||||
}
|
||||
|
||||
public String getShowAchievementName() {
|
||||
return showAchievementName;
|
||||
|
|
@ -492,38 +502,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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TokenListVo {
|
||||
|
||||
private Long id; // 项目ID
|
||||
private String name; // 项目名称
|
||||
private Long totalToken; // 项目总Token
|
||||
private String createBy; // 创建人
|
||||
private Long currentToken; // 当前Token
|
||||
private String repositoryName; // 仓库名称
|
||||
private Long repositoryId; // 仓库名称
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Data createdOn; // 项目创建时间(以毫秒为单位)
|
||||
}
|
||||
|
|
@ -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();
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -156,4 +156,6 @@ public interface AchievementsMapper {
|
|||
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
@ -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;
|
||||
|
|
@ -74,7 +75,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));
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
@ -5,8 +5,10 @@ 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.behaviorImage.domain.AchievementBehaviorSumVo;
|
||||
|
|
@ -21,6 +23,7 @@ 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.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
|
|
@ -28,6 +31,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;
|
||||
|
||||
/**
|
||||
|
|
@ -37,6 +41,7 @@ import static com.microservices.dms.utils.UrlUtil.getUrlPath;
|
|||
* @date 2025-04-02
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class AchievementsServiceImpl implements IAchievementsService {
|
||||
@Autowired
|
||||
private AchievementsMapper achievementsMapper;
|
||||
|
|
@ -47,9 +52,6 @@ public class AchievementsServiceImpl implements IAchievementsService {
|
|||
@Autowired
|
||||
private ExpertResourceLibraryMapper expertResourceLibraryMapper;
|
||||
|
||||
@Autowired
|
||||
private ProjectResourceLibraryMapper projectResourceLibraryMapper;
|
||||
|
||||
@Autowired
|
||||
private IBehaviorImageService behaviorImageService;
|
||||
|
||||
|
|
@ -62,7 +64,6 @@ public class AchievementsServiceImpl implements IAchievementsService {
|
|||
@Value("${http.gatewayUrl}")
|
||||
public String gatewayUrl;
|
||||
|
||||
|
||||
/**
|
||||
* 查询成果
|
||||
*
|
||||
|
|
@ -72,16 +73,16 @@ 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 = "";
|
||||
if(StringUtils.isNotEmpty(gender) && gender.equals("1")){
|
||||
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);
|
||||
|
|
@ -107,14 +108,14 @@ public class AchievementsServiceImpl implements IAchievementsService {
|
|||
for (Achievements a : list) {
|
||||
String gender = a.getGender();
|
||||
String img = "";
|
||||
if(StringUtils.isNotEmpty(gender) && gender.equals("1")){
|
||||
if (StringUtils.isNotEmpty(gender) && gender.equals("1")) {
|
||||
img = "images/avatars/User/girl.jpg";
|
||||
}else if (StringUtils.isNotEmpty(gender) && gender.equals("0")) {
|
||||
} 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);
|
||||
|
|
@ -122,6 +123,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.getDockingUserInfo(a.getId());
|
||||
a.setDockingUserInfo(dockingUserInfo);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
|
@ -192,25 +197,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);
|
||||
|
|
@ -241,14 +247,14 @@ public class AchievementsServiceImpl implements IAchievementsService {
|
|||
for (Achievements a : list) {
|
||||
String gender = a.getGender();
|
||||
String img = "";
|
||||
if(StringUtils.isNotEmpty(gender) && gender.equals("1")){
|
||||
if (StringUtils.isNotEmpty(gender) && gender.equals("1")) {
|
||||
img = "images/avatars/User/girl.jpg";
|
||||
}else if(StringUtils.isNotEmpty(gender) && gender.equals("0")){
|
||||
} 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);
|
||||
|
|
@ -294,14 +300,14 @@ public class AchievementsServiceImpl implements IAchievementsService {
|
|||
@Override
|
||||
public List<HotAchVo> getHotAchievement() {
|
||||
//根据查询条件获取所有的成果数据
|
||||
List<HotAchVo> resultList = achievementsMapper.getHotAchievement();
|
||||
List<HotAchVo> resultList = achievementsMapper.getHotAchievement();
|
||||
//遍历成果数据,获取对应成果的点击数
|
||||
for (HotAchVo a : resultList) {
|
||||
String gender = a.getGender();
|
||||
String img = "";
|
||||
if(StringUtils.isNotEmpty(gender) && gender.equals("1")){
|
||||
if (StringUtils.isNotEmpty(gender) && gender.equals("1")) {
|
||||
img = "images/avatars/User/girl.jpg";
|
||||
}else if (StringUtils.isNotEmpty(gender) && gender.equals("0")){
|
||||
} else if (StringUtils.isNotEmpty(gender) && gender.equals("0")) {
|
||||
img = "images/avatars/User/boy.jpg";
|
||||
}
|
||||
a.setUserImg(img);
|
||||
|
|
@ -391,7 +397,7 @@ public class AchievementsServiceImpl implements IAchievementsService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<KeyValVo<String, Long>> get7AddClickById(String id,String clickType) {
|
||||
public List<KeyValVo<String, Long>> get7AddClickById(String id, String clickType) {
|
||||
|
||||
if (StringUtils.isEmpty(clickType)) {
|
||||
clickType = "Achievements";
|
||||
|
|
@ -496,7 +502,7 @@ public class AchievementsServiceImpl implements IAchievementsService {
|
|||
|
||||
@Override
|
||||
public List<TaskResourceLibrary> getRelatedAchTaskOfExpert(Long id) {
|
||||
return achievementsMapper.getRelatedAchTaskOfExpert(id);
|
||||
return achievementsMapper.getRelatedAchTaskOfExpert(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -504,6 +510,7 @@ public class AchievementsServiceImpl implements IAchievementsService {
|
|||
return achievementsMapper.getRelatedAchCompetitionOfExpert(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据查询内容,调用搜索行为接口
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,7 +5,9 @@ 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;
|
||||
|
|
@ -46,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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
@ -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,7 +95,7 @@ public interface BehaviorImageMapper {
|
|||
|
||||
List<UserTypeTotalVo> getUserTypeStatistic(@Param("userId")Long userId);
|
||||
|
||||
List<KeyValueVo> getActivityStatistic();
|
||||
ActivityUserTotal getActivityStatistic();
|
||||
|
||||
List<ActivityUserLibrary> selectActivityUserLibraryListAll(ActivityUserLibrary activityUserLibrary);
|
||||
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ public interface IBehaviorImageService {
|
|||
|
||||
UserExpertTotalVo getUserExpertStatistic(Long userId);
|
||||
|
||||
List<KeyValueVo> getActivityStatistic();
|
||||
ActivityUserTotal getActivityStatistic();
|
||||
|
||||
UserTypeTotalVo getUserBehaviorSum(Long userId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -309,7 +309,7 @@ public class BehaviorImageServiceImpl implements IBehaviorImageService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<KeyValueVo> getActivityStatistic() {
|
||||
public ActivityUserTotal getActivityStatistic() {
|
||||
return behaviorImageMapper.getActivityStatistic();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,10 +11,23 @@ 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.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
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 javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -157,4 +170,22 @@ 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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
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分配给本项目中的其他用户
|
||||
|
||||
}
|
||||
|
|
@ -2,10 +2,7 @@ package com.microservices.dms.referral.mapper;
|
|||
|
||||
import com.microservices.common.datasource.annotation.Slave;
|
||||
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||
import com.microservices.dms.referral.vo.ExpertVo;
|
||||
import com.microservices.dms.referral.vo.IssuesVo;
|
||||
import com.microservices.dms.referral.vo.PullRequestVo;
|
||||
import com.microservices.dms.referral.vo.TaskVo;
|
||||
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;
|
||||
|
|
@ -46,4 +43,7 @@ public interface TalentReferralMapper {
|
|||
TaskVo selectCompetitionById(Long competitionId);
|
||||
|
||||
List<TaskVo> selectCompetitionIdByStatus();
|
||||
|
||||
PrInfoVo selectPRInfoById(@Param("id") Integer id);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,10 +11,7 @@ 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.ExpertVo;
|
||||
import com.microservices.dms.referral.vo.IssueDto;
|
||||
import com.microservices.dms.referral.vo.IssuesVo;
|
||||
import com.microservices.dms.referral.vo.TaskVo;
|
||||
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;
|
||||
|
|
@ -94,9 +91,9 @@ public class TalentReferralService {
|
|||
return collaborators;
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> doIssueTalentReferral(Long projectId, Long issueId) {
|
||||
public List<Map<String, Object>> doIssueTalentReferral(Long issueId , Long projectId) {
|
||||
List<Map.Entry<Long, Double>> entries = issueTalentReferral(projectId, issueId);
|
||||
return entries.stream().map(s -> {
|
||||
return entries.stream().limit(3).map(s -> {
|
||||
Map<String, Object> mm = talentReferralMapper.selectUsersById(s.getKey());
|
||||
return mm;
|
||||
}).collect(Collectors.toList());
|
||||
|
|
@ -111,12 +108,12 @@ 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));
|
||||
List<IssuesVo> issuesVos = talentReferralMapper.selectIssuesCondition(vo);
|
||||
Map<Long, Double> userFractionMap = new HashMap<>();
|
||||
// 计算与解决issue的相似度, 标题+描述
|
||||
|
|
@ -153,36 +150,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) -> {
|
||||
|
|
@ -224,7 +226,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());
|
||||
|
|
@ -232,9 +234,9 @@ public class TalentReferralService {
|
|||
return new HashSet<>();
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> doPRTalentReferral(Long projectId, Long prId) {
|
||||
public List<Map<String, Object>> doPRTalentReferral(Long prId, Long projectId) {
|
||||
List<Map.Entry<Long, Double>> entries = PRTalentReferral(projectId, prId);
|
||||
return entries.stream().map(s -> {
|
||||
return entries.stream().limit(3).map(s -> {
|
||||
Map<String, Object> mm = talentReferralMapper.selectUsersById(s.getKey());
|
||||
return mm;
|
||||
}).collect(Collectors.toList());
|
||||
|
|
@ -242,14 +244,14 @@ public class TalentReferralService {
|
|||
|
||||
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);
|
||||
}
|
||||
|
||||
//定时统计
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public class CompetitionResourceLibrary extends BaseEntity {
|
|||
*/
|
||||
private String competitionField;
|
||||
/**
|
||||
* 竞赛状态 0进行中 1已结束
|
||||
* 竞赛状态 status: 0 未上架 1上架
|
||||
*/
|
||||
private String competitionStatus;
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.microservices.dms.resourceLibrary.mapper;
|
||||
|
||||
import com.microservices.common.datasource.annotation.Slave;
|
||||
import com.microservices.dms.achievementLibrary.domain.TokenListVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.ProjectResourceLibrary;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.ProjectListVo;
|
||||
|
|
@ -51,4 +52,8 @@ public interface ProjectResourceLibraryMapper {
|
|||
List<KeyValVo<String,String>> getAttachments(@Param("containerId") Long containerId);
|
||||
|
||||
String getProjectDomainNameByKey(@Param("projectDomain") String projectDomain );
|
||||
|
||||
List<TokenListVo> selectProjectInfos();
|
||||
|
||||
Long sumProjectIssueToken(@Param("id") Long id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -230,6 +230,7 @@ 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>
|
||||
|
||||
|
|
@ -355,6 +356,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
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
|
||||
|
|
@ -461,10 +463,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>
|
||||
|
||||
|
|
@ -539,24 +542,37 @@ 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
|
||||
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 t.name,t.source,count(1) as "tmp",t.field_1,t.remark
|
||||
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'
|
||||
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')
|
||||
)t
|
||||
where t.field_1 is not null and t.field_1 !=""
|
||||
group by t.name, t.source, t.field_1, t.remark
|
||||
) r
|
||||
) z
|
||||
<where>
|
||||
<if test="areaKey != null and areaKey != ''">
|
||||
and z.field_1 = #{areaKey}
|
||||
|
|
@ -699,4 +715,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
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 >= #{s} and created_at <= #{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' order by created_at desc limit 1) 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' order by created_at desc limit 1) c on u.id = c.user_id
|
||||
where u.enterprise_certification='1') t
|
||||
order by t.created_at
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -140,7 +140,7 @@
|
|||
</select>
|
||||
|
||||
<select id="selectActivityUserLibraryListAll" resultType="com.microservices.dms.behaviorImage.domain.ActivityUserLibrary">
|
||||
select res.userId,res.loginName,res.userName,res.isExpert,res.isAuth,res.relatedCompetition,res.p1+res.p2+res.p3 as "relatedProject" from (
|
||||
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",
|
||||
|
|
@ -306,14 +306,24 @@
|
|||
)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">
|
||||
|
|
|
|||
|
|
@ -370,12 +370,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>
|
||||
|
||||
|
|
@ -452,10 +452,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>
|
||||
|
||||
|
|
@ -495,14 +496,15 @@
|
|||
|
||||
<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>
|
||||
|
||||
|
|
@ -525,13 +527,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 >= #{s}
|
||||
and created_at <= #{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">
|
||||
|
|
|
|||
|
|
@ -369,4 +369,16 @@
|
|||
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, r.identifier repositoryName, r.id as repositoryId from projects p
|
||||
join repositories r on p.id = r.project_id where p.use_blockchain = 1
|
||||
</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>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -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,6 +77,9 @@ 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>
|
||||
</select>
|
||||
|
||||
|
|
@ -105,6 +115,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 +153,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 +187,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 +225,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>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<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>
|
||||
|
|
@ -71,7 +71,7 @@
|
|||
from tasks t
|
||||
join task_details td on t.id = td.task_id
|
||||
where status in
|
||||
<foreach collection="list" item="item" close=")" index="idx" open="(" separator=",">
|
||||
<foreach collection="statusIds" item="item" close=")" index="idx" open="(" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
|
@ -115,5 +115,9 @@
|
|||
where upload_date < 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>
|
||||
</mapper>
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -23,7 +23,6 @@ public class MakerSpaceDataController extends BaseController {
|
|||
|
||||
@ApiOperation("创客空间全局资源获取")
|
||||
@GetMapping(value = "/total")
|
||||
@GitlinkAdminAccessRequired
|
||||
public AjaxResult getTotalData() {
|
||||
return success(tasksService.getTotalStatisticalData());
|
||||
}
|
||||
|
|
@ -45,10 +44,16 @@ public class MakerSpaceDataController extends BaseController {
|
|||
@ApiOperation("创客任务最新操作日志")
|
||||
@GetMapping(value = "/task/operLog")
|
||||
@GitlinkAdminAccessRequired
|
||||
public AjaxResult getPaperTrendData(@ApiParam("获取最新操作日志的数量") @RequestParam Integer topNum) {
|
||||
public AjaxResult getOperLogData(@ApiParam("获取最新操作日志的数量") @RequestParam Integer topNum) {
|
||||
return success(tasksService.getTaskOperLogTopN(topNum));
|
||||
}
|
||||
|
||||
@ApiOperation("创客任务最新操作日志——首页展示")
|
||||
@GetMapping(value = "/task/userOperLog")
|
||||
public AjaxResult getUserOperLogData(@ApiParam("获取最新操作日志的数量") @RequestParam Integer topNum) {
|
||||
return success(tasksService.getTaskUserOperLogTopN(topNum));
|
||||
}
|
||||
|
||||
@ApiOperation("创客任务奖金分布")
|
||||
@GetMapping(value = "/task/bountyDistribution")
|
||||
@GitlinkAdminAccessRequired
|
||||
|
|
@ -79,10 +84,13 @@ public class MakerSpaceDataController extends BaseController {
|
|||
|
||||
@ApiOperation("创客任务-所有任务类型分布")
|
||||
@GetMapping(value = "/task/categoryDistribution")
|
||||
@GitlinkAdminAccessRequired
|
||||
public AjaxResult getAllTaskCategoryDistribution() {
|
||||
return success(tasksService.getAllTaskCategoryDistribution());
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("创客任务-各状态任务数据统计")
|
||||
@GetMapping(value = "/task/statisticByStatus")
|
||||
public AjaxResult getTaskStatisticsByStatus() {
|
||||
return success(tasksService.getTaskStatisticsByStatus());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,11 @@ public class MakerSpaceTotalDataVo {
|
|||
|
||||
private int totalApplicants;
|
||||
|
||||
private int currentTotalAwardAmount;
|
||||
private float currentTotalAwardAmount;
|
||||
|
||||
private float paidAwardAmount;
|
||||
|
||||
private int totalVisits;
|
||||
|
||||
private List<Object> taskPublishedCountsByYear;
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ public interface TasksMapper{
|
|||
|
||||
int getTotalApplicantCount();
|
||||
|
||||
int getCurrentTotalAwardAmount();
|
||||
float getCurrentTotalAwardAmount();
|
||||
|
||||
List<Object> getTaskPublishedCountsByYear();
|
||||
|
||||
|
|
@ -40,4 +40,12 @@ public interface TasksMapper{
|
|||
List<TaskHeatInfoVo> getTaskInfoByVisits(@Param("topNum") Integer topNum);
|
||||
|
||||
List<Map<String, String>> getTaskModeStatistic();
|
||||
|
||||
float getPaidAwardAmount();
|
||||
|
||||
Map<String, String> getTaskStatisticsByStatus(@Param("status") Integer status);
|
||||
|
||||
List<Map<String, String>> getTaskUserOperLogTopN(@Param("topNum") Integer topNum, @Param("taskLogOperations") String[] taskLogOperations);
|
||||
|
||||
int getTotalVisits();
|
||||
}
|
||||
|
|
@ -25,4 +25,8 @@ public interface ITasksService {
|
|||
List<TaskHeatInfoVo> getTaskHeatTopN(Integer topNum);
|
||||
|
||||
List<Map<String, String>> getTaskModeStatisticalData();
|
||||
|
||||
List<Map<String, String>> getTaskStatisticsByStatus();
|
||||
|
||||
List<Map<String, String>> getTaskUserOperLogTopN(Integer topNum);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import org.springframework.stereotype.Service;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.ParseException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
|
@ -27,6 +28,10 @@ public class TasksServiceImpl implements ITasksService {
|
|||
|
||||
private static final Logger logger = LoggerFactory.getLogger(TasksServiceImpl.class);
|
||||
|
||||
private static final String[] taskLogOperations = {"添加需求", "添加成果", "审核成果", "管理员审核评选结果及佐证",
|
||||
"上传委托协议", "胜出者上传协议", "平台方上传签订表", "平台方上传协议"};
|
||||
|
||||
|
||||
@Resource
|
||||
private TasksMapper tasksMapper;
|
||||
|
||||
|
|
@ -35,7 +40,9 @@ 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());
|
||||
makerSpaceTotalDataVo.setTaskBountyCountsByYear(tasksMapper.getTaskBountyCountsByYear());
|
||||
return makerSpaceTotalDataVo;
|
||||
|
|
@ -110,6 +117,22 @@ public class TasksServiceImpl implements ITasksService {
|
|||
return tasksMapper.getTaskModeStatistic();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, String>> getTaskStatisticsByStatus() {
|
||||
List<Map<String, String>> result = new ArrayList<>();
|
||||
result.add(tasksMapper.getTaskStatisticsByStatus(DssTaskStatus.PAPER_COLLECT.getKey()));
|
||||
result.add(tasksMapper.getTaskStatisticsByStatus(DssTaskStatus.PAPER_SELECT.getKey()));
|
||||
result.add(tasksMapper.getTaskStatisticsByStatus(DssTaskStatus.PUBLICITY.getKey()));
|
||||
result.add(tasksMapper.getTaskStatisticsByStatus(DssTaskStatus.CONTRACT.getKey()));
|
||||
result.add(tasksMapper.getTaskStatisticsByStatus(DssTaskStatus.COMPLETE.getKey()));
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, String>> getTaskUserOperLogTopN(Integer topNum) {
|
||||
return tasksMapper.getTaskUserOperLogTopN(topNum, taskLogOperations);
|
||||
}
|
||||
|
||||
private int[] getNewAddedTasksByMonth(String startTime, String endTime) throws ParseException, JsonProcessingException {
|
||||
int monthDiff = 12;
|
||||
Map<Object, Object> map_init = MapInitByMonth(monthDiff,endTime);
|
||||
|
|
|
|||
|
|
@ -26,14 +26,12 @@ public class ProjectDataController extends BaseController {
|
|||
|
||||
@ApiOperation("开源项目全局资源获取")
|
||||
@GetMapping(value = "/global-resources")
|
||||
@GitlinkAdminAccessRequired
|
||||
public AjaxResult getGlobalResourcesData() throws ParseException, JsonProcessingException {
|
||||
return success(projectGlobalResourcesService.getProjectGlobalResourcesData());
|
||||
}
|
||||
|
||||
@ApiOperation("开源项目最新动态获取")
|
||||
@GetMapping(value = "/latestActivities")
|
||||
@GitlinkAdminAccessRequired
|
||||
public AjaxResult getLatestActivitiesData(@ApiParam("分页数") @RequestParam(value = "page", defaultValue = "1") int page,
|
||||
@ApiParam("分页大小") @RequestParam(value = "limit", defaultValue = "6") int limit){
|
||||
return success(projectGlobalResourcesService.getLatestActivitiesData(page, limit));
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
@ -67,7 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHERE
|
||||
is_delete = 0
|
||||
AND STATUS BETWEEN 3 AND 8
|
||||
AND YEAR(created_at) IN (YEAR(CURDATE()) - 1, YEAR(CURDATE()))
|
||||
AND YEAR(created_at) IN (YEAR(CURDATE()) - 2, YEAR(CURDATE()),YEAR(CURDATE()) - 1, YEAR(CURDATE()))
|
||||
GROUP BY
|
||||
YEAR(created_at)
|
||||
ORDER BY
|
||||
|
|
@ -82,7 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHERE
|
||||
is_delete = 0
|
||||
AND STATUS BETWEEN 3 AND 8
|
||||
AND YEAR(created_at) IN (YEAR(CURDATE()) - 1, YEAR(CURDATE()))
|
||||
AND YEAR(created_at) IN (YEAR(CURDATE()) - 2, YEAR(CURDATE()),YEAR(CURDATE()) - 1, YEAR(CURDATE()))
|
||||
GROUP BY
|
||||
YEAR(created_at)
|
||||
ORDER BY
|
||||
|
|
@ -207,5 +207,128 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHERE is_delete = 0 AND `status` BETWEEN 3 AND 8
|
||||
GROUP BY publish_mode
|
||||
</select>
|
||||
<select id="getPaidAwardAmount" resultType="java.lang.Float">
|
||||
SELECT COALESCE(SUM(bounty), 0) AS total_bounty
|
||||
FROM tasks
|
||||
WHERE is_delete = 0 AND `status` = 8 and except_closed_boolean = 0;
|
||||
</select>
|
||||
<select id="getTotalVisits" resultType="java.lang.Integer">
|
||||
SELECT COALESCE(SUM(visits), 0) AS total_visits
|
||||
FROM tasks
|
||||
WHERE is_delete = 0;
|
||||
</select>
|
||||
<select id="getTaskStatisticsByStatus" resultType="java.util.Map">
|
||||
<if test = "status == 3">
|
||||
select '成果征集中' AS status,sub1.total_tasks, sub1.total_bounty, sub2.total_applied_papers
|
||||
from
|
||||
(select count(t.id) as 'total_tasks', sum(t.bounty) as 'total_bounty'
|
||||
from tasks t where t.status = 3 and t.is_delete = 0) sub1,
|
||||
(select count(p.id) as 'total_applied_papers'
|
||||
from papers p left join tasks t on t.id = p.task_id and p.parent_id = 0 and p.check_status = 1
|
||||
WHERE t.status =3 AND t.is_delete =0) sub2
|
||||
</if>
|
||||
<if test = "status == 4">
|
||||
select '成果评选中' AS status,
|
||||
sub1.total_tasks,
|
||||
sub2.total_selected_papers,
|
||||
sub3.total_participated_experts
|
||||
from
|
||||
(select count(t.id) as 'total_tasks'
|
||||
from tasks t where t.status = 4 and t.is_delete = 0) sub1,
|
||||
(select count(p.id) as 'total_selected_papers'
|
||||
from papers p
|
||||
left join tasks t on p.task_id = t.id and p.parent_id = 0 and p.check_status = 1) sub2,
|
||||
(select count(e.expert_id) as 'total_participated_experts'
|
||||
from tasks t
|
||||
left join
|
||||
(select distinct tega.expert_id , teg.container_id
|
||||
from task_expert_group_assignments tega
|
||||
left join task_expert_groups teg on tega.group_id = teg.id
|
||||
left join task_scoring_rule str on teg.container_id = str.container_id
|
||||
where teg.container_type = 2 and str.status in (-1,1,2)) e
|
||||
on t.id = e.container_id
|
||||
where t.status = 4 and t.is_delete = 0) sub3
|
||||
</if>
|
||||
<if test = "status == 5">
|
||||
SELECT
|
||||
'公示中' AS status,
|
||||
sub1.total_tasks,
|
||||
sub2.total_won_papers,
|
||||
sub1.total_bounty
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
COUNT(DISTINCT t.id) AS 'total_tasks',
|
||||
SUM(t.bounty) AS 'total_bounty'
|
||||
FROM
|
||||
tasks t
|
||||
WHERE
|
||||
t.status = 5 AND t.is_delete = 0
|
||||
) sub1,
|
||||
(
|
||||
SELECT
|
||||
COUNT(p.id) AS 'total_won_papers'
|
||||
FROM
|
||||
papers p
|
||||
LEFT JOIN tasks t ON t.id = p.task_id AND p.parent_id = 0 AND p.status = 2
|
||||
WHERE
|
||||
t.status = 5 AND t.is_delete = 0
|
||||
) sub2;
|
||||
</if>
|
||||
<if test = "status == 6">
|
||||
select
|
||||
'协议签订中' AS status,
|
||||
sub1.total_tasks,
|
||||
sub2.total_signed_tasks,
|
||||
sub3.total_unsigned_tasks
|
||||
from
|
||||
(select count(t.id) as 'total_tasks'
|
||||
from tasks t where t.status = 6 and t.is_delete = 0) sub1,
|
||||
(select count(p.id) as 'total_signed_tasks'
|
||||
from papers p
|
||||
left join tasks t on t.id = p.task_id and p.parent_id = 0 and p.status = 2 and p.is_sign = 1
|
||||
where t.status = 6 and t.is_delete = 0) sub2,
|
||||
(select count(p.id) as 'total_unsigned_tasks'
|
||||
from papers p
|
||||
left join tasks t on t.id = p.task_id and p.parent_id = 0 and p.status = 2 and p.is_sign = 0
|
||||
where t.status = 6 and t.is_delete = 0) sub3
|
||||
</if>
|
||||
<if test = "status == 8">
|
||||
select '已完成' AS status, sub1.total_tasks, sub2.total_paid_bounty, sub3.total_won_applicants
|
||||
from
|
||||
(select count(t.id) as 'total_tasks'
|
||||
from tasks t where t.status = 8 and t.is_delete = 0) sub1,
|
||||
(select sum(t.bounty) as 'total_paid_bounty'
|
||||
from tasks t where t.status = 8 and t.is_delete = 0) sub2,
|
||||
(select count(p.id) as 'total_won_applicants'
|
||||
from papers p
|
||||
left join tasks t on t.id = p.task_id and p.parent_id = 0 and p.status = 2
|
||||
where t.status = 8 and t.is_delete = 0) sub3
|
||||
</if>
|
||||
</select>
|
||||
<select id="getTaskUserOperLogTopN" resultType="java.util.Map">
|
||||
SELECT
|
||||
log_desc as log_desc,
|
||||
CASE
|
||||
WHEN TIMESTAMPDIFF(MINUTE, oper_time, NOW()) = 0 THEN CONCAT(TIMESTAMPDIFF(SECOND, oper_time, NOW()), '秒前')
|
||||
WHEN TIMESTAMPDIFF(HOUR, oper_time, NOW()) = 0 THEN CONCAT(TIMESTAMPDIFF(MINUTE, oper_time, NOW()), '分钟前')
|
||||
WHEN TIMESTAMPDIFF(DAY, oper_time, NOW()) = 0 THEN CONCAT(TIMESTAMPDIFF(HOUR, oper_time, NOW()), '小时前')
|
||||
ELSE CONCAT(TIMESTAMPDIFF(DAY, oper_time, NOW()), '天前')
|
||||
END AS time_ago,
|
||||
task_id
|
||||
FROM
|
||||
task_oper_log
|
||||
WHERE
|
||||
oper_title in
|
||||
<foreach item="item" collection="taskLogOperations" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND log_desc NOT LIKE '%未通过%'
|
||||
AND log_desc NOT LIKE '%驳回%'
|
||||
AND log_desc NOT LIKE '%失败%'
|
||||
ORDER BY
|
||||
id DESC
|
||||
LIMIT #{topNum};
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -88,6 +88,18 @@ public class CommonController extends BaseController {
|
|||
return R.ok(sysFileInfoService.packagedFile(packagedStructure, zipFileName, type, hierarchy));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过Url下载文件到本地
|
||||
*/
|
||||
@PostMapping(value = "/downloadFileByUrl")
|
||||
@InnerAuth
|
||||
public R<String> downloadFileByUrl(
|
||||
@RequestParam("fileUrl") String fileUrl
|
||||
, @RequestParam("type") String type
|
||||
, @RequestParam("hierarchy") String hierarchy) {
|
||||
return R.ok(sysFileInfoService.downloadFileByUrl(fileUrl, type, hierarchy));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用下载请求
|
||||
*
|
||||
|
|
@ -210,4 +222,17 @@ public class CommonController extends BaseController {
|
|||
sysFileInfo.setFilePath("");
|
||||
return R.ok(sysFileInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传本地文件到Forge
|
||||
*
|
||||
* @param fileIdentifiers 文件标识列表,逗号分隔
|
||||
* @return Forge文件标识列表
|
||||
*/
|
||||
@InnerAuth
|
||||
@PostMapping(value = "/uploadFileToForge/{fileIdentifiers}")
|
||||
@ApiOperation(value = "上传本地文件到Forge", hidden = true)
|
||||
R<List<String>> uploadFileToForge(@PathVariable("fileIdentifiers") String fileIdentifiers) {
|
||||
return R.ok(sysFileInfoService.uploadFileToForge(fileIdentifiers));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +1,19 @@
|
|||
package com.microservices.file.controller;
|
||||
|
||||
import com.microservices.common.core.domain.R;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.file.service.ISysFileInfoService;
|
||||
import com.microservices.system.api.domain.SysFileInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
|
@ -107,4 +108,31 @@ public class OpenController {
|
|||
sysFileInfo.setFilePath("");
|
||||
return R.ok(sysFileInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用上传请求
|
||||
*/
|
||||
@PostMapping("/upload")
|
||||
@ApiOperation("公开上传请求")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "file", value = "文件实体", paramType = "form", dataType = "_file"),
|
||||
@ApiImplicitParam(name = "type", value = "文件类型(zone-identifier:专区下支持文件标识的附件,cms:内容管理,resource:专区资源,pms:项目管理,pms-gitlink:项目管理gitlink附件,gitlink:gitlink附件)", 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) {
|
||||
SysFileInfo sysFileInfo = sysFileInfoService.upload(file, type, hierarchy);
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("url", sysFileInfo.getDownloadUrl());
|
||||
if (sysFileInfo.getFileIdentifier() != null) {
|
||||
ajax.put("fileIdentifier", sysFileInfo.getFileIdentifier());
|
||||
}
|
||||
ajax.put("fileName", sysFileInfo.getFilePath());
|
||||
if (sysFileInfo.getFileId() != null) {
|
||||
ajax.put("fileId", sysFileInfo.getFileId());
|
||||
}
|
||||
ajax.put("fileOriginName", sysFileInfo.getFileOriginName());
|
||||
ajax.put("fileSuffix", sysFileInfo.getFileSuffix());
|
||||
ajax.put("fileSize", sysFileInfo.getFileSizeInfo());
|
||||
return ajax;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -171,4 +171,8 @@ public interface ISysFileInfoService {
|
|||
* @return 压缩包文件标识
|
||||
*/
|
||||
String packagedFile(HashMap<String, String> packagedStructure, String zipFileName, String type, String hierarchy);
|
||||
|
||||
List<String> uploadFileToForge(String fileIdentifiers);
|
||||
|
||||
String downloadFileByUrl(String fileUrl, String type, String hierarchy);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
package com.microservices.file.service.impl;
|
||||
|
||||
import com.microservices.common.core.constant.CacheConstants;
|
||||
import com.microservices.common.core.exception.ServiceException;
|
||||
import com.microservices.common.core.utils.DateUtils;
|
||||
import com.microservices.common.core.utils.ServletUtils;
|
||||
import com.microservices.common.core.utils.html.EscapeUtil;
|
||||
import com.microservices.common.redis.service.RedisService;
|
||||
import com.microservices.file.service.ISysFileInfoAsyncService;
|
||||
import com.microservices.file.service.ISysFileInfoService;
|
||||
import com.microservices.file.utils.CustomExecutorFactory;
|
||||
|
|
@ -41,10 +43,13 @@ public class SysFileInfoAsyncServiceImpl implements ISysFileInfoAsyncService {
|
|||
*/
|
||||
@Value("${file.path}")
|
||||
private String localFilePath;
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
@Override
|
||||
public void asyncPackagedFile(String fileIdentifier, HashMap<String, String> packagedStructure, String zipFileName, String type, String hierarchy) {
|
||||
CustomExecutorFactory.threadPoolExecutor.execute(() -> {
|
||||
logger.info("开始打包文件(压缩文件标识[{}]),输出Zip文件名称为:{}", fileIdentifier, zipFileName);
|
||||
Path localPath = Paths.get(localFilePath);
|
||||
// 输出目录
|
||||
String datePath = DateUtils.datePath();
|
||||
|
|
@ -70,6 +75,7 @@ public class SysFileInfoAsyncServiceImpl implements ISysFileInfoAsyncService {
|
|||
String filePath = localFilePath + fileInfo.getFilePath();
|
||||
File file = new File(filePath);
|
||||
if (!file.exists()) {
|
||||
redisService.setCacheObject(CacheConstants.getPackageFileIsFinish(fileIdentifier), -1);
|
||||
throw new IOException("该文件不存在");
|
||||
}
|
||||
// 拷贝文件到打包目录
|
||||
|
|
@ -82,7 +88,8 @@ public class SysFileInfoAsyncServiceImpl implements ISysFileInfoAsyncService {
|
|||
org.apache.commons.io.FileUtils.copyURLToFile(new URL(fileSource), packagedFilePath.toFile());
|
||||
}
|
||||
} catch (IOException e) {
|
||||
logger.error("打包文件时出现异常,需压缩文件处理失败:{}", e.getMessage());
|
||||
redisService.setCacheObject(CacheConstants.getPackageFileIsFinish(fileIdentifier), -1);
|
||||
logger.error("打包文件时出现异常(压缩文件标识[{}]),需压缩文件处理失败:{}", fileIdentifier, e.getMessage());
|
||||
throw new ServiceException("打包文件时出现异常,需压缩文件处理失败!");
|
||||
}
|
||||
});
|
||||
|
|
@ -91,7 +98,8 @@ public class SysFileInfoAsyncServiceImpl implements ISysFileInfoAsyncService {
|
|||
ZipUtils.toZip(tempPackagedPath.toString(), Files.newOutputStream(zipFilePath), true);
|
||||
File zipFile = zipFilePath.toFile();
|
||||
if (!zipFile.exists()) {
|
||||
throw new ServiceException("打包文件时出现异常:文件压缩失败");
|
||||
redisService.setCacheObject(CacheConstants.getPackageFileIsFinish(fileIdentifier), -1);
|
||||
throw new ServiceException("打包文件时出现异常:压缩文件不存在");
|
||||
}
|
||||
String filePath = EscapeUtil.removeExtraSlashOfUrl("/" + type + "/" + hierarchy + "/" + datePath + "/" + fullZipFileName);
|
||||
SysFileInfo sysFileInfo = new SysFileInfo(fileIdentifier, zipFile, filePath);
|
||||
|
|
@ -101,9 +109,12 @@ public class SysFileInfoAsyncServiceImpl implements ISysFileInfoAsyncService {
|
|||
org.apache.commons.io.FileUtils.deleteDirectory(tempPackagedPath.toFile());
|
||||
}
|
||||
} catch (IOException e) {
|
||||
logger.error("打包文件时出现异常:{}", e.getMessage());
|
||||
redisService.setCacheObject(CacheConstants.getPackageFileIsFinish(fileIdentifier), -1);
|
||||
logger.error("打包文件时出现异常(压缩文件标识[{}]):{}", fileIdentifier, e.getMessage());
|
||||
throw new ServiceException("打包文件时出现异常!");
|
||||
}
|
||||
logger.info("打包完成(压缩文件标识[{}]),输出Zip文件名称为:{}", fileIdentifier, zipFileName);
|
||||
redisService.setCacheObject(CacheConstants.getPackageFileIsFinish(fileIdentifier), 1);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ package com.microservices.file.service.impl;
|
|||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.j256.simplemagic.ContentInfo;
|
||||
import com.j256.simplemagic.ContentInfoUtil;
|
||||
import com.microservices.common.core.constant.CacheConstants;
|
||||
import com.microservices.common.core.constant.Constants;
|
||||
import com.microservices.common.core.exception.ServiceException;
|
||||
import com.microservices.common.core.utils.DateUtils;
|
||||
|
|
@ -14,6 +15,7 @@ import com.microservices.common.core.utils.html.EscapeUtil;
|
|||
import com.microservices.common.core.utils.uuid.IdUtils;
|
||||
import com.microservices.common.httpClient.domain.GitLinkRequestUrl;
|
||||
import com.microservices.common.httpClient.util.GitLinkRequestHelper;
|
||||
import com.microservices.common.redis.service.RedisService;
|
||||
import com.microservices.common.security.utils.SecurityUtils;
|
||||
import com.microservices.file.mapper.SysFileInfoMapper;
|
||||
import com.microservices.file.service.ISysFileInfoAsyncService;
|
||||
|
|
@ -34,6 +36,8 @@ import java.io.File;
|
|||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.net.URL;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.*;
|
||||
import java.util.regex.Pattern;
|
||||
|
|
@ -84,6 +88,8 @@ public class SysFileInfoServiceImpl implements ISysFileInfoService {
|
|||
*/
|
||||
@Value("${file.domain}")
|
||||
public String domain;
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
@Override
|
||||
public SysFileInfo selectSysFileInfoByFileObjectName(String fileObjectName) {
|
||||
|
|
@ -499,10 +505,62 @@ public class SysFileInfoServiceImpl implements ISysFileInfoService {
|
|||
@Override
|
||||
public String packagedFile(HashMap<String, String> packagedStructure, String zipFileName, String type, String hierarchy) {
|
||||
String fileIdentifier = genFileIdentifier();
|
||||
redisService.setCacheObject(CacheConstants.getPackageFileIsFinish(fileIdentifier), 0);
|
||||
fileInfoAsyncService.asyncPackagedFile(fileIdentifier, packagedStructure, zipFileName, type, hierarchy);
|
||||
return fileIdentifier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> uploadFileToForge(String fileIdentifiers) {
|
||||
List<SysFileInfo> fileInfoList = getFileListByIdentifier(fileIdentifiers);
|
||||
try {
|
||||
List<String> forgeFileIdentifierList = new ArrayList<>();
|
||||
for (SysFileInfo fileInfo : fileInfoList) {
|
||||
String filePath = localFilePath + fileInfo.getFilePath();
|
||||
File file = new File(filePath);
|
||||
if (!file.exists()) {
|
||||
throw new ServiceException("该文件不存在");
|
||||
}
|
||||
// 拷贝文件到打包目录
|
||||
FileInputStream fileInputStream = new FileInputStream(file);
|
||||
MultipartFile multipartFile = FileUtils.createMultipartFile(fileInputStream, fileInfo.getFileOriginName());
|
||||
SysFileInfo sysFileInfo = upload(multipartFile, "pms-gitlink", null);
|
||||
forgeFileIdentifierList.add(sysFileInfo.getFileIdentifier());
|
||||
}
|
||||
return forgeFileIdentifierList;
|
||||
} catch (IOException e) {
|
||||
logger.error("上传本地文件到Forge失败{}", e.getMessage());
|
||||
throw new ServiceException("上传本地文件到Forge失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String downloadFileByUrl(String fileUrl, String type, String hierarchy) {
|
||||
String fileIdentifier = genFileIdentifier();
|
||||
try {
|
||||
String fileName = fileUrl.substring(fileUrl.lastIndexOf('/') + 1);
|
||||
Path localPath = Paths.get(localFilePath);
|
||||
// 下载目录
|
||||
String datePath = DateUtils.datePath();
|
||||
Path downloadPath = localPath
|
||||
.resolve(type)
|
||||
.resolve(hierarchy)
|
||||
.resolve(datePath);
|
||||
Path packagedFilePath = downloadPath.resolve(fileName);
|
||||
org.apache.commons.io.FileUtils.copyURLToFile(new URL(fileUrl), packagedFilePath.toFile());
|
||||
File downloadFile = packagedFilePath.toFile();
|
||||
if (!downloadFile.exists()) {
|
||||
throw new ServiceException("下载文件时出现异常");
|
||||
}
|
||||
String filePath = EscapeUtil.removeExtraSlashOfUrl("/" + type + "/" + hierarchy + "/" + datePath + "/" + fileName);
|
||||
SysFileInfo sysFileInfo = new SysFileInfo(fileIdentifier, downloadFile, filePath);
|
||||
insertSysFileInfo(sysFileInfo);
|
||||
} catch (IOException e) {
|
||||
throw new ServiceException("下载文件失败");
|
||||
}
|
||||
return fileIdentifier;
|
||||
}
|
||||
|
||||
private void fileDownload(SysFileInfo sysFileInfo, HttpServletResponse response) {
|
||||
try {
|
||||
String fileName = sysFileInfo.getFileOriginName();
|
||||
|
|
|
|||
|
|
@ -3,15 +3,18 @@ package com.microservices.pms.common.controller;
|
|||
import com.microservices.common.core.utils.html.EscapeUtil;
|
||||
import com.microservices.common.core.web.controller.BaseController;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.common.log.annotation.Log;
|
||||
import com.microservices.common.log.enums.BusinessType;
|
||||
import com.microservices.pms.product.domain.vo.ProductUserReqInputVo;
|
||||
import com.microservices.pms.product.service.IPmsProductRequirementService;
|
||||
import com.microservices.pms.specialArea.service.SoftwareFactStatisticsServiceImpl;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
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.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @author otto
|
||||
|
|
@ -27,7 +30,9 @@ public class OpenController extends BaseController {
|
|||
|
||||
@Autowired
|
||||
private SoftwareFactStatisticsServiceImpl softwareFactStatisticsService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private IPmsProductRequirementService pmsProductRequirementService;
|
||||
/**
|
||||
* 查询项目管理企业列表
|
||||
*/
|
||||
|
|
@ -39,6 +44,18 @@ public class OpenController extends BaseController {
|
|||
);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取指定组织的项目研发状态")
|
||||
@GetMapping("/{enterpriseIdentifier}/specialArea/softwareFact/statis/projectSituation")
|
||||
public AjaxResult theEnterpriseProjectSituation(@PathVariable String enterpriseIdentifier) {
|
||||
return AjaxResult.success(softwareFactStatisticsService.projectSituation(enterpriseIdentifier));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取指定组织的产品里程碑状态")
|
||||
@GetMapping("/{enterpriseIdentifier}/specialArea/softwareFact/statis/productPlanSituation")
|
||||
public AjaxResult theEnterpriseProductPlanSituation(@PathVariable String enterpriseIdentifier) {
|
||||
return AjaxResult.success(softwareFactStatisticsService.productPlanSituation(enterpriseIdentifier));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "今日工作态势")
|
||||
@GetMapping("/specialArea/softwareFact/statis/todayWorkSituation")
|
||||
public AjaxResult todayWorkSituation(){
|
||||
|
|
@ -57,4 +74,16 @@ public class OpenController extends BaseController {
|
|||
return AjaxResult.success(softwareFactStatisticsService.projectSituation());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增需求
|
||||
*/
|
||||
@Log(title = "需求", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/{enterpriseIdentifier}/productUserRequirement")
|
||||
@ApiOperation(value = "新增需求")
|
||||
public AjaxResult add(@PathVariable String enterpriseIdentifier,
|
||||
@RequestBody @Validated ProductUserReqInputVo productUserReqInputVo) {
|
||||
productUserReqInputVo.setEnterpriseIdentifier(enterpriseIdentifier);
|
||||
return success(pmsProductRequirementService.insertUserReqWithoutAuth(productUserReqInputVo));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ public class PmsCommonAsyncServiceImpl implements IPmsCommonAsyncService {
|
|||
List<String> tagIds = new ArrayList<>(Arrays.asList(tagIdsStr.split(",")));
|
||||
tagIds.remove(tagIdStr);
|
||||
pmsProductRequirement.setTags(String.join(",", tagIds));
|
||||
pmsProductRequirementService.updatePmsProductRequirement(pmsProductRequirement);
|
||||
pmsProductRequirementService.updateRequirement(pmsProductRequirement);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.microservices.pms.dashboard.controller;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.microservices.common.core.domain.R;
|
||||
import com.microservices.common.core.utils.StringUtils;
|
||||
import com.microservices.common.core.utils.bean.BeanUtils;
|
||||
import com.microservices.common.core.web.controller.BaseController;
|
||||
|
|
@ -9,28 +10,33 @@ import com.microservices.common.core.web.page.GenericsTableDataInfo;
|
|||
import com.microservices.common.security.utils.SecurityUtils;
|
||||
import com.microservices.pms.dashboard.domain.vo.MyDashboardVo;
|
||||
import com.microservices.pms.dashboard.domain.vo.MyProjectIssuesSearchVo;
|
||||
import com.microservices.pms.dashboard.domain.vo.MyTodoProjectIssuesSearchVo;
|
||||
import com.microservices.pms.product.domain.PmsProduct;
|
||||
import com.microservices.pms.product.domain.PmsProductRequirement;
|
||||
import com.microservices.pms.product.domain.vo.PmsProductSearchVo;
|
||||
import com.microservices.pms.product.domain.PmsProductStatus;
|
||||
import com.microservices.pms.product.domain.enums.ProductReqStatus;
|
||||
import com.microservices.pms.product.domain.vo.*;
|
||||
import com.microservices.pms.product.service.IPmsProductPlanService;
|
||||
import com.microservices.pms.product.service.IPmsProductRequirementService;
|
||||
import com.microservices.pms.product.service.IPmsProductService;
|
||||
import com.microservices.pms.product.service.IPmsProductStatusService;
|
||||
import com.microservices.pms.project.domain.PmsProject;
|
||||
import com.microservices.pms.project.domain.vo.*;
|
||||
import com.microservices.pms.project.service.IPmsProjectService;
|
||||
import com.microservices.pms.project.service.IPmsProjectSprintService;
|
||||
import com.microservices.pms.project.service.PmsProjectIssuesService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
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;
|
||||
|
||||
import static com.microservices.pms.utils.PmsConstants.PRODUCT_PLAN_CLOSED_STATUS_NAME;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/{enterpriseIdentifier}/dashboard")
|
||||
|
|
@ -53,6 +59,12 @@ public class PmsDashboardController extends BaseController {
|
|||
@Autowired
|
||||
private IPmsProductService pmsProductService;
|
||||
|
||||
@Autowired
|
||||
private IPmsProductPlanService pmsProductPlanService;
|
||||
|
||||
@Autowired
|
||||
private IPmsProductStatusService pmsProductStatusService;
|
||||
|
||||
|
||||
/**
|
||||
* 我的工作台统计信息
|
||||
|
|
@ -73,8 +85,13 @@ public class PmsDashboardController extends BaseController {
|
|||
PmsProductRequirement pmsProductRequirement = new PmsProductRequirement();
|
||||
pmsProductRequirement.setProductIdentifierList(pmsProductList.stream().map(PmsProduct::getProductIdentifier).collect(Collectors.toList()));
|
||||
pmsProductRequirement.setCreateBy(SecurityUtils.getUsername());
|
||||
Integer requirementCount = pmsProductRequirementService.selectPmsProductRequirementCount(pmsProductRequirement);
|
||||
Integer requirementCount = pmsProductRequirementService.selectProductReqSpecsCount(pmsProductRequirement);
|
||||
myDashboardVo.setProductRequirementCount(requirementCount);
|
||||
|
||||
long assignedMeProductCount = pmsProductList.stream()
|
||||
.filter(pmsProduct -> pmsProduct.getProductAssigneeGitlinkIds().contains(String.valueOf(SecurityUtils.getGitlinkUserId())))
|
||||
.count();
|
||||
myDashboardVo.setAssignedMeProductCount((int) assignedMeProductCount);
|
||||
}
|
||||
return success(myDashboardVo);
|
||||
}
|
||||
|
|
@ -85,16 +102,13 @@ public class PmsDashboardController extends BaseController {
|
|||
@GetMapping("/myProjectIssues")
|
||||
@ApiOperation(value = "我的工作项")
|
||||
public AjaxResult myProjectIssues(MyProjectIssuesSearchVo myProjectIssuesSearchVo) {
|
||||
PmsProjectIssuesSearchVo pmsProjectIssuesSearchVo = new PmsProjectIssuesSearchVo();
|
||||
BeanUtils.copyProperties(myProjectIssuesSearchVo, pmsProjectIssuesSearchVo);
|
||||
|
||||
List<PmsProject> projectList = pmsProjectService.selectPmsProjectList(new PmsProject());
|
||||
if(projectList.isEmpty()){
|
||||
return success();
|
||||
}
|
||||
pmsProjectIssuesSearchVo.setPmProjectIds(StringUtils.join(projectList.stream().map(PmsProject::getId).toArray(), ","));
|
||||
// 不包含周报
|
||||
pmsProjectIssuesSearchVo.setPmIssueTypes("1,2,3");
|
||||
JSONObject result = pmsProjectIssuesService.selectPmsProjectIssuesList(pmsProjectIssuesSearchVo);
|
||||
myProjectIssuesSearchVo.setPmProjectIds(StringUtils.join(projectList.stream().map(PmsProject::getId).toArray(), ","));
|
||||
JSONObject result = pmsProjectIssuesService.selectMyPmsProjectIssuesList(myProjectIssuesSearchVo);
|
||||
return success(result);
|
||||
}
|
||||
|
||||
|
|
@ -108,6 +122,24 @@ public class PmsDashboardController extends BaseController {
|
|||
return pmsProjectService.selectPmsProjectList(pmsProjectSearchVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的项目-项目情况统计
|
||||
*/
|
||||
@ApiOperation(value = "我的项目-项目统计")
|
||||
@GetMapping("/myProjects/statistics")
|
||||
public AjaxResult myProjectStatistics(@ApiParam("项目id") @RequestParam Long pmProjectId) {
|
||||
return success(pmsProjectService.getMyProjectStatistics(pmProjectId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的仓库-仓库情况统计
|
||||
*/
|
||||
@ApiOperation(value = "我的仓库-仓库情况统计")
|
||||
@GetMapping("/myRepositories/statistics")
|
||||
public AjaxResult myRepositoriesStatistics(@ApiParam("仓库id") @RequestParam Long repositoryId) {
|
||||
return success(pmsProjectService.getMyRepositoriesStatistics(repositoryId));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 我的迭代
|
||||
|
|
@ -128,4 +160,176 @@ public class PmsDashboardController extends BaseController {
|
|||
pmsProjectSprintSearchVo.setPmsProjectIds(StringUtils.join(projectList.stream().map(PmsProject::getId).toArray(), ","));
|
||||
return pmsProjectSprintService.selectAllPmsProjectSprintList(pmsProjectSprintSearchVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的待办
|
||||
*/
|
||||
@GetMapping("/todo")
|
||||
@ApiOperation(value = "我的待办")
|
||||
public AjaxResult todoProjectIssues(MyTodoProjectIssuesSearchVo todoProjectIssuesSearchVo) {
|
||||
List<PmsProject> projectList = pmsProjectService.selectPmsProjectList(new PmsProject());
|
||||
if(projectList.isEmpty()){
|
||||
return success();
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的产品
|
||||
*/
|
||||
@ApiOperation(value = "我的产品")
|
||||
@GetMapping("/myProduct")
|
||||
public GenericsTableDataInfo<PmsProductStatVo> myProduct(@PathVariable String enterpriseIdentifier,
|
||||
@Validated PmsProductSearchVo pmsProductSearchVo) {
|
||||
startPage();
|
||||
pmsProductSearchVo.setPmsEnterpriseIdentifier(enterpriseIdentifier);
|
||||
//获取组织下所有的产品信息
|
||||
GenericsTableDataInfo<PmsProductDataVo> productsInfo = pmsProductService.selectPmsProductPageList(pmsProductSearchVo);
|
||||
List<PmsProductDataVo> rows = productsInfo.getRows();
|
||||
|
||||
// 统计需求数量
|
||||
List<PmsProductStatVo> statVos = rows.stream().map(e -> {
|
||||
PmsProductStatVo statVo = new PmsProductStatVo();
|
||||
String pmsProductIdentifier = e.getProductIdentifier();
|
||||
Integer requirementCount = pmsProductRequirementService.countByIdentifierAndStatus(pmsProductIdentifier, getUserReqList());
|
||||
Integer reqSpecsCount = pmsProductRequirementService.countByIdentifierAndStatus(pmsProductIdentifier, getTotalReqSpecsList());
|
||||
BeanUtils.copyProperties(e, statVo);
|
||||
statVo.setReqSpecsCount(reqSpecsCount);
|
||||
statVo.setUserReqCount(requirementCount);
|
||||
return statVo;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
GenericsTableDataInfo<PmsProductStatVo> result = new GenericsTableDataInfo<>();
|
||||
result.setRows(statVos);
|
||||
result.setTotal(productsInfo.getTotal());
|
||||
return result;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "我的产品数据统计-原始需求统计")
|
||||
@ApiImplicitParam(name = "productIdentifier", value = "产品标识", paramType = "query", dataType = "String")
|
||||
@GetMapping("/userRequirementStat")
|
||||
public R<PmsRequirementStatResVo> UserRequirementStat(String productIdentifier){
|
||||
PmsRequirementStatResVo pmsRequirementStatResVo = buildPmsRequirementStatResVo(
|
||||
productIdentifier,
|
||||
getUserReqList(),
|
||||
ProductReqStatus.REVIEWED_USER_REQ);
|
||||
|
||||
return R.ok(pmsRequirementStatResVo);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "我的产品数据统计-需求统计")
|
||||
@ApiImplicitParam(name = "productIdentifier", value = "产品标识", paramType = "query", dataType = "String")
|
||||
@GetMapping("/productRequirementSpecsStat")
|
||||
public R<PmsRequirementStatResVo> ProductRequirementSpecsStat(String productIdentifier){
|
||||
PmsRequirementStatResVo pmsRequirementStatResVo = buildPmsRequirementStatResVo(
|
||||
productIdentifier,
|
||||
getReqSpecsList(),
|
||||
ProductReqStatus.COMPLETED_REQ_SPECS);
|
||||
return R.ok(pmsRequirementStatResVo);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "我的产品数据统计-里程碑状态分布统计")
|
||||
@ApiImplicitParam(name = "productIdentifier", value = "产品标识", paramType = "query", dataType = "String")
|
||||
@GetMapping("/milestoneStatusStat")
|
||||
public R<PmsRequirementStatResVo> milestoneStatusStat(String productIdentifier){
|
||||
Map<String, Integer> status2NumMap = pmsProductPlanService.countPmsProductPlanGroupByStatus(productIdentifier)
|
||||
.stream().collect(Collectors.toMap(EnumCommonVo::getKey, ReqStatusStatVo::getNum));
|
||||
PmsProductStatus pmsProductStatus = new PmsProductStatus();
|
||||
pmsProductStatus.setType(1);
|
||||
List<PmsTypeDataVo> pmsTypeDataVos = pmsProductStatusService.selectPmsProductStatusList(pmsProductStatus);
|
||||
List<ReqStatusStatVo> statusStatVos = pmsTypeDataVos.stream().filter(e -> !PRODUCT_PLAN_CLOSED_STATUS_NAME.equals(e.getName())).map(e -> {
|
||||
ReqStatusStatVo vo = new ReqStatusStatVo();
|
||||
vo.setKey(String.valueOf(e.getId()));
|
||||
vo.setNum(status2NumMap.getOrDefault(String.valueOf(e.getId()), 0));
|
||||
vo.setName(e.getName());
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
PmsRequirementStatResVo resVo = new PmsRequirementStatResVo();
|
||||
resVo.setPmsProductStatVos(statusStatVos);
|
||||
resVo.setRatio(0);
|
||||
return R.ok(resVo);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取 统计饼图所需的需求状态list
|
||||
* @return 需求状态list
|
||||
*/
|
||||
private List<String> getReqSpecsList() {
|
||||
return Stream.of(ProductReqStatus.PENDING_REVIEW_REQ_SPECS.getKey(),
|
||||
ProductReqStatus.PLANNED_REQ_SPECS.getKey(),
|
||||
ProductReqStatus.REJECTED_REQ_SPECS.getKey(),
|
||||
ProductReqStatus.REVIEWED_REQ_SPECS.getKey(),
|
||||
ProductReqStatus.COMPLETED_REQ_SPECS.getKey())
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取Count总数时,需求的状态list
|
||||
* @return 需求状态list
|
||||
*/
|
||||
private List<String> getTotalReqSpecsList() {
|
||||
return Stream.of(ProductReqStatus.PENDING_REVIEW_REQ_SPECS.getKey(),
|
||||
ProductReqStatus.PLANNED_REQ_SPECS.getKey(),
|
||||
ProductReqStatus.REJECTED_REQ_SPECS.getKey(),
|
||||
ProductReqStatus.REVIEWED_REQ_SPECS.getKey(),
|
||||
ProductReqStatus.COMPLETED_REQ_SPECS.getKey(),
|
||||
ProductReqStatus.CHANGING_REQ_SPECS.getKey())
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 原始需求状态list
|
||||
* @return 原始需求状态list
|
||||
*/
|
||||
private List<String> getUserReqList() {
|
||||
return Stream.of(ProductReqStatus.PENDING_REVIEW_USER_REQ.getKey(),
|
||||
ProductReqStatus.REJECTED_USER_REQ.getKey(),
|
||||
ProductReqStatus.REVIEWED_USER_REQ.getKey())
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 拼接统计返回结果
|
||||
* @param productIdentifier 产品标识
|
||||
* @param statusList 状态列表
|
||||
* @param productReqStatus x
|
||||
* @return
|
||||
*/
|
||||
private PmsRequirementStatResVo buildPmsRequirementStatResVo(String productIdentifier,List<String> statusList, ProductReqStatus productReqStatus) {
|
||||
Map<String, Integer> status2NumMap = pmsProductRequirementService
|
||||
.selectReqCountGroupByStatus(productIdentifier, statusList)
|
||||
.stream().collect(Collectors.toMap(EnumCommonVo::getKey, ReqStatusStatVo::getNum));
|
||||
|
||||
//组装各个状态的数量
|
||||
List<ReqStatusStatVo> statusStatVos = statusList.stream().map(e -> {
|
||||
ReqStatusStatVo vo = new ReqStatusStatVo();
|
||||
vo.setKey(e);
|
||||
vo.setNum(status2NumMap.getOrDefault(e, 0));
|
||||
vo.setName(ProductReqStatus.getByKey(e).getName());
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
PmsRequirementStatResVo resVo = new PmsRequirementStatResVo();
|
||||
resVo.setPmsProductStatVos(statusStatVos);
|
||||
resVo.setRatio(0);
|
||||
//计算 各自的比率
|
||||
int sum = statusStatVos.stream().mapToInt(ReqStatusStatVo::getNum).sum();
|
||||
if (sum > 0) {
|
||||
Integer completedReqSpecsCount = status2NumMap.getOrDefault(productReqStatus.getKey(), 0);
|
||||
double ratioDouble = (double) completedReqSpecsCount / sum * 100;
|
||||
int ratio = (int) Math.round(ratioDouble);
|
||||
resVo.setRatio(ratio);
|
||||
}
|
||||
return resVo;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,4 +11,7 @@ public class MyDashboardVo extends IssueTypeTotalCountVo {
|
|||
|
||||
@ApiModelProperty(value = "产品需求数")
|
||||
private int productRequirementCount;
|
||||
|
||||
@ApiModelProperty(value = "我负责的产品数")
|
||||
private int assignedMeProductCount;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@ import lombok.Data;
|
|||
@ApiModel("我的工作项搜索对象")
|
||||
public class MyProjectIssuesSearchVo {
|
||||
|
||||
@ApiModelProperty(value = "疑修类型,all 全部 opened 开启中 closed 已关闭", required = true)
|
||||
@ApiModelProperty(value = "疑修类型,all 全部 opened 开启中 closed 已关闭")
|
||||
private String category;
|
||||
|
||||
@ApiModelProperty(value = "参与类型,all 全部 aboutme 关于我的 authoredme 我创建的 assignedme 我负责的 atme @我的", required = true)
|
||||
@ApiModelProperty(value = "参与类型,all 全部 aboutme 关于我的 authoredme 我创建的 assignedme 我负责的 atme @我的")
|
||||
private String participantCategory;
|
||||
|
||||
@ApiModelProperty(value = "工作项名称搜索关键词")
|
||||
|
|
@ -30,6 +30,9 @@ public class MyProjectIssuesSearchVo {
|
|||
private String limit;
|
||||
|
||||
@ApiModelProperty(value = "按pmProjectId集合查询,逗号隔开", hidden = true)
|
||||
private String pmsProjectIds;
|
||||
private String pmProjectIds;
|
||||
|
||||
@ApiModelProperty(value = "工作项类型:计划1 任务2 缺陷3,多个用逗号隔开", required = true)
|
||||
private String pmIssueTypes;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
package com.microservices.pms.dashboard.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel("我的待办工作项搜索对象")
|
||||
public class MyTodoProjectIssuesSearchVo {
|
||||
|
||||
@ApiModelProperty(value = "日期,格式:yyyy-MM-dd,示例值:2024-12-11")
|
||||
private String date;
|
||||
|
||||
@ApiModelProperty(value = "工作项名称搜索关键词")
|
||||
private String keyword;
|
||||
|
||||
@ApiModelProperty(value = "排序方式: issues.updated_on 更新时间 issues.created_on 创建时间 issue_priorities.position 优先级")
|
||||
private String sortBy;
|
||||
|
||||
@ApiModelProperty(value = "排序方向:asc 正序 desc 倒序")
|
||||
private String sortDirection;
|
||||
|
||||
@ApiModelProperty(value = "页码", required = true)
|
||||
private String page;
|
||||
|
||||
@ApiModelProperty(value = "分页数", required = true)
|
||||
private String limit;
|
||||
|
||||
@ApiModelProperty(value = "按pmProjectId集合查询,逗号隔开", hidden = true)
|
||||
private String pmProjectIds;
|
||||
|
||||
@ApiModelProperty(value = "工作项类型:计划1 任务2 缺陷3,多个用逗号隔开")
|
||||
private String pmIssueTypes;
|
||||
|
||||
}
|
||||
|
|
@ -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()));
|
||||
}
|
||||
|
||||
|
|
@ -95,8 +90,7 @@ public class PmsDocumentController extends BaseController
|
|||
@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,11 @@ 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) {
|
||||
return toAjax(pmsDocumentService.deletePmsDocumentByIds(ids, enterpriseId, pmsProjectId));
|
||||
}
|
||||
|
||||
|
|
@ -131,8 +123,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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,10 +36,10 @@ public class PmsDocumentUserFavoriteController extends BaseController
|
|||
* 查询用户收藏文档列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public GenericsTableDataInfo<PmsDocumentVo> list(PmsDocumentFavoriteSearchVo pmsDocumentFavoriteSearchVo)
|
||||
public GenericsTableDataInfo<PmsDocumentVo> list(@PathVariable String enterpriseIdentifier, PmsDocumentFavoriteSearchVo pmsDocumentFavoriteSearchVo)
|
||||
{
|
||||
|
||||
return pmsDocumentUserFavoriteService.selectPmsDocumentUserFavoriteList(pmsDocumentFavoriteSearchVo);
|
||||
return pmsDocumentUserFavoriteService.selectPmsDocumentUserFavoriteList(enterpriseIdentifier, pmsDocumentFavoriteSearchVo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.microservices.pms.document.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.microservices.common.core.annotation.Excel;
|
||||
import com.microservices.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
|
|
@ -56,6 +57,7 @@ public class PmsDocument extends BaseEntity
|
|||
|
||||
/** 权限 1-私有 2-全员读 3-全员读写 */
|
||||
@Excel(name = "权限 1-私有 2-全员读 3-全员读写")
|
||||
@JsonIgnore
|
||||
private Integer permission;
|
||||
|
||||
public void setId(Long id)
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public class PmsDocumentDetailVo
|
|||
private Integer isTop;
|
||||
|
||||
/** 权限 1-私有 2-全员读 3-全员读写 */
|
||||
@ApiModelProperty(value = "权限 1-私有 2-全员读 3-全员读写")
|
||||
@ApiModelProperty(value = "权限 1-私有 2-全员读 3-全员读写", hidden = true)
|
||||
private Integer permission;
|
||||
|
||||
@ApiModelProperty(value = "文档创建者")
|
||||
|
|
|
|||
|
|
@ -30,4 +30,8 @@ public class PmsDocumentFavoriteSearchVo extends BaseEntity
|
|||
@JsonIgnore
|
||||
@ApiModelProperty(value = "用户id", hidden = true)
|
||||
private Long currentUserId;
|
||||
|
||||
@JsonIgnore
|
||||
@ApiModelProperty(value = "企业id", hidden = true)
|
||||
private Long pmsEnterpriseId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,9 +60,8 @@ public class PmsDocumentInputVo
|
|||
private Integer isTop;
|
||||
|
||||
/** 权限 1-私有 2-全员读 3-全员读写 */
|
||||
@ApiModelProperty(value = "权限 1-私有 2-全员读 3-全员读写", required = true)
|
||||
@NotNull
|
||||
private Integer permission;
|
||||
@ApiModelProperty(value = "权限 1-私有 2-全员读 3-全员读写", hidden = true)
|
||||
private Integer permission = 3;
|
||||
|
||||
public PmsDocument toPmsDocument() {
|
||||
PmsDocument pmsDocument = new PmsDocument();
|
||||
|
|
|
|||
|
|
@ -47,8 +47,8 @@ public class PmsDocumentUpdateVo
|
|||
private Integer isTop;
|
||||
|
||||
/** 权限 1-私有 2-全员读 3-全员读写 */
|
||||
@ApiModelProperty(value = "权限 1-私有 2-全员读 3-全员读写")
|
||||
private Integer permission;
|
||||
@ApiModelProperty(value = "权限 1-私有 2-全员读 3-全员读写", hidden = true)
|
||||
private Integer permission = 3;
|
||||
|
||||
public PmsDocument toPmsDocument() {
|
||||
PmsDocument pmsDocument = new PmsDocument();
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public class PmsDocumentVo
|
|||
private Integer isTop;
|
||||
|
||||
/** 权限 1-私有 2-全员读 3-全员读写 */
|
||||
@ApiModelProperty(value = "权限 1-私有 2-全员读 3-全员读写")
|
||||
@ApiModelProperty(value = "权限 1-私有 2-全员读 3-全员读写", hidden = true)
|
||||
private Integer permission;
|
||||
|
||||
@ApiModelProperty(value = "文档创建者")
|
||||
|
|
@ -72,4 +72,7 @@ public class PmsDocumentVo
|
|||
|
||||
@ApiModelProperty(value = "是否被收藏")
|
||||
private Boolean isFavour;
|
||||
|
||||
@ApiModelProperty(value = "是否存在子文件夹")
|
||||
private Boolean hasChildDir=false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@ public class PmsFileTypeDocumentInputVo
|
|||
private String[] attachmentIdentifiers;
|
||||
|
||||
/** 权限 1-私有 2-全员读 3-全员读写 */
|
||||
@ApiModelProperty(value = "权限 1-私有 2-全员读 3-全员读写", required = true)
|
||||
@NotNull
|
||||
private Integer permission;
|
||||
@ApiModelProperty(value = "权限 1-私有 2-全员读 3-全员读写", hidden = true)
|
||||
private Integer permission = 3;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,11 +79,13 @@ public interface PmsDocumentMapper
|
|||
|
||||
int countChildDocByIds(@Param("ids") Long[] ids);
|
||||
|
||||
int countDocumentByNameAndTypeAndParenId(@Param("name") String name, @Param("docType") Integer docType, @Param("parenId") Long parenId, @Param("pmsProjectId") Long pmsProjectId);
|
||||
int countDocumentByNameAndTypeAndParenId(@Param("name") String name, @Param("docType") Integer docType, @Param("parenId") Long parenId, @Param("pmsProjectId") Long pmsProjectId, @Param("pmsEnterpriseId") Long pmsEnterpriseId);
|
||||
|
||||
int deletePmsDocumentByIdWithoutAuthCheck(@Param("docId") Long docId);
|
||||
|
||||
Long[] selectLinkedRepoIds(@Param("enterpriseId") Long enterpriseId, @Param("projectId") Long projectId);
|
||||
|
||||
List<PmsDocument> selectPmsFavoriteDocumentList(PmsDocumentFavoriteSearchVo pmsDocumentFavoriteSearchVo);
|
||||
|
||||
boolean hasChildDirById(@Param("documentId") Long documentId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.microservices.common.core.web.page.GenericsTableDataInfo;
|
|||
import com.microservices.pms.document.domain.PmsDocument;
|
||||
import com.microservices.pms.document.domain.vo.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -93,4 +94,6 @@ public interface IPmsDocumentService
|
|||
* @return
|
||||
*/
|
||||
JSONObject getOptionalWikiRepoList(OptionalWikiReposSearchVo optionalWikiReposSearchVo);
|
||||
|
||||
void downloadDoc(HttpServletResponse response, String enterpriseIdentifier, Long docId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,5 +29,5 @@ public interface IPmsDocumentUserFavoriteService
|
|||
*/
|
||||
public int deletePmsDocumentUserFavoriteByDocId(Long documentId);
|
||||
|
||||
GenericsTableDataInfo<PmsDocumentVo> selectPmsDocumentUserFavoriteList(PmsDocumentFavoriteSearchVo pmsDocumentFavoriteSearchVo);
|
||||
GenericsTableDataInfo<PmsDocumentVo> selectPmsDocumentUserFavoriteList(String enterpriseIdentifier, PmsDocumentFavoriteSearchVo pmsDocumentFavoriteSearchVo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.microservices.common.core.constant.HttpStatus;
|
|||
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.core.utils.file.FileUtils;
|
||||
import com.microservices.common.core.web.page.Breadcrumb;
|
||||
import com.microservices.common.core.web.page.GenericsTableDataInfo;
|
||||
import com.microservices.common.httpClient.util.GitLinkRequestHelper;
|
||||
|
|
@ -21,6 +22,7 @@ import com.microservices.pms.enums.PmsDocumentType;
|
|||
import com.microservices.pms.project.mapper.PmsProjectRepositoryMapper;
|
||||
import com.microservices.pms.project.service.IPmsProjectService;
|
||||
import com.microservices.pms.utils.PmsGitLinkRequestUrl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
|
@ -28,7 +30,12 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.net.URISyntaxException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
|
@ -38,13 +45,13 @@ import static com.microservices.common.httpClient.constant.GitLinkConstants.DATA
|
|||
|
||||
/**
|
||||
* 项目管理-文档库Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author wanjia
|
||||
* @date 2024-01-08
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class PmsDocumentServiceImpl implements IPmsDocumentService
|
||||
{
|
||||
public class PmsDocumentServiceImpl implements IPmsDocumentService {
|
||||
private static final Logger logger = LoggerFactory.getLogger(PmsDocumentServiceImpl.class);
|
||||
@Resource
|
||||
private PmsDocumentMapper pmsDocumentMapper;
|
||||
|
|
@ -69,13 +76,12 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
|||
|
||||
/**
|
||||
* 查询项目管理-文档库
|
||||
*
|
||||
*
|
||||
* @param id 项目管理-文档库主键
|
||||
* @return 项目管理-文档库
|
||||
*/
|
||||
@Override
|
||||
public PmsDocument selectPmsDocumentByIdAndEnterpriseId(Long id, Long enterpriseId)
|
||||
{
|
||||
public PmsDocument selectPmsDocumentByIdAndEnterpriseId(Long id, Long enterpriseId) {
|
||||
boolean isEnterpriseAdmin = pmsCommonService.hasDocsManageRole(enterpriseId);
|
||||
return pmsDocumentMapper.selectPmsDocumentByIdAndEnterpriseId(id, enterpriseId, isEnterpriseAdmin, SecurityUtils.getUsername());
|
||||
}
|
||||
|
|
@ -97,13 +103,12 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
|||
|
||||
/**
|
||||
* 查询项目管理-文档库列表
|
||||
*
|
||||
*
|
||||
* @param pmsDocument 项目管理-文档库
|
||||
* @return 项目管理-文档库
|
||||
*/
|
||||
@Override
|
||||
public List<PmsDocument> selectPmsDocumentList(PmsDocument pmsDocument)
|
||||
{
|
||||
public List<PmsDocument> selectPmsDocumentList(PmsDocument pmsDocument) {
|
||||
checkAuthAndReturnAdminStatus(pmsDocument.getPmsEnterpriseId());
|
||||
return pmsDocumentMapper.selectPmsDocumentList(pmsDocument);
|
||||
}
|
||||
|
|
@ -116,7 +121,7 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
|||
pmsDocumentSearchVo.setCurrentUserName(currentUserName);
|
||||
startPage();
|
||||
List<PmsDocument> pmsDocumentList = pmsDocumentMapper.selectPmsDocumentListBySearchInput(pmsDocumentSearchVo);
|
||||
GenericsTableDataInfo<PmsDocumentVo> page = toPage(pmsDocumentList,this::buildPmsDocumentVo);
|
||||
GenericsTableDataInfo<PmsDocumentVo> page = toPage(pmsDocumentList, this::buildPmsDocumentVo);
|
||||
//构建面包屑列表
|
||||
if (pmsDocumentSearchVo.getParentId() != 0) {
|
||||
List<Breadcrumb> breadcrumbs = buildBreadcrumbs(pmsDocumentSearchVo.getParentId());
|
||||
|
|
@ -132,25 +137,57 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
|||
PmsEnterprise pmsEnterprise = pmsEnterpriseService.selectPmsEnterpriseById(enterpriseId);
|
||||
Map<String, String> queryParams = buildRepoListQueryParams(optionalWikiReposSearchVo);
|
||||
try {
|
||||
return gitLinkRequestHelper.doGet(PmsGitLinkRequestUrl.GET_ORGANIZATION_REPO_LIST(pmsEnterprise.getEnterpriseIdentifier(), queryParams));
|
||||
return gitLinkRequestHelper.doGet(PmsGitLinkRequestUrl.GET_ORGANIZATION_REPO_LIST(pmsEnterprise.getEnterpriseIdentifier(), queryParams));
|
||||
} catch (URISyntaxException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void downloadDoc(HttpServletResponse response, String enterpriseIdentifier, Long docId) {
|
||||
PmsEnterprise enterprise = pmsEnterpriseService.selectPmsEnterpriseByIdentifier(enterpriseIdentifier);
|
||||
PmsDocument pmsDocument = selectPmsDocumentByIdAndEnterpriseId(docId, enterprise.getId());
|
||||
if (!pmsDocument.getDocType().equals(PmsDocumentType.DOCUMENT.getKey())) {
|
||||
throw new ServiceException("当前接口仅允许下载文档类型");
|
||||
}
|
||||
Path tempFilePath = null;
|
||||
try {
|
||||
String docFileName = pmsDocument.getName() + ".md";
|
||||
FileUtils.setAttachmentResponseHeader(response, docFileName);
|
||||
// 创建临时文件
|
||||
tempFilePath = Files.createTempFile(pmsDocument.getName(), ".md");
|
||||
String content = "";
|
||||
if (pmsDocument.getContent() != null) {
|
||||
content = pmsDocument.getContent();
|
||||
}
|
||||
Files.write(tempFilePath, content.getBytes(StandardCharsets.UTF_8));
|
||||
FileUtils.writeBytes(tempFilePath.toString(), response.getOutputStream());
|
||||
} catch (IOException e) {
|
||||
log.error("文档下载失败:{}", e.getMessage());
|
||||
throw new ServiceException("文档下载失败");
|
||||
} finally {
|
||||
if (tempFilePath != null) {
|
||||
try {
|
||||
Files.deleteIfExists(tempFilePath);
|
||||
} catch (IOException e) {
|
||||
log.error("删除临时文件失败:{}", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增项目管理-文档库
|
||||
*
|
||||
*
|
||||
* @param pmsDocument 项目管理-文档库
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertPmsDocument(PmsDocument pmsDocument)
|
||||
{
|
||||
public int insertPmsDocument(PmsDocument pmsDocument) {
|
||||
checkPmsProjectById(pmsDocument.getPmsProjectId());
|
||||
checkAuthAndReturnAdminStatus(pmsDocument.getPmsEnterpriseId());
|
||||
String currentUserName = SecurityUtils.getUsername();
|
||||
checkForSameDocumentExistence(pmsDocument.getName(), pmsDocument.getDocType(), pmsDocument.getParentId(), pmsDocument.getPmsProjectId());
|
||||
checkForSameDocumentExistence(pmsDocument.getName(), pmsDocument.getDocType(), pmsDocument.getParentId(), pmsDocument.getPmsProjectId(), pmsDocument.getPmsEnterpriseId());
|
||||
pmsDocument.setCreateTime(DateUtils.getNowDate());
|
||||
pmsDocument.setCreateBy(currentUserName);
|
||||
return pmsDocumentMapper.insertPmsDocument(pmsDocument);
|
||||
|
|
@ -169,13 +206,12 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
|||
|
||||
/**
|
||||
* 修改项目管理-文档库
|
||||
*
|
||||
*
|
||||
* @param pmsDocument 项目管理-文档库
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updatePmsDocument(PmsDocument pmsDocument)
|
||||
{
|
||||
public int updatePmsDocument(PmsDocument pmsDocument) {
|
||||
checkPmsProjectById(pmsDocument.getPmsProjectId());
|
||||
String currentUserName = SecurityUtils.getUsername();
|
||||
boolean isEnterpriseAdmin = checkAuthAndReturnAdminStatus(pmsDocument.getPmsEnterpriseId());
|
||||
|
|
@ -195,8 +231,7 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePmsDocumentByIds(Long[] ids, Long enterpriseId, Long projectId)
|
||||
{
|
||||
public int deletePmsDocumentByIds(Long[] ids, Long enterpriseId, Long projectId) {
|
||||
checkPmsProjectById(projectId);
|
||||
String currentUserName = SecurityUtils.getUsername();
|
||||
boolean isEnterpriseAdmin = checkAuthAndReturnAdminStatus(enterpriseId);
|
||||
|
|
@ -207,13 +242,12 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
|||
|
||||
/**
|
||||
* 删除项目管理-文档库信息
|
||||
*
|
||||
*
|
||||
* @param id 项目管理-文档库主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePmsDocumentById(Long id, Long enterpriseId, Long projectId)
|
||||
{
|
||||
public int deletePmsDocumentById(Long id, Long enterpriseId, Long projectId) {
|
||||
checkPmsProjectById(projectId);
|
||||
String currentUserName = SecurityUtils.getUsername();
|
||||
boolean isEnterpriseAdmin = checkAuthAndReturnAdminStatus(enterpriseId);
|
||||
|
|
@ -231,6 +265,9 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
|||
}
|
||||
pmsDocumentVo.setWikiRepositorySimpleInfo(wikiRepositoryInfo);
|
||||
pmsDocumentVo.setIsFavour(pmsDocumentUserFavoriteMapper.isDocumentInFavorites(SecurityUtils.getUserId(), pmsDocument.getId()));
|
||||
if (PmsDocumentType.DOCUMENT_DIRECTORY.getKey() == pmsDocumentVo.getDocType()) {
|
||||
pmsDocumentVo.setHasChildDir(pmsDocumentMapper.hasChildDirById(pmsDocument.getId()));
|
||||
}
|
||||
return pmsDocumentVo;
|
||||
}
|
||||
|
||||
|
|
@ -303,7 +340,7 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
|||
throw new ServiceException("文件类型的文档名称个数与文件标识个数不匹配");
|
||||
}
|
||||
List<PmsDocument> pmsDocumentList = new ArrayList<>();
|
||||
for (int i=0; i < names.length; i++) {
|
||||
for (int i = 0; i < names.length; i++) {
|
||||
PmsDocument pmsDocument = new PmsDocument();
|
||||
BeanUtils.copyProperties(pmsFileTypeDocumentInputVo, pmsDocument);
|
||||
pmsDocument.setName(names[i]);
|
||||
|
|
@ -311,7 +348,7 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
|||
pmsDocument.setCreateTime(DateUtils.getNowDate());
|
||||
pmsDocument.setUpdateTime(DateUtils.getNowDate());
|
||||
pmsDocument.setCreateBy(currentUserName);
|
||||
checkForSameDocumentExistence(pmsDocument.getName(), pmsDocument.getDocType(), pmsDocument.getParentId(), pmsDocument.getPmsProjectId());
|
||||
checkForSameDocumentExistence(pmsDocument.getName(), pmsDocument.getDocType(), pmsDocument.getParentId(), pmsDocument.getPmsProjectId(), pmsDocument.getPmsEnterpriseId());
|
||||
pmsDocumentList.add(pmsDocument);
|
||||
}
|
||||
return pmsDocumentMapper.batchInsertPmsDocument(pmsDocumentList);
|
||||
|
|
@ -324,8 +361,8 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
|||
}
|
||||
}
|
||||
|
||||
private void checkForSameDocumentExistence(String name, Integer docType, Long parentId, Long pmsProjectId) {
|
||||
if (pmsDocumentMapper.countDocumentByNameAndTypeAndParenId(name, docType, parentId, pmsProjectId) > 0) {
|
||||
private void checkForSameDocumentExistence(String name, Integer docType, Long parentId, Long pmsProjectId, Long pmsEnterpriseId) {
|
||||
if (pmsDocumentMapper.countDocumentByNameAndTypeAndParenId(name, docType, parentId, pmsProjectId, pmsEnterpriseId) > 0) {
|
||||
throw new ServiceException("当前目录已存在同名文档:[%s]", name);
|
||||
}
|
||||
}
|
||||
|
|
@ -373,7 +410,7 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
|||
queryParams.put("pm_project_repository_ids", unlinkedRepoIdsString);
|
||||
}
|
||||
queryParams.put("search", optionalWikiReposSearchVo.getSearch());
|
||||
queryParams.put("page" , String.valueOf(optionalWikiReposSearchVo.getPage()));
|
||||
queryParams.put("page", String.valueOf(optionalWikiReposSearchVo.getPage()));
|
||||
queryParams.put("limit", String.valueOf(optionalWikiReposSearchVo.getLimit()));
|
||||
queryParams.put("sort_by", optionalWikiReposSearchVo.getSortBy());
|
||||
queryParams.put("sort_direction", "desc");
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ import com.microservices.pms.document.domain.vo.PmsDocumentVo;
|
|||
import com.microservices.pms.document.mapper.PmsDocumentMapper;
|
||||
import com.microservices.pms.document.mapper.PmsDocumentUserFavoriteMapper;
|
||||
import com.microservices.pms.document.service.IPmsDocumentUserFavoriteService;
|
||||
import com.microservices.pms.enterprise.service.IPmsEnterpriseService;
|
||||
import com.microservices.pms.enterprise.service.impl.PmsEnterpriseServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
|
@ -36,6 +38,9 @@ public class PmsDocumentUserFavoriteServiceImpl implements IPmsDocumentUserFavor
|
|||
@Autowired
|
||||
private PmsDocumentServiceImpl pmsDocumentService;
|
||||
|
||||
@Autowired
|
||||
private IPmsEnterpriseService pmsEnterpriseService;
|
||||
|
||||
/**
|
||||
* 新增用户收藏文档
|
||||
*
|
||||
|
|
@ -67,8 +72,9 @@ public class PmsDocumentUserFavoriteServiceImpl implements IPmsDocumentUserFavor
|
|||
}
|
||||
|
||||
@Override
|
||||
public GenericsTableDataInfo<PmsDocumentVo> selectPmsDocumentUserFavoriteList(PmsDocumentFavoriteSearchVo pmsDocumentFavoriteSearchVo) {
|
||||
public GenericsTableDataInfo<PmsDocumentVo> selectPmsDocumentUserFavoriteList(String enterpriseIdentifier, PmsDocumentFavoriteSearchVo pmsDocumentFavoriteSearchVo) {
|
||||
pmsDocumentFavoriteSearchVo.setCurrentUserId(SecurityUtils.getUserId());
|
||||
pmsDocumentFavoriteSearchVo.setPmsEnterpriseId(pmsEnterpriseService.selectPmsEnterpriseByIdentifier(enterpriseIdentifier).getId());
|
||||
List<PmsDocument> pmsDocumentList = pmsDocumentMapper.selectPmsFavoriteDocumentList(pmsDocumentFavoriteSearchVo);
|
||||
return toPage(pmsDocumentList,pmsDocumentService::buildPmsDocumentVo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -160,4 +160,15 @@ public class PmsEnterpriseController extends BaseController
|
|||
@ApiParam(name = "gitlinkOrgId", value = "gitlink组织Id") @PathVariable Long gitlinkOrgId) {
|
||||
return genericsSuccess(pmsEnterpriseService.getWorkbenchUrl(gitlinkOrgId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据项目ID查询所属组织标识
|
||||
*/
|
||||
@GetMapping("/getEnterpriseIdentifierByProjectId/{projectId}")
|
||||
@ApiOperation(value = "根据项目ID查询所属组织标识")
|
||||
public GenericsAjaxResult<String> getEnterpriseIdentifierByProjectId(
|
||||
@ApiParam(name = "projectId", value = "项目Id") @PathVariable Long projectId) {
|
||||
return genericsSuccess(pmsEnterpriseService.getEnterpriseByProjectId(projectId).getEnterpriseIdentifier());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,6 +60,8 @@ public interface IPmsEnterpriseService {
|
|||
|
||||
PmsEnterprise selectPmsEnterpriseByIdentifier(String identifier);
|
||||
|
||||
PmsEnterprise selectPmsEnterpriseByIdentifierWithoutAuth(String identifier);
|
||||
|
||||
/**
|
||||
* 获取企业下用户列表
|
||||
*
|
||||
|
|
@ -147,4 +149,7 @@ public interface IPmsEnterpriseService {
|
|||
void increaseOpenEnterpriseProcessCount(Long gitlinkOrgId);
|
||||
|
||||
void decreaseOpenEnterpriseProcessCount(Long gitlinkOrgId);
|
||||
|
||||
|
||||
PmsEnterprise getEnterpriseByProjectId(Long projectId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.alibaba.fastjson2.JSONObject;
|
|||
import com.microservices.common.core.constant.CacheConstants;
|
||||
import com.microservices.common.core.constant.HttpStatus;
|
||||
import com.microservices.common.core.constant.SecurityConstants;
|
||||
import com.microservices.common.core.context.SecurityContextHolder;
|
||||
import com.microservices.common.core.enums.SystemRole;
|
||||
import com.microservices.common.core.exception.ServiceException;
|
||||
import com.microservices.common.core.utils.DateUtils;
|
||||
|
|
@ -28,6 +29,7 @@ import com.microservices.pms.product.domain.vo.PmsProductSearchVo;
|
|||
import com.microservices.pms.product.service.IPmsProductRequirementTagService;
|
||||
import com.microservices.pms.product.service.IPmsProductService;
|
||||
import com.microservices.pms.project.domain.PmsProject;
|
||||
import com.microservices.pms.project.mapper.PmsProjectMapper;
|
||||
import com.microservices.pms.project.service.IPmsProjectService;
|
||||
import com.microservices.pms.utils.PmsConstants;
|
||||
import com.microservices.pms.utils.PmsGitLinkRequestUrl;
|
||||
|
|
@ -87,6 +89,8 @@ public class PmsEnterpriseServiceImpl implements IPmsEnterpriseService {
|
|||
private RedisService redisService;
|
||||
@Value("${pms.pmsUrl}")
|
||||
private String pmsUrl;
|
||||
@Autowired
|
||||
private PmsProjectMapper pmsProjectMapper;
|
||||
|
||||
/**
|
||||
* 查询项目管理企业
|
||||
|
|
@ -136,6 +140,27 @@ public class PmsEnterpriseServiceImpl implements IPmsEnterpriseService {
|
|||
return pmsEnterprise;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PmsEnterprise selectPmsEnterpriseByIdentifierWithoutAuth(String identifier) {
|
||||
// 企业信息在项目管理的每次接口请求中都会执行查询,加入到Redis缓存减少数据库查询次数
|
||||
String enterpriseRedisKey = CacheConstants.getEnterpriseIdentifierKey(identifier);
|
||||
PmsEnterprise pmsEnterprise;
|
||||
if (redisService.hasKey(enterpriseRedisKey)) {
|
||||
pmsEnterprise = redisService.getCacheObject(enterpriseRedisKey);
|
||||
} else {
|
||||
pmsEnterprise = pmsEnterpriseMapper.selectPmsEnterpriseByIdentifier(identifier);
|
||||
if (pmsEnterprise == null) {
|
||||
throw new ServiceException("该企业不存在(企业标识[%s])", identifier);
|
||||
}
|
||||
redisService.setCacheObject(enterpriseRedisKey, pmsEnterprise);
|
||||
}
|
||||
if (!checkEnterpriseInitComplete(pmsEnterprise.getGitlinkOrgId())) {
|
||||
throw new ServiceException("当前组织初始化未完成,不允许进行操作!");
|
||||
}
|
||||
pmsEnterprise.setGitlinkUrl(gitLinkRequestHelper.gitLinkUrl);
|
||||
return pmsEnterprise;
|
||||
}
|
||||
|
||||
private void clearPmsEnterpriseForRedis(PmsEnterprise pmsEnterprise) {
|
||||
redisService.deleteObject(CacheConstants.getEnterpriseIdentifierKey(pmsEnterprise.getEnterpriseIdentifier()));
|
||||
redisService.deleteObject(CacheConstants.getEnterpriseIdKey(pmsEnterprise.getId()));
|
||||
|
|
@ -596,4 +621,14 @@ public class PmsEnterpriseServiceImpl implements IPmsEnterpriseService {
|
|||
private Boolean checkEnterpriseInitComplete(Long gitlinkOrgId) {
|
||||
return !redisService.hasKey(CacheConstants.getGitlinkOrgIdOpenEnterpriseKey(gitlinkOrgId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PmsEnterprise getEnterpriseByProjectId(Long projectId) {
|
||||
PmsProject pmsProject = pmsProjectMapper.selectPmsProjectById(projectId);
|
||||
PmsEnterprise pmsEnterprise = pmsEnterpriseMapper.selectPmsEnterpriseById(pmsProject.getPmsEnterpriseId());
|
||||
// // 手动注入上下文
|
||||
// SecurityContextHolder.setDeptId(pmsEnterprise.getDeptId().toString());
|
||||
// checkEnterpriseIsCurrentEnterprise(pmsEnterprise);
|
||||
return pmsEnterprise;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,141 @@
|
|||
package com.microservices.pms.enums;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.microservices.common.core.exception.ServiceException;
|
||||
import com.microservices.common.core.utils.StringUtils;
|
||||
import com.microservices.common.core.utils.html.EscapeUtil;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author OTTO
|
||||
*/
|
||||
@Getter
|
||||
@ApiModel("产品库制品路径前缀")
|
||||
public enum ProductLibraryComponentPathEnum {
|
||||
ALL("_All", "所有"),
|
||||
SOFTWARE("Software", "制品"),
|
||||
DOC("Document", "文档");
|
||||
|
||||
private final String key;
|
||||
private final String name;
|
||||
|
||||
ProductLibraryComponentPathEnum(String key, String name) {
|
||||
this.key = key;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
public static ProductLibraryComponentPathEnum getByKey(String key) {
|
||||
for (ProductLibraryComponentPathEnum typeEnum : ProductLibraryComponentPathEnum.values()) {
|
||||
if (typeEnum.key.equals(key)) {
|
||||
return typeEnum;
|
||||
}
|
||||
}
|
||||
throw new ServiceException("该产品库制品路径前缀不存在(产品库制品路径前缀[%s])", key);
|
||||
}
|
||||
|
||||
public static String getSoftwareFixedPath(String directory) {
|
||||
return EscapeUtil.removeExtraSlashOfUrl(SOFTWARE.key + "/" + directory);
|
||||
}
|
||||
|
||||
public static String getDocFixedPath(String directory) {
|
||||
return EscapeUtil.removeExtraSlashOfUrl(DOC.key + "/" + directory);
|
||||
}
|
||||
|
||||
public static String getChineseFixedPath(String path) {
|
||||
if (path.startsWith(SOFTWARE.key)) {
|
||||
return path.replaceFirst(SOFTWARE.key, SOFTWARE.name);
|
||||
}
|
||||
if (path.startsWith(DOC.key)) {
|
||||
return path.replaceFirst(DOC.key, DOC.name);
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
public static boolean pathIsNeedPackaged(String node, String path) {
|
||||
if (StringUtils.isNotEmpty(node)) {
|
||||
if (node.equals(SOFTWARE.key)) {
|
||||
return path.startsWith(SOFTWARE.key);
|
||||
}
|
||||
if (node.equals(DOC.key)) {
|
||||
return path.startsWith(DOC.key);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static String getPackagedFileJson(String node, String packagedFileIdentifiersJson, String fileIdentifier) {
|
||||
JSONObject packagedFileIdentifiersJsonObj;
|
||||
if (StringUtils.isNotEmpty(packagedFileIdentifiersJson) && JSON.isValid(packagedFileIdentifiersJson)) {
|
||||
packagedFileIdentifiersJsonObj = JSONObject.parseObject(packagedFileIdentifiersJson);
|
||||
} else {
|
||||
packagedFileIdentifiersJsonObj = new JSONObject();
|
||||
}
|
||||
if (StringUtils.isNotEmpty(node)) {
|
||||
if (SOFTWARE.key.equals(node)) {
|
||||
packagedFileIdentifiersJsonObj.put(SOFTWARE.key, fileIdentifier);
|
||||
return packagedFileIdentifiersJsonObj.toJSONString();
|
||||
}
|
||||
if (DOC.key.equals(node)) {
|
||||
packagedFileIdentifiersJsonObj.put(DOC.key, fileIdentifier);
|
||||
return packagedFileIdentifiersJsonObj.toJSONString();
|
||||
}
|
||||
}
|
||||
packagedFileIdentifiersJsonObj.put(ALL.key, fileIdentifier);
|
||||
return packagedFileIdentifiersJsonObj.toJSONString();
|
||||
}
|
||||
|
||||
public static String getPackagedFileIdentifierFromJson(String node, JSONObject packagedFileIdentifiersJsonObj) {
|
||||
if (StringUtils.isNotEmpty(node)) {
|
||||
if (SOFTWARE.key.equals(node)) {
|
||||
return packagedFileIdentifiersJsonObj.getString(SOFTWARE.key);
|
||||
}
|
||||
if (DOC.key.equals(node)) {
|
||||
return packagedFileIdentifiersJsonObj.getString(DOC.key);
|
||||
}
|
||||
}
|
||||
return packagedFileIdentifiersJsonObj.getString(ALL.key);
|
||||
}
|
||||
|
||||
public static String getPackagedFileTag(String node) {
|
||||
if (StringUtils.isNotEmpty(node)) {
|
||||
if (SOFTWARE.key.equals(node)) {
|
||||
return "(" + SOFTWARE.name + ")";
|
||||
}
|
||||
if (DOC.key.equals(node)) {
|
||||
return "(" + DOC.name + ")";
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static String setPackagedFileIdentifierNull(String node, String packagedFileIdentifiersJson) {
|
||||
JSONObject packagedFileIdentifiersJsonObj;
|
||||
if (StringUtils.isNotEmpty(packagedFileIdentifiersJson) && JSON.isValid(packagedFileIdentifiersJson)) {
|
||||
packagedFileIdentifiersJsonObj = JSONObject.parseObject(packagedFileIdentifiersJson);
|
||||
} else {
|
||||
packagedFileIdentifiersJsonObj = new JSONObject();
|
||||
}
|
||||
if (StringUtils.isNotEmpty(node)) {
|
||||
if (SOFTWARE.key.equals(node)) {
|
||||
if (packagedFileIdentifiersJsonObj.containsKey(SOFTWARE.key)) {
|
||||
packagedFileIdentifiersJsonObj.remove(SOFTWARE.key);
|
||||
}
|
||||
return packagedFileIdentifiersJsonObj.toJSONString();
|
||||
}
|
||||
if (DOC.key.equals(node)) {
|
||||
if (packagedFileIdentifiersJsonObj.containsKey(DOC.key)) {
|
||||
packagedFileIdentifiersJsonObj.remove(DOC.key);
|
||||
}
|
||||
return packagedFileIdentifiersJsonObj.toJSONString();
|
||||
}
|
||||
}
|
||||
if (packagedFileIdentifiersJsonObj.containsKey(ALL.key)) {
|
||||
packagedFileIdentifiersJsonObj.remove(ALL.key);
|
||||
}
|
||||
return packagedFileIdentifiersJsonObj.toJSONString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.microservices.pms.enums;
|
||||
|
||||
import com.microservices.common.core.exception.ServiceException;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author OTTO
|
||||
*/
|
||||
@Getter
|
||||
@ApiModel("来源类型")
|
||||
public enum ProductLibraryRepoFromTypeEnum {
|
||||
COMMON("common", "普通类型"),
|
||||
PIPELINE("pipeline", "流水线类型"),
|
||||
DOC("doc", "文档类型");
|
||||
|
||||
private final String key;
|
||||
private final String name;
|
||||
|
||||
ProductLibraryRepoFromTypeEnum(String key, String name) {
|
||||
this.key = key;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
public static ProductLibraryRepoFromTypeEnum getByKey(String key) {
|
||||
for (ProductLibraryRepoFromTypeEnum typeEnum : ProductLibraryRepoFromTypeEnum.values()) {
|
||||
if (typeEnum.key.equals(key)) {
|
||||
return typeEnum;
|
||||
}
|
||||
}
|
||||
throw new ServiceException("该来源类型不存在(来源类型[%s])", key);
|
||||
}
|
||||
}
|
||||
|
|
@ -79,4 +79,6 @@ public interface PmsJournalsMapper
|
|||
* @param journalId 评论对象Id
|
||||
*/
|
||||
void deletePmsJournalsByTypeAndJournalId(@Param("type") String type, @Param("journalId") Long journalId);
|
||||
|
||||
void updateJournalsIdByTypeAndOldId(@Param("type") String type, @Param("oldJournalId") Long oldJournalId, @Param("journalId") Long journalId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,4 +68,13 @@ public interface IPmsJournalsService
|
|||
* @param journalId 评论对象Id
|
||||
*/
|
||||
void deletePmsJournalsByTypeAndJournalId(String type, Long journalId);
|
||||
|
||||
/**
|
||||
* 更新评论对象id
|
||||
*
|
||||
* @param type 类型
|
||||
* @param oldJournalId 原评论对象Id
|
||||
* @param journalId 评论对象Id
|
||||
*/
|
||||
void updateJournalsIdByTypeAndOldId(String type, Long oldJournalId, Long journalId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -228,4 +228,9 @@ public class PmsJournalsServiceImpl implements IPmsJournalsService
|
|||
public void deletePmsJournalsByTypeAndJournalId(String type, Long journalId) {
|
||||
pmsJournalsMapper.deletePmsJournalsByTypeAndJournalId(type, journalId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateJournalsIdByTypeAndOldId(String type, Long oldJournalId, Long journalId) {
|
||||
pmsJournalsMapper.updateJournalsIdByTypeAndOldId(type, oldJournalId, journalId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,32 +5,25 @@ import com.microservices.common.core.web.domain.AjaxResult;
|
|||
import com.microservices.common.core.web.page.GenericsTableDataInfo;
|
||||
import com.microservices.common.log.annotation.Log;
|
||||
import com.microservices.common.log.enums.BusinessType;
|
||||
import com.microservices.pms.pipeline.domain.PmsCiPipelines;
|
||||
import com.microservices.pms.pipeline.domain.vo.*;
|
||||
import com.microservices.pms.pipeline.service.IPmsCiPipelinesService;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.microservices.common.log.annotation.Log;
|
||||
import com.microservices.common.log.enums.BusinessType;
|
||||
import com.microservices.pms.pipeline.service.IPmsCiPipelinesService;
|
||||
import com.microservices.common.core.web.controller.BaseController;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* 流水线Controller
|
||||
*
|
||||
*
|
||||
* @author wanjia
|
||||
* @date 2024-03-02
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/{enterpriseIdentifier}/pipelines")
|
||||
@Api(tags = "项目管理-流水线相关接口")
|
||||
public class PmsCiPipelinesController extends BaseController
|
||||
{
|
||||
public class PmsCiPipelinesController extends BaseController {
|
||||
@Autowired
|
||||
private IPmsCiPipelinesService pmsCiPipelinesService;
|
||||
|
||||
|
|
@ -47,11 +40,30 @@ public class PmsCiPipelinesController extends BaseController
|
|||
})
|
||||
@ApiOperation("流水线列表")
|
||||
public GenericsTableDataInfo<PmsCiPipelinesDetailVo> list(@ApiParam(name = "enterpriseIdentifier", value = "企业标识") @PathVariable String enterpriseIdentifier,
|
||||
@ApiParam("流水线名称搜索") @RequestParam(required = false) String pipelineName,
|
||||
@ApiParam("流水线构建类型 1-声明式流水线 2-图形化流水线") @RequestParam(required = false) Integer pipelineType) {
|
||||
|
||||
return pmsCiPipelinesService.selectPmsCiPipelinesList(enterpriseIdentifier, pipelineName, pipelineType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询流水线卡片列表
|
||||
*/
|
||||
// @RequiresPermissions("pms:pipelines:list")
|
||||
@GetMapping("/cardList")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "pageNum", value = "当前记录起始索引", paramType = "query", dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页显示记录数", paramType = "query", dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "orderByColumn", value = "排序列(更新时间:updateTime,创建时间:createTime)", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "isAsc", value = "排序的方向desc或者asc,默认asc", paramType = "query", dataType = "String")
|
||||
})
|
||||
@ApiOperation("流水线卡片列表")
|
||||
public GenericsTableDataInfo<PmsCiPipelinesCardVo> cardList(@ApiParam(name = "enterpriseIdentifier", value = "企业标识") @PathVariable String enterpriseIdentifier,
|
||||
@ApiParam("流水线名称搜索") @RequestParam(required = false) String pipelineName,
|
||||
@ApiParam("流水线构建类型 1-声明式流水线 2-图形化流水线") @RequestParam(required = false) Integer pipelineType)
|
||||
{
|
||||
|
||||
return pmsCiPipelinesService.selectPmsCiPipelinesList(enterpriseIdentifier, pipelineName, pipelineType);
|
||||
return pmsCiPipelinesService.selectPmsCiPipelinesCardList(enterpriseIdentifier, pipelineName, pipelineType);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -60,8 +72,7 @@ public class PmsCiPipelinesController extends BaseController
|
|||
// @RequiresPermissions("pms:pipelines:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiOperation("获取流水线详情")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(pmsCiPipelinesService.selectPmsCiPipelinesById(id));
|
||||
}
|
||||
|
||||
|
|
@ -73,8 +84,7 @@ public class PmsCiPipelinesController extends BaseController
|
|||
@PostMapping
|
||||
@ApiOperation("新增流水线")
|
||||
public AjaxResult add(@ApiParam(name = "enterpriseIdentifier", value = "企业标识") @PathVariable String enterpriseIdentifier,
|
||||
@RequestBody @Validated PmsCiPipelinesInputVo pmsCiPipelinesInputVo)
|
||||
{
|
||||
@RequestBody @Validated PmsCiPipelinesInputVo pmsCiPipelinesInputVo) {
|
||||
return success(pmsCiPipelinesService.insertPmsCiPipelines(pmsCiPipelinesInputVo, enterpriseIdentifier));
|
||||
}
|
||||
|
||||
|
|
@ -85,8 +95,7 @@ public class PmsCiPipelinesController extends BaseController
|
|||
@Log(title = "流水线", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
@ApiOperation("编辑流水线")
|
||||
public AjaxResult edit(@RequestBody PmsCiPipelinesUpdateVo pmsCiPipelinesUpdateVo)
|
||||
{
|
||||
public AjaxResult edit(@RequestBody PmsCiPipelinesUpdateVo pmsCiPipelinesUpdateVo) {
|
||||
return toAjax(pmsCiPipelinesService.updatePmsCiPipelines(pmsCiPipelinesUpdateVo.toPmsCiPipelines()));
|
||||
}
|
||||
|
||||
|
|
@ -98,8 +107,7 @@ public class PmsCiPipelinesController extends BaseController
|
|||
@PostMapping(value = "/settingFile")
|
||||
@ApiOperation("编辑流水线配置文件")
|
||||
public AjaxResult editPipelineFile(@ApiParam(name = "enterpriseIdentifier", value = "企业标识") @PathVariable String enterpriseIdentifier,
|
||||
@RequestBody PmsCiPipelineFileInputVo pmsCiPipelineFileInputVo)
|
||||
{
|
||||
@RequestBody PmsCiPipelineFileInputVo pmsCiPipelineFileInputVo) {
|
||||
return toAjax(pmsCiPipelinesService.createOrUpdatePmsCiPipelineFile(pmsCiPipelineFileInputVo));
|
||||
}
|
||||
|
||||
|
|
@ -108,9 +116,8 @@ public class PmsCiPipelinesController extends BaseController
|
|||
*/
|
||||
// @RequiresPermissions("pms:pipelines:remove")
|
||||
@Log(title = "流水线", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(pmsCiPipelinesService.deletePmsCiPipelinesByIds(ids));
|
||||
}
|
||||
|
||||
|
|
@ -131,8 +138,7 @@ public class PmsCiPipelinesController extends BaseController
|
|||
// @RequiresPermissions("pms:pipelines:list")
|
||||
@GetMapping(value = "/{id}/actions/runs")
|
||||
@ApiOperation("流水线执行记录列表")
|
||||
public AjaxResult getPipelineRunsList(@ApiParam(name = "id", value = "流水线id")@PathVariable Long id, PmsCiPipelinePageVo pmsCiPipelinePageVo)
|
||||
{
|
||||
public AjaxResult getPipelineRunsList(@ApiParam(name = "id", value = "流水线id") @PathVariable Long id, PmsCiPipelinePageVo pmsCiPipelinePageVo) {
|
||||
return success(pmsCiPipelinesService.selectPipelineRunsList(id, pmsCiPipelinePageVo));
|
||||
}
|
||||
|
||||
|
|
@ -142,11 +148,10 @@ public class PmsCiPipelinesController extends BaseController
|
|||
// @RequiresPermissions("pms:pipelines:query")
|
||||
@PostMapping(value = "/{id}/actions/runs/{run}/jobs/{job}")
|
||||
@ApiOperation("流水线执行记录任务详情")
|
||||
public AjaxResult getPipelineRunsJob(@ApiParam(name = "id", value = "流水线id")@PathVariable Long id,
|
||||
@ApiParam(name = "run", value = "执行记录序号")@PathVariable String run,
|
||||
@ApiParam(name = "job", value = "执行任务序号")@PathVariable String job,
|
||||
@RequestBody @Validated PmsCiPipelineLogCursorsVo pmsCiPipelineLogCursorsVo)
|
||||
{
|
||||
public AjaxResult getPipelineRunsJob(@ApiParam(name = "id", value = "流水线id") @PathVariable Long id,
|
||||
@ApiParam(name = "run", value = "执行记录序号") @PathVariable String run,
|
||||
@ApiParam(name = "job", value = "执行任务序号") @PathVariable String job,
|
||||
@RequestBody @Validated PmsCiPipelineLogCursorsVo pmsCiPipelineLogCursorsVo) {
|
||||
return success(pmsCiPipelinesService.getPipelineRunsJob(id, run, job, pmsCiPipelineLogCursorsVo));
|
||||
}
|
||||
|
||||
|
|
@ -157,8 +162,7 @@ public class PmsCiPipelinesController extends BaseController
|
|||
@Log(title = "流水线", businessType = BusinessType.UPDATE)
|
||||
@PutMapping(value = "/{id}/actions/enable")
|
||||
@ApiOperation("启用流水线")
|
||||
public AjaxResult enablePipeline(@ApiParam(name = "id", value = "流水线id")@PathVariable Long id)
|
||||
{
|
||||
public AjaxResult enablePipeline(@ApiParam(name = "id", value = "流水线id") @PathVariable Long id) {
|
||||
return success(pmsCiPipelinesService.enablePipeline(id));
|
||||
}
|
||||
|
||||
|
|
@ -169,38 +173,33 @@ public class PmsCiPipelinesController extends BaseController
|
|||
@Log(title = "流水线", businessType = BusinessType.UPDATE)
|
||||
@PutMapping(value = "/{id}/actions/disable")
|
||||
@ApiOperation("禁用流水线")
|
||||
public AjaxResult disablePipeline(@ApiParam(name = "id", value = "流水线id")@PathVariable Long id)
|
||||
{
|
||||
public AjaxResult disablePipeline(@ApiParam(name = "id", value = "流水线id") @PathVariable Long id) {
|
||||
return success(pmsCiPipelinesService.disablePipeline(id));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/actions/nodes")
|
||||
@ApiOperation("节点列表")
|
||||
public AjaxResult getActionNodes()
|
||||
{
|
||||
public AjaxResult getActionNodes() {
|
||||
return success(pmsCiPipelinesService.selectNodes());
|
||||
}
|
||||
|
||||
@GetMapping(value = "/actions/templates")
|
||||
@ApiOperation("流水线模版列表")
|
||||
public AjaxResult getActionTemplates()
|
||||
{
|
||||
public AjaxResult getActionTemplates() {
|
||||
return success(pmsCiPipelinesService.selectTemplates());
|
||||
}
|
||||
|
||||
@PostMapping(value = "/{id}/graphJsonToYaml")
|
||||
@ApiOperation("流水线图形json构建声明式yaml")
|
||||
public AjaxResult buildPipelineYaml(@ApiParam(name = "id", value = "流水线id")@PathVariable Long id,
|
||||
@RequestBody @Validated PmsCiPipelineBuildYamlInputVo pmsCiPipelineBuildInputVo)
|
||||
{
|
||||
public AjaxResult buildPipelineYaml(@ApiParam(name = "id", value = "流水线id") @PathVariable Long id,
|
||||
@RequestBody @Validated PmsCiPipelineBuildYamlInputVo pmsCiPipelineBuildInputVo) {
|
||||
return success(pmsCiPipelinesService.buildPipelineYamlByGraphJson(id, pmsCiPipelineBuildInputVo));
|
||||
}
|
||||
|
||||
@PostMapping(value = "/{id}/savePipelineYaml")
|
||||
@ApiOperation("流水线图形构建声明式yaml并保存")
|
||||
public AjaxResult savePipelineYaml(@ApiParam(name = "id", value = "流水线id")@PathVariable Long id,
|
||||
@RequestBody @Validated PmsCiPipelineBuildYamlInputVo pmsCiPipelineBuildInputVo)
|
||||
{
|
||||
public AjaxResult savePipelineYaml(@ApiParam(name = "id", value = "流水线id") @PathVariable Long id,
|
||||
@RequestBody @Validated PmsCiPipelineBuildYamlInputVo pmsCiPipelineBuildInputVo) {
|
||||
return success(pmsCiPipelinesService.savePipelineYamlByGraphicJson(id, pmsCiPipelineBuildInputVo));
|
||||
}
|
||||
|
||||
|
|
@ -219,8 +218,7 @@ public class PmsCiPipelinesController extends BaseController
|
|||
@ApiOperation("启动流水线执行记录任务")
|
||||
public AjaxResult runPipelineRunsJob(@ApiParam(name = "id", value = "流水线id") @PathVariable Long id,
|
||||
@ApiParam(name = "workflow", value = "流水线文件名称", required = true) @RequestParam String workflow,
|
||||
@ApiParam(name = "ref", value = "分支名称", required = true) @RequestParam String ref)
|
||||
{
|
||||
@ApiParam(name = "ref", value = "分支名称", required = true) @RequestParam String ref) {
|
||||
return success(pmsCiPipelinesService.runPipelineRunsJob(id, workflow, ref));
|
||||
}
|
||||
|
||||
|
|
@ -229,10 +227,9 @@ public class PmsCiPipelinesController extends BaseController
|
|||
*/
|
||||
@PostMapping(value = "/{id}/actions/runs/{run}/jobs/{job}/rerun")
|
||||
@ApiOperation("重启流水线执行记录任务")
|
||||
public AjaxResult reRunPipelineRunsJob(@ApiParam(name = "id", value = "流水线id")@PathVariable Long id,
|
||||
@ApiParam(name = "run", value = "执行记录序号")@PathVariable String run,
|
||||
@ApiParam(name = "job", value = "执行任务序号")@PathVariable String job)
|
||||
{
|
||||
public AjaxResult reRunPipelineRunsJob(@ApiParam(name = "id", value = "流水线id") @PathVariable Long id,
|
||||
@ApiParam(name = "run", value = "执行记录序号") @PathVariable String run,
|
||||
@ApiParam(name = "job", value = "执行任务序号") @PathVariable String job) {
|
||||
return success(pmsCiPipelinesService.reRunPipelineRunsJob(id, run, job));
|
||||
}
|
||||
|
||||
|
|
@ -241,9 +238,8 @@ public class PmsCiPipelinesController extends BaseController
|
|||
*/
|
||||
@PostMapping(value = "/{id}/actions/runs/{run}/rerun")
|
||||
@ApiOperation("重启所有流水线执行记录任务")
|
||||
public AjaxResult reRunAllJobsInPipelineRun(@ApiParam(name = "id", value = "流水线id")@PathVariable Long id,
|
||||
@ApiParam(name = "run", value = "执行记录序号")@PathVariable String run)
|
||||
{
|
||||
public AjaxResult reRunAllJobsInPipelineRun(@ApiParam(name = "id", value = "流水线id") @PathVariable Long id,
|
||||
@ApiParam(name = "run", value = "执行记录序号") @PathVariable String run) {
|
||||
return success(pmsCiPipelinesService.reRunAllJobsInPipelineRun(id, run));
|
||||
}
|
||||
|
||||
|
|
@ -264,11 +260,22 @@ public class PmsCiPipelinesController extends BaseController
|
|||
*/
|
||||
@GetMapping(value = "/{id}/actions/runs/{run}/results")
|
||||
@ApiOperation("流水线执行测试报告结果查询")
|
||||
public AjaxResult getPipelineRunResults(@ApiParam(name = "id", value = "流水线id")@PathVariable Long id,
|
||||
@ApiParam(name = "run", value = "执行记录序号")@PathVariable String run)
|
||||
{
|
||||
public AjaxResult getPipelineRunResults(@ApiParam(name = "id", value = "流水线id") @PathVariable Long id,
|
||||
@ApiParam(name = "run", value = "执行记录序号") @PathVariable String run) {
|
||||
return success(pmsCiPipelinesService.getPipelineRunResults(id, run));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getPipelineRubyId/{javaId}")
|
||||
@ApiOperation("查询流水线Id(根据JavaId查询RubyId)")
|
||||
public AjaxResult getPipelineRubyIdByJavaId(@ApiParam(name = "javaId", value = "JavaId") @PathVariable Long javaId) {
|
||||
return success(pmsCiPipelinesService.getPipelineRubyIdByJavaId(javaId));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/{repoOwner}/{repoIdentifier}/getPipelineId/{fileName}")
|
||||
@ApiOperation("查询流水线Id(根据JavaId查询RubyId)")
|
||||
public AjaxResult getPipelineId(@ApiParam(name = "repoOwner", value = "仓库所有者") @PathVariable String repoOwner,
|
||||
@ApiParam(name = "repoIdentifier", value = "仓库标识") @PathVariable String repoIdentifier,
|
||||
@ApiParam(name = "fileName", value = "流水线文件名") @PathVariable String fileName) {
|
||||
return success(pmsCiPipelinesService.getPipelineId(repoOwner, repoIdentifier, fileName));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,53 @@
|
|||
package com.microservices.pms.pipeline.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流水线卡片执行详情对象
|
||||
*
|
||||
* @author xxq
|
||||
* @date 2025-01-23
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("流水线卡片执行详情对象")
|
||||
public class PmsCiPipelinesCardRunVo {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "总执行数量")
|
||||
private Long total;
|
||||
|
||||
@ApiModelProperty(value = "成功执行数量")
|
||||
private Long success;
|
||||
|
||||
@ApiModelProperty(value = "失败执行数量")
|
||||
private Long failure;
|
||||
|
||||
@ApiModelProperty(value = "是否定时任务")
|
||||
private Boolean schedule;
|
||||
|
||||
@ApiModelProperty(value = "执行状态")
|
||||
private Long status;
|
||||
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
private Long started;
|
||||
|
||||
@ApiModelProperty(value = "结束时间")
|
||||
private Long stopped;
|
||||
|
||||
@ApiModelProperty(value = "执行时长")
|
||||
private Long length;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Long created;
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Long updated;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
package com.microservices.pms.pipeline.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流水线卡片详情对象 pms_ci_pipelines
|
||||
*
|
||||
* @author xxq
|
||||
* @date 2025-01-23
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("流水线卡片详情对象")
|
||||
public class PmsCiPipelinesCardVo {
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 仓库owner
|
||||
*/
|
||||
@ApiModelProperty(value = "仓库owner")
|
||||
private String owner;
|
||||
|
||||
/**
|
||||
* 仓库标识
|
||||
*/
|
||||
@ApiModelProperty(value = "仓库标识")
|
||||
private String repoIdentifier;
|
||||
|
||||
@ApiModelProperty(value = "仓库名")
|
||||
private String repoName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "url")
|
||||
private String url;
|
||||
|
||||
@ApiModelProperty(value = "流水线列表")
|
||||
private List<PmsCiPipelinesDetailVo> pipelinesList;
|
||||
|
||||
}
|
||||
|
|
@ -77,4 +77,6 @@ public class PmsCiPipelinesDetailVo
|
|||
@ApiModelProperty(value = "流水线模板JSON")
|
||||
private JSONObject pipelineTemplateJson;
|
||||
|
||||
@ApiModelProperty(value = "流水线执行详情")
|
||||
private PmsCiPipelinesCardRunVo pmsCiPipelinesCardRunVo;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ public interface PmsCiPipelinesMapper
|
|||
* @return 流水线集合
|
||||
*/
|
||||
public List<PmsCiPipelines> selectPmsCiPipelinesList(PmsCiPipelines pmsCiPipelines);
|
||||
public List<PmsCiPipelines> selectPmsCiPipelinesCardList(PmsCiPipelines pmsCiPipelines);
|
||||
|
||||
/**
|
||||
* 新增流水线
|
||||
|
|
@ -64,4 +65,6 @@ public interface PmsCiPipelinesMapper
|
|||
public int deletePmsCiPipelinesByIds(Long[] ids);
|
||||
|
||||
int selectCountByPipelineNameAndRepoInfo(@Param("pipelineName") String pipelineName, @Param("owner") String owner, @Param("repoIdentifier") String repoIdentifier, @Param("branch") String branch);
|
||||
|
||||
PmsCiPipelines selectPmsCiPipelinesByRepoAndFileName(@Param("repoOwner") String repoOwner, @Param("repoIdentifier") String repoIdentifier, @Param("fileName") String fileName);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ public interface IPmsCiPipelinesService
|
|||
* @return 流水线集合
|
||||
*/
|
||||
public GenericsTableDataInfo<PmsCiPipelinesDetailVo> selectPmsCiPipelinesList(String enterpriseIdentifier, String pipelineName, Integer pipelineType);
|
||||
public GenericsTableDataInfo<PmsCiPipelinesCardVo> selectPmsCiPipelinesCardList(String enterpriseIdentifier, String pipelineName, Integer pipelineType);
|
||||
|
||||
/**
|
||||
* 新增流水线
|
||||
|
|
@ -102,4 +103,8 @@ public interface IPmsCiPipelinesService
|
|||
JSONObject runPipelineRunsJob(Long id, String workflow, String ref);
|
||||
|
||||
JSONObject getPipelineRunResults(Long id, String run);
|
||||
|
||||
JSONObject getPipelineRubyIdByJavaId(Long javaId);
|
||||
|
||||
JSONObject getPipelineId(String repoOwner, String repoIdentifier, String fileName);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import java.util.Map;
|
|||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
|
@ -15,6 +16,7 @@ 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.core.utils.YamlValidatorUtils;
|
||||
import com.microservices.common.core.utils.html.EscapeUtil;
|
||||
import com.microservices.common.core.web.page.GenericsTableDataInfo;
|
||||
import com.microservices.common.httpClient.domain.EntryDto;
|
||||
import com.microservices.common.httpClient.domain.FileEntryDto;
|
||||
|
|
@ -24,9 +26,11 @@ import com.microservices.pms.common.service.IPmsCommonService;
|
|||
import com.microservices.pms.enterprise.domain.PmsEnterprise;
|
||||
import com.microservices.pms.enterprise.service.IPmsEnterpriseService;
|
||||
import com.microservices.pms.pipeline.domain.PmsCiPipelineGraphics;
|
||||
import com.microservices.pms.pipeline.domain.PmsCiPipelines;
|
||||
import com.microservices.pms.pipeline.domain.vo.*;
|
||||
import com.microservices.pms.pipeline.mapper.PmsCiPipelinesMapper;
|
||||
import com.microservices.pms.pipeline.service.IPmsCiPipelineGraphicsService;
|
||||
import com.microservices.pms.utils.PmsConstants;
|
||||
import com.microservices.pms.pipeline.service.IPmsCiPipelinesService;
|
||||
import com.microservices.pms.utils.PmsGitLinkRequestUrl;
|
||||
import com.microservices.pms.utils.YamlUtil;
|
||||
import org.slf4j.Logger;
|
||||
|
|
@ -34,12 +38,18 @@ import org.slf4j.LoggerFactory;
|
|||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.microservices.pms.pipeline.mapper.PmsCiPipelinesMapper;
|
||||
import com.microservices.pms.pipeline.domain.PmsCiPipelines;
|
||||
import com.microservices.pms.pipeline.service.IPmsCiPipelinesService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.microservices.common.core.utils.JSONUtils.convertObjectToJSONObject;
|
||||
import static com.microservices.common.core.utils.PageUtils.startPage;
|
||||
|
|
@ -50,7 +60,7 @@ import static com.microservices.pms.utils.PmsConstants.*;
|
|||
|
||||
/**
|
||||
* 流水线Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author wanjia
|
||||
* @date 2024-03-02
|
||||
*/
|
||||
|
|
@ -110,6 +120,28 @@ public class PmsCiPipelinesServiceImpl implements IPmsCiPipelinesService {
|
|||
return toPage(pipelinesList, this::buildPmsCiPipelinesDetailVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询流水线卡片列表
|
||||
*
|
||||
* @param enterpriseIdentifier 企业标识
|
||||
* @param pipelineName 流水线名
|
||||
* @param pipelineType
|
||||
* @return 流水线
|
||||
*/
|
||||
@Override
|
||||
public GenericsTableDataInfo<PmsCiPipelinesCardVo> selectPmsCiPipelinesCardList(String enterpriseIdentifier, String pipelineName, Integer pipelineType) {
|
||||
PmsEnterprise pmsEnterprise = pmsEnterpriseService.selectPmsEnterpriseByIdentifier(enterpriseIdentifier);
|
||||
PmsCiPipelines pmsCiPipelines = new PmsCiPipelines();
|
||||
pmsCiPipelines.setPipelineName(pipelineName);
|
||||
pmsCiPipelines.setPmsEnterpriseId(pmsEnterprise.getId());
|
||||
pmsCiPipelines.setPipelineType(pipelineType);
|
||||
startPage();
|
||||
List<PmsCiPipelines> pipelinesList = pmsCiPipelinesMapper.selectPmsCiPipelinesCardList(pmsCiPipelines);
|
||||
String workflows = pipelinesList.size() == 0 ? "" : Optional.ofNullable(pipelinesList).orElse(Collections.emptyList()).stream().map(PmsCiPipelines::getFileName).collect(Collectors.joining(","));
|
||||
List<PmsCiPipelinesCardRunVo> result = pipelinesList.size() == 0 ? Collections.emptyList() : gitLinkRequestHelper.doGetToObjectList(PmsGitLinkRequestUrl.GET_ACTION_RUN_DATA(pipelinesList.get(0).getOwner(), workflows), PmsCiPipelinesCardRunVo.class);
|
||||
return toPage(pipelinesList, x -> this.buildPmsCiPipelinesCardDetailVo(x, result));
|
||||
}
|
||||
|
||||
private PmsCiPipelinesDetailVo buildPmsCiPipelinesDetailVo(PmsCiPipelines pmsCiPipelines) {
|
||||
PmsCiPipelinesDetailVo pmsCiPipelinesDetailVo = new PmsCiPipelinesDetailVo();
|
||||
BeanUtils.copyProperties(pmsCiPipelines, pmsCiPipelinesDetailVo);
|
||||
|
|
@ -117,6 +149,20 @@ public class PmsCiPipelinesServiceImpl implements IPmsCiPipelinesService {
|
|||
return pmsCiPipelinesDetailVo;
|
||||
}
|
||||
|
||||
private PmsCiPipelinesCardVo buildPmsCiPipelinesCardDetailVo(PmsCiPipelines pmsCiPipelines, List<PmsCiPipelinesCardRunVo> result) {
|
||||
PmsCiPipelinesCardVo pmsCiPipelinesCardVo = new PmsCiPipelinesCardVo();
|
||||
BeanUtils.copyProperties(pmsCiPipelines, pmsCiPipelinesCardVo);
|
||||
pmsCiPipelinesCardVo.setUrl(EscapeUtil.removeExtraSlashOfUrl(gitLinkRequestHelper.gitLinkUrl + "/" + pmsCiPipelines.getOwner() + "/" + pmsCiPipelines.getRepoIdentifier()));
|
||||
PmsCiPipelines queryCiPipelines = new PmsCiPipelines();
|
||||
queryCiPipelines.setRepoIdentifier(pmsCiPipelines.getRepoIdentifier());
|
||||
queryCiPipelines.setOwner(pmsCiPipelines.getOwner());
|
||||
queryCiPipelines.setPmsEnterpriseId(pmsCiPipelines.getPmsEnterpriseId());
|
||||
List<PmsCiPipelines> pipelinesList = pmsCiPipelinesMapper.selectPmsCiPipelinesList(queryCiPipelines);
|
||||
pmsCiPipelinesCardVo.setPipelinesList(Optional.ofNullable(pipelinesList).orElse(Collections.emptyList()).stream().map(this::buildPmsCiPipelinesDetailVo).collect(Collectors.toList()));
|
||||
pmsCiPipelinesCardVo.getPipelinesList().forEach(x -> x.setPmsCiPipelinesCardRunVo(result.stream().filter(a -> a.getName().equals(x.getFileName())).findFirst().orElse(null)));
|
||||
return pmsCiPipelinesCardVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增流水线
|
||||
*
|
||||
|
|
@ -404,9 +450,9 @@ public class PmsCiPipelinesServiceImpl implements IPmsCiPipelinesService {
|
|||
throw new ServiceException("该项目流水线不存在(流水线ID[%s])", id);
|
||||
}
|
||||
return gitLinkRequestHelper.doPost(PmsGitLinkRequestUrl.RERUN_PIPELINE_RUNS_JOB(pmsCiPipelines.getOwner(),
|
||||
pmsCiPipelines.getRepoIdentifier(),
|
||||
run,
|
||||
job), null);
|
||||
pmsCiPipelines.getRepoIdentifier(),
|
||||
run,
|
||||
job), null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -416,9 +462,9 @@ public class PmsCiPipelinesServiceImpl implements IPmsCiPipelinesService {
|
|||
throw new ServiceException("该项目流水线不存在(流水线ID[%s])", id);
|
||||
}
|
||||
return gitLinkRequestHelper.doPost(PmsGitLinkRequestUrl.RUN_PIPELINE_RUNS_JOB(pmsCiPipelines.getOwner(),
|
||||
pmsCiPipelines.getRepoIdentifier(),
|
||||
workflow,
|
||||
ref), null);
|
||||
pmsCiPipelines.getRepoIdentifier(),
|
||||
workflow,
|
||||
ref), null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -456,7 +502,7 @@ public class PmsCiPipelinesServiceImpl implements IPmsCiPipelinesService {
|
|||
throw new ServiceException("该项目流水线不存在(流水线ID[%s])", id);
|
||||
}
|
||||
try {
|
||||
return gitLinkRequestHelper.doGet(PmsGitLinkRequestUrl.GET_PIPELINE_RUN_RESULTS(pmsCiPipelines.getOwner(),
|
||||
return gitLinkRequestHelper.doGet(PmsGitLinkRequestUrl.GET_PIPELINE_RUN_RESULTS(pmsCiPipelines.getOwner(),
|
||||
pmsCiPipelines.getRepoIdentifier(),
|
||||
run));
|
||||
} catch (Exception e) {
|
||||
|
|
@ -465,6 +511,39 @@ public class PmsCiPipelinesServiceImpl implements IPmsCiPipelinesService {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getPipelineRubyIdByJavaId(Long javaId) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("pipelineRubyId", null);
|
||||
PmsCiPipelines pmsCiPipelines = pmsCiPipelinesMapper.selectPmsCiPipelinesById(javaId);
|
||||
if (pmsCiPipelines != null) {
|
||||
JSONObject rubyResultData = gitLinkRequestHelper.doGet(
|
||||
PmsGitLinkRequestUrl.GET_PIPELINE_ACTIONS(pmsCiPipelines.getOwner(), pmsCiPipelines.getRepoIdentifier(), pmsCiPipelines.getFileName()
|
||||
));
|
||||
if (rubyResultData != null) {
|
||||
JSONArray rubyResultList = rubyResultData.getJSONArray("data");
|
||||
if (!rubyResultList.isEmpty()) {
|
||||
JSONObject rubyResult = rubyResultList.getJSONObject(0);
|
||||
jsonObject.put("pipelineRubyId", rubyResult.getLong("id"));
|
||||
}
|
||||
}
|
||||
}
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public JSONObject getPipelineId(String repoOwner, String repoIdentifier, String fileName) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("pipelineId", null);
|
||||
PmsCiPipelines pmsCiPipelines = pmsCiPipelinesMapper.selectPmsCiPipelinesByRepoAndFileName(repoOwner, repoIdentifier, fileName);
|
||||
if (pmsCiPipelines == null) {
|
||||
return jsonObject;
|
||||
}
|
||||
jsonObject.put("pipelineId", pmsCiPipelines.getId());
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
private void saveOrUpdateGraphicJsonToLocal(Long id, PmsCiPipelineBuildYamlInputVo pmsCiPipelineBuildInputVo) {
|
||||
PmsCiPipelineGraphics existentialPmsCiPipelineGraphics = pmsCiPipelineGraphicsService.selectPmsCiPipelineGraphicsByPmsCiPipelineId(id);
|
||||
PmsCiPipelineGraphics pmsCiPipelineGraphics = new PmsCiPipelineGraphics();
|
||||
|
|
|
|||
|
|
@ -21,83 +21,77 @@ import org.springframework.validation.annotation.Validated;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 产品计划Controller
|
||||
* 产品里程碑Controller
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2023-10-10
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "项目管理-产品计划相关接口")
|
||||
@Api(tags = "项目管理-产品里程碑相关接口")
|
||||
@RequestMapping("/{enterpriseIdentifier}/pmsProductPlan")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "enterpriseIdentifier", value = "企业标识", paramType = "path", dataType = "String")
|
||||
})
|
||||
public class PmsProductPlanController extends BaseController
|
||||
{
|
||||
public class PmsProductPlanController extends BaseController {
|
||||
@Autowired
|
||||
private IPmsProductPlanService pmsProductPlanService;
|
||||
|
||||
/**
|
||||
* 查询产品计划列表
|
||||
* 查询产品里程碑列表
|
||||
*/
|
||||
@RequiresPermissions("pms:pmsProduct:show")
|
||||
@GetMapping("/list")
|
||||
@ApiOperation(value = "查询产品计划列表")
|
||||
@ApiOperation(value = "查询产品里程碑列表")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "pageNum", value = "当前记录起始索引", paramType = "query", dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页显示记录数", paramType = "query", dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "orderByColumn", value = "排序列(开始时间:startTime,结束时间:endTime,产品需求数:productRequirementCount,优先级:priorityId)", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "isAsc", value = "排序的方向desc或者asc,默认asc", paramType = "query", dataType = "String")
|
||||
})
|
||||
public GenericsTableDataInfo<PmsProductPlanDataVo> list(@Validated PmsProductPlanSearchVo pmsProductPlanSearchVo)
|
||||
{
|
||||
public GenericsTableDataInfo<PmsProductPlanDataVo> list(@Validated PmsProductPlanSearchVo pmsProductPlanSearchVo) {
|
||||
return pmsProductPlanService.selectPmsProductPlanList(pmsProductPlanSearchVo.toPmsProductPlan());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取产品计划详细信息
|
||||
* 获取产品里程碑详细信息
|
||||
*/
|
||||
@RequiresPermissions("pms:pmsProduct:show")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiOperation(value = "获取产品计划详细信息")
|
||||
public GenericsAjaxResult<PmsProductPlanDataVo> getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
@ApiOperation(value = "获取产品里程碑详细信息")
|
||||
public GenericsAjaxResult<PmsProductPlanDataVo> getInfo(@PathVariable("id") Long id) {
|
||||
return genericsSuccess(pmsProductPlanService.selectPmsProductPlanDataById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增产品计划
|
||||
* 新增产品里程碑
|
||||
*/
|
||||
@RequiresPermissions("pms:pmsProductPlan:add")
|
||||
@Log(title = "产品计划", businessType = BusinessType.INSERT)
|
||||
@Log(title = "产品里程碑", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@ApiOperation(value = "新增产品计划")
|
||||
public AjaxResult add(@RequestBody @Validated PmsProductPlanInputVo pmsProductPlanInputVo)
|
||||
{
|
||||
@ApiOperation(value = "新增产品里程碑")
|
||||
public AjaxResult add(@RequestBody @Validated PmsProductPlanInputVo pmsProductPlanInputVo) {
|
||||
return success(pmsProductPlanService.insertPmsProductPlan(pmsProductPlanInputVo.toPmsProductPlan()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改产品计划
|
||||
* 修改产品里程碑
|
||||
*/
|
||||
@RequiresPermissions("pms:pmsProductPlan:edit")
|
||||
@Log(title = "产品计划", businessType = BusinessType.UPDATE)
|
||||
@Log(title = "产品里程碑", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
@ApiOperation(value = "修改产品计划")
|
||||
public AjaxResult edit(@RequestBody @Validated PmsProductPlanUpdateVo pmsProductPlanUpdateVo)
|
||||
{
|
||||
@ApiOperation(value = "修改产品里程碑")
|
||||
public AjaxResult edit(@RequestBody @Validated PmsProductPlanUpdateVo pmsProductPlanUpdateVo) {
|
||||
return toAjax(pmsProductPlanService.updatePmsProductPlan(pmsProductPlanUpdateVo.toPmsProductPlan()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除产品计划
|
||||
* 删除产品里程碑
|
||||
*/
|
||||
@RequiresPermissions("pms:pmsProductPlan:remove")
|
||||
@Log(title = "产品计划", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
@ApiOperation(value = "删除产品计划")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
@Log(title = "产品里程碑", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
@ApiOperation(value = "删除产品里程碑")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(pmsProductPlanService.deletePmsProductPlanByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,145 +0,0 @@
|
|||
package com.microservices.pms.product.controller;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.microservices.common.core.web.controller.BaseController;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.common.core.web.domain.GenericsAjaxResult;
|
||||
import com.microservices.common.core.web.page.GenericsTableDataInfo;
|
||||
import com.microservices.common.log.annotation.Log;
|
||||
import com.microservices.common.log.enums.BusinessType;
|
||||
import com.microservices.common.security.annotation.Logical;
|
||||
import com.microservices.common.security.annotation.RequiresPermissions;
|
||||
import com.microservices.pms.product.domain.PmsProductRequirement;
|
||||
import com.microservices.pms.product.domain.vo.*;
|
||||
import com.microservices.pms.product.service.IPmsProductModuleService;
|
||||
import com.microservices.pms.product.service.IPmsProductRequirementService;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 产品需求Controller
|
||||
*
|
||||
* @author otto
|
||||
* @date 2023-10-10
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "项目管理-产品需求相关接口")
|
||||
@RequestMapping("/{enterpriseIdentifier}/pmsProductRequirement")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "enterpriseIdentifier", value = "企业标识", paramType = "path", dataType = "String")
|
||||
})
|
||||
public class PmsProductRequirementController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IPmsProductRequirementService pmsProductRequirementService;
|
||||
@Autowired
|
||||
private IPmsProductModuleService pmsProductModuleService;
|
||||
|
||||
/**
|
||||
* 查询产品需求列表
|
||||
*/
|
||||
@RequiresPermissions("pms:pmsProduct:show")
|
||||
@GetMapping("/list")
|
||||
@ApiOperation(value = "查询产品需求列表")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "pageNum", value = "当前记录起始索引", paramType = "query", dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页显示记录数", paramType = "query", dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "orderByColumn", value = "排序列(更新时间:updateTime,创建时间:createTime,优先级:priorityId,开始时间:startTime,结束时间:endTime)", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "isAsc", value = "排序的方向desc或者asc,默认asc", paramType = "query", dataType = "String")
|
||||
})
|
||||
public GenericsTableDataInfo<PmsProductRequirementDataVo> list(@Validated PmsProductRequirementSearchVo pmsProductRequirementSearchVo)
|
||||
{
|
||||
PmsProductRequirement pmsProductRequirementSearch=pmsProductRequirementSearchVo.toPmsProductRequirement();
|
||||
|
||||
if (pmsProductRequirementSearch.getPmsProductModuleId() != null && pmsProductRequirementSearch.getPmsProductModuleId() != 0) {
|
||||
List<Long> moduleIdList=pmsProductModuleService.selectChildrenPmsProductModuleIdList(pmsProductRequirementSearch.getPmsProductModuleId());
|
||||
pmsProductRequirementSearch.setChildrenModuleIdList(moduleIdList);
|
||||
}
|
||||
return pmsProductRequirementService.selectPmsProductRequirementPageList(pmsProductRequirementSearch);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取产品需求详细信息
|
||||
*/
|
||||
@RequiresPermissions("pms:pmsProduct:show")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiOperation(value = "获取产品需求详细信息")
|
||||
public GenericsAjaxResult<PmsProductRequirementDetailVo> getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return genericsSuccess(pmsProductRequirementService.selectPmsProductRequirementDetailById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据产品标识和需求索引获取产品需求详细信息
|
||||
*/
|
||||
@RequiresPermissions("pms:pmsProduct:show")
|
||||
@GetMapping(value = "/ProductIdentifier/{productIdentifier}/index/{index}")
|
||||
@ApiOperation(value = "根据产品标识和需求索引获取产品需求详细信息")
|
||||
public GenericsAjaxResult<PmsProductRequirementDetailVo> getInfo(@PathVariable("productIdentifier") String productIdentifier, @PathVariable("index") Long index)
|
||||
{
|
||||
return genericsSuccess(pmsProductRequirementService.selectPmsProductRequirementDetailByProductIdentifierAndIndex(productIdentifier, index));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增产品需求
|
||||
*/
|
||||
@RequiresPermissions("pms:pmsProductRequirement:add")
|
||||
@Log(title = "产品需求", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@ApiOperation(value = "新增产品需求")
|
||||
public AjaxResult add(@RequestBody @Validated PmsProductRequirementInputVo pmsProductRequirementInputVo)
|
||||
{
|
||||
return success(pmsProductRequirementService.insertPmsProductRequirement(pmsProductRequirementInputVo.toPmsProductRequirement()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改产品需求
|
||||
*/
|
||||
@RequiresPermissions(value = {"pms:pmsProductRequirement:edit", "pms:pmsProductPlan:edit"}, logical = Logical.OR)
|
||||
@Log(title = "产品需求", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
@ApiOperation(value = "修改产品需求")
|
||||
public AjaxResult edit(@RequestBody @Validated PmsProductRequirementUpdateVo pmsProductRequirementUpdateVo)
|
||||
{
|
||||
return toAjax(pmsProductRequirementService.updatePmsProductRequirement(pmsProductRequirementUpdateVo.toPmsProductRequirement()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量修改产品需求
|
||||
*/
|
||||
@RequiresPermissions("pms:pmsProductRequirement:edit")
|
||||
@Log(title = "产品需求", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/batch")
|
||||
@ApiOperation(value = "批量修改产品需求")
|
||||
public AjaxResult batchEdit(
|
||||
@ApiParam(name = "pmsProductRequirementBatchUpdateVo",
|
||||
value = "【字段说明】(非必填字段不传递则代表不更新,传null则代表置空):\n" +
|
||||
"idList:需求Id列表(必填),示例:[1,2,3];\n" +
|
||||
"priorityId:关联优先级ID;\n" +
|
||||
"statusId:关联状态ID;\n" +
|
||||
"pmsProductModuleId:关联产品模块ID;\n" +
|
||||
"pmsProductPlanId:关联产品计划ID;\n" +
|
||||
"tags:标记Id列表,使用逗号分割的字符串;\n" +
|
||||
"requirementAssigneeGitlinkIds:需求负责人Gitlink ID列表(逗号分隔);\n" +
|
||||
"pmsProjectId:关联项目ID\n")
|
||||
@RequestBody JSONObject pmsProductRequirementBatchUpdateVo)
|
||||
{
|
||||
return toAjax(pmsProductRequirementService.batchUpdatePmsProductRequirement(pmsProductRequirementBatchUpdateVo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除产品需求
|
||||
*/
|
||||
@RequiresPermissions("pms:pmsProductRequirement:remove")
|
||||
@Log(title = "产品需求", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
@ApiOperation(value = "删除产品需求")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(pmsProductRequirementService.deletePmsProductRequirementByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,172 @@
|
|||
package com.microservices.pms.product.controller;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.microservices.common.core.web.controller.BaseController;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.common.core.web.domain.GenericsAjaxResult;
|
||||
import com.microservices.common.core.web.page.GenericsTableDataInfo;
|
||||
import com.microservices.common.log.annotation.Log;
|
||||
import com.microservices.common.log.enums.BusinessType;
|
||||
import com.microservices.common.security.annotation.RequiresPermissions;
|
||||
import com.microservices.pms.product.domain.vo.*;
|
||||
import com.microservices.pms.product.service.IPmsProductRequirementService;
|
||||
import com.microservices.pms.project.domain.PmsProject;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 产品需求相关接口
|
||||
*
|
||||
* @author otto
|
||||
* @date 2023-10-10
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "项目管理-需求相关接口")
|
||||
@RequestMapping("/{enterpriseIdentifier}/productRequirementSpecs")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "enterpriseIdentifier", value = "企业标识", paramType = "path", dataType = "String")
|
||||
})
|
||||
public class ProductReqSpecsController extends BaseController {
|
||||
@Autowired
|
||||
private IPmsProductRequirementService pmsProductRequirementService;
|
||||
|
||||
/**
|
||||
* 查询产品需求列表
|
||||
*/
|
||||
@ApiOperation(value = "查询需求列表")
|
||||
@RequiresPermissions("pms:pmsProduct:show")
|
||||
@GetMapping("/list")
|
||||
public GenericsTableDataInfo<ProductReqSpecsDataVo> list(@PathVariable String enterpriseIdentifier, @Validated ProductReqSpecsSearchVo productReqSpecsSearchVo) {
|
||||
return pmsProductRequirementService.selectReqSpecsList(productReqSpecsSearchVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取需求详细信息
|
||||
*/
|
||||
@RequiresPermissions("pms:pmsProduct:show")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiOperation(value = "获取需求详细信息")
|
||||
public GenericsAjaxResult<ProductReqSpecsDetailVo> getInfo(@PathVariable("id") Long id) {
|
||||
return genericsSuccess(pmsProductRequirementService.selectReqSpecsDetailById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增需求
|
||||
*/
|
||||
@RequiresPermissions("pms:pmsProductRequirement:add")
|
||||
@Log(title = "需求", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@ApiOperation(value = "新增需求")
|
||||
public AjaxResult add(@PathVariable String enterpriseIdentifier,
|
||||
@RequestBody @Validated ProductReqSpecsInputVo productReqSpecsInputVo) {
|
||||
productReqSpecsInputVo.setEnterpriseIdentifier(enterpriseIdentifier);
|
||||
return success(pmsProductRequirementService.insertReqSpecs(productReqSpecsInputVo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改需求
|
||||
*/
|
||||
@RequiresPermissions("pms:pmsProductRequirement:edit")
|
||||
@Log(title = "需求", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
@ApiOperation(value = "修改需求")
|
||||
public AjaxResult edit(@RequestBody @Validated ProductReqSpecsUpdateVo productReqSpecsUpdateVo) {
|
||||
return toAjax(pmsProductRequirementService.updateReqSpecs(productReqSpecsUpdateVo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 变更需求
|
||||
*/
|
||||
@RequiresPermissions("pms:pmsProductRequirement:edit")
|
||||
@Log(title = "需求", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/change")
|
||||
@ApiOperation(value = "变更需求")
|
||||
public AjaxResult change(@RequestBody @Validated ProductReqSpecsChangeVo productReqSpecsChangeVo) {
|
||||
return toAjax(pmsProductRequirementService.changeReqSpecs(productReqSpecsChangeVo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除需求
|
||||
*/
|
||||
@RequiresPermissions("pms:pmsProductRequirement:remove")
|
||||
@Log(title = "需求", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
@ApiOperation(value = "删除需求")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(pmsProductRequirementService.deleteReqSpecsByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 评审需求
|
||||
*/
|
||||
@RequiresPermissions("pms:pmsProductRequirement:edit")
|
||||
@Log(title = "需求", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/review")
|
||||
@ApiOperation(value = "评审需求")
|
||||
public AjaxResult review(@RequestBody @Validated ProductReqReviewVo productReqReviewVo) {
|
||||
return toAjax(pmsProductRequirementService.reviewReqSpecs(productReqReviewVo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 需求纳入计划
|
||||
*/
|
||||
@RequiresPermissions("pms:pmsProductRequirement:edit")
|
||||
@Log(title = "需求", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/activePlan")
|
||||
@ApiOperation(value = "需求纳入计划")
|
||||
public AjaxResult activePlan(@PathVariable String enterpriseIdentifier, @RequestBody @Validated ProductReqSpecsActivePlanVo productReqSpecsActivePlanVo) {
|
||||
productReqSpecsActivePlanVo.setEnterpriseIdentifier(enterpriseIdentifier);
|
||||
return toAjax(pmsProductRequirementService.activePlan(productReqSpecsActivePlanVo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 纳入计划时可选择项目列表
|
||||
*/
|
||||
@ApiOperation(value = "纳入计划时可选择项目列表")
|
||||
@RequiresPermissions("pms:pmsProduct:show")
|
||||
@GetMapping("/{productIdentifier}/projectList")
|
||||
public List<PmsProject> projectList(@PathVariable("productIdentifier") String productIdentifier) {
|
||||
return pmsProductRequirementService.selectReqSpecsProjectList(productIdentifier);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询需求状态列表
|
||||
*/
|
||||
@ApiOperation(value = "查询需求状态列表")
|
||||
@RequiresPermissions("pms:pmsProduct:show")
|
||||
@GetMapping("/statusList")
|
||||
public List<ReqStatusCommonVo> statusList() {
|
||||
return pmsProductRequirementService.selectReqSpecsStatusList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询需求类型列表
|
||||
*/
|
||||
@ApiOperation(value = "查询需求类型列表")
|
||||
@RequiresPermissions("pms:pmsProduct:show")
|
||||
@GetMapping("/typeList")
|
||||
public List<EnumCommonVo> typeList() {
|
||||
return pmsProductRequirementService.selectReqSpecsTypeList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量修改产品需求
|
||||
*/
|
||||
@RequiresPermissions("pms:pmsProductRequirement:edit")
|
||||
@Log(title = "需求", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/batch")
|
||||
@ApiOperation(value = "批量修改产品需求")
|
||||
public AjaxResult batchEdit(
|
||||
@ApiParam(name = "pmsProductRequirementBatchUpdateVo",
|
||||
value = "【字段说明】(非必填字段不传递则代表不更新,传null则代表置空):\n" +
|
||||
"idList:需求Id列表(必填),示例:[1,2,3];\n" +
|
||||
"pmsProductModuleId:关联产品模块ID;\n" +
|
||||
"pmsProductPlanId:关联产品里程碑ID;\n")
|
||||
@RequestBody JSONObject pmsProductRequirementBatchUpdateVo) {
|
||||
return toAjax(pmsProductRequirementService.batchUpdatePmsProductRequirement(pmsProductRequirementBatchUpdateVo));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
package com.microservices.pms.product.controller;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.microservices.common.core.web.controller.BaseController;
|
||||
import com.microservices.common.core.web.domain.GenericsAjaxResult;
|
||||
import com.microservices.common.core.web.page.GenericsTableDataInfo;
|
||||
import com.microservices.common.security.annotation.RequiresPermissions;
|
||||
import com.microservices.pms.product.domain.vo.ProductReqOperationRecordDataVo;
|
||||
import com.microservices.pms.product.domain.vo.ProductReqSpecsAssociatedTestcaseDataVo;
|
||||
import com.microservices.pms.product.service.IPmsProductReqOperationRecordService;
|
||||
import com.microservices.pms.product.service.IPmsProductRequirementService;
|
||||
import com.microservices.pms.project.service.IPmsProjectTestcaseService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
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.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 产品需求相关接口
|
||||
*
|
||||
* @author otto
|
||||
* @date 2023-10-10
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "项目管理-需求跟踪相关接口")
|
||||
@RequestMapping("/{enterpriseIdentifier}/productRequirementTracking")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "enterpriseIdentifier", value = "企业标识", paramType = "path", dataType = "String")
|
||||
})
|
||||
public class ProductReqTrackingController extends BaseController {
|
||||
@Autowired
|
||||
private IPmsProductReqOperationRecordService pmsProductReqOperationRecordService;
|
||||
@Autowired
|
||||
private IPmsProjectTestcaseService pmsProjectTestcaseService;
|
||||
@Autowired
|
||||
private IPmsProductRequirementService pmsProductRequirementService;
|
||||
|
||||
/**
|
||||
* 查询原始需求变更记录
|
||||
*/
|
||||
@ApiOperation(value = "查询原始需求变更记录")
|
||||
@RequiresPermissions("pms:pmsProduct:show")
|
||||
@GetMapping("/{userReqId}/userReqChangeRecord")
|
||||
public GenericsTableDataInfo<ProductReqOperationRecordDataVo> getUserReqChangeRecordList(
|
||||
@PathVariable("userReqId") Long userReqId) {
|
||||
return getGenericsDataTable(pmsProductReqOperationRecordService.selectUserReqChangeRecordList(userReqId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询原始需求变更记录
|
||||
*/
|
||||
@ApiOperation(value = "查询需求变更记录")
|
||||
@RequiresPermissions("pms:pmsProduct:show")
|
||||
@GetMapping("/{reqSpecsId}/reqSpecsChangeRecord")
|
||||
public GenericsTableDataInfo<ProductReqOperationRecordDataVo> getReqSpecsChangeRecordList(
|
||||
@PathVariable("reqSpecsId") Long reqSpecsId) {
|
||||
return getGenericsDataTable(pmsProductReqOperationRecordService.selectReqSpecsChangeRecordList(reqSpecsId));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询需求关联的测试用例")
|
||||
@RequiresPermissions("pms:pmsProduct:show")
|
||||
@GetMapping("/{reqSpecsId}/associatedTestcase")
|
||||
public GenericsTableDataInfo<ProductReqSpecsAssociatedTestcaseDataVo> getReqSpecsAssociatedTestcaseList(
|
||||
@PathVariable("reqSpecsId") Long reqSpecsId) {
|
||||
return getGenericsDataTable(pmsProjectTestcaseService.selectReqSpecsAssociatedTestcaseList(reqSpecsId));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询需求关联的计划")
|
||||
@RequiresPermissions("pms:pmsProduct:show")
|
||||
@GetMapping("/{reqSpecsId}/associatedPlan")
|
||||
public GenericsAjaxResult<JSONObject> getReqSpecsAssociatedPlanData(
|
||||
@PathVariable("reqSpecsId") Long reqSpecsId) {
|
||||
return GenericsAjaxResult.success(pmsProductRequirementService.selectReqSpecsAssociatedPlanData(reqSpecsId));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,113 @@
|
|||
package com.microservices.pms.product.controller;
|
||||
|
||||
import com.microservices.common.core.web.controller.BaseController;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.common.core.web.domain.GenericsAjaxResult;
|
||||
import com.microservices.common.core.web.page.GenericsTableDataInfo;
|
||||
import com.microservices.common.log.annotation.Log;
|
||||
import com.microservices.common.log.enums.BusinessType;
|
||||
import com.microservices.common.security.annotation.RequiresPermissions;
|
||||
import com.microservices.pms.product.domain.vo.*;
|
||||
import com.microservices.pms.product.service.IPmsProductRequirementService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 产品原始需求相关接口
|
||||
*
|
||||
* @author otto
|
||||
* @date 2023-10-10
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "项目管理-原始需求相关接口")
|
||||
@RequestMapping("/{enterpriseIdentifier}/productUserRequirement")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "enterpriseIdentifier", value = "企业标识", paramType = "path", dataType = "String")
|
||||
})
|
||||
public class ProductUserReqController extends BaseController {
|
||||
@Autowired
|
||||
private IPmsProductRequirementService pmsProductRequirementService;
|
||||
|
||||
/**
|
||||
* 查询产品原始需求列表
|
||||
*/
|
||||
@ApiOperation(value = "查询原始需求列表")
|
||||
@RequiresPermissions("pms:pmsProduct:show")
|
||||
@GetMapping("/list")
|
||||
public GenericsTableDataInfo<ProductUserReqDataVo> list(@Validated ProductUserReqSearchVo productUserReqSearchVo) {
|
||||
return pmsProductRequirementService.selectUserReqList(productUserReqSearchVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取原始需求详细信息
|
||||
*/
|
||||
@RequiresPermissions("pms:pmsProduct:show")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiOperation(value = "获取原始需求详细信息")
|
||||
public GenericsAjaxResult<ProductUserReqDetailVo> getInfo(@PathVariable("id") Long id) {
|
||||
return genericsSuccess(pmsProductRequirementService.selectUserReqDetailById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增原始需求
|
||||
*/
|
||||
@RequiresPermissions("pms:pmsProductRequirement:add")
|
||||
@Log(title = "原始需求", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@ApiOperation(value = "新增原始需求")
|
||||
public AjaxResult add(@PathVariable String enterpriseIdentifier,
|
||||
@RequestBody @Validated ProductUserReqInputVo productUserReqInputVo) {
|
||||
productUserReqInputVo.setEnterpriseIdentifier(enterpriseIdentifier);
|
||||
return success(pmsProductRequirementService.insertUserReq(productUserReqInputVo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改原始需求
|
||||
*/
|
||||
@RequiresPermissions("pms:pmsProductRequirement:edit")
|
||||
@Log(title = "原始需求", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
@ApiOperation(value = "修改原始需求")
|
||||
public AjaxResult edit(@RequestBody @Validated ProductUserReqUpdateVo productUserReqUpdateVo) {
|
||||
return toAjax(pmsProductRequirementService.updateUserReq(productUserReqUpdateVo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除原始需求
|
||||
*/
|
||||
@RequiresPermissions("pms:pmsProductRequirement:remove")
|
||||
@Log(title = "原始需求", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
@ApiOperation(value = "删除原始需求")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(pmsProductRequirementService.deleteUserReqByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 评审原始需求
|
||||
*/
|
||||
@RequiresPermissions("pms:pmsProductRequirement:edit")
|
||||
@Log(title = "原始需求", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/review")
|
||||
@ApiOperation(value = "评审原始需求")
|
||||
public AjaxResult review(@RequestBody @Validated ProductReqReviewVo productReqReviewVo) {
|
||||
return toAjax(pmsProductRequirementService.reviewUserReq(productReqReviewVo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询原始需求状态列表
|
||||
*/
|
||||
@ApiOperation(value = "查询原始需求状态列表")
|
||||
@RequiresPermissions("pms:pmsProduct:show")
|
||||
@GetMapping("/statusList")
|
||||
public List<ReqStatusCommonVo> statusList() {
|
||||
return pmsProductRequirementService.selectUserReqStatusList();
|
||||
}
|
||||
}
|
||||
|
|
@ -66,16 +66,13 @@ public class PmsProduct extends BaseEntity
|
|||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
/** 预留字段1 */
|
||||
@ApiModelProperty(value = "自定义标识")
|
||||
private String customIdentifier;
|
||||
|
||||
@ApiModelProperty(value = "预留字段1")
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
private String reservedField1;
|
||||
|
||||
/** 预留字段2 */
|
||||
@ApiModelProperty(value = "预留字段2")
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
private String reservedField2;
|
||||
|
||||
|
||||
public PmsProductDataVo toPmsProductDataVo() {
|
||||
PmsProductDataVo target = new PmsProductDataVo();
|
||||
|
|
|
|||
|
|
@ -83,6 +83,9 @@ public class PmsProductModule extends BaseEntity
|
|||
@ApiModelProperty(value = "关联项目ID")
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
private Long pmsProjectId;
|
||||
|
||||
@ApiModelProperty(value = "是否为固定模块")
|
||||
private Boolean isFixedModule;
|
||||
/**
|
||||
* 子模块
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -12,22 +12,26 @@ import lombok.Data;
|
|||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 产品计划对象 pms_product_plan
|
||||
* 产品里程碑对象 pms_product_plan
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2023-10-10
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("产品计划对象")
|
||||
@ApiModel("产品里程碑对象")
|
||||
public class PmsProductPlan extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 产品计划ID */
|
||||
/**
|
||||
* 产品里程碑ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/** 计划标题 */
|
||||
@ApiModelProperty(value = "计划标题")
|
||||
/**
|
||||
* 里程碑标题
|
||||
*/
|
||||
@ApiModelProperty(value = "里程碑标题")
|
||||
private String planTitle;
|
||||
|
||||
/** 关联产品标识 */
|
||||
|
|
@ -52,8 +56,10 @@ public class PmsProductPlan extends BaseEntity
|
|||
@ApiModelProperty(value = "结束时间")
|
||||
private Date endTime;
|
||||
|
||||
/** 计划描述 */
|
||||
@ApiModelProperty(value = "计划描述")
|
||||
/**
|
||||
* 里程碑描述
|
||||
*/
|
||||
@ApiModelProperty(value = "里程碑描述")
|
||||
private String planDescription;
|
||||
|
||||
/** 工作量 */
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue