Selaa lähdekoodia

fix 去掉公众号同步判断

zoujiajian 3 vuotta sitten
vanhempi
sitoutus
37761021c7

+ 4 - 5
netflix-service/src/main/java/com/cyksj/service/gzh/factory/EventMsgService.java

@@ -20,7 +20,6 @@ import com.cyksj.model.dto.MsgEvent;
 import com.cyksj.model.entity.User;
 import com.cyksj.model.entity.UserGzhRelation;
 import com.cyksj.model.entity.WxApp;
-import com.cyksj.model.entity.WxSyncLog;
 import com.cyksj.redis.RedisService;
 import com.cyksj.service.distribute.DistributeService;
 import com.cyksj.service.distribute.equipment.EquipmentDistributeService;
@@ -109,9 +108,9 @@ public class EventMsgService implements GzhMsgService {
 		}
 		//迁移公众号之后同步授权后信息
 		//是否是迁移用户
-		WxSyncLog wxSyncLog = wxSyncLogMapper.selectOne(Wrappers.lambdaQuery(WxSyncLog.class)
-				.eq(WxSyncLog::getToAppid, weChatConfig.getAppid())
-				.eq(WxSyncLog::getNewOpenid, openId).last("limit 1"));
+//		WxSyncLog wxSyncLog = wxSyncLogMapper.selectOne(Wrappers.lambdaQuery(WxSyncLog.class)
+//				.eq(WxSyncLog::getToAppid, weChatConfig.getAppid())
+//				.eq(WxSyncLog::getNewOpenid, openId).last("limit 1"));
 
 		WxApp wxApp = wxAppMapper.selectOne(Wrappers.lambdaQuery(WxApp.class)
 				.eq(WxApp::getGzhOriginalId, msgEvent.getToUserName()).last("limit 1"));
@@ -119,7 +118,7 @@ public class EventMsgService implements GzhMsgService {
 			return false;
 		}
 		GzhUnionidUserinfo info = weChatService.getUserInfo2(weChatService.getAccessToken(wxApp.getAppId()), openId);
-		User user = userService.getSyncUser(info.getOpenid(), info.getUnionid(), wxSyncLog);
+		User user = userService.getSyncUser(info.getOpenid(), info.getUnionid(), null);
 
 		String state = redisService.getStr(RedisService.key.WX_GZH_QRCODE_SHARED_LOGIN.getNameFormat(sceneKey));
 		GzhBodyDto gzhDto = null;

+ 1 - 19
netflix-service/src/main/java/com/cyksj/service/user/impl/UserServiceImpl.java

@@ -72,11 +72,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
         if (StrUtil.isEmpty(unionid)) {
             throw BusinessRuntimeException.getInstance("授权操作异常,请刷新页面");
         }
-        WxSyncLog wxSyncLog = wxSyncLogMapper.selectOne(Wrappers.lambdaQuery(WxSyncLog.class)
-                .eq(WxSyncLog::getToAppid, weChatConfig.getAppid())
-                .eq(WxSyncLog::getNewOpenid, info.getOpenid()).last("limit 1"));
-
-		User user = getSyncUser(info.getOpenid(), info.getUnionid(), wxSyncLog);
+		User user = getSyncUser(info.getOpenid(), info.getUnionid(), null);
 
 		user = Optional.ofNullable(user).orElseGet(() -> new User()
 				.setUnionid(unionid));
@@ -90,20 +86,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
 		if (StrUtil.isEmpty(user.getHeadimgurl())) {
 			user.setHeadimgurl(info.getHeadimgurl());
 		}
-		if (!user.getUnionid().equals(unionid)) {
-			UserTransferLog log = new UserTransferLog();
-			if (wxSyncLog != null) {
-				log.setType("公众号迁移");
-			} else {
-				log.setType("绑定开发者账号");
-			}
-			log.setOldAppId(weChatConfig.getOldAppid());
-			log.setNewAppId(weChatConfig.getAppid());
-			log.setUserId(user.getId());
-			log.setOldUnionid(user.getUnionid());
-			log.setNewUnionid(info.getUnionid());
-			userTransferLogMapper.insert(log);
-		}
 		user.setUnionid(unionid);
 		user.setOpenId(info.getOpenid());
 		Boolean isNewUser = false;