anderx 4 lat temu
rodzic
commit
6d1671ecec
32 zmienionych plików z 1257 dodań i 154 usunięć
  1. 6 0
      src/main/java/com/goafanti/admin/controller/AdminNoticeApiController.java
  2. 2 0
      src/main/java/com/goafanti/admin/service/NoticeService.java
  3. 16 0
      src/main/java/com/goafanti/admin/service/impl/NoticeServiceImpl.java
  4. 9 0
      src/main/java/com/goafanti/common/bo/userDaysBo.java
  5. 11 7
      src/main/java/com/goafanti/common/dao/UserChannelMapper.java
  6. 2 0
      src/main/java/com/goafanti/common/dao/UserLockReleaseMapper.java
  7. 1 1
      src/main/java/com/goafanti/common/dao/UserMapper.java
  8. 55 0
      src/main/java/com/goafanti/common/dao/UserMidMapper.java
  9. 11 3
      src/main/java/com/goafanti/common/enums/ChannelStatus.java
  10. 121 35
      src/main/java/com/goafanti/common/mapper/UserChannelMapper.xml
  11. 22 6
      src/main/java/com/goafanti/common/mapper/UserLockReleaseMapper.xml
  12. 4 2
      src/main/java/com/goafanti/common/mapper/UserMapper.xml
  13. 55 6
      src/main/java/com/goafanti/common/mapper/UserMapperExt.xml
  14. 179 0
      src/main/java/com/goafanti/common/mapper/UserMidMapper.xml
  15. 21 1
      src/main/java/com/goafanti/common/model/Notice.java
  16. 15 0
      src/main/java/com/goafanti/common/model/User.java
  17. 194 26
      src/main/java/com/goafanti/common/model/UserChannel.java
  18. 269 0
      src/main/java/com/goafanti/common/model/UserMid.java
  19. 25 13
      src/main/java/com/goafanti/common/task/ReleaseUserTask.java
  20. 42 0
      src/main/java/com/goafanti/customer/bo/InputChannelCounts.java
  21. 10 0
      src/main/java/com/goafanti/customer/bo/InputListChannel.java
  22. 57 0
      src/main/java/com/goafanti/customer/bo/OutChannelCounts.java
  23. 11 0
      src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java
  24. 5 6
      src/main/java/com/goafanti/customer/service/CustomerService.java
  25. 28 6
      src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java
  26. 15 0
      src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java
  27. 5 1
      src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java
  28. 33 32
      src/main/java/com/goafanti/user/bo/InputUserChannel.java
  29. 2 0
      src/main/java/com/goafanti/user/controller/UserChannelApiController.java
  30. 6 1
      src/main/java/com/goafanti/user/service/UserService.java
  31. 23 5
      src/main/java/com/goafanti/user/service/impl/UserChannelServiceImpl.java
  32. 2 3
      src/main/java/com/goafanti/user/service/impl/UserServiceImpl.java

+ 6 - 0
src/main/java/com/goafanti/admin/controller/AdminNoticeApiController.java

@@ -26,6 +26,12 @@ public class AdminNoticeApiController extends CertifyApiController{
 	@RequestMapping(value = "/unreadCount", method = RequestMethod.GET)
 	public Result unreadCount(){
 		Result res = new Result();
+		//判断是否锁定,已锁定则删除token
+		if(noticeService.checkLock()) {
+			res.getError().add(buildError("账号已经被锁定"));
+			return res;
+		}
+		
 		res.setData(noticeService.findUnreadNoticeCount());
 		return res;
 	}

+ 2 - 0
src/main/java/com/goafanti/admin/service/NoticeService.java

@@ -11,4 +11,6 @@ public interface NoticeService {
 
 	int findUnreadNoticeCount();
 
+	boolean checkLock();
+
 }

+ 16 - 0
src/main/java/com/goafanti/admin/service/impl/NoticeServiceImpl.java

@@ -11,7 +11,9 @@ import org.springframework.stereotype.Service;
 import com.goafanti.admin.bo.NoticeBo;
 import com.goafanti.admin.service.NoticeService;
 import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.dao.AdminMapper;
 import com.goafanti.common.dao.NoticeMapper;
+import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.Notice;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
@@ -21,6 +23,8 @@ import com.goafanti.core.shiro.token.TokenManager;
 public class NoticeServiceImpl extends BaseMybatisDao<NoticeMapper> implements NoticeService {
 	@Autowired
 	private NoticeMapper noticeMapper;
+	@Autowired
+	private AdminMapper adminMapper;
 
 	@SuppressWarnings("unchecked")
 	@Override
@@ -73,4 +77,16 @@ public class NoticeServiceImpl extends BaseMybatisDao<NoticeMapper> implements N
 			aid = TokenManager.getAdminId();
 		return noticeMapper.selectUnreadedCount(aid);
 	}
+
+	@Override
+	public boolean checkLock() {
+		if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
+			Admin a=adminMapper.selectByPrimaryKey(TokenManager.getAdminId());
+			if (!"正常".contains(a.getStatus())) {
+				TokenManager.logout();
+				return true;
+			}
+		}
+		return false;
+	}
 }

+ 9 - 0
src/main/java/com/goafanti/common/bo/userDaysBo.java

@@ -5,6 +5,7 @@ public class userDaysBo {
 	private String uid;
 	private String aid;
 	private String name;
+	private Integer recovery;
 	private Integer type;
 
 	public String getUid() {
@@ -39,4 +40,12 @@ public class userDaysBo {
 		this.type = type;
 	}
 
+	public Integer getRecovery() {
+		return recovery;
+	}
+
+	public void setRecovery(Integer recovery) {
+		this.recovery = recovery;
+	}
+
 }

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

@@ -12,45 +12,46 @@ 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  Wed Apr 28 13:55:31 CST 2021
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
 	 */
 	int deleteByPrimaryKey(Integer id);
 
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_channel
-	 * @mbg.generated  Wed Apr 28 13:55:31 CST 2021
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
 	 */
 	int insert(UserChannel record);
 
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_channel
-	 * @mbg.generated  Wed Apr 28 13:55:31 CST 2021
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
 	 */
 	int insertSelective(UserChannel record);
 
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_channel
-	 * @mbg.generated  Wed Apr 28 13:55:31 CST 2021
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
 	 */
 	UserChannel selectByPrimaryKey(Integer id);
 
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_channel
-	 * @mbg.generated  Wed Apr 28 13:55:31 CST 2021
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
 	 */
 	int updateByPrimaryKeySelective(UserChannel record);
 
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_channel
-	 * @mbg.generated  Wed Apr 28 13:55:31 CST 2021
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
 	 */
 	int updateByPrimaryKey(UserChannel record);
-	
+
+
 	void updateByUid(UserChannel uc);
 
 
@@ -77,6 +78,9 @@ public interface UserChannelMapper {
 	void deleteUser(List<String> list);
 
 
+	int selectSignByUid(String uid);
+
+
 	
 
 

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

@@ -145,5 +145,7 @@ public interface UserLockReleaseMapper {
 
 	void updateChannelList(@Param("list")List<String> list);
 
+	List<userDaysBo> selectChannelNotFollow(Integer days);
+
 
 }

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

@@ -286,7 +286,7 @@ public interface UserMapper {
 
 	int updatechannelCustomerDeliver(@Param("list")List<String> list, @Param("aid")String aid);
 
-	void updateReleaseUserChannel(List<userDaysBo> newCList);
+	void updateReleaseUserChannel(@Param("list")List<userDaysBo> newCList, @Param("type")Integer type);
 
 	String checkBeforeChannel(String uid);
 

+ 55 - 0
src/main/java/com/goafanti/common/dao/UserMidMapper.java

@@ -0,0 +1,55 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.UserMid;
+
+public interface UserMidMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table user_mid
+     *
+     * @mbg.generated Thu May 06 15:37:38 CST 2021
+     */
+    int deleteByPrimaryKey(Integer id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table user_mid
+     *
+     * @mbg.generated Thu May 06 15:37:38 CST 2021
+     */
+    int insert(UserMid record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table user_mid
+     *
+     * @mbg.generated Thu May 06 15:37:38 CST 2021
+     */
+    int insertSelective(UserMid record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table user_mid
+     *
+     * @mbg.generated Thu May 06 15:37:38 CST 2021
+     */
+    UserMid selectByPrimaryKey(Integer id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table user_mid
+     *
+     * @mbg.generated Thu May 06 15:37:38 CST 2021
+     */
+    int updateByPrimaryKeySelective(UserMid record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table user_mid
+     *
+     * @mbg.generated Thu May 06 15:37:38 CST 2021
+     */
+    int updateByPrimaryKey(UserMid record);
+
+	int updateByUid(UserMid um);
+}

+ 11 - 3
src/main/java/com/goafanti/common/enums/ChannelStatus.java

@@ -13,11 +13,11 @@ public enum ChannelStatus {
 	/** 已分配营销员*/ 
 	YFPYXY(2,"已分配营销员"),
 	/** 0已存在私有*/ 
-	YCZSY(3,"已存在私有"),
+	YCZWDSY(3,"已存在我的私有"),
 	/** 0已存在公共*/ 
 	YCZGG(4,"已存在公共"),
 	/** 0已存在签单*/ 
-	YCZQD(5,"已存在签单"),
+	YCZWDQIAND(5,"已存在我的签单"),
 	/** 0回退 */ 
 	HT(6,"回退"),
 	/** 已签单*/ 
@@ -26,7 +26,15 @@ public enum ChannelStatus {
 	YSF(8,"已释放"),
 	/** 非法名称*/ 
 	FFMC(9,"非法名称"),
-	NULL(10,"");
+	/** 已存在渠道*/ 
+	YCZWDQD(10,"已存在我的渠道"),
+	/** 已存在渠道*/ 
+	YCZBRQD(11,"已存在别人渠道"),
+	/** 0已存在私有*/ 
+	YCZBRSY(12,"已存在别人私有"),
+	/** 0已存在签单*/ 
+	YCZBRQIAND(13,"已存在别人签单"),
+	NULL(99,"");
 	 
 	private Integer	code;
 	private String	desc;

+ 121 - 35
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 Wed Apr 28 13:55:31 CST 2021.
+      This element was generated on Fri May 07 15:11:33 CST 2021.
     -->
     <id column="id" jdbcType="INTEGER" property="id" />
     <result column="uid" jdbcType="VARCHAR" property="uid" />
@@ -15,20 +15,28 @@
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="remarks" jdbcType="VARCHAR" property="remarks" />
     <result column="recovery" jdbcType="INTEGER" property="recovery" />
+    <result column="maid" jdbcType="VARCHAR" property="maid" />
+    <result column="sign_time" jdbcType="TIMESTAMP" property="signTime" />
+    <result column="province" jdbcType="VARCHAR" property="province" />
+    <result column="city" jdbcType="VARCHAR" property="city" />
+    <result column="society_tag" jdbcType="VARCHAR" property="societyTag" />
+    <result column="contacts" jdbcType="VARCHAR" property="contacts" />
+    <result column="contact_mobile" jdbcType="VARCHAR" property="contactMobile" />
   </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 Wed Apr 28 13:55:31 CST 2021.
+      This element was generated on Fri May 07 15:11:33 CST 2021.
     -->
-    id, `uid`, aid, `status`, distribution_time, create_time, remarks, `recovery`
+    id, `uid`, aid, `status`, distribution_time, create_time, remarks, `recovery`, maid, 
+    sign_time, province, city, society_tag, contacts, contact_mobile
   </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 Wed Apr 28 13:55:31 CST 2021.
+      This element was generated on Fri May 07 15:11:33 CST 2021.
     -->
     select 
     <include refid="Base_Column_List" />
@@ -39,7 +47,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Apr 28 13:55:31 CST 2021.
+      This element was generated on Fri May 07 15:11:33 CST 2021.
     -->
     delete from user_channel
     where id = #{id,jdbcType=INTEGER}
@@ -48,20 +56,26 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Apr 28 13:55:31 CST 2021.
+      This element was generated on Fri May 07 15:11:33 CST 2021.
     -->
     insert into user_channel (id, `uid`, aid, 
       `status`, distribution_time, create_time, 
-      remarks, `recovery`)
+      remarks, `recovery`, maid, 
+      sign_time, province, city, 
+      society_tag, contacts, contact_mobile
+      )
     values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, 
       #{status,jdbcType=INTEGER}, #{distributionTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, 
-      #{remarks,jdbcType=VARCHAR}, #{recovery,jdbcType=INTEGER})
+      #{remarks,jdbcType=VARCHAR}, #{recovery,jdbcType=INTEGER}, #{maid,jdbcType=VARCHAR}, 
+      #{signTime,jdbcType=TIMESTAMP}, #{province,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR}, 
+      #{societyTag,jdbcType=VARCHAR}, #{contacts,jdbcType=VARCHAR}, #{contactMobile,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 Wed Apr 28 13:55:31 CST 2021.
+      This element was generated on Fri May 07 15:11:33 CST 2021.
     -->
     insert into user_channel
     <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -89,6 +103,27 @@
       <if test="recovery != null">
         `recovery`,
       </if>
+      <if test="maid != null">
+        maid,
+      </if>
+      <if test="signTime != null">
+        sign_time,
+      </if>
+      <if test="province != null">
+        province,
+      </if>
+      <if test="city != null">
+        city,
+      </if>
+      <if test="societyTag != null">
+        society_tag,
+      </if>
+      <if test="contacts != null">
+        contacts,
+      </if>
+      <if test="contactMobile != null">
+        contact_mobile,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -115,13 +150,34 @@
       <if test="recovery != null">
         #{recovery,jdbcType=INTEGER},
       </if>
+      <if test="maid != null">
+        #{maid,jdbcType=VARCHAR},
+      </if>
+      <if test="signTime != null">
+        #{signTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="province != null">
+        #{province,jdbcType=VARCHAR},
+      </if>
+      <if test="city != null">
+        #{city,jdbcType=VARCHAR},
+      </if>
+      <if test="societyTag != null">
+        #{societyTag,jdbcType=VARCHAR},
+      </if>
+      <if test="contacts != null">
+        #{contacts,jdbcType=VARCHAR},
+      </if>
+      <if test="contactMobile != null">
+        #{contactMobile,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 Wed Apr 28 13:55:31 CST 2021.
+      This element was generated on Fri May 07 15:11:33 CST 2021.
     -->
     update user_channel
     <set>
@@ -146,9 +202,53 @@
       <if test="recovery != null">
         `recovery` = #{recovery,jdbcType=INTEGER},
       </if>
+      <if test="maid != null">
+        maid = #{maid,jdbcType=VARCHAR},
+      </if>
+      <if test="signTime != null">
+        sign_time = #{signTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="province != null">
+        province = #{province,jdbcType=VARCHAR},
+      </if>
+      <if test="city != null">
+        city = #{city,jdbcType=VARCHAR},
+      </if>
+      <if test="societyTag != null">
+        society_tag = #{societyTag,jdbcType=VARCHAR},
+      </if>
+      <if test="contacts != null">
+        contacts = #{contacts,jdbcType=VARCHAR},
+      </if>
+      <if test="contactMobile != null">
+        contact_mobile = #{contactMobile,jdbcType=VARCHAR},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
+  <update id="updateByPrimaryKey" 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 Fri May 07 15:11:33 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},
+      remarks = #{remarks,jdbcType=VARCHAR},
+      `recovery` = #{recovery,jdbcType=INTEGER},
+      maid = #{maid,jdbcType=VARCHAR},
+      sign_time = #{signTime,jdbcType=TIMESTAMP},
+      province = #{province,jdbcType=VARCHAR},
+      city = #{city,jdbcType=VARCHAR},
+      society_tag = #{societyTag,jdbcType=VARCHAR},
+      contacts = #{contacts,jdbcType=VARCHAR},
+      contact_mobile = #{contactMobile,jdbcType=VARCHAR}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
    <update id="updateByUid" parameterType="com.goafanti.common.model.UserChannel">
     
     update user_channel
@@ -171,44 +271,30 @@
       <if test="recovery != null">
         `recovery` = #{recovery,jdbcType=INTEGER},
       </if>
+      <if test="signTime != null ">
+       sign_time = #{signTime,jdbcType=TIMESTAMP},
+      </if>
     </set>
     where uid = #{uid,jdbcType=VARCHAR} and status in (1,2)
   </update>
-  <update id="updateByPrimaryKey" 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 Wed Apr 28 13:55:31 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},
-      remarks = #{remarks,jdbcType=VARCHAR},
-      `recovery` = #{recovery,jdbcType=INTEGER}
-    where id = #{id,jdbcType=INTEGER}
-  </update>
   
     <insert id="insertBatch" parameterType="com.goafanti.user.bo.InputUserChannel">
        insert into user_channel ( `uid`, aid, 
-      `status`,remarks)VALUES
+      `status`,remarks,province,city,society_tag,contacts,contact_mobile)VALUES
       <foreach collection="list" index="index" item="item" separator=",">
       (#{item.uid,jdbcType=VARCHAR}, #{item.aid,jdbcType=VARCHAR},#{item.status},
-      #{item.remarks})
+      #{item.remarks},#{item.provinces},#{item.citys},#{item.societyTags},
+      #{item.contacts},#{item.contactMobile})
     </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,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 
-    left join district_glossory d2 on c.location_city =d2.id
+ 	date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimes ,a.contacts ,a.contact_mobile contactMobile,a.remarks,
+ 	a.society_tag societyTag ,a.province,a.city from user_channel a
+    left join user b on a.uid=b.id  
     where 1=1
-    and a.status in (3,4,5,9)
+    and a.status in (3,4,5,9,10,11,12,13)
     <if test="aid !=null">
     and a.aid= #{aid} 
     </if>
@@ -223,7 +309,7 @@
     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
-    where 1=1 and a.status in (3,4,5,9)
+    where 1=1 and a.status in (3,4,5,9,10,11,12,13)
     <if test="aid !=null">
     and a.aid= #{aid} 
     </if>

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

@@ -385,7 +385,8 @@
 	left join 
 		(select uid,aid,max(create_time) as last_follow_time from user_follow where aid = #{aid} group by uid)t1
 	on t0.uid = t1.uid 
-	where 1=1
+	left join user u on t0.uid=u.id
+	where u.channel=0
 	<if test="type==0">
 	 and datediff(now(),if(t0.lock_time &lt; t1.last_follow_time,t1.last_follow_time,t1.t0.lock_time))>30
 	</if>
@@ -457,14 +458,29 @@
 		(select uid,aid,max(create_time) as last_follow_time from user_follow where aid = #{aid} group by uid)t1
 	on t0.uid = t1.uid 
 	left join user u on t0.uid=u.id
-	where datediff(now(),if(t0.lock_time &lt; t1.last_follow_time,t1.last_follow_time,t1.t0.lock_time))> #{x} or datediff(now(),t0.lock_time)> #{y}
+	where u.channel=0
+	and (datediff(now(),if(t0.lock_time &lt; t1.last_follow_time,t1.last_follow_time,t1.t0.lock_time))> #{x} 
+		or datediff(now(),t0.lock_time)> #{y})
   </select>
   
     <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 in (1,2)
-		 and a.share_type =0 and datediff(now(),b.distribution_time) &gt; #{z}
+	select  t0.uid, t0.aid, u.nickname name,c.recovery 
+	from `user` u
+	inner join (select id,uid,aid,lock_time from user_lock_release where type = 0 and status = 0 group by aid,uid)t0 on t0.uid=u.id
+	left join user_channel c on u.id=c.uid
+	where u.channel =1 and c.status &lt; 3
+	and datediff(now(),t0.lock_time) &gt; #{days}
+  </select>
+  
+  <select id="selectChannelNotFollow" resultType="com.goafanti.common.bo.userDaysBo">
+  	 select  t0.uid, t0.aid, u.nickname name ,2 type
+	from `user` u
+	inner join (select id,uid,aid,lock_time from user_lock_release where type = 0 and status = 0 group by aid,uid)t0 on t0.uid=u.id
+	left join 
+		(select uid,aid,max(create_time) as last_follow_time from user_follow  group by aid,uid)t1
+	on t0.uid = t1.uid  and t0.aid=t1.aid
+	where u.channel =1 
+	and datediff(now(),if(t0.lock_time &lt; t1.last_follow_time,t1.last_follow_time,t1.t0.lock_time)) &gt; #{days} 
   </select>
   
   

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

@@ -41,7 +41,9 @@
     <result column="username" jdbcType="VARCHAR" property="username" />
     <result column="authentication" jdbcType="INTEGER" property="authentication" />
     <result column="level" jdbcType="INTEGER" property="level" />
-    <result column="integrity" jdbcType="FLOAT" property="integrity" />  
+    <result column="integrity" jdbcType="FLOAT" property="integrity" />
+    <result column="sign_bills" jdbcType="INTEGER" property="signBills" />
+    <result column="channel" jdbcType="INTEGER" property="channel" />    
   </resultMap>
   <sql id="Example_Where_Clause">
     <!--
@@ -121,7 +123,7 @@
     source, update_time, company_logo_url, head_portrait_url, society_tag, introduction, 
     value_added_tag, organization_id, identify_name, background_url, audit_opinion, audit_status, 
     share_type, aid, transfer_time, information_maintainer, core_technology, accomplish_situation, 
-    intellectual_property, credit_rating, username, authentication, level,integrity
+    intellectual_property, credit_rating, username, authentication, level,integrity,sign_bills,channel
   </sql>
   <select id="selectByExample" parameterType="com.goafanti.common.model.UserExample" resultMap="BaseResultMap">
     <!--

+ 55 - 6
src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

@@ -2097,10 +2097,11 @@ inner join(
     <if test="status !=null">
     and a.status = #{status}
     </if>
-    <if test="type==0 and aid!=null">
+    <if test="type==0"><!-- 营销员 -->
+    and a.status not in(0,6) 
     and b.aid= #{aid}
     </if>
-    <if test="type==1 and aid!=null">
+    <if test="type==1 and aid!=null"><!-- 渠道专员 -->
     and a.aid= #{aid}
     </if>
     <if test="maid !=null">
@@ -2130,10 +2131,11 @@ inner join(
     <if test="status !=null">
     and a.status = #{status}
     </if>
-    <if test="type==0 and aid!=null">
+      <if test="type==0"><!-- 营销员 -->
+    and a.status not in(0,6) 
     and b.aid= #{aid}
     </if>
-    <if test="type==1 and aid!=null">
+    <if test="type==1 and aid!=null"><!-- 渠道专员 -->
     and a.aid= #{aid}
     </if>
     <if test="maid !=null">
@@ -2162,8 +2164,16 @@ inner join(
   </update>
   
   <update id="updateReleaseUserChannel">
-	update user a ,user_channel b,user_lock_release c set a.share_type=1,a.channel=0,
-	b.status=7,a.transfer_time =now(),c.release_time =now(),c.status =2
+	update user a ,user_channel b,user_lock_release c 
+	set 
+	<if test="type==0">
+	b.status = 6,b.recovery=1,
+	</if>
+	<if test="type==1">
+	a.share_type = 1,b.status = 8,
+	</if>  
+	  a.transfer_time = now(), c.release_time = now(),
+	c.status = 2
 	where a.id=b.uid and a.id=c.uid  and a.aid=c.aid  and c.status =0 and c.`type` =0 
 	and b.status in (0,1,2) and a.id in(
 	<foreach item="item" collection="list" separator="," index="">
@@ -2176,4 +2186,43 @@ inner join(
 	left join user b on a.uid =b.id
 	where a.status=8 and a.uid = #{uid}
   </select>
+  
+  <select id="selectChannelCountsList" resultType="com.goafanti.customer.bo.OutChannelCounts">
+ 		select b.name,b.id aid,a.counts,a.wfp unallocated,a.yfp allocated,a.yqd sign,a.ysf common
+ 	from (select t1.aid,count(1)counts ,sum(t1.wfp)wfp,sum(t1.yfp)yfp,sum(t1.yqd)yqd,sum(t1.ysf)ysf from 
+	(select x.aid,x.uid,if(x.distribution_time is null ,1,0)wfp,if(x.distribution_time is not  null,1,0)yfp
+	,if(y.sign_bills =1,1,0)yqd,if(y.share_type=1,1,0)ysf from user_channel x left join user y on x.uid =y.id
+	where 1=1 and x.status in (0,1,2,6,7)
+	<if test="type==0 and startTime !=null and endTime !=null">
+	and  x.create_time between  #{startTime} and #{endTime}
+	</if>
+	<if test="type==1 and startTime !=null and endTime !=null">
+	and x.distribution_time  between  #{startTime} and #{endTime} 
+	</if>
+	<if test="type==2 and startTime !=null and endTime !=null">
+	and x.sign_time  between  #{startTime} and #{endTime}
+	</if>
+	)t1 group by t1.aid)a
+	left join admin b on a.aid=b.id
+ 	<if test="page_sql != null">
+   		${page_sql}
+	</if>
+  </select>
+  <select id="selectChannelCountsCount" resultType="java.lang.Integer">
+    select count(*) from (select ifnull(count(*),0) 
+  from 
+	(select x.aid,x.uid,if(x.distribution_time is null ,1,0)wfp,if(x.distribution_time is not  null,1,0)yfp
+	,if(y.sign_bills =1,1,0)yqd,if(y.share_type=1,1,0)ysf from user_channel x left join user y on x.uid =y.id
+	where 1=1 and x.status in (0,1,2,6,7)
+	<if test="type==0 and startTime !=null and endTime !=null">
+	and  x.create_time between  #{startTime} and #{endTime}
+	</if>
+	<if test="type==1 and startTime !=null and endTime !=null">
+	and x.distribution_time  between  #{startTime} and #{endTime} 
+	</if>
+	<if test="type==2 and startTime !=null and endTime !=null">
+	and x.sign_time  between  #{startTime} and #{endTime}
+	</if>
+	)t1 group by t1.aid)t2
+  </select>
 </mapper>

+ 179 - 0
src/main/java/com/goafanti/common/mapper/UserMidMapper.xml

@@ -0,0 +1,179 @@
+<?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.UserMidMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.UserMid">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu May 06 15:37:38 CST 2021.
+    -->
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="uid" jdbcType="VARCHAR" property="uid" />
+    <result column="aid" jdbcType="VARCHAR" property="aid" />
+    <result column="last_follow_time" jdbcType="TIMESTAMP" property="lastFollowTime" />
+    <result column="last_sign_time" jdbcType="TIMESTAMP" property="lastSignTime" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="big_customer" jdbcType="INTEGER" property="bigCustomer" />
+  </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 May 06 15:37:38 CST 2021.
+    -->
+    id, `uid`, aid, last_follow_time, last_sign_time, create_time, big_customer
+  </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 May 06 15:37:38 CST 2021.
+    -->
+    select 
+    <include refid="Base_Column_List" />
+    from user_mid
+    where id = #{id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu May 06 15:37:38 CST 2021.
+    -->
+    delete from user_mid
+    where id = #{id,jdbcType=INTEGER}
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.UserMid">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu May 06 15:37:38 CST 2021.
+    -->
+    insert into user_mid (id, `uid`, aid, 
+      last_follow_time, last_sign_time, create_time, 
+      big_customer)
+    values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, 
+      #{lastFollowTime,jdbcType=TIMESTAMP}, #{lastSignTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{bigCustomer,jdbcType=INTEGER})
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.UserMid">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu May 06 15:37:38 CST 2021.
+    -->
+    insert into user_mid
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="uid != null">
+        `uid`,
+      </if>
+      <if test="aid != null">
+        aid,
+      </if>
+      <if test="lastFollowTime != null">
+        last_follow_time,
+      </if>
+      <if test="lastSignTime != null">
+        last_sign_time,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="bigCustomer != null">
+        big_customer,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=INTEGER},
+      </if>
+      <if test="uid != null">
+        #{uid,jdbcType=VARCHAR},
+      </if>
+      <if test="aid != null">
+        #{aid,jdbcType=VARCHAR},
+      </if>
+      <if test="lastFollowTime != null">
+        #{lastFollowTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="lastSignTime != null">
+        #{lastSignTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="bigCustomer != null">
+        #{bigCustomer,jdbcType=INTEGER},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.UserMid">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu May 06 15:37:38 CST 2021.
+    -->
+    update user_mid
+    <set>
+      <if test="uid != null">
+        `uid` = #{uid,jdbcType=VARCHAR},
+      </if>
+      <if test="aid != null">
+        aid = #{aid,jdbcType=VARCHAR},
+      </if>
+      <if test="lastFollowTime != null">
+        last_follow_time = #{lastFollowTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="lastSignTime != null">
+        last_sign_time = #{lastSignTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="bigCustomer != null">
+        big_customer = #{bigCustomer,jdbcType=INTEGER},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.UserMid">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu May 06 15:37:38 CST 2021.
+    -->
+    update user_mid
+    set `uid` = #{uid,jdbcType=VARCHAR},
+      aid = #{aid,jdbcType=VARCHAR},
+      last_follow_time = #{lastFollowTime,jdbcType=TIMESTAMP},
+      last_sign_time = #{lastSignTime,jdbcType=TIMESTAMP},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      big_customer = #{bigCustomer,jdbcType=INTEGER}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  
+  <update id="updateByUid" parameterType="com.goafanti.common.model.UserMid">
+    update user_mid
+    <set>
+      <if test="aid != null">
+        aid = #{aid,jdbcType=VARCHAR},
+      </if>
+      <if test="lastFollowTime != null">
+        last_follow_time = #{lastFollowTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="lastSignTime != null">
+        last_sign_time = #{lastSignTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="bigCustomer != null">
+        big_customer = #{bigCustomer,jdbcType=INTEGER},
+      </if>
+    </set>
+    where `uid` = #{uid,jdbcType=VARCHAR}
+  </update>
+</mapper>

+ 21 - 1
src/main/java/com/goafanti/common/model/Notice.java

@@ -67,6 +67,26 @@ public class Notice {
 	 * @param noticeType 标题
 	 * @param content  内容
 	 */
+	public Notice(String id,Date createTime,Integer readed,String aid,Integer noticeType,String content,String uid) {
+		this.id=id;
+		this.createTime=createTime;
+		this.readed=readed;
+		this.aid=aid;
+		this.noticeType=noticeType;
+		this.content=content;
+		this.uid=uid;
+	}
+	
+	
+	/**
+	 * 
+	 * @param id 编号
+	 * @param createTime 创建时间
+	 * @param readed 0未读
+	 * @param aid 发件人
+	 * @param noticeType 标题
+	 * @param content  内容
+	 */
 	public Notice(String id,Date createTime,Integer readed,String aid,Integer noticeType,String content) {
 		this.id=id;
 		this.createTime=createTime;
@@ -74,7 +94,7 @@ public class Notice {
 		this.aid=aid;
 		this.noticeType=noticeType;
 		this.content=content;
-	};
+	}
 
 	public Integer getYear() {
 		return year;

+ 15 - 0
src/main/java/com/goafanti/common/model/User.java

@@ -185,6 +185,9 @@ public class  User implements AftUser{
 	
 	private Integer guidance;
 	
+	private Integer signBills;
+	private Integer channel;
+	
 	public String getId() {
 		return id;
 	}
@@ -743,4 +746,16 @@ public class  User implements AftUser{
 		public void setGuidance(Integer guidance) {
 			this.guidance = guidance;
 		}
+		public Integer getSignBills() {
+			return signBills;
+		}
+		public void setSignBills(Integer signBills) {
+			this.signBills = signBills;
+		}
+		public Integer getChannel() {
+			return channel;
+		}
+		public void setChannel(Integer channel) {
+			this.channel = channel;
+		}
 }

+ 194 - 26
src/main/java/com/goafanti/common/model/UserChannel.java

@@ -7,54 +7,89 @@ public class UserChannel implements Serializable {
 
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_channel.id
-	 * @mbg.generated  Wed Apr 28 13:55:31 CST 2021
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
 	 */
 	private Integer id;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_channel.uid
-	 * @mbg.generated  Wed Apr 28 13:55:31 CST 2021
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
 	 */
 	private String uid;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_channel.aid
-	 * @mbg.generated  Wed Apr 28 13:55:31 CST 2021
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
 	 */
 	private String aid;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_channel.status
-	 * @mbg.generated  Wed Apr 28 13:55:31 CST 2021
+	 * @mbg.generated  Fri May 07 15:11:33 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  Wed Apr 28 13:55:31 CST 2021
+	 * @mbg.generated  Fri May 07 15:11:33 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  Wed Apr 28 13:55:31 CST 2021
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
 	 */
 	private Date createTime;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_channel.remarks
-	 * @mbg.generated  Wed Apr 28 13:55:31 CST 2021
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
 	 */
 	private String remarks;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_channel.recovery
-	 * @mbg.generated  Wed Apr 28 13:55:31 CST 2021
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
 	 */
 	private Integer recovery;
 	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_channel.maid
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
+	 */
+	private String maid;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_channel.sign_time
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
+	 */
+	private Date signTime;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_channel.province
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
+	 */
+	private String province;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_channel.city
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
+	 */
+	private String city;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_channel.society_tag
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
+	 */
+	private String societyTag;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_channel.contacts
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
+	 */
+	private String contacts;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column user_channel.contact_mobile
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
+	 */
+	private String contactMobile;
+	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table user_channel
-	 * @mbg.generated  Wed Apr 28 13:55:31 CST 2021
+	 * @mbg.generated  Fri May 07 15:11:33 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  Wed Apr 28 13:55:31 CST 2021
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
 	 */
 	public Integer getId() {
 		return id;
@@ -63,7 +98,7 @@ public class UserChannel implements Serializable {
 	/**
 	 * 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  Wed Apr 28 13:55:31 CST 2021
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
 	 */
 	public void setId(Integer id) {
 		this.id = id;
@@ -72,7 +107,7 @@ public class UserChannel implements Serializable {
 	/**
 	 * 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  Wed Apr 28 13:55:31 CST 2021
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
 	 */
 	public String getUid() {
 		return uid;
@@ -81,7 +116,7 @@ public class UserChannel implements Serializable {
 	/**
 	 * 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  Wed Apr 28 13:55:31 CST 2021
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
 	 */
 	public void setUid(String uid) {
 		this.uid = uid == null ? null : uid.trim();
@@ -90,7 +125,7 @@ public class UserChannel implements Serializable {
 	/**
 	 * 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  Wed Apr 28 13:55:31 CST 2021
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
 	 */
 	public String getAid() {
 		return aid;
@@ -99,7 +134,7 @@ public class UserChannel implements Serializable {
 	/**
 	 * 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  Wed Apr 28 13:55:31 CST 2021
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
 	 */
 	public void setAid(String aid) {
 		this.aid = aid == null ? null : aid.trim();
@@ -108,7 +143,7 @@ public class UserChannel implements Serializable {
 	/**
 	 * 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  Wed Apr 28 13:55:31 CST 2021
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
 	 */
 	public Integer getStatus() {
 		return status;
@@ -117,7 +152,7 @@ public class UserChannel implements Serializable {
 	/**
 	 * 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  Wed Apr 28 13:55:31 CST 2021
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
 	 */
 	public void setStatus(Integer status) {
 		this.status = status;
@@ -126,7 +161,7 @@ public class UserChannel implements Serializable {
 	/**
 	 * 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  Wed Apr 28 13:55:31 CST 2021
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
 	 */
 	public Date getDistributionTime() {
 		return distributionTime;
@@ -135,7 +170,7 @@ public class UserChannel implements Serializable {
 	/**
 	 * 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  Wed Apr 28 13:55:31 CST 2021
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
 	 */
 	public void setDistributionTime(Date distributionTime) {
 		this.distributionTime = distributionTime;
@@ -144,7 +179,7 @@ public class UserChannel implements Serializable {
 	/**
 	 * 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  Wed Apr 28 13:55:31 CST 2021
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
 	 */
 	public Date getCreateTime() {
 		return createTime;
@@ -153,7 +188,7 @@ public class UserChannel implements Serializable {
 	/**
 	 * 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  Wed Apr 28 13:55:31 CST 2021
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
 	 */
 	public void setCreateTime(Date createTime) {
 		this.createTime = createTime;
@@ -162,7 +197,7 @@ public class UserChannel implements Serializable {
 	/**
 	 * 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  Wed Apr 28 13:55:31 CST 2021
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
 	 */
 	public String getRemarks() {
 		return remarks;
@@ -171,7 +206,7 @@ public class UserChannel implements Serializable {
 	/**
 	 * 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  Wed Apr 28 13:55:31 CST 2021
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
 	 */
 	public void setRemarks(String remarks) {
 		this.remarks = remarks == null ? null : remarks.trim();
@@ -180,7 +215,7 @@ public class UserChannel implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_channel.recovery
 	 * @return  the value of user_channel.recovery
-	 * @mbg.generated  Wed Apr 28 13:55:31 CST 2021
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
 	 */
 	public Integer getRecovery() {
 		return recovery;
@@ -189,15 +224,141 @@ public class UserChannel implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_channel.recovery
 	 * @param recovery  the value for user_channel.recovery
-	 * @mbg.generated  Wed Apr 28 13:55:31 CST 2021
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
 	 */
 	public void setRecovery(Integer recovery) {
 		this.recovery = recovery;
 	}
 
 	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_channel.maid
+	 * @return  the value of user_channel.maid
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
+	 */
+	public String getMaid() {
+		return maid;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_channel.maid
+	 * @param maid  the value for user_channel.maid
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
+	 */
+	public void setMaid(String maid) {
+		this.maid = maid == null ? null : maid.trim();
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_channel.sign_time
+	 * @return  the value of user_channel.sign_time
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
+	 */
+	public Date getSignTime() {
+		return signTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_channel.sign_time
+	 * @param signTime  the value for user_channel.sign_time
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
+	 */
+	public void setSignTime(Date signTime) {
+		this.signTime = signTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_channel.province
+	 * @return  the value of user_channel.province
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
+	 */
+	public String getProvince() {
+		return province;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_channel.province
+	 * @param province  the value for user_channel.province
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
+	 */
+	public void setProvince(String province) {
+		this.province = province == null ? null : province.trim();
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_channel.city
+	 * @return  the value of user_channel.city
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
+	 */
+	public String getCity() {
+		return city;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_channel.city
+	 * @param city  the value for user_channel.city
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
+	 */
+	public void setCity(String city) {
+		this.city = city == null ? null : city.trim();
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_channel.society_tag
+	 * @return  the value of user_channel.society_tag
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
+	 */
+	public String getSocietyTag() {
+		return societyTag;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_channel.society_tag
+	 * @param societyTag  the value for user_channel.society_tag
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
+	 */
+	public void setSocietyTag(String societyTag) {
+		this.societyTag = societyTag == null ? null : societyTag.trim();
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_channel.contacts
+	 * @return  the value of user_channel.contacts
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
+	 */
+	public String getContacts() {
+		return contacts;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_channel.contacts
+	 * @param contacts  the value for user_channel.contacts
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
+	 */
+	public void setContacts(String contacts) {
+		this.contacts = contacts == null ? null : contacts.trim();
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column user_channel.contact_mobile
+	 * @return  the value of user_channel.contact_mobile
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
+	 */
+	public String getContactMobile() {
+		return contactMobile;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column user_channel.contact_mobile
+	 * @param contactMobile  the value for user_channel.contact_mobile
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
+	 */
+	public void setContactMobile(String contactMobile) {
+		this.contactMobile = contactMobile == null ? null : contactMobile.trim();
+	}
+
+	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_channel
-	 * @mbg.generated  Wed Apr 28 13:55:31 CST 2021
+	 * @mbg.generated  Fri May 07 15:11:33 CST 2021
 	 */
 	@Override
 	public String toString() {
@@ -213,6 +374,13 @@ public class UserChannel implements Serializable {
 		sb.append(", createTime=").append(createTime);
 		sb.append(", remarks=").append(remarks);
 		sb.append(", recovery=").append(recovery);
+		sb.append(", maid=").append(maid);
+		sb.append(", signTime=").append(signTime);
+		sb.append(", province=").append(province);
+		sb.append(", city=").append(city);
+		sb.append(", societyTag=").append(societyTag);
+		sb.append(", contacts=").append(contacts);
+		sb.append(", contactMobile=").append(contactMobile);
 		sb.append(", serialVersionUID=").append(serialVersionUID);
 		sb.append("]");
 		return sb.toString();

+ 269 - 0
src/main/java/com/goafanti/common/model/UserMid.java

@@ -0,0 +1,269 @@
+package com.goafanti.common.model;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class UserMid implements Serializable {
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column user_mid.id
+     *
+     * @mbg.generated Thu May 06 15:37:38 CST 2021
+     */
+    private Integer id;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column user_mid.uid
+     *
+     * @mbg.generated Thu May 06 15:37:38 CST 2021
+     */
+    private String uid;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column user_mid.aid
+     *
+     * @mbg.generated Thu May 06 15:37:38 CST 2021
+     */
+    private String aid;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column user_mid.last_follow_time
+     *
+     * @mbg.generated Thu May 06 15:37:38 CST 2021
+     */
+    private Date lastFollowTime;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column user_mid.last_sign_time
+     *
+     * @mbg.generated Thu May 06 15:37:38 CST 2021
+     */
+    private Date lastSignTime;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column user_mid.create_time
+     *
+     * @mbg.generated Thu May 06 15:37:38 CST 2021
+     */
+    private Date createTime;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column user_mid.big_customer
+     *
+     * @mbg.generated Thu May 06 15:37:38 CST 2021
+     */
+    private Integer bigCustomer;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table user_mid
+     *
+     * @mbg.generated Thu May 06 15:37:38 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_mid.id
+     *
+     * @return the value of user_mid.id
+     *
+     * @mbg.generated Thu May 06 15:37:38 CST 2021
+     */
+    public Integer getId() {
+        return id;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column user_mid.id
+     *
+     * @param id the value for user_mid.id
+     *
+     * @mbg.generated Thu May 06 15:37:38 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_mid.uid
+     *
+     * @return the value of user_mid.uid
+     *
+     * @mbg.generated Thu May 06 15:37:38 CST 2021
+     */
+    public String getUid() {
+        return uid;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column user_mid.uid
+     *
+     * @param uid the value for user_mid.uid
+     *
+     * @mbg.generated Thu May 06 15:37:38 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_mid.aid
+     *
+     * @return the value of user_mid.aid
+     *
+     * @mbg.generated Thu May 06 15:37:38 CST 2021
+     */
+    public String getAid() {
+        return aid;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column user_mid.aid
+     *
+     * @param aid the value for user_mid.aid
+     *
+     * @mbg.generated Thu May 06 15:37:38 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_mid.last_follow_time
+     *
+     * @return the value of user_mid.last_follow_time
+     *
+     * @mbg.generated Thu May 06 15:37:38 CST 2021
+     */
+    public Date getLastFollowTime() {
+        return lastFollowTime;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column user_mid.last_follow_time
+     *
+     * @param lastFollowTime the value for user_mid.last_follow_time
+     *
+     * @mbg.generated Thu May 06 15:37:38 CST 2021
+     */
+    public void setLastFollowTime(Date lastFollowTime) {
+        this.lastFollowTime = lastFollowTime;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column user_mid.last_sign_time
+     *
+     * @return the value of user_mid.last_sign_time
+     *
+     * @mbg.generated Thu May 06 15:37:38 CST 2021
+     */
+    public Date getLastSignTime() {
+        return lastSignTime;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column user_mid.last_sign_time
+     *
+     * @param lastSignTime the value for user_mid.last_sign_time
+     *
+     * @mbg.generated Thu May 06 15:37:38 CST 2021
+     */
+    public void setLastSignTime(Date lastSignTime) {
+        this.lastSignTime = lastSignTime;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column user_mid.create_time
+     *
+     * @return the value of user_mid.create_time
+     *
+     * @mbg.generated Thu May 06 15:37:38 CST 2021
+     */
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column user_mid.create_time
+     *
+     * @param createTime the value for user_mid.create_time
+     *
+     * @mbg.generated Thu May 06 15:37:38 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_mid.big_customer
+     *
+     * @return the value of user_mid.big_customer
+     *
+     * @mbg.generated Thu May 06 15:37:38 CST 2021
+     */
+    public Integer getBigCustomer() {
+        return bigCustomer;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column user_mid.big_customer
+     *
+     * @param bigCustomer the value for user_mid.big_customer
+     *
+     * @mbg.generated Thu May 06 15:37:38 CST 2021
+     */
+    public void setBigCustomer(Integer bigCustomer) {
+        this.bigCustomer = bigCustomer;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table user_mid
+     *
+     * @mbg.generated Thu May 06 15:37:38 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(", lastFollowTime=").append(lastFollowTime);
+        sb.append(", lastSignTime=").append(lastSignTime);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", bigCustomer=").append(bigCustomer);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

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

@@ -73,15 +73,19 @@ public class ReleaseUserTask {
 			if (!userTmpList.isEmpty())
 				count.addAll(userTmpList);
 		}
-		List<userDaysBo> userChannelList = customerService.selectChannelUserDays(0);
+		List<userDaysBo> userChannelList = customerService.selectChannelNotFollow();
 		if (!userChannelList.isEmpty())
 			count.addAll(userChannelList);
 		List<Notice> ln = new ArrayList<>();
 		for (userDaysBo ub : count) {
-			String str = String.format("您的%s客户【%s】剩余天数不足十五天,请及时跟进或者限时签单!", ub.getType() == 1 ? "私有" : "渠道",
-					ub.getName());
+			String str=null;  
+			if (ub.getType() == 1) {
+				str = String.format("您的%s客户【%s】剩余天数不足十五天,请及时跟进或者限时签单!", "私有", ub.getName());
+			}else {
+				str = String.format("您的%s客户【%s】已经十五天未跟进,请及时跟进或者限时签单!", "渠道", ub.getName());
+			}
 			ln.add(new Notice(UUID.randomUUID().toString(), new Date(), 0, ub.getAid(),
-					NoticeStatus.CUSTOMER_PRIVATE_REMINDER.getCode(), str));
+					NoticeStatus.CUSTOMER_PRIVATE_REMINDER.getCode(), str,ub.getUid()));
 		}
 		List<Notice> newList = new ArrayList<>();
 		if (ln != null && ln.size() > 0) {
@@ -139,17 +143,25 @@ public class ReleaseUserTask {
 					}
 				}
 			}
-			// 获取90天渠道释放
-			List<userDaysBo> userChannelList = customerService.selectChannelUserDays(1);
-			List<userDaysBo> newCList=new ArrayList<>();
+			// 获取超过90天客户,判断是否回收过,未回收则回收,已回收则释放为公共客户
+			List<userDaysBo> userChannelList = customerService.selectChannelUserDays();
+			List<userDaysBo> hsList=new ArrayList<>();
+			List<userDaysBo> sfList=new ArrayList<>();
 			if (userChannelList != null && userChannelList.size() > 0) {
 				for (int i = 0; i < userChannelList.size(); i++) {
-					newCList.add(userChannelList.get(i));
-					if (pointsDataLimit == newCList.size() || i == userChannelList.size() - 1) {
-						userService.pushReleaseUserChannel(newCList);
+					//回收
+					if (userChannelList.get(i).getRecovery()==0) {
+						hsList.add(userChannelList.get(i));
+					}else {
+						sfList.add(userChannelList.get(i));
+					}
+					if (pointsDataLimit == (hsList.size()+sfList.size()) || i == userChannelList.size() - 1) {
+						if(!hsList.isEmpty())userService.pushReleaseUserChannel(hsList,0);
+						if(!sfList.isEmpty())userService.pushReleaseUserChannel(sfList,1);
+						hsList.clear();
+						sfList.clear();
+						Thread.sleep(2000);
 					}
-					newCList.clear();
-					Thread.sleep(2000);
 				}
 			}
 			List<LockingReleaseBo> lockList = customerService.selectPendinglockUserList();
@@ -157,7 +169,7 @@ public class ReleaseUserTask {
 				customerService.updateReleaseLock(releaseTime);
 		} catch (Exception e) {
 			Notice n = new Notice(UUID.randomUUID().toString(), new Date(), 0, "1",
-					NoticeStatus.TASK_PATENT_ERROR.getCode(), "==============客户释放失败================");
+					NoticeStatus.TASK_PATENT_ERROR.getCode(), "==============客户释放失败================",null);
 			noticeMapper.insert(n);
 			EmailBo emailBo = new EmailBo("释放客户失败", AFTConstants.ADMIN_EMAIL, "超管", "平台", "系统", "释放客户失败");
 			try {

+ 42 - 0
src/main/java/com/goafanti/customer/bo/InputChannelCounts.java

@@ -0,0 +1,42 @@
+package com.goafanti.customer.bo;
+
+public class InputChannelCounts {
+	
+	private Integer type;
+	private String startTime;
+	private String endTime;
+	private Integer pageSize;
+	private Integer pageNo;
+	public Integer getType() {
+		return type;
+	}
+	public void setType(Integer type) {
+		this.type = type;
+	}
+	public String getStartTime() {
+		return startTime;
+	}
+	public void setStartTime(String startTime) {
+		this.startTime = startTime;
+	}
+	public String getEndTime() {
+		return endTime;
+	}
+	public void setEndTime(String endTime) {
+		this.endTime = endTime;
+	}
+	public Integer getPageSize() {
+		return pageSize;
+	}
+	public void setPageSize(Integer pageSize) {
+		this.pageSize = pageSize;
+	}
+	public Integer getPageNo() {
+		return pageNo;
+	}
+	public void setPageNo(Integer pageNo) {
+		this.pageNo = pageNo;
+	}
+	
+	
+}

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

@@ -6,6 +6,10 @@ public class InputListChannel {
 	private Integer province;
 	private Integer city;
 	private Integer status;
+	private String aid;
+	/**
+	 * 0营销员 1渠道专员 2营销总监
+	 */
 	private Integer type;
 	private String startTime;
 	private String endTime;
@@ -65,6 +69,12 @@ public class InputListChannel {
 	public void setType(Integer type) {
 		this.type = type;
 	}
+	public String getAid() {
+		return aid;
+	}
+	public void setAid(String aid) {
+		this.aid = aid;
+	}
 	
 	
 }

+ 57 - 0
src/main/java/com/goafanti/customer/bo/OutChannelCounts.java

@@ -0,0 +1,57 @@
+package com.goafanti.customer.bo;
+
+public class OutChannelCounts {
+	private String aid;
+	private String name;
+	private Integer counts;
+	private Integer unallocated;
+	private Integer allocated;
+	private Integer common;
+	private Integer sign;
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	
+	public Integer getUnallocated() {
+		return unallocated;
+	}
+	public void setUnallocated(Integer unallocated) {
+		this.unallocated = unallocated;
+	}
+	public Integer getAllocated() {
+		return allocated;
+	}
+	public void setAllocated(Integer allocated) {
+		this.allocated = allocated;
+	}
+
+	public Integer getSign() {
+		return sign;
+	}
+	public void setSign(Integer sign) {
+		this.sign = sign;
+	}
+	public Integer getCommon() {
+		return common;
+	}
+	public void setCommon(Integer common) {
+		this.common = common;
+	}
+	public Integer getCounts() {
+		return counts;
+	}
+	public void setCounts(Integer counts) {
+		this.counts = counts;
+	}
+	public String getAid() {
+		return aid;
+	}
+	public void setAid(String aid) {
+		this.aid = aid;
+	}
+	
+	
+}

+ 11 - 0
src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java

@@ -50,6 +50,7 @@ import com.goafanti.customer.bo.CustomerListOut;
 import com.goafanti.customer.bo.CustomerOrganizationDetailBo;
 import com.goafanti.customer.bo.CustomerPersonalDetailBo;
 import com.goafanti.customer.bo.FollowBusinessBo;
+import com.goafanti.customer.bo.InputChannelCounts;
 import com.goafanti.customer.bo.InputListChannel;
 import com.goafanti.customer.bo.UserDetailBo;
 import com.goafanti.customer.service.CustomerService;
@@ -1279,6 +1280,16 @@ public class AdminCustomerApiController extends BaseApiController{
 	}
 	
 	/**
+	 *  渠道客户统计列表
+	 **/
+	@RequestMapping(value = "/listChannelCounts" , method = RequestMethod.GET)
+	public Result listChannelCounts(InputChannelCounts in){
+		Result res = new Result();
+		res.setData(customerService.listChannelCounts(in));
+		return res;
+	}
+	
+	/**
 	 * 	渠道客户转交 
 	 * @param userIds 用户编号集
 	 * @param receiveId 接受者

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

@@ -24,6 +24,7 @@ import com.goafanti.customer.bo.CustomerPersonalDetailBo;
 import com.goafanti.customer.bo.CustomerSimpleBo;
 import com.goafanti.customer.bo.FollowBusinessBo;
 import com.goafanti.customer.bo.FollowListBo;
+import com.goafanti.customer.bo.InputChannelCounts;
 import com.goafanti.customer.bo.InputListChannel;
 import com.goafanti.customer.bo.LockingReleaseBo;
 import com.goafanti.customer.bo.StatisticBo;
@@ -515,12 +516,8 @@ public interface CustomerService {
 	int updatePrivateBusinessTransfer(String inputId, String uid, String pid);
 	int pushReleaseUser(String id);
 	List<userDaysBo> selectUserDays(String id);
-	/**
-	 * 
-	 * @param type 0提前15天 1达到
-	 * @return
-	 */
-	List<userDaysBo> selectChannelUserDays(Integer type);
+
+	List<userDaysBo> selectChannelUserDays();
 	
 	int addGuidance(String followId, String guidance);
 	/**
@@ -554,4 +551,6 @@ public interface CustomerService {
 	boolean checkChannel(List<String> uids);
 	boolean checkBeforeChannel(String uid);
 	boolean checkRecovery(List<String> uids);
+	List<userDaysBo> selectChannelNotFollow();
+	Object listChannelCounts(InputChannelCounts in);
 }

+ 28 - 6
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -24,6 +24,7 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import com.alibaba.druid.sql.parser.Token;
 import com.goafanti.common.bo.Error;
 import com.goafanti.common.bo.userDaysBo;
 import com.goafanti.common.constant.AFTConstants;
@@ -85,6 +86,7 @@ import com.goafanti.customer.bo.CustomerPersonalDetailBo;
 import com.goafanti.customer.bo.CustomerSimpleBo;
 import com.goafanti.customer.bo.FollowBusinessBo;
 import com.goafanti.customer.bo.FollowListBo;
+import com.goafanti.customer.bo.InputChannelCounts;
 import com.goafanti.customer.bo.InputListChannel;
 import com.goafanti.customer.bo.LockingReleaseBo;
 import com.goafanti.customer.bo.StatisticBo;
@@ -1991,10 +1993,8 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 	}
 
 	@Override
-	public List<userDaysBo> selectChannelUserDays(Integer type) {
+	public List<userDaysBo> selectChannelUserDays() {
 		Integer days = 90;
-		if (type == 0)
-			days -= USER_REMIND_DAYS;
 		return userLockReleaseMapper.selectChannelUserDays(days);
 	}
 
@@ -2073,11 +2073,15 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 			params.put("startTime", in.getStartTime());
 		if (StringUtils.isNotBlank(in.getEndTime()))
 			params.put("endTime", in.getEndTime() + " 23:59:59");
-		if (TokenManager.hasRole(AFTConstants.SALESMAN_MANAGER)) {
+		if (TokenManager.hasRole(AFTConstants.SALESMAN_DIRECTOR)||TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
+			
+		}else if (TokenManager.hasRole(AFTConstants.SALESMAN_MANAGER)) {
 			params.put("maid", TokenManager.getAdminId());
-		}else if (!TokenManager.hasRole(AFTConstants.SALESMAN_DIRECTOR) && !TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
-			params.put("aid", TokenManager.getAdminId());
+		}else {
+			params.put("aid", in.getAid()==null?TokenManager.getAdminId():in.getAid());
+			
 		}
+		
 		return findPage("selectChannelCustomerList", "selectChannelCustomerCount", params, in.getPageNo(),
 				in.getPageSize());
 
@@ -2161,4 +2165,22 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		return false;
 	}
 
+	@Override
+	public List<userDaysBo> selectChannelNotFollow(){ 
+			Integer days = 15;
+			return userLockReleaseMapper.selectChannelNotFollow(days);
+		}
+
+	@Override
+	public Object listChannelCounts(InputChannelCounts in) {
+		Map<String, Object> params = new HashMap<>();
+		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");
+		return findPage("selectChannelCountsList", "selectChannelCountsCount", params, in.getPageNo(),
+				in.getPageSize());
+	}
+
 }

+ 15 - 0
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -61,6 +61,7 @@ import com.goafanti.common.dao.TTaskMidMapper;
 import com.goafanti.common.dao.ThirdPartyCompanyMapper;
 import com.goafanti.common.dao.UserLockReleaseMapper;
 import com.goafanti.common.dao.UserMapper;
+import com.goafanti.common.dao.UserMidMapper;
 import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.enums.OrderLogProcess;
 import com.goafanti.common.error.BusinessException;
@@ -86,6 +87,7 @@ import com.goafanti.common.model.TOrderRefundWithBLOBs;
 import com.goafanti.common.model.TOrderTask;
 import com.goafanti.common.model.TTaskMid;
 import com.goafanti.common.model.User;
+import com.goafanti.common.model.UserMid;
 import com.goafanti.common.utils.ExportExcelUtil;
 import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.common.utils.SendEmailUtil;
@@ -174,6 +176,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	private ThirdPartyCompanyMapper	thirdPartyCompanyMapper;
 	@Autowired
 	private TTaskMidMapper	tTaskMidMapper;
+	@Autowired
+	private UserMidMapper	userMidMapper;
 	@Value(value = "${mobileRemindCodeTemplate}")
 	private String					mobileRemindCodeTemplate	= null;
 	@Value(value = "${upload.path}")
@@ -342,6 +346,17 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 			AdminListBo a = adminMapper.getDeptNameByAid(TokenManager.getAdminId());
 			aids.addAll(adminMapper.listNameByDepAndName(a.getDepartmentId(), "营销管理员"));
 			type=NoticeStatus.ORDER_START.getCode();
+			//如果订单金额超过10W标记为大客户
+			if(t.getTotalAmount().compareTo(new BigDecimal("10"))>=0) {
+				UserMid um=new UserMid();
+				um.setUid(t.getBuyerId());
+				um.setBigCustomer(1);
+				int i=userMidMapper.updateByUid(um);
+				if (i==0) {
+					um.setAid(t2.getSalesmanId());
+					userMidMapper.insertSelective(um);
+				}
+			}
 			pushGeneralSendNoticeAndEmail(aids, type,t2.getOrderNo(), TokenManager.getAdminId(),t.getApproval());
 		}
 		if (t2.getApproval()==ApprovalNewState.BH.getCode()||

+ 5 - 1
src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java

@@ -50,6 +50,7 @@ import com.goafanti.common.dao.UserBusinessMapper;
 import com.goafanti.common.dao.UserChannelMapper;
 import com.goafanti.common.dao.UserLockReleaseMapper;
 import com.goafanti.common.dao.UserMapper;
+import com.goafanti.common.enums.ChannelStatus;
 import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.enums.OrderLogProcess;
 import com.goafanti.common.error.BusinessException;
@@ -71,6 +72,7 @@ import com.goafanti.common.model.TaskHoursCount;
 import com.goafanti.common.model.TaskLog;
 import com.goafanti.common.model.TaskProgress;
 import com.goafanti.common.model.TaskProgressLog;
+import com.goafanti.common.model.User;
 import com.goafanti.common.model.UserBusiness;
 import com.goafanti.common.model.UserChannel;
 import com.goafanti.common.model.UserLockRelease;
@@ -100,6 +102,7 @@ import com.goafanti.order.service.OrderNewService;
 import com.goafanti.order.service.OrderProjectService;
 import com.goafanti.organization.bo.OutPaymentNode;
 import com.goafanti.techproject.enums.TaskState;
+import com.mysql.fabric.xmlrpc.base.Data;
 @Service
 public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> implements OrderProjectService {
 	@Autowired
@@ -211,7 +214,8 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 				//如果是渠道客户更新渠道表
 				UserChannel uc=new UserChannel();
 				uc.setUid(tn.getBuyerId());
-				uc.setStatus(7);
+				uc.setStatus(ChannelStatus.YQD.getCode());
+				uc.setSignTime(date);
 				userChannelMapper.updateByUid(uc);
 		}else if (specially==0) {
 			addOrderLog(t.getOrderNo(), OrderLogProcess.XMPD.getCode(),remarks);

+ 33 - 32
src/main/java/com/goafanti/user/bo/InputUserChannel.java

@@ -9,11 +9,11 @@ public class InputUserChannel extends UserChannel{
 	/**  名称*/
 	private String userName;
 	/**  省*/
-	private String province;
+	private String provinces;
 	/**  市*/
-	private String city;
+	private String citys;
 	/**  社会性质*/
-	private String societyTag;
+	private String societyTags;
 	/**  联系人*/
 	private String contacts;
 	/**  联系人电话*/
@@ -39,35 +39,6 @@ public class InputUserChannel extends UserChannel{
 	}
 
 
-	public String getProvince() {
-		return province;
-	}
-
-
-	public void setProvince(String province) {
-		this.province = province;
-	}
-
-
-	public String getCity() {
-		return city;
-	}
-
-
-	public void setCity(String city) {
-		this.city = city;
-	}
-
-
-	public String getSocietyTag() {
-		return societyTag;
-	}
-
-
-	public void setSocietyTag(String societyTag) {
-		this.societyTag = societyTag;
-	}
-
 
 	public String getContacts() {
 		return contacts;
@@ -119,6 +90,36 @@ public class InputUserChannel extends UserChannel{
 	}
 
 
+	public String getProvinces() {
+		return provinces;
+	}
+
+
+	public void setProvinces(String provinces) {
+		this.provinces = provinces;
+	}
+
+
+	public String getCitys() {
+		return citys;
+	}
+
+
+	public void setCitys(String citys) {
+		this.citys = citys;
+	}
+
+
+	public String getSocietyTags() {
+		return societyTags;
+	}
+
+
+	public void setSocietyTags(String societyTags) {
+		this.societyTags = societyTags;
+	}
+
+
 	
 
 	

+ 2 - 0
src/main/java/com/goafanti/user/controller/UserChannelApiController.java

@@ -145,6 +145,8 @@ public class UserChannelApiController  extends CertifyApiController{
           }
           return res;
       }
+      
+      
 	
 
 }

+ 6 - 1
src/main/java/com/goafanti/user/service/UserService.java

@@ -69,7 +69,12 @@ public interface UserService {
 	List<User> selectUserByRoleName(String roleName1, String roleName2);
 
 
-	void pushReleaseUserChannel(List<userDaysBo> newCList);
+	/**
+	 * 
+	 * @param newCList
+	 * @param type 0回收 1释放
+	 */
+	void pushReleaseUserChannel(List<userDaysBo> newCList, Integer type);
 	
 	
 }

+ 23 - 5
src/main/java/com/goafanti/user/service/impl/UserChannelServiceImpl.java

@@ -120,7 +120,6 @@ public class UserChannelServiceImpl extends BaseMybatisDao<UserChannelMapper> im
     				}
     			}
     			if(flag){
-    				i++;
     				continue;
     			} else{//如果是空白行(即可能没有数据,但是有一定格式)
     				if(i == sheet.getLastRowNum())//如果到了最后一行,直接将那一行remove掉
@@ -159,12 +158,15 @@ public class UserChannelServiceImpl extends BaseMybatisDao<UserChannelMapper> im
 							break;
 						case 1:
 							in.setProvince(getProvinceId(pList,getCellValue(cell)));
+							in.setProvinces(getCellValue(cell));
 							break;
 						case 2:
 							in.setCity(getCityId(cList,getCellValue(cell)));
+							in.setCitys(getCellValue(cell));
 							break;
 						case 3:
 							in.setSocietyTag(SocietyTag.getCodeByValue(getCellValue(cell)).toString());
+							in.setSocietyTags(getCellValue(cell));
 							break;
 						case 4:
 							in.setContacts(getCellValue(cell));
@@ -197,10 +199,26 @@ public class UserChannelServiceImpl extends BaseMybatisDao<UserChannelMapper> im
 					in.setStatus(ChannelStatus.WFP.getCode());
 					list.add(in);
 				}else {
-//					共享类型 0-私有 1-公共 2 签单
-					if(u.getShareType()==0)in.setStatus(ChannelStatus.YCZSY.getCode());
+					Integer i=0;
+					if (u.getAid().equals(TokenManager.getAdminId())) {
+						i=1;
+					}
+//					共享类型 0-私有 1-公共 2 签单 
+					if(u.getShareType()==0) {
+						if(u.getChannel()==0) {
+							if(i==1)in.setStatus(ChannelStatus.YCZWDSY.getCode());
+							else in.setStatus(ChannelStatus.YCZBRSY.getCode());
+						}
+						else {
+							if(i==1)in.setStatus(ChannelStatus.YCZWDQD.getCode());
+							else in.setStatus(ChannelStatus.YCZBRQD.getCode());
+						}
+					}
 					else if(u.getShareType()==1)in.setStatus(ChannelStatus.YCZGG.getCode());
-					else if(u.getShareType()==2)in.setStatus(ChannelStatus.YCZQD.getCode());
+					else if(u.getShareType()==2) {
+						if(i==1)in.setStatus(ChannelStatus.YCZWDQIAND.getCode());
+						else in.setStatus(ChannelStatus.YCZBRQIAND.getCode());
+					}
 					in.setUid(u.getId());
 					list2.add(in);
 				}
@@ -290,7 +308,7 @@ public class UserChannelServiceImpl extends BaseMybatisDao<UserChannelMapper> im
 	
 
 	private boolean checkUserName(String userName) {
-		if (userName.contains("房地产")) {
+		if (userName!=null&&userName.contains("房地产")) {
 			return true;
 		}
 		return false;

+ 2 - 3
src/main/java/com/goafanti/user/service/impl/UserServiceImpl.java

@@ -375,9 +375,8 @@ public class UserServiceImpl extends BaseMybatisDao<UserMapper> implements UserS
 	}
 
 	@Override
-	public void pushReleaseUserChannel(List<userDaysBo> newCList) {
-		
-		userMapper.updateReleaseUserChannel(newCList);
+	public void pushReleaseUserChannel(List<userDaysBo> newCList,Integer type) {
+		userMapper.updateReleaseUserChannel(newCList,type);
 		
 	}