Browse Source

Accept Merge Request #257 客户系统投产 : (test -> prod)

Merge Request: 客户系统投产
Created By: @浅川
Accepted By: @浅川
URL: https://coding.net/t/aft/p/AFT/git/merge/257
浅川 8 years ago
parent
commit
1b1db684fa

+ 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="customer_log"/>
+    <table schema="aft" tableName="follow_up_record"/>
   </context>
 </generatorConfiguration>

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

@@ -11,71 +11,82 @@ public interface FollowUpRecordMapper {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	long countByExample(FollowUpRecordExample example);
 
+
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	int deleteByExample(FollowUpRecordExample example);
 
+
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	int deleteByPrimaryKey(String id);
 
+
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	int insert(FollowUpRecord record);
 
+
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	int insertSelective(FollowUpRecord record);
 
+
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	List<FollowUpRecord> selectByExample(FollowUpRecordExample example);
 
+
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	FollowUpRecord selectByPrimaryKey(String id);
 
+
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	int updateByExampleSelective(@Param("record") FollowUpRecord record,
 			@Param("example") FollowUpRecordExample example);
 
+
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	int updateByExample(@Param("record") FollowUpRecord record, @Param("example") FollowUpRecordExample example);
 
+
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	int updateByPrimaryKeySelective(FollowUpRecord record);
 
+
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	int updateByPrimaryKey(FollowUpRecord record);
 
+
 	/**
 	 * 查询跟进记录列表
 	 * @param customerId

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

@@ -775,7 +775,7 @@
   <select id="findUserOwnerAchievementCount" parameterType="String" resultType="java.lang.Integer">
   	select 
   		count(1)
-  	from achievement
+  	from achievement a
   	<if test="hot != null and hot == 1"><!-- 在首页 -->
 		inner join marketing_management mm on a.id = mm.product_id
 	</if>

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

@@ -5,7 +5,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Oct 18 19:10:46 CST 2017.
+      This element was generated on Wed Nov 01 21:31:29 CST 2017.
     -->
     <id column="id" jdbcType="VARCHAR" property="id" />
     <result column="cid" jdbcType="VARCHAR" property="cid" />
@@ -14,7 +14,7 @@
     <result column="tm_stamp" jdbcType="TIMESTAMP" property="tmStamp" />
     <result column="follow_result" jdbcType="VARCHAR" property="followResult" />
     <result column="follow_situation" jdbcType="INTEGER" property="followSituation" />
-    <result column="attachment" jdbcType="INTEGER" property="attachment" />
+    <result column="attachment" jdbcType="VARCHAR" property="attachment" />
     <result column="cuid" jdbcType="VARCHAR" property="cuid" />
     <result column="customer_status" jdbcType="INTEGER" property="customerStatus" />
     <result column="contact_info" jdbcType="VARCHAR" property="contactInfo" />
@@ -24,7 +24,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Oct 18 19:10:46 CST 2017.
+      This element was generated on Wed Nov 01 21:31:29 CST 2017.
     -->
     <where>
       <foreach collection="oredCriteria" item="criteria" separator="or">
@@ -58,7 +58,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Oct 18 19:10:46 CST 2017.
+      This element was generated on Wed Nov 01 21:31:29 CST 2017.
     -->
     <where>
       <foreach collection="example.oredCriteria" item="criteria" separator="or">
@@ -92,7 +92,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Oct 18 19:10:46 CST 2017.
+      This element was generated on Wed Nov 01 21:31:29 CST 2017.
     -->
     id, cid, aid, follow_date, tm_stamp, follow_result, follow_situation, attachment, 
     cuid, customer_status, contact_info, effective
@@ -101,7 +101,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Oct 18 19:10:46 CST 2017.
+      This element was generated on Wed Nov 01 21:31:29 CST 2017.
     -->
     select
     <if test="distinct">
@@ -120,7 +120,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Oct 18 19:10:46 CST 2017.
+      This element was generated on Wed Nov 01 21:31:29 CST 2017.
     -->
     select 
     <include refid="Base_Column_List" />
@@ -131,7 +131,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Oct 18 19:10:46 CST 2017.
+      This element was generated on Wed Nov 01 21:31:29 CST 2017.
     -->
     delete from follow_up_record
     where id = #{id,jdbcType=VARCHAR}
@@ -140,7 +140,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Oct 18 19:10:46 CST 2017.
+      This element was generated on Wed Nov 01 21:31:29 CST 2017.
     -->
     delete from follow_up_record
     <if test="_parameter != null">
@@ -151,7 +151,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Oct 18 19:10:46 CST 2017.
+      This element was generated on Wed Nov 01 21:31:29 CST 2017.
     -->
     insert into follow_up_record (id, cid, aid, 
       follow_date, tm_stamp, follow_result, 
@@ -160,7 +160,7 @@
       )
     values (#{id,jdbcType=VARCHAR}, #{cid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, 
       #{followDate,jdbcType=TIMESTAMP}, #{tmStamp,jdbcType=TIMESTAMP}, #{followResult,jdbcType=VARCHAR}, 
-      #{followSituation,jdbcType=INTEGER}, #{attachment,jdbcType=INTEGER}, #{cuid,jdbcType=VARCHAR}, 
+      #{followSituation,jdbcType=INTEGER}, #{attachment,jdbcType=VARCHAR}, #{cuid,jdbcType=VARCHAR}, 
       #{customerStatus,jdbcType=INTEGER}, #{contactInfo,jdbcType=VARCHAR}, #{effective,jdbcType=INTEGER}
       )
   </insert>
@@ -168,7 +168,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Oct 18 19:10:46 CST 2017.
+      This element was generated on Wed Nov 01 21:31:29 CST 2017.
     -->
     insert into follow_up_record
     <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -232,7 +232,7 @@
         #{followSituation,jdbcType=INTEGER},
       </if>
       <if test="attachment != null">
-        #{attachment,jdbcType=INTEGER},
+        #{attachment,jdbcType=VARCHAR},
       </if>
       <if test="cuid != null">
         #{cuid,jdbcType=VARCHAR},
@@ -252,7 +252,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Oct 18 19:10:46 CST 2017.
+      This element was generated on Wed Nov 01 21:31:29 CST 2017.
     -->
     select count(*) from follow_up_record
     <if test="_parameter != null">
@@ -263,7 +263,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Oct 18 19:10:46 CST 2017.
+      This element was generated on Wed Nov 01 21:31:29 CST 2017.
     -->
     update follow_up_record
     <set>
@@ -289,7 +289,7 @@
         follow_situation = #{record.followSituation,jdbcType=INTEGER},
       </if>
       <if test="record.attachment != null">
-        attachment = #{record.attachment,jdbcType=INTEGER},
+        attachment = #{record.attachment,jdbcType=VARCHAR},
       </if>
       <if test="record.cuid != null">
         cuid = #{record.cuid,jdbcType=VARCHAR},
@@ -312,7 +312,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Oct 18 19:10:46 CST 2017.
+      This element was generated on Wed Nov 01 21:31:29 CST 2017.
     -->
     update follow_up_record
     set id = #{record.id,jdbcType=VARCHAR},
@@ -322,7 +322,7 @@
       tm_stamp = #{record.tmStamp,jdbcType=TIMESTAMP},
       follow_result = #{record.followResult,jdbcType=VARCHAR},
       follow_situation = #{record.followSituation,jdbcType=INTEGER},
-      attachment = #{record.attachment,jdbcType=INTEGER},
+      attachment = #{record.attachment,jdbcType=VARCHAR},
       cuid = #{record.cuid,jdbcType=VARCHAR},
       customer_status = #{record.customerStatus,jdbcType=INTEGER},
       contact_info = #{record.contactInfo,jdbcType=VARCHAR},
@@ -335,7 +335,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Oct 18 19:10:46 CST 2017.
+      This element was generated on Wed Nov 01 21:31:29 CST 2017.
     -->
     update follow_up_record
     <set>
@@ -358,7 +358,7 @@
         follow_situation = #{followSituation,jdbcType=INTEGER},
       </if>
       <if test="attachment != null">
-        attachment = #{attachment,jdbcType=INTEGER},
+        attachment = #{attachment,jdbcType=VARCHAR},
       </if>
       <if test="cuid != null">
         cuid = #{cuid,jdbcType=VARCHAR},
@@ -379,7 +379,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Oct 18 19:10:46 CST 2017.
+      This element was generated on Wed Nov 01 21:31:29 CST 2017.
     -->
     update follow_up_record
     set cid = #{cid,jdbcType=VARCHAR},
@@ -388,7 +388,7 @@
       tm_stamp = #{tmStamp,jdbcType=TIMESTAMP},
       follow_result = #{followResult,jdbcType=VARCHAR},
       follow_situation = #{followSituation,jdbcType=INTEGER},
-      attachment = #{attachment,jdbcType=INTEGER},
+      attachment = #{attachment,jdbcType=VARCHAR},
       cuid = #{cuid,jdbcType=VARCHAR},
       customer_status = #{customerStatus,jdbcType=INTEGER},
       contact_info = #{contactInfo,jdbcType=VARCHAR},

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

@@ -6,69 +6,69 @@ public class FollowUpRecord {
 
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column follow_up_record.id
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	private String id;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column follow_up_record.cid
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	private String cid;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column follow_up_record.aid
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	private String aid;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column follow_up_record.follow_date
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	private Date followDate;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column follow_up_record.tm_stamp
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	private Date tmStamp;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column follow_up_record.follow_result
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	private String followResult;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column follow_up_record.follow_situation
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	private Integer followSituation;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column follow_up_record.attachment
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
-	private Integer attachment;
+	private String attachment;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column follow_up_record.cuid
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	private String cuid;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column follow_up_record.customer_status
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	private Integer customerStatus;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column follow_up_record.contact_info
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	private String contactInfo;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column follow_up_record.effective
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	private Integer effective;
 
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column follow_up_record.id
 	 * @return  the value of follow_up_record.id
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public String getId() {
 		return id;
@@ -77,7 +77,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column follow_up_record.id
 	 * @param id  the value for follow_up_record.id
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public void setId(String id) {
 		this.id = id;
@@ -86,7 +86,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column follow_up_record.cid
 	 * @return  the value of follow_up_record.cid
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public String getCid() {
 		return cid;
@@ -95,7 +95,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column follow_up_record.cid
 	 * @param cid  the value for follow_up_record.cid
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public void setCid(String cid) {
 		this.cid = cid;
@@ -104,7 +104,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column follow_up_record.aid
 	 * @return  the value of follow_up_record.aid
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public String getAid() {
 		return aid;
@@ -113,7 +113,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column follow_up_record.aid
 	 * @param aid  the value for follow_up_record.aid
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public void setAid(String aid) {
 		this.aid = aid;
@@ -122,7 +122,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column follow_up_record.follow_date
 	 * @return  the value of follow_up_record.follow_date
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public Date getFollowDate() {
 		return followDate;
@@ -131,7 +131,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column follow_up_record.follow_date
 	 * @param followDate  the value for follow_up_record.follow_date
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public void setFollowDate(Date followDate) {
 		this.followDate = followDate;
@@ -140,7 +140,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column follow_up_record.tm_stamp
 	 * @return  the value of follow_up_record.tm_stamp
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public Date getTmStamp() {
 		return tmStamp;
@@ -149,7 +149,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column follow_up_record.tm_stamp
 	 * @param tmStamp  the value for follow_up_record.tm_stamp
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public void setTmStamp(Date tmStamp) {
 		this.tmStamp = tmStamp;
@@ -158,7 +158,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column follow_up_record.follow_result
 	 * @return  the value of follow_up_record.follow_result
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public String getFollowResult() {
 		return followResult;
@@ -167,7 +167,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column follow_up_record.follow_result
 	 * @param followResult  the value for follow_up_record.follow_result
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public void setFollowResult(String followResult) {
 		this.followResult = followResult;
@@ -176,7 +176,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column follow_up_record.follow_situation
 	 * @return  the value of follow_up_record.follow_situation
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public Integer getFollowSituation() {
 		return followSituation;
@@ -185,7 +185,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column follow_up_record.follow_situation
 	 * @param followSituation  the value for follow_up_record.follow_situation
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public void setFollowSituation(Integer followSituation) {
 		this.followSituation = followSituation;
@@ -194,25 +194,25 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column follow_up_record.attachment
 	 * @return  the value of follow_up_record.attachment
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
-	public Integer getAttachment() {
+	public String getAttachment() {
 		return attachment;
 	}
 
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column follow_up_record.attachment
 	 * @param attachment  the value for follow_up_record.attachment
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
-	public void setAttachment(Integer attachment) {
+	public void setAttachment(String attachment) {
 		this.attachment = attachment;
 	}
 
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column follow_up_record.cuid
 	 * @return  the value of follow_up_record.cuid
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public String getCuid() {
 		return cuid;
@@ -221,7 +221,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column follow_up_record.cuid
 	 * @param cuid  the value for follow_up_record.cuid
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public void setCuid(String cuid) {
 		this.cuid = cuid;
@@ -230,7 +230,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column follow_up_record.customer_status
 	 * @return  the value of follow_up_record.customer_status
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public Integer getCustomerStatus() {
 		return customerStatus;
@@ -239,7 +239,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column follow_up_record.customer_status
 	 * @param customerStatus  the value for follow_up_record.customer_status
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public void setCustomerStatus(Integer customerStatus) {
 		this.customerStatus = customerStatus;
@@ -248,7 +248,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column follow_up_record.contact_info
 	 * @return  the value of follow_up_record.contact_info
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public String getContactInfo() {
 		return contactInfo;
@@ -257,7 +257,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column follow_up_record.contact_info
 	 * @param contactInfo  the value for follow_up_record.contact_info
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public void setContactInfo(String contactInfo) {
 		this.contactInfo = contactInfo;
@@ -266,7 +266,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column follow_up_record.effective
 	 * @return  the value of follow_up_record.effective
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public Integer getEffective() {
 		return effective;
@@ -275,7 +275,7 @@ public class FollowUpRecord {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column follow_up_record.effective
 	 * @param effective  the value for follow_up_record.effective
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public void setEffective(Integer effective) {
 		this.effective = effective;

+ 36 - 26
src/main/java/com/goafanti/common/model/FollowUpRecordExample.java

@@ -7,23 +7,23 @@ import java.util.List;
 public class FollowUpRecordExample {
     /**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table follow_up_record
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	protected String orderByClause;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table follow_up_record
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	protected boolean distinct;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table follow_up_record
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	protected List<Criteria> oredCriteria;
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public FollowUpRecordExample() {
 		oredCriteria = new ArrayList<Criteria>();
@@ -31,7 +31,7 @@ public class FollowUpRecordExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public void setOrderByClause(String orderByClause) {
 		this.orderByClause = orderByClause;
@@ -39,7 +39,7 @@ public class FollowUpRecordExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public String getOrderByClause() {
 		return orderByClause;
@@ -47,7 +47,7 @@ public class FollowUpRecordExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public void setDistinct(boolean distinct) {
 		this.distinct = distinct;
@@ -55,7 +55,7 @@ public class FollowUpRecordExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public boolean isDistinct() {
 		return distinct;
@@ -63,7 +63,7 @@ public class FollowUpRecordExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public List<Criteria> getOredCriteria() {
 		return oredCriteria;
@@ -71,7 +71,7 @@ public class FollowUpRecordExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public void or(Criteria criteria) {
 		oredCriteria.add(criteria);
@@ -79,7 +79,7 @@ public class FollowUpRecordExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public Criteria or() {
 		Criteria criteria = createCriteriaInternal();
@@ -89,7 +89,7 @@ public class FollowUpRecordExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public Criteria createCriteria() {
 		Criteria criteria = createCriteriaInternal();
@@ -101,7 +101,7 @@ public class FollowUpRecordExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	protected Criteria createCriteriaInternal() {
 		Criteria criteria = new Criteria();
@@ -110,7 +110,7 @@ public class FollowUpRecordExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table follow_up_record
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public void clear() {
 		oredCriteria.clear();
@@ -120,7 +120,7 @@ public class FollowUpRecordExample {
 
 	/**
 	 * This class was generated by MyBatis Generator. This class corresponds to the database table follow_up_record
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	protected abstract static class GeneratedCriteria {
 		protected List<Criterion> criteria;
@@ -633,52 +633,62 @@ public class FollowUpRecordExample {
 			return (Criteria) this;
 		}
 
-		public Criteria andAttachmentEqualTo(Integer value) {
+		public Criteria andAttachmentEqualTo(String value) {
 			addCriterion("attachment =", value, "attachment");
 			return (Criteria) this;
 		}
 
-		public Criteria andAttachmentNotEqualTo(Integer value) {
+		public Criteria andAttachmentNotEqualTo(String value) {
 			addCriterion("attachment <>", value, "attachment");
 			return (Criteria) this;
 		}
 
-		public Criteria andAttachmentGreaterThan(Integer value) {
+		public Criteria andAttachmentGreaterThan(String value) {
 			addCriterion("attachment >", value, "attachment");
 			return (Criteria) this;
 		}
 
-		public Criteria andAttachmentGreaterThanOrEqualTo(Integer value) {
+		public Criteria andAttachmentGreaterThanOrEqualTo(String value) {
 			addCriterion("attachment >=", value, "attachment");
 			return (Criteria) this;
 		}
 
-		public Criteria andAttachmentLessThan(Integer value) {
+		public Criteria andAttachmentLessThan(String value) {
 			addCriterion("attachment <", value, "attachment");
 			return (Criteria) this;
 		}
 
-		public Criteria andAttachmentLessThanOrEqualTo(Integer value) {
+		public Criteria andAttachmentLessThanOrEqualTo(String value) {
 			addCriterion("attachment <=", value, "attachment");
 			return (Criteria) this;
 		}
 
-		public Criteria andAttachmentIn(List<Integer> values) {
+		public Criteria andAttachmentLike(String value) {
+			addCriterion("attachment like", value, "attachment");
+			return (Criteria) this;
+		}
+
+		public Criteria andAttachmentNotLike(String value) {
+			addCriterion("attachment not like", value, "attachment");
+			return (Criteria) this;
+		}
+
+		public Criteria andAttachmentIn(List<String> values) {
 			addCriterion("attachment in", values, "attachment");
 			return (Criteria) this;
 		}
 
-		public Criteria andAttachmentNotIn(List<Integer> values) {
+		public Criteria andAttachmentNotIn(List<String> values) {
 			addCriterion("attachment not in", values, "attachment");
 			return (Criteria) this;
 		}
 
-		public Criteria andAttachmentBetween(Integer value1, Integer value2) {
+		public Criteria andAttachmentBetween(String value1, String value2) {
 			addCriterion("attachment between", value1, value2, "attachment");
 			return (Criteria) this;
 		}
 
-		public Criteria andAttachmentNotBetween(Integer value1, Integer value2) {
+		public Criteria andAttachmentNotBetween(String value1, String value2) {
 			addCriterion("attachment not between", value1, value2, "attachment");
 			return (Criteria) this;
 		}
@@ -946,7 +956,7 @@ public class FollowUpRecordExample {
 
 	/**
 	 * This class was generated by MyBatis Generator. This class corresponds to the database table follow_up_record
-	 * @mbg.generated  Wed Oct 18 19:10:46 CST 2017
+	 * @mbg.generated  Wed Nov 01 21:31:29 CST 2017
 	 */
 	public static class Criterion {
 		private String condition;

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

@@ -2,7 +2,7 @@ package com.goafanti.customer.bo;
 
 public class CustomerOut {
 	/**
-	 * 客户类型(1-个人用户,2-公司用户)
+	 * 客户类型(1-个人客户,2-机构单位,3-团体单位)
 	 */
 	private Integer customerType;
 	
@@ -21,7 +21,7 @@ public class CustomerOut {
 	 */
 	private String cid;
 	/**
-	 * 分享类型(1-个人用户,2-公共用户)
+	 * 分享类型(1-私有客户,2-公共客户)
 	 */
 	private Integer shareType;
 	

+ 35 - 33
src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java

@@ -64,43 +64,45 @@ public class AdminCustomerApiController extends BaseApiController {
 	public Result addCustomer(CustomerIn cusIn,CustomerOrganizationInfo coi,CustomerUserInfo cui,FollowUpRecord fur) throws ParseException, IllegalAccessException, InvocationTargetException {
 		Result res=new Result();
 		//查询客户是否已经存在
+		if(StringUtils.isEmpty(cusIn.getCompanyName())) res.getError().add(new Error("公司名字不能为空"));
+		if(StringUtils.isEmpty(cusIn.getCompanyIntention())) res.getError().add(new Error("意向服务不能为空"));
+		if(StringUtils.isEmpty(cusIn.getFollowSituation())) res.getError().add(new Error("跟进进度不能为空"));
+		if(StringUtils.isEmpty(cusIn.getCustomerStatus())) res.getError().add(new Error("客户状态不能为空"));
+		if(StringUtils.isEmpty(cui.getName())) res.getError().add(new Error("联系人姓名不能为空"));
+		if(StringUtils.isEmpty(cui.getMobile())&&StringUtils.isEmpty(cui.getTelNum())) res.getError().add(new Error("手机号码和座机不能同时为空"));
 		if(customerOrganizationService.findCustomerOrganizationByName(cusIn.getCompanyName())>0){
 			res.getError().add(buildError(ErrorConstants.CUSTOMER_ALREADY_EXIST));
 			return res;
 		}
 		//添加 customer
 		String customerId = UUID.randomUUID().toString();//客户记录ID
-		String  customerUsrId= UUID.randomUUID().toString();//客户联系人ID
+		String customerUserId= UUID.randomUUID().toString();//客户联系人ID
 		String followId=UUID.randomUUID().toString();//跟进记录ID
-		Customer c = new Customer();
-		cusIn.setFollowId(followId);
-		cusIn.setId(customerId);		
-		cui.setId(customerUsrId);
-		cui.setCid(customerId);//客户联系人表中的cid
-		
+		//客户信息表
+		Customer cus = new Customer();
+		BeanUtils.copyProperties(cus, cusIn);
+		cus.setId(customerId);
+		cus.setFollowId(followId);
+		cus.setShareType(Integer.parseInt(cusIn.getShareType()));
+		cus.setCustomerType(Integer.parseInt(cusIn.getCustomerType()));
+		cus.setAid(TokenManager.getAdminId());
+		cus.setCreateTime(new Date());
+		//公司信息和联系人信息表
+		cui.setId(customerUserId);
+		cui.setCid(customerId);//客户联系人表中的cid		
 		coi.setId(UUID.randomUUID().toString());//客户公司ID
 		coi.setCid(customerId);//客户公司表中的cid
-		SimpleDateFormat format = new SimpleDateFormat(AFTConstants.YYYYMMDD);
+		//跟进信息表
+		SimpleDateFormat format = new SimpleDateFormat(AFTConstants.YYYYMMDDHHMMSS);
 		fur.setFollowDate(format.parse(cusIn.getFollowDates()));
 		fur.setId(followId);//跟进记录的ID
 		fur.setCid(customerId);//跟进记录表中的cid
-		fur.setCuid(customerUsrId);//跟进记录表中的联系人id		
-		/*if(StringUtils.isNotBlank(cusIn.getAid())) fur.setAid(cusIn.getAid());*//*暂时注释*/
-		
-		BeanUtils.copyProperties(c, cusIn);
-		c.setShareType(Integer.parseInt(cusIn.getShareType()));
-		c.setCustomerType(Integer.parseInt(cusIn.getCustomerType()));
-		c.setId(customerId);
-		
-		customerService.addCustomer(c);
-		//插入 customerUserInfo
-		customerUserService.addCustomerUserInfo(cui);
-		//插入 customerOrganizationInfo
-		customerOrganizationService.addCustomerOrganizationInfo(coi);
-		//插入跟进表
-		followUpService.addFollowUp(fur);
+		fur.setCuid(customerUserId);//跟进记录表中的联系人id
+		fur.setAid(TokenManager.getAdminId());
+		customerService.addCustomer(cus,cui,coi,fur);
 		//添加日志
-		customerService.saveCustomerLog(cusIn, AFTConstants.CUSTOMER_CREATE,customerId);
+		cusIn.setId(customerId);
+		customerService.saveCustomerLog(cusIn, AFTConstants.CUSTOMER_CREATE);
 		return res;
 	}
 	
@@ -111,11 +113,11 @@ public class AdminCustomerApiController extends BaseApiController {
 	 * @return
 	 * @throws ParseException
 	 */
-	@RequestMapping(value = "/deleteCustomer", method = RequestMethod.POST)
+	@RequestMapping(value = "/deleteCustomer", method = RequestMethod.GET)
 	public Result deleteCustomer(CustomerIn cusIn) throws ParseException {
 		Result res=new Result();
 		customerService.deleteCustomer(cusIn.getId());
-		customerService.saveCustomerLog(cusIn, AFTConstants.CUSTOMER_DELETE,cusIn.getId());
+		customerService.saveCustomerLog(cusIn, AFTConstants.CUSTOMER_DELETE);
 		return res;
 	}
 	
@@ -230,12 +232,12 @@ public class AdminCustomerApiController extends BaseApiController {
 		BeanUtils.copyProperties(c, cusIn);
 		c.setCustomerType(Integer.parseInt(cusIn.getCustomerType()));
 		coi.setCid(cusIn.getId());
-		//更新主表
+		//更新客户信息和客户公司信息
 		customerService.updateCustomer(c);
 		//更新公司表
 		customerOrganizationService.updateCustomerOrganizationInfo(coi);
 		//插入日志表
-		customerService.saveCustomerLog(cusIn, AFTConstants.CUSTOMER_MODIFY,cusIn.getId());
+		customerService.saveCustomerLog(cusIn, AFTConstants.CUSTOMER_MODIFY);
 	    return res;
 	}
 	
@@ -255,7 +257,7 @@ public class AdminCustomerApiController extends BaseApiController {
 		//更新主表
 		customerService.updateCustomer(c);
 		//插入日志表
-		customerService.saveCustomerLog(cusIn, AFTConstants.CUSTOMER_TRANSFER,cusIn.getId());
+		customerService.saveCustomerLog(cusIn, AFTConstants.CUSTOMER_TRANSFER);
 	    return res;
 	}
 	
@@ -315,7 +317,7 @@ public class AdminCustomerApiController extends BaseApiController {
 			e.printStackTrace();
 		}	
 		customerService.updateCustomer(cus);
-		customerService.saveCustomerLog(cusIn, AFTConstants.CUSTOMER_FOLLOW,cusIn.getId());
+		customerService.saveCustomerLog(cusIn, AFTConstants.CUSTOMER_FOLLOW);
 		return res;
 	}
 	
@@ -428,7 +430,7 @@ public class AdminCustomerApiController extends BaseApiController {
 		//更新主表
 		customerService.updateCustomer(c);
 		//插入日志表
-		customerService.saveCustomerLog(cusIn, AFTConstants.CUSTOMER_RECEIVE,cusIn.getId());
+		customerService.saveCustomerLog(cusIn, AFTConstants.CUSTOMER_RECEIVE);
 	    return res;
 	}
 	
@@ -451,7 +453,7 @@ public class AdminCustomerApiController extends BaseApiController {
 	 * @throws InvocationTargetException 
 	 * @throws IllegalAccessException 
 	 */
-	@RequestMapping(value = "/transferToPublic" , method = RequestMethod.POST)
+	@RequestMapping(value = "/transferToPublic" , method = RequestMethod.GET)
 	public Result transferToPublic(CustomerIn cusIn) throws IllegalAccessException, InvocationTargetException{
 		Result res=new Result();
 		Customer c = new Customer();
@@ -462,7 +464,7 @@ public class AdminCustomerApiController extends BaseApiController {
 		//更新主表
 		customerService.updateCustomer(c);
 		//插入日志表
-		customerService.saveCustomerLog(cusIn, AFTConstants.CUSTOMER_TO_PUBLIC,cusIn.getId());
+		customerService.saveCustomerLog(cusIn, AFTConstants.CUSTOMER_TO_PUBLIC);
 	    return res;
 	}
 	

+ 5 - 2
src/main/java/com/goafanti/customer/service/CustomerService.java

@@ -4,6 +4,9 @@ import java.util.List;
 
 import com.goafanti.common.model.Customer;
 import com.goafanti.common.model.CustomerLog;
+import com.goafanti.common.model.CustomerOrganizationInfo;
+import com.goafanti.common.model.CustomerUserInfo;
+import com.goafanti.common.model.FollowUpRecord;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.customer.bo.CustomerIn;
 import com.goafanti.customer.bo.CustomerOut;
@@ -15,7 +18,7 @@ public interface CustomerService {
 	 * @param cus
 	 * @return
 	 */
-	int addCustomer(Customer cus);
+	int addCustomer(Customer cus,CustomerUserInfo cui,CustomerOrganizationInfo coi,FollowUpRecord fur);
 	
 	/**
 	 * 删除客户信息
@@ -64,7 +67,7 @@ public interface CustomerService {
 	 * 
 	 * @param cus 添加日志
 	 */
-	public void saveCustomerLog(CustomerIn cus,String operatorType,String cid);
+	public void saveCustomerLog(CustomerIn cus,String operatorType);
 	
 	/**
 	 * 

+ 51 - 26
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -23,12 +23,18 @@ import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.AdminMapper;
 import com.goafanti.common.dao.CustomerLogMapper;
 import com.goafanti.common.dao.CustomerMapper;
+import com.goafanti.common.dao.CustomerOrganizationInfoMapper;
+import com.goafanti.common.dao.CustomerUserInfoMapper;
+import com.goafanti.common.dao.FollowUpRecordMapper;
 import com.goafanti.common.enums.CustomerFollowFiled;
 import com.goafanti.common.enums.CustomerIntentionFiled;
 import com.goafanti.common.enums.CustomerStatusFiled;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.Customer;
 import com.goafanti.common.model.CustomerLog;
+import com.goafanti.common.model.CustomerOrganizationInfo;
+import com.goafanti.common.model.CustomerUserInfo;
+import com.goafanti.common.model.FollowUpRecord;
 import com.goafanti.common.utils.StringUtils;
 @Service
 public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implements CustomerService {
@@ -38,12 +44,22 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
 	private AdminMapper adminMapper;
 	@Autowired
 	private CustomerLogMapper customerLogMapper;
+	@Autowired
+	private CustomerUserInfoMapper customerUserInfoMapper;
+	@Autowired
+	private CustomerOrganizationInfoMapper customerOrganizationInfoMapper;
+	@Autowired
+	private FollowUpRecordMapper followUpRecordMapper;
 	@Override
-	public int addCustomer(Customer cus) {
-		Date data =new Date();
+	public int addCustomer(Customer cus,CustomerUserInfo cui,CustomerOrganizationInfo coi,FollowUpRecord fur) {
+		//插入 customerUserInfo
+		customerUserInfoMapper.insert(cui);
+		//插入 customerOrganizationInfo
+		customerOrganizationInfoMapper.insert(coi);
+		//插入跟进表
+		followUpRecordMapper.insert(fur);
 		String paid = findLadderIds(TokenManager.getAdminId());//查询上级管理员ID集合
-		cus.setCreateTime(data);
-		cus.setAid(TokenManager.getAdminId());
+		if(StringUtils.isNotBlank(paid)) paid = paid.substring(0, paid.length()-1);	
 		cus.setPaid(paid);
 		int res = customerMapper.insert(cus);
 		return res;
@@ -72,7 +88,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
 			String newPaid = "";
 			for(Customer c:customers){
 				newPaid = findLadderIds(c.getAid());
-				if(!newPaid.equals("")) newPaid = newPaid.substring(0, newPaid.length()-1);
+				if(StringUtils.isNotBlank(newPaid)) newPaid = newPaid.substring(0, newPaid.length()-1);
 				c.setPaid(newPaid);
 				customerMapper.updateByPrimaryKeySelective(c);
 			}
@@ -159,7 +175,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
 	private CustomerOut setFiled(CustomerOut co) {
 		switch(co.getCustomerType()){
 			case 0 : co.set_customerType("个人客户") ;break;
-			case 1 : co.set_customerType("公司客户") ;break;
+			case 1 : co.set_customerType("机构单位") ;break;
 			case 2 : co.set_customerType("团体单位") ;break;
 		}
 		switch(co.getCustomerStatus()){
@@ -232,57 +248,64 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
 	}
 	
 	@Override
-	public void saveCustomerLog(CustomerIn cus,String operatorType,String cid){
+	public void saveCustomerLog(CustomerIn cus,String operatorType){
 		/* 记录日志 */
+		String cid = cus.getId();
 		CustomerLog log = new CustomerLog();
 		log.setId(UUID.randomUUID().toString());
 		log.setCid(cid);
 		log.setOperatorTime(new SimpleDateFormat(AFTConstants.YYYYMMDDHHMMSS).format(new Date()));
 		log.setOperatorName(TokenManager.getAdminToken().getName());
 		Customer c =  customerMapper.selectByPrimaryKey(cid) ;
+		
 		if(operatorType.equals(AFTConstants.CUSTOMER_CREATE)){//创建用户
 			log.setAfterFollowSituation(CustomerFollowFiled.getField(Integer.parseInt(cus.getFollowSituation())).getDesc()); //跟进状态
 			log.setAfterCustomerIntention(getCompanyIntention(cus.getCompanyIntention())); //跟进意向
 			log.setAfterCustomerStatus(CustomerStatusFiled.getField(Integer.parseInt(cus.getCustomerStatus())).getDesc()); //客户状态
 			log.setAfterAdminName(TokenManager.getAdminToken().getName());
 			log.setOperatorType(AFTConstants.CUSTOMER_CREATE);
-		}else if(operatorType.equals(AFTConstants.CUSTOMER_MODIFY)){ //修改用户
-			log.setBeforeAdminName(cus.getBeforeAdminName());//修改前操作人
+		}else if(operatorType.equals(AFTConstants.CUSTOMER_MODIFY)){ //修改客户
+			String beforeAdminName = adminMapper.selectByPrimaryKey(c.getAid()).getName();
+			log.setBeforeAdminName(beforeAdminName);//修改前操作人
 			log.setBeforeCustomerIntention(getCompanyIntention(c.getCompanyIntention())); //修改前跟进意向
 			log.setBeforeCustomerStatus(CustomerStatusFiled.getField(c.getCustomerStatus()).getDesc()); //修改前跟进状态
 			log.setBeforeFollowSituation(CustomerFollowFiled.getField(c.getFollowSituation()).getDesc());//修改前跟进进度
+			log.setAfterAdminName(TokenManager.getAdminToken().getName());
 			log.setAfterFollowSituation(CustomerFollowFiled.getField(Integer.parseInt(cus.getFollowSituation())).getDesc()); //修改后跟进状态
 			log.setAfterCustomerIntention(getCompanyIntention(cus.getCompanyIntention())); //修改后跟进意向
 			log.setAfterCustomerStatus(CustomerStatusFiled.getField(Integer.parseInt(cus.getCustomerStatus())).getDesc()); //修改后客户状态
 			log.setOperatorType(AFTConstants.CUSTOMER_MODIFY);
-		}else if(operatorType.equals(AFTConstants.CUSTOMER_DELETE)){ //删除用户
-			log.setBeforeAdminName(cus.getBeforeAdminName());
-			log.setBeforeCustomerIntention(getCompanyIntention(cus.getBeforeCompanyIntention())); //跟进意向
-			log.setBeforeCustomerStatus(CustomerStatusFiled.getField(Integer.parseInt(cus.getBeforeCustomerStatus())).getDesc()); //跟进状态
-			log.setBeforeFollowSituation(CustomerFollowFiled.getField(Integer.parseInt(cus.getBeforeFollowSituation())).getDesc());//跟进进度
+		}else if(operatorType.equals(AFTConstants.CUSTOMER_DELETE)){ //删除客户
+			String beforeAdminName = adminMapper.selectByPrimaryKey(c.getAid()).getName();
+			log.setBeforeAdminName(beforeAdminName); //删除前跟进人
+			log.setBeforeCustomerIntention(getCompanyIntention(c.getCompanyIntention())); //删除前跟进意向
+			log.setBeforeCustomerStatus(CustomerStatusFiled.getField(c.getCustomerStatus()).getDesc()); //删除前跟进状态
+			log.setBeforeFollowSituation(CustomerFollowFiled.getField(c.getFollowSituation()).getDesc());//删除前跟进进度
 			log.setOperatorType(AFTConstants.CUSTOMER_DELETE);
 		}else if(operatorType.equals(AFTConstants.CUSTOMER_TRANSFER)){ //转交客户
 			log.setBeforeAdminName(cus.getBeforeAdminName());//转交前的人
 			log.setAfterAdminName(cus.getAdminName());//转交后的人
-			log.setBeforeCustomerIntention(getCompanyIntention(cus.getBeforeCompanyIntention())); //修改前跟进意向
-			log.setBeforeCustomerStatus(CustomerStatusFiled.getField(Integer.parseInt(cus.getBeforeCustomerStatus())).getDesc()); //修改前跟进状态
-			log.setBeforeFollowSituation(CustomerFollowFiled.getField(Integer.parseInt(cus.getBeforeFollowSituation())).getDesc());//修改前跟进进度
+			log.setBeforeCustomerIntention(getCompanyIntention(c.getCompanyIntention())); //转交前跟进意向
+			log.setBeforeCustomerStatus(CustomerStatusFiled.getField(c.getCustomerStatus()).getDesc()); //转交前跟进状态
+			log.setBeforeFollowSituation(CustomerFollowFiled.getField(c.getFollowSituation()).getDesc());//转交前跟进进度
 			log.setOperatorType(AFTConstants.CUSTOMER_TRANSFER);
-		}else if(operatorType.equals(AFTConstants.CUSTOMER_RECEIVE)){ //领取
-			log.setBeforeAdminName(cus.getBeforeAdminName());//领取前的人
+		}else if(operatorType.equals(AFTConstants.CUSTOMER_RECEIVE)){ //领取客户
+			String beforeAdminName = adminMapper.selectByPrimaryKey(c.getAid()).getName();
+			log.setBeforeAdminName(beforeAdminName);//领取前的人
 			log.setAfterAdminName(TokenManager.getAdminToken().getName());//领取后跟进人
-			log.setBeforeCustomerIntention(getCompanyIntention(cus.getBeforeCompanyIntention())); //领取前跟进意向
-			log.setBeforeCustomerStatus(CustomerStatusFiled.getField(Integer.parseInt(cus.getBeforeCustomerStatus())).getDesc()); //领取前跟进状态
-			log.setBeforeFollowSituation(CustomerFollowFiled.getField(Integer.parseInt(cus.getBeforeFollowSituation())).getDesc());//领取前跟进进度
+			log.setBeforeCustomerIntention(getCompanyIntention(c.getCompanyIntention())); //领取前跟进意向
+			log.setBeforeCustomerStatus(CustomerStatusFiled.getField(c.getCustomerStatus()).getDesc()); //领取前跟进状态
+			log.setBeforeFollowSituation(CustomerFollowFiled.getField(c.getFollowSituation()).getDesc());//领取前跟进进度
 			log.setOperatorType(AFTConstants.CUSTOMER_RECEIVE);
 		}else if(operatorType.equals(AFTConstants.CUSTOMER_TO_PUBLIC)){ //转为公共客户
 			log.setBeforeAdminName(cus.getBeforeAdminName());//转为公共客户前跟进人
-			log.setBeforeCustomerIntention(getCompanyIntention(cus.getBeforeCompanyIntention())); //修改前跟进意向
-			log.setBeforeCustomerStatus(CustomerStatusFiled.getField(Integer.parseInt(cus.getBeforeCustomerStatus())).getDesc()); //修改前跟进状态
-			log.setBeforeFollowSituation(CustomerFollowFiled.getField(Integer.parseInt(cus.getBeforeFollowSituation())).getDesc());//修改前跟进进度
+			log.setBeforeCustomerIntention(getCompanyIntention(c.getCompanyIntention())); //转换前跟进意向
+			log.setBeforeCustomerStatus(CustomerStatusFiled.getField(c.getCustomerStatus()).getDesc()); //转换前跟进状态
+			log.setBeforeFollowSituation(CustomerFollowFiled.getField(c.getFollowSituation()).getDesc());//转换前跟进进度
 			log.setOperatorType(AFTConstants.CUSTOMER_TO_PUBLIC);
 		}else if(operatorType.equals(AFTConstants.CUSTOMER_FOLLOW)){ //跟进客户
-			log.setBeforeAdminName(TokenManager.getAdminToken().getName());//跟进前操作人
+			String beforeAdminName = adminMapper.selectByPrimaryKey(c.getAid()).getName();
+			log.setBeforeAdminName(beforeAdminName);//跟进前操作人
 			log.setBeforeCustomerIntention(getCompanyIntention(c.getCompanyIntention())); //修改前跟进意向
 			log.setBeforeCustomerStatus(CustomerStatusFiled.getField(c.getCustomerStatus()).getDesc()); //修改前跟进状态
 			log.setBeforeFollowSituation(CustomerFollowFiled.getField(c.getFollowSituation()).getDesc());//修改前跟进进度
@@ -314,7 +337,9 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
 	 */
 	@Override
 	public int updateCustomer(Customer c) {
+		//修改主表
 		 return customerMapper.updateByPrimaryKeySelective(c);
+		
 	}
 	
 	/**

+ 1 - 1
src/main/resources/props/config_local.properties

@@ -54,7 +54,7 @@ session.validate.timespan=18000000
 app.name=AFT
 template.cacheable=false
 
-static.host=//sb.jishutao.com/1.0.47
+static.host=//sb.jishutao.com/1.0.48
 portal.host=//sf.jishutao.com/portal/2.0.6
 avatar.host=//sb.jishutao.com
 avatar.upload.host=//sb.jishutao.com/upload

+ 1 - 1
src/main/resources/props/config_test.properties

@@ -54,7 +54,7 @@ session.validate.timespan=18000000
 app.name=AFT
 template.cacheable=false
 
-static.host=//static.jishutao.com/1.0.47
+static.host=//static.jishutao.com/1.0.48
 portal.host=//static.jishutao.com/portal/2.0.6
 avatar.host=//static.jishutao.com
 avatar.upload.host=//static.jishutao.com/upload