Browse Source

测试支持

wanghui 7 years ago
parent
commit
bbb877f7f4

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

@@ -356,7 +356,12 @@
   
   <select id="selectWaitReleaseCustomer" resultType="com.goafanti.customer.bo.LockingReleaseBo">
 	select 
-		t0.id,t0.uid,t0.aid,t0.lock_time,t1.last_follow_time,t2.last_sign_time
+		t0.id,
+		t0.uid,
+		t0.aid,
+		t0.lock_time,
+		t1.last_follow_time,
+		t2.last_sign_time
 	from
 		(select id,uid,aid,lock_time from user_lock_release where aid = #{aid} and type = 0 and status = 0)t0
 	left join 
@@ -365,6 +370,7 @@
 	left join 
 		(select buyer_id,salesman_id,max(sign_time) as last_sign_time from t_order where salesman_id = #{aid} group by buyer_id)t2
 	on t0.uid = t2.buyer_id
+	<!-- where datediff(t1.last_follow_time,t0.lock_time)>30 or datediff(t2.last_sign_time,t0.lock_time)>270 -->
 	where datediff(t1.last_follow_time,t0.lock_time)>30 or datediff(t2.last_sign_time,t0.lock_time)>270
   </select>
   
@@ -373,7 +379,7 @@
 		t0.id,
 		t0.uid,
 		t0.aid,
-		t0.lock_time as lockTime,
+		t0.lock_time,
 		t1.last_follow_time,
 		t2.last_sign_time
 	from

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

@@ -8,12 +8,15 @@ import javax.annotation.Resource;
 
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
 
 import com.goafanti.common.model.User;
 import com.goafanti.customer.bo.LockingReleaseBo;
 import com.goafanti.customer.service.CustomerService;
 import com.goafanti.user.service.UserService;
-@Component
+//@Component
+@Controller
 public class ReleaseUserTask {
 	@Resource
 	private CustomerService customerServiceImpl;
@@ -23,7 +26,8 @@ public class ReleaseUserTask {
 	/**
 	 * 每天凌晨一点释放客户和业务
 	 */
-	@Scheduled(cron = "0 0 1 * * ?") 
+	//@Scheduled(cron = "0 0 1 * * ?") 
+	@RequestMapping(value = "/releaseUser")
 	public void releaseUser(){
 		Date releaseTime = new Date();
 		List<User> userList = userServiceImpl.selectUserByRoleName("营销员");