提交 5ebb6a27 authored 作者: luojie's avatar luojie

更新模板识别,中英文商品标题都可以识别

上级 fe317f6a
......@@ -4,7 +4,6 @@ package com.diaoyun.zion.chinafrica.service.impl;
import com.diaoyun.zion.chinafrica.dao.TbCfItemCommentDao;
import com.diaoyun.zion.chinafrica.entity.TbCfItemCommentEntity;
import com.diaoyun.zion.chinafrica.entity.TbCfItemCommentEntityExtends;
import com.diaoyun.zion.chinafrica.entity.TbCfReplyEntity;
import com.diaoyun.zion.chinafrica.service.TbCfItemCommentService;
import com.diaoyun.zion.master.base.Result;
import com.diaoyun.zion.master.enums.ResultCodeEnum;
......
......@@ -16,6 +16,7 @@ import com.diaoyun.zion.master.common.TokenManager;
import com.diaoyun.zion.master.enums.ResultCodeEnum;
import com.diaoyun.zion.master.security.JwtTokenProvider;
import com.diaoyun.zion.master.util.IdUtil;
import com.diaoyun.zion.master.util.ValidateUtils;
import com.diaoyun.zion.master.util.WordposHelper;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
......@@ -185,6 +186,18 @@ public class TbCfItemDetailServiceImpl implements TbCfItemDetailService {
//根据keyword获取运费模板
List<TbCfExpressTemplateEntity> tbCfExpressTemplateList = tbCfExpTemKeywordDao.getTemplateByKeyword(keyword);
totalTemplateSet.addAll(tbCfExpressTemplateList);
//TODO 后续优化
if(ValidateUtils.isContainChinese(keyword)) {
if ("0".equals(tbCfExpressTemplateList.size())) {
String[] split = keyword.split("");
for (int i = 0; i < split.length; i++) {
if(i+1<split.length){
List<TbCfExpressTemplateEntity> tbCfExpressTemplateLists = tbCfExpTemKeywordDao.getTemplateByKeyword(split[i]+split[i+1]);
totalTemplateSet.addAll(tbCfExpressTemplateLists);
}
}
}
}
}
}
//没有的话就设置 其他
......
......@@ -80,8 +80,8 @@
<!--根据keyword获取运费模板-->
<select id="getTemplateByKeyword" resultType="com.diaoyun.zion.chinafrica.entity.TbCfExpressTemplateEntity">
select t2.* from tb_cf_exp_tem_keyword t1,tb_cf_express_template t2 where t1.keyword=#{keyword}
and t1.template_id=t2.template_id
select DISTINCT t2.* from tb_cf_exp_tem_keyword t1 left join tb_cf_express_template t2 on t1.template_id=t2.template_id
where t1.keyword LIKE concat('%',#{keyword},'%') or t1.enkeyword LIKE concat('%',#{keyword},'%')
</select>
</mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论