Ver Código Fonte

非专利成果导入,查询 ,删除,取消关联

XMTT 5 anos atrás
pai
commit
c7a04891ad

+ 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")

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

149
            this.keyWordService.refreshResearchResult(con, id, kws);
149
            this.keyWordService.refreshResearchResult(con, id, kws);
150
        }
150
        }
151
        this.researchResultDao.insert(con, researchResult);
151
        this.researchResultDao.insert(con, researchResult);
152
        Researcher researcher = new Researcher();
153
        researcher.setId(id);
154
        researcher.setProfessorId(researchResult.getCreator());
155
        researcher.setName("");
156
        researcher.setStatus("1");
157
        this.researcherDao.insert(con,researcher);
152
        return id;
158
        return id;
153
    }
159
    }
154
160
208
    @Get
214
    @Get
209
    @Path("/researcher")
215
    @Path("/researcher")
210
    public List<Researcher> queryResearchers(@JdbcConn Connection con, String id) throws SQLException {
216
    public List<Researcher> queryResearchers(@JdbcConn Connection con, String id) throws SQLException {
211
        return this.researcherDao.query(con, id);
217
        return this.researcherDao.query(con, id );
212
    }
218
    }
213
219
214
    @Get
220
    @Get
240
246
241
    @Get
247
    @Get
242
    @Path("/pq/researcher")
248
    @Path("/pq/researcher")
243
    public PageQueryResult<ResearchResult> pqByResearcher(@JdbcConn Connection con,@Nullable String[] status, String id,int pageSize,int pageNo)throws SQLException {
244
        return researchResultDao.pageQueryByResearcher(con, status, id, pageSize, pageNo);
249
    public PageQueryResult<ResearchResult> pqByResearcher(@JdbcConn Connection con,@Nullable String[] status,@Nullable String key, String id,int pageSize,int pageNo)throws SQLException {
250
        return researchResultDao.pageQueryByResearcher(con, status,key == null ? null : "%" + key + "%",id, pageSize, pageNo);
245
    }
251
    }
246
252
247
    @Get
253
    @Get
248
    @Path("/pq/creator")
254
    @Path("/pq/creator")
249
    public PageQueryResult<ResearchResult> pqByCreator(@JdbcConn Connection con,@Nullable String[] status, String id,int pageSize,int pageNo)throws SQLException {
255
    public PageQueryResult<ResearchResult> pqByCreator(@JdbcConn Connection con,@Nullable String[] status, String id,int pageSize,int pageNo)throws SQLException {
250
        return researchResultDao.pageQueryByCreator(con, status, id, pageSize, pageNo);
256
        return researchResultDao.pageQueryByCreator(con, status, id,pageSize, pageNo);
251
    }
257
    }
252
258
253
    @Get
259
    @Get
440
        }
446
        }
441
    }
447
    }
442
448
449
    /**
450
     *
451
     * @param con
452
     * @param id 非专利成果ID(用户ID)
453
     * @return
454
     * @throws SQLException
455
     */
456
    @Post
457
    @Path("/ass")
458
    public void ass(@JdbcConn(true) Connection con,String id,String researcher)throws SQLException{
459
        Researcher res = new Researcher();
460
        res.setId(id);
461
        res.setProfessorId(researcher.substring(0,32));
462
        res.setName("");
463
        res.setStatus(researcher.substring(researcher.length()-1));
464
        this.researcherDao.insert(con,res);
465
466
    }
467
468
    /**
469
     *
470
     * @param con
471
     * @param id  非专利(成果) ID
472
     * @param uid 创建人(研究者id)
473
     * @throws SQLException
474
     */
475
    @Post
476
    @Path("/deleteContact")
477
    public void deleteContact(@JdbcConn(true) Connection con, String id,String uid) throws SQLException {
478
        this.researcherDao.deletecontact(con,id,uid);
479
    }
480
481
443
482
444
}
483
}

+ 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
}

+ 7 - 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
39
    @DeleteWith
40
    @From(Researcher.class)
41
    int deletecontact(Connection con, String id , String professorId)throws SQLException;
42
36
}
43
}