chenbiao %!s(int64=2) %!d(string=hai) anos
pai
achega
f795d7cbe1

+ 23 - 0
netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpEventActionServiceImpl.java

@@ -544,6 +544,29 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
 		return null;
 	}
 
+	@Override
+	public CorpXmlOutMessage msgAuditApproved(CorpXmlMessage message, Map<String, Object> context) {
+		//修改 会话存档同意状态
+		String corpId = message.getToUserName();
+		String userId = message.getUserId();
+		String externalUserId = message.getExternalUserId();
+		//客服动态二维码配置state
+		WxCorpApp wxCorpApp = WeChatCorpFactory.getCorpConfigStrategy(corpId);
+		CorpUserFollowRelation relation = relationMapper
+				.selectOne(Wrappers.lambdaQuery(CorpUserFollowRelation.class)
+						.eq(CorpUserFollowRelation::getWxCorpId, wxCorpApp.getId())
+						.eq(CorpUserFollowRelation::getCorpUserId, externalUserId)
+						.eq(CorpUserFollowRelation::getFollowId, userId)
+						.last("limit 1"));
+		if(relation != null){
+			relation.setAgreeStatus("Agree");
+			relationMapper.updateById(relation);
+		}else {
+			throw  BusinessRuntimeException.getInstance("用户还未保存.");
+		}
+		return null;
+	}
+
 	/**
 	 * 修改客户成员关系,客户标签
 	 */

+ 11 - 1
netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpServiceImpl.java

@@ -145,7 +145,17 @@ public class CorpServiceImpl implements CorpService {
 						return corpEventActionService.delCorpTag(message, context);
 					}
 				})
-				.end();
+				.end()
+				//用户同意会话存档
+				.rule().async(false).changeType("msg_audit_approved").event("change_external_contact")
+				.handler(new CorpMessageHandler() {
+					@Override
+					public CorpXmlOutMessage handle(CorpXmlMessage message, Map<String, Object> context, CorpService corpService) throws Exception {
+						return corpEventActionService.msgAuditApproved(message, context);
+					}
+				})
+				.end()
+		;
 
 	}
 

+ 2 - 0
netflix-service/src/main/java/com/cyksj/service/corp/msg/CorpEventActionService.java

@@ -29,4 +29,6 @@ public interface CorpEventActionService {
 	CorpXmlOutMessage updateCorpGroupChat(CorpXmlMessage message, Map<String, Object> context) throws Exception;
 
 	CorpXmlOutMessage delCorpGroupChat(CorpXmlMessage message);
+
+    CorpXmlOutMessage msgAuditApproved(CorpXmlMessage message, Map<String, Object> context);
 }