Browse Source

Merge remote-tracking branch 'origin/dev' into test

wanghui 8 years ago
parent
commit
a04cc27495

+ 2 - 0
src/main/java/com/goafanti/common/dao/UserBusinessMapper.java

@@ -83,4 +83,6 @@ public interface UserBusinessMapper {
 	List<UserBusiness> findBusinessByUAid(@Param("uid")String uid, @Param("aid")String aid);
 
 	BussinessFollowBo findBusinessDetail(@Param("businessId")String businessId);
+
+	BussinessFollowBo findFollowOneBusiness(@Param("ufbId") String ufbId);
 }

+ 11 - 11
src/main/java/com/goafanti/common/dao/UserFollowBusinessMapper.java

@@ -9,69 +9,69 @@ public interface UserFollowBusinessMapper {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow_business
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	long countByExample(UserFollowBusinessExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow_business
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	int deleteByExample(UserFollowBusinessExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow_business
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	int deleteByPrimaryKey(String id);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow_business
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	int insert(UserFollowBusiness record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow_business
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	int insertSelective(UserFollowBusiness record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow_business
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	List<UserFollowBusiness> selectByExample(UserFollowBusinessExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow_business
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	UserFollowBusiness selectByPrimaryKey(String id);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow_business
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	int updateByExampleSelective(@Param("record") UserFollowBusiness record,
 			@Param("example") UserFollowBusinessExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow_business
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	int updateByExample(@Param("record") UserFollowBusiness record,
 			@Param("example") UserFollowBusinessExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow_business
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	int updateByPrimaryKeySelective(UserFollowBusiness record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow_business
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	int updateByPrimaryKey(UserFollowBusiness record);
 }

+ 7 - 0
src/main/java/com/goafanti/common/dao/UserMapper.java

@@ -162,4 +162,11 @@ public interface UserMapper {
 	 */
 	List<UserBusiness> findBusinessByFollowId(String followId);
 
+	/**
+	 * 查询客户所有联系人
+	 * @param uid
+	 * @return
+	 */
+	List<OrganizationContactBook> findAllContacts(String uid);
+
 }

+ 31 - 1
src/main/java/com/goafanti/common/mapper/UserBusinessMapper.xml

@@ -363,6 +363,9 @@
 		a.business_glossory_id = c.id left join admin d on
 		a.uid = d.id
 	where a.aid = #{aid,jdbcType=VARCHAR}
+	<if test="uid != null and uid !=''">
+		and a.uid = #{uid,jdbcType=VARCHAR}
+	</if>
 	<if test="businessId !=null and businessId != ''">
 		and a.business_glossory_id = #{businessGlossoryId,jdbcType=VARCHAR}
 	</if>
@@ -397,6 +400,9 @@
 		a.business_glossory_id = c.id left join admin d on
 		a.uid = d.id
 	where a.aid = #{aid,jdbcType=VARCHAR}
+	<if test="uid != null and uid !=''">
+		and a.uid = #{uid,jdbcType=VARCHAR}
+	</if>
 	<if test="businessId !=null and businessId != ''">
 		and c.id = #{businessId,jdbcType=VARCHAR}
 	</if>
@@ -436,13 +442,14 @@
   </select>
   
   <select id="findBusinessByUAid"  parameterType="java.lang.String" resultMap="BaseResultMap">
-  	select select id,uid,business_glossory_id,follow_situation,customer_status,remarks from user_business
+  	select id,uid,business_glossory_id,follow_situation,customer_status,remarks from user_business
   	where  uid = #{uid,jdbcType=VARCHAR} and aid = #{aid,jdbcType=VARCHAR}
   </select>
   
   <select id="findBusinessDetail" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.BussinessFollowBo">
 	select
 		a.id as businessId,
+		a.uid,
 		a.business_glossory_id as businessGlossoryId,
 		a.create_time as createTime,
 		a.follow_situation as followSituation,
@@ -456,4 +463,27 @@
 		a.aid = c.id
 	where a.id = #{businessId,jdbcType=VARCHAR}
   </select>
+  
+  <select id="findFollowOneBusiness" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.BussinessFollowBo">
+	select
+		a.customer_status as customerStatus,
+		a.follow_situation as followSituation,
+		a.remarks,
+		b.id as followId,
+		b.create_time as createTime,
+		b.business_glossory_id as businessGlossoryId,
+		b.result,
+		d.name as contacts,
+		d.mobile as contactMobile,
+		b.create_time as followTime,
+		e.name as adminName,
+		f.name as identifyName
+	from
+		user_follow_business a 
+	left join user_follow b on a.follow_id = b.id
+	left join user_business c on a.business_id = c.id
+	left join organization_contact_book d on b.ocb_id = d.id
+	left join admin e on b.aid = e.id
+	left join user f on b.uid = f.id
+  </select>
 </mapper>

+ 15 - 15
src/main/java/com/goafanti/common/mapper/UserFollowBusinessMapper.xml

@@ -5,7 +5,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 16 12:41:22 CST 2017.
+      This element was generated on Sat Nov 18 16:17:07 CST 2017.
     -->
     <id column="id" jdbcType="VARCHAR" property="id" />
     <result column="follow_id" jdbcType="VARCHAR" property="followId" />
@@ -19,7 +19,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 16 12:41:22 CST 2017.
+      This element was generated on Sat Nov 18 16:17:07 CST 2017.
     -->
     <where>
       <foreach collection="oredCriteria" item="criteria" separator="or">
@@ -53,7 +53,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 16 12:41:22 CST 2017.
+      This element was generated on Sat Nov 18 16:17:07 CST 2017.
     -->
     <where>
       <foreach collection="example.oredCriteria" item="criteria" separator="or">
@@ -87,7 +87,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 16 12:41:22 CST 2017.
+      This element was generated on Sat Nov 18 16:17:07 CST 2017.
     -->
     id, follow_id, business_id, follow_situation, customer_status, remarks, business_glossory_id
   </sql>
@@ -95,7 +95,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 16 12:41:22 CST 2017.
+      This element was generated on Sat Nov 18 16:17:07 CST 2017.
     -->
     select
     <if test="distinct">
@@ -114,7 +114,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 16 12:41:22 CST 2017.
+      This element was generated on Sat Nov 18 16:17:07 CST 2017.
     -->
     select 
     <include refid="Base_Column_List" />
@@ -125,7 +125,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 16 12:41:22 CST 2017.
+      This element was generated on Sat Nov 18 16:17:07 CST 2017.
     -->
     delete from user_follow_business
     where id = #{id,jdbcType=VARCHAR}
@@ -134,7 +134,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 16 12:41:22 CST 2017.
+      This element was generated on Sat Nov 18 16:17:07 CST 2017.
     -->
     delete from user_follow_business
     <if test="_parameter != null">
@@ -145,7 +145,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 16 12:41:22 CST 2017.
+      This element was generated on Sat Nov 18 16:17:07 CST 2017.
     -->
     insert into user_follow_business (id, follow_id, business_id, 
       follow_situation, customer_status, remarks, 
@@ -158,7 +158,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 16 12:41:22 CST 2017.
+      This element was generated on Sat Nov 18 16:17:07 CST 2017.
     -->
     insert into user_follow_business
     <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -212,7 +212,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 16 12:41:22 CST 2017.
+      This element was generated on Sat Nov 18 16:17:07 CST 2017.
     -->
     select count(*) from user_follow_business
     <if test="_parameter != null">
@@ -223,7 +223,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 16 12:41:22 CST 2017.
+      This element was generated on Sat Nov 18 16:17:07 CST 2017.
     -->
     update user_follow_business
     <set>
@@ -257,7 +257,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 16 12:41:22 CST 2017.
+      This element was generated on Sat Nov 18 16:17:07 CST 2017.
     -->
     update user_follow_business
     set id = #{record.id,jdbcType=VARCHAR},
@@ -275,7 +275,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 16 12:41:22 CST 2017.
+      This element was generated on Sat Nov 18 16:17:07 CST 2017.
     -->
     update user_follow_business
     <set>
@@ -304,7 +304,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Nov 16 12:41:22 CST 2017.
+      This element was generated on Sat Nov 18 16:17:07 CST 2017.
     -->
     update user_follow_business
     set follow_id = #{followId,jdbcType=VARCHAR},

+ 32 - 9
src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

@@ -267,7 +267,7 @@
 	
 	<select id="findCustomerByName" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.CustomerSimpleBo">
 		select id,identify_name as name from user where identify_name like
-		concat('%',#{identifyName},'%')
+		concat(#{identifyName},'%')
 	</select>
 	
 	<select id="judgeCustomerByName" parameterType="java.lang.String" resultType="java.lang.Integer">
@@ -317,33 +317,50 @@
 			b.identify_name as identityName,
 			c.name,
 			c.mobile,
-			d.name as adminName 
+			d.name as adminName
+		<if test="businessGlossoryId != null and businessGlossoryId != ''"><!--  客户甲项目A所有的跟进记录 -->
+			,e.id as ufbId
+		</if>
 		from user_follow a
 		left join user b on a.uid = b.id 
 		left join organization_contact_book c on a.ocb_id = c.id
 		left join admin d on a.aid = d.id
+		<if test="businessGlossoryId != null and businessGlossoryId != ''"><!--  客户甲项目A所有的跟进记录 -->
+			right join user_follow_business e on a.id = e.follow_id
+		</if>
+		where a.effective = 0
 		<if test="uid != null and uid != ''">
-			a.uid = #{uid,jdbcType=VARCHAR}
+			and a.uid = #{uid,jdbcType=VARCHAR}
 		</if>
 		<if test="aid != null and aid != ''">
-			a.aid = #{adid,jdbcType=VARCHAR}
+			and a.aid = #{adid,jdbcType=VARCHAR}
+		</if>
+		<if test="businessGlossoryId != null and businessGlossoryId != ''"><!--  客户甲项目A所有的跟进记录 -->
+			and e.businessGlossoryId = #{businessGlossoryId,jdbcType=VARCHAR}
 		</if>
 		<if test="page_sql != null">
     		${page_sql}
    		 </if>
 	</select>
-	<select id="selectFollowHistoryCount">
+	<select id="selectFollowHistoryCount" resultType="java.lang.Integer">
 		select 
 			count(0)
 		from user_follow a
 		left join user b on a.uid = b.id 
 		left join organization_contact_book c on a.ocb_id = c.id
 		left join admin d on a.aid = d.id
+		<if test="businessGlossoryId != null and businessGlossoryId != ''"><!--  客户甲项目A所有的跟进记录 -->
+			right join user_follow_business e on a.id = e.follow_id
+		</if>
+		where a.effective = 0
 		<if test="uid != null and uid != ''">
-			a.uid = #{uid,jdbcType=VARCHAR}
+			and a.uid = #{uid,jdbcType=VARCHAR}
 		</if>
 		<if test="aid != null and aid != ''">
-			a.aid = #{adid,jdbcType=VARCHAR}
+			and a.aid = #{adid,jdbcType=VARCHAR}
+		</if>
+		<if test="businessGlossoryId != null and businessGlossoryId != ''"><!--  客户甲项目A所有的跟进记录 -->
+			and e.businessGlossoryId = #{businessGlossoryId,jdbcType=VARCHAR}
 		</if>
 	</select>
 	
@@ -361,7 +378,8 @@
 			current_member_status currentMemberStatus,
 			service_certification as  serviceCertification,
 			user_certification as userCertification,
-			identify_name as identifyName
+			identify_name as identifyName,
+			status
 		from
 			user
 		where id = #{uid,jdbcType=VARCHAR}
@@ -372,6 +390,12 @@
 		where uid = #{uid,jdbcType=VARCHAR} and aid = #{aid,jdbcType=VARCHAR}
 	</select>
 	
+	<select id="findAllContacts" parameterType="java.lang.String" resultType="com.goafanti.common.model.OrganizationContactBook">
+		select id as ocbId,name,mobile from organization_contact_book 
+		where uid = #{uid,jdbcType=VARCHAR}
+		group by name
+	</select>
+	
 	<select id="findFollowById" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.FollowBusinessBo">
 		select
 			a.id as followId,
@@ -402,5 +426,4 @@
 		user_follow_business a
 		where a.id = #{followId,jdbcType=VARCHAR}
 	</select>
-	
 </mapper>

+ 21 - 21
src/main/java/com/goafanti/common/model/UserFollowBusiness.java

@@ -4,44 +4,44 @@ public class UserFollowBusiness {
 
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_follow_business.id
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	private String id;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_follow_business.follow_id
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	private String followId;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_follow_business.business_id
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	private String businessId;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_follow_business.follow_situation
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	private Integer followSituation;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_follow_business.customer_status
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	private Integer customerStatus;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_follow_business.remarks
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	private String remarks;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_follow_business.business_glossory_id
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	private Integer businessGlossoryId;
 
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_follow_business.id
 	 * @return  the value of user_follow_business.id
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	public String getId() {
 		return id;
@@ -50,7 +50,7 @@ public class UserFollowBusiness {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_follow_business.id
 	 * @param id  the value for user_follow_business.id
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	public void setId(String id) {
 		this.id = id;
@@ -59,7 +59,7 @@ public class UserFollowBusiness {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_follow_business.follow_id
 	 * @return  the value of user_follow_business.follow_id
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	public String getFollowId() {
 		return followId;
@@ -68,7 +68,7 @@ public class UserFollowBusiness {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_follow_business.follow_id
 	 * @param followId  the value for user_follow_business.follow_id
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	public void setFollowId(String followId) {
 		this.followId = followId;
@@ -77,7 +77,7 @@ public class UserFollowBusiness {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_follow_business.business_id
 	 * @return  the value of user_follow_business.business_id
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	public String getBusinessId() {
 		return businessId;
@@ -86,7 +86,7 @@ public class UserFollowBusiness {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_follow_business.business_id
 	 * @param businessId  the value for user_follow_business.business_id
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	public void setBusinessId(String businessId) {
 		this.businessId = businessId;
@@ -95,7 +95,7 @@ public class UserFollowBusiness {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_follow_business.follow_situation
 	 * @return  the value of user_follow_business.follow_situation
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	public Integer getFollowSituation() {
 		return followSituation;
@@ -104,7 +104,7 @@ public class UserFollowBusiness {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_follow_business.follow_situation
 	 * @param followSituation  the value for user_follow_business.follow_situation
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	public void setFollowSituation(Integer followSituation) {
 		this.followSituation = followSituation;
@@ -113,7 +113,7 @@ public class UserFollowBusiness {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_follow_business.customer_status
 	 * @return  the value of user_follow_business.customer_status
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	public Integer getCustomerStatus() {
 		return customerStatus;
@@ -122,7 +122,7 @@ public class UserFollowBusiness {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_follow_business.customer_status
 	 * @param customerStatus  the value for user_follow_business.customer_status
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	public void setCustomerStatus(Integer customerStatus) {
 		this.customerStatus = customerStatus;
@@ -131,7 +131,7 @@ public class UserFollowBusiness {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_follow_business.remarks
 	 * @return  the value of user_follow_business.remarks
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	public String getRemarks() {
 		return remarks;
@@ -140,7 +140,7 @@ public class UserFollowBusiness {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_follow_business.remarks
 	 * @param remarks  the value for user_follow_business.remarks
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	public void setRemarks(String remarks) {
 		this.remarks = remarks;
@@ -149,7 +149,7 @@ public class UserFollowBusiness {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_follow_business.business_glossory_id
 	 * @return  the value of user_follow_business.business_glossory_id
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	public Integer getBusinessGlossoryId() {
 		return businessGlossoryId;
@@ -158,7 +158,7 @@ public class UserFollowBusiness {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_follow_business.business_glossory_id
 	 * @param businessGlossoryId  the value for user_follow_business.business_glossory_id
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	public void setBusinessGlossoryId(Integer businessGlossoryId) {
 		this.businessGlossoryId = businessGlossoryId;

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

@@ -6,23 +6,23 @@ import java.util.List;
 public class UserFollowBusinessExample {
     /**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table user_follow_business
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	protected String orderByClause;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table user_follow_business
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	protected boolean distinct;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table user_follow_business
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	protected List<Criteria> oredCriteria;
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow_business
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	public UserFollowBusinessExample() {
 		oredCriteria = new ArrayList<Criteria>();
@@ -30,7 +30,7 @@ public class UserFollowBusinessExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow_business
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	public void setOrderByClause(String orderByClause) {
 		this.orderByClause = orderByClause;
@@ -38,7 +38,7 @@ public class UserFollowBusinessExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow_business
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	public String getOrderByClause() {
 		return orderByClause;
@@ -46,7 +46,7 @@ public class UserFollowBusinessExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow_business
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	public void setDistinct(boolean distinct) {
 		this.distinct = distinct;
@@ -54,7 +54,7 @@ public class UserFollowBusinessExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow_business
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	public boolean isDistinct() {
 		return distinct;
@@ -62,7 +62,7 @@ public class UserFollowBusinessExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow_business
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	public List<Criteria> getOredCriteria() {
 		return oredCriteria;
@@ -70,7 +70,7 @@ public class UserFollowBusinessExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow_business
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	public void or(Criteria criteria) {
 		oredCriteria.add(criteria);
@@ -78,7 +78,7 @@ public class UserFollowBusinessExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow_business
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	public Criteria or() {
 		Criteria criteria = createCriteriaInternal();
@@ -88,7 +88,7 @@ public class UserFollowBusinessExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow_business
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	public Criteria createCriteria() {
 		Criteria criteria = createCriteriaInternal();
@@ -100,7 +100,7 @@ public class UserFollowBusinessExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow_business
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	protected Criteria createCriteriaInternal() {
 		Criteria criteria = new Criteria();
@@ -109,7 +109,7 @@ public class UserFollowBusinessExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_follow_business
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	public void clear() {
 		oredCriteria.clear();
@@ -119,7 +119,7 @@ public class UserFollowBusinessExample {
 
 	/**
 	 * This class was generated by MyBatis Generator. This class corresponds to the database table user_follow_business
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	protected abstract static class GeneratedCriteria {
 		protected List<Criterion> criteria;
@@ -625,7 +625,7 @@ public class UserFollowBusinessExample {
 
 	/**
 	 * This class was generated by MyBatis Generator. This class corresponds to the database table user_follow_business
-	 * @mbg.generated  Thu Nov 16 12:41:22 CST 2017
+	 * @mbg.generated  Sat Nov 18 16:17:07 CST 2017
 	 */
 	public static class Criterion {
 		private String condition;

+ 9 - 1
src/main/java/com/goafanti/customer/bo/BusinessListBo.java

@@ -1,6 +1,8 @@
 package com.goafanti.customer.bo;
 
 public class BusinessListBo {
+	/** 客户ID **/
+	private String uid;
 	/** 客户业务ID **/
 	private String businessId;
 	/** 业务名称 **/
@@ -23,7 +25,13 @@ public class BusinessListBo {
 	private String createTime;
 	/** 业务字典ID **/
 	private String businessGlossoryId;
-
+	
+	public String getUid() {
+		return uid;
+	}
+	public void setUid(String uid) {
+		this.uid = uid;
+	}
 	public String getBusinessId() {
 		return businessId;
 	}

+ 40 - 1
src/main/java/com/goafanti/customer/bo/BussinessFollowBo.java

@@ -8,6 +8,8 @@ package com.goafanti.customer.bo;
 public class BussinessFollowBo {
 	/** 客户ID **/
 	private String uid;
+	/** 客户名 **/
+	private String identifyName;
 	/** 客户业务ID **/
 	private String businessId;
 	/** 意向服务ID **/
@@ -18,6 +20,8 @@ public class BussinessFollowBo {
 	private String customerStatus;
 	/** 创建时间 **/
 	private String createTime;
+	/** 拜访记录ID **/
+	private String followId;
 	/** 跟进时间 **/
 	private String followTime;
 	/** 营销员ID **/
@@ -30,13 +34,24 @@ public class BussinessFollowBo {
 	private String remarks;
 	/** 拜访结果 **/
 	private String result;
-	
+	/** 当前联系人姓名 **/
+	private String contacts;
+	/** 当前联系人号码 **/
+	private String contactMobile;
+	/** 客户甲的项目A对应的拜访记录ID **/
+	private String ufbId;
 	public String getUid() {
 		return uid;
 	}
 	public void setUid(String uid) {
 		this.uid = uid;
 	}
+	public String getIdentifyName() {
+		return identifyName;
+	}
+	public void setIdentifyName(String identifyName) {
+		this.identifyName = identifyName;
+	}
 	public String getBusinessId() {
 		return businessId;
 	}
@@ -67,6 +82,12 @@ public class BussinessFollowBo {
 	public void setCreateTime(String createTime) {
 		this.createTime = createTime;
 	}
+	public String getFollowId() {
+		return followId;
+	}
+	public void setFollowId(String followId) {
+		this.followId = followId;
+	}
 	public String getFollowTime() {
 		return followTime;
 	}
@@ -103,4 +124,22 @@ public class BussinessFollowBo {
 	public void setResult(String result) {
 		this.result = result;
 	}
+	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 getUfbId() {
+		return ufbId;
+	}
+	public void setUfbId(String ufbId) {
+		this.ufbId = ufbId;
+	}
 }

+ 1 - 1
src/main/java/com/goafanti/customer/bo/FollowBusinessBo.java

@@ -20,7 +20,7 @@ public class FollowBusinessBo {
 	private String contacts;
 	/** 需要保存的联系人ID **/
 	private String ocbId;
-	/** 联系方式 **/
+	/** 拜访方式 **/
 	private String contactType;
 	/** 拜访结果 **/
 	private String result;

+ 9 - 0
src/main/java/com/goafanti/customer/bo/FollowListBo.java

@@ -22,6 +22,9 @@ public class FollowListBo {
 	/** 拜访人姓名 **/
 	private String adminName;
 	
+	/** user_follow_business ID **/ 
+	private String ufbId;
+	
 	public String getFollowId() {
 		return followId;
 	}
@@ -64,4 +67,10 @@ public class FollowListBo {
 	public void setAdminName(String adminName) {
 		this.adminName = adminName;
 	}
+	public String getUfbId() {
+		return ufbId;
+	}
+	public void setUfbId(String ufbId) {
+		this.ufbId = ufbId;
+	}
 }

+ 24 - 5
src/main/java/com/goafanti/customer/controller/BusinessApiController.java

@@ -93,16 +93,16 @@ public class BusinessApiController extends BaseController{
 	}
 	
 	/** 进入跟进单个客户意向 **/
-	@RequestMapping(value = "/toFollowOneBusiness", method = RequestMethod.GET)
-	public Result toFollowOneBusiness(String businessId){
+	@RequestMapping(value = "/toAddFollowOneBusiness", method = RequestMethod.GET)
+	public Result toAddFollowOneBusiness(String businessId){
 		Result res = new Result();
 		res.setData(businessService.findBusinessDetail(businessId));
 		return res;
 	}
 	
 	/** 跟进单个客户意向 **/
-	@RequestMapping(value = "/followOneBusiness", method = RequestMethod.POST)
-	public Result followOneBusiness(BussinessFollowBo bfb){
+	@RequestMapping(value = "/addFollowOneBusiness", method = RequestMethod.POST)
+	public Result addFollowOneBusiness(BussinessFollowBo bfb){
 		Result res = new Result();
 		if(StringUtils.isBlank(bfb.getBusinessId()) ||
 				StringUtils.isBlank(bfb.getUid()) || StringUtils.isBlank(bfb.getOcbId())){
@@ -110,10 +110,29 @@ public class BusinessApiController extends BaseController{
 			return res;
 		}
 		try {
-			businessService.followOneBusiness(bfb);
+			businessService.addFollowOneBusiness(bfb);
 		} catch (ParseException e) {
 			e.printStackTrace();
 		}
 		return res;
 	}
+	
+	/** 进入修改某个客户一个业务的当次拜访 **/
+	@RequestMapping(value = "/toUpdateFollowOneBusiness", method = RequestMethod.GET)
+	public Result toUpdateFollowOneBusiness(String ufbId){
+		Result res = new Result();
+		res.setData(businessService.findFollowOneBusiness(ufbId));
+		return res;
+	}
+	
+	/** 修改某个客户一个业务的当次拜访 **/
+	@RequestMapping(value = "/updateFollowOneBusiness", method = RequestMethod.GET)
+	public Result updateFollowOneBusiness(BussinessFollowBo bfb){
+		Result res = new Result();
+		if(StringUtils.isBlank(bfb.getFollowId()) || StringUtils.isBlank(bfb.getUfbId())){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,""));
+		}
+		businessService.updateFollowOneBusiness(bfb);
+		return res;
+	}
 }

+ 10 - 7
src/main/java/com/goafanti/customer/controller/CustomerApiController.java

@@ -128,9 +128,9 @@ public class CustomerApiController extends BaseController{
 	
 	/** 查看跟进记录 **/
 	@RequestMapping(value = "/listFollowHistory", method = RequestMethod.GET)
-	public Result listFollowHistory(Integer pageNo, Integer pageSize,String uid){
+	public Result listFollowHistory(Integer pageNo, Integer pageSize,String uid,String businessGlossoryId){
 		Result res = new Result();
-		res.setData(customerService.listFollowHistory(pageNo,pageSize,uid));
+		res.setData(customerService.listFollowHistory(pageNo,pageSize,uid,businessGlossoryId));
 		return res;
 	}
 	
@@ -204,11 +204,7 @@ public class CustomerApiController extends BaseController{
 		return res;
 	}
 	
-	/**
-	 * 修改拜访记录
-	 * @param fbb
-	 * @return
-	 */
+	/** 修改拜访记录 **/ 
 	@RequestMapping(value = "/updateFollow", method = RequestMethod.POST)
 	public Result updateFollow(FollowBusinessBo fbb){
 		Result res = new Result();
@@ -220,4 +216,11 @@ public class CustomerApiController extends BaseController{
 		return res;
 	}
 	
+	/** 查询客户的所有联系人 **/ 
+	@RequestMapping(value = "/findAllContacts", method = RequestMethod.GET)
+	public Result findAllContacts(String uid){
+		Result res = new Result();
+		res.setData(customerService.findAllContacts(uid));
+		return res;
+	}
 }

+ 15 - 1
src/main/java/com/goafanti/customer/service/BusinessService.java

@@ -63,5 +63,19 @@ public interface BusinessService {
 	 * @param bfb
 	 * @return
 	 */
-	int followOneBusiness(BussinessFollowBo bfb) throws ParseException;
+	int addFollowOneBusiness(BussinessFollowBo bfb) throws ParseException;
+
+	/**
+	 * 查询某个客户的一个意向的当次拜访
+	 * @param ufbId
+	 * @return
+	 */
+	BussinessFollowBo findFollowOneBusiness(String ufbId);
+
+	/**
+	 * 修改某个客户的一个意向的当次拜访
+	 * @param bfb
+	 * @return
+	 */
+	int updateFollowOneBusiness(BussinessFollowBo bfb);
 }

+ 8 - 1
src/main/java/com/goafanti/customer/service/CustomerService.java

@@ -125,7 +125,7 @@ public interface CustomerService {
 	 * @param pageSize
 	 * @return
 	 */
-	Pagination<FollowListBo> listFollowHistory(Integer pageNo, Integer pageSize,String uid);
+	Pagination<FollowListBo> listFollowHistory(Integer pageNo, Integer pageSize,String uid,String businessGlossoryId);
 	
 	/**
 	 * 查看客户账户信息
@@ -172,4 +172,11 @@ public interface CustomerService {
 	 * @param fbb
 	 */
 	int updateFollow(FollowBusinessBo fbb)  throws ParseException ;
+	
+	/**
+	 * 查询客户的所有联系人
+	 * @param uid
+	 * @return
+	 */
+	List<OrganizationContactBook> findAllContacts(String uid);
 }

+ 26 - 1
src/main/java/com/goafanti/customer/service/impl/BusinessServiceImpl.java

@@ -44,6 +44,7 @@ public class BusinessServiceImpl extends BaseMybatisDao<UserBusinessMapper> impl
 	
 	private Map<String,Object> disposeParams(BusinessListBo blo){
 		Map<String, Object> params = new HashMap<String, Object>();
+		if(StringUtils.isNotBlank(blo.getUid())) params.put("uid", blo.getUid());
 		if(StringUtils.isNotBlank(blo.getAid())) params.put("aid", blo.getAid());
 		if(StringUtils.isNotBlank(blo.getAdminName())) params.put("adminName", blo.getAdminName());
 		if(StringUtils.isNotBlank(blo.getBusinessId())) params.put("businessId", blo.getBusinessId());
@@ -132,7 +133,7 @@ public class BusinessServiceImpl extends BaseMybatisDao<UserBusinessMapper> impl
 
 	@Override
 	@Transactional
-	public int followOneBusiness(BussinessFollowBo bfb) throws ParseException {
+	public int addFollowOneBusiness(BussinessFollowBo bfb) throws ParseException {
 		Date updateTime = new Date();
 		SimpleDateFormat format = new  SimpleDateFormat(AFTConstants.YYYYMMDDHHMMSS);
 		UserBusiness userBusiness = new UserBusiness();
@@ -166,4 +167,28 @@ public class BusinessServiceImpl extends BaseMybatisDao<UserBusinessMapper> impl
 		return 1;
 	}
 
+	@Override
+	public BussinessFollowBo findFollowOneBusiness(String ufbId) {
+		
+		return userBusinessMapper.findFollowOneBusiness(ufbId);
+	}
+
+	@Override
+	public int updateFollowOneBusiness(BussinessFollowBo bfb) {
+		//修改业务跟进中间表
+		UserFollowBusiness userFollowBusiness = new UserFollowBusiness();
+		userFollowBusiness.setId(bfb.getUfbId());
+		userFollowBusiness.setRemarks(bfb.getRemarks());
+		userFollowBusiness.setCustomerStatus(Integer.parseInt(bfb.getCustomerStatus()));
+		userFollowBusiness.setFollowSituation(Integer.parseInt(bfb.getFollowSituation()));
+		userFollowBusinessMapper.updateByPrimaryKeySelective(userFollowBusiness);
+		//修改跟进记录表
+		UserFollow userFollow = new UserFollow();
+		userFollow.setId(bfb.getFollowId());
+		userFollow.setContactType(Integer.parseInt(bfb.getContactType()));
+		userFollow.setResult(bfb.getResult());
+		userFollowMapper.updateByPrimaryKeySelective(userFollow);
+		return 1;
+	}
+
 }

+ 8 - 1
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -267,9 +267,10 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<FollowListBo> listFollowHistory(Integer pageNo, Integer pageSize,String uid) {
+	public Pagination<FollowListBo> listFollowHistory(Integer pageNo, Integer pageSize,String uid,String businessGlossoryId) {
 		Map<String, Object> params = new HashMap<String, Object>();
 		if(StringUtils.isNotBlank(uid))params.put("uid", uid);
+		if(StringUtils.isNotBlank(businessGlossoryId)) params.put("businessGlossoryId", businessGlossoryId);
 		return (Pagination<FollowListBo>)findPage("selectFollowHistoryList","selectFollowHistoryCount",params, pageNo, pageSize);
 	}
 
@@ -294,6 +295,7 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 	@Override
 	@Transactional
 	public int addFollow(FollowBusinessBo fbb) throws ParseException {
+		if(fbb.getUserBusinessList().size()<1) throw new BusinessException(new Error("至少需要填一个跟进业务"));
 		//更新跟进记录表
 		SimpleDateFormat format = new SimpleDateFormat(AFTConstants.YYYYMMDDHHMMSS);
 		UserFollow userFollow = new UserFollow();
@@ -429,5 +431,10 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 		}
 		return 1;
 	}
+
+	@Override
+	public List<OrganizationContactBook> findAllContacts(String uid) {
+		return userMapper.findAllContacts(uid);
+	}
 	
 }