| @@ -6,6 +6,8 @@ import com.iformall.common.IdWorker; | |||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.po.base.BaseCUserEntity; | import com.iformall.domain.po.base.BaseCUserEntity; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.po.tt.TtCUser; | |||||
| import com.iformall.enums.EnumAppPlat; | |||||
| import com.iformall.enums.EnumScoreType; | import com.iformall.enums.EnumScoreType; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| @@ -137,7 +139,17 @@ public class BaseController { | |||||
| if (baseuser.getRealUser() == null) { | if (baseuser.getRealUser() == null) { | ||||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY); | throw new MallinkException(ErrorCode.USER_IS_EMPTY); | ||||
| } | } | ||||
| CUser user = RedisCacheUtils.getFieldObject(baseuser, "realUser", CUser.class); | |||||
| CUser user = null; | |||||
| if(EnumAppPlat.WX.equals(baseuser.getAppPlat())){ | |||||
| user = RedisCacheUtils.getFieldObject(baseuser, "realUser", WxCUser.class); | |||||
| }else if(EnumAppPlat.TOUTIAO.equals(baseuser.getAppPlat())){ | |||||
| user = RedisCacheUtils.getFieldObject(baseuser, "realUser", TtCUser.class); | |||||
| }else{ | |||||
| user = RedisCacheUtils.getFieldObject(baseuser, "realUser", CUser.class); | |||||
| } | |||||
| if(user == null){ | |||||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY); | |||||
| } | |||||
| TenantEntity tenantEntity = getTenantInfo(); | TenantEntity tenantEntity = getTenantInfo(); | ||||
| if (user.getTenantId() == null) { | if (user.getTenantId() == null) { | ||||
| user.setTenantId(tenantEntity.getTenantId()); | user.setTenantId(tenantEntity.getTenantId()); | ||||
| @@ -71,7 +71,7 @@ public class WxMsgValidationcodeController extends BaseController { | |||||
| wxMsgValidationcode.setPhone(phone); | wxMsgValidationcode.setPhone(phone); | ||||
| wxMsgValidationcode.setType(type); | wxMsgValidationcode.setType(type); | ||||
| wxMsgValidationcode.setCode(code); | wxMsgValidationcode.setCode(code); | ||||
| //只需要一端发就可以了 | |||||
| //只需要一端发就可以了 | |||||
| WxAppinfo appinfo = WxAppinfoService.getCAppInfo(getTenantInfo(), EnumAppPlat.WX); | WxAppinfo appinfo = WxAppinfoService.getCAppInfo(getTenantInfo(), EnumAppPlat.WX); | ||||
| wxMsgValidationcode.setAppid(appinfo.getAppId()); | wxMsgValidationcode.setAppid(appinfo.getAppId()); | ||||
| //wxMsgValidationcode.setAppid(user.getAppId()); | //wxMsgValidationcode.setAppid(user.getAppId()); | ||||
| @@ -19,7 +19,6 @@ import com.iformall.service.WxCUserBasicInfoService; | |||||
| import com.iformall.service.WxCUserTagsService; | import com.iformall.service.WxCUserTagsService; | ||||
| import com.iformall.service.cuser.BasicCUserService; | import com.iformall.service.cuser.BasicCUserService; | ||||
| import com.iformall.service.cuser.CUserServiceApapter; | import com.iformall.service.cuser.CUserServiceApapter; | ||||
| import com.iformall.service.cuser.CUserServiceFactory; | |||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| import com.iformall.utils.MaUtil; | import com.iformall.utils.MaUtil; | ||||
| import lombok.SneakyThrows; | import lombok.SneakyThrows; | ||||
| @@ -60,6 +59,7 @@ public class TtCUserServiceAdapter extends BasicCUserService implements CUserSer | |||||
| entity.setUserId(ttCUser.getUserId()); | entity.setUserId(ttCUser.getUserId()); | ||||
| entity.setToken(ttCUser.getToken()); | entity.setToken(ttCUser.getToken()); | ||||
| entity.updateTenantInfo(ttCUser); | entity.updateTenantInfo(ttCUser); | ||||
| entity.setAppPlat(EnumAppPlat.TOUTIAO); | |||||
| entity.setRealUser(ttCUser); | entity.setRealUser(ttCUser); | ||||
| return entity; | return entity; | ||||
| } | } | ||||
| @@ -252,6 +252,10 @@ public class TtCUserServiceAdapter extends BasicCUserService implements CUserSer | |||||
| @Override | @Override | ||||
| public void updateMsgCount(CUser user) { | public void updateMsgCount(CUser user) { | ||||
| // TtCUser userL = new TtCUser(); | |||||
| // userL.setId(user.getId()); | |||||
| // userL.updateTenantInfo(user); | |||||
| // ttCUserMapper.updateMsgCount(userL); | |||||
| ttCUserMapper.updateMsgCount((TtCUser) user); | ttCUserMapper.updateMsgCount((TtCUser) user); | ||||
| } | } | ||||
| @@ -63,6 +63,7 @@ public class WxCUserServiceAdapter extends BasicCUserService implements CUserSer | |||||
| entity.setUserId(wxCUser.getUserId()); | entity.setUserId(wxCUser.getUserId()); | ||||
| entity.setToken(wxCUser.getToken()); | entity.setToken(wxCUser.getToken()); | ||||
| entity.updateTenantInfo(wxCUser); | entity.updateTenantInfo(wxCUser); | ||||
| entity.setAppPlat(EnumAppPlat.WX); | |||||
| entity.setRealUser(wxCUser); | entity.setRealUser(wxCUser); | ||||
| return entity; | return entity; | ||||
| } | } | ||||
| @@ -255,6 +256,10 @@ public class WxCUserServiceAdapter extends BasicCUserService implements CUserSer | |||||
| @Override | @Override | ||||
| public void updateMsgCount(CUser user) { | public void updateMsgCount(CUser user) { | ||||
| // WxCUser userL = new WxCUser(); | |||||
| // userL.setId(user.getId()); | |||||
| // userL.updateTenantInfo(user); | |||||
| // wxCUserMapper.updateMsgCount(userL); | |||||
| wxCUserMapper.updateMsgCount((WxCUser) user); | wxCUserMapper.updateMsgCount((WxCUser) user); | ||||
| } | } | ||||