Kaynağa Gözat

客户系统

wanghui 8 yıl önce
ebeveyn
işleme
e33b22e28b
22 değiştirilmiş dosya ile 631 ekleme ve 177 silme
  1. 6 0
      src/main/java/com/goafanti/common/constant/AFTConstants.java
  2. 0 7
      src/main/java/com/goafanti/common/dao/CustomerMapper.java
  3. 10 1
      src/main/java/com/goafanti/common/dao/CustomerUserInfoMapper.java
  4. 20 12
      src/main/java/com/goafanti/common/dao/FollowUpRecordMapper.java
  5. 2 2
      src/main/java/com/goafanti/common/enums/AttachmentType.java
  6. 22 7
      src/main/java/com/goafanti/common/mapper/CustomerMapper.xml
  7. 14 6
      src/main/java/com/goafanti/common/mapper/CustomerUserInfoMapper.xml
  8. 47 22
      src/main/java/com/goafanti/common/mapper/FollowUpRecordMapper.xml
  9. 56 33
      src/main/java/com/goafanti/common/model/FollowUpRecord.java
  10. 76 16
      src/main/java/com/goafanti/common/model/FollowUpRecordExample.java
  11. 1 1
      src/main/java/com/goafanti/common/utils/FileUtils.java
  12. 46 11
      src/main/java/com/goafanti/customer/bo/CustomerIn.java
  13. 24 2
      src/main/java/com/goafanti/customer/bo/CustomerOut.java
  14. 15 0
      src/main/java/com/goafanti/customer/bo/CustomerUserInfoOut.java
  15. 16 1
      src/main/java/com/goafanti/customer/bo/FollowUpRecordOut.java
  16. 150 34
      src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java
  17. 13 1
      src/main/java/com/goafanti/customer/service/CustomerService.java
  18. 9 1
      src/main/java/com/goafanti/customer/service/CustomerUserService.java
  19. 8 2
      src/main/java/com/goafanti/customer/service/FollowUpService.java
  20. 80 9
      src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java
  21. 9 6
      src/main/java/com/goafanti/customer/service/impl/CustomerUserServiceImp.java
  22. 7 3
      src/main/java/com/goafanti/customer/service/impl/FollowUpServiceImp.java

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

@@ -68,4 +68,10 @@ public class AFTConstants {
 	public static final String CUSTOMER_TRANSFER					= "转交客户";
 	
 	public static final String CUSTOMER_MODIFY						= "修改客户资料";
+	
+	public static final String CUSTOMER_RECEIVE                     = "领取客户";
+	
+	public static final String CUSTOMER_TO_PUBLIC					= "转为公共客户";
+	
+	public static final String CUSTOMER_VIEW_ALL					= "查看公司客户所有信息";
 }

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

@@ -87,11 +87,4 @@ public interface CustomerMapper {
      * @return 查询团队 客户记录
      */
     List<Customer> selectByLadderId(@Param("ladderId")String ladderId);
-    
-    /**
-     * 
-     * @param ladderId 上层领导ID
-     * @return 查询团队 客户记录
-     */
-    List<Customer> updFollowId(Customer record);
 }

+ 10 - 1
src/main/java/com/goafanti/common/dao/CustomerUserInfoMapper.java

@@ -2,6 +2,8 @@ package com.goafanti.common.dao;
 
 import com.goafanti.common.model.CustomerUserInfo;
 import com.goafanti.common.model.CustomerUserInfoExample;
+import com.goafanti.customer.bo.CustomerUserInfoOut;
+
 import java.util.List;
 import org.apache.ibatis.annotations.Param;
 
@@ -91,7 +93,7 @@ public interface CustomerUserInfoMapper {
 	/**
 	 * 查询联系人名称列表
 	 */
-	List<CustomerUserInfo> selectUserNameList(String cid);
+	List<CustomerUserInfo> selectCustomerUserList(String cid);
 	/**
 	 * 查询是否存在主要联系人
 	 */
@@ -101,4 +103,11 @@ public interface CustomerUserInfoMapper {
 	 */
 	int updataPrimaryFlg(String cid);
 
+	/**
+	 * 查看客户联系人详情
+	 * @param id
+	 * @return
+	 */
+	CustomerUserInfoOut findContactDetail(String id);
+
 }

+ 20 - 12
src/main/java/com/goafanti/common/dao/FollowUpRecordMapper.java

@@ -11,75 +11,83 @@ public interface FollowUpRecordMapper {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	long countByExample(FollowUpRecordExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	int deleteByExample(FollowUpRecordExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	int deleteByPrimaryKey(String id);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	int insert(FollowUpRecord record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	int insertSelective(FollowUpRecord record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	List<FollowUpRecord> selectByExample(FollowUpRecordExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	FollowUpRecord selectByPrimaryKey(String id);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	int updateByExampleSelective(@Param("record") FollowUpRecord record,
 			@Param("example") FollowUpRecordExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	int updateByExample(@Param("record") FollowUpRecord record, @Param("example") FollowUpRecordExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	int updateByPrimaryKeySelective(FollowUpRecord record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	int updateByPrimaryKey(FollowUpRecord record);
-	
+
 	/**
 	 * 查询跟进记录列表
 	 * @param customerId
 	 * @return
 	 */
 	List<FollowUpRecordOut> listFollowUpRecord(@Param("cid")String cid);
+	
+
+	/**
+	 * 删除跟进
+	 * @param followId
+	 * @return
+	 */
+	int deleteFollowUpRecord(@Param("followId")String followId);
 }

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

@@ -47,8 +47,8 @@ public enum AttachmentType {
 	NEWS_CONTENT_PICTURE("news_content_picture", "新闻内容图片"),
 	LECTURE_PICTURE("lecture_picture", "科技讲堂展示图片"),
 	ACTIVITY_TITLE_PICTURE("activity_title_picture", "活动题图"),
-	ACTIVITY_CONTENT_PICTURE("activity_content_picture", "活动内容图片");
-	
+	ACTIVITY_CONTENT_PICTURE("activity_content_picture", "活动内容图片"),
+	CUSTOMER_SYS_FILE("customer_sys_file","客户系统文件");
 
 	private AttachmentType(String code, String desc) {
 		this.code = code;

+ 22 - 7
src/main/java/com/goafanti/common/mapper/CustomerMapper.xml

@@ -401,7 +401,7 @@
   </update>
 	 
   <select id="selectCustomer"  resultType="com.goafanti.customer.bo.CustomerOut">
-    select a.id,a.customer_type as customerType,a.share_type as shareType,a.company_intention as CompanyIntention,
+    select a.id,a.aid,a.customer_type as customerType,a.share_type as shareType,a.company_intention as CompanyIntention,
     a.tag,a.follow_situation as followSituation,a.customer_status as customerStatus,
     b.follow_date as followDate,
     c.name as contactName ,c.mobile,c.tel_num as telNum,
@@ -417,6 +417,9 @@
     <if test="aid != null">
     	and a.aid = #{aid,jdbcType=VARCHAR}
     </if>
+    <if test="paid != null">
+    	or a.paid like concat('%',#{paid},'%')
+    </if>
     <if test="shareType != null">
         and a.share_type = #{shareType,jdbcType=INTEGER}
     </if>
@@ -438,6 +441,12 @@
     <if test="contactTel != null">
     	 and c.tel_num = #{contactTel,jdbcType=VARCHAR}
     </if>
+    <if test="companyName != null">
+    	and d.company_name = #{companyName,jdbcType=VARCHAR}
+    </if>
+    <if test="locationProvince != null">
+    	and d.location_province = #{locationProvince,jdbcType=VARCHAR}
+    </if>
    	<if test="adminName != null">
    	 	and e.name = #{adminName,jdbcType=VARCHAR}
    	</if>
@@ -484,25 +493,24 @@
   </select>
   
   <select id="selectCustomerById" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.CustomerOut">
-    select 
+    select
+    a.id as cid, 
+    a.tag,
     a.customer_type as customerType,
     a.share_type as shareType,
     a.company_intention as companyIntention,
     a.create_time as createTime,
     a.follow_situation as followSituation,
-    a.customer_status as customerStatus ,
-    b.name as contactName,b.sex,b.mobile,b.tel_num as telNum,b.email,b.qq,b.wechat,b.depatrment,b.remarks,
-    b.customer_position as customerPosition,
+    a.customer_status as customerStatus,
     c.company_name as companyName,
     c.location_province as locationProvince,
     c.company_industry as companyIndustry,
     c.adress,
     d.name as adminName
     from customer a 
-    left join customer_user_info b on  a.id=b.cid
     left join customer_organization_info c on a.id=c.cid
     left join admin d on a.aid=d.id
-    where a.id = #{id,jdbcType=VARCHAR} and b.primary_flg=0
+    where a.id = #{id,jdbcType=VARCHAR}
   </select> 
   
   <update id="updCustomerByPrimaryKey" parameterType="com.goafanti.common.model.Customer">
@@ -544,4 +552,11 @@
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>
+  
+  <select id="selectByLadderId" parameterType="java.lang.String" resultMap="BaseResultMap">
+  	select 
+    <include refid="Base_Column_List" />
+    from customer
+    where paid like concat('%',#{paid},'%')
+  </select>
 </mapper>

+ 14 - 6
src/main/java/com/goafanti/common/mapper/CustomerUserInfoMapper.xml

@@ -411,11 +411,11 @@
     where id = #{id,jdbcType=VARCHAR}
   </update>  
   
-  <select id="selectUserNameList" parameterType="java.lang.String" resultType="com.goafanti.common.model.CustomerUserInfo">
-    select 
-    id,name 
-    from customer_user_info
-    where 1=1 and cid = #{cid,jdbcType=VARCHAR}
+  <select id="selectCustomerUserList" parameterType="java.lang.String" resultType="com.goafanti.common.model.CustomerUserInfo">
+    select a.id,a.cid,a.name,a.mobile,a.email,a.qq,a.wechat,a.tel_num as telNum,
+    a.depatrment,a.customer_position as customerPosition,a.sex
+    from customer_user_info a
+    where a.cid = #{cid,jdbcType=VARCHAR}
   </select>
   
   <select id="selectPrimaryFlgByCid" parameterType="java.lang.String" resultType="java.lang.String">
@@ -428,5 +428,13 @@
   <update id="updataPrimaryFlg" parameterType="java.lang.String" >
     update customer_user_info set primary_flg=1 where 1=1 and id = #{id,jdbcType=VARCHAR}
   </update>
- 
+  
+  <select id="findContactDetail" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.CustomerUserInfoOut">
+  	select 
+	  	a.id,a.cid,a.name,a.mobile,a.email,a.qq,a.wechat,a.tel_num as telNum,
+	  	a.depatrment,a.customer_position as customerPosition,a.sex,
+	  	b.company_name as companyName,primary_flg as primaryFlg
+    from customer_user_info a join customer_organization_info b on a.cid = b.cid
+  	where a.id = #{id,jdbcType=VARCHAR}
+  </select>
 </mapper>

+ 47 - 22
src/main/java/com/goafanti/common/mapper/FollowUpRecordMapper.xml

@@ -5,7 +5,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Oct 17 18:20:53 CST 2017.
+      This element was generated on Wed Oct 18 19:10:46 CST 2017.
     -->
     <id column="id" jdbcType="VARCHAR" property="id" />
     <result column="cid" jdbcType="VARCHAR" property="cid" />
@@ -18,12 +18,13 @@
     <result column="cuid" jdbcType="VARCHAR" property="cuid" />
     <result column="customer_status" jdbcType="INTEGER" property="customerStatus" />
     <result column="contact_info" jdbcType="VARCHAR" property="contactInfo" />
+    <result column="effective" jdbcType="INTEGER" property="effective" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Oct 17 18:20:53 CST 2017.
+      This element was generated on Wed Oct 18 19:10:46 CST 2017.
     -->
     <where>
       <foreach collection="oredCriteria" item="criteria" separator="or">
@@ -57,7 +58,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Oct 17 18:20:53 CST 2017.
+      This element was generated on Wed Oct 18 19:10:46 CST 2017.
     -->
     <where>
       <foreach collection="example.oredCriteria" item="criteria" separator="or">
@@ -91,16 +92,16 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Oct 17 18:20:53 CST 2017.
+      This element was generated on Wed Oct 18 19:10:46 CST 2017.
     -->
     id, cid, aid, follow_date, tm_stamp, follow_result, follow_situation, attachment, 
-    cuid, customer_status, contact_info
+    cuid, customer_status, contact_info, effective
   </sql>
   <select id="selectByExample" parameterType="com.goafanti.common.model.FollowUpRecordExample" resultMap="BaseResultMap">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Oct 17 18:20:53 CST 2017.
+      This element was generated on Wed Oct 18 19:10:46 CST 2017.
     -->
     select
     <if test="distinct">
@@ -119,7 +120,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Oct 17 18:20:53 CST 2017.
+      This element was generated on Wed Oct 18 19:10:46 CST 2017.
     -->
     select 
     <include refid="Base_Column_List" />
@@ -130,7 +131,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Oct 17 18:20:53 CST 2017.
+      This element was generated on Wed Oct 18 19:10:46 CST 2017.
     -->
     delete from follow_up_record
     where id = #{id,jdbcType=VARCHAR}
@@ -139,7 +140,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Oct 17 18:20:53 CST 2017.
+      This element was generated on Wed Oct 18 19:10:46 CST 2017.
     -->
     delete from follow_up_record
     <if test="_parameter != null">
@@ -150,22 +151,24 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Oct 17 18:20:53 CST 2017.
+      This element was generated on Wed Oct 18 19:10:46 CST 2017.
     -->
     insert into follow_up_record (id, cid, aid, 
       follow_date, tm_stamp, follow_result, 
       follow_situation, attachment, cuid, 
-      customer_status, contact_info)
+      customer_status, contact_info, effective
+      )
     values (#{id,jdbcType=VARCHAR}, #{cid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, 
       #{followDate,jdbcType=TIMESTAMP}, #{tmStamp,jdbcType=TIMESTAMP}, #{followResult,jdbcType=VARCHAR}, 
       #{followSituation,jdbcType=INTEGER}, #{attachment,jdbcType=INTEGER}, #{cuid,jdbcType=VARCHAR}, 
-      #{customerStatus,jdbcType=INTEGER}, #{contactInfo,jdbcType=VARCHAR})
+      #{customerStatus,jdbcType=INTEGER}, #{contactInfo,jdbcType=VARCHAR}, #{effective,jdbcType=INTEGER}
+      )
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.FollowUpRecord">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Oct 17 18:20:53 CST 2017.
+      This element was generated on Wed Oct 18 19:10:46 CST 2017.
     -->
     insert into follow_up_record
     <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -202,6 +205,9 @@
       <if test="contactInfo != null">
         contact_info,
       </if>
+      <if test="effective != null">
+        effective,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -237,13 +243,16 @@
       <if test="contactInfo != null">
         #{contactInfo,jdbcType=VARCHAR},
       </if>
+      <if test="effective != null">
+        #{effective,jdbcType=INTEGER},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.goafanti.common.model.FollowUpRecordExample" resultType="java.lang.Long">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Oct 17 18:20:53 CST 2017.
+      This element was generated on Wed Oct 18 19:10:46 CST 2017.
     -->
     select count(*) from follow_up_record
     <if test="_parameter != null">
@@ -254,7 +263,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Oct 17 18:20:53 CST 2017.
+      This element was generated on Wed Oct 18 19:10:46 CST 2017.
     -->
     update follow_up_record
     <set>
@@ -291,6 +300,9 @@
       <if test="record.contactInfo != null">
         contact_info = #{record.contactInfo,jdbcType=VARCHAR},
       </if>
+      <if test="record.effective != null">
+        effective = #{record.effective,jdbcType=INTEGER},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -300,7 +312,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Oct 17 18:20:53 CST 2017.
+      This element was generated on Wed Oct 18 19:10:46 CST 2017.
     -->
     update follow_up_record
     set id = #{record.id,jdbcType=VARCHAR},
@@ -313,7 +325,8 @@
       attachment = #{record.attachment,jdbcType=INTEGER},
       cuid = #{record.cuid,jdbcType=VARCHAR},
       customer_status = #{record.customerStatus,jdbcType=INTEGER},
-      contact_info = #{record.contactInfo,jdbcType=VARCHAR}
+      contact_info = #{record.contactInfo,jdbcType=VARCHAR},
+      effective = #{record.effective,jdbcType=INTEGER}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -322,7 +335,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Oct 17 18:20:53 CST 2017.
+      This element was generated on Wed Oct 18 19:10:46 CST 2017.
     -->
     update follow_up_record
     <set>
@@ -356,6 +369,9 @@
       <if test="contactInfo != null">
         contact_info = #{contactInfo,jdbcType=VARCHAR},
       </if>
+      <if test="effective != null">
+        effective = #{effective,jdbcType=INTEGER},
+      </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>
@@ -363,7 +379,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Oct 17 18:20:53 CST 2017.
+      This element was generated on Wed Oct 18 19:10:46 CST 2017.
     -->
     update follow_up_record
     set cid = #{cid,jdbcType=VARCHAR},
@@ -375,19 +391,28 @@
       attachment = #{attachment,jdbcType=INTEGER},
       cuid = #{cuid,jdbcType=VARCHAR},
       customer_status = #{customerStatus,jdbcType=INTEGER},
-      contact_info = #{contactInfo,jdbcType=VARCHAR}
+      contact_info = #{contactInfo,jdbcType=VARCHAR},
+      effective = #{effective,jdbcType=INTEGER}
     where id = #{id,jdbcType=VARCHAR}
   </update>
   <select id="listFollowUpRecord" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.FollowUpRecordOut">
   	select 
+  		a.id as followId,
+  		a.cuid as contactId,
 		a.follow_date as followDate,
 		a.follow_result as followResult, 
 		a.follow_situation as followSituation,
 		a.customer_status as customerStatus,
 		a.attachment,
 		a.contact_info as contactInfo,
-		b.name as contactName
+		b.name as contactName,
+		c.name as adminName
 	from follow_up_record a left join customer_user_info b on a.cuid = b.id
-	where a.cid = #{cid,jdbcType=VARCHAR}
+	left join admin c on a.aid = c.id
+	where a.cid = #{cid,jdbcType=VARCHAR} and a.effective = 0
   </select>
+  
+  <update id="deleteFollowUpRecord" parameterType="java.lang.String">
+  	 update follow_up_record set effective = 1 where id = #{followId,jdbcType=VARCHAR}
+  </update>
 </mapper>

+ 56 - 33
src/main/java/com/goafanti/common/model/FollowUpRecord.java

@@ -6,64 +6,69 @@ public class FollowUpRecord {
 
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column follow_up_record.id
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	private String id;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column follow_up_record.cid
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	private String cid;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column follow_up_record.aid
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	private String aid;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column follow_up_record.follow_date
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	private Date followDate;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column follow_up_record.tm_stamp
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	private Date tmStamp;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column follow_up_record.follow_result
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	private String followResult;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column follow_up_record.follow_situation
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	private Integer followSituation;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column follow_up_record.attachment
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	private Integer attachment;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column follow_up_record.cuid
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	private String cuid;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column follow_up_record.customer_status
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	private Integer customerStatus;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column follow_up_record.contact_info
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	private String contactInfo;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column follow_up_record.effective
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 */
+	private Integer effective;
 
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column follow_up_record.id
 	 * @return  the value of follow_up_record.id
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public String getId() {
 		return id;
@@ -72,7 +77,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column follow_up_record.id
 	 * @param id  the value for follow_up_record.id
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public void setId(String id) {
 		this.id = id;
@@ -81,7 +86,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column follow_up_record.cid
 	 * @return  the value of follow_up_record.cid
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public String getCid() {
 		return cid;
@@ -90,7 +95,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column follow_up_record.cid
 	 * @param cid  the value for follow_up_record.cid
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public void setCid(String cid) {
 		this.cid = cid;
@@ -99,7 +104,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column follow_up_record.aid
 	 * @return  the value of follow_up_record.aid
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public String getAid() {
 		return aid;
@@ -108,7 +113,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column follow_up_record.aid
 	 * @param aid  the value for follow_up_record.aid
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public void setAid(String aid) {
 		this.aid = aid;
@@ -117,7 +122,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column follow_up_record.follow_date
 	 * @return  the value of follow_up_record.follow_date
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public Date getFollowDate() {
 		return followDate;
@@ -126,7 +131,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column follow_up_record.follow_date
 	 * @param followDate  the value for follow_up_record.follow_date
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public void setFollowDate(Date followDate) {
 		this.followDate = followDate;
@@ -135,7 +140,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column follow_up_record.tm_stamp
 	 * @return  the value of follow_up_record.tm_stamp
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public Date getTmStamp() {
 		return tmStamp;
@@ -144,7 +149,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column follow_up_record.tm_stamp
 	 * @param tmStamp  the value for follow_up_record.tm_stamp
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public void setTmStamp(Date tmStamp) {
 		this.tmStamp = tmStamp;
@@ -153,7 +158,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column follow_up_record.follow_result
 	 * @return  the value of follow_up_record.follow_result
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public String getFollowResult() {
 		return followResult;
@@ -162,7 +167,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column follow_up_record.follow_result
 	 * @param followResult  the value for follow_up_record.follow_result
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public void setFollowResult(String followResult) {
 		this.followResult = followResult;
@@ -171,7 +176,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column follow_up_record.follow_situation
 	 * @return  the value of follow_up_record.follow_situation
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public Integer getFollowSituation() {
 		return followSituation;
@@ -180,7 +185,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column follow_up_record.follow_situation
 	 * @param followSituation  the value for follow_up_record.follow_situation
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public void setFollowSituation(Integer followSituation) {
 		this.followSituation = followSituation;
@@ -189,7 +194,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column follow_up_record.attachment
 	 * @return  the value of follow_up_record.attachment
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public Integer getAttachment() {
 		return attachment;
@@ -198,7 +203,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column follow_up_record.attachment
 	 * @param attachment  the value for follow_up_record.attachment
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public void setAttachment(Integer attachment) {
 		this.attachment = attachment;
@@ -207,7 +212,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column follow_up_record.cuid
 	 * @return  the value of follow_up_record.cuid
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public String getCuid() {
 		return cuid;
@@ -216,7 +221,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column follow_up_record.cuid
 	 * @param cuid  the value for follow_up_record.cuid
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public void setCuid(String cuid) {
 		this.cuid = cuid;
@@ -225,7 +230,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column follow_up_record.customer_status
 	 * @return  the value of follow_up_record.customer_status
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public Integer getCustomerStatus() {
 		return customerStatus;
@@ -234,7 +239,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column follow_up_record.customer_status
 	 * @param customerStatus  the value for follow_up_record.customer_status
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public void setCustomerStatus(Integer customerStatus) {
 		this.customerStatus = customerStatus;
@@ -243,7 +248,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column follow_up_record.contact_info
 	 * @return  the value of follow_up_record.contact_info
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public String getContactInfo() {
 		return contactInfo;
@@ -252,9 +257,27 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column follow_up_record.contact_info
 	 * @param contactInfo  the value for follow_up_record.contact_info
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public void setContactInfo(String contactInfo) {
 		this.contactInfo = contactInfo;
 	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column follow_up_record.effective
+	 * @return  the value of follow_up_record.effective
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 */
+	public Integer getEffective() {
+		return effective;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column follow_up_record.effective
+	 * @param effective  the value for follow_up_record.effective
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 */
+	public void setEffective(Integer effective) {
+		this.effective = effective;
+	}
 }

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

@@ -7,23 +7,23 @@ import java.util.List;
 public class FollowUpRecordExample {
     /**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table follow_up_record
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	protected String orderByClause;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table follow_up_record
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	protected boolean distinct;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table follow_up_record
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	protected List<Criteria> oredCriteria;
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public FollowUpRecordExample() {
 		oredCriteria = new ArrayList<Criteria>();
@@ -31,7 +31,7 @@ public class FollowUpRecordExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public void setOrderByClause(String orderByClause) {
 		this.orderByClause = orderByClause;
@@ -39,7 +39,7 @@ public class FollowUpRecordExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public String getOrderByClause() {
 		return orderByClause;
@@ -47,7 +47,7 @@ public class FollowUpRecordExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public void setDistinct(boolean distinct) {
 		this.distinct = distinct;
@@ -55,7 +55,7 @@ public class FollowUpRecordExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public boolean isDistinct() {
 		return distinct;
@@ -63,7 +63,7 @@ public class FollowUpRecordExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public List<Criteria> getOredCriteria() {
 		return oredCriteria;
@@ -71,7 +71,7 @@ public class FollowUpRecordExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public void or(Criteria criteria) {
 		oredCriteria.add(criteria);
@@ -79,7 +79,7 @@ public class FollowUpRecordExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public Criteria or() {
 		Criteria criteria = createCriteriaInternal();
@@ -89,7 +89,7 @@ public class FollowUpRecordExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public Criteria createCriteria() {
 		Criteria criteria = createCriteriaInternal();
@@ -101,7 +101,7 @@ public class FollowUpRecordExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	protected Criteria createCriteriaInternal() {
 		Criteria criteria = new Criteria();
@@ -110,7 +110,7 @@ public class FollowUpRecordExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public void clear() {
 		oredCriteria.clear();
@@ -120,7 +120,7 @@ public class FollowUpRecordExample {
 
 	/**
 	 * This class was generated by MyBatis Generator. This class corresponds to the database table follow_up_record
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	protected abstract static class GeneratedCriteria {
 		protected List<Criterion> criteria;
@@ -882,11 +882,71 @@ public class FollowUpRecordExample {
 			addCriterion("contact_info not between", value1, value2, "contactInfo");
 			return (Criteria) this;
 		}
+
+		public Criteria andEffectiveIsNull() {
+			addCriterion("effective is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andEffectiveIsNotNull() {
+			addCriterion("effective is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andEffectiveEqualTo(Integer value) {
+			addCriterion("effective =", value, "effective");
+			return (Criteria) this;
+		}
+
+		public Criteria andEffectiveNotEqualTo(Integer value) {
+			addCriterion("effective <>", value, "effective");
+			return (Criteria) this;
+		}
+
+		public Criteria andEffectiveGreaterThan(Integer value) {
+			addCriterion("effective >", value, "effective");
+			return (Criteria) this;
+		}
+
+		public Criteria andEffectiveGreaterThanOrEqualTo(Integer value) {
+			addCriterion("effective >=", value, "effective");
+			return (Criteria) this;
+		}
+
+		public Criteria andEffectiveLessThan(Integer value) {
+			addCriterion("effective <", value, "effective");
+			return (Criteria) this;
+		}
+
+		public Criteria andEffectiveLessThanOrEqualTo(Integer value) {
+			addCriterion("effective <=", value, "effective");
+			return (Criteria) this;
+		}
+
+		public Criteria andEffectiveIn(List<Integer> values) {
+			addCriterion("effective in", values, "effective");
+			return (Criteria) this;
+		}
+
+		public Criteria andEffectiveNotIn(List<Integer> values) {
+			addCriterion("effective not in", values, "effective");
+			return (Criteria) this;
+		}
+
+		public Criteria andEffectiveBetween(Integer value1, Integer value2) {
+			addCriterion("effective between", value1, value2, "effective");
+			return (Criteria) this;
+		}
+
+		public Criteria andEffectiveNotBetween(Integer value1, Integer value2) {
+			addCriterion("effective not between", value1, value2, "effective");
+			return (Criteria) this;
+		}
 	}
 
 	/**
 	 * This class was generated by MyBatis Generator. This class corresponds to the database table follow_up_record
-	 * @mbg.generated  Tue Oct 17 18:20:53 CST 2017
+	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
 	 */
 	public static class Criterion {
 		private String condition;

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

@@ -106,7 +106,7 @@ public class FileUtils {
 				|| sign.indexOf("achievement_technical_picture") != -1
 				|| sign.indexOf("achievement_maturity_picture") != -1 || sign.indexOf("demand_order_file") != -1
 				|| sign.indexOf("lecture_picture") != -1|| sign.indexOf("cover_picture") != -1 
-				|| sign.indexOf("news") != -1) {
+				|| sign.indexOf("news") != -1||sign.indexOf("customer_sys_file") != -1) {
 			uniq = true;
 		}
 		String fileName = "";

+ 46 - 11
src/main/java/com/goafanti/customer/bo/CustomerIn.java

@@ -4,21 +4,27 @@ package com.goafanti.customer.bo;
 public class CustomerIn {
 	/** 客户编号 **/
 	private String id;
+	
 	/** 跟进记录编号 **/
 	private String followId;
+	
 	/** 客户编号 **/
 	private String cuid;
+	
 	/** 跟进时间 **/
 	private String followDates;
 	
 	/** 客户名 **/
 	private String customerName;
 	
+	/** 公司名称 **/
+	private String companyName;
+	
 	/** 客户类型 **/
-	private String customerTyp;
+	private String customerType;
 	
 	/** 共享类型  **/
-	private String shareTyp; 
+	private String shareType; 
 	
 	/** 联系人姓名 **/
 	private String contactName;
@@ -58,6 +64,12 @@ public class CustomerIn {
 	/** 客户标签 **/
 	private String tag;
 	
+	/** 上级ID **/
+	private String  paid;
+	
+	/** 省份 **/
+	private String locationProvince;
+	
 	public String getCuid() {
 		return cuid;
 	}
@@ -117,20 +129,20 @@ public class CustomerIn {
 		this.customerName = customerName;
 	}
 
-	public String getCustomerTyp() {
-		return customerTyp;
+	public String getCustomerType() {
+		return customerType;
 	}
 
-	public void setCustomerTyp(String customerTyp) {
-		this.customerTyp = customerTyp;
+	public void setCustomerType(String customerType) {
+		this.customerType = customerType;
 	}
 
-	public String getShareTyp() {
-		return shareTyp;
+	public String getShareType() {
+		return shareType;
 	}
 
-	public void setShareTyp(String shareTyp) {
-		this.shareTyp = shareTyp;
+	public void setShareType(String shareType) {
+		this.shareType = shareType;
 	}
 
 	public String getContactName() {
@@ -220,5 +232,28 @@ public class CustomerIn {
 	public void setFollowDates(String followDates) {
 		this.followDates = followDates;
 	}
-	
+
+	public String getPaid() {
+		return paid;
+	}
+
+	public void setPaid(String paid) {
+		this.paid = paid;
+	}
+
+	public String getLocationProvince() {
+		return locationProvince;
+	}
+
+	public void setLocationProvince(String locationProvince) {
+		this.locationProvince = locationProvince;
+	}
+
+	public String getCompanyName() {
+		return companyName;
+	}
+
+	public void setCompanyName(String companyName) {
+		this.companyName = companyName;
+	}
 }

+ 24 - 2
src/main/java/com/goafanti/customer/bo/CustomerOut.java

@@ -113,7 +113,10 @@ public class CustomerOut {
 	 * 详细地址
 	 */
 	private String adress;
-	
+	/**
+	 * 跟单人ID
+	 */
+	private String aid;
 	/**
 	 * 跟单人
 	 */
@@ -133,7 +136,10 @@ public class CustomerOut {
 	private String beforeFollowSituation;
 	/** 跟单人 **/
 	private String beforeAdminName;
-
+	
+	/** 公司标签 **/
+	private String tag;
+	
 	public Integer getCustomerType() {
 		return customerType;
 	}
@@ -374,6 +380,14 @@ public class CustomerOut {
 		this.adress = adress;
 	}
 
+	public String getAid() {
+		return aid;
+	}
+
+	public void setAid(String aid) {
+		this.aid = aid;
+	}
+
 	public String getAdminName() {
 		return adminName;
 	}
@@ -422,6 +436,14 @@ public class CustomerOut {
 		this.beforeAdminName = beforeAdminName;
 	}
 
+	public String getTag() {
+		return tag;
+	}
+
+	public void setTag(String tag) {
+		this.tag = tag;
+	}
+
 	@Override
 	public String toString() {
 		return "CustomerOut [customerType=" + customerType + ", _customerType=" + _customerType + ", id=" + id

+ 15 - 0
src/main/java/com/goafanti/customer/bo/CustomerUserInfoOut.java

@@ -0,0 +1,15 @@
+package com.goafanti.customer.bo;
+
+import com.goafanti.common.model.CustomerUserInfo;
+
+public class CustomerUserInfoOut extends CustomerUserInfo{
+	private String companyName;
+
+	public String getCompanyName() {
+		return companyName;
+	}
+
+	public void setCompanyName(String companyName) {
+		this.companyName = companyName;
+	}	
+}

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

@@ -32,6 +32,10 @@ public class FollowUpRecordOut {
 	private String attachment;
 	/** 跟进结果 **/
 	private String followResult;
+	/** 跟进记录 ID **/
+	private String followId;
+	/** 联系人 ID **/
+	private String contactId;
 	
 	public String get_followDate() {
 		SimpleDateFormat format = new SimpleDateFormat(AFTConstants.YYYYMMDDHHMMSS);
@@ -102,5 +106,16 @@ public class FollowUpRecordOut {
 	public void setFollowResult(String followResult) {
 		this.followResult = followResult;
 	}
-	
+	public String getFollowId() {
+		return followId;
+	}
+	public void setFollowId(String followId) {
+		this.followId = followId;
+	}
+	public String getContactId() {
+		return contactId;
+	}
+	public void setContactId(String contactId) {
+		this.contactId = contactId;
+	}
 }

+ 150 - 34
src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java

@@ -9,6 +9,7 @@ import java.util.UUID;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 
 import org.apache.commons.beanutils.BeanUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -27,16 +28,17 @@ import com.goafanti.admin.service.AdminService;
 import com.goafanti.common.bo.Error;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.AFTConstants;
-import com.goafanti.common.controller.BaseController;
+import com.goafanti.common.controller.BaseApiController;
 import com.goafanti.common.model.Customer;
 import com.goafanti.common.model.CustomerOrganizationInfo;
 import com.goafanti.common.model.CustomerUserInfo;
 import com.goafanti.common.model.FollowUpRecord;
 import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.core.shiro.token.TokenManager;
 
 @RestController
 @RequestMapping(value = "/api/admin/customer")
-public class AdminCustomerApiController extends BaseController {
+public class AdminCustomerApiController extends BaseApiController {
 
 	@Resource
 	private CustomerService customerService;
@@ -72,7 +74,7 @@ public class AdminCustomerApiController extends BaseController {
 		
 		coi.setId(UUID.randomUUID().toString());//客户公司ID
 		coi.setCid(customerId);//客户公司表中的cid
-		SimpleDateFormat format = new SimpleDateFormat(AFTConstants.YYYYMMDD);
+		SimpleDateFormat format = new SimpleDateFormat(AFTConstants.YYYYMMDDHHMMSS);
 		fur.setFollowDate(format.parse(cusIn.getFollowDates()));
 		fur.setId(followId);//跟进记录的ID
 		fur.setCid(customerId);//跟进记录表中的cid
@@ -80,8 +82,8 @@ public class AdminCustomerApiController extends BaseController {
 		/*if(StringUtils.isNotBlank(cusIn.getAid())) fur.setAid(cusIn.getAid());*//*暂时注释*/
 		
 		BeanUtils.copyProperties(c, cusIn);
-		c.setShareType(Integer.parseInt(cusIn.getShareTyp()));
-		c.setCustomerType(Integer.parseInt(cusIn.getCustomerTyp()));
+		c.setShareType(Integer.parseInt(cusIn.getShareType()));
+		c.setCustomerType(Integer.parseInt(cusIn.getCustomerType()));
 		c.setId(customerId);
 		
 		customerService.addCustomer(c);
@@ -90,7 +92,7 @@ public class AdminCustomerApiController extends BaseController {
 		//插入 customerOrganizationInfo
 		customerOrganizationService.addCustomerOrganizationInfo(coi);
 		//插入跟进表
-		followUpService.addFollowUp(fur,cusIn);
+		followUpService.addFollowUp(fur);
 		//添加日志
 		customerService.saveCustomerLogo(cusIn, AFTConstants.CUSTOMER_CREATE,customerId);
 		return res;
@@ -104,10 +106,10 @@ public class AdminCustomerApiController extends BaseController {
 	 * @throws ParseException
 	 */
 	@RequestMapping(value = "/deleteCustomer", method = RequestMethod.POST)
-	public Result deleteCustomer(String id,CustomerIn cusIn) throws ParseException {
+	public Result deleteCustomer(CustomerIn cusIn) throws ParseException {
 		Result res=new Result();
-		customerService.deleteCustomer(id);
-		customerService.saveCustomerLogo(cusIn, AFTConstants.CUSTOMER_DELETE,id);
+		customerService.deleteCustomer(cusIn.getId());
+		customerService.saveCustomerLogo(cusIn, AFTConstants.CUSTOMER_DELETE,cusIn.getId());
 		return res;
 	}
 	
@@ -154,8 +156,8 @@ public class AdminCustomerApiController extends BaseController {
 	 * 
 	 * @return
 	 */
-	@RequestMapping(value = "/findCustomerUserDetails", method = RequestMethod.POST)
-	public Result findCustomerUserDetails(String id) {
+	@RequestMapping(value = "/findCustomerDetails", method = RequestMethod.POST)
+	public Result findCustomerDetails(String id) {
 		Result res=new Result();
 		res.setData(customerService.findCustomerDetails(id));
 		return res;
@@ -166,10 +168,10 @@ public class AdminCustomerApiController extends BaseController {
 	 * 
 	 * @return
 	 */
-	@RequestMapping(value = "/findCustomerUserNameList", method = RequestMethod.POST)
-	public Result findCustomerUserNameList (String cid) {
+	@RequestMapping(value = "/findCustomerUserList", method = RequestMethod.POST)
+	public Result findCustomerUserList (String cid) {
 		Result res =new Result();
-	    res.setData(customerUserService.findCustomerUserNameList(cid));
+	    res.setData(customerUserService.selectCustomerUserList(cid));
 	    return res;
 	}
 	
@@ -203,13 +205,13 @@ public class AdminCustomerApiController extends BaseController {
 	 * @throws InvocationTargetException 
 	 * @throws IllegalAccessException 
 	 */
-	@RequestMapping(value = "/updCustomer", method = RequestMethod.POST)
-	public Result updCustomer (CustomerIn cusIn,CustomerOrganizationInfo coi) throws IllegalAccessException, InvocationTargetException  {
+	@RequestMapping(value = "/updateCustomer", method = RequestMethod.POST)
+	public Result updateCustomer (CustomerIn cusIn,CustomerOrganizationInfo coi,HttpServletResponse rsp) throws IllegalAccessException, InvocationTargetException  {
 		Result res=new Result();
 		Customer c =new Customer();
 		BeanUtils.copyProperties(c, cusIn);
-		c.setShareType(Integer.parseInt(cusIn.getShareTyp()));
-		c.setCustomerType(Integer.parseInt(cusIn.getCustomerTyp()));
+		c.setShareType(Integer.parseInt(cusIn.getShareType()));
+		c.setCustomerType(Integer.parseInt(cusIn.getCustomerType()));
 		coi.setCid(cusIn.getId());
 		//更新主表
 		customerService.updateCustomer(c);
@@ -230,7 +232,9 @@ public class AdminCustomerApiController extends BaseController {
 	public Result transferCustomer (CustomerIn cusIn) throws IllegalAccessException, InvocationTargetException  {
 		Result res=new Result();
 		Customer c =new Customer();
-		BeanUtils.copyProperties(c, cusIn);
+		c.setId(cusIn.getId());
+		c.setAid(cusIn.getAid());
+		c.setCreateTime(new Date());
 		//更新主表
 		customerService.updateCustomer(c);
 		//插入日志表
@@ -242,22 +246,29 @@ public class AdminCustomerApiController extends BaseController {
 	 * 查询单个联系人信息
 	 * @return
 	 */
-	@RequestMapping(value = "/findContactDetail", method = RequestMethod.POST)
-	public Result findContactDetail (String id)  {
+	@RequestMapping(value = "/findContactDetail", method = RequestMethod.GET)
+	public Result findContactDetail (String contactId)  {
 		Result res=new Result();
-		res.setData(customerUserService.findContractById(id));
+		res.setData(customerUserService.findContactDetail(contactId));
 		return res;
 	}
 	
 	/**
-	 * 修改单个联系人信息
+	 * 修改联系人信息
 	 * @return
 	 */
-	/*@RequestMapping(value = "/transferCsutomer", method = RequestMethod.POST)
-	public Result updContractById (String id)  {
+	@RequestMapping(value = "/updateContacter", method = RequestMethod.POST)
+	public Result updateContacter (CustomerUserInfo cui)  {
 		Result res=new Result();
+		if(cui.getPrimaryFlg() == 0){
+			String primaryId = customerUserService.selectPrimaryFlgByCid(cui.getCid());
+			if(StringUtils.isNoneBlank(primaryId)) {
+				customerUserService.updatePrimaryFlg(primaryId);//把主要联系人状态给去掉
+			}		
+		}
+		customerUserService.updateContractById(cui);
 		return res;
-	}*/
+	}
 	
 	/**
 	 * 添加跟进记录
@@ -272,8 +283,10 @@ public class AdminCustomerApiController extends BaseController {
 		if(StringUtils.isNotBlank(cusIn.getFollowDates())) fur.setFollowDate(format.parse(cusIn.getFollowDates()));
 		String followId = UUID.randomUUID().toString();
 		fur.setId(followId);
+		fur.setCid(cusIn.getId());
+		fur.setEffective(0);
 		cusIn.setFollowId(followId);
-		followUpService.addFollowUp(fur, cusIn);	
+		followUpService.addFollowUp(fur);	
 		Customer cus = new Customer();
 		try {
 			BeanUtils.copyProperties(cus, cusIn);
@@ -283,8 +296,7 @@ public class AdminCustomerApiController extends BaseController {
 				cus.setCustomerStatus(Integer.parseInt(cusIn.getCustomerStatus()));
 		} catch (IllegalAccessException | InvocationTargetException e) {			
 			e.printStackTrace();
-		}
-		
+		}	
 		customerService.updateCustomer(cus);
 		return res;
 	}
@@ -319,17 +331,121 @@ public class AdminCustomerApiController extends BaseController {
 	 * @param customerId
 	 * @return
 	 */
-	@RequestMapping(value = "/delContract" , method = RequestMethod.GET)
-	public Result delContract(String id){
+	@RequestMapping(value = "/deleteContacter" , method = RequestMethod.GET)
+	public Result deleteContacter(String contactId){
 		Result res= new Result();
-		CustomerUserInfo customerUserInfo = customerUserService.findContractById(id);
-		
+		CustomerUserInfo customerUserInfo = customerUserService.findContractById(contactId);
 		if(customerUserInfo.getPrimaryFlg()==0) {
 			res.getError().add(new Error("该联系人为主要联系人,不能进行删除操作!"));
 		}else {
-			customerUserService.deleteContractById(id);
+			customerUserService.deleteContractById(contactId);
 		}
 		return res;
 	}	
 	
+	/**
+	 * 营销员填写跟进记录上传文件
+	 * @param req
+	 * @param sign
+	 * @return
+	 */
+	@RequestMapping(value = "/attachmentUpload" , method = RequestMethod.POST)
+	public Result attachmentUpload(HttpServletRequest req, String sign){
+		Result res= new Result();
+		res.setData(handleFile(res, "/customer_sys_file/", true, req, sign));
+		return res;
+	}
+	
+	/**
+	 * 删除跟进记录 
+	 * @param followId
+	 * @return
+	 */
+	@RequestMapping(value = "/deleteFollowUpRecord", method = RequestMethod.GET)
+	public Result deleteFollowUpRecord(String followId){
+		Result res= new Result();
+		followUpService.deleteFollowUpRecord(followId);
+		return res;
+	}
+	
+	/**
+	 * 查看公共客户
+	 * @param request
+	 * @return
+	 */
+	@RequestMapping(value = "/listPublicCustomer", method = RequestMethod.POST)
+	public Result listPublicCustomer(HttpServletRequest request,CustomerIn cin,Integer pageSize, Integer pageNumber){
+		Result  res = new Result();
+		Pagination<CustomerOut> boList = customerService.getPublicCustomer(cin, pageSize, pageNumber);
+		res.setData(boList);
+		return res;
+	}
+	
+	/**
+	 * 领取
+	 * @param cusIn
+	 * @return
+	 * @throws IllegalAccessException
+	 * @throws InvocationTargetException
+	 */
+	@RequestMapping(value = "/receivePublicCustomer", method = RequestMethod.GET)
+	public Result receivePublicCustomer(CustomerIn cusIn) throws IllegalAccessException, InvocationTargetException{
+		Result res=new Result();
+		Customer c =new Customer();
+		c.setId(cusIn.getId());
+		c.setAid(TokenManager.getAdminId());
+		//更新主表
+		customerService.updateCustomer(c);
+		//插入日志表
+		customerService.saveCustomerLogo(cusIn, AFTConstants.CUSTOMER_RECEIVE,cusIn.getId());
+	    return res;
+	}
+	
+	/**
+	 * 查看公共客户
+	 * @param request
+	 * @return
+	 */
+	@RequestMapping(value = "/listTeamCustomer", method = RequestMethod.POST)
+	public Result listTeamCustomer(HttpServletRequest request,CustomerIn cin,Integer pageSize, Integer pageNumber){
+		Result  res = new Result();
+		Pagination<CustomerOut> boList = customerService.getPublicCustomer(cin, pageSize, pageNumber);
+		res.setData(boList);
+		return res;
+	}
+	
+	/**
+	 * 转为公共客户
+	 * @return
+	 * @throws InvocationTargetException 
+	 * @throws IllegalAccessException 
+	 */
+	@RequestMapping(value = "/transferToPublic" , method = RequestMethod.POST)
+	public Result transferToPublic(CustomerIn cusIn) throws IllegalAccessException, InvocationTargetException{
+		Result res=new Result();
+		Customer c = new Customer();
+		c.setId(cusIn.getId());
+		c.setAid("");
+		c.setShareType(1);
+		c.setCreateTime(new Date());
+		//更新主表
+		customerService.updateCustomer(c);
+		//插入日志表
+		customerService.saveCustomerLogo(cusIn, AFTConstants.CUSTOMER_TO_PUBLIC,cusIn.getId());
+	    return res;
+	}
+	
+	/**
+	 * 查看公司客户
+	 * @param request
+	 * @return
+	 */
+	@RequestMapping(value = "/listCompanyCustomer", method = RequestMethod.POST)
+	public Result listCompanyCustomer(HttpServletRequest request,CustomerIn cin,Integer pageSize, Integer pageNumber){
+		Result  res = new Result();
+		Pagination<CustomerOut> boList = customerService.getCompanyCustomer(cin, pageSize, pageNumber);
+		res.setData(boList);
+		return res;
+	}
+
 }

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

@@ -46,6 +46,18 @@ public interface CustomerService {
 	Pagination<CustomerOut> getPublicCustomer(CustomerIn cin,Integer pageSize, Integer pageNumber);
 	
 	/**
+	 *  获取团队客户
+	 * @return
+	 */
+	Pagination<CustomerOut> getTeamCustomer(CustomerIn cin, Integer pageSize, Integer pageNumber);
+	
+	/**
+	 *  获取公司客户
+	 * @return
+	 */
+	Pagination<CustomerOut> getCompanyCustomer(CustomerIn cin, Integer pageSize, Integer pageNumber);
+	
+	/**
 	 * 
 	 * @param cus 添加日志
 	 */
@@ -71,5 +83,5 @@ public interface CustomerService {
 	 * @return 查询公司基本信息
 	 */
 	public CustomerOut findCustomerBaseInfo(String id);
-	
+
 }

+ 9 - 1
src/main/java/com/goafanti/customer/service/CustomerUserService.java

@@ -3,6 +3,7 @@ package com.goafanti.customer.service;
 import java.util.List;
 
 import com.goafanti.common.model.CustomerUserInfo;
+import com.goafanti.customer.bo.CustomerUserInfoOut;
 
 public interface CustomerUserService {
 	
@@ -18,7 +19,7 @@ public interface CustomerUserService {
 	 * @param cui
 	 * @return
 	 */
-	List<CustomerUserInfo> findCustomerUserNameList(String cid);
+	List<CustomerUserInfo> selectCustomerUserList(String cid);
 	
 	/**
 	 * 查询主要联系人
@@ -51,4 +52,11 @@ public interface CustomerUserService {
 	 * @return
 	 */
 	int deleteContractById (String id);
+	
+	/**
+	 * 查看单个单个联系人
+	 * @param id
+	 * @return
+	 */
+	CustomerUserInfoOut findContactDetail(String id);
 }

+ 8 - 2
src/main/java/com/goafanti/customer/service/FollowUpService.java

@@ -3,7 +3,6 @@ package com.goafanti.customer.service;
 import java.util.List;
 
 import com.goafanti.common.model.FollowUpRecord;
-import com.goafanti.customer.bo.CustomerIn;
 import com.goafanti.customer.bo.FollowUpRecordOut;
 
 public interface FollowUpService {
@@ -12,7 +11,7 @@ public interface FollowUpService {
 	 * @param cui
 	 * @return
 	 */
-	int addFollowUp(FollowUpRecord fur,CustomerIn cusIn);
+	int addFollowUp(FollowUpRecord fur);
 	
 	/**
 	 * 查看跟进记录列表
@@ -20,4 +19,11 @@ public interface FollowUpService {
 	 * @return
 	 */
 	List<FollowUpRecordOut> listFollowUpRecord(String customerId);
+	
+	/**
+	 * 删除跟进记录
+	 * @param followId
+	 * @return
+	 */
+	int deleteFollowUpRecord(String followId);
 }

+ 80 - 9
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -1,13 +1,17 @@
 package com.goafanti.customer.service.impl;
 
 import java.lang.reflect.InvocationTargetException;
+import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 
+import javax.security.auth.Subject;
+
 import org.apache.commons.beanutils.BeanUtils;
+import org.apache.shiro.SecurityUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.goafanti.core.mybatis.BaseMybatisDao;
@@ -38,8 +42,10 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
 	@Override
 	public int addCustomer(Customer cus) {
 		Date data =new Date();
+		String paid = findLadderIds(TokenManager.getAdminId());//查询上级管理员ID集合
 		cus.setCreateTime(data);
 		cus.setAid(TokenManager.getAdminId());
+		cus.setPaid(paid);
 		int res = customerMapper.insert(cus);
 		return res;
 	}
@@ -77,7 +83,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
 	@SuppressWarnings("unchecked")
 	@Override
 	public Pagination<CustomerOut> getPrivateCustomer(CustomerIn cin, Integer pageSize, Integer pageNumber) {
-		cin.setShareTyp("0");
+		cin.setShareType("0");
 		cin.setAid(TokenManager.getAdminId());
 		Map<String,Object> params = disposeParams(cin);
 		if(pageSize == null || pageSize < 0) pageSize = 10;
@@ -87,23 +93,59 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
 		return list;
 	}
 
+	@SuppressWarnings("unchecked")
 	@Override
 	public Pagination<CustomerOut> getPublicCustomer(CustomerIn cin, Integer pageSize, Integer pageNumber) {
-		// TODO Auto-generated method stub
-		return null;
+		cin.setShareType("1");
+		Map<String,Object> params = disposeParams(cin);
+		if(pageSize == null || pageSize < 0) pageSize = 10;
+		if(pageNumber == null || pageNumber <0 ) pageNumber = 1;
+		Pagination<CustomerOut> list = (Pagination<CustomerOut>)findPage("selectCustomer","selectCustomerCount",params, pageNumber, pageSize);
+		list.setList(setResult((List<CustomerOut>)list.getList()));
+		list.setList(descResult((List<CustomerOut>)list.getList()));
+		return list;
+	}
+	
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<CustomerOut> getTeamCustomer(CustomerIn cin, Integer pageSize, Integer pageNumber) {
+		cin.setShareType("0");
+		String paid = findLadderIds(TokenManager.getAdminId());
+		cin.setPaid(paid);
+		Map<String,Object> params = disposeParams(cin);
+		if(pageSize == null || pageSize < 0) pageSize = 10;
+		if(pageNumber == null || pageNumber <0 ) pageNumber = 1;
+		Pagination<CustomerOut> list = (Pagination<CustomerOut>)findPage("selectCustomer","selectCustomerCount",params, pageNumber, pageSize);
+		list.setList(setResult((List<CustomerOut>)list.getList()));
+		list.setList(descResult((List<CustomerOut>)list.getList()));
+		return list;
 	}
 
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<CustomerOut> getCompanyCustomer(CustomerIn cin, Integer pageSize, Integer pageNumber) {
+		Map<String,Object> params = disposeParams(cin);
+		if(pageSize == null || pageSize < 0) pageSize = 10;
+		if(pageNumber == null || pageNumber <0 ) pageNumber = 1;
+		Pagination<CustomerOut> list = (Pagination<CustomerOut>)findPage("selectCustomer","selectCustomerCount",params, pageNumber, pageSize);
+		list.setList(setResult((List<CustomerOut>)list.getList()));
+		return list;
+	}
+	
 	private Map<String,Object> disposeParams(CustomerIn cin){
 		Map<String,Object> params = new HashMap<String,Object>();
 		if(StringUtils.isNotBlank(cin.getAdminName())) params.put("adminName", cin.getAdminName());
 		if(StringUtils.isNotBlank(cin.getAid())) params.put("aid", cin.getAid());
+		if(StringUtils.isNotBlank(cin.getPaid())) params.put("paid", cin.getPaid());
 		if(StringUtils.isNotBlank(cin.getCompanyIntention())) params.put("companyIntention", Integer.parseInt(cin.getCompanyIntention()));
 		if(StringUtils.isNotBlank(cin.getContactName())) params.put("contactName", cin.getContactName());
 		if(StringUtils.isNotBlank(cin.getCustomerStatus())) params.put("customerStauts", Integer.parseInt(cin.getCustomerStatus()));
 		if(StringUtils.isNotBlank(cin.getFollowSituation())) params.put("followSituation", Integer.parseInt(cin.getFollowSituation()));
-		if(StringUtils.isNotBlank(cin.getShareTyp())) params.put("shareType", Integer.parseInt(cin.getShareTyp()));
-		if(StringUtils.isNotBlank(cin.getCustomerTyp())) params.put("customerType", Integer.parseInt(cin.getCustomerTyp()));
+		if(StringUtils.isNotBlank(cin.getShareType())) params.put("shareType", Integer.parseInt(cin.getShareType()));
+		if(StringUtils.isNotBlank(cin.getCustomerType())) params.put("customerType", Integer.parseInt(cin.getCustomerType()));
 		if(StringUtils.isNotBlank(cin.getContactTel())) params.put("contactTel", cin.getContactTel());
+		if(StringUtils.isNotBlank(cin.getLocationProvince())) params.put("locationProvince", cin.getLocationProvince());
+		if(StringUtils.isNotBlank(cin.getCompanyName())) params.put("companyName", cin.getCompanyName());
 		return params;
 	}
 	private List<CustomerOut> setResult(List<CustomerOut> list){
@@ -114,9 +156,9 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
 	}
 	
 	private CustomerOut setFiled(CustomerOut co) {
-		switch(co.getShareType()){
-			case 0 : co.set_shareType("个人客户") ;break;
-			case 1 : co.set_shareType("公共客户") ;break;
+		switch(co.getCustomerType()){
+			case 0 : co.set_customerType("个人客户") ;break;
+			case 1 : co.set_customerType("公司客户") ;break;
 		}
 		switch(co.getCustomerStatus()){
 			case 0 : co.set_customerStatus("新客户") ;break;
@@ -151,6 +193,8 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
 			_companyIntention = _companyIntention.substring(0, _companyIntention.length()-6);
 		}
 		co.set_companyIntention(_companyIntention);
+		
+		if(StringUtils.isNotBlank(co.getFollowDate())) co.setFollowDate(co.getFollowDate().substring(0,19));
 		return co;
 	}
 	/**
@@ -206,6 +250,19 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
 			log.setBeforeCustomerStatus(CustomerStatusFiled.getField(Integer.parseInt(cus.getBeforeCustomerStatus())).getDesc()); //修改前跟进状态
 			log.setBeforeFollowSituation(CustomerFollowFiled.getField(Integer.parseInt(cus.getBeforeFollowSituation())).getDesc());//修改前跟进进度
 			log.setOperatorType(AFTConstants.CUSTOMER_TRANSFER);
+		}else if(operatorType.equals(AFTConstants.CUSTOMER_RECEIVE)){ //领取
+			log.setBeforeAdminName(cus.getBeforeAdminName());//领取前的人
+			log.setAfterAdminName(TokenManager.getAdminToken().getName());//领取后跟进人
+			log.setBeforeCustomerIntention(getCompanyIntention(cus.getBeforeCompanyIntention())); //领取前跟进意向
+			log.setBeforeCustomerStatus(CustomerStatusFiled.getField(Integer.parseInt(cus.getBeforeCustomerStatus())).getDesc()); //领取前跟进状态
+			log.setBeforeFollowSituation(CustomerFollowFiled.getField(Integer.parseInt(cus.getBeforeFollowSituation())).getDesc());//领取前跟进进度
+			log.setOperatorType(AFTConstants.CUSTOMER_RECEIVE);
+		}else if(operatorType.equals(AFTConstants.CUSTOMER_TO_PUBLIC)){
+			log.setBeforeAdminName(cus.getBeforeAdminName());//转为公共客户前跟进人
+			log.setBeforeCustomerIntention(getCompanyIntention(cus.getBeforeCompanyIntention())); //修改前跟进意向
+			log.setBeforeCustomerStatus(CustomerStatusFiled.getField(Integer.parseInt(cus.getBeforeCustomerStatus())).getDesc()); //修改前跟进状态
+			log.setBeforeFollowSituation(CustomerFollowFiled.getField(Integer.parseInt(cus.getBeforeFollowSituation())).getDesc());//修改前跟进进度
+			log.setOperatorType(AFTConstants.CUSTOMER_TO_PUBLIC);
 		}
 		CustomerLogMapper.insert(log);
 	}
@@ -248,5 +305,19 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
 		return cusOut;
 	}
 	
-	
+	/**
+	 *  客户资料脱敏
+	 * @param cusOut
+	 */
+	private List<CustomerOut> descResult(List<CustomerOut> outList){
+		for(CustomerOut out : outList){
+			out.setAdminName("***");
+			out.set_followSituation("***");
+			out.set_companyIntention("***");
+			out.setContactName("***");
+			out.setMobile("***");
+			out.setTelNum("***");
+		}
+		return outList;
+	}
 }

+ 9 - 6
src/main/java/com/goafanti/customer/service/impl/CustomerUserServiceImp.java

@@ -9,6 +9,7 @@ import org.springframework.stereotype.Service;
 import com.goafanti.common.dao.CustomerUserInfoMapper;
 import com.goafanti.common.model.CustomerUserInfo;
 import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.customer.bo.CustomerUserInfoOut;
 import com.goafanti.customer.service.CustomerUserService;
 @Service
 public class CustomerUserServiceImp extends BaseMybatisDao<CustomerUserInfoMapper>  implements CustomerUserService{
@@ -21,8 +22,8 @@ public class CustomerUserServiceImp extends BaseMybatisDao<CustomerUserInfoMappe
 	}
 
 	@Override
-	public List<CustomerUserInfo> findCustomerUserNameList(String cid) {
-		return customerUserInfoMapper.selectUserNameList(cid);
+	public List<CustomerUserInfo> selectCustomerUserList(String cid) {
+		return customerUserInfoMapper.selectCustomerUserList(cid);
 	}
 
 	@Override
@@ -37,8 +38,8 @@ public class CustomerUserServiceImp extends BaseMybatisDao<CustomerUserInfoMappe
 	}
 
 	@Override
-	public CustomerUserInfo findContractById(String id) {
-		return customerUserInfoMapper.selectByPrimaryKey(id);
+	public CustomerUserInfo findContractById(String contactId) {
+		return customerUserInfoMapper.selectByPrimaryKey(contactId);
 	}
 
 	@Override
@@ -51,7 +52,9 @@ public class CustomerUserServiceImp extends BaseMybatisDao<CustomerUserInfoMappe
 		return customerUserInfoMapper.deleteByPrimaryKey(id);
 	}
 
-
-
+	@Override
+	public CustomerUserInfoOut findContactDetail(String id) {
+		return customerUserInfoMapper.findContactDetail(id);
+	}
 
 }

+ 7 - 3
src/main/java/com/goafanti/customer/service/impl/FollowUpServiceImp.java

@@ -11,7 +11,6 @@ import com.goafanti.common.dao.FollowUpRecordMapper;
 import com.goafanti.common.model.FollowUpRecord;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.shiro.token.TokenManager;
-import com.goafanti.customer.bo.CustomerIn;
 import com.goafanti.customer.bo.FollowUpRecordOut;
 import com.goafanti.customer.service.FollowUpService;
 @Service
@@ -19,8 +18,7 @@ public class FollowUpServiceImp extends BaseMybatisDao<CustomerUserInfoMapper>
 	@Autowired
 	private FollowUpRecordMapper followUpRecordMapper ;
 	@Override
-	public int addFollowUp(FollowUpRecord fur,CustomerIn cusIn) {
-		fur.setCid(cusIn.getId());
+	public int addFollowUp(FollowUpRecord fur) {
 		fur.setAid(TokenManager.getAdminId());
 		return followUpRecordMapper.insert(fur);
 	}
@@ -31,4 +29,10 @@ public class FollowUpServiceImp extends BaseMybatisDao<CustomerUserInfoMapper>
 		return followUpRecordMapper.listFollowUpRecord(customerId);
 	}
 
+
+	@Override
+	public int deleteFollowUpRecord(String followId) {
+		
+		return followUpRecordMapper.deleteFollowUpRecord(followId);
+	}
 }