| | |
| | |
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.util.SystemInfoUtil;
|
| | | import org.aspectj.lang.ProceedingJoinPoint;
|
| | | import org.aspectj.lang.Signature;
|
| | | import org.aspectj.lang.annotation.Around;
|
| | |
| | | import com.yeshi.fanli.util.annotation.RequestNoSignValidate;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | | import org.yeshi.utils.SystemUtil;
|
| | |
|
| | | //客户端接口签名验证
|
| | | @Component
|
| | |
| | |
|
| | | @Around(EDP)
|
| | | public Object appH5Around(ProceedingJoinPoint joinPoint) throws IOException {
|
| | |
|
| | | Object[] args = joinPoint.getArgs();
|
| | | ServletRequestAttributes servletContainer = (ServletRequestAttributes) RequestContextHolder
|
| | | .getRequestAttributes();
|
| | | HttpServletRequest request = servletContainer.getRequest();
|
| | |
|
| | | AcceptData acceptData = null;
|
| | | for (Object obj : args) {
|
| | | if (obj instanceof AcceptData) {
|
| | | acceptData = (AcceptData) obj;
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | Signature signature = joinPoint.getSignature();
|
| | | MethodSignature methodSignature = (MethodSignature) signature;
|
| | |
| | | e2.printStackTrace();
|
| | | }
|
| | |
|
| | | Object[] args = joinPoint.getArgs();
|
| | | // 判断是否有忽略验证的注解
|
| | | if (realMethod != null && realMethod.isAnnotationPresent(RequestNoSignValidate.class)) {
|
| | | if(acceptData!=null){
|
| | | acceptData.setSystem(SystemInfoUtil.getSystem(acceptData));
|
| | | }
|
| | |
|
| | | try {
|
| | | return joinPoint.proceed(args);
|
| | | } catch (Throwable e) {
|
| | |
| | |
|
| | | // 签名是否正确
|
| | | if (isRight) {
|
| | | if(acceptData!=null){
|
| | | acceptData.setSystem(SystemInfoUtil.getSystem(acceptData));
|
| | | }
|
| | | Object obj = null;
|
| | | try {
|
| | | obj = joinPoint.proceed(args);
|
| | |
| | | package com.yeshi.fanli.controller;
|
| | |
|
| | | import java.io.IOException;
|
| | | import java.io.PrintWriter;
|
| | | import java.io.UnsupportedEncodingException;
|
| | | import java.net.URLDecoder;
|
| | | import java.util.Date;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.UserActiveLog;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoModifyRecord.ModifyTypeEnum;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.msg.UserAccountMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.user.tb.TaoBaoUnionAuthRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
|
| | | import com.yeshi.fanli.util.AESUtil;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisKeyEnum;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.*;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | | import java.io.IOException;
|
| | | import java.io.PrintWriter;
|
| | | import java.io.UnsupportedEncodingException;
|
| | | import java.net.URLDecoder;
|
| | | import java.util.Date;
|
| | |
|
| | | /**
|
| | | * 授权回调
|
| | |
| | | // 计入记录
|
| | |
|
| | | try {
|
| | | //
|
| | | String result = TaoKeApiUtil.getAccessToken(code, TaoBaoConstant.TAOBAO_AUTH_APPKEY,
|
| | | TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | JSONObject data = JSONObject.fromObject(result);
|
| | |
| | | final String relationId2 = relationId;
|
| | | // 异步申请会员ID
|
| | | final Long fuid = uid;
|
| | | ThreadUtil.run(new Runnable() {
|
| | |
|
| | | @Override
|
| | | public void run() {
|
| | | String specialId = null;
|
| | | try {
|
| | | specialId = TaoKeApiUtil.getSpecialId(accessToken, TaoBaoConstant.TAOBAO_AUTH_APPKEY,
|
| | | TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | } catch (TaoBaoAuthException e1) {
|
| | | LogManager.getLogger(LogType.taobaoAuth).error(fuid + "会员备案失败:" + e1.getMessage());
|
| | | }
|
| | |
|
| | | try {
|
| | | userExtraTaoBaoInfoService.addSpecialId(fuid, specialId, taoBaoUid, name, true);
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(specialId) && !StringUtil.isNullOrEmpty(relationId2))
|
| | | userInfoModifyRecordService.addModifyRecord(fuid, ModifyTypeEnum.bindTaoBao, taoBaoUid);
|
| | | } catch (UserExtraTaoBaoInfoException e) {
|
| | | LogHelper.test(e.getMsg());
|
| | | }
|
| | | }
|
| | | });
|
| | | // ThreadUtil.run(new Runnable() {
|
| | | //
|
| | | // @Override
|
| | | // public void run() {
|
| | | // String specialId = null;
|
| | | // try {
|
| | | // specialId = TaoKeApiUtil.getSpecialId(accessToken, TaoBaoConstant.TAOBAO_AUTH_APPKEY,
|
| | | // TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | // } catch (TaoBaoAuthException e1) {
|
| | | // LogManager.getLogger(LogType.taobaoAuth).error(fuid + "会员备案失败:" + e1.getMessage());
|
| | | // }
|
| | | //
|
| | | // try {
|
| | | // userExtraTaoBaoInfoService.addSpecialId(fuid, specialId, taoBaoUid, name, true);
|
| | | //
|
| | | // if (!StringUtil.isNullOrEmpty(specialId) && !StringUtil.isNullOrEmpty(relationId2))
|
| | | // userInfoModifyRecordService.addModifyRecord(fuid, ModifyTypeEnum.bindTaoBao, taoBaoUid);
|
| | | // } catch (UserExtraTaoBaoInfoException e) {
|
| | | // LogHelper.test(e.getMsg());
|
| | | // }
|
| | | // }
|
| | | // });
|
| | |
|
| | | // 稍作延迟
|
| | | Thread.sleep(50);
|
| | |
| | | if (e.getCode() == TaoBaoAuthException.CODE_NOT_REAL_NAME)
|
| | | userAccountMsgNotificationService.taoBaoAuthFail(uid, name, "淘宝账号未实名");
|
| | | LogManager.getLogger(LogType.taobaoAuth).error(uid + "会员备案失败:" + e.getMessage());
|
| | |
|
| | | LogHelper.test("淘宝授权:"+uid + "会员备案失败:" + e.getMessage());
|
| | | }
|
| | |
|
| | | LogHelper.test("淘宝授权:"+specialId);
|
| | |
|
| | | try {
|
| | | userExtraTaoBaoInfoService.addSpecialId(uid, specialId, taoBaoUid, nickName, true);
|
| | |
| | |
|
| | | final String specialId2 = specialId;
|
| | | // 异步申请渠道ID
|
| | | ThreadUtil.run(new Runnable() {
|
| | |
|
| | | @Override
|
| | | public void run() {
|
| | | String relationId = null;
|
| | | try {
|
| | | relationId = TaoKeApiUtil.getRelationId(accessToken, TaoBaoConstant.TAOBAO_AUTH_APPKEY,
|
| | | TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | } catch (TaoBaoAuthException e1) {
|
| | | LogManager.getLogger(LogType.taobaoAuth).error(fuid + "渠道备案失败:" + e1.getMessage());
|
| | | }
|
| | | try {
|
| | | userExtraTaoBaoInfoService.addRelationId(fuid, relationId, taoBaoUid, name, true);
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(specialId2) && !StringUtil.isNullOrEmpty(relationId))
|
| | | userInfoModifyRecordService.addModifyRecord(fuid, ModifyTypeEnum.bindTaoBao, taoBaoUid);
|
| | | } catch (UserExtraTaoBaoInfoException e) {
|
| | | LogHelper.test(e.getMsg());
|
| | | }
|
| | | }
|
| | | });
|
| | | // ThreadUtil.run(new Runnable() {
|
| | | //
|
| | | // @Override
|
| | | // public void run() {
|
| | | // String relationId = null;
|
| | | // try {
|
| | | // relationId = TaoKeApiUtil.getRelationId(accessToken, TaoBaoConstant.TAOBAO_AUTH_APPKEY,
|
| | | // TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | // } catch (TaoBaoAuthException e1) {
|
| | | // LogManager.getLogger(LogType.taobaoAuth).error(fuid + "渠道备案失败:" + e1.getMessage());
|
| | | // }
|
| | | // try {
|
| | | // userExtraTaoBaoInfoService.addRelationId(fuid, relationId, taoBaoUid, name, true);
|
| | | //
|
| | | // if (!StringUtil.isNullOrEmpty(specialId2) && !StringUtil.isNullOrEmpty(relationId))
|
| | | // userInfoModifyRecordService.addModifyRecord(fuid, ModifyTypeEnum.bindTaoBao, taoBaoUid);
|
| | | // } catch (UserExtraTaoBaoInfoException e) {
|
| | | // LogHelper.test(e.getMsg());
|
| | | // }
|
| | | // }
|
| | | // });
|
| | | // 稍作延迟
|
| | | Thread.sleep(50);
|
| | |
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import com.yeshi.fanli.entity.SystemEnum;
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
| | | @RequestMapping(value = "query")
|
| | | public void query(String callback, AcceptData acceptData, Long pageId, Integer pageSize, String key, Long cid,
|
| | | PrintWriter out) {
|
| | | //其他APP无帮助中心列表
|
| | | acceptData.setSystem(SystemEnum.blks);
|
| | | try {
|
| | | if (pageSize == null)
|
| | | pageSize = Constant.PAGE_SIZE;
|
| | |
| | | public void getRecommendIndex(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | try {
|
| | | // 获取设备定义性别
|
| | | int deviceSex = deviceSexService.getDeviceSex(acceptData.getDevice());
|
| | | int deviceSex = deviceSexService.getDeviceSex(acceptData.getDevice(),acceptData.getSystem());
|
| | |
|
| | | // 1、专题模块
|
| | | JSONObject root = specialService.listCacheSpecialToIndex(acceptData, deviceSex,acceptData.getSystem());
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import com.yeshi.fanli.entity.SystemFunction;
|
| | | import com.yeshi.fanli.util.SystemInfoUtil;
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | |
| | | out.print(JsonUtil.loadFalseResult(1, "暂不开放申请"));
|
| | | return;
|
| | | }
|
| | | |
| | | String inviteCode = userInfoExtraService.getInviteCodeByUid(uid);
|
| | | if (StringUtil.isNullOrEmpty(inviteCode)) {
|
| | | out.print(JsonUtil.loadFalseResult(3, "请激活邀请码"));
|
| | | return;
|
| | |
|
| | | if(SystemInfoUtil.hasFunctions(acceptData.getSystem(), SystemFunction.threeSale)) {
|
| | | String inviteCode = userInfoExtraService.getInviteCodeByUid(uid);
|
| | | if (StringUtil.isNullOrEmpty(inviteCode)) {
|
| | | out.print(JsonUtil.loadFalseResult(3, "请激活邀请码"));
|
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import com.yeshi.fanli.entity.SystemEnum;
|
| | | import com.yeshi.fanli.entity.SystemFunction;
|
| | | import com.yeshi.fanli.util.*;
|
| | | import org.apache.commons.beanutils.PropertyUtils;
|
| | | import org.springframework.stereotype.Controller;
|
| | |
| | | data.put("welfareCenterNews", welfareCenterNews);// 福利中心消息
|
| | | data.put("vipLink", userVipConfigService.getValueByKey("vip_link"));// 超级会员升级链接
|
| | |
|
| | | // 2.0.1之后绑定手机号
|
| | | if (VersionUtil.greaterThan_2_0_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | boolean bindPhone = false;
|
| | | if (StringUtil.isNullOrEmpty(userInfo.getPhone()))
|
| | | bindPhone = bindRemindService.bindRemind(uid, BindRemind.TYPE_PHONE);
|
| | | data.put("bindPhone", bindPhone);
|
| | | if(SystemInfoUtil.hasFunctions(acceptData.getSystem(), SystemFunction.bindPhone)) {
|
| | | // 2.0.1之后绑定手机号
|
| | | if (VersionUtil.greaterThan_2_0_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | boolean bindPhone = false;
|
| | | if (StringUtil.isNullOrEmpty(userInfo.getPhone()))
|
| | | bindPhone = bindRemindService.bindRemind(uid, BindRemind.TYPE_PHONE);
|
| | | data.put("bindPhone", bindPhone);
|
| | | }
|
| | | }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(invitCode)) {
|
| | |
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpSession;
|
| | |
|
| | | import com.yeshi.fanli.entity.SystemEnum;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | |
| | | @RequestMapping("api/v1/user/msg")
|
| | | public class UserMsgController {
|
| | |
|
| | | @Resource
|
| | | private BusinessSystemService businessSystemService;
|
| | |
|
| | | @Resource
|
| | | private MsgOrderDetailService msgOrderDetailService;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | |
|
| | | // 消息的类型
|
| | | final static String MSG_TYPE_ORDER = "order";
|
| | |
| | | // 创建时间在28号后的才有新人欢迎
|
| | | if ((time > TimeUtil.convertToTimeTemp("2019-01-28", "yyyy-MM-dd") || uid == null)) {
|
| | | UserHomeMsgVO vo = new UserHomeMsgVO();
|
| | | vo.setContent(String.format("恭喜你,成为%s的用户\n独家优惠券帮你省钱;\n参与奖金活动帮你赚钱;\n让%s成为你的省钱助手吧!",
|
| | | Constant.getAppName(acceptData.getPlatform(), acceptData.getVersion()),
|
| | | Constant.getAppName(acceptData.getPlatform(), acceptData.getVersion())));
|
| | | vo.setTitle("新人欢迎");
|
| | | vo.setContent(configService.getValue(ConfigKeyEnum.welcomeMsg, acceptData.getSystem()));
|
| | | if (acceptData.getSystem() == SystemEnum.blks)
|
| | | vo.setTitle("新人欢迎");
|
| | | else
|
| | | vo.setTitle("欢迎新人");
|
| | | vo.setCreateTime(getTimeDesc(now, new Date(time)));
|
| | | vo.setType(UserHomeMsgVO.TYPE_WELCOME);
|
| | | volist.add(vo);
|
| | |
| | | }
|
| | |
|
| | | // 人工客服
|
| | | commonMsgList.add(getKeFuMsg(acceptData));
|
| | | if (acceptData.getSystem() == SystemEnum.blks)
|
| | | commonMsgList.add(getKeFuMsg(acceptData));
|
| | |
|
| | | // 推荐记录
|
| | | DeviceActive deviceActive = deviceActiveService.getDeviceByDeviceAndPlatform(acceptData.getDevice(),
|
| | |
| | | // 创建时间在28号后的才有新人欢迎
|
| | | if ((time > TimeUtil.convertToTimeTemp("2019-01-28", "yyyy-MM-dd") || uid == null)) {
|
| | | Map<String, Object> map = new HashMap<String, Object>();
|
| | | map.put("title", "新人欢迎");
|
| | | if (acceptData.getSystem() == SystemEnum.blks)
|
| | | map.put("title", "新人欢迎");
|
| | | else
|
| | | map.put("title", "欢迎新人");
|
| | | map.put("content",
|
| | | String.format("恭喜你,成为%s的用户\n独家优惠券帮你省钱;\n参与奖金活动帮你赚钱;\n让%s成为你的省钱助手吧!",
|
| | | Constant.getAppName(acceptData.getPlatform(), acceptData.getVersion()),
|
| | | Constant.getAppName(acceptData.getPlatform(), acceptData.getVersion())));
|
| | | configService.getValue(ConfigKeyEnum.welcomeMsg, acceptData.getSystem()));
|
| | | map.put("createTime", new Date(time));
|
| | | UserMsgCenter msgCenternre = new UserMsgCenter();
|
| | | msgCenternre.setWelcomeMsg(map);
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import com.yeshi.fanli.util.SystemInfoUtil;
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
| | | @RequestMapping("api/apph5/v1/coupon")
|
| | | public class AppH5CouponController {
|
| | |
|
| | | @Resource
|
| | | private QualityGoodsService qualityGoodsService;
|
| | | @Resource
|
| | | private QualityGoodsService qualityGoodsService;
|
| | |
|
| | | @Resource
|
| | | private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService;
|
| | | @Resource
|
| | | private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | |
|
| | | @Resource
|
| | | private UserSystemCouponService userSystemCouponService;
|
| | | @Resource
|
| | | private UserSystemCouponService userSystemCouponService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | |
|
| | | @Resource
|
| | | private UserVIPInfoService userVIPInfoService;
|
| | | @Resource
|
| | | private UserVIPInfoService userVIPInfoService;
|
| | |
|
| | | @Resource
|
| | | private FreeGoodsCouponService freeGoodsCouponService;
|
| | | @Resource
|
| | | private FreeGoodsCouponService freeGoodsCouponService;
|
| | |
|
| | | @Resource
|
| | | private TearcherService tearcherService;
|
| | | @Resource
|
| | | private TearcherService tearcherService;
|
| | |
|
| | | @RequestMapping("getMianDanGoodsList")
|
| | | public void getMianDanGoodsList(AcceptData acceptData, PrintWriter out, int page, int pageSize, String callback) {
|
| | | List<QualityFactory> listQuery = qualityGoodsService.listFreeGoods((page - 1) * pageSize, pageSize);
|
| | | if (listQuery == null || listQuery.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(2, "没有更多了"));
|
| | | return;
|
| | | }
|
| | | @RequestMapping("getMianDanGoodsList")
|
| | | public void getMianDanGoodsList(AcceptData acceptData, PrintWriter out, int page, int pageSize, String callback) {
|
| | | if (acceptData.getSystem() == null)
|
| | | acceptData.setSystem(SystemInfoUtil.getSystem(acceptData));
|
| | |
|
| | | List<Long> listGid = new ArrayList<Long>();
|
| | | for (QualityFactory qualityFactory : listQuery) {
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = qualityFactory.getTaoBaoGoodsBrief();
|
| | | if (taoBaoGoodsBrief == null) {
|
| | | continue;
|
| | | }
|
| | | listGid.add(taoBaoGoodsBrief.getAuctionId());
|
| | | }
|
| | | List<QualityFactory> listQuery = qualityGoodsService.listFreeGoods((page - 1) * pageSize, pageSize);
|
| | | if (listQuery == null || listQuery.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(2, "没有更多了"));
|
| | | return;
|
| | | }
|
| | |
|
| | | // API网络接口验证是否在售
|
| | | List<TaoBaoGoodsBrief> listTaoKeGoods = null;
|
| | | try {
|
| | | listTaoKeGoods = TaoKeApiUtil.getBatchGoodsInfo(listGid);
|
| | | } catch (TaoKeApiException e) {
|
| | | e.printStackTrace();
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | e.printStackTrace();
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | List<Long> listGid = new ArrayList<Long>();
|
| | | for (QualityFactory qualityFactory : listQuery) {
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = qualityFactory.getTaoBaoGoodsBrief();
|
| | | if (taoBaoGoodsBrief == null) {
|
| | | continue;
|
| | | }
|
| | | listGid.add(taoBaoGoodsBrief.getAuctionId());
|
| | | }
|
| | |
|
| | | JSONArray array = new JSONArray();
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | // API网络接口验证是否在售
|
| | | List<TaoBaoGoodsBrief> listTaoKeGoods = null;
|
| | | try {
|
| | | listTaoKeGoods = TaoKeApiUtil.getBatchGoodsInfo(listGid);
|
| | | } catch (TaoKeApiException e) {
|
| | | e.printStackTrace();
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | e.printStackTrace();
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | ConfigParamsDTO configParamsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion(), UserLevelEnum.daRen,acceptData.getSystem());
|
| | | /* 遍历列表数据 */
|
| | | for (QualityFactory selectionGoods : listQuery) {
|
| | | JSONArray array = new JSONArray();
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | |
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = selectionGoods.getTaoBaoGoodsBrief();
|
| | | ConfigParamsDTO configParamsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion(), UserLevelEnum.daRen, acceptData.getSystem());
|
| | | /* 遍历列表数据 */
|
| | | for (QualityFactory selectionGoods : listQuery) {
|
| | |
|
| | | if (taoBaoGoodsBrief == null) {
|
| | | continue;
|
| | | }
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = selectionGoods.getTaoBaoGoodsBrief();
|
| | |
|
| | | if (listTaoKeGoods != null && listTaoKeGoods.size() > 0) {
|
| | | boolean stateSale = false; // 默认停售
|
| | | Long goodsId = taoBaoGoodsBrief.getAuctionId();
|
| | | for (TaoBaoGoodsBrief taoKeGoods : listTaoKeGoods) {
|
| | | Long auctionId = taoKeGoods.getAuctionId();
|
| | | if (goodsId == auctionId || goodsId.equals(auctionId)) {
|
| | | stateSale = true; // 在售
|
| | | break;
|
| | | }
|
| | | }
|
| | | if (taoBaoGoodsBrief == null) {
|
| | | continue;
|
| | | }
|
| | |
|
| | | if (!stateSale) {
|
| | | continue;
|
| | | }
|
| | | }
|
| | | if (listTaoKeGoods != null && listTaoKeGoods.size() > 0) {
|
| | | boolean stateSale = false; // 默认停售
|
| | | Long goodsId = taoBaoGoodsBrief.getAuctionId();
|
| | | for (TaoBaoGoodsBrief taoKeGoods : listTaoKeGoods) {
|
| | | Long auctionId = taoKeGoods.getAuctionId();
|
| | | if (goodsId == auctionId || goodsId.equals(auctionId)) {
|
| | | stateSale = true; // 在售
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | BigDecimal couplePrice = TaoBaoUtil.getAfterUseCouplePrice(taoBaoGoodsBrief);
|
| | | if (couplePrice.compareTo(new BigDecimal("9.9")) == 1) {
|
| | | continue; // 券后价大于10
|
| | | }
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, configParamsDTO);
|
| | | array.add(gson.toJson(detailVO));
|
| | | }
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("goodsList", array);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | if (!stateSale) {
|
| | | continue;
|
| | | }
|
| | | }
|
| | |
|
| | | @RequestMapping("getMianDanInfo")
|
| | | public void getMianDanInfo(AcceptData acceptData, PrintWriter out, Long uid, String callback) {
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | | }
|
| | | // 获取用户信息
|
| | | UserInfo user = userInfoService.getUserById(uid);
|
| | | if (user == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户不存在"));
|
| | | return;
|
| | | }
|
| | | // 获取免单券数量
|
| | | long couponCount = userSystemCouponService.countUsableFreeCouponForBuy(uid);
|
| | | JSONObject userJson = new JSONObject();
|
| | | userJson.put("nickName", user.getNickName());
|
| | | userJson.put("portrait", user.getPortrait());
|
| | | userJson.put("id", user.getId());
|
| | | BigDecimal couplePrice = TaoBaoUtil.getAfterUseCouplePrice(taoBaoGoodsBrief);
|
| | | if (couplePrice.compareTo(new BigDecimal("9.9")) == 1) {
|
| | | continue; // 券后价大于10
|
| | | }
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, configParamsDTO);
|
| | | array.add(gson.toJson(detailVO));
|
| | | }
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("goodsList", array);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("user", userJson);
|
| | | data.put("couponCount", couponCount);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | @RequestMapping("getMianDanInfo")
|
| | | public void getMianDanInfo(AcceptData acceptData, PrintWriter out, Long uid, String callback) {
|
| | | if (acceptData.getSystem() == null)
|
| | | acceptData.setSystem(SystemInfoUtil.getSystem(acceptData));
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | | }
|
| | | // 获取用户信息
|
| | | UserInfo user = userInfoService.getUserById(uid);
|
| | | if (user == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户不存在"));
|
| | | return;
|
| | | }
|
| | | // 获取免单券数量
|
| | | long couponCount = userSystemCouponService.countUsableFreeCouponForBuy(uid);
|
| | | JSONObject userJson = new JSONObject();
|
| | | userJson.put("nickName", user.getNickName());
|
| | | userJson.put("portrait", user.getPortrait());
|
| | | userJson.put("id", user.getId());
|
| | |
|
| | | /**
|
| | | * 获取返利奖励券信息
|
| | | * |
| | | * @param acceptData
|
| | | * @param out
|
| | | * @param uid
|
| | | * @param callback
|
| | | */
|
| | | @RequestMapping("getRewardCouponInfo")
|
| | | public void getRewardCouponInfo(AcceptData acceptData, PrintWriter out, Long uid, String callback) {
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | | }
|
| | | // 获取用户信息
|
| | | UserInfo user = userInfoService.getUserById(uid);
|
| | | if (user == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户不存在"));
|
| | | return;
|
| | | }
|
| | | // 获取免单券数量
|
| | | long couponCount = userSystemCouponService.countUsableRewardCoupon(uid);
|
| | | UserInfoExtra extraInfo = userInfoExtraService.getUserInfoExtra(uid);
|
| | | long integralCount = extraInfo != null ? extraInfo.getGoldCoin() : 0L;
|
| | | JSONObject userJson = new JSONObject();
|
| | | userJson.put("nickName", user.getNickName());
|
| | | userJson.put("portrait", user.getPortrait());
|
| | | userJson.put("id", user.getId());
|
| | | userJson.put("vip", userVIPInfoService.isVIP(user.getId()));
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("user", userJson);
|
| | | data.put("couponCount", couponCount);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("user", userJson);
|
| | | data.put("couponCount", couponCount);
|
| | | data.put("integralCount", integralCount);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | /**
|
| | | * 获取返利奖励券信息
|
| | | *
|
| | | * @param acceptData
|
| | | * @param out
|
| | | * @param uid
|
| | | * @param callback
|
| | | */
|
| | | @RequestMapping("getRewardCouponInfo")
|
| | | public void getRewardCouponInfo(AcceptData acceptData, PrintWriter out, Long uid, String callback) {
|
| | | if (acceptData.getSystem() == null)
|
| | | acceptData.setSystem(SystemInfoUtil.getSystem(acceptData));
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | | }
|
| | | // 获取用户信息
|
| | | UserInfo user = userInfoService.getUserById(uid);
|
| | | if (user == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户不存在"));
|
| | | return;
|
| | | }
|
| | | // 获取免单券数量
|
| | | long couponCount = userSystemCouponService.countUsableRewardCoupon(uid);
|
| | | UserInfoExtra extraInfo = userInfoExtraService.getUserInfoExtra(uid);
|
| | | long integralCount = extraInfo != null ? extraInfo.getGoldCoin() : 0L;
|
| | | JSONObject userJson = new JSONObject();
|
| | | userJson.put("nickName", user.getNickName());
|
| | | userJson.put("portrait", user.getPortrait());
|
| | | userJson.put("id", user.getId());
|
| | | userJson.put("vip", userVIPInfoService.isVIP(user.getId()));
|
| | |
|
| | | /**
|
| | | * 新版免单商品列表
|
| | | * |
| | | * @param acceptData
|
| | | * @param callback
|
| | | * @param page
|
| | | * @param goodsType
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping("getFreeGoodsList")
|
| | | public void getFreeGoodsList(AcceptData acceptData, String callback, Long uid, int page, int goodsType,
|
| | | PrintWriter out) {
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | | }
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("user", userJson);
|
| | | data.put("couponCount", couponCount);
|
| | | data.put("integralCount", integralCount);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | // 获取用户信息
|
| | | UserInfo user = userInfoService.getUserById(uid);
|
| | | if (user == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户不存在"));
|
| | | return;
|
| | | }
|
| | | /**
|
| | | * 新版免单商品列表
|
| | | *
|
| | | * @param acceptData
|
| | | * @param callback
|
| | | * @param page
|
| | | * @param goodsType
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping("getFreeGoodsList")
|
| | | public void getFreeGoodsList(AcceptData acceptData, String callback, Long uid, int page, int goodsType,
|
| | | PrintWriter out) {
|
| | | if (acceptData.getSystem() == null)
|
| | | acceptData.setSystem(SystemInfoUtil.getSystem(acceptData));
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | String tearcherWX = null;
|
| | | TearcherInfo tearcherInfo = tearcherService.selectByUid(uid);
|
| | | if (tearcherInfo != null) {
|
| | | tearcherWX = tearcherInfo.getWxID();
|
| | | }
|
| | | // 获取用户信息
|
| | | UserInfo user = userInfoService.getUserById(uid);
|
| | | if (user == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户不存在"));
|
| | | return;
|
| | | }
|
| | |
|
| | | // 获取免单券数量
|
| | | long couponNum = userSystemCouponService.countUsableFreeCouponForBuy(uid);
|
| | | String tearcherWX = null;
|
| | | TearcherInfo tearcherInfo = tearcherService.selectByUid(uid);
|
| | | if (tearcherInfo != null) {
|
| | | tearcherWX = tearcherInfo.getWxID();
|
| | | }
|
| | |
|
| | | JSONArray array = new JSONArray();
|
| | | List<FreeGoodsCoupon> list = freeGoodsCouponService.listByType((page - 1) * Constant.PAGE_SIZE,
|
| | | Constant.PAGE_SIZE, goodsType);
|
| | | if (list != null && list.size() > 0) {
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create();
|
| | | for (FreeGoodsCoupon freeGoods : list) {
|
| | | GoodsDetailVO goods = freeGoods.getGoods();
|
| | | if (goods == null)
|
| | | continue;
|
| | | |
| | | // 实付款0
|
| | | OtherInfo otherInfo = goods.getOtherInfo();
|
| | | if (otherInfo == null)
|
| | | otherInfo = new OtherInfo();
|
| | | otherInfo.setActualPay(BigDecimal.ZERO);
|
| | | |
| | | // 补齐金额
|
| | | if (goods.isHasCoupon()) {
|
| | | otherInfo.setMendMoney(goods.getCouponPrice());
|
| | | } else {
|
| | | otherInfo.setMendMoney(goods.getZkPrice());
|
| | | }
|
| | | goods.setOtherInfo(otherInfo);
|
| | | array.add(gson.toJson(goods));
|
| | | }
|
| | | }
|
| | | // 获取免单券数量
|
| | | long couponNum = userSystemCouponService.countUsableFreeCouponForBuy(uid);
|
| | |
|
| | | JSONObject userJson = new JSONObject();
|
| | | userJson.put("nickName", user.getNickName());
|
| | | userJson.put("portrait", user.getPortrait());
|
| | | userJson.put("couponNum", couponNum);
|
| | | userJson.put("tearcherWX", tearcherWX);
|
| | | JSONArray array = new JSONArray();
|
| | | List<FreeGoodsCoupon> list = freeGoodsCouponService.listByType((page - 1) * Constant.PAGE_SIZE,
|
| | | Constant.PAGE_SIZE, goodsType);
|
| | | if (list != null && list.size() > 0) {
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create();
|
| | | for (FreeGoodsCoupon freeGoods : list) {
|
| | | GoodsDetailVO goods = freeGoods.getGoods();
|
| | | if (goods == null)
|
| | | continue;
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("user", userJson);
|
| | | data.put("count", freeGoodsCouponService.countByType(goodsType));
|
| | | data.put("list", array);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | // 实付款0
|
| | | OtherInfo otherInfo = goods.getOtherInfo();
|
| | | if (otherInfo == null)
|
| | | otherInfo = new OtherInfo();
|
| | | otherInfo.setActualPay(BigDecimal.ZERO);
|
| | |
|
| | | // 补齐金额
|
| | | if (goods.isHasCoupon()) {
|
| | | otherInfo.setMendMoney(goods.getCouponPrice());
|
| | | } else {
|
| | | otherInfo.setMendMoney(goods.getZkPrice());
|
| | | }
|
| | | goods.setOtherInfo(otherInfo);
|
| | | array.add(gson.toJson(goods));
|
| | | }
|
| | | }
|
| | |
|
| | | JSONObject userJson = new JSONObject();
|
| | | userJson.put("nickName", user.getNickName());
|
| | | userJson.put("portrait", user.getPortrait());
|
| | | userJson.put("couponNum", couponNum);
|
| | | userJson.put("tearcherWX", tearcherWX);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("user", userJson);
|
| | | data.put("count", freeGoodsCouponService.countByType(goodsType));
|
| | | data.put("list", array);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | } |
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import com.yeshi.fanli.util.SystemInfoUtil;
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.yeshi.utils.DateUtil;
|
| | |
| | | */
|
| | | @RequestMapping("getGoodsList")
|
| | | public void getGoodsList(AcceptData acceptData, String callback, Long uid, Integer page, PrintWriter out) {
|
| | | if (acceptData.getSystem() == null)
|
| | | acceptData.setSystem(SystemInfoUtil.getSystem(acceptData));
|
| | | JSONArray array = new JSONArray();
|
| | | List<PullNewGoods> list = pullNewGoodsService.listQuery((page-1)*Constant.PAGE_SIZE, Constant.PAGE_SIZE);
|
| | | if (list != null && list.size() > 0) {
|
| | |
| | | */
|
| | | @RequestMapping("getRankList")
|
| | | public void getRankList(AcceptData acceptData, String callback, Long uid, PrintWriter out) {
|
| | | if (acceptData.getSystem() == null)
|
| | | acceptData.setSystem(SystemInfoUtil.getSystem(acceptData));
|
| | | JSONArray array = new JSONArray();
|
| | | List<UserRankings> list = userRankingsService.getRankList(0, 10);
|
| | | if (list != null && list.size() > 0) {
|
| | |
| | | */
|
| | | @RequestMapping("getShareImg")
|
| | | public void getShareImg(AcceptData acceptData, String callback, Long uid, PrintWriter out) {
|
| | | if (acceptData.getSystem() == null)
|
| | | acceptData.setSystem(SystemInfoUtil.getSystem(acceptData));
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import com.yeshi.fanli.util.SystemInfoUtil;
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
| | |
|
| | | @RequestMapping("getTLJBuyGoods")
|
| | | public void getTLJBuyGoods(AcceptData acceptData, PrintWriter out, String callback) {
|
| | | if (acceptData.getSystem() == null)
|
| | | acceptData.setSystem(SystemInfoUtil.getSystem(acceptData));
|
| | | //
|
| | | List<TLJBuyGoods> goodsList = tljBuyGoodsService
|
| | | .listByDay(TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd"));
|
| | |
| | | */
|
| | | @RequestMapping("getShareHotGoods")
|
| | | public void getShareHotGoods(AcceptData acceptData, PrintWriter out, String callback) {
|
| | | if (acceptData.getSystem() == null)
|
| | | acceptData.setSystem(SystemInfoUtil.getSystem(acceptData));
|
| | | List<ShareHotGoods> goodsList = shareHotGoodsService
|
| | | .listByDay(TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd"));
|
| | | int count = goodsList.size();
|
| | |
| | |
|
| | | /**
|
| | | * 动态
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | * @author Administrator
|
| | | */
|
| | | @Controller
|
| | | @RequestMapping("api/v2/config")
|
| | | public class ConfigControllerV2 {
|
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | |
|
| | | @Resource
|
| | | private TBPidService tbPidService;
|
| | | @Resource
|
| | | private TBPidService tbPidService;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoUnionConfigService taoBaoUnionConfigService;
|
| | | @Resource
|
| | | private TaoBaoUnionConfigService taoBaoUnionConfigService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | |
|
| | | @Resource
|
| | | private FloatADService floatADService;
|
| | | @Resource
|
| | | private FloatADService floatADService;
|
| | |
|
| | | @Resource
|
| | | private JumpDetailV2Service jumpDetailV2Service;
|
| | | @Resource
|
| | | private JumpDetailV2Service jumpDetailV2Service;
|
| | |
|
| | | @Resource
|
| | | private MsgDeviceReadStateService msgDeviceReadStateService;
|
| | | @Resource
|
| | | private MsgDeviceReadStateService msgDeviceReadStateService;
|
| | |
|
| | | @Resource
|
| | | private UserTaoLiJinOriginService uerTaoLiJinOriginService;
|
| | | @Resource
|
| | | private UserTaoLiJinOriginService uerTaoLiJinOriginService;
|
| | |
|
| | | @Resource
|
| | | private UserActiveLogService userActiveLogService;
|
| | | @Resource
|
| | | private UserActiveLogService userActiveLogService;
|
| | |
|
| | | @Resource
|
| | | private UserTaoLiJinNewbiesService userTaoLiJinNewbiesService;
|
| | | @Resource
|
| | | private UserTaoLiJinNewbiesService userTaoLiJinNewbiesService;
|
| | |
|
| | | @Resource
|
| | | private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService;
|
| | | @Resource
|
| | | private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService;
|
| | |
|
| | | @Resource
|
| | | private RedisManager redisManager;
|
| | | @Resource
|
| | | private RedisManager redisManager;
|
| | |
|
| | | /**
|
| | | * s 首页配置信息
|
| | | * |
| | | * @param acceptData
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getHomeConfig", method = RequestMethod.POST)
|
| | | public void getHomeConfig(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | if (uid != null && uid == 0L)
|
| | | uid = null;
|
| | | /**
|
| | | * s 首页配置信息
|
| | | *
|
| | | * @param acceptData
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getHomeConfig", method = RequestMethod.POST)
|
| | | public void getHomeConfig(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | if (uid != null && uid == 0L)
|
| | | uid = null;
|
| | |
|
| | | AppHomeFloatImg appHomeFloatImg = configService.getAppHomeFloatImg(acceptData.getSystem());
|
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform()) && !Constant.IS_TEST) {
|
| | | appHomeFloatImg = null;
|
| | | }
|
| | | AppHomeFloatImg appHomeFloatImg = configService.getAppHomeFloatImg(acceptData.getSystem());
|
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform()) && !Constant.IS_TEST) {
|
| | | appHomeFloatImg = null;
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | if (appHomeFloatImg != null) {
|
| | | data.put("floatImg", appHomeFloatImg);
|
| | | }
|
| | | JSONObject data = new JSONObject();
|
| | | if (appHomeFloatImg != null) {
|
| | | data.put("floatImg", appHomeFloatImg);
|
| | | }
|
| | |
|
| | | String notifyImg = configService.getAppHomeFloatNotifyImg(acceptData.getSystem());
|
| | | if (!StringUtil.isNullOrEmpty(notifyImg)) {
|
| | | data.put("floatNotifyImg", notifyImg);
|
| | | }
|
| | | String notifyImg = configService.getAppHomeFloatNotifyImg(acceptData.getSystem());
|
| | | if (!StringUtil.isNullOrEmpty(notifyImg)) {
|
| | | data.put("floatNotifyImg", notifyImg);
|
| | | }
|
| | |
|
| | | // 无新人弹框 则查询默认
|
| | | FloatAD floatAD = floatADService.getEffectiveFloatAD(FloatAD.POSITION_INDEX, 0,acceptData.getSystem());
|
| | | // 无新人弹框 则查询默认
|
| | | FloatAD floatAD = floatADService.getEffectiveFloatAD(FloatAD.POSITION_INDEX, 0, acceptData.getSystem());
|
| | |
|
| | | if (floatAD != null && floatAD.getTypeEnum() != FloatADTypeEnum.newUserRedPack) {
|
| | | JSONObject detail = new JSONObject();
|
| | | detail.put("img", floatAD.getPicture());
|
| | | detail.put("jumpDetail", floatAD.getJumpDetail());
|
| | | detail.put("params", floatAD.getParams());
|
| | | detail.put("showTime", floatAD.getShowMode());
|
| | | detail.put("accountLogin", floatAD.isJumpNeedLogin());
|
| | | data.put("floatImgDetail", detail);
|
| | | }
|
| | | if (floatAD != null && floatAD.getTypeEnum() != FloatADTypeEnum.newUserRedPack) {
|
| | | JSONObject detail = new JSONObject();
|
| | | detail.put("img", floatAD.getPicture());
|
| | | detail.put("jumpDetail", floatAD.getJumpDetail());
|
| | | detail.put("params", floatAD.getParams());
|
| | | detail.put("showTime", floatAD.getShowMode());
|
| | | detail.put("accountLogin", floatAD.isJumpNeedLogin());
|
| | | data.put("floatImgDetail", detail);
|
| | | }
|
| | |
|
| | | // 领券帮助链接,1.5.2后生效
|
| | | String couponHelp = configService.getValue(ConfigKeyEnum.taobaoCouponHelp.getKey(),acceptData.getSystem());
|
| | | data.put("couponHelpUrl", couponHelp);
|
| | | // 领券帮助链接,1.5.2后生效
|
| | | String couponHelp = configService.getValue(ConfigKeyEnum.taobaoCouponHelp.getKey(), acceptData.getSystem());
|
| | | data.put("couponHelpUrl", couponHelp);
|
| | |
|
| | | // 底部网页链接
|
| | | String platform = acceptData.getPlatform();
|
| | | if ("android".equalsIgnoreCase(platform)) {
|
| | | data.put("htmlLink", configService.getValue(ConfigKeyEnum.indexHtmlLinkAndroid.getKey(),acceptData.getSystem()));
|
| | | }
|
| | | // 底部网页链接
|
| | | String platform = acceptData.getPlatform();
|
| | | if ("android".equalsIgnoreCase(platform)) {
|
| | | data.put("htmlLink", configService.getValue(ConfigKeyEnum.indexHtmlLinkAndroid.getKey(), acceptData.getSystem()));
|
| | | }
|
| | |
|
| | | // 判断新老用户
|
| | | UserActiveLog da = null;
|
| | | if (uid != null)
|
| | | da = userActiveLogService.getFirstActiveInfo(uid);
|
| | | // 新人
|
| | | if (da == null || (System.currentTimeMillis() - da.getCreateTime().getTime()) <= 1000 * 60 * 60 * 24 * 15L) {
|
| | | data.put("userTimeType", 0);
|
| | | } else {// 老人
|
| | | data.put("userTimeType", 1);
|
| | | }
|
| | | data.put("hotFuctionLink", configService.getByVersion(ConfigKeyEnum.hotFunctionUrl.getKey(), platform,
|
| | | Integer.parseInt(acceptData.getVersion()),acceptData.getSystem()));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | // 判断新老用户
|
| | | UserActiveLog da = null;
|
| | | if (uid != null)
|
| | | da = userActiveLogService.getFirstActiveInfo(uid);
|
| | | // 新人
|
| | | if (da == null || (System.currentTimeMillis() - da.getCreateTime().getTime()) <= 1000 * 60 * 60 * 24 * 15L) {
|
| | | data.put("userTimeType", 0);
|
| | | } else {// 老人
|
| | | data.put("userTimeType", 1);
|
| | | }
|
| | | data.put("hotFuctionLink", configService.getByVersion(ConfigKeyEnum.hotFunctionUrl.getKey(), platform,
|
| | | Integer.parseInt(acceptData.getVersion()), acceptData.getSystem()));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | /**
|
| | | * s 首页配置信息
|
| | | * |
| | | * @param acceptData
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getHomeConfigNew")
|
| | | public void getHomeConfigNew(AcceptData acceptData, Long uid, String callback, PrintWriter out) {
|
| | | if (uid != null && uid == 0L)
|
| | | uid = null;
|
| | | /**
|
| | | * s 首页配置信息
|
| | | *
|
| | | * @param acceptData
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getHomeConfigNew")
|
| | | public void getHomeConfigNew(AcceptData acceptData, Long uid, String callback, PrintWriter out) {
|
| | | if (uid != null && uid == 0L)
|
| | | uid = null;
|
| | |
|
| | | String platform = acceptData.getPlatform();
|
| | | String version = acceptData.getVersion();
|
| | | String platform = acceptData.getPlatform();
|
| | | String version = acceptData.getVersion();
|
| | |
|
| | | // 活动弹框
|
| | | List<FloatAD> listAD = new ArrayList<FloatAD>();
|
| | | List<FloatImgDetailVO> listVO = new ArrayList<FloatImgDetailVO>();
|
| | | List<FloatAD> list = floatADService.getValidFloatADCache(FloatAD.POSITION_INDEX, null, platform,
|
| | | Integer.parseInt(version),acceptData.getSystem());
|
| | | if (list != null && !list.isEmpty())
|
| | | listAD.addAll(list);
|
| | | // 活动弹框
|
| | | List<FloatAD> listAD = new ArrayList<FloatAD>();
|
| | | List<FloatImgDetailVO> listVO = new ArrayList<FloatImgDetailVO>();
|
| | | List<FloatAD> list = floatADService.getValidFloatADCache(FloatAD.POSITION_INDEX, null, platform,
|
| | | Integer.parseInt(version), acceptData.getSystem());
|
| | | if (list != null && !list.isEmpty())
|
| | | listAD.addAll(list);
|
| | |
|
| | | for (int i = 0; i < listAD.size(); i++) {
|
| | | FloatAD floatAD = listAD.get(i);
|
| | | FloatADTypeEnum typeEnum = floatAD.getTypeEnum();
|
| | | if (typeEnum == FloatADTypeEnum.newUserRedPack && (!VersionUtil.greaterThan_2_0_5(platform, version)
|
| | | || !userTaoLiJinNewbiesService.verifyHasReward(uid, acceptData.getDevice()))) {
|
| | | for (int i = 0; i < listAD.size(); i++) {
|
| | | FloatAD floatAD = listAD.get(i);
|
| | | FloatADTypeEnum typeEnum = floatAD.getTypeEnum();
|
| | | if (typeEnum == FloatADTypeEnum.newUserRedPack && (!VersionUtil.greaterThan_2_0_5(platform, version)
|
| | | || !userTaoLiJinNewbiesService.verifyHasReward(uid, acceptData.getDevice()))) {
|
| | |
|
| | | listAD.remove(i);
|
| | | i--;
|
| | | continue;
|
| | | }
|
| | | listAD.remove(i);
|
| | | i--;
|
| | | continue;
|
| | | }
|
| | |
|
| | | JumpDetailV2 jumpDetail = floatAD.getJumpDetail();
|
| | | if (jumpDetail != null) {
|
| | | jumpDetail = jumpDetailV2Service.selectByPrimaryKey(jumpDetail.getId());
|
| | | if (jumpDetail != null) {
|
| | | jumpDetail.setNeedLogin(floatAD.isJumpNeedLogin());
|
| | | }
|
| | | }
|
| | | FloatImgDetailVO floatImgVO = new FloatImgDetailVO();
|
| | | floatImgVO.setId(floatAD.getId().toString());
|
| | | floatImgVO.setImg(floatAD.getPicture());
|
| | | floatImgVO.setParams(floatAD.getParams());
|
| | | floatImgVO.setJumpDetail(jumpDetail);
|
| | | floatImgVO.setShowTime(floatAD.getShowMode());
|
| | | floatImgVO.setAccountLogin(floatAD.isJumpNeedLogin());
|
| | | if (floatAD.getPlaySound() != null)
|
| | | floatImgVO.setPlaySound(floatAD.getPlaySound());// 默认都播放音效
|
| | | else
|
| | | floatImgVO.setPlaySound(false);
|
| | | listVO.add(floatImgVO);
|
| | | }
|
| | | JumpDetailV2 jumpDetail = floatAD.getJumpDetail();
|
| | | if (jumpDetail != null) {
|
| | | jumpDetail = jumpDetailV2Service.selectByPrimaryKey(jumpDetail.getId());
|
| | | if (jumpDetail != null) {
|
| | | jumpDetail.setNeedLogin(floatAD.isJumpNeedLogin());
|
| | | }
|
| | | }
|
| | | FloatImgDetailVO floatImgVO = new FloatImgDetailVO();
|
| | | floatImgVO.setId(floatAD.getId().toString());
|
| | | floatImgVO.setImg(floatAD.getPicture());
|
| | | floatImgVO.setParams(floatAD.getParams());
|
| | | floatImgVO.setJumpDetail(jumpDetail);
|
| | | floatImgVO.setShowTime(floatAD.getShowMode());
|
| | | floatImgVO.setAccountLogin(floatAD.isJumpNeedLogin());
|
| | | if (floatAD.getPlaySound() != null)
|
| | | floatImgVO.setPlaySound(floatAD.getPlaySound());// 默认都播放音效
|
| | | else
|
| | | floatImgVO.setPlaySound(false);
|
| | | listVO.add(floatImgVO);
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("listAD", JsonUtil.getApiCommonGson().toJson(listVO));
|
| | | data.put("protocol", configService.getValue(ConfigKeyEnum.userProtocolHomeData.getKey(),acceptData.getSystem()));
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("listAD", JsonUtil.getApiCommonGson().toJson(listVO));
|
| | | data.put("protocol", configService.getValue(ConfigKeyEnum.userProtocolHomeData.getKey(), acceptData.getSystem()));
|
| | |
|
| | | // 领券帮助链接,1.5.2后生效
|
| | | String couponHelp = configService.getValue(ConfigKeyEnum.taobaoCouponHelp.getKey(),acceptData.getSystem());
|
| | | data.put("couponHelpUrl", couponHelp);
|
| | | // 领券帮助链接,1.5.2后生效
|
| | | String couponHelp = configService.getValue(ConfigKeyEnum.taobaoCouponHelp.getKey(), acceptData.getSystem());
|
| | | data.put("couponHelpUrl", couponHelp);
|
| | |
|
| | | // 判断新老用户 显示热门功能按钮滑动
|
| | | UserActiveLog da = null;
|
| | | if (uid != null)
|
| | | da = userActiveLogService.getFirstActiveInfo(uid);
|
| | | // 新人
|
| | | if (da == null || (System.currentTimeMillis() - da.getCreateTime().getTime()) <= 1000 * 60 * 60 * 24 * 15L) {
|
| | | data.put("userTimeType", 0);
|
| | | } else {// 老人
|
| | | data.put("userTimeType", 1);
|
| | | }
|
| | | // 判断新老用户 显示热门功能按钮滑动
|
| | | UserActiveLog da = null;
|
| | | if (uid != null)
|
| | | da = userActiveLogService.getFirstActiveInfo(uid);
|
| | | // 新人
|
| | | if (da == null || (System.currentTimeMillis() - da.getCreateTime().getTime()) <= 1000 * 60 * 60 * 24 * 15L) {
|
| | | data.put("userTimeType", 0);
|
| | | } else {// 老人
|
| | | data.put("userTimeType", 1);
|
| | | }
|
| | |
|
| | | // 是否显示热门功能按钮
|
| | | data.put("hotFuctionLink",
|
| | | configService.getByVersion(ConfigKeyEnum.hotFunctionUrl.getKey(), platform, Integer.parseInt(version),acceptData.getSystem()));
|
| | | if (StringUtil.isNullOrEmpty(callback))
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | else
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | }
|
| | | // 是否显示热门功能按钮
|
| | | data.put("hotFuctionLink",
|
| | | configService.getByVersion(ConfigKeyEnum.hotFunctionUrl.getKey(), platform, Integer.parseInt(version), acceptData.getSystem()));
|
| | | if (StringUtil.isNullOrEmpty(callback))
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | else
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 消息中心弹框
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getMSGConfig", method = RequestMethod.POST)
|
| | | public void getMSGConfig(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | out.print(JsonUtil.loadFalseResult("推广红包相关功能已下线!"));
|
| | | }
|
| | | /**
|
| | | * 消息中心弹框
|
| | | *
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getMSGConfig", method = RequestMethod.POST)
|
| | | public void getMSGConfig(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | out.print(JsonUtil.loadFalseResult("推广红包相关功能已下线!"));
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "getTaoBaoCartConfig", method = RequestMethod.POST)
|
| | | public void getTaoBaoCartConfig(AcceptData acceptData, String position, Long uid, PrintWriter out) {
|
| | | if (uid == null || uid <= 0) {
|
| | | out.print(JsonUtil.loadFalseResult("用户尚未登录"));
|
| | | return;
|
| | | }
|
| | | @RequestMapping(value = "getTaoBaoCartConfig", method = RequestMethod.POST)
|
| | | public void getTaoBaoCartConfig(AcceptData acceptData, String position, Long uid, PrintWriter out) {
|
| | | if (uid == null || uid <= 0) {
|
| | | out.print(JsonUtil.loadFalseResult("用户尚未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | // 是否需要购物城转链
|
| | | boolean convert = "0".equalsIgnoreCase(configService.getValue(ConfigKeyEnum.showTaobaoCartConvert.getKey(),acceptData.getSystem())) ? false
|
| | | : true;
|
| | | // 是否需要购物城转链
|
| | | boolean convert = "0".equalsIgnoreCase(configService.getValue(ConfigKeyEnum.showTaobaoCartConvert.getKey(), acceptData.getSystem())) ? false
|
| | | : true;
|
| | |
|
| | | if (!"cart".equalsIgnoreCase(position) && !convert) {
|
| | | out.print(JsonUtil.loadFalseResult(""));
|
| | | return;
|
| | | }
|
| | | if (!"cart".equalsIgnoreCase(position) && !convert) {
|
| | | out.print(JsonUtil.loadFalseResult(""));
|
| | | return;
|
| | | }
|
| | |
|
| | | ClientTBPid clientTBPid = null;
|
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform())) {
|
| | | clientTBPid = tbPidService.getIOSDefault();
|
| | | } else {
|
| | | clientTBPid = tbPidService.getAndroidDefault();
|
| | | }
|
| | | ClientTBPid clientTBPid = null;
|
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform())) {
|
| | | clientTBPid = tbPidService.getIOSDefault();
|
| | | } else {
|
| | | clientTBPid = tbPidService.getAndroidDefault();
|
| | | }
|
| | |
|
| | | String cartJS = configService.getValue(ConfigKeyEnum.taobaoCartJS.getKey(),acceptData.getSystem());
|
| | | String cartUrl = configService.getValue(ConfigKeyEnum.taobaoCartLink.getKey(),acceptData.getSystem());
|
| | | if (!convert)// 不转链
|
| | | {
|
| | | cartUrl = "http://";
|
| | | cartJS = "-";
|
| | | }
|
| | | String js = null;
|
| | | String link = null;
|
| | | try {
|
| | | js = DESUtil.encode(cartJS, StringUtil.getBase64String("YeShiFANLI889*+"),
|
| | | StringUtil.getBase64String("*M#34f?,"));
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | String cartJS = configService.getValue(ConfigKeyEnum.taobaoCartJS.getKey(), acceptData.getSystem());
|
| | | String cartUrl = configService.getValue(ConfigKeyEnum.taobaoCartLink.getKey(), acceptData.getSystem());
|
| | | if (!convert)// 不转链
|
| | | {
|
| | | cartUrl = "http://";
|
| | | cartJS = "-";
|
| | | }
|
| | | String js = null;
|
| | | String link = null;
|
| | | try {
|
| | | js = DESUtil.encode(cartJS, StringUtil.getBase64String("YeShiFANLI889*+"),
|
| | | StringUtil.getBase64String("*M#34f?,"));
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | try {
|
| | | link = DESUtil.encode(cartUrl, StringUtil.getBase64String("YeShiFANLI889*+"),
|
| | | StringUtil.getBase64String("*M#34f?,"));
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("js", js);
|
| | | data.put("link", link);
|
| | | data.put("tbPidInfo", clientTBPid);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | try {
|
| | | link = DESUtil.encode(cartUrl, StringUtil.getBase64String("YeShiFANLI889*+"),
|
| | | StringUtil.getBase64String("*M#34f?,"));
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("js", js);
|
| | | data.put("link", link);
|
| | | data.put("tbPidInfo", clientTBPid);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "getWebConfig", method = RequestMethod.POST)
|
| | | public void getWebConfig(AcceptData acceptData, String url, PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | | @RequestMapping(value = "getWebConfig", method = RequestMethod.POST)
|
| | | public void getWebConfig(AcceptData acceptData, String url, PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | |
|
| | | if (url != null && url.contains("ifeeds.tmall.com/article.html?")) {
|
| | | if (VersionUtil.greaterThan_2_0(acceptData.getPlatform(), acceptData.getVersion()))
|
| | | data.put("baichuan", false);
|
| | | else
|
| | | data.put("baichuan", true);
|
| | | data.put("goodsDetail", false);
|
| | | } else if (url != null && (url.contains("s.click") || url.contains("taobao.com") || url.contains("tmall.com")
|
| | | || url.contains("m.tb.cn"))) {
|
| | | if (VersionUtil.greaterThan_2_0(acceptData.getPlatform(), acceptData.getVersion()))
|
| | | data.put("baichuan", false);
|
| | | else
|
| | | data.put("baichuan", true);
|
| | | data.put("goodsDetail", true);// 需要拦截商品详情
|
| | | } else if (url != null && (url.contains("jd.com"))) {
|
| | | // 不能包含详情页
|
| | | String skuId = JDUtil.parseJDSkuIdByUrl(url);
|
| | | if (StringUtil.isNullOrEmpty(skuId))// 不能拦截详情页面,防止前端进入死循环
|
| | | if (url.startsWith("https://union-click.jd.com/jdc?"))
|
| | | data.put("goodsDetail", false);
|
| | | else
|
| | | data.put("goodsDetail", true);
|
| | | else
|
| | | data.put("goodsDetail", false);
|
| | | if (url != null && url.contains("ifeeds.tmall.com/article.html?")) {
|
| | | if (VersionUtil.greaterThan_2_0(acceptData.getPlatform(), acceptData.getVersion()))
|
| | | data.put("baichuan", false);
|
| | | else
|
| | | data.put("baichuan", true);
|
| | | data.put("goodsDetail", false);
|
| | | } else if (url != null && (url.contains("s.click") || url.contains("taobao.com") || url.contains("tmall.com")
|
| | | || url.contains("m.tb.cn"))) {
|
| | | if (VersionUtil.greaterThan_2_0(acceptData.getPlatform(), acceptData.getVersion()))
|
| | | data.put("baichuan", false);
|
| | | else
|
| | | data.put("baichuan", true);
|
| | | data.put("goodsDetail", true);// 需要拦截商品详情
|
| | | } else if (url != null && (url.contains("jd.com"))) {
|
| | | // 不能包含详情页
|
| | | String skuId = JDUtil.parseJDSkuIdByUrl(url);
|
| | | if (StringUtil.isNullOrEmpty(skuId))// 不能拦截详情页面,防止前端进入死循环
|
| | | if (url.startsWith("https://union-click.jd.com/jdc?"))
|
| | | data.put("goodsDetail", false);
|
| | | else
|
| | | data.put("goodsDetail", true);
|
| | | else
|
| | | data.put("goodsDetail", false);
|
| | |
|
| | | data.put("baichuan", false);// 不需要采用阿里百川的方式加载webview
|
| | | data.put("baichuan", false);// 不需要采用阿里百川的方式加载webview
|
| | |
|
| | | } else if (url != null && (url.contains(".vip.com"))) {// 唯品会
|
| | | String goodsId = VipShopUtil.parseGoodsIdByUrl(url);
|
| | | if (StringUtil.isNullOrEmpty(goodsId))// 不能拦截详情页面,防止前端进入死循环
|
| | | data.put("goodsDetail", true);
|
| | | else
|
| | | data.put("goodsDetail", false);
|
| | | } else if (url != null && (url.contains(".suning.com"))) {// 苏宁
|
| | | String goodsId = SuningUtil.parseGoodsIdByUrl(url);
|
| | | if (StringUtil.isNullOrEmpty(goodsId))// 不能拦截详情页面,防止前端进入死循环
|
| | | data.put("goodsDetail", true);
|
| | | else
|
| | | data.put("goodsDetail", false);
|
| | | } else if (url != null && ((url.contains("yangkeduo.com") && !url.contains("yangkeduo.com/goods.html?")
|
| | | && !url.contains("yangkeduo.com/duo_coupon_landing.html?"))
|
| | | || (url.startsWith("https://p.pinduoduo.com/")))) {
|
| | | data.put("baichuan", false);// 不需要采用阿里百川的方式加载webview
|
| | | data.put("goodsDetail", true);// 不需要拦截商品详情
|
| | | } else {
|
| | | data.put("baichuan", false);// 不需要采用阿里百川的方式加载webview
|
| | | data.put("goodsDetail", false);// 不需要拦截商品详情
|
| | | }
|
| | | // TODO 前端需要处理
|
| | | // if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(),
|
| | | // acceptData.getVersion())) {
|
| | | // JSONObject js = new JSONObject();
|
| | | // String jsStr = configService.get("url_extract_id");
|
| | | // String md5 = StringUtil.Md5(jsStr);
|
| | | // js.put("md5", md5);
|
| | | // data.put("js", js);
|
| | | // }
|
| | | } else if (url != null && (url.contains(".vip.com"))) {// 唯品会
|
| | | String goodsId = VipShopUtil.parseGoodsIdByUrl(url);
|
| | | if (StringUtil.isNullOrEmpty(goodsId))// 不能拦截详情页面,防止前端进入死循环
|
| | | data.put("goodsDetail", true);
|
| | | else
|
| | | data.put("goodsDetail", false);
|
| | | } else if (url != null && (url.contains(".suning.com"))) {// 苏宁
|
| | | String goodsId = SuningUtil.parseGoodsIdByUrl(url);
|
| | | if (StringUtil.isNullOrEmpty(goodsId))// 不能拦截详情页面,防止前端进入死循环
|
| | | data.put("goodsDetail", true);
|
| | | else
|
| | | data.put("goodsDetail", false);
|
| | | } else if (url != null && ((url.contains("yangkeduo.com") && !url.contains("yangkeduo.com/goods.html?")
|
| | | && !url.contains("yangkeduo.com/duo_coupon_landing.html?"))
|
| | | || (url.startsWith("https://p.pinduoduo.com/")))) {
|
| | | data.put("baichuan", false);// 不需要采用阿里百川的方式加载webview
|
| | | data.put("goodsDetail", true);// 不需要拦截商品详情
|
| | | } else {
|
| | | data.put("baichuan", false);// 不需要采用阿里百川的方式加载webview
|
| | | data.put("goodsDetail", false);// 不需要拦截商品详情
|
| | | }
|
| | | // TODO 前端需要处理
|
| | | // if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(),
|
| | | // acceptData.getVersion())) {
|
| | | // JSONObject js = new JSONObject();
|
| | | // String jsStr = configService.get("url_extract_id");
|
| | | // String md5 = StringUtil.Md5(jsStr);
|
| | | // js.put("md5", md5);
|
| | | // data.put("js", js);
|
| | | // }
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "getWebJS", method = RequestMethod.POST)
|
| | | public void getWebJS(AcceptData acceptData, PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | | String urlIdJS = configService.getValue("url_extract_id",acceptData.getSystem());
|
| | | data.put("urlIdJSMD5", StringUtil.Md5(urlIdJS));
|
| | | data.put("urlIdJS", AESUtil.encrypt(urlIdJS, Constant.UIDAESKEY));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | @RequestMapping(value = "getWebJS", method = RequestMethod.POST)
|
| | | public void getWebJS(AcceptData acceptData, PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | | String urlIdJS = configService.getValue("url_extract_id", acceptData.getSystem());
|
| | | data.put("urlIdJSMD5", StringUtil.Md5(urlIdJS));
|
| | | data.put("urlIdJS", AESUtil.encrypt(urlIdJS, Constant.UIDAESKEY));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取账号绑定中的配置信息
|
| | | * |
| | | * @param acceptData
|
| | | * @param out
|
| | | */
|
| | | /**
|
| | | * 获取账号绑定中的配置信息
|
| | | *
|
| | | * @param acceptData
|
| | | * @param out
|
| | | */
|
| | |
|
| | | @RequestMapping(value = "getBindAccountConfig", method = RequestMethod.POST)
|
| | | public void getBindAccountConfig(AcceptData acceptData, PrintWriter out) {
|
| | | String alipayHelpUrl = configService.getValue(ConfigKeyEnum.alipayHelp.getKey(),acceptData.getSystem());// 支付宝帮助
|
| | | String alipayBindFailUrl = configService.getValue(ConfigKeyEnum.alipayBindFailReason.getKey(),acceptData.getSystem());// 支付宝绑定失败原因
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("alipayHelp", alipayHelpUrl);
|
| | | data.put("alipayBindFailReason", alipayBindFailUrl);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | @RequestMapping(value = "getBindAccountConfig", method = RequestMethod.POST)
|
| | | public void getBindAccountConfig(AcceptData acceptData, PrintWriter out) {
|
| | | String alipayHelpUrl = configService.getValue(ConfigKeyEnum.alipayHelp.getKey(), acceptData.getSystem());// 支付宝帮助
|
| | | String alipayBindFailUrl = configService.getValue(ConfigKeyEnum.alipayBindFailReason.getKey(), acceptData.getSystem());// 支付宝绑定失败原因
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("alipayHelp", alipayHelpUrl);
|
| | | data.put("alipayBindFailReason", alipayBindFailUrl);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取订单配置
|
| | | * |
| | | * @param acceptData
|
| | | * @param out
|
| | | */
|
| | | /**
|
| | | * 获取订单配置
|
| | | *
|
| | | * @param acceptData
|
| | | * @param out
|
| | | */
|
| | |
|
| | | @RequestMapping(value = "getOrderConfig", method = RequestMethod.POST)
|
| | | public void getOrderConfig(AcceptData acceptData, PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | | // 测试
|
| | | data.put("showTaoBaoOrder",
|
| | | "0".equalsIgnoreCase(configService.getValue(ConfigKeyEnum.showTaobaoOrder.getKey(),acceptData.getSystem()).trim()) ? false : true);
|
| | | data.put("taoBaoOrderUrl", "https://main.m.taobao.com/olist/index.html");
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | @RequestMapping(value = "getOrderConfig", method = RequestMethod.POST)
|
| | | public void getOrderConfig(AcceptData acceptData, PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | | // 测试
|
| | | data.put("showTaoBaoOrder",
|
| | | "0".equalsIgnoreCase(configService.getValue(ConfigKeyEnum.showTaobaoOrder.getKey(), acceptData.getSystem()).trim()) ? false : true);
|
| | | data.put("taoBaoOrderUrl", "https://main.m.taobao.com/olist/index.html");
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "getKeFuConfig", method = RequestMethod.POST)
|
| | | public void getKeFuConfig(AcceptData acceptData, PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("meiqia", "1".equalsIgnoreCase(configService.getValue(ConfigKeyEnum.kefuMeiqia.getKey(),acceptData.getSystem())) ? true : false);// 是否跳转美洽,不跳转美洽就用原来的
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | // 设置消息已读
|
| | | ThreadUtil.run(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | msgDeviceReadStateService.setDeviceMsgRead(MsgDeviceReadState.TYPE_KEFU, acceptData.getDevice(),
|
| | | "android".equalsIgnoreCase(acceptData.getPlatform()) ? 1 : 2);
|
| | | }
|
| | | });
|
| | | }
|
| | | @RequestMapping(value = "getKeFuConfig", method = RequestMethod.POST)
|
| | | public void getKeFuConfig(AcceptData acceptData, PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("meiqia", "1".equalsIgnoreCase(configService.getValue(ConfigKeyEnum.kefuMeiqia.getKey(), acceptData.getSystem())) ? true : false);// 是否跳转美洽,不跳转美洽就用原来的
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | // 设置消息已读
|
| | | ThreadUtil.run(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | msgDeviceReadStateService.setDeviceMsgRead(MsgDeviceReadState.TYPE_KEFU, acceptData.getDevice(),
|
| | | "android".equalsIgnoreCase(acceptData.getPlatform()) ? 1 : 2);
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取邀请码帮助链接
|
| | | * |
| | | * @param acceptData
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getInviteCodeInputHelp", method = RequestMethod.POST)
|
| | | public void getInviteCodeInputHelp(AcceptData acceptData, PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("helpUrl", configService.getValue(ConfigKeyEnum.inviteCodeInputHelp.getKey(),acceptData.getSystem()));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | /**
|
| | | * 获取邀请码帮助链接
|
| | | *
|
| | | * @param acceptData
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getInviteCodeInputHelp", method = RequestMethod.POST)
|
| | | public void getInviteCodeInputHelp(AcceptData acceptData, PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("helpUrl", configService.getValue(ConfigKeyEnum.inviteCodeInputHelp.getKey(), acceptData.getSystem()));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取饿了么的推广链接
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getElemeLink")
|
| | | public void getElemeLink(AcceptData acceptData, Long uid, String callback, PrintWriter out) {
|
| | | /**
|
| | | * 获取饿了么的推广链接
|
| | | *
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getElemeLink")
|
| | | public void getElemeLink(AcceptData acceptData, Long uid, String callback, PrintWriter out) {
|
| | |
|
| | | UserExtraTaoBaoInfo userInfoExtra = userExtraTaoBaoInfoService.getByUid(uid);
|
| | | if (userInfoExtra == null || StringUtil.isNullOrEmpty(userInfoExtra.getRelationId())) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult(1001, "请绑定淘宝")));
|
| | | return;
|
| | | }
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.elmeLink, uid + "");
|
| | | String elmeLink = redisManager.getCommonString(key);
|
| | | if (StringUtil.isNullOrEmpty(elmeLink)) {
|
| | | TaoKeOfficialActivityConvertResultDTO dto = TaoKeApiUtil.officialActivityConvert(
|
| | | TaoBaoConstant.TAOBAO_ELEME_PID.split("_")[3], "1571715733668", userInfoExtra.getRelationId());
|
| | | if (dto != null)
|
| | | elmeLink = dto.getShort_click_url();
|
| | | if (!StringUtil.isNullOrEmpty(elmeLink)) {
|
| | | redisManager.cacheCommonString(key, elmeLink, 60 * 60);// 缓存1个小时
|
| | | }
|
| | | }
|
| | | UserExtraTaoBaoInfo userInfoExtra = userExtraTaoBaoInfoService.getByUid(uid);
|
| | | if (userInfoExtra == null || StringUtil.isNullOrEmpty(userInfoExtra.getRelationId())) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult(1001, "请绑定淘宝")));
|
| | | return;
|
| | | }
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.elmeLink, uid + "");
|
| | | String elmeLink = redisManager.getCommonString(key);
|
| | | if (StringUtil.isNullOrEmpty(elmeLink)) {
|
| | | TaoKeOfficialActivityConvertResultDTO dto = TaoKeApiUtil.officialActivityConvert(
|
| | | TaoBaoConstant.TAOBAO_ELEME_PID.split("_")[3], "1571715733668", userInfoExtra.getRelationId());
|
| | | if (dto != null)
|
| | | elmeLink = dto.getShort_click_url();
|
| | | if (!StringUtil.isNullOrEmpty(elmeLink)) {
|
| | | redisManager.cacheCommonString(key, elmeLink, 60 * 60);// 缓存1个小时
|
| | | }
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | JSONObject data = new JSONObject();
|
| | |
|
| | | // data.put("hongBao",
|
| | | // configService.get("eleme_hongbao_link").replace("{用户ID}", uid + ""));
|
| | | // data.put("goods",
|
| | | // configService.get("eleme_goods_link").replace("{用户ID}", uid + ""));
|
| | | // data.put("hongBao",
|
| | | // configService.get("eleme_hongbao_link").replace("{用户ID}", uid + ""));
|
| | | // data.put("goods",
|
| | | // configService.get("eleme_goods_link").replace("{用户ID}", uid + ""));
|
| | |
|
| | | data.put("hongBao", elmeLink);
|
| | | data.put("goods", elmeLink);
|
| | | data.put("hongBao", elmeLink);
|
| | | data.put("goods", elmeLink);
|
| | |
|
| | | ClientTBPid clientTBPid1 = new ClientTBPid(TaoBaoConstant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_ELEME_PID,
|
| | | null, TaoBaoConstant.TAOBAO_ELEME_PID.split("_")[3]);
|
| | | data.put("taoKeParams", clientTBPid1);
|
| | | if (StringUtil.isNullOrEmpty(callback))
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | else
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | }
|
| | | ClientTBPid clientTBPid1 = new ClientTBPid(TaoBaoConstant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_ELEME_PID,
|
| | | null, TaoBaoConstant.TAOBAO_ELEME_PID.split("_")[3]);
|
| | | data.put("taoKeParams", clientTBPid1);
|
| | | if (StringUtil.isNullOrEmpty(callback))
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | else
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | }
|
| | |
|
| | | /**
|
| | | * |
| | | * @Title: getElemeLinkNew
|
| | | * @Description: |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param activityId 活动ID
|
| | | * @param share -是否为分享
|
| | | * @param callback |
| | | * @param out |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | | @RequestMapping(value = "getElemeLinkNew")
|
| | | public void getElemeLinkNew(AcceptData acceptData, Long uid, String activityId, boolean share, boolean shareImg,
|
| | | String callback, PrintWriter out) {
|
| | | /**
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param activityId 活动ID
|
| | | * @param share -是否为分享
|
| | | * @param callback
|
| | | * @param out void 返回类型
|
| | | * @throws
|
| | | * @Title: getElemeLinkNew
|
| | | * @Description:
|
| | | */
|
| | | @RequestMapping(value = "getElemeLinkNew")
|
| | | public void getElemeLinkNew(AcceptData acceptData, Long uid, String activityId, boolean share, boolean shareImg,
|
| | | String callback, PrintWriter out) {
|
| | |
|
| | | UserExtraTaoBaoInfo userInfoExtra = userExtraTaoBaoInfoService.getByUid(uid);
|
| | | if (userInfoExtra == null || StringUtil.isNullOrEmpty(userInfoExtra.getRelationId())) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult(1001, "请绑定淘宝")));
|
| | | return;
|
| | | }
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.elmeLink, uid + "-" + activityId + "-" + share);
|
| | | String elmeResult = redisManager.getCommonString(key);
|
| | | JSONObject data = new JSONObject();
|
| | | TaoKeOfficialActivityConvertResultDTO dto = null;
|
| | | if (StringUtil.isNullOrEmpty(elmeResult)) {
|
| | | if (share) {
|
| | | dto = TaoKeApiUtil.officialActivityConvert(TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT.split("_")[3],
|
| | | activityId, userInfoExtra.getRelationId());
|
| | | } else {
|
| | | dto = TaoKeApiUtil.officialActivityConvert(TaoBaoConstant.TAOBAO_ELEME_PID.split("_")[3], activityId,
|
| | | userInfoExtra.getRelationId());
|
| | | }
|
| | | UserExtraTaoBaoInfo userInfoExtra = userExtraTaoBaoInfoService.getByUid(uid);
|
| | | if (userInfoExtra == null || StringUtil.isNullOrEmpty(userInfoExtra.getRelationId())) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult(1001, "请绑定淘宝")));
|
| | | return;
|
| | | }
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.elmeLink, uid + "-" + activityId + "-" + share);
|
| | | String elmeResult = redisManager.getCommonString(key);
|
| | | JSONObject data = new JSONObject();
|
| | | TaoKeOfficialActivityConvertResultDTO dto = null;
|
| | | if (StringUtil.isNullOrEmpty(elmeResult)) {
|
| | | if (share) {
|
| | | dto = TaoKeApiUtil.officialActivityConvert(TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT.split("_")[3],
|
| | | activityId, userInfoExtra.getRelationId());
|
| | | } else {
|
| | | dto = TaoKeApiUtil.officialActivityConvert(TaoBaoConstant.TAOBAO_ELEME_PID.split("_")[3], activityId,
|
| | | userInfoExtra.getRelationId());
|
| | | }
|
| | |
|
| | | if (dto != null) {
|
| | | if (share) {// 生成口令
|
| | | String token = TaoKeApiUtil.getTKToken("http://", "饿了么", dto.getShort_click_url());
|
| | | dto.setToken(TaoBaoUtil.filterTaoToken(token));
|
| | | }
|
| | | redisManager.cacheCommonString(key, JsonUtil.getSimpleGson().toJson(dto), 60 * 60);// 缓存1个小时
|
| | | }
|
| | | } else {
|
| | | dto = JsonUtil.getSimpleGson().fromJson(elmeResult, TaoKeOfficialActivityConvertResultDTO.class);
|
| | | if (dto != null) {
|
| | | if (share) {// 生成口令
|
| | | String token = TaoKeApiUtil.getTKToken("http://", "饿了么", dto.getShort_click_url());
|
| | | dto.setToken(TaoBaoUtil.filterTaoToken(token));
|
| | | }
|
| | | redisManager.cacheCommonString(key, JsonUtil.getSimpleGson().toJson(dto), 60 * 60);// 缓存1个小时
|
| | | }
|
| | | } else {
|
| | | dto = JsonUtil.getSimpleGson().fromJson(elmeResult, TaoKeOfficialActivityConvertResultDTO.class);
|
| | |
|
| | | if (share && StringUtil.isNullOrEmpty(dto.getToken())) {
|
| | | // 保存口令
|
| | | String token = TaoKeApiUtil.getTKToken("http://", "饿了么", dto.getShort_click_url());
|
| | | dto.setToken(TaoBaoUtil.filterTaoToken(token));
|
| | | redisManager.cacheCommonString(key, JsonUtil.getSimpleGson().toJson(dto), 60 * 60);// 缓存1个小时
|
| | | }
|
| | | if (share && StringUtil.isNullOrEmpty(dto.getToken())) {
|
| | | // 保存口令
|
| | | String token = TaoKeApiUtil.getTKToken("http://", "饿了么", dto.getShort_click_url());
|
| | | dto.setToken(TaoBaoUtil.filterTaoToken(token));
|
| | | redisManager.cacheCommonString(key, JsonUtil.getSimpleGson().toJson(dto), 60 * 60);// 缓存1个小时
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | ElemeConvertInfoResultVO info = new ElemeConvertInfoResultVO(null, dto.getToken(), dto.getShort_click_url());
|
| | | if (share && shareImg) {
|
| | | InputStream elmeShareImg = ImageUtil.drawSimpleImage(
|
| | | this.getClass().getClassLoader().getResourceAsStream("image/elme_bg.png"), 1080, 1646,
|
| | | HttpUtil.getAsInputStream(dto.getWx_qrcode_url()), 500, 500, 295, 908);
|
| | | ElemeConvertInfoResultVO info = new ElemeConvertInfoResultVO(null, dto.getToken(), dto.getShort_click_url());
|
| | | if (share && shareImg) {
|
| | | InputStream elmeShareImg = ImageUtil.drawSimpleImage(
|
| | | this.getClass().getClassLoader().getResourceAsStream("image/elme_bg.png"), 1080, 1646,
|
| | | HttpUtil.getAsInputStream(dto.getWx_qrcode_url()), 500, 500, 295, 908);
|
| | |
|
| | | if (elmeShareImg != null) {
|
| | | String filePath = FilePathEnum.elmeShare.getPath() + "-" + uid + "-"
|
| | | + UUID.randomUUID().toString().replace("-", "") + ".png";
|
| | | FileUploadResult uploadResult = COSManager.getInstance().uploadFile(elmeShareImg, filePath);
|
| | | if (uploadResult != null)
|
| | | info.setQrCodeImg(uploadResult.getUrl());
|
| | | }
|
| | | if (elmeShareImg != null) {
|
| | | String filePath = FilePathEnum.elmeShare.getPath() + "-" + uid + "-"
|
| | | + UUID.randomUUID().toString().replace("-", "") + ".png";
|
| | | FileUploadResult uploadResult = COSManager.getInstance().uploadFile(elmeShareImg, filePath);
|
| | | if (uploadResult != null)
|
| | | info.setQrCodeImg(uploadResult.getUrl());
|
| | | }
|
| | |
|
| | | if (info.getQrCodeImg() == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("分享图生成失败"));
|
| | | return;
|
| | | }
|
| | | if (info.getQrCodeImg() == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("分享图生成失败"));
|
| | | return;
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | data.put("info", info);
|
| | | data.put("info", info);
|
| | |
|
| | | ClientTBPid clientTBPid1 = new ClientTBPid(TaoBaoConstant.TAOBAO_AUTH_APPKEY,
|
| | | share ? TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT : TaoBaoConstant.TAOBAO_ELEME_PID, null,
|
| | | TaoBaoConstant.TAOBAO_ELEME_PID.split("_")[3]);
|
| | | clientTBPid1.setAdZoneId(clientTBPid1.getPid().split("_")[3]);
|
| | | data.put("taoKeParams", clientTBPid1);
|
| | | if (StringUtil.isNullOrEmpty(callback))
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | else
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | }
|
| | | ClientTBPid clientTBPid1 = new ClientTBPid(TaoBaoConstant.TAOBAO_AUTH_APPKEY,
|
| | | share ? TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT : TaoBaoConstant.TAOBAO_ELEME_PID, null,
|
| | | TaoBaoConstant.TAOBAO_ELEME_PID.split("_")[3]);
|
| | | clientTBPid1.setAdZoneId(clientTBPid1.getPid().split("_")[3]);
|
| | | data.put("taoKeParams", clientTBPid1);
|
| | | if (StringUtil.isNullOrEmpty(callback))
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | else
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "getKouBeiLink")
|
| | | public void getKouBeiLink(AcceptData acceptData, Long uid, String activityId, boolean share, boolean shareImg,
|
| | | String callback, PrintWriter out) {
|
| | | @RequestMapping(value = "getKouBeiLink")
|
| | | public void getKouBeiLink(AcceptData acceptData, Long uid, String activityId, boolean share, boolean shareImg,
|
| | | String callback, PrintWriter out) {
|
| | |
|
| | | UserExtraTaoBaoInfo userInfoExtra = userExtraTaoBaoInfoService.getByUid(uid);
|
| | | if (userInfoExtra == null || StringUtil.isNullOrEmpty(userInfoExtra.getRelationId())) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult(1001, "请绑定淘宝")));
|
| | | return;
|
| | | }
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.kouBeiLink, uid + "-" + activityId + "-" + share);
|
| | | String elmeResult = redisManager.getCommonString(key);
|
| | | JSONObject data = new JSONObject();
|
| | | TaoKeOfficialActivityConvertResultDTO dto = null;
|
| | | if (StringUtil.isNullOrEmpty(elmeResult)) {
|
| | | if (share) {
|
| | | dto = TaoKeApiUtil.officialActivityConvert(TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT.split("_")[3],
|
| | | activityId, userInfoExtra.getRelationId());
|
| | | } else {
|
| | | dto = TaoKeApiUtil.officialActivityConvert(TaoBaoConstant.TAOBAO_KOUBEI_PID.split("_")[3], activityId,
|
| | | userInfoExtra.getRelationId());
|
| | | }
|
| | | UserExtraTaoBaoInfo userInfoExtra = userExtraTaoBaoInfoService.getByUid(uid);
|
| | | if (userInfoExtra == null || StringUtil.isNullOrEmpty(userInfoExtra.getRelationId())) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult(1001, "请绑定淘宝")));
|
| | | return;
|
| | | }
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.kouBeiLink, uid + "-" + activityId + "-" + share);
|
| | | String elmeResult = redisManager.getCommonString(key);
|
| | | JSONObject data = new JSONObject();
|
| | | TaoKeOfficialActivityConvertResultDTO dto = null;
|
| | | if (StringUtil.isNullOrEmpty(elmeResult)) {
|
| | | if (share) {
|
| | | dto = TaoKeApiUtil.officialActivityConvert(TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT.split("_")[3],
|
| | | activityId, userInfoExtra.getRelationId());
|
| | | } else {
|
| | | dto = TaoKeApiUtil.officialActivityConvert(TaoBaoConstant.TAOBAO_KOUBEI_PID.split("_")[3], activityId,
|
| | | userInfoExtra.getRelationId());
|
| | | }
|
| | |
|
| | | if (dto != null) {
|
| | | if (share) {// 生成口令
|
| | | String token = TaoKeApiUtil.getTKToken("http://", "口碑", dto.getClick_url());
|
| | | dto.setToken(TaoBaoUtil.filterTaoToken(token));
|
| | | }
|
| | | redisManager.cacheCommonString(key, JsonUtil.getSimpleGson().toJson(dto), 60 * 60);// 缓存1个小时
|
| | | }
|
| | | } else {
|
| | | dto = JsonUtil.getSimpleGson().fromJson(elmeResult, TaoKeOfficialActivityConvertResultDTO.class);
|
| | | if (dto != null) {
|
| | | if (share) {// 生成口令
|
| | | String token = TaoKeApiUtil.getTKToken("http://", "口碑", dto.getClick_url());
|
| | | dto.setToken(TaoBaoUtil.filterTaoToken(token));
|
| | | }
|
| | | redisManager.cacheCommonString(key, JsonUtil.getSimpleGson().toJson(dto), 60 * 60);// 缓存1个小时
|
| | | }
|
| | | } else {
|
| | | dto = JsonUtil.getSimpleGson().fromJson(elmeResult, TaoKeOfficialActivityConvertResultDTO.class);
|
| | |
|
| | | if (share && StringUtil.isNullOrEmpty(dto.getToken())) {
|
| | | // 保存口令
|
| | | String token = TaoKeApiUtil.getTKToken("http://", "口碑", dto.getClick_url());
|
| | | dto.setToken(TaoBaoUtil.filterTaoToken(token));
|
| | | redisManager.cacheCommonString(key, JsonUtil.getSimpleGson().toJson(dto), 60 * 60);// 缓存1个小时
|
| | | }
|
| | | if (share && StringUtil.isNullOrEmpty(dto.getToken())) {
|
| | | // 保存口令
|
| | | String token = TaoKeApiUtil.getTKToken("http://", "口碑", dto.getClick_url());
|
| | | dto.setToken(TaoBaoUtil.filterTaoToken(token));
|
| | | redisManager.cacheCommonString(key, JsonUtil.getSimpleGson().toJson(dto), 60 * 60);// 缓存1个小时
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | ElemeConvertInfoResultVO info = new ElemeConvertInfoResultVO(null, dto.getToken(), dto.getClick_url());
|
| | | if (share && shareImg) {
|
| | | InputStream elmeShareImg = ImageUtil.drawSimpleImage(
|
| | | this.getClass().getClassLoader().getResourceAsStream("image/elme_bg.png"), 1080, 1646,
|
| | | HttpUtil.getAsInputStream(dto.getWx_qrcode_url()), 500, 500, 295, 908);
|
| | | ElemeConvertInfoResultVO info = new ElemeConvertInfoResultVO(null, dto.getToken(), dto.getClick_url());
|
| | | if (share && shareImg) {
|
| | | InputStream elmeShareImg = ImageUtil.drawSimpleImage(
|
| | | this.getClass().getClassLoader().getResourceAsStream("image/elme_bg.png"), 1080, 1646,
|
| | | HttpUtil.getAsInputStream(dto.getWx_qrcode_url()), 500, 500, 295, 908);
|
| | |
|
| | | if (elmeShareImg != null) {
|
| | | String filePath = FilePathEnum.elmeShare.getPath() + "-" + uid + "-"
|
| | | + UUID.randomUUID().toString().replace("-", "") + ".png";
|
| | | FileUploadResult uploadResult = COSManager.getInstance().uploadFile(elmeShareImg, filePath);
|
| | | if (uploadResult != null)
|
| | | info.setQrCodeImg(uploadResult.getUrl());
|
| | | }
|
| | | if (elmeShareImg != null) {
|
| | | String filePath = FilePathEnum.elmeShare.getPath() + "-" + uid + "-"
|
| | | + UUID.randomUUID().toString().replace("-", "") + ".png";
|
| | | FileUploadResult uploadResult = COSManager.getInstance().uploadFile(elmeShareImg, filePath);
|
| | | if (uploadResult != null)
|
| | | info.setQrCodeImg(uploadResult.getUrl());
|
| | | }
|
| | |
|
| | | if (info.getQrCodeImg() == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("分享图生成失败"));
|
| | | return;
|
| | | }
|
| | | if (info.getQrCodeImg() == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("分享图生成失败"));
|
| | | return;
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | data.put("info", info);
|
| | | data.put("info", info);
|
| | |
|
| | | ClientTBPid clientTBPid1 = new ClientTBPid(TaoBaoConstant.TAOBAO_AUTH_APPKEY,
|
| | | share ? TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT : TaoBaoConstant.TAOBAO_KOUBEI_PID, null,
|
| | | TaoBaoConstant.TAOBAO_KOUBEI_PID.split("_")[3]);
|
| | | clientTBPid1.setAdZoneId(clientTBPid1.getPid().split("_")[3]);
|
| | | data.put("taoKeParams", clientTBPid1);
|
| | | if (StringUtil.isNullOrEmpty(callback))
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | else
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | }
|
| | | ClientTBPid clientTBPid1 = new ClientTBPid(TaoBaoConstant.TAOBAO_AUTH_APPKEY,
|
| | | share ? TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT : TaoBaoConstant.TAOBAO_KOUBEI_PID, null,
|
| | | TaoBaoConstant.TAOBAO_KOUBEI_PID.split("_")[3]);
|
| | | clientTBPid1.setAdZoneId(clientTBPid1.getPid().split("_")[3]);
|
| | | data.put("taoKeParams", clientTBPid1);
|
| | | if (StringUtil.isNullOrEmpty(callback))
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | else
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取饿了么的推广链接
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "userProtocolListen")
|
| | | public void userProtocolListen(AcceptData acceptData, Long uid, int type, PrintWriter out) {
|
| | | LogHelper.userProtocolListen(String.format("%s#%s#%s", acceptData.getDevice(), uid, type));
|
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | | }
|
| | | /**
|
| | | * 获取饿了么的推广链接
|
| | | *
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "userProtocolListen")
|
| | | public void userProtocolListen(AcceptData acceptData, Long uid, int type, PrintWriter out) {
|
| | | LogHelper.userProtocolListen(String.format("%s#%s#%s", acceptData.getDevice(), uid, type));
|
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 是否显示广告
|
| | | * @Title: showAd
|
| | | * @Description: |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | | @RequestMapping(value = "getShowAd")
|
| | | public void showAd(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | String value = configService.getValue(ConfigKeyEnum.showSplashAd.getKey(),acceptData.getSystem());
|
| | | boolean huaweiShowAd = true;
|
| | | if ("huawei".equalsIgnoreCase(acceptData.getChannel())) {
|
| | | String version = configService.getValue(ConfigKeyEnum.huaweiOnLineVersionCode.getKey(),acceptData.getSystem());
|
| | | if (!StringUtil.isNullOrEmpty(version)) {
|
| | | if (Integer.parseInt(version) == Integer.parseInt(acceptData.getVersion())) {
|
| | | huaweiShowAd = false;
|
| | | }
|
| | | }
|
| | | }
|
| | | /**
|
| | | * 是否显示广告
|
| | | *
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out void 返回类型
|
| | | * @throws
|
| | | * @Title: showAd
|
| | | * @Description:
|
| | | */
|
| | | @RequestMapping(value = "getShowAd")
|
| | | public void showAd(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | String value = configService.getValue(ConfigKeyEnum.showSplashAd.getKey(), acceptData.getSystem());
|
| | | boolean huaweiShowAd = true;
|
| | | if ("huawei".equalsIgnoreCase(acceptData.getChannel())) {
|
| | | String version = configService.getValue(ConfigKeyEnum.huaweiOnLineVersionCode.getKey(), acceptData.getSystem());
|
| | | if (!StringUtil.isNullOrEmpty(version)) {
|
| | | if (Integer.parseInt(version) == Integer.parseInt(acceptData.getVersion())) {
|
| | | huaweiShowAd = false;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | if ("0".equalsIgnoreCase(value.trim())) {
|
| | | data.put("show", false);
|
| | | } else {
|
| | | if (huaweiShowAd)
|
| | | data.put("show", true);
|
| | | else
|
| | | data.put("show", false);
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | JSONObject data = new JSONObject();
|
| | | if ("0".equalsIgnoreCase(value.trim())) {
|
| | | data.put("show", false);
|
| | | } else {
|
| | | if (huaweiShowAd) {
|
| | | data.put("show", true);
|
| | | //加载广告数据
|
| | | data.put("ad", configService.getValue(ConfigKeyEnum.gdtAdInfo, acceptData.getSystem()));
|
| | | } else
|
| | | data.put("show", false);
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取注销协议
|
| | | * @param acceptData
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getLogoutProtocol")
|
| | | public void getLogoutProtocol(String callback, AcceptData acceptData, PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("link", configService.getValue(ConfigKeyEnum.accountLogoutProtocolLink.getKey(),acceptData.getSystem()));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | /**
|
| | | * 获取注销协议
|
| | | *
|
| | | * @param acceptData
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getLogoutProtocol")
|
| | | public void getLogoutProtocol(String callback, AcceptData acceptData, PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("link", configService.getValue(ConfigKeyEnum.accountLogoutProtocolLink.getKey(), acceptData.getSystem()));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | }
|
| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.entity.SystemFunction; |
| | | import com.yeshi.fanli.exception.taobao.TaoBaoConvertLinkException; |
| | | import com.yeshi.fanli.service.manger.goods.TaoBaoLinkManager; |
| | | import com.yeshi.fanli.util.*; |
| | |
| | | |
| | | /** |
| | | * 动态 |
| | | * |
| | | * @author Administrator |
| | | * |
| | | * @author Administrator |
| | | */ |
| | | @Controller |
| | | @RequestMapping("api/v2/dynamic") |
| | | public class DynamicControllerV2 { |
| | | |
| | | @Resource |
| | | private TaoBaoLinkManager taoBaoLinkManager; |
| | | @Resource |
| | | private TaoBaoLinkManager taoBaoLinkManager; |
| | | |
| | | @Resource |
| | | private JumpDetailV2Service jumpDetailV2Service; |
| | | @Resource |
| | | private JumpDetailV2Service jumpDetailV2Service; |
| | | |
| | | @Resource |
| | | private DynamicInfoService dynamicInfoService; |
| | | @Resource |
| | | private DynamicInfoService dynamicInfoService; |
| | | |
| | | @Resource |
| | | private SpecialService specialService; |
| | | @Resource |
| | | private SpecialService specialService; |
| | | |
| | | @Resource |
| | | private ArticleOfficialService articleOfficialService; |
| | | @Resource |
| | | private ArticleOfficialService articleOfficialService; |
| | | |
| | | @Resource |
| | | private SwiperPictureService swiperPictureService; |
| | | @Resource |
| | | private SwiperPictureService swiperPictureService; |
| | | |
| | | @Resource |
| | | private ConfigService configService; |
| | | @Resource |
| | | private ConfigService configService; |
| | | |
| | | @Resource |
| | | private GoodsEvaluateService goodsEvaluateService; |
| | | @Resource |
| | | private GoodsEvaluateService goodsEvaluateService; |
| | | |
| | | @Resource |
| | | private UserInfoService userInfoService; |
| | | @Resource |
| | | private UserInfoExtraService userInfoExtraService; |
| | | @Resource |
| | | private UserInfoService userInfoService; |
| | | @Resource |
| | | private UserInfoExtraService userInfoExtraService; |
| | | |
| | | @Resource |
| | | private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService; |
| | | @Resource |
| | | private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService; |
| | | |
| | | @Resource |
| | | private JDGoodsCacheUtil jdGoodsCacheUtil; |
| | | @Resource |
| | | private JDGoodsCacheUtil jdGoodsCacheUtil; |
| | | |
| | | @Resource |
| | | private QrCodeService qrCodeService; |
| | | @Resource |
| | | private QrCodeService qrCodeService; |
| | | |
| | | @Resource |
| | | private ConvertLinkManager convertLinkManager; |
| | | @Resource |
| | | private ConvertLinkManager convertLinkManager; |
| | | |
| | | @Resource |
| | | private ShareGoodsService shareGoodsService; |
| | | @Resource |
| | | private ShareGoodsService shareGoodsService; |
| | | |
| | | @Resource |
| | | private DailyCountMomentsService dailyCountMomentsService; |
| | | @Resource |
| | | private DailyCountMomentsService dailyCountMomentsService; |
| | | |
| | | @Resource |
| | | private CommonShareInfoService commonShareInfoService; |
| | | @Resource |
| | | private CommonShareInfoService commonShareInfoService; |
| | | |
| | | @Resource |
| | | private UserCloudService userCloudService; |
| | | @Resource |
| | | private UserCloudService userCloudService; |
| | | |
| | | @Resource(name = "taskExecutor") |
| | | private TaskExecutor executor; |
| | | @Resource(name = "taskExecutor") |
| | | private TaskExecutor executor; |
| | | |
| | | private final static long TYPE_REXIAO = 1;// 热销 |
| | | private final static long TYPE_TUIJIAN = 2;// 推荐 |
| | | private final static long TYPE_HAODIAN = 3;// 好店 |
| | | private final static long TYPE_YAOQING = 4;// 邀请 |
| | | private final static long TYPE_HUODONG = 5;// 活动 |
| | | private final static long TYPE_XUEYUAN = 6;// 学院 |
| | | private final static long TYPE_FAQUAN = 7;// 发圈 |
| | | private final static long TYPE_SUCAI = 8;// 素材 |
| | | private final static long TYPE_REXIAO = 1;// 热销 |
| | | private final static long TYPE_TUIJIAN = 2;// 推荐 |
| | | private final static long TYPE_HAODIAN = 3;// 好店 |
| | | private final static long TYPE_YAOQING = 4;// 邀请 |
| | | private final static long TYPE_HUODONG = 5;// 活动 |
| | | private final static long TYPE_XUEYUAN = 6;// 学院 |
| | | private final static long TYPE_FAQUAN = 7;// 发圈 |
| | | private final static long TYPE_SUCAI = 8;// 素材 |
| | | |
| | | private static Map<Long, GoodsClass> classMap = null; |
| | | private static Map<Long, GoodsClass> classMap = null; |
| | | |
| | | private Map<Long, GoodsClass> getAllDynamicClass() { |
| | | if (classMap != null && classMap.size() > 0) |
| | | return classMap; |
| | | classMap = new HashMap<Long, GoodsClass>(); |
| | | List<GoodsClass> listSub = new ArrayList<GoodsClass>(); |
| | | listSub.add(new GoodsClass(0L, "今日单品")); |
| | | listSub.addAll(DaTaoKeUtil.goodsClasses); |
| | | private Map<Long, GoodsClass> getAllDynamicClass() { |
| | | if (classMap != null && classMap.size() > 0) |
| | | return classMap; |
| | | classMap = new HashMap<Long, GoodsClass>(); |
| | | List<GoodsClass> listSub = new ArrayList<GoodsClass>(); |
| | | listSub.add(new GoodsClass(0L, "今日单品")); |
| | | listSub.addAll(DaTaoKeUtil.goodsClasses); |
| | | |
| | | GoodsClass menu = new GoodsClass(TYPE_REXIAO, "热销"); |
| | | menu.setListSub(listSub); |
| | | classMap.put(TYPE_REXIAO, menu); |
| | | GoodsClass menu = new GoodsClass(TYPE_REXIAO, "热销"); |
| | | menu.setListSub(listSub); |
| | | classMap.put(TYPE_REXIAO, menu); |
| | | |
| | | menu = new GoodsClass(TYPE_TUIJIAN, "推荐"); |
| | | menu.setListSub(new ArrayList<GoodsClass>()); |
| | | classMap.put(TYPE_TUIJIAN, menu); |
| | | menu = new GoodsClass(TYPE_TUIJIAN, "推荐"); |
| | | menu.setListSub(new ArrayList<GoodsClass>()); |
| | | classMap.put(TYPE_TUIJIAN, menu); |
| | | |
| | | menu = new GoodsClass(TYPE_HAODIAN, "好店"); |
| | | menu.setListSub(new ArrayList<GoodsClass>()); |
| | | classMap.put(TYPE_HAODIAN, menu); |
| | | menu = new GoodsClass(TYPE_HAODIAN, "好店"); |
| | | menu.setListSub(new ArrayList<GoodsClass>()); |
| | | classMap.put(TYPE_HAODIAN, menu); |
| | | |
| | | menu = new GoodsClass(TYPE_YAOQING, "邀请"); |
| | | menu.setListSub(new ArrayList<GoodsClass>()); |
| | | classMap.put(TYPE_YAOQING, menu); |
| | | menu = new GoodsClass(TYPE_YAOQING, "邀请"); |
| | | menu.setListSub(new ArrayList<GoodsClass>()); |
| | | classMap.put(TYPE_YAOQING, menu); |
| | | |
| | | menu = new GoodsClass(TYPE_HUODONG, "活动"); |
| | | List<GoodsClass> sub5 = new ArrayList<GoodsClass>(); |
| | | sub5.add(new GoodsClass(0L, "全部")); |
| | | sub5.add(new GoodsClass(1L, "淘宝")); |
| | | sub5.add(new GoodsClass(2L, "京东")); |
| | | sub5.add(new GoodsClass(3L, "拼多多")); |
| | | menu.setListSub(sub5); |
| | | classMap.put(TYPE_HUODONG, menu); |
| | | menu = new GoodsClass(TYPE_HUODONG, "活动"); |
| | | List<GoodsClass> sub5 = new ArrayList<GoodsClass>(); |
| | | sub5.add(new GoodsClass(0L, "全部")); |
| | | sub5.add(new GoodsClass(1L, "淘宝")); |
| | | sub5.add(new GoodsClass(2L, "京东")); |
| | | sub5.add(new GoodsClass(3L, "拼多多")); |
| | | menu.setListSub(sub5); |
| | | classMap.put(TYPE_HUODONG, menu); |
| | | |
| | | menu = new GoodsClass(TYPE_XUEYUAN, "学院"); |
| | | menu.setListSub(new ArrayList<GoodsClass>()); |
| | | classMap.put(TYPE_XUEYUAN, menu); |
| | | menu = new GoodsClass(TYPE_XUEYUAN, "学院"); |
| | | menu.setListSub(new ArrayList<GoodsClass>()); |
| | | classMap.put(TYPE_XUEYUAN, menu); |
| | | |
| | | menu = new GoodsClass(TYPE_FAQUAN, "发圈"); |
| | | menu.setListSub(new ArrayList<GoodsClass>()); |
| | | classMap.put(TYPE_FAQUAN, menu); |
| | | menu = new GoodsClass(TYPE_FAQUAN, "发圈"); |
| | | menu.setListSub(new ArrayList<GoodsClass>()); |
| | | classMap.put(TYPE_FAQUAN, menu); |
| | | |
| | | menu = new GoodsClass(TYPE_SUCAI, "素材"); |
| | | menu.setListSub(new ArrayList<GoodsClass>()); |
| | | classMap.put(TYPE_SUCAI, menu); |
| | | return classMap; |
| | | } |
| | | menu = new GoodsClass(TYPE_SUCAI, "素材"); |
| | | menu.setListSub(new ArrayList<GoodsClass>()); |
| | | classMap.put(TYPE_SUCAI, menu); |
| | | return classMap; |
| | | } |
| | | |
| | | /** |
| | | * 查询顶部分类 |
| | | * |
| | | * @param acceptData |
| | | * @param cid |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getClass", method = RequestMethod.POST) |
| | | public void getClass(AcceptData acceptData, Long cid, PrintWriter out) { |
| | | // ios 只返回子集分类 |
| | | if (cid != null) { |
| | | Map<Long, GoodsClass> map = getAllDynamicClass(); |
| | | JSONObject data = new JSONObject(); |
| | | data.put("list", JsonUtil.getApiCommonGson().toJson(map.get(cid).getListSub())); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | return; |
| | | } |
| | | /** |
| | | * 查询顶部分类 |
| | | * |
| | | * @param acceptData |
| | | * @param cid |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getClass", method = RequestMethod.POST) |
| | | public void getClass(AcceptData acceptData, Long cid, PrintWriter out) { |
| | | // ios 只返回子集分类 |
| | | if (cid != null) { |
| | | Map<Long, GoodsClass> map = getAllDynamicClass(); |
| | | JSONObject data = new JSONObject(); |
| | | data.put("list", JsonUtil.getApiCommonGson().toJson(map.get(cid).getListSub())); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | return; |
| | | } |
| | | |
| | | // Android 返回分类以及顶部数据 |
| | | List<GoodsClass> listSub = new ArrayList<GoodsClass>(); |
| | | listSub.add(new GoodsClass(0L, "今日单品")); |
| | | listSub.addAll(DaTaoKeUtil.goodsClasses); |
| | | // Android 返回分类以及顶部数据 |
| | | List<GoodsClass> listSub = new ArrayList<GoodsClass>(); |
| | | listSub.add(new GoodsClass(0L, "今日单品")); |
| | | listSub.addAll(DaTaoKeUtil.goodsClasses); |
| | | |
| | | GoodsClass menu1 = new GoodsClass(1L, "热销"); |
| | | menu1.setListSub(listSub); |
| | | GoodsClass menu1 = new GoodsClass(1L, "热销"); |
| | | menu1.setListSub(listSub); |
| | | |
| | | GoodsClass menu2 = new GoodsClass(2L, "推荐"); |
| | | menu2.setListSub(new ArrayList<GoodsClass>()); |
| | | GoodsClass menu2 = new GoodsClass(2L, "推荐"); |
| | | menu2.setListSub(new ArrayList<GoodsClass>()); |
| | | |
| | | GoodsClass menu3 = new GoodsClass(3L, "好店"); |
| | | menu3.setListSub(new ArrayList<GoodsClass>()); |
| | | GoodsClass menu3 = new GoodsClass(3L, "好店"); |
| | | menu3.setListSub(new ArrayList<GoodsClass>()); |
| | | |
| | | GoodsClass menu4 = new GoodsClass(4L, "邀请"); |
| | | menu4.setListSub(new ArrayList<GoodsClass>()); |
| | | GoodsClass menu4 = new GoodsClass(4L, "邀请"); |
| | | menu4.setListSub(new ArrayList<GoodsClass>()); |
| | | |
| | | GoodsClass menu5 = new GoodsClass(5L, "活动"); |
| | | List<GoodsClass> sub5 = new ArrayList<GoodsClass>(); |
| | | sub5.add(new GoodsClass(0L, "全部")); |
| | | sub5.add(new GoodsClass(1L, "淘宝")); |
| | | sub5.add(new GoodsClass(2L, "京东")); |
| | | sub5.add(new GoodsClass(3L, "拼多多")); |
| | | menu5.setListSub(sub5); |
| | | GoodsClass menu5 = new GoodsClass(5L, "活动"); |
| | | List<GoodsClass> sub5 = new ArrayList<GoodsClass>(); |
| | | sub5.add(new GoodsClass(0L, "全部")); |
| | | sub5.add(new GoodsClass(1L, "淘宝")); |
| | | sub5.add(new GoodsClass(2L, "京东")); |
| | | sub5.add(new GoodsClass(3L, "拼多多")); |
| | | menu5.setListSub(sub5); |
| | | |
| | | GoodsClass menu6 = new GoodsClass(6L, "学院"); |
| | | menu6.setListSub(new ArrayList<GoodsClass>()); |
| | | GoodsClass menu6 = new GoodsClass(6L, "学院"); |
| | | menu6.setListSub(new ArrayList<GoodsClass>()); |
| | | |
| | | List<GoodsClass> list = new ArrayList<GoodsClass>(); |
| | | List<GoodsClass> list = new ArrayList<GoodsClass>(); |
| | | |
| | | Map<Long, GoodsClass> map = getAllDynamicClass(); |
| | | Map<Long, GoodsClass> map = getAllDynamicClass(); |
| | | |
| | | if (VersionUtil.greaterThan_2_0_7(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | // 2.0.7返回发圈+活动+学院+素材 |
| | | list.add(map.get(TYPE_FAQUAN)); |
| | | list.add(map.get(TYPE_HUODONG)); |
| | | // list.add(map.get(TYPE_XUEYUAN)); |
| | | list.add(map.get(TYPE_SUCAI)); |
| | | } else if (VersionUtil.greaterThan_2_0_6(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | // 2.0.6返回热销+活动+推荐+学院+邀请 |
| | | list.add(map.get(TYPE_REXIAO)); |
| | | list.add(map.get(TYPE_HUODONG)); |
| | | list.add(map.get(TYPE_TUIJIAN)); |
| | | // list.add(map.get(TYPE_XUEYUAN)); |
| | | list.add(map.get(TYPE_YAOQING)); |
| | | } else if (VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | // 2.0.5返回热销+活动+推荐+邀请 |
| | | list.add(map.get(TYPE_REXIAO)); |
| | | list.add(map.get(TYPE_HUODONG)); |
| | | list.add(map.get(TYPE_TUIJIAN)); |
| | | list.add(map.get(TYPE_YAOQING)); |
| | | } else { |
| | | // 2.0.5以前的版本返回热销+活动+推荐+好店+邀请 |
| | | list.add(map.get(TYPE_REXIAO)); |
| | | list.add(map.get(TYPE_HUODONG)); |
| | | list.add(map.get(TYPE_TUIJIAN)); |
| | | list.add(map.get(TYPE_HAODIAN)); |
| | | list.add(map.get(TYPE_YAOQING)); |
| | | } |
| | | if (VersionUtil.greaterThan_2_0_7(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | // 2.0.7返回发圈+活动+学院+素材 |
| | | if (acceptData.getSystem() == SystemEnum.blks) { |
| | | list.add(map.get(TYPE_FAQUAN)); |
| | | list.add(map.get(TYPE_HUODONG)); |
| | | // list.add(map.get(TYPE_XUEYUAN)); |
| | | list.add(map.get(TYPE_SUCAI)); |
| | | } else { |
| | | list.add(map.get(TYPE_FAQUAN)); |
| | | } |
| | | } else if (VersionUtil.greaterThan_2_0_6(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | // 2.0.6返回热销+活动+推荐+学院+邀请 |
| | | list.add(map.get(TYPE_REXIAO)); |
| | | list.add(map.get(TYPE_HUODONG)); |
| | | list.add(map.get(TYPE_TUIJIAN)); |
| | | // list.add(map.get(TYPE_XUEYUAN)); |
| | | list.add(map.get(TYPE_YAOQING)); |
| | | } else if (VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | // 2.0.5返回热销+活动+推荐+邀请 |
| | | list.add(map.get(TYPE_REXIAO)); |
| | | list.add(map.get(TYPE_HUODONG)); |
| | | list.add(map.get(TYPE_TUIJIAN)); |
| | | list.add(map.get(TYPE_YAOQING)); |
| | | } else { |
| | | // 2.0.5以前的版本返回热销+活动+推荐+好店+邀请 |
| | | list.add(map.get(TYPE_REXIAO)); |
| | | list.add(map.get(TYPE_HUODONG)); |
| | | list.add(map.get(TYPE_TUIJIAN)); |
| | | list.add(map.get(TYPE_HAODIAN)); |
| | | list.add(map.get(TYPE_YAOQING)); |
| | | } |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | data.put("list", JsonUtil.getApiCommonGson().toJson(list)); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | JSONObject data = new JSONObject(); |
| | | data.put("list", JsonUtil.getApiCommonGson().toJson(list)); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | |
| | | /** |
| | | * 动态商品列表 |
| | | * |
| | | * @param acceptData |
| | | * @param page |
| | | * @param cid |
| | | * @param subId |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getList", method = RequestMethod.POST) |
| | | public void getList(AcceptData acceptData, Integer page, Long cid, Long subId, PrintWriter out) { |
| | | if (cid == null) { |
| | | out.print(JsonUtil.loadFalseResult("主分类id不能为空")); |
| | | return; |
| | | } |
| | | /** |
| | | * 动态商品列表 |
| | | * |
| | | * @param acceptData |
| | | * @param page |
| | | * @param cid |
| | | * @param subId |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getList", method = RequestMethod.POST) |
| | | public void getList(AcceptData acceptData, Integer page, Long cid, Long subId, PrintWriter out) { |
| | | if (cid == null) { |
| | | out.print(JsonUtil.loadFalseResult("主分类id不能为空")); |
| | | return; |
| | | } |
| | | |
| | | if (cid != null) { |
| | | if (cid == 5) { // 活动主题 |
| | | getSpecialList(acceptData, page, subId, out); |
| | | return; |
| | | } else if (cid == 6) { // 学院 |
| | | getArticleList(acceptData, page, null, false, out); |
| | | return; |
| | | } |
| | | } |
| | | if (cid != null) { |
| | | if (cid == 5) { // 活动主题 |
| | | getSpecialList(acceptData, page, subId, out); |
| | | return; |
| | | } else if (cid == 6) { // 学院 |
| | | getArticleList(acceptData, page, null, false, out); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | long count = 0; |
| | | long count = 0; |
| | | |
| | | int platform = 1; |
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform())) { |
| | | platform = 2; |
| | | } |
| | | int platform = 1; |
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform())) { |
| | | platform = 2; |
| | | } |
| | | |
| | | int version = Integer.parseInt(acceptData.getVersion()); |
| | | List<DynamicInfo> list = dynamicInfoService.queryV2(platform, version, (page - 1) * Constant.PAGE_SIZE, |
| | | Constant.PAGE_SIZE, cid, subId); |
| | | if (list == null) { |
| | | list = new ArrayList<DynamicInfo>(); |
| | | } else { |
| | | count = dynamicInfoService.count(cid, subId); |
| | | } |
| | | int version = Integer.parseInt(acceptData.getVersion()); |
| | | List<DynamicInfo> list = dynamicInfoService.queryV2(platform, version, (page - 1) * Constant.PAGE_SIZE, |
| | | Constant.PAGE_SIZE, cid, subId); |
| | | if (list == null) { |
| | | list = new ArrayList<DynamicInfo>(); |
| | | } else { |
| | | count = dynamicInfoService.count(cid, subId); |
| | | } |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | data.put("count", count); |
| | | data.put("list", getGson().toJson(list)); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | JSONObject data = new JSONObject(); |
| | | data.put("count", count); |
| | | data.put("list", getGson().toJson(list)); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | |
| | | /** |
| | | * 活动列表 |
| | | * |
| | | * @param acceptData |
| | | * @param out |
| | | */ |
| | | private void getSpecialList(AcceptData acceptData, Integer page, Long subId, PrintWriter out) { |
| | | if (subId == null) { |
| | | out.print(JsonUtil.loadFalseResult("分类id不能为空")); |
| | | return; |
| | | } |
| | | /** |
| | | * 活动列表 |
| | | * |
| | | * @param acceptData |
| | | * @param out |
| | | */ |
| | | private void getSpecialList(AcceptData acceptData, Integer page, Long subId, PrintWriter out) { |
| | | if (subId == null) { |
| | | out.print(JsonUtil.loadFalseResult("分类id不能为空")); |
| | | return; |
| | | } |
| | | |
| | | // 平台区分 |
| | | int platformCode = Constant.getPlatformCode(acceptData.getPlatform()); |
| | | List<String> listKey = new ArrayList<String>(); |
| | | // 平台区分 |
| | | int platformCode = Constant.getPlatformCode(acceptData.getPlatform()); |
| | | List<String> listKey = new ArrayList<String>(); |
| | | |
| | | if (subId == 1) { // 淘宝 |
| | | listKey.add("special_channel_tb"); |
| | | } else if (subId == 2) { // 京东 |
| | | listKey.add("special_channel_jd"); |
| | | } else if (subId == 3) { // 拼多多 |
| | | listKey.add("special_channel_pdd"); |
| | | } else { // 全部 |
| | | listKey.add("special_channel_tb"); |
| | | listKey.add("special_channel_jd"); |
| | | listKey.add("special_channel_pdd"); |
| | | } |
| | | if (subId == 1) { // 淘宝 |
| | | listKey.add("special_channel_tb"); |
| | | } else if (subId == 2) { // 京东 |
| | | listKey.add("special_channel_jd"); |
| | | } else if (subId == 3) { // 拼多多 |
| | | listKey.add("special_channel_pdd"); |
| | | } else { // 全部 |
| | | listKey.add("special_channel_tb"); |
| | | listKey.add("special_channel_jd"); |
| | | listKey.add("special_channel_pdd"); |
| | | } |
| | | |
| | | List<SpecialVO> list = specialService.listByPlaceKeyHasLabel((page - 1) * Constant.PAGE_SIZE, |
| | | Constant.PAGE_SIZE, listKey, platformCode, Integer.parseInt(acceptData.getVersion()),acceptData.getSystem()); |
| | | List<SpecialVO> list = specialService.listByPlaceKeyHasLabel((page - 1) * Constant.PAGE_SIZE, |
| | | Constant.PAGE_SIZE, listKey, platformCode, Integer.parseInt(acceptData.getVersion()), acceptData.getSystem()); |
| | | |
| | | long time = System.currentTimeMillis(); |
| | | long time = System.currentTimeMillis(); |
| | | |
| | | // 删除尚未启用的过期的 |
| | | for (int i = 0; i < list.size(); i++) { |
| | | Special special = list.get(i); |
| | | if (special.getState() == 1L) { |
| | | continue; |
| | | } |
| | | // 删除尚未启用的过期的 |
| | | for (int i = 0; i < list.size(); i++) { |
| | | Special special = list.get(i); |
| | | if (special.getState() == 1L) { |
| | | continue; |
| | | } |
| | | |
| | | // 是否活动已过期 |
| | | if (special.getStartTime() != null && special.getEndTime() != null) { |
| | | if (time < special.getStartTime().getTime() || time > special.getEndTime().getTime()) { |
| | | continue; |
| | | } else { |
| | | special.setTimeTask(true); |
| | | special.setCountDownTime((special.getEndTime().getTime() - time) / 1000); |
| | | } |
| | | } |
| | | // 是否活动已过期 |
| | | if (special.getStartTime() != null && special.getEndTime() != null) { |
| | | if (time < special.getStartTime().getTime() || time > special.getEndTime().getTime()) { |
| | | continue; |
| | | } else { |
| | | special.setTimeTask(true); |
| | | special.setCountDownTime((special.getEndTime().getTime() - time) / 1000); |
| | | } |
| | | } |
| | | |
| | | // 设置标签 |
| | | List<SpecialLabel> listLabels = special.getListLabels(); |
| | | if (listLabels != null && !listLabels.isEmpty()) { |
| | | List<ClientTextStyleVO> labels = new ArrayList<>(); |
| | | for (SpecialLabel specialLabel : listLabels) { |
| | | labels.add(new ClientTextStyleVO(specialLabel.getName(), specialLabel.getBgColor())); |
| | | } |
| | | special.setLabels(labels); |
| | | } |
| | | // 设置标签 |
| | | List<SpecialLabel> listLabels = special.getListLabels(); |
| | | if (listLabels != null && !listLabels.isEmpty()) { |
| | | List<ClientTextStyleVO> labels = new ArrayList<>(); |
| | | for (SpecialLabel specialLabel : listLabels) { |
| | | labels.add(new ClientTextStyleVO(specialLabel.getName(), specialLabel.getBgColor())); |
| | | } |
| | | special.setLabels(labels); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | long count = specialService.countByPlaceKeyList(listKey, platformCode, |
| | | Integer.parseInt(acceptData.getVersion()),acceptData.getSystem()); |
| | | long count = specialService.countByPlaceKeyList(listKey, platformCode, |
| | | Integer.parseInt(acceptData.getVersion()), acceptData.getSystem()); |
| | | |
| | | GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation(); |
| | | Gson gson = gsonBuilder.create(); |
| | | JSONObject data = new JSONObject(); |
| | | data.put("count", count); |
| | | data.put("list", gson.toJson(list)); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation(); |
| | | Gson gson = gsonBuilder.create(); |
| | | JSONObject data = new JSONObject(); |
| | | data.put("count", count); |
| | | data.put("list", gson.toJson(list)); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | |
| | | /** |
| | | * 时间处理 |
| | | * |
| | | * @return |
| | | */ |
| | | private Gson getGson() { |
| | | GsonBuilder gb = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()); |
| | | gb.excludeFieldsWithoutExposeAnnotation(); |
| | | gb.registerTypeAdapter(Date.class, new JsonSerializer<Date>() { |
| | | @Override |
| | | public JsonElement serialize(Date value, Type theType, JsonSerializationContext context) { |
| | | String desc = ""; |
| | | if (value != null) { |
| | | // 判断是否是同一天 |
| | | /** |
| | | * 时间处理 |
| | | * |
| | | * @return |
| | | */ |
| | | private Gson getGson() { |
| | | GsonBuilder gb = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()); |
| | | gb.excludeFieldsWithoutExposeAnnotation(); |
| | | gb.registerTypeAdapter(Date.class, new JsonSerializer<Date>() { |
| | | @Override |
| | | public JsonElement serialize(Date value, Type theType, JsonSerializationContext context) { |
| | | String desc = ""; |
| | | if (value != null) { |
| | | // 判断是否是同一天 |
| | | |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(value); |
| | | int y1 = calendar.get(Calendar.YEAR);// 获取年份 |
| | | int d1 = calendar.get(Calendar.DAY_OF_YEAR);// 获取年中第几天 |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(value); |
| | | int y1 = calendar.get(Calendar.YEAR);// 获取年份 |
| | | int d1 = calendar.get(Calendar.DAY_OF_YEAR);// 获取年中第几天 |
| | | |
| | | Date nowDate = new Date(); |
| | | Calendar calendar2 = Calendar.getInstance(); |
| | | calendar2.setTime(nowDate); |
| | | int y2 = calendar2.get(Calendar.YEAR);// 获取年份 |
| | | int d2 = calendar2.get(Calendar.DAY_OF_YEAR);// 获取年中第几天 |
| | | Date nowDate = new Date(); |
| | | Calendar calendar2 = Calendar.getInstance(); |
| | | calendar2.setTime(nowDate); |
| | | int y2 = calendar2.get(Calendar.YEAR);// 获取年份 |
| | | int d2 = calendar2.get(Calendar.DAY_OF_YEAR);// 获取年中第几天 |
| | | |
| | | long old = value.getTime(); |
| | | long now = nowDate.getTime(); |
| | | if (y1 == y2) { |
| | | if (d1 == d2) { |
| | | long cha = now - old; |
| | | if (cha < 1000 * 60 * 2L) { |
| | | desc = "刚刚"; |
| | | } else if (cha < 1000 * 60 * 60L) { |
| | | desc = (cha / (1000 * 60)) + "分钟前"; |
| | | } else { |
| | | desc = (cha / (1000 * 60 * 60)) + "小时前"; |
| | | } |
| | | } else if (d2 - d1 == 1) { |
| | | desc = "昨天"; |
| | | } else { |
| | | desc = (d2 - d1) + "天前"; |
| | | } |
| | | } else { |
| | | int timeDistance = 0; |
| | | for (int i = y1; i < y2; i++) { |
| | | if (i % 4 == 0 && i % 100 != 0 || i % 400 == 0) { |
| | | timeDistance += 366; // 闰年 |
| | | } else { |
| | | timeDistance += 365; // 不是闰年 |
| | | } |
| | | } |
| | | desc = timeDistance + (d2 - d1) + "天前"; |
| | | } |
| | | long old = value.getTime(); |
| | | long now = nowDate.getTime(); |
| | | if (y1 == y2) { |
| | | if (d1 == d2) { |
| | | long cha = now - old; |
| | | if (cha < 1000 * 60 * 2L) { |
| | | desc = "刚刚"; |
| | | } else if (cha < 1000 * 60 * 60L) { |
| | | desc = (cha / (1000 * 60)) + "分钟前"; |
| | | } else { |
| | | desc = (cha / (1000 * 60 * 60)) + "小时前"; |
| | | } |
| | | } else if (d2 - d1 == 1) { |
| | | desc = "昨天"; |
| | | } else { |
| | | desc = (d2 - d1) + "天前"; |
| | | } |
| | | } else { |
| | | int timeDistance = 0; |
| | | for (int i = y1; i < y2; i++) { |
| | | if (i % 4 == 0 && i % 100 != 0 || i % 400 == 0) { |
| | | timeDistance += 366; // 闰年 |
| | | } else { |
| | | timeDistance += 365; // 不是闰年 |
| | | } |
| | | } |
| | | desc = timeDistance + (d2 - d1) + "天前"; |
| | | } |
| | | |
| | | return new JsonPrimitive(desc); |
| | | } |
| | | return new JsonPrimitive(desc); |
| | | } |
| | | |
| | | return new JsonPrimitive(""); |
| | | } |
| | | }); |
| | | return new JsonPrimitive(""); |
| | | } |
| | | }); |
| | | |
| | | Gson gson = gb.create(); |
| | | return gson; |
| | | } |
| | | Gson gson = gb.create(); |
| | | return gson; |
| | | } |
| | | |
| | | /** |
| | | * 活动列表 |
| | | * |
| | | * @param acceptData |
| | | * @param out |
| | | */ |
| | | private void getArticleList(AcceptData acceptData, Integer page, String key, boolean search, PrintWriter out) { |
| | | List<ArticleVO> list = articleOfficialService.queryValid((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, |
| | | key); |
| | | if (list != null) { |
| | | for (ArticleVO article : list) { |
| | | String tags = article.getTags(); |
| | | if (StringUtil.isNullOrEmpty(tags)) { |
| | | continue; |
| | | } |
| | | /** |
| | | * 活动列表 |
| | | * |
| | | * @param acceptData |
| | | * @param out |
| | | */ |
| | | private void getArticleList(AcceptData acceptData, Integer page, String key, boolean search, PrintWriter out) { |
| | | List<ArticleVO> list = articleOfficialService.queryValid((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, |
| | | key); |
| | | if (list != null) { |
| | | for (ArticleVO article : list) { |
| | | String tags = article.getTags(); |
| | | if (StringUtil.isNullOrEmpty(tags)) { |
| | | continue; |
| | | } |
| | | |
| | | String[] arrayTags = tags.split("\\s+"); |
| | | if (arrayTags == null || arrayTags.length == 0) { |
| | | continue; |
| | | } |
| | | String[] arrayTags = tags.split("\\s+"); |
| | | if (arrayTags == null || arrayTags.length == 0) { |
| | | continue; |
| | | } |
| | | |
| | | String[] arrayTagsColour = null; |
| | | String tagsColour = article.getTagsColour(); |
| | | if (!StringUtil.isNullOrEmpty(tagsColour)) { |
| | | arrayTagsColour = tagsColour.split("\\s+"); |
| | | } |
| | | String[] arrayTagsColour = null; |
| | | String tagsColour = article.getTagsColour(); |
| | | if (!StringUtil.isNullOrEmpty(tagsColour)) { |
| | | arrayTagsColour = tagsColour.split("\\s+"); |
| | | } |
| | | |
| | | String color = "#FE0014"; |
| | | List<ClientTextStyleVO> labels = new ArrayList<ClientTextStyleVO>(); |
| | | for (int i = 0; i < arrayTags.length; i++) { |
| | | String tag = arrayTags[i]; |
| | | if (arrayTagsColour != null && arrayTagsColour.length == arrayTags.length) { |
| | | color = arrayTagsColour[i]; |
| | | } |
| | | ClientTextStyleVO styleVO = new ClientTextStyleVO(); |
| | | styleVO.setColor(color); |
| | | styleVO.setContent(tag); |
| | | labels.add(styleVO); |
| | | } |
| | | article.setLabels(labels); |
| | | } |
| | | } |
| | | String color = "#FE0014"; |
| | | List<ClientTextStyleVO> labels = new ArrayList<ClientTextStyleVO>(); |
| | | for (int i = 0; i < arrayTags.length; i++) { |
| | | String tag = arrayTags[i]; |
| | | if (arrayTagsColour != null && arrayTagsColour.length == arrayTags.length) { |
| | | color = arrayTagsColour[i]; |
| | | } |
| | | ClientTextStyleVO styleVO = new ClientTextStyleVO(); |
| | | styleVO.setColor(color); |
| | | styleVO.setContent(tag); |
| | | labels.add(styleVO); |
| | | } |
| | | article.setLabels(labels); |
| | | } |
| | | } |
| | | |
| | | GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation(); |
| | | Gson gson = gsonBuilder.create(); |
| | | GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation(); |
| | | Gson gson = gsonBuilder.create(); |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | if (page == 1 && !search) { |
| | | List<BannerVO> banners = swiperPictureService.getByBannerCardAndVersion("article_banners", |
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()),acceptData.getSystem()); |
| | | if (banners == null) |
| | | banners = new ArrayList<>(); |
| | | data.put("banners", gson.toJson(banners)); |
| | | JSONObject data = new JSONObject(); |
| | | if (page == 1 && !search) { |
| | | List<BannerVO> banners = swiperPictureService.getByBannerCardAndVersion("article_banners", |
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()), acceptData.getSystem()); |
| | | if (banners == null) |
| | | banners = new ArrayList<>(); |
| | | data.put("banners", gson.toJson(banners)); |
| | | |
| | | List<SpecialVO> listSpecial = specialService.listByVersion(0, Integer.MAX_VALUE, "article_specials", |
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()), acceptData.getSystem()); |
| | | if (listSpecial == null) |
| | | listSpecial = new ArrayList<>(); |
| | | |
| | | for (SpecialVO special : listSpecial) { |
| | | boolean needLogin = special.isJumpLogin(); |
| | | JumpDetailV2 jumpDetail = special.getJumpDetail(); |
| | | if (jumpDetail != null) { |
| | | jumpDetail.setNeedLogin(needLogin); |
| | | special.setJumpDetail(jumpDetail); |
| | | } |
| | | } |
| | | data.put("specials", gson.toJson(listSpecial)); |
| | | } |
| | | data.put("count", articleOfficialService.countValid(key)); |
| | | data.put("list", gson.toJson(list)); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | |
| | | /** |
| | | * 文章搜索 |
| | | * |
| | | * @param acceptData |
| | | * @param id |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "readArticle", method = RequestMethod.POST) |
| | | public void readArticle(AcceptData acceptData, String id, PrintWriter out) { |
| | | if (StringUtil.isNullOrEmpty(id)) { |
| | | out.print(JsonUtil.loadFalseResult("id不能为空")); |
| | | return; |
| | | } |
| | | articleOfficialService.updateReadNum(id); |
| | | out.print(JsonUtil.loadTrueResult("操作成功")); |
| | | } |
| | | |
| | | /** |
| | | * 文章搜索 |
| | | * |
| | | * @param acceptData |
| | | * @param page |
| | | * @param key |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "searchArticle", method = RequestMethod.POST) |
| | | public void searchArticle(AcceptData acceptData, Integer page, String key, PrintWriter out) { |
| | | getArticleList(acceptData, page, key, true, out); |
| | | } |
| | | |
| | | List<SpecialVO> listSpecial = specialService.listByVersion(0, Integer.MAX_VALUE, "article_specials", |
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()),acceptData.getSystem()); |
| | | if (listSpecial == null) |
| | | listSpecial = new ArrayList<>(); |
| | | /** |
| | | * 文章搜索 |
| | | * |
| | | * @param acceptData |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getArticleHot", method = RequestMethod.POST) |
| | | public void getArticleHot(AcceptData acceptData, PrintWriter out) { |
| | | JSONObject data = new JSONObject(); |
| | | data.put("words", configService.getValue(ConfigKeyEnum.articleHotWords.getKey(), SystemInfoUtil.getSystem(acceptData))); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | |
| | | for (SpecialVO special : listSpecial) { |
| | | boolean needLogin = special.isJumpLogin(); |
| | | JumpDetailV2 jumpDetail = special.getJumpDetail(); |
| | | if (jumpDetail != null) { |
| | | jumpDetail.setNeedLogin(needLogin); |
| | | special.setJumpDetail(jumpDetail); |
| | | } |
| | | } |
| | | data.put("specials", gson.toJson(listSpecial)); |
| | | } |
| | | data.put("count", articleOfficialService.countValid(key)); |
| | | data.put("list", gson.toJson(list)); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | /** |
| | | * 2.0.7版本后调用 动态列表(适用于发圈与素材) |
| | | * |
| | | * @param acceptData |
| | | * @param page |
| | | * @param cid |
| | | * @param subId |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getDynamicList", method = RequestMethod.POST) |
| | | public void getDynamicListNew(AcceptData acceptData, Integer page, Long cid, String subId, Long uid, PrintWriter out) { |
| | | try { |
| | | int type = 1; |
| | | if (cid == TYPE_FAQUAN) { |
| | | type = 1; |
| | | } else if (cid == TYPE_SUCAI) { |
| | | type = 2; |
| | | } |
| | | List<GoodsEvaluate> listNew = new ArrayList<GoodsEvaluate>(); |
| | | |
| | | /** |
| | | * 文章搜索 |
| | | * |
| | | * @param acceptData |
| | | * @param id |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "readArticle", method = RequestMethod.POST) |
| | | public void readArticle(AcceptData acceptData, String id, PrintWriter out) { |
| | | if (StringUtil.isNullOrEmpty(id)) { |
| | | out.print(JsonUtil.loadFalseResult("id不能为空")); |
| | | return; |
| | | } |
| | | articleOfficialService.updateReadNum(id); |
| | | out.print(JsonUtil.loadTrueResult("操作成功")); |
| | | } |
| | | List<GoodsEvaluate> list = goodsEvaluateService.queryMaterialsCache((page - 1) * Constant.PAGE_SIZE, |
| | | Constant.PAGE_SIZE, type, acceptData.getSystem()); |
| | | |
| | | /** |
| | | * 文章搜索 |
| | | * |
| | | * @param acceptData |
| | | * @param page |
| | | * @param key |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "searchArticle", method = RequestMethod.POST) |
| | | public void searchArticle(AcceptData acceptData, Integer page, String key, PrintWriter out) { |
| | | getArticleList(acceptData, page, key, true, out); |
| | | } |
| | | if (!VersionUtil.greaterThan_2_1_1(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | listNew.addAll(list); |
| | | } else if (list.size() > 0) { // 活动图片不允许跳转 |
| | | |
| | | /** |
| | | * 文章搜索 |
| | | * |
| | | * @param acceptData |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getArticleHot", method = RequestMethod.POST) |
| | | public void getArticleHot(AcceptData acceptData, PrintWriter out) { |
| | | JSONObject data = new JSONObject(); |
| | | data.put("words", configService.getValue(ConfigKeyEnum.articleHotWords.getKey(), SystemInfoUtil.getSystem(acceptData))); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | // 云发单是否开启 |
| | | boolean cloudOpen = configService.isRobotCloudOpen(ConfigKeyEnum.robotCloudOpenCircle.getKey(), acceptData.getPlatform(), acceptData.getVersion(), SystemInfoUtil.getSystem(acceptData)); |
| | | if (!cloudOpen && uid != null) { |
| | | List<String> testUsers = configService.getTestUsers(SystemInfoUtil.getSystem(acceptData)); |
| | | if (testUsers != null && testUsers.contains(uid + "")) { |
| | | cloudOpen = true; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 2.0.7版本后调用 动态列表(适用于发圈与素材) |
| | | * |
| | | * @param acceptData |
| | | * @param page |
| | | * @param cid |
| | | * @param subId |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getDynamicList", method = RequestMethod.POST) |
| | | public void getDynamicListNew(AcceptData acceptData, Integer page, Long cid, String subId, Long uid, PrintWriter out) { |
| | | try { |
| | | int type = 1; |
| | | if (cid == TYPE_FAQUAN) { |
| | | type = 1; |
| | | } else if (cid == TYPE_SUCAI) { |
| | | type = 2; |
| | | } |
| | | List<GoodsEvaluate> listNew = new ArrayList<GoodsEvaluate>(); |
| | | for (GoodsEvaluate goodsEvaluate : list) { |
| | | GoodsEvaluate evaluateNew = new GoodsEvaluate(); |
| | | try { |
| | | PropertyUtils.copyProperties(evaluateNew, goodsEvaluate); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | continue; |
| | | } |
| | | |
| | | List<GoodsEvaluate> list = goodsEvaluateService.queryMaterialsCache((page - 1) * Constant.PAGE_SIZE, |
| | | Constant.PAGE_SIZE, type,acceptData.getSystem()); |
| | | EvaluateEnum evaluateEnum = evaluateNew.getType(); |
| | | // 单品 活动可以一键云发单 |
| | | if (evaluateEnum == EvaluateEnum.activity || evaluateEnum == EvaluateEnum.single) { |
| | | evaluateNew.setCloud(cloudOpen); |
| | | } |
| | | |
| | | if (!VersionUtil.greaterThan_2_1_1(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | listNew.addAll(list); |
| | | } else if (list.size() > 0) { // 活动图片不允许跳转 |
| | | |
| | | // 云发单是否开启 |
| | | boolean cloudOpen = configService.isRobotCloudOpen(ConfigKeyEnum.robotCloudOpenCircle.getKey(),acceptData.getPlatform(), acceptData.getVersion(),SystemInfoUtil.getSystem(acceptData)); |
| | | if (!cloudOpen && uid != null) { |
| | | List<String> testUsers = configService.getTestUsers(SystemInfoUtil.getSystem(acceptData)); |
| | | if (testUsers != null && testUsers.contains(uid+"")) { |
| | | cloudOpen = true; |
| | | } |
| | | } |
| | | |
| | | for (GoodsEvaluate goodsEvaluate : list) { |
| | | GoodsEvaluate evaluateNew = new GoodsEvaluate(); |
| | | try { |
| | | PropertyUtils.copyProperties(evaluateNew, goodsEvaluate); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | continue; |
| | | } |
| | | |
| | | EvaluateEnum evaluateEnum = evaluateNew.getType(); |
| | | // 单品 活动可以一键云发单 |
| | | if (evaluateEnum == EvaluateEnum.activity || evaluateEnum == EvaluateEnum.single) { |
| | | evaluateNew.setCloud(cloudOpen); |
| | | } |
| | | |
| | | if (evaluateEnum != EvaluateEnum.activity) { |
| | | listNew.add(evaluateNew); |
| | | continue; |
| | | } |
| | | if (evaluateEnum != EvaluateEnum.activity) { |
| | | listNew.add(evaluateNew); |
| | | continue; |
| | | } |
| | | |
| | | |
| | | // 跳转过渡页 |
| | | // String jumpLink = |
| | | // configService.get(ConfigKeyEnum.activityDetailLink.getKey()) |
| | | // + "?type=%s&id=%s"; |
| | | // jumpLink = String.format(jumpLink, "circle", |
| | | // evaluateNew.getId()); |
| | | // evaluateNew.setJumpLink(jumpLink); |
| | | |
| | | // 图片数量 |
| | | if (evaluateNew.getImgList() != null && evaluateNew.getImgList().size() > 0) { |
| | | int size = evaluateNew.getImgList().size(); |
| | | List<ImgInfo> listInfoNew = new ArrayList<ImgInfo>(); |
| | | // 跳转过渡页 |
| | | // String jumpLink = |
| | | // configService.get(ConfigKeyEnum.activityDetailLink.getKey()) |
| | | // + "?type=%s&id=%s"; |
| | | // jumpLink = String.format(jumpLink, "circle", |
| | | // evaluateNew.getId()); |
| | | // evaluateNew.setJumpLink(jumpLink); |
| | | |
| | | for (ImgInfo imgInfo : goodsEvaluate.getImgList()) { |
| | | if (imgInfo.getType() != ImgEnum.activity) { |
| | | listInfoNew.add(imgInfo); |
| | | continue; |
| | | } |
| | | ImgInfo infoNew = new ImgInfo(); |
| | | try { |
| | | PropertyUtils.copyProperties(infoNew, imgInfo); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | continue; |
| | | } |
| | | infoNew.setType(ImgEnum.img); |
| | | // 图片大于一张时 显示九宫格图 |
| | | if (size > 1) { |
| | | infoNew.setW(1); |
| | | infoNew.setH(1); |
| | | } |
| | | listInfoNew.add(infoNew); |
| | | } |
| | | evaluateNew.setImgList(listInfoNew); |
| | | } |
| | | listNew.add(evaluateNew); |
| | | } |
| | | } |
| | | // 图片数量 |
| | | if (evaluateNew.getImgList() != null && evaluateNew.getImgList().size() > 0) { |
| | | int size = evaluateNew.getImgList().size(); |
| | | List<ImgInfo> listInfoNew = new ArrayList<ImgInfo>(); |
| | | |
| | | GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation(); |
| | | gsonBuilder.registerTypeAdapter(ImgEnum.class, new JsonSerializer<ImgEnum>() { |
| | | @Override |
| | | public JsonElement serialize(ImgEnum value, Type theType, JsonSerializationContext context) { |
| | | if (value == null) { |
| | | return new JsonPrimitive(""); |
| | | } else { |
| | | return new JsonPrimitive(value.getVlaue()); |
| | | } |
| | | } |
| | | }).registerTypeAdapter(BigDecimal.class, new JsonSerializer<BigDecimal>() { |
| | | @Override |
| | | public JsonElement serialize(BigDecimal value, Type theType, JsonSerializationContext context) { |
| | | if (value == null) { |
| | | return new JsonPrimitive(""); |
| | | } else { |
| | | // 保留2位小数 |
| | | return new JsonPrimitive(MoneyBigDecimalUtil.getWithNoZera(value) + ""); |
| | | } |
| | | } |
| | | }).registerTypeAdapter(Date.class, new JsonSerializer<Date>() { |
| | | @Override |
| | | public JsonElement serialize(Date value, Type theType, JsonSerializationContext context) { |
| | | String desc = ""; |
| | | if (value != null) { |
| | | // 判断是否是同一天 |
| | | for (ImgInfo imgInfo : goodsEvaluate.getImgList()) { |
| | | if (imgInfo.getType() != ImgEnum.activity) { |
| | | listInfoNew.add(imgInfo); |
| | | continue; |
| | | } |
| | | ImgInfo infoNew = new ImgInfo(); |
| | | try { |
| | | PropertyUtils.copyProperties(infoNew, imgInfo); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | continue; |
| | | } |
| | | infoNew.setType(ImgEnum.img); |
| | | // 图片大于一张时 显示九宫格图 |
| | | if (size > 1) { |
| | | infoNew.setW(1); |
| | | infoNew.setH(1); |
| | | } |
| | | listInfoNew.add(infoNew); |
| | | } |
| | | evaluateNew.setImgList(listInfoNew); |
| | | } |
| | | listNew.add(evaluateNew); |
| | | } |
| | | } |
| | | |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(value); |
| | | int y1 = calendar.get(Calendar.YEAR);// 获取年份 |
| | | int d1 = calendar.get(Calendar.DAY_OF_YEAR);// 获取年中第几天 |
| | | GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation(); |
| | | gsonBuilder.registerTypeAdapter(ImgEnum.class, new JsonSerializer<ImgEnum>() { |
| | | @Override |
| | | public JsonElement serialize(ImgEnum value, Type theType, JsonSerializationContext context) { |
| | | if (value == null) { |
| | | return new JsonPrimitive(""); |
| | | } else { |
| | | return new JsonPrimitive(value.getVlaue()); |
| | | } |
| | | } |
| | | }).registerTypeAdapter(BigDecimal.class, new JsonSerializer<BigDecimal>() { |
| | | @Override |
| | | public JsonElement serialize(BigDecimal value, Type theType, JsonSerializationContext context) { |
| | | if (value == null) { |
| | | return new JsonPrimitive(""); |
| | | } else { |
| | | // 保留2位小数 |
| | | return new JsonPrimitive(MoneyBigDecimalUtil.getWithNoZera(value) + ""); |
| | | } |
| | | } |
| | | }).registerTypeAdapter(Date.class, new JsonSerializer<Date>() { |
| | | @Override |
| | | public JsonElement serialize(Date value, Type theType, JsonSerializationContext context) { |
| | | String desc = ""; |
| | | if (value != null) { |
| | | // 判断是否是同一天 |
| | | |
| | | Date nowDate = new Date(); |
| | | Calendar calendar2 = Calendar.getInstance(); |
| | | calendar2.setTime(nowDate); |
| | | int y2 = calendar2.get(Calendar.YEAR);// 获取年份 |
| | | int d2 = calendar2.get(Calendar.DAY_OF_YEAR);// 获取年中第几天 |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(value); |
| | | int y1 = calendar.get(Calendar.YEAR);// 获取年份 |
| | | int d1 = calendar.get(Calendar.DAY_OF_YEAR);// 获取年中第几天 |
| | | |
| | | long old = value.getTime(); |
| | | long now = nowDate.getTime(); |
| | | if (y1 == y2) { |
| | | if (d1 == d2) { |
| | | long cha = now - old; |
| | | if (cha < 1000 * 60 * 2L) { |
| | | desc = "刚刚"; |
| | | } else if (cha < 1000 * 60 * 60L) { |
| | | desc = (cha / (1000 * 60)) + "分钟前"; |
| | | } else { |
| | | desc = (cha / (1000 * 60 * 60)) + "小时前"; |
| | | } |
| | | } else if (d2 - d1 == 1) { |
| | | desc = "昨天"; |
| | | } else { |
| | | desc = (d2 - d1) + "天前"; |
| | | } |
| | | } else { |
| | | int timeDistance = 0; |
| | | for (int i = y1; i < y2; i++) { |
| | | if (i % 4 == 0 && i % 100 != 0 || i % 400 == 0) { |
| | | timeDistance += 366; // 闰年 |
| | | } else { |
| | | timeDistance += 365; // 不是闰年 |
| | | } |
| | | } |
| | | desc = timeDistance + (d2 - d1) + "天前"; |
| | | } |
| | | Date nowDate = new Date(); |
| | | Calendar calendar2 = Calendar.getInstance(); |
| | | calendar2.setTime(nowDate); |
| | | int y2 = calendar2.get(Calendar.YEAR);// 获取年份 |
| | | int d2 = calendar2.get(Calendar.DAY_OF_YEAR);// 获取年中第几天 |
| | | |
| | | return new JsonPrimitive(desc); |
| | | } |
| | | long old = value.getTime(); |
| | | long now = nowDate.getTime(); |
| | | if (y1 == y2) { |
| | | if (d1 == d2) { |
| | | long cha = now - old; |
| | | if (cha < 1000 * 60 * 2L) { |
| | | desc = "刚刚"; |
| | | } else if (cha < 1000 * 60 * 60L) { |
| | | desc = (cha / (1000 * 60)) + "分钟前"; |
| | | } else { |
| | | desc = (cha / (1000 * 60 * 60)) + "小时前"; |
| | | } |
| | | } else if (d2 - d1 == 1) { |
| | | desc = "昨天"; |
| | | } else { |
| | | desc = (d2 - d1) + "天前"; |
| | | } |
| | | } else { |
| | | int timeDistance = 0; |
| | | for (int i = y1; i < y2; i++) { |
| | | if (i % 4 == 0 && i % 100 != 0 || i % 400 == 0) { |
| | | timeDistance += 366; // 闰年 |
| | | } else { |
| | | timeDistance += 365; // 不是闰年 |
| | | } |
| | | } |
| | | desc = timeDistance + (d2 - d1) + "天前"; |
| | | } |
| | | |
| | | return new JsonPrimitive(""); |
| | | } |
| | | }); |
| | | Gson gson = gsonBuilder.create(); |
| | | long count = goodsEvaluateService.countValidMaterials(type,acceptData.getSystem()); |
| | | return new JsonPrimitive(desc); |
| | | } |
| | | |
| | | JSONArray jsonArray = new JSONArray(); |
| | | return new JsonPrimitive(""); |
| | | } |
| | | }); |
| | | Gson gson = gsonBuilder.create(); |
| | | long count = goodsEvaluateService.countValidMaterials(type, acceptData.getSystem()); |
| | | |
| | | String listStr = gson.toJson(listNew); |
| | | JSONArray array = JSONArray.fromObject(listStr); |
| | | for (int i = 0; i < array.size(); i++) { |
| | | Object object = array.get(i); |
| | | JSONObject json = JSONObject.fromObject(object); |
| | | Object shareNum = json.get("shareNum"); |
| | | if (shareNum != null) { |
| | | int num = Integer.parseInt(shareNum.toString()); |
| | | JSONArray jsonArray = new JSONArray(); |
| | | |
| | | if (num >= 100000000) { |
| | | double sales = num; |
| | | String salesCountMidea = String.format("%.1f", sales / 100000000); |
| | | json.put("shareNum", salesCountMidea + "亿"); |
| | | } else if (num >= 10000) { |
| | | double sales = num; |
| | | String salesCountMidea = String.format("%.1f", sales / 10000); |
| | | json.put("shareNum", salesCountMidea + "万"); |
| | | } |
| | | } |
| | | jsonArray.add(json); |
| | | } |
| | | String listStr = gson.toJson(listNew); |
| | | JSONArray array = JSONArray.fromObject(listStr); |
| | | for (int i = 0; i < array.size(); i++) { |
| | | Object object = array.get(i); |
| | | JSONObject json = JSONObject.fromObject(object); |
| | | Object shareNum = json.get("shareNum"); |
| | | if (shareNum != null) { |
| | | int num = Integer.parseInt(shareNum.toString()); |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | data.put("count", count); |
| | | data.put("list", jsonArray); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | out.print(JsonUtil.loadFalseResult(1, "查询信息失败")); |
| | | LogHelper.errorDetailInfo(e); |
| | | } |
| | | if (num >= 100000000) { |
| | | double sales = num; |
| | | String salesCountMidea = String.format("%.1f", sales / 100000000); |
| | | json.put("shareNum", salesCountMidea + "亿"); |
| | | } else if (num >= 10000) { |
| | | double sales = num; |
| | | String salesCountMidea = String.format("%.1f", sales / 10000); |
| | | json.put("shareNum", salesCountMidea + "万"); |
| | | } |
| | | } |
| | | jsonArray.add(json); |
| | | } |
| | | |
| | | } |
| | | JSONObject data = new JSONObject(); |
| | | data.put("count", count); |
| | | data.put("list", jsonArray); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | out.print(JsonUtil.loadFalseResult(1, "查询信息失败")); |
| | | LogHelper.errorDetailInfo(e); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param acceptData |
| | | * @param uid |
| | | * @param id |
| | | * @param type |
| | | * 1-放大 2-保存 3-分享 |
| | | * @param goodsId |
| | | * @param goodsType |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "evaluateShare", method = RequestMethod.POST) |
| | | public void evaluateShare(AcceptData acceptData, Long uid, String id, Integer type, String goodsId, |
| | | Integer goodsType, PrintWriter out) { |
| | | try { |
| | | if (uid == null) { |
| | | out.print(JsonUtil.loadFalseResult("用户未登录")); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | if (StringUtil.isNullOrEmpty(id) || type == null) { |
| | | out.print(JsonUtil.loadFalseResult("传递参数不能为空")); |
| | | return; |
| | | } |
| | | /** |
| | | * @param acceptData |
| | | * @param uid |
| | | * @param id |
| | | * @param type 1-放大 2-保存 3-分享 |
| | | * @param goodsId |
| | | * @param goodsType |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "evaluateShare", method = RequestMethod.POST) |
| | | public void evaluateShare(AcceptData acceptData, Long uid, String id, Integer type, String goodsId, |
| | | Integer goodsType, PrintWriter out) { |
| | | try { |
| | | if (uid == null) { |
| | | out.print(JsonUtil.loadFalseResult("用户未登录")); |
| | | return; |
| | | } |
| | | |
| | | if (type == 1 && (StringUtil.isNullOrEmpty(goodsId) || goodsType == null)) { |
| | | out.print(JsonUtil.loadFalseResult("商品参数不能为空")); |
| | | return; |
| | | } |
| | | if (StringUtil.isNullOrEmpty(id) || type == null) { |
| | | out.print(JsonUtil.loadFalseResult("传递参数不能为空")); |
| | | return; |
| | | } |
| | | |
| | | GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(id); |
| | | if (goodsEvaluate == null) { |
| | | out.print(JsonUtil.loadFalseResult("该内容已不存在")); |
| | | return; |
| | | } |
| | | if (type == 1 && (StringUtil.isNullOrEmpty(goodsId) || goodsType == null)) { |
| | | out.print(JsonUtil.loadFalseResult("商品参数不能为空")); |
| | | return; |
| | | } |
| | | |
| | | UserInfo user = userInfoService.getUserByIdWithMybatis(uid); |
| | | if (user == null) { |
| | | out.print(JsonUtil.loadFalseResult("用户未登录")); |
| | | return; |
| | | } |
| | | GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(id); |
| | | if (goodsEvaluate == null) { |
| | | out.print(JsonUtil.loadFalseResult("该内容已不存在")); |
| | | return; |
| | | } |
| | | |
| | | if (user != null && user.getState() != UserInfo.STATE_NORMAL) { |
| | | out.print(JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC)); |
| | | return; |
| | | } |
| | | UserInfo user = userInfoService.getUserByIdWithMybatis(uid); |
| | | if (user == null) { |
| | | out.print(JsonUtil.loadFalseResult("用户未登录")); |
| | | return; |
| | | } |
| | | |
| | | UserExtraTaoBaoInfo taoBaoInfo = userExtraTaoBaoInfoService.getByUid(uid); |
| | | String relationId = null; |
| | | if (taoBaoInfo != null && taoBaoInfo.getRelationId() != null && taoBaoInfo.getRelationValid() != null |
| | | && taoBaoInfo.getRelationValid() == true) |
| | | relationId = taoBaoInfo.getRelationId(); |
| | | if (user != null && user.getState() != UserInfo.STATE_NORMAL) { |
| | | out.print(JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC)); |
| | | return; |
| | | } |
| | | |
| | | if (StringUtil.isNullOrEmpty(relationId)) { |
| | | out.print(JsonUtil.loadFalseResult(2, "淘宝未授权,请前往\"我的\"绑定淘宝账号")); |
| | | return; |
| | | } |
| | | UserExtraTaoBaoInfo taoBaoInfo = userExtraTaoBaoInfoService.getByUid(uid); |
| | | String relationId = null; |
| | | if (taoBaoInfo != null && taoBaoInfo.getRelationId() != null && taoBaoInfo.getRelationValid() != null |
| | | && taoBaoInfo.getRelationValid() == true) |
| | | relationId = taoBaoInfo.getRelationId(); |
| | | |
| | | String inviteCode = userInfoExtraService.getInviteCodeByUid(uid); |
| | | if (StringUtil.isNullOrEmpty(inviteCode)) { |
| | | out.print(JsonUtil.loadFalseResult(1, "邀请码未激活")); |
| | | return; |
| | | } |
| | | if (StringUtil.isNullOrEmpty(relationId)) { |
| | | out.print(JsonUtil.loadFalseResult(2, "淘宝未授权,请前往\"我的\"绑定淘宝账号")); |
| | | return; |
| | | } |
| | | String inviteCode = userInfoExtraService.getInviteCodeByUid(uid); |
| | | if (SystemInfoUtil.hasFunctions(acceptData.getSystem(), SystemFunction.threeSale)) { |
| | | inviteCode = userInfoExtraService.getInviteCodeByUid(uid); |
| | | if (StringUtil.isNullOrEmpty(inviteCode)) { |
| | | out.print(JsonUtil.loadFalseResult(1, "邀请码未激活")); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | List<ImgInfo> imgs = goodsEvaluate.getImgList(); |
| | | if (imgs == null) { |
| | | out.print(JsonUtil.loadFalseResult("该图片内容已不存在")); |
| | | return; |
| | | } |
| | | List<ImgInfo> imgs = goodsEvaluate.getImgList(); |
| | | if (imgs == null) { |
| | | out.print(JsonUtil.loadFalseResult("该图片内容已不存在")); |
| | | return; |
| | | } |
| | | |
| | | List<String> list = new ArrayList<>(); |
| | | Integer dynamicType = goodsEvaluate.getDynamicType(); |
| | | if (dynamicType == null || dynamicType.intValue() == 2) { |
| | | for (ImgInfo imgInfo : imgs) { |
| | | if (imgInfo.getType() == ImgEnum.goods || imgInfo.getType() == ImgEnum.video) |
| | | continue; |
| | | if (imgInfo.getType() == ImgEnum.img) |
| | | list.add(StringUtil.isNullOrEmpty(imgInfo.getUrlHD()) ? imgInfo.getUrl() : imgInfo.getUrlHD()); |
| | | else if (imgInfo.getType() == ImgEnum.activity) |
| | | if (!StringUtil.isNullOrEmpty(imgInfo.getActivityPic())) { |
| | | list.add(imgInfo.getActivityPic()); |
| | | } |
| | | } |
| | | } else { |
| | | // 单品 |
| | | if (goodsEvaluate.getType() == EvaluateEnum.single) { |
| | | for (ImgInfo imgInfo : imgs) { |
| | | if (imgInfo.getType() == ImgEnum.video) |
| | | continue; |
| | | List<String> list = new ArrayList<>(); |
| | | Integer dynamicType = goodsEvaluate.getDynamicType(); |
| | | if (dynamicType == null || dynamicType.intValue() == 2) { |
| | | for (ImgInfo imgInfo : imgs) { |
| | | if (imgInfo.getType() == ImgEnum.goods || imgInfo.getType() == ImgEnum.video) |
| | | continue; |
| | | if (imgInfo.getType() == ImgEnum.img) |
| | | list.add(StringUtil.isNullOrEmpty(imgInfo.getUrlHD()) ? imgInfo.getUrl() : imgInfo.getUrlHD()); |
| | | else if (imgInfo.getType() == ImgEnum.activity) |
| | | if (!StringUtil.isNullOrEmpty(imgInfo.getActivityPic())) { |
| | | list.add(imgInfo.getActivityPic()); |
| | | } |
| | | } |
| | | } else { |
| | | // 单品 |
| | | if (goodsEvaluate.getType() == EvaluateEnum.single) { |
| | | for (ImgInfo imgInfo : imgs) { |
| | | if (imgInfo.getType() == ImgEnum.video) |
| | | continue; |
| | | |
| | | GoodsDetailVO goodsVO = imgInfo.getGoodsVO(); |
| | | if (goodsVO == null) { |
| | | list.add(StringUtil.isNullOrEmpty(imgInfo.getUrlHD()) ? imgInfo.getUrl() |
| | | : imgInfo.getUrlHD()); |
| | | continue; |
| | | } |
| | | GoodsDetailVO goodsVO = imgInfo.getGoodsVO(); |
| | | if (goodsVO == null) { |
| | | list.add(StringUtil.isNullOrEmpty(imgInfo.getUrlHD()) ? imgInfo.getUrl() |
| | | : imgInfo.getUrlHD()); |
| | | continue; |
| | | } |
| | | |
| | | String jumpLink = getJumpLink(goodsVO, user, relationId, inviteCode, imgInfo.getUrl(),SystemInfoUtil.getSystem(acceptData)); |
| | | if (!StringUtil.isNullOrEmpty(jumpLink)) { |
| | | list.add(jumpLink); |
| | | } |
| | | } |
| | | String jumpLink = getJumpLink(goodsVO, user, relationId, inviteCode, imgInfo.getUrl(), SystemInfoUtil.getSystem(acceptData)); |
| | | if (!StringUtil.isNullOrEmpty(jumpLink)) { |
| | | list.add(jumpLink); |
| | | } |
| | | } |
| | | |
| | | } else if (goodsEvaluate.getType() == EvaluateEnum.multiple) { |
| | | if (type == 1) { |
| | | for (ImgInfo imgInfo : imgs) { |
| | | if (imgInfo.getGoodsVO() != null) |
| | | if (imgInfo.getGoodsVO().getGoodsId().equalsIgnoreCase(goodsId) |
| | | && imgInfo.getGoodsVO().getGoodsType() == goodsType.intValue()) { |
| | | String jumpLink = getJumpLink(imgInfo.getGoodsVO(), user, relationId, inviteCode, |
| | | imgInfo.getUrl(),SystemInfoUtil.getSystem(acceptData)); |
| | | if (!StringUtil.isNullOrEmpty(jumpLink)) { |
| | | list.add(jumpLink); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | } else if (type == 2 || type == 3) { |
| | | for (ImgInfo imgInfo : imgs) { |
| | | if (imgInfo.getGoodsVO() != null) { |
| | | String jumpLink = getJumpLink(imgInfo.getGoodsVO(), user, relationId, inviteCode, |
| | | imgInfo.getUrl(),SystemInfoUtil.getSystem(acceptData)); |
| | | if (!StringUtil.isNullOrEmpty(jumpLink)) { |
| | | list.add(jumpLink); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } else if (goodsEvaluate.getType() == EvaluateEnum.multiple) { |
| | | if (type == 1) { |
| | | for (ImgInfo imgInfo : imgs) { |
| | | if (imgInfo.getGoodsVO() != null) |
| | | if (imgInfo.getGoodsVO().getGoodsId().equalsIgnoreCase(goodsId) |
| | | && imgInfo.getGoodsVO().getGoodsType() == goodsType.intValue()) { |
| | | String jumpLink = getJumpLink(imgInfo.getGoodsVO(), user, relationId, inviteCode, |
| | | imgInfo.getUrl(), SystemInfoUtil.getSystem(acceptData)); |
| | | if (!StringUtil.isNullOrEmpty(jumpLink)) { |
| | | list.add(jumpLink); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | } else if (type == 2 || type == 3) { |
| | | for (ImgInfo imgInfo : imgs) { |
| | | if (imgInfo.getGoodsVO() != null) { |
| | | String jumpLink = getJumpLink(imgInfo.getGoodsVO(), user, relationId, inviteCode, |
| | | imgInfo.getUrl(), SystemInfoUtil.getSystem(acceptData)); |
| | | if (!StringUtil.isNullOrEmpty(jumpLink)) { |
| | | list.add(jumpLink); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } else if (goodsEvaluate.getType() == EvaluateEnum.activity) { |
| | | for (ImgInfo imgInfo : imgs) { |
| | | if (imgInfo.getType() == ImgEnum.goods || imgInfo.getType() == ImgEnum.video) |
| | | continue; |
| | | if (imgInfo.getType() == ImgEnum.img) |
| | | list.add(StringUtil.isNullOrEmpty(imgInfo.getUrlHD()) ? imgInfo.getUrl() |
| | | : imgInfo.getUrlHD()); |
| | | else if (imgInfo.getType() == ImgEnum.activity) |
| | | if (!StringUtil.isNullOrEmpty(imgInfo.getActivityPic())) { |
| | | list.add(imgInfo.getActivityPic()); |
| | | } else if (!StringUtil.isNullOrEmpty(imgInfo.getUrl())) { |
| | | list.add(imgInfo.getUrl()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } else if (goodsEvaluate.getType() == EvaluateEnum.activity) { |
| | | for (ImgInfo imgInfo : imgs) { |
| | | if (imgInfo.getType() == ImgEnum.goods || imgInfo.getType() == ImgEnum.video) |
| | | continue; |
| | | if (imgInfo.getType() == ImgEnum.img) |
| | | list.add(StringUtil.isNullOrEmpty(imgInfo.getUrlHD()) ? imgInfo.getUrl() |
| | | : imgInfo.getUrlHD()); |
| | | else if (imgInfo.getType() == ImgEnum.activity) |
| | | if (!StringUtil.isNullOrEmpty(imgInfo.getActivityPic())) { |
| | | list.add(imgInfo.getActivityPic()); |
| | | } else if (!StringUtil.isNullOrEmpty(imgInfo.getUrl())) { |
| | | list.add(imgInfo.getUrl()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | Integer shareCount = goodsEvaluate.getShareNum(); |
| | | if (shareCount == null) { |
| | | shareCount = 0; |
| | | } |
| | | Integer shareCount = goodsEvaluate.getShareNum(); |
| | | if (shareCount == null) { |
| | | shareCount = 0; |
| | | } |
| | | |
| | | if (type == 3) { |
| | | shareCount++; |
| | | goodsEvaluateService.addShareNum(id); |
| | | if (type == 3) { |
| | | shareCount++; |
| | | goodsEvaluateService.addShareNum(id); |
| | | |
| | | executor.execute(new Runnable() { |
| | | @Override |
| | | public void run() { // 添加每日统计 |
| | | dailyCountMomentsService.addShareClick(); |
| | | } |
| | | }); |
| | | } |
| | | executor.execute(new Runnable() { |
| | | @Override |
| | | public void run() { // 添加每日统计 |
| | | dailyCountMomentsService.addShareClick(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | if (list.size() == 0) { |
| | | out.print(JsonUtil.loadFalseResult("该信息已下架")); |
| | | return; |
| | | } |
| | | if (list.size() == 0) { |
| | | out.print(JsonUtil.loadFalseResult("该信息已下架")); |
| | | return; |
| | | } |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | data.put("count", shareCount); |
| | | data.put("list", list); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } catch (Exception e) { |
| | | out.print(JsonUtil.loadFalseResult("分享图生成失败")); |
| | | return; |
| | | } |
| | | } |
| | | JSONObject data = new JSONObject(); |
| | | data.put("count", shareCount); |
| | | data.put("list", list); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } catch (Exception e) { |
| | | out.print(JsonUtil.loadFalseResult("分享图生成失败")); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | private String getJumpLink(GoodsDetailVO goodsVO, UserInfo user, String relationId, String inviteCode, |
| | | private String getJumpLink(GoodsDetailVO goodsVO, UserInfo user, String relationId, String inviteCode, |
| | | String mainPic, SystemEnum system) { |
| | | String jumpLink = null; |
| | | if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) { |
| | | TaoBaoLink taoBaoLink = null; |
| | | try { |
| | | taoBaoLink = taoBaoLinkManager.getTaoBaoLinkForShare(user.getId(), Long.parseLong(goodsVO.getGoodsId()), |
| | | relationId,null); |
| | | } catch (TaoBaoConvertLinkException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | jumpLink = ShareControllerV2.getERCodeContentNew( |
| | | configService.getValue(ConfigKeyEnum.taobaoShareQrcodeText.getKey(),system), taoBaoLink.getGoods(), |
| | | TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken())); |
| | | } else if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_JD) { |
| | | JDGoods jdGoods = jdGoodsCacheUtil.getGoodsInfo(Long.parseLong(goodsVO.getGoodsId())); |
| | | if (jdGoods == null) { |
| | | return null; |
| | | } |
| | | String jumpLink = null; |
| | | if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) { |
| | | TaoBaoLink taoBaoLink = null; |
| | | try { |
| | | taoBaoLink = taoBaoLinkManager.getTaoBaoLinkForShare(user.getId(), Long.parseLong(goodsVO.getGoodsId()), |
| | | relationId, null); |
| | | } catch (TaoBaoConvertLinkException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | jumpLink = ShareControllerV2.getERCodeContentNew( |
| | | configService.getValue(ConfigKeyEnum.taobaoShareQrcodeText.getKey(), system), taoBaoLink.getGoods(), |
| | | TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken())); |
| | | } else if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_JD) { |
| | | JDGoods jdGoods = jdGoodsCacheUtil.getGoodsInfo(Long.parseLong(goodsVO.getGoodsId())); |
| | | if (jdGoods == null) { |
| | | return null; |
| | | } |
| | | |
| | | String couponUrl = null; |
| | | JDCouponInfo couponInfo = JDUtil.getShowCouponInfo(jdGoods); |
| | | if (couponInfo != null) { |
| | | couponUrl = couponInfo.getLink(); |
| | | } |
| | | String materialId = "https://item.jd.com/" + goodsVO.getGoodsId() + ".html"; |
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "", |
| | | user.getId() + ""); |
| | | } else if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_PDD) { |
| | | jumpLink = PinDuoDuoApiUtil.getPromotionUrl(Long.parseLong(goodsVO.getGoodsId()), |
| | | PinDuoDuoApiUtil.PID_SHARE + "", user.getId() + ""); |
| | | } |
| | | String couponUrl = null; |
| | | JDCouponInfo couponInfo = JDUtil.getShowCouponInfo(jdGoods); |
| | | if (couponInfo != null) { |
| | | couponUrl = couponInfo.getLink(); |
| | | } |
| | | String materialId = "https://item.jd.com/" + goodsVO.getGoodsId() + ".html"; |
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "", |
| | | user.getId() + ""); |
| | | } else if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_PDD) { |
| | | jumpLink = PinDuoDuoApiUtil.getPromotionUrl(Long.parseLong(goodsVO.getGoodsId()), |
| | | PinDuoDuoApiUtil.PID_SHARE + "", user.getId() + ""); |
| | | } |
| | | |
| | | FileUploadResult uploadResult = qrCodeService.drawDynamicGoodsPoster(jumpLink, user.getPortrait(), inviteCode, |
| | | mainPic, goodsVO); |
| | | if (uploadResult != null) { |
| | | return uploadResult.getUrl(); |
| | | } |
| | | return null; |
| | | } |
| | | FileUploadResult uploadResult = qrCodeService.drawDynamicGoodsPoster(jumpLink, user.getPortrait(), inviteCode, |
| | | mainPic, goodsVO); |
| | | if (uploadResult != null) { |
| | | return uploadResult.getUrl(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 评论复制-H5 |
| | | * |
| | | * @param acceptData |
| | | * @param id |
| | | * @param cid |
| | | * 评论id |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "evaluateComment", method = RequestMethod.POST) |
| | | public void evaluateComment(AcceptData acceptData, Long uid, String id, String cid, PrintWriter out) { |
| | | if (StringUtil.isNullOrEmpty(id)) { |
| | | out.print(JsonUtil.loadFalseResult("id不能为空")); |
| | | return; |
| | | } |
| | | /** |
| | | * 评论复制-H5 |
| | | * |
| | | * @param acceptData |
| | | * @param id |
| | | * @param cid 评论id |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "evaluateComment", method = RequestMethod.POST) |
| | | public void evaluateComment(AcceptData acceptData, Long uid, String id, String cid, PrintWriter out) { |
| | | if (StringUtil.isNullOrEmpty(id)) { |
| | | out.print(JsonUtil.loadFalseResult("id不能为空")); |
| | | return; |
| | | } |
| | | |
| | | GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(id); |
| | | if (goodsEvaluate == null) { |
| | | out.print(JsonUtil.loadFalseResult("该内容已不存在")); |
| | | return; |
| | | } |
| | | GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(id); |
| | | if (goodsEvaluate == null) { |
| | | out.print(JsonUtil.loadFalseResult("该内容已不存在")); |
| | | return; |
| | | } |
| | | |
| | | UserInfo user = userInfoService.getUserByIdWithMybatis(uid); |
| | | if (user == null) { |
| | | out.print(JsonUtil.loadFalseResult("用户未登录")); |
| | | return; |
| | | } |
| | | UserInfo user = userInfoService.getUserByIdWithMybatis(uid); |
| | | if (user == null) { |
| | | out.print(JsonUtil.loadFalseResult("用户未登录")); |
| | | return; |
| | | } |
| | | |
| | | if (user != null && user.getState() != UserInfo.STATE_NORMAL) { |
| | | out.print(JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC)); |
| | | return; |
| | | } |
| | | if (user != null && user.getState() != UserInfo.STATE_NORMAL) { |
| | | out.print(JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC)); |
| | | return; |
| | | } |
| | | |
| | | UserExtraTaoBaoInfo taoBaoInfo = userExtraTaoBaoInfoService.getByUid(uid); |
| | | String relationId = null; |
| | | if (taoBaoInfo != null && taoBaoInfo.getRelationId() != null && taoBaoInfo.getRelationValid() != null |
| | | && taoBaoInfo.getRelationValid() == true) |
| | | relationId = taoBaoInfo.getRelationId(); |
| | | UserExtraTaoBaoInfo taoBaoInfo = userExtraTaoBaoInfoService.getByUid(uid); |
| | | String relationId = null; |
| | | if (taoBaoInfo != null && taoBaoInfo.getRelationId() != null && taoBaoInfo.getRelationValid() != null |
| | | && taoBaoInfo.getRelationValid() == true) |
| | | relationId = taoBaoInfo.getRelationId(); |
| | | |
| | | if (StringUtil.isNullOrEmpty(relationId)) { |
| | | out.print(JsonUtil.loadFalseResult(2, "淘宝未授权,请前往\"我的\"绑定淘宝账号")); |
| | | return; |
| | | } |
| | | if (StringUtil.isNullOrEmpty(relationId)) { |
| | | out.print(JsonUtil.loadFalseResult(2, "淘宝未授权,请前往\"我的\"绑定淘宝账号")); |
| | | return; |
| | | } |
| | | |
| | | String text = ""; |
| | | CommentInfo comment = null; |
| | | List<CommentInfo> comments = goodsEvaluate.getComments(); |
| | | if (comments != null) { |
| | | for (CommentInfo commentInfo : comments) { |
| | | if (cid.equals(commentInfo.getId())) { |
| | | text = commentInfo.getContent(); |
| | | comment = commentInfo; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | String text = ""; |
| | | CommentInfo comment = null; |
| | | List<CommentInfo> comments = goodsEvaluate.getComments(); |
| | | if (comments != null) { |
| | | for (CommentInfo commentInfo : comments) { |
| | | if (cid.equals(commentInfo.getId())) { |
| | | text = commentInfo.getContent(); |
| | | comment = commentInfo; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | String newText = text; // 非通用券需要验证 |
| | | if (comment != null && (comment.getNeedSpin() == null || comment.getNeedSpin())) { |
| | | try { |
| | | newText = convertLinkManager.convertLinkFromText(text, uid, true); |
| | | } catch (ConvertLinkExceptionException e) { |
| | | if (e.getCode() != ConvertLinkExceptionException.CODE_NONE) { |
| | | out.print(JsonUtil.loadFalseResult("评论生成失败")); |
| | | return; |
| | | } |
| | | } catch (Exception e) { |
| | | LogHelper.errorDetailInfo(e); |
| | | out.print(JsonUtil.loadFalseResult("评论生成失败")); |
| | | return; |
| | | } |
| | | } |
| | | String newText = text; // 非通用券需要验证 |
| | | if (comment != null && (comment.getNeedSpin() == null || comment.getNeedSpin())) { |
| | | try { |
| | | newText = convertLinkManager.convertLinkFromText(text, uid, true); |
| | | } catch (ConvertLinkExceptionException e) { |
| | | if (e.getCode() != ConvertLinkExceptionException.CODE_NONE) { |
| | | out.print(JsonUtil.loadFalseResult("评论生成失败")); |
| | | return; |
| | | } |
| | | } catch (Exception e) { |
| | | LogHelper.errorDetailInfo(e); |
| | | out.print(JsonUtil.loadFalseResult("评论生成失败")); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | // 替换价格 |
| | | if (goodsEvaluate.getType() == EvaluateEnum.single) { |
| | | GoodsDetailVO goods = goodsEvaluate.getGoods(); |
| | | newText = newText.replace("[原价]", MoneyBigDecimalUtil.getWithNoZera(goods.getZkPrice()) + ""); |
| | | if (!goods.isHasCoupon()) { |
| | | newText = newText.replace("领券抢购", "抢购"); |
| | | newText = newText.replace("【券后价】[券后价]元", ""); |
| | | } else { |
| | | newText = newText.replace("[券后价]", MoneyBigDecimalUtil.getWithNoZera(goods.getCouponPrice()) + ""); |
| | | } |
| | | newText = newText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n"); |
| | | } |
| | | // 替换价格 |
| | | if (goodsEvaluate.getType() == EvaluateEnum.single) { |
| | | GoodsDetailVO goods = goodsEvaluate.getGoods(); |
| | | newText = newText.replace("[原价]", MoneyBigDecimalUtil.getWithNoZera(goods.getZkPrice()) + ""); |
| | | if (!goods.isHasCoupon()) { |
| | | newText = newText.replace("领券抢购", "抢购"); |
| | | newText = newText.replace("【券后价】[券后价]元", ""); |
| | | } else { |
| | | newText = newText.replace("[券后价]", MoneyBigDecimalUtil.getWithNoZera(goods.getCouponPrice()) + ""); |
| | | } |
| | | newText = newText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n"); |
| | | } |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | data.put("text", newText); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | JSONObject data = new JSONObject(); |
| | | data.put("text", newText); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | |
| | | executor.execute(new Runnable() { |
| | | @Override |
| | | public void run() { // 添加每日统计 |
| | | dailyCountMomentsService.addCopyComment(); |
| | | } |
| | | }); |
| | | } |
| | | executor.execute(new Runnable() { |
| | | @Override |
| | | public void run() { // 添加每日统计 |
| | | dailyCountMomentsService.addCopyComment(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 评论复制-专题 |
| | | * |
| | | * @param acceptData |
| | | * @param id |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "copySpecialComment", method = RequestMethod.POST) |
| | | public void copySpecialComment(AcceptData acceptData, Long uid, Long id, PrintWriter out) { |
| | | if (uid == null || id == null) { |
| | | out.print(JsonUtil.loadFalseResult("参数不能为空")); |
| | | return; |
| | | } |
| | | /** |
| | | * 评论复制-专题 |
| | | * |
| | | * @param acceptData |
| | | * @param id |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "copySpecialComment", method = RequestMethod.POST) |
| | | public void copySpecialComment(AcceptData acceptData, Long uid, Long id, PrintWriter out) { |
| | | if (uid == null || id == null) { |
| | | out.print(JsonUtil.loadFalseResult("参数不能为空")); |
| | | return; |
| | | } |
| | | |
| | | CommonShareInfo shareInfo = commonShareInfoService.getByPidAndType(id, CommonShareInfoEnum.special.name()); |
| | | if (shareInfo == null || StringUtil.isNullOrEmpty(shareInfo.getComment())) { |
| | | out.print(JsonUtil.loadFalseResult("该内容已不存在")); |
| | | return; |
| | | } |
| | | CommonShareInfo shareInfo = commonShareInfoService.getByPidAndType(id, CommonShareInfoEnum.special.name()); |
| | | if (shareInfo == null || StringUtil.isNullOrEmpty(shareInfo.getComment())) { |
| | | out.print(JsonUtil.loadFalseResult("该内容已不存在")); |
| | | return; |
| | | } |
| | | |
| | | UserInfo user = userInfoService.getUserByIdWithMybatis(uid); |
| | | if (user == null) { |
| | | out.print(JsonUtil.loadFalseResult("用户未登录")); |
| | | return; |
| | | } |
| | | UserInfo user = userInfoService.getUserByIdWithMybatis(uid); |
| | | if (user == null) { |
| | | out.print(JsonUtil.loadFalseResult("用户未登录")); |
| | | return; |
| | | } |
| | | |
| | | if (user != null && user.getState() != UserInfo.STATE_NORMAL) { |
| | | out.print(JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC)); |
| | | return; |
| | | } |
| | | if (user != null && user.getState() != UserInfo.STATE_NORMAL) { |
| | | out.print(JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC)); |
| | | return; |
| | | } |
| | | |
| | | UserExtraTaoBaoInfo taoBaoInfo = userExtraTaoBaoInfoService.getByUid(uid); |
| | | String relationId = null; |
| | | if (taoBaoInfo != null && taoBaoInfo.getRelationId() != null && taoBaoInfo.getRelationValid() != null |
| | | && taoBaoInfo.getRelationValid() == true) |
| | | relationId = taoBaoInfo.getRelationId(); |
| | | UserExtraTaoBaoInfo taoBaoInfo = userExtraTaoBaoInfoService.getByUid(uid); |
| | | String relationId = null; |
| | | if (taoBaoInfo != null && taoBaoInfo.getRelationId() != null && taoBaoInfo.getRelationValid() != null |
| | | && taoBaoInfo.getRelationValid() == true) |
| | | relationId = taoBaoInfo.getRelationId(); |
| | | |
| | | if (StringUtil.isNullOrEmpty(relationId)) { |
| | | out.print(JsonUtil.loadFalseResult(2, "淘宝未授权,请前往\"我的\"绑定淘宝账号")); |
| | | return; |
| | | } |
| | | if (StringUtil.isNullOrEmpty(relationId)) { |
| | | out.print(JsonUtil.loadFalseResult(2, "淘宝未授权,请前往\"我的\"绑定淘宝账号")); |
| | | return; |
| | | } |
| | | |
| | | String text = shareInfo.getComment(); |
| | | String newText = text; |
| | | if (shareInfo.getNeedSpin() != null && shareInfo.getNeedSpin()) { |
| | | try { |
| | | newText = convertLinkManager.convertLinkFromText(text, uid, true); |
| | | } catch (ConvertLinkExceptionException e) { |
| | | if (e.getCode() != ConvertLinkExceptionException.CODE_NONE) { |
| | | out.print(JsonUtil.loadFalseResult("评论生成失败")); |
| | | return; |
| | | } |
| | | } catch (Exception e) { |
| | | LogHelper.errorDetailInfo(e); |
| | | out.print(JsonUtil.loadFalseResult("评论生成失败")); |
| | | return; |
| | | } |
| | | } |
| | | String text = shareInfo.getComment(); |
| | | String newText = text; |
| | | if (shareInfo.getNeedSpin() != null && shareInfo.getNeedSpin()) { |
| | | try { |
| | | newText = convertLinkManager.convertLinkFromText(text, uid, true); |
| | | } catch (ConvertLinkExceptionException e) { |
| | | if (e.getCode() != ConvertLinkExceptionException.CODE_NONE) { |
| | | out.print(JsonUtil.loadFalseResult("评论生成失败")); |
| | | return; |
| | | } |
| | | } catch (Exception e) { |
| | | LogHelper.errorDetailInfo(e); |
| | | out.print(JsonUtil.loadFalseResult("评论生成失败")); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | data.put("text", newText); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | JSONObject data = new JSONObject(); |
| | | data.put("text", newText); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | |
| | | @RequestMapping(value = "getActivityDetail") |
| | | public void getActivityDetail(String callback, AcceptData acceptData, Long uid, String type, String id, |
| | | PrintWriter out) { |
| | | if (uid == null || StringUtil.isNullOrEmpty(id) || StringUtil.isNullOrEmpty(type)) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("参数不能为空")); |
| | | return; |
| | | } |
| | | @RequestMapping(value = "getActivityDetail") |
| | | public void getActivityDetail(String callback, AcceptData acceptData, Long uid, String type, String id, |
| | | PrintWriter out) { |
| | | if (uid == null || StringUtil.isNullOrEmpty(id) || StringUtil.isNullOrEmpty(type)) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("参数不能为空")); |
| | | return; |
| | | } |
| | | |
| | | String title = ""; |
| | | String comment = ""; |
| | | String params = ""; |
| | | String desc = ""; |
| | | Date startTime = null; |
| | | Date endTime = null; |
| | | JumpDetailV2 jumpDetail = null; |
| | | List<String> imgs = new ArrayList<>(); |
| | | if ("circle".equalsIgnoreCase(type)) { // 发圈活动 |
| | | GoodsEvaluate evaluate = goodsEvaluateService.getById(id); |
| | | if (evaluate == null) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该活动已下架")); |
| | | return; |
| | | } |
| | | String title = ""; |
| | | String comment = ""; |
| | | String params = ""; |
| | | String desc = ""; |
| | | Date startTime = null; |
| | | Date endTime = null; |
| | | JumpDetailV2 jumpDetail = null; |
| | | List<String> imgs = new ArrayList<>(); |
| | | if ("circle".equalsIgnoreCase(type)) { // 发圈活动 |
| | | GoodsEvaluate evaluate = goodsEvaluateService.getById(id); |
| | | if (evaluate == null) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该活动已下架")); |
| | | return; |
| | | } |
| | | |
| | | title = evaluate.getTitle(); |
| | | List<CommentInfo> comments = evaluate.getComments(); |
| | | if (comments != null && comments.size() > 0) { |
| | | comment = comments.get(0).getContent(); |
| | | } |
| | | title = evaluate.getTitle(); |
| | | List<CommentInfo> comments = evaluate.getComments(); |
| | | if (comments != null && comments.size() > 0) { |
| | | comment = comments.get(0).getContent(); |
| | | } |
| | | |
| | | String jumpLink = null; |
| | | if (!StringUtil.isNullOrEmpty(evaluate.getJumpLink())) { |
| | | jumpLink = evaluate.getJumpLink(); |
| | | } |
| | | String jumpLink = null; |
| | | if (!StringUtil.isNullOrEmpty(evaluate.getJumpLink())) { |
| | | jumpLink = evaluate.getJumpLink(); |
| | | } |
| | | |
| | | List<ImgInfo> imgList = evaluate.getImgList(); |
| | | if (imgList != null && imgList.size() > 0) { |
| | | for (ImgInfo imgInfo : imgList) { |
| | | if (!StringUtil.isNullOrEmpty(imgInfo.getUrl()) |
| | | && (imgInfo.getType() == ImgEnum.img || imgInfo.getType() == ImgEnum.activity)) { |
| | | imgs.add(imgInfo.getUrl()); |
| | | } |
| | | List<ImgInfo> imgList = evaluate.getImgList(); |
| | | if (imgList != null && imgList.size() > 0) { |
| | | for (ImgInfo imgInfo : imgList) { |
| | | if (!StringUtil.isNullOrEmpty(imgInfo.getUrl()) |
| | | && (imgInfo.getType() == ImgEnum.img || imgInfo.getType() == ImgEnum.activity)) { |
| | | imgs.add(imgInfo.getUrl()); |
| | | } |
| | | |
| | | if (imgInfo.getType() == ImgEnum.img || imgInfo.getType() == ImgEnum.activity) { |
| | | if (StringUtil.isNullOrEmpty(jumpLink) && !StringUtil.isNullOrEmpty(imgInfo.getActivityUrl())) { |
| | | jumpLink = imgInfo.getActivityUrl(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (imgInfo.getType() == ImgEnum.img || imgInfo.getType() == ImgEnum.activity) { |
| | | if (StringUtil.isNullOrEmpty(jumpLink) && !StringUtil.isNullOrEmpty(imgInfo.getActivityUrl())) { |
| | | jumpLink = imgInfo.getActivityUrl(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | int platformCode = Constant.getPlatformCode(acceptData.getPlatform()); |
| | | jumpDetail = jumpDetailV2Service.getByTypeCache("web", platformCode, |
| | | Integer.parseInt(acceptData.getVersion())); |
| | | JSONObject inner = new JSONObject(); |
| | | inner.put("url", jumpLink); |
| | | params = inner.toString(); |
| | | } else { |
| | | long pid = Long.parseLong(id); |
| | | if (CommonShareInfoEnum.special.name().equalsIgnoreCase(type)) { |
| | | Special special = specialService.selectByPrimaryKey(pid); |
| | | if (special == null) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该活动已下架")); |
| | | return; |
| | | } |
| | | int platformCode = Constant.getPlatformCode(acceptData.getPlatform()); |
| | | jumpDetail = jumpDetailV2Service.getByTypeCache("web", platformCode, |
| | | Integer.parseInt(acceptData.getVersion())); |
| | | JSONObject inner = new JSONObject(); |
| | | inner.put("url", jumpLink); |
| | | params = inner.toString(); |
| | | } else { |
| | | long pid = Long.parseLong(id); |
| | | if (CommonShareInfoEnum.special.name().equalsIgnoreCase(type)) { |
| | | Special special = specialService.selectByPrimaryKey(pid); |
| | | if (special == null) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该活动已下架")); |
| | | return; |
| | | } |
| | | |
| | | params = special.getParams(); |
| | | jumpDetail = special.getJumpDetail(); |
| | | if (!StringUtil.isNullOrEmpty(special.getPicture())) { |
| | | imgs.add(special.getPicture()); |
| | | } |
| | | params = special.getParams(); |
| | | jumpDetail = special.getJumpDetail(); |
| | | if (!StringUtil.isNullOrEmpty(special.getPicture())) { |
| | | imgs.add(special.getPicture()); |
| | | } |
| | | |
| | | title = special.getName(); |
| | | title = special.getName(); |
| | | |
| | | desc = special.getRemark(); |
| | | startTime = special.getStartTime(); |
| | | endTime = special.getEndTime(); |
| | | } else if (CommonShareInfoEnum.banner.name().equalsIgnoreCase(type)) { |
| | | SwiperPicture swiper = swiperPictureService.selectByPrimaryKey(pid); |
| | | if (swiper == null) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该活动已下架")); |
| | | return; |
| | | } |
| | | params = swiper.getParams(); |
| | | jumpDetail = swiper.getJumpDetail(); |
| | | if (!StringUtil.isNullOrEmpty(swiper.getSrc())) { |
| | | imgs.add(swiper.getSrc()); |
| | | } |
| | | desc = special.getRemark(); |
| | | startTime = special.getStartTime(); |
| | | endTime = special.getEndTime(); |
| | | } else if (CommonShareInfoEnum.banner.name().equalsIgnoreCase(type)) { |
| | | SwiperPicture swiper = swiperPictureService.selectByPrimaryKey(pid); |
| | | if (swiper == null) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该活动已下架")); |
| | | return; |
| | | } |
| | | params = swiper.getParams(); |
| | | jumpDetail = swiper.getJumpDetail(); |
| | | if (!StringUtil.isNullOrEmpty(swiper.getSrc())) { |
| | | imgs.add(swiper.getSrc()); |
| | | } |
| | | |
| | | title = swiper.getTitle(); |
| | | desc = swiper.getDesc(); |
| | | startTime = swiper.getStartTime(); |
| | | endTime = swiper.getEndTime(); |
| | | } |
| | | CommonShareInfo shareInfo = commonShareInfoService.getByPidAndType(pid, type); |
| | | if (shareInfo != null && !StringUtil.isNullOrEmpty(shareInfo.getComment())) { |
| | | comment = shareInfo.getComment(); |
| | | } |
| | | } |
| | | title = swiper.getTitle(); |
| | | desc = swiper.getDesc(); |
| | | startTime = swiper.getStartTime(); |
| | | endTime = swiper.getEndTime(); |
| | | } |
| | | CommonShareInfo shareInfo = commonShareInfoService.getByPidAndType(pid, type); |
| | | if (shareInfo != null && !StringUtil.isNullOrEmpty(shareInfo.getComment())) { |
| | | comment = shareInfo.getComment(); |
| | | } |
| | | } |
| | | |
| | | if (!StringUtil.isNullOrEmpty(comment)) { // 替换淘宝官方活动 |
| | | List<String> activityIdList = convertLinkManager.getTaoBaoOfficialActivityId(comment); |
| | | for (String st : activityIdList) |
| | | comment = comment.replace(st, ""); |
| | | } |
| | | if (!StringUtil.isNullOrEmpty(comment)) { // 替换淘宝官方活动 |
| | | List<String> activityIdList = convertLinkManager.getTaoBaoOfficialActivityId(comment); |
| | | for (String st : activityIdList) |
| | | comment = comment.replace(st, ""); |
| | | } |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | data.put("title", title); |
| | | data.put("desc", desc); |
| | | data.put("comment", comment); |
| | | data.put("params", params); |
| | | data.put("jumpDetail", jumpDetail); |
| | | data.put("imgs", imgs); |
| | | if (startTime != null) { |
| | | data.put("startTime", TimeUtil.getGernalTime(startTime.getTime(), "yyyy.MM.dd")); |
| | | } |
| | | JSONObject data = new JSONObject(); |
| | | data.put("title", title); |
| | | data.put("desc", desc); |
| | | data.put("comment", comment); |
| | | data.put("params", params); |
| | | data.put("jumpDetail", jumpDetail); |
| | | data.put("imgs", imgs); |
| | | if (startTime != null) { |
| | | data.put("startTime", TimeUtil.getGernalTime(startTime.getTime(), "yyyy.MM.dd")); |
| | | } |
| | | |
| | | if (endTime != null) { |
| | | data.put("endTime", TimeUtil.getGernalTime(endTime.getTime(), "yyyy.MM.dd")); |
| | | } |
| | | |
| | | if (endTime != null) { |
| | | data.put("endTime", TimeUtil.getGernalTime(endTime.getTime(), "yyyy.MM.dd")); |
| | | } |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); |
| | | } |
| | | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); |
| | | } |
| | | /** |
| | | * 评论复制-专题 |
| | | * |
| | | * @param acceptData |
| | | * @param id |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "copyShareComment") |
| | | public void copyShareComment(String callback, AcceptData acceptData, Long uid, String id, String type, |
| | | PrintWriter out) { |
| | | if (uid == null || StringUtil.isNullOrEmpty(id) || StringUtil.isNullOrEmpty(type)) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("参数不能为空")); |
| | | return; |
| | | } |
| | | |
| | | /** |
| | | * 评论复制-专题 |
| | | * |
| | | * @param acceptData |
| | | * @param id |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "copyShareComment") |
| | | public void copyShareComment(String callback, AcceptData acceptData, Long uid, String id, String type, |
| | | PrintWriter out) { |
| | | if (uid == null || StringUtil.isNullOrEmpty(id) || StringUtil.isNullOrEmpty(type)) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("参数不能为空")); |
| | | return; |
| | | } |
| | | if ("circle".equalsIgnoreCase(type)) { // 发圈活动 |
| | | copyActivityComment(callback, acceptData, uid, id, out); |
| | | return; |
| | | } |
| | | |
| | | if ("circle".equalsIgnoreCase(type)) { // 发圈活动 |
| | | copyActivityComment(callback, acceptData, uid, id, out); |
| | | return; |
| | | } |
| | | long pid = Long.parseLong(id); |
| | | CommonShareInfo shareInfo = commonShareInfoService.getByPidAndType(pid, type); |
| | | if (shareInfo == null || StringUtil.isNullOrEmpty(shareInfo.getComment())) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该内容已不存在")); |
| | | return; |
| | | } |
| | | |
| | | long pid = Long.parseLong(id); |
| | | CommonShareInfo shareInfo = commonShareInfoService.getByPidAndType(pid, type); |
| | | if (shareInfo == null || StringUtil.isNullOrEmpty(shareInfo.getComment())) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该内容已不存在")); |
| | | return; |
| | | } |
| | | UserInfo user = userInfoService.getUserByIdWithMybatis(uid); |
| | | if (user == null) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户未登录")); |
| | | return; |
| | | } |
| | | |
| | | UserInfo user = userInfoService.getUserByIdWithMybatis(uid); |
| | | if (user == null) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户未登录")); |
| | | return; |
| | | } |
| | | if (user != null && user.getState() != UserInfo.STATE_NORMAL) { |
| | | JsonUtil.printMode(out, callback, |
| | | JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC)); |
| | | return; |
| | | } |
| | | |
| | | if (user != null && user.getState() != UserInfo.STATE_NORMAL) { |
| | | JsonUtil.printMode(out, callback, |
| | | JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC)); |
| | | return; |
| | | } |
| | | UserExtraTaoBaoInfo taoBaoInfo = userExtraTaoBaoInfoService.getByUid(uid); |
| | | String relationId = null; |
| | | if (taoBaoInfo != null && taoBaoInfo.getRelationId() != null && taoBaoInfo.getRelationValid() != null |
| | | && taoBaoInfo.getRelationValid() == true) |
| | | relationId = taoBaoInfo.getRelationId(); |
| | | |
| | | UserExtraTaoBaoInfo taoBaoInfo = userExtraTaoBaoInfoService.getByUid(uid); |
| | | String relationId = null; |
| | | if (taoBaoInfo != null && taoBaoInfo.getRelationId() != null && taoBaoInfo.getRelationValid() != null |
| | | && taoBaoInfo.getRelationValid() == true) |
| | | relationId = taoBaoInfo.getRelationId(); |
| | | if (StringUtil.isNullOrEmpty(relationId)) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(2, "淘宝未授权,请前往\"我的\"绑定淘宝账号")); |
| | | return; |
| | | } |
| | | |
| | | if (StringUtil.isNullOrEmpty(relationId)) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(2, "淘宝未授权,请前往\"我的\"绑定淘宝账号")); |
| | | return; |
| | | } |
| | | String text = shareInfo.getComment(); |
| | | String newText = text; |
| | | if (shareInfo.getNeedSpin() != null && shareInfo.getNeedSpin()) { |
| | | try { |
| | | newText = convertLinkManager.convertLinkFromText(text, uid, true); |
| | | } catch (ConvertLinkExceptionException e) { |
| | | if (e.getCode() != ConvertLinkExceptionException.CODE_NONE) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("评论生成失败")); |
| | | return; |
| | | } |
| | | } catch (Exception e) { |
| | | LogHelper.errorDetailInfo(e); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("评论生成失败")); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | String text = shareInfo.getComment(); |
| | | String newText = text; |
| | | if (shareInfo.getNeedSpin() != null && shareInfo.getNeedSpin()) { |
| | | try { |
| | | newText = convertLinkManager.convertLinkFromText(text, uid, true); |
| | | } catch (ConvertLinkExceptionException e) { |
| | | if (e.getCode() != ConvertLinkExceptionException.CODE_NONE) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("评论生成失败")); |
| | | return; |
| | | } |
| | | } catch (Exception e) { |
| | | LogHelper.errorDetailInfo(e); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("评论生成失败")); |
| | | return; |
| | | } |
| | | } |
| | | JSONObject data = new JSONObject(); |
| | | data.put("text", newText); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); |
| | | } |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | data.put("text", newText); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); |
| | | } |
| | | /** |
| | | * 活动分享绘图 |
| | | * |
| | | * @param type |
| | | * @param id |
| | | * @param erCodeContent |
| | | * @return String 返回类型 |
| | | * @throws |
| | | * @Title: createActivityShareImg |
| | | * @Description: |
| | | */ |
| | | private String createActivityShareImg(String type, String id, String erCodeContent) { |
| | | |
| | | /** |
| | | * 活动分享绘图 |
| | | * @Title: createActivityShareImg |
| | | * @Description: |
| | | * @param type |
| | | * @param id |
| | | * @param erCodeContent |
| | | * @return |
| | | * String 返回类型 |
| | | * @throws |
| | | */ |
| | | private String createActivityShareImg(String type, String id, String erCodeContent) { |
| | | String title = ""; |
| | | String desc = ""; |
| | | String img = ""; |
| | | if ("circle".equalsIgnoreCase(type)) { |
| | | |
| | | String title = ""; |
| | | String desc = ""; |
| | | String img = ""; |
| | | if ("circle".equalsIgnoreCase(type)) { |
| | | } else if ("banner".equalsIgnoreCase(type)) { |
| | | SwiperPicture picture = swiperPictureService.selectByPrimaryKey(Long.parseLong(id)); |
| | | title = picture.getTitle(); |
| | | desc = picture.getDesc(); |
| | | img = picture.getSrc(); |
| | | } else if ("special".equalsIgnoreCase(type)) { |
| | | Special special = specialService.selectByPrimaryKey(Long.parseLong(id)); |
| | | title = special.getName(); |
| | | desc = special.getRemark(); |
| | | img = special.getPicture(); |
| | | } |
| | | |
| | | } else if ("banner".equalsIgnoreCase(type)) { |
| | | SwiperPicture picture = swiperPictureService.selectByPrimaryKey(Long.parseLong(id)); |
| | | title = picture.getTitle(); |
| | | desc = picture.getDesc(); |
| | | img = picture.getSrc(); |
| | | } else if ("special".equalsIgnoreCase(type)) { |
| | | Special special = specialService.selectByPrimaryKey(Long.parseLong(id)); |
| | | title = special.getName(); |
| | | desc = special.getRemark(); |
| | | img = special.getPicture(); |
| | | } |
| | | try { |
| | | InputStream erCodeInputStream = null; |
| | | erCodeInputStream = QRCodeUtil.getInstance(250).encode(erCodeContent); |
| | | int[] size = new int[2]; |
| | | try { |
| | | size = ImageUtil.getImgWidthAndHeight(img); |
| | | } catch (MalformedURLException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | InputStream resultInputStream = ImageUtil.drawActivityShareImg(HttpUtil.getAsInputStream(img), |
| | | (float) size[0] / size[1], title, desc, erCodeInputStream); |
| | | if (resultInputStream != null) { |
| | | String filePath = FilePathEnum.activityShare.getPath() + UUID.randomUUID().toString().replace("-", "") |
| | | + ".png"; |
| | | FileUploadResult result = COSManager.getInstance().uploadFile(resultInputStream, filePath); |
| | | if (result != null) |
| | | return result.getUrl(); |
| | | } |
| | | } catch (Exception e1) { |
| | | e1.printStackTrace(); |
| | | } |
| | | |
| | | try { |
| | | InputStream erCodeInputStream = null; |
| | | erCodeInputStream = QRCodeUtil.getInstance(250).encode(erCodeContent); |
| | | int[] size = new int[2]; |
| | | try { |
| | | size = ImageUtil.getImgWidthAndHeight(img); |
| | | } catch (MalformedURLException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | InputStream resultInputStream = ImageUtil.drawActivityShareImg(HttpUtil.getAsInputStream(img), |
| | | (float) size[0] / size[1], title, desc, erCodeInputStream); |
| | | if (resultInputStream != null) { |
| | | String filePath = FilePathEnum.activityShare.getPath() + UUID.randomUUID().toString().replace("-", "") |
| | | + ".png"; |
| | | FileUploadResult result = COSManager.getInstance().uploadFile(resultInputStream, filePath); |
| | | if (result != null) |
| | | return result.getUrl(); |
| | | } |
| | | } catch (Exception e1) { |
| | | e1.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | /** |
| | | * 评论复制-专题 |
| | | * |
| | | * @param acceptData |
| | | * @param id |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getActivityShareImg") |
| | | public void getActivityShareImg(String callback, AcceptData acceptData, Long uid, String id, String type, |
| | | PrintWriter out) { |
| | | if (uid == null || StringUtil.isNullOrEmpty(id) || StringUtil.isNullOrEmpty(type)) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("参数不能为空")); |
| | | return; |
| | | } |
| | | |
| | | /** |
| | | * 评论复制-专题 |
| | | * |
| | | * @param acceptData |
| | | * @param id |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getActivityShareImg") |
| | | public void getActivityShareImg(String callback, AcceptData acceptData, Long uid, String id, String type, |
| | | PrintWriter out) { |
| | | if (uid == null || StringUtil.isNullOrEmpty(id) || StringUtil.isNullOrEmpty(type)) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("参数不能为空")); |
| | | return; |
| | | } |
| | | if ("circle".equalsIgnoreCase(type)) { // 发圈活动 |
| | | // copyActivityComment(callback, acceptData, uid, id, out); |
| | | // TODO 分享发圈的图 |
| | | return; |
| | | } |
| | | |
| | | if ("circle".equalsIgnoreCase(type)) { // 发圈活动 |
| | | // copyActivityComment(callback, acceptData, uid, id, out); |
| | | // TODO 分享发圈的图 |
| | | return; |
| | | } |
| | | long pid = Long.parseLong(id); |
| | | CommonShareInfo shareInfo = commonShareInfoService.getByPidAndType(pid, type); |
| | | if (shareInfo == null || StringUtil.isNullOrEmpty(shareInfo.getComment())) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该内容已不存在")); |
| | | return; |
| | | } |
| | | |
| | | long pid = Long.parseLong(id); |
| | | CommonShareInfo shareInfo = commonShareInfoService.getByPidAndType(pid, type); |
| | | if (shareInfo == null || StringUtil.isNullOrEmpty(shareInfo.getComment())) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该内容已不存在")); |
| | | return; |
| | | } |
| | | UserInfo user = userInfoService.getUserByIdWithMybatis(uid); |
| | | if (user == null) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户未登录")); |
| | | return; |
| | | } |
| | | |
| | | UserInfo user = userInfoService.getUserByIdWithMybatis(uid); |
| | | if (user == null) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户未登录")); |
| | | return; |
| | | } |
| | | if (user != null && user.getState() != UserInfo.STATE_NORMAL) { |
| | | JsonUtil.printMode(out, callback, |
| | | JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC)); |
| | | return; |
| | | } |
| | | |
| | | if (user != null && user.getState() != UserInfo.STATE_NORMAL) { |
| | | JsonUtil.printMode(out, callback, |
| | | JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC)); |
| | | return; |
| | | } |
| | | UserExtraTaoBaoInfo taoBaoInfo = userExtraTaoBaoInfoService.getByUid(uid); |
| | | String relationId = null; |
| | | if (taoBaoInfo != null && taoBaoInfo.getRelationId() != null && taoBaoInfo.getRelationValid() != null |
| | | && taoBaoInfo.getRelationValid() == true) |
| | | relationId = taoBaoInfo.getRelationId(); |
| | | |
| | | UserExtraTaoBaoInfo taoBaoInfo = userExtraTaoBaoInfoService.getByUid(uid); |
| | | String relationId = null; |
| | | if (taoBaoInfo != null && taoBaoInfo.getRelationId() != null && taoBaoInfo.getRelationValid() != null |
| | | && taoBaoInfo.getRelationValid() == true) |
| | | relationId = taoBaoInfo.getRelationId(); |
| | | if (StringUtil.isNullOrEmpty(relationId)) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(2, "淘宝未授权,请前往\"我的\"绑定淘宝账号")); |
| | | return; |
| | | } |
| | | |
| | | if (StringUtil.isNullOrEmpty(relationId)) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(2, "淘宝未授权,请前往\"我的\"绑定淘宝账号")); |
| | | return; |
| | | } |
| | | String text = shareInfo.getComment(); |
| | | String newText = text; |
| | | String imgUrl = null; |
| | | if (shareInfo.getNeedSpin() != null && shareInfo.getNeedSpin()) { |
| | | try { |
| | | String erCodeContent = ""; |
| | | newText = convertLinkManager.convertLinkFromText(text, uid, true); |
| | | // 获取口令 |
| | | List<String> tokenList = TaoBaoUtil.getTokenListFromTextWithKuoHao(newText); |
| | | if (tokenList != null && tokenList.size() > 0) { |
| | | // 构造分享链接 |
| | | erCodeContent = ShareControllerV2.getTaoBaoActiivtyERCodeContentNew( |
| | | configService.getValue(ConfigKeyEnum.taobaoShareQrcodeText.getKey(), SystemInfoUtil.getSystem(acceptData)), tokenList.get(0)); |
| | | } else { |
| | | // 获取链接 |
| | | List<String> urlList = JDUtil.getJDShortLinksFromText(newText); |
| | | if (urlList != null && urlList.size() > 0) { |
| | | erCodeContent = urlList.get(0); |
| | | } else { |
| | | urlList = PinDuoDuoUtil.getPDDShortLinksFromText(newText); |
| | | if (urlList != null && urlList.size() > 0) { |
| | | erCodeContent = urlList.get(0); |
| | | } |
| | | } |
| | | } |
| | | |
| | | String text = shareInfo.getComment(); |
| | | String newText = text; |
| | | String imgUrl = null; |
| | | if (shareInfo.getNeedSpin() != null && shareInfo.getNeedSpin()) { |
| | | try { |
| | | String erCodeContent = ""; |
| | | newText = convertLinkManager.convertLinkFromText(text, uid, true); |
| | | // 获取口令 |
| | | List<String> tokenList = TaoBaoUtil.getTokenListFromTextWithKuoHao(newText); |
| | | if (tokenList != null && tokenList.size() > 0) { |
| | | // 构造分享链接 |
| | | erCodeContent = ShareControllerV2.getTaoBaoActiivtyERCodeContentNew( |
| | | configService.getValue(ConfigKeyEnum.taobaoShareQrcodeText.getKey(),SystemInfoUtil.getSystem(acceptData)), tokenList.get(0)); |
| | | } else { |
| | | // 获取链接 |
| | | List<String> urlList = JDUtil.getJDShortLinksFromText(newText); |
| | | if (urlList != null && urlList.size() > 0) { |
| | | erCodeContent = urlList.get(0); |
| | | } else { |
| | | urlList = PinDuoDuoUtil.getPDDShortLinksFromText(newText); |
| | | if (urlList != null && urlList.size() > 0) { |
| | | erCodeContent = urlList.get(0); |
| | | } |
| | | } |
| | | } |
| | | imgUrl = createActivityShareImg(type, id, erCodeContent); |
| | | } catch (ConvertLinkExceptionException e) { |
| | | if (e.getCode() != ConvertLinkExceptionException.CODE_NONE) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("评论生成失败")); |
| | | return; |
| | | } |
| | | } catch (Exception e) { |
| | | LogHelper.errorDetailInfo(e); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("评论生成失败")); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | imgUrl = createActivityShareImg(type, id, erCodeContent); |
| | | } catch (ConvertLinkExceptionException e) { |
| | | if (e.getCode() != ConvertLinkExceptionException.CODE_NONE) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("评论生成失败")); |
| | | return; |
| | | } |
| | | } catch (Exception e) { |
| | | LogHelper.errorDetailInfo(e); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("评论生成失败")); |
| | | return; |
| | | } |
| | | } |
| | | if (StringUtil.isNullOrEmpty(imgUrl)) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("分享图生成失败")); |
| | | } else { |
| | | JSONObject data = new JSONObject(); |
| | | data.put("text", newText); |
| | | data.put("img", imgUrl); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); |
| | | } |
| | | } |
| | | |
| | | if (StringUtil.isNullOrEmpty(imgUrl)) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("分享图生成失败")); |
| | | } else { |
| | | JSONObject data = new JSONObject(); |
| | | data.put("text", newText); |
| | | data.put("img", imgUrl); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); |
| | | } |
| | | } |
| | | /** |
| | | * 评论复制 |
| | | * |
| | | * @param acceptData |
| | | * @param id |
| | | * @param out |
| | | */ |
| | | private void copyActivityComment(String callback, AcceptData acceptData, Long uid, String id, PrintWriter out) { |
| | | if (StringUtil.isNullOrEmpty(id)) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("id不能为空")); |
| | | return; |
| | | } |
| | | |
| | | /** |
| | | * 评论复制 |
| | | * |
| | | * @param acceptData |
| | | * @param id |
| | | * @param out |
| | | */ |
| | | private void copyActivityComment(String callback, AcceptData acceptData, Long uid, String id, PrintWriter out) { |
| | | if (StringUtil.isNullOrEmpty(id)) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("id不能为空")); |
| | | return; |
| | | } |
| | | GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(id); |
| | | if (goodsEvaluate == null) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该内容已不存在")); |
| | | return; |
| | | } |
| | | |
| | | GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(id); |
| | | if (goodsEvaluate == null) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该内容已不存在")); |
| | | return; |
| | | } |
| | | UserInfo user = userInfoService.getUserByIdWithMybatis(uid); |
| | | if (user == null) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户未登录")); |
| | | return; |
| | | } |
| | | |
| | | UserInfo user = userInfoService.getUserByIdWithMybatis(uid); |
| | | if (user == null) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户未登录")); |
| | | return; |
| | | } |
| | | if (user != null && user.getState() != UserInfo.STATE_NORMAL) { |
| | | JsonUtil.printMode(out, callback, |
| | | JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC)); |
| | | return; |
| | | } |
| | | |
| | | if (user != null && user.getState() != UserInfo.STATE_NORMAL) { |
| | | JsonUtil.printMode(out, callback, |
| | | JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC)); |
| | | return; |
| | | } |
| | | UserExtraTaoBaoInfo taoBaoInfo = userExtraTaoBaoInfoService.getByUid(uid); |
| | | String relationId = null; |
| | | if (taoBaoInfo != null && taoBaoInfo.getRelationId() != null && taoBaoInfo.getRelationValid() != null |
| | | && taoBaoInfo.getRelationValid() == true) |
| | | relationId = taoBaoInfo.getRelationId(); |
| | | |
| | | UserExtraTaoBaoInfo taoBaoInfo = userExtraTaoBaoInfoService.getByUid(uid); |
| | | String relationId = null; |
| | | if (taoBaoInfo != null && taoBaoInfo.getRelationId() != null && taoBaoInfo.getRelationValid() != null |
| | | && taoBaoInfo.getRelationValid() == true) |
| | | relationId = taoBaoInfo.getRelationId(); |
| | | if (StringUtil.isNullOrEmpty(relationId)) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(2, "淘宝未授权,请前往\"我的\"绑定淘宝账号")); |
| | | return; |
| | | } |
| | | |
| | | if (StringUtil.isNullOrEmpty(relationId)) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(2, "淘宝未授权,请前往\"我的\"绑定淘宝账号")); |
| | | return; |
| | | } |
| | | String text = ""; |
| | | CommentInfo comment = null; |
| | | List<CommentInfo> comments = goodsEvaluate.getComments(); |
| | | if (comments != null && comments.size() > 0) { |
| | | CommentInfo info = comments.get(0); |
| | | text = info.getContent(); |
| | | comment = info; |
| | | } |
| | | |
| | | String text = ""; |
| | | CommentInfo comment = null; |
| | | List<CommentInfo> comments = goodsEvaluate.getComments(); |
| | | if (comments != null && comments.size() > 0) { |
| | | CommentInfo info = comments.get(0); |
| | | text = info.getContent(); |
| | | comment = info; |
| | | } |
| | | String newText = text; // 非通用券需要验证 |
| | | if (comment != null && (comment.getNeedSpin() == null || comment.getNeedSpin())) { |
| | | try { |
| | | newText = convertLinkManager.convertLinkFromText(text, uid, true); |
| | | } catch (ConvertLinkExceptionException e) { |
| | | if (e.getCode() != ConvertLinkExceptionException.CODE_NONE) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("评论生成失败")); |
| | | return; |
| | | } |
| | | } catch (Exception e) { |
| | | LogHelper.errorDetailInfo(e); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("评论生成失败")); |
| | | return; |
| | | } |
| | | } |
| | | JSONObject data = new JSONObject(); |
| | | data.put("text", newText); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); |
| | | |
| | | String newText = text; // 非通用券需要验证 |
| | | if (comment != null && (comment.getNeedSpin() == null || comment.getNeedSpin())) { |
| | | try { |
| | | newText = convertLinkManager.convertLinkFromText(text, uid, true); |
| | | } catch (ConvertLinkExceptionException e) { |
| | | if (e.getCode() != ConvertLinkExceptionException.CODE_NONE) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("评论生成失败")); |
| | | return; |
| | | } |
| | | } catch (Exception e) { |
| | | LogHelper.errorDetailInfo(e); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("评论生成失败")); |
| | | return; |
| | | } |
| | | } |
| | | JSONObject data = new JSONObject(); |
| | | data.put("text", newText); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); |
| | | executor.execute(new Runnable() { |
| | | @Override |
| | | public void run() { // 添加每日统计 |
| | | dailyCountMomentsService.addCopyComment(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | executor.execute(new Runnable() { |
| | | @Override |
| | | public void run() { // 添加每日统计 |
| | | dailyCountMomentsService.addCopyComment(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | |
| | | * 获取导航栏内容
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param sex 0通用 1男 2女
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getHomeItems", method = RequestMethod.POST)
|
| | | public void getHomeItems(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | // 获取设备定义性别
|
| | | int deviceSex = deviceSexService.getDeviceSex(acceptData.getDevice());
|
| | | List<HomeNavbar> listNavbar = homeNavbarUserService.listEffectiveNavbar(uid, acceptData.getDevice(), deviceSex);
|
| | | int deviceSex = deviceSexService.getDeviceSex(acceptData.getDevice(),acceptData.getSystem());
|
| | | List<HomeNavbar> listNavbar = homeNavbarUserService.listEffectiveNavbar(uid, acceptData.getDevice(), deviceSex,acceptData.getSystem());
|
| | |
|
| | | List<HomeNavbar> list = new ArrayList<HomeNavbar>();
|
| | | if (listNavbar != null) {
|
| | |
| | | package com.yeshi.fanli.controller.client.v2;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Calendar;
|
| | | import java.util.Collections;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsResult;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.Special;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | |
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisKeyEnum;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.*;
|
| | | import com.yeshi.fanli.util.factory.MonitorFactory;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.util.taobao.DaTaoKeUtil;
|
| | |
| | | import com.yeshi.fanli.vo.search.SearchKeyTOPVO;
|
| | | import com.yeshi.fanli.vo.search.SearchKeyVO;
|
| | | import com.yeshi.fanli.vo.tlj.ReduceHongBao;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import java.io.PrintWriter;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Calendar;
|
| | | import java.util.Collections;
|
| | | import java.util.List;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("api/v2/recommend")
|
| | |
| | | public void getRecommendIndex(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | try {
|
| | | // 获取设备定义性别
|
| | | int deviceSex = deviceSexService.getDeviceSex(acceptData.getDevice());
|
| | | int deviceSex = deviceSexService.getDeviceSex(acceptData.getDevice(),acceptData.getSystem());
|
| | |
|
| | | // 1、专题模块
|
| | | JSONObject root = specialService.listCacheSpecialToIndex(acceptData, deviceSex,acceptData.getSystem());
|
| | |
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import com.yeshi.fanli.entity.SystemEnum;
|
| | | import com.yeshi.fanli.entity.SystemFunction;
|
| | | import com.yeshi.fanli.util.*;
|
| | | import com.yeshi.fanli.vo.taobao.TaoBaoUser;
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 淘宝登录(子APP)
|
| | | *
|
| | | * @param acceptData
|
| | | * @param userData
|
| | | * @param request
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "loginTB", method = RequestMethod.POST)
|
| | | public void loginTB(AcceptData acceptData, String userData,
|
| | | HttpServletRequest request, PrintWriter out) {
|
| | | if (acceptData.getSystem() == SystemEnum.blks) {
|
| | | out.print(JsonUtil.loadFalseResult("暂不支持此种登录方式"));
|
| | | return;
|
| | | }
|
| | | TaoBaoUser taoBaoUser = new Gson().fromJson(userData, TaoBaoUser.class);
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages(), acceptData.getSystem());
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | | }
|
| | |
|
| | | UserInfo userInfo = null;
|
| | | try {
|
| | | userInfo = userAccountService.loginTB(new ProxyIP(request.getRemoteHost(), request.getRemotePort()), taoBaoUser, system);
|
| | | } catch (UserAccountException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getMsg()));
|
| | | }
|
| | |
|
| | | if (userInfo == null) {
|
| | | out.print(JsonUtil.loadFalseResult("登录失败"));
|
| | | } else {
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("userInfo", UserUtil.filterForClientUser(userInfo));
|
| | | data.put("inviteCode", userInfoExtraService.getInviteCodeByUid(userInfo.getId()));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 绑定电话号码 V2.0.1 微信登录
|
| | | *
|
| | |
| | | vo.setTotalInviteMoney(
|
| | | userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate).abs());
|
| | |
|
| | | //累计所有
|
| | | typeList.clear();
|
| | | typeList.add(UserMoneyDetailTypeEnum.fanli);
|
| | | typeList.add(UserMoneyDetailTypeEnum.fanliNew);
|
| | | typeList.add(UserMoneyDetailTypeEnum.fanliWeiQuan);
|
| | | typeList.add(UserMoneyDetailTypeEnum.fanliWeiQuanNew);
|
| | | typeList.add(UserMoneyDetailTypeEnum.orderReward);
|
| | | typeList.add(UserMoneyDetailTypeEnum.orderRewardNew);
|
| | | typeList.add(UserMoneyDetailTypeEnum.share);
|
| | | typeList.add(UserMoneyDetailTypeEnum.shareNew);
|
| | | typeList.add(UserMoneyDetailTypeEnum.shareWeiQuan);
|
| | | vo.setTotalMoney(
|
| | | userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate).abs());
|
| | |
|
| | |
|
| | |
|
| | | if (VersionUtil.greaterThan_2_1_2(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | vo.setMoneyArrivalDesc("尽早确认收货可以促使资金尽早到账");
|
| | |
| | | // 根据获WXUnionId有效用户
|
| | | UserInfo getEffectiveUserInfoByWXUnionId(@Param("unionId") String unionId, @Param("system") SystemEnum system);
|
| | |
|
| | | //根据淘宝openId获取有效用户
|
| | | UserInfo getEffectiveUserInfoByOpenId(@Param("openId") String openId, @Param("system") SystemEnum system);
|
| | |
|
| | |
|
| | |
|
| | | //根据微信openid查询
|
| | | UserInfo getEffectiveUserInfoByWXOpenId(@Param("wxOpenId") String wxOpenId, @Param("system") SystemEnum system);
|
| | |
|
| | |
| | | */ |
| | | public enum SystemEnum { |
| | | blks("com.yeshi.ec.rebate", "com.xyj.ec.fanli-ios", new String[]{}, new SystemFunction[]{ |
| | | SystemFunction.bindPhone, SystemFunction.threeSale, SystemFunction.cloudOrder, SystemFunction.godenCorn, SystemFunction.redPack |
| | | SystemFunction.bindPhone, SystemFunction.threeSale, SystemFunction.cloudOrder, SystemFunction.godenCorn, SystemFunction.redPack,SystemFunction.faQuan |
| | | }, 1, "板栗快省"), |
| | | flq("com.yeshi.ec.flq", "com.xyj.ec.flq-ios", new String[]{}, new SystemFunction[]{}, 2, "返利券"); |
| | | flq("com.fanliunion.android", "com.xyj.ec.flq-ios", new String[]{}, new SystemFunction[]{SystemFunction.faQuan}, 2, "返利联盟"); |
| | | private String packageName; |
| | | private String bundleId; |
| | | private int systemId; |
| | |
| | | godenCorn("金币"), |
| | | cloudOrder("云发单"), |
| | | redPack("红包"), |
| | | faQuan("发圈"), |
| | | vip("超级会员"); |
| | | |
| | | private SystemFunction(String desc) { |
| | |
| | | |
| | | public enum ConfigKeyEnum { |
| | | |
| | | // 提现相关 |
| | | extractWay("extract_way", "是否手动提现"), |
| | | extractDayCount("extract_count_day", "用户每天最大提现次数"), |
| | | extractMoneyMin("extract_min_money", "单笔提现最小金额"), |
| | | extractMoneyMAX("extract_max_money", "单笔提现最大金额"), |
| | | extractMoneyDay("extract_money_day", "用户每天最大提现金额"), |
| | | extractCodeEmailFrom("extract_code_email_from", "发送提现验证码的邮箱"), |
| | | adminMinSameGoodsOrderCount("admin_min_same_goods_order_count", "提现审核列表高危标识同商品订单数量最小值"), |
| | | adminMinSameShopOrderCount("admin_min_same_shop_order_count", "提现审核列表高危标识同店铺订单数量最小值"), |
| | | alipayHelp("alipay_help", "支付宝帮助"), |
| | | alipayBindFailReason("alipay_bind_fail_reason", "支付宝绑定失败可能原因"), |
| | | // 提现相关 |
| | | extractWay("extract_way", "是否手动提现"), |
| | | extractDayCount("extract_count_day", "用户每天最大提现次数"), |
| | | extractMoneyMin("extract_min_money", "单笔提现最小金额"), |
| | | extractMoneyMAX("extract_max_money", "单笔提现最大金额"), |
| | | extractMoneyDay("extract_money_day", "用户每天最大提现金额"), |
| | | extractCodeEmailFrom("extract_code_email_from", "发送提现验证码的邮箱"), |
| | | adminMinSameGoodsOrderCount("admin_min_same_goods_order_count", "提现审核列表高危标识同商品订单数量最小值"), |
| | | adminMinSameShopOrderCount("admin_min_same_shop_order_count", "提现审核列表高危标识同店铺订单数量最小值"), |
| | | alipayHelp("alipay_help", "支付宝帮助"), |
| | | alipayBindFailReason("alipay_bind_fail_reason", "支付宝绑定失败可能原因"), |
| | | |
| | | // 分享商品 |
| | | h5Url("h5_url", "H5网页域名"), |
| | | shareSina("shareSina", "分享商品到新浪的前缀内容"), // 未找到对应Call |
| | | shareRuleLinkJD("share_rule_link_jd", "京东分享规则(帮助中心)"), |
| | | shareRuleLinkPDD("share_rule_link_pdd", "拼多多分享规则(帮助中心)"), |
| | | shareRuleLinkVIP("share_rule_link_vip", "唯品会分享规则(帮助中心)"), |
| | | shareRuleLinkSuning("share_rule_link_suning", "苏宁分享规则(帮助中心)"), |
| | | shareSingleGoodsRule("share_single_goods_rule", "单品分享规则"), |
| | | shareGoodsTemplateRules("share_goods_template_rules", "分享模板规则"), // 存在2个相同 |
| | | // 内容不同、版本但一样 |
| | | shareGoodsTemplateRulesJD("share_goods_template_rules_jd", "京东模板规则"), |
| | | shareGoodsTemplateRulesPDD("share_goods_template_rules_pdd", "拼多多模板规则"), |
| | | shareGoodsTemplateRulesVIP("share_goods_template_rules_vip", "唯品会模板规则"), |
| | | shareGoodsTemplateRulesSuNing("share_goods_template_rules_suning", "苏宁模板规则"), |
| | | goodsShareNotifyImgs("goods_share_notify_imgs", "单个商品分享的券提示图片"), |
| | | goodsShareMultipleNotify("goods_share_multiple_notify", "多个商品分享提醒"), |
| | | goodsShareNotifyImgs207("goods_share_notify_imgs_207", "单个商品分享的券提示图片(2.0.7及以后)"), |
| | | goodsShareNotifyImgsVIP("goods_share_notify_imgs_vip", "单个商品分享的券提示图片(唯品会)"), |
| | | goodsShareNotify("goods_share_notify", "单个商品分享提醒"), |
| | | goodsShareNotifyJD("goods_share_notify_jd", "京东分享提醒"), |
| | | goodsShareNotifyPDD("goods_share_notify_pdd", "拼多多分享提醒"), |
| | | goodsShareNotifyVIP("goods_share_notify_vip", "拼多多分享提醒"), |
| | | goodsShareNotifySuning("goods_share_notify_Suning", "拼多多分享提醒"), |
| | | |
| | | goodsShareTextCoupon("goods_share_text_coupon", "单个商品分享文案(有券)"), |
| | | goodsShareTextCouponJD("goods_share_text_coupon_jd", "京东单个商品分享模板-有券"), |
| | | goodsShareTextCouponPDD("goods_share_text_coupon_pdd", "拼多多单个商品分享模板-有券"), |
| | | goodsShareTextNoCoupon("goods_share_text_nocoupon", "单个商品分享文案(无券)"), |
| | | goodsShareTextNoCouponJD("goods_share_text_nocoupon_jd", "京东单个商品分享模板-无券"), |
| | | goodsShareTextNocouponPDD("goods_share_text_nocoupon_pdd", "拼多多单个商品分享模板-无券"), |
| | | shareSingleGoodsCommentText("share_single_goods_comment_text", "单品分享评论区文案"), |
| | | shareGoodsActivityOpen("share_goods_activity_open", "分享商品订单活动"), |
| | | superHongBaoShareDesc("super-hongbao-share-desc", "双12红包分享语"), |
| | | superYuShouShareDesc("super-yushou-share-desc", "双11预售分享语"), |
| | | // 分享商品 |
| | | h5Url("h5_url", "H5网页域名"), |
| | | shareSina("shareSina", "分享商品到新浪的前缀内容"), // 未找到对应Call |
| | | shareRuleLinkJD("share_rule_link_jd", "京东分享规则(帮助中心)"), |
| | | shareRuleLinkPDD("share_rule_link_pdd", "拼多多分享规则(帮助中心)"), |
| | | shareRuleLinkVIP("share_rule_link_vip", "唯品会分享规则(帮助中心)"), |
| | | shareRuleLinkSuning("share_rule_link_suning", "苏宁分享规则(帮助中心)"), |
| | | shareSingleGoodsRule("share_single_goods_rule", "单品分享规则"), |
| | | shareGoodsTemplateRules("share_goods_template_rules", "分享模板规则"), // 存在2个相同 |
| | | // 内容不同、版本但一样 |
| | | shareGoodsTemplateRulesJD("share_goods_template_rules_jd", "京东模板规则"), |
| | | shareGoodsTemplateRulesPDD("share_goods_template_rules_pdd", "拼多多模板规则"), |
| | | shareGoodsTemplateRulesVIP("share_goods_template_rules_vip", "唯品会模板规则"), |
| | | shareGoodsTemplateRulesSuNing("share_goods_template_rules_suning", "苏宁模板规则"), |
| | | goodsShareNotifyImgs("goods_share_notify_imgs", "单个商品分享的券提示图片"), |
| | | goodsShareMultipleNotify("goods_share_multiple_notify", "多个商品分享提醒"), |
| | | goodsShareNotifyImgs207("goods_share_notify_imgs_207", "单个商品分享的券提示图片(2.0.7及以后)"), |
| | | goodsShareNotifyImgsVIP("goods_share_notify_imgs_vip", "单个商品分享的券提示图片(唯品会)"), |
| | | goodsShareNotify("goods_share_notify", "单个商品分享提醒"), |
| | | goodsShareNotifyJD("goods_share_notify_jd", "京东分享提醒"), |
| | | goodsShareNotifyPDD("goods_share_notify_pdd", "拼多多分享提醒"), |
| | | goodsShareNotifyVIP("goods_share_notify_vip", "拼多多分享提醒"), |
| | | goodsShareNotifySuning("goods_share_notify_Suning", "拼多多分享提醒"), |
| | | |
| | | // 邀请好友 |
| | | inviteCodeHlepLink("invite_code_hlep_link", "邀请激活页面-特别提醒"), |
| | | inviteActivationTip("invite_activation_tip", "邀请激活页面-特别提醒"), |
| | | inviteActivationSuccessTip("invite_activation_success_tip", "邀请激活成功页面-特别提醒"), |
| | | inviteActivationUrl("invite_activation_url", "邀请码激活页面"), |
| | | inviteActivationSuccessUrl("invite_activation_success_url", "邀请码激活成功页面"), |
| | | inviteTopBanner("invite_top_banner", "邀请页顶部大图"), // 未找到对应Call |
| | | inviteDesc("invite_desc", "邀请有奖特别说明"), |
| | | teamList("team_list", "我的队员链接"), |
| | | teamHelpUrl("team_help_url", "我的队员 问号 跳转链接"), |
| | | rewardRankRange("reward_rank_range", "奖金榜金额上下幅度最大范围"), |
| | | inviteHelpLink("invite_help_link", "邀请好友帮助链接"), |
| | | inviteSeparateLimitDays("invite_separate_limit_days", "会员脱离期限"), |
| | | inviteCodeInputHelp("invite_code_input_help", "邀请码填写帮助"), |
| | | firstOrderRewardBoss("first_order_reward_boss", "一级队员首单,奖励上级金币"), |
| | | firstOrderRewardBossSuper("first_order_reward_boss_super", "二级队员首次下单,系统奖励金币 "), |
| | | firstShareOrderReward("first_share_order_reward", "首笔分享订单,系统奖励金币"), |
| | | firstShareOrderRewardBoss("first_share_order_reward_boss", "一级队员首笔分享订单,系统奖励金币 "), |
| | | goodsShareTextCoupon("goods_share_text_coupon", "单个商品分享文案(有券)"), |
| | | goodsShareTextCouponJD("goods_share_text_coupon_jd", "京东单个商品分享模板-有券"), |
| | | goodsShareTextCouponPDD("goods_share_text_coupon_pdd", "拼多多单个商品分享模板-有券"), |
| | | goodsShareTextNoCoupon("goods_share_text_nocoupon", "单个商品分享文案(无券)"), |
| | | goodsShareTextNoCouponJD("goods_share_text_nocoupon_jd", "京东单个商品分享模板-无券"), |
| | | goodsShareTextNocouponPDD("goods_share_text_nocoupon_pdd", "拼多多单个商品分享模板-无券"), |
| | | shareSingleGoodsCommentText("share_single_goods_comment_text", "单品分享评论区文案"), |
| | | shareGoodsActivityOpen("share_goods_activity_open", "分享商品订单活动"), |
| | | superHongBaoShareDesc("super-hongbao-share-desc", "双12红包分享语"), |
| | | superYuShouShareDesc("super-yushou-share-desc", "双11预售分享语"), |
| | | |
| | | // 免单券、奖励券 |
| | | exchangeRebatePercent("exchange_rebate_percent", "兑换奖励券比例"), |
| | | freeCouponActivateNum("free_coupon_activate_num", "免单券激活订单数量"), |
| | | freeCouponHelp("free_coupon_help", "商品详情弹框免单券问号链接"), |
| | | freeCouponTip("free_coupon_tip", "商品详情弹框免单券提示"), |
| | | freeCouponBackRemark("free_coupon_back_remark", "免单券退回页面备注"), |
| | | freeCouponRemark("free_coupon_remark", "免单券进度使用中、成功备注"), |
| | | freeGoodsList("free_goods_list", "免单商品列表"), |
| | | freeCouponUsingHelp("free_coupon_using-help", "免单券使用中说明"), |
| | | freeGoodsRule("free_goods_rule", "免单商品活动规则"), |
| | | rewardCouponHelp("reward_coupon_help", "订单奖励券弹出框位置问号"), |
| | | rewardCouponRemark("reward_coupon_remark", "奖励券备注"), |
| | | specialGuideRewardCouponLink("special_guide_reward_coupon_link", "返利奖励券引导页"), |
| | | giveFreeCouponTips("give_free_coupon_tips", "免单券赠送口令提示语"), |
| | | giveRebatePercentCouponTips("give_rebate_percent_coupon_tips", "奖励券赠送口令提示"), |
| | | publishListHelpLink("publish_list_help_link", "邀请码发布帮助链接"), |
| | | lotteryRuleNewbies("lottery_rule_newbies", "新人抽奖界面规则内容"), |
| | | lotteryRuleDailyRebate("lottery_rule_daily_rebate", "奖励券天天抽-抽奖规则"), |
| | | // 邀请好友 |
| | | inviteCodeHlepLink("invite_code_hlep_link", "邀请激活页面-特别提醒"), |
| | | inviteActivationTip("invite_activation_tip", "邀请激活页面-特别提醒"), |
| | | inviteActivationSuccessTip("invite_activation_success_tip", "邀请激活成功页面-特别提醒"), |
| | | inviteActivationUrl("invite_activation_url", "邀请码激活页面"), |
| | | inviteActivationSuccessUrl("invite_activation_success_url", "邀请码激活成功页面"), |
| | | inviteTopBanner("invite_top_banner", "邀请页顶部大图"), // 未找到对应Call |
| | | inviteDesc("invite_desc", "邀请有奖特别说明"), |
| | | teamList("team_list", "我的队员链接"), |
| | | teamHelpUrl("team_help_url", "我的队员 问号 跳转链接"), |
| | | rewardRankRange("reward_rank_range", "奖金榜金额上下幅度最大范围"), |
| | | inviteHelpLink("invite_help_link", "邀请好友帮助链接"), |
| | | inviteSeparateLimitDays("invite_separate_limit_days", "会员脱离期限"), |
| | | inviteCodeInputHelp("invite_code_input_help", "邀请码填写帮助"), |
| | | firstOrderRewardBoss("first_order_reward_boss", "一级队员首单,奖励上级金币"), |
| | | firstOrderRewardBossSuper("first_order_reward_boss_super", "二级队员首次下单,系统奖励金币 "), |
| | | firstShareOrderReward("first_share_order_reward", "首笔分享订单,系统奖励金币"), |
| | | firstShareOrderRewardBoss("first_share_order_reward_boss", "一级队员首笔分享订单,系统奖励金币 "), |
| | | |
| | | // 商品相关 |
| | | taobaoProxyIP("taobao_proxy_ip", "淘宝商品详情代理IP"), |
| | | taobaoCartJS("taobao_cart_js", "淘宝购物车脚本"), |
| | | taobaoCartLink("taobao_cart_link", "购物车链接"), |
| | | taobaoCartJumpDetail("taobao_cart_jump_detail", "我的购物车跳转方式"), // 存在2个相同 |
| | | // 存在版本区分 |
| | | taobaoCouponHelp("taobao_coupon_help", "券帮助"), |
| | | convertTaoBaoLinkInServer("convert_taobao_link_in_server", "是否在服务端转链"), |
| | | showTaobaoCartConvert("show_taobao_cart_convert", "购物车是否转链"), |
| | | taobaoShareQrcodeText("taobao_share_qrcode_text", "淘宝商品二维码识别文字"), |
| | | noRebateHelpLink("no_rebate_help_link", "商品详情无返利问号"), |
| | | goodsDetailFanliRateHelpUrl("goods_detail_fanli_rate_help_url", "商品详情返利比例说明"), |
| | | detailPrompt("detail_prompt", "商品详情提示语"), |
| | | oldGoodsDetailHelpUrl("old_goods_detail_help_url", "老版商品详情页的帮助中心"), |
| | | shareBonusPicture("shareBonusPicture", "1.4.0版本商品详情 分享奖金图片"), |
| | | // 免单券、奖励券 |
| | | exchangeRebatePercent("exchange_rebate_percent", "兑换奖励券比例"), |
| | | freeCouponActivateNum("free_coupon_activate_num", "免单券激活订单数量"), |
| | | freeCouponHelp("free_coupon_help", "商品详情弹框免单券问号链接"), |
| | | freeCouponTip("free_coupon_tip", "商品详情弹框免单券提示"), |
| | | freeCouponBackRemark("free_coupon_back_remark", "免单券退回页面备注"), |
| | | freeCouponRemark("free_coupon_remark", "免单券进度使用中、成功备注"), |
| | | freeGoodsList("free_goods_list", "免单商品列表"), |
| | | freeCouponUsingHelp("free_coupon_using-help", "免单券使用中说明"), |
| | | freeGoodsRule("free_goods_rule", "免单商品活动规则"), |
| | | rewardCouponHelp("reward_coupon_help", "订单奖励券弹出框位置问号"), |
| | | rewardCouponRemark("reward_coupon_remark", "奖励券备注"), |
| | | specialGuideRewardCouponLink("special_guide_reward_coupon_link", "返利奖励券引导页"), |
| | | giveFreeCouponTips("give_free_coupon_tips", "免单券赠送口令提示语"), |
| | | giveRebatePercentCouponTips("give_rebate_percent_coupon_tips", "奖励券赠送口令提示"), |
| | | publishListHelpLink("publish_list_help_link", "邀请码发布帮助链接"), |
| | | lotteryRuleNewbies("lottery_rule_newbies", "新人抽奖界面规则内容"), |
| | | lotteryRuleDailyRebate("lottery_rule_daily_rebate", "奖励券天天抽-抽奖规则"), |
| | | |
| | | tljOwnBuyNogoods("tlj_own_buy_nogoods", "自购立减无商品页面"), |
| | | zigoulijianRule("zigoulijian_rule", "自购立减活动规则"), |
| | | zigoulijianNofanliHelp("zigoulijian_nofanli_help", "自购立减无返利帮助"), |
| | | // 商品相关 |
| | | taobaoProxyIP("taobao_proxy_ip", "淘宝商品详情代理IP"), |
| | | taobaoCartJS("taobao_cart_js", "淘宝购物车脚本"), |
| | | taobaoCartLink("taobao_cart_link", "购物车链接"), |
| | | taobaoCartJumpDetail("taobao_cart_jump_detail", "我的购物车跳转方式"), // 存在2个相同 |
| | | // 存在版本区分 |
| | | taobaoCouponHelp("taobao_coupon_help", "券帮助"), |
| | | convertTaoBaoLinkInServer("convert_taobao_link_in_server", "是否在服务端转链"), |
| | | showTaobaoCartConvert("show_taobao_cart_convert", "购物车是否转链"), |
| | | taobaoShareQrcodeText("taobao_share_qrcode_text", "淘宝商品二维码识别文字"), |
| | | noRebateHelpLink("no_rebate_help_link", "商品详情无返利问号"), |
| | | goodsDetailFanliRateHelpUrl("goods_detail_fanli_rate_help_url", "商品详情返利比例说明"), |
| | | detailPrompt("detail_prompt", "商品详情提示语"), |
| | | oldGoodsDetailHelpUrl("old_goods_detail_help_url", "老版商品详情页的帮助中心"), |
| | | shareBonusPicture("shareBonusPicture", "1.4.0版本商品详情 分享奖金图片"), |
| | | |
| | | // 订单相关 |
| | | showTaobaoOrder("show_taobao_order", "是否显示淘宝订单"), |
| | | taobaoOrderParseJS("taobao_order_parse_js", "淘宝订单解析脚本"), |
| | | autoFindTaobaoOrder("auto_find_taobao_order", "是否开启淘宝自动找单"), |
| | | orderListHelp("order_list_help", "订单列表帮助链接"), |
| | | lostOrderHelpWhat("lost_order_help_what", "订单找回-订单找回是什么"), |
| | | lostOrderHelpReason("lost_order_help_reason", "订单找回-找回失败原因"), |
| | | orderFindNotifyUrl("order_find_notify_url", "订单列表-订单找回帮助链接"), |
| | | orderAppealCountDay("order_appeal_count_day", "每天最大申诉订单数量"), |
| | | tljOwnBuyNogoods("tlj_own_buy_nogoods", "自购立减无商品页面"), |
| | | zigoulijianRule("zigoulijian_rule", "自购立减活动规则"), |
| | | zigoulijianNofanliHelp("zigoulijian_nofanli_help", "自购立减无返利帮助"), |
| | | |
| | | // 消息信息 |
| | | shareMessage("share_message", "短信分享编辑内容"), |
| | | helpName("help_name", "帮助客服名称"), // 未找到对应Call |
| | | helpNumber("help_number", "帮助客服号码"), // 未找到对应Call |
| | | msgConfigZhushou("msg-config-zhushou", "消息-返利券小助手"), |
| | | msgConfigGuanxuan("msg-config-guanxuan", "消息-官宣任务"), |
| | | msgConfigNotify("msg-config-notify", "消息-大图通知"), |
| | | kefuMeiqia("kefu_meiqia", "美洽客服是否开启(0-关闭 1-开启)"), |
| | | customerServiceLink("customer_service_link", "人工客服链接"), |
| | | canSendEmergencyMsg("can_send_emergency_msg", "是否发送服务器告警短信"), |
| | | // 订单相关 |
| | | showTaobaoOrder("show_taobao_order", "是否显示淘宝订单"), |
| | | taobaoOrderParseJS("taobao_order_parse_js", "淘宝订单解析脚本"), |
| | | autoFindTaobaoOrder("auto_find_taobao_order", "是否开启淘宝自动找单"), |
| | | orderListHelp("order_list_help", "订单列表帮助链接"), |
| | | lostOrderHelpWhat("lost_order_help_what", "订单找回-订单找回是什么"), |
| | | lostOrderHelpReason("lost_order_help_reason", "订单找回-找回失败原因"), |
| | | orderFindNotifyUrl("order_find_notify_url", "订单列表-订单找回帮助链接"), |
| | | orderAppealCountDay("order_appeal_count_day", "每天最大申诉订单数量"), |
| | | |
| | | // 首页 |
| | | newUserHongBao("new_user_hongbao", "新手红包是否开启"), // 未找到对应Call |
| | | newUserIsOrder("new_user_isorder", "新手红包是否下单生效"), // 未找到对应Call |
| | | recommendDetails("recommend_details", "动态推荐详情页面"), // 未找到对应Call |
| | | homeWeexUrl("home_weex_url", "首页weex链接"), |
| | | appFloatImg("app_float_img", "首页悬浮大图"), |
| | | homeFloatImgNew("home_float_img_new", "首页悬浮广告位"), // 未找到对应Call |
| | | homeFloatNotifyImg("home_float_notify_img", "首页悬浮提示大图"), |
| | | homeInviteBanner("home_invite_banner", "首页邀请有奖大图"), |
| | | spikeGoodsLink("spike_goods_link", "限时秒杀跳转的网页链接"), |
| | | indexHtmlLinkIos("index_html_link_ios", "首页-限时秒杀(IOS)网页链接"), |
| | | indexHtmlLinkAndroid("index_html_link_android", "首页-限时秒杀(安卓)网页链接"), |
| | | tipGuideNewUser("tip_guide_new_user", "首页新人版/未登录版"), |
| | | tipGuideSaveMoney("tip_guide_save_money", "首页省钱版"), |
| | | tipGuideShareInvite("tip_guide_share_invite", "首页赚钱版"), |
| | | searchDiscoveryKeys("search_discovery_keys", "搜索发现关键词"), |
| | | searchDiscoveryH5Link("search_discovery_h5_link", "搜索发现h5连接"), |
| | | autoExtractHelpUrl("auto_extract_help_url", "自动提现帮助链接"), |
| | | // 协议 |
| | | userProtocolHomeData("user_protocol_home_data", "用户协议首页内容"), |
| | | serviceProtocolLink("service_protocol_link", "服务协议"), |
| | | privacyProtocolLink("privacy_protocol_link", "隐私协议"), |
| | | accountLogoutProtocolLink("account_logout_protocol_link", "账户注销协议"), |
| | | // 消息信息 |
| | | shareMessage("share_message", "短信分享编辑内容"), |
| | | helpName("help_name", "帮助客服名称"), // 未找到对应Call |
| | | helpNumber("help_number", "帮助客服号码"), // 未找到对应Call |
| | | msgConfigZhushou("msg-config-zhushou", "消息-返利券小助手"), |
| | | msgConfigGuanxuan("msg-config-guanxuan", "消息-官宣任务"), |
| | | msgConfigNotify("msg-config-notify", "消息-大图通知"), |
| | | kefuMeiqia("kefu_meiqia", "美洽客服是否开启(0-关闭 1-开启)"), |
| | | customerServiceLink("customer_service_link", "人工客服链接"), |
| | | canSendEmergencyMsg("can_send_emergency_msg", "是否发送服务器告警短信"), |
| | | |
| | | shareOpenJD("share_jd_open", "京东商品是否开启分享"), |
| | | jdApiSearchKey("jd_api_search_key", "京东API是否搜索"), |
| | | jingdongH5Link("jingdong_h5_link", "京东跳转地址"), |
| | | jdWXMPClass("jd_wxmp_class", "京东小程序分类"), |
| | | elemeHongbaoLink("eleme_hongbao_link", "饿了么红包链接"), // 未找到对应Call |
| | | elemeGoodsLink("eleme_goods_link", "饿了么商品链接"), // 未找到对应Call |
| | | // 首页 |
| | | newUserHongBao("new_user_hongbao", "新手红包是否开启"), // 未找到对应Call |
| | | newUserIsOrder("new_user_isorder", "新手红包是否下单生效"), // 未找到对应Call |
| | | recommendDetails("recommend_details", "动态推荐详情页面"), // 未找到对应Call |
| | | homeWeexUrl("home_weex_url", "首页weex链接"), |
| | | appFloatImg("app_float_img", "首页悬浮大图"), |
| | | homeFloatImgNew("home_float_img_new", "首页悬浮广告位"), // 未找到对应Call |
| | | homeFloatNotifyImg("home_float_notify_img", "首页悬浮提示大图"), |
| | | homeInviteBanner("home_invite_banner", "首页邀请有奖大图"), |
| | | spikeGoodsLink("spike_goods_link", "限时秒杀跳转的网页链接"), |
| | | indexHtmlLinkIos("index_html_link_ios", "首页-限时秒杀(IOS)网页链接"), |
| | | indexHtmlLinkAndroid("index_html_link_android", "首页-限时秒杀(安卓)网页链接"), |
| | | tipGuideNewUser("tip_guide_new_user", "首页新人版/未登录版"), |
| | | tipGuideSaveMoney("tip_guide_save_money", "首页省钱版"), |
| | | tipGuideShareInvite("tip_guide_share_invite", "首页赚钱版"), |
| | | searchDiscoveryKeys("search_discovery_keys", "搜索发现关键词"), |
| | | searchDiscoveryH5Link("search_discovery_h5_link", "搜索发现h5连接"), |
| | | autoExtractHelpUrl("auto_extract_help_url", "自动提现帮助链接"), |
| | | // 协议 |
| | | userProtocolHomeData("user_protocol_home_data", "用户协议首页内容"), |
| | | serviceProtocolLink("service_protocol_link", "服务协议"), |
| | | privacyProtocolLink("privacy_protocol_link", "隐私协议"), |
| | | accountLogoutProtocolLink("account_logout_protocol_link", "账户注销协议"), |
| | | |
| | | passwordErrorMAX("password_max_error", "用户每天最多输错密码次数"), // 未找到对应Call |
| | | userRankTip("user_rank_tip", "用户等级页面特别提醒"), |
| | | userRankContrast("user_rank_contrast", "用户等级对照图片url"), |
| | | tkRateRange("tkRate_range", "前端筛选比例范围"), |
| | | onlyInfo("only_info", "返回前端的"), |
| | | downAPP("downAPP", "下载APP链接"), |
| | | appDownLink("app_down_link", "APP下载地址"), |
| | | xcxSetting("xcx_setting", "小程序更新设置"), |
| | | iosOnlingVersion("ios_onling_version", "IOS正在上线的版本"), |
| | | openSpeicalAndRelationApply("open_speical_and_relation_apply", "开启会员运营ID与渠道ID申请"), |
| | | hotFunctionUrl("hot_function_url", "热门功能链接"), // 存在2个相同 存在版本区分 |
| | | pushGoodsDetails("push_goods_details", "推送页面"), |
| | | pushActivityLink("push_activity_link", "推送发圈活动页面"), |
| | | brandBackgroundPicture("brand_background_picture", "品牌背景图片"), |
| | | articleHotWords("article_hot_words", "动态-学院文章热搜词"), |
| | | inviteRules("invite_rules", "动态-学院文章热搜词"), |
| | | vipLink("vip_link", "超级会员升级链接"), // 转移至VIPConfig 已废弃 |
| | | helpLinkVipInfo("help_link_vip_info", "超级会员详情页帮助链接"), // 已废弃 |
| | | // 文案转链 |
| | | convertDocWebLink("convert_doc_web_link", "文案转链网页"), |
| | | convertDocHelpLink("convert_doc_help_link", "文案转链帮助网页"), |
| | | convertDocTip("convert_doc_tip", "文案转链温馨提示"), |
| | | newerGonglue("newer_gonglue_url", "新手攻略链接"), |
| | | tearcherLink("tearcher_link", "导师链接"), |
| | | quickShareGoodsText("quick_share_goods_text", "快捷分享商品文本"), |
| | | quickShareTBCommentText("quick_share_tb_comment_text", "快捷分享商品文本"), |
| | | quickShareJDCommentText("quick_share_jd_comment_text", "快捷分享商品文本"), |
| | | quickSharePDDCommentText("quick_share_pdd_comment_text", "快捷分享商品文本"), |
| | | quickShareVIPCommentText("quick_share_vip_comment_text", "快捷分享商品文本"), |
| | | quickShareSuNingCommentText("quick_share_suning_comment_text", "快捷分享商品文本"), |
| | | shareOpenJD("share_jd_open", "京东商品是否开启分享"), |
| | | jdApiSearchKey("jd_api_search_key", "京东API是否搜索"), |
| | | jingdongH5Link("jingdong_h5_link", "京东跳转地址"), |
| | | jdWXMPClass("jd_wxmp_class", "京东小程序分类"), |
| | | elemeHongbaoLink("eleme_hongbao_link", "饿了么红包链接"), // 未找到对应Call |
| | | elemeGoodsLink("eleme_goods_link", "饿了么商品链接"), // 未找到对应Call |
| | | |
| | | passwordErrorMAX("password_max_error", "用户每天最多输错密码次数"), // 未找到对应Call |
| | | userRankTip("user_rank_tip", "用户等级页面特别提醒"), |
| | | userRankContrast("user_rank_contrast", "用户等级对照图片url"), |
| | | tkRateRange("tkRate_range", "前端筛选比例范围"), |
| | | onlyInfo("only_info", "返回前端的"), |
| | | downAPP("downAPP", "下载APP链接"), |
| | | appDownLink("app_down_link", "APP下载地址"), |
| | | xcxSetting("xcx_setting", "小程序更新设置"), |
| | | iosOnlingVersion("ios_onling_version", "IOS正在上线的版本"), |
| | | openSpeicalAndRelationApply("open_speical_and_relation_apply", "开启会员运营ID与渠道ID申请"), |
| | | hotFunctionUrl("hot_function_url", "热门功能链接"), // 存在2个相同 存在版本区分 |
| | | pushGoodsDetails("push_goods_details", "推送页面"), |
| | | pushActivityLink("push_activity_link", "推送发圈活动页面"), |
| | | brandBackgroundPicture("brand_background_picture", "品牌背景图片"), |
| | | articleHotWords("article_hot_words", "动态-学院文章热搜词"), |
| | | inviteRules("invite_rules", "动态-学院文章热搜词"), |
| | | vipLink("vip_link", "超级会员升级链接"), // 转移至VIPConfig 已废弃 |
| | | helpLinkVipInfo("help_link_vip_info", "超级会员详情页帮助链接"), // 已废弃 |
| | | // 文案转链 |
| | | convertDocWebLink("convert_doc_web_link", "文案转链网页"), |
| | | convertDocHelpLink("convert_doc_help_link", "文案转链帮助网页"), |
| | | convertDocTip("convert_doc_tip", "文案转链温馨提示"), |
| | | newerGonglue("newer_gonglue_url", "新手攻略链接"), |
| | | tearcherLink("tearcher_link", "导师链接"), |
| | | quickShareGoodsText("quick_share_goods_text", "快捷分享商品文本"), |
| | | quickShareTBCommentText("quick_share_tb_comment_text", "快捷分享商品文本"), |
| | | quickShareJDCommentText("quick_share_jd_comment_text", "快捷分享商品文本"), |
| | | quickSharePDDCommentText("quick_share_pdd_comment_text", "快捷分享商品文本"), |
| | | quickShareVIPCommentText("quick_share_vip_comment_text", "快捷分享商品文本"), |
| | | quickShareSuNingCommentText("quick_share_suning_comment_text", "快捷分享商品文本"), |
| | | |
| | | |
| | | shareCommentTextTB("share_comment_text_tb", "淘宝单图多图分享商品文本"), |
| | | shareCommentTextJD("share_comment_text_jd", "京东单图多图分享商品文本"), |
| | | shareCommentTextPDD("share_comment_text_pdd", "拼多多单图多图分享商品文本"), |
| | | shareCommentTextVIP("share_comment_text_vip", "唯品会单图多图分享商品文本"), |
| | | shareCommentTextSuNing("share_comment_text_suning", "苏宁单图多图分享商品文本"), |
| | | |
| | | |
| | | evaluateEmojis("evaluate_emojis", "发圈评论Emojis"), |
| | | evaluateText("evaluate_text", "发圈评论文本"), |
| | | evaluateZeroKey("evaluate_zero_key", "0点匹配词"), |
| | | shareCommentTextTB("share_comment_text_tb", "淘宝单图多图分享商品文本"), |
| | | shareCommentTextJD("share_comment_text_jd", "京东单图多图分享商品文本"), |
| | | shareCommentTextPDD("share_comment_text_pdd", "拼多多单图多图分享商品文本"), |
| | | shareCommentTextVIP("share_comment_text_vip", "唯品会单图多图分享商品文本"), |
| | | shareCommentTextSuNing("share_comment_text_suning", "苏宁单图多图分享商品文本"), |
| | | |
| | | |
| | | vipUpgradeLink("vip_upgrade_link", "我的界面-会员升级链接"), |
| | | evaluateEmojis("evaluate_emojis", "发圈评论Emojis"), |
| | | evaluateText("evaluate_text", "发圈评论文本"), |
| | | evaluateZeroKey("evaluate_zero_key", "0点匹配词"), |
| | | |
| | | orderRebateDescLink("order_rebate_desc_link", "订单返利计算说明链接"), |
| | | |
| | | teamStatisticsLink("team_statistics_link", "队员统计页面链接"), |
| | | activityDetailLink("activity_detail_link", "活动详情过渡页"), |
| | | |
| | | // 平台规则 |
| | | platformRule("platform_rule_link", "平台规则"), |
| | | |
| | | showSplashAd("show_splash_ad","是否显示开屏广告"), |
| | | |
| | | huaweiOnLineVersionCode("huawei_online_version_code","华为渠道正在上线的版本"), |
| | | |
| | | testUserArray("test_user_array","测试用户数组"), |
| | | |
| | | robotCloudLink("robot_cloud_link","云发单链接"), |
| | | robotCloudOpen("robot_cloud_open","云发单是否开启-我的界面"), |
| | | robotCloudOpenCircle("robot_cloud_open_circle","云发单是否开启-发圈界面"), |
| | | robotCloudOpenGoodsDetail("robot_cloud_open_goods_detail","云发单是否开启-商品详情"), |
| | | robotCloudGroupPictureNum("robot_cloud_group_picture_num","云发单群图片数量"), |
| | | |
| | | |
| | | cloudAlipayJumpLink("cloud_alipay_jump_link","云发单支付跳转地址"), |
| | | cloudAlipayReturnLink("cloud_alipay_return_link","云发单支付成功后返回哪个前端页面"), |
| | | cloudAlipayNotifyLink("cloud_alipay_notify_link","云发单支付成功后回调地址"), |
| | | |
| | | clipboardRecommendGoodsMakeMore("clipboard_recommend_goods_make_more_link","根据粘贴板推荐商品赚更多链接") |
| | | ; |
| | | |
| | | |
| | | |
| | | |
| | | private final String key; |
| | | private final String desc; |
| | | vipUpgradeLink("vip_upgrade_link", "我的界面-会员升级链接"), |
| | | |
| | | private ConfigKeyEnum(String key, String desc) { |
| | | this.key = key; |
| | | this.desc = desc; |
| | | } |
| | | orderRebateDescLink("order_rebate_desc_link", "订单返利计算说明链接"), |
| | | |
| | | public String getDesc() { |
| | | return desc; |
| | | } |
| | | teamStatisticsLink("team_statistics_link", "队员统计页面链接"), |
| | | activityDetailLink("activity_detail_link", "活动详情过渡页"), |
| | | |
| | | public String getKey() { |
| | | return key; |
| | | } |
| | | // 平台规则 |
| | | platformRule("platform_rule_link", "平台规则"), |
| | | |
| | | showSplashAd("show_splash_ad", "是否显示开屏广告"), |
| | | |
| | | huaweiOnLineVersionCode("huawei_online_version_code", "华为渠道正在上线的版本"), |
| | | |
| | | testUserArray("test_user_array", "测试用户数组"), |
| | | |
| | | robotCloudLink("robot_cloud_link", "云发单链接"), |
| | | robotCloudOpen("robot_cloud_open", "云发单是否开启-我的界面"), |
| | | robotCloudOpenCircle("robot_cloud_open_circle", "云发单是否开启-发圈界面"), |
| | | robotCloudOpenGoodsDetail("robot_cloud_open_goods_detail", "云发单是否开启-商品详情"), |
| | | robotCloudGroupPictureNum("robot_cloud_group_picture_num", "云发单群图片数量"), |
| | | |
| | | |
| | | cloudAlipayJumpLink("cloud_alipay_jump_link", "云发单支付跳转地址"), |
| | | cloudAlipayReturnLink("cloud_alipay_return_link", "云发单支付成功后返回哪个前端页面"), |
| | | cloudAlipayNotifyLink("cloud_alipay_notify_link", "云发单支付成功后回调地址"), |
| | | clipboardRecommendGoodsMakeMore("clipboard_recommend_goods_make_more_link", "根据粘贴板推荐商品赚更多链接"), |
| | | welcomeMsg("welcome_message", "消息页面的欢迎消息"), |
| | | gdtAdInfo("gdt_ad_info", "广点通广告信息"); |
| | | |
| | | |
| | | private final String key; |
| | | private final String desc; |
| | | |
| | | private ConfigKeyEnum(String key, String desc) { |
| | | this.key = key; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | public String getDesc() { |
| | | return desc; |
| | | } |
| | | |
| | | public String getKey() { |
| | | return key; |
| | | } |
| | | } |
| | |
| | | import javax.annotation.Resource;
|
| | |
|
| | | import com.yeshi.fanli.entity.SystemEnum;
|
| | | import com.yeshi.fanli.entity.SystemFunction;
|
| | | import com.yeshi.fanli.util.SystemInfoUtil;
|
| | | import org.apache.commons.lang.StringEscapeUtils;
|
| | | import org.springframework.scheduling.annotation.Scheduled;
|
| | | import org.springframework.stereotype.Component;
|
| | |
| | | GoodsDetailVOFactory.convertJDGoods(jdGoods,
|
| | | new ConfigParamsDTO(hongBaoManageService.getFanLiRate(SystemEnum.blks),
|
| | | hongBaoManageService.getShareRate(SystemEnum.blks), null,
|
| | | hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP,SystemEnum.blks))));
|
| | | hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP, SystemEnum.blks))));
|
| | | picture.setGoodState(0);
|
| | | picture.setJumpDetail(jumpDetailV2Service.getByTypeCache("goodsdetail"));
|
| | | picture.setParams(null);
|
| | |
| | | */
|
| | | @XxlJob("dynamic-insertEvaluate")
|
| | | public ReturnT<String> insertEvaluate(String param) throws Exception {
|
| | | // 好单库
|
| | | boolean addResult = addHDKListSelected();
|
| | | // 大淘客备用
|
| | | if (!addResult) {
|
| | | addDTKFriendsFircleList();
|
| | |
|
| | | for (SystemEnum system : SystemEnum.values()) {
|
| | | if (!SystemInfoUtil.hasFunctions(system, SystemFunction.faQuan))
|
| | | continue;
|
| | | // 好单库
|
| | | boolean addResult = addHDKListSelected(system);
|
| | | // 大淘客备用
|
| | | if (!addResult) {
|
| | | addDTKFriendsFircleList(system);
|
| | | }
|
| | | }
|
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | |
| | | *
|
| | | * @return
|
| | | */
|
| | | private boolean addHDKListSelected() {
|
| | | private boolean addHDKListSelected(SystemEnum system) {
|
| | | boolean addResult = false;
|
| | | Integer minId = 1;
|
| | | while (minId != null) {
|
| | |
| | | List<ActivityRuleUser> ruleList = activityUserService.listByRuleCode(ActivityRuleUser.RULE_HAOHUO, 1, 20);
|
| | | ActivityUser user = ruleList.get((int) (ruleList.size() * Math.random())).getActivityUser();
|
| | |
|
| | | int addProcess = goodsEvaluateService.addGoodsEvaluate(TaoBaoGoodsFactory.create(hdkGoods), pics, user, showtitle, SystemEnum.blks);
|
| | | int addProcess = goodsEvaluateService.addGoodsEvaluate(TaoBaoGoodsFactory.create(hdkGoods), pics, user, showtitle, system);
|
| | | if (addProcess == 0) {
|
| | | addResult = true;
|
| | | break;
|
| | |
| | | *
|
| | | * @return
|
| | | */
|
| | | private boolean addDTKFriendsFircleList() {
|
| | | private boolean addDTKFriendsFircleList(SystemEnum system) {
|
| | | boolean addResult = false;
|
| | | try {
|
| | | DaTaoKeGoodsResult result = DaTaoKeApiUtil.getFriendsFircleList("1", 100);
|
| | |
| | | user = ruleList.get((int) (ruleList.size() * Math.random())).getActivityUser();
|
| | | }
|
| | |
|
| | | int addProcess = goodsEvaluateService.addGoodsEvaluate(TaoBaoUtil.convert(tkGoods), null, user, showtitle, SystemEnum.blks);
|
| | | int addProcess = goodsEvaluateService.addGoodsEvaluate(TaoBaoUtil.convert(tkGoods), null, user, showtitle, system);
|
| | | if (addProcess == 0) {
|
| | | addResult = true;
|
| | | break;
|
| | |
| | | private BrandInfoMapper brandInfoMapper;
|
| | |
|
| | | @Resource
|
| | | private HongBaoManageService hongBaoManageService;
|
| | | |
| | | @Resource
|
| | | private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService;
|
| | |
|
| | | @Resource
|
| | | private QualityGoodsService qualityGoodsService;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService;
|
| | |
|
| | | @Resource
|
| | | private BrandClassShopService brandClassShopService;
|
| | |
|
| | | @Resource
|
| | | private BrandShopCaheDao brandShopCaheDao;
|
| | |
|
| | | @Resource
|
| | | private BrandGoodsCaheService brandGoodsCaheService;
|
| | |
| | | return value;
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Cacheable(value = "config", key = "'getValueByKey-'+#key+'-'+#system")
|
| | | public String getValue(ConfigKeyEnum key, SystemEnum system) {
|
| | | List<Config> list = configMapper.listByKey(key.getKey(), null, null,system);
|
| | | if (list.size() == 0) {
|
| | | return null;
|
| | | }
|
| | | String value = list.get(0).getValue();
|
| | | return value;
|
| | | }
|
| | |
|
| | |
|
| | | @Cacheable(value = "config", key = "'getByVersion'+'-'+#key+'-'+#platform+'-'+#version+'-'+#system ")
|
| | | public String getByVersion(String key, String platform, int version, SystemEnum system) {
|
| | | Integer minAndroidVersion = null;
|
| | |
| | | } |
| | | |
| | | @Override |
| | | @Cacheable(value = "dynamicCache", key = "'queryMaterialsCache-'+#start+'-'+#type") |
| | | @Cacheable(value = "dynamicCache", key = "'queryMaterialsCache-'+#start+'-'+#type+'-'+#system") |
| | | public List<GoodsEvaluate> queryMaterialsCache(int start, int count, int type, SystemEnum system) throws Exception { |
| | | List<GoodsEvaluate> list = goodsEvaluateDao.queryValid(start, count, type, system); |
| | | if (list == null) { |
| | |
| | | goodsEvaluate.setLineNum(lineNum); |
| | | goodsEvaluate.setImgList(imgList); |
| | | goodsEvaluate.setComments(commentsNew); |
| | | goodsEvaluate.setSystem(system); |
| | | goodsEvaluateDao.save(goodsEvaluate); |
| | | } |
| | | |
| | |
| | | goodsEvaluate.setLineNum(lineNum); |
| | | goodsEvaluate.setImgList(imgList); |
| | | goodsEvaluate.setComments(commentsNew); |
| | | goodsEvaluate.setSystem(system); |
| | | goodsEvaluateDao.save(goodsEvaluate); |
| | | return result; |
| | | } |
| | |
| | | goodsEvaluate.setPublishTime(new Date()); |
| | | goodsEvaluate.setCreateTime(new Date()); |
| | | goodsEvaluate.setUpdateTime(new Date()); |
| | | goodsEvaluate.setSystem(system); |
| | | |
| | | List<String> goodsimgs = goodsBrief.getImgList(); |
| | | |
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import com.yeshi.fanli.entity.SystemEnum;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.user.DeviceSexDao;
|
| | |
| | | @Service
|
| | | public class DeviceSexServiceImpl implements DeviceSexService {
|
| | |
|
| | | @Resource
|
| | | private DeviceSexDao deviceSexDao;
|
| | | |
| | | @Resource
|
| | | private RedisManager redisManager;
|
| | | |
| | | @Resource
|
| | | private DeviceSexDao deviceSexDao;
|
| | |
|
| | | @Override
|
| | | public void save(String device, Integer sex) {
|
| | | if (StringUtil.isNullOrEmpty(device) || sex == null) {
|
| | | return;
|
| | | }
|
| | | DeviceSex deviceSex = new DeviceSex();
|
| | | deviceSex.setId(device);
|
| | | deviceSex.setSex(sex);
|
| | | deviceSex.setCreateTime(new Date());
|
| | | deviceSexDao.save(deviceSex);
|
| | | |
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.deviceSex, device);
|
| | | redisManager.cacheCommonString(key, sex + "", 10);
|
| | | }
|
| | | @Resource
|
| | | private RedisManager redisManager;
|
| | |
|
| | | @Override
|
| | | public int getDeviceSex(String device) {
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.deviceSex, device);
|
| | | String result = redisManager.getCommonString(key);
|
| | | if (!StringUtil.isNullOrEmpty(result)) {
|
| | | return Integer.parseInt(result);
|
| | | }
|
| | | |
| | | DeviceSex deviceSex = deviceSexDao.get(device);
|
| | | if (deviceSex == null || deviceSex.getSex() == null) {
|
| | | return 0;
|
| | | }
|
| | | return deviceSex.getSex();
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void save(String device, Integer sex) {
|
| | | if (StringUtil.isNullOrEmpty(device) || sex == null) {
|
| | | return;
|
| | | }
|
| | | DeviceSex deviceSex = new DeviceSex();
|
| | | deviceSex.setId(device);
|
| | | deviceSex.setSex(sex);
|
| | | deviceSex.setCreateTime(new Date());
|
| | | deviceSexDao.save(deviceSex);
|
| | |
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.deviceSex, device);
|
| | | redisManager.cacheCommonString(key, sex + "", 10);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int getDeviceSex(String device, SystemEnum system) {
|
| | | if (system != SystemEnum.blks)
|
| | | return 0;
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.deviceSex, device);
|
| | | String result = redisManager.getCommonString(key);
|
| | | if (!StringUtil.isNullOrEmpty(result)) {
|
| | | return Integer.parseInt(result);
|
| | | }
|
| | |
|
| | | DeviceSex deviceSex = deviceSexDao.get(device);
|
| | | if (deviceSex == null || deviceSex.getSex() == null) {
|
| | | return 0;
|
| | | }
|
| | | return deviceSex.getSex();
|
| | | }
|
| | | }
|
| | |
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | |
|
| | |
|
| | | @Override
|
| | | public List<HomeNavbar> listEffectiveNavbar(Long uid, String device, Integer sex) {
|
| | | public List<HomeNavbar> listEffectiveNavbar(Long uid, String device, Integer sex,SystemEnum system) {
|
| | | List<HomeNavbar> list = new ArrayList<HomeNavbar>();
|
| | |
|
| | | SystemEnum system = userInfoService.getUserSystem(uid);
|
| | |
|
| | | if (sex == null || sex == 0) {
|
| | | if (uid != null || !StringUtil.isNullOrEmpty(device)) {
|
| | | if (uid != null) {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Cacheable(value = "bannerCache", key = "'getByBannerCard-'+#card+'-'+system")
|
| | | @Cacheable(value = "bannerCache", key = "'getByBannerCard-'+#card+'-'+#system")
|
| | | public List<BannerVO> getByBannerCard(String card,SystemEnum system) {
|
| | | List<SwiperPicture> list = swiperPictureMapper.getByBannerCard(card,system);
|
| | | if (list != null && list.size() > 0) {
|
| | |
| | | import com.yeshi.fanli.entity.SystemEnum;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | | import com.yeshi.fanli.util.*;
|
| | | import com.yeshi.fanli.vo.taobao.TaoBaoUser;
|
| | | import org.springframework.context.annotation.Lazy;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
| | |
|
| | | /**
|
| | | * 根据系统与unionid寻找用户
|
| | | *
|
| | | * @param system
|
| | | * @param unionId
|
| | | * @return
|
| | |
| | |
|
| | |
|
| | | /**
|
| | | *根据系统和淘宝的Openid寻找用户
|
| | | * 根据系统和淘宝的Openid寻找用户
|
| | | *
|
| | | * @param system
|
| | | * @param openId
|
| | | * @return
|
| | |
| | |
|
| | | /**
|
| | | * 根据系统和电话号码寻找用户
|
| | | *
|
| | | * @param system
|
| | | * @param phone
|
| | | * @return
|
| | |
| | | user.setRank(0);
|
| | | if (StringUtil.isNullOrEmpty(user.getPortrait()))
|
| | | user.setPortrait(Constant.systemCommonConfig.getDefaultPortrait());
|
| | | userInfoService.createUser(user,user.getSystem());
|
| | | userInfoService.createUser(user, user.getSystem());
|
| | | // 昵称为空时 默认昵称
|
| | | if (StringUtil.isNullOrEmpty(user.getNickName())) {
|
| | | UserInfo updateUserInfo = new UserInfo(user.getId());
|
| | |
| | | userInfo.setPhone(phone);
|
| | | userInfo.setLoginType(loginType);
|
| | | userInfo.setState(UserInfo.STATE_NORMAL);
|
| | | userInfo.setSystem( businessSystem.getSystem());
|
| | | userInfo.setSystem(businessSystem.getSystem());
|
| | | // 创建用户
|
| | | addUser(userInfo);
|
| | |
|
| | |
| | | throw new UserAccountException(10, "请稍后再试");
|
| | | }
|
| | |
|
| | | @Override
|
| | | public UserInfo loginTB(ProxyIP ipInfo, TaoBaoUser taoBaoUser, BusinessSystem businessSystem) throws UserAccountException {
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(taoBaoUser.getUserid()))
|
| | | throw new UserAccountException(1, "淘宝授权信息不完整");
|
| | |
|
| | | UserInfo userInfo = userInfoService.getEffectiveUserInfoByOpenId(taoBaoUser.getOpenId(), businessSystem.getSystem());
|
| | | if (userInfo != null) {
|
| | | // 更新账户登录信息
|
| | | updateLonginInfo(userInfo, 1, ipInfo);
|
| | | } else {
|
| | | userInfo = new UserInfo();
|
| | | userInfo.setNickName(taoBaoUser.getNick());
|
| | | userInfo.setPortrait(taoBaoUser.getAvatarUrl());
|
| | | userInfo.setAppId(businessSystem.getAppid());
|
| | | userInfo.setTaoBaoUid(taoBaoUser.getUserid());
|
| | | userInfo.setOpenid(taoBaoUser.getOpenId());
|
| | | userInfo.setLoginType(1);
|
| | | userInfo.setState(UserInfo.STATE_NORMAL);
|
| | | userInfo.setSystem(businessSystem.getSystem());
|
| | | // 创建用户
|
| | | addUser(userInfo);
|
| | | try {
|
| | | // 第一次登录时创建用户额外信息
|
| | | userInfoExtraService.createUserInfoExtra(userInfo.getId());
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | return userInfo;
|
| | | }
|
| | |
|
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public UserInfo loginPhoneNew(ProxyIP ipInfo, AcceptData acceptData, int loginType, String vcode, String phone, String appId)
|
| | | public UserInfo loginPhoneNew(ProxyIP ipInfo, AcceptData acceptData, int loginType, String vcode, String
|
| | | phone, String appId)
|
| | | throws UserAccountException {
|
| | | // 空额清理
|
| | | if (phone == null || phone.trim().length() == 0) {
|
| | |
| | | LogHelper.lgoinInfo(logInfo.toString());
|
| | |
|
| | | // 通过Code换取信息
|
| | | WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUser(code,businessSystem.getWxAppId(), businessSystem.getWxAppSecret());
|
| | | WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUser(code, businessSystem.getWxAppId(), businessSystem.getWxAppSecret());
|
| | | if (weiXinUser == null) {
|
| | | throw new UserAccountException(1, "微信帐号授权失败");
|
| | | }
|
| | |
| | | if (exec == null || exec.size() == 0) {
|
| | | throw new UserAccountException(10, "请稍后再试");
|
| | | } else {
|
| | | UserInfo userInfo = userInfoService.getEffectiveUserInfoByWXUnionId(weiXinUser.getUnionid(),businessSystem.getSystem());
|
| | | UserInfo userInfo = userInfoService.getEffectiveUserInfoByWXUnionId(weiXinUser.getUnionid(), businessSystem.getSystem());
|
| | | // 直接用的微信登录
|
| | | if (userInfo != null) {
|
| | | LogHelper.test("微信unionID存在:" + weiXinUser.getUnionid());
|
| | | // 更新账户登录信息
|
| | | updateLonginInfo(userInfo, loginType,ipInfo );
|
| | | updateLonginInfo(userInfo, loginType, ipInfo);
|
| | | // 删除邀请分享图
|
| | | spreadUserImgService.deleteImgUrl(userInfo.getId());
|
| | | } else {
|
| | |
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public UserInfo loginWeiXinNew(ProxyIP ipInfo, int loginType, String wxCode,
|
| | | BusinessSystem businessSystem) throws UserAccountException {
|
| | | BusinessSystem businessSystem) throws UserAccountException {
|
| | | // 日志信息
|
| | | JSONObject logInfo = new JSONObject();
|
| | | logInfo.put("appId", businessSystem.getAppid());
|
| | |
| | | LogHelper.lgoinInfo(logInfo.toString());
|
| | |
|
| | | // 通过Code换取信息
|
| | | WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUser(wxCode, businessSystem.getWxAppId(),businessSystem.getWxAppSecret());
|
| | | WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUser(wxCode, businessSystem.getWxAppId(), businessSystem.getWxAppSecret());
|
| | | if (weiXinUser == null) {
|
| | | throw new UserAccountException(1, "微信帐号授权失败");
|
| | | }
|
| | |
| | | throw new UserAccountException(2, "您已经绑定了该电话号码");
|
| | | }
|
| | |
|
| | | UserInfo phoneUser = userInfoService.getEffectiveUserInfoByPhone(phone,user.getSystem());
|
| | | UserInfo phoneUser = userInfoService.getEffectiveUserInfoByPhone(phone, user.getSystem());
|
| | | if (phoneUser != null) {
|
| | | throw new UserAccountException(2, "号码已经被占用");
|
| | | }
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | public UserInfo bindWXToLogin(ProxyIP ipInfo, AcceptData acceptData, String code, String appId, String key) throws UserAccountException {
|
| | | public UserInfo bindWXToLogin(ProxyIP ipInfo, AcceptData acceptData, String code, String appId, String key) throws
|
| | | UserAccountException {
|
| | | // 日志信息
|
| | | JSONObject logInfo = new JSONObject();
|
| | | logInfo.put("appId", appId);
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public UserInfo getEffectiveUserInfoByOpenId(String openId, SystemEnum sysetm) {
|
| | | return userInfoMapper.getEffectiveUserInfoByOpenId(openId,sysetm);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public UserInfo getUserInfo(Long uid) throws UserInfoException {
|
| | | if (uid == null) {
|
| | | throw new UserInfoException(1, "请求参数为空");
|
| | |
| | | }
|
| | |
|
| | | //清除该用户的授权信息
|
| | | userExtraTaoBaoInfoMapper.clearUid(uid);
|
| | | // userExtraTaoBaoInfoMapper.clearUid(uid);
|
| | | SystemEnum system = userInfoService.getUserSystem(uid);
|
| | | List<UserExtraTaoBaoInfo> list = userExtraTaoBaoInfoMapper.listByTaoBaoUid(taoBaoUid,system);
|
| | | UserExtraTaoBaoInfo existInfo = null;
|
| | |
| | | throw new UserExtraTaoBaoInfoException(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC);
|
| | | }
|
| | |
|
| | | userExtraTaoBaoInfoMapper.clearUid(uid);
|
| | | // userExtraTaoBaoInfoMapper.clearUid(uid);
|
| | | SystemEnum system = userInfoService.getUserSystem(uid);
|
| | |
|
| | | UserExtraTaoBaoInfo taoBaoInfo = new UserExtraTaoBaoInfo();
|
| | |
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.SystemEnum;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import org.yeshi.utils.entity.ProxyIP;
|
| | |
|
| | | import com.yeshi.fanli.entity.common.Config;
|
| | |
| | | void save(Config config);
|
| | |
|
| | | String getValue(String string,SystemEnum system);
|
| | |
|
| | | String getValue(ConfigKeyEnum key, SystemEnum system);
|
| | |
|
| | | String getByVersion(String key,String platform,int version,SystemEnum system);
|
| | |
|
| | |
| | | package com.yeshi.fanli.service.inter.homemodule;
|
| | |
|
| | | import com.yeshi.fanli.entity.SystemEnum;
|
| | |
|
| | | public interface DeviceSexService {
|
| | |
|
| | | /**
|
| | |
| | | * @param device
|
| | | * @return
|
| | | */
|
| | | public int getDeviceSex(String device);
|
| | | public int getDeviceSex(String device,SystemEnum system);
|
| | |
|
| | |
|
| | | }
|
| | |
| | | * 查询导航栏
|
| | | * @return
|
| | | */
|
| | | public List<HomeNavbar> listEffectiveNavbar(Long uid, String device, Integer sex);
|
| | | public List<HomeNavbar> listEffectiveNavbar(Long uid, String device, Integer sex,SystemEnum system);
|
| | |
|
| | | /**
|
| | | * 保存用户自定义
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.WeiXinUser;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | | import com.yeshi.fanli.exception.user.UserAccountException;
|
| | | import com.yeshi.fanli.vo.taobao.TaoBaoUser;
|
| | | import org.yeshi.utils.entity.ProxyIP;
|
| | |
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | /**
|
| | | * 登录服务
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | * @author Administrator
|
| | | */
|
| | | public interface UserAccountService {
|
| | | /**
|
| | | * 用户登录
|
| | | * |
| | | * @param code
|
| | | * @param phone
|
| | | * @param wxinstall
|
| | | * @param loginType
|
| | | * @return
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public LoginResult login(HttpServletRequest request, AcceptData acceptData, Boolean first, String appId,
|
| | | String code, String phone, UserInfo tbUserInfo, boolean wxinstall, int loginType)
|
| | | throws UserAccountException;
|
| | | /**
|
| | | * 用户登录
|
| | | *
|
| | | * @param code
|
| | | * @param phone
|
| | | * @param wxinstall
|
| | | * @param loginType
|
| | | * @return
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public LoginResult login(HttpServletRequest request, AcceptData acceptData, Boolean first, String appId,
|
| | | String code, String phone, UserInfo tbUserInfo, boolean wxinstall, int loginType)
|
| | | throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 没有安装微信时候的登录
|
| | | * |
| | | * @param appId
|
| | | * @param code
|
| | | * @param phone
|
| | | * @param tbUserInfo
|
| | | * @param loginType
|
| | | * @return
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public LoginResult loginNoInstallWX(AcceptData acceptData, String appId, String code, String phone,
|
| | | UserInfo tbUserInfo, int loginType) throws UserAccountException;
|
| | | /**
|
| | | * 没有安装微信时候的登录
|
| | | *
|
| | | * @param appId
|
| | | * @param code
|
| | | * @param phone
|
| | | * @param tbUserInfo
|
| | | * @param loginType
|
| | | * @return
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public LoginResult loginNoInstallWX(AcceptData acceptData, String appId, String code, String phone,
|
| | | UserInfo tbUserInfo, int loginType) throws UserAccountException;
|
| | |
|
| | |
|
| | | /**
|
| | | * 注册用户
|
| | | * |
| | | * @param userInfo
|
| | | */
|
| | | public void register(UserInfo userInfo) throws UserAccountException;
|
| | | /**
|
| | | * 注册用户
|
| | | *
|
| | | * @param userInfo
|
| | | */
|
| | | public void register(UserInfo userInfo) throws UserAccountException;
|
| | |
|
| | |
|
| | | /**
|
| | | * 根据系统与微信unionid获取用户信息
|
| | | * @param system
|
| | | * @param unionId
|
| | | * @return
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public UserInfo getUserInfoByWXUnionId(SystemEnum system, String unionId) throws UserAccountException;
|
| | | /**
|
| | | * 根据系统与微信unionid获取用户信息
|
| | | *
|
| | | * @param system
|
| | | * @param unionId
|
| | | * @return
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public UserInfo getUserInfoByWXUnionId(SystemEnum system, String unionId) throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 根据系统和淘宝的Openid寻找用户
|
| | | * @param system
|
| | | * @param openId
|
| | | * @return
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public UserInfo getUserInfoByTaoBaoOpenId(SystemEnum system, String openId) throws UserAccountException;
|
| | | /**
|
| | | * 根据系统和淘宝的Openid寻找用户
|
| | | *
|
| | | * @param system
|
| | | * @param openId
|
| | | * @return
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public UserInfo getUserInfoByTaoBaoOpenId(SystemEnum system, String openId) throws UserAccountException;
|
| | |
|
| | |
|
| | | /**
|
| | | * 根据系统和电话号码寻找用户
|
| | | * @param system
|
| | | * @param phone
|
| | | * @return
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public UserInfo getUserInfoByPhone(SystemEnum system, String phone) throws UserAccountException;
|
| | | /**
|
| | | * 根据系统和电话号码寻找用户
|
| | | *
|
| | | * @param system
|
| | | * @param phone
|
| | | * @return
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public UserInfo getUserInfoByPhone(SystemEnum system, String phone) throws UserAccountException;
|
| | |
|
| | | public void addUser(UserInfo user);
|
| | | public void addUser(UserInfo user);
|
| | |
|
| | | /**
|
| | | * 更改部分用户信息
|
| | | * |
| | | * @param user
|
| | | */
|
| | | public void updateUserSelective(UserInfo user);
|
| | | /**
|
| | | * 更改部分用户信息
|
| | | *
|
| | | * @param user
|
| | | */
|
| | | public void updateUserSelective(UserInfo user);
|
| | |
|
| | | /**
|
| | | * 绑定电话号码
|
| | | * |
| | | * @param uid
|
| | | * @param phone
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public void bindPhone(Long uid, String phone) throws UserAccountException;
|
| | | /**
|
| | | * 绑定电话号码
|
| | | *
|
| | | * @param uid
|
| | | * @param phone
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public void bindPhone(Long uid, String phone) throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 解绑电话
|
| | | * |
| | | * @param uid
|
| | | * @param phone
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public void unBindPhone(Long uid, String phone) throws UserAccountException;
|
| | | /**
|
| | | * 解绑电话
|
| | | *
|
| | | * @param uid
|
| | | * @param phone
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public void unBindPhone(Long uid, String phone) throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 绑定淘宝
|
| | | * |
| | | * @param uid
|
| | | * @param tbOpenId
|
| | | * @param tbNickName
|
| | | * @param tbPortrait
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public void bindTaoBao(Long uid, String tbOpenId, String tbNickName, String tbPortrait) throws UserAccountException;
|
| | | /**
|
| | | * 绑定淘宝
|
| | | *
|
| | | * @param uid
|
| | | * @param tbOpenId
|
| | | * @param tbNickName
|
| | | * @param tbPortrait
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public void bindTaoBao(Long uid, String tbOpenId, String tbNickName, String tbPortrait) throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 解绑淘宝
|
| | | * |
| | | * @param uid
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public void unBindTaoBao(Long uid) throws UserAccountException;
|
| | | /**
|
| | | * 解绑淘宝
|
| | | *
|
| | | * @param uid
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public void unBindTaoBao(Long uid) throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 更改微信绑定
|
| | | * |
| | | * @param uid
|
| | | * @param code
|
| | | */
|
| | | public void changeWXBind(AcceptData acceptData, Long uid, String code) throws UserAccountException;
|
| | | /**
|
| | | * 更改微信绑定
|
| | | *
|
| | | * @param uid
|
| | | * @param code
|
| | | */
|
| | | public void changeWXBind(AcceptData acceptData, Long uid, String code) throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 清理用户头像
|
| | | * |
| | | * @param uid
|
| | | */
|
| | | public void clearUserPortrait(Long uid);
|
| | | /**
|
| | | * 清理用户头像
|
| | | *
|
| | | * @param uid
|
| | | */
|
| | | public void clearUserPortrait(Long uid);
|
| | |
|
| | | /**
|
| | | * 修复用户头像
|
| | | * |
| | | * @param uid
|
| | | */
|
| | | public String repairPortrait(Long uid);
|
| | | /**
|
| | | * 修复用户头像
|
| | | *
|
| | | * @param uid
|
| | | */
|
| | | public String repairPortrait(Long uid);
|
| | |
|
| | | /**
|
| | | * 电话号码登录 1.5.3
|
| | | * @param ipInfo
|
| | | * @param acceptData
|
| | | * @param loginType
|
| | | * @param vcode
|
| | | * @param phone
|
| | | * @param appId
|
| | | * @return
|
| | | * @throws UserAccountException
|
| | | */
|
| | | @Deprecated
|
| | | public UserInfo loginPhone(ProxyIP ipInfo, int loginType, String vcode, String phone, BusinessSystem businessSystem)
|
| | | throws UserAccountException;
|
| | | /**
|
| | | * 电话号码登录 1.5.3
|
| | | *
|
| | | * @param ipInfo
|
| | | * @param loginType
|
| | | * @param vcode
|
| | | * @param phone
|
| | | * @param businessSystem
|
| | | * @return
|
| | | * @throws UserAccountException
|
| | | */
|
| | | @Deprecated
|
| | | public UserInfo loginPhone(ProxyIP ipInfo, int loginType, String vcode, String phone, BusinessSystem businessSystem)
|
| | | throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 淘宝登录
|
| | | *
|
| | | * @param ipInfo
|
| | | * @param taoBaoUser -淘宝信息
|
| | | * @param businessSystem
|
| | | * @return
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public UserInfo loginTB(ProxyIP ipInfo, TaoBaoUser taoBaoUser, BusinessSystem businessSystem)
|
| | | throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 微信登录 1.5.3
|
| | | *
|
| | | * @param ipInfo
|
| | | * @param loginType
|
| | | * @param code
|
| | | * @param businessSystem
|
| | | * @return
|
| | | * @throws UserAccountException
|
| | | */
|
| | | @Deprecated
|
| | | public UserInfo loginWeiXin(ProxyIP ipInfo, int loginType, String code, BusinessSystem businessSystem) throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 绑定电话号码 V1.5.3
|
| | | *
|
| | | * @param uid
|
| | | * @param phone
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public void bindPhoneNew(Long uid, String phone) throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 绑定微信 V1.5.3
|
| | | *
|
| | | * @param uid
|
| | | * @param code
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public void bindWeiXin(AcceptData acceptData, Long uid, String code) throws UserAccountException;
|
| | |
|
| | |
|
| | | /**
|
| | | * 微信登录 1.5.3
|
| | | * @param ipInfo
|
| | | * @param acceptData
|
| | | * @param loginType
|
| | | * @param code
|
| | | * @param appId
|
| | | * @return
|
| | | * @throws UserAccountException
|
| | | */
|
| | | @Deprecated
|
| | | public UserInfo loginWeiXin(ProxyIP ipInfo, int loginType, String code, BusinessSystem businessSystem) throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 绑定电话号码 V1.5.3
|
| | | * |
| | | * @param uid
|
| | | * @param phone
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public void bindPhoneNew(Long uid, String phone) throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 绑定微信 V1.5.3
|
| | | * |
| | | * @param uid
|
| | | * @param code
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public void bindWeiXin(AcceptData acceptData, Long uid, String code) throws UserAccountException;
|
| | | |
| | |
|
| | | /**
|
| | | * 绑定微信 V1.5.3
|
| | | * @param uid
|
| | | * @param wxUser
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public void bindWeiXin( Long uid, WeiXinUser wxUser ) throws UserAccountException;
|
| | | /**
|
| | | * 绑定微信 V1.5.3
|
| | | *
|
| | | * @param uid
|
| | | * @param wxUser
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public void bindWeiXin(Long uid, WeiXinUser wxUser) throws UserAccountException;
|
| | |
|
| | |
|
| | | /**
|
| | | * 账户封禁
|
| | | * |
| | | * @param uid
|
| | | * @param reason
|
| | | */
|
| | | public void forbiddenUser(Long uid, String reason);
|
| | | /**
|
| | | * 账户封禁
|
| | | *
|
| | | * @param uid
|
| | | * @param reason
|
| | | */
|
| | | public void forbiddenUser(Long uid, String reason);
|
| | |
|
| | | /**
|
| | | * 封禁用户所有信息:手机号、微信、淘宝、支付宝
|
| | | * |
| | | * @param uid
|
| | | * @param reason
|
| | | */
|
| | | public void forbiddenUserAll(Long uid, String reason);
|
| | | /**
|
| | | * 封禁用户所有信息:手机号、微信、淘宝、支付宝
|
| | | *
|
| | | * @param uid
|
| | | * @param reason
|
| | | */
|
| | | public void forbiddenUserAll(Long uid, String reason);
|
| | |
|
| | | /**
|
| | | * 删除账户
|
| | | * |
| | | * @param uid
|
| | | * @param reason
|
| | | */
|
| | | public void DeleteUser(Long uid, String reason);
|
| | | /**
|
| | | * 删除账户
|
| | | *
|
| | | * @param uid
|
| | | * @param reason
|
| | | */
|
| | | public void DeleteUser(Long uid, String reason);
|
| | |
|
| | | /**
|
| | | * 长时间未登录账户删除
|
| | | * |
| | | * @param uid
|
| | | * @param reason
|
| | | */
|
| | | public void DeleteUserOutOfDate(Long uid, String reason);
|
| | | /**
|
| | | * 长时间未登录账户删除
|
| | | *
|
| | | * @param uid
|
| | | * @param reason
|
| | | */
|
| | | public void DeleteUserOutOfDate(Long uid, String reason);
|
| | |
|
| | | /**
|
| | | * 2.0.1 新登录方式 -微信
|
| | | * @param ipInfo
|
| | | * @param acceptData
|
| | | * @param loginType
|
| | | * @param wxCode
|
| | | * @param appId
|
| | | * @return
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public UserInfo loginWeiXinNew(ProxyIP ipInfo, int loginType, String wxCode,
|
| | | BusinessSystem businessSystem) throws UserAccountException;
|
| | | /**
|
| | | * 2.0.1 新登录方式 -微信
|
| | | *
|
| | | * @param ipInfo
|
| | | * @param acceptData
|
| | | * @param loginType
|
| | | * @param wxCode
|
| | | * @param appId
|
| | | * @return
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public UserInfo loginWeiXinNew(ProxyIP ipInfo, int loginType, String wxCode,
|
| | | BusinessSystem businessSystem) throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 未注册之前绑定手机号
|
| | | * @param ipinfo
|
| | | * @param acceptData
|
| | | * @param phone
|
| | | * @param key
|
| | | * @return
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public UserInfo bindPhoneToLogin(ProxyIP ipinfo, AcceptData acceptData, String phone, String key)
|
| | | throws UserAccountException;
|
| | | /**
|
| | | * 未注册之前绑定手机号
|
| | | *
|
| | | * @param ipinfo
|
| | | * @param acceptData
|
| | | * @param phone
|
| | | * @param key
|
| | | * @return
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public UserInfo bindPhoneToLogin(ProxyIP ipinfo, AcceptData acceptData, String phone, String key)
|
| | | throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 手机登录需要绑定微信
|
| | | * @param ipinfo
|
| | | * @param acceptData
|
| | | * @param loginType
|
| | | * @param vcode
|
| | | * @param phone
|
| | | * @param appId
|
| | | * @return
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public UserInfo loginPhoneNew(ProxyIP ipinfo, AcceptData acceptData, int loginType, String vcode, String phone, String appId)
|
| | | throws UserAccountException;
|
| | | /**
|
| | | * 手机登录需要绑定微信
|
| | | *
|
| | | * @param ipinfo
|
| | | * @param acceptData
|
| | | * @param loginType
|
| | | * @param vcode
|
| | | * @param phone
|
| | | * @param appId
|
| | | * @return
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public UserInfo loginPhoneNew(ProxyIP ipinfo, AcceptData acceptData, int loginType, String vcode, String phone, String appId)
|
| | | throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 绑定微信登录 + 手机号key
|
| | | * @param ipInfo
|
| | | * @param acceptData
|
| | | * @param code
|
| | | * @param appId
|
| | | * @param key
|
| | | * @return
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public UserInfo bindWXToLogin(ProxyIP ipInfo, AcceptData acceptData, String code, String appId,
|
| | | String key) throws UserAccountException;
|
| | | /**
|
| | | * 绑定微信登录 + 手机号key
|
| | | *
|
| | | * @param ipInfo
|
| | | * @param acceptData
|
| | | * @param code
|
| | | * @param appId
|
| | | * @param key
|
| | | * @return
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public UserInfo bindWXToLogin(ProxyIP ipInfo, AcceptData acceptData, String code, String appId,
|
| | | String key) throws UserAccountException;
|
| | |
|
| | | }
|
| | |
| | | */
|
| | | public UserInfo getEffectiveUserInfoByWXUnionId(String unionId, SystemEnum sysetm);
|
| | |
|
| | |
|
| | | /**
|
| | | * 获取有效用户(根据淘宝OpenId)
|
| | | * @param openId
|
| | | * @param sysetm
|
| | | * @return
|
| | | */
|
| | | public UserInfo getEffectiveUserInfoByOpenId(String openId, SystemEnum sysetm);
|
| | |
|
| | | /**
|
| | | * 获取用户余额
|
| | | *
|
| | |
| | | private BigDecimal totalFanLiMoney;// 累计自购返利
|
| | | private BigDecimal totalShareMoney;// 累计分享奖金
|
| | | private BigDecimal totalInviteMoney;// 累计邀请奖金
|
| | | private BigDecimal totalMoney;//累计资金
|
| | |
|
| | | // 收货详情
|
| | | private BigDecimal monthSettleMoney;// 本月已收货
|
| | |
| | |
|
| | | private MoneyPredictVO todayPredict;// 今日预估
|
| | | private MoneyPredictVO monthPredict;// 本月预估
|
| | | |
| | |
|
| | |
|
| | | public BigDecimal getTotalMoney() {
|
| | | return totalMoney;
|
| | | }
|
| | |
|
| | | public void setTotalMoney(BigDecimal totalMoney) {
|
| | | this.totalMoney = totalMoney;
|
| | | }
|
| | |
|
| | | public BigDecimal getBalanceMoney() {
|
| | | return balanceMoney;
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.vo.taobao; |
| | | |
| | | public class TaoBaoUser { |
| | | private String userid; |
| | | private String nick; |
| | | private String avatarUrl; |
| | | private String openId; |
| | | private String openSid; |
| | | private String topAccessToken; |
| | | private String topAuthCode; |
| | | private String topExpireTime; |
| | | private String ssoToken; |
| | | private String havanaSsoToken; |
| | | |
| | | public String getUserid() { |
| | | return userid; |
| | | } |
| | | |
| | | public void setUserid(String userid) { |
| | | this.userid = userid; |
| | | } |
| | | |
| | | public String getNick() { |
| | | return nick; |
| | | } |
| | | |
| | | public void setNick(String nick) { |
| | | this.nick = nick; |
| | | } |
| | | |
| | | public String getAvatarUrl() { |
| | | return avatarUrl; |
| | | } |
| | | |
| | | public void setAvatarUrl(String avatarUrl) { |
| | | this.avatarUrl = avatarUrl; |
| | | } |
| | | |
| | | public String getOpenId() { |
| | | return openId; |
| | | } |
| | | |
| | | public void setOpenId(String openId) { |
| | | this.openId = openId; |
| | | } |
| | | |
| | | public String getOpenSid() { |
| | | return openSid; |
| | | } |
| | | |
| | | public void setOpenSid(String openSid) { |
| | | this.openSid = openSid; |
| | | } |
| | | |
| | | public String getTopAccessToken() { |
| | | return topAccessToken; |
| | | } |
| | | |
| | | public void setTopAccessToken(String topAccessToken) { |
| | | this.topAccessToken = topAccessToken; |
| | | } |
| | | |
| | | public String getTopAuthCode() { |
| | | return topAuthCode; |
| | | } |
| | | |
| | | public void setTopAuthCode(String topAuthCode) { |
| | | this.topAuthCode = topAuthCode; |
| | | } |
| | | |
| | | public String getTopExpireTime() { |
| | | return topExpireTime; |
| | | } |
| | | |
| | | public void setTopExpireTime(String topExpireTime) { |
| | | this.topExpireTime = topExpireTime; |
| | | } |
| | | |
| | | public String getSsoToken() { |
| | | return ssoToken; |
| | | } |
| | | |
| | | public void setSsoToken(String ssoToken) { |
| | | this.ssoToken = ssoToken; |
| | | } |
| | | |
| | | public String getHavanaSsoToken() { |
| | | return havanaSsoToken; |
| | | } |
| | | |
| | | public void setHavanaSsoToken(String havanaSsoToken) { |
| | | this.havanaSsoToken = havanaSsoToken; |
| | | } |
| | | } |
| | |
| | | mongo.dbname=flq
|
| | | mongo.port=27017
|
| | | mongo.port=27016
|
| | | #开发环境
|
| | | mongo.host=192.168.1.253
|
| | | mongo.username=admin
|
| | | mongo.password=123456
|
| | | #mongo.host=192.168.1.253
|
| | | #mongo.username=admin
|
| | | #mongo.password=123456
|
| | | #
|
| | | #mongo.host=193.112.35.168
|
| | | #mongo.username=yeshi
|
| | | #mongo.password=Yeshi2016@
|
| | | mongo.host=193.112.35.168
|
| | | mongo.username=yeshi
|
| | | mongo.password=Yeshi2016@
|
| | |
|
| | | mongo.connectionsPerHost=8
|
| | | mongo.threadsAllowedToBlockForConnectionMultiplier=4
|
| | |
| | | </select> |
| | | |
| | | |
| | | <select id="selectByKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.String"> |
| | | <select id="selectByKey" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_hongbao_manage where `key` = #{key} AND system=#{system} order by validtime |
| | |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | <select id="getEffectiveUserInfoByOpenId" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_user |
| | | where identifycode=#{openId} AND system=#{system} AND state = 0 |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | |
| | | <select id="getEffectiveUserInfoByWXOpenId" resultMap="BaseResultMap"> |
| | | select |
| | |
| | | |
| | | <select id="listEffective" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_brand_class_shop b |
| | | LEFT JOIN `yeshi_ec_taobao_shop_info` p ON b.`bcs_shop_id` = p.`tsi_id` left join yeshi_ec_brand_class_system_map m on m.`sm_brand_class_id`=b.`bcs_cid` |
| | | left join yeshi_ec_brand_class_system_map m on m.`sm_brand_class_id`=b.`bcs_cid` |
| | | WHERE b.bcs_state = 1 AND m.sm_system=#{system} |
| | | <if test="cid != null and cid !=0 "> |
| | | AND b.`bcs_cid` = #{cid} |
| | |
| | | </delete> |
| | | |
| | | <select id="listBrandInfoVO" resultMap="ResultVOMap"> |
| | | SELECT * FROM yeshi_ec_brand_info d LEFT JOIN `yeshi_ec_brand_class_shop` s ON d.`bf_id`=s.`bcs_shop_id` LEFT JOIN `yeshi_ec_brand_class_system_map` m ON m.`sm_brand_class_id`=s.`bcs_cid` |
| | | SELECT * FROM yeshi_ec_brand_info d LEFT JOIN `yeshi_ec_brand_class_system_map` m ON m.`sm_brand_class_id`=d.`bf_cid` |
| | | WHERE d.`bf_state` = 1 AND sm_system=#{system} AND d.bf_goods_total <![CDATA[>=]]> 3 AND d.bf_shop_total <![CDATA[>]]> 0 |
| | | <if test="cid != null">AND d.`bf_cid` = #{cid}</if> |
| | | ORDER BY d.`bf_weight` DESC |
| | |
| | | </select> |
| | | |
| | | <select id="listValidByCidToApp" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_brand_info d LEFT JOIN `yeshi_ec_brand_class_shop` s ON d.`bf_id`=s.`bcs_shop_id` LEFT JOIN `yeshi_ec_brand_class_system_map` m ON m.`sm_brand_class_id`=s.`bcs_cid` |
| | | SELECT * FROM yeshi_ec_brand_info d LEFT JOIN `yeshi_ec_brand_class_system_map` m ON m.`sm_brand_class_id`=d.`bf_cid` |
| | | WHERE d.`bf_state` = 1 AND d.`bf_cid` = #{cid} AND d.bf_goods_total <![CDATA[>=]]>3 |
| | | AND d.bf_shop_total <![CDATA[>]]> 0 AND m.sm_system=#{system} |
| | | ORDER BY d.`bf_order` |
| | |
| | | </select> |
| | | |
| | | <select id="countValidByCidToApp" resultType="Long"> |
| | | SELECT IFNULL(COUNT(d.`bf_id`),0) FROM yeshi_ec_brand_info d LEFT JOIN `yeshi_ec_brand_class_shop` s ON d.`bf_id`=s.`bcs_shop_id` LEFT JOIN `yeshi_ec_brand_class_system_map` m ON m.`sm_brand_class_id`=s.`bcs_cid` |
| | | SELECT IFNULL(COUNT(d.`bf_id`),0) FROM yeshi_ec_brand_info d LEFT JOIN `yeshi_ec_brand_class_system_map` m ON m.`sm_brand_class_id`=d.`bf_cid` |
| | | WHERE d.`bf_state` = 1 AND m.sm_system=#{system} |
| | | <if test="cid != null">AND d.`bf_cid` = #{cid}</if> |
| | | AND d.bf_goods_total <![CDATA[>=]]> 3 AND d.bf_shop_total <![CDATA[>]]> 0 |
| | |
| | | LEFT JOIN |
| | | `yeshi_ec_special_place` pc ON pc.`sp_id` = c.`cd_place_id` |
| | | WHERE |
| | | c.`cd_state` = 0 |
| | | c.`cd_state` = 0 AND c.`cd_system`=#{system} |
| | | AND IF(c.`cd_start_time` IS NULL,TRUE, |
| | | c.`cd_start_time`<![CDATA[<=]]>NOW()) |
| | | AND IF(c.`cd_end_time` IS NULL,TRUE,c.`cd_end_time`<![CDATA[>=]]>NOW()) |
| | |
| | | |
| | | <select id="listByTaoBaoUid" resultMap="BaseResultMap" |
| | | parameterType="java.lang.String"> |
| | | SELECT * FROM yeshi_ec_user_info_extra_taobao tb left join yeshi_ec_user on id=uiet_uid |
| | | SELECT <include refid="Base_Column_List"/> FROM yeshi_ec_user_info_extra_taobao tb left join yeshi_ec_user on id=uiet_uid |
| | | WHERE |
| | | tb.`uiet_taobao_uid` = #{taoBaoUid} |
| | | <if test="system!=null"> |