admin
2019-05-05 81082e03207761edff6b317df8268dc3f968c20a
淘宝后台搜索增加分类ID填写
5个文件已修改
2个文件已添加
237 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/CallBackController.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/TaoBaoGoodsBriefAdminController.java 64 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/PushController.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/UserInfoController.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/UserMsgController.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/ExtractServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/msg/UserCommonMsgVO.java 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/CallBackController.java
New file
@@ -0,0 +1,28 @@
package com.yeshi.fanli.controller;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
/**
 * 授权回调
 *
 * @author Administrator
 *
 */
@Controller
@RequestMapping("client/v1/callback")
public class CallBackController {
    /**
     * 客服消息回调
     *
     * @param response
     */
    @RequestMapping(value = "kefuMsg")
    public void kefuMsg(HttpServletResponse response) {
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/admin/TaoBaoGoodsBriefAdminController.java
@@ -51,7 +51,7 @@
    @Resource
    private QualityFactoryService qualityFactoryService;
    @Resource
    private TaoBaoUnionConfigService taoBaoUnionConfigService;
@@ -62,7 +62,6 @@
    @Resource
    private TaoBaoClassService taoBaoClassService;
    /**
     * 
@@ -86,26 +85,26 @@
    public void queryOnSale(String callback, Integer pageIndex, Integer pageSize, String key, Long tbClassId,
            Integer startPrice, Integer endPrice, String startTkRate, String endTkRate, Integer sort, Integer istmall,
            Integer hasCoupon, Integer baoYou, Integer startDsr, Integer overseas, Integer needPrepay,
            Integer includePayRate30, Integer includeGoodRate, Integer includeRfdRate, Integer npxLevel,
            Integer includePayRate30, Integer includeGoodRate, Integer includeRfdRate, Integer npxLevel, String cid,
            PrintWriter out) {
        try {
            // 查询物料
            TaoBaoSearchResult result = getGoodsByWuLiao(pageIndex, pageSize, key, tbClassId, startPrice, endPrice, startTkRate, endTkRate, sort,
                    istmall, hasCoupon, baoYou, startDsr, overseas, needPrepay,    includePayRate30, includeGoodRate,
                    includeRfdRate, npxLevel);
            TaoBaoSearchResult result = getGoodsByWuLiao(pageIndex, pageSize, key, tbClassId, startPrice, endPrice,
                    startTkRate, endTkRate, sort, istmall, hasCoupon, baoYou, startDsr, overseas, needPrepay,
                    includePayRate30, includeGoodRate, includeRfdRate, npxLevel,cid);
            if (result == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("未获取到淘宝商品信息"));
                return;
            }
            List<TaoBaoGoodsBrief> listTaoBaoGoods = result.getTaoBaoGoodsBriefs();
            if (listTaoBaoGoods == null || listTaoBaoGoods.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("未查询到淘宝商品信息"));
                return;
            }
            // 插入商品集合
            List<Long> listAuctionId = new ArrayList<Long>();
            for (TaoBaoGoodsBrief goodsBrief : listTaoBaoGoods) {
@@ -218,9 +217,10 @@
        }
    }
    /**
     *  加入精选库商品
     * 加入精选库商品
     *
     * @param callback
     * @param pageIndex
     * @param key
@@ -252,39 +252,40 @@
            }
            Gson gson2 = new Gson();
            List<Long> listTaoBaoId = gson2.fromJson(auctionIds, new TypeToken<ArrayList<Long>>() {}.getType());
            List<Long> listTaoBaoId = gson2.fromJson(auctionIds, new TypeToken<ArrayList<Long>>() {
            }.getType());
            if (listTaoBaoId == null || listTaoBaoId.size() == 0) {
                out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("请选择正确的商品入库")));
                return;
            }
            // 查询物料
            TaoBaoSearchResult result = getGoodsByWuLiao(pageIndex, pageSize, key, tbClassId, startPrice, endPrice, startTkRate, endTkRate, sort,
                    istmall, hasCoupon, baoYou, startDsr, overseas, needPrepay,    includePayRate30, includeGoodRate,
                    includeRfdRate, npxLevel);
            TaoBaoSearchResult result = getGoodsByWuLiao(pageIndex, pageSize, key, tbClassId, startPrice, endPrice,
                    startTkRate, endTkRate, sort, istmall, hasCoupon, baoYou, startDsr, overseas, needPrepay,
                    includePayRate30, includeGoodRate, includeRfdRate, npxLevel,null);
            if (result == null) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("未获取到淘宝商品信息"));
                return;
            }
            List<TaoBaoGoodsBrief> listTaoBaoGoods = result.getTaoBaoGoodsBriefs();
            if (listTaoBaoGoods == null || listTaoBaoGoods.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("未查询到淘宝商品信息"));
                return;
            }
            List<TaoBaoGoodsBrief> listAddGoods = new ArrayList<TaoBaoGoodsBrief>();
            for (TaoBaoGoodsBrief taoBaoGoodsBrief: listTaoBaoGoods) {
            for (TaoBaoGoodsBrief taoBaoGoodsBrief : listTaoBaoGoods) {
                Long auctionId = taoBaoGoodsBrief.getAuctionId();
                if (listTaoBaoId.contains(auctionId)) {
                    listAddGoods.add(taoBaoGoodsBrief);
                    listTaoBaoId.remove(auctionId);
                }
            }
            if (listTaoBaoId != null && listTaoBaoId.size() > 0) {
                for (Long auctionId: listTaoBaoId) {
                for (Long auctionId : listTaoBaoId) {
                    /* 根据auctionId 获取淘宝商品 */
                    TaoBaoGoodsBrief goodsBrief = TaoKeApiUtil.searchGoodsDetail(auctionId);
                    if (goodsBrief != null) {
@@ -292,11 +293,11 @@
                    }
                }
            }
            AdminUser admin = (AdminUser) request.getSession().getAttribute(Constant.SESSION_ADMIN);
            // 插入精选库
            qualityFactoryService.addBatchTaoBaoGoods(listAddGoods, lableNames, admin);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("加入成功"));
        } catch (Exception e) {
@@ -308,6 +309,7 @@
    /**
     * 根据条件淘宝商品查询
     *
     * @param pageIndex
     * @param pageSize
     * @param key
@@ -332,7 +334,7 @@
    public TaoBaoSearchResult getGoodsByWuLiao(Integer pageIndex, Integer pageSize, String key, Long tbClassId,
            Integer startPrice, Integer endPrice, String startTkRate, String endTkRate, Integer sort, Integer istmall,
            Integer hasCoupon, Integer baoYou, Integer startDsr, Integer overseas, Integer needPrepay,
            Integer includePayRate30, Integer includeGoodRate, Integer includeRfdRate, Integer npxLevel)
            Integer includePayRate30, Integer includeGoodRate, Integer includeRfdRate, Integer npxLevel, String cids)
            throws Exception {
        SearchFilter filter = new SearchFilter();
@@ -347,8 +349,8 @@
            GoodsClass rb = goodsClassService.getGoodsClass(tbClassId);
            if (rb == null) {
                throw new Exception("该类型已不存在,请刷新重试");
            }
            }
            // 淘宝类目id
            String taoBaoCatIds = taoBaoClassService.getTaoBaoCatIds(tbClassId);
            if (StringUtil.isNullOrEmpty(taoBaoCatIds)) {
@@ -357,6 +359,8 @@
                filter.setCateIds(taoBaoCatIds);
            }
        }
        if (!StringUtil.isNullOrEmpty(cids))
            filter.setCateIds(cids);
        // 查询条件和类目id不能同时为空
        if (StringUtil.isNullOrEmpty(key) && tbClassId == null) {
@@ -380,7 +384,8 @@
            int tkRate = (int) (Float.parseFloat(endTkRate) * 100);
            filter.setEndTkRate(tkRate);
        }
        // 排序字段 销量(total_sales)淘客佣金比率(tk_rate)累计推广量(tk_total_sales)总支出佣金(tk_total_commi)
        // 排序字段
        // 销量(total_sales)淘客佣金比率(tk_rate)累计推广量(tk_total_sales)总支出佣金(tk_total_commi)
        if (sort != null) {
            filter.setSort(sort);
        }
@@ -426,8 +431,7 @@
        if (npxLevel != null && npxLevel > 0 && npxLevel < 4) {
            filter.setNpxLevel(npxLevel);
        }
        boolean islink = false;
        Long auctionId = null;
        /* 判断是否是商品链接搜索 */
fanli/src/main/java/com/yeshi/fanli/controller/client/PushController.java
@@ -62,7 +62,7 @@
    private PushService pushService;
    @Resource
    private PushGoodsService PushGoodsService;
    private PushGoodsService pushGoodsService;
    @Resource
    private PushGoodsGroupService pushGoodsGroupService;
@@ -81,7 +81,8 @@
    @RequestMapping(value = "callback", method = RequestMethod.POST)
    public void callback(AcceptData acceptData, String pushId, PrintWriter out) {
        BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
        BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
                acceptData.getPackages());
        if (system == null) {
            out.print(JsonUtil.loadFalseResult("不存在该系统"));
            return;
@@ -204,11 +205,11 @@
            // 设备注册时间
            Date createTime = deviceActive.getCreateTime();
            count = PushGoodsService.countHistoryByPushTime(uid, createTime);
            count = pushGoodsService.countHistoryByPushTime(uid, createTime);
            int pageSize = Constant.PAGE_SIZE;
            list = PushGoodsService.listHistoryByPushTime((page - 1) * pageSize, pageSize, uid, createTime);
            list = pushGoodsService.listHistoryByPushTime((page - 1) * pageSize, pageSize, uid, createTime);
            if (list != null && list.size() > 0) {
                for (PushGoods pushGoods : list) {
                    JSONObject result = new JSONObject();
fanli/src/main/java/com/yeshi/fanli/controller/client/UserInfoController.java
@@ -1178,6 +1178,8 @@
            out.print(JsonUtil.loadFalseResult("提现金额大于我的红包"));
        } else if (etype == 111) {
            out.print(JsonUtil.loadFalseResult("更换了手机号后7天内不允许提现"));
        } else if (etype == 110) {
            out.print(JsonUtil.loadFalseResult(Constant.znxConfig.getExtractWrongMsg()));
        }
    }
fanli/src/main/java/com/yeshi/fanli/controller/client/UserMsgController.java
@@ -49,6 +49,7 @@
import com.yeshi.fanli.exception.goods.RecommendUserGoodsException;
import com.yeshi.fanli.exception.msg.UserSystemMsgException;
import com.yeshi.fanli.exception.user.UserCustomSettingsException;
import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
import com.yeshi.fanli.service.inter.config.BusinessSystemService;
import com.yeshi.fanli.service.inter.goods.CommonGoodsService;
import com.yeshi.fanli.service.inter.goods.RecommendUserGoodsService;
@@ -61,6 +62,7 @@
import com.yeshi.fanli.service.inter.msg.MsgOtherDetailService;
import com.yeshi.fanli.service.inter.msg.UserMsgReadStateService;
import com.yeshi.fanli.service.inter.msg.UserSystemMsgService;
import com.yeshi.fanli.service.inter.push.PushGoodsService;
import com.yeshi.fanli.service.inter.user.UserCustomSettingsService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.util.Constant;
@@ -70,6 +72,7 @@
import com.yeshi.fanli.util.factory.CommonGoodsFactory;
import com.yeshi.fanli.util.factory.msg.UserMsgVOFactory;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
import com.yeshi.fanli.vo.msg.UserCommonMsgVO;
import com.yeshi.fanli.vo.msg.UserHomeMsgVO;
import com.yeshi.fanli.vo.msg.UserMsgCenter;
import com.yeshi.fanli.vo.msg.UserMsgVO;
@@ -125,6 +128,12 @@
    @Resource
    private SpecialService specialService;
    @Resource
    private JumpDetailV2Service jumpDetailV2Service;
    @Resource
    private PushGoodsService pushGoodsService;
    // 消息的类型
    final static String MSG_TYPE_ORDER = "order";
@@ -539,6 +548,18 @@
        List<UserMsgCenter> listCenter = new ArrayList<>();
        // 单条消息
        List<UserCommonMsgVO> commonMsgList = new ArrayList<>();
        commonMsgList.add(new UserCommonMsgVO("http://img.flqapp.com/resource/msg/icon_kefu.png", "人工客服", new Date(),
                UserCommonMsgVO.TYPE_KEFU, "", false, null, null));
        // 推荐记录
        // list = pushGoodsService.listHistoryByPushTime(0, 1, uid, createTime);
        commonMsgList.add(new UserCommonMsgVO("http://img.flqapp.com/resource/msg/icon_recommend.png", "推荐记录",
                new Date(), UserCommonMsgVO.TYPE_RECOMMEND, "防油防水防潮,污渍一抹即净,从胃到心的暖意", false,
                jumpDetailV2Service.getByTypeCache("recommend_list"), null));
        // 1、活动区域
        List<Special> listSpecial = specialService.listByPlaceKey("msg_activities");
        if (listSpecial != null && listSpecial.size() > 0) {
@@ -656,6 +677,7 @@
        }
        root.put("list", builder.create().toJson(listCenter));
        root.put("commonList", builder.create().toJson(commonMsgList));
        root.put("count", listCenter.size());
        out.print(JsonUtil.loadTrueResult(root));
    }
fanli/src/main/java/com/yeshi/fanli/service/impl/user/ExtractServiceImpl.java
@@ -254,10 +254,17 @@
            return 3;
        }
        // 有借贷关系
        boolean isHaveToReplay = userMoneyDebtService.isHaveDebtToRepay(extract.getUserInfo().getId());
        if (isHaveToReplay) {
            return 110;
        }
        Integer type = setExtractRecord(extract, maxCount, maxMoney);
        if (type != 0) {
            return type;
        }
        extractMapper.insertSelective(extract);
        ExtractAuditRecord auditRecord = new ExtractAuditRecord();
@@ -287,7 +294,8 @@
        if ("是".equals(autoExtract)) {
            LogHelper.userInfo("uid=" + user.getId() + ",提交转账申请!");
        } else {// 暂时不自动提现
            transfer(extract, null);
            // transfer(extract, null);
            ;
        }
        return null;
    }
fanli/src/main/java/com/yeshi/fanli/vo/msg/UserCommonMsgVO.java
New file
@@ -0,0 +1,102 @@
package com.yeshi.fanli.vo.msg;
import java.util.Date;
import com.yeshi.fanli.entity.common.JumpDetailV2;
public class UserCommonMsgVO {
    public static String TYPE_KEFU = "kefu";
    public static String TYPE_GUANXUAN = "guanxuan";
    public static String TYPE_ZHUSHOU = "zhushou";
    public static String TYPE_RECOMMEND = "recommend";
    private String icon;
    private String title;
    private Date time;
    private String type; // kefu -客服消息 other-其他消息
    private String latestMsg;// 最近的消息
    private Boolean read;// 是否已读
    private JumpDetailV2 jumpDetail;// 跳转详情
    private String params;// 跳转参数
    public UserCommonMsgVO(String icon, String title, Date time, String type, String latestMsg, Boolean read,
            JumpDetailV2 jumpDetail, String params) {
        this.icon = icon;
        this.title = title;
        this.time = time;
        this.type = type;
        this.latestMsg = latestMsg;
        this.read = read;
        this.jumpDetail = jumpDetail;
        this.params = params;
    }
    public UserCommonMsgVO() {
    }
    public String getIcon() {
        return icon;
    }
    public void setIcon(String icon) {
        this.icon = icon;
    }
    public String getTitle() {
        return title;
    }
    public void setTitle(String title) {
        this.title = title;
    }
    public Date getTime() {
        return time;
    }
    public void setTime(Date time) {
        this.time = time;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public String getLatestMsg() {
        return latestMsg;
    }
    public void setLatestMsg(String latestMsg) {
        this.latestMsg = latestMsg;
    }
    public Boolean getRead() {
        return read;
    }
    public void setRead(Boolean read) {
        this.read = read;
    }
    public JumpDetailV2 getJumpDetail() {
        return jumpDetail;
    }
    public void setJumpDetail(JumpDetailV2 jumpDetail) {
        this.jumpDetail = jumpDetail;
    }
    public String getParams() {
        return params;
    }
    public void setParams(String params) {
        this.params = params;
    }
}