|
@@ -1,21 +1,25 @@
|
|
|
package com.fs.qw.qwTask;
|
|
package com.fs.qw.qwTask;
|
|
|
|
|
|
|
|
import com.fs.course.service.IFsUserCourseService;
|
|
import com.fs.course.service.IFsUserCourseService;
|
|
|
-import com.fs.qw.service.IQwExternalContactService;
|
|
|
|
|
-import com.fs.qw.service.IQwGroupMsgService;
|
|
|
|
|
-import com.fs.qw.service.IQwMaterialService;
|
|
|
|
|
-import com.fs.qw.service.IQwUserService;
|
|
|
|
|
|
|
+import com.fs.qw.domain.QwIpadServerLog;
|
|
|
|
|
+import com.fs.qw.domain.QwUser;
|
|
|
|
|
+import com.fs.qw.mapper.QwUserMapper;
|
|
|
|
|
+import com.fs.qw.service.*;
|
|
|
import com.fs.sop.service.impl.QwSopLogsServiceImpl;
|
|
import com.fs.sop.service.impl.QwSopLogsServiceImpl;
|
|
|
import com.fs.sop.service.impl.QwSopServiceImpl;
|
|
import com.fs.sop.service.impl.QwSopServiceImpl;
|
|
|
import com.fs.sop.service.ISopUserLogsService;
|
|
import com.fs.sop.service.ISopUserLogsService;
|
|
|
import com.fs.statis.IFsStatisQwWatchService;
|
|
import com.fs.statis.IFsStatisQwWatchService;
|
|
|
import com.fs.statis.service.FsStatisSalerWatchService;
|
|
import com.fs.statis.service.FsStatisSalerWatchService;
|
|
|
|
|
+import com.fs.wxwork.dto.WxWorkGetQrCodeDTO;
|
|
|
|
|
+import com.fs.wxwork.service.WxWorkService;
|
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
|
|
|
+import java.util.Date;
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
|
|
@Component("qwTask")
|
|
@Component("qwTask")
|
|
|
public class qwTask {
|
|
public class qwTask {
|
|
@@ -50,6 +54,21 @@ public class qwTask {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IQwMaterialService iQwMaterialService;
|
|
private IQwMaterialService iQwMaterialService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private QwUserMapper qwUserMapper;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IQwIpadServerService ipadServerService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IQwIpadServerLogService qwIpadServerLogService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IQwIpadServerUserService qwIpadServerUserService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private WxWorkService wxWorkService;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
//正在使用
|
|
//正在使用
|
|
|
public void qwExternalContact()
|
|
public void qwExternalContact()
|
|
@@ -199,4 +218,55 @@ public class qwTask {
|
|
|
public void updateMaterialByTwoDays(){
|
|
public void updateMaterialByTwoDays(){
|
|
|
iQwMaterialService.updateQwMaterialByQw();
|
|
iQwMaterialService.updateQwMaterialByQw();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 定时清除 占着茅坑不拉屎的ipad 账号
|
|
|
|
|
+ */
|
|
|
|
|
+ public void selectQwUserByUnbindIpad(){
|
|
|
|
|
+ List<QwUser> list = qwUserMapper.selectQwUserByTest();
|
|
|
|
|
+ for (QwUser qwUser : list) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ Integer serverStatus = qwUser.getServerStatus();
|
|
|
|
|
+ Long serverId = qwUser.getServerId();
|
|
|
|
|
+ if (serverStatus==0){
|
|
|
|
|
+ System.out.println("不需要解绑");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (serverId==null){
|
|
|
|
|
+ System.out.println("serverId不存在");
|
|
|
|
|
+ }
|
|
|
|
|
+ QwUser u = new QwUser();
|
|
|
|
|
+ u.setId(qwUser.getId());
|
|
|
|
|
+ u.setServerId(null);
|
|
|
|
|
+ u.setServerStatus(0);
|
|
|
|
|
+ qwUserMapper.updateQwUser(u);
|
|
|
|
|
+ ipadServerService.addServer(serverId);
|
|
|
|
|
+ QwIpadServerLog qwIpadServerLog = new QwIpadServerLog();
|
|
|
|
|
+ qwIpadServerLog.setType(2);
|
|
|
|
|
+ qwIpadServerLog.setTilie("解绑");
|
|
|
|
|
+ qwIpadServerLog.setServerId(serverId);
|
|
|
|
|
+ qwIpadServerLog.setQwUserId(qwUser.getId());
|
|
|
|
|
+ qwIpadServerLog.setCompanyUserId(qwUser.getCompanyUserId());
|
|
|
|
|
+ qwIpadServerLog.setCompanyId(qwUser.getCompanyId());
|
|
|
|
|
+ qwIpadServerLog.setCreateTime(new Date());
|
|
|
|
|
+ qwIpadServerLogService.insertQwIpadServerLog(qwIpadServerLog);
|
|
|
|
|
+ qwIpadServerUserService.deleteQwIpadServerUserByQwUserId(qwUser.getId());
|
|
|
|
|
+ WxWorkGetQrCodeDTO wxWorkGetQrCodeDTO = new WxWorkGetQrCodeDTO();
|
|
|
|
|
+ wxWorkGetQrCodeDTO.setUuid(qwUser.getUid());
|
|
|
|
|
+ wxWorkService.LoginOut(wxWorkGetQrCodeDTO,qwUser.getServerId());
|
|
|
|
|
+ updateIpadStatus(qwUser.getId(),0);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ System.out.println("解绑ipad报错"+e);
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ void updateIpadStatus(Long id ,Integer status){
|
|
|
|
|
+ QwUser u = new QwUser();
|
|
|
|
|
+ u.setId(id);
|
|
|
|
|
+ u.setIpadStatus(status);
|
|
|
|
|
+ qwUserMapper.updateQwUser(u);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|