Ver Código Fonte

Merge branch 'test'

XMTT 5 anos atrás
pai
commit
0b9e1103c5

+ 5 - 0
.gitignore

5
/.tern-project
5
/.tern-project
6
/config-dev.properties
6
/config-dev.properties
7
/src/main/resources/project-dev.properties
7
/src/main/resources/project-dev.properties
8
.gitignore
9
portal-web.iml
10
.idea/
11
a/
12
index.html

+ 1 - 1
src/main/java/com/ekexiu/portal/resResult/ResearchResultDao.java

65
65
66
    @PageQuery
66
    @PageQuery
67
    @OrderBy("ORDER BY CREATE_TIME DESC")
67
    @OrderBy("ORDER BY CREATE_TIME DESC")
68
    PageQueryResult<ResearchResult> pageQueryByResearcher(Connection con, @Nullable @In String[] status, @SqlColumn(handlerClass = StringHandler.class, value = "ID IN (SELECT ID FROM RESEARCHER WHERE PROFESSOR_ID = ?)") String id, int pageSize, int pageNo) throws SQLException;
68
    PageQueryResult<ResearchResult> pageQueryByResearcher(Connection con, @Nullable @In String[] status,@Nullable @GroupSqlColumn(handlerClass = StringHandler.class, value = {"name like ?", "ID IN (SELECT ID FROM RESEARCHER WHERE NAME LIKE ?)", "SUBJECT LIKE ?", "INDUSTRY LIKE ?"}, isAnd = false) String key ,@SqlColumn(handlerClass = StringHandler.class, value = "ID IN (SELECT ID FROM RESEARCHER WHERE PROFESSOR_ID = ?)") String id, int pageSize, int pageNo) throws SQLException;
69
69
70
    @PageQuery
70
    @PageQuery
71
    @OrderBy("ORDER BY STATUS DESC, CREATE_TIME DESC")
71
    @OrderBy("ORDER BY STATUS DESC, CREATE_TIME DESC")

+ 87 - 4
src/main/java/com/ekexiu/portal/resResult/ResearchResultService.java

3
import com.ekexiu.portal.dao.ProfessorDao;
3
import com.ekexiu.portal.dao.ProfessorDao;
4
import com.ekexiu.portal.dao.WatchDao;
4
import com.ekexiu.portal.dao.WatchDao;
5
import com.ekexiu.portal.service.KeyWordService;
5
import com.ekexiu.portal.service.KeyWordService;
6
import com.ekexiu.portal.team.TeamDao;
6
import org.jfw.apt.annotation.Autowrie;
7
import org.jfw.apt.annotation.Autowrie;
7
import org.jfw.apt.annotation.DefaultValue;
8
import org.jfw.apt.annotation.DefaultValue;
8
import org.jfw.apt.annotation.Nullable;
9
import org.jfw.apt.annotation.Nullable;
52
    private KeyWordService keyWordService;
53
    private KeyWordService keyWordService;
53
    @Autowrie
54
    @Autowrie
54
    private WatchDao watchDao;
55
    private WatchDao watchDao;
56
    @Autowrie
57
    private TeamDao teamDao;
55
58
56
    public ResearcherDao getResearcherDao() {
59
    public ResearcherDao getResearcherDao() {
57
        return researcherDao;
60
        return researcherDao;
121
        this.imgMaxWidth = imgMaxWidth;
124
        this.imgMaxWidth = imgMaxWidth;
122
    }
125
    }
123
126
127
    public TeamDao getTeamDao() {
128
        return teamDao;
129
    }
130
131
    public void setTeamDao(TeamDao teamDao) {
132
        this.teamDao = teamDao;
133
    }
134
124
    public String insert(Connection con, ResearchResult researchResult, String[] researchers) throws SQLException {
135
    public String insert(Connection con, ResearchResult researchResult, String[] researchers) throws SQLException {
125
        String id = StringUtil.buildUUID();
136
        String id = StringUtil.buildUUID();
126
        researchResult.setId(id);
137
        researchResult.setId(id);
137
            kws = ListUtil.splitTrimExcludeEmpty(subject + "," + industry, ',').toArray(new String[0]);
148
            kws = ListUtil.splitTrimExcludeEmpty(subject + "," + industry, ',').toArray(new String[0]);
138
            this.keyWordService.refreshResearchResult(con, id, kws);
149
            this.keyWordService.refreshResearchResult(con, id, kws);
139
        }
150
        }
151
        Researcher res  = new Researcher();
152
        res.setId(id);
153
        res.setProfessorId(researchResult.getCreator());
154
        res.setName("######");
155
        res.setStatus("1");
156
        this.researcherDao.insert(con,res);
140
        this.researchResultDao.insert(con, researchResult);
157
        this.researchResultDao.insert(con, researchResult);
141
        return id;
158
        return id;
142
    }
159
    }
160
            }else {
177
            }else {
161
                this.keyWordService.refreshResearchResult(con, id, null);
178
                this.keyWordService.refreshResearchResult(con, id, null);
162
            }
179
            }
180
            Researcher res  = new Researcher();
181
            res.setId(id);
182
            res.setProfessorId(researchResult.getCreator());
183
            res.setName("######");
184
            res.setStatus("1");
185
            this.researcherDao.insert(con,res);
163
            return true;
186
            return true;
164
        }
187
        }
165
        return false;
188
        return false;
197
    @Get
220
    @Get
198
    @Path("/researcher")
221
    @Path("/researcher")
199
    public List<Researcher> queryResearchers(@JdbcConn Connection con, String id) throws SQLException {
222
    public List<Researcher> queryResearchers(@JdbcConn Connection con, String id) throws SQLException {
200
        return this.researcherDao.query(con, id);
223
        return this.researcherDao.query(con, id );
201
    }
224
    }
202
225
203
    @Get
226
    @Get
211
    public void delete(@JdbcConn(true) Connection con, String id) throws SQLException {
234
    public void delete(@JdbcConn(true) Connection con, String id) throws SQLException {
212
        watchDao.deleteWatch(con,(short)12, id);
235
        watchDao.deleteWatch(con,(short)12, id);
213
        this.researchResultDao.updateStatus(con, id);
236
        this.researchResultDao.updateStatus(con, id);
237
        this.teamDao.deleteResResultbyresearchResult(con,id);
238
        this.researcherDao.delete(con,id);
214
        this.keyWordService.refreshResearchResult(con, id, null);
239
        this.keyWordService.refreshResearchResult(con, id, null);
215
    }
240
    }
216
241
228
253
229
    @Get
254
    @Get
230
    @Path("/pq/researcher")
255
    @Path("/pq/researcher")
231
    public PageQueryResult<ResearchResult> pqByResearcher(@JdbcConn Connection con,@Nullable String[] status, String id,int pageSize,int pageNo)throws SQLException {
232
        return researchResultDao.pageQueryByResearcher(con, status, id, pageSize, pageNo);
256
    public PageQueryResult<ResearchResult> pqByResearcher(@JdbcConn Connection con,@Nullable String[] status,@Nullable String key, String id,int pageSize,int pageNo)throws SQLException {
257
        return researchResultDao.pageQueryByResearcher(con, status,key == null ? null : "%" + key + "%",id, pageSize, pageNo);
233
    }
258
    }
234
259
235
    @Get
260
    @Get
236
    @Path("/pq/creator")
261
    @Path("/pq/creator")
237
    public PageQueryResult<ResearchResult> pqByCreator(@JdbcConn Connection con,@Nullable String[] status, String id,int pageSize,int pageNo)throws SQLException {
262
    public PageQueryResult<ResearchResult> pqByCreator(@JdbcConn Connection con,@Nullable String[] status, String id,int pageSize,int pageNo)throws SQLException {
238
        return researchResultDao.pageQueryByCreator(con, status, id, pageSize, pageNo);
263
        return researchResultDao.pageQueryByCreator(con, status, id,pageSize, pageNo);
239
    }
264
    }
240
265
241
    @Get
266
    @Get
422
                re.setId(id);
447
                re.setId(id);
423
                re.setProfessorId(researchers[i].substring(0, 32));
448
                re.setProfessorId(researchers[i].substring(0, 32));
424
                re.setName(researchers[i].substring(33));
449
                re.setName(researchers[i].substring(33));
450
                re.setStatus("0");
425
                res[i] = re;
451
                res[i] = re;
426
            }
452
            }
427
            this.researcherDao.insert(con, res);
453
            this.researcherDao.insert(con, res);
428
        }
454
        }
429
    }
455
    }
430
456
457
    /**
458
     *
459
     * @param con
460
     * @param id 非专利成果ID
461
     * @return
462
     * @throws SQLException
463
     */
464
    @Post
465
    @Path("/ass")
466
    public int ass(@JdbcConn(true) Connection con,String id,String researcher)throws SQLException{
467
        Researcher res = new Researcher();
468
        res.setId(id);
469
        res.setProfessorId(researcher.substring(0,32));
470
        res.setName("");
471
        res.setStatus("1");
472
        return this.researcherDao.insert(con,res);
473
    }
474
475
    /**
476
     *
477
     * @param con
478
     * @param id  专利id、
479
     * @param pid  用户id
480
     * @return
481
     * @throws SQLException
482
     */
483
    @Get
484
    @Path("/selectbyidandPid")
485
    public List<Researcher> selectbyidandPid(@JdbcConn Connection con,String id,String pid) throws SQLException {
486
        return this.researcherDao.selectbyidandPid(con,id,pid);
487
    }
488
489
    /**
490
     *
491
     * @param con
492
     * @param id  非专利(成果) ID
493
     * @param uid 创建人(研究者id)
494
     * @throws SQLException
495
     */
496
    @Post
497
    @Path("/deleteContact")
498
    public void deleteContact(@JdbcConn(true) Connection con, String id,String uid) throws SQLException {
499
        this.researcherDao.deletecontact(con,id,uid);
500
    }
501
502
    /**
503
     *
504
     * @param con
505
     * @param pid 研究者id
506
     * @return
507
     * @throws SQLException
508
     */
509
    @Get
510
    @Path("/researcherbyprofessorId")
511
    public List<Researcher> queryResearchersbyprofessorId(@JdbcConn Connection con, String pid) throws SQLException {
512
        return this.researcherDao.querybyprofessorId(con,pid);
513
    }
431
514
432
}
515
}

+ 12 - 0
src/main/java/com/ekexiu/portal/resResult/Researcher.java

14
    private String id;
14
    private String id;
15
    private String professorId;
15
    private String professorId;
16
    private String name;
16
    private String name;
17
    private String status;
18
17
19
18
    @Column(DE.id_32)
20
    @Column(DE.id_32)
19
    public String getId() {
21
    public String getId() {
41
    public void setName(String name) {
43
    public void setName(String name) {
42
        this.name = name;
44
        this.name = name;
43
    }
45
    }
46
47
    @Column(descp = "状态 0:默认 显示,1:不显示 ", value = DE.singleChar)
48
    public String getStatus() {
49
        return status;
50
    }
51
52
    public void setStatus(String status) {
53
        this.status = status;
54
    }
55
44
}
56
}

+ 14 - 0
src/main/java/com/ekexiu/portal/resResult/ResearcherDao.java

4
import org.jfw.apt.orm.annotation.dao.Batch;
4
import org.jfw.apt.orm.annotation.dao.Batch;
5
import org.jfw.apt.orm.annotation.dao.DAO;
5
import org.jfw.apt.orm.annotation.dao.DAO;
6
import org.jfw.apt.orm.annotation.dao.method.From;
6
import org.jfw.apt.orm.annotation.dao.method.From;
7
import org.jfw.apt.orm.annotation.dao.method.Where;
7
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
8
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
8
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
9
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
9
import org.jfw.apt.orm.annotation.dao.method.operator.SelectList;
10
import org.jfw.apt.orm.annotation.dao.method.operator.SelectList;
31
32
32
    @SelectList
33
    @SelectList
33
    @Nullable
34
    @Nullable
35
    @Where("STATUS = '0'")
34
    List<Researcher> query(Connection con, String id) throws SQLException;
36
    List<Researcher> query(Connection con, String id) throws SQLException;
35
37
38
    @SelectList
39
    @Nullable
40
    List<Researcher> querybyprofessorId(Connection con, String professorId) throws SQLException;
41
42
    @DeleteWith
43
    @From(Researcher.class)
44
    int deletecontact(Connection con, String id , String professorId)throws SQLException;
45
46
    @SelectList
47
    @Nullable
48
    List<Researcher> selectbyidandPid(Connection con,String id ,String professorId) throws SQLException;
49
36
}
50
}

+ 4 - 0
src/main/java/com/ekexiu/portal/team/TeamDao.java

136
    @From(TeamResResult.class)
136
    @From(TeamResResult.class)
137
    int deleteResResult(Connection con, String id, String researchResult) throws SQLException;
137
    int deleteResResult(Connection con, String id, String researchResult) throws SQLException;
138
138
139
    @DeleteWith
140
    @From(TeamResResult.class)
141
    int deleteResResultbyresearchResult(Connection con, String researchResult) throws SQLException;
142
139
    @Insert
143
    @Insert
140
    int insert(Connection con, TeamPaper teamPaper) throws SQLException;
144
    int insert(Connection con, TeamPaper teamPaper) throws SQLException;
141
145