| | |
| | |
|
| | | for (GiveVIPApplyInfo info : list) {
|
| | | // 组织用户信息
|
| | | UserInfo userInfo = userInfoService.getUserById(info.getTargetUid());
|
| | | UserInfo userInfo = userInfoService.selectByPKey(info.getTargetUid());
|
| | | UserInfo simpleInfo = new UserInfo(userInfo.getId());
|
| | | simpleInfo.setNickName(userInfo.getNickName());
|
| | | simpleInfo.setPortrait(userInfo.getPortrait());
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | moneyBigDecial = MoneyBigDecimalUtil.mul(moneyBigDecial, new BigDecimal("2.5"));
|
| | |
|
| | | List<UserLevelEnum> levelList = new ArrayList<UserLevelEnum>();
|
| | | net.sf.json.JSONArray array = net.sf.json.JSONArray.fromObject(list);
|
| | | for (int i = 0; i < array.size(); i++)
|
| | |
| | |
|
| | | Collections.reverse(levelList);
|
| | |
|
| | | BigDecimal fanLiRate = orderHongBaoMoneyComputeService.getFanliRate(levelList.get(0), new Date());
|
| | | |
| | | moneyBigDecial=MoneyBigDecimalUtil.div(moneyBigDecial.multiply(new BigDecimal(100)), fanLiRate);
|
| | |
|
| | | List<UserTeamLevel> bossList = new ArrayList<>();
|
| | | if (levelList.size() > 1)
|
| | | for (int i = 1; i < levelList.size(); i++) {
|
| | |
| | | if (Constant.IS_TEST) {
|
| | | page = 1;
|
| | | }
|
| | | List<GiveVIPApplyInfo> list = giveVIPApplyInfoService.listByTargetUid(uid, page, Constant.PAGE_SIZE);
|
| | | long count = giveVIPApplyInfoService.countByTargetUid(uid);
|
| | | List<GiveVIPApplyInfo> list = giveVIPApplyInfoService.listBySourceUid(uid, page, Constant.PAGE_SIZE);
|
| | | long count = giveVIPApplyInfoService.countBySourceUid(uid);
|
| | | String uploadInfoLink = userVipConfigService.getValueByKey("apply_vip_upload_info_link");
|
| | | String vipLink = userVipConfigService.getValueByKey("vip_link");
|
| | |
|
| | |
| | | package com.yeshi.fanli.controller.client.v2;
|
| | |
|
| | | import java.io.InputStream;
|
| | | import java.io.PrintWriter;
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | | import java.util.UUID;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.encrypt.DESUtil;
|
| | | import org.yeshi.utils.entity.FileUploadResult;
|
| | | import org.yeshi.utils.tencentcloud.COSManager;
|
| | |
|
| | | import com.yeshi.fanli.dto.taobao.api.TaoKeOfficialActivityConvertResultDTO;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.FloatAD;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.FloatAD.FloatADTypeEnum;
|
| | |
| | | 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.FilePathEnum;
|
| | | import com.yeshi.fanli.util.ImageUtil;
|
| | | import com.yeshi.fanli.util.RedisKeyEnum;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.jd.JDUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.vo.elme.ElemeConvertInfoResultVO;
|
| | | import com.yeshi.fanli.vo.homemodule.FloatImgDetailVO;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
| | | } else {// 老人
|
| | | data.put("userTimeType", 1);
|
| | | }
|
| | | data.put("hotFuctionLink",
|
| | | configService.getByVersion(ConfigKeyEnum.hotFunctionUrl.getKey(), platform, Integer.parseInt(acceptData.getVersion())));
|
| | | data.put("hotFuctionLink", configService.getByVersion(ConfigKeyEnum.hotFunctionUrl.getKey(), platform,
|
| | | Integer.parseInt(acceptData.getVersion())));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | |
| | | public void getHomeConfigNew(AcceptData acceptData, Long uid, String callback, PrintWriter out) {
|
| | | if (uid != null && uid == 0L)
|
| | | uid = null;
|
| | | |
| | | String platform = acceptData.getPlatform(); |
| | |
|
| | | 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) );
|
| | | List<FloatAD> list = floatADService.getValidFloatADCache(FloatAD.POSITION_INDEX, null, platform,
|
| | | Integer.parseInt(version));
|
| | | 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()))) {
|
| | | if (typeEnum == FloatADTypeEnum.newUserRedPack && (!VersionUtil.greaterThan_2_0_5(platform, version)
|
| | | || !userTaoLiJinNewbiesService.verifyHasReward(uid, acceptData.getDevice()))) {
|
| | |
|
| | | listAD.remove(i);
|
| | | i--;
|
| | |
| | | }
|
| | |
|
| | | // 是否需要购物城转链
|
| | | boolean convert = "0".equalsIgnoreCase(configService.get(ConfigKeyEnum.showTaobaoCartConvert.getKey())) ? false : true;
|
| | | boolean convert = "0".equalsIgnoreCase(configService.get(ConfigKeyEnum.showTaobaoCartConvert.getKey())) ? false
|
| | | : true;
|
| | |
|
| | | if (!"cart".equalsIgnoreCase(position) && !convert) {
|
| | | out.print(JsonUtil.loadFalseResult(""));
|
| | |
| | | public void getOrderConfig(AcceptData acceptData, PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | | // 测试
|
| | | data.put("showTaoBaoOrder", "0".equalsIgnoreCase(configService.get(ConfigKeyEnum.showTaobaoOrder.getKey()).trim()) ? false : true);
|
| | | data.put("showTaoBaoOrder",
|
| | | "0".equalsIgnoreCase(configService.get(ConfigKeyEnum.showTaobaoOrder.getKey()).trim()) ? false : true);
|
| | | data.put("taoBaoOrderUrl", "https://main.m.taobao.com/olist/index.html");
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.elmeLink, uid + "");
|
| | | String elmeLink = redisManager.getCommonString(key);
|
| | | if (StringUtil.isNullOrEmpty(elmeLink)) {
|
| | | elmeLink = TaoKeApiUtil.officialActivityConvert(TaoBaoConstant.TAOBAO_ELEME_PID.split("_")[3],
|
| | | "1571715733668", userInfoExtra.getRelationId());
|
| | | 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个小时
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * |
| | | * @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) {
|
| | |
|
| | | 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 (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);
|
| | |
|
| | | if (elmeShareImg != null) {
|
| | | String filePath = FilePathEnum.banLiShopClass.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;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | 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)));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取饿了么的推广链接
|
| | | *
|
| | | * @param acceptData
|
| | |
| | | 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(""));
|
| | | |
| | | |
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.yeshi.fanli.dto.taobao.api.TaoKeOfficialActivityConvertResultDTO;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.S11SuperHongBao, info.getRelationId() +"");
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.S11SuperHongBao, info.getRelationId() + "");
|
| | | String token = redisManager.getCommonString(key);
|
| | | if (StringUtil.isNullOrEmpty(token)) {
|
| | | try {
|
| | | String link = TaoKeApiUtil.officialActivityConvert("19507100253", "1574926757600",
|
| | | info.getRelationId());
|
| | | TaoKeOfficialActivityConvertResultDTO dto = TaoKeApiUtil.officialActivityConvert("19507100253",
|
| | | "1574926757600", info.getRelationId());
|
| | | String link = dto.getShort_click_url();
|
| | | if (!StringUtil.isNullOrEmpty(link)) {
|
| | | token = TaoKeApiUtil.getTKToken("http://img.flqapp.com/resource/s12/banner.jpg", "【天猫双12】上亿红包等你来拆!---板栗快省", link);
|
| | | token = TaoKeApiUtil.getTKToken("http://img.flqapp.com/resource/s12/banner.jpg",
|
| | | "【天猫双12】上亿红包等你来拆!---板栗快省", link);
|
| | | if (!StringUtil.isNullOrEmpty(token))
|
| | | redisManager.cacheCommonString(key, token, 60 * 60 * 24);// 缓存1天
|
| | | }
|
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.yeshi.fanli.dto.taobao.api.TaoKeOfficialActivityConvertResultDTO;
|
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.S11SuperHongBao, info.getRelationId() +"");
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.S11SuperHongBao, info.getRelationId() + "");
|
| | | String token = null;
|
| | | token = redisManager.getCommonString(key);
|
| | | if (StringUtil.isNullOrEmpty(token)) {
|
| | | try {
|
| | | String link = TaoKeApiUtil.officialActivityConvert("19507100253", "1574926757600",
|
| | | info.getRelationId());
|
| | | TaoKeOfficialActivityConvertResultDTO dto = TaoKeApiUtil.officialActivityConvert("19507100253",
|
| | | "1574926757600", info.getRelationId());
|
| | | String link = dto.getShort_click_url();
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(link)) {
|
| | | token = TaoKeApiUtil.getTKToken("http://img.flqapp.com/resource/s11/banner.jpg",
|
| | | "【天猫双12】上亿红包等你来拆!", link);
|
| | | token = TaoKeApiUtil.getTKToken("http://img.flqapp.com/resource/s11/banner.jpg", "【天猫双12】上亿红包等你来拆!",
|
| | | link);
|
| | | if (!StringUtil.isNullOrEmpty(token))
|
| | | redisManager.cacheCommonString(key, token, 60 * 60 * 24);// 缓存1天
|
| | | }
|
| | |
| | | token = redisManager.getCommonString(key);
|
| | | if (StringUtil.isNullOrEmpty(token)) {
|
| | | try {
|
| | | String link = TaoKeApiUtil.officialActivityConvert("19507100253", "1574926757600",
|
| | | info.getRelationId());
|
| | | TaoKeOfficialActivityConvertResultDTO dto = TaoKeApiUtil.officialActivityConvert("19507100253",
|
| | | "1574926757600", info.getRelationId());
|
| | | String link = dto.getShort_click_url();
|
| | | if (!StringUtil.isNullOrEmpty(link)) {
|
| | | token = TaoKeApiUtil.getTKToken("http://img.flqapp.com/resource/s11/banner.jpg",
|
| | | "预售商品付定金,得奖金!", link);
|
| | | token = TaoKeApiUtil.getTKToken("http://img.flqapp.com/resource/s11/banner.jpg", "预售商品付定金,得奖金!",
|
| | | link);
|
| | | if (Constant.IS_OUTNET)
|
| | | if (!StringUtil.isNullOrEmpty(token))
|
| | | redisManager.cacheCommonString(key, token, 60 * 60 * 24);// 缓存1天
|
| | |
| | | * List<GiveVIPApplyInfo> 返回类型
|
| | | * @throws
|
| | | */
|
| | | public List<GiveVIPApplyInfo> list(Long targetUid, Integer state, int start, int count) {
|
| | | public List<GiveVIPApplyInfo> listByTargetUid(Long targetUid, Integer state, int start, int count) {
|
| | | Query query = new Query();
|
| | |
|
| | | List<Criteria> list = new ArrayList<Criteria>();
|
| | |
| | | return findList(query);
|
| | | }
|
| | |
|
| | | public long count(Long targetUid, Integer state) {
|
| | | public long countByTargetUid(Long targetUid, Integer state) {
|
| | | Query query = new Query();
|
| | |
|
| | | List<Criteria> list = new ArrayList<Criteria>();
|
| | |
| | | }
|
| | | return count(query);
|
| | | }
|
| | | |
| | | |
| | | |
| | | public List<GiveVIPApplyInfo> listBySourceUid(Long sourceUid, Integer state, int start, int count) {
|
| | | Query query = new Query();
|
| | |
|
| | | List<Criteria> list = new ArrayList<Criteria>();
|
| | | if (sourceUid != null)
|
| | | list.add(Criteria.where("sourceUid").is(sourceUid));
|
| | |
|
| | | if (state != null)
|
| | | list.add(Criteria.where("state").is(state));
|
| | |
|
| | | if (list.size() > 0) {
|
| | | Criteria[] cas = new Criteria[list.size()];
|
| | | for (int i = 0; i < list.size(); i++)
|
| | | cas[i] = list.get(i);
|
| | | query.addCriteria(new Criteria().andOperator(cas));
|
| | | }
|
| | | query.skip(start);
|
| | | query.limit(count);
|
| | | query.with(new Sort(Sort.Direction.DESC, "createTime"));
|
| | | return findList(query);
|
| | | }
|
| | |
|
| | | public long countBySourceUid(Long sourceUid, Integer state) {
|
| | | Query query = new Query();
|
| | |
|
| | | List<Criteria> list = new ArrayList<Criteria>();
|
| | | if (sourceUid != null)
|
| | | list.add(Criteria.where("sourceUid").is(sourceUid));
|
| | |
|
| | | if (state != null)
|
| | | list.add(Criteria.where("state").is(state));
|
| | |
|
| | | if (list.size() > 0) {
|
| | |
|
| | | Criteria[] cas = new Criteria[list.size()];
|
| | | for (int i = 0; i < list.size(); i++)
|
| | | cas[i] = list.get(i);
|
| | | query.addCriteria(new Criteria().andOperator(cas));
|
| | | }
|
| | | return count(query);
|
| | | }
|
| | |
|
| | | public void updateSelective(GiveVIPApplyInfo info) {
|
| | | Query query = new Query();
|
New file |
| | |
| | | package com.yeshi.fanli.dto.taobao.api;
|
| | |
|
| | | //淘客官方活动转链结果
|
| | | public class TaoKeOfficialActivityConvertResultDTO {
|
| | |
|
| | | private String wx_qrcode_url;// 微信推广二维码地址
|
| | | private String click_url;// 淘客推广长链
|
| | | private String short_click_url;// 淘客推广短链
|
| | | private String terminal_type;// 投放平台, 1-PC 2-无线
|
| | | private String material_oss_url;// 物料素材下载地址
|
| | | private String page_name;// 会场名称
|
| | | private String page_start_time;// 活动开始时间
|
| | | private String page_end_time;// 活动结束时间
|
| | | private String wx_miniprogram_path;// 微信小程序路径
|
| | | |
| | | private String token;//口令
|
| | |
|
| | | public String getToken() {
|
| | | return token;
|
| | | }
|
| | |
|
| | | public void setToken(String token) {
|
| | | this.token = token;
|
| | | }
|
| | |
|
| | | public String getWx_qrcode_url() {
|
| | | return wx_qrcode_url;
|
| | | }
|
| | |
|
| | | public void setWx_qrcode_url(String wx_qrcode_url) {
|
| | | this.wx_qrcode_url = wx_qrcode_url;
|
| | | }
|
| | |
|
| | | public String getClick_url() {
|
| | | return click_url;
|
| | | }
|
| | |
|
| | | public void setClick_url(String click_url) {
|
| | | this.click_url = click_url;
|
| | | }
|
| | |
|
| | | public String getShort_click_url() {
|
| | | return short_click_url;
|
| | | }
|
| | |
|
| | | public void setShort_click_url(String short_click_url) {
|
| | | this.short_click_url = short_click_url;
|
| | | }
|
| | |
|
| | | public String getTerminal_type() {
|
| | | return terminal_type;
|
| | | }
|
| | |
|
| | | public void setTerminal_type(String terminal_type) {
|
| | | this.terminal_type = terminal_type;
|
| | | }
|
| | |
|
| | | public String getMaterial_oss_url() {
|
| | | return material_oss_url;
|
| | | }
|
| | |
|
| | | public void setMaterial_oss_url(String material_oss_url) {
|
| | | this.material_oss_url = material_oss_url;
|
| | | }
|
| | |
|
| | | public String getPage_name() {
|
| | | return page_name;
|
| | | }
|
| | |
|
| | | public void setPage_name(String page_name) {
|
| | | this.page_name = page_name;
|
| | | }
|
| | |
|
| | | public String getPage_start_time() {
|
| | | return page_start_time;
|
| | | }
|
| | |
|
| | | public void setPage_start_time(String page_start_time) {
|
| | | this.page_start_time = page_start_time;
|
| | | }
|
| | |
|
| | | public String getPage_end_time() {
|
| | | return page_end_time;
|
| | | }
|
| | |
|
| | | public void setPage_end_time(String page_end_time) {
|
| | | this.page_end_time = page_end_time;
|
| | | }
|
| | |
|
| | | public String getWx_miniprogram_path() {
|
| | | return wx_miniprogram_path;
|
| | | }
|
| | |
|
| | | public void setWx_miniprogram_path(String wx_miniprogram_path) {
|
| | | this.wx_miniprogram_path = wx_miniprogram_path;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | <select id="statisticFirstTeamLevelCount" resultMap="BaseResultMap"
|
| | | parameterType="java.lang.Long">
|
| | | SELECT a.l as level,COUNT(*) as num FROM
|
| | |
|
| | | (
|
| | |
|
| | | SELECT MAX(v.`vpi_process`) AS l FROM yeshi_ec_threesale s LEFT JOIN
|
| | |
| | |
|
| | | <select id="statisticSecondTeamLevelCount" resultMap="BaseResultMap"
|
| | | parameterType="java.lang.Long">
|
| | |
|
| | |
|
| | | SELECT a.l as level,COUNT(*) as num FROM
|
| | |
|
| | | (
|
| | |
|
| | | SELECT MAX(v.`vpi_process`) AS l FROM yeshi_ec_threesale s LEFT JOIN
|
| | | yeshi_ec_threesale ss ON ss.`boss_id`=s.`worker_id` LEFT JOIN
|
| | | `yeshi_ec_user_vip_pre_info` v ON ss.`worker_id`=v.`vpi_uid` WHERE
|
| | | s.`boss_id`=#{uid} AND ss.`worker_id`>0 GROUP BY ss.`worker_id`
|
| | | ) a GROUP BY l
|
| | |
|
| | |
|
| | | </select>
|
| | |
|
| | | </mapper>
|
| | |
| | | List<TaoBaoOrder> list = orders.get(orderId);
|
| | | String pid = String.format("mm_%s_%s_%s", configList.get(0).getAccountId(),
|
| | | list.get(0).getSourceMediaId(), list.get(0).getAdPositionId());
|
| | | if ("饿了么".equalsIgnoreCase(list.get(0).getOrderType())) {
|
| | | if ("饿了么".equalsIgnoreCase(list.get(0).getOrderType())&&!pid.equalsIgnoreCase(TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT)) {
|
| | | // 饿了么订单开始归入到淘宝订单
|
| | | if (TimeUtil.convertToTimeTemp(list.get(0).getCreateTime(),
|
| | | "yyyy-MM-dd HH:mm:ss") >= Constant.NEW_ORDER_FANLI_RULE_TIME) {
|
| | |
| | | // 查询主红包
|
| | | HongBaoOrder hongBaoOrder = hongBaoOrderMapper.selectByCommonOrderId(commonOrder.getId());
|
| | | if (hongBaoOrder != null && hongBaoOrder.getHongBaoV2() != null) {
|
| | | if (hongBaoOrder.getHongBaoV2().getState() == HongBaoV2.STATE_BUKELINGQU) {
|
| | | if (hongBaoOrder.getHongBaoV2().getState() == HongBaoV2.STATE_BUKELINGQU || hongBaoOrder.getHongBaoV2().getState() == HongBaoV2.STATE_SHIXIAO) {
|
| | | // 订单失效,赠送金币
|
| | | try {
|
| | | invalidHongBaoV2AndGiveGodenCorn(hongBaoOrder.getHongBaoV2().getId(), hongBaoOrder.getHongBaoV2().getUserInfo().getId(), commonOrder.getOrderNo(), commonOrder.getSourceType(), "订单成功,商家未打款");
|
| | |
| | |
|
| | | @Override
|
| | | public List<GiveVIPApplyInfo> listByTargetUid(Long uid, int page, int pageSize) {
|
| | | return giveVIPApplyInfoDao.list(uid, null, (page - 1) * pageSize, pageSize);
|
| | | return giveVIPApplyInfoDao.listByTargetUid(uid, null, (page - 1) * pageSize, pageSize);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countByTargetUid(Long uid) {
|
| | | return giveVIPApplyInfoDao.count(uid, null);
|
| | | return giveVIPApplyInfoDao.countByTargetUid(uid, null);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<GiveVIPApplyInfo> listByStateAndTargetUid(Long targetUid,Integer state, int page, int pageSize) {
|
| | | return giveVIPApplyInfoDao.list(targetUid, state, (page - 1) * pageSize, pageSize);
|
| | | public List<GiveVIPApplyInfo> listByStateAndTargetUid(Long targetUid, Integer state, int page, int pageSize) {
|
| | | return giveVIPApplyInfoDao.listByTargetUid(targetUid, state, (page - 1) * pageSize, pageSize);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countByStateAndTargetUid(Long targetUid,Integer state) {
|
| | | return giveVIPApplyInfoDao.count(targetUid, state);
|
| | | public long countByStateAndTargetUid(Long targetUid, Integer state) {
|
| | | return giveVIPApplyInfoDao.countByTargetUid(targetUid, state);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | if (info == null)
|
| | | throw new GiveVIPApplyInfoException(1, "记录不存在");
|
| | |
|
| | | // if (info.getState() == GiveVIPApplyInfo.STATE_NO_INFO)
|
| | | // throw new GiveVIPApplyInfoException(2, "用户未提交资料");
|
| | | // if (info.getState() == GiveVIPApplyInfo.STATE_NO_INFO)
|
| | | // throw new GiveVIPApplyInfoException(2, "用户未提交资料");
|
| | |
|
| | | if (info.getState() == GiveVIPApplyInfo.STATE_REJECT)
|
| | | throw new GiveVIPApplyInfoException(3, "已经被拒绝");
|
| | |
| | | info.getLevel().getName(), reason);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<GiveVIPApplyInfo> listBySourceUid(Long uid, int page, int pageSize) {
|
| | | return giveVIPApplyInfoDao.listBySourceUid(uid, null, (page - 1) * pageSize, 1);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countBySourceUid(Long uid) {
|
| | | return giveVIPApplyInfoDao.countBySourceUid(uid, null);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | public void saveImgs(String id, List<String> imgList);
|
| | |
|
| | | /**
|
| | | * 根据源用户拉取数据
|
| | | * 根据目标用户拉取数据
|
| | | * @Title: listBySourceUid
|
| | | * @Description:
|
| | | * @param uid
|
| | |
| | | public List<GiveVIPApplyInfo> listByTargetUid(Long uid, int page, int pageSize);
|
| | |
|
| | | public long countByTargetUid(Long uid);
|
| | |
|
| | | /**
|
| | | * 根据源用户ID拉取数据
|
| | | * @Title: listBySourceUid
|
| | | * @Description: |
| | | * @param uid
|
| | | * @param page
|
| | | * @param pageSize
|
| | | * @return |
| | | * List<GiveVIPApplyInfo> 返回类型
|
| | | * @throws
|
| | | */
|
| | | public List<GiveVIPApplyInfo> listBySourceUid(Long uid, int page, int pageSize);
|
| | |
|
| | | public long countBySourceUid(Long uid);
|
| | |
|
| | | /**
|
| | | * 根据状态查询
|
| | |
| | | */
|
| | | public List<GiveVIPApplyInfo> listByStateAndTargetUid(Long targetUid, Integer state, int page, int pageSize);
|
| | |
|
| | | public long countByStateAndTargetUid(Long targetUid,Integer state);
|
| | | public long countByStateAndTargetUid(Long targetUid, Integer state);
|
| | |
|
| | | /**
|
| | | * 通过
|
| | |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | | public void pass(String id, Long adminId) throws GiveVIPApplyInfoException,UserVIPPreInfoException;
|
| | | public void pass(String id, Long adminId) throws GiveVIPApplyInfoException, UserVIPPreInfoException;
|
| | |
|
| | | /**
|
| | | * 拒绝
|
| | |
| | | import org.yeshi.utils.StringUtil;
|
| | |
|
| | | import com.yeshi.fanli.dto.pdd.PDDPromotionUrl;
|
| | | import com.yeshi.fanli.dto.taobao.api.TaoKeOfficialActivityConvertResultDTO;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoKeAppInfo;
|
| | | import com.yeshi.fanli.exception.goods.ConvertLinkExceptionException;
|
| | |
| | | String activityid = st.replace("{淘宝活动:", "").replace("}", "");
|
| | | if (!StringUtil.isNullOrEmpty(activityid)) {
|
| | | String adzoneId = TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT.split("_")[3];
|
| | | String link = TaoKeApiUtil.officialActivityConvert(adzoneId, activityid, relationId);
|
| | | TaoKeOfficialActivityConvertResultDTO dto = TaoKeApiUtil.officialActivityConvert(adzoneId,
|
| | | activityid, relationId);
|
| | | String link = dto.getShort_click_url();
|
| | | String token = TaoKeApiUtil.getTKToken("http://", "淘宝官方活动", link);
|
| | | newText = newText.replace(st, TaoBaoUtil.filterTaoToken(token));
|
| | | }
|
| | |
| | | shareGoods("/user/img/sharegoods/", "分享商品图片"),
|
| | | shareXCX("/user/img/sharegoods_xcx/", "分享小程序图片"),
|
| | | vipApply("/usr/img/vip/apply/","会员申请用户上传图片"),
|
| | | elmeShare("/usr/img/elme/share/","饿了么分享图生成"),
|
| | | // 编辑相关
|
| | | apk("/editor/apk/", "上传Apk安装包"), // -- /img/admin/
|
| | | section("/editor/upload_imgs/", "后台上传图片路径"), // -- /img/admin/
|
| | |
| | | |
| | | // 二维码图框 |
| | | g2d.setColor(Color.WHITE); |
| | | InputStream codeFrame = ImageUtil.class.getClassLoader().getResourceAsStream("image/share/qr_code_frame_xcx.png"); |
| | | InputStream codeFrame = ImageUtil.class.getClassLoader() |
| | | .getResourceAsStream("image/share/qr_code_frame_xcx.png"); |
| | | g2d.drawImage(ImageIO.read(codeFrame), spacing + 405, y + 20, 200, 220, null); |
| | | // 画二维码 |
| | | int codeSize = 170; |
| | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | |
| | | if (portraitStream == null) { |
| | | portraitStream = ImageUtil.class.getClassLoader().getResourceAsStream("image/official_default_head.jpg"); |
| | | portraitStream = ImageUtil.class.getClassLoader() |
| | | .getResourceAsStream("image/official_default_head.jpg"); |
| | | } |
| | | BufferedImage portraitImg = ImageIO.read(portraitStream); |
| | | BufferedImage zoomInImage = ImageUtil.zoomInImage(portraitImg, 84, 84); |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 分析海报图 |
| | | * @param qrcode |
| | |
| | | * @param goods |
| | | * @return |
| | | */ |
| | | public static InputStream drawGoodsPoster(InputStream qrcode, InputStream portraitStream, String inviteCode, |
| | | public static InputStream drawGoodsPoster(InputStream qrcode, InputStream portraitStream, String inviteCode, |
| | | String mainPic, GoodsDetailVO goods) { |
| | | try { |
| | | String fontPath = "/usr/share/fonts/PingFang_Medium.ttf"; |
| | |
| | | Font boldFont36 = Font.createFont(Font.PLAIN, new File(fontBoldPath)).deriveFont(36.0f); |
| | | |
| | | int px = 640; // 图片宽度 |
| | | // int py = 1154; // 图片高度 显示邀请码 |
| | | // int py = 1154; // 图片高度 显示邀请码 |
| | | int py = 1060; // 图片高度 |
| | | final BufferedImage targetImg = new BufferedImage(px, py, BufferedImage.TYPE_INT_RGB); |
| | | HashMap<Key, Object> mapH = new HashMap<Key, Object>(); |
| | |
| | | |
| | | // 1、画商品主图 |
| | | InputStream picStream = HttpUtil.getAsInputStream(mainPic); |
| | | // InputStream picStream = ImageUtil.class.getClassLoader().getResourceAsStream("image/share/test_pic1.jpg"); |
| | | // InputStream picStream = |
| | | // ImageUtil.class.getClassLoader().getResourceAsStream("image/share/test_pic1.jpg"); |
| | | g2d.drawImage(ImageIO.read(picStream), 0, 0, x, y, null); |
| | | |
| | | |
| | | // 2、画来源图标 |
| | | int length = 10; |
| | | int row1 = 450; |
| | |
| | | } else { |
| | | g2d.drawString(title.substring(0, length2), spacing, y + 45 + row * 36); |
| | | } |
| | | |
| | | |
| | | |
| | | int baoYouLength = spacing; |
| | | if (!goods.isHasCoupon()) { |
| | | // 无券 |
| | |
| | | g2d.setFont(font26); |
| | | g2d.setColor(new Color(229, 0, 92)); |
| | | g2d.drawString("券后价 ¥ ", spacing, y + 125); |
| | | |
| | | |
| | | g2d.setFont(boldFont36); |
| | | String couponPrice = MoneyBigDecimalUtil.getWithNoZera(goods.getCouponPrice()).toString(); |
| | | g2d.drawString(couponPrice, spacing + 116, y + 125); |
| | | g2d.drawString(couponPrice, spacing + 116, y + 125); |
| | | |
| | | FontMetrics fm2 = g2d.getFontMetrics(boldFont36); |
| | | int textLength1 = 116 + fm2.stringWidth(couponPrice); |
| | | |
| | | |
| | | // 渠道原价 |
| | | g2d.setColor(new Color(153, 153, 153)); |
| | | g2d.setFont(font24); |
| | |
| | | g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
| | | g2d.drawRoundRect(spacing + 42, y + 140, textLength + 20, 39, 10, 10); |
| | | g2d.drawString(quanAmount, spacing + 55, y + 170); |
| | | |
| | | baoYouLength =spacing + 42 + textLength + 20 + 20; |
| | | |
| | | baoYouLength = spacing + 42 + textLength + 20 + 20; |
| | | } |
| | | |
| | | // 自营 、包邮 |
| | |
| | | ziying = ImageUtil.class.getClassLoader().getResourceAsStream("image/icon_baoyou.png"); |
| | | g2d.drawImage(ImageIO.read(ziying), baoYouLength, y + 150, 60, 30, null); |
| | | } |
| | | |
| | | |
| | | // 销量 |
| | | String sale = null; |
| | |
| | | g2d.setFont(font24); |
| | | g2d.setColor(new Color(153, 153, 153)); |
| | | g2d.drawString(sale, spacing + 605 - textLength, y + 125); |
| | | |
| | | |
| | | |
| | | // 下单提示 |
| | | InputStream downTip = null; |
| | | InputStream downTip = null; |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | downTip = ImageUtil.class.getClassLoader().getResourceAsStream("image/share/down_tip_tb.png"); |
| | | } else { |
| | | downTip = ImageUtil.class.getClassLoader().getResourceAsStream("image/share/down_tip_jd_pdd.png"); |
| | | } |
| | | g2d.drawImage(ImageIO.read(downTip), spacing, y + 200, 382, 203, null); |
| | | |
| | | |
| | | // 二维码图框 |
| | | InputStream codeFrame = ImageUtil.class.getClassLoader().getResourceAsStream("image/share/qr_code_frame01.png"); |
| | | InputStream codeFrame = ImageUtil.class.getClassLoader() |
| | | .getResourceAsStream("image/share/qr_code_frame01.png"); |
| | | g2d.drawImage(ImageIO.read(codeFrame), spacing + 405, y + 200, 200, 203, null); |
| | | |
| | | |
| | | // 画二维码 |
| | | int codeSize = 170; |
| | | int pX = spacing + 422; |
| | | int pY = y + 217; |
| | | int pX = spacing + 422; |
| | | int pY = y + 217; |
| | | g2d.drawImage(ImageIO.read(qrcode), pX, pY, codeSize, codeSize, null); |
| | | |
| | | int portraitSize = 200 * 5 / 23; |
| | |
| | | portraitImg = ImageUtil.zoomInImage(portraitImg, portraitSize, portraitSize); |
| | | portraitImg = ImageUtil.roundImage(portraitImg, 10); |
| | | g2d.drawImage(portraitImg, pPX, pPY, portraitSize, portraitSize, null); |
| | | |
| | | |
| | | // g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
| | | // g2d.setColor(new Color(255,231, 224)); |
| | | // g2d.fillRoundRect(spacing, y + 420, 607, 79, 10, 10); |
| | | // |
| | | // InputStream banliStream = ImageUtil.class.getClassLoader().getResourceAsStream("image/banlikuaisheng.png"); |
| | | // g2d.drawImage(ImageIO.read(banliStream), spacing + 20, y + 440, 170, 38, null); |
| | | // |
| | | // inviteCode = "邀请码:" + inviteCode; |
| | | // Font font26d28 = Font.createFont(Font.PLAIN, new File(fontPath)).deriveFont(26.28f); |
| | | // FontMetrics fmcode = g2d.getFontMetrics(font26d28); |
| | | // int codeLength = fmcode.stringWidth(inviteCode); |
| | | // // 邀请码背景 |
| | | // g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
| | | // g2d.setColor(new Color(229,71, 27)); |
| | | // g2d.fillRoundRect(spacing + (600 - (int)(codeLength * 1.1)), y + 440, 10 + codeLength, 37, 10, 10); |
| | | // // 邀请码文字 |
| | | // g2d.setFont(font26d28); |
| | | // g2d.setColor(new Color(255, 255, 255)); |
| | | // g2d.drawString(inviteCode, spacing + (600 - (int)(codeLength * 1.1) + 5), y + 468); |
| | | |
| | | |
| | | // g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, |
| | | // RenderingHints.VALUE_ANTIALIAS_ON); |
| | | // g2d.setColor(new Color(255,231, 224)); |
| | | // g2d.fillRoundRect(spacing, y + 420, 607, 79, 10, 10); |
| | | // |
| | | // InputStream banliStream = |
| | | // ImageUtil.class.getClassLoader().getResourceAsStream("image/banlikuaisheng.png"); |
| | | // g2d.drawImage(ImageIO.read(banliStream), spacing + 20, y + 440, |
| | | // 170, 38, null); |
| | | // |
| | | // inviteCode = "邀请码:" + inviteCode; |
| | | // Font font26d28 = Font.createFont(Font.PLAIN, new |
| | | // File(fontPath)).deriveFont(26.28f); |
| | | // FontMetrics fmcode = g2d.getFontMetrics(font26d28); |
| | | // int codeLength = fmcode.stringWidth(inviteCode); |
| | | // // 邀请码背景 |
| | | // g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, |
| | | // RenderingHints.VALUE_ANTIALIAS_ON); |
| | | // g2d.setColor(new Color(229,71, 27)); |
| | | // g2d.fillRoundRect(spacing + (600 - (int)(codeLength * 1.1)), y + |
| | | // 440, 10 + codeLength, 37, 10, 10); |
| | | // // 邀请码文字 |
| | | // g2d.setFont(font26d28); |
| | | // g2d.setColor(new Color(255, 255, 255)); |
| | | // g2d.drawString(inviteCode, spacing + (600 - (int)(codeLength * |
| | | // 1.1) + 5), y + 468); |
| | | |
| | | g2d.dispose(); |
| | | |
| | | ByteArrayOutputStream aos = new ByteArrayOutputStream(); |
| | |
| | | } |
| | | } |
| | | return null; |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | // 画券 |
| | | BigDecimal withNoZera = MoneyBigDecimalUtil.getWithNoZera(goods.getCouponAmount()); |
| | | if (withNoZera != null && withNoZera.compareTo(new BigDecimal(0)) > 0) { |
| | | // // 画透明背景 |
| | | // g2d.setColor(new Color(255, 255, 255, 210)); |
| | | // g2d.fillRect(topX + 8, topY + 240, 300, 65); |
| | | // // 画透明背景 |
| | | // g2d.setColor(new Color(255, 255, 255, 210)); |
| | | // g2d.fillRect(topX + 8, topY + 240, 300, 65); |
| | | |
| | | g2d.setRenderingHints(mapH); |
| | | |
| | |
| | | int size = withNoZera.toString().length() * 22; |
| | | int place = withNoZera.toString().length() * 22; |
| | | |
| | | // // 券红色底部 |
| | | // // 券红色底部 |
| | | int quanBGWidht = topX + 170 - place; |
| | | int quanBGHeight = topY + 220; |
| | | g2d.setColor(new Color(229, 0, 92)); |
| | |
| | | out.close(); |
| | | } |
| | | |
| | | public static InputStream drawAlipayImage(InputStream bg, String recieveTime, String money, String orderNo, |
| | | String ttf) { |
| | | try { |
| | | String fontPath = "/usr/share/fonts/PingFang_Medium.ttf"; |
| | | String os = System.getProperty("os.name"); |
| | | if (os.toLowerCase().startsWith("win")) { |
| | | fontPath = ttf; |
| | | } |
| | | |
| | | String fontBoldPath = "/usr/share/fonts/PingFang_Heavy_0.ttf"; |
| | | if (os.toLowerCase().startsWith("win")) { |
| | | fontBoldPath = "D:/PingFang_Heavy_0.ttf"; |
| | | } |
| | | int px = 1080; // 图片宽度 |
| | | int py = 2340; // 图片高度 |
| | | final BufferedImage targetImg = new BufferedImage(px, py, BufferedImage.TYPE_INT_RGB); |
| | | HashMap<Key, Object> mapH = new HashMap<Key, Object>(); |
| | | mapH.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);// 抗锯齿 (抗锯齿总开关) |
| | | mapH.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_GASP);// 文字抗锯齿 |
| | | |
| | | final Graphics2D g2d = (Graphics2D) targetImg.getGraphics(); |
| | | g2d.setRenderingHints(mapH); |
| | | g2d.setColor(Color.decode("#333333")); |
| | | g2d.fillRect(0, 0, px, py); |
| | | |
| | | BufferedImage bgImage = ImageIO.read(bg); |
| | | g2d.drawImage(bgImage, null, 0, 0); |
| | | |
| | | Font font = Font.createFont(Font.PLAIN, new File(fontPath)).deriveFont(87.0f); |
| | | g2d.setFont(font); |
| | | |
| | | // 画金额 |
| | | FontMetrics fm = g2d.getFontMetrics(font); |
| | | fm.stringWidth(money); |
| | | |
| | | g2d.drawString(money, (px - fm.stringWidth(money)) / 2, 359 + 65); |
| | | |
| | | // 画创建时间 |
| | | |
| | | // 画订单 |
| | | |
| | | g2d.dispose(); |
| | | |
| | | ByteArrayOutputStream aos = new ByteArrayOutputStream(); |
| | | ImageIO.write(targetImg, "JPEG", aos); |
| | | return new ByteArrayInputStream(aos.toByteArray()); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | try { |
| | | LogHelper.errorDetailInfo(e); |
| | | } catch (Exception e1) { |
| | | e1.printStackTrace(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public static InputStream drawSimpleImage(InputStream bg, int width, int height, InputStream imgStream, |
| | | int imgWidth, int imgHeight, int px, int py) { |
| | | try { |
| | | final BufferedImage targetImg = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); |
| | | HashMap<Key, Object> mapH = new HashMap<Key, Object>(); |
| | | mapH.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);// 抗锯齿 (抗锯齿总开关) |
| | | mapH.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_GASP);// 文字抗锯齿 |
| | | |
| | | final Graphics2D g2d = (Graphics2D) targetImg.getGraphics(); |
| | | g2d.setRenderingHints(mapH); |
| | | g2d.setColor(Color.decode("#333333")); |
| | | g2d.fillRect(0, 0, px, py); |
| | | |
| | | BufferedImage bgImage = ImageIO.read(bg); |
| | | g2d.drawImage(bgImage, null, 0, 0); |
| | | |
| | | BufferedImage img = zoomInImage(ImageIO.read(imgStream), imgWidth, imgHeight); |
| | | |
| | | g2d.drawImage(img, px, py, null); |
| | | |
| | | g2d.dispose(); |
| | | |
| | | ByteArrayOutputStream aos = new ByteArrayOutputStream(); |
| | | ImageIO.write(targetImg, "JPEG", aos); |
| | | return new ByteArrayInputStream(aos.toByteArray()); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | try { |
| | | LogHelper.errorDetailInfo(e); |
| | | } catch (Exception e1) { |
| | | e1.printStackTrace(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
| | |
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.taobao.TbImgUtil;
|
| | |
|
| | | import com.yeshi.fanli.dto.taobao.TaoBaoShopInfoDTO;
|
| | | import com.yeshi.fanli.dto.taobao.TaoLiJinDTO;
|
| | | import com.yeshi.fanli.dto.taobao.api.TaoKeOfficialActivityConvertResultDTO;
|
| | | import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinReport;
|
| | | import com.yeshi.fanli.entity.taobao.SearchFilter;
|
| | | import com.yeshi.fanli.entity.taobao.SearchShopFilter;
|
| | |
| | | * -渠道ID
|
| | | * @return
|
| | | */
|
| | | public static String officialActivityConvert(String adZoneId, String promotionSceneId, String relationId) {
|
| | | public static TaoKeOfficialActivityConvertResultDTO officialActivityConvert(String adZoneId,
|
| | | String promotionSceneId, String relationId) {
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("method", "taobao.tbk.activitylink.get");
|
| | | map.put("method", "taobao.tbk.activity.info.get");
|
| | | map.put("adzone_id", adZoneId);
|
| | | map.put("promotion_scene_id", promotionSceneId);
|
| | | map.put("activity_material_id", promotionSceneId);
|
| | | if (relationId != null)
|
| | | map.put("relation_id", relationId);
|
| | | TaoKeAppInfo app = new TaoKeAppInfo();
|
| | |
| | | app.setAppSecret(TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | try {
|
| | | String result = TaoKeBaseUtil.baseRequestForThreeTimes(map, app);
|
| | | System.out.println(result);
|
| | | JSONObject json = JSONObject.fromObject(result);
|
| | | if (json != null) {
|
| | | json = json.optJSONObject("tbk_activitylink_get_response");
|
| | | if (json.optInt("result_code") == 200) {
|
| | | return json.optString("data");
|
| | | json = json.optJSONObject("tbk_activity_info_get_response");
|
| | | if (json.optJSONObject("data") != null) {
|
| | | return JsonUtil.getSimpleGson().fromJson(json.optJSONObject("data").toString(),
|
| | | TaoKeOfficialActivityConvertResultDTO.class);
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
New file |
| | |
| | | package com.yeshi.fanli.vo.elme;
|
| | |
|
| | | public class ElemeConvertInfoResultVO {
|
| | | private String qrCodeImg;// 二维码图
|
| | | private String token;// 口令
|
| | | private String link;// 链接
|
| | |
|
| | | public ElemeConvertInfoResultVO(String qrCodeImg, String token, String link) {
|
| | | super();
|
| | | this.qrCodeImg = qrCodeImg;
|
| | | this.token = token;
|
| | | this.link = link;
|
| | | }
|
| | |
|
| | | public String getQrCodeImg() {
|
| | | return qrCodeImg;
|
| | | }
|
| | |
|
| | | public void setQrCodeImg(String qrCodeImg) {
|
| | | this.qrCodeImg = qrCodeImg;
|
| | | }
|
| | |
|
| | | public String getToken() {
|
| | | return token;
|
| | | }
|
| | |
|
| | | public void setToken(String token) {
|
| | | this.token = token;
|
| | | }
|
| | |
|
| | | public String getLink() {
|
| | | return link;
|
| | | }
|
| | |
|
| | | public void setLink(String link) {
|
| | | this.link = link;
|
| | | }
|
| | |
|
| | | }
|