Conflicts: mallinkService/src/main/java/com/iformall/mapper/WxCUserMapper.java mallinkService/src/main/java/com/iformall/service/impl/WxCUserServiceImpl.java mallinkService/src/main/resources/mapper/WxCUserMapper.xmlrelease_toaliyun_real
| @@ -9,11 +9,9 @@ import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.domain.po.WxAppinfo; | import com.iformall.domain.po.WxAppinfo; | ||||
| import com.iformall.domain.po.WxCUser; | import com.iformall.domain.po.WxCUser; | ||||
| import com.iformall.domain.po.WxCUserBasicInfo; | import com.iformall.domain.po.WxCUserBasicInfo; | ||||
| import com.iformall.enums.EnumScoreType; | |||||
| import com.iformall.exception.MallinkException; | 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.service.wechat.FmOpenService; | ||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| import com.iformall.utils.IPUtil; | import com.iformall.utils.IPUtil; | ||||
| @@ -61,6 +59,12 @@ public class BaseController { | |||||
| @Autowired | @Autowired | ||||
| private CUserTokenService cUserTokenService; | private CUserTokenService cUserTokenService; | ||||
| @Autowired | |||||
| private WxScoreRulesService wxScoreRulesService; | |||||
| @Autowired | |||||
| private MemCouponFromDspService memCouponFromDspService; | |||||
| @Autowired | @Autowired | ||||
| @Qualifier("objectCommonRedisTemplate") | @Qualifier("objectCommonRedisTemplate") | ||||
| @@ -254,7 +258,7 @@ public class BaseController { | |||||
| byId.setAvatarUrl(avatarUrl); | byId.setAvatarUrl(avatarUrl); | ||||
| byId.setSex(sex); | byId.setSex(sex); | ||||
| wxCUserBasicInfoService.update(byId); | wxCUserBasicInfoService.update(byId); | ||||
| removeCacheMember(basicInfo.getId()); | |||||
| removeCacheMember(byId.getId()); | |||||
| return byId.getId(); | return byId.getId(); | ||||
| } else { | } else { | ||||
| basicInfo = new WxCUserBasicInfo(); | basicInfo = new WxCUserBasicInfo(); | ||||
| @@ -266,6 +270,15 @@ public class BaseController { | |||||
| basicInfo.setSex(sex); | basicInfo.setSex(sex); | ||||
| wxCUserBasicInfoService.save(basicInfo); | wxCUserBasicInfoService.save(basicInfo); | ||||
| removeCacheMember(basicInfo.getId()); | 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(); | return basicInfo.getId(); | ||||
| } | } | ||||
| } | } | ||||
| @@ -598,11 +598,6 @@ public class WxUserGrantController extends BaseController { | |||||
| return new ResultData(ErrorCode.USER_IS_EMPTY); | return new ResultData(ErrorCode.USER_IS_EMPTY); | ||||
| } | } | ||||
| boolean isFirstPhone = false; | |||||
| if(user.getUserId() == null) { | |||||
| isFirstPhone = true; | |||||
| } | |||||
| WxMaService wxMaService = getWeappService(user.getAppId()); | WxMaService wxMaService = getWeappService(user.getAppId()); | ||||
| String session_key = user.getSessionKey(); | String session_key = user.getSessionKey(); | ||||
| @@ -638,16 +633,6 @@ public class WxUserGrantController extends BaseController { | |||||
| removeCacheCUser(); | removeCacheCUser(); | ||||
| if(isFirstPhone) { | |||||
| // 首次授权, 增加成长值及积分 | |||||
| // 成长值 | |||||
| wxScoreRulesService.addScore(getTenantInfo(),EnumScoreType.WECHAT_PHONE, user); | |||||
| // 增加积分 | |||||
| wxCUserBasicInfoService.addCredit(user.getUserId(),getTenantInfo(),EnumScoreType.WECHAT_PHONE); | |||||
| // 外部注券 | |||||
| memCouponFromDspService.couponOrderFromDsp(tenantEntity, phoneNoInfo.getPhoneNumber()); | |||||
| } | |||||
| resultMap.put("msg", "授权手机成功!"); | resultMap.put("msg", "授权手机成功!"); | ||||
| resultMap.put("phone", phoneNoInfo.getPhoneNumber()); | resultMap.put("phone", phoneNoInfo.getPhoneNumber()); | ||||
| } else { | } else { | ||||
| @@ -43,5 +43,5 @@ public interface WxCUserMapper extends CommonMapper<WxCUser, Long> { | |||||
| List<String> findOpenIdList(@Param("userId")Long userId, @Param("tenantId")String tenantId); | List<String> findOpenIdList(@Param("userId")Long userId, @Param("tenantId")String tenantId); | ||||
| List<String> findTokenList(@Param("userId")Long userId, @Param("tenantId")String tenantId); | |||||
| List<String> findTokenList(@Param("id")Long id,@Param("userId")Long userId, @Param("tenantId")String tenantId); | |||||
| } | } | ||||
| @@ -324,7 +324,7 @@ public class WxCUserServiceImpl implements WxCUserService { | |||||
| @Override | @Override | ||||
| public void delForUserIdOnly(Long id, Long userId, String tenantId) { | public void delForUserIdOnly(Long id, Long userId, String tenantId) { | ||||
| List<String> tokenList = wxCUserMapper.findTokenList(userId, tenantId); | |||||
| List<String> tokenList = wxCUserMapper.findTokenList(id,userId, tenantId); | |||||
| if(tokenList != null){ | if(tokenList != null){ | ||||
| for (String token:tokenList) { | for (String token:tokenList) { | ||||
| cUserTokenService.removeTokenCache(token); | cUserTokenService.removeTokenCache(token); | ||||
| @@ -433,7 +433,7 @@ | |||||
| </update> | </update> | ||||
| <select id="findTokenList" parameterType="hashmap" resultType="String" > | <select id="findTokenList" parameterType="hashmap" resultType="String" > | ||||
| select token from wx_c_user where user_id=#{userId} and tenant_id = #{tenantId} | |||||
| select token from wx_c_user where user_id=#{userId} and tenant_id = #{tenantId} and id != #{id} | |||||
| </select> | </select> | ||||
| <!-- tenant_id = IF(tenant_id is null ,null,CONCAT(tenant_id,"_del")),--> | <!-- tenant_id = IF(tenant_id is null ,null,CONCAT(tenant_id,"_del")),--> | ||||