Browse Source

客户释放修改

anderx 1 year ago
parent
commit
0f036d37cb

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

@@ -378,15 +378,15 @@
 
   <select id="selectWaitReleaseCustomer" resultType="com.goafanti.customer.bo.LockingReleaseBo">
 	select
-		t0.id, t0.uid, t0.aid, DATE_FORMAT(t0.lock_time , '%Y-%m-%d') lockTime,u.new_channel newChannel,
+		t0.id, t0.uid, t0.aid, DATE_FORMAT(t0.lock_time , '%Y-%m-%d') lockTime,u.new_channel newChannel, 0 type,
 		um.last_follow_time lastFollowTime,u.nickname userName ,um.channel_type channelType,u.share_type shareType
 	from
-		(select id,uid,aid,lock_time from user_lock_release where aid = #{aid}  and status = 0)t0
+		(select id,uid,aid,lock_time from user_lock_release where aid = #{aid} and type = 0 and status = 0)t0
 	 left join user u on t0.uid=u.id  left join user_mid um on t0.uid=um.uid
-	where u.channel=0 and u.share_type in (0,2)
+	where u.channel=0
 	 and datediff(now(),if(t0.lock_time &lt; um.last_follow_time,um.last_follow_time,t0.lock_time))>30
     UNION
-    SELECT t0.id, t0.uid, t0.aid, DATE_FORMAT(t0.lock_time , '%Y-%m-%d') lockTime,u.new_channel newChannel,
+    SELECT t0.id, t0.uid, t0.aid, DATE_FORMAT(t0.lock_time , '%Y-%m-%d') lockTime,u.new_channel newChannel, 1 type,
            um.last_follow_time lastFollowTime,u.nickname userName ,um.channel_type channelType,u.share_type shareType
     from (select id,uid,aid,lock_time from user_lock_release where aid = #{aid} and type = 0 and status = 0)t0
       left join `user` u  on t0.uid=u.id left join user_mid um on u.id =um.uid

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

@@ -66,9 +66,9 @@ public class ReleaseUserTask {
 	 * 客户释放
 	 *
 	 */
-//	@Scheduled(cron = "0 23 9  * * ?")
+	@Scheduled(cron = "0 30 16  * * ?")
 //	@RequestMapping("/open/test")
-	@Scheduled(cron = "0 0 1  * * ?")
+//	@Scheduled(cron = "0 0 1  * * ?")
 	public void startTask() {
 		try {
 			List<User> userList = userService.selectUserByRoleName("营销员", "营销经理");
@@ -241,13 +241,17 @@ public class ReleaseUserTask {
 					if (StringUtils.isNotBlank(u.getId())&&!AFTConstants.CAOJIN_AID.equals(u.getId())) {
 						// 获取30天释放 释放以锁定表与user_mid最后跟进取时间
 						List<LockingReleaseBo>  userTmpList = customerService.selectWaitReleaseCustomer(u.getId());
-						customerService.pushReleaseLog(userTmpList, 0);
+						customerService.pushReleaseLog(userTmpList);
 						addUserNotice(userTmpList);
 						if (!userTmpList.isEmpty()) {
-							//私有的交给原来的处理锁与客户,签单的另外处理
-							List<LockingReleaseBo> collect = userTmpList.stream().filter(e -> e.getShareType() == 0).collect(Collectors.toList());
+							//30天私有和270天签单业务释放不改变
+							List<LockingReleaseBo> collect = userTmpList.stream().filter(e ->
+											(e.getShareType() == 0&& e.getType()==0)||e.getType()==1
+									).collect(Collectors.toList());
 							lockUserList.addAll(collect);
-							List<LockingReleaseBo> collect2 = userTmpList.stream().filter(e -> e.getShareType() == 2).collect(Collectors.toList());
+							//30天签单单独只释放签签单
+							List<LockingReleaseBo> collect2 = userTmpList.stream().filter(e ->
+									e.getShareType() == 2&& e.getType()==0).collect(Collectors.toList());
 							lockUserList2.addAll(collect2);
 						}
 					}
@@ -269,6 +273,7 @@ public class ReleaseUserTask {
 			if (!lockUserList2.isEmpty()) {
 				for (int i = 0; i < lockUserList2.size(); i++) {
 					newList.add(lockUserList2.get(i));
+					System.out.println(lockUserList2.get(i).getUserName());
 					if (pointsDataLimit == newList.size() || i == lockUserList.size() - 1) {
 						userService.updateUserShareType(newList);
 						newList.clear();

+ 6 - 3
src/main/java/com/goafanti/customer/bo/LockingReleaseBo.java

@@ -5,7 +5,7 @@ public class LockingReleaseBo {
 	private String uid;
 	private String aid;
 	private String lockTime;
-	private String type;
+	private Integer type;
 	private String businessProjectId;
 	private String businessProjectName;
 	private String salesmanName;
@@ -98,12 +98,15 @@ public class LockingReleaseBo {
 	public void setLastSignTime(String lastSignTime) {
 		this.lastSignTime = lastSignTime;
 	}
-	public String getType() {
+
+	public Integer getType() {
 		return type;
 	}
-	public void setType(String type) {
+
+	public void setType(Integer type) {
 		this.type = type;
 	}
+
 	public Integer getMySign() {
 		return mySign;
 	}

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

@@ -507,10 +507,9 @@ public interface CustomerService {
 	/**
 	 *
 	 * @param list 释放客户
-	 * @param type 0 未跟进  1未签单
 	 * @throws InterruptedException
 	 */
-	void pushReleaseLog(List<LockingReleaseBo> list,Integer type) throws InterruptedException;
+	void pushReleaseLog(List<LockingReleaseBo> list) throws InterruptedException;
 	Object listChannelCustomer(InputListChannel in);
 	/**
 	 *

+ 2 - 1
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -2579,12 +2579,13 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 	}
 
 	@Override
-	public void pushReleaseLog(List<LockingReleaseBo> list, Integer type) throws InterruptedException {
+	public void pushReleaseLog(List<LockingReleaseBo> list) throws InterruptedException {
 		Date date = new Date();
 		List<LockingReleaseBo> newList = new ArrayList<LockingReleaseBo>();
 		List<UserTransferLog> list3 = new ArrayList<UserTransferLog>();
 		if (!list.isEmpty()) {
 			for (int i = 0; i < list.size(); i++) {
+				int type = list.get(i).getType();
 				newList.add(list.get(i));
 				if (50 == newList.size() || i == list.size() - 1) {
 					if (!newList.isEmpty()) {