瀏覽代碼

fix:BUGFix

zack 1 月之前
父節點
當前提交
693a506217

+ 13 - 1
yt-ios-lemon/lemon-ios-service/src/main/java/com/ytpm/lemonios/controller/WxController.java

@@ -24,10 +24,12 @@ import com.ytpm.general.Result;
 import com.ytpm.general.StatusCode;
 import com.ytpm.lemonios.dao.AdRecordMapper;
 import com.ytpm.lemonios.dao.AppUserMapper;
+import com.ytpm.lemonios.dao.DitchMapper;
 import com.ytpm.lemonios.service.AppUserService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
+import org.checkerframework.checker.units.qual.A;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -59,6 +61,8 @@ public class WxController {
     private RiskFeign riskFeign;
     @Autowired
     private AppUserService appUserService;
+    @Autowired
+    private DitchMapper ditchMapper;
 
     @PostMapping("/login")
     @ApiOperation("微信登录")
@@ -96,7 +100,15 @@ public class WxController {
         //根据应用ID获取配置调用接口登录
         WxDefaultConfig defaultConfig = appUserMapper.getDefaultConfigByDitchId(param.getDitchId());
         if(Objects.isNull(defaultConfig)){
-            return new Result<>(StatusCode.ACCESS_ERR,"登录失败,未找到相应配置!");
+            YtDitch ditch = ditchMapper.selectById(param.getDitchId());
+            if (ditch != null){
+                WxDefaultConfig defaultConfig1 = appUserMapper.getByAppId(ditch.getAppId());
+                if (Objects.isNull(defaultConfig1)){
+                    return new Result<>(StatusCode.ACCESS_ERR,"登录失败,未找到相应配置!");
+                }
+            } else {
+                return new Result<>(StatusCode.ACCESS_ERR,"登录失败,未找到相应配置!");
+            }
         }
         IosUserInfo userInfo = setIosUserInfo(param);
         param.setLoginIp(getClientIp(request));

+ 5 - 2
yt-ios-lemon/lemon-ios-service/src/main/java/com/ytpm/lemonios/dao/AppUserMapper.java

@@ -102,13 +102,16 @@ public interface AppUserMapper {
      */
     List<YtDyzUser> getUserList(AppUserParam param);
 
-    List<YtDyzAdRecord> getByUserByParam(AdRecordListParam param);
-
     /**
      * 根据应用类型查询应用默认配置
      */
     WxDefaultConfig getDefaultConfig(@Param("appType") int appType);
 
+    /**
+     * 根据应用ID查询应用默认配置
+     */
+    WxDefaultConfig getByAppId(@Param("appId") String appId);
+
     /**
      * 根据应用ID查询应用默认配置
      */

+ 12 - 7
yt-ios-lemon/lemon-ios-service/src/main/java/com/ytpm/lemonios/service/impl/AppUserServiceImpl.java

@@ -92,12 +92,7 @@ public class AppUserServiceImpl implements AppUserService {
 
     @Override
     public YtDyzUser crudForNewTransIos(IosLoginParam param, IosUserInfo userInfo) {
-        YtDyzUser old;
-        if (param.getDitchId() == null){
-            old = appUserMapper.selectByIosId(param.getIosId());
-        } else {
-            old = appUserMapper.getYtAppUserForIos(param.getIosId(), param.getDitchId());
-        }
+        YtDyzUser old = appUserMapper.selectByIosId(param.getIosId());
         if(Objects.isNull(old)) {
             old = new YtDyzUser();
             registryUserForIos(param,userInfo, old);
@@ -234,6 +229,11 @@ public class AppUserServiceImpl implements AppUserService {
             throw new CustomerException(getTipsMsg());
         }
         YtDyzUser newUser = new YtDyzUser();
+        if (old.getDitchId() == null) {
+            newUser.setDitchId(param.getDitchId());
+            YtDitch ditch =  ditchMapper.selectById(param.getDitchId());
+            newUser.setAppId(ditch.getAppId());
+        }
         newUser.setUserId(old.getUserId());
         newUser.setNickName(userInfo.getNickname());
         newUser.setHeadImg(userInfo.getHeadimgurl());
@@ -300,7 +300,12 @@ public class AppUserServiceImpl implements AppUserService {
         old.setWithdrawTotal(BigDecimal.ZERO);
         old.setDitchId(param.getDitchId());
         old.setSignDays(0);
-        old.setAppId(param.getAppId());
+        YtDitch ditch = ditchMapper.selectById(param.getDitchId());
+        if (ditch != null) {
+            old.setAppId(ditch.getAppId());
+        } else {
+            old.setAppId("");
+        }
         old.setUserStatus(UserStatusEnum.NORMAL.getCode());
         old.setIosId(param.getIosId());
         old.setHeadImg(userInfo.getHeadimgurl());

+ 7 - 0
yt-ios-lemon/lemon-ios-service/src/main/resources/mapper/AppUserMapper.xml

@@ -454,6 +454,13 @@
             #{item}
         </foreach>
     </select>
+    <select id="getByAppId" resultType="com.ytpm.app.view.WxDefaultConfig">
+        select
+            config_id, config_name, open_id appId, secret, app_id platformAppId, app_key platformAppSecret, app_type,user_path,login_path,ad_path,answer_path,power_path
+             ,can_simulator,taku_app_id,taku_key,taku_banner_pid,taku_interstitial_pid,taku_reward_pid,taku_native_pid,can_use_adb,can_accumulation,can_use_float,can_use_root,ditch_id,power_wait_time,interstitial_interval_time
+        from yt_app_default_config
+        where app_id = #{appId}
+    </select>
     <select id="getDefaultConfig" resultType="com.ytpm.app.view.WxDefaultConfig">
         select
             config_id, config_name, open_id appId, secret, app_id platformAppId, app_key platformAppSecret, app_type,user_path,login_path,ad_path,answer_path,power_path

+ 1 - 1
yt-ios-lemon/lemon-ios-service/src/main/resources/mapper/DitchMapper.xml

@@ -45,7 +45,7 @@
     </select>
     <select id="selectById" resultType="com.ytpm.agent.model.YtDitch">
         select
-            ditch_id, ditch_name, user_id, is_delete, create_time
+            ditch_id, ditch_name, user_id, app_id, app_type, is_delete, create_time
         from yt_ditch
         where ditch_id = #{ditchId}
     </select>

+ 2 - 2
yt-risk/risk-manage/src/main/java/com/ytpm/service/impl/RiskServiceImpl.java

@@ -445,8 +445,8 @@ public class RiskServiceImpl implements RiskService {
     private void checkRisk322ForIos(YtDyzUser dyzUser) {
         RiskTemplateView view = configMapper.getByCode("322");
         //根据用户所属应用查询该应用母包openid查询用户信息
-
-        YtPlatformUserApp userApp =  appMapper.selectParentApp(dyzUser.getAppId());
+        YtApp ytApp = appMapper.selectRiskApp(dyzUser.getAppId());
+        YtPlatformUserApp userApp =  appMapper.selectParentApp(ytApp.getSuperiorId());
         Object o = feignInvoker.invoke(userApp.getServiceName(),"queryByIosId",dyzUser.getIosId());
         List<YtDyzUser> dyzUsers = JSONArray.parseArray(JSON.toJSONString(o), YtDyzUser.class);