|
|
@@ -152,11 +152,11 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
|
|
|
/**
|
|
|
* 商品关键字检查,这里需要用一些关键字匹配
|
|
|
* 只要商品关键字在数据库中存在,就不允许添加商品。
|
|
|
- * @param keyWords
|
|
|
+ * @param vo
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public SelectForbiddenKeywordsVo selectForbiddenKeywords(String keyWords){
|
|
|
+ public SelectForbiddenKeywordsVo selectForbiddenKeywords(ForbiddenKeywordsVO vo){
|
|
|
SelectForbiddenKeywordsVo result = new SelectForbiddenKeywordsVo();
|
|
|
List<ForbiddenOnlineMedicine> forbiddenOnlineMedicines = fsStoreProductMapper.selectForbiddenKeywords();
|
|
|
//提示语Map
|
|
|
@@ -169,27 +169,31 @@ public class FsStoreProductScrmServiceImpl implements IFsStoreProductScrmService
|
|
|
if (originalKey == null && originalIngredient == null) {
|
|
|
continue;
|
|
|
}
|
|
|
- //TODO 成分不进入这个检查
|
|
|
String processedKey = null;
|
|
|
- if (originalKey != null) {
|
|
|
- processedKey = originalKey.replace(BRACKET_NUM_EN, "").replace(BRACKET_NUM_CN, "");
|
|
|
- }
|
|
|
- if (processedKey != null) {
|
|
|
- String processedChange = cleanKeyword(processedKey);
|
|
|
- forbiddenKeywords.add(processedChange);
|
|
|
- promptWordsMap.put(processedChange, medicine.getForbiddenKeywords());
|
|
|
- }
|
|
|
- String processedIngredient = null;
|
|
|
- //TODO 如果是名称就需要跳过
|
|
|
- if (originalIngredient != null) {
|
|
|
- processedIngredient = originalIngredient.replace(BRACKET_NUM_EN, "").replace(BRACKET_NUM_CN, "");
|
|
|
+ if(vo.getField().equals("productName")){
|
|
|
+ if (originalKey != null) {
|
|
|
+ processedKey = originalKey.replace(BRACKET_NUM_EN, "").replace(BRACKET_NUM_CN, "");
|
|
|
+ }
|
|
|
+ if (processedKey != null) {
|
|
|
+ String processedChange = cleanKeyword(processedKey);
|
|
|
+ forbiddenKeywords.add(processedChange);
|
|
|
+ promptWordsMap.put(processedChange, medicine.getForbiddenKeywords());
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
- if (processedIngredient != null && !Objects.equals(processedKey, processedIngredient)) {
|
|
|
- String medicineIngredientChange = cleanKeyword(processedIngredient);
|
|
|
- forbiddenKeywords.add(medicineIngredientChange);
|
|
|
- promptWordsMap.put(medicineIngredientChange, medicine.getMedicineIngredient());
|
|
|
+ if(vo.getField().equals("ingredient")){
|
|
|
+ String processedIngredient = null;
|
|
|
+ if (originalIngredient != null) {
|
|
|
+ processedIngredient = originalIngredient.replace(BRACKET_NUM_EN, "").replace(BRACKET_NUM_CN, "");
|
|
|
+ }
|
|
|
+ if (processedIngredient != null && !Objects.equals(processedKey, processedIngredient)) {
|
|
|
+ String medicineIngredientChange = cleanKeyword(processedIngredient);
|
|
|
+ forbiddenKeywords.add(medicineIngredientChange);
|
|
|
+ promptWordsMap.put(medicineIngredientChange, medicine.getMedicineIngredient());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ String keyWords = vo.getKeywords();
|
|
|
DrugComponentAnalyzer.CheckResult checkResult = DrugComponentAnalyzer.checkForbiddenComponents(forbiddenKeywords, keyWords);
|
|
|
boolean forbidden = checkResult.isForbidden();
|
|
|
if(!forbidden){
|