Compare commits
278 Commits
1-audit-li
...
dev
Author | SHA1 | Date |
---|---|---|
|
70c2ab3f8c | 1 month ago |
|
9c2fcef028 | 1 month ago |
|
0a8a5f2df4 | 2 months ago |
|
7713078596 | 2 months ago |
|
e6b4ed9f2c | 2 months ago |
|
6dc88fdada | 2 months ago |
|
234b043d72 | 2 months ago |
|
f522ed9b81 | 2 months ago |
|
6f6a8b0eac | 2 months ago |
|
eb5ad650c9 | 2 months ago |
|
9274dfc3d0 | 2 months ago |
|
41b5d42330 | 2 months ago |
|
c6c0db0232 | 2 months ago |
|
6a04b5e037 | 2 months ago |
|
a9c617075f | 2 months ago |
|
db4620694c | 2 months ago |
|
70c950cdd7 | 2 months ago |
|
a9e8336986 | 2 months ago |
|
23797bae9e | 2 months ago |
|
37c1d0db08 | 2 months ago |
|
b49adee62a | 2 months ago |
|
c8382c4aea | 2 months ago |
|
6e40343d6c | 2 months ago |
|
55a76daa5a | 3 months ago |
|
5371df1f50 | 3 months ago |
|
4ab3637d9c | 4 years ago |
|
893f7ae1f2 | 4 years ago |
|
06f657f5c2 | 4 years ago |
|
b13f331f2c | 4 years ago |
|
12973109d3 | 4 years ago |
|
278e2135bb | 4 years ago |
|
b662437afe | 4 years ago |
|
5ae17fbe83 | 4 years ago |
|
3f16c8a078 | 4 years ago |
|
e3da8c710f | 4 years ago |
|
54b992a7f3 | 4 years ago |
|
e20fb468f9 | 4 years ago |
|
1a3ffb7bab | 4 years ago |
|
d29416fb76 | 4 years ago |
|
37053d853b | 4 years ago |
|
b961c8e3dc | 4 years ago |
|
3dd6210f42 | 4 years ago |
|
5520f19357 | 4 years ago |
|
2cc3008dc5 | 4 years ago |
|
708a1a6d32 | 4 years ago |
|
751195bf96 | 4 years ago |
|
6adb3fec71 | 4 years ago |
|
ae0a1f3532 | 4 years ago |
|
e167a68bc6 | 4 years ago |
|
6b717f26d3 | 4 years ago |
|
b20ab96b55 | 4 years ago |
|
2c55293e0e | 4 years ago |
|
a14735699c | 4 years ago |
|
9f21850767 | 4 years ago |
|
abde7f311c | 4 years ago |
|
5333258c62 | 4 years ago |
|
2149dfd32f | 4 years ago |
|
34c5e79cbb | 4 years ago |
|
2110c21be7 | 4 years ago |
|
30e06335e9 | 4 years ago |
|
c528711431 | 4 years ago |
|
0bb9768bda | 4 years ago |
|
52d6210875 | 4 years ago |
|
65569732d6 | 4 years ago |
|
1d0c90d932 | 4 years ago |
|
440def2b71 | 4 years ago |
|
1460e26127 | 4 years ago |
|
1f5cde4b66 | 4 years ago |
|
10a99d42cf | 4 years ago |
|
90c11c6946 | 4 years ago |
|
134f75666c | 4 years ago |
|
b8d492724c | 4 years ago |
|
bc48a486ee | 4 years ago |
|
c36876f7e7 | 4 years ago |
|
a136acb0b4 | 5 years ago |
|
7d1f5e9059 | 5 years ago |
|
4c4c1b2015 | 5 years ago |
|
6b90d7b0c0 | 5 years ago |
|
fa03edf32d | 5 years ago |
|
4e1d99392a | 5 years ago |
|
ac55481bc6 | 5 years ago |
|
71448364d7 | 5 years ago |
|
c57914db7c | 5 years ago |
|
ab20b3843f | 5 years ago |
|
268a311a87 | 5 years ago |
|
a67eb23714 | 5 years ago |
|
5ee1f33de1 | 5 years ago |
|
107ddb90ac | 5 years ago |
|
ac6bd13c6c | 5 years ago |
|
e7061f4545 | 5 years ago |
|
d741bd019a | 5 years ago |
|
846d94bb46 | 5 years ago |
|
5755cf2f92 | 5 years ago |
|
7587ff7a51 | 5 years ago |
|
6c220355ee | 5 years ago |
|
779f286988 | 5 years ago |
|
7753dd104c | 5 years ago |
|
48955b9cfd | 5 years ago |
|
9665653234 | 5 years ago |
|
04f545db1c | 5 years ago |
|
746f443931 | 5 years ago |
|
1be74769bf | 5 years ago |
|
2cdec4bcda | 5 years ago |
|
a17dac55e2 | 5 years ago |
|
9e6993f136 | 5 years ago |
|
0647438bfb | 5 years ago |
|
41c4ee7997 | 5 years ago |
|
9d3ee273f6 | 5 years ago |
|
3267138524 | 5 years ago |
|
df1bf873ff | 5 years ago |
|
24f447aed7 | 5 years ago |
|
36c4e52e37 | 5 years ago |
|
529db0442c | 5 years ago |
|
db97892af2 | 5 years ago |
|
ff19001f1f | 5 years ago |
|
2012a58fc2 | 5 years ago |
|
9ba4476f80 | 5 years ago |
|
098f70ede6 | 5 years ago |
|
d84b1fcbdc | 5 years ago |
|
b44bbaec75 | 5 years ago |
|
436c15e727 | 5 years ago |
|
e4f5bede2a | 5 years ago |
|
888fecf687 | 5 years ago |
|
51ed732ae8 | 5 years ago |
|
18bb0b85ac | 5 years ago |
|
615c70d12a | 5 years ago |
|
96d166d031 | 5 years ago |
|
fb23f182de | 5 years ago |
|
f8c1e52ca4 | 5 years ago |
|
59e52aaf4a | 5 years ago |
|
dc467ec72c | 5 years ago |
|
019ac6e0ad | 5 years ago |
|
1ccec83390 | 5 years ago |
|
4104844b1e | 5 years ago |
|
c0afabc37c | 5 years ago |
|
624573a47a | 5 years ago |
|
fddc15af5a | 5 years ago |
|
bdb8fd8ce4 | 5 years ago |
|
acd58005de | 5 years ago |
|
1ff38fc80e | 5 years ago |
|
c77702704f | 5 years ago |
|
44824e53b2 | 5 years ago |
|
bacd3827e3 | 5 years ago |
|
0cd8003dd7 | 5 years ago |
|
bdff81d25e | 5 years ago |
|
482964fe53 | 5 years ago |
|
dc52968ddf | 5 years ago |
|
22abf6a27d | 5 years ago |
|
abea3c7dad | 5 years ago |
|
23d4e5602f | 5 years ago |
|
bde4ac5f1c | 5 years ago |
|
3898dcf1c1 | 5 years ago |
|
2d230afa35 | 5 years ago |
|
db3252d822 | 5 years ago |
|
e6dc2abdd9 | 5 years ago |
|
ae8dc58a9d | 5 years ago |
|
38478835fb | 5 years ago |
|
7edb9d2aa3 | 5 years ago |
|
961a6a318e | 5 years ago |
|
267bd5b0f3 | 5 years ago |
|
a5ac2bcbc2 | 5 years ago |
|
291f4e1e33 | 5 years ago |
|
53307c6add | 5 years ago |
|
a405267092 | 5 years ago |
|
1224cc7a23 | 5 years ago |
|
a878f8c22c | 5 years ago |
|
d2ce6d604e | 5 years ago |
|
b4b7b9087e | 5 years ago |
|
a7b48e1534 | 5 years ago |
|
9388302a47 | 5 years ago |
|
e680aa30c4 | 5 years ago |
|
4498b71259 | 5 years ago |
|
632c6299b7 | 5 years ago |
|
9013d79228 | 5 years ago |
|
192adbfa0b | 5 years ago |
|
eb30d07d10 | 5 years ago |
|
eceb8ec528 | 5 years ago |
|
330ffc4df1 | 5 years ago |
|
77ce908d58 | 5 years ago |
|
8ffafd6693 | 5 years ago |
|
e967e2bfee | 5 years ago |
|
c25392337a | 5 years ago |
|
3b0a2dd964 | 5 years ago |
|
8d1e410e83 | 5 years ago |
|
eb87c6d52f | 5 years ago |
|
a35bcfce1b | 5 years ago |
|
6258e7b6bf | 5 years ago |
|
c4b35ddf6a | 5 years ago |
|
7388e12e3f | 5 years ago |
|
4bb4fd6bca | 5 years ago |
|
4eeb79ab80 | 5 years ago |
|
336a16ff73 | 5 years ago |
|
0e7fdac980 | 5 years ago |
|
482e2b3595 | 5 years ago |
|
2b911017b1 | 5 years ago |
|
0cd3055176 | 5 years ago |
|
280c39dae4 | 5 years ago |
|
828d320e0f | 5 years ago |
|
678397e970 | 5 years ago |
|
916bbae414 | 5 years ago |
|
477a9fd6ff | 5 years ago |
|
59d6edb818 | 5 years ago |
|
f4479c2ab7 | 5 years ago |
|
193b2b3a32 | 5 years ago |
|
837a9f465c | 5 years ago |
|
eba3592410 | 5 years ago |
|
22195813ae | 5 years ago |
|
43e7b9fe1f | 5 years ago |
|
308da4113d | 5 years ago |
|
c9ecae9842 | 5 years ago |
|
d4364b9767 | 5 years ago |
|
505a054cc8 | 5 years ago |
|
8bb9e3a844 | 5 years ago |
|
661da17f73 | 5 years ago |
|
01bcac2680 | 5 years ago |
|
421ed635e8 | 5 years ago |
|
24a1276005 | 5 years ago |
|
512a805e8c | 5 years ago |
|
ab17b9f152 | 5 years ago |
|
181086c9db | 5 years ago |
|
82e454a50b | 5 years ago |
|
c303d65c8d | 5 years ago |
|
7c1b124c94 | 5 years ago |
|
29cfadef02 | 5 years ago |
|
ef521123dd | 5 years ago |
|
82ae42f7fc | 5 years ago |
|
af09938e66 | 5 years ago |
|
1c8359f900 | 5 years ago |
|
47131f1fb7 | 5 years ago |
|
284a3f51e9 | 5 years ago |
|
bd24525315 | 5 years ago |
|
3e9bbb3584 | 5 years ago |
|
16885cc94f | 5 years ago |
|
b1c090b0ea | 5 years ago |
|
ecda92326b | 5 years ago |
|
457f1da985 | 5 years ago |
|
5f214620bf | 5 years ago |
|
c21739bfc6 | 5 years ago |
|
bab621677e | 5 years ago |
|
8b52518c4a | 5 years ago |
|
d7c4e6b222 | 5 years ago |
|
bb9f412480 | 5 years ago |
|
c0e66e81a2 | 5 years ago |
|
1823c1ba50 | 5 years ago |
|
e468646cd6 | 5 years ago |
|
90799356ab | 5 years ago |
|
4213524dbd | 5 years ago |
|
f960d4de1b | 5 years ago |
|
097f7827b0 | 5 years ago |
|
50314246f5 | 5 years ago |
|
279cc0e18a | 5 years ago |
|
b1e101c940 | 5 years ago |
|
241c489b21 | 5 years ago |
|
52ae197f34 | 5 years ago |
|
4025aa67ca | 5 years ago |
|
4bab980f62 | 5 years ago |
|
ee55e08fee | 5 years ago |
|
82ab40a608 | 5 years ago |
|
83f3f7d6b9 | 5 years ago |
|
b2d4d52675 | 5 years ago |
|
4d2d7fa113 | 5 years ago |
|
9393fbe326 | 5 years ago |
|
2d6de6b535 | 5 years ago |
|
955bdaa438 | 5 years ago |
|
60dfad5d76 | 5 years ago |
|
70920cc612 | 5 years ago |
|
e16b1da761 | 5 years ago |
|
09cae66ca4 | 5 years ago |
|
7684bac74d | 5 years ago |
|
6469ddcd42 | 5 years ago |
|
92a0674b95 | 5 years ago |
|
8fbce55028 | 5 years ago |
|
2cf3e52596 | 5 years ago |
|
167de9bf65 | 5 years ago |
|
993a034527 | 5 years ago |
|
9bd954ea9b | 5 years ago |
|
1487affb8e | 5 years ago |
|
e74261184f | 5 years ago |
@ -0,0 +1,19 @@
|
||||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage('Test') {
|
||||
steps {
|
||||
sh "./gradlew clean test --info"
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
script {
|
||||
if (currentBuild.currentResult == 'FAILURE') {
|
||||
step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "a.romanov@ulstu.ru", sendToIndividuals: true])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
package ru.ulstu.configuration;
|
||||
|
||||
import org.eclipse.jetty.server.ServerConnector;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer;
|
||||
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
|
||||
import org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainerFactory;
|
||||
import org.springframework.boot.context.embedded.jetty.JettyServerCustomizer;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class HttpListenerConfiguration implements EmbeddedServletContainerCustomizer {
|
||||
@Value("${server.http.port}")
|
||||
private int httpPort;
|
||||
|
||||
private void configureJetty(JettyEmbeddedServletContainerFactory jettyFactory) {
|
||||
jettyFactory.addServerCustomizers((JettyServerCustomizer) server -> {
|
||||
ServerConnector serverConnector = new ServerConnector(server);
|
||||
serverConnector.setPort(httpPort);
|
||||
server.addConnector(serverConnector);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void customize(ConfigurableEmbeddedServletContainer container) {
|
||||
if (container instanceof JettyEmbeddedServletContainerFactory) {
|
||||
configureJetty((JettyEmbeddedServletContainerFactory) container);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
package ru.ulstu.configuration;
|
||||
|
||||
import com.google.common.base.Predicates;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
@Configuration
|
||||
@EnableSwagger2
|
||||
public class SwaggerConfiguration {
|
||||
@Bean
|
||||
public Docket swaggerApi() {
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.select()
|
||||
.apis(RequestHandlerSelectors.any())
|
||||
.paths(Predicates.not(PathSelectors.regex("/error")))
|
||||
.build();
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package ru.ulstu.core.model;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
import org.springframework.security.web.authentication.AuthenticationFailureHandler;
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.ulstu.user.error.UserBlockedException;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@Component
|
||||
public class AuthFailureHandler implements AuthenticationFailureHandler {
|
||||
@Override
|
||||
public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response,
|
||||
AuthenticationException ex) throws IOException {
|
||||
if (ex.getClass() == UserBlockedException.class) {
|
||||
response.sendRedirect("/users/block");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package ru.ulstu.core.model;
|
||||
|
||||
import ru.ulstu.deadline.model.Deadline;
|
||||
import ru.ulstu.timeline.model.Event;
|
||||
import ru.ulstu.user.model.User;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface EventSource {
|
||||
List<Deadline> getDeadlines();
|
||||
|
||||
String getTitle();
|
||||
|
||||
List<User> getRecipients();
|
||||
|
||||
void addObjectToEvent(Event event);
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
package ru.ulstu.core.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TreeDto {
|
||||
private Integer id;
|
||||
private String text;
|
||||
private List<TreeDto> children = new ArrayList<>();
|
||||
|
||||
public TreeDto() {
|
||||
}
|
||||
|
||||
public <T extends TreeEntity> TreeDto(TreeEntity item) {
|
||||
this.text = item.toString();
|
||||
this.id = item.getId();
|
||||
}
|
||||
|
||||
public TreeDto(String rootName) {
|
||||
this.text = rootName;
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
return text;
|
||||
}
|
||||
|
||||
public List<TreeDto> getChildren() {
|
||||
return children;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
package ru.ulstu.core.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface TreeEntity<T> {
|
||||
|
||||
Integer getId();
|
||||
|
||||
List<T> getChildren();
|
||||
|
||||
void setChildren(List<T> children);
|
||||
|
||||
T getParent();
|
||||
|
||||
void setParent(T parent);
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package ru.ulstu.core.model;
|
||||
|
||||
import ru.ulstu.user.model.User;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public interface UserActivity {
|
||||
String getTitle();
|
||||
|
||||
Set<User> getActivityUsers();
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
package ru.ulstu.core.model;
|
||||
|
||||
import ru.ulstu.user.model.User;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public interface UserContainer {
|
||||
Set<User> getUsers();
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package ru.ulstu.core.navigation;
|
||||
|
||||
public class Page {
|
||||
public static final String INDEX = "/index.html";
|
||||
public static final String PAPER = "/paper/paper.html";
|
||||
public static final String PAPER_LIST = "/paper/papers.html";
|
||||
public static final String PAPER_DASHBOARD = "/paper/dashboard.html";
|
||||
public static final String GRANT = "/grant/grant.html";
|
||||
public static final String GRANT_LIST = "/grant/grants.html";
|
||||
public static final String GRANT_DASHBOARD = "/grant/dashboard.html";
|
||||
public static final String USER_LIST = "/admin/users.html";
|
||||
public static final String LOGOUT = "/logout";
|
||||
public static final String CONFERENCE = "/conference/conference.html";
|
||||
public static final String CONFERENCE_DASHBOARD = "/conference/dashboard.html";
|
||||
public static final String CONFERENCE_LIST = "/conference/conferences.html";
|
||||
public static final String PROJECT_DASHBOARD = "/conference/dashboard.html";
|
||||
|
||||
public String getIndex() {
|
||||
return INDEX;
|
||||
}
|
||||
|
||||
public String getPaperList() {
|
||||
return PAPER_LIST;
|
||||
}
|
||||
|
||||
public String getPaperDashboard() {
|
||||
return PAPER_DASHBOARD;
|
||||
}
|
||||
|
||||
public String getUserList() {
|
||||
return USER_LIST;
|
||||
}
|
||||
|
||||
public String getLogout() {
|
||||
return LOGOUT;
|
||||
}
|
||||
|
||||
public String getGrantList() {
|
||||
return GRANT_LIST;
|
||||
}
|
||||
|
||||
public String getGrantDashboard() {
|
||||
return GRANT_DASHBOARD;
|
||||
}
|
||||
|
||||
public String getPaper() {
|
||||
return PAPER;
|
||||
}
|
||||
|
||||
public String getGrant() {
|
||||
return GRANT;
|
||||
}
|
||||
|
||||
public String getConferenceDashboard() {
|
||||
return CONFERENCE_DASHBOARD;
|
||||
}
|
||||
|
||||
public String getProjectDashboard() {
|
||||
return PROJECT_DASHBOARD;
|
||||
}
|
||||
|
||||
public String getConference() {
|
||||
return CONFERENCE;
|
||||
}
|
||||
|
||||
public String getConferenceList() {
|
||||
return CONFERENCE_LIST;
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
package ru.ulstu.core.util;
|
||||
|
||||
public class NumberUtils {
|
||||
public static Double ceil(Double number) {
|
||||
if (number == null) {
|
||||
return 0.0;
|
||||
}
|
||||
return Double.valueOf(Math.ceil(number));
|
||||
}
|
||||
|
||||
public static Double round(Double number) {
|
||||
if (number == null) {
|
||||
return 0.0;
|
||||
}
|
||||
return Double.valueOf(Math.ceil(number * 100)) / 100;
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package ru.ulstu.grant.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import ru.ulstu.configuration.Constants;
|
||||
import ru.ulstu.grant.service.GrantService;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.ParseException;
|
||||
|
||||
import static ru.ulstu.paper.controller.PaperRestController.URL;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(URL)
|
||||
public class GrantRestController {
|
||||
public static final String URL = Constants.API_1_0 + "grants";
|
||||
|
||||
private final GrantService grantService;
|
||||
|
||||
public GrantRestController(GrantService grantService) {
|
||||
this.grantService = grantService;
|
||||
}
|
||||
|
||||
@GetMapping("/grab")
|
||||
public void grab() throws IOException, ParseException {
|
||||
grantService.createFromKias();
|
||||
}
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package ru.ulstu.grant.page;
|
||||
|
||||
import com.gargoylesoftware.htmlunit.html.DomNode;
|
||||
import com.gargoylesoftware.htmlunit.html.HtmlElement;
|
||||
import com.gargoylesoftware.htmlunit.html.HtmlPage;
|
||||
import com.gargoylesoftware.htmlunit.html.HtmlTableRow;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class KiasPage {
|
||||
private final static String KIAS_GRANT_DATE_FORMAT = "dd.MM.yyyy HH:mm";
|
||||
private final HtmlPage page;
|
||||
|
||||
public KiasPage(HtmlPage page) {
|
||||
this.page = page;
|
||||
}
|
||||
|
||||
public boolean goToNextPage() {
|
||||
try {
|
||||
HtmlElement nextPageLink = page.getHtmlElementById("js-ctrlNext");
|
||||
if (nextPageLink.isDisplayed()) {
|
||||
nextPageLink.click();
|
||||
return true;
|
||||
}
|
||||
} finally {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public List<DomNode> getPageOfGrants() {
|
||||
return page.getByXPath("/html/body/div[2]/div/div[2]/main/div[1]/table/tbody/tr");
|
||||
}
|
||||
|
||||
public String getGrantTitle(DomNode grant) {
|
||||
return ((DomNode) grant.getFirstByXPath("td[2]")).getTextContent() + " "
|
||||
+ ((DomNode) grant.getFirstByXPath("td[@class='tertiary']/a")).getTextContent();
|
||||
}
|
||||
|
||||
public Date parseDeadLineDate(DomNode grantElement) throws ParseException {
|
||||
String deadlineDate = getFirstDeadline(grantElement); //10.06.2019 23:59
|
||||
SimpleDateFormat formatter = new SimpleDateFormat(KIAS_GRANT_DATE_FORMAT);
|
||||
return formatter.parse(deadlineDate);
|
||||
}
|
||||
|
||||
private String getFirstDeadline(DomNode grantElement) {
|
||||
return ((DomNode) grantElement.getFirstByXPath("td[5]")).getTextContent();
|
||||
}
|
||||
|
||||
public boolean isTableRowGrantLine(DomNode grantElement) {
|
||||
return !((HtmlTableRow) grantElement).getAttribute("class").contains("pagerSavedHeightSpacer");
|
||||
}
|
||||
}
|
@ -1,11 +1,25 @@
|
||||
package ru.ulstu.grant.repository;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import ru.ulstu.grant.model.Grant;
|
||||
import ru.ulstu.name.BaseRepository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface GrantRepository extends JpaRepository<Grant, Integer> {
|
||||
public interface GrantRepository extends JpaRepository<Grant, Integer>, BaseRepository {
|
||||
|
||||
List<Grant> findByStatus(Grant.GrantStatus status);
|
||||
|
||||
Grant findFirstByTitle(String title);
|
||||
|
||||
Grant findGrantById(Integer grantId);
|
||||
|
||||
@Override
|
||||
@Query("SELECT title FROM Grant g WHERE (g.title = :name) AND (:id IS NULL OR g.id != :id) ")
|
||||
List<String> findByNameAndNotId(@Param("name") String name, @Param("id") Integer id);
|
||||
|
||||
@Query("SELECT g FROM Grant g WHERE (g.status <> 'SKIPPED') AND (g.status <> 'COMPLETED')")
|
||||
List<Grant> findAllActive();
|
||||
}
|
||||
|
@ -0,0 +1,25 @@
|
||||
package ru.ulstu.index.model;
|
||||
|
||||
public class Section {
|
||||
private final String title;
|
||||
private final String image;
|
||||
private final String href;
|
||||
|
||||
public Section(String title, String href, String image) {
|
||||
this.title = title;
|
||||
this.image = image;
|
||||
this.href = href;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public String getImage() {
|
||||
return image;
|
||||
}
|
||||
|
||||
public String getHref() {
|
||||
return href;
|
||||
}
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
package ru.ulstu.odinexample.controller;
|
||||
|
||||
public class OdinExampleController {
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
package ru.ulstu.odinexample.model;
|
||||
|
||||
public class OdinExampleDto {
|
||||
}
|
@ -1,103 +0,0 @@
|
||||
package ru.ulstu.odinexample.model;
|
||||
|
||||
import ru.ulstu.core.util.DateUtils;
|
||||
import ru.ulstu.odin.model.annotation.OdinCaption;
|
||||
import ru.ulstu.odin.model.annotation.OdinDate;
|
||||
import ru.ulstu.odin.model.annotation.OdinNumeric;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.util.Date;
|
||||
|
||||
public class OdinExampleListDto {
|
||||
@OdinCaption("instant")
|
||||
@OdinDate(type = OdinDate.OdinDateType.DATETIME)
|
||||
private Instant instant;
|
||||
@OdinCaption("date")
|
||||
private Date date;
|
||||
@OdinCaption("localdate")
|
||||
private LocalDate localDate;
|
||||
@OdinCaption("localtime")
|
||||
@OdinDate(type = OdinDate.OdinDateType.TIME)
|
||||
private LocalTime localTime;
|
||||
@OdinCaption("localdatetime")
|
||||
@OdinDate(type = OdinDate.OdinDateType.DATETIME)
|
||||
private LocalDateTime localDateTime;
|
||||
@OdinCaption("int")
|
||||
private int intval;
|
||||
@OdinCaption("int+settings")
|
||||
@OdinNumeric(precision = 5, scale = 2)
|
||||
private int intvalset;
|
||||
@OdinCaption("float")
|
||||
private float floatval;
|
||||
@OdinCaption("double")
|
||||
private double aDouble;
|
||||
@OdinCaption("double+set")
|
||||
@OdinNumeric(precision = 5, scale = 3)
|
||||
private double aDoubles;
|
||||
@OdinCaption("int+positive")
|
||||
@OdinNumeric(positiveOnly = true, scale = 2)
|
||||
private int invalpos;
|
||||
|
||||
public OdinExampleListDto() {
|
||||
this.instant = Instant.now();
|
||||
this.date = new Date();
|
||||
this.localDate = LocalDate.now();
|
||||
this.localTime = LocalTime.now();
|
||||
this.localDateTime = LocalDateTime.now();
|
||||
intval = -134;
|
||||
intvalset = 1343423232;
|
||||
floatval = 2323.44F;
|
||||
aDouble = -232323.43434;
|
||||
aDoubles = 0.456456456;
|
||||
invalpos = -23232323;
|
||||
}
|
||||
|
||||
|
||||
public Date getInstant() {
|
||||
return DateUtils.instantToDate(instant);
|
||||
}
|
||||
|
||||
public Date getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
public Date getLocalDate() {
|
||||
return DateUtils.localDateToDate(localDate);
|
||||
}
|
||||
|
||||
public Date getLocalTime() {
|
||||
return DateUtils.localTimeToDate(localTime);
|
||||
}
|
||||
|
||||
public Date getLocalDateTime() {
|
||||
return DateUtils.localDateTimeToDate(localDateTime);
|
||||
}
|
||||
|
||||
public int getIntval() {
|
||||
return intval;
|
||||
}
|
||||
|
||||
public int getIntvalset() {
|
||||
return intvalset;
|
||||
}
|
||||
|
||||
public float getFloatval() {
|
||||
return floatval;
|
||||
}
|
||||
|
||||
public double getaDouble() {
|
||||
return aDouble;
|
||||
}
|
||||
|
||||
public double getaDoubles() {
|
||||
return aDoubles;
|
||||
}
|
||||
|
||||
public int getInvalpos() {
|
||||
return invalpos;
|
||||
}
|
||||
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
package ru.ulstu.odinexample.service;
|
||||
|
||||
public class OdinExampleService {
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
package ru.ulstu.paper.error;
|
||||
|
||||
public class PaperConferenceRelationExistException extends RuntimeException {
|
||||
public PaperConferenceRelationExistException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package ru.ulstu.paper.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AutoCompleteData {
|
||||
private List<String> authors = new ArrayList<>();
|
||||
private List<String> publicationTitles = new ArrayList<>();
|
||||
private List<String> publishers = new ArrayList<>();
|
||||
private List<String> journalOrCollectionTitles = new ArrayList<>();
|
||||
|
||||
public List<String> getAuthors() {
|
||||
return authors;
|
||||
}
|
||||
|
||||
public void setAuthors(List<String> authors) {
|
||||
this.authors = authors;
|
||||
}
|
||||
|
||||
public List<String> getPublicationTitles() {
|
||||
return publicationTitles;
|
||||
}
|
||||
|
||||
public void setPublicationTitles(List<String> publicationTitles) {
|
||||
this.publicationTitles = publicationTitles;
|
||||
}
|
||||
|
||||
public List<String> getPublishers() {
|
||||
return publishers;
|
||||
}
|
||||
|
||||
public void setPublishers(List<String> publishers) {
|
||||
this.publishers = publishers;
|
||||
}
|
||||
|
||||
public List<String> getJournalOrCollectionTitles() {
|
||||
return journalOrCollectionTitles;
|
||||
}
|
||||
|
||||
public void setJournalOrCollectionTitles(List<String> journalOrCollectionTitles) {
|
||||
this.journalOrCollectionTitles = journalOrCollectionTitles;
|
||||
}
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
package ru.ulstu.paper.model;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.EnumType;
|
||||
import jakarta.persistence.Enumerated;
|
||||
import ru.ulstu.core.model.BaseEntity;
|
||||
|
||||
@Entity
|
||||
public class Reference extends BaseEntity {
|
||||
|
||||
private String authors;
|
||||
|
||||
@Column(name = "publication_title")
|
||||
private String publicationTitle;
|
||||
|
||||
@Column(name = "publication_year")
|
||||
private Integer publicationYear;
|
||||
|
||||
private String publisher;
|
||||
|
||||
private String pages;
|
||||
|
||||
@Column(name = "journal_or_collection_title")
|
||||
private String journalOrCollectionTitle;
|
||||
|
||||
@Enumerated(value = EnumType.STRING)
|
||||
@Column(name = "reference_type")
|
||||
private ReferenceDto.ReferenceType referenceType = ReferenceDto.ReferenceType.ARTICLE;
|
||||
|
||||
public String getAuthors() {
|
||||
return authors;
|
||||
}
|
||||
|
||||
public void setAuthors(String authors) {
|
||||
this.authors = authors;
|
||||
}
|
||||
|
||||
public String getPublicationTitle() {
|
||||
return publicationTitle;
|
||||
}
|
||||
|
||||
public void setPublicationTitle(String publicationTitle) {
|
||||
this.publicationTitle = publicationTitle;
|
||||
}
|
||||
|
||||
public Integer getPublicationYear() {
|
||||
return publicationYear;
|
||||
}
|
||||
|
||||
public void setPublicationYear(Integer publicationYear) {
|
||||
this.publicationYear = publicationYear;
|
||||
}
|
||||
|
||||
public String getPublisher() {
|
||||
return publisher;
|
||||
}
|
||||
|
||||
public void setPublisher(String publisher) {
|
||||
this.publisher = publisher;
|
||||
}
|
||||
|
||||
public String getPages() {
|
||||
return pages;
|
||||
}
|
||||
|
||||
public void setPages(String pages) {
|
||||
this.pages = pages;
|
||||
}
|
||||
|
||||
public String getJournalOrCollectionTitle() {
|
||||
return journalOrCollectionTitle;
|
||||
}
|
||||
|
||||
public void setJournalOrCollectionTitle(String journalOrCollectionTitle) {
|
||||
this.journalOrCollectionTitle = journalOrCollectionTitle;
|
||||
}
|
||||
|
||||
public ReferenceDto.ReferenceType getReferenceType() {
|
||||
return referenceType;
|
||||
}
|
||||
|
||||
public void setReferenceType(ReferenceDto.ReferenceType referenceType) {
|
||||
this.referenceType = referenceType;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package ru.ulstu.paper.repository;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import ru.ulstu.paper.model.Reference;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ReferenceRepository extends JpaRepository<Reference, Integer> {
|
||||
void deleteById(Integer id);
|
||||
|
||||
@Query("SELECT DISTINCT r.authors FROM Reference r")
|
||||
List<String> findDistinctAuthors();
|
||||
|
||||
@Query("SELECT DISTINCT r.publicationTitle FROM Reference r")
|
||||
List<String> findDistinctPublicationTitles();
|
||||
|
||||
@Query("SELECT DISTINCT r.publisher FROM Reference r")
|
||||
List<String> findDistinctPublishers();
|
||||
|
||||
@Query("SELECT DISTINCT r.journalOrCollectionTitle FROM Reference r where r.journalOrCollectionTitle <> ''")
|
||||
List<String> findDistinctJournalOrCollectionTitles();
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package ru.ulstu.ping.model;
|
||||
|
||||
import ru.ulstu.user.model.User;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class PingInfo {
|
||||
private User user;
|
||||
private List<Ping> pings = new ArrayList<>();
|
||||
|
||||
public PingInfo(User user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public User getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(User user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public List<Ping> getPings() {
|
||||
return pings;
|
||||
}
|
||||
|
||||
public void setPings(List<Ping> pings) {
|
||||
this.pings = pings;
|
||||
}
|
||||
|
||||
public void addPing(Ping ping) {
|
||||
this.pings.add(ping);
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package ru.ulstu.ping.service;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
import ru.ulstu.core.model.UserActivity;
|
||||
import ru.ulstu.ping.model.Ping;
|
||||
import ru.ulstu.ping.model.PingInfo;
|
||||
import ru.ulstu.ping.repository.PingRepository;
|
||||
import ru.ulstu.user.model.User;
|
||||
import ru.ulstu.user.service.MailService;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@Service
|
||||
public class PingScheduler {
|
||||
private final Logger log = LoggerFactory.getLogger(PingScheduler.class);
|
||||
private final PingRepository pingRepository;
|
||||
private final MailService mailService;
|
||||
private final static String PING_MAIL_SUBJECT = "Ping статистика";
|
||||
|
||||
public PingScheduler(PingRepository pingRepository, MailService mailService) {
|
||||
this.pingRepository = pingRepository;
|
||||
this.mailService = mailService;
|
||||
}
|
||||
|
||||
|
||||
@Scheduled(cron = "0 0 * * 1 ?")
|
||||
public void sendPingsInfo() {
|
||||
log.debug("Scheduler.sendPingsInfo started");
|
||||
|
||||
List<PingInfo> pingInfos = new ArrayList<>();
|
||||
|
||||
for (Ping ping : pingRepository.findByDate(java.sql.Date.valueOf(LocalDate.now().minusWeeks(1)))) {
|
||||
UserActivity pingActivity = ping.getActivity();
|
||||
Set<User> users = pingActivity.getActivityUsers();
|
||||
|
||||
for (User user : users) {
|
||||
PingInfo userPing = pingInfos.stream().filter(u -> u.getUser() == user).findFirst().orElse(null);
|
||||
if (userPing == null) {
|
||||
userPing = new PingInfo(user);
|
||||
pingInfos.add(userPing);
|
||||
}
|
||||
userPing.addPing(ping);
|
||||
}
|
||||
}
|
||||
|
||||
for (PingInfo pingInfo : pingInfos) {
|
||||
mailService.sendEmailFromTemplate(Map.of("pings", pingInfo.getPings()),
|
||||
pingInfo.getUser(), "pingsInfoWeekEmail", PING_MAIL_SUBJECT);
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue