...
|
...
|
@@ -104,19 +104,23 @@ public class GrassArticleServiceImpl implements IGrassArticleService{ |
|
|
|
|
|
try{
|
|
|
List<GrassArticleProduct> sknList = Lists.newArrayList();
|
|
|
String[] skns = req.getArticleSkns().split(",");
|
|
|
int orderby = 0;
|
|
|
for (String skn: skns) {
|
|
|
GrassArticleProduct grassArticleSkn = new GrassArticleProduct();
|
|
|
grassArticleSkn.setArticleId(article.getId());
|
|
|
grassArticleSkn.setProductSkn(Integer.valueOf(skn));
|
|
|
grassArticleSkn.setCreateTime(DateUtil.getCurrentTimeSeconds());
|
|
|
grassArticleSkn.setOrderBy(orderby);
|
|
|
orderby++;
|
|
|
sknList.add(grassArticleSkn);
|
|
|
if(StringUtils.isNotEmpty( req.getArticleSkns())){
|
|
|
String[] skns = req.getArticleSkns().split(",");
|
|
|
int orderby = 0;
|
|
|
for (String skn: skns) {
|
|
|
GrassArticleProduct grassArticleSkn = new GrassArticleProduct();
|
|
|
grassArticleSkn.setArticleId(article.getId());
|
|
|
grassArticleSkn.setProductSkn(Integer.valueOf(skn));
|
|
|
grassArticleSkn.setCreateTime(DateUtil.getCurrentTimeSeconds());
|
|
|
grassArticleSkn.setOrderBy(orderby);
|
|
|
orderby++;
|
|
|
sknList.add(grassArticleSkn);
|
|
|
}
|
|
|
if(CollectionUtils.isNotEmpty(sknList)){
|
|
|
grassArticleProductDao.insertArticleSkns(sknList);
|
|
|
}
|
|
|
logger.info("insert grass article skns success, ariticle id is {}, sknList size is {}", article.getId(), sknList.size());
|
|
|
}
|
|
|
grassArticleProductDao.insertArticleSkns(sknList);
|
|
|
logger.info("insert grass article skns success, ariticle id is {}, sknList size is {}", article.getId(), sknList.size());
|
|
|
}catch (Exception e){
|
|
|
logger.warn("insert article skns fail,ariticle id is {}, e is {}",article.getId(), e );
|
|
|
}
|
...
|
...
|
@@ -397,9 +401,9 @@ public class GrassArticleServiceImpl implements IGrassArticleService{ |
|
|
logger.info("publishCheck images is null");
|
|
|
throw new PlatformException("publish images is null", 403);
|
|
|
}
|
|
|
if(StringUtils.isEmpty(req.getArticleSkns())){
|
|
|
logger.info("publishCheck skn is null");
|
|
|
throw new PlatformException("publish skn is null", 403);
|
|
|
if(StringUtils.isEmpty(req.getContent())){
|
|
|
logger.info("publishCheck content is null");
|
|
|
throw new PlatformException("publish content is null", 403);
|
|
|
}
|
|
|
|
|
|
}
|
...
|
...
|
|