Browse Source

成果新增联系人与联系人电话,成果搜索接口新增所有人搜索等优化与BUG修复

anderx 7 years ago
parent
commit
06219e9c16

+ 22 - 9
src/main/java/com/goafanti/achievement/bo/InputAchievement.java

@@ -159,9 +159,6 @@ public class InputAchievement {
 	@Size(min = 0, max = 36, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	private String		techBrokerId;
 
-	@Max(value = 3, message = "{" + ErrorConstants.PARAM_ERROR + "}")
-	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
-	private Integer		contacts;
 	
 	@Max(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
@@ -178,6 +175,28 @@ public class InputAchievement {
 	@Size(min = 0, max = 500, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	private String remark;
 	
+	@Size(min = 0, max = 256, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String contacts;
+	
+	@Size(min = 0, max = 36, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String contactMobile ;
+	
+	public String getContacts() {
+		return contacts;
+	}
+
+	public void setContacts(String contacts) {
+		this.contacts = contacts;
+	}
+
+	public String getContactMobile() {
+		return contactMobile;
+	}
+
+	public void setContactMobile(String contactMobile) {
+		this.contactMobile = contactMobile;
+	}
+
 	public String getRemark() {
 		return remark;
 	}
@@ -554,13 +573,7 @@ public class InputAchievement {
 		this.ownerId = ownerId;
 	}
 
-	public Integer getContacts() {
-		return contacts;
-	}
 
-	public void setContacts(Integer contacts) {
-		this.contacts = contacts;
-	}
 
 	public Integer getJmrhFlag() {
 		return jmrhFlag;

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

@@ -222,7 +222,7 @@ public class AdminAchievementApiController extends CertifyApiController {
                     AchievementFields.getFieldDesc(bindingResult.getFieldError().getField())));
             return res;
         }
-        if (null == switchSign) {
+       /* if (null == switchSign) {
             res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到开关标记", "开关标记"));
             return res;
         }
@@ -230,7 +230,7 @@ public class AdminAchievementApiController extends CertifyApiController {
                 && !AchievementSwitchSign.OPEN.getCode().equals(switchSign)) {
             res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "开关标记"));
             return res;
-        }
+        }*/
         if (StringUtils.isBlank(ia.getId())) {
             res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到成果ID", "成果ID"));
             return res;

+ 20 - 13
src/main/java/com/goafanti/common/mapper/AchievementMapper.xml

@@ -44,7 +44,6 @@
     <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="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" />
@@ -58,6 +57,8 @@
     <result column="international_flag" jdbcType="INTEGER" property="internationalFlag" />
     <result column="jmrh_flag" jdbcType="INTEGER" property="jmrhFlag" />
     <result column="boutique" jdbcType="INTEGER" property="boutique" />
+    <result column="contacts" jdbcType="VARCHAR" property="contacts" />
+    <result column="contact_mobile" jdbcType="VARCHAR" property="contactMobile" />
   </resultMap>
   <sql id="Base_Column_List">
     id, serial_number, data_category, name, keyword, category, summary, introduction, 
@@ -94,11 +95,11 @@
       awards, team_des, parameter, 
       tech_plan_url, business_plan_url, org_id, 
       org_name, org_address, org_email, 
-      org_contacts, org_contacts_mobile, contacts, 
+      org_contacts, org_contacts_mobile,  
       manager_id, salesman_id, status, 
       create_time, release_status, release_date, 
       deleted_sign, audit_status, tech_broker_id,
-      country_name_zh,international_flag,jmrh_flag,boutique,remark)
+      country_name_zh,international_flag,jmrh_flag,boutique,remark,contacts,contact_mobile )
     values (#{id,jdbcType=VARCHAR}, #{serialNumber,jdbcType=INTEGER}, #{dataCategory,jdbcType=INTEGER}, 
       #{name,jdbcType=VARCHAR}, #{keyword,jdbcType=VARCHAR}, #{category,jdbcType=INTEGER}, 
       #{summary,jdbcType=VARCHAR}, #{introduction,jdbcType=LONGVARCHAR}, #{technicalPictureUrl,jdbcType=VARCHAR}, 
@@ -112,11 +113,11 @@
       #{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=INTEGER}, 
+      #{orgContacts,jdbcType=VARCHAR}, #{orgContactsMobile,jdbcType=VARCHAR}, 
       #{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},
-      #{countryNameZh,jdbcType=VARCHAR}, #{internationalFlag,jdbcType=INTEGER},#{jmrhFlag,jdbcType=INTEGER},#{boutique,jdbcType=INTEGER},#{remark,jdbcType=VARCHAR})
+      #{countryNameZh,jdbcType=VARCHAR}, #{internationalFlag,jdbcType=INTEGER},#{jmrhFlag,jdbcType=INTEGER},#{boutique,jdbcType=INTEGER},#{remark,jdbcType=VARCHAR},#{contacts,jdbcType=VARCHAR},#{contactMobile,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.Achievement">
     insert into achievement
@@ -632,6 +633,12 @@
       <if test="remark != null">
         remark = #{remark,jdbcType=VARCHAR},
       </if>
+      <if test="contacts != null">
+        contacts  = #{contacts,jdbcType=VARCHAR},
+      </if>
+      <if test="contactMobile != null">
+        contact_mobile  = #{contactMobile ,jdbcType=VARCHAR},
+      </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>
@@ -855,7 +862,7 @@
   	select 
   		a.id, a.serial_number as serialNumber, a.data_category as dataCategory, 
   		a.name, a.keyword, a.category, a.owner_name as ownerName, a.owner_type as ownerType, 
-  		a.owner_id as ownerId, a.org_id as orgId, a.contacts,a.create_time as createTime,
+  		a.owner_id as ownerId, a.org_id as orgId,a.create_time as createTime,
   		a.release_date as releaseDate, a.audit_status as auditStatus, ad.name as techBrokerId,a.boutique,ad.id techBrokerIdd,
   		a.release_status as releaseStatus
   	<if test="hot != null and hot == 1"><!-- 在首页 -->
@@ -880,7 +887,7 @@
 		and a.owner_type = #{ownerType,jdbcType=VARCHAR}
 	</if>
   	<if test="ownerName != null">
-  		and  a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%') 	
+  		and  a.owner_name like CONCAT(#{ownerName,jdbcType=VARCHAR},'%') 	
   	</if>
   	<if test="ownerId != null">
 		and  a.owner_id = #{ownerId,jdbcType=VARCHAR}
@@ -1237,7 +1244,7 @@
 		    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.id_number as iOwnerIdNumber, u.mobile as iOwnerMobile,j.easemob_name as easemobName,a.remark,
-			ifnull(t.x,0) as orderIntentionCount ,ifnull(t2.x,0) as orderCount,ifnull(mm.effective,0) hot,a.boutique,
+			ifnull(t.x,0) as orderIntentionCount ,ifnull(t2.x,0) as orderCount,ifnull(mm.effective,0) hot,a.boutique,a.contacts,a.contact_mobile as contactMobile, 
 			a.international_flag as internationalFlag
 	from achievement a
     left join user_identity ui on a.owner_id = ui.uid
@@ -1275,7 +1282,7 @@
 		    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, u.mobile as iOwnerMobile,a.boutique,ifnull(mm.effective,0) hot,mm.cover_img as coverImg,a.remark
+		    oi.org_code as iOwnerIdNumber, u.mobile as iOwnerMobile,a.boutique,ifnull(mm.effective,0) hot,mm.cover_img as coverImg,a.remark,a.contacts,a.contact_mobile as contactMobile
     from achievement a
     left join organization_identity oi on a.owner_id = oi.uid
     left join user u on u.id = a.owner_id
@@ -1802,7 +1809,7 @@
   	select 
   		a.id, a.serial_number as serialNumber, a.data_category as dataCategory, 
   		a.name, a.keyword, a.category, a.owner_name as ownerName, a.owner_type as ownerType, 
-  		<!-- oi.unit_name as username,  -->a.owner_id as ownerId, a.org_id as orgId, a.contacts,a.create_time as createTime,
+  		<!-- oi.unit_name as username,  -->a.owner_id as ownerId, a.org_id as orgId,a.create_time as createTime,
   		a.release_date as releaseDate, a.audit_status as auditStatus, ad.name as techBrokerId,a.boutique
   	<if test="hot != null and hot == 1"><!-- 在首页 -->
 		,1 as hot
@@ -1913,7 +1920,7 @@
 		and a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR} 
 	</if>
   	<if test="ownerName != null">
-  		and  a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%')
+  		and  a.owner_name like CONCAT(#{ownerName,jdbcType=VARCHAR},'%')
   	</if>
   	<!-- <if test="unitName != null">
   		and  oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
@@ -1969,7 +1976,7 @@
   	select 
   		a.id, a.serial_number as serialNumber, a.data_category as dataCategory, 
   		a.name, a.keyword, a.category, a.owner_name as ownerName, a.owner_type as ownerType, 
-  		<!-- oi.unit_name as username,  -->a.owner_id as ownerId, a.org_id as orgId, a.contacts,a.create_time as createTime,
+  		<!-- oi.unit_name as username,  -->a.owner_id as ownerId, a.org_id as orgId,a.create_time as createTime,
   		a.release_date as releaseDate, a.audit_status as auditStatus, ad.name as techBrokerId,a.boutique
   	<if test="hot != null and hot == 1"><!-- 在首页 -->
 		,1 as hot
@@ -2001,7 +2008,7 @@
 		and (a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR} or ad.department_id=(select department_id from admin where id=#{techBrokerId,jdbcType=VARCHAR}))
 	</if>
   	<if test="ownerName != null">
-  		and  a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%') 	
+  		and  a.owner_name like CONCAT(#{ownerName,jdbcType=VARCHAR},'%') 	
   	</if>
   	<!-- <if test="unitName != null">
   		and  oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')

+ 23 - 11
src/main/java/com/goafanti/common/model/Achievement.java

@@ -3,12 +3,15 @@ package com.goafanti.common.model;
 import java.math.BigDecimal;
 import java.util.Date;
 
+import javax.validation.constraints.Size;
+
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.time.DateFormatUtils;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonFormat.Shape;
 import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.utils.FileUtils;
 import com.fasterxml.jackson.annotation.JsonIgnore;
 
@@ -220,10 +223,6 @@ public class Achievement {
 	 */
 	private String		orgContactsMobile;
 
-	/**
-	 * 联系人及联系电话
-	 */
-	private Integer		contacts;
 
 	/**
 	 * 客户经理ID
@@ -292,6 +291,26 @@ public class Achievement {
     private Integer boutique;
     
     private String remark;
+    
+    private String contacts;
+	
+	private String contactMobile ;
+	
+	public String getContacts() {
+		return contacts;
+	}
+
+	public void setContacts(String contacts) {
+		this.contacts = contacts;
+	}
+
+	public String getContactMobile() {
+		return contactMobile;
+	}
+
+	public void setContactMobile(String contactMobile) {
+		this.contactMobile = contactMobile;
+	}
 	
 	public String getRemark() {
 		return remark;
@@ -656,14 +675,7 @@ public class Achievement {
 		this.orgContactsMobile = orgContactsMobile;
 	}
 
-	@JsonFormat(shape = Shape.STRING)
-	public Integer getContacts() {
-		return contacts;
-	}
 
-	public void setContacts(Integer contacts) {
-		this.contacts = contacts;
-	}
 
 	public String getManagerId() {
 		return managerId;

File diff suppressed because it is too large
+ 4004 - 0
src/main/java/com/goafanti/common/model/AchievementExample.java


+ 69 - 0
src/main/java/com/goafanti/common/model/AchievementWithBLOBs.java

@@ -0,0 +1,69 @@
+package com.goafanti.common.model;
+
+public class AchievementWithBLOBs extends Achievement {
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column achievement.introduction
+     *
+     * @mbg.generated Tue Mar 20 11:56:41 CST 2018
+     */
+    private String introduction;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column achievement.maturity_picture_url
+     *
+     * @mbg.generated Tue Mar 20 11:56:41 CST 2018
+     */
+    private String maturityPictureUrl;
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column achievement.introduction
+     *
+     * @return the value of achievement.introduction
+     *
+     * @mbg.generated Tue Mar 20 11:56:41 CST 2018
+     */
+    public String getIntroduction() {
+        return introduction;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column achievement.introduction
+     *
+     * @param introduction the value for achievement.introduction
+     *
+     * @mbg.generated Tue Mar 20 11:56:41 CST 2018
+     */
+    public void setIntroduction(String introduction) {
+        this.introduction = introduction;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column achievement.maturity_picture_url
+     *
+     * @return the value of achievement.maturity_picture_url
+     *
+     * @mbg.generated Tue Mar 20 11:56:41 CST 2018
+     */
+    public String getMaturityPictureUrl() {
+        return maturityPictureUrl;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column achievement.maturity_picture_url
+     *
+     * @param maturityPictureUrl the value for achievement.maturity_picture_url
+     *
+     * @mbg.generated Tue Mar 20 11:56:41 CST 2018
+     */
+    public void setMaturityPictureUrl(String maturityPictureUrl) {
+        this.maturityPictureUrl = maturityPictureUrl;
+    }
+}