Browse Source

新增上传用户图片接口

liliang4869 7 years ago
parent
commit
0b9f10e58b

+ 1 - 0
src/main/java/com/goafanti/common/controller/WebpageController.java

@@ -666,6 +666,7 @@ public class WebpageController extends BaseController {
 	
 	@RequestMapping(value = "/portal/technologyTrading/achievementDetail")
 	public ModelAndView achievementDetail(HttpServletRequest request, ModelAndView modelAndView,String id, Integer type) {
+		if(type==null) {type =1;}
 		//详情
 		AchievementObject achievementObject=achievementService.getAchievementDetail(id,type);
 		modelAndView.addObject("achievementdetail",achievementObject);

+ 2 - 1
src/main/java/com/goafanti/common/enums/AttachmentType.java

@@ -15,7 +15,8 @@ public enum AttachmentType {
 	NEWS_TITLE_PICTURE("news_title_picture", "新闻题图图片"),
 	NEWS_CONTENT_PICTURE("news_content_picture", "新闻内容图片"),
 	JT_BUSINESS_PICTURE("jt_business_picture","技淘品类图片"),
-	JT_PROJECT_PICTURE("jt_project_picture","技淘服务项目图片");
+	JT_PROJECT_PICTURE("jt_project_picture","技淘服务项目图片"),
+	USER_PICTURE("user_picture","用户图片");
 	private AttachmentType(String code, String desc) {
 		this.code = code;
 		this.desc = desc;

+ 7 - 1
src/main/java/com/goafanti/common/mapper/UserIdentityMapper.xml

@@ -846,7 +846,13 @@
 		b.area,
 		b.postal_address as postalAddress,
 		b.fixed_tel as fixedTel,
-		b.qq
+		b.qq,
+		b.graduate_school as graduateSchool,
+		b.major_category as majorCategory,
+		b.qualification,
+		b.professional_title as professionalTitle,
+		b.expert_audit as expertAudit,
+		b.work_unit as workUnit
 	from
 		user a left join user_identity b on
 		a.id = b.uid

+ 1 - 1
src/main/java/com/goafanti/common/utils/FileUtils.java

@@ -96,7 +96,7 @@ public class FileUtils {
 	public static String mosaicFileName(MultipartFile mf, boolean isPrivate, String sign, String path, String uid) {
 		String suffix = mf.getOriginalFilename().substring(mf.getOriginalFilename().lastIndexOf("."));
 		boolean uniq = false;
-		if (sign.indexOf("demand_picture") != -1|| sign.indexOf("achievement_picture") != -1) {
+		if (sign.indexOf("demand_picture") != -1|| sign.indexOf("achievement_picture") != -1 || sign.indexOf("user_picture")!=-1) {
 			uniq = true;
 		}
 		String fileName = "";

+ 45 - 0
src/main/java/com/goafanti/user/bo/UserIdentityBo.java

@@ -2,6 +2,51 @@ package com.goafanti.user.bo;
 
 public class UserIdentityBo extends InputUserIdentity {
 	String reservationCount;
+	String graduateSchool;
+	String majorCategory;
+	String qualification;
+	String professionalTitle;
+	Integer expertAudit;
+	
+	public String getGraduateSchool() {
+		return graduateSchool;
+	}
+
+	public void setGraduateSchool(String graduateSchool) {
+		this.graduateSchool = graduateSchool;
+	}
+
+	public String getMajorCategory() {
+		return majorCategory;
+	}
+
+	public void setMajorCategory(String majorCategory) {
+		this.majorCategory = majorCategory;
+	}
+
+	public String getQualification() {
+		return qualification;
+	}
+
+	public void setQualification(String qualification) {
+		this.qualification = qualification;
+	}
+
+	public String getProfessionalTitle() {
+		return professionalTitle;
+	}
+
+	public void setProfessionalTitle(String professionalTitle) {
+		this.professionalTitle = professionalTitle;
+	}
+
+	public Integer getExpertAudit() {
+		return expertAudit;
+	}
+
+	public void setExpertAudit(Integer expertAudit) {
+		this.expertAudit = expertAudit;
+	}
 
 	public String getReservationCount() {
 		return reservationCount;

+ 16 - 0
src/main/java/com/goafanti/user/controller/UserApiController.java

@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.BaseApiController;
+import com.goafanti.common.enums.AttachmentType;
 import com.goafanti.common.enums.IdentityAuditStatus;
 import com.goafanti.common.enums.IdentityProcess;
 import com.goafanti.common.enums.OrgProFields;
@@ -864,4 +865,19 @@ public class UserApiController extends BaseApiController {
 		res.setData(userContactService.selectContactByUid(TokenManager.getUserId()));
 		return res;
 	}
+	
+    /**
+     * 图片上传
+     */
+    @RequestMapping(value = "/uploadPicture", method = RequestMethod.POST)
+    public Result uploadPicture(HttpServletRequest req, String sign) {
+        Result res = new Result();
+        AttachmentType attachmentType = AttachmentType.getField(sign);
+        if (attachmentType == AttachmentType.USER_PICTURE) {
+            res.setData(handleFiles(res, "/user/", false, req, sign, "user"));
+        } else {
+            res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
+        }
+        return res;
+    }
 }

+ 6 - 20
src/main/webapp/WEB-INF/views/portal/index.html

@@ -54,19 +54,10 @@
 					<div id="seachCont">
 						<div class="seachCont seachCont1" clicka="0">
 							<div>
-								购买技术
+								专利技术
 							</div>
 							<div>
-							承按需求
-							</div>
-							<div>
-							技术评估
-							</div>
-							<div>
-								发布需求
-							</div>
-							<div>
-								发布成果
+								实用技术
 							</div>
 						</div>
 					</div>
@@ -81,17 +72,12 @@
 					</div>
 					<div id="seachCont">
 						<div class="seachCont seachCont4" clicka="0">
+						
 							<div>
-							发布需求
-							</div>
-							<div>
-								承接需求
-							</div>
-							<div>
-							寻找需求
+							产业需求
 							</div>
 							<div>
-							成果对接
+							资金需求
 							</div>
 							
 						</div>
@@ -291,7 +277,7 @@
 				<div>需求</div>
 			</div>
 			<div class="indexGroom_tables chengguo" >
-			<a  th:each="a:${achievements}" th:href="@{/portal/technologyTrading/achievementDetail(id=${a.id})}" >
+			<a  th:each="a:${achievements}" th:href="@{/portal/technologyTrading/achievementDetail(id=${a.id},type=${a.dataCategory})}" >
 					<div>
 						<img th:src="${a.firstPicture}==null?${portalHost+'/img/indexNewTab.jpg'}:${avatarUploadHost+a.firstPicture}" alt="" />
 						<div>

+ 8 - 1
src/main/webapp/WEB-INF/views/portal/technologyTrading/achievement.html

@@ -267,20 +267,24 @@
             </h4>
         </div>
         <div class="transaction">
+        
             <div class="transactionImg">
                 <img th:src="${portalHost+'/img/newMenu/achievement_29.jpg'}" alt="">
+                
                 <div th:each="policy,policyStat:${policyList}" th:if="${policyStat.index}==0">
+                  <a th:href="@{/portal/news/newsDetail(id=${policy.id},type=0)}">
                     <address><img th:src="${portalHost+'/img/newMenu/achievement_28.jpg'}" alt="">
                     <span th:text="${#strings.abbreviate(policy.provinceS+policy.cityS,8)}"></span>
                     <time th:text="${#dates.format(policy.editTime,'yyyy-MM-dd')}"></time>
                     </address>
                     <h5>《<span th:text="${#strings.abbreviate(policy.title,12)}"></span>》</h5>
                     <p th:text="${#strings.abbreviate(policy.summary,45)}"></p>
-                    <a href="#">查看更多 > </a>
+              </a>
                 </div>
             </div>
             <ul>
                 <li th:each="policy,policyStat:${policyList}" th:if="${policyStat.index}>0 and ${policyStat.index}<3">
+                <a th:href="@{/portal/news/newsDetail(id=${policy.id},type=0)}">
                     <div class="time">
                         <p th:text="${#dates.format(policy.editTime,'dd')}"></p>
                         <hr>
@@ -292,12 +296,14 @@
                        <span class="title" >《<span th:text="${#strings.abbreviate(policy.title,12)}"></span>》</span></address>
                         <p  th:text="${#strings.abbreviate(policy.summary,45)}"></p>
                     </div>
+                    </a>
                 </li>
             </ul>
         </div>
         <div class="transactionList">
             <ol>
                 <li  th:each="policy,policyStat:${policyList}" th:if="${policyStat.index}>=3 and ${policyStat.index}<5">
+                  <a th:href="@{/portal/news/newsDetail(id=${policy.id},type=0)}">
                     <div class="time">
                         <p th:text="${#dates.format(policy.editTime,'dd')}">23</p>
                         <hr>
@@ -309,6 +315,7 @@
                        <span class="title">《<span th:text="${#strings.abbreviate(policy.title,12)}"></span>》</span></address>
                         <p th:text="${#strings.abbreviate(policy.summary,45)}"></p>
                     </div>
+                    </a>
                 </li>
             </ol>
         </div>