| | |
| | | */
|
| | | @RequestMapping("query")
|
| | | public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer state,
|
| | | Integer handleType, PrintWriter out) {
|
| | | Integer handleType, Integer type, PrintWriter out) {
|
| | |
|
| | | if (pageIndex == null || pageIndex < 0){
|
| | | pageIndex = 1;
|
| | |
| | |
|
| | | try {
|
| | |
|
| | | List<LostOrder> list = lostOrderService.listQuery((pageIndex - 1) * pageSize, pageSize, key, state, handleType);
|
| | | List<LostOrder> list = lostOrderService.listQuery((pageIndex - 1) * pageSize, pageSize, key, state, handleType, type);
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无更多数据"));
|
| | | return;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | long count = lostOrderService.countQuery(key, state, handleType);
|
| | | long count = lostOrderService.countQuery(key, state, handleType, type);
|
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | |
|
| | |
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.controller.admin.utils.AdminUtils;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail.UserMoneyDetailTypeEnum;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getUserOrderList")
|
| | | public void getUserOrderList(String callback, Integer pageIndex, Integer pageSize, Integer keyType, String key,
|
| | | Integer state, Integer type, Integer orderState, String startTime, String endTime, PrintWriter out) {
|
| | | public void getUserOrderList(String callback, Integer pageIndex, Integer pageSize, Integer keyType, |
| | | String key, Integer state, Integer type, Integer orderState, String startTime, String endTime,
|
| | | Integer source, PrintWriter out) {
|
| | |
|
| | | if (pageIndex == null || pageIndex < 1) {
|
| | | pageIndex = 1;
|
| | |
| | |
|
| | | // 查询列表
|
| | | List<CommonOrderVO> list = commonOrderService.listQuery((pageIndex - 1) * pageSize, pageSize, keyType, key,
|
| | | state, type, orderState, startTime, endTime);
|
| | | state, type, orderState, startTime, endTime, source);
|
| | |
|
| | | if (list != null && list.size() > 0) {
|
| | | // 统计总数
|
| | | count = commonOrderService.countQuery(keyType, key, state, type, orderState, startTime, endTime);
|
| | | count = commonOrderService.countQuery(keyType, key, state, type, orderState, startTime, endTime, source);
|
| | | }
|
| | |
|
| | | // 查询是否维权
|
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.taobao.TbImgUtil;
|
| | |
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | result.put("picture", picture);
|
| | | result.put("picture", TbImgUtil.getTBSize320Img(picture));
|
| | |
|
| | | String fontColor1 = "#666666";
|
| | | String fontColor2 = "#E5005C";
|
| | |
| | | import com.yeshi.fanli.util.CMQManager;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | | import com.yeshi.fanli.vo.order.CommonOrderVO;
|
| | | import com.yeshi.fanli.vo.user.UserInfoExtraVO;
|
| | |
| | | String orderNo, String startTime, String endTime, Integer slotTime, boolean needCount, Integer dateType,
|
| | | Integer goodsType, PrintWriter out) {
|
| | |
|
| | | if (Constant.IS_TEST)
|
| | | uid = 389677L;
|
| | |
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | |
| | | type = null; // 所有类型订单
|
| | | }
|
| | |
|
| | | if (goodsType != null && goodsType == 0) {
|
| | | if (!VersionUtil.greaterThan_1_6_0(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | goodsType = Constant.SOURCE_TYPE_TAOBAO;
|
| | | } else if (goodsType != null && goodsType == 0){
|
| | | goodsType = null; // 所有平台订单
|
| | | }
|
| | |
|
| | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", count);
|
| | | data.put("list", JsonUtil.getApiCommonGson().toJson(list));
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | |
| | |
|
| | |
|
| | | /**
|
| | | * 获取商品详情
|
| | | * |
| | | * @param acceptData
|
| | | * @param id
|
| | | * @param source
|
| | | * @param uid
|
| | | * @param from
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getDetail", method = RequestMethod.POST)
|
| | | public void getDetail(AcceptData acceptData, Long id, Integer goodsType, Long uid, String from, PrintWriter out) {
|
| | | if (id == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "商品id不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | | // 淘宝商品
|
| | | if (goodsType == null || Constant.SOURCE_TYPE_TAOBAO == goodsType) {
|
| | | getTaoBaoGoodsDetial(acceptData, id, uid, from, out);
|
| | | return;
|
| | | }
|
| | |
|
| | | // 京东商品
|
| | | if (Constant.SOURCE_TYPE_JD == goodsType) {
|
| | | getJDGoodsDetial(acceptData, id, uid, from, out);
|
| | | return;
|
| | | }
|
| | |
|
| | | // 拼多多商品
|
| | | if (Constant.SOURCE_TYPE_PDD == goodsType) {
|
| | | getPDDGoodsDetial(acceptData, id, uid, from, out);
|
| | | return;
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 淘宝商品详情
|
| | | * @param acceptData
|
| | | * @param id
|
| | |
| | | * @param from
|
| | | * @param out
|
| | | */
|
| | | public void getTaoBaoGoodsDetial(AcceptData acceptData, Long id, Long uid, String from, PrintWriter out) {
|
| | | @RequestMapping(value = "getDetailTB", method = RequestMethod.POST)
|
| | | public void getDetialTB(AcceptData acceptData, Long id, Long uid, String from, PrintWriter out) {
|
| | | if (id == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "请上传id"));
|
| | | out.print(JsonUtil.loadFalseResult(1, "商品id不能为空"));
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | * @param from
|
| | | * @param out
|
| | | */
|
| | | public void getJDGoodsDetial(AcceptData acceptData, Long id, Long uid, String from, PrintWriter out) {
|
| | | @RequestMapping(value = "getDetailJD", method = RequestMethod.POST)
|
| | | public void getDetialJD(AcceptData acceptData, Long id, Long uid, String from, PrintWriter out) {
|
| | | // 系统验证
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 京东商品详情
|
| | | * 拼多多商品详情
|
| | | *
|
| | | * @param acceptData
|
| | | * @param id
|
| | |
| | | * @param from
|
| | | * @param out
|
| | | */
|
| | | public void getPDDGoodsDetial(AcceptData acceptData, Long id, Long uid, String from, PrintWriter out) {
|
| | | @RequestMapping(value = "getDetailPDD", method = RequestMethod.POST)
|
| | | public void getDetialPDD(AcceptData acceptData, Long id, Long uid, String from, PrintWriter out) {
|
| | | // 系统验证
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | |
| | | extraVO.setIosOnling(configService.iosOnLining(Integer.parseInt(version)));
|
| | | }
|
| | |
|
| | | // 图文详情
|
| | | extraVO.setDetailUrl("http://apph5.yeshitv.com/apppage/goods_img_pdd.html?id="+ id);
|
| | |
|
| | | Long inOrderCount30Days = pddGoods.getSoldQuantity();
|
| | | List<ShamUser> listShareUser = new ArrayList<ShamUser>();
|
| | |
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Collections;
|
| | | import java.util.HashSet;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.Set;
|
| | | import java.util.regex.Matcher;
|
| | | import java.util.regex.Pattern;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.core.task.TaskExecutor;
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | |
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.dto.dataoke.DaTaoKeGoodsResult;
|
| | | import com.yeshi.fanli.dto.jd.JDSearchFilter;
|
| | | import com.yeshi.fanli.dto.jd.JDSearchResult;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | |
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.taobao.SearchFilter;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchNav;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.BusinessSystemService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | |
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | | import com.yeshi.fanli.util.Utils;
|
| | | import com.yeshi.fanli.util.cache.TaoBaoGoodsCacheUtil;
|
| | | import com.yeshi.fanli.util.dataoke.DaTaoKeApiUtil;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.util.jd.JDUtil;
|
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | | |
| | | @Resource(name = "taskExecutor")
|
| | | private TaskExecutor executor;
|
| | |
|
| | |
|
| | |
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "searchGoods")
|
| | | public void searchGoods(AcceptData acceptData, String kw, int page, String filter, String order, String startprice,
|
| | | String endprice, Double startTkRate, Double endTkRate, String fastFilter, Integer goodsType,
|
| | | public void searchGoods(AcceptData acceptData, Integer goodsType, String key, Integer page, String filter, Integer order, |
| | | PrintWriter out) {
|
| | |
|
| | | String bid = getHistorySearchBid(acceptData);
|
| | |
|
| | | // 加入搜索历史记录
|
| | | historySearchService.addHistorySearch(kw, bid);
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(kw) && (kw.startsWith("http://") || kw.startsWith("https://"))) {
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("result", new JSONArray());
|
| | | data.put("count", 0);
|
| | | data.put("nav", new JSONArray());
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | if (goodsType == null || goodsType < 1 || goodsType >3) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "请传递正确平台参数"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(fastFilter)) {
|
| | | if (!StringUtil.isNullOrEmpty(filter)) {
|
| | | JSONArray filterArray = JSONArray.fromObject(filter);
|
| | | JSONArray fastFilterArray = JSONArray.fromObject(fastFilter);
|
| | | filterArray.addAll(fastFilterArray);
|
| | | filter = filterArray.toString();
|
| | | } else {
|
| | | filter = fastFilter;
|
| | | }
|
| | | }
|
| | |
|
| | | // 默认淘宝
|
| | | if (goodsType == null) {
|
| | | goodsType = Constant.SOURCE_TYPE_TAOBAO;
|
| | | }
|
| | |
|
| | | // 京东商品
|
| | | if (goodsType.intValue() == Constant.SOURCE_TYPE_JD) {
|
| | | searchJDGoods(kw, page, filter, order, startprice, endprice, out);
|
| | | if (page == null || page < 1) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "页码不能小于1"));
|
| | | return;
|
| | | }
|
| | |
|
| | | // 拼多多商品 TODO
|
| | | if (goodsType.intValue() == Constant.SOURCE_TYPE_PDD) {
|
| | | searchPDDGoods(kw, page, filter, order, startprice, endprice, out);
|
| | | if (StringUtil.isNullOrEmpty(key)) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "请输入搜索内容"));
|
| | | return;
|
| | | }
|
| | | final String searchkey = key.trim();
|
| | |
|
| | | // 是否是推荐
|
| | | boolean recommend = false;
|
| | | if (!StringUtil.isNullOrEmpty(fastFilter)) {
|
| | | // 查询淘宝天猫
|
| | | JSONArray array = JSONArray.fromObject(filter);
|
| | | for (int i = 0; i < array.size(); i++) {
|
| | | String ty = array.optJSONObject(i).optString("type");
|
| | |
|
| | | if ("recommend".equalsIgnoreCase(ty)) {
|
| | | recommend = true;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | JSONObject data = null;
|
| | | if (!recommend) {
|
| | | // 淘宝接口请求
|
| | | data = searchTaoBaoGoods(kw, page, filter, order, startprice, endprice);
|
| | | } else {
|
| | | // 推荐:大淘客
|
| | | data = searchDaTaoKeGoods(kw, page, filter, order, startprice, endprice);
|
| | | }
|
| | |
|
| | | // 获取推荐词
|
| | | List<String> listRecommendWords = new ArrayList<String>();
|
| | | // 综合 查询第一页时获取候选词
|
| | | if (page == 1) {
|
| | | listRecommendWords = TaoBaoUtil.getSuguestSearch(kw);
|
| | | if (listRecommendWords == null || listRecommendWords.size() == 0) {
|
| | | listRecommendWords = new ArrayList<String>();
|
| | | }
|
| | |
|
| | | List<TaoBaoShopVO> listShop = taoBaoShopService.getShopByKey(kw);
|
| | | if (listShop != null && listShop.size() > 0 && listShop.get(0).getListGoods() != null
|
| | | && listShop.get(0).getListGoods().size() > 2) {
|
| | | data.put("shop", JsonUtil.getApiCommonGson().toJson(listShop.get(0)));
|
| | | }
|
| | | }
|
| | |
|
| | | Gson gson = new GsonBuilder().create();
|
| | | if (data != null)
|
| | | data.put("words", gson.toJson(listRecommendWords));
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | private String getHistorySearchBid(AcceptData acceptData) {
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | StringBuffer sb = new StringBuffer();
|
| | | String link = "#$$$#";
|
| | | String platform = acceptData.getPlatform();
|
| | | String packages = acceptData.getPackages();
|
| | | String device = acceptData.getDevice();
|
| | | sb.append(platform).append(link).append(packages).append(link).append(device);
|
| | | return StringUtil.Md5(sb.toString());
|
| | | String bid = StringUtil.Md5(sb.toString());
|
| | | |
| | | // 加入搜索历史记录
|
| | | historySearchService.addHistorySearch(searchkey, bid);
|
| | | }
|
| | | });
|
| | | |
| | |
|
| | | if (searchkey.startsWith("http://") || searchkey.startsWith("https://")) {
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("result", new JSONArray());
|
| | | data.put("count", 0);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | return;
|
| | | }
|
| | |
|
| | | /*--------- 京东商品 -------*/ |
| | | if (goodsType.intValue() == Constant.SOURCE_TYPE_JD) {
|
| | | searchJDGoods(searchkey, page, filter, order, out);
|
| | | return;
|
| | | }
|
| | |
|
| | | /*-------- 拼多多商品 -------*/ |
| | | if (goodsType.intValue() == Constant.SOURCE_TYPE_PDD) {
|
| | | searchPDDGoods(searchkey, page, filter, order, out);
|
| | | return;
|
| | | }
|
| | |
|
| | | /*-------- 淘宝商品 -------*/ |
| | | searchTaoBaoGoods(searchkey, page, filter, order, out);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | * @param endprice
|
| | | * @return
|
| | | */
|
| | | private JSONObject searchTaoBaoGoods(String kw, int page, String filter, String order, String startprice,
|
| | | String endprice) {
|
| | | private void searchTaoBaoGoods(String key, Integer page, String filter, Integer order, PrintWriter out) {
|
| | | SearchFilter sf = new SearchFilter();
|
| | | sf.setKey(SearchFilterUtil.filterSearchContent(kw));
|
| | | sf.setKey(SearchFilterUtil.filterSearchContent(key));
|
| | | sf.setPage(page);
|
| | | sf.setSort(0);
|
| | | sf.setPageSize(Constant.PAGE_SIZE);
|
| | |
|
| | | if (!com.yeshi.fanli.util.StringUtil.isNullOrEmpty(startprice)) {
|
| | | sf.setStartPrice(new BigDecimal(startprice));
|
| | | }
|
| | |
|
| | | if (!com.yeshi.fanli.util.StringUtil.isNullOrEmpty(endprice)) {
|
| | | sf.setEndPrice(new BigDecimal(endprice));
|
| | | }
|
| | |
|
| | | if (!com.yeshi.fanli.util.StringUtil.isNullOrEmpty(order)) {
|
| | | if (Integer.parseInt(order) == 1) {
|
| | | if (order != null) {
|
| | | if (order == 1) { // 销量高到低
|
| | | sf.setSort(TaoBaoUtil.SORT_SALE_HIGH_TO_LOW);
|
| | | } else if (Integer.parseInt(order) == 2) {
|
| | | } else if (order == 2) { // 价格高到低
|
| | | sf.setSort(TaoBaoUtil.SORT_PRICE_HIGH_TO_LOW);
|
| | | } else if (Integer.parseInt(order) == 3) {
|
| | | } else if (order == 3) { // 价格低到高
|
| | | sf.setSort(TaoBaoUtil.SORT_PRICE_LOW_TO_HIGH);
|
| | | } else if (Integer.parseInt(order) == 4) {
|
| | | sf.setSort(TaoBaoUtil.SORT_TOTAL_SALES_HIGH_TO_LOW);
|
| | | } else if (Integer.parseInt(order) == 5) {
|
| | | } else if (order == 4) { // 返利比高到低
|
| | | sf.setSort(TaoBaoUtil.SORT_TKRATE_HIGH_TO_LOW);
|
| | | } else if (Integer.parseInt(order) == 6) {
|
| | | sf.setSort(TaoBaoUtil.SORT_TKRATE_LOW_TO_HIGH);
|
| | | }
|
| | | } else {
|
| | | // 默认销量从高到低排序
|
| | | sf.setSort(TaoBaoUtil.SORT_SALE_HIGH_TO_LOW);
|
| | | }
|
| | |
|
| | | if (!com.yeshi.fanli.util.StringUtil.isNullOrEmpty(filter)) {
|
| | | // 查询淘宝天猫
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(filter)) {
|
| | | JSONArray array = JSONArray.fromObject(filter);
|
| | | Set<String> params = new HashSet<String>();
|
| | | for (int i = 0; i < array.size(); i++) {
|
| | | // [{"type":'shoptype',id:12}]
|
| | | String ty = array.optJSONObject(i).optString("type");
|
| | | if ("shoptype".equalsIgnoreCase(ty)) {
|
| | | if (array.optJSONObject(i).optInt("id") == 21) {
|
| | | sf.setTmFlagship(false); // 不筛�?
|
| | | } else {
|
| | | sf.setTmFlagship(true);
|
| | | sf.setTmall(true);
|
| | | sf.setShopTag("b2c");
|
| | | }
|
| | | } else if ("category".equalsIgnoreCase(ty)) {
|
| | | sf.setCateIds(array.optJSONObject(i).optString("id"));
|
| | | } else if ("userType".equalsIgnoreCase(ty)) {
|
| | | // if(array.optJSONObject(i).optInt("id") == 51)
|
| | | sf.setTmall(true);
|
| | | // else
|
| | | // sf.setTmall(false);
|
| | | } else if ("baoyou".equalsIgnoreCase(ty)) {
|
| | | // if(array.optJSONObject(i).optInt("id") == 61)
|
| | | sf.setBaoYou(true);
|
| | | // else
|
| | | // sf.setBaoYou(false);
|
| | | } else if ("quantype".equalsIgnoreCase(ty)) {
|
| | | // if (array.optJSONObject(i).optInt("id") == 31){
|
| | | if ("coupon".equalsIgnoreCase(ty)) { // 有券
|
| | | sf.setQuan(1);
|
| | | if (sf.isTmFlagship()) {
|
| | | sf.setShopTag(sf.getShopTag() + ",dpyhq");
|
| | | } else {
|
| | | sf.setShopTag("dpyhq");
|
| | | }
|
| | | // }
|
| | | // else
|
| | | // sf.setQuan(2);
|
| | | } else if ("hongbaotype".equalsIgnoreCase(ty)) {
|
| | | if (array.optJSONObject(i).optInt("id") == 41)// 有红�?
|
| | | sf.setHongbao(1);
|
| | | else// 无红�?
|
| | | sf.setHongbao(2);
|
| | | } else if ("property".equalsIgnoreCase(ty)) {
|
| | | String pid = (String) array.optJSONObject(i).opt("pid");
|
| | | String id = (String) array.optJSONObject(i).opt("id");
|
| | | boolean flag = false;
|
| | | String str = null;
|
| | | for (String string : params) {
|
| | | flag = string.contains(pid + ":");
|
| | | if (flag) {
|
| | | str = string;
|
| | | break;
|
| | | } else if ("tmall".equalsIgnoreCase(ty)) { // 天猫
|
| | | sf.setTmall(true);
|
| | | }
|
| | | }
|
| | | if (flag) {
|
| | | params.add(str + "," + id);
|
| | | params.remove(str);
|
| | | } else {
|
| | | params.add(pid + ":" + id);
|
| | | }
|
| | | } else if ("fahuodi".equalsIgnoreCase(ty)) {
|
| | | int id = array.optJSONObject(i).optInt("id");
|
| | | sf.setProvinceId(id);
|
| | | } else if ("materialId".equalsIgnoreCase(ty)) {
|
| | | int id = array.optJSONObject(i).optInt("id");
|
| | | sf.setProvinceId(id);
|
| | | } else if ("tkRate1".equalsIgnoreCase(ty)) {
|
| | | setSearchTkRate(0, sf);
|
| | | } else if ("tkRate2".equalsIgnoreCase(ty)) {
|
| | | setSearchTkRate(1, sf);
|
| | | } else if ("tkRate3".equalsIgnoreCase(ty)) {
|
| | | setSearchTkRate(2, sf);
|
| | | } else if ("tkRate4".equalsIgnoreCase(ty)) {
|
| | | setSearchTkRate(3, sf);
|
| | | } else if ("tkRate5".equalsIgnoreCase(ty)) {
|
| | | setSearchTkRate(4, sf);
|
| | | }
|
| | | }
|
| | | 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 (page == 1) {
|
| | | daTaoKeList = daTaoKeGoodsDetailService.listByDtitle(key);
|
| | | }
|
| | | |
| | | // 淘宝api搜索商品
|
| | | TaoBaoSearchResult result = TaoBaoUtil.search(sf);
|
| | | |
| | | // 搜索是否在营销主商品库
|
| | | 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()));
|
| | |
|
| | | ThreadUtil.run(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | |
| | | taoBaoGoodsCacheUtil.saveCommonTaoBaoGoodsInfo(goods);
|
| | | }
|
| | | });
|
| | | // } catch (Exception e) {
|
| | | // e.printStackTrace();
|
| | | // }
|
| | |
|
| | | }
|
| | |
|
| | | List<TaoBaoSearchNav> navList = TaoBaoUtil.getBaseNav();
|
| | | if (result.getNavList() != null)
|
| | | navList.addAll(result.getNavList());
|
| | | Gson gson = new GsonBuilder().create();
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("nav", gson.toJson(navList));
|
| | | List<GoodsDetailVO> list = new ArrayList<GoodsDetailVO>();
|
| | | List<TaoBaoGoodsBrief> taoBaoGoodsBriefs = result.getTaoBaoGoodsBriefs();
|
| | | if (taoBaoGoodsBriefs == null)
|
| | | List<TaoBaoGoodsBrief> taoBaoGoodsBriefs = null;
|
| | | if (result != null) {
|
| | | taoBaoGoodsBriefs = result.getTaoBaoGoodsBriefs();
|
| | | }
|
| | | if (taoBaoGoodsBriefs == null) {
|
| | | taoBaoGoodsBriefs = new ArrayList<>();
|
| | | }
|
| | |
|
| | | try {
|
| | | if (daTaoKeList != null && daTaoKeList.size() > 0) {
|
| | | try {
|
| | | 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();
|
| | | List<GoodsDetailVO> list = new ArrayList<GoodsDetailVO>();
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | |
|
| | | if (fq == 0 && fh == 0 && !ft) {
|
| | | if (result != null && taoBaoGoodsBriefs != null)
|
| | | for (TaoBaoGoodsBrief bf : taoBaoGoodsBriefs) {
|
| | | list.add(GoodsDetailVOFactory.convertTaoBao(bf, null, fanLiRate, shareRate));
|
| | | }
|
| | | } else {
|
| | | if (taoBaoGoodsBriefs != null)
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : taoBaoGoodsBriefs) {
|
| | | list.add(GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate));
|
| | | }
|
| | | for (TaoBaoGoodsBrief goods : taoBaoGoodsBriefs) {
|
| | | list.add(GoodsDetailVOFactory.convertTaoBao(goods, null, fanLiRate, shareRate));
|
| | | }
|
| | |
|
| | | Gson gson2 = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().create();
|
| | |
|
| | | data.put("result", gson2.toJson(list));
|
| | | data.put("count", result.getTaoBaoHead().getDocsfound());
|
| | | return data;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 大淘客商品
|
| | | * |
| | | * @param key
|
| | | * @param page
|
| | | * @param filter
|
| | | * @param order
|
| | | * @param startprice
|
| | | * @param endprice
|
| | | * @return
|
| | | */
|
| | | private JSONObject searchDaTaoKeGoods(String key, int page, String filter, String order, String startprice,
|
| | | String endprice) {
|
| | | int sort = DaTaoKeApiUtil.SORT_DEFAULT;
|
| | | if ("5".equalsIgnoreCase(order)) {
|
| | | sort = DaTaoKeApiUtil.SORT_COMMISSION;
|
| | | } else if ("1".equalsIgnoreCase(order)) {
|
| | | sort = DaTaoKeApiUtil.SORT_SALES;
|
| | | } else if ("2".equalsIgnoreCase(order)) {
|
| | | sort = DaTaoKeApiUtil.SORT_PRICE_HIGH_TO_LOW;
|
| | | } else if ("3".equalsIgnoreCase(order)) {
|
| | | sort = DaTaoKeApiUtil.SORT_PRICE_LOW_TO_HIGH;
|
| | | }
|
| | |
|
| | | List<GoodsDetailVO> listVO = new ArrayList<GoodsDetailVO>();
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | |
|
| | | DaTaoKeGoodsResult result = DaTaoKeApiUtil.search(key, null, null, null, page, 20, sort);
|
| | | if (result != null && result.getGoodsList() != null)
|
| | | for (DaTaoKeDetailV2 goods : result.getGoodsList()) {
|
| | | listVO.add(GoodsDetailVOFactory.convertTaoBao(TaoBaoUtil.convert(goods), null, fanLiRate, shareRate));
|
| | | }
|
| | |
|
| | | List<TaoBaoSearchNav> navList = new ArrayList<>();
|
| | | Gson gson = new GsonBuilder().create();
|
| | | Gson gson2 = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().create();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("nav", gson.toJson(navList));
|
| | | data.put("result", gson2.toJson(listVO));
|
| | | data.put("count", result.getTotalCount());
|
| | | data.put("result", gson.toJson(list));
|
| | | data.put("count", result.getTaoBaoHead().getDocsfound());
|
| | |
|
| | | return data;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 设置查询佣金比例范围
|
| | | * |
| | | * @param i
|
| | | * @param sf
|
| | | */
|
| | | public void setSearchTkRate(int i, SearchFilter sf) {
|
| | | // 获取对应参数
|
| | | String value = configService.get("tkRate_range");
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(value)) {
|
| | |
|
| | | JSONArray tkRatearray = JSONArray.fromObject(value);
|
| | |
|
| | | if (tkRatearray != null) {
|
| | |
|
| | | String start = tkRatearray.optJSONObject(i).optString("start");
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(start)) {
|
| | | int tkRate = (int) (Float.parseFloat(start) * 100);
|
| | | sf.setStartTkRate(tkRate);
|
| | | }
|
| | |
|
| | | String end = tkRatearray.optJSONObject(i).optString("end");
|
| | | if (!StringUtil.isNullOrEmpty(end)) {
|
| | | int tkRate = (int) (Float.parseFloat(end) * 100);
|
| | | sf.setEndTkRate(tkRate);
|
| | | if (page == 1) {
|
| | | // 第一页返回店铺信息
|
| | | List<TaoBaoShopVO> listShop = taoBaoShopService.getShopByKey(key);
|
| | | if (listShop != null && listShop.size() > 0 && listShop.get(0).getListGoods() != null
|
| | | && listShop.get(0).getListGoods().size() > 2) {
|
| | | data.put("shop", JsonUtil.getApiCommonGson().toJson(listShop.get(0)));
|
| | | }
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 京东
|
| | |
| | | * @param endprice
|
| | | * @return
|
| | | */
|
| | | private void searchJDGoods(String kw, int page, String filter, String order, String startprice, String endprice,
|
| | | PrintWriter out) {
|
| | | private void searchJDGoods(String key, Integer page, String filter, Integer order, PrintWriter out) {
|
| | | JDSearchFilter jdfilter = new JDSearchFilter();
|
| | | jdfilter.setKey(SearchFilterUtil.filterSearchContent(kw));
|
| | | jdfilter.setKey(SearchFilterUtil.filterSearchContent(key));
|
| | | jdfilter.setPageNo(page);
|
| | | jdfilter.setPageSize(Constant.PAGE_SIZE);
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(startprice)) {
|
| | | jdfilter.setFromPrice(Integer.parseInt(startprice));
|
| | | }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(endprice)) {
|
| | | jdfilter.setToPrice(Integer.parseInt(endprice));
|
| | | }
|
| | |
|
| | | int sort = 1;
|
| | | if (!StringUtil.isNullOrEmpty(order)) {
|
| | | sort = Integer.parseInt(order);
|
| | | }
|
| | |
|
| | | if (order != null) {
|
| | | int sort = order.intValue();
|
| | | switch (sort) {
|
| | | case 1: // 销量 desc
|
| | | jdfilter.setSort(JDSearchFilter.SORT_DESC);
|
| | |
| | | jdfilter.setSort(JDSearchFilter.SORT_ASC);
|
| | | jdfilter.setSortName(JDSearchFilter.SORTNAME_PRICE);
|
| | | break;
|
| | | case 5: // 返利比—DESC
|
| | | case 4: // 返利比—DESC
|
| | | jdfilter.setSort(JDSearchFilter.SORT_DESC);
|
| | | jdfilter.setSortName(JDSearchFilter.SORTNAME_COMMISSION_SHARE);
|
| | | break;
|
| | | default: // 默认:销量 desc
|
| | | // jdfilter.setSort(JDSearchFilter.SORT_DESC);
|
| | | // jdfilter.setSortName(JDSearchFilter.SORTNAME_ORDER_COUNT_30DAYS);
|
| | | default:
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | if (!com.yeshi.fanli.util.StringUtil.isNullOrEmpty(filter)) {
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(filter)) {
|
| | | JSONArray array = JSONArray.fromObject(filter);
|
| | | for (int i = 0; i < array.size(); i++) {
|
| | | String ty = array.optJSONObject(i).optString("type");
|
| | | if ("quantype".equalsIgnoreCase(ty)) {
|
| | | if ("coupon".equalsIgnoreCase(ty)) {
|
| | | jdfilter.setHasCoupon(1); // 有券
|
| | | } else if ("zy".equalsIgnoreCase(ty)) {
|
| | | jdfilter.setIsZY(1); // 是否自营
|
| | | } else if ("delivery".equalsIgnoreCase(ty)) {
|
| | | jdfilter.setDeliveryType(1); // 是否京东配送
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | * @param endprice
|
| | | * @return
|
| | | */
|
| | | private void searchPDDGoods(String kw, int page, String filter, String order, String startprice, String endprice,
|
| | | PrintWriter out) {
|
| | | private void searchPDDGoods(String key, Integer page, String filter, Integer order, PrintWriter out) {
|
| | | PDDSearchFilter pddfilter = new PDDSearchFilter();
|
| | | pddfilter.setKw(SearchFilterUtil.filterSearchContent(kw));
|
| | | pddfilter.setKw(SearchFilterUtil.filterSearchContent(key));
|
| | | pddfilter.setPage(page);
|
| | | pddfilter.setPageSize(Constant.PAGE_SIZE);
|
| | |
|
| | | int sort = 1;
|
| | | if (!StringUtil.isNullOrEmpty(order)) {
|
| | | sort = Integer.parseInt(order);
|
| | | }
|
| | |
|
| | | if (order != null) {
|
| | | int sort = order.intValue();
|
| | | switch (sort) {
|
| | | case 1: // 销量 desc
|
| | | pddfilter.setSortType(6);
|
| | |
| | | case 3: // 价格—asc
|
| | | pddfilter.setSortType(3);
|
| | | break;
|
| | | case 5: // 返利比—asc
|
| | | case 4: // 返利比—desc
|
| | | pddfilter.setSortType(2);
|
| | | break;
|
| | | case 6: // 返利比—asc
|
| | | pddfilter.setSortType(1);
|
| | | break;
|
| | | case 20: // 综合排序
|
| | | default: // 综合排序
|
| | | pddfilter.setSortType(0);
|
| | | break;
|
| | | default: // 默认:销量 desc
|
| | | // pddfilter.setSortType(6);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | if (!com.yeshi.fanli.util.StringUtil.isNullOrEmpty(filter)) {
|
| | | if (!StringUtil.isNullOrEmpty(filter)) {
|
| | | JSONArray array = JSONArray.fromObject(filter);
|
| | | for (int i = 0; i < array.size(); i++) {
|
| | | String ty = array.optJSONObject(i).optString("type");
|
| | | if ("quantype".equalsIgnoreCase(ty)) {
|
| | | if ("coupon".equalsIgnoreCase(ty)) {
|
| | | pddfilter.setHasCoupon(true); // 有券
|
| | | } else if ("brand".equalsIgnoreCase(ty)) {
|
| | | pddfilter.setIsBrand(true); // 是否是品牌
|
| | |
| | |
|
| | | shareInfo.setShareText(shareText);
|
| | |
|
| | | // String descText = shareText.replace(taoBaoLink.getGoods().getTitle(), "").trim();
|
| | | // if (descText.startsWith("\\r\\n"))
|
| | | // descText = descText.substring(0);
|
| | | // data.put("descText", descText);
|
| | | String descText = shareText.replace(taoBaoLink.getGoods().getTitle(), "").trim();
|
| | | if (descText.startsWith("\\r\\n")) {
|
| | | descText = descText.substring(0);
|
| | | }
|
| | | shareInfo.setDescText(descText);
|
| | |
|
| | |
|
| | | // 提示图文内容
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("spreadMoney", " ¥" + spreadMoney.toString());
|
| | | ShareInfoVO shareInfo = new ShareInfoVO();
|
| | | shareInfo.setSpreadMoney(" ¥" + spreadMoney.toString());
|
| | |
|
| | | String taoLiJinLink = null;
|
| | | Long tljId = null;
|
| | |
| | | UserTaoLiJinRecord record = userTaoLiJinRecordService.createShareTaoLiJin(uid, totalNum, goods);
|
| | | tljId = record.getId();
|
| | | taoLiJinLink = record.getSendUrl();
|
| | | data.put("tljId", tljId);
|
| | | data.put("surplusMoney", record.getSurplusMoney());
|
| | | shareInfo.setTljId(tljId.toString());
|
| | | shareInfo.setSurplusMoney(record.getSurplusMoney().toString());
|
| | | } catch (UserTaoLiJinRecordException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|
| | | return;
|
| | |
| | | if (!StringUtil.isNullOrEmpty(shortLink)) {
|
| | | url = shortLink;
|
| | | }
|
| | | data.put("clickUrl", url);
|
| | | shareInfo.setClickUrl(url);
|
| | |
|
| | | // 创建淘口令
|
| | | if (!StringUtil.isNullOrEmpty(taoLiJinLink)) {// 通过立即推广方式获取淘口令成功
|
| | |
| | | taoBaoLink.setTaoToken(quanToken);
|
| | | }
|
| | | }
|
| | | data.put("token", taoBaoLink.getTaoToken());
|
| | |
|
| | | data.put("rule",
|
| | | "http://apph5.yeshitv.com/apppage/all_help_content.html?id=148&from=singlemessage&isappinstalled=0");
|
| | | data.put("pictUrl", TbImgUtil.getTBSizeImg(taoBaoLink.getGoods().getPictUrl(), 500));
|
| | | shareInfo.setToken(taoBaoLink.getTaoToken());
|
| | | shareInfo.setRule(configService.get("share_single_goods_rule"));
|
| | | shareInfo.setPictUrl(TbImgUtil.getTBSizeImg(taoBaoLink.getGoods().getPictUrl(), 500));
|
| | |
|
| | | // 无券
|
| | | String shopType = taoBaoLink.getGoods().getUserType() == 0 ? "淘宝价" : "天猫价";
|
| | |
| | | shareText = shareText.replace("{店铺类型}", shopType)
|
| | | .replace("{月销量}", TaoBaoUtil.getSaleCount(taoBaoLink.getGoods().getBiz30day()))
|
| | | .replace("{领券短链}", shortLink).replace("{淘口令}", taoBaoLink.getTaoToken());
|
| | | data.put("shareText", shareText);
|
| | | shareInfo.setShareText(shareText);
|
| | | |
| | | |
| | | String descText = shareText.replace(taoBaoLink.getGoods().getTitle(), "").trim();
|
| | | if (descText.startsWith("\\r\\n"))
|
| | | descText = descText.substring(0);
|
| | | data.put("descText", descText);
|
| | | |
| | | shareInfo.setDescText(descText);
|
| | |
|
| | | String imgs = configService.get("goods_share_notify_imgs");
|
| | | JSONArray array = JSONArray.fromObject(imgs);
|
| | | int p = (int) (array.size() * Math.random());
|
| | | if (p < array.size())
|
| | | data.put("notifyPicture", array.optString(p));
|
| | | data.put("notifyDesc", configService.get("goods_share_notify"));
|
| | | if (p < array.size()) {
|
| | | shareInfo.setNotifyPicture(array.optString(p));
|
| | | }
|
| | | shareInfo.setNotifyDesc(configService.get("goods_share_notify"));
|
| | |
|
| | | // 添加分享记录
|
| | | BigDecimal rate = hongBaoManageService.getShareRate();
|
| | | BigDecimal shareMoney = TaoBaoUtil.getShareGoodsHongBaoInfo(taoBaoLink.getGoods(), rate);
|
| | |
|
| | | data.put("shareMoney", "¥" + shareMoney.toString());
|
| | | shareInfo.setShareMoney("¥" + shareMoney.toString());
|
| | | try {
|
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, auctionId,
|
| | | Constant.SOURCE_TYPE_TAOBAO);
|
| | | data.put("shareId", shareRecord.getRedisKey());
|
| | | shareInfo.setShareId(shareRecord.getRedisKey());
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | |
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | out.print(JsonUtil.loadTrueResult(JsonUtil.getSimpleGson().toJson(shareInfo)));
|
| | |
|
| | | final TaoBaoLink taobaoLink = taoBaoLink;
|
| | | // 异步操作
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | // TODO
|
| | | ShareInfoVO shareInfo = new ShareInfoVO();
|
| | | String url = String.format("http://%s%s?uid=%s&id=%s&appType=flq&goodsType=%s", configService.getH5Host(),
|
| | | Constant.systemCommonConfig.getShareGoodsPagePath(), AESUtil.encrypt(uid + "", Constant.UIDAESKEY),
|
| | | goodsId + "", Constant.SOURCE_TYPE_JD);
|
| | |
| | | url = shortLink;
|
| | | }
|
| | |
|
| | | data.put("clickUrl", url);
|
| | | data.put("rule", configService.get("share_rule_link_jd"));
|
| | | data.put("pictUrl", jdGoods.getPicUrl());
|
| | | shareInfo.setClickUrl(url);
|
| | | shareInfo.setRule(configService.get("share_rule_link_jd"));
|
| | | shareInfo.setPictUrl(jdGoods.getPicUrl());
|
| | | |
| | |
|
| | | String shareText = "";
|
| | |
|
| | | String shopType = "京东价";
|
| | |
|
| | | // 分享模板
|
| | |
| | | shareText = shareText.replace("{店铺类型}", shopType)
|
| | | .replace("{月销量}", JDUtil.getSaleCount(jdGoods.getInOrderCount30Days())).replace("{领券短链}", shortLink)
|
| | | .replace("{淘口令}", null);
|
| | | data.put("shareText", shareText);
|
| | | shareInfo.setShareText(shareText);
|
| | |
|
| | | String descText = shareText.replace(jdGoods.getSkuName(), "").trim();
|
| | | if (descText.startsWith("\\r\\n"))
|
| | | if (descText.startsWith("\\r\\n")) {
|
| | | descText = descText.substring(0);
|
| | | data.put("descText", descText);
|
| | | }
|
| | | shareInfo.setDescText(descText);
|
| | | |
| | | //
|
| | | String imgs = configService.get("goods_share_notify_imgs");
|
| | | JSONArray array = JSONArray.fromObject(imgs);
|
| | | int p = (int) (array.size() * Math.random());
|
| | | if (p < array.size())
|
| | | data.put("notifyPicture", array.optString(p));
|
| | | data.put("notifyDesc", configService.get("goods_share_notify_jd"));
|
| | | if (p < array.size()) {
|
| | | shareInfo.setNotifyPicture(array.optString(p));
|
| | | }
|
| | | shareInfo.setNotifyDesc(configService.get("goods_share_notify_jd"));
|
| | | |
| | |
|
| | | // 添加分享记录
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | BigDecimal shareMoney = JDUtil.getGoodsFanLiMoney(jdGoods, shareRate);
|
| | |
|
| | | data.put("shareMoney", "¥" + shareMoney.toString());
|
| | | shareInfo.setShareMoney("¥" + shareMoney.toString());
|
| | | try {
|
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, goodsId,
|
| | | Constant.SOURCE_TYPE_JD);
|
| | | data.put("shareId", shareRecord.getRedisKey());
|
| | | shareInfo.setShareId(shareRecord.getRedisKey());
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | |
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | out.print(JsonUtil.loadTrueResult(JsonUtil.getSimpleGson().toJson(shareInfo)));
|
| | |
|
| | | // 异步操作
|
| | | final JDGoods goods = jdGoods;
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | ShareInfoVO shareInfo = new ShareInfoVO();
|
| | | |
| | | // TODO
|
| | | String url = String.format("http://%s%s?uid=%s&id=%s&appType=flq&goodsType=%s", configService.getH5Host(),
|
| | | Constant.systemCommonConfig.getShareGoodsPagePath(), AESUtil.encrypt(uid + "", Constant.UIDAESKEY),
|
| | | goodsId + "", Constant.SOURCE_TYPE_PDD);
|
| | |
| | | url = shortLink;
|
| | | }
|
| | |
|
| | | data.put("clickUrl", url);
|
| | | // 帮助中心-介绍
|
| | | data.put("rule", configService.get("share_rule_link_pdd"));
|
| | | data.put("pictUrl", goods.getGoodsImageUrl());
|
| | | shareInfo.setClickUrl(url);
|
| | | shareInfo.setRule(configService.get("share_rule_link_pdd"));
|
| | | shareInfo.setPictUrl(goods.getGoodsImageUrl());
|
| | |
|
| | | String shareText = "";
|
| | |
|
| | | String shopType = "拼多多价";
|
| | |
|
| | | // 无券
|
| | |
| | | shareText = shareText.replace("{店铺类型}", shopType)
|
| | | .replace("{月销量}", PinDuoDuoUtil.getSaleCount(goods.getSoldQuantity())).replace("{领券短链}", shortLink)
|
| | | .replace("{淘口令}", null);
|
| | | data.put("shareText", shareText);
|
| | | shareInfo.setShareText(shareText);
|
| | | |
| | | String descText = shareText.replace(goods.getGoodsName(), "").trim();
|
| | | if (descText.startsWith("\\r\\n"))
|
| | | if (descText.startsWith("\\r\\n")) {
|
| | | descText = descText.substring(0);
|
| | | data.put("descText", descText);
|
| | | }
|
| | | shareInfo.setDescText(descText);
|
| | | |
| | | //
|
| | | String imgs = configService.get("goods_share_notify_imgs");
|
| | | JSONArray array = JSONArray.fromObject(imgs);
|
| | | int p = (int) (array.size() * Math.random());
|
| | | if (p < array.size())
|
| | | data.put("notifyPicture", array.optString(p));
|
| | | if (p < array.size()) {
|
| | | shareInfo.setNotifyPicture(array.optString(p));
|
| | | }
|
| | | shareInfo.setNotifyDesc(configService.get("goods_share_notify_pdd"));
|
| | |
|
| | | data.put("notifyDesc", configService.get("goods_share_notify_pdd"));
|
| | |
|
| | | // 添加分享记录
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | BigDecimal shareMoney = PinDuoDuoUtil.getGoodsFanLiMoney(goods, shareRate);
|
| | | shareInfo.setShareMoney("¥" + shareMoney.toString());
|
| | |
|
| | | data.put("shareMoney", "¥" + shareMoney.toString());
|
| | | try {
|
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, goodsId,
|
| | | Constant.SOURCE_TYPE_JD);
|
| | | data.put("shareId", shareRecord.getRedisKey());
|
| | | shareInfo.setShareId(shareRecord.getRedisKey());
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | |
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | out.print(JsonUtil.loadTrueResult(JsonUtil.getSimpleGson().toJson(shareInfo)));
|
| | |
|
| | | // 异步操作
|
| | | com.yeshi.fanli.util.ThreadUtil.run(new Runnable() {
|
| | |
| | | List<CommonOrderVO> listQuery(@Param("start") long start, @Param("count") int count, |
| | | @Param("keyType") Integer keyType, @Param("key") String key, @Param("state") Integer state, |
| | | @Param("type") Integer type, @Param("orderState") Integer orderState, @Param("startTime") String startTime, |
| | | @Param("endTime") String endTime); |
| | | @Param("endTime") String endTime, @Param("source")Integer source); |
| | | |
| | | /** |
| | | * 统计 |
| | | */ |
| | | long countQuery(@Param("keyType") Integer keyType, @Param("key") String key, @Param("state") Integer state, |
| | | @Param("type") Integer type, @Param("orderState") Integer orderState, @Param("startTime") String startTime, |
| | | @Param("endTime") String endTime); |
| | | @Param("endTime") String endTime, @Param("source")Integer source); |
| | | |
| | | /** |
| | | * 根据来源类型与订单号查询列表 |
| | |
| | | * @return |
| | | */ |
| | | List<LostOrder> listQuery(@Param("start") long start, @Param("count") int count, @Param("key") String key, |
| | | @Param("state") Integer state, @Param("handleType") Integer handleType); |
| | | @Param("state") Integer state, @Param("handleType") Integer handleType, @Param("type") Integer type);
|
| | | |
| | | long countQuery(@Param("key") String key, @Param("state") Integer state, @Param("handleType") Integer handleType); |
| | | long countQuery(@Param("key") String key, @Param("state") Integer state, @Param("handleType") Integer handleType,
|
| | | @Param("type") Integer type);
|
| | | |
| | | /** |
| | | * 统计申诉订单数量 |
| | |
| | | * @param listCouponId |
| | | * @return |
| | | */ |
| | | List<UserSystemCouponRecord> getRecordByOrderNoList(@Param("list") List<String> list); |
| | | List<UserSystemCouponRecord> getRecordByOrderNoList( @Param("source")Integer source, @Param("list") List<String> list);
|
| | | |
| | | |
| | | /** |
| | |
| | | <if test="keyType == 1 ">AND co.co_order_no = ${key}</if> |
| | | <if test="keyType == 2 ">AND hb.hb_uid = ${key}</if> |
| | | </if> |
| | | <!-- 订单来源 --> |
| | | <if test="source != null">AND co.co_source_type = #{source}</if> |
| | | ORDER BY co.co_third_create_time DESC LIMIT ${start},${count} ) A LEFT |
| | | JOIN yeshi_ec_user u ON u.id = A.hb_uid |
| | | </select> |
| | |
| | | <if test="keyType == 1 ">AND co.co_order_no = ${key}</if> |
| | | <if test="keyType == 2 ">AND hb.hb_uid = ${key}</if> |
| | | </if> |
| | | <!-- 订单来源 --> |
| | | <if test="source != null">AND co.co_source_type = #{source}</if> |
| | | </select> |
| | | <select id="getCouponHongbaoByOrderNo" resultMap="ResultMap"> |
| | | SELECT COALESCE(SUM(IF(hb.hb_type=1,hb.`hb_money`,0)),0)AS totalMoney, |
| | |
| | | <if test="state != null">AND d.state = #{state}</if> |
| | | <if test="handleType != null and handleType == 0">AND d.state = 0</if> |
| | | <if test="handleType != null and handleType != 0">AND (d.state = 1 or d.state = 2)</if> |
| | | <if test="type != null">AND d.type = #{type}</if>
|
| | | ORDER BY d.createTime desc LIMIT ${start},${count} |
| | | </select> |
| | | <select id="countQuery" resultType="java.lang.Long"> |
| | |
| | | <if test="state != null">AND d.state = #{state}</if> |
| | | <if test="handleType != null and handleType == 0">AND d.state = 0</if> |
| | | <if test="handleType != null and handleType != 0">AND (d.state = 1 or d.state = 2)</if> |
| | | <if test="type != null">AND d.type = #{type}</if>
|
| | | </select> |
| | | <select id="countLostNum" resultType="java.util.HashMap"> |
| | | SELECT COUNT(t.`id`) AS showValue, |
| | |
| | | <select id="getRecordByOrderNoList" resultMap="BaseResultMap"> |
| | | SELECT * FROM `yeshi_ec_user_system_coupon_record` cd |
| | | LEFT JOIN `yeshi_ec_user_system_coupon` uc ON uc.`usc_id` = cd.`ucr_user_coupon_id` |
| | | WHERE cd.`ucr_order_no` in |
| | | WHERE cd.ucr_good_source = #{source} AND cd.`ucr_order_no` in
|
| | | <foreach collection="list" item="item" open="(" close=")" |
| | | separator=",">#{item}</foreach> |
| | | </select> |
| | |
| | | payMent = commonOrder.getSettlement();
|
| | |
|
| | | if (payMent.compareTo(new BigDecimal(10)) < 0) {
|
| | | mianDan = userSystemCouponRecordService.isSuccessMianDan(commonOrder.getOrderNo());
|
| | | mianDan = userSystemCouponRecordService.isSuccessMianDan(commonOrder.getSourceType(),commonOrder.getOrderNo());
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | public void listDataFactory(AcceptData acceptData, List<CommonOrderVO> listOrder, List<CommonOrderVO> listGoods, Long uid) {
|
| | |
|
| | | List<String> listNo = new ArrayList<String>();
|
| | | List<String> listTB = new ArrayList<String>();
|
| | | List<String> listJD = new ArrayList<String>();
|
| | | List<String> listPDD = new ArrayList<String>();
|
| | | for (CommonOrderVO commonOrderVO : listOrder) {
|
| | | listNo.add(commonOrderVO.getOrderNo());
|
| | | Integer sourceType = commonOrderVO.getSourceType();
|
| | | if (sourceType == null) {
|
| | | continue;
|
| | | } else if (sourceType == Constant.SOURCE_TYPE_TAOBAO) {
|
| | | listTB.add(commonOrderVO.getOrderNo());
|
| | | } else if (sourceType == Constant.SOURCE_TYPE_JD) {
|
| | | listJD.add(commonOrderVO.getOrderNo());
|
| | | } else if (sourceType == Constant.SOURCE_TYPE_PDD) {
|
| | | listPDD.add(commonOrderVO.getOrderNo());
|
| | | }
|
| | | }
|
| | |
|
| | | // 已经使用券订单
|
| | | List<UserSystemCouponRecord> couponRecordList = userSystemCouponRecordService.getRecordByOrderNoList(listNo);
|
| | | List<UserSystemCouponRecord> listRecordTB = null;
|
| | | if (listTB.size() > 0) {
|
| | | listRecordTB = userSystemCouponRecordService.getRecordByOrderNoList(Constant.SOURCE_TYPE_TAOBAO, listTB);
|
| | | }
|
| | | |
| | | List<UserSystemCouponRecord> listRecordJD = null;
|
| | | if (listJD.size() > 0) {
|
| | | listRecordJD = userSystemCouponRecordService.getRecordByOrderNoList(Constant.SOURCE_TYPE_JD, listJD);
|
| | | }
|
| | | |
| | | List<UserSystemCouponRecord> listRecordPDD = null;
|
| | | if (listPDD.size() > 0) {
|
| | | listRecordPDD = userSystemCouponRecordService.getRecordByOrderNoList(Constant.SOURCE_TYPE_PDD, listPDD);
|
| | | }
|
| | |
|
| | | /* 组合商品信息 */
|
| | | for (CommonOrderVO commonOrder : listGoods) {
|
| | |
|
| | | CommonOrderGoods goods = commonOrder.getCommonOrderGoods();
|
| | | if (goods == null) {
|
| | | continue;
|
| | |
| | |
|
| | | String orderNo1 = commonOrder.getOrderNo();
|
| | | Integer sourceType = commonOrder.getSourceType();
|
| | |
|
| | | for (CommonOrderVO order : listOrder) {
|
| | | String orderNo2 = order.getOrderNo();
|
| | | Integer sourceType2 = order.getSourceType();
|
| | |
| | | } else if (CommonOrder.STATE_WQ == orderState) {
|
| | | orderStateContent = "已维权";
|
| | |
|
| | | Integer sourceType = order.getSourceType();
|
| | | if (sourceType != null && sourceType == Constant.SOURCE_TYPE_TAOBAO) {
|
| | | /* 订单维权 判断是否全部维权 */
|
| | | List<TaoBaoWeiQuanOrder> listWQ = taoBaoWeiQuanOrderMapper
|
| | | .selectListByOrderIdAndState(order.getOrderNo(), "维权成功");
|
| | |
| | | hongBaoState = HongBaoV2.STATE_BUFENSHIXIAO; // 部分失效
|
| | | } else {
|
| | | hongBaoState = HongBaoV2.STATE_SHIXIAO; // 全部失效
|
| | | }
|
| | | }
|
| | | }
|
| | | orderStateMap.put("content", orderStateContent);
|
| | |
| | |
|
| | | // 非自购的订单 不显示返利、免单详情
|
| | | if (HongBaoV2.TYPE_ZIGOU != hongBaoType) {
|
| | | // 订单标识
|
| | | order.setSignList(signList);
|
| | |
|
| | | } else {
|
| | | Integer sourceType = order.getSourceType();
|
| | | // 奖励订单、免单 使用记录
|
| | | if (sourceType == null) {
|
| | | setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType, null, signList);
|
| | | } else if (sourceType == Constant.SOURCE_TYPE_TAOBAO) {
|
| | | setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType, listRecordTB, signList);
|
| | | } else if (sourceType == Constant.SOURCE_TYPE_JD) {
|
| | | setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType, listRecordJD, signList);
|
| | | } else if (sourceType == Constant.SOURCE_TYPE_PDD) {
|
| | | setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType, listRecordPDD, signList);
|
| | | }
|
| | | }
|
| | | |
| | | // 邀请隐藏订单号
|
| | | if (HongBaoV2.TYPE_YAOQING == hongBaoType || HongBaoV2.TYPE_YIJI == hongBaoType
|
| | | || HongBaoV2.TYPE_ERJI == hongBaoType || HongBaoV2.TYPE_SHARE_YIJI == hongBaoType
|
| | | || HongBaoV2.TYPE_SHARE_ERJI == hongBaoType) {
|
| | | String orderNo = order.getOrderNo();
|
| | | orderNo = orderNo.substring(0, orderNo.length()-6);
|
| | | order.setOrderNo(orderNo + "******");
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 订单: 免单标识 奖励标识
|
| | | * @param order
|
| | | * @param hasRewardCoupon
|
| | | * @param hongBaoState
|
| | | * @param list
|
| | | * @param signList
|
| | | */
|
| | | public void setSystemCouponRecord(CommonOrderVO order, boolean hasRewardCoupon, Integer hongBaoState, Integer hongBaoType,
|
| | | List<UserSystemCouponRecord> list, List<String> signList) {
|
| | |
|
| | | // 是否免单商品
|
| | | boolean freeOrder = false;
|
| | | // 是否奖励成功
|
| | | boolean rewardSuccess = false;
|
| | |
|
| | | // 奖励订单、免单 使用记录
|
| | | if (couponRecordList != null && couponRecordList.size() > 0) {
|
| | |
|
| | | for (UserSystemCouponRecord couponRecord : couponRecordList) {
|
| | | if (list != null && list.size() > 0) {
|
| | | for (UserSystemCouponRecord couponRecord : list) {
|
| | | // 订单号匹配
|
| | | if (order.getOrderNo().equals(couponRecord.getOrderNo())) {
|
| | |
|
| | | String systemCouponType = couponRecord.getCouponType();
|
| | | Integer state = couponRecord.getState();
|
| | |
|
| | | String systemCouponType = couponRecord.getCouponType();
|
| | | // 奖励订单: 且成功
|
| | | if (CouponTypeEnum.rebatePercentCoupon.name().equals(systemCouponType)
|
| | | && UserSystemCouponRecord.STATE_SUCCESS == state) {
|
| | |
| | | rewardMap.put("jump", jump);
|
| | |
|
| | | order.setRewardDetail(rewardMap);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | @Override
|
| | | public List<CommonOrderVO> listQuery(long start, int count, Integer keyType, String key, Integer state,
|
| | | Integer type, Integer orderState, String startTime, String endTime) throws CommonOrderException {
|
| | | Integer type, Integer orderState, String startTime, String endTime, Integer source) throws CommonOrderException {
|
| | |
|
| | | List<CommonOrderVO> list = commonOrderMapper.listQuery(start, count, keyType, key, state, type, orderState,
|
| | | startTime, endTime);
|
| | | startTime, endTime, source);
|
| | |
|
| | | if (list == null) {
|
| | | list = new ArrayList<CommonOrderVO>();
|
| | |
| | | return list;
|
| | | }
|
| | |
|
| | | List<String> listNo = new ArrayList<String>();
|
| | | List<String> listTB = new ArrayList<String>();
|
| | | List<String> listJD = new ArrayList<String>();
|
| | | List<String> listPDD = new ArrayList<String>();
|
| | | for (CommonOrderVO commonOrderVO : list) {
|
| | | listNo.add(commonOrderVO.getOrderNo());
|
| | | Integer sourceType = commonOrderVO.getSourceType();
|
| | | if (sourceType == null) {
|
| | | continue;
|
| | | } else if (sourceType == Constant.SOURCE_TYPE_TAOBAO) {
|
| | | listTB.add(commonOrderVO.getOrderNo());
|
| | | } else if (sourceType == Constant.SOURCE_TYPE_JD) {
|
| | | listJD.add(commonOrderVO.getOrderNo());
|
| | | } else if (sourceType == Constant.SOURCE_TYPE_PDD) {
|
| | | listPDD.add(commonOrderVO.getOrderNo());
|
| | | }
|
| | | // 已经使用券订单
|
| | | List<UserSystemCouponRecord> couponRecordList = userSystemCouponRecordService.getRecordByOrderNoList(listNo);
|
| | | }
|
| | |
|
| | | List<UserSystemCouponRecord> listRecordTB = null;
|
| | | if (listTB.size() > 0) {
|
| | | listRecordTB = userSystemCouponRecordService.getRecordByOrderNoList(Constant.SOURCE_TYPE_TAOBAO, listTB);
|
| | | }
|
| | | |
| | | List<UserSystemCouponRecord> listRecordJD = null;
|
| | | if (listJD.size() > 0) {
|
| | | listRecordJD = userSystemCouponRecordService.getRecordByOrderNoList(Constant.SOURCE_TYPE_JD, listJD);
|
| | | }
|
| | | |
| | | List<UserSystemCouponRecord> listRecordPDD = null;
|
| | | if (listPDD.size() > 0) {
|
| | | listRecordPDD = userSystemCouponRecordService.getRecordByOrderNoList(Constant.SOURCE_TYPE_PDD, listPDD);
|
| | | }
|
| | |
|
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
| | | for (CommonOrderVO order : list) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | // 奖励订单、免单 使用记录
|
| | | if (couponRecordList != null && couponRecordList.size() > 0) {
|
| | | for (UserSystemCouponRecord couponRecord : couponRecordList) {
|
| | | // 订单号匹配
|
| | | if (order.getOrderNo().equals(couponRecord.getOrderNo())) {
|
| | |
|
| | | Integer sourceType = order.getSourceType();
|
| | | // 奖励订单、免单 使用记录
|
| | | if (sourceType == null) {
|
| | | |
| | | } else if (sourceType == Constant.SOURCE_TYPE_TAOBAO && listRecordTB != null && listRecordTB.size() > 0) {
|
| | | for (UserSystemCouponRecord couponRecord : listRecordTB) {
|
| | | if (order.getOrderNo().equals(couponRecord.getOrderNo())) {
|
| | | String systemCouponType = couponRecord.getCouponType();
|
| | | Integer couponState = couponRecord.getState();
|
| | | if (CouponTypeEnum.freeCoupon.name().equals(systemCouponType)
|
| | |
| | | order.setOtherState(1);
|
| | | }
|
| | | }
|
| | |
|
| | | break;
|
| | | }
|
| | | }
|
| | | } else if (sourceType == Constant.SOURCE_TYPE_JD && listRecordJD != null && listRecordJD.size() > 0) {
|
| | | for (UserSystemCouponRecord couponRecord : listRecordJD) {
|
| | | if (order.getOrderNo().equals(couponRecord.getOrderNo())) {
|
| | | String systemCouponType = couponRecord.getCouponType();
|
| | | Integer couponState = couponRecord.getState();
|
| | | if (CouponTypeEnum.freeCoupon.name().equals(systemCouponType)
|
| | | || CouponTypeEnum.welfareFreeCoupon.name().equals(systemCouponType)) {
|
| | | if (UserSystemCouponRecord.STATE_SUCCESS == couponState) {
|
| | | // 免单成功
|
| | | order.setOtherState(1);
|
| | | } |
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | | } else if (sourceType == Constant.SOURCE_TYPE_PDD && listRecordPDD != null && listRecordPDD.size() > 0) {
|
| | | for (UserSystemCouponRecord couponRecord : listRecordPDD) {
|
| | | if (order.getOrderNo().equals(couponRecord.getOrderNo())) {
|
| | | String systemCouponType = couponRecord.getCouponType();
|
| | | Integer couponState = couponRecord.getState();
|
| | | if (CouponTypeEnum.freeCoupon.name().equals(systemCouponType)
|
| | | || CouponTypeEnum.welfareFreeCoupon.name().equals(systemCouponType)) {
|
| | | if (UserSystemCouponRecord.STATE_SUCCESS == couponState) {
|
| | | // 免单成功
|
| | | order.setOtherState(1);
|
| | | } |
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | | return list;
|
| | |
| | |
|
| | | @Override
|
| | | public long countQuery(Integer keyType, String key, Integer state, Integer type, Integer orderState,
|
| | | String startTime, String endTime) throws CommonOrderException {
|
| | | return commonOrderMapper.countQuery(keyType, key, state, type, orderState, startTime, endTime);
|
| | | String startTime, String endTime, Integer source) throws CommonOrderException {
|
| | | return commonOrderMapper.countQuery(keyType, key, state, type, orderState, startTime, endTime, source);
|
| | | }
|
| | |
|
| | |
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | |
| | | * @return
|
| | | */
|
| | | @Override
|
| | | public List<LostOrder> listQuery(long start, int count, String key, Integer state, Integer handleType) {
|
| | | return lostOrderMapper.listQuery(start, count, key, state, handleType);
|
| | | public List<LostOrder> listQuery(long start, int count, String key, Integer state, Integer handleType, Integer type) {
|
| | | return lostOrderMapper.listQuery(start, count, key, state, handleType, type);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countQuery(String key, Integer state, Integer handleType) {
|
| | | return lostOrderMapper.countQuery(key, state, handleType);
|
| | | public long countQuery(String key, Integer state, Integer handleType, Integer type) {
|
| | | return lostOrderMapper.countQuery(key, state, handleType, type);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | if (commonOrder.getState() == CommonOrder.STATE_JS)
|
| | | payMent = commonOrder.getSettlement();
|
| | | if (payMent.compareTo(new BigDecimal(10)) < 0) {
|
| | | mianDan = userSystemCouponRecordService.isSuccessMianDan(commonOrder.getOrderNo());
|
| | | mianDan = userSystemCouponRecordService.isSuccessMianDan(commonOrder.getSourceType(),commonOrder.getOrderNo());
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public List<UserSystemCouponRecord> getRecordByOrderNoList(List<String> list) {
|
| | | return userSystemCouponRecordMapper.getRecordByOrderNoList(list);
|
| | | public List<UserSystemCouponRecord> getRecordByOrderNoList(Integer source, List<String> list) {
|
| | | return userSystemCouponRecordMapper.getRecordByOrderNoList(source, list);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public boolean isSuccessMianDan(String orderId) {
|
| | | public boolean isSuccessMianDan(Integer source, String orderId) {
|
| | | List<String> orderList = new ArrayList<>();
|
| | | orderList.add(orderId);
|
| | | List<UserSystemCouponRecord> list = getRecordByOrderNoList(orderList);
|
| | | List<UserSystemCouponRecord> list = getRecordByOrderNoList(source, orderList);
|
| | | for (UserSystemCouponRecord record : list) {
|
| | | if (record.getCouponType().equalsIgnoreCase(CouponTypeEnum.freeCoupon.name())
|
| | | || record.getCouponType().equalsIgnoreCase(CouponTypeEnum.welfareFreeCoupon.name())) {
|
| | |
| | | */
|
| | |
|
| | | public List<CommonOrderVO> listQuery(long start, int count, Integer keyType, String key, Integer state,
|
| | | Integer type, Integer orderState, String startTime, String endTime) throws CommonOrderException;
|
| | | Integer type, Integer orderState, String startTime, String endTime, Integer source) throws CommonOrderException;
|
| | |
|
| | | public long countQuery(Integer keyType, String key, Integer state, Integer type, Integer orderState,
|
| | | String startTime, String endTime) throws CommonOrderException;
|
| | | String startTime, String endTime, Integer source) throws CommonOrderException;
|
| | |
|
| | |
|
| | | /**
|
| | |
| | | * @param handleType
|
| | | * @return
|
| | | */
|
| | | public List<LostOrder> listQuery(long start, int count, String key, Integer state, Integer handleType);
|
| | | public List<LostOrder> listQuery(long start, int count, String key, Integer state, Integer handleType, Integer type);
|
| | |
|
| | | public long countQuery(String key, Integer state, Integer handleType);
|
| | | public long countQuery(String key, Integer state, Integer handleType, Integer type);
|
| | |
|
| | | /**
|
| | | * 本月申诉订单数 统计
|
| | |
| | |
|
| | | public UserSystemCouponRecord getRecordByOrderNo(String orderNo, Integer state);
|
| | |
|
| | | public List<UserSystemCouponRecord> getRecordByOrderNoList(List<String> list);
|
| | | public List<UserSystemCouponRecord> getRecordByOrderNoList(Integer source, List<String> list);
|
| | |
|
| | | /**
|
| | | * 查询正在使用中 超过时间仍未匹配到订单记录
|
| | |
| | | * @param orderId
|
| | | * @return
|
| | | */
|
| | | public boolean isSuccessMianDan(String orderId);
|
| | | public boolean isSuccessMianDan(Integer source, String orderId);
|
| | |
|
| | | }
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | |
| | | public static boolean greaterThan_1_6_0(String platform, String versionCode) {
|
| | | if ((("android".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) >= 46))
|
| | | || (("ios".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) >= 57)))
|
| | | return true;
|
| | | else
|
| | | return false;
|
| | | }
|
| | |
|
| | | public static boolean smallerThan_1_5_1(String platform, String versionCode) {
|
| | | if ((("android".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) < 36))
|
| | |
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | | import com.yeshi.fanli.vo.goods.MoneyInfoVO;
|
| | | import com.yeshi.fanli.vo.goods.ShopInfoVO;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | |
|
| | | /**
|
| | | * 商品加工
|
| | |
| | | goodsInfo.setZkPrice(goods.getPrice());
|
| | | goodsInfo.setImgList(goods.getImageList());
|
| | | goodsInfo.setState(0);
|
| | | goodsInfo.setShopType(20); // 京东
|
| | |
|
| | | String salesCountMidea = null;
|
| | | Long count = goods.getInOrderCount30Days();
|
| | |
| | | }
|
| | | goodsInfo.setSalesCount(salesCountMidea);
|
| | |
|
| | | String owner = goods.getOwner();
|
| | | if (StringUtil.isNullOrEmpty(owner) && "g".equalsIgnoreCase(owner)) {
|
| | | goodsInfo.setShopType(21); // 京东自营
|
| | | } else {
|
| | | goodsInfo.setShopType(20); // 京东
|
| | | }
|
| | |
|
| | | // 资金信息
|
| | | MoneyInfoVO moneyInfoVO = new MoneyInfoVO();
|
| | |
| | | // goodsInfo.setShopInfo(shop);
|
| | | // }
|
| | |
|
| | | |
| | | // 京东自营标签
|
| | | String owner = goods.getOwner();
|
| | | if (!StringUtil.isNullOrEmpty(owner) && "g".equalsIgnoreCase(owner)) {
|
| | | List<ClientTextStyleVO> labels = new ArrayList<ClientTextStyleVO>();
|
| | | ClientTextStyleVO textStyleVO = new ClientTextStyleVO();
|
| | | textStyleVO.setContent("京东自营");
|
| | | textStyleVO.setColor("#E42219");
|
| | | labels.add(textStyleVO);
|
| | | goodsInfo.setLabels(labels);
|
| | | }
|
| | | |
| | | return goodsInfo;
|
| | | }
|
| | |
|
| | |
| | | package com.yeshi.fanli.vo.goods;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public class CouponInfoVO {
|
| | | public class CouponInfoVO implements Serializable {
|
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | | @Expose
|
| | | private int totalCount;// 总数量
|
| | | @Expose
|
| | |
| | | package com.yeshi.fanli.vo.goods;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.List;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public class GoodsDetailExtraVO {
|
| | | public class GoodsDetailExtraVO implements Serializable {
|
| | |
|
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | // 是否IOS上线
|
| | | @Expose
|
| | |
| | | package com.yeshi.fanli.vo.goods;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public class GoodsDetailVO {
|
| | | public class GoodsDetailVO implements Serializable {
|
| | | |
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Expose
|
| | | private Long id;// 系统ID
|
| | |
| | | package com.yeshi.fanli.vo.goods;
|
| | |
|
| | | import java.io.Serializable;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | | import com.yeshi.fanli.vo.tlj.ReduceHongBao;
|
| | | import com.yeshi.fanli.vo.tlj.SpreadHongBao;
|
| | |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public class OtherInfo {
|
| | | public class OtherInfo implements Serializable{
|
| | |
|
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | | // 推广红包
|
| | | @Expose
|
| | | private SpreadHongBao spreadHongBao;
|
| | |
| | | package com.yeshi.fanli.vo.goods;
|
| | |
|
| | | import java.io.Serializable;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | |
|
| | | /**
|
| | |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public class ShareInfoVO {
|
| | | public class ShareInfoVO implements Serializable {
|
| | |
|
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | // 分享id
|
| | | @Expose
|
| | |
| | | @Expose
|
| | | private String shareText;
|
| | |
|
| | | // 分享文字-无标题
|
| | | @Expose
|
| | | private String descText;
|
| | |
|
| | | // 特别提醒
|
| | | @Expose
|
| | | private String notifyDesc;
|
| | |
| | | @Expose
|
| | | private String rule;
|
| | |
|
| | | // 淘礼金红包
|
| | | // 分享金额
|
| | | @Expose
|
| | | private String shareMoney;
|
| | | |
| | | // 淘礼金红包
|
| | | @Expose
|
| | | private String spreadMoney;
|
| | | |
| | | // 淘礼金ID
|
| | | @Expose
|
| | | private String tljId;
|
| | | |
| | | // 淘礼金余额
|
| | | @Expose
|
| | | private String surplusMoney;
|
| | |
| | | public void setSurplusMoney(String surplusMoney) {
|
| | | this.surplusMoney = surplusMoney;
|
| | | }
|
| | |
|
| | | public String getDescText() {
|
| | | return descText;
|
| | | }
|
| | |
|
| | | public void setDescText(String descText) {
|
| | | this.descText = descText;
|
| | | }
|
| | |
|
| | | public String getSpreadMoney() {
|
| | | return spreadMoney;
|
| | | }
|
| | |
|
| | | public void setSpreadMoney(String spreadMoney) {
|
| | | this.spreadMoney = spreadMoney;
|
| | | }
|
| | | }
|
| | |
| | | package com.yeshi.fanli.vo.goods;
|
| | |
|
| | | import java.io.Serializable;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | |
|
| | | /**
|
| | |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public class ShareVO {
|
| | | public class ShareVO implements Serializable{
|
| | |
|
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | // 分享链接
|
| | | @Expose
|
| | |
| | | package com.yeshi.fanli.vo.tlj;
|
| | |
|
| | | import java.io.Serializable;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | |
|
| | | public class ReduceHongBao {
|
| | | public class ReduceHongBao implements Serializable {
|
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | | @Expose
|
| | | private String name;
|
| | | @Expose
|
| | |
| | | package com.yeshi.fanli.vo.tlj;
|
| | |
|
| | | import java.io.Serializable;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | |
|
| | | public class SpreadHongBao {
|
| | | public class SpreadHongBao implements Serializable{
|
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | | @Expose
|
| | | private String name;
|
| | | @Expose
|
| | |
| | | package com.yeshi.fanli.vo.tlj;
|
| | |
|
| | | import java.io.Serializable;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | | import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinDetail;
|
| | |
|
| | | public class TaoLiJinDetailVO {
|
| | | public class TaoLiJinDetailVO implements Serializable{
|
| | | |
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | | @Expose
|
| | | private TaoLiJinMonthVO month;
|
| | | @Expose
|
| | |
| | | package com.yeshi.fanli.vo.tlj;
|
| | |
|
| | | import java.io.Serializable;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | |
|
| | | public class TaoLiJinMonthVO {
|
| | | public class TaoLiJinMonthVO implements Serializable{
|
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | | @Expose
|
| | | private int year;// 年份
|
| | | @Expose
|