|
|
|
@@ -9,11 +9,9 @@ import com.iformall.domain.po.base.TenantEntity; |
|
|
|
import com.iformall.domain.po.WxAppinfo; |
|
|
|
import com.iformall.domain.po.WxCUser; |
|
|
|
import com.iformall.domain.po.WxCUserBasicInfo; |
|
|
|
import com.iformall.enums.EnumScoreType; |
|
|
|
import com.iformall.exception.MallinkException; |
|
|
|
import com.iformall.service.CUserTokenService; |
|
|
|
import com.iformall.service.WxAppinfoService; |
|
|
|
import com.iformall.service.WxCUserBasicChildService; |
|
|
|
import com.iformall.service.WxCUserBasicInfoService; |
|
|
|
import com.iformall.service.*; |
|
|
|
import com.iformall.service.wechat.FmOpenService; |
|
|
|
import com.iformall.utils.Constant; |
|
|
|
import com.iformall.utils.IPUtil; |
|
|
|
@@ -61,6 +59,12 @@ public class BaseController { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private CUserTokenService cUserTokenService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private WxScoreRulesService wxScoreRulesService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private MemCouponFromDspService memCouponFromDspService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
@Qualifier("objectCommonRedisTemplate") |
|
|
|
@@ -215,7 +219,7 @@ public class BaseController { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Long saveToBasicInfoByCUser(String userPhone,String userName,String avatarUrl,Integer sex,Long userId,Boolean isFirstPhone) { |
|
|
|
public Long saveToBasicInfoByCUser(String userPhone,String userName,String avatarUrl,Integer sex,Long userId) { |
|
|
|
TenantEntity tenantEntity = getTenantInfo(); |
|
|
|
if (StringUtils.isBlank(userPhone)) |
|
|
|
return null; |
|
|
|
@@ -243,7 +247,6 @@ public class BaseController { |
|
|
|
basicInfo.setSex(sex); |
|
|
|
wxCUserBasicInfoService.update(basicInfo); |
|
|
|
removeCacheMember(basicInfo.getId()); |
|
|
|
isFirstPhone = false; |
|
|
|
return basicInfo.getId(); |
|
|
|
} else { |
|
|
|
if (byId != null) { |
|
|
|
@@ -256,7 +259,6 @@ public class BaseController { |
|
|
|
byId.setSex(sex); |
|
|
|
wxCUserBasicInfoService.update(byId); |
|
|
|
removeCacheMember(basicInfo.getId()); |
|
|
|
isFirstPhone = false; |
|
|
|
return byId.getId(); |
|
|
|
} else { |
|
|
|
basicInfo = new WxCUserBasicInfo(); |
|
|
|
@@ -268,6 +270,15 @@ public class BaseController { |
|
|
|
basicInfo.setSex(sex); |
|
|
|
wxCUserBasicInfoService.save(basicInfo); |
|
|
|
removeCacheMember(basicInfo.getId()); |
|
|
|
|
|
|
|
// 首次授权, 增加成长值及积分 |
|
|
|
// 成长值 |
|
|
|
wxScoreRulesService.addScore(tenantEntity, EnumScoreType.WECHAT_PHONE, basicInfo); |
|
|
|
// 增加积分 |
|
|
|
wxCUserBasicInfoService.addCredit(basicInfo.getId(),tenantEntity,EnumScoreType.WECHAT_PHONE); |
|
|
|
// 外部注券 |
|
|
|
memCouponFromDspService.couponOrderFromDsp(tenantEntity, userPhone); |
|
|
|
|
|
|
|
return basicInfo.getId(); |
|
|
|
} |
|
|
|
} |
|
|
|
|