瀏覽代碼

客户管理系统

wanghui 8 年之前
父節點
當前提交
5f049a3e72
共有 21 個文件被更改,包括 774 次插入186 次删除
  1. 1 2
      generatorConfig.xml
  2. 11 11
      src/main/java/com/goafanti/common/dao/OrganizationContactBookMapper.java
  3. 2 0
      src/main/java/com/goafanti/common/dao/UserBusinessMapper.java
  4. 16 1
      src/main/java/com/goafanti/common/dao/UserMapper.java
  5. 29 29
      src/main/java/com/goafanti/common/mapper/OrganizationContactBookMapper.xml
  6. 5 0
      src/main/java/com/goafanti/common/mapper/UserBusinessMapper.xml
  7. 68 4
      src/main/java/com/goafanti/common/mapper/UserMapperExt.xml
  8. 49 49
      src/main/java/com/goafanti/common/model/OrganizationContactBook.java
  9. 44 44
      src/main/java/com/goafanti/common/model/OrganizationContactBookExample.java
  10. 25 0
      src/main/java/com/goafanti/common/utils/BeanUtilsExt.java
  11. 92 14
      src/main/java/com/goafanti/customer/bo/BussinessFollowBo.java
  12. 1 1
      src/main/java/com/goafanti/customer/bo/CustomerListOut.java
  13. 85 0
      src/main/java/com/goafanti/customer/bo/FollowBusinessBo.java
  14. 67 0
      src/main/java/com/goafanti/customer/bo/FollowListBo.java
  15. 16 0
      src/main/java/com/goafanti/customer/bo/UserDetailBo.java
  16. 26 2
      src/main/java/com/goafanti/customer/controller/BusinessApiController.java
  17. 78 2
      src/main/java/com/goafanti/customer/controller/CustomerApiController.java
  18. 9 0
      src/main/java/com/goafanti/customer/service/BusinessService.java
  19. 38 0
      src/main/java/com/goafanti/customer/service/CustomerService.java
  20. 40 24
      src/main/java/com/goafanti/customer/service/impl/BusinessServiceImpl.java
  21. 72 3
      src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

+ 1 - 2
generatorConfig.xml

@@ -8,7 +8,6 @@
     <javaModelGenerator targetPackage="com.goafanti.common.model" targetProject="AFT" />
     <sqlMapGenerator targetPackage="com.goafanti.common.mapper" targetProject="AFT" />
     <javaClientGenerator targetPackage="com.goafanti.common.dao" targetProject="AFT" type="XMLMAPPER" />
-    <table schema="aft" tableName="user"/>
-    <table schema="aft" tableName="user_follow"/>
+    <table schema="aft" tableName="organization_contact_book"/>
   </context>
 </generatorConfiguration>

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

@@ -11,69 +11,69 @@ public interface OrganizationContactBookMapper {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	long countByExample(OrganizationContactBookExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	int deleteByExample(OrganizationContactBookExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	int deleteByPrimaryKey(String id);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	int insert(OrganizationContactBook record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	int insertSelective(OrganizationContactBook record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	List<OrganizationContactBook> selectByExample(OrganizationContactBookExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	OrganizationContactBook selectByPrimaryKey(String id);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	int updateByExampleSelective(@Param("record") OrganizationContactBook record,
 			@Param("example") OrganizationContactBookExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	int updateByExample(@Param("record") OrganizationContactBook record,
 			@Param("example") OrganizationContactBookExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	int updateByPrimaryKeySelective(OrganizationContactBook record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	int updateByPrimaryKey(OrganizationContactBook record);
 }

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

@@ -78,4 +78,6 @@ public interface UserBusinessMapper {
 	List<BusinessListBo> findBusinessGlossory();
 
 	int judgeBusiness(@Param("uid")String uid,@Param("businessGlossoryId")Integer businessGlossoryId,@Param("aid")String aid);
+
+	List<UserBusiness> findBusinessByUAid(String uid, String aid);
 }

+ 16 - 1
src/main/java/com/goafanti/common/dao/UserMapper.java

@@ -5,6 +5,7 @@ import java.util.List;
 
 import org.apache.ibatis.annotations.Param;
 
+import com.goafanti.common.model.OrganizationContactBook;
 import com.goafanti.common.model.User;
 import com.goafanti.user.bo.OrgPartnerDetailBo;
 import com.goafanti.user.bo.UserDownLoadBo;
@@ -103,7 +104,7 @@ public interface UserMapper {
 	User selectByMobieAndType(String mobile, Integer type);
 	
 	/**
-	 * 根据客户名模糊搜��?
+	 * 根据客户模糊搜索
 	 * @param name
 	 * @return
 	 */
@@ -131,4 +132,18 @@ public interface UserMapper {
 	 */
 	CustomerOrganizationDetailBo findOrganizationCustomerDetail(@Param("uid")String uid);
 
+	/**
+	 * 查看客户账户信息
+	 * @param uid
+	 * @return
+	 */
+	User findUserAccountDetail(@Param("uid")String uid);
+
+	/**
+	 * 查看客户联系人列表
+	 * @param uid
+	 * @return
+	 */
+	List<OrganizationContactBook> findCustomerContacts(@Param("uid")String uid,@Param("aid")String aid);
+
 }

+ 29 - 29
src/main/java/com/goafanti/common/mapper/OrganizationContactBookMapper.xml

@@ -5,10 +5,10 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Nov 13 11:47:55 CST 2017.
+      This element was generated on Wed Nov 15 16:01:22 CST 2017.
     -->
     <id column="id" jdbcType="VARCHAR" property="id" />
-    <result column="cid" jdbcType="VARCHAR" property="cid" />
+    <result column="uid" jdbcType="VARCHAR" property="uid" />
     <result column="name" jdbcType="VARCHAR" property="name" />
     <result column="sex" jdbcType="CHAR" property="sex" />
     <result column="mobile" jdbcType="VARCHAR" property="mobile" />
@@ -25,7 +25,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Nov 13 11:47:55 CST 2017.
+      This element was generated on Wed Nov 15 16:01:22 CST 2017.
     -->
     <where>
       <foreach collection="oredCriteria" item="criteria" separator="or">
@@ -59,7 +59,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Nov 13 11:47:55 CST 2017.
+      This element was generated on Wed Nov 15 16:01:22 CST 2017.
     -->
     <where>
       <foreach collection="example.oredCriteria" item="criteria" separator="or">
@@ -93,16 +93,16 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Nov 13 11:47:55 CST 2017.
+      This element was generated on Wed Nov 15 16:01:22 CST 2017.
     -->
-    id, cid, name, sex, mobile, email, qq, wechat, depatrment, customer_position, tel_num, 
+    id, uid, name, sex, mobile, email, qq, wechat, depatrment, customer_position, tel_num, 
     major, aid
   </sql>
   <select id="selectByExample" parameterType="com.goafanti.common.model.OrganizationContactBookExample" resultMap="BaseResultMap">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Nov 13 11:47:55 CST 2017.
+      This element was generated on Wed Nov 15 16:01:22 CST 2017.
     -->
     select
     <if test="distinct">
@@ -121,7 +121,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Nov 13 11:47:55 CST 2017.
+      This element was generated on Wed Nov 15 16:01:22 CST 2017.
     -->
     select 
     <include refid="Base_Column_List" />
@@ -132,7 +132,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Nov 13 11:47:55 CST 2017.
+      This element was generated on Wed Nov 15 16:01:22 CST 2017.
     -->
     delete from organization_contact_book
     where id = #{id,jdbcType=VARCHAR}
@@ -141,7 +141,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Nov 13 11:47:55 CST 2017.
+      This element was generated on Wed Nov 15 16:01:22 CST 2017.
     -->
     delete from organization_contact_book
     <if test="_parameter != null">
@@ -152,13 +152,13 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Nov 13 11:47:55 CST 2017.
+      This element was generated on Wed Nov 15 16:01:22 CST 2017.
     -->
-    insert into organization_contact_book (id, cid, name, 
+    insert into organization_contact_book (id, uid, name, 
       sex, mobile, email, qq, 
       wechat, depatrment, customer_position, 
       tel_num, major, aid)
-    values (#{id,jdbcType=VARCHAR}, #{cid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, 
+    values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, 
       #{sex,jdbcType=CHAR}, #{mobile,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{qq,jdbcType=VARCHAR}, 
       #{wechat,jdbcType=VARCHAR}, #{depatrment,jdbcType=VARCHAR}, #{customerPosition,jdbcType=VARCHAR}, 
       #{telNum,jdbcType=VARCHAR}, #{major,jdbcType=INTEGER}, #{aid,jdbcType=VARCHAR})
@@ -167,15 +167,15 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Nov 13 11:47:55 CST 2017.
+      This element was generated on Wed Nov 15 16:01:22 CST 2017.
     -->
     insert into organization_contact_book
     <trim prefix="(" suffix=")" suffixOverrides=",">
       <if test="id != null">
         id,
       </if>
-      <if test="cid != null">
-        cid,
+      <if test="uid != null">
+        uid,
       </if>
       <if test="name != null">
         name,
@@ -215,8 +215,8 @@
       <if test="id != null">
         #{id,jdbcType=VARCHAR},
       </if>
-      <if test="cid != null">
-        #{cid,jdbcType=VARCHAR},
+      <if test="uid != null">
+        #{uid,jdbcType=VARCHAR},
       </if>
       <if test="name != null">
         #{name,jdbcType=VARCHAR},
@@ -257,7 +257,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Nov 13 11:47:55 CST 2017.
+      This element was generated on Wed Nov 15 16:01:22 CST 2017.
     -->
     select count(*) from organization_contact_book
     <if test="_parameter != null">
@@ -268,15 +268,15 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Nov 13 11:47:55 CST 2017.
+      This element was generated on Wed Nov 15 16:01:22 CST 2017.
     -->
     update organization_contact_book
     <set>
       <if test="record.id != null">
         id = #{record.id,jdbcType=VARCHAR},
       </if>
-      <if test="record.cid != null">
-        cid = #{record.cid,jdbcType=VARCHAR},
+      <if test="record.uid != null">
+        uid = #{record.uid,jdbcType=VARCHAR},
       </if>
       <if test="record.name != null">
         name = #{record.name,jdbcType=VARCHAR},
@@ -320,11 +320,11 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Nov 13 11:47:55 CST 2017.
+      This element was generated on Wed Nov 15 16:01:22 CST 2017.
     -->
     update organization_contact_book
     set id = #{record.id,jdbcType=VARCHAR},
-      cid = #{record.cid,jdbcType=VARCHAR},
+      uid = #{record.uid,jdbcType=VARCHAR},
       name = #{record.name,jdbcType=VARCHAR},
       sex = #{record.sex,jdbcType=CHAR},
       mobile = #{record.mobile,jdbcType=VARCHAR},
@@ -344,12 +344,12 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Nov 13 11:47:55 CST 2017.
+      This element was generated on Wed Nov 15 16:01:22 CST 2017.
     -->
     update organization_contact_book
     <set>
-      <if test="cid != null">
-        cid = #{cid,jdbcType=VARCHAR},
+      <if test="uid != null">
+        uid = #{uid,jdbcType=VARCHAR},
       </if>
       <if test="name != null">
         name = #{name,jdbcType=VARCHAR},
@@ -391,10 +391,10 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Nov 13 11:47:55 CST 2017.
+      This element was generated on Wed Nov 15 16:01:22 CST 2017.
     -->
     update organization_contact_book
-    set cid = #{cid,jdbcType=VARCHAR},
+    set uid = #{uid,jdbcType=VARCHAR},
       name = #{name,jdbcType=VARCHAR},
       sex = #{sex,jdbcType=CHAR},
       mobile = #{mobile,jdbcType=VARCHAR},

+ 5 - 0
src/main/java/com/goafanti/common/mapper/UserBusinessMapper.xml

@@ -434,4 +434,9 @@
   	 	and aid = #{aid,jdbcType=VARCHAR}
   	 </if>
   </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
+  	where  uid = #{uid,jdbcType=VARCHAR} and aid = #{aid,jdbcType=VARCHAR}
+  </select>
 </mapper>

+ 68 - 4
src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

@@ -7,12 +7,11 @@
 		a.service_certification as serviceCertification,
 		a.user_certification as userCertification,a.current_member_status as
 		currentMemberStatus,a.identify_name as name,a.lvl,a.is_member as isMember,
-		b.contacts,b.contact_mobile as
-		contactMobile,b.international,b.expert,b.celebrity,
+		b.contacts,b.contact_mobile as contactMobile,b.international,b.expert,b.celebrity,
 		dg1.name as province,dg2.name as city, dg3.name as area,c.name as industry
 		from
 		(select
-		id,type,status,create_time,service_certification,user_certification,current_member_status,identify_name,lvl
+		id,type,status,create_time,service_certification,user_certification,current_member_status,identify_name,lvl,is_member
 		from user
 		where type = 0
 		<if test="aid != null and aid !=''">
@@ -144,7 +143,7 @@
 		dg1.name as province,dg2.name as city, dg3.name as area,c.name as industry
 		from
 		(select
-		id,type,status,create_time,service_certification,user_certification,current_member_status,identify_name,lvl
+		id,type,status,create_time,service_certification,user_certification,current_member_status,identify_name,lvl,is_member
 		from user
 		where type = 1
 		<if test="aid != null and aid !=''">
@@ -297,6 +296,7 @@
 			b.legal_person_email as legalPersonEmail,
 			b.high_tech_zone highTechZone,
 			b.listed,
+			b.international,
 			b.org_code as orgCode,
 			b.org_code_url as orgCodeUrl,
 			b.business_scope as businessScope,
@@ -308,4 +308,68 @@
 			where id = #{uid,jdbcType=VARCHAR}
 		)as a inner join organization_identity b on a.id = b.uid
 	</select>
+	<select id="selectFollowHistoryList" resultType="com.goafanti.customer.bo.FollowListBo">
+		select 
+			a.id as followId,
+			a.create_time as followTime,
+			a.contact_type as contactType,
+			a.result, 
+			b.identify_name as identityName,
+			c.name,
+			c.mobile,
+			d.name as adminName 
+		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="uid != null and uid != ''">
+			a.uid = #{uid,jdbcType=VARCHAR}
+		</if>
+		<if test="aid != null and aid != ''">
+			a.aid = #{adid,jdbcType=VARCHAR}
+		</if>
+		<if test="page_sql != null">
+    		${page_sql}
+   		 </if>
+	</select>
+	<select id="selectFollowHistoryCount">
+		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="uid != null and uid != ''">
+			a.uid = #{uid,jdbcType=VARCHAR}
+		</if>
+		<if test="aid != null and aid != ''">
+			a.aid = #{adid,jdbcType=VARCHAR}
+		</if>
+	</select>
+	
+	<select id="findUserAccountDetail"  parameterType="java.lang.String"  resultType="com.goafanti.common.model.User">
+		select
+			id,
+			mobile,
+			nickname,
+			create_time as createTime,
+			type,
+			source,
+			email,
+			is_member as isMember,
+			lvl,
+			current_member_status currentMemberStatus,
+			service_certification as  serviceCertification,
+			user_certification as userCertification,
+			identify_name as identifyName
+		from
+			user
+		where id = #{uid,jdbcType=VARCHAR}
+	</select>
+	
+	<select id="findCustomerContacts" parameterType="java.lang.String" resultType="com.goafanti.common.model.OrganizationContactBook">
+		select id as ocbId,name from organization_contact_book 
+		where uid = #{uid,jdbcType=VARCHAR} and aid = #{aid,jdbcType=VARCHAR}
+	</select>
+		
 </mapper>

+ 49 - 49
src/main/java/com/goafanti/common/model/OrganizationContactBook.java

@@ -4,74 +4,74 @@ public class OrganizationContactBook {
 
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_contact_book.id
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	private String id;
 	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_contact_book.cid
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_contact_book.uid
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
-	private String cid;
+	private String uid;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_contact_book.name
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	private String name;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_contact_book.sex
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	private String sex;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_contact_book.mobile
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	private String mobile;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_contact_book.email
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	private String email;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_contact_book.qq
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	private String qq;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_contact_book.wechat
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	private String wechat;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_contact_book.depatrment
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	private String depatrment;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_contact_book.customer_position
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	private String customerPosition;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_contact_book.tel_num
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	private String telNum;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_contact_book.major
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	private Integer major;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column organization_contact_book.aid
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	private String aid;
 
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_contact_book.id
 	 * @return  the value of organization_contact_book.id
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public String getId() {
 		return id;
@@ -80,34 +80,34 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_contact_book.id
 	 * @param id  the value for organization_contact_book.id
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public void setId(String id) {
 		this.id = id;
 	}
 
 	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_contact_book.cid
-	 * @return  the value of organization_contact_book.cid
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_contact_book.uid
+	 * @return  the value of organization_contact_book.uid
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
-	public String getCid() {
-		return cid;
+	public String getUid() {
+		return uid;
 	}
 
 	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_contact_book.cid
-	 * @param cid  the value for organization_contact_book.cid
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_contact_book.uid
+	 * @param uid  the value for organization_contact_book.uid
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
-	public void setCid(String cid) {
-		this.cid = cid;
+	public void setUid(String uid) {
+		this.uid = uid;
 	}
 
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_contact_book.name
 	 * @return  the value of organization_contact_book.name
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public String getName() {
 		return name;
@@ -116,7 +116,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_contact_book.name
 	 * @param name  the value for organization_contact_book.name
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public void setName(String name) {
 		this.name = name;
@@ -125,7 +125,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_contact_book.sex
 	 * @return  the value of organization_contact_book.sex
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public String getSex() {
 		return sex;
@@ -134,7 +134,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_contact_book.sex
 	 * @param sex  the value for organization_contact_book.sex
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public void setSex(String sex) {
 		this.sex = sex;
@@ -143,7 +143,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_contact_book.mobile
 	 * @return  the value of organization_contact_book.mobile
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public String getMobile() {
 		return mobile;
@@ -152,7 +152,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_contact_book.mobile
 	 * @param mobile  the value for organization_contact_book.mobile
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public void setMobile(String mobile) {
 		this.mobile = mobile;
@@ -161,7 +161,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_contact_book.email
 	 * @return  the value of organization_contact_book.email
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public String getEmail() {
 		return email;
@@ -170,7 +170,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_contact_book.email
 	 * @param email  the value for organization_contact_book.email
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public void setEmail(String email) {
 		this.email = email;
@@ -179,7 +179,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_contact_book.qq
 	 * @return  the value of organization_contact_book.qq
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public String getQq() {
 		return qq;
@@ -188,7 +188,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_contact_book.qq
 	 * @param qq  the value for organization_contact_book.qq
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public void setQq(String qq) {
 		this.qq = qq;
@@ -197,7 +197,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_contact_book.wechat
 	 * @return  the value of organization_contact_book.wechat
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public String getWechat() {
 		return wechat;
@@ -206,7 +206,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_contact_book.wechat
 	 * @param wechat  the value for organization_contact_book.wechat
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public void setWechat(String wechat) {
 		this.wechat = wechat;
@@ -215,7 +215,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_contact_book.depatrment
 	 * @return  the value of organization_contact_book.depatrment
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public String getDepatrment() {
 		return depatrment;
@@ -224,7 +224,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_contact_book.depatrment
 	 * @param depatrment  the value for organization_contact_book.depatrment
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public void setDepatrment(String depatrment) {
 		this.depatrment = depatrment;
@@ -233,7 +233,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_contact_book.customer_position
 	 * @return  the value of organization_contact_book.customer_position
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public String getCustomerPosition() {
 		return customerPosition;
@@ -242,7 +242,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_contact_book.customer_position
 	 * @param customerPosition  the value for organization_contact_book.customer_position
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public void setCustomerPosition(String customerPosition) {
 		this.customerPosition = customerPosition;
@@ -251,7 +251,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_contact_book.tel_num
 	 * @return  the value of organization_contact_book.tel_num
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public String getTelNum() {
 		return telNum;
@@ -260,7 +260,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_contact_book.tel_num
 	 * @param telNum  the value for organization_contact_book.tel_num
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public void setTelNum(String telNum) {
 		this.telNum = telNum;
@@ -269,7 +269,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_contact_book.major
 	 * @return  the value of organization_contact_book.major
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public Integer getMajor() {
 		return major;
@@ -278,7 +278,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_contact_book.major
 	 * @param major  the value for organization_contact_book.major
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public void setMajor(Integer major) {
 		this.major = major;
@@ -287,7 +287,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column organization_contact_book.aid
 	 * @return  the value of organization_contact_book.aid
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public String getAid() {
 		return aid;
@@ -296,7 +296,7 @@ public class OrganizationContactBook {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column organization_contact_book.aid
 	 * @param aid  the value for organization_contact_book.aid
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public void setAid(String aid) {
 		this.aid = aid;

+ 44 - 44
src/main/java/com/goafanti/common/model/OrganizationContactBookExample.java

@@ -6,23 +6,23 @@ import java.util.List;
 public class OrganizationContactBookExample {
     /**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table organization_contact_book
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	protected String orderByClause;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table organization_contact_book
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	protected boolean distinct;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table organization_contact_book
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	protected List<Criteria> oredCriteria;
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public OrganizationContactBookExample() {
 		oredCriteria = new ArrayList<Criteria>();
@@ -30,7 +30,7 @@ public class OrganizationContactBookExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public void setOrderByClause(String orderByClause) {
 		this.orderByClause = orderByClause;
@@ -38,7 +38,7 @@ public class OrganizationContactBookExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public String getOrderByClause() {
 		return orderByClause;
@@ -46,7 +46,7 @@ public class OrganizationContactBookExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public void setDistinct(boolean distinct) {
 		this.distinct = distinct;
@@ -54,7 +54,7 @@ public class OrganizationContactBookExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public boolean isDistinct() {
 		return distinct;
@@ -62,7 +62,7 @@ public class OrganizationContactBookExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public List<Criteria> getOredCriteria() {
 		return oredCriteria;
@@ -70,7 +70,7 @@ public class OrganizationContactBookExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public void or(Criteria criteria) {
 		oredCriteria.add(criteria);
@@ -78,7 +78,7 @@ public class OrganizationContactBookExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public Criteria or() {
 		Criteria criteria = createCriteriaInternal();
@@ -88,7 +88,7 @@ public class OrganizationContactBookExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public Criteria createCriteria() {
 		Criteria criteria = createCriteriaInternal();
@@ -100,7 +100,7 @@ public class OrganizationContactBookExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	protected Criteria createCriteriaInternal() {
 		Criteria criteria = new Criteria();
@@ -109,7 +109,7 @@ public class OrganizationContactBookExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table organization_contact_book
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public void clear() {
 		oredCriteria.clear();
@@ -119,7 +119,7 @@ public class OrganizationContactBookExample {
 
 	/**
 	 * This class was generated by MyBatis Generator. This class corresponds to the database table organization_contact_book
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	protected abstract static class GeneratedCriteria {
 		protected List<Criterion> criteria;
@@ -232,73 +232,73 @@ public class OrganizationContactBookExample {
 			return (Criteria) this;
 		}
 
-		public Criteria andCidIsNull() {
-			addCriterion("cid is null");
+		public Criteria andUidIsNull() {
+			addCriterion("uid is null");
 			return (Criteria) this;
 		}
 
-		public Criteria andCidIsNotNull() {
-			addCriterion("cid is not null");
+		public Criteria andUidIsNotNull() {
+			addCriterion("uid is not null");
 			return (Criteria) this;
 		}
 
-		public Criteria andCidEqualTo(String value) {
-			addCriterion("cid =", value, "cid");
+		public Criteria andUidEqualTo(String value) {
+			addCriterion("uid =", value, "uid");
 			return (Criteria) this;
 		}
 
-		public Criteria andCidNotEqualTo(String value) {
-			addCriterion("cid <>", value, "cid");
+		public Criteria andUidNotEqualTo(String value) {
+			addCriterion("uid <>", value, "uid");
 			return (Criteria) this;
 		}
 
-		public Criteria andCidGreaterThan(String value) {
-			addCriterion("cid >", value, "cid");
+		public Criteria andUidGreaterThan(String value) {
+			addCriterion("uid >", value, "uid");
 			return (Criteria) this;
 		}
 
-		public Criteria andCidGreaterThanOrEqualTo(String value) {
-			addCriterion("cid >=", value, "cid");
+		public Criteria andUidGreaterThanOrEqualTo(String value) {
+			addCriterion("uid >=", value, "uid");
 			return (Criteria) this;
 		}
 
-		public Criteria andCidLessThan(String value) {
-			addCriterion("cid <", value, "cid");
+		public Criteria andUidLessThan(String value) {
+			addCriterion("uid <", value, "uid");
 			return (Criteria) this;
 		}
 
-		public Criteria andCidLessThanOrEqualTo(String value) {
-			addCriterion("cid <=", value, "cid");
+		public Criteria andUidLessThanOrEqualTo(String value) {
+			addCriterion("uid <=", value, "uid");
 			return (Criteria) this;
 		}
 
-		public Criteria andCidLike(String value) {
-			addCriterion("cid like", value, "cid");
+		public Criteria andUidLike(String value) {
+			addCriterion("uid like", value, "uid");
 			return (Criteria) this;
 		}
 
-		public Criteria andCidNotLike(String value) {
-			addCriterion("cid not like", value, "cid");
+		public Criteria andUidNotLike(String value) {
+			addCriterion("uid not like", value, "uid");
 			return (Criteria) this;
 		}
 
-		public Criteria andCidIn(List<String> values) {
-			addCriterion("cid in", values, "cid");
+		public Criteria andUidIn(List<String> values) {
+			addCriterion("uid in", values, "uid");
 			return (Criteria) this;
 		}
 
-		public Criteria andCidNotIn(List<String> values) {
-			addCriterion("cid not in", values, "cid");
+		public Criteria andUidNotIn(List<String> values) {
+			addCriterion("uid not in", values, "uid");
 			return (Criteria) this;
 		}
 
-		public Criteria andCidBetween(String value1, String value2) {
-			addCriterion("cid between", value1, value2, "cid");
+		public Criteria andUidBetween(String value1, String value2) {
+			addCriterion("uid between", value1, value2, "uid");
 			return (Criteria) this;
 		}
 
-		public Criteria andCidNotBetween(String value1, String value2) {
-			addCriterion("cid not between", value1, value2, "cid");
+		public Criteria andUidNotBetween(String value1, String value2) {
+			addCriterion("uid not between", value1, value2, "uid");
 			return (Criteria) this;
 		}
 
@@ -1065,7 +1065,7 @@ public class OrganizationContactBookExample {
 
 	/**
 	 * This class was generated by MyBatis Generator. This class corresponds to the database table organization_contact_book
-	 * @mbg.generated  Mon Nov 13 11:47:55 CST 2017
+	 * @mbg.generated  Wed Nov 15 16:01:22 CST 2017
 	 */
 	public static class Criterion {
 		private String condition;

+ 25 - 0
src/main/java/com/goafanti/common/utils/BeanUtilsExt.java

@@ -0,0 +1,25 @@
+package com.goafanti.common.utils;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.apache.commons.beanutils.BeanUtils;
+import org.apache.commons.beanutils.ConvertUtils;
+
+public class BeanUtilsExt extends BeanUtils {
+
+    private BeanUtilsExt() {
+    }
+
+    static {
+        ConvertUtils.register(new org.apache.commons.beanutils.converters.DateConverter(null), java.sql.Date.class);
+        ConvertUtils.register(new org.apache.commons.beanutils.converters.SqlDateConverter(null), java.util.Date.class);
+        ConvertUtils.register(new org.apache.commons.beanutils.converters.SqlTimestampConverter(null), java.sql.Timestamp.class);
+        ConvertUtils.register(new org.apache.commons.beanutils.converters.BigDecimalConverter(null) , java.math.BigDecimal.class);
+    }
+
+    public static void copyProperties(Object target, Object source) throws InvocationTargetException,
+            IllegalAccessException {
+        org.apache.commons.beanutils.BeanUtils.copyProperties(target, source);
+
+    }
+}

+ 92 - 14
src/main/java/com/goafanti/customer/bo/BussinessFollowBo.java

@@ -1,28 +1,106 @@
 package com.goafanti.customer.bo;
 
-import com.goafanti.common.model.UserBusiness;
-import com.goafanti.common.model.UserFollow;
-
+/**
+ * 新增和修改业务意向
+ * @author WangHui
+ *
+ */
 public class BussinessFollowBo {
-	private UserFollow userFollow;
-	private UserBusiness userBusiness;
+	/** 客户ID **/
+	private String uid;
+	/** 客户业务ID **/
+	private String businessId;
+	/** 意向服务ID **/
+	private String businessGlossoryId;
+	/** 跟进状态 **/
+	private String followSituation;
+	/** 客户状态 **/
+	private String customerStatus;
+	/** 创建时间 **/
 	private String createTime;
-	public UserFollow getUserFollow() {
-		return userFollow;
+	/** 跟进时间 **/
+	private String followTime;
+	/** 营销员ID **/
+	private String adminName;
+	/** 联系方式 **/
+	private String contactType;
+	/** 联系人ID **/
+	private String ocbId;
+	/** 业务意向说明 **/
+	private String remarks;
+	/** 拜访结果 **/
+	private String result;
+	
+	public String getUid() {
+		return uid;
+	}
+	public void setUid(String uid) {
+		this.uid = uid;
+	}
+	public String getBusinessId() {
+		return businessId;
+	}
+	public void setBusinessId(String businessId) {
+		this.businessId = businessId;
+	}
+	public String getBusinessGlossoryId() {
+		return businessGlossoryId;
 	}
-	public void setUserFollow(UserFollow userFollow) {
-		this.userFollow = userFollow;
+	public void setBusinessGlossoryId(String businessGlossoryId) {
+		this.businessGlossoryId = businessGlossoryId;
 	}
-	public UserBusiness getUserBusiness() {
-		return userBusiness;
+	public String getFollowSituation() {
+		return followSituation;
 	}
-	public void setUserBusiness(UserBusiness userBusiness) {
-		this.userBusiness = userBusiness;
+	public void setFollowSituation(String followSituation) {
+		this.followSituation = followSituation;
+	}
+	public String getCustomerStatus() {
+		return customerStatus;
+	}
+	public void setCustomerStatus(String customerStatus) {
+		this.customerStatus = customerStatus;
 	}
 	public String getCreateTime() {
 		return createTime;
 	}
 	public void setCreateTime(String createTime) {
 		this.createTime = createTime;
-	}	
+	}
+	public String getFollowTime() {
+		return followTime;
+	}
+	public void setFollowTime(String followTime) {
+		this.followTime = followTime;
+	}
+	public String getAdminName() {
+		return adminName;
+	}
+	public void setAdminName(String adminName) {
+		this.adminName = adminName;
+	}
+	public String getContactType() {
+		return contactType;
+	}
+	public void setContactType(String contactType) {
+		this.contactType = contactType;
+	}
+	public String getOcbId() {
+		return ocbId;
+	}
+	public void setOcbId(String ocbId) {
+		this.ocbId = ocbId;
+	}
+	public String getRemarks() {
+		return remarks;
+	}
+	public void setRemarks(String remarks) {
+		this.remarks = remarks;
+	}
+	public String getResult() {
+		return result;
+	}
+	public void setResult(String result) {
+		this.result = result;
+	}
 }

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

@@ -1,6 +1,6 @@
 package com.goafanti.customer.bo;
 
-public class CustomerListOut extends CustomerListIn{
+public class CustomerListOut extends CustomerListIn{	
 	/** 客户ID **/
 	private String uid;
 	

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

@@ -0,0 +1,85 @@
+package com.goafanti.customer.bo;
+
+import java.util.List;
+
+import com.goafanti.common.model.UserBusiness;
+
+/**
+ * 新增和修改
+ * @author WangHui
+ *
+ */
+public class FollowBusinessBo {
+	/** 客户ID **/
+	private String uid;
+	/** 客户名 **/
+	private String identityName;
+	/** 当前联系人姓名 **/
+	private String contacts;
+	/** 新的联系人 **/
+	private String contactMobile;
+	/** 需要保存的联系人ID **/
+	private String ocbId;
+	/** 联系方式 **/
+	private String contactType;
+	/** 拜访结果 **/
+	private String result;
+	/** 拜访时间 **/
+	private String followTime;
+	/** 业务意向列表 **/
+	private List<UserBusiness> userBusinessList;
+	public String getUid() {
+		return uid;
+	}
+	public void setUid(String uid) {
+		this.uid = uid;
+	}
+	public String getIdentityName() {
+		return identityName;
+	}
+	public void setIdentityName(String identityName) {
+		this.identityName = identityName;
+	}
+	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 getOcbId() {
+		return ocbId;
+	}
+	public void setOcbId(String ocbId) {
+		this.ocbId = ocbId;
+	}
+	public String getContactType() {
+		return contactType;
+	}
+	public void setContactType(String contactType) {
+		this.contactType = contactType;
+	}
+	public String getResult() {
+		return result;
+	}
+	public void setResult(String result) {
+		this.result = result;
+	}
+	public String getFollowTime() {
+		return followTime;
+	}
+	public void setFollowTime(String followTime) {
+		this.followTime = followTime;
+	}
+	public List<UserBusiness> getUserBusinessList() {
+		return userBusinessList;
+	}
+	public void setUserBusinessList(List<UserBusiness> userBusinessList) {
+		this.userBusinessList = userBusinessList;
+	}
+}

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

@@ -0,0 +1,67 @@
+package com.goafanti.customer.bo;
+
+public class FollowListBo {
+	/** 跟进记录ID **/
+	private String followId;
+	
+	/** 跟进时间  **/
+	private String followTime;
+	
+	/** 客户名 **/
+	private String identityName;
+	
+	/** 联系人 **/
+	private String contacts;
+	
+	/** 联系电话 **/
+	private String contactMobile;
+	
+	/** 跟进结果 **/
+	private String result;
+	
+	/** 拜访人姓名 **/
+	private String adminName;
+	
+	public String getFollowId() {
+		return followId;
+	}
+	public void setFollowId(String followId) {
+		this.followId = followId;
+	}
+	public String getFollowTime() {
+		return followTime;
+	}
+	public void setFollowTime(String followTime) {
+		this.followTime = followTime;
+	}
+	public String getIdentityName() {
+		return identityName;
+	}
+	public void setIdentityName(String identityName) {
+		this.identityName = identityName;
+	}
+	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 getResult() {
+		return result;
+	}
+	public void setResult(String result) {
+		this.result = result;
+	}
+	public String getAdminName() {
+		return adminName;
+	}
+	public void setAdminName(String adminName) {
+		this.adminName = adminName;
+	}
+}

+ 16 - 0
src/main/java/com/goafanti/customer/bo/UserDetailBo.java

@@ -0,0 +1,16 @@
+package com.goafanti.customer.bo;
+
+import com.goafanti.common.model.User;
+
+public class UserDetailBo extends User{
+	private String createTimes;
+
+	public String getCreateTimes() {
+		return createTimes;
+	}
+
+	public void setCreateTimes(String createTimes) {
+		this.createTimes = createTimes;
+	}
+	
+}

+ 26 - 2
src/main/java/com/goafanti/customer/controller/BusinessApiController.java

@@ -1,5 +1,8 @@
 package com.goafanti.customer.controller;
 
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
 import javax.annotation.Resource;
 
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -8,7 +11,11 @@ import org.springframework.web.bind.annotation.RestController;
 
 import com.goafanti.common.bo.Error;
 import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.BaseController;
+import com.goafanti.common.utils.StringUtils;
+import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.customer.bo.BusinessListBo;
 import com.goafanti.customer.bo.BussinessFollowBo;
 import com.goafanti.customer.service.BusinessService;
@@ -34,16 +41,33 @@ public class BusinessApiController extends BaseController{
 		return res;
 	}
 
-	/** 添加意向和拜访记录 **/
+	/** 新增客户意向 **/
 	@RequestMapping(value = "/addBusinessAndFollow", method = RequestMethod.POST)
 	public Result addBusinessAndFollow(BussinessFollowBo bfb){
 		Result res = new Result();
-		if(businessService.judgeBusiness(bfb.getUserBusiness().getUid(), bfb.getUserBusiness().getBusinessGlossoryId())>0){
+		if(StringUtils.isBlank(bfb.getBusinessGlossoryId()) || StringUtils.isBlank(bfb.getUid())){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,""));
+			return res;
+		}		
+		if(businessService.judgeBusiness(bfb.getUid(), Integer.parseInt(bfb.getBusinessGlossoryId()))>0){
 			res.getError().add(new Error("该项业务已经被跟进"));
 			return res;
 		}
 		businessService.addBusinessAndFollow(bfb);
 		return res;
 	}
+	
+	/** 进入新增意向服务 **/
+	@RequestMapping(value = "/toAddBusinessAndFollow", method = RequestMethod.GET)
+	public Result toAddBusinessAndFollow(){
+		Result res = new Result();
+		BussinessFollowBo bo = new BussinessFollowBo();
+		bo.setAdminName(TokenManager.getAdminToken().getName());
+		SimpleDateFormat format = new SimpleDateFormat(AFTConstants.YYYYMMDDHHMMSS);
+		bo.setCreateTime(format.format(new Date()));
+		bo.setFollowTime(bo.getCreateTime());
+		res.setData(bo);
+		return res;
+	}
 
 }

+ 78 - 2
src/main/java/com/goafanti/customer/controller/CustomerApiController.java

@@ -1,5 +1,9 @@
 package com.goafanti.customer.controller;
 
+import java.lang.reflect.InvocationTargetException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
 import javax.annotation.Resource;
 
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -8,11 +12,18 @@ import org.springframework.web.bind.annotation.RestController;
 
 import com.goafanti.common.bo.Error;
 import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.BaseController;
+import com.goafanti.common.model.User;
+import com.goafanti.common.utils.BeanUtilsExt;
 import com.goafanti.common.utils.StringUtils;
+import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.customer.bo.CustomerListIn;
 import com.goafanti.customer.bo.CustomerOrganizationDetailBo;
+import com.goafanti.customer.bo.FollowBusinessBo;
+import com.goafanti.customer.bo.UserDetailBo;
+import com.goafanti.customer.service.BusinessService;
 import com.goafanti.customer.service.CustomerService;
 
 @RestController
@@ -20,7 +31,8 @@ import com.goafanti.customer.service.CustomerService;
 public class CustomerApiController extends BaseController{
 	@Resource
 	private CustomerService customerService;
-	
+	@Resource
+	private BusinessService businessService;
 	/** 私有个人客户列表 **/
 	@RequestMapping(value = "/listPrivatePersonalCustomer" , method = RequestMethod.POST)
 	public Result listPrivatePersonalCustomer(CustomerListIn cli,Integer pageNo, Integer pageSize){
@@ -107,10 +119,74 @@ public class CustomerApiController extends BaseController{
 	public Result updateOrganizationCustomer(CustomerOrganizationDetailBo bo){
 		Result res = new Result();
 		if(StringUtils.isBlank(bo.getId()) || StringUtils.isBlank(bo.getUid())){
-			res.getError().add(new Error(ErrorConstants.PARAM_ERROR));
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR,""));
 			return res;
 		} 
 		customerService.updateOrganizationCustomer(bo);
 		return res;
 	}
+	
+	/** 查看跟进记录 **/
+	@RequestMapping(value = "/listFollowHistory", method = RequestMethod.GET)
+	public Result listFollowHistory(Integer pageNo, Integer pageSize,String uid){
+		Result res = new Result();
+		res.setData(customerService.listFollowHistory(pageNo,pageSize,uid));
+		return res;
+	}
+	
+	/** 查看客户账户信息 **/
+	@RequestMapping(value = "/findUserAccountDetail", method = RequestMethod.GET)
+	public Result findUserAcountDetail(String uid){
+		Result res = new Result();
+		UserDetailBo bo = new UserDetailBo();
+		User user = customerService.findUserAccountDetail(uid);
+		try {
+			BeanUtilsExt.copyProperties(bo, user);
+		} catch (InvocationTargetException | IllegalAccessException e) {
+			e.printStackTrace();
+		}
+		SimpleDateFormat format = new SimpleDateFormat(AFTConstants.YYYYMMDDHHMMSS);
+		bo.setCreateTimes(format.format(user.getCreateTime()));
+		res.setData(bo);
+		return res;
+	}
+	
+	/** 修改客户账户信息 **/
+	@RequestMapping(value = "/updateUserAccount", method = RequestMethod.POST)
+	public Result updateUserAccount(User user){
+		Result res = new Result();
+		customerService.updateUserAccount(user);
+		return res;
+	}
+
+	/** 查看客户联系人列表 **/
+	@RequestMapping(value = "/findCustomerContacts", method = RequestMethod.GET)
+	public Result findCustomerContacts(String uid){
+		Result res = new Result();
+		res.setData(customerService.findCustomerContacts(uid));
+		return res;
+	}
+	
+	/** 进入添加拜访记录 **/
+	@RequestMapping(value = "/toAddFollow", method = RequestMethod.GET)
+	public Result toAddFollow(String uid){
+		Result res =  new Result();
+		User user = customerService.findUserAccountDetail(uid);
+		FollowBusinessBo fbb = new FollowBusinessBo();
+		SimpleDateFormat format = new SimpleDateFormat(AFTConstants.YYYYMMDDHHMMSS);
+		fbb.setFollowTime(format.format(new Date()));
+		fbb.setIdentityName(user.getIdentifyName());
+		fbb.setUid(uid);
+		fbb.setUserBusinessList(businessService.findBusinessByUAid(uid, TokenManager.getAdminId()));
+		res.setData(fbb);
+		return res;
+	}
+	
+	/** 添加拜访记录 **/
+	@RequestMapping(value = "/addFollow", method = RequestMethod.POST)
+	public Result addFollow(FollowBusinessBo fbb){
+		Result res =  new Result();
+		customerService.addFollow(fbb);
+		return res;
+	}
 }

+ 9 - 0
src/main/java/com/goafanti/customer/service/BusinessService.java

@@ -2,6 +2,7 @@ package com.goafanti.customer.service;
 
 import java.util.List;
 
+import com.goafanti.common.model.UserBusiness;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.customer.bo.BusinessListBo;
 import com.goafanti.customer.bo.BussinessFollowBo;
@@ -33,4 +34,12 @@ public interface BusinessService {
 	 * @param bfb
 	 */
 	void addBusinessAndFollow(BussinessFollowBo bfb);
+	
+	/**
+	 * 查询业务列表
+	 * @param uid 客户ID
+	 * @param aid 营销员ID
+	 * @return
+	 */
+	List<UserBusiness> findBusinessByUAid(String uid,String aid);
 }

+ 38 - 0
src/main/java/com/goafanti/customer/service/CustomerService.java

@@ -2,12 +2,16 @@ package com.goafanti.customer.service;
 
 import java.util.List;
 
+import com.goafanti.common.model.OrganizationContactBook;
+import com.goafanti.common.model.User;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.customer.bo.CustomerListIn;
 import com.goafanti.customer.bo.CustomerListOut;
 import com.goafanti.customer.bo.CustomerOrganizationDetailBo;
 import com.goafanti.customer.bo.CustomerPersonalDetailBo;
 import com.goafanti.customer.bo.CustomerSimpleBo;
+import com.goafanti.customer.bo.FollowBusinessBo;
+import com.goafanti.customer.bo.FollowListBo;
 
 public interface CustomerService {
 	/**
@@ -112,4 +116,38 @@ public interface CustomerService {
 	 * @return
 	 */
 	int updateOrganizationCustomer(CustomerOrganizationDetailBo bo);
+	
+	/**
+	 * 查看跟进记录列表
+	 * @param pageNo
+	 * @param pageSize
+	 * @return
+	 */
+	Pagination<FollowListBo> listFollowHistory(Integer pageNo, Integer pageSize,String uid);
+	
+	/**
+	 * 查看客户账户信息
+	 * @param uid 客户ID
+	 * @return
+	 */
+	User findUserAccountDetail(String uid);
+	
+	/**
+	 * 更新用户基本信息
+	 * @param user
+	 */
+	int updateUserAccount(User user);
+	
+	/**
+	 * 客户联系人列表
+	 * @param uid
+	 * @return
+	 */
+	List<OrganizationContactBook> findCustomerContacts(String uid);
+	
+	/**
+	 * 添加拜访记录
+	 * @param fbb
+	 */
+	int addFollow(FollowBusinessBo fbb);
 }

+ 40 - 24
src/main/java/com/goafanti/customer/service/impl/BusinessServiceImpl.java

@@ -1,6 +1,7 @@
 package com.goafanti.customer.service.impl;
 
 import java.lang.reflect.InvocationTargetException;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -9,6 +10,7 @@ import java.util.UUID;
 import org.apache.commons.beanutils.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import com.goafanti.common.dao.UserBusinessMapper;
 import com.goafanti.common.dao.UserFollowBusinessMapper;
@@ -62,33 +64,47 @@ public class BusinessServiceImpl extends BaseMybatisDao<UserBusinessMapper> impl
 	}
 
 	@Override
+	@Transactional
 	public void addBusinessAndFollow(BussinessFollowBo bfb) {
 		UserBusiness ub = new UserBusiness();
 		String ubId = UUID.randomUUID().toString();
-		try {
-			BeanUtils.copyProperties(ub, bfb.getUserBusiness());
-			ub.setId(ubId);
-			ub.setAid(TokenManager.getAdminId());
-			userBusinessMapper.insert(ub);
-			if(StringUtils.isNotBlank(bfb.getUserFollow().getOcbId())){ //跟进联系人不为空则添加跟进记录
-				UserFollow uf = new UserFollow();
-				String ufId = UUID.randomUUID().toString();
-				BeanUtils.copyProperties(uf, bfb);
-				uf.setAid(TokenManager.getAdminId());
-				uf.setEffective(0);
-				int followCount = userBusinessMapper.judgeBusiness(bfb.getUserFollow().getUid(), null, TokenManager.getAdminId())+1;
-				uf.setFollowCount(followCount);
-				userFollowMapper.insert(uf);
-				UserFollowBusiness ufb = new UserFollowBusiness();
-				ufb.setId(UUID.randomUUID().toString());
-				ufb.setBusinessId(ubId);
-				ufb.setFollowId(ufId);
-				ufb.setCustomerStatus(ub.getCustomerStatus());
-				ufb.setFollowSituation(ub.getFollowSituation());
-				userFollowBusinessMapper.insert(ufb);
-			}
-		} catch (IllegalAccessException | InvocationTargetException e) {
-			e.printStackTrace();
+		Date date = new Date();
+		ub.setCustomerStatus(Integer.parseInt(bfb.getCustomerStatus()));
+		ub.setFollowSituation(Integer.parseInt(bfb.getFollowSituation()));
+		ub.setId(ubId);
+		ub.setUid(bfb.getUid());
+		ub.setAid(TokenManager.getAdminId());
+		ub.setRemarks(bfb.getRemarks());
+		ub.setUpdateTime(date);
+		ub.setCreateTime(date);
+		userBusinessMapper.insert(ub);
+		if (StringUtils.isNotBlank(bfb.getOcbId())) { // 跟进联系人不为空则添加跟进记录
+			UserFollow uf = new UserFollow();
+			String ufId = UUID.randomUUID().toString();
+			uf.setId(ufId);
+			uf.setUid(bfb.getUid());
+			uf.setCreateTime(date);
+			uf.setOcbId(bfb.getOcbId());
+			uf.setResult(bfb.getResult());
+			uf.setContactType(Integer.parseInt(bfb.getContactType()));
+			uf.setAid(TokenManager.getAdminId());
+			uf.setEffective(0);
+			int followCount = userBusinessMapper.judgeBusiness(bfb.getUid(), null, TokenManager.getAdminId()) + 1;
+			uf.setFollowCount(followCount);
+			userFollowMapper.insert(uf);
+			UserFollowBusiness ufb = new UserFollowBusiness();
+			ufb.setId(UUID.randomUUID().toString());
+			ufb.setBusinessId(ubId);
+			ufb.setFollowId(ufId);
+			ufb.setCustomerStatus(ub.getCustomerStatus());
+			ufb.setFollowSituation(ub.getFollowSituation());
+			userFollowBusinessMapper.insert(ufb);
 		}
 	}
+
+	@Override
+	public List<UserBusiness> findBusinessByUAid(String uid, String aid) {
+		
+		return userBusinessMapper.findBusinessByUAid(uid,aid);
+	}
 }

+ 72 - 3
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -9,7 +9,6 @@ import java.util.UUID;
 
 import javax.annotation.Resource;
 
-import org.apache.commons.beanutils.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -17,13 +16,18 @@ import org.springframework.transaction.annotation.Transactional;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.OrganizationContactBookMapper;
 import com.goafanti.common.dao.OrganizationIdentityMapper;
+import com.goafanti.common.dao.UserBusinessMapper;
 import com.goafanti.common.dao.UserIdentityMapper;
 import com.goafanti.common.dao.UserMapper;
 import com.goafanti.common.error.BusinessException;
 import com.goafanti.common.model.OrganizationContactBook;
 import com.goafanti.common.model.OrganizationIdentity;
 import com.goafanti.common.model.User;
+import com.goafanti.common.model.UserBusiness;
+import com.goafanti.common.model.UserFollow;
+import com.goafanti.common.model.UserFollowBusiness;
 import com.goafanti.common.model.UserIdentity;
+import com.goafanti.common.utils.BeanUtilsExt;
 import com.goafanti.common.utils.PasswordUtil;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
@@ -34,6 +38,8 @@ import com.goafanti.customer.bo.CustomerListOut;
 import com.goafanti.customer.bo.CustomerOrganizationDetailBo;
 import com.goafanti.customer.bo.CustomerPersonalDetailBo;
 import com.goafanti.customer.bo.CustomerSimpleBo;
+import com.goafanti.customer.bo.FollowBusinessBo;
+import com.goafanti.customer.bo.FollowListBo;
 import com.goafanti.customer.service.CustomerService;
 
 @Service
@@ -48,6 +54,8 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 	private OrganizationContactBookMapper organizationContactBookMapper;
 	@Resource(name = "passwordUtil")
 	private PasswordUtil					passwordUtil;
+	@Resource
+	private UserBusinessMapper userBusinessMapper;
 	@Override
 	public Pagination<CustomerListOut> listPrivatePersonalCustomer(CustomerListIn cli, Integer pageNo,Integer pageSize) {
 		cli.setType(AFTConstants.USER_TYPE_PERSONAL);
@@ -204,7 +212,7 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 		OrganizationContactBook cob = new OrganizationContactBook();
 		cob.setAid(TokenManager.getAdminId());
 		cob.setId(UUID.randomUUID().toString());
-		cob.setCid(identifyId);
+		cob.setUid(identifyId);
 		cob.setName(contacts);
 		cob.setMobile(contactMobile);
 		organizationContactBookMapper.insert(cob);
@@ -228,7 +236,7 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 		OrganizationIdentity oi = new OrganizationIdentity();
 		User user = new User();
 		try {
-			BeanUtils.copyProperties(oi, bo);
+			BeanUtilsExt.copyProperties(oi, bo);
 			user.setId(bo.getUid());
 			user.setIdentifyName(bo.getUnitName());
 			user.setSocietyTag(bo.getSocietyTag());
@@ -244,5 +252,66 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 		userMapper.updateByPrimaryKeySelective(user);
 		return 1;
 	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<FollowListBo> listFollowHistory(Integer pageNo, Integer pageSize,String uid) {
+		Map<String, Object> params = new HashMap<String, Object>();
+		if(StringUtils.isNotBlank(uid))params.put("uid", uid);
+		return (Pagination<FollowListBo>)findPage("selectFollowHistoryList","selectFollowHistoryCount",params, pageNo, pageSize);
+	}
+
+	@Override
+	public User findUserAccountDetail(String uid) {
+		
+		return userMapper.findUserAccountDetail(uid);
+	}
+
+	@Override
+	public int updateUserAccount(User user) {
+		
+		return userMapper.updateByPrimaryKeySelective(user);
+	}
+
+	@Override
+	public List<OrganizationContactBook> findCustomerContacts(String uid) {
+		
+		return userMapper.findCustomerContacts(uid,TokenManager.getAdminId());
+	}
+
+	@Override
+	@Transactional
+	public int addFollow(FollowBusinessBo fbb) {
+		Date date = new Date();
+		UserFollow userFollow = new UserFollow();
+		String ufId = UUID.randomUUID().toString();
+		userFollow.setId(ufId);
+		userFollow.setAid(TokenManager.getAdminId());
+		userFollow.setContactType(Integer.parseInt(fbb.getContactType()));
+		userFollow.setEffective(0);
+		userFollow.setCreateTime(date);
+		userFollow.setOcbId(fbb.getOcbId());
+		userFollow.setResult(fbb.getResult());
+		userFollow.setUid(fbb.getUid());
+		int followCount = userBusinessMapper.judgeBusiness(fbb.getUid(), null, TokenManager.getAdminId()) + 1;
+		userFollow.setFollowCount(followCount);
+		String ufbId = "";
+		UserFollowBusiness ufb = null;
+		for(UserBusiness ub: fbb.getUserBusinessList()){
+			ufb = new UserFollowBusiness();
+			ufbId = UUID.randomUUID().toString();
+			if(StringUtils.isNotBlank(ub.getId())){
+				ufb.setBusinessId(ub.getId()); //意向表ID
+				ufb.setCustomerStatus(ub.getCustomerStatus());
+				ufb.setFollowId(ufbId);
+				ufb.setFollowSituation(ub.getFollowSituation());
+				//更新
+			}else{
+				//检测是否可以创建业务
+			}
+			
+		}
+		return 1;
+	}
 	
 }