Browse Source

文章设置栏目;文章、资源、专利、论文设置关键词

XMTT 7 years ago
parent
commit
ad9af22024
21 changed files with 442 additions and 11 deletions
  1. 25 0
      src/main/java/com/ekexiu/console/system/dao/ArtKeyWordDao.java
  2. 10 2
      src/main/java/com/ekexiu/console/system/dao/ArticleDao.java
  3. 25 0
      src/main/java/com/ekexiu/console/system/dao/PapKeyWordDao.java
  4. 25 0
      src/main/java/com/ekexiu/console/system/dao/PatKeyWordDao.java
  5. 4 0
      src/main/java/com/ekexiu/console/system/dao/PpaperDao.java
  6. 4 0
      src/main/java/com/ekexiu/console/system/dao/PpatentDao.java
  7. 25 0
      src/main/java/com/ekexiu/console/system/dao/ResKeyWordDao.java
  8. 4 0
      src/main/java/com/ekexiu/console/system/dao/ResourceDao.java
  9. 32 0
      src/main/java/com/ekexiu/console/system/po/ArtKeyWord.java
  10. 9 0
      src/main/java/com/ekexiu/console/system/po/Article.java
  11. 32 0
      src/main/java/com/ekexiu/console/system/po/PapKeyWord.java
  12. 32 0
      src/main/java/com/ekexiu/console/system/po/PatKeyWord.java
  13. 33 0
      src/main/java/com/ekexiu/console/system/po/ResKeyWord.java
  14. 23 0
      src/main/java/com/ekexiu/console/system/service/ArticleService.java
  15. 106 6
      src/main/java/com/ekexiu/console/system/service/KeyWordService.java
  16. 1 1
      src/main/java/com/ekexiu/console/system/service/OrgService.java
  17. 16 0
      src/main/java/com/ekexiu/console/system/service/PaperService.java
  18. 17 0
      src/main/java/com/ekexiu/console/system/service/PatentService.java
  19. 1 1
      src/main/java/com/ekexiu/console/system/service/ProfessorService.java
  20. 17 0
      src/main/java/com/ekexiu/console/system/service/ResourceService.java
  21. 1 1
      src/main/java/com/ekexiu/console/system/service/UserInfoService.java

+ 25 - 0
src/main/java/com/ekexiu/console/system/dao/ArtKeyWordDao.java

@ -0,0 +1,25 @@
1
package com.ekexiu.console.system.dao;
2
3
import com.ekexiu.console.system.po.ArtKeyWord;
4
import org.jfw.apt.orm.annotation.dao.Batch;
5
import org.jfw.apt.orm.annotation.dao.DAO;
6
import org.jfw.apt.orm.annotation.dao.method.From;
7
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
8
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
9
10
import java.sql.Connection;
11
import java.sql.SQLException;
12
13
/**
14
 * Created by TT on 2017/8/23.
15
 */
16
@DAO
17
public interface ArtKeyWordDao {
18
    @Insert
19
    @Batch
20
    int[] insert(Connection con, ArtKeyWord[] okws) throws SQLException;
21
22
    @DeleteWith
23
    @From(ArtKeyWord.class)
24
    int delete(Connection con, String id) throws SQLException;
25
}

+ 10 - 2
src/main/java/com/ekexiu/console/system/dao/ArticleDao.java

@ -49,13 +49,21 @@ public interface ArticleDao {
49 49
    @Batch
50 50
    @UpdateWith
51 51
    @From(Article.class)
52
    int[] updateStatus(Connection con,@Batch String[] articleId,@Set String status) throws SQLException;
52
    int[] updateStatus(Connection con, @Batch String[] articleId, @Set String status) throws SQLException;
53 53
54 54
    @UpdateWith
55 55
    @From(Article.class)
56
    int updateStatus(Connection con,String articleId,@Set String status) throws SQLException;
56
    int updateStatus(Connection con, String articleId, @Set String status) throws SQLException;
57 57
58 58
    @UpdateWith
59 59
    @From(Article.class)
60 60
    int updateSortNum(Connection con, String articleId, @Set long sortNum) throws SQLException;
61
62
    @UpdateWith
63
    @From(Article.class)
64
    int updateColNum(Connection con, String articleId, @Set int colNum) throws SQLException;
65
66
    @UpdateWith
67
    @From(Article.class)
68
    int updateSubject(Connection con, String articleId, @Set String subject) throws SQLException;
61 69
}

+ 25 - 0
src/main/java/com/ekexiu/console/system/dao/PapKeyWordDao.java

@ -0,0 +1,25 @@
1
package com.ekexiu.console.system.dao;
2
3
import com.ekexiu.console.system.po.PapKeyWord;
4
import org.jfw.apt.orm.annotation.dao.Batch;
5
import org.jfw.apt.orm.annotation.dao.DAO;
6
import org.jfw.apt.orm.annotation.dao.method.From;
7
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
8
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
9
10
import java.sql.Connection;
11
import java.sql.SQLException;
12
13
/**
14
 * Created by TT on 2017/8/23.
15
 */
16
@DAO
17
public interface PapKeyWordDao {
18
    @Insert
19
    @Batch
20
    int[] insert(Connection con, PapKeyWord[] okws) throws SQLException;
21
22
    @DeleteWith
23
    @From(PapKeyWord.class)
24
    int delete(Connection con, String id) throws SQLException;
25
}

+ 25 - 0
src/main/java/com/ekexiu/console/system/dao/PatKeyWordDao.java

@ -0,0 +1,25 @@
1
package com.ekexiu.console.system.dao;
2
3
import com.ekexiu.console.system.po.PatKeyWord;
4
import org.jfw.apt.orm.annotation.dao.Batch;
5
import org.jfw.apt.orm.annotation.dao.DAO;
6
import org.jfw.apt.orm.annotation.dao.method.From;
7
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
8
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
9
10
import java.sql.Connection;
11
import java.sql.SQLException;
12
13
/**
14
 * Created by TT on 2017/8/23.
15
 */
16
@DAO
17
public interface PatKeyWordDao {
18
    @Insert
19
    @Batch
20
    int[] insert(Connection con, PatKeyWord[] okws) throws SQLException;
21
22
    @DeleteWith
23
    @From(PatKeyWord.class)
24
    int delete(Connection con, String id) throws SQLException;
25
}

+ 4 - 0
src/main/java/com/ekexiu/console/system/dao/PpaperDao.java

@ -44,4 +44,8 @@ public interface PpaperDao {
44 44
    @UpdateWith
45 45
    @From(Ppaper.class)
46 46
    int updateSortNum(Connection con, String id, @Set long sortNum) throws SQLException;
47
48
    @UpdateWith
49
    @From(Ppaper.class)
50
    int updateKeyWords(Connection con, String id, @Set String keywords) throws SQLException;
47 51
}

+ 4 - 0
src/main/java/com/ekexiu/console/system/dao/PpatentDao.java

@ -45,4 +45,8 @@ public interface PpatentDao {
45 45
    @From(Ppatent.class)
46 46
    int updateSortNum(Connection con, String id, @Set long sortNum) throws SQLException;
47 47
48
    @UpdateWith
49
    @From(Ppatent.class)
50
    int updateKeyWords(Connection con, String id, @Set String keywords) throws SQLException;
51
48 52
}

+ 25 - 0
src/main/java/com/ekexiu/console/system/dao/ResKeyWordDao.java

@ -0,0 +1,25 @@
1
package com.ekexiu.console.system.dao;
2
3
import com.ekexiu.console.system.po.ResKeyWord;
4
import org.jfw.apt.orm.annotation.dao.Batch;
5
import org.jfw.apt.orm.annotation.dao.DAO;
6
import org.jfw.apt.orm.annotation.dao.method.From;
7
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
8
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
9
10
import java.sql.Connection;
11
import java.sql.SQLException;
12
13
/**
14
 * Created by TT on 2017/8/23.
15
 */
16
@DAO
17
public interface ResKeyWordDao {
18
    @Insert
19
    @Batch
20
    int[] insert(Connection con, ResKeyWord[] okws) throws SQLException;
21
22
    @DeleteWith
23
    @From(ResKeyWord.class)
24
    int delete(Connection con, String id) throws SQLException;
25
}

+ 4 - 0
src/main/java/com/ekexiu/console/system/dao/ResourceDao.java

@ -58,4 +58,8 @@ public interface ResourceDao {
58 58
    @UpdateWith
59 59
    @From(Resource.class)
60 60
    int updateSortNum(Connection con, String resourceId, @Set long sortNum) throws SQLException;
61
62
    @UpdateWith
63
    @From(Resource.class)
64
    int updateSubject(Connection con, String resourceId, @Set String subject) throws SQLException;
61 65
}

+ 32 - 0
src/main/java/com/ekexiu/console/system/po/ArtKeyWord.java

@ -0,0 +1,32 @@
1
package com.ekexiu.console.system.po;
2
3
import org.jfw.apt.orm.annotation.entry.Column;
4
import org.jfw.apt.orm.annotation.entry.Table;
5
import org.jfw.apt.orm.core.enums.DE;
6
7
/**
8
 * Created by TT on 2017/8/23.
9
 */
10
@Table
11
public class ArtKeyWord {
12
    private String id;
13
    private String kw;
14
15
    @Column(DE.id_32)
16
    public String getId() {
17
        return id;
18
    }
19
20
    public void setId(String id) {
21
        this.id = id;
22
    }
23
24
    @Column(DE.text_de)
25
    public String getKw() {
26
        return kw;
27
    }
28
29
    public void setKw(String kw) {
30
        this.kw = kw;
31
    }
32
}

+ 9 - 0
src/main/java/com/ekexiu/console/system/po/Article.java

@ -33,6 +33,7 @@ public class Article implements CreateTimeSupported, ModifyTimeSupported {
33 33
    private String status;
34 34
    private long shareId;
35 35
    private long sortNum;
36
    private int colNum;
36 37
37 38
    @Column(DE.id_32)
38 39
    public String getArticleId() {
@ -153,5 +154,13 @@ public class Article implements CreateTimeSupported, ModifyTimeSupported {
153 154
    public void setSortNum(long sortNum) {
154 155
        this.sortNum = sortNum;
155 156
    }
157
158
    @Column(DE.int_de)
159
    public int getColNum() {
160
        return colNum;
161
    }
162
    public void setColNum(int colNum) {
163
        this.colNum = colNum;
164
    }
156 165
}
157 166

+ 32 - 0
src/main/java/com/ekexiu/console/system/po/PapKeyWord.java

@ -0,0 +1,32 @@
1
package com.ekexiu.console.system.po;
2
3
import org.jfw.apt.orm.annotation.entry.Column;
4
import org.jfw.apt.orm.annotation.entry.Table;
5
import org.jfw.apt.orm.core.enums.DE;
6
7
/**
8
 * Created by TT on 2017/8/23.
9
 */
10
@Table
11
public class PapKeyWord {
12
    private String id;
13
    private String kw;
14
15
    @Column(DE.id_32)
16
    public String getId() {
17
        return id;
18
    }
19
20
    public void setId(String id) {
21
        this.id = id;
22
    }
23
24
    @Column(DE.text_de)
25
    public String getKw() {
26
        return kw;
27
    }
28
29
    public void setKw(String kw) {
30
        this.kw = kw;
31
    }
32
}

+ 32 - 0
src/main/java/com/ekexiu/console/system/po/PatKeyWord.java

@ -0,0 +1,32 @@
1
package com.ekexiu.console.system.po;
2
3
import org.jfw.apt.orm.annotation.entry.Column;
4
import org.jfw.apt.orm.annotation.entry.Table;
5
import org.jfw.apt.orm.core.enums.DE;
6
7
/**
8
 * Created by TT on 2017/8/23.
9
 */
10
@Table
11
public class PatKeyWord {
12
    private String id;
13
    private String kw;
14
15
    @Column(DE.id_32)
16
    public String getId() {
17
        return id;
18
    }
19
20
    public void setId(String id) {
21
        this.id = id;
22
    }
23
24
    @Column(DE.text_de)
25
    public String getKw() {
26
        return kw;
27
    }
28
29
    public void setKw(String kw) {
30
        this.kw = kw;
31
    }
32
}

+ 33 - 0
src/main/java/com/ekexiu/console/system/po/ResKeyWord.java

@ -0,0 +1,33 @@
1
package com.ekexiu.console.system.po;
2
3
import org.jfw.apt.orm.annotation.entry.Column;
4
import org.jfw.apt.orm.annotation.entry.Table;
5
import org.jfw.apt.orm.core.enums.DE;
6
7
/**
8
 * Created by TT on 2017/8/23.
9
 */
10
@Table
11
public class ResKeyWord {
12
    private String id;
13
    private String kw;
14
15
    @Column(DE.id_32)
16
    public String getId() {
17
        return id;
18
    }
19
20
    public void setId(String id) {
21
        this.id = id;
22
    }
23
24
    @Column(DE.text_de)
25
    public String getKw() {
26
        return kw;
27
    }
28
29
    public void setKw(String kw) {
30
        this.kw = kw;
31
    }
32
}
33

+ 23 - 0
src/main/java/com/ekexiu/console/system/service/ArticleService.java

@ -23,6 +23,8 @@ import java.sql.SQLException;
23 23
public class ArticleService {
24 24
    @Autowrie
25 25
    private ArticleDao articleDao;
26
    @Autowrie
27
    private KeyWordService keyWordService;
26 28
27 29
    public ArticleDao getArticleDao() {
28 30
        return articleDao;
@ -32,6 +34,14 @@ public class ArticleService {
32 34
        this.articleDao = articleDao;
33 35
    }
34 36
37
    public KeyWordService getKeyWordService() {
38
        return keyWordService;
39
    }
40
41
    public void setKeyWordService(KeyWordService keyWordService) {
42
        this.keyWordService = keyWordService;
43
    }
44
35 45
    @Path("/pq")
36 46
    @Get
37 47
    public PageQueryResult<ArticleInfo> pageQueryResult(@JdbcConn Connection con, @Nullable String title, @Nullable String name, int orderBy, @Nullable String bt, @Nullable String et, @DefaultValue("1") int pageNo, @DefaultValue("10") int pageSize)throws SQLException {
@ -62,4 +72,17 @@ public class ArticleService {
62 72
    public Article query(@JdbcConn Connection con, @PathVar String id) throws SQLException {
63 73
        return this.articleDao.query(con, id);
64 74
    }
75
76
    @Post
77
    @Path("/colNum")
78
    public void updateColNum(@JdbcConn(true) Connection con,String articleId,int colNum)throws SQLException {
79
        this.articleDao.updateColNum(con, articleId, colNum);
80
    }
81
82
    @Post
83
    @Path("/subject")
84
    public void updateSubject(@JdbcConn(true) Connection con,String articleId,@Nullable String subject) throws SQLException {
85
        this.articleDao.updateSubject(con, articleId, subject);
86
        this.keyWordService.refreshArticle(con, articleId, subject);
87
    }
65 88
}

+ 106 - 6
src/main/java/com/ekexiu/console/system/service/KeyWordService.java

@ -1,9 +1,7 @@
1 1
package com.ekexiu.console.system.service;
2 2
3
import com.ekexiu.console.system.dao.OrgKeyWordDao;
4
import com.ekexiu.console.system.dao.ProKeyWordDao;
5
import com.ekexiu.console.system.po.OrgKeyWord;
6
import com.ekexiu.console.system.po.ProKeyWord;
3
import com.ekexiu.console.system.dao.*;
4
import com.ekexiu.console.system.po.*;
7 5
import org.jfw.apt.annotation.Autowrie;
8 6
import org.jfw.apt.annotation.Bean;
9 7
@ -22,6 +20,14 @@ public class KeyWordService {
22 20
    private ProKeyWordDao proKeyWordDao;
23 21
    @Autowrie
24 22
    private OrgKeyWordDao orgKeyWordDao;
23
    @Autowrie
24
    private ResKeyWordDao resKeyWordDao;
25
    @Autowrie
26
    private ArtKeyWordDao artKeyWordDao;
27
    @Autowrie
28
    private PatKeyWordDao patKeyWordDao;
29
    @Autowrie
30
    private PapKeyWordDao papKeyWordDao;
25 31
26 32
    public ProKeyWordDao getProKeyWordDao() {
27 33
        return proKeyWordDao;
@ -39,7 +45,40 @@ public class KeyWordService {
39 45
        this.orgKeyWordDao = orgKeyWordDao;
40 46
    }
41 47
42
    public void refreshProfessor(Connection con, String id, String[] kws) throws SQLException {
48
    public ResKeyWordDao getResKeyWordDao() {
49
        return resKeyWordDao;
50
    }
51
52
    public void setResKeyWordDao(ResKeyWordDao resKeyWordDao) {
53
        this.resKeyWordDao = resKeyWordDao;
54
    }
55
56
    public ArtKeyWordDao getArtKeyWordDao() {
57
        return artKeyWordDao;
58
    }
59
60
    public void setArtKeyWordDao(ArtKeyWordDao artKeyWordDao) {
61
        this.artKeyWordDao = artKeyWordDao;
62
    }
63
64
    public PatKeyWordDao getPatKeyWordDao() {
65
        return patKeyWordDao;
66
    }
67
68
    public void setPatKeyWordDao(PatKeyWordDao patKeyWordDao) {
69
        this.patKeyWordDao = patKeyWordDao;
70
    }
71
72
    public PapKeyWordDao getPapKeyWordDao() {
73
        return papKeyWordDao;
74
    }
75
76
    public void setPapKeyWordDao(PapKeyWordDao papKeyWordDao) {
77
        this.papKeyWordDao = papKeyWordDao;
78
    }
79
80
    public void refreshProfessor(Connection con, String id, String kw) throws SQLException {
81
        String[] kws = splitKeyWord(kw);
43 82
        proKeyWordDao.delete(con, id);
44 83
        if (kws != null && kws.length > 0) {
45 84
            ProKeyWord[] okws = new ProKeyWord[kws.length];
@ -53,7 +92,8 @@ public class KeyWordService {
53 92
        }
54 93
    }
55 94
56
    public void refreshOrg(Connection con, String id, String[] kws) throws SQLException {
95
    public void refreshOrg(Connection con, String id, String kw) throws SQLException {
96
        String[] kws = splitKeyWord(kw);
57 97
        orgKeyWordDao.delete(con, id);
58 98
        if (kws != null && kws.length > 0) {
59 99
            OrgKeyWord[] okws = new OrgKeyWord[kws.length];
@ -67,6 +107,66 @@ public class KeyWordService {
67 107
        }
68 108
    }
69 109
110
    public void refreshArticle(Connection con, String id, String kw) throws SQLException {
111
        String[] kws = splitKeyWord(kw);
112
        artKeyWordDao.delete(con, id);
113
        if (kws != null && kws.length > 0) {
114
            ArtKeyWord[] okws = new ArtKeyWord[kws.length];
115
            for (int i = 0; i < kws.length; ++i) {
116
                ArtKeyWord okw = new ArtKeyWord();
117
                okw.setId(id);
118
                okw.setKw(kws[i]);
119
                okws[i] = okw;
120
            }
121
            artKeyWordDao.insert(con, okws);
122
        }
123
    }
124
125
    public void refreshResource(Connection con, String id, String kw) throws SQLException {
126
        String[] kws = splitKeyWord(kw);
127
        resKeyWordDao.delete(con, id);
128
        if (kws != null && kws.length > 0) {
129
            ResKeyWord[] okws = new ResKeyWord[kws.length];
130
            for (int i = 0; i < kws.length; ++i) {
131
                ResKeyWord okw = new ResKeyWord();
132
                okw.setId(id);
133
                okw.setKw(kws[i]);
134
                okws[i] = okw;
135
            }
136
            resKeyWordDao.insert(con, okws);
137
        }
138
    }
139
140
    public void refreshPaper(Connection con, String id, String kw) throws SQLException {
141
        String[] kws = splitKeyWord(kw);
142
        papKeyWordDao.delete(con, id);
143
        if (kws != null && kws.length > 0) {
144
            PapKeyWord[] okws = new PapKeyWord[kws.length];
145
            for (int i = 0; i < kws.length; ++i) {
146
                PapKeyWord okw = new PapKeyWord();
147
                okw.setId(id);
148
                okw.setKw(kws[i]);
149
                okws[i] = okw;
150
            }
151
            papKeyWordDao.insert(con, okws);
152
        }
153
    }
154
155
    public void refreshPatent(Connection con, String id, String kw) throws SQLException {
156
        String[] kws = splitKeyWord(kw);
157
        patKeyWordDao.delete(con, id);
158
        if (kws != null && kws.length > 0) {
159
            PatKeyWord[] okws = new PatKeyWord[kws.length];
160
            for (int i = 0; i < kws.length; ++i) {
161
                PatKeyWord okw = new PatKeyWord();
162
                okw.setId(id);
163
                okw.setKw(kws[i]);
164
                okws[i] = okw;
165
            }
166
            patKeyWordDao.insert(con, okws);
167
        }
168
    }
169
70 170
    public static String[] splitKeyWord(String kws) {
71 171
        if (kws == null || kws.trim().length() == 0) return null;
72 172
        kws = kws.trim();

+ 1 - 1
src/main/java/com/ekexiu/console/system/service/OrgService.java

@ -425,7 +425,7 @@ public class OrgService extends com.ekexiu.console.service.Upload {
425 425
            String in = no.getIndustry();
426 426
            String kw = s==null?"":s.trim();
427 427
            kw = kw + (in==null?"":(","+in.trim()));
428
            this.keyWordService.refreshOrg(con,orgn.getId(),KeyWordService.splitKeyWord(kw));
428
            this.keyWordService.refreshOrg(con,orgn.getId(),kw);
429 429
        }else{
430 430
            this.keyWordService.refreshOrg(con,orgn.getId(),null);
431 431
        }

+ 16 - 0
src/main/java/com/ekexiu/console/system/service/PaperService.java

@ -26,6 +26,8 @@ public class PaperService {
26 26
    private PpaperDao ppaperDao;
27 27
    @Autowrie
28 28
    private PaperAgreeDao paperAgreeDao;
29
    @Autowrie
30
    private KeyWordService keyWordService;
29 31
30 32
    public PpaperDao getPpaperDao() {
31 33
        return ppaperDao;
@ -43,6 +45,14 @@ public class PaperService {
43 45
        this.paperAgreeDao = paperAgreeDao;
44 46
    }
45 47
48
    public KeyWordService getKeyWordService() {
49
        return keyWordService;
50
    }
51
52
    public void setKeyWordService(KeyWordService keyWordService) {
53
        this.keyWordService = keyWordService;
54
    }
55
46 56
    @Path("/pq")
47 57
    @Get
48 58
    public PageQueryResult<Ppaper> pageQueryResult(@JdbcConn Connection con, @Nullable String title, @Nullable String name, int orderBy, @Nullable String bt, @Nullable String et, @DefaultValue("1") int pageNo, @DefaultValue("10") int pageSize)throws SQLException {
@ -73,4 +83,10 @@ public class PaperService {
73 83
        return this.paperAgreeDao.query(con,id);
74 84
    }
75 85
86
    @Post
87
    @Path("/keywords")
88
    public void updateKeyWords(@JdbcConn(true) Connection con,String id, @Nullable String keywords) throws SQLException {
89
        this.ppaperDao.updateKeyWords(con, id, keywords);
90
        this.keyWordService.refreshPaper(con, id, keywords);
91
    }
76 92
}

+ 17 - 0
src/main/java/com/ekexiu/console/system/service/PatentService.java

@ -26,6 +26,8 @@ public class PatentService {
26 26
    private PpatentDao ppatentDao;
27 27
    @Autowrie
28 28
    private PatentAgreeDao patentAgreeDao;
29
    @Autowrie
30
    private KeyWordService keyWordService;
29 31
30 32
    public PpatentDao getPpatentDao() {
31 33
        return ppatentDao;
@ -43,6 +45,14 @@ public class PatentService {
43 45
        this.patentAgreeDao = patentAgreeDao;
44 46
    }
45 47
48
    public KeyWordService getKeyWordService() {
49
        return keyWordService;
50
    }
51
52
    public void setKeyWordService(KeyWordService keyWordService) {
53
        this.keyWordService = keyWordService;
54
    }
55
46 56
    @Path("/pq")
47 57
    @Get
48 58
    public PageQueryResult<Ppatent> pageQueryResult(@JdbcConn Connection con, @Nullable String title, @Nullable String name, int orderBy, @Nullable String bt, @Nullable String et, @DefaultValue("1") int pageNo, @DefaultValue("10") int pageSize)throws SQLException {
@ -72,4 +82,11 @@ public class PatentService {
72 82
    public int agreeCount(@JdbcConn(false) Connection con,String id)throws SQLException{
73 83
        return this.patentAgreeDao.query(con,id);
74 84
    }
85
86
    @Post
87
    @Path("/keywords")
88
    public void updateKeyWords(@JdbcConn(true) Connection con,String id, @Nullable String keywords) throws SQLException {
89
        this.ppatentDao.updateKeyWords(con, id, keywords);
90
        this.keyWordService.refreshPatent(con, id, keywords);
91
    }
75 92
}

+ 1 - 1
src/main/java/com/ekexiu/console/system/service/ProfessorService.java

@ -157,7 +157,7 @@ public class ProfessorService {
157 157
            String industry = p.getIndustry();
158 158
            if (industry == null)
159 159
                industry = "";
160
            this.keyWordService.refreshProfessor(con, professor.getId(), KeyWordService.splitKeyWord(subject + "," + industry));
160
            this.keyWordService.refreshProfessor(con, professor.getId(), subject + "," + industry);
161 161
        } else {
162 162
            throw new JfwBaseException(50000, "只能修改未激活用户信息");
163 163
        }

+ 17 - 0
src/main/java/com/ekexiu/console/system/service/ResourceService.java

@ -23,6 +23,8 @@ import java.sql.SQLException;
23 23
public class ResourceService {
24 24
    @Autowrie
25 25
    private ResourceDao resourceDao;
26
    @Autowrie
27
    private KeyWordService keyWordService;
26 28
27 29
    public ResourceDao getResourceDao() {
28 30
        return resourceDao;
@ -32,6 +34,14 @@ public class ResourceService {
32 34
        this.resourceDao = resourceDao;
33 35
    }
34 36
37
    public KeyWordService getKeyWordService() {
38
        return keyWordService;
39
    }
40
41
    public void setKeyWordService(KeyWordService keyWordService) {
42
        this.keyWordService = keyWordService;
43
    }
44
35 45
    @Path("/pq")
36 46
    @Get
37 47
    public PageQueryResult<ResourceInfo> pageQueryResult(@JdbcConn Connection con, @Nullable String resourceName, @Nullable String name, int orderBy, @Nullable String bt, @Nullable String et, @DefaultValue("1") int pageNo, @DefaultValue("10") int pageSize)throws SQLException {
@ -62,4 +72,11 @@ public class ResourceService {
62 72
    public Resource query(@JdbcConn Connection con, @PathVar String id) throws SQLException {
63 73
        return this.resourceDao.query(con, id);
64 74
    }
75
76
    @Post
77
    @Path("/subject")
78
    public void updateSubject(@JdbcConn(true) Connection con,String resourceId,@Nullable String subject) throws SQLException {
79
        this.resourceDao.updateSubject(con, resourceId, subject);
80
        this.keyWordService.refreshResource(con, resourceId, subject);
81
    }
65 82
}

+ 1 - 1
src/main/java/com/ekexiu/console/system/service/UserInfoService.java

@ -288,7 +288,7 @@ public class UserInfoService {
288 288
                }
289 289
                professor.setProfessorState(0);
290 290
                this.professorService.insert(con, professor, userInfo.getOrgName());
291
                this.keyWordService.refreshProfessor(con, id, KeyWordService.splitKeyWord(subject + "," + industry));
291
                this.keyWordService.refreshProfessor(con, id,subject + "," + industry);
292 292
293 293
                ArrayList<String> areas = (ArrayList<String>) userInfo.get("researchArea");
294 294
                if (areas != null) {