Browse Source

文章编辑

XMTT 7 years ago
parent
commit
05f264ea54

+ 7 - 4
src/main/java/com/ekexiu/console/system/dao/ArticleDao.java

@ -6,14 +6,12 @@ import org.jfw.apt.annotation.Nullable;
6 6
import org.jfw.apt.orm.annotation.dao.Batch;
7 7
import org.jfw.apt.orm.annotation.dao.Column;
8 8
import org.jfw.apt.orm.annotation.dao.DAO;
9
import org.jfw.apt.orm.annotation.dao.Dynamic;
9 10
import org.jfw.apt.orm.annotation.dao.method.Exclude;
10 11
import org.jfw.apt.orm.annotation.dao.method.From;
11 12
import org.jfw.apt.orm.annotation.dao.method.OrderBy;
12 13
import org.jfw.apt.orm.annotation.dao.method.Where;
13
import org.jfw.apt.orm.annotation.dao.method.operator.PageQuery;
14
import org.jfw.apt.orm.annotation.dao.method.operator.QueryVal;
15
import org.jfw.apt.orm.annotation.dao.method.operator.SelectOne;
16
import org.jfw.apt.orm.annotation.dao.method.operator.UpdateWith;
14
import org.jfw.apt.orm.annotation.dao.method.operator.*;
17 15
import org.jfw.apt.orm.annotation.dao.param.*;
18 16
import org.jfw.apt.orm.core.defaultImpl.StringHandler;
19 17
import org.jfw.util.PageQueryResult;
@ -27,6 +25,11 @@ import java.sql.SQLException;
27 25
@DAO
28 26
public interface ArticleDao {
29 27
28
    @Update
29
    @Exclude("modifyTime")
30
    @Dynamic
31
    int update(Connection con, Article article) throws SQLException;
32
30 33
    @Nullable
31 34
    @SelectOne
32 35
    Article query(Connection con, String articleId) throws SQLException;

+ 30 - 0
src/main/java/com/ekexiu/console/system/dao/ArticleOrgDao.java

@ -0,0 +1,30 @@
1
package com.ekexiu.console.system.dao;
2
3
import com.ekexiu.console.system.po.ArticleOrg;
4
import org.jfw.apt.orm.annotation.dao.DAO;
5
import org.jfw.apt.orm.annotation.dao.method.From;
6
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
7
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
8
import org.jfw.apt.orm.annotation.dao.method.operator.SelectList;
9
10
import java.sql.Connection;
11
import java.sql.SQLException;
12
import java.util.List;
13
14
/**
15
 * Created by TT on 2017/9/13.
16
 */
17
@DAO
18
public interface ArticleOrgDao {
19
20
    @Insert
21
    int insert(Connection con, ArticleOrg org) throws SQLException;
22
23
    @SelectList
24
    List<ArticleOrg> query(Connection con, String articleId) throws SQLException;
25
26
    @DeleteWith
27
    @From(ArticleOrg.class)
28
    int delete(Connection con, String articleId) throws SQLException;
29
30
}

+ 36 - 0
src/main/java/com/ekexiu/console/system/dao/ArticleProDao.java

@ -0,0 +1,36 @@
1
package com.ekexiu.console.system.dao;
2
3
import com.ekexiu.console.system.po.ArticlePro;
4
import org.jfw.apt.orm.annotation.dao.DAO;
5
import org.jfw.apt.orm.annotation.dao.method.From;
6
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
7
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
8
import org.jfw.apt.orm.annotation.dao.method.operator.SelectList;
9
10
import java.sql.Connection;
11
import java.sql.SQLException;
12
import java.util.List;
13
14
/**
15
 * Created by TT on 2017/9/13.
16
 */
17
@DAO
18
public abstract class ArticleProDao {
19
    @Insert
20
    public abstract int insert(Connection con, ArticlePro articlePro) throws SQLException;
21
22
//	@QueryVal
23
//	@From(ArticlePro.class)
24
//	@Column(handlerClass = IntHandler.class, value = "COUNT(1)")
25
//	@DefaultValue("0")
26
//	public abstract int queryByArticleId(Connection con, String articleId) throws SQLException;
27
28
    @SelectList
29
    public abstract List<ArticlePro> query(Connection con, String articleId) throws SQLException;
30
31
    @DeleteWith
32
    @From(ArticlePro.class)
33
    public abstract int delete(Connection con, String articleId) throws SQLException;
34
35
36
}

+ 33 - 0
src/main/java/com/ekexiu/console/system/dao/ArticleResDao.java

@ -0,0 +1,33 @@
1
package com.ekexiu.console.system.dao;
2
3
import com.ekexiu.console.system.po.ArticleRes;
4
import org.jfw.apt.orm.annotation.dao.DAO;
5
import org.jfw.apt.orm.annotation.dao.method.From;
6
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.Insert;
9
import org.jfw.apt.orm.annotation.dao.method.operator.SelectList;
10
11
import java.sql.Connection;
12
import java.sql.SQLException;
13
import java.util.List;
14
15
/**
16
 * Created by TT on 2017/9/13.
17
 */
18
@DAO
19
public abstract class ArticleResDao {
20
21
    @Insert
22
    public abstract int insert(Connection con, ArticleRes articleRes) throws SQLException;
23
24
    @SelectList
25
    @Where("RESOURCE_ID IN (SELECT RESOURCE_ID FROM RESOURCE WHERE STATUS='1')")
26
    public abstract List<ArticleRes> query(Connection con, String articleId) throws SQLException;
27
28
    @DeleteWith
29
    @From(ArticleRes.class)
30
    public abstract int delete(Connection con, String articleId) throws SQLException;
31
32
}
33

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

@ -18,6 +18,10 @@ import java.sql.SQLException;
18 18

19 19
@DAO
20 20
public interface OrgDao {
21
	@Nullable
22
	@SelectOne
23
	Organization queryOrg(Connection con, String id)throws SQLException;
24

21 25
	@Insert
22 26
	int insert(Connection con, Organization org) throws SQLException;
23 27


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

@ -10,10 +10,7 @@ import org.jfw.apt.orm.annotation.dao.method.Exclude;
10 10
import org.jfw.apt.orm.annotation.dao.method.From;
11 11
import org.jfw.apt.orm.annotation.dao.method.OrderBy;
12 12
import org.jfw.apt.orm.annotation.dao.method.Where;
13
import org.jfw.apt.orm.annotation.dao.method.operator.PageQuery;
14
import org.jfw.apt.orm.annotation.dao.method.operator.QueryVal;
15
import org.jfw.apt.orm.annotation.dao.method.operator.SelectOne;
16
import org.jfw.apt.orm.annotation.dao.method.operator.UpdateWith;
13
import org.jfw.apt.orm.annotation.dao.method.operator.*;
17 14
import org.jfw.apt.orm.annotation.dao.param.*;
18 15
import org.jfw.apt.orm.core.defaultImpl.StringHandler;
19 16
import org.jfw.util.PageQueryResult;
@ -31,6 +28,11 @@ public interface ResourceDao {
31 28
    @SelectOne
32 29
    Resource query(Connection con, String resourceId) throws SQLException;
33 30
31
    @Nullable
32
    @QueryOne
33
    @Where("STATUS='1'")
34
    ResourceInfo queryResInfo(Connection con, String resourceId) throws SQLException;
35
34 36
    @Nullable
35 37
    @QueryVal
36 38
    @Column(handlerClass = StringHandler.class, value = "resource_name")

+ 56 - 0
src/main/java/com/ekexiu/console/system/po/ArticleOrg.java

@ -0,0 +1,56 @@
1
package com.ekexiu.console.system.po;
2
3
import com.ekexiu.console.basepo.CreateTimeSupported;
4
import org.jfw.apt.orm.annotation.entry.Column;
5
import org.jfw.apt.orm.annotation.entry.Table;
6
import org.jfw.apt.orm.annotation.entry.Unique;
7
import org.jfw.apt.orm.annotation.entry.Uniques;
8
import org.jfw.apt.orm.core.enums.DE;
9
10
/**
11
 * Created by TT on 2017/9/13.
12
 */
13
@Table
14
@Uniques(@Unique(clolumns = {"articleId", "orgId"}, name = "ARTICLE_ORG_UQ"))
15
public class ArticleOrg implements CreateTimeSupported {
16
    private String articleId;
17
    private String orgId;
18
    private String createTime;
19
    private Article article;
20
21
    @Override
22
    public String getCreateTime() {
23
        return this.createTime;
24
    }
25
26
    @Override
27
    public void setCreateTime(String createTime) {
28
        this.createTime = createTime;
29
    }
30
31
    @Column(DE.id_32)
32
    public String getArticleId() {
33
        return articleId;
34
    }
35
36
    public void setArticleId(String articleId) {
37
        this.articleId = articleId;
38
    }
39
40
    @Column(DE.id_32)
41
    public String getOrgId() {
42
        return orgId;
43
    }
44
45
    public void setOrgId(String orgId) {
46
        this.orgId = orgId;
47
    }
48
49
    public Article getArticle() {
50
        return article;
51
    }
52
53
    public void setArticle(Article article) {
54
        this.article = article;
55
    }
56
}

+ 45 - 0
src/main/java/com/ekexiu/console/system/po/ArticlePro.java

@ -0,0 +1,45 @@
1
package com.ekexiu.console.system.po;
2
3
import com.ekexiu.console.basepo.CreateTimeSupported;
4
import org.jfw.apt.orm.annotation.entry.Column;
5
import org.jfw.apt.orm.annotation.entry.Table;
6
import org.jfw.apt.orm.annotation.entry.Unique;
7
import org.jfw.apt.orm.annotation.entry.Uniques;
8
import org.jfw.apt.orm.core.enums.DE;
9
10
/**
11
 * Created by TT on 2017/9/13.
12
 */
13
@Table
14
@Uniques(@Unique(clolumns = {"articleId", "professorId"}, name = "ARTICLE_PRO_UQ"))
15
public class ArticlePro implements CreateTimeSupported {
16
    private String articleId;
17
    private String professorId;
18
    private String createTime;
19
20
    @Column(DE.id_32)
21
    public String getArticleId() {
22
        return articleId;
23
    }
24
25
    public void setArticleId(String articleId) {
26
        this.articleId = articleId;
27
    }
28
29
    @Column(DE.id_32)
30
    public String getProfessorId() {
31
        return professorId;
32
    }
33
34
    public void setProfessorId(String professorId) {
35
        this.professorId = professorId;
36
    }
37
38
    public String getCreateTime() {
39
        return createTime;
40
    }
41
42
    public void setCreateTime(String createTime) {
43
        this.createTime = createTime;
44
    }
45
}

+ 54 - 0
src/main/java/com/ekexiu/console/system/po/ArticleRes.java

@ -0,0 +1,54 @@
1
package com.ekexiu.console.system.po;
2
3
import com.ekexiu.console.basepo.CreateTimeSupported;
4
import org.jfw.apt.orm.annotation.entry.Column;
5
import org.jfw.apt.orm.annotation.entry.Table;
6
import org.jfw.apt.orm.annotation.entry.Unique;
7
import org.jfw.apt.orm.annotation.entry.Uniques;
8
import org.jfw.apt.orm.core.enums.DE;
9
10
/**
11
 * Created by TT on 2017/9/13.
12
 */
13
@Table
14
@Uniques(@Unique(clolumns = {"articleId", "resourceId"}, name = "ARTICLE_RES_UQ"))
15
public class ArticleRes implements CreateTimeSupported {
16
    private String articleId;
17
    private String resourceId;
18
    private String createTime;
19
    private Article article;
20
21
    public Article getArticle() {
22
        return article;
23
    }
24
25
    public void setArticle(Article article) {
26
        this.article = article;
27
    }
28
29
    @Column(DE.id_32)
30
    public String getArticleId() {
31
        return articleId;
32
    }
33
34
    public void setArticleId(String articleId) {
35
        this.articleId = articleId;
36
    }
37
38
    @Column(DE.id_32)
39
    public String getResourceId() {
40
        return resourceId;
41
    }
42
43
    public void setResourceId(String resourceId) {
44
        this.resourceId = resourceId;
45
    }
46
47
    public String getCreateTime() {
48
        return createTime;
49
    }
50
51
    public void setCreateTime(String createTime) {
52
        this.createTime = createTime;
53
    }
54
}

+ 297 - 2
src/main/java/com/ekexiu/console/system/service/ArticleService.java

@ -1,8 +1,12 @@
1 1
package com.ekexiu.console.system.service;
2 2
3
import com.ekexiu.console.system.dao.ArticleDao;
4
import com.ekexiu.console.system.po.Article;
3
import com.ekexiu.console.system.dao.*;
4
import com.ekexiu.console.system.po.*;
5 5
import com.ekexiu.console.system.pojo.ArticleInfo;
6
import com.ekexiu.console.system.pojo.ProfessorInfo;
7
import com.ekexiu.console.system.pojo.ResourceInfo;
8
import com.ekexiu.console.util.HttpService;
9
import com.ekexiu.console.util.HttpServiceImpl;
6 10
import org.jfw.apt.annotation.Autowrie;
7 11
import org.jfw.apt.annotation.DefaultValue;
8 12
import org.jfw.apt.annotation.Nullable;
@ -11,20 +15,50 @@ import org.jfw.apt.web.annotation.operate.Get;
11 15
import org.jfw.apt.web.annotation.operate.Post;
12 16
import org.jfw.apt.web.annotation.param.JdbcConn;
13 17
import org.jfw.apt.web.annotation.param.PathVar;
18
import org.jfw.util.JpgUtil;
14 19
import org.jfw.util.PageQueryResult;
20
import org.jfw.util.exception.JfwBaseException;
21
import org.jfw.util.io.IoUtil;
22
import org.jfw.util.reflect.TypeReference;
15 23
24
import java.io.*;
25
import java.net.URLEncoder;
16 26
import java.sql.Connection;
17 27
import java.sql.SQLException;
28
import java.text.SimpleDateFormat;
29
import java.util.ArrayList;
30
import java.util.Date;
31
import java.util.List;
18 32
19 33
/**
20 34
 * Created by TT on 2017/8/3.
21 35
 */
22 36
@Path("/article")
23 37
public class ArticleService {
38
    private static HttpService http = new HttpServiceImpl();
39
40
    private File tmpPath;
41
    private File articlePath;
42
    private String dateFormat = "yyyyMMdd";
43
    private String timeFormat = "yyyyMMddHHmmss";
44
    private int artMaxLen = 200;
45
    private static final String JPG = "jpg";
24 46
    @Autowrie
25 47
    private ArticleDao articleDao;
26 48
    @Autowrie
27 49
    private KeyWordService keyWordService;
50
    @Autowrie
51
    private ArticleProDao articleProDao;
52
    @Autowrie
53
    private ArticleOrgDao articleOrgDao;
54
    @Autowrie
55
    private ArticleResDao articleResDao;
56
    @Autowrie
57
    private ProfessorDao professorDao;
58
    @Autowrie
59
    private OrgDao orgDao;
60
    @Autowrie
61
    private ResourceDao resourceDao;
28 62
29 63
    public ArticleDao getArticleDao() {
30 64
        return articleDao;
@ -42,6 +76,140 @@ public class ArticleService {
42 76
        this.keyWordService = keyWordService;
43 77
    }
44 78
79
    public ArticleProDao getArticleProDao() {
80
        return articleProDao;
81
    }
82
83
    public void setArticleProDao(ArticleProDao articleProDao) {
84
        this.articleProDao = articleProDao;
85
    }
86
87
    public ArticleOrgDao getArticleOrgDao() {
88
        return articleOrgDao;
89
    }
90
91
    public void setArticleOrgDao(ArticleOrgDao articleOrgDao) {
92
        this.articleOrgDao = articleOrgDao;
93
    }
94
95
    public ArticleResDao getArticleResDao() {
96
        return articleResDao;
97
    }
98
99
    public void setArticleResDao(ArticleResDao articleResDao) {
100
        this.articleResDao = articleResDao;
101
    }
102
103
    public ProfessorDao getProfessorDao() {
104
        return professorDao;
105
    }
106
107
    public void setProfessorDao(ProfessorDao professorDao) {
108
        this.professorDao = professorDao;
109
    }
110
111
    public OrgDao getOrgDao() {
112
        return orgDao;
113
    }
114
115
    public void setOrgDao(OrgDao orgDao) {
116
        this.orgDao = orgDao;
117
    }
118
119
    public ResourceDao getResourceDao() {
120
        return resourceDao;
121
    }
122
123
    public void setResourceDao(ResourceDao resourceDao) {
124
        this.resourceDao = resourceDao;
125
    }
126
127
    public File getTmpPath() {
128
        return tmpPath;
129
    }
130
131
    public void setTmpPath(File tmpPath) {
132
        this.tmpPath = tmpPath;
133
    }
134
135
    public File getArticlePath() {
136
        return articlePath;
137
    }
138
139
    public void setArticlePath(File articlePath) {
140
        this.articlePath = articlePath;
141
    }
142
143
    public String getDateFormat() {
144
        return dateFormat;
145
    }
146
147
    public void setDateFormat(String dateFormat) {
148
        this.dateFormat = dateFormat;
149
    }
150
151
    public String getTimeFormat() {
152
        return timeFormat;
153
    }
154
155
    public void setTimeFormat(String timeFormat) {
156
        this.timeFormat = timeFormat;
157
    }
158
159
    public int getArtMaxLen() {
160
        return artMaxLen;
161
    }
162
163
    public void setArtMaxLen(int artMaxLen) {
164
        this.artMaxLen = artMaxLen;
165
    }
166
167
    public static String getJPG() {
168
        return JPG;
169
    }
170
171
    private byte[] resImage(byte[] src, int maxLen) throws IOException {
172
        ByteArrayInputStream in = new ByteArrayInputStream(src);
173
        ByteArrayOutputStream out = new ByteArrayOutputStream();
174
        JpgUtil.scalingZoom(in, out, maxLen);
175
        out.flush();
176
        return out.toByteArray();
177
    }
178
179
    private byte[] readTmpFile(String fn) throws JfwBaseException {
180
        File file = new File(this.tmpPath, fn);
181
        if (!file.exists())
182
            throw new JfwBaseException(90, "resource image not exists");
183
        try {
184
            InputStream in = new FileInputStream(file);
185
            ByteArrayOutputStream out = new ByteArrayOutputStream();
186
            IoUtil.copy(in, out, true, true);
187
            return out.toByteArray();
188
        } catch (IOException e) {
189
            throw new JfwBaseException(91, "read temp resource image error", e);
190
        }
191
    }
192
193
    private void saveArtImg(String fn, String id) throws JfwBaseException, IOException {
194
        byte[] src = this.readTmpFile(fn);
195
        src = JpgUtil.read(src);
196
        byte[] shareResImage = this.resImage(src, this.artMaxLen);
197
        String savePath = this.articlePath + "/" + this.createDate();
198
        File dateFile = new File(savePath);
199
        if (!dateFile.exists()) {
200
            // 创建日期目录
201
            dateFile.mkdirs();
202
        }
203
        IoUtil.saveStream(new FileOutputStream(new File(dateFile, id + "." + JPG)), src, true);
204
        IoUtil.saveStream(new FileOutputStream(new File(dateFile, id + "_s." + JPG)), shareResImage, true);
205
    }
206
207
    private String createDate() {
208
        SimpleDateFormat df = new SimpleDateFormat(this.dateFormat);
209
        String date = df.format(new Date());
210
        return date;
211
    }
212
45 213
    @Path("/pq")
46 214
    @Get
47 215
    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 {
@ -85,4 +253,131 @@ public class ArticleService {
85 253
        this.articleDao.updateSubject(con, articleId, subject);
86 254
        this.keyWordService.refreshArticle(con, articleId, subject);
87 255
    }
256
257
    @Get
258
    @Path("/qaHotKey")
259
    public List<DataDictCode> queryHotKey(String key) throws JfwBaseException, IOException {
260
        List<DataDictCode> dataDictCodes = http.get("http://192.168.3.233:81/ajax/dataDict/qaHotKey?key="+ URLEncoder.encode(key,"UTF-8"), new TypeReference<List<DataDictCode>>() {
261
        }.getType());
262
        return dataDictCodes;
263
    }
264
265
    @Post
266
    @Path("/save")
267
    public String saveArticle(@JdbcConn(true) Connection con, Article article)throws SQLException,IOException,JfwBaseException {
268
        if (article.getArticleId().trim().length() == 32) {
269
            if (article.getArticleImg() != null) {
270
                this.saveArtImg(article.getArticleImg(), article.getArticleId());
271
                article.setArticleImg(this.createDate() + "/" + article.getArticleId() + "." + JPG);
272
            }
273
            this.articleDao.update(con, article);
274
            this.keyWordService.refreshArticle(con, article.getArticleId(), article.getSubject());
275
            return article.getArticleId();
276
        }else {
277
            throw new JfwBaseException(-2, "bad parameter:articleId");
278
        }
279
    }
280
281
    @Post
282
    @Path("/relatePro")
283
    public List<ProfessorInfo> relatePro(@JdbcConn Connection con,String articleId)throws SQLException {
284
        List<ArticlePro> articlePros = this.articleProDao.query(con, articleId);
285
        List<ProfessorInfo> professorInfos =new ArrayList<ProfessorInfo>();
286
        for (ArticlePro articlePro : articlePros) {
287
            ProfessorInfo professorInfo = this.professorDao.query(con, articlePro.getProfessorId());
288
            professorInfos.add(professorInfo);
289
        }
290
        return professorInfos;
291
    }
292
293
    @Post
294
    @Path("/relateOrg")
295
    public List<Organization> relateOrg(@JdbcConn Connection con, String articleId)throws SQLException {
296
        List<ArticleOrg> articleOrgs = this.articleOrgDao.query(con, articleId);
297
        List<Organization> orgs= new ArrayList<Organization>();
298
        for (ArticleOrg articleOrg : articleOrgs) {
299
            Organization org = this.orgDao.queryOrg(con,articleOrg.getOrgId());
300
            orgs.add(org);
301
        }
302
        return orgs;
303
    }
304
305
    @Post
306
    @Path("/relateRes")
307
    public List<ResourceInfo> relateRes(@JdbcConn Connection con, String articleId)throws SQLException {
308
        List<ArticleRes> articleRess = this.articleResDao.query(con, articleId);
309
        List<ResourceInfo> resourceInfos = new ArrayList<ResourceInfo>();
310
        for (ArticleRes articleRes : articleRess) {
311
            ResourceInfo resourceInfo = this.resourceDao.queryResInfo(con, articleRes.getResourceId());
312
            resourceInfos.add(resourceInfo);
313
        }
314
        return resourceInfos;
315
    }
316
317
    @Post
318
    @Path("/relateSave")
319
    public void relateSave(@JdbcConn(true) Connection con,String articleId,@Nullable String[] professors,@Nullable String[] resources,@Nullable String[] orgs)throws SQLException,JfwBaseException{
320
        this.articleProDao.delete(con, articleId);
321
        this.articleResDao.delete(con, articleId);
322
        this.articleOrgDao.delete(con, articleId);
323
        if (professors != null) {
324
            for (String professor : professors) {
325
                ArticlePro articlePro = new ArticlePro();
326
                articlePro.setArticleId(articleId);
327
                articlePro.setProfessorId(professor);
328
                try {
329
                    this.articleProDao.insert(con, articlePro);
330
                } catch (SQLException e) {
331
                    throw new JfwBaseException(6001, "关联专家不可重复");
332
                }
333
            }
334
        }
335
        if (resources != null) {
336
            for (String resource : resources) {
337
                ArticleRes articleRes = new ArticleRes();
338
                articleRes.setArticleId(articleId);
339
                articleRes.setResourceId(resource);
340
                try {
341
                    this.articleResDao.insert(con, articleRes);
342
                } catch (SQLException e) {
343
                    throw new JfwBaseException(6002, "关联资源不可重复");
344
                }
345
            }
346
        }
347
        if (orgs != null && orgs.length > 0) {
348
            for (String org : orgs) {
349
                ArticleOrg articleOrg = new ArticleOrg();
350
                articleOrg.setArticleId(articleId);
351
                articleOrg.setOrgId(org);
352
                try {
353
                    this.articleOrgDao.insert(con, articleOrg);
354
                } catch (SQLException e) {
355
                    throw new JfwBaseException(6003, "关联企业不可重复");
356
                }
357
            }
358
        }
359
    }
360
361
    public class DataDictCode {
362
        private long count;
363
        private String caption;
364
365
        public long getCount() {
366
            return count;
367
        }
368
369
        public void setCount(long count) {
370
            this.count = count;
371
        }
372
373
        public String getCaption() {
374
            return caption;
375
        }
376
377
        public void setCaption(String caption) {
378
            this.caption = caption;
379
        }
380
381
    }
382
88 383
}

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

@ -75,7 +75,7 @@ public class AuthApplyService {
75 75
76 76
    @Post
77 77
    @Path("/state")
78
    public void updateState(@JdbcConn(true) Connection con, String authApplyId, Integer solveStatus, Integer applyType, String professorId,String idCard) throws SQLException {
78
    public void updateState(@JdbcConn(true) Connection con, String authApplyId, Integer solveStatus, Integer applyType, String professorId,@Nullable String idCard) throws SQLException {
79 79
        this.authApplyDao.updateSolveStatus(con, solveStatus, authApplyId);
80 80
        if (applyType == 1) {
81 81
            this.professorDao.updateAuthStatus(con, professorId, solveStatus,idCard);

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

@ -73,6 +73,12 @@ public class ResourceService {
73 73
        return this.resourceDao.query(con, id);
74 74
    }
75 75
76
    @Get
77
    @Path("/resourceInfo")
78
    public ResourceInfo queryInfo(@JdbcConn Connection con, String id)throws SQLException {
79
        return this.resourceDao.queryResInfo(con, id);
80
    }
81
76 82
    @Post
77 83
    @Path("/subject")
78 84
    public void updateSubject(@JdbcConn(true) Connection con,String resourceId,@Nullable String subject) throws SQLException {

+ 7 - 1
src/main/resources/project-dev.properties

@ -96,4 +96,10 @@ mailService_Map.map-val-2::java.lang.String=true
96 96
com_ekexiu_console_system_service_OrgService.defaultOrgType=1
97 97

98 98
#com_ekexiu_console_system_service_DiscoverBannerService.generatePath::java.io.File=D:/tmp/data
99
com_ekexiu_console_system_service_DiscoverBannerService.generatePath::java.io.File=/kexiu/webdata/data/inc
99
com_ekexiu_console_system_service_DiscoverBannerService.generatePath::java.io.File=/kexiu/webdata/data/inc
100

101
#com_ekexiu_console_system_service_ArticleService.tmpPath::java.io.File=D:/tmp/data/images/tmp
102
com_ekexiu_console_system_service_ArticleService.tmpPath::java.io.File=/kexiu/www/html/images/tmp
103

104
#com_ekexiu_console_system_service_ArticleService.articlePath::java.io.File=D:/tmp/data/article
105
com_ekexiu_console_system_service_ArticleService.articlePath::java.io.File=/kexiu/webdata/data/article

+ 4 - 0
src/main/resources/project-test-dev.properties

@ -78,3 +78,7 @@ mailService_Map.map-val-2::java.lang.String=true
78 78
com_ekexiu_console_system_service_OrgService.defaultOrgType=1
79 79
80 80
com_ekexiu_console_system_service_DiscoverBannerService.generatePath::java.io.File=/kexiu/webdata/data/inc
81
82
com_ekexiu_console_system_service_ArticleService.tmpPath::java.io.File=/kexiu/www/html/images/tmp
83
84
com_ekexiu_console_system_service_ArticleService.articlePath::java.io.File=/kexiu/webdata/data/article

+ 5 - 1
src/main/resources/project-test.properties

@ -77,4 +77,8 @@ mailService_Map.map-val-2::java.lang.String=true
77 77
78 78
com_ekexiu_console_system_service_OrgService.defaultOrgType=1
79 79
80
com_ekexiu_console_system_service_DiscoverBannerService.generatePath::java.io.File=/kexiu/webdata/data/inc
80
com_ekexiu_console_system_service_DiscoverBannerService.generatePath::java.io.File=/kexiu/webdata/data/inc
81
82
com_ekexiu_console_system_service_ArticleService.tmpPath::java.io.File=/kexiu/www/html/images/tmp
83
84
com_ekexiu_console_system_service_ArticleService.articlePath::java.io.File=/kexiu/webdata/data/article

+ 5 - 1
src/main/resources/project.properties

@ -79,4 +79,8 @@ mailService_Map.map-val-2::java.lang.String=true
79 79
80 80
com_ekexiu_console_system_service_OrgService.defaultOrgType=1
81 81
82
com_ekexiu_console_system_service_DiscoverBannerService.generatePath::java.io.File=/kexiu/webdata/data/inc
82
com_ekexiu_console_system_service_DiscoverBannerService.generatePath::java.io.File=/kexiu/webdata/data/inc
83
84
com_ekexiu_console_system_service_ArticleService.tmpPath::java.io.File=/kexiu/www/html/images/tmp
85
86
com_ekexiu_console_system_service_ArticleService.articlePath::java.io.File=/kexiu/webdata/data/article