|
@ -20,6 +20,7 @@ import com.ekexiu.portal.po.Article;
|
20
|
20
|
import com.ekexiu.portal.po.ArticleAgree;
|
21
|
21
|
import com.ekexiu.portal.po.ArticleOrg;
|
22
|
22
|
import com.ekexiu.portal.po.ArticlePro;
|
|
23
|
import com.ekexiu.portal.po.ArticleProduct;
|
23
|
24
|
import com.ekexiu.portal.po.ArticleRes;
|
24
|
25
|
import com.ekexiu.portal.po.ArticleWare;
|
25
|
26
|
import com.ekexiu.portal.po.Image;
|
|
@ -377,7 +378,7 @@ public class ArticleService {
|
377
|
378
|
@Post
|
378
|
379
|
@Path("/save")
|
379
|
380
|
public String saveArticle(@JdbcConn(false) Connection con, Article article,@Nullable String[] files,@Nullable String[] professors, @Nullable String[] resources,
|
380
|
|
@Nullable String[] orgs, @Nullable String[] wares) throws SQLException, IOException, JfwBaseException {
|
|
381
|
@Nullable String[] orgs, @Nullable String[] wares,@Nullable String[] products) throws SQLException, IOException, JfwBaseException {
|
381
|
382
|
String articleId = null;
|
382
|
383
|
try {
|
383
|
384
|
|
|
@ -434,6 +435,15 @@ public class ArticleService {
|
434
|
435
|
articleDao.insert(con, aw);
|
435
|
436
|
}
|
436
|
437
|
}
|
|
438
|
articleDao.deleteProduct(con, article.getArticleId());
|
|
439
|
if (products != null && products.length > 0) {
|
|
440
|
for (String pid : products) {
|
|
441
|
ArticleProduct ap = new ArticleProduct();
|
|
442
|
ap.setId(articleId);
|
|
443
|
ap.setProduct(pid);
|
|
444
|
articleDao.insert(con, ap);
|
|
445
|
}
|
|
446
|
}
|
437
|
447
|
} else if (article.getArticleId().trim().length() == 32) {
|
438
|
448
|
articleId = article.getArticleId();
|
439
|
449
|
if (article.getArticleImg() != null) {
|
|
@ -480,6 +490,15 @@ public class ArticleService {
|
480
|
490
|
articleDao.insert(con, aw);
|
481
|
491
|
}
|
482
|
492
|
}
|
|
493
|
articleDao.deleteProduct(con, article.getArticleId());
|
|
494
|
if (products != null && products.length > 0) {
|
|
495
|
for (String pid : products) {
|
|
496
|
ArticleProduct ap = new ArticleProduct();
|
|
497
|
ap.setId(articleId);
|
|
498
|
ap.setProduct(pid);
|
|
499
|
articleDao.insert(con, ap);
|
|
500
|
}
|
|
501
|
}
|
483
|
502
|
} else {
|
484
|
503
|
throw new JfwBaseException(-2, "bad parameter:articleId");
|
485
|
504
|
}
|
|
@ -498,7 +517,7 @@ public class ArticleService {
|
498
|
517
|
@Post
|
499
|
518
|
@Path("/draft")
|
500
|
519
|
public String draft(@JdbcConn(false) Connection con, Article article,@Nullable String[] files, @Nullable String[] professors, @Nullable String[] resources, @Nullable String[] orgs,
|
501
|
|
@Nullable String[] wares) throws SQLException, IOException, JfwBaseException {
|
|
520
|
@Nullable String[] wares,@Nullable String[] products) throws SQLException, IOException, JfwBaseException {
|
502
|
521
|
|
503
|
522
|
String articleId = null;
|
504
|
523
|
try {
|
|
@ -554,6 +573,15 @@ public class ArticleService {
|
554
|
573
|
articleDao.insert(con, aw);
|
555
|
574
|
}
|
556
|
575
|
}
|
|
576
|
articleDao.deleteProduct(con, article.getArticleId());
|
|
577
|
if (products != null && products.length > 0) {
|
|
578
|
for (String pid : products) {
|
|
579
|
ArticleProduct ap = new ArticleProduct();
|
|
580
|
ap.setId(articleId);
|
|
581
|
ap.setProduct(pid);
|
|
582
|
articleDao.insert(con, ap);
|
|
583
|
}
|
|
584
|
}
|
557
|
585
|
} else if (article.getArticleId().trim().length() == 32) {
|
558
|
586
|
articleId = article.getArticleId();
|
559
|
587
|
if (article.getArticleImg() != null) {
|
|
@ -600,6 +628,15 @@ public class ArticleService {
|
600
|
628
|
articleDao.insert(con, aw);
|
601
|
629
|
}
|
602
|
630
|
}
|
|
631
|
articleDao.deleteProduct(con, article.getArticleId());
|
|
632
|
if (products != null && products.length > 0) {
|
|
633
|
for (String pid : products) {
|
|
634
|
ArticleProduct ap = new ArticleProduct();
|
|
635
|
ap.setId(articleId);
|
|
636
|
ap.setProduct(pid);
|
|
637
|
articleDao.insert(con, ap);
|
|
638
|
}
|
|
639
|
}
|
603
|
640
|
} else {
|
604
|
641
|
throw new JfwBaseException(-2, "bad parameter:articleId");
|
605
|
642
|
}
|
|
@ -618,7 +655,7 @@ public class ArticleService {
|
618
|
655
|
@Post
|
619
|
656
|
@Path("/timing")
|
620
|
657
|
public String timingPublish(@JdbcConn(false) Connection con, Article article,@Nullable String[] files, @Nullable String[] professors, @Nullable String[] resources,
|
621
|
|
@Nullable String[] orgs, @Nullable String[] wares) throws SQLException, IOException, JfwBaseException {
|
|
658
|
@Nullable String[] orgs, @Nullable String[] wares,@Nullable String[] products) throws SQLException, IOException, JfwBaseException {
|
622
|
659
|
String articleId = null;
|
623
|
660
|
try {
|
624
|
661
|
if (article.getPublishTime() == null) {
|
|
@ -675,6 +712,15 @@ public class ArticleService {
|
675
|
712
|
articleDao.insert(con, aw);
|
676
|
713
|
}
|
677
|
714
|
}
|
|
715
|
articleDao.deleteProduct(con, article.getArticleId());
|
|
716
|
if (products != null && products.length > 0) {
|
|
717
|
for (String pid : products) {
|
|
718
|
ArticleProduct ap = new ArticleProduct();
|
|
719
|
ap.setId(articleId);
|
|
720
|
ap.setProduct(pid);
|
|
721
|
articleDao.insert(con, ap);
|
|
722
|
}
|
|
723
|
}
|
678
|
724
|
} else if (article.getArticleId().trim().length() == 32) {
|
679
|
725
|
articleId = article.getArticleId();
|
680
|
726
|
if (article.getArticleImg() != null) {
|
|
@ -722,6 +768,15 @@ public class ArticleService {
|
722
|
768
|
articleDao.insert(con, aw);
|
723
|
769
|
}
|
724
|
770
|
}
|
|
771
|
articleDao.deleteProduct(con, article.getArticleId());
|
|
772
|
if (products != null && products.length > 0) {
|
|
773
|
for (String pid : products) {
|
|
774
|
ArticleProduct ap = new ArticleProduct();
|
|
775
|
ap.setId(articleId);
|
|
776
|
ap.setProduct(pid);
|
|
777
|
articleDao.insert(con, ap);
|
|
778
|
}
|
|
779
|
}
|
725
|
780
|
} else {
|
726
|
781
|
throw new JfwBaseException(-2, "bad parameter:articleId");
|
727
|
782
|
}
|
|
@ -1202,6 +1257,12 @@ public class ArticleService {
|
1202
|
1257
|
return articleDao.queryWares(con, id);
|
1203
|
1258
|
}
|
1204
|
1259
|
|
|
1260
|
@Get
|
|
1261
|
@Path("/product")
|
|
1262
|
public List<ArticleProduct> queryProducts(@JdbcConn Connection con,String id)throws SQLException {
|
|
1263
|
return articleDao.queryProduct(con, id);
|
|
1264
|
}
|
|
1265
|
|
1205
|
1266
|
@Get
|
1206
|
1267
|
@Path("/count/publish")
|
1207
|
1268
|
public long countPublish(@JdbcConn Connection con,String category,String owner)throws SQLException {
|