Antiloveg 8 years ago
parent
commit
10f5357de5

+ 4 - 0
src/main/java/com/goafanti/common/controller/BaseController.java

@@ -51,6 +51,9 @@ public class BaseController {
 	@Value(value = "${portal.host}")
 	private String					portalHost			= null;
 
+	@Value(value = "${avatar.upload.host}")
+	private String					avatarUploadHost	= null;
+
 	protected Error buildError(String key) {
 		return buildError(key, null);
 	}
@@ -109,6 +112,7 @@ public class BaseController {
 		model.addAttribute("staticDomain", avatarHost);
 		model.addAttribute("staticHost", staticHost);
 		model.addAttribute("avatarHost", avatarHost);
+		model.addAttribute("avatarUploadHost", avatarUploadHost);
 		model.addAttribute("portalHost", portalHost);
 		model.addAttribute("basePath", request.getContextPath());
 		model.addAttribute("shiro", SecurityUtils.getSubject());

+ 9 - 27
src/main/java/com/goafanti/star/service/impl/StarServiceImpl.java

@@ -1,9 +1,6 @@
 package com.goafanti.star.service.impl;
 
-import java.util.ArrayList;
-import java.util.HashSet;
 import java.util.List;
-import java.util.Set;
 import java.util.UUID;
 
 import org.slf4j.Logger;
@@ -43,36 +40,21 @@ public class StarServiceImpl implements StarService {
 	@Override
 	public void save(List<Star> starList, String[] hot) {
 		starMapper.deleteAll();
-		Set<String> set = new HashSet<>();
 		for (Star s : starList) {
 			s.setId(UUID.randomUUID().toString());
 			s.setHot(StarHotType.UNHOT.getCode());
-			for (String h : hot) {
-				if (s.getUid().equals(h)) {
-					s.setHot(StarHotType.HOT.getCode());
-				} else {
-					set.add(h);
-				}
-			}
 		}
+		
 		Star star = null;
-		List<Star> list = new ArrayList<>();
-		for (String s : set) {
-			for (Star ss : starList) {
-				if (ss.getUid().equals(s)) {
-					ss.setHot(StarHotType.HOT.getCode());
-				} else {
-					star = new Star();
-					star.setId(UUID.randomUUID().toString());
-					star.setUid(s);
-					star.setHot(StarHotType.HOT.getCode());
-					star.setStar(StarType.UNSTAR.getCode());
-					list.add(star);
-				}
-			}
-
+		for (String ss : hot){
+			star = new Star();
+			star.setId(UUID.randomUUID().toString());
+			star.setUid(ss);
+			star.setHot(StarHotType.HOT.getCode());
+			star.setStar(StarType.UNSTAR.getCode());
+			starList.add(star);
 		}
-		starList.addAll(list);
+
 		starMapper.insertBatch(starList);
 	}
 

+ 3 - 1
src/main/resources/props/config_dev.properties

@@ -69,4 +69,6 @@ mobileCodeTemplate=SMS_37845022
 
 portal.host=//afts.hnzhiming.com/portal/1.0.3
 
-patentTemplate=SMS_72005286
+patentTemplate=SMS_72005286
+
+avatar.upload.host=//afts.hnzhiming.com/upload

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

@@ -72,3 +72,5 @@ mobileCodeTemplate=SMS_37845022
 portal.host=//afts.hnzhiming.com/portal/1.0.3
 
 patentTemplate=SMS_72005286
+
+avatar.upload.host=//afts.hnzhiming.com/upload

+ 3 - 1
src/main/resources/props/config_test.properties

@@ -71,4 +71,6 @@ mobileCodeTemplate=SMS_37845022
 
 portal.host=//aftts.hnzhiming.com/portal/1.0.3
 
-patentTemplate=SMS_72005286
+patentTemplate=SMS_72005286
+
+avatar.upload.host=//aftts.hnzhiming.com/upload

+ 2 - 2
src/main/webapp/WEB-INF/views/portal/scienceTechnology/bigShot.html

@@ -58,7 +58,7 @@
 			<ul>
 				<li th:each="star,iterStart:${starList}">
 					<div class="star_content_img">
-						<img th:if="${star.personPortraitUrl != null}" th:src="${avatarHost + star.personPortraitUrl}">
+						<img th:if="${star.personPortraitUrl != null}" th:src="${avatarUploadHost + star.personPortraitUrl}">
 						<a href="#">
                             <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
                             关注
@@ -104,7 +104,7 @@
 			<ul>
 				<li th:each="lecture,iterStart:${lectureList}">
 					<div class="star_content_img">
-						<img th:if="${lecture.lectureUrl} != null" th:src="${avatarHost + lecture.lectureUrl}">
+						<img th:if="${lecture.lectureUrl} != null" th:src="${avatarUploadHost + lecture.lectureUrl}">
 					</div>
 					<div class="lecture_content_info">
 						<h5 th:text="${lecture.name}">科技成果转化项目开展讲座</h5>

File diff suppressed because it is too large
+ 1 - 1
src/main/webapp/WEB-INF/views/portal/scienceTechnology/lecture.html


+ 1 - 1
src/main/webapp/WEB-INF/views/portal/scienceTechnology/star.html

@@ -155,7 +155,7 @@
 			<ul>
 				<li th:each="star,iterStart:${starList}">
 					<div class="expert_content_img">
-						<img th:if= "${star.personPortraitUrl} != null" th:src="${avatarHost + star.personPortraitUrl}">
+						<img th:if= "${star.personPortraitUrl} != null" th:src="${avatarUploadHost + star.personPortraitUrl}">
 						<a href="#">
                             <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
                             关注