Merge remote-tracking branch 'origin/master'
Conflicts:
fanli/src/main/java/com/yeshi/fanli/controller/web/TLJBuyGoodsController.java
fanli/src/main/java/com/yeshi/fanli/entity/taobao/TLJBuyGoods.java
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TLJBuyGoodsServiceImpl.java
fanli/src/main/java/com/yeshi/fanli/service/inter/taobao/TLJBuyGoodsService.java
| | |
| | | TaoBaoWeiQuanOrder weiQuanOrder = taoBaoWeiQuanOrderService.listByorderItemId(order.getTradeId());
|
| | | if (weiQuanOrder != null)// 有维权
|
| | | {
|
| | | order.setWeiQuanState(weiQuanOrder.getState());
|
| | | order.setState(CommonOrder.STATE_WQ);
|
| | | TaoBaoWeiQuanDrawBack drawBack = taoBaoWeiQuanDrawBackService
|
| | | .selectByOrderItemId(weiQuanOrder.getOrderItemId());
|
| | | if (drawBack != null) {// 已经退款
|
| | | order.setWeiQuanState(weiQuanOrder.getState());
|
| | | |
| | | // 计算退款资金
|
| | | UserMoneyDetail detail = null;
|
| | | switch (order.getHongBaoType()) {
|
| | |
| | | @Resource
|
| | | private UserActiveLogService userActiveLogService;
|
| | |
|
| | | /**s
|
| | | * 首页配置信息
|
| | | /**
|
| | | * s 首页配置信息
|
| | | *
|
| | | * @param acceptData
|
| | | * @param out
|
| | |
| | | "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.get("invite_code_input_help"));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | |
| | | TaoBaoGoodsBrief tb = null;
|
| | | String URL_REGEX = "(((http|https)://)|(www\\.))[a-zA-Z0-9\\._-]+\\.[a-zA-Z]{2,6}(:[0-9]{1,4})?(/[a-zA-Z0-9\\&%_\\./-~-]*)?";
|
| | |
|
| | | |
| | | Pattern p = Pattern.compile(URL_REGEX);
|
| | | Matcher matcher = p.matcher(url);
|
| | | if (!matcher.find()) {// 不包含链接
|
| | |
| | | // 商品详情
|
| | | // 发现
|
| | | // 没有链接,标题过长也不处理
|
| | | if (text.length() > 50) {
|
| | | if (text.startsWith("【") && text.contains("】")) {
|
| | | int end = text.indexOf("】");
|
| | | if (end > 2)
|
| | | text = text.substring(1, end);
|
| | | }
|
| | |
|
| | | LogHelper.test("根据粘贴板推荐:"+text);
|
| | |
|
| | | if (text.length() > 80) {
|
| | | out.print(JsonUtil.loadFalseResult("值过长"));
|
| | | return;
|
| | | }
|
| | |
| | | // 新人只要使用了新人红包,也就是那1块钱,那么,他看到的分享爆款中的商品-就只能分享。
|
| | | long countRecord = userTaoLiJinRecordService.countRecordByUid(uid);
|
| | | if (countRecord == 0) {
|
| | | taoBaoLink = shareGoodsService.getTaoLiJinLinkForBuy(uid, specialId, auctionId);
|
| | | taoBaoLink = shareGoodsService.getTaoLiJinLinkForBuy(uid, specialId, auctionId, null);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | LogHelper.errorDetailInfo(e, "uid:" + uid, null);
|
| | | }
|
| | | if (!StringUtil.isNullOrEmpty(relationId)) {//
|
| | | taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(uid, auctionId, relationId,
|
| | | TaoBaoConstant.TAOBAO_RELATION_AS_SPECIAL_PID);
|
| | | if (source != null && "taolijin".equals(source)) {
|
| | | boolean isNewUser = userInfoExtraService.isNewUser(uid);
|
| | | if (isNewUser) {
|
| | | // 判定为老用户:
|
| | | // 新人只要使用了新人红包,也就是那1块钱,那么,他看到的分享爆款中的商品-就只能分享。
|
| | | long countRecord = userTaoLiJinRecordService.countRecordByUid(uid);
|
| | | if (countRecord == 0) {
|
| | | taoBaoLink = shareGoodsService.getTaoLiJinLinkForBuy(uid, specialId, auctionId,
|
| | | TaoBaoConstant.TAOBAO_RELATION_AS_SPECIAL_PID);
|
| | | }
|
| | | }
|
| | | } else {
|
| | | taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(uid, auctionId, relationId,
|
| | | TaoBaoConstant.TAOBAO_RELATION_AS_SPECIAL_PID);
|
| | | }
|
| | |
|
| | | data.put("native", true);
|
| | | } else {
|
| | | if (pidType == PidUser.TYPE_FANLI_ANDROID)
|
| | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | |
|
| | | LogHelper.errorDetailInfo(e);
|
| | |
|
| | | isNative = false;
|
| | | try {
|
| | | monitorService.addClientAPIMonitor(MonitorFactory.createClientAPI(request, 0, 0, "购买淘宝商品转链出错"));
|
New file |
| | |
| | | package com.yeshi.fanli.controller.web;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | 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.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.taobao.TLJBuyGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.service.inter.taobao.TLJBuyGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("api/web/v1/tljBuyGoods")
|
| | | public class TLJBuyGoodsController {
|
| | |
|
| | | @Resource
|
| | | private TLJBuyGoodsService tljBuyGoodsService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | |
|
| | | /**
|
| | | * 拉取备选商品
|
| | | * |
| | | * @param callback
|
| | | * @param acceptData
|
| | | * @param kw
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "listPreGoods", method = RequestMethod.GET)
|
| | | public void listPreGoods(String callback, AcceptData acceptData, String kw, Integer page, PrintWriter out) {
|
| | | // 大淘客数据,更新
|
| | | List<TaoBaoGoodsBrief> list = tljBuyGoodsService.listPreGoods(page);
|
| | | JSONArray array = new JSONArray();
|
| | | Gson gson = new Gson();
|
| | | for (TaoBaoGoodsBrief goods : list) {
|
| | | array.add(gson.toJson(
|
| | | TaoBaoUtil.getTaoBaoGoodsBriefExtra(goods, TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE + "", null)));
|
| | | }
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(array)));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 设置分享商品
|
| | | * |
| | | * @param callback
|
| | | * @param acceptData
|
| | | * @param ids
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "setShareGoods", method = RequestMethod.GET)
|
| | | public void setShareGoods(String callback, AcceptData acceptData, String ids, String day, PrintWriter out) {
|
| | | // 大淘客数据,更新
|
| | | JSONArray array = JSONArray.fromObject(ids);
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(day)) {
|
| | | day = TimeUtil.getGernalTime(System.currentTimeMillis() + 1000 * 60 * 60 * 24L, "yyyy-MM-dd");
|
| | | }
|
| | | int count = 0;
|
| | | for (int i = 0; i < array.size(); i++) {
|
| | | // 获取商品详情
|
| | | TaoBaoGoodsBrief goods = null;
|
| | | try {
|
| | | goods = TaoKeApiUtil.searchGoodsDetail(array.optLong(i));
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | if (goods != null && goods.getCouponAmount() != null
|
| | | && goods.getCouponAmount().compareTo(new BigDecimal(0)) > 0) {
|
| | |
|
| | | if (TaoBaoUtil.getAfterUseCouplePrice(goods).multiply(goods.getTkRate())
|
| | | .compareTo(new BigDecimal("143")) >= 0) {
|
| | | count++;
|
| | | goods = daTaoKeGoodsDetailService.filterTaoBaoGoods(goods);
|
| | | int totalHongBaoCount = 2000 + (int) (Math.random() * 8000);
|
| | | int leftHongBaoCount = 200 + (int) (Math.random() * 2000);
|
| | | tljBuyGoodsService.addTLJBuyGoods(
|
| | | new TLJBuyGoods(null, day, new Date(), goods, totalHongBaoCount, leftHongBaoCount),
|
| | | TaoBaoConstant.ownBuyApp);
|
| | | }
|
| | | }
|
| | | }
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult("设置成功:" + count)));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取已经选择的商品
|
| | | * |
| | | * @param callback
|
| | | * @param acceptData
|
| | | * @param day
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "listSelectedGoods", method = RequestMethod.GET)
|
| | | public void listSelectedGoods(String callback, AcceptData acceptData, String day, PrintWriter out) {
|
| | | if (StringUtil.isNullOrEmpty(day)) {
|
| | | day = TimeUtil.getGernalTime(System.currentTimeMillis() + 1000 * 60 * 60 * 24L, "yyyy-MM-dd");
|
| | | }
|
| | |
|
| | | // 最多30个商品
|
| | | List<TLJBuyGoods> listGoods = tljBuyGoodsService.listByDay(day, 30);
|
| | | JSONArray array = new JSONArray();
|
| | | for (TLJBuyGoods sh : listGoods) {
|
| | | TaoBaoGoodsBriefExtra item = TaoBaoUtil.getTaoBaoGoodsBriefExtra(sh.getGoods(),
|
| | | TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE + "", null);
|
| | | if (!StringUtil.isNullOrEmpty(item.getPictUrlWhite()))
|
| | | item.setPictUrl(item.getPictUrlWhite());
|
| | | item.setAuctionUrl(sh.getId());
|
| | | array.add(item);
|
| | | }
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(array)));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 删除选择的商品
|
| | | * |
| | | * @param callback
|
| | | * @param acceptData
|
| | | * @param ids
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "deleteSelectedGoods", method = RequestMethod.GET)
|
| | | public void deleteSelectedGoods(String callback, AcceptData acceptData, String ids, PrintWriter out) {
|
| | | JSONArray array = JSONArray.fromObject(ids);
|
| | | for (int i = 0; i < array.size(); i++) {
|
| | | String id = array.optString(i);
|
| | | tljBuyGoodsService.deleteById(id);
|
| | | }
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult("")));
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | private String state;
|
| | | private String source;// 来源
|
| | | private BigDecimal money;// 面额
|
| | | private String timeDesc;// 时间说明
|
| | | private String reason;// 原因
|
| | | private String result;// 结果
|
| | |
|
| | | public String getState() {
|
| | | return state;
|
| | |
| | | this.money = money;
|
| | | }
|
| | |
|
| | | public String getTimeDesc() {
|
| | | return timeDesc;
|
| | | }
|
| | |
|
| | | public void setTimeDesc(String timeDesc) {
|
| | | this.timeDesc = timeDesc;
|
| | | }
|
| | |
|
| | | public String getReason() {
|
| | | return reason;
|
| | | }
|
| | |
|
| | | public void setReason(String reason) {
|
| | | this.reason = reason;
|
| | | }
|
| | |
|
| | | public String getResult() {
|
| | | return result;
|
| | | }
|
| | |
|
| | | public void setResult(String result) {
|
| | | this.result = result;
|
| | | }
|
| | | |
| | | }
|
| | |
| | | public class UserTaoLiJinOrigin {
|
| | |
|
| | | public enum TaoLiJinOriginEnum {
|
| | | newbiesWin("新人红包"), shareWin("推广红包福利"), rankWin("账户等级福利"), inviteWin("邀请队员奖励"), refund("失效回退");
|
| | | newbiesWin("新人红包"), shareWin("推广红包福利"), rankWin("账户等级福利"), inviteWin("邀请队员奖励"), refund("未领取回退");
|
| | |
|
| | | private final String desc;
|
| | |
|
New file |
| | |
| | | package com.yeshi.fanli.entity.taobao;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.Date;
|
| | |
|
| | | import org.springframework.data.annotation.Id;
|
| | | import org.springframework.data.mongodb.core.mapping.Document;
|
| | | import org.springframework.data.mongodb.core.mapping.Field;
|
| | |
|
| | | /**
|
| | | * 自购立减
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Document(collection = "tljBuyGoods")
|
| | | public class TLJBuyGoods implements Serializable {
|
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | | @Id
|
| | | private String id;
|
| | | @Field
|
| | | private String appKey;
|
| | | @Field
|
| | | private String day;
|
| | | @Field
|
| | | private Date updateTime;
|
| | | @Field
|
| | | private TaoBaoGoodsBrief goods;
|
| | | @Field
|
| | | private Integer totalHongBaoCount;// 总红包个数
|
| | | @Field
|
| | | private Integer leftHongBaoCount;// 剩余红包个数
|
| | |
|
| | | public String getAppKey() {
|
| | | return appKey;
|
| | | }
|
| | |
|
| | | public void setAppKey(String appKey) {
|
| | | this.appKey = appKey;
|
| | | }
|
| | |
|
| | | public Integer getTotalHongBaoCount() {
|
| | | return totalHongBaoCount;
|
| | | }
|
| | |
|
| | | public void setTotalHongBaoCount(Integer totalHongBaoCount) {
|
| | | this.totalHongBaoCount = totalHongBaoCount;
|
| | | }
|
| | |
|
| | | public Integer getLeftHongBaoCount() {
|
| | | return leftHongBaoCount;
|
| | | }
|
| | |
|
| | | public void setLeftHongBaoCount(Integer leftHongBaoCount) {
|
| | | this.leftHongBaoCount = leftHongBaoCount;
|
| | | }
|
| | |
|
| | | public TLJBuyGoods(String id, String day, Date updateTime, TaoBaoGoodsBrief goods, int totalHongBaoCount,
|
| | | int leftHongBaoCount) {
|
| | | this.id = id;
|
| | | this.day = day;
|
| | | this.updateTime = updateTime;
|
| | | this.goods = goods;
|
| | | this.totalHongBaoCount = totalHongBaoCount;
|
| | | this.leftHongBaoCount = leftHongBaoCount;
|
| | | }
|
| | |
|
| | | public TLJBuyGoods() {
|
| | |
|
| | | }
|
| | |
|
| | | public String getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(String id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public String getDay() {
|
| | | return day;
|
| | | }
|
| | |
|
| | | public void setDay(String day) {
|
| | | this.day = day;
|
| | | }
|
| | |
|
| | | public Date getUpdateTime() {
|
| | | return updateTime;
|
| | | }
|
| | |
|
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | |
|
| | | public TaoBaoGoodsBrief getGoods() {
|
| | | return goods;
|
| | | }
|
| | |
|
| | | public void setGoods(TaoBaoGoodsBrief goods) {
|
| | | this.goods = goods;
|
| | | }
|
| | | }
|
| | |
| | | <select id="getSurplusLiJin" resultMap="BaseResultMap" > |
| | | SELECT * FROM yeshi_ec_user_taolijin_origin t |
| | | WHERE t.`uto_uid` = #{uid} AND t.`uto_money_surplus`<![CDATA[>]]> 0 |
| | | ORDER BY t.`uto_create_time` |
| | | </select> |
| | | |
| | | <select id="countByUidAndType" resultType="Long"> |
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public TaoBaoLink getTaoLiJinLinkForBuy(Long uid, String specialId, Long auctionId) throws ShareGoodsException {
|
| | | public TaoBaoLink getTaoLiJinLinkForBuy(Long uid, String specialId, Long auctionId, String pid)
|
| | | throws ShareGoodsException {
|
| | | if (uid == null || uid <= 0) {
|
| | | throw new ShareGoodsException(1, "用户ID不能为空");
|
| | | }
|
| | |
| | | TaoKeAppInfo app = new TaoKeAppInfo();
|
| | | app.setAppKey(TaoBaoConstant.TAOBAO_AUTH_APPKEY);
|
| | | app.setAppSecret(TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | app.setPid(TaoBaoConstant.TAOBAO_SPECIAL_PID_DEFAULT);
|
| | | if (pid == null)
|
| | | app.setPid(TaoBaoConstant.TAOBAO_SPECIAL_PID_DEFAULT);
|
| | | else
|
| | | app.setPid(pid);
|
| | | TaoBaoGoodsBrief goods = TaoKeApiUtil.specialConvertCoupon(auctionId, app);
|
| | | if (goods == null) {
|
| | | throw new ShareGoodsException(1, "");
|
| | |
| | |
|
| | | boolean canBuy = userTLJBuyHistoryService.canBuy(uid, auctionId);
|
| | | if (!canBuy) {
|
| | | throw new ShareGoodsException(3, "同一商品每日只能领取三次");
|
| | | throw new ShareGoodsException(3, "立减红包已抢光,请稍后再试");
|
| | | }
|
| | |
|
| | | long currentTime = System.currentTimeMillis();
|
| | |
| | | taoLiJinDTO = TaoKeApiUtil.createTaoLiJin(auctionId, "自购立减", perface, 1, new Date(currentTime), sendEndTime,
|
| | | new Date(currentTime), sendEndTime, app);
|
| | | } catch (TaoKeApiException e) {
|
| | | LogHelper.errorDetailInfo(e, e.getMessage(), null);
|
| | | throw new ShareGoodsException(5, "生成推广链接失败");
|
| | | }
|
| | | if (taoLiJinDTO == null)
|
| | |
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public boolean verifyCanCreateTLJ(Long auctionId,TaoKeAppInfo info) {
|
| | | public boolean verifyCanCreateTLJ(Long auctionId, TaoKeAppInfo info) {
|
| | | TaoLiJinDTO taoLiJinDTO = null;
|
| | | try {
|
| | | taoLiJinDTO = TaoKeApiUtil.createTaoLiJin(auctionId, "淘礼金验证", new BigDecimal("1.00"), 1, new Date(),
|
| | | new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 6), new Date(),
|
| | | new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 6),
|
| | | info);
|
| | | new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 6), info);
|
| | | } catch (TaoKeApiException e) {
|
| | | if (e.getCode() == TaoKeApiException.CODE_TLJ_FORBIDDEN) {
|
| | | // 该商品不支持创建淘礼金红包
|
| | |
| | | shareHotGoods.getGoods().setCouponStartFee(goods.getCouponStartFee());
|
| | | shareHotGoods.getGoods().setCouponTotalCount(goods.getCouponTotalCount());
|
| | | shareHotGoods.getGoods().setBiz30day(goods.getBiz30day());
|
| | | shareHotGoods.getGoods().setTkRate(goods.getTkRate());
|
| | | shareHotGoodsDao.save(shareHotGoods);
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.taobao;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.cache.annotation.Cacheable;
|
| | | import org.springframework.cache.ehcache.EhCacheCacheManager;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.taobao.TLJBuyGoodsDao;
|
| | | import com.yeshi.fanli.dto.taobao.TaoLiJinDTO;
|
| | | import com.yeshi.fanli.entity.taobao.TLJBuyGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoKeAppInfo;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | | import com.yeshi.fanli.exception.taobao.TaoKeApiException;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TLJBuyGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
|
| | | @Service
|
| | | public class TLJBuyGoodsServiceImpl implements TLJBuyGoodsService {
|
| | | @Resource
|
| | | private TLJBuyGoodsDao tljBuyGoodsDao;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | |
|
| | | @Resource
|
| | | private EhCacheCacheManager ehCacheCacheManager;
|
| | |
|
| | | @Override
|
| | | public void addTLJBuyGoods(TLJBuyGoods goods, TaoKeAppInfo taoKeAppInfo) {
|
| | | if (goods == null || StringUtil.isNullOrEmpty(goods.getDay()) || goods.getGoods() == null)
|
| | | return;
|
| | | goods.setId(StringUtil.Md5(goods.getDay() + "#" + goods.getGoods().getAuctionId()));
|
| | | if (goods.getUpdateTime() == null)
|
| | | goods.setUpdateTime(new Date());
|
| | | if (taoKeAppInfo != null)
|
| | | goods.setAppKey(taoKeAppInfo.getAppKey());
|
| | | tljBuyGoodsDao.save(goods);
|
| | | }
|
| | |
|
| | | @Cacheable(value = "commonContentCache", key = "'tljBuy-listByDay'+#day")
|
| | | @Override
|
| | | public List<TLJBuyGoods> listByDay(String day) {
|
| | | return listByDay(day, 10);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<TLJBuyGoods> listByDay(String day, int count) {
|
| | | List<TLJBuyGoods> list = tljBuyGoodsDao.listByDayOrderByUpdateTime(day, 1, count);
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | if (list != null) {
|
| | | for (TLJBuyGoods shg : list)
|
| | | goodsList.add(shg.getGoods());
|
| | | }
|
| | | // 过滤下线商品
|
| | | goodsList = taoBaoGoodsBriefService.filterOffLineGoods(goodsList);
|
| | | // 添加大淘客信息
|
| | | goodsList = daTaoKeGoodsDetailService.filterTaoBaoGoods(goodsList);
|
| | | Map<Long, TaoBaoGoodsBrief> goodsMap = new HashMap<>();
|
| | | if (goodsList != null)
|
| | | for (TaoBaoGoodsBrief g : goodsList)
|
| | | goodsMap.put(g.getAuctionId(), g);
|
| | |
|
| | | for (int j = 0; j < list.size(); j++) {
|
| | | if (goodsMap.get(list.get(j).getGoods().getAuctionId()) == null) {
|
| | | list.remove(j);
|
| | | j--;
|
| | | }
|
| | | }
|
| | | return list;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void deleteById(String id) {
|
| | | tljBuyGoodsDao.delete(id);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<TaoBaoGoodsBrief> listPreGoods(int page) {
|
| | | List<DaTaoKeDetailV2> list = daTaoKeGoodsDetailV2Service.listPreTLJBuyGoods(page);
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | if (list != null) {
|
| | | for (DaTaoKeDetailV2 v2 : list)
|
| | | goodsList.add(TaoBaoUtil.convert(v2));
|
| | | }
|
| | | return goodsList;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void deleteByGoodsId(Long goodsId) {
|
| | | tljBuyGoodsDao.deleteByGoodsId(goodsId);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public boolean verifyCanCreateTLJ(Long auctionId) {
|
| | | TaoLiJinDTO taoLiJinDTO = null;
|
| | | try {
|
| | | taoLiJinDTO = TaoKeApiUtil.createTaoLiJin(auctionId, "淘礼金验证", new BigDecimal("1.00"), 1, new Date(),
|
| | | new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 6), new Date(),
|
| | | new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 6),
|
| | | new TaoKeAppInfo(TaoBaoConstant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_AUTH_APPSECRET,
|
| | | TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT));
|
| | | } catch (TaoKeApiException e) {
|
| | | if (e.getCode() == TaoKeApiException.CODE_TLJ_FORBIDDEN) {
|
| | | // 该商品不支持创建淘礼金红包
|
| | | deleteByGoodsId(auctionId);
|
| | | return false;
|
| | | } else if (e.getCode() == TaoKeApiException.CODE_TLJ_NO_MONEY) {
|
| | | // 官方玩法钱包余额不足 TODO
|
| | | }
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void updateGoods(TaoBaoGoodsBrief goods) {
|
| | | if (goods == null)
|
| | | return;
|
| | | List<TLJBuyGoods> list = tljBuyGoodsDao.listByAuctionId(goods.getAuctionId());
|
| | | // 查询自购立减是否小于1元
|
| | | BigDecimal money = TaoBaoUtil.getGoodsHongBaoMoney(goods, TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE);
|
| | | // if (money.compareTo(new BigDecimal(1)) < 0) {// 删除商品
|
| | | // if (list != null)
|
| | | // for (TLJBuyGoods tljGoods : list) {
|
| | | // tljBuyGoodsDao.delete(tljGoods.getId());
|
| | | // }
|
| | | // }
|
| | |
|
| | | if (list != null)
|
| | | for (TLJBuyGoods TLJBuyGoods : list) {
|
| | |
|
| | | if (goods.getCouponInfo() == null)
|
| | | goods.setCouponInfo("");
|
| | | if (goods.getCouponAmount() == null)
|
| | | goods.setCouponAmount(new BigDecimal(0));
|
| | |
|
| | | // 判断 券信息 价格信息 返利比例信息是否改变
|
| | | boolean change = false;
|
| | | if (goods.getZkPrice().compareTo(TLJBuyGoods.getGoods().getZkPrice()) != 0)
|
| | | change = true;
|
| | | if (goods.getCouponAmount().compareTo(TLJBuyGoods.getGoods().getCouponAmount()) != 0)
|
| | | change = true;
|
| | | if (!goods.getCouponInfo().equalsIgnoreCase(TLJBuyGoods.getGoods().getCouponInfo()))
|
| | | change = true;
|
| | | if (goods.getTkRate().compareTo(TLJBuyGoods.getGoods().getTkRate()) != 0)
|
| | | change = true;
|
| | |
|
| | | if (change) {
|
| | | // 清除列表缓存
|
| | | ehCacheCacheManager.getCache("commonContentCache").evict(
|
| | | "tljBuy-listByDay" + TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd"));
|
| | | }
|
| | |
|
| | | // 更新券信息 ,价格信息,销量信息
|
| | | TLJBuyGoods.getGoods().setZkPrice(goods.getZkPrice());
|
| | | TLJBuyGoods.getGoods().setCouponAmount(goods.getCouponAmount());
|
| | | TLJBuyGoods.getGoods().setCouponInfo(goods.getCouponInfo());
|
| | | TLJBuyGoods.getGoods().setCouponEffectiveEndTime(goods.getCouponEffectiveEndTime());
|
| | | TLJBuyGoods.getGoods().setCouponEffectiveStartTime(goods.getCouponEffectiveStartTime());
|
| | | TLJBuyGoods.getGoods().setCouponLeftCount(goods.getCouponLeftCount());
|
| | | TLJBuyGoods.getGoods().setCouponStartFee(goods.getCouponStartFee());
|
| | | TLJBuyGoods.getGoods().setCouponTotalCount(goods.getCouponTotalCount());
|
| | | TLJBuyGoods.getGoods().setBiz30day(goods.getBiz30day());
|
| | | TLJBuyGoods.getGoods().setTkRate(goods.getTkRate());
|
| | | tljBuyGoodsDao.save(TLJBuyGoods);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void subHongBaoLeftCount(Long auctionId, String day, int count) {
|
| | | TLJBuyGoods goods = tljBuyGoodsDao.selectByAuctionIdAndDay(auctionId, day);
|
| | | if (goods != null) {
|
| | | tljBuyGoodsDao.subHongBaoCount(goods.getId(), count);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public TLJBuyGoods selectByAuctionIdAndDay(Long auctionId, String day) {
|
| | | return tljBuyGoodsDao.selectByAuctionIdAndDay(auctionId, day);
|
| | | }
|
| | | } |
| | |
| | | public List<DaTaoKeDetailV2> listPreShareHotGoods(int page) {
|
| | | Map<Long, DaTaoKeDetailV2> map = new HashMap<>();
|
| | | List<DaTaoKeDetailV2> list = daTaoKeGoodsDetailV2Dao.listPreShareHotGoods((page - 1) * Constant.PAGE_SIZE,
|
| | | Constant.PAGE_SIZE, "updateTime");
|
| | | Constant.PAGE_SIZE, "monthSales");
|
| | | System.out.println(list);
|
| | | for (DaTaoKeDetailV2 v2 : list) {
|
| | | map.put(v2.getId(), v2);
|
| | |
| | | import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinRecord;
|
| | | import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinReport;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.bus.user.UserMoneyExtra;
|
| | | import com.yeshi.fanli.entity.bus.user.UserRank;
|
| | | import com.yeshi.fanli.exception.tlj.UserTaoLiJinOriginException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | |
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinDetailService;
|
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
|
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinRecordService;
|
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinReportService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.UserMoneyExtraService;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserTaoLiJinRecordService userTaoLiJinRecordService;
|
| | | |
| | | @Resource
|
| | | private UserTaoLiJinReportService userTaoLiJinReportService;
|
| | |
|
| | |
|
| | | @Override
|
| | |
| | |
|
| | | BigDecimal total = new BigDecimal(0);
|
| | | for (UserTaoLiJinOrigin userTaoLiJinOrigin: list) {
|
| | | |
| | | UserTaoLiJinOrigin origin = new UserTaoLiJinOrigin();
|
| | | origin.setId(userTaoLiJinOrigin.getId());
|
| | | origin.setMoneySurplus(new BigDecimal(0));
|
| | | origin.setUpdateTime(new Date());
|
| | | userTaoLiJinOriginMapper.updateByPrimaryKeySelective(origin);
|
| | |
|
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd hh.mm");
|
| | | String time = sd.format(userTaoLiJinOrigin.getCreateTime());
|
| | | if (origin.getOrigin().equals(TaoLiJinOriginEnum.refund)) {
|
| | | String rightsId = userTaoLiJinOrigin.getRightsId();
|
| | | UserTaoLiJinReport report = userTaoLiJinReportService.selectByPrimaryKey(rightsId);
|
| | | Date shareTime = null;
|
| | | if (report == null) {
|
| | | shareTime = date;
|
| | | } else {
|
| | | shareTime = report.getCreateTime();
|
| | | }
|
| | | |
| | | // 消息
|
| | | MsgOtherTaoLiJinContentDTO content = new MsgOtherTaoLiJinContentDTO();
|
| | | content.setState("红包收回");
|
| | | content.setSource("于["+ sd.format(shareTime) + "]创建的分享未被领取部分");
|
| | | content.setTimeDesc("退回于" + time);
|
| | | content.setMoney(userTaoLiJinOrigin.getMoneySurplus());
|
| | | content.setReason("本笔退回推广红包从退回日起至今并未产生分享记录");
|
| | | content.setResult("长期未使用收回");
|
| | | userOtherMsgNotificationService.taoLiJinMsg(uid, "如有疑问请联系人工客服", content);
|
| | | |
| | | } else {
|
| | | // 消息
|
| | | MsgOtherTaoLiJinContentDTO content = new MsgOtherTaoLiJinContentDTO();
|
| | | content.setState("红包收回");
|
| | | content.setSource(origin.getOrigin().getDesc());
|
| | | content.setTimeDesc("获得于" + time);
|
| | | content.setMoney(userTaoLiJinOrigin.getMoneySurplus());
|
| | | content.setReason("本笔推广红包从获得日起至今并未产生分享记录");
|
| | | content.setResult("长期未使用收回");
|
| | | userOtherMsgNotificationService.taoLiJinMsg(uid, "如有疑问请联系人工客服", content);
|
| | | }
|
| | | |
| | | |
| | | total = MoneyBigDecimalUtil.add(total, userTaoLiJinOrigin.getMoneySurplus());
|
| | | }
|
| | | |
| | | // 用户剩余淘礼金
|
| | | UserMoneyExtra userMoneyExtra = userMoneyExtraService.selectByPrimaryKey(uid);
|
| | | if (userMoneyExtra == null || userMoneyExtra.getTlj() == null) {
|
| | | return;
|
| | | }
|
| | | |
| | | UserMoneyExtra updateExtra = new UserMoneyExtra();
|
| | | updateExtra.setUid(uid);
|
| | | |
| | | BigDecimal tljSelf = userMoneyExtra.getTljSelf();
|
| | | if (tljSelf != null && tljSelf.compareTo(new BigDecimal(0)) > 0) { // 剩余淘礼金-- 自购
|
| | | BigDecimal sub = MoneyBigDecimalUtil.sub(tljSelf, total);
|
| | | if (sub.compareTo(new BigDecimal(0)) > 0) {
|
| | | updateExtra.setTljSelf(sub);
|
| | | } else {
|
| | | updateExtra.setTljSelf(new BigDecimal(0));
|
| | | }
|
| | | } |
| | | updateExtra.setTlj(MoneyBigDecimalUtil.sub(userMoneyExtra.getTlj(), total));
|
| | | updateExtra.setUpdateTime(new Date());
|
| | | userMoneyExtraService.updateByPrimaryKeySelective(updateExtra);
|
| | | |
| | |
|
| | | // 插入明细
|
| | | UserTaoLiJinDetail detail = new UserTaoLiJinDetail();
|
| | |
| | | detail.setMoney(new BigDecimal("-" + total.toString()));
|
| | | detail.setTitle(TaoLiJinDetailTypeEnum.sendBack.getDesc());
|
| | | detail.setType(TaoLiJinDetailTypeEnum.sendBack);
|
| | | detail.setCreateTime(date);
|
| | | detail.setCreateTime(new Date());
|
| | | userTaoLiJinDetailService.insertSelective(detail);
|
| | | |
| | | // 消息
|
| | | final BigDecimal totalMoney = total;
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | try {
|
| | | MsgOtherTaoLiJinContentDTO content = new MsgOtherTaoLiJinContentDTO();
|
| | | content.setState("红包扣除");
|
| | | content.setSource("15天内未产生过推广红包分享记录");
|
| | | content.setMoney(totalMoney);
|
| | | userOtherMsgNotificationService.taoLiJinMsg(uid, "清除后无法恢复", content);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public UserTaoLiJinReport selectByPrimaryKey(String id) {
|
| | | return userTaoLiJinReportMapper.selectByPrimaryKey(id);
|
| | | }
|
| | | |
| | | }
|
| | |
| | | * @return
|
| | | * @throws ShareGoodsException
|
| | | */
|
| | | public TaoBaoLink getTaoLiJinLinkForBuy(Long uid, String specialId, Long auctionId) throws ShareGoodsException;
|
| | | public TaoBaoLink getTaoLiJinLinkForBuy(Long uid, String specialId, Long auctionId,String pid) throws ShareGoodsException;
|
| | |
|
| | | /**
|
| | | * 淘礼金 链接
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.taobao;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.taobao.TLJBuyGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoKeAppInfo;
|
| | |
|
| | | /**
|
| | | * 自购立减
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public interface TLJBuyGoodsService {
|
| | |
|
| | | /**
|
| | | * 添加自购立减商品
|
| | | * |
| | | * @param goods
|
| | | */
|
| | | public void addTLJBuyGoods(TLJBuyGoods goods,TaoKeAppInfo taoKeAppInfo);
|
| | |
|
| | | /**
|
| | | * 根据日期查找
|
| | | * |
| | | * @param day
|
| | | * @return
|
| | | */
|
| | | public List<TLJBuyGoods> listByDay(String day);
|
| | |
|
| | | public List<TLJBuyGoods> listByDay(String day, int count);
|
| | |
|
| | | /**
|
| | | * 根据主键删除
|
| | | * |
| | | * @param id
|
| | | */
|
| | | public void deleteById(String id);
|
| | |
|
| | | /**
|
| | | * 获取备选商品
|
| | | * |
| | | * @return
|
| | | */
|
| | | public List<TaoBaoGoodsBrief> listPreGoods(int page);
|
| | |
|
| | | /**
|
| | | * 根据商品id删除
|
| | | * |
| | | * @param goodsId
|
| | | */
|
| | | public void deleteByGoodsId(Long goodsId);
|
| | |
|
| | | /**
|
| | | * 验证是否可以创建淘礼金
|
| | | * |
| | | * @param auctionId
|
| | | * @return
|
| | | */
|
| | | public boolean verifyCanCreateTLJ(Long auctionId);
|
| | |
|
| | | /**
|
| | | * 更新商品
|
| | | * |
| | | * @param goods
|
| | | */
|
| | | public void updateGoods(TaoBaoGoodsBrief goods);
|
| | |
|
| | | /**
|
| | | * 减去剩余红包数量
|
| | | * |
| | | * @param auctionId
|
| | | * @param day
|
| | | * @param count
|
| | | */
|
| | | public void subHongBaoLeftCount(Long auctionId, String day, int count);
|
| | |
|
| | | /**
|
| | | * 根据商品ID和日期查询
|
| | | * |
| | | * @param auctionId
|
| | | * @param day
|
| | | * @return
|
| | | */
|
| | | public TLJBuyGoods selectByAuctionIdAndDay(Long auctionId, String day);
|
| | |
|
| | | }
|
| | |
| | | * 超过3天的未领取 退回金额
|
| | | */
|
| | | public void refundNotWin();
|
| | |
|
| | | public UserTaoLiJinReport selectByPrimaryKey(String id);
|
| | | }
|
| | |
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("¥" + filterMoney(msg.getBalance()) + "", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("账号余额", COLOR_TITLE), contentList));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("账户余额", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
|
| | |
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("¥" + filterMoney(msg.getBalance()) + "", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("账号余额", COLOR_TITLE), contentList));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("账户余额", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
|
| | |
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("¥" + filterMoney(msg.getBalance()) + "", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("账号余额", COLOR_TITLE), contentList));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("账户余额", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
|
| | |
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("¥" + filterMoney(msg.getBalance()) + "", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("账号余额", COLOR_TITLE), contentList));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("账户余额", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
|
| | |
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("¥" + filterMoney(msg.getBalance()) + "", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("账号余额", COLOR_TITLE), contentList));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("账户余额", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
|
| | |
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("¥" + filterMoney(msg.getBalance()) + "", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("账号余额", COLOR_TITLE), contentList));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("账户余额", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
|
| | |
| | | contentList.add(new ClientTextStyleVO(dto.getSource() + "", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("来源", COLOR_TITLE), contentList));
|
| | | }
|
| | | |
| | | if (!StringUtil.isNullOrEmpty(dto.getTimeDesc())) {
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(dto.getTimeDesc() + "", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("时间", COLOR_TITLE), contentList));
|
| | | }
|
| | |
|
| | | if (dto.getMoney() != null) {
|
| | | contentList = new ArrayList<>();
|
| | |
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("面额", COLOR_TITLE), contentList));
|
| | | }
|
| | |
|
| | | |
| | | if (!StringUtil.isNullOrEmpty(dto.getReason())) {
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(dto.getReason() + "", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("原因", COLOR_TITLE), contentList));
|
| | | }
|
| | | |
| | | if (!StringUtil.isNullOrEmpty(dto.getResult())) {
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(dto.getResult() + "", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("结果", COLOR_TITLE), contentList));
|
| | | }
|
| | | |
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
|
| | | COLOR_CONTENT));
|
| | |
| | | dto.setRightsId(modelJson.optString("rights_id"));
|
| | | dto.setSendUrl(modelJson.optString("send_url"));
|
| | | return dto;
|
| | | }else{
|
| | | LogHelper.error(json);
|
| | | }
|
| | |
|
| | | // 接口返回异常
|
| | |
| | | case "FAIL_BIZ_ITEM_FORBIDDEN":
|
| | | throw new TaoKeApiException(TaoKeApiException.CODE_TLJ_FORBIDDEN, "该商品不支持创建淘礼金红包");
|
| | | case "FAIL_BIZ_ACCOUNT_UN_PAID":
|
| | | case "2":
|
| | | case "PRE_FREEZE_ASSET_ACCOUNT_ERROR":
|
| | | throw new TaoKeApiException(TaoKeApiException.CODE_TLJ_NO_MONEY, "官方玩法钱包余额不足");
|
| | | default:
|
| | | return null;
|