| | |
| | | |
| | | public String generateAsaToken(String token) { |
| | | RSA rsa = new RSA(null, AppContants.PUBLIC_KEY); |
| | | return rsa.encryptBase64(token + "_" + System.currentTimeMillis(), KeyType.PublicKey); |
| | | // return rsa.encryptBase64(token + "_" + System.currentTimeMillis(), KeyType.PublicKey); |
| | | //去掉时间戳 |
| | | return rsa.encryptBase64(token, KeyType.PublicKey); |
| | | } |
| | | |
| | | @Override |
| | |
| | | mallMemberVo.setIsAgent(1); |
| | | }else if(ObjectUtil.isNotEmpty(mallAgentRecordAgree)){ |
| | | mallMemberVo.setIsAgent(2); |
| | | if(StrUtil.isNotEmpty(mallAgentRecordAgree.getAgentLevel())){ |
| | | DataDictionaryCustom dataDictionaryCustom = dataDictionaryCustomMapper.selectDicDataByTypeAndCode("AGENT_LEVEL_APPLY", mallAgentRecordAgree.getAgentLevel()); |
| | | mallMemberVo.setAgentLevelName(dataDictionaryCustom.getDescription()); |
| | | } |
| | | }else if(ObjectUtil.isNotEmpty(mallAgentRecordDisagree)){ |
| | | mallMemberVo.setIsAgent(3); |
| | | } |
| | |
| | | } |
| | | } |
| | | String token = IdUtil.simpleUUID(); |
| | | redisUtils.set(token, JSONObject.toJSONString(mallMember), 360000); |
| | | redisUtils.set(redisKey, token, 360000); |
| | | redisUtils.set(token, JSONObject.toJSONString(mallMember), -1); |
| | | redisUtils.set(redisKey, token, -1); |
| | | Map<String, Object> authInfo = new HashMap<>(); |
| | | authInfo.put("token", token); |
| | | authInfo.put("appid", xcxProperties.getXcxAppid()); |
| | |
| | | Integer type = apiRechargeWalletDto.getType(); |
| | | if(2 == type){ |
| | | //成为合伙人的充值金额 |
| | | DataDictionaryCustom agentPriceDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.PRICE_AMOUNT.getType(), |
| | | DataDictionaryEnum.PRICE_AMOUNT.getCode()); |
| | | String agentPrice = agentPriceDic.getValue(); |
| | | BigDecimal price = new BigDecimal(agentPrice); |
| | | if(price.compareTo(amount) != 0){ |
| | | MallAgentRecord mallAgentRecord = mallAgentRecordMapper.selectById(apiRechargeWalletDto.getAgentApplyId()); |
| | | BigDecimal agentPrice = mallAgentRecord.getAmount(); |
| | | // DataDictionaryCustom agentPriceDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.PRICE_AMOUNT.getType(), |
| | | // DataDictionaryEnum.PRICE_AMOUNT.getCode()); |
| | | // String agentPrice = agentPriceDic.getValue(); |
| | | // BigDecimal price = new BigDecimal(agentPrice); |
| | | if(agentPrice.compareTo(amount) != 0){ |
| | | return new FebsResponse().fail().message("成为合伙人的金额为"+agentPrice); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void updateMemberAgent(Long memberId) { |
| | | public void updateMemberAgent(Long memberId,String levelCode) { |
| | | mallAgentRecordMapper.updateStateByMemberId(memberId); |
| | | |
| | | //更新用户表中的LEVEL |
| | | MallMember mallMember = this.baseMapper.selectById(memberId); |
| | | mallMember.setLevel(AgentLevelEnum.FIRST_LEVEL.name()); |
| | | mallMember.setLevel(levelCode); |
| | | this.baseMapper.updateById(mallMember); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse agentDetail() { |
| | | DataDictionaryCustom dataDictionaryCustom = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.AGENT_DETAILS.getType(), DataDictionaryEnum.AGENT_DETAILS.getCode()); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if(ObjectUtil.isNotEmpty(dataDictionaryCustom)){ |
| | | map.put("agentDetail", dataDictionaryCustom.getValue()); |
| | | } |
| | | return new FebsResponse().success().data(map); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse activityInfo() { |
| | | DataDictionaryCustom activityBulletinDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.ACTIVITY_BULLETIN.getType(), DataDictionaryEnum.ACTIVITY_BULLETIN.getCode()); |
| | | DataDictionaryCustom giveAmountDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.GIVE_AMOUNT.getType(), DataDictionaryEnum.GIVE_AMOUNT.getCode()); |
| | | DataDictionaryCustom giveStateDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.GIVE_STATE.getType(), DataDictionaryEnum.GIVE_STATE.getCode()); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if(ObjectUtil.isNotEmpty(activityBulletinDic)){ |
| | | map.put("activityBulletin", |
| | | ObjectUtil.isEmpty(activityBulletinDic.getValue()) ? "暂无活动" : activityBulletinDic.getValue()); |
| | | } |
| | | if(ObjectUtil.isNotEmpty(giveAmountDic)){ |
| | | map.put("giveAmount", |
| | | ObjectUtil.isEmpty(giveAmountDic.getValue()) ? 0 : giveAmountDic.getValue()); |
| | | } |
| | | map.put("giveState",giveStateDic.getValue()); |
| | | return new FebsResponse().success().data(map); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse agentApplyInfo() { |
| | | Long memberId = LoginUserUtil.getLoginUser().getId(); |
| | | ApiMallAgentRecordVo apiMallAgentRecordVo = mallAgentRecordMapper.selectApiMallAgentRecordVoByMemberIdAndState(memberId,MallAgentRecord.APPLY_ING); |
| | | return new FebsResponse().success().data(apiMallAgentRecordVo); |
| | | } |
| | | |
| | | private String getXcxLoginUrl(String code) { |
| | | String wechatLoginUrl =xcxProperties.getWecharLoginUrl(); |
| | | return String.format(wechatLoginUrl, xcxProperties.getXcxAppid(), xcxProperties.getXcxSecret(), code); |