|
|
@@ -8,6 +8,7 @@ import com.fs.app.websocket.bean.ResultMsgVo;
|
|
|
import com.fs.app.websocket.bean.SendMsgVo;
|
|
|
import com.fs.company.domain.CompanyWxClient;
|
|
|
import com.fs.company.mapper.CompanyWxClientMapper;
|
|
|
+import com.fs.company.service.CompanyWorkflowEngine;
|
|
|
import com.fs.company.service.impl.CompanyWxServiceImpl;
|
|
|
import com.fs.wxcid.domain.CidIpadServer;
|
|
|
import com.fs.wxcid.mapper.CidIpadServerMapper;
|
|
|
@@ -22,6 +23,7 @@ import com.fs.wxcid.mapper.WxContactMapper;
|
|
|
import com.fs.wxcid.service.IWxMsgLogService;
|
|
|
import com.hc.openapi.tool.fastjson.JSON;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import javax.websocket.*;
|
|
|
@@ -47,6 +49,7 @@ public class WebSocketServer {
|
|
|
CompanyWxClientMapper companyWxClientMapper = SpringUtils.getBean(CompanyWxClientMapper.class);
|
|
|
CompanyWxServiceImpl companyWxService = SpringUtils.getBean(CompanyWxServiceImpl.class);
|
|
|
CidIpadServerMapper cidIpadServerMapper = SpringUtils.getBean(CidIpadServerMapper.class);
|
|
|
+ CompanyWorkflowEngine companyWorkflowEngine = SpringUtils.getBean(CompanyWorkflowEngine.class);
|
|
|
|
|
|
//发送消息
|
|
|
public <T> void sendMessage(Session session, ResultMsgVo<T> data) {
|
|
|
@@ -161,9 +164,11 @@ public class WebSocketServer {
|
|
|
com.fs.wxcid.vo.wxvo.AddResultWxVo addResultWxVo = JSON.parseObject(msg.getDataJson(), com.fs.wxcid.vo.wxvo.AddResultWxVo.class);
|
|
|
log.info("接收到加好友回调:{}", addResultWxVo);
|
|
|
WxContact wxContact = wxContactMapper.selectOne(new QueryWrapper<WxContact>().eq("remark", addResultWxVo.getRemark()).eq("friends", 0));
|
|
|
+ log.info("更新联系人:{}", wxContact);
|
|
|
wxContact.setFriends(1);
|
|
|
wxContactMapper.updateById(wxContact);
|
|
|
List<CompanyWxClient> clients = companyWxClientMapper.selectWxV2(companyWxAccount.getId(), wxContact.getPhone());
|
|
|
+ log.info("更新联系人2:{}", clients);
|
|
|
if(clients != null){
|
|
|
clients.parallelStream().forEach(e -> {
|
|
|
e.setIsAdd(1);
|
|
|
@@ -174,6 +179,11 @@ public class WebSocketServer {
|
|
|
companyWxService.triggerWorkflowOnAddWxSuccess(e.getId());
|
|
|
});
|
|
|
}
|
|
|
+// if(null != addResultWxVo && StringUtils.isNotBlank(addResultWxVo.getBizJson())){
|
|
|
+// JSONObject jsonObject = JSONObject.parseObject(addResultWxVo.getBizJson());
|
|
|
+// jsonObject.put("remark",addResultWxVo.getRemark());
|
|
|
+// companyWorkflowEngine.addWxSuccess(jsonObject);
|
|
|
+// }
|
|
|
break;
|
|
|
|
|
|
}
|