anderx лет назад: 4
Родитель
Сommit
61de3df958
20 измененных файлов с 909 добавлено и 789 удалено
  1. 1 1
      GeneratorConfig.xml
  2. 2 0
      src/main/java/com/goafanti/common/dao/OrganizationContactBookMapper.java
  3. 37 42
      src/main/java/com/goafanti/common/dao/UserChannelMapper.java
  4. 2 0
      src/main/java/com/goafanti/common/dao/UserFollowMapper.java
  5. 5 0
      src/main/java/com/goafanti/common/dao/UserMapper.java
  6. 9 0
      src/main/java/com/goafanti/common/mapper/OrganizationContactBookMapper.xml
  7. 39 26
      src/main/java/com/goafanti/common/mapper/UserChannelMapper.xml
  8. 434 429
      src/main/java/com/goafanti/common/mapper/UserFollowMapper.xml
  9. 2 2
      src/main/java/com/goafanti/common/mapper/UserLockReleaseMapper.xml
  10. 36 13
      src/main/java/com/goafanti/common/mapper/UserMapperExt.xml
  11. 189 228
      src/main/java/com/goafanti/common/model/UserChannel.java
  12. 2 2
      src/main/java/com/goafanti/common/task/ReleaseUserTask.java
  13. 7 0
      src/main/java/com/goafanti/customer/bo/InputListChannel.java
  14. 14 2
      src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java
  15. 11 1
      src/main/java/com/goafanti/customer/service/CustomerService.java
  16. 37 10
      src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java
  17. 37 7
      src/main/java/com/goafanti/user/bo/OutUserChannel.java
  18. 4 0
      src/main/java/com/goafanti/user/service/UserService.java
  19. 32 26
      src/main/java/com/goafanti/user/service/impl/UserChannelServiceImpl.java
  20. 9 0
      src/main/java/com/goafanti/user/service/impl/UserServiceImpl.java

+ 1 - 1
GeneratorConfig.xml

@@ -43,7 +43,7 @@
     <property name="enableSubPackages" value="false"/>
      <property name="nullCatalogMeansCurrent" value="true"/>
     </javaClientGenerator>
-    <table schema="aft" tableName="user_transfer_log"   enableCountByExample="false"
+    <table schema="aft" tableName="user_channel"   enableCountByExample="false"
                enableUpdateByExample="false"
                enableDeleteByExample="false"
                enableSelectByExample="false"

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

@@ -88,4 +88,6 @@ public interface OrganizationContactBookMapper {
 	void updateAdmin(@Param("uid")String uid, @Param("aid")String aid);
 
 	void insertBatch(List<InputUserChannel> list);
+
+	void updateByUids(@Param("list")List<String> list, @Param("aid")String aid);
 }

+ 37 - 42
src/main/java/com/goafanti/common/dao/UserChannelMapper.java

@@ -1,5 +1,6 @@
 package com.goafanti.common.dao;
 
+import java.util.Date;
 import java.util.List;
 
 import org.apache.ibatis.annotations.Param;
@@ -10,57 +11,51 @@ import com.goafanti.user.bo.OutUserChannel;
 
 public interface UserChannelMapper {
     /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table user_channel
-     *
-     * @mbg.generated Thu Apr 22 09:06:45 CST 2021
-     */
-    int deleteByPrimaryKey(Integer id);
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_channel
+	 * @mbg.generated  Sun Apr 25 09:04:26 CST 2021
+	 */
+	int deleteByPrimaryKey(Integer id);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table user_channel
-     *
-     * @mbg.generated Thu Apr 22 09:06:45 CST 2021
-     */
-    int insert(UserChannel record);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table user_channel
-     *
-     * @mbg.generated Thu Apr 22 09:06:45 CST 2021
-     */
-    int insertSelective(UserChannel record);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_channel
+	 * @mbg.generated  Sun Apr 25 09:04:26 CST 2021
+	 */
+	int insert(UserChannel record);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table user_channel
-     *
-     * @mbg.generated Thu Apr 22 09:06:45 CST 2021
-     */
-    UserChannel selectByPrimaryKey(Integer id);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table user_channel
-     *
-     * @mbg.generated Thu Apr 22 09:06:45 CST 2021
-     */
-    int updateByPrimaryKeySelective(UserChannel record);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_channel
+	 * @mbg.generated  Sun Apr 25 09:04:26 CST 2021
+	 */
+	int insertSelective(UserChannel record);
+
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_channel
+	 * @mbg.generated  Sun Apr 25 09:04:26 CST 2021
+	 */
+	UserChannel selectByPrimaryKey(Integer id);
+
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_channel
+	 * @mbg.generated  Sun Apr 25 09:04:26 CST 2021
+	 */
+	int updateByPrimaryKeySelective(UserChannel record);
+
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_channel
+	 * @mbg.generated  Sun Apr 25 09:04:26 CST 2021
+	 */
+	int updateByPrimaryKey(UserChannel record);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table user_channel
-     *
-     * @mbg.generated Thu Apr 22 09:06:45 CST 2021
-     */
-    int updateByPrimaryKey(UserChannel record);
 
 	void insertBatch(List<InputUserChannel> list);
 
 
-	void updateByuids(@Param("list")List<String> list, @Param("status")Integer status);
+	void updateByuids(@Param("list")List<String> list, @Param("status")Integer status, @Param("date")Date date);
 
 	int deleteByIds(List<String> list);
 

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

@@ -76,5 +76,7 @@ public interface UserFollowMapper {
 
 	int pushUserGuidance(@Param("id")String id, @Param("guidance")Integer guidance);
 
+	List<UserFollow> selectbyUid(@Param("uid")String uid,@Param("aid")String aid);
+
 	
 }

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

@@ -7,6 +7,7 @@ import java.util.Map;
 import org.apache.ibatis.annotations.Param;
 
 import com.goafanti.app.bo.UserBasicInfo;
+import com.goafanti.common.bo.userDaysBo;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.OrganizationContactBook;
 import com.goafanti.common.model.User;
@@ -285,6 +286,10 @@ public interface UserMapper {
 
 	int updatechannelCustomerDeliver(@Param("list")List<String> list, @Param("aid")String aid);
 
+	void updateReleaseUserChannel(List<userDaysBo> newCList);
+
+	String checkBeforeChannel(String uid);
+
 	
 	
 }

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

@@ -475,4 +475,13 @@
       #{item.contactMobile,jdbcType=VARCHAR},1)
     </foreach>
   </insert>
+  <update id="updateByUids">
+  update organization_contact_book
+		set aid= #{aid}
+      where uid in(
+      <foreach item="item" index="index" collection="list" separator=",">
+      #{item}
+    </foreach>
+      )
+  </update>
 </mapper>

+ 39 - 26
src/main/java/com/goafanti/common/mapper/UserChannelMapper.xml

@@ -5,7 +5,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Apr 22 09:06:45 CST 2021.
+      This element was generated on Sun Apr 25 09:04:26 CST 2021.
     -->
     <id column="id" jdbcType="INTEGER" property="id" />
     <result column="uid" jdbcType="VARCHAR" property="uid" />
@@ -13,20 +13,21 @@
     <result column="status" jdbcType="INTEGER" property="status" />
     <result column="distribution_time" jdbcType="TIMESTAMP" property="distributionTime" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
   </resultMap>
   <sql id="Base_Column_List">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Apr 22 09:06:45 CST 2021.
+      This element was generated on Sun Apr 25 09:04:26 CST 2021.
     -->
-    id, `uid`, aid, `status`, distribution_time, create_time
+    id, `uid`, aid, `status`, distribution_time, create_time, remarks
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Apr 22 09:06:45 CST 2021.
+      This element was generated on Sun Apr 25 09:04:26 CST 2021.
     -->
     select 
     <include refid="Base_Column_List" />
@@ -37,7 +38,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Apr 22 09:06:45 CST 2021.
+      This element was generated on Sun Apr 25 09:04:26 CST 2021.
     -->
     delete from user_channel
     where id = #{id,jdbcType=INTEGER}
@@ -46,20 +47,20 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Apr 22 09:06:45 CST 2021.
+      This element was generated on Sun Apr 25 09:04:26 CST 2021.
     -->
     insert into user_channel (id, `uid`, aid, 
-      `status`, distribution_time, create_time
-      )
+      `status`, distribution_time, create_time, 
+      remarks)
     values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, 
-      #{status,jdbcType=INTEGER}, #{distributionTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}
-      )
+      #{status,jdbcType=INTEGER}, #{distributionTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{remarks,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.UserChannel">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Apr 22 09:06:45 CST 2021.
+      This element was generated on Sun Apr 25 09:04:26 CST 2021.
     -->
     insert into user_channel
     <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -81,6 +82,9 @@
       <if test="createTime != null">
         create_time,
       </if>
+      <if test="remarks != null">
+        remarks,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -101,13 +105,16 @@
       <if test="createTime != null">
         #{createTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="remarks != null">
+        #{remarks,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.UserChannel">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Apr 22 09:06:45 CST 2021.
+      This element was generated on Sun Apr 25 09:04:26 CST 2021.
     -->
     update user_channel
     <set>
@@ -126,6 +133,9 @@
       <if test="createTime != null">
         create_time = #{createTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="remarks != null">
+        remarks = #{remarks,jdbcType=VARCHAR},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
@@ -133,29 +143,30 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Apr 22 09:06:45 CST 2021.
+      This element was generated on Sun Apr 25 09:04:26 CST 2021.
     -->
     update user_channel
     set `uid` = #{uid,jdbcType=VARCHAR},
       aid = #{aid,jdbcType=VARCHAR},
       `status` = #{status,jdbcType=INTEGER},
       distribution_time = #{distributionTime,jdbcType=TIMESTAMP},
-      create_time = #{createTime,jdbcType=TIMESTAMP}
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      remarks = #{remarks,jdbcType=VARCHAR}
     where id = #{id,jdbcType=INTEGER}
   </update>
   
     <insert id="insertBatch" parameterType="com.goafanti.user.bo.InputUserChannel">
        insert into user_channel ( `uid`, aid, 
-      `status`)VALUES
-      <foreach item="item" index="index" collection="list" separator=",">
-      (#{item.uid,jdbcType=VARCHAR}, #{item.aid,jdbcType=VARCHAR},#{item.status}
-      )
+      `status`,remarks)VALUES
+      <foreach collection="list" index="index" item="item" separator=",">
+      (#{item.uid,jdbcType=VARCHAR}, #{item.aid,jdbcType=VARCHAR},#{item.status},
+      #{item.remarks})
     </foreach>
     </insert>
     
     <select id="selectByAidAndstatusList" resultType="com.goafanti.user.bo.OutUserChannel">
  	   select a.id,a.uid,b.nickname userName,a.aid,a.status,date_format(a.distribution_time,'%Y-%m-%d %H:%i:%S')distributionTimes,
- 	date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimes ,c.contacts ,c.contact_mobile contactMobile,
+ 	date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimes ,c.contacts ,c.contact_mobile contactMobile,a.remarks,
  	b.society_tag societyTag ,d1.name province,d2.name city from user_channel a
     left join user b on a.uid=b.id  left join organization_identity c on a.uid =c.uid 
     left join district_glossory d1 on c.location_province =d1.id 
@@ -164,8 +175,8 @@
     <if test="aid !=null">
     and a.aid= #{aid} 
     </if>
-    <if test="status !=null">
-    and a.status =#{status}
+    <if test="type == 1">
+    and a.status &gt; 1
     </if>
     <if test="page_sql != null">
     	${page_sql}
@@ -181,22 +192,24 @@
     <if test="aid !=null">
     and a.aid= #{aid} 
     </if>
-    <if test="status !=null">
-    and a.status =#{status}
+      <if test="type == 1">
+    and a.status &gt; 1
     </if>
-    
     </select>
     <update id="updateByuids">
      update user_channel set status = #{status}
+     <if test="date !=null">
+     ,distribution_time= #{date}
+     </if>
 	where uid in( 
-      <foreach item="item" index="index" collection="list" separator=",">
+      <foreach collection="list" index="index" item="item" separator=",">
       #{item}
     </foreach>
       )
     </update>
     <delete id="deleteByIds">
     delete from user_channel where id in (
-      <foreach item="item" index="index" collection="list" separator=",">
+      <foreach collection="list" index="index" item="item" separator=",">
       #{item}
     </foreach>
     )

+ 434 - 429
src/main/java/com/goafanti/common/mapper/UserFollowMapper.xml

@@ -1,433 +1,438 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.goafanti.common.dao.UserFollowMapper">
-  <resultMap id="BaseResultMap" type="com.goafanti.common.model.UserFollow">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sat Oct 10 10:18:15 CST 2020.
-    -->
-    <id column="id" jdbcType="VARCHAR" property="id" />
-    <result column="uid" jdbcType="VARCHAR" property="uid" />
-    <result column="aid" jdbcType="VARCHAR" property="aid" />
-    <result column="paid" jdbcType="VARCHAR" property="paid" />
-    <result column="result" jdbcType="VARCHAR" property="result" />
-    <result column="attachment_url" jdbcType="VARCHAR" property="attachmentUrl" />
-    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
-    <result column="ocb_id" jdbcType="VARCHAR" property="ocbId" />
-    <result column="contact_type" jdbcType="INTEGER" property="contactType" />
-    <result column="effective" jdbcType="INTEGER" property="effective" />
-    <result column="time_stamp" jdbcType="TIMESTAMP" property="timeStamp" />
-    <result column="follow_count" jdbcType="INTEGER" property="followCount" />
-    <result column="guidance" jdbcType="VARCHAR" property="guidance" />
-    <result column="guidance_time" jdbcType="TIMESTAMP" property="guidanceTime" />
-  </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 Sat Oct 10 10:18:15 CST 2020.
-    -->
-    <where>
-      <foreach collection="oredCriteria" item="criteria" separator="or">
-        <if test="criteria.valid">
-          <trim prefix="(" prefixOverrides="and" suffix=")">
-            <foreach collection="criteria.criteria" item="criterion">
-              <choose>
-                <when test="criterion.noValue">
-                  and ${criterion.condition}
-                </when>
-                <when test="criterion.singleValue">
-                  and ${criterion.condition} #{criterion.value}
-                </when>
-                <when test="criterion.betweenValue">
-                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
-                </when>
-                <when test="criterion.listValue">
-                  and ${criterion.condition}
-                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
-                    #{listItem}
-                  </foreach>
-                </when>
-              </choose>
-            </foreach>
-          </trim>
-        </if>
-      </foreach>
-    </where>
-  </sql>
-  <sql id="Update_By_Example_Where_Clause">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sat Oct 10 10:18:15 CST 2020.
-    -->
-    <where>
-      <foreach collection="example.oredCriteria" item="criteria" separator="or">
-        <if test="criteria.valid">
-          <trim prefix="(" prefixOverrides="and" suffix=")">
-            <foreach collection="criteria.criteria" item="criterion">
-              <choose>
-                <when test="criterion.noValue">
-                  and ${criterion.condition}
-                </when>
-                <when test="criterion.singleValue">
-                  and ${criterion.condition} #{criterion.value}
-                </when>
-                <when test="criterion.betweenValue">
-                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
-                </when>
-                <when test="criterion.listValue">
-                  and ${criterion.condition}
-                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
-                    #{listItem}
-                  </foreach>
-                </when>
-              </choose>
-            </foreach>
-          </trim>
-        </if>
-      </foreach>
-    </where>
-  </sql>
-  <sql id="Base_Column_List">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sat Oct 10 10:18:15 CST 2020.
-    -->
-    id, uid, aid, paid, result, attachment_url, create_time, ocb_id, contact_type, effective, 
-    time_stamp, follow_count, guidance, guidance_time
-  </sql>
-  <select id="selectByExample" parameterType="com.goafanti.common.model.UserFollowExample" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sat Oct 10 10:18:15 CST 2020.
-    -->
-    select
-    <if test="distinct">
-      distinct
-    </if>
-    <include refid="Base_Column_List" />
-    from user_follow
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-    <if test="orderByClause != null">
-      order by ${orderByClause}
-    </if>
-  </select>
-  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sat Oct 10 10:18:15 CST 2020.
-    -->
-    select 
-    <include refid="Base_Column_List" />
-    from user_follow
-    where id = #{id,jdbcType=VARCHAR}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sat Oct 10 10:18:15 CST 2020.
-    -->
-    delete from user_follow
-    where id = #{id,jdbcType=VARCHAR}
-  </delete>
-  <delete id="deleteByExample" parameterType="com.goafanti.common.model.UserFollowExample">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sat Oct 10 10:18:15 CST 2020.
-    -->
-    delete from user_follow
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </delete>
-  <insert id="insert" parameterType="com.goafanti.common.model.UserFollow">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sat Oct 10 10:18:15 CST 2020.
-    -->
-    insert into user_follow (id, uid, aid, 
-      paid, result, attachment_url, 
-      create_time, ocb_id, contact_type, 
-      effective, time_stamp, follow_count, 
-      guidance, guidance_time)
-    values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, 
-      #{paid,jdbcType=VARCHAR}, #{result,jdbcType=VARCHAR}, #{attachmentUrl,jdbcType=VARCHAR}, 
-      #{createTime,jdbcType=TIMESTAMP}, #{ocbId,jdbcType=VARCHAR}, #{contactType,jdbcType=INTEGER}, 
-      #{effective,jdbcType=INTEGER}, #{timeStamp,jdbcType=TIMESTAMP}, #{followCount,jdbcType=INTEGER}, 
-      #{guidance,jdbcType=VARCHAR}, #{guidanceTime,jdbcType=TIMESTAMP})
-  </insert>
-  <insert id="insertSelective" parameterType="com.goafanti.common.model.UserFollow">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sat Oct 10 10:18:15 CST 2020.
-    -->
-    insert into user_follow
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        id,
-      </if>
-      <if test="uid != null">
-        uid,
-      </if>
-      <if test="aid != null">
-        aid,
-      </if>
-      <if test="paid != null">
-        paid,
-      </if>
-      <if test="result != null">
-        result,
-      </if>
-      <if test="attachmentUrl != null">
-        attachment_url,
-      </if>
-      <if test="createTime != null">
-        create_time,
-      </if>
-      <if test="ocbId != null">
-        ocb_id,
-      </if>
-      <if test="contactType != null">
-        contact_type,
-      </if>
-      <if test="effective != null">
-        effective,
-      </if>
-      <if test="timeStamp != null">
-        time_stamp,
-      </if>
-      <if test="followCount != null">
-        follow_count,
-      </if>
-      <if test="guidance != null">
-        guidance,
-      </if>
-      <if test="guidanceTime != null">
-        guidance_time,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        #{id,jdbcType=VARCHAR},
-      </if>
-      <if test="uid != null">
-        #{uid,jdbcType=VARCHAR},
-      </if>
-      <if test="aid != null">
-        #{aid,jdbcType=VARCHAR},
-      </if>
-      <if test="paid != null">
-        #{paid,jdbcType=VARCHAR},
-      </if>
-      <if test="result != null">
-        #{result,jdbcType=VARCHAR},
-      </if>
-      <if test="attachmentUrl != null">
-        #{attachmentUrl,jdbcType=VARCHAR},
-      </if>
-      <if test="createTime != null">
-        #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="ocbId != null">
-        #{ocbId,jdbcType=VARCHAR},
-      </if>
-      <if test="contactType != null">
-        #{contactType,jdbcType=INTEGER},
-      </if>
-      <if test="effective != null">
-        #{effective,jdbcType=INTEGER},
-      </if>
-      <if test="timeStamp != null">
-        #{timeStamp,jdbcType=TIMESTAMP},
-      </if>
-      <if test="followCount != null">
-        #{followCount,jdbcType=INTEGER},
-      </if>
-      <if test="guidance != null">
-        #{guidance,jdbcType=VARCHAR},
-      </if>
-      <if test="guidanceTime != null">
-        #{guidanceTime,jdbcType=TIMESTAMP},
-      </if>
-    </trim>
-  </insert>
-  <select id="countByExample" parameterType="com.goafanti.common.model.UserFollowExample" resultType="java.lang.Long">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sat Oct 10 10:18:15 CST 2020.
-    -->
-    select count(*) from user_follow
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </select>
-  <update id="updateByExampleSelective" parameterType="map">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sat Oct 10 10:18:15 CST 2020.
-    -->
-    update user_follow
-    <set>
-      <if test="record.id != null">
-        id = #{record.id,jdbcType=VARCHAR},
-      </if>
-      <if test="record.uid != null">
-        uid = #{record.uid,jdbcType=VARCHAR},
-      </if>
-      <if test="record.aid != null">
-        aid = #{record.aid,jdbcType=VARCHAR},
-      </if>
-      <if test="record.paid != null">
-        paid = #{record.paid,jdbcType=VARCHAR},
-      </if>
-      <if test="record.result != null">
-        result = #{record.result,jdbcType=VARCHAR},
-      </if>
-      <if test="record.attachmentUrl != null">
-        attachment_url = #{record.attachmentUrl,jdbcType=VARCHAR},
-      </if>
-      <if test="record.createTime != null">
-        create_time = #{record.createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="record.ocbId != null">
-        ocb_id = #{record.ocbId,jdbcType=VARCHAR},
-      </if>
-      <if test="record.contactType != null">
-        contact_type = #{record.contactType,jdbcType=INTEGER},
-      </if>
-      <if test="record.effective != null">
-        effective = #{record.effective,jdbcType=INTEGER},
-      </if>
-      <if test="record.timeStamp != null">
-        time_stamp = #{record.timeStamp,jdbcType=TIMESTAMP},
-      </if>
-      <if test="record.followCount != null">
-        follow_count = #{record.followCount,jdbcType=INTEGER},
-      </if>
-      <if test="record.guidance != null">
-        guidance = #{record.guidance,jdbcType=VARCHAR},
-      </if>
-      <if test="record.guidanceTime != null">
-        guidance_time = #{record.guidanceTime,jdbcType=TIMESTAMP},
-      </if>
-    </set>
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
-  <update id="updateByExample" parameterType="map">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sat Oct 10 10:18:15 CST 2020.
-    -->
-    update user_follow
-    set id = #{record.id,jdbcType=VARCHAR},
-      uid = #{record.uid,jdbcType=VARCHAR},
-      aid = #{record.aid,jdbcType=VARCHAR},
-      paid = #{record.paid,jdbcType=VARCHAR},
-      result = #{record.result,jdbcType=VARCHAR},
-      attachment_url = #{record.attachmentUrl,jdbcType=VARCHAR},
-      create_time = #{record.createTime,jdbcType=TIMESTAMP},
-      ocb_id = #{record.ocbId,jdbcType=VARCHAR},
-      contact_type = #{record.contactType,jdbcType=INTEGER},
-      effective = #{record.effective,jdbcType=INTEGER},
-      time_stamp = #{record.timeStamp,jdbcType=TIMESTAMP},
-      follow_count = #{record.followCount,jdbcType=INTEGER},
-      guidance = #{record.guidance,jdbcType=VARCHAR},
-      guidance_time = #{record.guidanceTime,jdbcType=TIMESTAMP}
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
-  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.UserFollow">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sat Oct 10 10:18:15 CST 2020.
-    -->
-    update user_follow
-    <set>
-      <if test="uid != null">
-        uid = #{uid,jdbcType=VARCHAR},
-      </if>
-      <if test="aid != null">
-        aid = #{aid,jdbcType=VARCHAR},
-      </if>
-      <if test="paid != null">
-        paid = #{paid,jdbcType=VARCHAR},
-      </if>
-      <if test="result != null">
-        result = #{result,jdbcType=VARCHAR},
-      </if>
-      <if test="attachmentUrl != null">
-        attachment_url = #{attachmentUrl,jdbcType=VARCHAR},
-      </if>
-      <if test="createTime != null">
-        create_time = #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="ocbId != null">
-        ocb_id = #{ocbId,jdbcType=VARCHAR},
-      </if>
-      <if test="contactType != null">
-        contact_type = #{contactType,jdbcType=INTEGER},
-      </if>
-      <if test="effective != null">
-        effective = #{effective,jdbcType=INTEGER},
-      </if>
-      <if test="timeStamp != null">
-        time_stamp = #{timeStamp,jdbcType=TIMESTAMP},
-      </if>
-      <if test="followCount != null">
-        follow_count = #{followCount,jdbcType=INTEGER},
-      </if>
-      <if test="guidance != null">
-        guidance = #{guidance,jdbcType=VARCHAR},
-      </if>
-      <if test="guidanceTime != null">
-        guidance_time = #{guidanceTime,jdbcType=TIMESTAMP},
-      </if>
-    </set>
-    where id = #{id,jdbcType=VARCHAR}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.UserFollow">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Sat Oct 10 10:18:15 CST 2020.
-    -->
-    update user_follow
-    set uid = #{uid,jdbcType=VARCHAR},
-      aid = #{aid,jdbcType=VARCHAR},
-      paid = #{paid,jdbcType=VARCHAR},
-      result = #{result,jdbcType=VARCHAR},
-      attachment_url = #{attachmentUrl,jdbcType=VARCHAR},
-      create_time = #{createTime,jdbcType=TIMESTAMP},
-      ocb_id = #{ocbId,jdbcType=VARCHAR},
-      contact_type = #{contactType,jdbcType=INTEGER},
-      effective = #{effective,jdbcType=INTEGER},
-      time_stamp = #{timeStamp,jdbcType=TIMESTAMP},
-      follow_count = #{followCount,jdbcType=INTEGER},
-      guidance = #{guidance,jdbcType=VARCHAR},
-      guidance_time = #{guidanceTime,jdbcType=TIMESTAMP}
-    where id = #{id,jdbcType=VARCHAR}
-  </update>
-  <update id="pushUserGuidance" >
-  		update   user_follow b, `user` a
-	set a.guidance= #{guidance}
-	where a.id=b.uid and b.id= #{id}
-  </update>
+	<resultMap id="BaseResultMap"
+		type="com.goafanti.common.model.UserFollow">
+		<!-- WARNING - @mbg.generated This element is automatically generated by 
+			MyBatis Generator, do not modify. This element was generated on Sat Oct 10 
+			10:18:15 CST 2020. -->
+		<id column="id" jdbcType="VARCHAR" property="id" />
+		<result column="uid" jdbcType="VARCHAR" property="uid" />
+		<result column="aid" jdbcType="VARCHAR" property="aid" />
+		<result column="paid" jdbcType="VARCHAR" property="paid" />
+		<result column="result" jdbcType="VARCHAR" property="result" />
+		<result column="attachment_url" jdbcType="VARCHAR"
+			property="attachmentUrl" />
+		<result column="create_time" jdbcType="TIMESTAMP"
+			property="createTime" />
+		<result column="ocb_id" jdbcType="VARCHAR" property="ocbId" />
+		<result column="contact_type" jdbcType="INTEGER"
+			property="contactType" />
+		<result column="effective" jdbcType="INTEGER"
+			property="effective" />
+		<result column="time_stamp" jdbcType="TIMESTAMP"
+			property="timeStamp" />
+		<result column="follow_count" jdbcType="INTEGER"
+			property="followCount" />
+		<result column="guidance" jdbcType="VARCHAR"
+			property="guidance" />
+		<result column="guidance_time" jdbcType="TIMESTAMP"
+			property="guidanceTime" />
+	</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 Sat Oct 10 
+			10:18:15 CST 2020. -->
+		<where>
+			<foreach collection="oredCriteria" item="criteria"
+				separator="or">
+				<if test="criteria.valid">
+					<trim prefix="(" prefixOverrides="and" suffix=")">
+						<foreach collection="criteria.criteria" item="criterion">
+							<choose>
+								<when test="criterion.noValue">
+									and ${criterion.condition}
+								</when>
+								<when test="criterion.singleValue">
+									and ${criterion.condition} #{criterion.value}
+								</when>
+								<when test="criterion.betweenValue">
+									and ${criterion.condition} #{criterion.value} and
+									#{criterion.secondValue}
+								</when>
+								<when test="criterion.listValue">
+									and ${criterion.condition}
+									<foreach close=")" collection="criterion.value"
+										item="listItem" open="(" separator=",">
+										#{listItem}
+									</foreach>
+								</when>
+							</choose>
+						</foreach>
+					</trim>
+				</if>
+			</foreach>
+		</where>
+	</sql>
+	<sql id="Update_By_Example_Where_Clause">
+		<!-- WARNING - @mbg.generated This element is automatically generated by 
+			MyBatis Generator, do not modify. This element was generated on Sat Oct 10 
+			10:18:15 CST 2020. -->
+		<where>
+			<foreach collection="example.oredCriteria" item="criteria"
+				separator="or">
+				<if test="criteria.valid">
+					<trim prefix="(" prefixOverrides="and" suffix=")">
+						<foreach collection="criteria.criteria" item="criterion">
+							<choose>
+								<when test="criterion.noValue">
+									and ${criterion.condition}
+								</when>
+								<when test="criterion.singleValue">
+									and ${criterion.condition} #{criterion.value}
+								</when>
+								<when test="criterion.betweenValue">
+									and ${criterion.condition} #{criterion.value} and
+									#{criterion.secondValue}
+								</when>
+								<when test="criterion.listValue">
+									and ${criterion.condition}
+									<foreach close=")" collection="criterion.value"
+										item="listItem" open="(" separator=",">
+										#{listItem}
+									</foreach>
+								</when>
+							</choose>
+						</foreach>
+					</trim>
+				</if>
+			</foreach>
+		</where>
+	</sql>
+	<sql id="Base_Column_List">
+		<!-- WARNING - @mbg.generated This element is automatically generated by 
+			MyBatis Generator, do not modify. This element was generated on Sat Oct 10 
+			10:18:15 CST 2020. -->
+		id, uid, aid, paid, result, attachment_url, create_time, ocb_id,
+		contact_type, effective,
+		time_stamp, follow_count, guidance, guidance_time
+	</sql>
+	<select id="selectByExample"
+		parameterType="com.goafanti.common.model.UserFollowExample"
+		resultMap="BaseResultMap">
+		<!-- WARNING - @mbg.generated This element is automatically generated by 
+			MyBatis Generator, do not modify. This element was generated on Sat Oct 10 
+			10:18:15 CST 2020. -->
+		select
+		<if test="distinct">
+			distinct
+		</if>
+		<include refid="Base_Column_List" />
+		from user_follow
+		<if test="_parameter != null">
+			<include refid="Example_Where_Clause" />
+		</if>
+		<if test="orderByClause != null">
+			order by ${orderByClause}
+		</if>
+	</select>
+	<select id="selectByPrimaryKey" parameterType="java.lang.String"
+		resultMap="BaseResultMap">
+		<!-- WARNING - @mbg.generated This element is automatically generated by 
+			MyBatis Generator, do not modify. This element was generated on Sat Oct 10 
+			10:18:15 CST 2020. -->
+		select
+		<include refid="Base_Column_List" />
+		from user_follow
+		where id = #{id,jdbcType=VARCHAR}
+	</select>
+	<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+		<!-- WARNING - @mbg.generated This element is automatically generated by 
+			MyBatis Generator, do not modify. This element was generated on Sat Oct 10 
+			10:18:15 CST 2020. -->
+		delete from user_follow
+		where id = #{id,jdbcType=VARCHAR}
+	</delete>
+	<delete id="deleteByExample"
+		parameterType="com.goafanti.common.model.UserFollowExample">
+		<!-- WARNING - @mbg.generated This element is automatically generated by 
+			MyBatis Generator, do not modify. This element was generated on Sat Oct 10 
+			10:18:15 CST 2020. -->
+		delete from user_follow
+		<if test="_parameter != null">
+			<include refid="Example_Where_Clause" />
+		</if>
+	</delete>
+	<insert id="insert"
+		parameterType="com.goafanti.common.model.UserFollow">
+		<!-- WARNING - @mbg.generated This element is automatically generated by 
+			MyBatis Generator, do not modify. This element was generated on Sat Oct 10 
+			10:18:15 CST 2020. -->
+		insert into user_follow (id, uid, aid,
+		paid, result, attachment_url,
+		create_time, ocb_id, contact_type,
+		effective, time_stamp, follow_count,
+		guidance, guidance_time)
+		values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR},
+		#{aid,jdbcType=VARCHAR},
+		#{paid,jdbcType=VARCHAR}, #{result,jdbcType=VARCHAR}, #{attachmentUrl,jdbcType=VARCHAR},
+		#{createTime,jdbcType=TIMESTAMP}, #{ocbId,jdbcType=VARCHAR},
+		#{contactType,jdbcType=INTEGER},
+		#{effective,jdbcType=INTEGER}, #{timeStamp,jdbcType=TIMESTAMP}, #{followCount,jdbcType=INTEGER},
+		#{guidance,jdbcType=VARCHAR}, #{guidanceTime,jdbcType=TIMESTAMP})
+	</insert>
+	<insert id="insertSelective"
+		parameterType="com.goafanti.common.model.UserFollow">
+		<!-- WARNING - @mbg.generated This element is automatically generated by 
+			MyBatis Generator, do not modify. This element was generated on Sat Oct 10 
+			10:18:15 CST 2020. -->
+		insert into user_follow
+		<trim prefix="(" suffix=")" suffixOverrides=",">
+			<if test="id != null">
+				id,
+			</if>
+			<if test="uid != null">
+				uid,
+			</if>
+			<if test="aid != null">
+				aid,
+			</if>
+			<if test="paid != null">
+				paid,
+			</if>
+			<if test="result != null">
+				result,
+			</if>
+			<if test="attachmentUrl != null">
+				attachment_url,
+			</if>
+			<if test="createTime != null">
+				create_time,
+			</if>
+			<if test="ocbId != null">
+				ocb_id,
+			</if>
+			<if test="contactType != null">
+				contact_type,
+			</if>
+			<if test="effective != null">
+				effective,
+			</if>
+			<if test="timeStamp != null">
+				time_stamp,
+			</if>
+			<if test="followCount != null">
+				follow_count,
+			</if>
+			<if test="guidance != null">
+				guidance,
+			</if>
+			<if test="guidanceTime != null">
+				guidance_time,
+			</if>
+		</trim>
+		<trim prefix="values (" suffix=")" suffixOverrides=",">
+			<if test="id != null">
+				#{id,jdbcType=VARCHAR},
+			</if>
+			<if test="uid != null">
+				#{uid,jdbcType=VARCHAR},
+			</if>
+			<if test="aid != null">
+				#{aid,jdbcType=VARCHAR},
+			</if>
+			<if test="paid != null">
+				#{paid,jdbcType=VARCHAR},
+			</if>
+			<if test="result != null">
+				#{result,jdbcType=VARCHAR},
+			</if>
+			<if test="attachmentUrl != null">
+				#{attachmentUrl,jdbcType=VARCHAR},
+			</if>
+			<if test="createTime != null">
+				#{createTime,jdbcType=TIMESTAMP},
+			</if>
+			<if test="ocbId != null">
+				#{ocbId,jdbcType=VARCHAR},
+			</if>
+			<if test="contactType != null">
+				#{contactType,jdbcType=INTEGER},
+			</if>
+			<if test="effective != null">
+				#{effective,jdbcType=INTEGER},
+			</if>
+			<if test="timeStamp != null">
+				#{timeStamp,jdbcType=TIMESTAMP},
+			</if>
+			<if test="followCount != null">
+				#{followCount,jdbcType=INTEGER},
+			</if>
+			<if test="guidance != null">
+				#{guidance,jdbcType=VARCHAR},
+			</if>
+			<if test="guidanceTime != null">
+				#{guidanceTime,jdbcType=TIMESTAMP},
+			</if>
+		</trim>
+	</insert>
+	<select id="countByExample"
+		parameterType="com.goafanti.common.model.UserFollowExample"
+		resultType="java.lang.Long">
+		<!-- WARNING - @mbg.generated This element is automatically generated by 
+			MyBatis Generator, do not modify. This element was generated on Sat Oct 10 
+			10:18:15 CST 2020. -->
+		select count(*) from user_follow
+		<if test="_parameter != null">
+			<include refid="Example_Where_Clause" />
+		</if>
+	</select>
+	<update id="updateByExampleSelective" parameterType="map">
+		<!-- WARNING - @mbg.generated This element is automatically generated by 
+			MyBatis Generator, do not modify. This element was generated on Sat Oct 10 
+			10:18:15 CST 2020. -->
+		update user_follow
+		<set>
+			<if test="record.id != null">
+				id = #{record.id,jdbcType=VARCHAR},
+			</if>
+			<if test="record.uid != null">
+				uid = #{record.uid,jdbcType=VARCHAR},
+			</if>
+			<if test="record.aid != null">
+				aid = #{record.aid,jdbcType=VARCHAR},
+			</if>
+			<if test="record.paid != null">
+				paid = #{record.paid,jdbcType=VARCHAR},
+			</if>
+			<if test="record.result != null">
+				result = #{record.result,jdbcType=VARCHAR},
+			</if>
+			<if test="record.attachmentUrl != null">
+				attachment_url = #{record.attachmentUrl,jdbcType=VARCHAR},
+			</if>
+			<if test="record.createTime != null">
+				create_time = #{record.createTime,jdbcType=TIMESTAMP},
+			</if>
+			<if test="record.ocbId != null">
+				ocb_id = #{record.ocbId,jdbcType=VARCHAR},
+			</if>
+			<if test="record.contactType != null">
+				contact_type = #{record.contactType,jdbcType=INTEGER},
+			</if>
+			<if test="record.effective != null">
+				effective = #{record.effective,jdbcType=INTEGER},
+			</if>
+			<if test="record.timeStamp != null">
+				time_stamp = #{record.timeStamp,jdbcType=TIMESTAMP},
+			</if>
+			<if test="record.followCount != null">
+				follow_count = #{record.followCount,jdbcType=INTEGER},
+			</if>
+			<if test="record.guidance != null">
+				guidance = #{record.guidance,jdbcType=VARCHAR},
+			</if>
+			<if test="record.guidanceTime != null">
+				guidance_time = #{record.guidanceTime,jdbcType=TIMESTAMP},
+			</if>
+		</set>
+		<if test="_parameter != null">
+			<include refid="Update_By_Example_Where_Clause" />
+		</if>
+	</update>
+	<update id="updateByExample" parameterType="map">
+		<!-- WARNING - @mbg.generated This element is automatically generated by 
+			MyBatis Generator, do not modify. This element was generated on Sat Oct 10 
+			10:18:15 CST 2020. -->
+		update user_follow
+		set id = #{record.id,jdbcType=VARCHAR},
+		uid = #{record.uid,jdbcType=VARCHAR},
+		aid = #{record.aid,jdbcType=VARCHAR},
+		paid = #{record.paid,jdbcType=VARCHAR},
+		result = #{record.result,jdbcType=VARCHAR},
+		attachment_url = #{record.attachmentUrl,jdbcType=VARCHAR},
+		create_time = #{record.createTime,jdbcType=TIMESTAMP},
+		ocb_id = #{record.ocbId,jdbcType=VARCHAR},
+		contact_type = #{record.contactType,jdbcType=INTEGER},
+		effective = #{record.effective,jdbcType=INTEGER},
+		time_stamp = #{record.timeStamp,jdbcType=TIMESTAMP},
+		follow_count = #{record.followCount,jdbcType=INTEGER},
+		guidance = #{record.guidance,jdbcType=VARCHAR},
+		guidance_time = #{record.guidanceTime,jdbcType=TIMESTAMP}
+		<if test="_parameter != null">
+			<include refid="Update_By_Example_Where_Clause" />
+		</if>
+	</update>
+	<update id="updateByPrimaryKeySelective"
+		parameterType="com.goafanti.common.model.UserFollow">
+		<!-- WARNING - @mbg.generated This element is automatically generated by 
+			MyBatis Generator, do not modify. This element was generated on Sat Oct 10 
+			10:18:15 CST 2020. -->
+		update user_follow
+		<set>
+			<if test="uid != null">
+				uid = #{uid,jdbcType=VARCHAR},
+			</if>
+			<if test="aid != null">
+				aid = #{aid,jdbcType=VARCHAR},
+			</if>
+			<if test="paid != null">
+				paid = #{paid,jdbcType=VARCHAR},
+			</if>
+			<if test="result != null">
+				result = #{result,jdbcType=VARCHAR},
+			</if>
+			<if test="attachmentUrl != null">
+				attachment_url = #{attachmentUrl,jdbcType=VARCHAR},
+			</if>
+			<if test="createTime != null">
+				create_time = #{createTime,jdbcType=TIMESTAMP},
+			</if>
+			<if test="ocbId != null">
+				ocb_id = #{ocbId,jdbcType=VARCHAR},
+			</if>
+			<if test="contactType != null">
+				contact_type = #{contactType,jdbcType=INTEGER},
+			</if>
+			<if test="effective != null">
+				effective = #{effective,jdbcType=INTEGER},
+			</if>
+			<if test="timeStamp != null">
+				time_stamp = #{timeStamp,jdbcType=TIMESTAMP},
+			</if>
+			<if test="followCount != null">
+				follow_count = #{followCount,jdbcType=INTEGER},
+			</if>
+			<if test="guidance != null">
+				guidance = #{guidance,jdbcType=VARCHAR},
+			</if>
+			<if test="guidanceTime != null">
+				guidance_time = #{guidanceTime,jdbcType=TIMESTAMP},
+			</if>
+		</set>
+		where id = #{id,jdbcType=VARCHAR}
+	</update>
+	<update id="updateByPrimaryKey"
+		parameterType="com.goafanti.common.model.UserFollow">
+		<!-- WARNING - @mbg.generated This element is automatically generated by 
+			MyBatis Generator, do not modify. This element was generated on Sat Oct 10 
+			10:18:15 CST 2020. -->
+		update user_follow
+		set uid = #{uid,jdbcType=VARCHAR},
+		aid = #{aid,jdbcType=VARCHAR},
+		paid = #{paid,jdbcType=VARCHAR},
+		result = #{result,jdbcType=VARCHAR},
+		attachment_url = #{attachmentUrl,jdbcType=VARCHAR},
+		create_time = #{createTime,jdbcType=TIMESTAMP},
+		ocb_id = #{ocbId,jdbcType=VARCHAR},
+		contact_type = #{contactType,jdbcType=INTEGER},
+		effective = #{effective,jdbcType=INTEGER},
+		time_stamp = #{timeStamp,jdbcType=TIMESTAMP},
+		follow_count = #{followCount,jdbcType=INTEGER},
+		guidance = #{guidance,jdbcType=VARCHAR},
+		guidance_time = #{guidanceTime,jdbcType=TIMESTAMP}
+		where id = #{id,jdbcType=VARCHAR}
+	</update>
+	<update id="pushUserGuidance">
+		update user_follow b, `user` a
+		set a.guidance= #{guidance}
+		where a.id=b.uid and b.id= #{id}
+	</update>
+	<select id="selectbyUid"  resultMap="BaseResultMap">
+		select
+		<include refid="Base_Column_List" />
+		from user_follow a
+		where a.uid= #{uid}
+		and a.aid= #{aid}
+	</select>
 </mapper>

+ 2 - 2
src/main/java/com/goafanti/common/mapper/UserLockReleaseMapper.xml

@@ -463,8 +463,8 @@
     <select id="selectChannelUserDays" resultType="com.goafanti.common.bo.userDaysBo">
   	select a.id uid,a.aid,a.nickname name,2 type from user a 
 		left join user_channel b on a.id=b.uid 
-		where a.channel=1 and b.status =2 
-		 and a.share_type =0 and datediff(now(),b.create_time) &gt; #{z}
+		where a.channel=1 and b.status =1 
+		 and a.share_type =0 and datediff(now(),b.distribution_time) &gt; #{z}
   </select>
   
   

+ 36 - 13
src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

@@ -2071,28 +2071,36 @@ inner join(
 	</update>
 	
 	<insert id="insertBatch" parameterType="com.goafanti.user.bo.InputUserChannel">
-    INSERT INTO `user` (id, mobile, password, nickname,share_type,type,society_tag,aid,channel)VALUES
-      <foreach item="item" index="index" collection="list" separator=",">
-      (#{item.uid,jdbcType=VARCHAR}, #{item.contactMobile,jdbcType=VARCHAR}, #{item.password,jdbcType=VARCHAR}, 
-      #{item.userName,jdbcType=DECIMAL}, #{item.shareType,jdbcType=TIMESTAMP}, 1,#{item.societyTag},#{item.aid},1)
+	INSERT INTO `user` (id, mobile, password,
+	nickname,identify_name,aid,
+	share_type,type,society_tag,channel,source)VALUES
+	<foreach item="item" index="index" collection="list"
+		separator=",">
+		(#{item.uid,jdbcType=VARCHAR}, #{item.contactMobile,jdbcType=VARCHAR},#{item.password,jdbcType=VARCHAR},
+		#{item.userName},#{item.userName},#{item.aid},
+		#{item.shareType,jdbcType=TIMESTAMP}, 1,#{item.societyTag},1,1)
     </foreach>
   </insert>
   
   <select id="selectChannelCustomerList" resultType="com.goafanti.user.bo.OutUserChannel">
    select a.id,a.uid,b.nickname userName,a.aid,a.status,date_format(a.distribution_time,'%Y-%m-%d %H:%i:%S')distributionTimes,
- 	date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimes ,c.contacts ,c.contact_mobile contactMobile,e.name aName,
- 	b.society_tag societyTag ,d1.name province,d2.name city from user_channel a
+ 	date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimes ,c.contacts ,c.contact_mobile contactMobile,e.name channelName,
+ 	b.society_tag societyTag ,d1.name province,d2.name city,f.name adminName ,b.guidance from user_channel a
     left join user b on a.uid=b.id  left join organization_identity c on a.uid =c.uid 
     left join district_glossory d1 on c.location_province =d1.id 
     left join district_glossory d2 on c.location_city =d2.id
     left join admin e on a.aid =e.id
-    where a.status in (0,2)
+    left join admin f on b.aid=f.id
+    where a.status in (0,1,5)
     <if test="status !=null">
     and a.status = #{status}
     </if>
-    <if test="aid!=null">
+    <if test="type==0 and aid!=null">
     and b.aid= #{aid}
     </if>
+    <if test="type==1 and aid!=null">
+    and a.aid= #{aid}
+    </if>
     <if test="province !=null">
     and  c.location_province= #{province}
     </if>
@@ -2112,16 +2120,16 @@ inner join(
   <select id="selectChannelCustomerCount" resultType="java.lang.Integer">
    select count(*) from user_channel a
     left join user b on a.uid=b.id  left join organization_identity c on a.uid =c.uid 
-    left join district_glossory d1 on c.location_province =d1.id 
-    left join district_glossory d2 on c.location_city =d2.id
-    left join admin e on a.aid =e.id
-    where a.status in(0,2)=1
+    where a.status in(0,1,5)
     <if test="status !=null">
     and a.status = #{status}
     </if>
-    <if test="aid!=null">
+    <if test="type==0 and aid!=null">
     and b.aid= #{aid}
     </if>
+    <if test="type==1 and aid!=null">
+    and a.aid= #{aid}
+    </if>
     <if test="province !=null">
     and  c.location_province= #{province}
     </if>
@@ -2143,4 +2151,19 @@ inner join(
      </foreach>
      )
   </update>
+  
+  <update id="updateReleaseUserChannel">
+	update user a ,user_channel b set a.share_type=1,a.channel=0,
+	b.status=6,a.transfer_time =now()
+	where a.id=b.uid and a.id in(
+	<foreach item="item" collection="list" separator="," index="">
+     #{item.uid}
+     </foreach>
+     )
+  </update>
+  <select id="checkBeforeChannel" resultType="java.lang.String">
+	select b.aid from user_channel a
+	left join user b on a.uid =b.id
+	where a .uid = #{uid}
+  </select>
 </mapper>

+ 189 - 228
src/main/java/com/goafanti/common/model/UserChannel.java

@@ -4,232 +4,193 @@ import java.io.Serializable;
 import java.util.Date;
 
 public class UserChannel implements Serializable {
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column user_channel.id
-     *
-     * @mbg.generated Thu Apr 22 09:06:45 CST 2021
-     */
-    private Integer id;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column user_channel.uid
-     *
-     * @mbg.generated Thu Apr 22 09:06:45 CST 2021
-     */
-    private String uid;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column user_channel.aid
-     *
-     * @mbg.generated Thu Apr 22 09:06:45 CST 2021
-     */
-    private String aid;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column user_channel.status
-     *
-     * @mbg.generated Thu Apr 22 09:06:45 CST 2021
-     */
-    private Integer status;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column user_channel.distribution_time
-     *
-     * @mbg.generated Thu Apr 22 09:06:45 CST 2021
-     */
-    private Date distributionTime;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column user_channel.create_time
-     *
-     * @mbg.generated Thu Apr 22 09:06:45 CST 2021
-     */
-    private Date createTime;
-
-    /**
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database table user_channel
-     *
-     * @mbg.generated Thu Apr 22 09:06:45 CST 2021
-     */
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column user_channel.id
-     *
-     * @return the value of user_channel.id
-     *
-     * @mbg.generated Thu Apr 22 09:06:45 CST 2021
-     */
-    public Integer getId() {
-        return id;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column user_channel.id
-     *
-     * @param id the value for user_channel.id
-     *
-     * @mbg.generated Thu Apr 22 09:06:45 CST 2021
-     */
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column user_channel.uid
-     *
-     * @return the value of user_channel.uid
-     *
-     * @mbg.generated Thu Apr 22 09:06:45 CST 2021
-     */
-    public String getUid() {
-        return uid;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column user_channel.uid
-     *
-     * @param uid the value for user_channel.uid
-     *
-     * @mbg.generated Thu Apr 22 09:06:45 CST 2021
-     */
-    public void setUid(String uid) {
-        this.uid = uid == null ? null : uid.trim();
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column user_channel.aid
-     *
-     * @return the value of user_channel.aid
-     *
-     * @mbg.generated Thu Apr 22 09:06:45 CST 2021
-     */
-    public String getAid() {
-        return aid;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column user_channel.aid
-     *
-     * @param aid the value for user_channel.aid
-     *
-     * @mbg.generated Thu Apr 22 09:06:45 CST 2021
-     */
-    public void setAid(String aid) {
-        this.aid = aid == null ? null : aid.trim();
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column user_channel.status
-     *
-     * @return the value of user_channel.status
-     *
-     * @mbg.generated Thu Apr 22 09:06:45 CST 2021
-     */
-    public Integer getStatus() {
-        return status;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column user_channel.status
-     *
-     * @param status the value for user_channel.status
-     *
-     * @mbg.generated Thu Apr 22 09:06:45 CST 2021
-     */
-    public void setStatus(Integer status) {
-        this.status = status;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column user_channel.distribution_time
-     *
-     * @return the value of user_channel.distribution_time
-     *
-     * @mbg.generated Thu Apr 22 09:06:45 CST 2021
-     */
-    public Date getDistributionTime() {
-        return distributionTime;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column user_channel.distribution_time
-     *
-     * @param distributionTime the value for user_channel.distribution_time
-     *
-     * @mbg.generated Thu Apr 22 09:06:45 CST 2021
-     */
-    public void setDistributionTime(Date distributionTime) {
-        this.distributionTime = distributionTime;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column user_channel.create_time
-     *
-     * @return the value of user_channel.create_time
-     *
-     * @mbg.generated Thu Apr 22 09:06:45 CST 2021
-     */
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column user_channel.create_time
-     *
-     * @param createTime the value for user_channel.create_time
-     *
-     * @mbg.generated Thu Apr 22 09:06:45 CST 2021
-     */
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table user_channel
-     *
-     * @mbg.generated Thu Apr 22 09:06:45 CST 2021
-     */
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder();
-        sb.append(getClass().getSimpleName());
-        sb.append(" [");
-        sb.append("Hash = ").append(hashCode());
-        sb.append(", id=").append(id);
-        sb.append(", uid=").append(uid);
-        sb.append(", aid=").append(aid);
-        sb.append(", status=").append(status);
-        sb.append(", distributionTime=").append(distributionTime);
-        sb.append(", createTime=").append(createTime);
-        sb.append(", serialVersionUID=").append(serialVersionUID);
-        sb.append("]");
-        return sb.toString();
-    }
+
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_channel.id
+	 * @mbg.generated  Sun Apr 25 09:04:26 CST 2021
+	 */
+	private Integer id;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_channel.uid
+	 * @mbg.generated  Sun Apr 25 09:04:26 CST 2021
+	 */
+	private String uid;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_channel.aid
+	 * @mbg.generated  Sun Apr 25 09:04:26 CST 2021
+	 */
+	private String aid;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_channel.status
+	 * @mbg.generated  Sun Apr 25 09:04:26 CST 2021
+	 */
+	private Integer status;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_channel.distribution_time
+	 * @mbg.generated  Sun Apr 25 09:04:26 CST 2021
+	 */
+	private Date distributionTime;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_channel.create_time
+	 * @mbg.generated  Sun Apr 25 09:04:26 CST 2021
+	 */
+	private Date createTime;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_channel.remarks
+	 * @mbg.generated  Sun Apr 25 09:04:26 CST 2021
+	 */
+	private String remarks;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database table user_channel
+	 * @mbg.generated  Sun Apr 25 09:04:26 CST 2021
+	 */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_channel.id
+	 * @return  the value of user_channel.id
+	 * @mbg.generated  Sun Apr 25 09:04:26 CST 2021
+	 */
+	public Integer getId() {
+		return id;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_channel.id
+	 * @param id  the value for user_channel.id
+	 * @mbg.generated  Sun Apr 25 09:04:26 CST 2021
+	 */
+	public void setId(Integer id) {
+		this.id = id;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_channel.uid
+	 * @return  the value of user_channel.uid
+	 * @mbg.generated  Sun Apr 25 09:04:26 CST 2021
+	 */
+	public String getUid() {
+		return uid;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_channel.uid
+	 * @param uid  the value for user_channel.uid
+	 * @mbg.generated  Sun Apr 25 09:04:26 CST 2021
+	 */
+	public void setUid(String uid) {
+		this.uid = uid == null ? null : uid.trim();
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_channel.aid
+	 * @return  the value of user_channel.aid
+	 * @mbg.generated  Sun Apr 25 09:04:26 CST 2021
+	 */
+	public String getAid() {
+		return aid;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_channel.aid
+	 * @param aid  the value for user_channel.aid
+	 * @mbg.generated  Sun Apr 25 09:04:26 CST 2021
+	 */
+	public void setAid(String aid) {
+		this.aid = aid == null ? null : aid.trim();
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_channel.status
+	 * @return  the value of user_channel.status
+	 * @mbg.generated  Sun Apr 25 09:04:26 CST 2021
+	 */
+	public Integer getStatus() {
+		return status;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_channel.status
+	 * @param status  the value for user_channel.status
+	 * @mbg.generated  Sun Apr 25 09:04:26 CST 2021
+	 */
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_channel.distribution_time
+	 * @return  the value of user_channel.distribution_time
+	 * @mbg.generated  Sun Apr 25 09:04:26 CST 2021
+	 */
+	public Date getDistributionTime() {
+		return distributionTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_channel.distribution_time
+	 * @param distributionTime  the value for user_channel.distribution_time
+	 * @mbg.generated  Sun Apr 25 09:04:26 CST 2021
+	 */
+	public void setDistributionTime(Date distributionTime) {
+		this.distributionTime = distributionTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_channel.create_time
+	 * @return  the value of user_channel.create_time
+	 * @mbg.generated  Sun Apr 25 09:04:26 CST 2021
+	 */
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_channel.create_time
+	 * @param createTime  the value for user_channel.create_time
+	 * @mbg.generated  Sun Apr 25 09:04:26 CST 2021
+	 */
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_channel.remarks
+	 * @return  the value of user_channel.remarks
+	 * @mbg.generated  Sun Apr 25 09:04:26 CST 2021
+	 */
+	public String getRemarks() {
+		return remarks;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_channel.remarks
+	 * @param remarks  the value for user_channel.remarks
+	 * @mbg.generated  Sun Apr 25 09:04:26 CST 2021
+	 */
+	public void setRemarks(String remarks) {
+		this.remarks = remarks == null ? null : remarks.trim();
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_channel
+	 * @mbg.generated  Sun Apr 25 09:04:26 CST 2021
+	 */
+	@Override
+	public String toString() {
+		StringBuilder sb = new StringBuilder();
+		sb.append(getClass().getSimpleName());
+		sb.append(" [");
+		sb.append("Hash = ").append(hashCode());
+		sb.append(", id=").append(id);
+		sb.append(", uid=").append(uid);
+		sb.append(", aid=").append(aid);
+		sb.append(", status=").append(status);
+		sb.append(", distributionTime=").append(distributionTime);
+		sb.append(", createTime=").append(createTime);
+		sb.append(", remarks=").append(remarks);
+		sb.append(", serialVersionUID=").append(serialVersionUID);
+		sb.append("]");
+		return sb.toString();
+	}
 }

+ 2 - 2
src/main/java/com/goafanti/common/task/ReleaseUserTask.java

@@ -145,8 +145,8 @@ public class ReleaseUserTask {
 			if (userChannelList != null && userChannelList.size() > 0) {
 				for (int i = 0; i < userChannelList.size(); i++) {
 					newCList.add(userChannelList.get(i));
-					if (pointsDataLimit == newCList.size() || i == lockUserList.size() - 1) {
-//						userService.releaseUserChannelList
+					if (pointsDataLimit == newCList.size() || i == userChannelList.size() - 1) {
+						userService.pushReleaseUserChannel(newCList);
 					}
 					newCList.clear();
 					Thread.sleep(2000);

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

@@ -6,6 +6,7 @@ public class InputListChannel {
 	private Integer province;
 	private Integer city;
 	private Integer status;
+	private Integer type;
 	private String startTime;
 	private String endTime;
 	private Integer pageNo;
@@ -58,6 +59,12 @@ public class InputListChannel {
 	public void setStatus(Integer status) {
 		this.status = status;
 	}
+	public Integer getType() {
+		return type;
+	}
+	public void setType(Integer type) {
+		this.type = type;
+	}
 	
 	
 }

+ 14 - 2
src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java

@@ -7,6 +7,7 @@ import java.text.DateFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
@@ -544,6 +545,11 @@ public class AdminCustomerApiController extends BaseApiController{
 			res.getError().add(buildError("","私有客户已达最大限制"));
 			return res;
 		}
+		
+		if (customerService.checkBeforeChannel(uid)) {
+			res.getError().add(buildError("","渠道客户丢失后不可再领取"));
+			return res;
+		}
 		customerService.updateByOperatorType(uid, oldAid,AFTConstants.USER_RECEIVE);
 		return res;
 	}
@@ -1274,9 +1280,15 @@ public class AdminCustomerApiController extends BaseApiController{
 	
 	/** 渠道客户转交 **/
 	@RequestMapping(value = "/channelCustomerDeliver", method = RequestMethod.POST)
-	public Result channelCustomerDeliver(String userIds ,String receiveId,String remarks){
+	public Result channelCustomerDeliver(String userIds ,String receiveId,String remarks,Integer type){
 		Result res = new Result();
-		res.setData(customerService.pushChannelDeliver( userIds , receiveId,remarks));
+		String [] str=userIds.split(",");
+		List<String> uids=Arrays.asList(str);
+		if (type==1&&customerService.checkChannel(uids)) {
+			res.getError().add(buildError("","已跟进,禁止转交!"));
+			return res;
+		}
+		res.setData(customerService.pushChannelDeliver( uids , receiveId,remarks,type));
 		return res;
 	}
 }

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

@@ -541,6 +541,16 @@ public interface CustomerService {
 	 */
 	void pushReleaseLog(List<LockingReleaseBo> list,Integer type) throws InterruptedException;
 	Object listChannelCustomer(InputListChannel in);
-	Object pushChannelDeliver(String userIds, String receiveId, String remarks);
+	/**
+	 * 
+	 * @param uids 用户集
+	 * @param receiveId 接受者
+	 * @param remarks	备注
+	 * @param type	0分配 1转交 2回退
+	 * @return
+	 */
+	Object pushChannelDeliver(List<String> uids, String receiveId, String remarks, Integer type);
 	Object getChannelCustomerByName(String name);
+	boolean checkChannel(List<String> uids);
+	boolean checkBeforeChannel(String uid);
 }

+ 37 - 10
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -1919,6 +1919,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		if(in.getProvince()!=null)params.put("province", in.getProvince());
 		if(in.getCity()!=null)params.put("city", in.getCity());
 		if(in.getStatus()!=null)params.put("status", in.getStatus());
+		params.put("type", in.getType()==null?0:in.getType());
 		if(StringUtils.isNotBlank(in.getStartTime()))params.put("startTime", in.getStartTime());
 		if(StringUtils.isNotBlank(in.getEndTime()))params.put("endTime", in.getEndTime()+" 23:59:59");
 		if(!TokenManager.hasRole(AFTConstants.SALESMAN_DIRECTOR)&&!TokenManager.hasRole(AFTConstants.SUPERADMIN)){
@@ -1929,11 +1930,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 	}
 
 	@Override
-	public Object pushChannelDeliver(String userIds, String receiveId,String remarks) {
-		String [] str=userIds.split(",");
-		List<String> uids=Arrays.asList(str);
-		int x=0;
-		if (TokenManager.hasRole(AFTConstants.SALESMAN_DIRECTOR))x=1;
+	public Object pushChannelDeliver(List<String> uids, String receiveId,String remarks, Integer type) {
 		Date date=new Date();
 		int  i=userMapper.updatechannelCustomerDeliver(uids, receiveId);
 		if (i>0) {
@@ -1941,18 +1938,48 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 			for (String string : uids) {
 				UserTransferLog u=new UserTransferLog();
 				u.setAid(TokenManager.getAdminId());
-				u.setTakeAid(receiveId);
 				u.setUid(string);
-				if(x==0)u.setType(10);
-				else if(x==1)u.setType(9);
+				if(type==0) {
+					u.setTakeAid(receiveId);
+					u.setType(9);
+				}
+				else if(type==1) {
+					u.setTakeAid(receiveId);
+					u.setType(10);
+				}
+				else if(type==2) {
+					u.setType(12);
+				}
 				u.setCreateTime(date);
 				u.setRemarks(remarks);
 				l.add(u);
 			}
 			userTransferLogMapper.insertList(l);
 		}
-		if(x==1)userChannelMapper.updateByuids(uids,2);
-		return i;
+		userChannelMapper.updateByuids(uids,1,date);
+		if(type==2)userChannelMapper.updateByuids(uids,5,null);
+		else organizationContactBookMapper.updateByUids(uids, receiveId); 
+		return 1;
+	}
+
+	@Override
+	public boolean checkChannel(List<String> uids) {
+		for (String uid : uids) {
+			List<UserFollow> list=userFollowMapper.selectbyUid(uid,TokenManager.getAdminId());
+			if (!list.isEmpty()) {
+				return true;
+			}
+		}
+		return false;
+	}
+
+	@Override
+	public boolean checkBeforeChannel(String uid) {
+		String aid=userMapper.checkBeforeChannel(uid);
+		if (aid!=null&&aid.equals(TokenManager.getAdminId())) {
+			return true;
+		}
+		return false;
 	}
 
 

+ 37 - 7
src/main/java/com/goafanti/user/bo/OutUserChannel.java

@@ -63,14 +63,15 @@ public class OutUserChannel  {
      */
     private Date createTime;
 
-    private String aName;
+    private String channelName;
+    private String adminName;
     @Excel(name = "客户名称")
 	private String userName;
     @Excel(name = "省")
     private String province;
     @Excel(name = "市")
     private String city;
-    @Excel(name = "社会性质",readConverterExp = "0=社会企业,1=科研单位,2=高等院校,3=科研专家,4=科技达人,5=服务机构,6=政府部门,7=商会,8=协会,9=其他组织,10其他个人")
+    @Excel(name = "社会性质",readConverterExp = "0=社会企业,1=科研单位,2=高等院校,3=科研专家,4=科技达人,5=服务机构,6=政府部门,7=商会,8=协会,9=其他组织,10=其他个人")
     private String societyTag;
 	public String getSocietyTag() {
 		return societyTag;
@@ -86,8 +87,19 @@ public class OutUserChannel  {
 	private String contacts;
 	@Excel(name = "联系人电话")
 	private String contactMobile;
+	@Excel(name = "备注")
+	private String remarks;
+	private Integer guidance;
 
-    /**
+    public String getRemarks() {
+		return remarks;
+	}
+
+	public void setRemarks(String remarks) {
+		this.remarks = remarks;
+	}
+
+	/**
      * This method was generated by MyBatis Generator.
      * This method returns the value of the database column user_channel.id
      *
@@ -287,12 +299,30 @@ public class OutUserChannel  {
 		this.contactMobile = contactMobile;
 	}
 
-	public String getaName() {
-		return aName;
+
+
+	public String getChannelName() {
+		return channelName;
+	}
+
+	public void setChannelName(String channelName) {
+		this.channelName = channelName;
+	}
+
+	public String getAdminName() {
+		return adminName;
+	}
+
+	public void setAdminName(String adminName) {
+		this.adminName = adminName;
+	}
+
+	public Integer getGuidance() {
+		return guidance;
 	}
 
-	public void setaName(String aName) {
-		this.aName = aName;
+	public void setGuidance(Integer guidance) {
+		this.guidance = guidance;
 	}
 
 }

+ 4 - 0
src/main/java/com/goafanti/user/service/UserService.java

@@ -4,6 +4,7 @@ import java.util.List;
 import java.util.Map;
 
 import com.goafanti.app.bo.UserBasicInfo;
+import com.goafanti.common.bo.userDaysBo;
 import com.goafanti.common.model.User;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.user.bo.OrgListBo;
@@ -66,6 +67,9 @@ public interface UserService {
 	User selectByNumber(String easemobName);
 	
 	List<User> selectUserByRoleName(String roleName1, String roleName2);
+
+
+	void pushReleaseUserChannel(List<userDaysBo> newCList);
 	
 	
 }

+ 32 - 26
src/main/java/com/goafanti/user/service/impl/UserChannelServiceImpl.java

@@ -150,25 +150,28 @@ public class UserChannelServiceImpl extends BaseMybatisDao<UserChannelMapper> im
 			        Cell cell = row.getCell(cellNum);
 			    	try {
 			        switch (cellNum) {
-					case 0:
-						in.setUserName(ExcelUtils.getCellValue(cell));
-						break;
-					case 1:
-						in.setProvince(getProvinceId(pList,ExcelUtils.getCellValue(cell)));
-						break;
-					case 2:
-						in.setCity(getCityId(cList,ExcelUtils.getCellValue(cell)));
-						break;
-					case 3:
-						in.setSocietyTag(SocietyTag.getCodeByValue(ExcelUtils.getCellValue(cell)).toString());
-						break;
-					case 4:
-						in.setContacts(ExcelUtils.getCellValue(cell));
-						break;
-					case 5:
-						in.setContactMobile(ExcelUtils.getCellValue(cell));
-						break;
-					}
+						case 0:
+							in.setUserName(ExcelUtils.getCellValue(cell));
+							break;
+						case 1:
+							in.setProvince(getProvinceId(pList,ExcelUtils.getCellValue(cell)));
+							break;
+						case 2:
+							in.setCity(getCityId(cList,ExcelUtils.getCellValue(cell)));
+							break;
+						case 3:
+							in.setSocietyTag(SocietyTag.getCodeByValue(ExcelUtils.getCellValue(cell)).toString());
+							break;
+						case 4:
+							in.setContacts(ExcelUtils.getCellValue(cell));
+							break;
+						case 5:
+							in.setContactMobile(ExcelUtils.getCellValue(cell));
+							break;
+				    	case 6:
+							in.setRemarks(ExcelUtils.getCellValue(cell));
+							break;
+						}
 			    	} catch (Exception e) {
 			    		throw new BusinessException(new Error("表格第"+(rowNum+1)+"行输入内容不正确。"));
 					}
@@ -179,14 +182,17 @@ public class UserChannelServiceImpl extends BaseMybatisDao<UserChannelMapper> im
 		        in.setShareType(0);
 		        in.setPassword(passwordUtil.getEncryptPwd("123456", now.getTime()));
 		        User u=userMapper.selectByName(in.getUserName());
-		        if (u!=null) {
-					in.setStatus(1);
-					in.setUid(u.getId());
-					list2.add(in);
-				}else {
-					in.setStatus(0);
+		        if (u==null) {
+		        	in.setStatus(0);
 					in.setUid(uid);
 					list.add(in);
+				}else {
+//					共享类型 0-私有 1-公共 2 签单
+					if(u.getShareType()==0)in.setStatus(2);
+					else if(u.getShareType()==1)in.setStatus(3);
+					else if(u.getShareType()==2)in.setStatus(4);
+					in.setUid(u.getId());
+					list2.add(in);
 				}
 		        
     		}
@@ -238,7 +244,7 @@ public class UserChannelServiceImpl extends BaseMybatisDao<UserChannelMapper> im
 	@Override
 	public Pagination<OutUserChannel> getErorrList(Integer pageNo,Integer pageSize) {
 		Map<String, Object> map =new HashMap<>();
-		map.put("status", 1);
+		map.put("type", 1);
 		map.put("aid", TokenManager.getAdminId());
 		return (Pagination<OutUserChannel>) findPage("selectByAidAndstatusList", "selectByAidAndstatusCount", map, pageNo, pageSize);
 	}

+ 9 - 0
src/main/java/com/goafanti/user/service/impl/UserServiceImpl.java

@@ -1,6 +1,7 @@
 package com.goafanti.user.service.impl;
 
 import java.text.ParseException;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -13,6 +14,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import com.goafanti.app.bo.UserBasicInfo;
+import com.goafanti.common.bo.userDaysBo;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.CopyrightInfoMapper;
 import com.goafanti.common.dao.OrgIntellectualPropertyMapper;
@@ -371,6 +373,13 @@ public class UserServiceImpl extends BaseMybatisDao<UserMapper> implements UserS
 	public List<User> selectUserByRoleName(String roleName1,String roleName2){
 		return userMapper.selectUserByRoleName(roleName1,roleName2);
 	}
+
+	@Override
+	public void pushReleaseUserChannel(List<userDaysBo> newCList) {
+		
+		userMapper.updateReleaseUserChannel(newCList);
+		
+	}
 	
 	
 }