|
@@ -42,6 +42,8 @@ import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.regex.Matcher;
|
|
|
+import java.util.regex.Pattern;
|
|
|
|
|
|
/**
|
|
|
* 采美百科产品/仪器Controller
|
|
@@ -113,12 +115,21 @@ public class CmBaikeProductController extends BaseController {
|
|
|
CmBaikeType cmBaikeType = new CmBaikeType();
|
|
|
cmBaikeType.setTypeSort(cmBaikeProduct.getCommodityType());
|
|
|
cmBaikeType.setStatus(1);
|
|
|
+ //去除义项名,词条概述格式
|
|
|
+// cmBaikeProduct.setAlias(removerFormat(cmBaikeProduct.getAlias()));
|
|
|
+// cmBaikeProduct.setDiscription(removerFormat(cmBaikeProduct.getDiscription()));
|
|
|
// 分类列表
|
|
|
List<CmBaikeType> typeList = cmBaikeTypeService.findList(cmBaikeType);
|
|
|
// 商品类型
|
|
|
String commodityType = "产品";
|
|
|
// 参数列表
|
|
|
List<CmBaikeProductParam> paramList = cmBaikeProductDao.findParamList(cmBaikeProduct.getId());
|
|
|
+ //去除信息栏内容格式
|
|
|
+// if(null!=paramList&¶mList.size()>0){
|
|
|
+// for (CmBaikeProductParam cp:paramList) {
|
|
|
+// cp.setContent(removerFormat(cp.getContent()));
|
|
|
+// }
|
|
|
+// }
|
|
|
cmBaikeProduct.setParamList(paramList);
|
|
|
// 产品/仪器认证图片列表
|
|
|
List<String> authImageList = cmBaikeProductDao.findImageList(cmBaikeProduct.getId(), 1);
|
|
@@ -145,6 +156,14 @@ public class CmBaikeProductController extends BaseController {
|
|
|
String sensitiveWords = infoDao.getSensitiveWords(4);
|
|
|
//正文
|
|
|
List<CmBaikeTextInfo> textInfo = cmBaikeProductDao.getTextInfo(cmBaikeProduct.getId());
|
|
|
+ //去除正文内容格式
|
|
|
+// if(null!=textInfo&&textInfo.size()>0){
|
|
|
+// for (CmBaikeTextInfo ct:textInfo) {
|
|
|
+// if(null!=ct.getDictionaryType()&&ct.getDictionaryType()==3){
|
|
|
+// ct.setDictionaryContent(removerFormat(ct.getDictionaryContent()));
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
cmBaikeProduct.setTextInfolist(textInfo);
|
|
|
//参考资料
|
|
|
if(StringUtils.isNotEmpty(cmBaikeProduct.getId())){
|
|
@@ -361,6 +380,19 @@ public class CmBaikeProductController extends BaseController {
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 去除字符串格式
|
|
|
+ * @param chara
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public String removerFormat(String chara){
|
|
|
+ if(StringUtils.isNotEmpty(chara)){
|
|
|
+ Pattern p=Pattern.compile("\\s*|\t|\r|\n");
|
|
|
+ Matcher m=p.matcher(chara);
|
|
|
+ chara=m.replaceAll("");
|
|
|
+ }
|
|
|
+ return chara;
|
|
|
+ }
|
|
|
/**
|
|
|
* 有数据变动时需要清除缓存
|
|
|
*/
|
|
@@ -378,11 +410,20 @@ public class CmBaikeProductController extends BaseController {
|
|
|
*/
|
|
|
@RequestMapping(value = "check")
|
|
|
public String checkInfo(CmBaikeProduct cmBaikeProduct,Model model) {
|
|
|
+ //去除义项名,词条概述格式
|
|
|
+// cmBaikeProduct.setAlias(removerFormat(cmBaikeProduct.getAlias()));
|
|
|
+// cmBaikeProduct.setDiscription(removerFormat(cmBaikeProduct.getDiscription()));
|
|
|
model.addAttribute("cmBaikeProduct", cmBaikeProduct);
|
|
|
// 商品类型
|
|
|
String commodityType = cmBaikeProduct.getCommodityType() == 1 ? "产品" : "仪器";
|
|
|
// 参数列表
|
|
|
List<CmBaikeProductParam> paramList = cmBaikeProductDao.findParamList(cmBaikeProduct.getId());
|
|
|
+ //去除信息栏内容格式
|
|
|
+// if(null!=paramList&¶mList.size()>0){
|
|
|
+// for (CmBaikeProductParam cp:paramList) {
|
|
|
+// cp.setContent(removerFormat(cp.getContent()));
|
|
|
+// }
|
|
|
+// }
|
|
|
cmBaikeProduct.setParamList(paramList);
|
|
|
// 产品/仪器认证图片列表
|
|
|
List<String> authImageList = cmBaikeProductDao.findImageList(cmBaikeProduct.getId(), 1);
|
|
@@ -400,6 +441,14 @@ public class CmBaikeProductController extends BaseController {
|
|
|
});
|
|
|
//正文
|
|
|
List<CmBaikeTextInfo> textInfo = cmBaikeProductDao.getTextInfo(cmBaikeProduct.getId());
|
|
|
+ //去除正文内容格式
|
|
|
+// if(null!=textInfo&&textInfo.size()>0){
|
|
|
+// for (CmBaikeTextInfo ct:textInfo) {
|
|
|
+// if(null!=ct.getDictionaryType()&&ct.getDictionaryType()==3){
|
|
|
+// ct.setDictionaryContent(removerFormat(ct.getDictionaryContent()));
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
cmBaikeProduct.setTextInfolist(textInfo);
|
|
|
//参考资料
|
|
|
if(StringUtils.isNotEmpty(cmBaikeProduct.getId())){
|
|
@@ -466,12 +515,21 @@ public class CmBaikeProductController extends BaseController {
|
|
|
*/
|
|
|
@RequestMapping(value = "toAuditPage")
|
|
|
public String toAuditPage(CmBaikeProduct cmBaikeProduct,Model model) {
|
|
|
+ //去除义项名,词条概述格式
|
|
|
+// cmBaikeProduct.setAlias(removerFormat(cmBaikeProduct.getAlias()));
|
|
|
+// cmBaikeProduct.setDiscription(removerFormat(cmBaikeProduct.getDiscription()));
|
|
|
model.addAttribute("cmBaikeProduct", cmBaikeProduct);
|
|
|
cmBaikeProduct.setPublishSource(2);
|
|
|
// 商品类型
|
|
|
String commodityType = cmBaikeProduct.getCommodityType() == 1 ? "产品" : "仪器";
|
|
|
// 参数列表
|
|
|
List<CmBaikeProductParam> paramList = cmBaikeProductDao.findParamList(cmBaikeProduct.getId());
|
|
|
+ //去除信息栏内容格式
|
|
|
+// if(null!=paramList&¶mList.size()>0){
|
|
|
+// for (CmBaikeProductParam cp:paramList) {
|
|
|
+// cp.setContent(removerFormat(cp.getContent()));
|
|
|
+// }
|
|
|
+// }
|
|
|
cmBaikeProduct.setParamList(paramList);
|
|
|
// 产品/仪器认证图片列表
|
|
|
List<String> authImageList = cmBaikeProductDao.findImageList(cmBaikeProduct.getId(), 1);
|
|
@@ -502,9 +560,14 @@ public class CmBaikeProductController extends BaseController {
|
|
|
String sensitiveWords = infoDao.getSensitiveWords(4);
|
|
|
//正文
|
|
|
List<CmBaikeTextInfo> textInfo = cmBaikeProductDao.getTextInfo(cmBaikeProduct.getId());
|
|
|
-// Gson g=new Gson();
|
|
|
-// String textInfoStr=g.toJson(textInfo);
|
|
|
-// cmBaikeProduct.setTextInfolistStr(textInfoStr);
|
|
|
+ //去除正文内容格式
|
|
|
+// if(null!=textInfo&&textInfo.size()>0){
|
|
|
+// for (CmBaikeTextInfo ct:textInfo) {
|
|
|
+// if(null!=ct.getDictionaryType()&&ct.getDictionaryType()==3){
|
|
|
+// ct.setDictionaryContent(removerFormat(ct.getDictionaryContent()));
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
cmBaikeProduct.setTextInfolist(textInfo);
|
|
|
//参考资料
|
|
|
if(StringUtils.isNotEmpty(cmBaikeProduct.getId())){
|