Browse Source

客户管理

wanghui 8 years ago
parent
commit
e0263ca118
29 changed files with 1266 additions and 406 deletions
  1. 1 1
      generatorConfig.xml
  2. 0 1
      src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java
  3. 14 2
      src/main/java/com/goafanti/common/constant/AFTConstants.java
  4. 2 1
      src/main/java/com/goafanti/common/dao/OrganizationContactBookMapper.java
  5. 3 0
      src/main/java/com/goafanti/common/dao/UserBusinessMapper.java
  6. 11 11
      src/main/java/com/goafanti/common/dao/UserIdentityMapper.java
  7. 10 1
      src/main/java/com/goafanti/common/dao/UserMapper.java
  8. 0 64
      src/main/java/com/goafanti/common/enums/CustomerFollowFiled.java
  9. 0 70
      src/main/java/com/goafanti/common/enums/CustomerIntentionFiled.java
  10. 2 0
      src/main/java/com/goafanti/common/enums/CustomerStatusFiled.java
  11. 11 0
      src/main/java/com/goafanti/common/mapper/OrganizationContactBookMapper.xml
  12. 21 10
      src/main/java/com/goafanti/common/mapper/UserBusinessMapper.xml
  13. 35 20
      src/main/java/com/goafanti/common/mapper/UserIdentityMapper.xml
  14. 20 0
      src/main/java/com/goafanti/common/mapper/UserMapper.xml
  15. 193 56
      src/main/java/com/goafanti/common/mapper/UserMapperExt.xml
  16. 116 93
      src/main/java/com/goafanti/common/model/UserIdentity.java
  17. 86 16
      src/main/java/com/goafanti/common/model/UserIdentityExample.java
  18. 55 29
      src/main/java/com/goafanti/common/utils/ExcelUtils.java
  19. 112 1
      src/main/java/com/goafanti/customer/bo/CustomerExcelBo.java
  20. 11 0
      src/main/java/com/goafanti/customer/bo/CustomerListIn.java
  21. 7 0
      src/main/java/com/goafanti/customer/bo/CustomerOrganizationDetailBo.java
  22. 28 1
      src/main/java/com/goafanti/customer/bo/CustomerPersonalDetailBo.java
  23. 5 5
      src/main/java/com/goafanti/customer/bo/FollowListBo.java
  24. 76 1
      src/main/java/com/goafanti/customer/controller/BusinessApiController.java
  25. 146 2
      src/main/java/com/goafanti/customer/controller/CustomerApiController.java
  26. 44 1
      src/main/java/com/goafanti/customer/service/BusinessService.java
  27. 35 0
      src/main/java/com/goafanti/customer/service/CustomerService.java
  28. 48 6
      src/main/java/com/goafanti/customer/service/impl/BusinessServiceImpl.java
  29. 174 14
      src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

+ 1 - 1
generatorConfig.xml

@@ -8,6 +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="organization_contact_book"/>
+    <table schema="aft" tableName="user_identity"/>
   </context>
 </generatorConfiguration>

+ 0 - 1
src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java

@@ -8,7 +8,6 @@ import java.util.TreeMap;
 
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
 
 import com.goafanti.admin.bo.AdminDetail;

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

@@ -81,7 +81,19 @@ public class AFTConstants {
 	
 	public static final String USER_TYPE_ORGANIZATION				= "1";
 	
-	public static final String SHARE_TYPE_PRIVATE					= "0";
+	public static final Integer SHARE_TYPE_PRIVATE					= 0;
 	
-	public static final String SHARE_TYPE_PUBLIC					= "1";
+	public static final Integer SHARE_TYPE_PUBLIC					= 1;
+	
+	public static final Integer USER_STATUS_NORMAL					= 0;
+	
+	public static final Integer USER_STATUS_CANCEL					= 1;
+	
+	public static final Integer USER_STATUS_LOCKING					= 2;
+	
+	public static final String USER_TRANSFER_TO_PUBLIC				= "转为公共客户";
+	
+	public static final String USER_DELETE							= "删除客户";
+	
+	public static final String USER_RECEIVE							= "领取";
 }

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

@@ -2,7 +2,6 @@ package com.goafanti.common.dao;
 
 import com.goafanti.common.model.OrganizationContactBook;
 import com.goafanti.common.model.OrganizationContactBookExample;
-import com.goafanti.customer.bo.CustomerSimpleBo;
 
 import java.util.List;
 import org.apache.ibatis.annotations.Param;
@@ -76,4 +75,6 @@ public interface OrganizationContactBookMapper {
 	 * @mbg.generated  Sun Nov 19 20:34:03 CST 2017
 	 */
 	int updateByPrimaryKey(OrganizationContactBook record);
+	
+	int checkContacts(@Param("uid")String uid,@Param("mobile")String mobile,@Param("aid")String aid);
 }

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

@@ -85,4 +85,7 @@ public interface UserBusinessMapper {
 	BussinessFollowBo findBusinessDetail(@Param("businessId")String businessId);
 
 	BussinessFollowBo findFollowOneBusiness(@Param("ufbId") String ufbId);
+	
+	int selectFollowCountByUAid(@Param("uid")String uid, @Param("aid")String aid);
+	
 }

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

@@ -12,67 +12,67 @@ import org.apache.ibatis.annotations.Param;
 public interface UserIdentityMapper {
     /**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_identity
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	long countByExample(UserIdentityExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_identity
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	int deleteByExample(UserIdentityExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_identity
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	int deleteByPrimaryKey(String id);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_identity
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	int insert(UserIdentity record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_identity
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	int insertSelective(UserIdentity record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_identity
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	List<UserIdentity> selectByExample(UserIdentityExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_identity
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	UserIdentity selectByPrimaryKey(String id);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_identity
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	int updateByExampleSelective(@Param("record") UserIdentity record, @Param("example") UserIdentityExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_identity
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	int updateByExample(@Param("record") UserIdentity record, @Param("example") UserIdentityExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_identity
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	int updateByPrimaryKeySelective(UserIdentity record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_identity
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	int updateByPrimaryKey(UserIdentity record);
 

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

@@ -117,7 +117,7 @@ public interface UserMapper {
 	 * @param name
 	 * @return
 	 */
-	int judgeCustomerByName(String name);
+	int judgeCustomerByName(@Param("identifyName")String identifyName);
 	
 	/**
 	 * 查询单位客户详情
@@ -169,4 +169,13 @@ public interface UserMapper {
 	 */
 	List<OrganizationContactBook> findAllContacts(String uid);
 
+	/**
+	 * 查询用户
+	 * @param uid
+	 * @param identifyName
+	 * @param mobile
+	 * @return
+	 */
+	List<User> checkUser(@Param("id")String id,@Param("identifyName")String identifyName, @Param("mobile")String mobile,@Param("type")Integer type);
+
 }

+ 0 - 64
src/main/java/com/goafanti/common/enums/CustomerFollowFiled.java

@@ -1,64 +0,0 @@
-package com.goafanti.common.enums;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public enum CustomerFollowFiled {
-	/**已发项目介绍资料  **/
-	FOLLOW_CREATE(0,"已发项目介绍资料"),
-	/** 已约面谈 **/
-	FOLLOW_INTERVIEW(1,"已约面谈"),
-	/** 已发合同计划书  **/
-	FOLLOW_PROSPECT_SEND(2,"已发合同计划书"),
-	/** 已报价  **/
-	FOLLOW_QUOTE(3,"已报价"),
-	/** 已发合同 **/
-	FOLLOW_CONTRACT_SEND(4,"已发合同"),
-	/** 已签合同**/
-	FOLLOW_CONTRACT_SIGN(5,"已签合同"),
-	/** 面谈中**/
-	FOLLOW_CONTRACT_INTERVIEW(6,"面谈中"),
-	/** 已面签 **/
-	FOLLOW_THE_INTERVIEW(7,"已面签"),
-	/** 无进度 **/
-	FOLLOW_NO_PROGRESS(8,"无进度"),
-	/** 未知  **/
-	OTHER(null,"未知");
-	
-	private static Map<Integer, CustomerFollowFiled> status = new HashMap<Integer, CustomerFollowFiled>();
-
-	static {
-		for (CustomerFollowFiled value : CustomerFollowFiled.values()) {
-			status.put(value.getCode(), value);
-		}
-	}
-
-	public static CustomerFollowFiled getField(Integer code) {
-		if (containsType(code)) {
-			return status.get(code);
-		}
-		return OTHER;
-	}
-
-	public static String getFieldDesc(Integer code) {
-		return getField(code).getDesc();
-	}
-
-	public static boolean containsType(Integer code) {
-		return status.containsKey(code);
-	}
-	
-	private CustomerFollowFiled(Integer code,String desc){
-		this.code = code;
-		this.desc = desc;
-	};
-	
-	private Integer code;
-	private String desc;
-	public Integer getCode() {
-		return code;
-	}
-	public String getDesc() {
-		return desc;
-	} 
-}

+ 0 - 70
src/main/java/com/goafanti/common/enums/CustomerIntentionFiled.java

@@ -1,70 +0,0 @@
-package com.goafanti.common.enums;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public enum CustomerIntentionFiled {
-	/** 发明专利 **/
-	INTENTION_INVENTION(0,"发明专利"),
-	/** 实用型新型专利 **/
-	INTENTION_PRACTICAL(1,"实用型新型专利"),
-	/** 外观专利 **/
-	INTENTION_APPEARANCE(2,"外观专利"),
-	/** 软件著作权  **/
-	INTENTION_SOFT(3,"软件著作权"),
-	/** 知识产权贯标  **/
-	INTENTION_PROPERTY(4,"知识产权贯标"),
-	/** 高企认定  **/
-	INTENTION_COGNIZANCE(5,"高企认定"),
-	/** 技术成果  **/
-	INTENTION_ACHIEVEMENT(6,"技术成果"),
-	/** 技术需求  **/
-	INTENTION_DEMAND(7,"技术需求"),
-	/** 专家咨询  **/
-	INTENTION_CONSULTATION(8,"专家咨询"),
-	/** 团单合作  **/
-	INTENTION_TEAM_COOPERATION(9,"团单合作"),
-	/** 商标 **/
-	INTENTION_BRAND(10,"商标"),
-	/** 系统集成  **/
-	INTENTION_INTEGRATION(11,"系统集成"),
-	/** 未知  **/
-	OTHER(null,"未知");
-	
-	private static Map<Integer, CustomerIntentionFiled> status = new HashMap<Integer, CustomerIntentionFiled>();
-
-	static {
-		for (CustomerIntentionFiled value : CustomerIntentionFiled.values()) {
-			status.put(value.getCode(), value);
-		}
-	}
-
-	public static CustomerIntentionFiled getField(Integer code) {
-		if (containsType(code)) {
-			return status.get(code);
-		}
-		return OTHER;
-	}
-
-	public static String getFieldDesc(Integer code) {
-		return getField(code).getDesc();
-	}
-
-	public static boolean containsType(Integer code) {
-		return status.containsKey(code);
-	}
-	
-	private CustomerIntentionFiled(Integer code,String desc){
-		this.code = code;
-		this.desc = desc;
-	};
-	private Integer code;
-	private String desc;
-	public Integer getCode() {
-		return code;
-	}
-	public String getDesc() {
-		return desc;
-	}
-	
-}

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

@@ -16,6 +16,8 @@ public enum CustomerStatusFiled {
 	STATUS_SIGN(4,"签单客户"),
 	/** 被拒绝客户 **/
 	STATUS_REFUSE(5,"被拒绝客户"),
+	/** 停止跟进 **/
+	STATUS_STOP(6,"停止跟进"),
 	/** 未知  **/
 	OTHER(-1,"未知");
 	

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

@@ -408,4 +408,15 @@
       aid = #{aid,jdbcType=VARCHAR}
     where id = #{id,jdbcType=VARCHAR}
   </update>
+  
+  <select id="checkContacts" resultType="java.lang.Integer">
+		select
+			count( 0 )
+		from
+			organization_contact_book
+		where
+			aid = #{aid,jdbcType=VARCHAR}
+			and uid = #{uid,jdbcType=VARCHAR}
+			and mobile = #{mobile,jdbcType=VARCHAR}
+  </select>
 </mapper>

+ 21 - 10
src/main/java/com/goafanti/common/mapper/UserBusinessMapper.xml

@@ -362,15 +362,18 @@
 		a.uid = b.id left join business_glossory c on
 		a.business_glossory_id = c.id left join admin d on
 		a.aid = d.id
-	where a.aid = #{aid,jdbcType=VARCHAR}
+	where 1 = 1
+	<if test="aid != null and aid != ''">
+		and a.aid = #{aid,jdbcType=VARCHAR}
+	</if>
 	<if test="uid != null and uid !=''">
 		and a.uid = #{uid,jdbcType=VARCHAR}
 	</if>
-	<if test="businessId !=null and businessId != ''">
+	<if test="businessGlossoryId !=null and businessGlossoryId != ''">
 		and a.business_glossory_id = #{businessGlossoryId,jdbcType=VARCHAR}
 	</if>
 	<if test="identifyName != null and identifyName != ''">
-		and b.identify_name = #{identifyName,jdbcType=VARCHAR}
+		and b.identify_name like concat('%', #{identifyName},'%')
 	</if>
 	<if test="followSituation != null">
 		and a.follow_situation = #{followSituation,jdbcType=INTEGER}
@@ -399,15 +402,18 @@
 		a.uid = b.id left join business_glossory c on
 		a.business_glossory_id = c.id left join admin d on
 		a.aid = d.id
-	where a.aid = #{aid,jdbcType=VARCHAR}
+	where 1 = 1
+	<if test="aid != null and aid != ''">
+		and a.aid = #{aid,jdbcType=VARCHAR}
+	</if>
 	<if test="uid != null and uid !=''">
 		and a.uid = #{uid,jdbcType=VARCHAR}
 	</if>
-	<if test="businessId !=null and businessId != ''">
-		and c.id = #{businessId,jdbcType=VARCHAR}
+	<if test="businessGlossoryId !=null and businessGlossoryId != ''">
+		and a.business_glossory_id = #{businessGlossoryId,jdbcType=VARCHAR}
 	</if>
 	<if test="identifyName != null and identifyName != ''">
-		and b.identify_name = #{identifyName,jdbcType=VARCHAR}
+		and b.identify_name like concat('%', #{identifyName},'%')
 	</if>
 	<if test="followSituation != null">
 		and a.follow_situation = #{followSituation,jdbcType=INTEGER}
@@ -432,7 +438,7 @@
   
   <select id="judgeBusiness" resultType="java.lang.Integer">
   	select count(0) from user_business where
-  	 uid = #{uid,jdbcType=VARCHAR}
+  	 uid = #{uid,jdbcType=VARCHAR} and customer_status  != 6 
   	 <if test="businessGlossoryId != null and businessGlossoryId != ''">
   	  	and business_glossory_id = #{businessGlossoryId,jdbcType=INTEGER}
   	 </if>
@@ -440,12 +446,17 @@
   	 	and aid = #{aid,jdbcType=VARCHAR}
   	 </if>
   </select>
-  
+ 
   <select id="findBusinessByUAid"  parameterType="java.lang.String" resultMap="BaseResultMap">
   	select id,uid,business_glossory_id,follow_situation,customer_status,remarks from user_business
-  	where  uid = #{uid,jdbcType=VARCHAR} and aid = #{aid,jdbcType=VARCHAR}
+  	where  uid = #{uid,jdbcType=VARCHAR} and aid = #{aid,jdbcType=VARCHAR} and  customer_status != 6
   </select>
   
+  <select id="selectFollowCountByUAid"  parameterType="java.lang.String"  resultType="java.lang.Integer">
+  	select count(0) from user_follow where uid = #{uid,jdbcType=VARCHAR} and aid = #{aid,jdbcType=VARCHAR}
+  </select>
+  
+  
   <select id="findBusinessDetail" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.BussinessFollowBo">
 	select
 		a.id as businessId,

+ 35 - 20
src/main/java/com/goafanti/common/mapper/UserIdentityMapper.xml

@@ -5,7 +5,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sun Nov 12 10:00:10 CST 2017.
+      This element was generated on Sat Nov 25 15:28:31 CST 2017.
     -->
     <id column="id" jdbcType="VARCHAR" property="id" />
     <result column="uid" jdbcType="VARCHAR" property="uid" />
@@ -38,12 +38,13 @@
     <result column="review_instructions" jdbcType="VARCHAR" property="reviewInstructions" />
     <result column="industry" jdbcType="INTEGER" property="industry" />
     <result column="contacts" jdbcType="VARCHAR" property="contacts" />
+    <result column="email" jdbcType="VARCHAR" property="email" />
   </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 Sun Nov 12 10:00:10 CST 2017.
+      This element was generated on Sat Nov 25 15:28:31 CST 2017.
     -->
     <where>
       <foreach collection="oredCriteria" item="criteria" separator="or">
@@ -77,7 +78,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sun Nov 12 10:00:10 CST 2017.
+      This element was generated on Sat Nov 25 15:28:31 CST 2017.
     -->
     <where>
       <foreach collection="example.oredCriteria" item="criteria" separator="or">
@@ -111,19 +112,19 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sun Nov 12 10:00:10 CST 2017.
+      This element was generated on Sat Nov 25 15:28:31 CST 2017.
     -->
     id, uid, username, sex, date_of_birth_year, date_of_birth_month, id_number, positive_id_url, 
     opposite_id_url, province, city, area, contact_mobile, bank_name, bank_account, bank_card_number, 
     amount_money, audit_status, process, wrong_count, payment_date, expert, celebrity, 
     international, fixed_tel, qq, postal_address, postcode, review_instructions, industry, 
-    contacts
+    contacts, email
   </sql>
   <select id="selectByExample" parameterType="com.goafanti.common.model.UserIdentityExample" resultMap="BaseResultMap">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sun Nov 12 10:00:10 CST 2017.
+      This element was generated on Sat Nov 25 15:28:31 CST 2017.
     -->
     select
     <if test="distinct">
@@ -142,7 +143,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sun Nov 12 10:00:10 CST 2017.
+      This element was generated on Sat Nov 25 15:28:31 CST 2017.
     -->
     select 
     <include refid="Base_Column_List" />
@@ -153,7 +154,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sun Nov 12 10:00:10 CST 2017.
+      This element was generated on Sat Nov 25 15:28:31 CST 2017.
     -->
     delete from user_identity
     where id = #{id,jdbcType=VARCHAR}
@@ -162,7 +163,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sun Nov 12 10:00:10 CST 2017.
+      This element was generated on Sat Nov 25 15:28:31 CST 2017.
     -->
     delete from user_identity
     <if test="_parameter != null">
@@ -173,7 +174,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sun Nov 12 10:00:10 CST 2017.
+      This element was generated on Sat Nov 25 15:28:31 CST 2017.
     -->
     insert into user_identity (id, uid, username, 
       sex, date_of_birth_year, date_of_birth_month, 
@@ -185,7 +186,7 @@
       expert, celebrity, international, 
       fixed_tel, qq, postal_address, 
       postcode, review_instructions, industry, 
-      contacts)
+      contacts, email)
     values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, 
       #{sex,jdbcType=VARCHAR}, #{dateOfBirthYear,jdbcType=VARCHAR}, #{dateOfBirthMonth,jdbcType=VARCHAR}, 
       #{idNumber,jdbcType=VARCHAR}, #{positiveIdUrl,jdbcType=VARCHAR}, #{oppositeIdUrl,jdbcType=VARCHAR}, 
@@ -196,13 +197,13 @@
       #{expert,jdbcType=INTEGER}, #{celebrity,jdbcType=INTEGER}, #{international,jdbcType=INTEGER}, 
       #{fixedTel,jdbcType=VARCHAR}, #{qq,jdbcType=VARCHAR}, #{postalAddress,jdbcType=VARCHAR}, 
       #{postcode,jdbcType=VARCHAR}, #{reviewInstructions,jdbcType=VARCHAR}, #{industry,jdbcType=INTEGER}, 
-      #{contacts,jdbcType=VARCHAR})
+      #{contacts,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.UserIdentity">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sun Nov 12 10:00:10 CST 2017.
+      This element was generated on Sat Nov 25 15:28:31 CST 2017.
     -->
     insert into user_identity
     <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -299,6 +300,9 @@
       <if test="contacts != null">
         contacts,
       </if>
+      <if test="email != null">
+        email,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -394,13 +398,16 @@
       <if test="contacts != null">
         #{contacts,jdbcType=VARCHAR},
       </if>
+      <if test="email != null">
+        #{email,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.goafanti.common.model.UserIdentityExample" resultType="java.lang.Long">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sun Nov 12 10:00:10 CST 2017.
+      This element was generated on Sat Nov 25 15:28:31 CST 2017.
     -->
     select count(*) from user_identity
     <if test="_parameter != null">
@@ -411,7 +418,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sun Nov 12 10:00:10 CST 2017.
+      This element was generated on Sat Nov 25 15:28:31 CST 2017.
     -->
     update user_identity
     <set>
@@ -508,6 +515,9 @@
       <if test="record.contacts != null">
         contacts = #{record.contacts,jdbcType=VARCHAR},
       </if>
+      <if test="record.email != null">
+        email = #{record.email,jdbcType=VARCHAR},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -517,7 +527,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sun Nov 12 10:00:10 CST 2017.
+      This element was generated on Sat Nov 25 15:28:31 CST 2017.
     -->
     update user_identity
     set id = #{record.id,jdbcType=VARCHAR},
@@ -550,7 +560,8 @@
       postcode = #{record.postcode,jdbcType=VARCHAR},
       review_instructions = #{record.reviewInstructions,jdbcType=VARCHAR},
       industry = #{record.industry,jdbcType=INTEGER},
-      contacts = #{record.contacts,jdbcType=VARCHAR}
+      contacts = #{record.contacts,jdbcType=VARCHAR},
+      email = #{record.email,jdbcType=VARCHAR}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -559,7 +570,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sun Nov 12 10:00:10 CST 2017.
+      This element was generated on Sat Nov 25 15:28:31 CST 2017.
     -->
     update user_identity
     <set>
@@ -653,6 +664,9 @@
       <if test="contacts != null">
         contacts = #{contacts,jdbcType=VARCHAR},
       </if>
+      <if test="email != null">
+        email = #{email,jdbcType=VARCHAR},
+      </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>
@@ -660,7 +674,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sun Nov 12 10:00:10 CST 2017.
+      This element was generated on Sat Nov 25 15:28:31 CST 2017.
     -->
     update user_identity
     set uid = #{uid,jdbcType=VARCHAR},
@@ -692,7 +706,8 @@
       postcode = #{postcode,jdbcType=VARCHAR},
       review_instructions = #{reviewInstructions,jdbcType=VARCHAR},
       industry = #{industry,jdbcType=INTEGER},
-      contacts = #{contacts,jdbcType=VARCHAR}
+      contacts = #{contacts,jdbcType=VARCHAR},
+      email = #{email,jdbcType=VARCHAR}
     where id = #{id,jdbcType=VARCHAR}
   </update>
  

+ 20 - 0
src/main/java/com/goafanti/common/mapper/UserMapper.xml

@@ -1406,4 +1406,24 @@
 		u.type = 0
 		limit 0,50
 	</select>
+	
+	<select id="checkUser" resultMap="BaseResultMap">
+		select
+			id
+		from
+			user
+		where 1=1
+		<if test="id != null and id != ''">
+			and id = #{id,jdbcType=VARCHAR}
+		</if>
+		<if test="identifyName != null and identifyName != ''">
+			and identify_name = #{identifyName,jdbcType=VARCHAR}
+		</if>
+		<if test="mobile != null and mobile !=''">
+			and mobile = #{mobile,jdbcType=VARCHAR}
+		</if>
+		<if test="type != null">
+			and type = #{type,jdbcType=INTEGER}
+		</if>
+	</select>
 </mapper>

+ 193 - 56
src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

@@ -3,20 +3,48 @@
 <mapper namespace="com.goafanti.common.dao.UserMapper">
 	<select id="selectPersonalCustomerList" resultType="com.goafanti.customer.bo.CustomerListOut">
 		select
-		a.id as uid,a.type,a.status, date_format(a.create_time,'%Y-%m-%d %H:%i:%s') as createTime,
-		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,
-		dg1.name as province,dg2.name as city, dg3.name as area,c.name as industry
+			a.id as uid,
+			a.type,
+			a.status, 
+			date_format(a.create_time,'%Y-%m-%d %H:%i:%s') as createTime,
+			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,
+			a.society_tag as societyTag,
+			a.share_type as shareType,
+			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,is_member
+			id,
+			type,
+			status,
+			create_time,
+			service_certification,
+			user_certification,
+			current_member_status,
+			identify_name,
+			lvl,
+			is_member,
+			society_tag,
+			share_type
 		from user
-		where type = 0
+		where type = 0  and status != 1
 		<if test="aid != null and aid !=''">
 			and aid = #{aid,jdbcType=VARCHAR}
 		</if>
+		<if test="name != null and name != ''">
+			and identify_name like concat('%',#{name},'%')
+		</if>
 		<if test="shareType != null">
 			and share_type = #{shareType,jdbcType=VARCHAR}
 		</if>
@@ -29,11 +57,17 @@
 		<if test="userCertification != null">
 			and user_certification = #{userCertification,jdbcType=INTEGER}
 		</if>
+		<if test="isMember != null">
+			and is_member = #{isMember,jdbcType=INTEGER}
+		</if>
+		<if test="lvl != null">
+			and lvl = #{lvl,jdbcType=INTEGER}
+		</if> 
 		<if test="currentMemberStatus != null">
 			and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
 		</if>
-		<if test="isMember != null">
-			and is_member = #{isMember,jdbcType=INTEGER}
+		<if test="societyTag != null and societyTag != ''">
+			and society_tag = #{societyTag,jdbcType=VARCHAR}
 		</if>
 		<if test="startDate != null and startDate != ''">
 			and create_time &gt; STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
@@ -47,16 +81,13 @@
 		left join district_glossory dg3 on b.area = dg3.id
 		left join industry_category c on b.industry = c.id
 		where 1=1
-		<if test="name != null and name !=''">
-			and b.username = #{name,jdbcType=VARCHAR}
-		</if>
 		<if test="province != null">
 			and b.province = #{province,jdbcType=INTEGER}
 		</if>
 		<if test="city != null">
-			and b.city = #{province,city=INTEGER}
+			and b.city = #{city,jdbcType=INTEGER}
 		</if>
-		<if test="province != null">
+		<if test="area != null">
 			and b.area = #{area,jdbcType=INTEGER}
 		</if>
 		<if test="industry != null">
@@ -68,6 +99,9 @@
 		<if test="celebrity != null">
 			and b.celebrity = #{celebrity,jdbcType=INTEGER}
 		</if>
+		<if test="international != null">
+			and b.international = #{international,jdbcType=INTEGER}
+		</if>
 			order by a.create_time desc 
 		 <if test="page_sql != null">
     		${page_sql}
@@ -80,10 +114,13 @@
 		(select
 		id
 		from user
-		where type = 0
+		where type = 0  and status != 1
 		<if test="aid != null and aid !=''">
 			and aid = #{aid,jdbcType=VARCHAR}
 		</if>
+		<if test="name != null and name != ''">
+			and identify_name like concat('%',#{name},'%')
+		</if>
 		<if test="shareType != null">
 			and share_type = #{shareType,jdbcType=VARCHAR}
 		</if>
@@ -96,11 +133,17 @@
 		<if test="userCertification != null">
 			and user_certification = #{userCertification,jdbcType=INTEGER}
 		</if>
+		<if test="isMember != null">
+			and is_member = #{isMember,jdbcType=INTEGER}
+		</if>
+		<if test="lvl != null">
+			and lvl = #{lvl,jdbcType=INTEGER}
+		</if> 
 		<if test="currentMemberStatus != null">
 			and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
 		</if>
-		<if test="isMember != null">
-			and is_member = #{isMember,jdbcType=INTEGER}
+		<if test="societyTag != null and societyTag != ''">
+			and society_tag = #{societyTag,jdbcType=VARCHAR}
 		</if>
 		<if test="startDate != null and startDate != ''">
 			and create_time &gt; STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
@@ -108,19 +151,16 @@
 		<if test="endDate != null and endDate != ''">
 			and create_time &lt; STR_TO_DATE(#{endDate},'%Y-%m-%d %H:%i:%s')
 		</if>
-		)as a inner join organization_identity b on a.id = b.uid
+		)as a inner join user_identity b on a.id = b.uid
 		where 1=1
-		<if test="name != null and name !=''">
-			and b.unit_name = #{name,jdbcType=VARCHAR}
-		</if>
 		<if test="province != null">
-			and b.location_province = #{province,jdbcType=INTEGER}
+			and b.province = #{province,jdbcType=INTEGER}
 		</if>
 		<if test="city != null">
-			and b.location_city = #{province,city=INTEGER}
+			and b.city = #{city,jdbcType=INTEGER}
 		</if>
-		<if test="province != null">
-			and b.location_area = #{area,jdbcType=INTEGER}
+		<if test="area != null">
+			and b.area = #{area,jdbcType=INTEGER}
 		</if>
 		<if test="industry != null">
 			and b.industry = #{industry,jdbcType=INTEGER}
@@ -131,24 +171,54 @@
 		<if test="celebrity != null">
 			and b.celebrity = #{celebrity,jdbcType=INTEGER}
 		</if>
+		<if test="international != null">
+			and b.international = #{international,jdbcType=INTEGER}
+		</if>
 	</select>
 	<select id="selectOrganizationCustomerList" resultType="com.goafanti.customer.bo.CustomerListOut">
 		select
-		a.id as uid,a.type,a.status, date_format(a.create_time,'%Y-%m-%d
-		%H:%i:%s') as createTime,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.listed,b.high_tech_zone as highTechZone,
-		dg1.name as province,dg2.name as city, dg3.name as area,c.name as industry
+			a.id as uid,
+			a.type,
+			a.status, 
+			date_format(a.create_time,'%Y-%m-%d %H:%i:%s') as createTime,
+			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,
+			a.society_tag as societyTag,
+			share_type as shareType,
+			b.contacts,
+			b.contact_mobile as contactMobile,
+			b.international,
+			b.listed,
+			b.high_tech_zone as highTechZone,
+			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,is_member
+			id,
+			type,
+			status,
+			create_time,
+			service_certification,
+			user_certification,
+			current_member_status,
+			identify_name,lvl,
+			is_member,
+			society_tag,
+			share_type
 		from user
-		where type = 1
+		where type = 1 and status != 1
 		<if test="aid != null and aid !=''">
 			and aid = #{aid,jdbcType=VARCHAR}
 		</if>
+		<if test="name != null and name != ''">
+			and identify_name like concat('%',#{name},'%')
+		</if>
 		<if test="shareType != null">
 			and share_type = #{shareType,jdbcType=VARCHAR}
 		</if>
@@ -161,11 +231,17 @@
 		<if test="userCertification != null">
 			and user_certification = #{userCertification,jdbcType=INTEGER}
 		</if>
+		<if test="isMember != null">
+			and is_member = #{isMember,jdbcType=INTEGER}
+		</if>
 		<if test="currentMemberStatus != null">
 			and current_member_status = #{currentMemberStatus,jdbcType=INTEGER}
 		</if>
-		<if test="isMember != null">
-			and is_member = #{isMember,jdbcType=INTEGER}
+		<if test="lvl != null">
+			and lvl = #{lvl,jdbcType=INTEGER}
+		</if> 
+		<if test="societyTag != null and societyTag != ''">
+			and society_tag = #{societyTag,jdbcType=VARCHAR}
 		</if>
 		<if test="startDate != null and startDate != ''">
 			and create_time &gt; STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
@@ -179,16 +255,13 @@
 		left join district_glossory dg3 on b.location_area = dg3.id
 		left join industry_category c on b.industry = c.id
 		where 1=1
-		<if test="name != null and name != ''">
-			and b.unit_name = #{name,jdbcType=VARCHAR}
-		</if>
 		<if test="province != null">
 			and b.location_province = #{province,jdbcType=INTEGER}
 		</if>
 		<if test="city != null">
-			and b.location_city = #{province,city=INTEGER}
+			and b.location_city = #{city,jdbcType=INTEGER}
 		</if>
-		<if test="province != null">
+		<if test="area != null">
 			and b.location_area = #{area,jdbcType=INTEGER}
 		</if>
 		<if test="industry != null">
@@ -200,6 +273,9 @@
 		<if test="highTechZone != null">
 			and b.high_tech_zone = #{highTechZone,jdbcType=INTEGER}
 		</if>
+		<if test="international != null">
+			and b.international = #{international,jdbcType=INTEGER}
+		</if>
 			order by a.create_time desc 
 		 <if test="page_sql != null">
     		${page_sql}
@@ -212,10 +288,13 @@
 		(select
 		id
 		from user
-		where type = 1
+		where type = 1 and status != 1
 		<if test="aid != null and aid !=''">
 			and aid = #{aid,jdbcType=VARCHAR}
 		</if>
+		<if test="name != null and name != ''">
+			and identify_name like concat('%',#{name},'%')
+		</if>
 		<if test="shareType != null">
 			and share_type = #{shareType,jdbcType=VARCHAR}
 		</if>
@@ -234,6 +313,9 @@
 		<if test="isMember != null">
 			and is_member = #{isMember,jdbcType=INTEGER}
 		</if>
+		<if test="societyTag != null and societyTag != ''">
+			and society_tag = #{societyTag,jdbcType=VARCHAR}
+		</if>
 		<if test="startDate != null and startDate != ''">
 			and create_time &gt; STR_TO_DATE(#{startDate},'%Y-%m-%d %H:%i:%s')
 		</if>
@@ -242,16 +324,13 @@
 		</if>
 		)as a inner join organization_identity b on a.id = b.uid
 		where 1=1
-		<if test="name != null and name !=''">
-			and b.unit_name = #{name,jdbcType=VARCHAR}
-		</if>
 		<if test="province != null">
 			and b.location_province = #{province,jdbcType=INTEGER}
 		</if>
 		<if test="city != null">
-			and b.location_city = #{province,city=INTEGER}
+			and b.location_city = #{city,jdbcType=INTEGER}
 		</if>
-		<if test="province != null">
+		<if test="area != null">
 			and b.location_area = #{area,jdbcType=INTEGER}
 		</if>
 		<if test="industry != null">
@@ -263,15 +342,19 @@
 		<if test="highTechZone != null">
 			and b.high_tech_zone = #{highTechZone,jdbcType=INTEGER}
 		</if>
+		<if test="international != null">
+			and b.international = #{international,jdbcType=INTEGER}
+		</if>
 	</select>
 	
 	<select id="findCustomerByName" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.CustomerSimpleBo">
 		select id,identify_name as name from user where identify_name like
-		concat('%',#{identifyName},'%')
+		concat('%',#{identifyName},'%') and status <![CDATA[!= ]]> 2
 	</select>
 	
-	<select id="judgeCustomerByName" parameterType="java.lang.String" resultType="java.lang.Integer">
-		select count(0) from user where identify_name = #{name,jdbcType=VARCHAR}
+	<select id="judgeCustomerByName" resultType="java.lang.Integer">
+		select count(0) from user where identify_name = #{identifyName,jdbcType=VARCHAR}
+		and status <![CDATA[!= ]]> 2
 	</select>
 	
 	<select id="findOrganizationCustomerDetail" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.CustomerOrganizationDetailBo">
@@ -280,7 +363,7 @@
 			a.society_tag as societyTag,
 			a.company_logo_url as companyLogoUrl,
 			a.introduction,
-			b.unit_name as unitName,
+		    a.identify_name as identifyName,
 			b.industry,
 			b.location_province as locationProvince,
 			b.location_city as locationCity,
@@ -300,14 +383,67 @@
 			b.org_code as orgCode,
 			b.org_code_url as orgCodeUrl,
 			b.business_scope as businessScope,
-			b.id
+			b.id,
+			b.contacts,
+			b.contact_mobile as contactMobile
 		from 
 		(select 
-			id,society_tag,company_logo_url,introduction
-		from user
-			where id = #{uid,jdbcType=VARCHAR}
+			id,
+			identify_name,
+			society_tag,
+			company_logo_url,
+			introduction
+		from 
+			user
+		where 
+			id = #{uid,jdbcType=VARCHAR}
 		)as a inner join organization_identity b on a.id = b.uid
 	</select>
+	
+	<select id="findPersonalCustomerDetail" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.CustomerPersonalDetailBo">
+		select
+			a.id as uid,
+			a.identify_name as identifyName,
+			a.society_tag as societyTag,
+			a.head_portrait_url as headPortraitUrl,
+			a.introduction,
+			b.id,
+			b.industry,
+			b.sex,
+			b.date_of_birth_year as dateOfBirthYear,
+			b.date_of_birth_month as dateOfBirthMonth,
+			b.id_number as idNumber,
+			b.province,
+			b.city,
+			b.area,
+			b.positive_id_url as positiveIdUrl,
+			b.opposite_id_url as oppositeIdUrl,
+			b.postal_address as postalAddress,
+			b.contact_mobile as contactMobile,
+			b.fixed_tel as fixedTel,
+			b.email,
+			b.expert,
+			b.celebrity,		
+			b.international,
+			b.contacts,
+			b.contact_mobile as contactMobile,
+			b.qq
+		from
+			(
+				select
+					id,
+					identify_name,
+					society_tag,
+					head_portrait_url,
+					introduction
+				from
+					user
+				where
+					id = #{uid,jdbcType=VARCHAR}
+			) as a inner join user_identity b on
+			a.id = b.uid	
+	</select>
+	
 	<select id="selectFollowHistoryList" resultType="com.goafanti.customer.bo.FollowListBo">
 		select 
 			a.id as followId,
@@ -426,4 +562,5 @@
 		user_follow_business a
 		where a.follow_id = #{followId,jdbcType=VARCHAR}
 	</select>
+	
 </mapper>

+ 116 - 93
src/main/java/com/goafanti/common/model/UserIdentity.java

@@ -7,164 +7,169 @@ public class UserIdentity {
 
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_identity.id
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	private String id;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_identity.uid
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	private String uid;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_identity.username
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	private String username;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_identity.sex
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	private String sex;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_identity.date_of_birth_year
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	private String dateOfBirthYear;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_identity.date_of_birth_month
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	private String dateOfBirthMonth;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_identity.id_number
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	private String idNumber;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_identity.positive_id_url
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	private String positiveIdUrl;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_identity.opposite_id_url
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	private String oppositeIdUrl;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_identity.province
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	private Integer province;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_identity.city
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	private Integer city;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_identity.area
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	private Integer area;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_identity.contact_mobile
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	private String contactMobile;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_identity.bank_name
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	private String bankName;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_identity.bank_account
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	private String bankAccount;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_identity.bank_card_number
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	private String bankCardNumber;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_identity.amount_money
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	private BigDecimal amountMoney;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_identity.audit_status
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	private Integer auditStatus;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_identity.process
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	private Integer process;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_identity.wrong_count
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	private Integer wrongCount;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_identity.payment_date
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	private Date paymentDate;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_identity.expert
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	private Integer expert;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_identity.celebrity
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	private Integer celebrity;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_identity.international
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	private Integer international;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_identity.fixed_tel
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	private String fixedTel;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_identity.qq
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	private String qq;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_identity.postal_address
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	private String postalAddress;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_identity.postcode
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	private String postcode;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_identity.review_instructions
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	private String reviewInstructions;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_identity.industry
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	private Integer industry;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_identity.contacts
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	private String contacts;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_identity.email
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
+	 */
+	private String email;
 
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_identity.id
 	 * @return  the value of user_identity.id
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public String getId() {
 		return id;
@@ -173,7 +178,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_identity.id
 	 * @param id  the value for user_identity.id
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setId(String id) {
 		this.id = id;
@@ -182,7 +187,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_identity.uid
 	 * @return  the value of user_identity.uid
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public String getUid() {
 		return uid;
@@ -191,7 +196,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_identity.uid
 	 * @param uid  the value for user_identity.uid
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setUid(String uid) {
 		this.uid = uid;
@@ -200,7 +205,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_identity.username
 	 * @return  the value of user_identity.username
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public String getUsername() {
 		return username;
@@ -209,7 +214,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_identity.username
 	 * @param username  the value for user_identity.username
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setUsername(String username) {
 		this.username = username;
@@ -218,7 +223,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_identity.sex
 	 * @return  the value of user_identity.sex
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public String getSex() {
 		return sex;
@@ -227,7 +232,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_identity.sex
 	 * @param sex  the value for user_identity.sex
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setSex(String sex) {
 		this.sex = sex;
@@ -236,7 +241,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_identity.date_of_birth_year
 	 * @return  the value of user_identity.date_of_birth_year
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public String getDateOfBirthYear() {
 		return dateOfBirthYear;
@@ -245,7 +250,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_identity.date_of_birth_year
 	 * @param dateOfBirthYear  the value for user_identity.date_of_birth_year
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setDateOfBirthYear(String dateOfBirthYear) {
 		this.dateOfBirthYear = dateOfBirthYear;
@@ -254,7 +259,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_identity.date_of_birth_month
 	 * @return  the value of user_identity.date_of_birth_month
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public String getDateOfBirthMonth() {
 		return dateOfBirthMonth;
@@ -263,7 +268,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_identity.date_of_birth_month
 	 * @param dateOfBirthMonth  the value for user_identity.date_of_birth_month
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setDateOfBirthMonth(String dateOfBirthMonth) {
 		this.dateOfBirthMonth = dateOfBirthMonth;
@@ -272,7 +277,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_identity.id_number
 	 * @return  the value of user_identity.id_number
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public String getIdNumber() {
 		return idNumber;
@@ -281,7 +286,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_identity.id_number
 	 * @param idNumber  the value for user_identity.id_number
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setIdNumber(String idNumber) {
 		this.idNumber = idNumber;
@@ -290,7 +295,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_identity.positive_id_url
 	 * @return  the value of user_identity.positive_id_url
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public String getPositiveIdUrl() {
 		return positiveIdUrl;
@@ -299,7 +304,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_identity.positive_id_url
 	 * @param positiveIdUrl  the value for user_identity.positive_id_url
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setPositiveIdUrl(String positiveIdUrl) {
 		this.positiveIdUrl = positiveIdUrl;
@@ -308,7 +313,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_identity.opposite_id_url
 	 * @return  the value of user_identity.opposite_id_url
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public String getOppositeIdUrl() {
 		return oppositeIdUrl;
@@ -317,7 +322,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_identity.opposite_id_url
 	 * @param oppositeIdUrl  the value for user_identity.opposite_id_url
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setOppositeIdUrl(String oppositeIdUrl) {
 		this.oppositeIdUrl = oppositeIdUrl;
@@ -326,7 +331,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_identity.province
 	 * @return  the value of user_identity.province
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public Integer getProvince() {
 		return province;
@@ -335,7 +340,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_identity.province
 	 * @param province  the value for user_identity.province
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setProvince(Integer province) {
 		this.province = province;
@@ -344,7 +349,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_identity.city
 	 * @return  the value of user_identity.city
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public Integer getCity() {
 		return city;
@@ -353,7 +358,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_identity.city
 	 * @param city  the value for user_identity.city
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setCity(Integer city) {
 		this.city = city;
@@ -362,7 +367,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_identity.area
 	 * @return  the value of user_identity.area
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public Integer getArea() {
 		return area;
@@ -371,7 +376,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_identity.area
 	 * @param area  the value for user_identity.area
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setArea(Integer area) {
 		this.area = area;
@@ -380,7 +385,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_identity.contact_mobile
 	 * @return  the value of user_identity.contact_mobile
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public String getContactMobile() {
 		return contactMobile;
@@ -389,7 +394,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_identity.contact_mobile
 	 * @param contactMobile  the value for user_identity.contact_mobile
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setContactMobile(String contactMobile) {
 		this.contactMobile = contactMobile;
@@ -398,7 +403,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_identity.bank_name
 	 * @return  the value of user_identity.bank_name
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public String getBankName() {
 		return bankName;
@@ -407,7 +412,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_identity.bank_name
 	 * @param bankName  the value for user_identity.bank_name
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setBankName(String bankName) {
 		this.bankName = bankName;
@@ -416,7 +421,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_identity.bank_account
 	 * @return  the value of user_identity.bank_account
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public String getBankAccount() {
 		return bankAccount;
@@ -425,7 +430,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_identity.bank_account
 	 * @param bankAccount  the value for user_identity.bank_account
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setBankAccount(String bankAccount) {
 		this.bankAccount = bankAccount;
@@ -434,7 +439,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_identity.bank_card_number
 	 * @return  the value of user_identity.bank_card_number
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public String getBankCardNumber() {
 		return bankCardNumber;
@@ -443,7 +448,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_identity.bank_card_number
 	 * @param bankCardNumber  the value for user_identity.bank_card_number
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setBankCardNumber(String bankCardNumber) {
 		this.bankCardNumber = bankCardNumber;
@@ -452,7 +457,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_identity.amount_money
 	 * @return  the value of user_identity.amount_money
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public BigDecimal getAmountMoney() {
 		return amountMoney;
@@ -461,7 +466,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_identity.amount_money
 	 * @param amountMoney  the value for user_identity.amount_money
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setAmountMoney(BigDecimal amountMoney) {
 		this.amountMoney = amountMoney;
@@ -470,7 +475,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_identity.audit_status
 	 * @return  the value of user_identity.audit_status
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public Integer getAuditStatus() {
 		return auditStatus;
@@ -479,7 +484,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_identity.audit_status
 	 * @param auditStatus  the value for user_identity.audit_status
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setAuditStatus(Integer auditStatus) {
 		this.auditStatus = auditStatus;
@@ -488,7 +493,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_identity.process
 	 * @return  the value of user_identity.process
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public Integer getProcess() {
 		return process;
@@ -497,7 +502,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_identity.process
 	 * @param process  the value for user_identity.process
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setProcess(Integer process) {
 		this.process = process;
@@ -506,7 +511,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_identity.wrong_count
 	 * @return  the value of user_identity.wrong_count
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public Integer getWrongCount() {
 		return wrongCount;
@@ -515,7 +520,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_identity.wrong_count
 	 * @param wrongCount  the value for user_identity.wrong_count
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setWrongCount(Integer wrongCount) {
 		this.wrongCount = wrongCount;
@@ -524,7 +529,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_identity.payment_date
 	 * @return  the value of user_identity.payment_date
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public Date getPaymentDate() {
 		return paymentDate;
@@ -533,7 +538,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_identity.payment_date
 	 * @param paymentDate  the value for user_identity.payment_date
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setPaymentDate(Date paymentDate) {
 		this.paymentDate = paymentDate;
@@ -542,7 +547,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_identity.expert
 	 * @return  the value of user_identity.expert
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public Integer getExpert() {
 		return expert;
@@ -551,7 +556,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_identity.expert
 	 * @param expert  the value for user_identity.expert
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setExpert(Integer expert) {
 		this.expert = expert;
@@ -560,7 +565,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_identity.celebrity
 	 * @return  the value of user_identity.celebrity
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public Integer getCelebrity() {
 		return celebrity;
@@ -569,7 +574,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_identity.celebrity
 	 * @param celebrity  the value for user_identity.celebrity
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setCelebrity(Integer celebrity) {
 		this.celebrity = celebrity;
@@ -578,7 +583,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_identity.international
 	 * @return  the value of user_identity.international
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public Integer getInternational() {
 		return international;
@@ -587,7 +592,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_identity.international
 	 * @param international  the value for user_identity.international
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setInternational(Integer international) {
 		this.international = international;
@@ -596,7 +601,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_identity.fixed_tel
 	 * @return  the value of user_identity.fixed_tel
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public String getFixedTel() {
 		return fixedTel;
@@ -605,7 +610,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_identity.fixed_tel
 	 * @param fixedTel  the value for user_identity.fixed_tel
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setFixedTel(String fixedTel) {
 		this.fixedTel = fixedTel;
@@ -614,7 +619,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_identity.qq
 	 * @return  the value of user_identity.qq
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public String getQq() {
 		return qq;
@@ -623,7 +628,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_identity.qq
 	 * @param qq  the value for user_identity.qq
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setQq(String qq) {
 		this.qq = qq;
@@ -632,7 +637,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_identity.postal_address
 	 * @return  the value of user_identity.postal_address
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public String getPostalAddress() {
 		return postalAddress;
@@ -641,7 +646,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_identity.postal_address
 	 * @param postalAddress  the value for user_identity.postal_address
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setPostalAddress(String postalAddress) {
 		this.postalAddress = postalAddress;
@@ -650,7 +655,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_identity.postcode
 	 * @return  the value of user_identity.postcode
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public String getPostcode() {
 		return postcode;
@@ -659,7 +664,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_identity.postcode
 	 * @param postcode  the value for user_identity.postcode
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setPostcode(String postcode) {
 		this.postcode = postcode;
@@ -668,7 +673,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_identity.review_instructions
 	 * @return  the value of user_identity.review_instructions
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public String getReviewInstructions() {
 		return reviewInstructions;
@@ -677,7 +682,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_identity.review_instructions
 	 * @param reviewInstructions  the value for user_identity.review_instructions
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setReviewInstructions(String reviewInstructions) {
 		this.reviewInstructions = reviewInstructions;
@@ -686,7 +691,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_identity.industry
 	 * @return  the value of user_identity.industry
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public Integer getIndustry() {
 		return industry;
@@ -695,7 +700,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_identity.industry
 	 * @param industry  the value for user_identity.industry
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setIndustry(Integer industry) {
 		this.industry = industry;
@@ -704,7 +709,7 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_identity.contacts
 	 * @return  the value of user_identity.contacts
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public String getContacts() {
 		return contacts;
@@ -713,9 +718,27 @@ public class UserIdentity {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_identity.contacts
 	 * @param contacts  the value for user_identity.contacts
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setContacts(String contacts) {
 		this.contacts = contacts;
 	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_identity.email
+	 * @return  the value of user_identity.email
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
+	 */
+	public String getEmail() {
+		return email;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_identity.email
+	 * @param email  the value for user_identity.email
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
+	 */
+	public void setEmail(String email) {
+		this.email = email;
+	}
 }

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

@@ -8,23 +8,23 @@ import java.util.List;
 public class UserIdentityExample {
     /**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table user_identity
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	protected String orderByClause;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table user_identity
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	protected boolean distinct;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table user_identity
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	protected List<Criteria> oredCriteria;
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_identity
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public UserIdentityExample() {
 		oredCriteria = new ArrayList<Criteria>();
@@ -32,7 +32,7 @@ public class UserIdentityExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_identity
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setOrderByClause(String orderByClause) {
 		this.orderByClause = orderByClause;
@@ -40,7 +40,7 @@ public class UserIdentityExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_identity
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public String getOrderByClause() {
 		return orderByClause;
@@ -48,7 +48,7 @@ public class UserIdentityExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_identity
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void setDistinct(boolean distinct) {
 		this.distinct = distinct;
@@ -56,7 +56,7 @@ public class UserIdentityExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_identity
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public boolean isDistinct() {
 		return distinct;
@@ -64,7 +64,7 @@ public class UserIdentityExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_identity
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public List<Criteria> getOredCriteria() {
 		return oredCriteria;
@@ -72,7 +72,7 @@ public class UserIdentityExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_identity
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void or(Criteria criteria) {
 		oredCriteria.add(criteria);
@@ -80,7 +80,7 @@ public class UserIdentityExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_identity
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public Criteria or() {
 		Criteria criteria = createCriteriaInternal();
@@ -90,7 +90,7 @@ public class UserIdentityExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_identity
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public Criteria createCriteria() {
 		Criteria criteria = createCriteriaInternal();
@@ -102,7 +102,7 @@ public class UserIdentityExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_identity
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	protected Criteria createCriteriaInternal() {
 		Criteria criteria = new Criteria();
@@ -111,7 +111,7 @@ public class UserIdentityExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_identity
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public void clear() {
 		oredCriteria.clear();
@@ -121,7 +121,7 @@ public class UserIdentityExample {
 
 	/**
 	 * This class was generated by MyBatis Generator. This class corresponds to the database table user_identity
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	protected abstract static class GeneratedCriteria {
 		protected List<Criterion> criteria;
@@ -2213,11 +2213,81 @@ public class UserIdentityExample {
 			addCriterion("contacts not between", value1, value2, "contacts");
 			return (Criteria) this;
 		}
+
+		public Criteria andEmailIsNull() {
+			addCriterion("email is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andEmailIsNotNull() {
+			addCriterion("email is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andEmailEqualTo(String value) {
+			addCriterion("email =", value, "email");
+			return (Criteria) this;
+		}
+
+		public Criteria andEmailNotEqualTo(String value) {
+			addCriterion("email <>", value, "email");
+			return (Criteria) this;
+		}
+
+		public Criteria andEmailGreaterThan(String value) {
+			addCriterion("email >", value, "email");
+			return (Criteria) this;
+		}
+
+		public Criteria andEmailGreaterThanOrEqualTo(String value) {
+			addCriterion("email >=", value, "email");
+			return (Criteria) this;
+		}
+
+		public Criteria andEmailLessThan(String value) {
+			addCriterion("email <", value, "email");
+			return (Criteria) this;
+		}
+
+		public Criteria andEmailLessThanOrEqualTo(String value) {
+			addCriterion("email <=", value, "email");
+			return (Criteria) this;
+		}
+
+		public Criteria andEmailLike(String value) {
+			addCriterion("email like", value, "email");
+			return (Criteria) this;
+		}
+
+		public Criteria andEmailNotLike(String value) {
+			addCriterion("email not like", value, "email");
+			return (Criteria) this;
+		}
+
+		public Criteria andEmailIn(List<String> values) {
+			addCriterion("email in", values, "email");
+			return (Criteria) this;
+		}
+
+		public Criteria andEmailNotIn(List<String> values) {
+			addCriterion("email not in", values, "email");
+			return (Criteria) this;
+		}
+
+		public Criteria andEmailBetween(String value1, String value2) {
+			addCriterion("email between", value1, value2, "email");
+			return (Criteria) this;
+		}
+
+		public Criteria andEmailNotBetween(String value1, String value2) {
+			addCriterion("email not between", value1, value2, "email");
+			return (Criteria) this;
+		}
 	}
 
 	/**
 	 * This class was generated by MyBatis Generator. This class corresponds to the database table user_identity
-	 * @mbg.generated  Sun Nov 12 10:00:10 CST 2017
+	 * @mbg.generated  Sat Nov 25 15:28:31 CST 2017
 	 */
 	public static class Criterion {
 		private String condition;

+ 55 - 29
src/main/java/com/goafanti/common/utils/ExcelUtils.java

@@ -5,56 +5,74 @@ import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.text.DecimalFormat;
-import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
-import java.util.TreeSet;
+import java.util.regex.Pattern;
 
 import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.CellType;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.xssf.usermodel.XSSFSheet;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import com.goafanti.customer.bo.CustomerExcelBo;
 
 public class ExcelUtils {
-	private Set<Integer> repeatRows = new TreeSet<Integer>(); //数据重复
-	private Set<Integer> vacantRows = new TreeSet<Integer>(); //数据不完整的
+	private Set<Integer> vacantRows = new HashSet<Integer>(); //数据不完整
+	private final String DEFAULT_MOBILE = "0000-0000000";
 	DecimalFormat df = new DecimalFormat("0");  
-	@SuppressWarnings({ "unused", "resource" })
-	public  List<CustomerExcelBo> parseExcel(String excelPath) throws IOException{
+	@SuppressWarnings ("resource")
+	public  Set<CustomerExcelBo> parseExcel(String excelPath) throws IOException{
 		InputStream excelFile = new FileInputStream(new File(excelPath));
 		XSSFWorkbook wb = new XSSFWorkbook(excelFile);	
-		List<CustomerExcelBo> result = new ArrayList<CustomerExcelBo>();
+		Set<CustomerExcelBo> result = new HashSet<CustomerExcelBo>();
 		XSSFSheet sheet = wb.getSheetAt(0);
 		Iterator<Row> rowIterator = sheet.iterator();
-		Row currentRow = rowIterator.next(); //表头
-		int rowNumber = 1;		
-		while(rowIterator.hasNext()){
+		Row currentRow = sheet.getRow(1); //表头
+		Cell configCell = currentRow.getCell(1); //配置
+		int totalNumber = 2;
+		if(configCell.getCellTypeEnum() == CellType.NUMERIC){
+			totalNumber = Integer.valueOf(df.format(configCell.getNumericCellValue()));
+		}else if(configCell.getCellTypeEnum() == CellType.STRING){
+			totalNumber = Integer.valueOf(configCell.getStringCellValue());
+		}
+		int rowNumber = 2;
+		rowIterator.next();
+		rowIterator.next();
+		while(rowIterator.hasNext() && rowNumber < totalNumber){
 			rowNumber++;
-			System.out.println(rowNumber);
 			currentRow = rowIterator.next();
 			Iterator<Cell> cellIterator = currentRow.iterator();
-			CustomerExcelBo cin = new CustomerExcelBo();
-			
-			result.add(cin);
+			CustomerExcelBo bo = new CustomerExcelBo();
+			bo.setCustomerType(checkCustomerType(cellIterator.next().getStringCellValue(), rowNumber));
+			bo.setIdentifyName(checkOther(cellIterator.next().getStringCellValue(),rowNumber,64));
+			bo.setFollowSituation(checkFollowSituation(cellIterator.next().getStringCellValue(), rowNumber));
+			bo.setCustomerStatus(checkCustomerStatus(cellIterator.next().getStringCellValue(), rowNumber));
+			bo.setBusinessGlossoryId(checkCustomerIntention(cellIterator.next().getStringCellValue(), rowNumber));
+			bo.setContacts(checkOther(cellIterator.next().getStringCellValue(),rowNumber,32));
+			Cell phoneCell = cellIterator.next();
+			if(phoneCell.getCellTypeEnum() == CellType.NUMERIC) {
+				bo.setMobile(checkMobile(df.format(phoneCell.getNumericCellValue()), rowNumber));
+			}else if(phoneCell.getCellTypeEnum() == CellType.STRING){
+				bo.setMobile(checkMobile(phoneCell.getStringCellValue(), rowNumber));
+			}
+			bo.setRowNumber(rowNumber);
+			result.add(bo);
 		}
 		return result;
 	}
 	
-	@SuppressWarnings("unused")
 	private String checkCustomerType(String customerType,int rowNumber){
 		if(StringUtils.isEmpty(customerType)) {
 			vacantRows.add(rowNumber);
 			return "";
 		}
 		if(customerType.equals("个人客户")) return "0"; 
-		if(customerType.equals("公司客户")) return "1";
-		if(customerType.equals("团体客户")) return "2";
+		if(customerType.equals("单位客户")) return "1";
 		vacantRows.add(rowNumber);
 		return "";
 	}
-	@SuppressWarnings("unused")
 	private String checkFollowSituation(String followSituation,int rowNumber){
 		if(StringUtils.isEmpty(followSituation)){
 			vacantRows.add(rowNumber);
@@ -72,7 +90,6 @@ public class ExcelUtils {
 		vacantRows.add(rowNumber);
 		return "";
 	}
-	@SuppressWarnings("unused")
 	private String checkCustomerStatus(String customerStatus,int rowNumber){
 		if(StringUtils.isEmpty(customerStatus)) {
 			vacantRows.add(rowNumber);
@@ -84,6 +101,7 @@ public class ExcelUtils {
 		if(customerStatus.equals("面谈客户")) return "3";
 		if(customerStatus.equals("签单客户")) return "4";
 		if(customerStatus.equals("被拒绝客户")) return "5";
+		if(customerStatus.equals("停止跟进")) return "6";
 		vacantRows.add(rowNumber);
 		return "";
 	}
@@ -93,8 +111,7 @@ public class ExcelUtils {
 
 		return flag;
 	}
-	@SuppressWarnings("unused")
-	private String checkCompanyIntention(String companyIntention,int rowNumber){
+	private String checkCustomerIntention(String companyIntention,int rowNumber){
 		if(StringUtils.isEmpty(companyIntention)){
 			vacantRows.add(rowNumber);
 			return "";
@@ -115,9 +132,8 @@ public class ExcelUtils {
 		return "";
 	}
 	
-	@SuppressWarnings("unused")
-	private String checkOther(String cellValue,int rowNumber){
-		if(StringUtils.isEmpty(cellValue)){
+	private String checkOther(String cellValue,int rowNumber,int maxLength){
+		if(StringUtils.isBlank(cellValue) || cellValue.length() > maxLength){
 			vacantRows.add(rowNumber);
 			return "";
 		}else{
@@ -125,11 +141,16 @@ public class ExcelUtils {
 		} 
 	}
 
-	public String getRepeatRows(){
-		if(repeatRows.size()>0)
-			return StringUtils.join(repeatRows.toArray(),",")+ " 行数据重复;";
-		else 
+	public String checkMobile(String mobile, int rowNumber){
+		String mobileRegex = "^1[3|4|5|7|8][0-9]{9}$"; 
+		String telRegex = "^\\d{3,4}-\\d{7,8}$";
+		if(StringUtils.isBlank(mobile)) return "";
+		if(DEFAULT_MOBILE.equals(mobile)) return mobile;
+		if(!Pattern.matches(mobileRegex, mobile) && !Pattern.matches(telRegex, mobile)){
+			vacantRows.add(rowNumber);
 			return "";
+		}
+		return mobile;
 	}
 	
 	public String getVacantRows(){
@@ -138,5 +159,10 @@ public class ExcelUtils {
 		else 
 			return "";
 	}
-
+	
+	public static void main(String[] args) {
+		ExcelUtils utils = new ExcelUtils();
+		String s = utils.checkMobile("18320746285", 1);
+		System.out.println(s);
+	}
 }

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

@@ -1,5 +1,116 @@
 package com.goafanti.customer.bo;
 
 public class CustomerExcelBo {
-
+	/** 营销员ID **/
+	private String aid;
+	/** 营销员姓名 **/
+	private String adminName;
+	/** 客户类型 **/
+	private String customerType;
+	/** 客户ID **/
+	private String uid;
+	/** 客户名 **/
+	private String identifyName;
+	/** 跟进状态 **/
+	private String followSituation;
+	/** 客户状态 **/
+	private String customerStatus;
+	/** 意向服务ID **/
+	private String businessGlossoryId;
+	/** 客户意向 **/
+	private String customerIntention;
+	/** 联系人 **/
+	private String contacts;
+	/** 联系号码 **/
+	private String mobile;
+	/** 行号 **/
+	private int rowNumber;
+	
+	public String getAid() {
+		return aid;
+	}
+	public void setAid(String aid) {
+		this.aid = aid;
+	}
+	public String getAdminName() {
+		return adminName;
+	}
+	public void setAdminName(String adminName) {
+		this.adminName = adminName;
+	}
+	public String getCustomerType() {
+		return customerType;
+	}
+	public void setCustomerType(String customerType) {
+		this.customerType = customerType;
+	}
+	public String getUid() {
+		return uid;
+	}
+	public void setUid(String uid) {
+		this.uid = uid;
+	}
+	public String getIdentifyName() {
+		return identifyName;
+	}
+	public void setIdentifyName(String identifyName) {
+		this.identifyName = identifyName;
+	}
+	public String getFollowSituation() {
+		return followSituation;
+	}
+	public void setFollowSituation(String followSituation) {
+		this.followSituation = followSituation;
+	}
+	public String getCustomerStatus() {
+		return customerStatus;
+	}
+	public void setCustomerStatus(String customerStatus) {
+		this.customerStatus = customerStatus;
+	}
+	public String getBusinessGlossoryId() {
+		return businessGlossoryId;
+	}
+	public void setBusinessGlossoryId(String businessGlossoryId) {
+		this.businessGlossoryId = businessGlossoryId;
+	}
+	public String getCustomerIntention() {
+		return customerIntention;
+	}
+	public void setCustomerIntention(String customerIntention) {
+		this.customerIntention = customerIntention;
+	}
+	public String getContacts() {
+		return contacts;
+	}
+	public void setContacts(String contacts) {
+		this.contacts = contacts;
+	}
+	public String getMobile() {
+		return mobile;
+	}
+	public void setMobile(String mobile) {
+		this.mobile = mobile;
+	}
+	public int getRowNumber() {
+		return rowNumber;
+	}
+	public void setRowNumber(int rowNumber) {
+		this.rowNumber = rowNumber;
+	}
+	
+	@Override
+	public boolean equals(Object obj) {
+		if(!(obj instanceof CustomerExcelBo)) return false;
+		CustomerExcelBo bo = (CustomerExcelBo)obj;
+		if(this.identifyName.equals(bo.getIdentifyName()) && this.businessGlossoryId.equals(bo.getBusinessGlossoryId()))
+			return true;
+		else 
+			return false;
+	}
+	@Override
+	public int hashCode() {
+		return (this.identifyName+";"+this.businessGlossoryId).hashCode();
+	}
+	
 }

+ 11 - 0
src/main/java/com/goafanti/customer/bo/CustomerListIn.java

@@ -71,6 +71,9 @@ public class CustomerListIn {
 	/** 是否会员 **/
 	private String isMember;
 	
+	/** 社会性质 **/
+	private String societyTag;
+	
 	public String getType() {
 		return type;
 	}
@@ -254,4 +257,12 @@ public class CustomerListIn {
 	public void setIsMember(String isMember) {
 		this.isMember = isMember;
 	}
+
+	public String getSocietyTag() {
+		return societyTag;
+	}
+
+	public void setSocietyTag(String societyTag) {
+		this.societyTag = societyTag;
+	}
 }

+ 7 - 0
src/main/java/com/goafanti/customer/bo/CustomerOrganizationDetailBo.java

@@ -3,9 +3,16 @@ package com.goafanti.customer.bo;
 import com.goafanti.common.model.OrganizationIdentity;
 
 public class CustomerOrganizationDetailBo extends OrganizationIdentity{
+	private String identifyName;
 	private String societyTag;
 	private String companyLogoUrl;
 	private String introduction;
+	public String getIdentifyName() {
+		return identifyName;
+	}
+	public void setIdentifyName(String identifyName) {
+		this.identifyName = identifyName;
+	}
 	public String getSocietyTag() {
 		return societyTag;
 	}

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

@@ -3,5 +3,32 @@ package com.goafanti.customer.bo;
 import com.goafanti.common.model.UserIdentity;
 
 public class CustomerPersonalDetailBo extends UserIdentity{
-	
+	private String identifyName;
+	private String societyTag;
+	private String headPortraitUrl;
+	private String introduction;
+	public String getIdentifyName() {
+		return identifyName;
+	}
+	public void setIdentifyName(String identifyName) {
+		this.identifyName = identifyName;
+	}
+	public String getSocietyTag() {
+		return societyTag;
+	}
+	public void setSocietyTag(String societyTag) {
+		this.societyTag = societyTag;
+	}
+	public String getHeadPortraitUrl() {
+		return headPortraitUrl;
+	}
+	public void setHeadPortraitUrl(String headPortraitUrl) {
+		this.headPortraitUrl = headPortraitUrl;
+	}
+	public String getIntroduction() {
+		return introduction;
+	}
+	public void setIntroduction(String introduction) {
+		this.introduction = introduction;
+	}
 }

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

@@ -8,7 +8,7 @@ public class FollowListBo {
 	private String followTime;
 	
 	/** 客户名 **/
-	private String identityName;
+	private String identifyName;
 	
 	/** 联系人 **/
 	private String contacts;
@@ -46,11 +46,11 @@ public class FollowListBo {
 	public void setFollowTime(String followTime) {
 		this.followTime = followTime;
 	}
-	public String getIdentityName() {
-		return identityName;
+	public String getIdentifyName() {
+		return identifyName;
 	}
-	public void setIdentityName(String identityName) {
-		this.identityName = identityName;
+	public void setIdentifyName(String identifyName) {
+		this.identifyName = identifyName;
 	}
 	public String getContacts() {
 		return contacts;

+ 76 - 1
src/main/java/com/goafanti/customer/controller/BusinessApiController.java

@@ -15,6 +15,7 @@ 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.OrganizationContactBook;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.customer.bo.BusinessListBo;
@@ -27,7 +28,7 @@ public class BusinessApiController extends BaseController{
 	@Resource
 	private BusinessService businessService;
 	
-	/** 查询业务列表 **/
+	/** 查询我的业务列表 **/
 	@RequestMapping(value = "/listBusiness", method = RequestMethod.POST)
 	public Result listBusiness(BusinessListBo blo,Integer pageNo, Integer pageSize){
 		Result res = new Result();
@@ -35,6 +36,14 @@ public class BusinessApiController extends BaseController{
 		return res;
 	}
 	
+	/** 查询所有的业务列表 **/
+	@RequestMapping(value = "/listAllBusiness", method = RequestMethod.POST)
+	public Result listAllBusiness(BusinessListBo blo,Integer pageNo, Integer pageSize){
+		Result res = new Result();
+		res.setData(businessService.listAllBusiness(blo, pageNo, pageSize));
+		return res;
+	}
+	
 	/** 查询业务字典 **/
 	@RequestMapping(value = "/findBusinessGlossory",method = RequestMethod.GET)
 	public Result findBusinessGlossory(){
@@ -138,8 +147,74 @@ public class BusinessApiController extends BaseController{
 		Result res = new Result();
 		if(StringUtils.isBlank(bfb.getFollowId()) || StringUtils.isBlank(bfb.getUfbId())){
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,""));
+			return res;
 		}
 		businessService.updateFollowOneBusiness(bfb);
 		return res;
 	}
+	
+	/** 删除某个客户一个业务的当次拜访 **/
+	@RequestMapping(value = "/deleteFollowOneBusiness", method = RequestMethod.GET)
+	public Result deleteFollowOneBusiness(String ufbId){
+		Result res = new Result();
+		if(StringUtils.isBlank(ufbId)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,""));
+			return res;
+		}
+		businessService.deleteFollowOneBusiness(ufbId);
+		return res;
+	}
+	
+	/** 添加单个联系人 **/
+	@RequestMapping(value = "/addOneContact", method = RequestMethod.POST)
+	public Result addOneContact(OrganizationContactBook ocb){
+		Result res = new Result();
+		if(StringUtils.isBlank(ocb.getUid())){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,""));
+			return res;
+		}
+		if(StringUtils.isBlank(ocb.getName()) || StringUtils.isBlank(ocb.getMobile())){
+			res.getError().add(buildError("联系人号码和联系人姓名不能为空"));
+			return res;
+		}
+		businessService.addOneContact(ocb);
+		return res;
+	}
+	
+	/** 删除单个联系人 **/
+	@RequestMapping(value = "/deleteOneContact", method = RequestMethod.GET)
+	public Result deleteOneContact(String ocbId){
+		Result res = new Result();
+		if(StringUtils.isBlank(ocbId)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,""));
+			return res;
+		}
+		businessService.delete(ocbId);
+		return res;
+	}
+	
+	/** 删除 业务 **/
+	@RequestMapping(value = "/deleteBusiness", method =RequestMethod.GET)
+	public Result deleteBusiness(String businessId){
+		Result res = new Result();
+		if(StringUtils.isBlank(businessId)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,""));
+			return res;
+		}
+		businessService.deleteBusiness(businessId);
+		return res;
+	}
+	
+	/** 停止业务 **/
+	@RequestMapping(value = "/stopBusiness", method = RequestMethod.GET)
+	public Result stopBusiness(String businessId){
+		Result res = new Result();
+		if(StringUtils.isBlank(businessId)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,""));
+			return res;
+		}
+		businessService.updateBusinessToStop(businessId);
+		return res;
+	}
+	
 }

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

@@ -1,33 +1,45 @@
 package com.goafanti.customer.controller;
 
+import java.io.IOException;
 import java.lang.reflect.InvocationTargetException;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
 
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
+import com.goafanti.admin.service.AftFileService;
+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.controller.BaseApiController;
 import com.goafanti.common.error.BusinessException;
+import com.goafanti.common.model.AftFile;
 import com.goafanti.common.model.OrganizationContactBook;
 import com.goafanti.common.model.User;
 import com.goafanti.common.model.UserBusiness;
 import com.goafanti.common.utils.BeanUtilsExt;
+import com.goafanti.common.utils.ExcelUtils;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.customer.bo.CustomerExcelBo;
 import com.goafanti.customer.bo.CustomerListIn;
 import com.goafanti.customer.bo.CustomerOrganizationDetailBo;
+import com.goafanti.customer.bo.CustomerPersonalDetailBo;
 import com.goafanti.customer.bo.FollowBusinessBo;
 import com.goafanti.customer.bo.UserDetailBo;
 import com.goafanti.customer.service.BusinessService;
@@ -35,11 +47,16 @@ import com.goafanti.customer.service.CustomerService;
 
 @RestController
 @RequestMapping("api/admin/customer")
-public class CustomerApiController extends BaseController{
+public class CustomerApiController extends BaseApiController{
 	@Resource
 	private CustomerService customerService;
 	@Resource
 	private BusinessService businessService;
+	@Resource
+	private AftFileService aftFileService;
+	@Value(value = "${upload.private.path}")
+	private String	uploadPrivatePath	= null;
+	
 	/** 私有个人客户列表 **/
 	@RequestMapping(value = "/listPrivatePersonalCustomer" , method = RequestMethod.POST)
 	public Result listPrivatePersonalCustomer(CustomerListIn cli,Integer pageNo, Integer pageSize){
@@ -103,6 +120,11 @@ public class CustomerApiController extends BaseController{
 	@RequestMapping(value = "/addCustomer", method = RequestMethod.POST)
 	public Result addCustomer(String name,String contacts,String contactMobile,String type,String societyTag) throws Exception{
 		Result res = new Result();
+		if(StringUtils.isBlank(name) || StringUtils.isBlank(contacts)
+				|| StringUtils.isBlank(contactMobile) || StringUtils.isBlank(societyTag)){
+			res.getError().add(buildError("客户名称、联系人、联系电话、社会性质不能为空"));
+			return res;
+		}
 		customerService.addCustomer(name, contacts, contactMobile, Integer.parseInt(type),societyTag);
 		return res;
 	}
@@ -135,6 +157,18 @@ public class CustomerApiController extends BaseController{
 		return res;
 	}
 	
+	/** 修改个人客户信息 **/
+	@RequestMapping(value = "/updatePersonalCustomer", method = RequestMethod.POST)
+	public Result updatePersonalCustomer(CustomerPersonalDetailBo bo){
+		Result res = new Result();
+		if(StringUtils.isBlank(bo.getUid()) || StringUtils.isBlank(bo.getId())){
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR,""));
+			return res;
+		}
+		customerService.updatePersonalCustomer(bo);
+		return res;
+	}
+	
 	/** 查看跟进记录 **/
 	@RequestMapping(value = "/listFollowHistory", method = RequestMethod.GET)
 	public Result listFollowHistory(Integer pageNo, Integer pageSize,String uid,String businessGlossoryId){
@@ -278,6 +312,18 @@ public class CustomerApiController extends BaseController{
 		return res;
 	}
 	
+	/** 删除跟进记录 **/
+	@RequestMapping(value = "/deleteFollow", method = RequestMethod.GET)
+	public Result deleteFollow(String followId){
+		Result res = new Result();
+		if(StringUtils.isBlank(followId)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, ""));
+			return res;
+		}
+		customerService.deleteFollow(followId);
+		return res;
+	}
+	
 	/** 查询客户的所有联系人 **/ 
 	@RequestMapping(value = "/findAllContacts", method = RequestMethod.GET)
 	public Result findAllContacts(String uid){
@@ -311,4 +357,102 @@ public class CustomerApiController extends BaseController{
 		customerService.updateCustomerContacts(ocbList,uid);
 		return res;
 	}
+	
+	/** 领取客户 **/
+	@RequestMapping(value = "/receiveCustomer", method = RequestMethod.GET)
+	public Result receiveCustomer(String uid){
+		Result res = new Result();
+		if(StringUtils.isBlank(uid)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, ""));
+			return res;
+		}
+		customerService.updateByOperatorType(uid, AFTConstants.USER_RECEIVE);
+		return res;
+	}
+
+	/** 删除客户 **/
+	@RequestMapping(value = "/deleteCustomer", method = RequestMethod.GET)
+	public Result deleteCustomer(String uid){
+		Result res = new Result();
+		if(StringUtils.isBlank(uid)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, ""));
+			return res;
+		}
+		customerService.updateByOperatorType(uid, AFTConstants.USER_DELETE);
+		return res;
+	}
+	
+	/**
+	 * 上传excel文档
+	 * @param req
+	 * @return
+	 */
+	@RequestMapping(value = "/uploadExcel",method = RequestMethod.POST)
+	public Result uploadExcel(HttpServletRequest req){
+		Result res = new Result();
+		String excelPath = handleFile(res, "/customer_sys_file/", true, req, "");
+		ExcelUtils utils = new ExcelUtils();
+			Set<CustomerExcelBo> boSet;
+			try {
+				boSet = utils.parseExcel(uploadPrivatePath + excelPath);
+				String errorMessage = "";
+				if(boSet.size()>100)	errorMessage += "导入数据不能超过一百条;";
+				errorMessage += utils.getVacantRows();
+				if(StringUtils.isNotBlank(errorMessage)) {
+					res.getError().add(new Error(errorMessage));
+					return res;
+				}
+				Set<Integer> existRows = new TreeSet<Integer>();
+				customerService.checkCustomer(boSet,existRows);
+				if(existRows.size()>0){
+					errorMessage = StringUtils.join(existRows.toArray(),",")+ " 行客户业务已存在;";
+					res.getError().add(new Error(errorMessage));
+					return res;
+				}
+				customerService.saveUploadData(boSet);
+			} catch (IOException e) {
+				e.printStackTrace();
+			}	
+		return res;
+	}
+	/**
+	 * 下载科技成果批量导入Excel模板
+	 */
+	@RequestMapping(value = "/downloadTemplate", method = RequestMethod.GET)
+	public Result downloadTemplateFile(HttpServletResponse response,String type) {
+			Result res = new Result();
+			if(AFTConstants.USER_TYPE_ORGANIZATION.equals(type)){
+				AftFile af = aftFileService.selectAftFileBySign("organization_customer_template");
+				if (null == af) {
+					res.getError().add(buildError(ErrorConstants.FILE_NON_EXISTENT, "", "找不到文件!"));
+				} else {
+					String path = af.getFilePath();
+					String suffix = path.substring(path.lastIndexOf("."));
+					String fileName = af.getFileName() + suffix;
+					downloadFile(response, fileName, path);
+				}
+			}else if(AFTConstants.USER_TYPE_PERSONAL.equals(type)){
+				AftFile af = aftFileService.selectAftFileBySign("personal_customer_template");
+				if (null == af) {
+					res.getError().add(buildError(ErrorConstants.FILE_NON_EXISTENT, "", "找不到文件!"));
+				} else {
+					String path = af.getFilePath();
+					String suffix = path.substring(path.lastIndexOf("."));
+					String fileName = af.getFileName() + suffix;
+					downloadFile(response, fileName, path);
+				}
+			}
+		return res;
+	}
+	
+	/** 转为公共客户 **/
+	@RequestMapping(value = "/transferToPublic", method = RequestMethod.GET)
+	public Result transferToPublic(String uid){
+		Result res = new Result();
+		if(StringUtils.isBlank(uid)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, ""));
+		}
+		customerService.updateByOperatorType(uid, AFTConstants.USER_TRANSFER_TO_PUBLIC);
+		return res;
+	}
 }

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

@@ -3,6 +3,7 @@ package com.goafanti.customer.service;
 import java.text.ParseException;
 import java.util.List;
 
+import com.goafanti.common.model.OrganizationContactBook;
 import com.goafanti.common.model.UserBusiness;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.customer.bo.BusinessListBo;
@@ -10,13 +11,20 @@ import com.goafanti.customer.bo.BussinessFollowBo;
 
 public interface BusinessService {
 	/**
-	 * 查询务列表
+	 * 查询我的业务列表
 	 * @param blo
 	 * @return
 	 */
 	Pagination<BusinessListBo> listBusiness(BusinessListBo blo,Integer pageNo,Integer pageSize);
 
 	/**
+	 * 查询所有的业务列表
+	 * @param bfb
+	 * @return
+	 */
+	Pagination<BusinessListBo> listAllBusiness(BusinessListBo blo, Integer pageNo, Integer pageSize);
+	
+	/**
 	 *  意向字典
 	 * @return
 	 */
@@ -78,4 +86,39 @@ public interface BusinessService {
 	 * @return
 	 */
 	int updateFollowOneBusiness(BussinessFollowBo bfb);
+
+	/**
+	 * 添加单个联系人
+	 * @param ocb
+	 * @return
+	 */
+	int addOneContact(OrganizationContactBook ocb);
+
+	/**
+	 * 删除业务
+	 * @param businessId
+	 * @return
+	 */
+	int deleteBusiness(String businessId);
+
+	/**
+	 * 停止业务
+	 * @param businessId
+	 * @return
+	 */
+	int updateBusinessToStop(String businessId);
+
+	/**
+	 * 删除跟进记录中间表记录
+	 * @param ufbId
+	 * @return
+	 */
+	int deleteFollowOneBusiness(String ufbId);
+
+	/**
+	 * 删除单个联系人
+	 * @param ocbId
+	 * @return
+	 */
+	int delete(String ocbId);
 }

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

@@ -8,6 +8,7 @@ import com.goafanti.common.model.OrganizationContactBook;
 import com.goafanti.common.model.User;
 import com.goafanti.common.model.UserBusiness;
 import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.customer.bo.CustomerExcelBo;
 import com.goafanti.customer.bo.CustomerListIn;
 import com.goafanti.customer.bo.CustomerListOut;
 import com.goafanti.customer.bo.CustomerOrganizationDetailBo;
@@ -122,6 +123,13 @@ public interface CustomerService {
 	int updateOrganizationCustomer(CustomerOrganizationDetailBo bo);
 	
 	/**
+	 * 修改个人客户信息
+	 * @param bo
+	 * @return
+	 */
+	int updatePersonalCustomer(CustomerPersonalDetailBo bo);
+	
+	/**
 	 * 查看跟进记录列表
 	 * @param pageNo
 	 * @param pageSize
@@ -189,4 +197,31 @@ public interface CustomerService {
 	 */
 	int updateCustomerContacts(List<OrganizationContactBook> ocbList,String uid);
 	
+	/**
+	 * 删除拜访记录
+	 * @param followId
+	 * @return
+	 */
+	int deleteFollow(String followId);
+	
+	/**
+	 * 检查客户业务
+	 * @param boSet
+	 * @param existRows
+	 */
+	void checkCustomer(Set<CustomerExcelBo> boSet,Set<Integer> existRows);
+	
+	/**
+	 * 保存上传数据
+	 * @param boSet
+	 */
+	int saveUploadData(Set<CustomerExcelBo> boSet);
+
+	/**
+	 *  通过操作类型更新客户
+	 * @param uid
+	 * @param operatorType
+	 * @return
+	 */
+	int updateByOperatorType(String uid,String operatorType);
 }

+ 48 - 6
src/main/java/com/goafanti/customer/service/impl/BusinessServiceImpl.java

@@ -13,9 +13,12 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.dao.OrganizationContactBookMapper;
 import com.goafanti.common.dao.UserBusinessMapper;
 import com.goafanti.common.dao.UserFollowBusinessMapper;
 import com.goafanti.common.dao.UserFollowMapper;
+import com.goafanti.common.enums.CustomerStatusFiled;
+import com.goafanti.common.model.OrganizationContactBook;
 import com.goafanti.common.model.UserBusiness;
 import com.goafanti.common.model.UserFollow;
 import com.goafanti.common.model.UserFollowBusiness;
@@ -35,22 +38,30 @@ public class BusinessServiceImpl extends BaseMybatisDao<UserBusinessMapper> impl
 	private UserFollowMapper userFollowMapper;
 	@Autowired
 	private UserFollowBusinessMapper userFollowBusinessMapper;
+	@Autowired
+	private OrganizationContactBookMapper organizationContactBookMapper;
 	@SuppressWarnings("unchecked")
 	@Override
 	public Pagination<BusinessListBo> listBusiness(BusinessListBo blo,Integer pageNo,Integer pageSize) {
 		blo.setAid(TokenManager.getAdminId());
 		return (Pagination<BusinessListBo>) findPage("selectBusinessList", "selectBusinessCount", disposeParams(blo), pageNo, pageSize);
 	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<BusinessListBo> listAllBusiness(BusinessListBo blo, Integer pageNo, Integer pageSize) {
+		return (Pagination<BusinessListBo>) findPage("selectBusinessList", "selectBusinessCount", disposeParams(blo), pageNo, pageSize);
+	}
 	
 	private Map<String,Object> disposeParams(BusinessListBo blo){
 		Map<String, Object> params = new HashMap<String, Object>();
 		if(StringUtils.isNotBlank(blo.getUid())) params.put("uid", blo.getUid());
 		if(StringUtils.isNotBlank(blo.getAid())) params.put("aid", blo.getAid());
 		if(StringUtils.isNotBlank(blo.getAdminName())) params.put("adminName", blo.getAdminName());
-		if(StringUtils.isNotBlank(blo.getBusinessId())) params.put("businessId", blo.getBusinessId());
+		if(StringUtils.isNotBlank(blo.getBusinessGlossoryId())) params.put("businessGlossoryId", blo.getBusinessGlossoryId());
 		if(StringUtils.isNotBlank(blo.getStartDate())) params.put("startDate", blo.getStartDate()+" 00:00:00");
 		if(StringUtils.isNotBlank(blo.getEndDate())) params.put("endDate", blo.getEndDate()+ " 23:59:59");
-		if(StringUtils.isNotBlank(blo.getIdentifyName())) params.put("identity", blo.getIdentifyName());
+		if(StringUtils.isNotBlank(blo.getIdentifyName())) params.put("identifyName", blo.getIdentifyName());
 		if(StringUtils.isNoneBlank(blo.getFollowSituation())) params.put("followSituation", blo.getFollowSituation());
 		if(StringUtils.isNotBlank(blo.getCustomerStatus())) params.put("customerStatus", blo.getCustomerStatus());
 		return params;
@@ -94,7 +105,7 @@ public class BusinessServiceImpl extends BaseMybatisDao<UserBusinessMapper> impl
 			uf.setContactType(Integer.parseInt(bfb.getContactType()));
 			uf.setAid(TokenManager.getAdminId());
 			uf.setEffective(0);
-			int followCount = userBusinessMapper.judgeBusiness(bfb.getUid(), null, TokenManager.getAdminId()) + 1;
+			int followCount = userBusinessMapper.selectFollowCountByUAid(bfb.getUid(), TokenManager.getAdminId()) + 1;
 			uf.setFollowCount(followCount);
 			userFollowMapper.insert(uf);
 			UserFollowBusiness ufb = new UserFollowBusiness();
@@ -128,8 +139,7 @@ public class BusinessServiceImpl extends BaseMybatisDao<UserBusinessMapper> impl
 		userBusiness.setFollowSituation(Integer.parseInt(bfb.getFollowSituation()));
 		userBusiness.setRemarks(bfb.getRemarks());
 		userBusiness.setUpdateTime(new Date());
-		userBusinessMapper.updateByPrimaryKeySelective(userBusiness);
-		return 1;
+		return userBusinessMapper.updateByPrimaryKeySelective(userBusiness);
 	}
 
 	@Override
@@ -145,7 +155,7 @@ public class BusinessServiceImpl extends BaseMybatisDao<UserBusinessMapper> impl
 		userBusinessMapper.updateByPrimaryKeySelective(userBusiness);
 		UserFollow userFollow = new UserFollow();
 		String followId = UUID.randomUUID().toString();
-		int followCount = userBusinessMapper.judgeBusiness(bfb.getUid(), null, TokenManager.getAdminId()) + 1;
+		int followCount = userBusinessMapper.selectFollowCountByUAid(bfb.getUid(), TokenManager.getAdminId()) + 1;
 		userFollow.setId(followId);
 		userFollow.setResult(bfb.getResult());
 		userFollow.setCreateTime(format.parse(bfb.getFollowTime()));
@@ -194,4 +204,36 @@ public class BusinessServiceImpl extends BaseMybatisDao<UserBusinessMapper> impl
 		return 1;
 	}
 
+	@Override
+	public int addOneContact(OrganizationContactBook ocb) {
+		ocb.setAid(TokenManager.getAdminId());
+		ocb.setId(UUID.randomUUID().toString());
+		return organizationContactBookMapper.insert(ocb);
+	}
+
+	@Override
+	public int deleteBusiness(String businessId) {
+		return userBusinessMapper.deleteByPrimaryKey(businessId);
+	}
+
+	@Override
+	public int updateBusinessToStop(String businessId) {
+		UserBusiness ub = new UserBusiness();
+		ub.setId(businessId);
+		ub.setCustomerStatus(CustomerStatusFiled.STATUS_STOP.getCode());
+		return userBusinessMapper.updateByPrimaryKeySelective(ub);
+	}
+
+	@Override
+	public int deleteFollowOneBusiness(String ufbId) {
+		UserFollowBusiness ufb = new UserFollowBusiness();
+		ufb.setId(ufbId);
+		return userFollowBusinessMapper.deleteByPrimaryKey(ufbId);
+	}
+
+	@Override
+	public int delete(String ocbId) {
+		return organizationContactBookMapper.deleteByPrimaryKey(ocbId);
+	}
+
 }

+ 174 - 14
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -43,6 +43,7 @@ import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.customer.bo.CustomerExcelBo;
 import com.goafanti.customer.bo.CustomerListIn;
 import com.goafanti.customer.bo.CustomerListOut;
 import com.goafanti.customer.bo.CustomerOrganizationDetailBo;
@@ -76,7 +77,7 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 	public Pagination<CustomerListOut> listPrivatePersonalCustomer(CustomerListIn cli, Integer pageNo,Integer pageSize) {
 		cli.setType(AFTConstants.USER_TYPE_PERSONAL);
 		cli.setAid(TokenManager.getAdminId());
-		cli.setShareType(AFTConstants.SHARE_TYPE_PRIVATE);
+		cli.setShareType(String.valueOf(AFTConstants.SHARE_TYPE_PRIVATE));
 		Map<String,Object> params = disposeParams(cli);
 		@SuppressWarnings("unchecked")
 		Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectPersonalCustomerList","selectPersonalCustomerCount",params,pageNo,pageSize);
@@ -87,7 +88,7 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 	public Pagination<CustomerListOut> listPublicPersonalCustomer(CustomerListIn cli, Integer pageNo,Integer pageSize) {
 		cli.setType(AFTConstants.USER_TYPE_PERSONAL);
 		cli.setAid(TokenManager.getAdminId());
-		cli.setShareType(AFTConstants.SHARE_TYPE_PUBLIC);
+		cli.setShareType(String.valueOf(AFTConstants.SHARE_TYPE_PUBLIC));
 		Map<String,Object> params = disposeParams(cli);
 		@SuppressWarnings("unchecked")
 		Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectPersonalCustomerList","selectPersonalCustomerCount",params,pageNo,pageSize);
@@ -107,7 +108,7 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 	public Pagination<CustomerListOut> listPrivateOrganizationCustomer(CustomerListIn cli, Integer pageNo,Integer pageSize) {
 		cli.setType(AFTConstants.USER_TYPE_ORGANIZATION);
 		cli.setAid(TokenManager.getAdminId());
-		cli.setShareType(AFTConstants.SHARE_TYPE_PRIVATE);
+		cli.setShareType(String.valueOf(AFTConstants.SHARE_TYPE_PRIVATE));
 		Map<String,Object> params = disposeParams(cli);
 		@SuppressWarnings("unchecked")
 		Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectOrganizationCustomerList","selectOrganizationCustomerCount",params,pageNo,pageSize);
@@ -118,7 +119,7 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 	public Pagination<CustomerListOut> listPublicOrganizationCustomer(CustomerListIn cli, Integer pageNo,Integer pageSize) {
 		cli.setType(AFTConstants.USER_TYPE_ORGANIZATION);
 		cli.setAid(TokenManager.getAdminId());
-		cli.setShareType(AFTConstants.SHARE_TYPE_PUBLIC);
+		cli.setShareType(String.valueOf(AFTConstants.SHARE_TYPE_PUBLIC));
 		Map<String,Object> params = disposeParams(cli);
 		@SuppressWarnings("unchecked")
 		Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectOrganizationCustomerList","selectOrganizationCustomerCount",params,pageNo,pageSize);
@@ -147,16 +148,20 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 		if(StringUtils.isNotBlank(cli.getStartDate())) params.put("startDate", cli.getStartDate());
 		if(StringUtils.isNotBlank(cli.getEndDate())) params.put("endDate", cli.getEndDate());
 		if(StringUtils.isNotBlank(cli.getExpert())) params.put("expert", Integer.parseInt(cli.getExpert()));
-		if(StringUtils.isNotBlank(cli.getIndustry())) params.put("indust", Integer.parseInt(cli.getIndustry()));
+		if(StringUtils.isNotBlank(cli.getIndustry())) params.put("industry", Integer.parseInt(cli.getIndustry()));
 		if(StringUtils.isNotBlank(cli.getInternational())) params.put("international", Integer.parseInt(cli.getInternational()));
 		if(StringUtils.isNotBlank(cli.getServiceCertification())) params.put("serviceCertification", Integer.parseInt(cli.getServiceCertification()));
 		if(StringUtils.isNotBlank(cli.getUserCertification())) params.put("userCertification", Integer.parseInt(cli.getUserCertification()));
-		if(StringUtils.isNotBlank(cli.getCurrentMemberStatus())) params.put("currentMemberStatus", Integer.parseInt(cli.getUserCertification()));
+		if(StringUtils.isNotBlank(cli.getCurrentMemberStatus())) params.put("currentMemberStatus", Integer.parseInt(cli.getCurrentMemberStatus()));
 		if(StringUtils.isNotBlank(cli.getLvl())) params.put("lvl", Integer.parseInt(cli.getLvl()));
 		if(StringUtils.isNotBlank(cli.getListed())) params.put("listed", Integer.parseInt(cli.getListed()));
 		if(StringUtils.isNotBlank(cli.getHighTechZone())) params.put("highTechZone", Integer.parseInt(cli.getHighTechZone()));
+		if(StringUtils.isNotBlank(cli.getExpert())) params.put("expert", Integer.parseInt(cli.getExpert()));
+		if(StringUtils.isNotBlank(cli.getCelebrity())) params.put("celebrity", Integer.parseInt(cli.getCelebrity()));
 		if(StringUtils.isNotBlank(cli.getAid())) params.put("aid", cli.getAid());
 		if(StringUtils.isNotBlank(cli.getIsMember())) params.put("isMember", Integer.parseInt(cli.getIsMember()));
+		if(StringUtils.isNotBlank(cli.getStatus())) params.put("status", Integer.parseInt(cli.getStatus()));
+		if(StringUtils.isNotBlank(cli.getSocietyTag())) params.put("societyTag", cli.getSocietyTag());
 		if(StringUtils.isNotBlank(cli.getStartDate())) params.put("startDate", cli.getStartDate()+" 00:00:00");
 		if(StringUtils.isNotBlank(cli.getEndDate())) params.put("endDate", cli.getEndDate()+" 23:59:59");
 		return params;
@@ -256,21 +261,37 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 		try {
 			BeanUtilsExt.copyProperties(oi, bo);
 			user.setId(bo.getUid());
-			user.setIdentifyName(bo.getUnitName());
 			user.setSocietyTag(bo.getSocietyTag());
 			user.setCompanyLogoUrl(bo.getCompanyLogoUrl());
 			user.setIntroduction(bo.getIntroduction());
 			user.setUpdateTime(new Date());
-		} catch (IllegalAccessException e) {
-			e.printStackTrace();
-		} catch (InvocationTargetException e) {
+		} catch (IllegalAccessException |InvocationTargetException e) {
 			e.printStackTrace();
-		}
+		} 
 		organizationIdentityMapper.updateByPrimaryKeySelective(oi);
 		userMapper.updateByPrimaryKeySelective(user);
 		return 1;
 	}
 
+	@Override
+	public int updatePersonalCustomer(CustomerPersonalDetailBo bo) {
+		UserIdentity ui = new UserIdentity();
+		User user = new User();
+		try {
+			BeanUtilsExt.copyProperties(ui, bo);
+			user.setId(bo.getUid());
+			user.setSocietyTag(bo.getSocietyTag());
+			user.setHeadPortraitUrl(bo.getHeadPortraitUrl());
+			user.setIntroduction(bo.getIntroduction());
+			user.setUpdateTime(new Date());
+		} catch (InvocationTargetException | IllegalAccessException e) {
+			e.printStackTrace();
+		}
+		userIdentityMapper.updateByPrimaryKeySelective(ui);
+		userMapper.updateByPrimaryKeySelective(user);
+		return 1;
+	}
+	
 	@SuppressWarnings("unchecked")
 	@Override
 	public Pagination<FollowListBo> listFollowHistory(Integer pageNo, Integer pageSize,String uid,String businessGlossoryId) {
@@ -288,7 +309,6 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 
 	@Override
 	public int updateUserAccount(User user) {
-		
 		return userMapper.updateByPrimaryKeySelective(user);
 	}
 
@@ -301,7 +321,7 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 	@Override
 	@Transactional
 	public int addFollow(FollowBusinessBo fbb) throws BusinessException{
-		if(fbb.getUserBusinessList().size()<1) throw new BusinessException(new Error("","","至少需要填写一个跟进业务"));
+		if(fbb.getUserBusinessList().size()<1) throw new BusinessException(new Error(ErrorConstants.AT_LEAST_A_BUSINESS,"",""));
 		//更新跟进记录表
 		SimpleDateFormat format = new SimpleDateFormat(AFTConstants.YYYYMMDDHHMMSS);
 		UserFollow userFollow = new UserFollow();
@@ -318,7 +338,7 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 		userFollow.setOcbId(fbb.getOcbId());
 		userFollow.setResult(fbb.getResult());
 		userFollow.setUid(fbb.getUid());
-		int followCount = userBusinessMapper.judgeBusiness(fbb.getUid(), null, TokenManager.getAdminId()) + 1;
+		int followCount = userBusinessMapper.selectFollowCountByUAid(fbb.getUid(), TokenManager.getAdminId()) + 1;
 		userFollow.setFollowCount(followCount);
 		userFollowMapper.insert(userFollow);
 		String ufbId = "";
@@ -484,5 +504,145 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 		}
 		return 1;
 	}
+
+	@Override
+	public int deleteFollow(String followId) {
+		UserFollow uf = new UserFollow();
+		uf.setId(followId);
+		uf.setEffective(1);
+		return userFollowMapper.updateByPrimaryKeySelective(uf);
+	}
+
+	@Override
+	public void checkCustomer(Set<CustomerExcelBo> boSet, Set<Integer> existRows) {
+		List<User> list = null;
+		User user = null;
+		for (CustomerExcelBo bo : boSet) {
+			list = userMapper.checkUser("", bo.getIdentifyName(), "", Integer.parseInt(bo.getCustomerType()));
+			if (list.size() > 0) {
+				user = list.get(0);
+				bo.setUid(user.getId());
+				if (userBusinessMapper.judgeBusiness(bo.getUid(), Integer.parseInt(bo.getBusinessGlossoryId()),"") > 0) {
+					existRows.add(bo.getRowNumber());
+				}
+			}
+		}
+	}
+
+	@Override
+	@Transactional
+	public int saveUploadData(Set<CustomerExcelBo> boSet) {
+		Date now = new Date();
+		String uid = "";
+		for(CustomerExcelBo bo : boSet){
+			if(StringUtils.isBlank(bo.getUid())){ //新建客户
+				uid = UUID.randomUUID().toString();
+				createUser(bo, uid, now);
+				createIdentity(bo, bo.getCustomerType(), uid);
+				createBusiness(bo, uid, now);
+				createContacts(bo, uid);	
+			}else{ //新建业务
+				uid = bo.getUid();
+				createBusiness(bo, uid, now);
+				if(organizationContactBookMapper.checkContacts(uid, bo.getMobile(), TokenManager.getAdminId())<=0){
+					createContacts(bo, uid);
+				}
+			}
+		}
+		return 1;
+	}
+	
+	private void createUser(CustomerExcelBo bo,String uid,Date now){
+		User user = new User();
+		user.setId(uid);
+		user.setIdentifyName(bo.getIdentifyName());
+		user.setSource(1);
+		user.setNickname(bo.getIdentifyName());
+		user.setStatus(0);
+		user.setShareType(0);
+		user.setServiceCertification(0);
+		user.setUserCertification(0);
+		user.setAid(TokenManager.getAdminId());
+		user.setType(Integer.parseInt(bo.getCustomerType()));
+		user.setCurrentMemberStatus(0);
+		user.setLvl(1);
+		user.setCreateTime(now);
+		user.setUpdateTime(now);
+		user.setMobile(bo.getMobile());
+		user.setPassword(AFTConstants.INITIALPASSWORD);
+		user.setIsMember(0);
+		passwordUtil.encryptPassword(user);
+		userMapper.insert(user);	
+	}
 	
+	private void createIdentity(CustomerExcelBo bo,String type,String uid){
+		String identifyId = UUID.randomUUID().toString();
+		if(type.equals(AFTConstants.USER_TYPE_PERSONAL)){
+			//新增个人认证信息
+			UserIdentity ui = new UserIdentity();
+			ui.setId(identifyId);
+			ui.setUid(uid);
+			ui.setContacts(bo.getContacts());
+			ui.setContactMobile(bo.getMobile());
+			ui.setUsername(bo.getIdentifyName());
+			ui.setExpert(0);
+			ui.setCelebrity(0);
+			ui.setInternational(0);
+			ui.setAuditStatus(0);
+			userIdentityMapper.insert(ui);
+		}else if(type.equals(AFTConstants.USER_TYPE_ORGANIZATION)){
+			// 创建企业认证信息
+			OrganizationIdentity oi = new OrganizationIdentity();
+			oi.setId(identifyId);
+			oi.setUnitName(bo.getIdentifyName());
+			oi.setUid(uid);
+			oi.setContacts(bo.getContacts());
+			oi.setContactMobile(bo.getMobile());
+			oi.setHighTechZone(0);
+			oi.setInternational(0);
+			oi.setListed(0);
+			oi.setAuditStatus(5); //实名企业
+			organizationIdentityMapper.insert(oi);
+		}
+	}
+	
+	private void createContacts(CustomerExcelBo bo,String uid){
+		//新增企业联系人
+		OrganizationContactBook cob = new OrganizationContactBook();
+		cob.setAid(TokenManager.getAdminId());
+		cob.setId(UUID.randomUUID().toString());
+		cob.setUid(uid);
+		cob.setName(bo.getContacts());
+		cob.setMobile(bo.getMobile());
+		organizationContactBookMapper.insert(cob);
+	}
+	
+	private void createBusiness(CustomerExcelBo bo,String uid,Date now){
+		//新增业务
+		UserBusiness ub = new UserBusiness();
+		ub.setId(UUID.randomUUID().toString());
+		ub.setAid(TokenManager.getAdminId());
+		ub.setBusinessGlossoryId(Integer.parseInt(bo.getBusinessGlossoryId()));
+		ub.setUid(uid);
+		ub.setCreateTime(now);
+		ub.setUpdateTime(now);
+		ub.setCustomerStatus(Integer.parseInt(bo.getCustomerStatus()));
+		ub.setFollowSituation(Integer.parseInt(bo.getFollowSituation()));
+		userBusinessMapper.insert(ub);
+	}
+
+	@Override
+	public int updateByOperatorType(String uid, String operatorType) {
+		User user = new User();
+		user.setId(uid);
+		if(operatorType.equals(AFTConstants.USER_TRANSFER_TO_PUBLIC)){
+			user.setShareType(AFTConstants.SHARE_TYPE_PUBLIC);
+		}else if(operatorType.equals(AFTConstants.USER_RECEIVE)){
+			user.setAid(TokenManager.getAdminId());
+			user.setShareType(AFTConstants.SHARE_TYPE_PRIVATE);
+		}else if(operatorType.equals(AFTConstants.USER_DELETE)){
+			user.setStatus(AFTConstants.USER_STATUS_CANCEL);
+		}
+		return userMapper.updateByPrimaryKeySelective(user);
+	}
 }