| | |
| | | |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.entity.SystemPIDInfo; |
| | | import com.yeshi.fanli.exception.goods.ConvertLinkException; |
| | | import com.yeshi.fanli.service.manger.PIDManager; |
| | | import com.yeshi.fanli.service.manger.goods.ConvertLinkManager; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | |
| | | private TBPidService tbPidService; |
| | | |
| | | @Resource |
| | | private TaoBaoUnionConfigService taoBaoUnionConfigService; |
| | | |
| | | @Resource |
| | | private UserInfoExtraService userInfoExtraService; |
| | | |
| | | @Resource |
| | | private FloatADService floatADService; |
| | | |
| | | @Resource |
| | |
| | | |
| | | @Resource |
| | | private MsgDeviceReadStateService msgDeviceReadStateService; |
| | | |
| | | @Resource |
| | | private UserTaoLiJinOriginService uerTaoLiJinOriginService; |
| | | |
| | | @Resource |
| | | private UserActiveLogService userActiveLogService; |
| | |
| | | |
| | | @Resource |
| | | private PIDManager pidManager; |
| | | |
| | | @Resource |
| | | private ConvertLinkManager convertLinkManager; |
| | | |
| | | /** |
| | | * s 首页配置信息 |
| | |
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.elmeLink, uid + ""); |
| | | String elmeLink = redisManager.getCommonString(key); |
| | | if (StringUtil.isNullOrEmpty(elmeLink)) { |
| | | TaoKeOfficialActivityConvertResultDTO dto = TaoKeApiUtil.officialActivityConvert( |
| | | elmePid.split("_")[3], "1571715733668", userInfoExtra.getRelationId()); |
| | | TaoKeOfficialActivityConvertResultDTO dto = null; |
| | | try { |
| | | dto = convertLinkManager.taobaoOfficialActivityConvert(uid, elmePid, "1571715733668", userInfoExtra.getRelationId(), false); |
| | | } catch (ConvertLinkException e) { |
| | | e.printStackTrace(); |
| | | if (StringUtil.isNullOrEmpty(callback)) |
| | | out.print(JsonUtil.loadFalseResult(e.getMessage())); |
| | | else |
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult(e.getMessage()))); |
| | | return; |
| | | } |
| | | if (dto != null) |
| | | elmeLink = dto.getShort_click_url(); |
| | | if (!StringUtil.isNullOrEmpty(elmeLink)) { |
| | |
| | | JSONObject data = new JSONObject(); |
| | | TaoKeOfficialActivityConvertResultDTO dto = null; |
| | | if (StringUtil.isNullOrEmpty(elmeResult)) { |
| | | try { |
| | | if (share) { |
| | | dto = TaoKeApiUtil.officialActivityConvert(relationPid.split("_")[3], |
| | | activityId, userInfoExtra.getRelationId()); |
| | | dto = convertLinkManager.taobaoOfficialActivityConvert(uid, relationPid, activityId, userInfoExtra.getRelationId(), true); |
| | | } else { |
| | | dto = TaoKeApiUtil.officialActivityConvert(elmePid.split("_")[3], activityId, |
| | | userInfoExtra.getRelationId()); |
| | | dto = convertLinkManager.taobaoOfficialActivityConvert(uid, elmePid, activityId, |
| | | userInfoExtra.getRelationId(), false); |
| | | } |
| | | } catch (ConvertLinkException e) { |
| | | if (StringUtil.isNullOrEmpty(callback)) |
| | | out.print(JsonUtil.loadFalseResult(e.getMessage())); |
| | | else |
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult(e.getMessage()))); |
| | | return; |
| | | } |
| | | |
| | | if (dto != null) { |
| | |
| | | JSONObject data = new JSONObject(); |
| | | TaoKeOfficialActivityConvertResultDTO dto = null; |
| | | if (StringUtil.isNullOrEmpty(elmeResult)) { |
| | | |
| | | try { |
| | | if (share) { |
| | | dto = TaoKeApiUtil.officialActivityConvert(relationPid.split("_")[3], |
| | | activityId, userInfoExtra.getRelationId()); |
| | | dto = convertLinkManager.taobaoOfficialActivityConvert(uid, relationPid, |
| | | activityId, userInfoExtra.getRelationId(), true); |
| | | } else { |
| | | dto = TaoKeApiUtil.officialActivityConvert(TaoBaoConstant.TAOBAO_KOUBEI_PID.split("_")[3], activityId, |
| | | userInfoExtra.getRelationId()); |
| | | dto = convertLinkManager.taobaoOfficialActivityConvert(uid, TaoBaoConstant.TAOBAO_KOUBEI_PID, |
| | | activityId, userInfoExtra.getRelationId(), false); |
| | | } |
| | | } catch (ConvertLinkException e) { |
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult(e.getCode(), e.getMessage()))); |
| | | return; |
| | | } |
| | | |
| | | if (dto != null) { |