|
|
@@ -21,10 +21,11 @@ import com.fs.his.service.IFsInquiryOrderService;
|
|
|
import com.fs.his.utils.qrcode.QRCodeUtils;
|
|
|
import com.fs.qw.domain.QwCompany;
|
|
|
import com.fs.qw.domain.QwExternalContact;
|
|
|
+import com.fs.qw.domain.QwIpadServerLog;
|
|
|
+import com.fs.qw.domain.QwUser;
|
|
|
import com.fs.qw.mapper.QwExternalContactMapper;
|
|
|
-import com.fs.qw.service.IQwCompanyService;
|
|
|
-import com.fs.qw.service.IQwExternalContactService;
|
|
|
-import com.fs.qw.service.IQwMaterialService;
|
|
|
+import com.fs.qw.mapper.QwUserMapper;
|
|
|
+import com.fs.qw.service.*;
|
|
|
import com.fs.qwApi.domain.QwExternalContactResult;
|
|
|
import com.fs.qwApi.service.QwApiService;
|
|
|
import com.fs.sop.mapper.QwSopLogsMapper;
|
|
|
@@ -33,6 +34,8 @@ import com.fs.sop.mapper.SopUserLogsMapper;
|
|
|
import com.fs.sop.service.*;
|
|
|
import com.fs.sop.vo.QwSopLogsDoSendListTVO;
|
|
|
import com.fs.store.service.IFsUserCourseCountService;
|
|
|
+import com.fs.wxwork.dto.WxWorkGetQrCodeDTO;
|
|
|
+import com.fs.wxwork.service.WxWorkService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@@ -48,6 +51,7 @@ import java.time.LocalDateTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
@Api("公共接口")
|
|
|
@@ -134,8 +138,77 @@ public class CommonController {
|
|
|
@Autowired
|
|
|
public RedisCache redisCache;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private QwUserMapper qwUserMapper;
|
|
|
+
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ IQwIpadServerService ipadServerService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ IQwIpadServerLogService qwIpadServerLogService;
|
|
|
+ @Autowired
|
|
|
+ IQwIpadServerUserService qwIpadServerUserService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ IQwExternalContactService externalContactService;
|
|
|
+ @Autowired
|
|
|
+ WxWorkService wxWorkService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ */
|
|
|
+ @GetMapping("/selectQwUserByTest")
|
|
|
+ public void selectQwUserByTest() {
|
|
|
+ try {
|
|
|
+ List<QwUser> list = qwUserMapper.selectQwUserByTest();
|
|
|
+ for (QwUser qwUser : list) {
|
|
|
+ try {
|
|
|
+ Integer serverStatus = qwUser.getServerStatus();
|
|
|
+ Long serverId = qwUser.getServerId();
|
|
|
+ if (serverStatus==0){
|
|
|
+ log.error("不需要解绑");
|
|
|
+ }
|
|
|
+ if (serverId==null){
|
|
|
+ log.error("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) {
|
|
|
+ log.error("解绑ipad报错",e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("定时处理未绑定员工企微异常",e);
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
|
|
|
+
|
|
|
+ void updateIpadStatus(Long id ,Integer status){
|
|
|
+ QwUser u = new QwUser();
|
|
|
+ u.setId(id);
|
|
|
+ u.setIpadStatus(status);
|
|
|
+ qwUserMapper.updateQwUser(u);
|
|
|
+ }
|
|
|
/**
|
|
|
*
|
|
|
*/
|