Authored by mlge

Merge branch 'dev_grass_20190108' of http://git.yoho.cn/platform/platform-cms in…

…to dev_grass_20190108
@@ -104,19 +104,23 @@ public class GrassArticleServiceImpl implements IGrassArticleService{ @@ -104,19 +104,23 @@ public class GrassArticleServiceImpl implements IGrassArticleService{
104 104
105 try{ 105 try{
106 List<GrassArticleProduct> sknList = Lists.newArrayList(); 106 List<GrassArticleProduct> sknList = Lists.newArrayList();
107 - String[] skns = req.getArticleSkns().split(",");  
108 - int orderby = 0;  
109 - for (String skn: skns) {  
110 - GrassArticleProduct grassArticleSkn = new GrassArticleProduct();  
111 - grassArticleSkn.setArticleId(article.getId());  
112 - grassArticleSkn.setProductSkn(Integer.valueOf(skn));  
113 - grassArticleSkn.setCreateTime(DateUtil.getCurrentTimeSeconds());  
114 - grassArticleSkn.setOrderBy(orderby);  
115 - orderby++;  
116 - sknList.add(grassArticleSkn); 107 + if(StringUtils.isNotEmpty( req.getArticleSkns())){
  108 + String[] skns = req.getArticleSkns().split(",");
  109 + int orderby = 0;
  110 + for (String skn: skns) {
  111 + GrassArticleProduct grassArticleSkn = new GrassArticleProduct();
  112 + grassArticleSkn.setArticleId(article.getId());
  113 + grassArticleSkn.setProductSkn(Integer.valueOf(skn));
  114 + grassArticleSkn.setCreateTime(DateUtil.getCurrentTimeSeconds());
  115 + grassArticleSkn.setOrderBy(orderby);
  116 + orderby++;
  117 + sknList.add(grassArticleSkn);
  118 + }
  119 + if(CollectionUtils.isNotEmpty(sknList)){
  120 + grassArticleProductDao.insertArticleSkns(sknList);
  121 + }
  122 + logger.info("insert grass article skns success, ariticle id is {}, sknList size is {}", article.getId(), sknList.size());
117 } 123 }
118 - grassArticleProductDao.insertArticleSkns(sknList);  
119 - logger.info("insert grass article skns success, ariticle id is {}, sknList size is {}", article.getId(), sknList.size());  
120 }catch (Exception e){ 124 }catch (Exception e){
121 logger.warn("insert article skns fail,ariticle id is {}, e is {}",article.getId(), e ); 125 logger.warn("insert article skns fail,ariticle id is {}, e is {}",article.getId(), e );
122 } 126 }
@@ -397,9 +401,9 @@ public class GrassArticleServiceImpl implements IGrassArticleService{ @@ -397,9 +401,9 @@ public class GrassArticleServiceImpl implements IGrassArticleService{
397 logger.info("publishCheck images is null"); 401 logger.info("publishCheck images is null");
398 throw new PlatformException("publish images is null", 403); 402 throw new PlatformException("publish images is null", 403);
399 } 403 }
400 - if(StringUtils.isEmpty(req.getArticleSkns())){  
401 - logger.info("publishCheck skn is null");  
402 - throw new PlatformException("publish skn is null", 403); 404 + if(StringUtils.isEmpty(req.getContent())){
  405 + logger.info("publishCheck content is null");
  406 + throw new PlatformException("publish content is null", 403);
403 } 407 }
404 408
405 } 409 }
@@ -51,7 +51,7 @@ @@ -51,7 +51,7 @@
51 51
52 <tr style="height: 60px"> 52 <tr style="height: 60px">
53 <td> 53 <td>
54 - <span style="color:red">*</span><label>选择话题</label> <br> 54 + <label>选择话题</label> <br>
55 <input id="topic" name="topicId" class="easyui-combobox" style="width:60% "/> 55 <input id="topic" name="topicId" class="easyui-combobox" style="width:60% "/>
56 </td> 56 </td>
57 </tr> 57 </tr>
@@ -70,7 +70,7 @@ @@ -70,7 +70,7 @@
70 </tr> 70 </tr>
71 <tr style="height: 60px"> 71 <tr style="height: 60px">
72 <td> 72 <td>
73 - <span style="color:red">*</span><label>关联商品</label> <br> 73 + <label>关联商品</label> <br>
74 <a id="addSkn" class="btn-primary" onclick="getEditDialog()" style="font-size: 15px">新增商品+</a> 74 <a id="addSkn" class="btn-primary" onclick="getEditDialog()" style="font-size: 15px">新增商品+</a>
75 <input id="skns" name="articleSkns" hidden="hidden"/> 75 <input id="skns" name="articleSkns" hidden="hidden"/>
76 </td> 76 </td>
@@ -128,7 +128,7 @@ @@ -128,7 +128,7 @@
128 128
129 $("#topic").combobox({ 129 $("#topic").combobox({
130 prompt: "请选择话题", 130 prompt: "请选择话题",
131 - required: true, 131 + required: false,
132 selectOnNavigation : true, 132 selectOnNavigation : true,
133 valueField: 'id', 133 valueField: 'id',
134 textField: 'topicName', 134 textField: 'topicName',