| | |
| | | Extract extract = record.getExtract();
|
| | | if (extract != null) {
|
| | | Integer extractState = extract.getState();
|
| | | if (extractState != null && extractState == 0) {
|
| | | if (extractState != null && extractState == Extract.STATE_NOT_PROCESS) {
|
| | | UserInfo userInfo = extract.getUserInfo();
|
| | | if (userInfo != null) {
|
| | | double countTodayMoney = extractService.countTodayMoney(userInfo.getId());
|
| | | if (countTodayMoney >= 100) {
|
| | | BigDecimal countTodayMoney = extractService.sumTodayApplyMoney(userInfo.getId());
|
| | | if (countTodayMoney.compareTo(new BigDecimal(100)) > 0) {
|
| | | warnLevel = 1;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.controller.client.v1;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | 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.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.dto.common.CommonContentNav;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.taobao.SearchFilter;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.exception.banner.SwiperPictureException;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | /**
|
| | | * 通用模板
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Controller
|
| | | @RequestMapping("api/v1/commoncontent")
|
| | | public class CommonContentController {
|
| | |
|
| | | @Resource
|
| | | private SwiperPictureService swiperPictureService;
|
| | |
|
| | | @Resource
|
| | | private HongBaoManageService hongBaoManageService;
|
| | |
|
| | | /**
|
| | | * 通用模板导航
|
| | | * |
| | | * @param acceptData
|
| | | * @param key
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getNavList", method = RequestMethod.POST)
|
| | | public void getNavList(AcceptData acceptData, String key, PrintWriter out) {
|
| | | if (StringUtil.isNullOrEmpty(key)) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "请传入Key"));
|
| | | return;
|
| | | }
|
| | | List<CommonContentNav> list = new ArrayList<>();
|
| | | for (int i = 0; i < 20; i++) {
|
| | | CommonContentNav gc = new CommonContentNav();
|
| | | gc.setCid((i + 1L) + "");
|
| | | if (i == 1) {
|
| | | gc.setName("测试" + i);
|
| | | gc.setPicture(
|
| | | "http://e.hiphotos.baidu.com/zhidao/pic/item/37d3d539b6003af3be51388a322ac65c1138b675.jpg");
|
| | | } else if (i == 2) {
|
| | | gc.setName("");
|
| | | gc.setPicture(
|
| | | "http://e.hiphotos.baidu.com/zhidao/pic/item/37d3d539b6003af3be51388a322ac65c1138b675.jpg");
|
| | | } else {
|
| | | gc.setName("测试" + i);
|
| | | }
|
| | | list.add(gc);
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(new Gson().toJson(list)));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取内容
|
| | | * |
| | | * @param acceptData
|
| | | * @param key
|
| | | * @param page-页码
|
| | | * @param navId-导航ID
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getNavGoodsList", method = RequestMethod.POST)
|
| | | public void getNavContent(AcceptData acceptData, String key, Integer page, String cid, PrintWriter out) {
|
| | | if (StringUtil.isNullOrEmpty(key)) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "请传入Key"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (page == null || page < 1) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "请传入正确的page"));
|
| | | return;
|
| | | }
|
| | |
|
| | | List<SwiperPicture> bannerList = new ArrayList<>();
|
| | | try {
|
| | | bannerList = swiperPictureService.getByBannerCard("index_top");
|
| | | } catch (SwiperPictureException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | JSONObject root = new JSONObject();
|
| | | if (page == 1)
|
| | | root.put("bannerList", new Gson().toJson(bannerList));
|
| | | |
| | | root.put("goodsCount", 200);
|
| | | SearchFilter sf = new SearchFilter();
|
| | | sf.setKey("鞋");
|
| | | sf.setPage(page);
|
| | | sf.setPageSize(20);
|
| | |
|
| | | JSONArray array = new JSONArray();
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create();
|
| | | BigDecimal pro = hongBaoManageService.getFanLiRate();
|
| | | List<TaoBaoGoodsBrief> goodsList = TaoKeApiUtil.searchWuLiao(sf).getTaoBaoGoodsBriefs();
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : goodsList) {
|
| | | array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, pro.toString(), "")));
|
| | | }
|
| | |
|
| | | root.put("goodsList", array);
|
| | | |
| | |
|
| | | out.print(JsonUtil.loadTrueResult(root));
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory;
|
| | | import com.yeshi.fanli.entity.taobao.ClientTBPid;
|
| | | import com.yeshi.fanli.entity.taobao.PidUser;
|
| | | import com.yeshi.fanli.entity.taobao.TBPid;
|
| | |
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.goods.ShareGoodsService;
|
| | | import com.yeshi.fanli.service.inter.goods.recommend.RecommendGoodsDeleteHistoryService;
|
| | | import com.yeshi.fanli.service.inter.monitor.BusinessEmergent110Service;
|
| | | import com.yeshi.fanli.service.inter.monitor.MonitorService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoBuyRelationMapService;
|
| | |
| | |
|
| | | @Resource
|
| | | private TaoBaoBuyRelationMapService taoBaoBuyRelationMapService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private BusinessEmergent110Service businessEmergent110Service;
|
| | |
|
| | | @Resource
|
| | | private RecommendGoodsDeleteHistoryService recommendGoodsDeleteHistoryService;
|
| | |
|
| | | /**
|
| | | * 获取淘宝的分享链接
|
| | |
| | | data.put("tbPidInfo", clientTBPid);
|
| | | data.put("native", true);
|
| | | }
|
| | | |
| | |
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } else {
|
| | | out.print(JsonUtil.loadFalseResult(1, "请求失败"));
|
| | | }
|
| | | |
| | |
|
| | | businessEmergent110Service.buyTaoBaoGoodsError(StringUtil.Md5(auctionId + ""));
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 删除推荐商品
|
| | | * |
| | | * @param acceptData
|
| | | * @param goodsId
|
| | | * @param source
|
| | | * @param uid
|
| | | * @param reason
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "deleteRecommendGoods")
|
| | | public void deleteRecommendGoods(AcceptData acceptData, Long goodsId, Integer source, Long uid, String reason,
|
| | | PrintWriter out) {
|
| | | if (goodsId == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "请上传商品"));
|
| | | return;
|
| | | }
|
| | |
|
| | | RecommendGoodsDeleteHistory history = new RecommendGoodsDeleteHistory();
|
| | | history.setDevice(acceptData.getDevice());
|
| | | history.setReason(reason);
|
| | | history.setUid(uid);
|
| | | history.setGoodsSource(source == null ? Constant.SOURCE_TYPE_TAOBAO : source);
|
| | | history.setGoodsId(goodsId);
|
| | | recommendGoodsDeleteHistoryService.addRecommendGoodsDeleteHistory(history);
|
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.controller.client.v1;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.io.UnsupportedEncodingException;
|
| | | import java.util.HashMap;
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | |
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | |
|
| | | import org.yeshi.utils.HttpUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | @Controller
|
| | |
| | | AppPageNotification ap = appPageNotificationService.getAppPageNotificationByTypeCache(type);
|
| | | if ("home".equalsIgnoreCase(type)
|
| | | && VersionUtil.smallerThan_1_5_1(acceptData.getPlatform(), acceptData.getVersion()) && ap != null) {
|
| | | ap.setCanClose(false);
|
| | | ap.setContent("尊敬的用户,为更加准确高效的为你返利、省钱,请升级到返利券最新版本");
|
| | | AppPageNotification no = new AppPageNotification();
|
| | | no.setContentUrl("");
|
| | | no.setMd5("111111111111111111");
|
| | | no.setPageName(ap.getPageName());
|
| | | no.setShow(true);
|
| | | no.setType(ap.getType());
|
| | | no.setUpdateTime(ap.getUpdateTime());
|
| | | no.setCanClose(false);
|
| | | no.setContent("尊敬的用户,为更加准确高效的为你返利、省钱,请升级到返利券最新版本");
|
| | | Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
|
| | | out.print(JsonUtil.loadTrueResult(gson.toJson(ap)));
|
| | | out.print(JsonUtil.loadTrueResult(gson.toJson(no)));
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "updateApp")
|
| | | public void updateApp(AcceptData acceptData, PrintWriter out) {
|
| | | Map<String, String> params = new HashMap<>();
|
| | | params.put("method", "update");
|
| | | params.put("Platform", "Android");
|
| | | params.put("Version", acceptData.getVersion());
|
| | | params.put("device ", acceptData.getDevice());
|
| | | params.put("time", System.currentTimeMillis() + "");
|
| | | params.put("Package", acceptData.getPackages());
|
| | | params.put("device", acceptData.getDevice());
|
| | | params.put("platform", "Android");
|
| | | params.put("key", "a3f390d88e4c41f2747bfa2f1b5f87db");
|
| | | params.put("versionCode", acceptData.getVersion() + "");
|
| | | String url = "http://update.yeshitv.com:8090/update/update";
|
| | | String result = HttpUtil.post(url, params, null);
|
| | | out.print(result);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | });
|
| | | return;
|
| | | } catch (ShareGoodsException e) {
|
| | | LogHelper.errorDetailInfo(e, "分享出错:uid:"+uid+"auctionId:"+auctionId, "");
|
| | | // 分享出错报警
|
| | | try {
|
| | | monitorService.addClientAPIMonitor(MonitorFactory.createClientAPI(request, e.getCode(), 0, "分享出错"));
|
| | |
| | | * @return
|
| | | */
|
| | | BigDecimal computeCompensateByUid(Long uid);
|
| | | |
| | | /**
|
| | | * 统计今日申请提现的金额(根据用户ID)
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | BigDecimal sumToadyApplyByUid(Long uid);
|
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.goods.recommend; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory; |
| | | |
| | | public interface RecommendGoodsDeleteHistoryMapper extends BaseMapper<RecommendGoodsDeleteHistory> { |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dto.common;
|
| | |
|
| | | public class CommonContentNav {
|
| | | private String cid;
|
| | | private String name;
|
| | | private String picture;
|
| | |
|
| | | public String getCid() {
|
| | | return cid;
|
| | | }
|
| | |
|
| | | public void setCid(String cid) {
|
| | | this.cid = cid;
|
| | | }
|
| | |
|
| | | public String getName() {
|
| | | return name;
|
| | | }
|
| | |
|
| | | public void setName(String name) {
|
| | | this.name = name;
|
| | | }
|
| | |
|
| | | public String getPicture() {
|
| | | return picture;
|
| | | }
|
| | |
|
| | | public void setPicture(String picture) {
|
| | | this.picture = picture;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.goods.recommend;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | @Table("yeshi_ec_recommend_goods_user_delete")
|
| | | public class RecommendGoodsDeleteHistory {
|
| | | @Column(name = "ud_id")
|
| | | private Long id;
|
| | | @Column(name = "ud_device")
|
| | | private String device;
|
| | | @Column(name = "ud_uid")
|
| | | private Long uid;
|
| | | @Column(name = "ud_goods_id")
|
| | | private Long goodsId;
|
| | | @Column(name = "ud_goods_source")
|
| | | private Integer goodsSource;
|
| | | @Column(name = "ud_reason")
|
| | | private String reason;
|
| | | @Column(name = "ud_create_time")
|
| | | private Date createTime;
|
| | | @Column(name = "ud_beizhu")
|
| | | private String beiZhu;
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public String getDevice() {
|
| | | return device;
|
| | | }
|
| | |
|
| | | public void setDevice(String device) {
|
| | | this.device = device;
|
| | | }
|
| | |
|
| | | public Long getUid() {
|
| | | return uid;
|
| | | }
|
| | |
|
| | | public void setUid(Long uid) {
|
| | | this.uid = uid;
|
| | | }
|
| | |
|
| | | public Long getGoodsId() {
|
| | | return goodsId;
|
| | | }
|
| | |
|
| | | public void setGoodsId(Long goodsId) {
|
| | | this.goodsId = goodsId;
|
| | | }
|
| | |
|
| | | public Integer getGoodsSource() {
|
| | | return goodsSource;
|
| | | }
|
| | |
|
| | | public void setGoodsSource(Integer goodsSource) {
|
| | | this.goodsSource = goodsSource;
|
| | | }
|
| | |
|
| | | public String getReason() {
|
| | | return reason;
|
| | | }
|
| | |
|
| | | public void setReason(String reason) {
|
| | | this.reason = reason;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | public String getBeiZhu() {
|
| | | return beiZhu;
|
| | | }
|
| | |
|
| | | public void setBeiZhu(String beiZhu) {
|
| | | this.beiZhu = beiZhu;
|
| | | }
|
| | | }
|
| | |
| | | AND <![CDATA[TO_DAYS( FROM_UNIXTIME(t.extractTime/1000)) = TO_DAYS(NOW())]]>
|
| | |
|
| | | </select>
|
| | |
|
| | | |
| | | |
| | | <select id="sumToadyApplyByUid" resultType="java.math.BigDecimal">
|
| | | SELECT IFNULL(SUM(t.`money`),0) FROM yeshi_ec_extract t
|
| | | WHERE t.`uid` = #{0}
|
| | | AND <![CDATA[TO_DAYS( FROM_UNIXTIME(t.extractTime/1000)) = TO_DAYS(NOW())]]>
|
| | | </select>
|
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper |
| | | namespace="com.yeshi.fanli.dao.mybatis.goods.recommend.RecommendGoodsDeleteHistoryMapper"> |
| | | <resultMap id="BaseResultMap" |
| | | type="com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory"> |
| | | <id column="ud_id" property="id" jdbcType="BIGINT" /> |
| | | <result column="ud_device" property="device" jdbcType="VARCHAR" /> |
| | | <result column="ud_uid" property="uid" jdbcType="BIGINT" /> |
| | | <result column="ud_goods_id" property="goodsId" jdbcType="BIGINT" /> |
| | | <result column="ud_goods_source" property="goodsSource" |
| | | jdbcType="INTEGER" /> |
| | | <result column="ud_reason" property="reason" jdbcType="VARCHAR" /> |
| | | <result column="ud_create_time" property="createTime" jdbcType="TIMESTAMP" /> |
| | | <result column="ud_beizhu" property="beiZhu" jdbcType="VARCHAR" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">ud_id,ud_device,ud_uid,ud_goods_id,ud_goods_source,ud_reason,ud_create_time,ud_beizhu |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_recommend_goods_user_delete where ud_id = |
| | | #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_recommend_goods_user_delete where ud_id = |
| | | #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" |
| | | parameterType="com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory" |
| | | useGeneratedKeys="true" keyProperty="id">insert into |
| | | yeshi_ec_recommend_goods_user_delete |
| | | (ud_id,ud_device,ud_uid,ud_goods_id,ud_goods_source,ud_reason,ud_create_time,ud_beizhu) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{device,jdbcType=VARCHAR},#{uid,jdbcType=BIGINT},#{goodsId,jdbcType=BIGINT},#{goodsSource,jdbcType=INTEGER},#{reason,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{beiZhu,jdbcType=VARCHAR}) |
| | | </insert> |
| | | <insert id="insertSelective" |
| | | parameterType="com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | | insert into yeshi_ec_recommend_goods_user_delete |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">ud_id,</if> |
| | | <if test="device != null">ud_device,</if> |
| | | <if test="uid != null">ud_uid,</if> |
| | | <if test="goodsId != null">ud_goods_id,</if> |
| | | <if test="goodsSource != null">ud_goods_source,</if> |
| | | <if test="reason != null">ud_reason,</if> |
| | | <if test="createTime != null">ud_create_time,</if> |
| | | <if test="beiZhu != null">ud_beizhu,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="device != null">#{device,jdbcType=VARCHAR},</if> |
| | | <if test="uid != null">#{uid,jdbcType=BIGINT},</if> |
| | | <if test="goodsId != null">#{goodsId,jdbcType=BIGINT},</if> |
| | | <if test="goodsSource != null">#{goodsSource,jdbcType=INTEGER},</if> |
| | | <if test="reason != null">#{reason,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="beiZhu != null">#{beiZhu,jdbcType=VARCHAR},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" |
| | | parameterType="com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory">update yeshi_ec_recommend_goods_user_delete set |
| | | ud_device = #{device,jdbcType=VARCHAR},ud_uid = |
| | | #{uid,jdbcType=BIGINT},ud_goods_id = |
| | | #{goodsId,jdbcType=BIGINT},ud_goods_source = |
| | | #{goodsSource,jdbcType=INTEGER},ud_reason = |
| | | #{reason,jdbcType=VARCHAR},ud_create_time = |
| | | #{createTime,jdbcType=TIMESTAMP},ud_beizhu = |
| | | #{beiZhu,jdbcType=VARCHAR} where ud_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKeySelective" |
| | | parameterType="com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory"> |
| | | update yeshi_ec_recommend_goods_user_delete |
| | | <set> |
| | | <if test="device != null">ud_device=#{device,jdbcType=VARCHAR},</if> |
| | | <if test="uid != null">ud_uid=#{uid,jdbcType=BIGINT},</if> |
| | | <if test="goodsId != null">ud_goods_id=#{goodsId,jdbcType=BIGINT},</if> |
| | | <if test="goodsSource != null">ud_goods_source=#{goodsSource,jdbcType=INTEGER},</if> |
| | | <if test="reason != null">ud_reason=#{reason,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">ud_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="beiZhu != null">ud_beizhu=#{beiZhu,jdbcType=VARCHAR},</if> |
| | | </set> |
| | | where ud_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
New file |
| | |
| | | package com.yeshi.fanli.service.impl.goods.recommend;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.goods.recommend.RecommendGoodsDeleteHistoryMapper;
|
| | | import com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory;
|
| | | import com.yeshi.fanli.service.inter.goods.recommend.RecommendGoodsDeleteHistoryService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | @Service
|
| | | public class RecommendGoodsDeleteHistoryServiceImpl implements RecommendGoodsDeleteHistoryService {
|
| | |
|
| | | @Resource
|
| | | private RecommendGoodsDeleteHistoryMapper recommendGoodsDeleteHistoryMapper;
|
| | |
|
| | | @Override
|
| | | public void addRecommendGoodsDeleteHistory(RecommendGoodsDeleteHistory history) {
|
| | | if (history.getGoodsId() == null || history.getGoodsSource() == null
|
| | | || StringUtil.isNullOrEmpty(history.getDevice()))
|
| | | return;
|
| | | if (history.getCreateTime() == null)
|
| | | history.setCreateTime(new Date());
|
| | | recommendGoodsDeleteHistoryMapper.insertSelective(history);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public double countTodayMoney(Long uid) {
|
| | | return extractMapper.countTodayMoney(uid);
|
| | | public BigDecimal sumTodayApplyMoney(Long uid) {
|
| | | return extractMapper.sumToadyApplyByUid(uid);
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.goods.recommend;
|
| | |
|
| | | import com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory;
|
| | |
|
| | | public interface RecommendGoodsDeleteHistoryService {
|
| | |
|
| | | /**
|
| | | * 添加推荐商品删除记录
|
| | | * |
| | | * @param history
|
| | | */
|
| | | public void addRecommendGoodsDeleteHistory(RecommendGoodsDeleteHistory history);
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.inter.user;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public double countTodayMoney(Long uid);
|
| | | public BigDecimal sumTodayApplyMoney(Long uid);
|
| | |
|
| | |
|
| | |
|
| | |
| | | static Map<String, Long> emergentTimeMap = new HashMap<>();
|
| | |
|
| | | public static void baoJin(String key, String name, String[] phones) {
|
| | | if (emergentTimeMap.get(key) == null || System.currentTimeMillis() - emergentTimeMap.get(key) > 1000 * 60 * 2)// 2分钟报警一次
|
| | | if (emergentTimeMap.get(key) == null || System.currentTimeMillis() - emergentTimeMap.get(key) > 1000 * 60 * 10)// 10分钟报警一次
|
| | | {
|
| | | emergentTimeMap.put(key, System.currentTimeMillis());
|
| | | // 发送短信
|
| | |
| | | task =true
|
| | | outnetwork =true
|
| | | test false |
| | | test=false |
| | |
| | | package org.fanli;
|
| | |
|
| | | import org.junit.Ignore;
|
| | | import org.junit.Test;
|
| | | import org.yeshi.utils.mybatis.ColumnParseUtil;
|
| | | import org.yeshi.utils.mybatis.MyBatisMapperUtil;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
|
| | | import com.yeshi.fanli.entity.bus.user.ExtractAuditRecord;
|
| | | import com.yeshi.fanli.entity.goods.recommend.RecommendGoodsDeleteHistory;
|
| | | import com.yeshi.fanli.entity.order.CommonOrderTradeIdMap;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoPunishOrder;
|
| | |
|
| | | //@Ignore
|
| | | public class MyBatisProduce {
|
| | |
|
| | | @Test
|
| | | public void test3() {
|
| | | MyBatisMapperUtil.createMapper(CommonOrderTradeIdMap.class);
|
| | | MyBatisMapperUtil.createMapper(RecommendGoodsDeleteHistory.class);
|
| | | // MyBatisMapperUtil.createMapper(UserMoneyDebtReturnHistory.class);
|
| | | }
|
| | |
|
| | | @Test
|
| | | public void test1() {
|
| | | ColumnParseUtil.parseColumn(GoodsClass.class,
|
| | | "D:/workspace/fanli/fanli-server/fanli/src/main/java/com/yeshi/fanli/mapping/GoodsClassMapper.xml");
|
| | | ColumnParseUtil.parseColumn(ExtractAuditRecord.class,
|
| | | "D:\\workspace\\fanli\\fanli-server\\fanli\\src\\main\\java\\com\\yeshi\\fanli\\mapping\\ExtractAuditRecordMapper.xml");
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import java.io.File;
|
| | | import java.io.FileInputStream;
|
| | | import java.io.FileNotFoundException;
|
| | | 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 org.junit.Ignore;
|
| | | import org.junit.Test;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | |
|
| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoLink;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoPunishOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoKeAppInfo;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.job.UpdateRelationAndSpecialOrderJob;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.goods.ShareGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoBuyRelationMapService;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.util.BeanUtil;
|
| | | import com.yeshi.fanli.util.SpringContext;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeOrderApiUtil;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
| | |
|
| | | @Test
|
| | | public void test1() {
|
| | | // TaoBaoShop shop=
|
| | | // TaoBaoUtil.getTaoBaoShopDetailByAuctionId(536542467108L);
|
| | | // System.out.println(shop);
|
| | | long startTime = TimeUtil.convertToTimeTemp("2019-04-02 00:00:00", "yyyy-MM-dd HH:mm:ss");
|
| | |
|
| | | List<TaoBaoPunishOrder> list = TaoKeOrderApiUtil.getPunishOrderList(startTime,
|
| | | startTime + 1000 * 60 * 60 * 24L);
|
| | | System.out.println(list);
|
| | |
|
| | | // TaoKeApiUtil.getTaoKeContentEffective();
|
| | | // TaoKeApiUtil.getTaoKeContent();
|
| | | UpdateRelationAndSpecialOrderJob updateRelationAndSpecialOrderJob= BeanUtil.getBean(UpdateRelationAndSpecialOrderJob.class);
|
| | | SpringContext.initCOS();
|
| | | updateRelationAndSpecialOrderJob.doJob2();
|
| | | }
|
| | |
|
| | | @Test
|
| | |
| | |
|
| | | @Test
|
| | | public void test3() {
|
| | | TaoKeApiUtil.taoKeContent();
|
| | | // try {
|
| | | // EmergencyUtil.baoJin("monitor-error-tb-app-limit-24980167",
|
| | | // "淘宝APPKey请求限制【24980167】", new String[] { "18581318252" });
|
| | | // } catch (Exception e1) {
|
| | | //
|
| | | // }
|
| | | // 0K6TBHS%2F84vpYy%2FzKPWwH6J7%2BkHL3AEW
|
| | | // 2PlyMHAEtzjJX3K6R73L5KJ7%2BkHL3AEW
|
| | | Long[] auctionIds = new Long[] { 528561708277L, 563689377074L, 570752677800L, 569281626446L, 567165767332L,
|
| | | 555437572417L, 534857332052L, 565233575889L, 565536124572L };
|
| | |
|
| | | for (Long auctionId : auctionIds)
|
| | | TaoKeApiUtil.createTaoLiJin(auctionId, "返利券新人淘礼金红包", new BigDecimal("1.00"), 1, 1, new Date(),
|
| | | new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 24L), new Date());
|
| | | // TaoKeApiUtil.getLiJinXG();
|
| | | // String
|
| | | // url="https://uland.taobao.com/taolijin/edetail?eh=aIrBfHZGd4iZuQF0XRz0iAXoB+DaBK5LQS0Flu/fbSp4QsdWMikAalrisGmre1Id0BFAqRODu114yl7QZ1qFyc7LbOC0oAuo+MUwzxYlSKECGml30RY8PBx5jSVkulpmRQIlrKaDNziGVmobyGguP+jgTFwOoHsRe9593cvcC9QGQASttHIRqdGO5qxVOPQ2buEoHk5wx6hxhsv5QYr1rbcOQrCzclRfPTIk7Z0myMWxZvcNeMU+E+L71lQF+6uZp7DLcYmoygrjfjYOW9fVleIg09jheaZgonv6QcvcARY=&union_lens=lensId:0b0b4505_0c2a_16af789993f_0880;traffic_flag=lm";
|
| | | // String token=
|
| | | // TaoKeApiUtil.getTKToken("https://img.alicdn.com/imgextra/i4/2256112408/O1CN01EKNifJ1TeuF9x4it9_!!2256112408.jpg_400x400.jpg",
|
| | | // "旗睿电风扇台式家用12寸16寸静音学生宿舍摇头定时节能台扇落地扇", url);
|
| | | // System.out.println(token);
|
| | | }
|
| | |
|
| | | @Test
|
| | |
| | |
|
| | | public static String post(String url, Map<String, String> map, Map<String, String> headers) {
|
| | | HttpClient client = new HttpClient();
|
| | | client.getHostConfiguration().setProxy("192.168.1.122", 8888);
|
| | | // client.getHostConfiguration().setProxy("192.168.1.122", 8888);
|
| | | PostMethod pm = new PostMethod(url);// 创建HttpPost对象
|
| | | NameValuePair[] ns = new NameValuePair[map.keySet().size()];
|
| | | Iterator<String> its = map.keySet().iterator();
|