New file |
| | |
| | | package com.yeshi.fanli.controller.admin;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | |
|
| | | 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.dto.msg.MsgCommonDTO;
|
| | | import com.yeshi.fanli.exception.ConfigException;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.msg.MsgConfigService;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("admin/new/api/v1/message")
|
| | | public class MessageController {
|
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | |
|
| | | @Resource
|
| | | private MsgConfigService msgConfigService;
|
| | |
|
| | | @RequestMapping(value = "getZhuShou")
|
| | | public void getZhuShou(String callback, PrintWriter out) {
|
| | | // 返利券小助手
|
| | | MsgCommonDTO zhuShouMsg = msgConfigService.getZhuShouMsg();
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(new Gson().toJson(zhuShouMsg)));
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "saveZhuShou", method = RequestMethod.POST)
|
| | | public void saveZhouShou(String callback, MsgCommonDTO dto, PrintWriter out) {
|
| | | if (dto.getJumpDetail() == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请指定跳转方式"));
|
| | | return;
|
| | | }
|
| | | try {
|
| | | msgConfigService.addZhuShouMsg(dto);
|
| | | } catch (ConfigException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | return;
|
| | | }
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(""));
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "getGuanXuan", method = RequestMethod.POST)
|
| | | public void getGuanXuan(String callback, PrintWriter out) {
|
| | | MsgCommonDTO guanXuan = msgConfigService.getGuanXuanMsg();
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(new Gson().toJson(guanXuan)));
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "saveGuanXuan", method = RequestMethod.POST)
|
| | | public void saveGuanXuan(String callback, MsgCommonDTO dto, PrintWriter out) {
|
| | | if (dto.getJumpDetail() == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请指定跳转方式"));
|
| | | return;
|
| | | }
|
| | | try {
|
| | | msgConfigService.addGuanXuanMsg(dto);
|
| | | } catch (ConfigException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | return;
|
| | | }
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(""));
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.bus.homemodule.FloatAD;
|
| | | import com.yeshi.fanli.entity.config.AppHomeFloatImg;
|
| | | import com.yeshi.fanli.entity.taobao.ClientTBPid;
|
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.FloatADService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | |
| | |
|
| | | @Resource
|
| | | private FloatADService floatADService;
|
| | |
|
| | | @Resource
|
| | | private JumpDetailV2Service jumpDetailV2Service;
|
| | |
|
| | | /**
|
| | | * 首页配置信息
|
| | |
| | | @RequestMapping(value = "getWebConfig", method = RequestMethod.POST)
|
| | | public void getWebConfig(AcceptData acceptData, String url, PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | | if (url != null && (url.contains("s.click") || url.contains("taobao.com") || url.contains("tmall.com")|| url.contains("m.tb.cn"))) {
|
| | | if (url != null && (url.contains("s.click") || url.contains("taobao.com") || url.contains("tmall.com")
|
| | | || url.contains("m.tb.cn"))) {
|
| | | data.put("baichuan", true);// 采用阿里百川的方式加载webview
|
| | | data.put("goodsDetail", true);// 需要拦截商品详情
|
| | | } else {
|
| | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("serviceProtocolLink", serviceProtocol);
|
| | | data.put("privacyProtocolLink", privacyProtocol);
|
| | | // 购物车跳转方式(包含jumpDetail与params)
|
| | | JSONObject source = JSONObject.fromObject(configService.get("taobao_cart_jump_detail"));
|
| | | data.put("taoBaoCart", source);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("获取失败"));
|
| | |
| | | @RequestMapping(value = "getOrderConfig", method = RequestMethod.POST)
|
| | | public void getOrderConfig(AcceptData acceptData, PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | | // 测试
|
| | | data.put("showTaoBaoOrder", "0".equalsIgnoreCase(configService.get("show_taobao_order").trim()) ? false : true);
|
| | | data.put("taoBaoOrderUrl", "https://main.m.taobao.com/olist/index.html");
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "getKeFuConfig", method = RequestMethod.POST)
|
| | | public void getKeFuConfig(AcceptData acceptData, PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("meiqia", "1".equalsIgnoreCase(configService.get("kefu_meiqia")) ? true : false);// 是否跳转美洽,不跳转美洽就用原来的
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | @Resource
|
| | | private MonitorService monitorService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private HomeNavbarService homeNavbarService;
|
| | | @Resource
|
| | | private SwiperPictureService swiperPictureService;
|
| | |
|
| | |
|
| | | @Resource(name = "taskExecutor")
|
| | | private TaskExecutor executor;
|
| | |
| | | if (picList == null) {
|
| | | picList = new ArrayList<SwiperPicture>();
|
| | | }
|
| | | |
| | |
|
| | | List<GoodsSubClass> goodsSubClassList = goodsSubClassService.getSubClassCache(gcid, 1);
|
| | | if (goodsSubClassList == null) {
|
| | | goodsSubClassList = new ArrayList<GoodsSubClass>();
|
| | | }
|
| | | |
| | |
|
| | | boolean changePicture = false;
|
| | | String version = acceptData.getVersion();
|
| | | int tversion = Integer.parseInt(version);
|
| | | String platform = acceptData.getPlatform();
|
| | | if ("android".equalsIgnoreCase(platform) && tversion > 38) {
|
| | | changePicture = true;
|
| | | } else if (tversion > 47){
|
| | | } else if (tversion > 47) {
|
| | | changePicture = true;
|
| | | }
|
| | | |
| | |
|
| | | // 1.5.3新版图片替换
|
| | | if (changePicture) {
|
| | | for (GoodsSubClass goodsSubClass: goodsSubClassList) {
|
| | | for (GoodsSubClass goodsSubClass : goodsSubClassList) {
|
| | | String pictureSecond = goodsSubClass.getPictureSecond();
|
| | | if (pictureSecond != null && pictureSecond.trim().length() > 0) {
|
| | | goodsSubClass.setPicture(pictureSecond);
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("picList", JsonUtil.getApiCommonGson().toJson(picList));
|
| | | data.put("count", goodsSubClassList.size());
|
| | |
| | | goodsClass.setIosClick(1L);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | GoodsClass gc = new GoodsClass();
|
| | | gc.setId(goodsClass.getId());
|
| | | gc.setIosClick(goodsClass.getIosClick());
|
| | |
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | @RequestMapping(value = "getCouponGoods", method = RequestMethod.POST)
|
| | | public void getCouponGoods(AcceptData acceptData, int page, long gcid, PrintWriter out) {
|
| | |
| | | @RequestMapping(value = "getgoods", method = RequestMethod.POST)
|
| | | public void getGoods(AcceptData acceptData, int page, long scid, String filter, String order, String startprice,
|
| | | String endprice, String fastFilter, 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;
|
| | |
| | | @RequestMapping(value = "getsecondclassgoods", method = RequestMethod.POST)
|
| | | public void getSecondClassGoods(AcceptData acceptData, int page, long scid, String filter, String order,
|
| | | String startprice, String endprice, String fastFilter, Integer totalSales, 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;
|
| | |
| | | @RequestMapping("choiceGoods")
|
| | | public void choiceGoods(AcceptData acceptData, long gcid, int page, 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;
|
| | |
| | | data.put("result", array);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | | @RequestMapping("getCouponList")
|
| | |
| | | result = TaoKeApiUtil.searchCouple(goodsClassService.getKeysById(id), null, page, 20);
|
| | |
|
| | | List<TaoBaoSearchNav> navList = TaoBaoUtil.getBaseNav();
|
| | | if (result.getNavList() != null)
|
| | | if (result != null && result.getNavList() != null)
|
| | | navList.addAll(result.getNavList());
|
| | |
|
| | | if (navList == null)
|
| | |
| | | @RequestMapping(value = { "getcategory" }, method = { org.springframework.web.bind.annotation.RequestMethod.POST })
|
| | | public void getcategory(AcceptData acceptData, PrintWriter out) {
|
| | | try {
|
| | | |
| | |
|
| | | boolean changePicture = false;
|
| | | String version = acceptData.getVersion();
|
| | | int tversion = Integer.parseInt(version);
|
| | | String platform = acceptData.getPlatform();
|
| | | if ("android".equalsIgnoreCase(platform) && tversion > 38) {
|
| | | changePicture = true;
|
| | | } else if (tversion > 47){
|
| | | } else if (tversion > 47) {
|
| | | changePicture = true;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | List<Map<String, Object>> listCache = goodsClassService.getClassListAllCache(changePicture);
|
| | | if (listCache == null) {
|
| | | listCache = new ArrayList<Map<String, Object>>();
|
| | |
| | | @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() + "");
|
| | | if ("android".equalsIgnoreCase(acceptData.getPlatform())) {// android更新
|
| | | acceptData.setVersion("10");
|
| | | 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);
|
| | | try {
|
| | | out.print(new String(result.getBytes("ISO-8859-1"), "UTF-8"));
|
| | | } catch (UnsupportedEncodingException e) {
|
| | | out.print(result);
|
| | | }
|
| | | } else {// IOS更新
|
| | | params.put("method", "update");
|
| | | params.put("Platform", "IOS");
|
| | | 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", "IOS");
|
| | | params.put("key", "32bb90e8976aab5298d5da10fe66f21d");
|
| | | params.put("versionCode", acceptData.getVersion() + "");
|
| | | }
|
| | | String url = "http://update.yeshitv.com:8090/update/update";
|
| | | String result = HttpUtil.post(url, params, null);
|
| | | out.print(result);
|
| | | try {
|
| | | out.print(new String(result.getBytes("ISO-8859-1"), "UTF-8"));
|
| | | } catch (UnsupportedEncodingException e) {
|
| | | out.print(result);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.service.inter.user.ShamUserService;
|
| | | import com.yeshi.fanli.service.inter.user.TBPidService;
|
| | | import com.yeshi.fanli.service.inter.user.UserCustomSettingsService;
|
| | |
| | |
|
| | | @Resource
|
| | | private TaoBaoShopService taoBaoShopService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | |
|
| | | @RequestMapping(value = "getHonestList")
|
| | | public void getHonestList(AcceptData acceptData, PrintWriter out) {
|
| | |
| | | nextTime.set(Calendar.MILLISECOND, 0);
|
| | |
|
| | | JSONArray array = null;
|
| | | String timekey = String.format("spikeGoods_hour-%s-%s",acceptData.getPlatform(),acceptData.getVersion());
|
| | | String cachekey = String.format("spikeGoodsList-%s-%s",acceptData.getPlatform(),acceptData.getVersion());
|
| | | String timekey = String.format("spikeGoods_hour-%s-%s", acceptData.getPlatform(), acceptData.getVersion());
|
| | | String cachekey = String.format("spikeGoodsList-%s-%s", acceptData.getPlatform(), acceptData.getVersion());
|
| | |
|
| | | String timeValue = redisManager.getCommonString(timekey);
|
| | | if (timeValue == null || !timeValue.equals(hour + "")) {
|
| | |
| | | if (!StringUtil.isNullOrEmpty(tb.getPictUrlWhite()))
|
| | | finalImgList.add(0, tb.getPictUrlWhite());
|
| | |
|
| | | // 大淘客商品过滤
|
| | | goods = daTaoKeGoodsDetailService.filterTaoBaoGoods(goods);
|
| | |
|
| | | JSONObject goodsJson = new JSONObject();
|
| | | goodsJson.put("auctionId", tb.getAuctionId());
|
| | | goodsJson.put("imgList", finalImgList);
|
| | |
| | | import java.io.PrintWriter;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Collections;
|
| | | import java.util.HashMap;
|
| | | import java.util.HashSet;
|
| | | import java.util.List;
|
| | |
| | | import java.util.Set;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.print.attribute.standard.NumberUp;
|
| | |
|
| | | import org.springframework.cache.annotation.Cacheable;
|
| | | import org.springframework.stereotype.Controller;
|
| | |
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.lable.QualityFactory;
|
| | | import com.yeshi.fanli.entity.bus.recommend.Honest;
|
| | | import com.yeshi.fanli.entity.bus.search.HistorySearch;
|
| | | import com.yeshi.fanli.entity.bus.search.HotSearch;
|
| | | import com.yeshi.fanli.entity.bus.su.search.SuperHotSearch;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchNav;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoUnionConfig;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
|
| | | import com.yeshi.fanli.service.inter.config.BusinessSystemService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.config.SuperHotSearchService;
|
| | |
| | | import com.yeshi.fanli.service.inter.lable.QualityGoodsService;
|
| | | import com.yeshi.fanli.service.inter.lable.TaoKeGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.service.inter.user.HistorySearchService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.EhcacheUtil;
|
| | |
| | | import com.yeshi.fanli.util.cache.TaoBaoGoodsCacheUtil;
|
| | | import com.yeshi.fanli.util.taobao.SearchFilterUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
|
| | | import net.sf.ehcache.Element;
|
| | | import net.sf.json.JSONArray;
|
| | |
| | |
|
| | | @Resource
|
| | | private TaoBaoGoodsCacheUtil taoBaoGoodsCacheUtil;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | |
|
| | | @RequestMapping(value = "gethotsearch", method = RequestMethod.POST)
|
| | | public void getHotSearch(AcceptData acceptData, PrintWriter out) {
|
| | |
| | |
|
| | | JSONObject data = null;
|
| | | if (!recommend) {
|
| | |
|
| | | // 淘宝接口请求
|
| | | data = searchGoods(kw, page, filter, order, startprice, endprice);
|
| | | } else {
|
| | |
| | | sf.setParams(params);
|
| | | }
|
| | |
|
| | | // 搜索大淘客
|
| | | List<DaTaoKeDetail> daTaoKeList = null;
|
| | | if (page == 1)
|
| | | daTaoKeList = daTaoKeGoodsDetailService.listByDtitle(kw);
|
| | |
|
| | | TaoBaoSearchResult result = TaoBaoUtil.search(sf);
|
| | | if (result == null) {
|
| | | return null;
|
| | | }
|
| | | // 搜索是否在营销主商品库
|
| | | if (result != null && result.getTaoBaoGoodsBriefs() != null && result.getTaoBaoGoodsBriefs().size() > 0) {
|
| | | // 暂时放弃更新到营销商品库
|
| | | // String numIds = "";
|
| | | // for (TaoBaoGoodsBrief goods : result.getTaoBaoGoodsBriefs()) {
|
| | | // numIds += goods.getAuctionId() + ",";
|
| | | // }
|
| | | // if (numIds.endsWith(","))
|
| | | // numIds = numIds.substring(0, numIds.length() - 1);
|
| | | // try {
|
| | | // List<TaoBaoGoodsBrief> goodsList = TaoKeApiUtil.getBatchGoodsInfos(numIds);
|
| | | // Map<Long, Integer> map = new HashMap<>();
|
| | | // for (TaoBaoGoodsBrief g : goodsList)
|
| | | // map.put(g.getAuctionId(), g.getMaterialLibType());
|
| | | // for (TaoBaoGoodsBrief goods : result.getTaoBaoGoodsBriefs())
|
| | | // goods.setMaterialLibType(map.get(goods.getAuctionId()));
|
| | | // 暂时放弃更新到营销商品库
|
| | | // String numIds = "";
|
| | | // for (TaoBaoGoodsBrief goods : result.getTaoBaoGoodsBriefs()) {
|
| | | // numIds += goods.getAuctionId() + ",";
|
| | | // }
|
| | | // if (numIds.endsWith(","))
|
| | | // numIds = numIds.substring(0, numIds.length() - 1);
|
| | | // try {
|
| | | // List<TaoBaoGoodsBrief> goodsList =
|
| | | // TaoKeApiUtil.getBatchGoodsInfos(numIds);
|
| | | // Map<Long, Integer> map = new HashMap<>();
|
| | | // for (TaoBaoGoodsBrief g : goodsList)
|
| | | // map.put(g.getAuctionId(), g.getMaterialLibType());
|
| | | // for (TaoBaoGoodsBrief goods : result.getTaoBaoGoodsBriefs())
|
| | | // goods.setMaterialLibType(map.get(goods.getAuctionId()));
|
| | |
|
| | | ThreadUtil.run(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | // 更新到緩存
|
| | | for (TaoBaoGoodsBrief goods : result.getTaoBaoGoodsBriefs())
|
| | | taoBaoGoodsCacheUtil.saveCommonTaoBaoGoodsInfo(goods);
|
| | | }
|
| | | });
|
| | | // } catch (Exception e) {
|
| | | // e.printStackTrace();
|
| | | // }
|
| | | ThreadUtil.run(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | // 更新到緩存
|
| | | for (TaoBaoGoodsBrief goods : result.getTaoBaoGoodsBriefs())
|
| | | taoBaoGoodsCacheUtil.saveCommonTaoBaoGoodsInfo(goods);
|
| | | }
|
| | | });
|
| | | // } catch (Exception e) {
|
| | | // e.printStackTrace();
|
| | | // }
|
| | |
|
| | | }
|
| | |
|
| | |
| | | data.put("nav", gson.toJson(navList));
|
| | | List<TaoBaoGoodsBriefExtra> re = new ArrayList<TaoBaoGoodsBriefExtra>();
|
| | | List<TaoBaoGoodsBrief> taoBaoGoodsBriefs = result.getTaoBaoGoodsBriefs();
|
| | | if (taoBaoGoodsBriefs == null)
|
| | | taoBaoGoodsBriefs = new ArrayList<>();
|
| | |
|
| | | try {
|
| | | if (daTaoKeList != null && daTaoKeList.size() > 0) {
|
| | | Collections.reverse(daTaoKeList);
|
| | | for (DaTaoKeDetail detail : daTaoKeList) {
|
| | | taoBaoGoodsBriefs.add(0,TaoBaoUtil.convert(detail));
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | | }
|
| | |
|
| | | int fq = sf.getQuan();
|
| | | int fh = sf.getHongbao();
|
| | | boolean ft = sf.isTmall();
|
| | | Map<String, String> map = manageService.convertMap();
|
| | | BigDecimal proportion = manageService.getFanLiRate();
|
| | | if (fq == 0 && fh == 0 && !ft) {
|
| | | if (result != null && result.getTaoBaoGoodsBriefs() != null)
|
| | | for (TaoBaoGoodsBrief bf : result.getTaoBaoGoodsBriefs()) {
|
| | | if (result != null && taoBaoGoodsBriefs != null)
|
| | | for (TaoBaoGoodsBrief bf : taoBaoGoodsBriefs) {
|
| | | int count = bf.getBiz30day();
|
| | | if (count >= 10000) { // 对销量数据做处理 页面展示7.3万
|
| | | double sales = count;
|
| | |
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.Utils;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestSerializableByKey;
|
| | | import com.yeshi.fanli.util.email.MailSenderUtil;
|
| | | import com.yeshi.fanli.util.factory.AccountDetailsFactory;
|
| | | import com.yeshi.fanli.util.factory.HongBaoFactory;
|
| | |
| | | data.put("error", "0");
|
| | | data.put("maxError", 1);
|
| | | String minMoney = configService.get(EXTRACT_MIN_MONEY); // 单笔提现的最小金额
|
| | | String maxMoney = configService.get("extract_money_day"); // 每日最大提现金额
|
| | | String maxMoney = configService.get(EXTRACT_MAX_MONEY); // 单笔提现的最小金额
|
| | | String maxDayMoney = configService.get("extract_money_day"); // 每日最大提现金额
|
| | | int maxDayCount = Integer.parseInt(configService.get("extract_count_day"));
|
| | | ExtractRecord extractRecord = extractRecordService.getExtractRecordByUid(uid);
|
| | | boolean canExtract = true;
|
| | |
| | | canExtract = false;
|
| | | errorMsg = String.format("每日最多提现%s次", maxDayCount + "");
|
| | | } else if (extractRecord != null
|
| | | && extractRecord.getMoney().add(new BigDecimal(minMoney)).compareTo(new BigDecimal(maxMoney)) > 0) {
|
| | | && extractRecord.getMoney().add(new BigDecimal(minMoney)).compareTo(new BigDecimal(maxDayMoney)) > 0) {
|
| | | canExtract = false;
|
| | | errorMsg = String.format("每日最多提现%s元", maxMoney);
|
| | | errorMsg = String.format("每日最多提现%s元", maxDayMoney);
|
| | | }
|
| | | data.put("canExtract", canExtract);
|
| | | data.put("extractErrorMsg", errorMsg);
|
| | |
|
| | | data.put("minMoney", minMoney);
|
| | | data.put("maxMoney", maxMoney);
|
| | | data.put("minMoney", minMoney);//单笔最低
|
| | | data.put("maxMoney", maxMoney);//单笔最高
|
| | | data.put("maxDayCount", maxDayCount);
|
| | | data.put("bindingAccountList", gson.toJson(filterBindingAccount(bindingAccountList)));
|
| | |
|
| | |
| | | * @param type
|
| | | * @param out
|
| | | */
|
| | | @RequestSerializableByKey(key="uid")
|
| | | @RequestMapping(value = "extractmoneynew", method = RequestMethod.POST)
|
| | | public void extractMoneyNew(AcceptData acceptData, long uid, BigDecimal money, String vcode,
|
| | | HttpServletRequest request, int type, PrintWriter out) {
|
| | |
| | | */
|
| | | @Table("yeshi_ec_brand_class_shop")
|
| | | public class BrandClassShop {
|
| | | public static int STATE_VALID = 1;// 启用
|
| | | public static int STATE_INVALID = 0;// 不启用
|
| | |
|
| | | @Expose
|
| | | @Column(name = "bcs_id")
|
| | | private Long id;
|
| | | |
| | |
|
| | | @Column(name = "bcs_cid")
|
| | | private BrandClass brandClass;
|
| | | |
| | |
|
| | | @Column(name = "bcs_shop_id")
|
| | | private TaoBaoShop shop;
|
| | | |
| | |
|
| | | @Column(name = "bcs_top")
|
| | | private Integer top;
|
| | | |
| | |
|
| | | @Column(name = "bcs_orderby")
|
| | | private Integer orderby;
|
| | | |
| | |
|
| | | @Column(name = "bcs_state")
|
| | | private Integer state;
|
| | | |
| | | private Integer state;// 1-启用 0-禁用
|
| | |
|
| | | // 点击次数
|
| | | @Column(name = "bcs_browse_num")
|
| | | private Long browseNum;
|
| | | |
| | |
|
| | | @Column(name = "bcs_create_time")
|
| | | private Date createTime;
|
| | | |
| | |
|
| | | @Column(name = "bcs_update_time")
|
| | | private Date updateTime;
|
| | |
|
| | | |
| | | // 劵数量
|
| | | private long couponNum;
|
| | | |
| | | |
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
| | | import com.yeshi.fanli.exception.ActivityException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.activity.ActivityService;
|
| | | import com.yeshi.fanli.service.inter.brand.BrandClassShopService;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
|
| | | import com.yeshi.fanli.service.inter.lable.LabelService;
|
| | | import com.yeshi.fanli.service.inter.lable.QualityFactoryService;
|
| | |
| | |
|
| | | @Resource
|
| | | private QualityFlashSaleService qualityFlashSaleService;
|
| | |
|
| | | @Resource
|
| | | private BrandClassShopService brandClassShopService;
|
| | |
|
| | | // 动态商品更新 ,1个小时更新
|
| | | @Scheduled(cron = "0 0 */1 * * ?")
|
| | |
| | | taoBaoGoodsUpdateService.deleteOutOfDate();
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 更新超过4个小时未更新的商品
|
| | | */
|
| | | //1个小时更新
|
| | | // 1个小时更新
|
| | | @Scheduled(cron = "0 0 1/1 * * ? ")
|
| | | public void addNeddUpdateTaoBaoGoods() {
|
| | | if (!Constant.IS_TASK) |
| | | public void addNeedUpdateTaoBaoGoods() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | |
| | |
|
| | | List<Long> list = taoBaoGoodsUpdateService.listNeedUpdateGoodsId(0, 2000, 4);
|
| | | if (list == null || list.size() == 0) {
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | for (Long id : list) {
|
| | | try {
|
| | | CMQManager.getInstance().addNeedUpdateTaoBaoGoodsId(id);
|
| | |
| | | }
|
| | |
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | |
|
| | | // 更新品牌商品,每天早上6点执行一次
|
| | | @Scheduled(cron = "0 0 6 * * ? ")
|
| | | public void updateBrandGoods() {
|
| | | brandClassShopService.updateShopGoods();
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_device_active where da_device = #{device} and |
| | | da_platform=#{platform} |
| | | da_platform=#{platform} order by da_id desc limit 1 |
| | | </select> |
| | | |
| | | <select id="selectByDeviceToeknMd5AndPlatform" resultMap="BaseResultMap"> |
| | |
| | | import com.yeshi.fanli.entity.brand.BrandClass;
|
| | | import com.yeshi.fanli.entity.brand.BrandClassShop;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.taobao.SearchFilter;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoShop;
|
| | | import com.yeshi.fanli.exception.brand.BrandClassShopException;
|
| | | import com.yeshi.fanli.service.inter.brand.BrandClassShopService;
|
| | |
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.vo.brand.TaoBaoShopVO;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | @Service
|
| | | public class BrandClassShopServiceImpl implements BrandClassShopService {
|
| | | |
| | |
|
| | | @Resource
|
| | | private BrandClassShopMapper brandClassShopMapper;
|
| | | |
| | |
|
| | | @Resource
|
| | | private CommonGoodsService commonGoodsService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private TaoBaoShopService taoBaoShopService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private TaoBaoShopHistoryService taoBaoShopHistoryService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private HongBaoManageService manageService;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
|
| | | |
| | |
|
| | |
|
| | | @Override
|
| | | public List<BrandClassShop> getExistByShopIds(List<Long> list){
|
| | | public List<BrandClassShop> getExistByShopIds(List<Long> list) {
|
| | | return brandClassShopMapper.getExistByShopIds(list);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | @Transactional
|
| | | public String saveShopInfo(Long cid, List<Long> list) throws BrandClassShopException{
|
| | | public String saveShopInfo(Long cid, List<Long> list) throws BrandClassShopException {
|
| | | if (list == null || list.size() == 0) {
|
| | | throw new BrandClassShopException(1, "请选择店铺");
|
| | | }
|
| | | |
| | |
|
| | | if (cid == null) {
|
| | | throw new BrandClassShopException(1, "请选择店铺类型");
|
| | | }
|
| | | |
| | |
|
| | | String shopIds = "";
|
| | | BrandClass brandClass = new BrandClass(cid);
|
| | | |
| | | for (Long shopId: list) {
|
| | | List<CommonGoods> listGoods= commonGoodsService.listBySellerId(shopId);
|
| | | |
| | |
|
| | | for (Long shopId : list) {
|
| | | List<CommonGoods> listGoods = commonGoodsService.listBySellerId(shopId);
|
| | |
|
| | | TaoBaoShop taoBaoShop = null;
|
| | | for (CommonGoods commonGoods: listGoods) {
|
| | | for (CommonGoods commonGoods : listGoods) {
|
| | | try {
|
| | | taoBaoShop = TaoBaoUtil.getTaoBaoShopDetailByAuctionId(commonGoods.getGoodsId());
|
| | | if (taoBaoShop != null && taoBaoShop.getId() != null) {
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | if (taoBaoShop == null) {
|
| | | shopIds = shopIds + "," + shopId;
|
| | | continue;
|
| | | }
|
| | | |
| | |
|
| | | TaoBaoShop current = taoBaoShopService.selectByPrimaryKey(shopId);
|
| | | if (current == null) {
|
| | | taoBaoShopService.insertSelective(taoBaoShop);
|
| | | } else {
|
| | | taoBaoShopService.updateByPrimaryKeySelective(taoBaoShop);
|
| | | }
|
| | | |
| | |
|
| | | BrandClassShop brandClassShop = brandClassShopMapper.getByShopIdAndCid(cid, shopId);
|
| | | if (brandClassShop == null) {
|
| | | brandClassShop = new BrandClassShop();
|
| | |
| | | }
|
| | | return shopIds;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | public void changeShopInfo(MultipartFile file, Long id, Long cid, String shopName, Integer state, Integer top) throws BrandClassShopException{
|
| | | |
| | | public void changeShopInfo(MultipartFile file, Long id, Long cid, String shopName, Integer state, Integer top)
|
| | | throws BrandClassShopException {
|
| | |
|
| | | if (id == null) {
|
| | | throw new BrandClassShopException(1, "数据为空:请选择店铺");
|
| | | }
|
| | | |
| | |
|
| | | if (cid == null) {
|
| | | throw new BrandClassShopException(1, "请选择店铺类型");
|
| | | }
|
| | | |
| | |
|
| | | BrandClassShop current = brandClassShopMapper.selectByPrimaryKey(id);
|
| | | if (current == null) {
|
| | | throw new BrandClassShopException(1, "该数据已不存在");
|
| | | }
|
| | | |
| | |
|
| | | TaoBaoShop shop = current.getShop();
|
| | | if (shop == null) {
|
| | | throw new BrandClassShopException(1, "店铺信息已不存在");
|
| | | }
|
| | | |
| | |
|
| | | // 自定义图片
|
| | | taoBaoShopService.changeInfo(file, shop.getId(), shopName);
|
| | | |
| | |
|
| | | BrandClassShop updateshop = new BrandClassShop();
|
| | | updateshop.setState(state);
|
| | | updateshop.setTop(top);
|
| | |
| | | updateshop.setBrandClass(new BrandClass(cid));
|
| | | brandClassShopMapper.updateByPrimaryKeySelective(updateshop);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public List<BrandClassShop> listQuery(long start, int count, String key, Long cid, Integer state) {
|
| | |
| | | if (listQuery == null || listQuery.size() == 0) {
|
| | | return listQuery;
|
| | | }
|
| | | |
| | |
|
| | | for (BrandClassShop brandClassShop : listQuery) {
|
| | | TaoBaoShop shop = brandClassShop.getShop();
|
| | | if (shop != null) {
|
| | | long couponNum = commonGoodsService.countBySellerIdAndHasCoupon(shop.getId());
|
| | | brandClassShop.setCouponNum(couponNum);
|
| | | |
| | |
|
| | | String shopLink = shop.getShopLink();
|
| | | if (StringUtil.isNullOrEmpty(shopLink)) {
|
| | | shop.setShopLink(TaoBaoUtil.getShopLink(shop.getId()));
|
| | | }
|
| | | |
| | |
|
| | | String shopNameCustom = shop.getShopNameCustom();
|
| | | if (!StringUtil.isNullOrEmpty(shopNameCustom)) {
|
| | | shop.setShopName(shopNameCustom);
|
| | | }
|
| | | |
| | |
|
| | | String shopIconCustom = shop.getShopIconCustom();
|
| | | if (!StringUtil.isNullOrEmpty(shopIconCustom)) {
|
| | | shop.setShopIcon(shopIconCustom);
|
| | |
| | | return listQuery;
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public long countQuery(String key, Long cid, Integer state) {
|
| | | return brandClassShopMapper.countQuery(key, cid, state);
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | |
| | | if (list == null || list.size() == 0) {
|
| | | return;
|
| | | }
|
| | | for (Long id: list) {
|
| | | for (Long id : list) {
|
| | | brandClassShopMapper.deleteByPrimaryKey(id);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public void deleteBatchByClassId(List<Long> list) {
|
| | | if (list == null || list.size() == 0) {
|
| | |
| | | }
|
| | | brandClassShopMapper.deleteBatchByClassId(list);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public void updateOrder(Long id, Integer moveType) throws BrandClassShopException, Exception{
|
| | | public void updateOrder(Long id, Integer moveType) throws BrandClassShopException, Exception {
|
| | |
|
| | | if (moveType == null || (!moveType.equals(1) && !moveType.equals(-1))) {
|
| | | throw new BrandClassShopException(1, "传递的类型不正确");
|
| | | }
|
| | | |
| | |
|
| | | if (id == null) {
|
| | | throw new BrandClassShopException(1, "ID不能为空");
|
| | | }
|
| | | |
| | |
|
| | | BrandClassShop resultObj = brandClassShopMapper.selectByPrimaryKey(id);
|
| | | if (resultObj == null) {
|
| | | throw new BrandClassShopException(1, "操作数据已不存在");
|
| | | }
|
| | | |
| | |
|
| | | BrandClass brandClass = resultObj.getBrandClass();
|
| | | if (brandClass == null) {
|
| | | throw new BrandClassShopException(1, "分类数据已不存在");
|
| | | }
|
| | | |
| | |
|
| | | Integer oldOrder = resultObj.getOrderby();
|
| | | BrandClassShop changeObj = brandClassShopMapper.getByAdjoinOrder(brandClass.getId(),oldOrder, moveType);
|
| | | |
| | | if (changeObj == null ) {
|
| | | BrandClassShop changeObj = brandClassShopMapper.getByAdjoinOrder(brandClass.getId(), oldOrder, moveType);
|
| | |
|
| | | if (changeObj == null) {
|
| | | throw new BrandClassShopException(1, "已经在最边缘,无可交换的位置");
|
| | | }
|
| | | // 交换排序序号
|
| | | resultObj.setOrderby(changeObj.getOrderby());
|
| | | changeObj.setOrderby(oldOrder);
|
| | | |
| | |
|
| | | brandClassShopMapper.updateByPrimaryKeySelective(changeObj);
|
| | | brandClassShopMapper.updateByPrimaryKeySelective(resultObj);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | @Cacheable(value = "brandCache", key = "'listEffectiveCache-'+#page+'-'+#cid")
|
| | | public JSONObject listEffectiveCache(int page, Long cid) {
|
| | | long countShop = 0;
|
| | | |
| | |
|
| | | if (cid != null && cid <= 0) {
|
| | | cid = null;
|
| | | }
|
| | | |
| | |
|
| | | List<TaoBaoShop> listShop = new ArrayList<TaoBaoShop>();
|
| | | // 第一页 查询全部分类下店铺
|
| | | if (page == 1 && cid != null) {
|
| | | if (page == 1 && cid != null) {
|
| | | List<BrandClassShop> list = brandClassShopMapper.listEffective(cid);
|
| | | if (list == null) {
|
| | | list = new ArrayList<BrandClassShop>();
|
| | | } else if (list.size() > 0) {
|
| | | countShop = brandClassShopMapper.countEffective(cid);
|
| | | }
|
| | | |
| | |
|
| | | for (BrandClassShop brandClassShop : list) {
|
| | | TaoBaoShop shop = brandClassShop.getShop();
|
| | | if (shop != null) {
|
| | |
| | | if (StringUtil.isNullOrEmpty(shopLink)) {
|
| | | shop.setShopLink(TaoBaoUtil.getShopLink(shop.getId()));
|
| | | }
|
| | | |
| | |
|
| | | String shopNameCustom = shop.getShopNameCustom();
|
| | | if (!StringUtil.isNullOrEmpty(shopNameCustom)) {
|
| | | shop.setShopName(shopNameCustom);
|
| | | }
|
| | | |
| | |
|
| | | String shopIconCustom = shop.getShopIconCustom();
|
| | | if (!StringUtil.isNullOrEmpty(shopIconCustom)) {
|
| | | shop.setShopIcon(shopIconCustom);
|
| | | }
|
| | | |
| | |
|
| | | listShop.add(shop);
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("countShop", countShop);
|
| | | data.put("listShop", JsonUtil.getApiCommonGson().toJson(listShop));
|
| | | |
| | |
|
| | | long count = 0;
|
| | | List<TaoBaoShopVO> listInfo = taoBaoShopService.listBrandShopinfo((page-1)*Constant.PAGE_SIZE, Constant.PAGE_SIZE, cid);
|
| | | List<TaoBaoShopVO> listInfo = taoBaoShopService.listBrandShopinfo((page - 1) * Constant.PAGE_SIZE,
|
| | | Constant.PAGE_SIZE, cid);
|
| | | if (listInfo == null) {
|
| | | listInfo = new ArrayList<TaoBaoShopVO>();
|
| | | } else if (listInfo.size() > 0) {
|
| | | count = taoBaoShopService.countBrandShopinfo(cid);
|
| | | }
|
| | | |
| | |
|
| | | BigDecimal proportion = manageService.getFanLiRate();
|
| | | for (TaoBaoShopVO taoBaoShopVO : listInfo) {
|
| | | |
| | |
|
| | | String shopLink = taoBaoShopVO.getShopLink();
|
| | | if (StringUtil.isNullOrEmpty(shopLink)) {
|
| | | taoBaoShopVO.setShopLink(TaoBaoUtil.getShopLink(taoBaoShopVO.getId()));
|
| | | }
|
| | | |
| | |
|
| | | String shopNameCustom = taoBaoShopVO.getShopNameCustom();
|
| | | if (!StringUtil.isNullOrEmpty(shopNameCustom)) {
|
| | | taoBaoShopVO.setShopName(shopNameCustom);
|
| | | }
|
| | | |
| | |
|
| | | String shopIconCustom = taoBaoShopVO.getShopIconCustom();
|
| | | if (!StringUtil.isNullOrEmpty(shopIconCustom)) {
|
| | | taoBaoShopVO.setShopIcon(shopIconCustom);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | List<TaoBaoGoodsBriefExtra> listGoods = new ArrayList<TaoBaoGoodsBriefExtra>();
|
| | | List<TaoBaoGoodsBrief> listGoodsBrief = taoBaoShopVO.getListGoodsBrief();
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) {
|
| | |
| | | }
|
| | | data.put("count", count);
|
| | | data.put("list", JsonUtil.getApiCommonGson().toJson(listInfo));
|
| | | |
| | |
|
| | | return data;
|
| | | }
|
| | | |
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public void addClick(Long shopId) {
|
| | | BrandClassShop brandClassShop = brandClassShopMapper.getByShopId(shopId);
|
| | |
| | | if (browseNum == null) {
|
| | | browseNum = 0L;
|
| | | }
|
| | | |
| | |
|
| | | BrandClassShop classShop = new BrandClassShop();
|
| | | classShop.setId(brandClassShop.getId());
|
| | | classShop.setBrowseNum(browseNum ++);
|
| | | classShop.setBrowseNum(browseNum++);
|
| | | brandClassShopMapper.updateByPrimaryKeySelective(classShop);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public void updateShopGoods() {
|
| | | // 查询店铺
|
| | | List<BrandClassShop> shopList = listQuery(0, 1000, "", null, BrandClassShop.STATE_VALID);
|
| | | if (shopList != null)
|
| | | for (BrandClassShop shop : shopList) {
|
| | | SearchFilter sf = new SearchFilter();
|
| | | sf.setKey(shop.getShop().getShopName().replace("官方旗舰店", "").replace("旗舰店", ""));
|
| | | sf.setPage(1);
|
| | | sf.setPageSize(100);
|
| | | TaoBaoSearchResult result = TaoKeApiUtil.searchWuLiao(sf);
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | if (result != null && result.getTaoBaoGoodsBriefs() != null)
|
| | | for (TaoBaoGoodsBrief goods : result.getTaoBaoGoodsBriefs()) {
|
| | | if (goods.getSellerId().longValue() == shop.getShop().getId()) {
|
| | | if (taoBaoGoodsBriefService.queryByAuctionId(goods.getAuctionId()).size() == 0) {
|
| | | goods.setCreatetime(new Date());
|
| | | goods.setState(0);
|
| | | goods.setUpdatetime(new Date());
|
| | | goodsList.add(goods);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (goodsList.size() > 0)
|
| | | taoBaoGoodsBriefService.insertBatch(goodsList);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | .setMoney(tempHongBaoOrder.getHongBaoV2().getMoney().add(childUpdate.getMoney()));
|
| | | notificationMap.put(child.getType(), tempHongBaoOrder);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | }
|
| | | } else
|
| | | throw new HongBaoException(2, "type错误");
|
| | |
| | | firstHongbao.setMoney(
|
| | | MoneyBigDecimalUtil.mul(hongBao.getMoney(), firstRate.divide(new BigDecimal(100))));
|
| | | }
|
| | | //返利为0的不通知
|
| | | if (firstHongbao.getMoney() == null || firstHongbao.getMoney().compareTo(new BigDecimal(0)) <= 0)
|
| | | return;
|
| | |
|
| | | hongBaoV2Mapper.insertSelective(firstHongbao);
|
| | | // 用户通知
|
| | | if (notificationMap.get(HongBaoV2.TYPE_YIJI) == null) {
|
| | |
| | | secondHongbao.setMoney(
|
| | | MoneyBigDecimalUtil.mul(hongBao.getMoney(), secondRate.divide(new BigDecimal(100))));
|
| | | }
|
| | | |
| | | //返利为0的不统计
|
| | | if (secondHongbao.getMoney() == null || secondHongbao.getMoney().compareTo(new BigDecimal(0)) <= 0)
|
| | | return;
|
| | |
|
| | | hongBaoV2Mapper.insertSelective(secondHongbao);
|
| | |
|
| | | // 用户通知
|
| | |
| | | else
|
| | | return money;
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public List<HongBaoV2> listChildrenById(Long id){
|
| | | public List<HongBaoV2> listChildrenById(Long id) {
|
| | | return hongBaoV2Mapper.listChildrenById(id);
|
| | | }
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.entity.order.CommonOrderGoods;
|
| | | import com.yeshi.fanli.entity.order.CommonOrderTradeIdMap;
|
| | |
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemCouponService;
|
| | | import com.yeshi.fanli.service.inter.goods.CommonGoodsService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoV2Service;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponRecordService;
|
| | |
| | |
|
| | | @Resource
|
| | | private CommonOrderTradeIdMapMapper commonOrderTradeIdMapMapper;
|
| | |
|
| | | @Resource
|
| | | private CommonGoodsService commonGoodsService;
|
| | |
|
| | | // 奖励订单图片
|
| | | public final static String PIC_REWARD = "http://img.flqapp.com/resource/order/order_state_reward.png";
|
| | |
| | | taoBaoGoods = TaoKeApiUtil.getSimpleGoodsInfo(taoBaoOrder.getAuctionId());
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | e.printStackTrace();
|
| | | LogHelper.errorDetailInfo(e, "AUCTIONID:"+taoBaoOrder.getAuctionId(), "");
|
| | | taoBaoGoods = TaoBaoUtil.getSimpleGoodsBrief(taoBaoOrder.getAuctionId());
|
| | | LogHelper.errorDetailInfo(e, "AUCTIONID:" + taoBaoOrder.getAuctionId(), "");
|
| | | try {
|
| | | taoBaoGoods = TaoBaoUtil.getSimpleGoodsBrief(taoBaoOrder.getAuctionId());
|
| | | } catch (Exception e1) {
|
| | | CommonGoods commonGoods = commonGoodsService.getCommonGoodsByGoodsIdAndGoodsType(
|
| | | taoBaoOrder.getAuctionId(), Constant.SOURCE_TYPE_TAOBAO);
|
| | | if (commonGoods != null)
|
| | | taoBaoGoods = TaoBaoUtil.convert(commonGoods);
|
| | | }
|
| | | }
|
| | | if (taoBaoGoods != null) {
|
| | | goods = CommonOrderGoodsFactory.create(taoBaoGoods);
|
| | |
| | | commonOrderMapper.insertSelective(commonOrder);
|
| | |
|
| | | // 插入映射,保证交易ID的完整性
|
| | | commonOrderTradeIdMapMapper.insertSelective(
|
| | | new CommonOrderTradeIdMap(commonOrder.getId(), commonOrder.getTradeId(), new Date(),commonOrder.getSourceType()));
|
| | | commonOrderTradeIdMapMapper.insertSelective(new CommonOrderTradeIdMap(commonOrder.getId(),
|
| | | commonOrder.getTradeId(), new Date(), commonOrder.getSourceType()));
|
| | |
|
| | | commonOrderList.add(commonOrder);
|
| | | continue;
|
| | |
| | | }
|
| | |
|
| | | // 站内信+推送
|
| | | UserInfo user = userInfoMapper.selectByPrimaryKey(uid);
|
| | | UserInfo user = userInfoMapper.selectByPKey(uid);
|
| | | try {
|
| | | userNotificationService.orderFanliRecieved(uid, hongBaoOrder.getCommonOrder().getOrderNo(),
|
| | | userGoodsCount.get(uid), user.getMyHongBao(), money);
|
| | |
| | | orderMapper.insertSelective(order);
|
| | | oldOrder = order;
|
| | | } else {
|
| | |
|
| | | Long targetUid = null;
|
| | | if (pid.equalsIgnoreCase(TaoBaoConstant.TAOBAO_RELATION_AS_SPECIAL_PID)
|
| | | && !StringUtil.isNullOrEmpty(orderList.get(0).getRelationId())) {
|
| | |
| | | if (shop != null)
|
| | | return shop;
|
| | | shop = TaoBaoUtil.getTaoBaoShopDetailByAuctionId(auctionId);
|
| | | if (shop != null)
|
| | | taoBaoShopMapper.insert(shop);
|
| | | try {
|
| | | if (shop != null)
|
| | | taoBaoShopMapper.insert(shop);
|
| | | } catch (Exception e) {
|
| | | }
|
| | | return shop;
|
| | | }
|
| | |
|
| | |
| | | updateUserInfo.setNickName(Constant.systemCommonConfig.getDefaultNickName() + user.getId());
|
| | | userInfoMapper.updateByPrimaryKeySelective(updateUserInfo);
|
| | | }
|
| | | |
| | |
|
| | | try {
|
| | | // 第一次登录时创建用户额外信息
|
| | | userInfoExtraService.createUserInfoExtra(user.getId());
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | |
|
| | | String oldVcode = redisManager.getSMSVCode(phone, SMSHistory.TYPE_LOGIN);
|
| | | LogHelper.test("----------------------登录验证码: " + oldVcode);
|
| | | if (StringUtil.isNullOrEmpty(oldVcode) || !oldVcode.equalsIgnoreCase(vcode)) {
|
| | | throw new UserAccountException(1, "验证码错误,重新输入");
|
| | | }
|
| | | if (!Constant.IS_TEST)
|
| | | if (StringUtil.isNullOrEmpty(oldVcode) || !oldVcode.equalsIgnoreCase(vcode)) {
|
| | | throw new UserAccountException(1, "验证码错误,重新输入");
|
| | | }
|
| | | }
|
| | |
|
| | | JSONObject logInfo = new JSONObject();
|
| | |
| | | UserInfo userInfo = userInfoMapper.getEffectiveUserInfoByWXUnionId(weiXinUser.getUnionid());
|
| | | // 直接用的微信登录
|
| | | if (userInfo != null) {
|
| | | LogHelper.test("微信unionID存在:"+weiXinUser.getUnionid());
|
| | | LogHelper.test("微信unionID存在:" + weiXinUser.getUnionid());
|
| | | // 更新账户登录信息
|
| | | updateLonginInfo(userInfo, loginType, request);
|
| | | // 删除邀请分享图
|
| | | spreadUserImgService.deleteImgUrl(userInfo.getId());
|
| | | } else {
|
| | | LogHelper.test("微信unionID不存在:"+weiXinUser.getUnionid());
|
| | | LogHelper.test("微信unionID不存在:" + weiXinUser.getUnionid());
|
| | | // 创建新账户
|
| | | userInfo = new UserInfo();
|
| | | userInfo.setPortrait(weiXinUser.getHeadimgurl());
|
| | |
| | | if (weiXinUser == null) {
|
| | | throw new UserAccountException(2, "微信帐号授权失败");
|
| | | }
|
| | | |
| | |
|
| | | String wxUnionId = weiXinUser.getUnionid();
|
| | | if (StringUtil.isNullOrEmpty(wxUnionId)) {
|
| | | throw new UserAccountException(2, "微信帐号授权失败");
|
| | | }
|
| | | |
| | |
|
| | | String wxUnionIdExist = user.getWxUnionId();
|
| | | if (StringUtil.isNullOrEmpty(wxUnionIdExist)) {
|
| | | UserInfo newUser = userInfoMapper.getEffectiveUserInfoByWXUnionId(wxUnionId);
|
| | |
| | | updateUserInfo.setWxOpenId(weiXinUser.getOpenid());
|
| | | updateUserInfo.setWxPic(weiXinUser.getHeadimgurl());
|
| | | updateUserInfo.setWxUnionId(weiXinUser.getUnionid());
|
| | | |
| | |
|
| | | // 将默认昵称替换成微信昵称
|
| | | String defaultNickName = Constant.systemCommonConfig.getDefaultNickName();
|
| | | if (!StringUtil.isNullOrEmpty(weiXinUser.getNickname()) && !StringUtil.isNullOrEmpty(defaultNickName)
|
| | | && defaultNickName.equals(user.getNickName())) {
|
| | | updateUserInfo.setNickName(weiXinUser.getNickname());
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | // 将默认头像替换成微信头像
|
| | | String defaultPortrait = Constant.systemCommonConfig.getDefaultPortrait();
|
| | | if (!StringUtil.isNullOrEmpty(weiXinUser.getHeadimgurl()) && !StringUtil.isNullOrEmpty(defaultPortrait)
|
| | |
| | | */
|
| | | public void deleteBatchByClassId(List<Long> list);
|
| | |
|
| | | |
| | | /**
|
| | | * 更新品牌商品
|
| | | */
|
| | | public void updateShopGoods();
|
| | | |
| | | }
|
| | |
| | | // 重新设置标题与券价格
|
| | | goods.setTitle(detail.getdTitle());
|
| | | goods.setCouponAmount(detail.getQuanPrice());
|
| | | goods.setZkPrice(detail.getOrgPrice());
|
| | | if (new BigDecimal(detail.getQuanCondition()).compareTo(new BigDecimal(0)) > 0)
|
| | | goods.setCouponInfo(String.format("满%s元减%s元", detail.getQuanCondition(),
|
| | | MoneyBigDecimalUtil.getWithNoZera(detail.getQuanPrice()).toString()));
|