瀏覽代碼

关键字处理

anderx 5 年之前
父節點
當前提交
2e53a5ddad

+ 18 - 7
src/main/java/com/goafanti/achievement/service/impl/AchievementServiceImpl.java

@@ -961,19 +961,30 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 		        in.setInfoSources(1);
 		        list.add(in);
 		        //关键字处理
-		        String [] keywords=null;
 		        if(in.getKeyword()!=null) {
+		        	String [] keywords=null;
+		        	boolean flag= false;
 		        	if (in.getKeyword().contains(",")) {
 		        		keywords=in.getKeyword().split(",");
+		        		flag=true;
 					}else if (in.getKeyword().contains(",")) {
 						keywords=in.getKeyword().split(",");
+						flag=true;
+					}else {
+						AchievementKeyword ak = new AchievementKeyword();
+						ak.setId(UUID.randomUUID().toString());
+						ak.setAchievementId(in.getId());
+						ak.setKeyword(in.getKeyword());
+						keyword.add(ak);
 					}
-		        	for (int j = 0; j < keywords.length; j++) {
-		        	AchievementKeyword ak = new AchievementKeyword();
-					ak.setId(UUID.randomUUID().toString());
-					ak.setAchievementId(in.getId());
-					ak.setKeyword(keywords[j].trim());
-					keyword.add(ak);
+		        	if (flag) {
+		        		for (String string : keywords) {
+		        			AchievementKeyword ak = new AchievementKeyword();
+							ak.setId(UUID.randomUUID().toString());
+							ak.setAchievementId(in.getId());
+							ak.setKeyword(string);
+							keyword.add(ak);
+						}
 					}
 				}
 				

+ 18 - 10
src/main/java/com/goafanti/demand/service/impl/DemandServiceImpl.java

@@ -57,11 +57,8 @@ import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.enums.UserType;
 import com.goafanti.common.enums.collectType;
 import com.goafanti.common.error.BusinessException;
-import com.goafanti.common.model.Achievement;
 import com.goafanti.common.model.AchievementDemand;
 import com.goafanti.common.model.AchievementDemandCount;
-import com.goafanti.common.model.AchievementKeyword;
-import com.goafanti.common.model.AchievementPublish;
 import com.goafanti.common.model.Demand;
 import com.goafanti.common.model.DemandKeyword;
 import com.goafanti.common.model.DemandPublish;
@@ -1048,19 +1045,30 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 		        in.setInfoSources(1);
 		        list.add(in);
 		        //关键字处理
-		        String [] keywords=null;
 		        if(in.getKeyword()!=null) {
+		        	String [] keywords=null;
+		        	boolean flag= false;
 		        	if (in.getKeyword().contains(",")) {
 		        		keywords=in.getKeyword().split(",");
+		        		flag=true;
 					}else if (in.getKeyword().contains(",")) {
 						keywords=in.getKeyword().split(",");
+						flag=true;
+					}else {
+						DemandKeyword ak = new DemandKeyword();
+						ak.setId(UUID.randomUUID().toString());
+						ak.setDemandId(in.getId());
+						ak.setKeyword(in.getKeyword());
+						keyword.add(ak);
 					}
-		        	for (int j = 0; j < keywords.length; j++) {
-		        		DemandKeyword ak = new DemandKeyword();
-					ak.setId(UUID.randomUUID().toString());
-					ak.setDemandId(in.getId());
-					ak.setKeyword(keywords[j].trim());
-					keyword.add(ak);
+		        	if (flag) {
+		        		for (String string : keywords) {
+		        			DemandKeyword ak = new DemandKeyword();
+							ak.setId(UUID.randomUUID().toString());
+							ak.setDemandId(in.getId());
+							ak.setKeyword(string);
+							keyword.add(ak);
+						}
 					}
 				}
 				

+ 2 - 2
src/main/resources/props/config_local.properties

@@ -38,8 +38,8 @@ app.name=AFT
 app.mobile.website=http://m.jishutao.com/1.0/template/index.html
 template.cacheable=false
 
-static.host=//ss.jishutao.com/client/1.2.5
-portal.host=//ss.jishutao.com/portal/1.2.7
+static.host=//statics.jishutao.com/client/1.0.0
+portal.host=//statics.jishutao.com/portal/1.2.7
 skjt.host=//statics.jishutao.com/skjt/1.3
 
 #本地

+ 2 - 2
src/main/resources/props/config_test.properties

@@ -56,8 +56,8 @@ app.name=AFT
 app.mobile.website=http://muat.jishutao.com
 template.cacheable=false
 
-static.host=//statics.jishutao.com/client/1.0.0
-portal.host=//statics.jishutao.com/portal/1.0.1
+static.host=//statics.jishutao.com/client/1.2.5
+portal.host=//statics.jishutao.com/portal/1.2.7
 skjt.host=//statics.jishutao.com/skjt/1.3
 skjt.userName=admin
 skjt.password=asd123..