Przeglądaj źródła

成果个人&组织列表、详情、下架、删除update

Antiloveg 8 lat temu
rodzic
commit
a6e2e530d2

+ 5 - 2
schema/2017-05-24.sql

@@ -4,7 +4,7 @@ CREATE TABLE `demand_keyword` (
   `keyword` VARCHAR(16) NOT NULL COMMENT '关键词',
   PRIMARY KEY (`id`))
 ENGINE = InnoDB
-COMMENT = '科技需求关键词'
+COMMENT = '科技需求关键词';
 
 CREATE TABLE `achievement_keyword` (
   `id` VARCHAR(36) NOT NULL,
@@ -12,4 +12,7 @@ CREATE TABLE `achievement_keyword` (
   `keyword` VARCHAR(36) NOT NULL COMMENT '科技成果关键词',
   PRIMARY KEY (`id`))
 ENGINE = InnoDB
-COMMENT = '科技成果关键词'
+COMMENT = '科技成果关键词';
+
+alter table `achievement` 
+modify column `contacts`  int(1) comment '联系人及方式';

+ 10 - 2
src/main/java/com/goafanti/achievement/bo/AchievementOrgOwnerDetailBo.java

@@ -11,6 +11,16 @@ public class AchievementOrgOwnerDetailBo extends Achievement {
 
 	private String	iOwnerEmail;
 
+	private String	iOwnerPostalAddress;
+
+	public String getiOwnerPostalAddress() {
+		return iOwnerPostalAddress;
+	}
+
+	public void setiOwnerPostalAddress(String iOwnerPostalAddress) {
+		this.iOwnerPostalAddress = iOwnerPostalAddress;
+	}
+
 	public String getiOwnerName() {
 		return iOwnerName;
 	}
@@ -42,7 +52,5 @@ public class AchievementOrgOwnerDetailBo extends Achievement {
 	public void setiOwnerEmail(String iOwnerEmail) {
 		this.iOwnerEmail = iOwnerEmail;
 	}
-	
-	
 
 }

+ 0 - 29
src/main/java/com/goafanti/achievement/bo/AchievementUserOwnerDetailBo.java

@@ -2,41 +2,12 @@ package com.goafanti.achievement.bo;
 
 public class AchievementUserOwnerDetailBo extends AchievementOrgOwnerDetailBo {
 	
-	private String iOrgName;
-	
-	private String iOrgAddress;
-	
-	private String iOrgEmail;
-	
 	private String province;
 	
 	private String city;
 	
 	private String area;
 
-	public String getiOrgName() {
-		return iOrgName;
-	}
-
-	public void setiOrgName(String iOrgName) {
-		this.iOrgName = iOrgName;
-	}
-
-	public String getiOrgAddress() {
-		return iOrgAddress;
-	}
-
-	public void setiOrgAddress(String iOrgAddress) {
-		this.iOrgAddress = iOrgAddress;
-	}
-
-	public String getiOrgEmail() {
-		return iOrgEmail;
-	}
-
-	public void setiOrgEmail(String iOrgEmail) {
-		this.iOrgEmail = iOrgEmail;
-	}
 
 	public String getProvince() {
 		return province;

+ 8 - 0
src/main/java/com/goafanti/achievement/controller/AchievementApiController.java

@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
 import com.goafanti.achievement.bo.InputAchievement;
 import com.goafanti.achievement.service.AchievementService;
 import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.enums.AchievementAuditStatus;
@@ -296,6 +297,13 @@ public class AchievementApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到合作方式", "合作方式"));
 			return res;
 		}
+		
+		for (int i=0; i<keywords.length; i++){
+			if (AFTConstants.KEYWORDLENTH < keywords[i].length()){
+				res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "关键词长度"));
+				return res;
+			}
+		}
 		return res;
 	}
 

+ 3 - 0
src/main/java/com/goafanti/achievement/service/AchievementService.java

@@ -3,6 +3,7 @@ package com.goafanti.achievement.service;
 import java.util.List;
 
 import com.goafanti.achievement.bo.AchievementListBo;
+import com.goafanti.achievement.bo.AchievementOrgOwnerDetailBo;
 import com.goafanti.achievement.bo.AchievementUserOwnerDetailBo;
 import com.goafanti.common.model.Achievement;
 import com.goafanti.core.mybatis.page.Pagination;
@@ -35,5 +36,7 @@ public interface AchievementService {
 
 	AchievementUserOwnerDetailBo selectUserOwnerDetail(String id);
 
+	AchievementOrgOwnerDetailBo selectOrgOwnerDetail(String id);
+
 
 }

+ 8 - 1
src/main/java/com/goafanti/achievement/service/impl/AchievementServiceImpl.java

@@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.goafanti.achievement.bo.AchievementListBo;
+import com.goafanti.achievement.bo.AchievementOrgOwnerDetailBo;
 import com.goafanti.achievement.bo.AchievementUserOwnerDetailBo;
 import com.goafanti.achievement.service.AchievementService;
 import com.goafanti.common.constant.AFTConstants;
@@ -241,7 +242,11 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 	public AchievementUserOwnerDetailBo selectUserOwnerDetail(String id) {
 		return achievementMapper.selectUserOwnerDetail(id);
 	}
-
+	
+	@Override
+	public AchievementOrgOwnerDetailBo selectOrgOwnerDetail(String id) {
+		return achievementMapper.selectOrgOwnerDetail(id);
+	}
 
 	private void createTechBorkerNotice(Achievement a) {
 		noticeMapper.insert(disposeNotice(a, null));
@@ -316,4 +321,6 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 	}
 
 	
+
+	
 }

+ 24 - 2
src/main/java/com/goafanti/admin/controller/AdminAchievementApiController.java

@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
 import com.goafanti.achievement.bo.InputAchievement;
 import com.goafanti.achievement.service.AchievementService;
 import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.enums.AchievementAuditStatus;
@@ -140,7 +141,7 @@ public class AdminAchievementApiController extends CertifyApiController {
 	 * 个人成果详情详情
 	 */
 	@RequestMapping(value = "/userDetail", method = RequestMethod.GET)
-	private Result detail(String id) {
+	private Result userDetail(String id) {
 		Result res = new Result();
 		if (StringUtils.isBlank(id)) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到成果ID", "成果ID"));
@@ -149,6 +150,20 @@ public class AdminAchievementApiController extends CertifyApiController {
 		res.setData(achievementService.selectUserOwnerDetail(id));
 		return res;
 	}
+	
+	/**
+	 * 组织用户成果详情详情
+	 */
+	@RequestMapping(value = "/orgDetail", method = RequestMethod.GET)
+	private Result orgDetail(String id) {
+		Result res = new Result();
+		if (StringUtils.isBlank(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到成果ID", "成果ID"));
+			return res;
+		}
+		res.setData(achievementService.selectOrgOwnerDetail(id));
+		return res;
+	}
 
 	/**
 	 * 个人成果列表
@@ -275,7 +290,7 @@ public class AdminAchievementApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到关键词", "关键词"));
 			return res;
 		}
-
+		
 		if (StringUtils.isBlank(ia.getOwnerName())) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到成果所有人名称", "成果所有人名称"));
 			return res;
@@ -310,6 +325,13 @@ public class AdminAchievementApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到合作方式", "合作方式"));
 			return res;
 		}
+		
+		for (int i=0; i<keywords.length; i++){
+			if (AFTConstants.KEYWORDLENTH < keywords[i].length()){
+				res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "关键词长度"));
+				return res;
+			}
+		}
 		return res;
 	}
 

+ 8 - 0
src/main/java/com/goafanti/admin/controller/AdminDemandApiController.java

@@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.enums.AttachmentType;
@@ -345,6 +346,13 @@ public class AdminDemandApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到问题说明", "问题说明"));
 			return res;
 		}
+		
+		for (int i=0; i<keywords.length; i++){
+			if (AFTConstants.KEYWORDLENTH < keywords[i].length()){
+				res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "关键词长度"));
+				return res;
+			}
+		}
 
 		return res;
 	}

+ 2 - 0
src/main/java/com/goafanti/common/constant/AFTConstants.java

@@ -27,4 +27,6 @@ public class AFTConstants {
 
 	public static final String	TECHPROJECT			= "科技项目申报管理";
 
+	public static final int		KEYWORDLENTH		= 16;
+
 }

+ 3 - 0
src/main/java/com/goafanti/common/dao/AchievementMapper.java

@@ -2,6 +2,7 @@ package com.goafanti.common.dao;
 
 import java.util.List;
 
+import com.goafanti.achievement.bo.AchievementOrgOwnerDetailBo;
 import com.goafanti.achievement.bo.AchievementUserOwnerDetailBo;
 import com.goafanti.common.model.Achievement;
 
@@ -23,4 +24,6 @@ public interface AchievementMapper {
 	int batchDeleteByPrimaryKey(List<String> id);
 
 	AchievementUserOwnerDetailBo selectUserOwnerDetail(String id);
+
+	AchievementOrgOwnerDetailBo selectOrgOwnerDetail(String id);
 }

+ 33 - 10
src/main/java/com/goafanti/common/mapper/AchievementMapper.xml

@@ -44,7 +44,7 @@
     <result column="org_email" jdbcType="VARCHAR" property="orgEmail" />
     <result column="org_contacts" jdbcType="VARCHAR" property="orgContacts" />
     <result column="org_contacts_mobile" jdbcType="VARCHAR" property="orgContactsMobile" />
-    <result column="contacts" jdbcType="VARCHAR" property="contacts" />
+    <result column="contacts" jdbcType="INTEGER" property="contacts" />
     <result column="manager_id" jdbcType="VARCHAR" property="managerId" />
     <result column="salesman_id" jdbcType="VARCHAR" property="salesmanId" />
     <result column="status" jdbcType="INTEGER" property="status" />
@@ -106,7 +106,7 @@
       #{awards,jdbcType=VARCHAR}, #{teamDes,jdbcType=VARCHAR}, #{parameter,jdbcType=VARCHAR}, 
       #{techPlanUrl,jdbcType=VARCHAR}, #{businessPlanUrl,jdbcType=VARCHAR}, #{orgId,jdbcType=VARCHAR}, 
       #{orgName,jdbcType=VARCHAR}, #{orgAddress,jdbcType=VARCHAR}, #{orgEmail,jdbcType=VARCHAR}, 
-      #{orgContacts,jdbcType=VARCHAR}, #{orgContactsMobile,jdbcType=VARCHAR}, #{contacts,jdbcType=VARCHAR}, 
+      #{orgContacts,jdbcType=VARCHAR}, #{orgContactsMobile,jdbcType=VARCHAR}, #{contacts,jdbcType=INTEGER}, 
       #{managerId,jdbcType=VARCHAR}, #{salesmanId,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, 
       #{createTime,jdbcType=TIMESTAMP}, #{releaseStatus,jdbcType=INTEGER}, #{releaseDate,jdbcType=TIMESTAMP}, 
       #{deletedSign,jdbcType=INTEGER}, #{auditStatus,jdbcType=INTEGER}, #{techBrokerId,jdbcType=VARCHAR})
@@ -399,7 +399,7 @@
         #{orgContactsMobile,jdbcType=VARCHAR},
       </if>
       <if test="contacts != null">
-        #{contacts,jdbcType=VARCHAR},
+        #{contacts,jdbcType=INTEGER},
       </if>
       <if test="managerId != null">
         #{managerId,jdbcType=VARCHAR},
@@ -557,7 +557,7 @@
         org_contacts_mobile = #{orgContactsMobile,jdbcType=VARCHAR},
       </if>
       <if test="contacts != null">
-        contacts = #{contacts,jdbcType=VARCHAR},
+        contacts = #{contacts,jdbcType=INTEGER},
       </if>
       <if test="managerId != null">
         manager_id = #{managerId,jdbcType=VARCHAR},
@@ -632,7 +632,7 @@
       org_email = #{orgEmail,jdbcType=VARCHAR},
       org_contacts = #{orgContacts,jdbcType=VARCHAR},
       org_contacts_mobile = #{orgContactsMobile,jdbcType=VARCHAR},
-      contacts = #{contacts,jdbcType=VARCHAR},
+      contacts = #{contacts,jdbcType=INTEGER},
       manager_id = #{managerId,jdbcType=VARCHAR},
       salesman_id = #{salesmanId,jdbcType=VARCHAR},
       status = #{status,jdbcType=INTEGER},
@@ -922,16 +922,39 @@
 		    a.transfer_price as transferPrice, a.technical_scene as technicalScene, a.breakthrough, 
 		    a.patent_case as patentCase, a.awards, a.team_des as teamDes, 
 		    a.parameter, a.tech_plan_url as techPlanUrl, a.business_plan_url as businessPlanUrl, 
-		    a.org_id as orgId, a.org_name as orgName, a.org_address as orgAddress, 
-		    a.org_email as orgEmail, a.org_contacts as orgContacts, a.org_contacts_mobile as orgContactsMobile, 
 		    a.contacts, a.manager_id as managerId, a.salesman_id as salesmanId, 
 		    a.create_time as createTime, a.release_status as releaseStatus, 
 		    a.release_date as releaseDate, a.audit_status as auditStatus, a.tech_broker_id as techBrokerId,
-		    ui.username as iOwnerName, ui.province, ui.city, ui.area, u.email as iOwnerEmail
+		    ui.username as iOwnerName, ui.province, ui.city, ui.area, u.email as iOwnerEmail,
+		    ui.id_number as iOwnerIdNumber, u.mobile as iOwnerMobile
     from achievement a
     left join user_identity ui on a.owner_id = ui.uid
-    left join organization_identity oi on a.org_id = oi.uid
     left join user u on u.id = a.owner_id
-    where a.id = #id,jdbcType=VARCHAR}
+    where a.id = #{id,jdbcType=VARCHAR}
+  </select>
+  
+   <select id="selectOrgOwnerDetail" parameterType="java.lang.String" resultType="com.goafanti.achievement.bo.AchievementOrgOwnerDetailBo">
+  	select  
+		  	a.id, a.serial_number as serialNumber, a.data_category as dataCategory, 
+		  	a.name, a.keyword, a.category, 
+		  	a.summary, a.introduction, a.technical_picture_url as technicalPictureUrl, 
+		  	a.field_a as fieldA, a.field_b as fieldB, a.field_c as fieldC, 
+		  	a.maturity, a.maturity_picture_url as maturityPictureUrl, a.maturity_text_file_url as maturityTextFileUrl, 
+		  	a.maturity_video_url as maturityVideoUrl, a.innovation, a.owner_id as ownerId, 
+		  	a.owner_name as ownerName, a.owner_type as ownerType, a.owner_id_number as ownerIdNumber, 
+		    a.owner_mobile as ownerMobile, a.owner_email as ownerEmail, a.owner_postal_address as ownerPostalAddress, 
+		    a.cooperation_mode as cooperationMode, a.transfer_mode as transferMode, a.bargaining_mode as bargainingMode, 
+		    a.transfer_price as transferPrice, a.technical_scene as technicalScene, a.breakthrough, 
+		    a.patent_case as patentCase, a.awards, a.team_des as teamDes, 
+		    a.parameter, a.tech_plan_url as techPlanUrl, a.business_plan_url as businessPlanUrl, 
+		    a.contacts, a.manager_id as managerId, a.salesman_id as salesmanId, 
+		    a.create_time as createTime, a.release_status as releaseStatus, 
+		    a.release_date as releaseDate, a.audit_status as auditStatus, a.tech_broker_id as techBrokerId,
+		    oi.unit_name as iOwnerName, oi.postal_address as iOwnerPostalAddress, u.email as iOwnerEmail,
+		    oi.org_code as iOwnerIdNumber
+    from achievement a
+    left join organization_identity oi on a.owner_id = oi.uid
+    left join user u on u.id = a.owner_id
+    where a.id = #{id,jdbcType=VARCHAR}
   </select>
 </mapper>

+ 16 - 9
src/main/java/com/goafanti/common/model/Achievement.java

@@ -223,7 +223,7 @@ public class Achievement {
 	/**
 	 * 联系人及联系电话
 	 */
-	private String		contacts;
+	private Integer		contacts;
 
 	/**
 	 * 客户经理ID
@@ -566,7 +566,8 @@ public class Achievement {
 	public void setBusinessPlanUrl(String businessPlanUrl) {
 		this.businessPlanUrl = businessPlanUrl;
 	}
-
+	
+	@JsonIgnore
 	public String getOrgId() {
 		return orgId;
 	}
@@ -574,7 +575,8 @@ public class Achievement {
 	public void setOrgId(String orgId) {
 		this.orgId = orgId;
 	}
-
+	
+	@JsonIgnore
 	public String getOrgName() {
 		return orgName;
 	}
@@ -582,7 +584,8 @@ public class Achievement {
 	public void setOrgName(String orgName) {
 		this.orgName = orgName;
 	}
-
+	
+	@JsonIgnore
 	public String getOrgAddress() {
 		return orgAddress;
 	}
@@ -590,7 +593,8 @@ public class Achievement {
 	public void setOrgAddress(String orgAddress) {
 		this.orgAddress = orgAddress;
 	}
-
+	
+	@JsonIgnore
 	public String getOrgEmail() {
 		return orgEmail;
 	}
@@ -598,7 +602,8 @@ public class Achievement {
 	public void setOrgEmail(String orgEmail) {
 		this.orgEmail = orgEmail;
 	}
-
+	
+	@JsonIgnore
 	public String getOrgContacts() {
 		return orgContacts;
 	}
@@ -606,7 +611,8 @@ public class Achievement {
 	public void setOrgContacts(String orgContacts) {
 		this.orgContacts = orgContacts;
 	}
-
+	
+	@JsonIgnore
 	public String getOrgContactsMobile() {
 		return orgContactsMobile;
 	}
@@ -615,11 +621,12 @@ public class Achievement {
 		this.orgContactsMobile = orgContactsMobile;
 	}
 
-	public String getContacts() {
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getContacts() {
 		return contacts;
 	}
 
-	public void setContacts(String contacts) {
+	public void setContacts(Integer contacts) {
 		this.contacts = contacts;
 	}
 

+ 8 - 1
src/main/java/com/goafanti/demand/controller/DemandApiController.java

@@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.enums.AttachmentType;
@@ -283,7 +284,13 @@ public class DemandApiController extends CertifyApiController{
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到问题说明", "问题说明"));
 			return res;
 		}
-
+		
+		for (int i=0; i<keywords.length; i++){
+			if (AFTConstants.KEYWORDLENTH < keywords[i].length()){
+				res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "关键词长度"));
+				return res;
+			}
+		}
 
 		return res;
 	}