New file |
| | |
| | | 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) {
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | @Resource
|
| | | private TaoBaoClassService taoBaoClassService;
|
| | |
|
| | |
|
| | | /**
|
| | | *
|
| | | * @param callback
|
| | |
| | | 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("未获取到淘宝商品信息"));
|
| | |
| | |
|
| | | /**
|
| | | * 加入精选库商品
|
| | | * |
| | | * @param callback
|
| | | * @param pageIndex
|
| | | * @param key
|
| | |
| | | }
|
| | |
|
| | | 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("未获取到淘宝商品信息"));
|
| | |
| | |
|
| | | /**
|
| | | * 根据条件淘宝商品查询
|
| | | * |
| | | * @param pageIndex
|
| | | * @param pageSize
|
| | | * @param key
|
| | |
| | | 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();
|
| | |
| | | filter.setCateIds(taoBaoCatIds);
|
| | | }
|
| | | }
|
| | | if (!StringUtil.isNullOrEmpty(cids))
|
| | | filter.setCateIds(cids);
|
| | |
|
| | | // 查询条件和类目id不能同时为空
|
| | | if (StringUtil.isNullOrEmpty(key) && tbClassId == null) {
|
| | |
| | | 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);
|
| | | }
|
| | |
| | | if (npxLevel != null && npxLevel > 0 && npxLevel < 4) {
|
| | | filter.setNpxLevel(npxLevel);
|
| | | }
|
| | | |
| | |
|
| | | boolean islink = false;
|
| | | Long auctionId = null;
|
| | |
| | | private PushService pushService;
|
| | |
|
| | | @Resource
|
| | | private PushGoodsService PushGoodsService;
|
| | | private PushGoodsService pushGoodsService;
|
| | |
|
| | | @Resource
|
| | | private PushGoodsGroupService pushGoodsGroupService;
|
| | |
| | |
|
| | | @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;
|
| | |
| | |
|
| | | // 设备注册时间
|
| | | 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();
|
| | |
| | | out.print(JsonUtil.loadFalseResult("提现金额大于我的红包"));
|
| | | } else if (etype == 111) {
|
| | | out.print(JsonUtil.loadFalseResult("更换了手机号后7天内不允许提现"));
|
| | | } else if (etype == 110) {
|
| | | out.print(JsonUtil.loadFalseResult(Constant.znxConfig.getExtractWrongMsg()));
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | 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;
|
| | |
| | | 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;
|
| | |
| | | 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;
|
| | |
| | |
|
| | | @Resource
|
| | | private SpecialService specialService;
|
| | |
|
| | | @Resource
|
| | | private JumpDetailV2Service jumpDetailV2Service;
|
| | |
|
| | | @Resource
|
| | | private PushGoodsService pushGoodsService;
|
| | |
|
| | | // 消息的类型
|
| | | final static String MSG_TYPE_ORDER = "order";
|
| | |
| | |
|
| | | 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) {
|
| | |
| | | }
|
| | |
|
| | | root.put("list", builder.create().toJson(listCenter));
|
| | | root.put("commonList", builder.create().toJson(commonMsgList));
|
| | | root.put("count", listCenter.size());
|
| | | out.print(JsonUtil.loadTrueResult(root));
|
| | | }
|
| | |
| | | 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();
|
| | |
| | | if ("是".equals(autoExtract)) {
|
| | | LogHelper.userInfo("uid=" + user.getId() + ",提交转账申请!");
|
| | | } else {// 暂时不自动提现
|
| | | transfer(extract, null);
|
| | | // transfer(extract, null);
|
| | | ;
|
| | | }
|
| | | return null;
|
| | | }
|
New file |
| | |
| | | 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;
|
| | | }
|
| | |
|
| | | }
|