Procházet zdrojové kódy

定时任务切换

anderx před 1 rokem
rodič
revize
c0da14ab49

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

@@ -180,7 +180,7 @@
                c.nickname userName ,d.name adminName,b.create_time createTime,b.uid,b.aid
         from  restrict_project b left join business_project a on b.pid =a.id
                  left join user c on b.uid=c.id left join admin d on b.aid=d.id
-        where  b.aid= #{aid,jdbcType=VARCHAR}
+        where  b.aid= #{aid,jdbcType=VARCHAR} and b.type in (1,2)
     </select>
     <select id="selectByParam" resultMap="BaseResultMap">
         select

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

@@ -22,8 +22,8 @@ import com.goafanti.customer.service.CustomerService;
 import com.goafanti.user.service.UserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
 import java.time.LocalDateTime;
@@ -35,8 +35,8 @@ import java.util.List;
 import java.util.UUID;
 
 
-//@Component
-@RestController
+@Component
+//@RestController
 public class ReleaseUserTask {
 	@Resource
 	private CustomerService customerService;
@@ -66,8 +66,8 @@ public class ReleaseUserTask {
 	 *
 	 */
 //	@Scheduled(cron = "0 23 9  * * ?")
-	@RequestMapping("/open/test")
-//	@Scheduled(cron = "0 0 1  * * ?")
+//	@RequestMapping("/open/test")
+	@Scheduled(cron = "0 0 1  * * ?")
 	public void startTask() {
 		try {
 			List<User> userList = userService.selectUserByRoleName("营销员", "营销经理");