| | |
| | | */
|
| | | @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;
|
| | | }
|
| | |
|
| | | |
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | if (system == null) {
|
| | |
| | | * @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());
|
| | |
| | | String version = acceptData.getVersion();
|
| | | 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) {
|
| | | if (goodsType == null || goodsType < 1 || goodsType >3) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "请传递正确平台参数"));
|
| | | return;
|
| | | }
|
| | | |
| | | if (page == null || page < 1) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "页码不能小于1"));
|
| | | return;
|
| | | }
|
| | | |
| | | if (StringUtil.isNullOrEmpty(key)) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "请输入搜索内容"));
|
| | | return;
|
| | | }
|
| | | final String searchkey = key.trim();
|
| | | |
| | | 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);
|
| | | String bid = StringUtil.Md5(sb.toString());
|
| | | |
| | | // 加入搜索历史记录
|
| | | historySearchService.addHistorySearch(searchkey, bid);
|
| | | }
|
| | | });
|
| | | |
| | |
|
| | | String bid = getHistorySearchBid(acceptData);
|
| | |
|
| | | // 加入搜索历史记录
|
| | | historySearchService.addHistorySearch(kw, bid);
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(kw) && (kw.startsWith("http://") || kw.startsWith("https://"))) {
|
| | | if (searchkey.startsWith("http://") || searchkey.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));
|
| | | 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);
|
| | | searchJDGoods(searchkey, page, filter, order, out);
|
| | | return;
|
| | | }
|
| | |
|
| | | // 拼多多商品 TODO
|
| | | /*-------- 拼多多商品 -------*/ |
| | | if (goodsType.intValue() == Constant.SOURCE_TYPE_PDD) {
|
| | | searchPDDGoods(kw, page, filter, order, startprice, endprice, out);
|
| | | searchPDDGoods(searchkey, page, filter, order, out);
|
| | | return;
|
| | | }
|
| | |
|
| | | // 是否是推荐
|
| | | 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) {
|
| | | 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());
|
| | | /*-------- 淘宝商品 -------*/ |
| | | 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;
|
| | | }
|
| | | }
|
| | | 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);
|
| | | }
|
| | | } else if ("tmall".equalsIgnoreCase(ty)) { // 天猫
|
| | | sf.setTmall(true);
|
| | | } |
| | | }
|
| | | 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) {
|
| | | }
|
| | | |
| | | if (daTaoKeList != null && daTaoKeList.size() > 0) {
|
| | | try {
|
| | | Collections.reverse(daTaoKeList);
|
| | | for (DaTaoKeDetail detail : daTaoKeList) {
|
| | | taoBaoGoodsBriefs.add(0, TaoBaoUtil.convert(detail));
|
| | | }
|
| | | } catch (Exception e) {
|
| | | }
|
| | | } 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())
|
| | | Gson gson = 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())
|
| | | .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 (order != null) {
|
| | | int sort = order.intValue();
|
| | | switch (sort) {
|
| | | case 1: // 销量 desc
|
| | | jdfilter.setSort(JDSearchFilter.SORT_DESC);
|
| | | jdfilter.setSortName(JDSearchFilter.SORTNAME_ORDER_COUNT_30DAYS);
|
| | | break;
|
| | | case 2: // 价格—desc
|
| | | jdfilter.setSort(JDSearchFilter.SORT_DESC);
|
| | | jdfilter.setSortName(JDSearchFilter.SORTNAME_PRICE);
|
| | | break;
|
| | | case 3: // 价格—asc
|
| | | jdfilter.setSort(JDSearchFilter.SORT_ASC);
|
| | | jdfilter.setSortName(JDSearchFilter.SORTNAME_PRICE);
|
| | | break;
|
| | | case 4: // 返利比—DESC
|
| | | jdfilter.setSort(JDSearchFilter.SORT_DESC);
|
| | | jdfilter.setSortName(JDSearchFilter.SORTNAME_COMMISSION_SHARE);
|
| | | break;
|
| | | default:
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(endprice)) {
|
| | | jdfilter.setToPrice(Integer.parseInt(endprice));
|
| | | }
|
| | |
|
| | | int sort = 1;
|
| | | if (!StringUtil.isNullOrEmpty(order)) {
|
| | | sort = Integer.parseInt(order);
|
| | | }
|
| | |
|
| | | switch (sort) {
|
| | | case 1: // 销量 desc
|
| | | jdfilter.setSort(JDSearchFilter.SORT_DESC);
|
| | | jdfilter.setSortName(JDSearchFilter.SORTNAME_ORDER_COUNT_30DAYS);
|
| | | break;
|
| | | case 2: // 价格—desc
|
| | | jdfilter.setSort(JDSearchFilter.SORT_DESC);
|
| | | jdfilter.setSortName(JDSearchFilter.SORTNAME_PRICE);
|
| | | break;
|
| | | case 3: // 价格—asc
|
| | | jdfilter.setSort(JDSearchFilter.SORT_ASC);
|
| | | jdfilter.setSortName(JDSearchFilter.SORTNAME_PRICE);
|
| | | break;
|
| | | case 5: // 返利比—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);
|
| | | 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);
|
| | | break;
|
| | | case 2: // 价格—desc
|
| | | pddfilter.setSortType(4);
|
| | | break;
|
| | | case 3: // 价格—asc
|
| | | pddfilter.setSortType(3);
|
| | | break;
|
| | | case 4: // 返利比—desc
|
| | | pddfilter.setSortType(2);
|
| | | break;
|
| | | default: // 综合排序
|
| | | pddfilter.setSortType(0);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | switch (sort) {
|
| | | case 1: // 销量 desc
|
| | | pddfilter.setSortType(6);
|
| | | break;
|
| | | case 2: // 价格—desc
|
| | | pddfilter.setSortType(4);
|
| | | break;
|
| | | case 3: // 价格—asc
|
| | | pddfilter.setSortType(3);
|
| | | break;
|
| | | case 5: // 返利比—asc
|
| | | pddfilter.setSortType(2);
|
| | | break;
|
| | | case 6: // 返利比—asc
|
| | | pddfilter.setSortType(1);
|
| | | break;
|
| | | case 20: // 综合排序
|
| | | 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 ? "淘宝价" : "天猫价";
|
| | | String shareText = "";
|
| | |
| | | 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));
|
| | |
|
| | | data.put("notifyDesc", configService.get("goods_share_notify_pdd"));
|
| | | if (p < array.size()) {
|
| | | shareInfo.setNotifyPicture(array.optString(p));
|
| | | }
|
| | | shareInfo.setNotifyDesc(configService.get("goods_share_notify_pdd"));
|
| | | |
| | |
|
| | | // 添加分享记录
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | BigDecimal shareMoney = PinDuoDuoUtil.getGoodsFanLiMoney(goods, 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)));
|
| | |
|
| | | // 异步操作
|
| | | 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); |
| | | |
| | | /** |
| | | * 根据来源类型与订单号查询列表 |
| | |
| | | package com.yeshi.fanli.dao.mybatis.order; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.bus.user.LostOrder; |
| | | |
| | | public interface LostOrderMapper extends BaseMapper<LostOrder> { |
| | | |
| | | /** |
| | | * 通过订单号查询丢失订单 |
| | | * |
| | | * @param orderId |
| | | * @return |
| | | */ |
| | | List<LostOrder> selectByOrderIdAndType(@Param("orderId")String orderId,@Param("type") int type); |
| | | |
| | | /** |
| | | * 统计用户申诉次数 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | Map<String, Object> countByUid(@Param("uid") Long uid); |
| | | |
| | | /** |
| | | * 后端列表查询 |
| | | * |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | | * @return |
| | | */ |
| | | List<LostOrder> listQuery(@Param("start") long start, @Param("count") int count, @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 |
| | | * @param state |
| | | * @param years |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> countLostNum(@Param("dateType") Integer dateType, @Param("resultCode") Integer resultCode, |
| | | @Param("year") String year, @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | /** |
| | | * 统计申诉成功订单金额 |
| | | * |
| | | * @param type |
| | | * @param state |
| | | * @param years |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> countAppealMoney(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | /** |
| | | * 根据用户删除 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | int deleteByUid(Long uid); |
| | | |
| | | /** |
| | | * |
| | | * @param uid |
| | | * @param start |
| | | * @param count |
| | | * @return |
| | | */ |
| | | List<LostOrder> listByUidOrderByCreateTimeDesc(@Param("uid") Long uid, @Param("start") long start, |
| | | @Param("count") int count); |
| | | |
| | | /** |
| | | * 获取用户订单数量 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | long countAllByUid(Long uid); |
| | | |
| | | /** |
| | | * |
| | | * @param orderId |
| | | * @param type |
| | | * @param stateList |
| | | * @return |
| | | */ |
| | | List<LostOrder> listByOrderIdAndTypeAndState(@Param("orderId") String orderId, @Param("type") int type, |
| | | @Param("stateList") List<Integer> stateList); |
| | | |
| | | /** |
| | | * 处理失败 |
| | | * |
| | | * @return |
| | | */ |
| | | int processFail(); |
| | | |
| | | /** |
| | | * 根据状态和结果码获取列表 |
| | | * |
| | | * @param state |
| | | * @param resultCode |
| | | * @param start |
| | | * @param count |
| | | * @return |
| | | */ |
| | | List<LostOrder> listByStateAndResultCode(@Param("state") Integer state, @Param("resultCode") Integer resultCode, |
| | | @Param("start") long start, @Param("count") int count); |
| | | |
| | | /** |
| | | * 统计今日申诉次数 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | long countTodayAppeal(@Param("uid") Long uid); |
| | | |
| | | /** |
| | | * 根据处理的最大时间和状态,处理结果查询 |
| | | * |
| | | * @param maxTime |
| | | * @param state |
| | | * @param resultCode |
| | | * @return |
| | | */ |
| | | List<LostOrder> listByMaxHandleTimeAndStateAndResultCode(@Param("maxTime") long maxTime, |
| | | @Param("state") Integer state, @Param("resultCode") Integer resultCode); |
| | | |
| | | package com.yeshi.fanli.dao.mybatis.order;
|
| | |
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | |
|
| | | import com.yeshi.fanli.dao.BaseMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.LostOrder;
|
| | |
|
| | | public interface LostOrderMapper extends BaseMapper<LostOrder> {
|
| | |
|
| | | /**
|
| | | * 通过订单号查询丢失订单
|
| | | * |
| | | * @param orderId
|
| | | * @return
|
| | | */
|
| | | List<LostOrder> selectByOrderIdAndType(@Param("orderId")String orderId,@Param("type") int type);
|
| | |
|
| | | /**
|
| | | * 统计用户申诉次数
|
| | | * |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | Map<String, Object> countByUid(@Param("uid") Long uid);
|
| | |
|
| | | /**
|
| | | * 后端列表查询
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | | * @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("type") Integer type);
|
| | |
|
| | | long countQuery(@Param("key") String key, @Param("state") Integer state, @Param("handleType") Integer handleType,
|
| | | @Param("type") Integer type);
|
| | |
|
| | | /**
|
| | | * 统计申诉订单数量
|
| | | * |
| | | * @param type
|
| | | * @param state
|
| | | * @param years
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | List<Map<String, Object>> countLostNum(@Param("dateType") Integer dateType, @Param("resultCode") Integer resultCode,
|
| | | @Param("year") String year, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
| | |
|
| | | /**
|
| | | * 统计申诉成功订单金额
|
| | | * |
| | | * @param type
|
| | | * @param state
|
| | | * @param years
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | List<Map<String, Object>> countAppealMoney(@Param("dateType") Integer dateType, @Param("year") String year,
|
| | | @Param("startTime") String startTime, @Param("endTime") String endTime);
|
| | |
|
| | | /**
|
| | | * 根据用户删除
|
| | | * |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | int deleteByUid(Long uid);
|
| | |
|
| | | /**
|
| | | * |
| | | * @param uid
|
| | | * @param start
|
| | | * @param count
|
| | | * @return
|
| | | */
|
| | | List<LostOrder> listByUidOrderByCreateTimeDesc(@Param("uid") Long uid, @Param("start") long start,
|
| | | @Param("count") int count);
|
| | |
|
| | | /**
|
| | | * 获取用户订单数量
|
| | | * |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | long countAllByUid(Long uid);
|
| | |
|
| | | /**
|
| | | * |
| | | * @param orderId
|
| | | * @param type
|
| | | * @param stateList
|
| | | * @return
|
| | | */
|
| | | List<LostOrder> listByOrderIdAndTypeAndState(@Param("orderId") String orderId, @Param("type") int type,
|
| | | @Param("stateList") List<Integer> stateList);
|
| | |
|
| | | /**
|
| | | * 处理失败
|
| | | * |
| | | * @return
|
| | | */
|
| | | int processFail();
|
| | |
|
| | | /**
|
| | | * 根据状态和结果码获取列表
|
| | | * |
| | | * @param state
|
| | | * @param resultCode
|
| | | * @param start
|
| | | * @param count
|
| | | * @return
|
| | | */
|
| | | List<LostOrder> listByStateAndResultCode(@Param("state") Integer state, @Param("resultCode") Integer resultCode,
|
| | | @Param("start") long start, @Param("count") int count);
|
| | |
|
| | | /**
|
| | | * 统计今日申诉次数
|
| | | * |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | long countTodayAppeal(@Param("uid") Long uid);
|
| | |
|
| | | /**
|
| | | * 根据处理的最大时间和状态,处理结果查询
|
| | | * |
| | | * @param maxTime
|
| | | * @param state
|
| | | * @param resultCode
|
| | | * @return
|
| | | */
|
| | | List<LostOrder> listByMaxHandleTimeAndStateAndResultCode(@Param("maxTime") long maxTime,
|
| | | @Param("state") Integer state, @Param("resultCode") Integer resultCode);
|
| | |
|
| | | } |
| | |
| | | package com.yeshi.fanli.dao.mybatis.user; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord; |
| | | |
| | | public interface UserSystemCouponRecordMapper extends BaseMapper<UserSystemCouponRecord> { |
| | | |
| | | /** |
| | | * 根据单个订单查询 |
| | | * @param uid |
| | | * @param activated |
| | | * @param listCouponId |
| | | * @return |
| | | */ |
| | | List<UserSystemCouponRecord> getRecordByState(@Param("uid") Long uid, @Param("state") Integer state); |
| | | |
| | | /** |
| | | * 根据单个订单查询 |
| | | * @param uid |
| | | * @param activated |
| | | * @param listCouponId |
| | | * @return |
| | | */ |
| | | UserSystemCouponRecord getRecordByOrderNo(@Param("orderNo") String orderNo, @Param("state") Integer state); |
| | | |
| | | |
| | | /** |
| | | * 根据订单号列表查询 |
| | | * @param uid |
| | | * @param activated |
| | | * @param listCouponId |
| | | * @return |
| | | */ |
| | | List<UserSystemCouponRecord> getRecordByOrderNoList(@Param("list") List<String> list); |
| | | |
| | | |
| | | /** |
| | | * 查询正在使用中 超过时间仍未匹配到订单记录 |
| | | * @param uid |
| | | * @param seconds |
| | | * @return |
| | | */ |
| | | List<UserSystemCouponRecord> getCouponByUsingTimeOut(@Param("uid") Long uid, @Param("number") Long number); |
| | | |
| | | package com.yeshi.fanli.dao.mybatis.user;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | |
|
| | | import com.yeshi.fanli.dao.BaseMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord;
|
| | |
|
| | | public interface UserSystemCouponRecordMapper extends BaseMapper<UserSystemCouponRecord> {
|
| | | |
| | | /**
|
| | | * 根据单个订单查询
|
| | | * @param uid
|
| | | * @param activated
|
| | | * @param listCouponId
|
| | | * @return
|
| | | */
|
| | | List<UserSystemCouponRecord> getRecordByState(@Param("uid") Long uid, @Param("state") Integer state);
|
| | | |
| | | /**
|
| | | * 根据单个订单查询
|
| | | * @param uid
|
| | | * @param activated
|
| | | * @param listCouponId
|
| | | * @return
|
| | | */
|
| | | UserSystemCouponRecord getRecordByOrderNo(@Param("orderNo") String orderNo, @Param("state") Integer state);
|
| | | |
| | | |
| | | /**
|
| | | * 根据订单号列表查询
|
| | | * @param uid
|
| | | * @param activated
|
| | | * @param listCouponId
|
| | | * @return
|
| | | */
|
| | | List<UserSystemCouponRecord> getRecordByOrderNoList( @Param("source")Integer source, @Param("list") List<String> list);
|
| | | |
| | | |
| | | /**
|
| | | * 查询正在使用中 超过时间仍未匹配到订单记录
|
| | | * @param uid
|
| | | * @param seconds
|
| | | * @return
|
| | | */
|
| | | List<UserSystemCouponRecord> getCouponByUsingTimeOut(@Param("uid") Long uid, @Param("number") Long number);
|
| | | |
| | | } |
| | |
| | | <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, |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.order.LostOrderMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.LostOrder"> |
| | | <id column="id" property="id" jdbcType="BIGINT" /> |
| | | <result column="orderId" property="orderId" jdbcType="VARCHAR" /> |
| | | <result column="type" property="type" jdbcType="INTEGER" /> |
| | | <result column="state" property="state" jdbcType="INTEGER" /> |
| | | <result column="createTime" property="createTime" jdbcType="BIGINT" /> |
| | | <result column="handleTime" property="handleTime" jdbcType="BIGINT" /> |
| | | <result column="remake" property="remake" jdbcType="VARCHAR" /> |
| | | <result column="judge" property="judge" jdbcType="VARCHAR" /> |
| | | <result column="result_code" property="resultCode" jdbcType="INTEGER" /> |
| | | <result column="ip_info" property="ipInfo" jdbcType="VARCHAR" /> |
| | | <association property="userInfo" column="uid" |
| | | javaType="com.yeshi.fanli.entity.bus.user.UserInfo"> |
| | | <id column="uid" property="id" jdbcType="BIGINT" /> |
| | | </association> |
| | | <association property="order" column="oid" |
| | | javaType="com.yeshi.fanli.entity.bus.user.Order"> |
| | | <id column="oid" property="id" jdbcType="BIGINT" /> |
| | | </association> |
| | | </resultMap> |
| | | <resultMap id="AllResultMap" type="com.yeshi.fanli.entity.bus.user.LostOrder"> |
| | | <id column="id" property="id" jdbcType="BIGINT" /> |
| | | <result column="orderId" property="orderId" jdbcType="VARCHAR" /> |
| | | <result column="type" property="type" jdbcType="INTEGER" /> |
| | | <result column="state" property="state" jdbcType="INTEGER" /> |
| | | <result column="createTime" property="createTime" jdbcType="BIGINT" /> |
| | | <result column="handleTime" property="handleTime" jdbcType="BIGINT" /> |
| | | <result column="remake" property="remake" jdbcType="VARCHAR" /> |
| | | <result column="judge" property="judge" jdbcType="VARCHAR" /> |
| | | <result column="result_code" property="resultCode" jdbcType="INTEGER" /> |
| | | <association property="userInfo" column="uid" |
| | | select="com.yeshi.fanli.dao.mybatis.UserInfoMapper.selectByPKey" /> |
| | | <association property="order" column="oid" |
| | | select="com.yeshi.fanli.dao.mybatis.order.OrderMapper.selectByPrimaryKey" /> |
| | | </resultMap> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_lost_order where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <select id="selectByOrderIdAndType" resultMap="BaseResultMap">select * from |
| | | yeshi_ec_lost_order where orderId=#{orderId} and `type`=#{type} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long">select * from yeshi_ec_lost_order where id=#{0}</select> |
| | | <select id="listByStateAndResultCode" resultMap="BaseResultMap">select * from |
| | | yeshi_ec_lost_order where `state`=#{state} and |
| | | `result_code`=#{resultCode} ORDER BY id DESC limit #{start},#{count} |
| | | </select> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.LostOrder"> |
| | | update yeshi_ec_lost_order |
| | | <set> |
| | | <if test="orderId != null">orderId=#{orderId,jdbcType=VARCHAR},</if> |
| | | <if test="type != null">type=#{type,jdbcType=INTEGER},</if> |
| | | <if test="state != null">state=#{state,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">createTime=#{createTime,jdbcType=BIGINT},</if> |
| | | <if test="handleTime != null">handleTime=#{handleTime,jdbcType=BIGINT},</if> |
| | | <if test="userInfo != null">uid=#{userInfo.id,jdbcType=BIGINT},</if> |
| | | <if test="order != null">oid=#{order.id,jdbcType=BIGINT},</if> |
| | | <if test="remake != null">remake=#{remake,jdbcType=VARCHAR},</if> |
| | | <if test="judge != null">judge=#{judge,jdbcType=VARCHAR},</if> |
| | | <if test="resultCode != null">result_code=#{resultCode,jdbcType=INTEGER},</if> |
| | | <if test="ipInfo !=null">ip_info =#{ipInfo,jdbcType=VARCHAR},</if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <select id="countByUid" resultType="java.util.HashMap">SELECT IFNULL(COUNT(id), 0) |
| | | AS total,IFNULL(SUM(CASE WHEN state = 1 THEN 1 ELSE 0 END),0) AS |
| | | totalPass, IFNULL(SUM(CASE WHEN state = 2 THEN 1 ELSE 0 END),0) AS |
| | | totalReject FROM yeshi_ec_lost_order WHERE uid = #{uid}; |
| | | </select> |
| | | <select id="listQuery" resultMap="AllResultMap"> |
| | | SELECT d.* FROM yeshi_ec_lost_order d left join yeshi_ec_user u on |
| | | d.uid = u.id WHERE 1=1 |
| | | <if test="key != null and key != """>AND (d.orderId like '%${key}%' or d.uid like '%${key}%' or |
| | | u.nick_name like '%${key}%')</if> |
| | | <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> |
| | | ORDER BY d.createTime desc LIMIT ${start},${count} |
| | | </select> |
| | | <select id="countQuery" resultType="java.lang.Long"> |
| | | SELECT IFNULL(count(d.id),0) FROM yeshi_ec_lost_order d left join |
| | | yeshi_ec_user u on d.uid = u.id WHERE 1=1 |
| | | <if test="key != null and key != """>AND (d.orderId like '%${key}%' or d.uid like '%${key}%' or |
| | | u.nick_name like '%${key}%')</if> |
| | | <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> |
| | | </select> |
| | | <select id="countLostNum" resultType="java.util.HashMap"> |
| | | SELECT COUNT(t.`id`) AS showValue, |
| | | <if test="dateType == 1">FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m-%d') AS |
| | | 'showDate' |
| | | </if> |
| | | <if test="dateType == 2">FROM_UNIXTIME(t.`createTime`/1000,'%m') AS 'showDate'</if> |
| | | <if test="dateType == 3">FROM_UNIXTIME(t.`createTime`/1000,'%Y') AS 'showDate'</if> |
| | | FROM `yeshi_ec_lost_order` t WHERE t.`createTime`IS NOT NULL |
| | | <if test="startTime != null and startTime != '' "> |
| | | AND FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m-%d')<![CDATA[ >= ]]>'${startTime}' |
| | | </if> |
| | | <if test="endTime != null and endTime != '' "> |
| | | AND FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m-%d') <![CDATA[ <= ]]> |
| | | '${endTime}' |
| | | </if> |
| | | <if test="year != null and year != '' ">AND FROM_UNIXTIME(t.`createTime`/1000,'%Y') = '${year}' |
| | | </if> |
| | | <if test="resultCode != null and resultCode != 0 ">AND t.`result_code` = ${resultCode}</if> |
| | | <if test="dateType == 1">GROUP BY FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m-%d') |
| | | </if> |
| | | <if test="dateType == 2">GROUP BY FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m')</if> |
| | | <if test="dateType == 3">GROUP BY FROM_UNIXTIME(t.`createTime`/1000,'%Y')</if> |
| | | ORDER BY t.`createTime` |
| | | </select> |
| | | <select id="countAppealMoney" resultType="java.util.HashMap"> |
| | | SELECT CAST(SUM(v.`hb_money`)AS DECIMAL(19,2)) AS showValue, |
| | | <if test="dateType == 1">FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m-%d') AS |
| | | 'showDate' |
| | | </if> |
| | | <if test="dateType == 2">FROM_UNIXTIME(t.`createTime`/1000,'%m') AS 'showDate'</if> |
| | | <if test="dateType == 3">FROM_UNIXTIME(t.`createTime`/1000,'%Y') AS 'showDate'</if> |
| | | FROM `yeshi_ec_lost_order` t LEFT JOIN `yeshi_ec_common_order` tc ON |
| | | tc.`co_order_no` = t.`orderId` LEFT JOIN `yeshi_ec_hongbao_order` h ON |
| | | h.`ho_order_id` = tc.`co_id` LEFT JOIN `yeshi_ec_hongbao_v2`v ON |
| | | h.`ho_hongbao_id` = v.`hb_id` WHERE t.`createTime`IS NOT NULL AND |
| | | t.`result_code` = 2 AND (v.`hb_type` =1 OR v.`hb_type` = 2) |
| | | <if test="startTime != null and startTime != '' "> |
| | | AND FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m-%d')<![CDATA[ >= ]]>'${startTime}' |
| | | </if> |
| | | <if test="endTime != null and endTime != '' "> |
| | | AND FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m-%d') <![CDATA[ <= ]]> |
| | | '${endTime}' |
| | | </if> |
| | | <if test="year != null and year != '' ">AND FROM_UNIXTIME(t.`createTime`/1000,'%Y') = '${year}' |
| | | </if> |
| | | <if test="dateType == 1">GROUP BY FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m-%d') |
| | | </if> |
| | | <if test="dateType == 2">GROUP BY FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m')</if> |
| | | <if test="dateType == 3">GROUP BY FROM_UNIXTIME(t.`createTime`/1000,'%Y')</if> |
| | | ORDER BY t.`createTime` |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="listByMaxHandleTimeAndStateAndResultCode" resultMap="BaseResultMap"> |
| | | select * from yeshi_ec_lost_order lo where #{maxTime} > |
| | | lo.`handleTime` |
| | | <if test="state!=null"> and lo.`state`=#{state} and result_code=#{resultCode} |
| | | </if> |
| | | |
| | | <if test="resultCode!=null"> and lo.`result_code`=#{resultCode} |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.LostOrder" |
| | | useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_lost_order |
| | | (id,orderId,type,state,createTime,handleTime,uid,oid,remake,judge,result_code,id,ip_info) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{orderId,jdbcType=VARCHAR},#{type,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createTime,jdbcType=BIGINT},#{handleTime,jdbcType=BIGINT},#{userInfo.id,jdbcType=BIGINT},#{order.id,jdbcType=BIGINT},#{remake,jdbcType=VARCHAR},#{judge,jdbcType=VARCHAR},#{resultCode,jdbcType=INTEGER},#{id,jdbcType=BIGINT},#{ipInfo,jdbcType=VARCHAR}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.LostOrder" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | | insert into yeshi_ec_lost_order |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="orderId != null">orderId,</if> |
| | | <if test="type != null">type,</if> |
| | | <if test="state != null">state,</if> |
| | | <if test="createTime != null">createTime,</if> |
| | | <if test="handleTime != null">handleTime,</if> |
| | | <if test="userInfo != null">uid,</if> |
| | | <if test="order != null">oid,</if> |
| | | <if test="remake != null">remake,</if> |
| | | <if test="judge != null">judge,</if> |
| | | <if test="resultCode != null">result_code,</if> |
| | | <if test="ipInfo != null">ip_info,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="orderId != null">#{orderId,jdbcType=VARCHAR},</if> |
| | | <if test="type != null">#{type,jdbcType=INTEGER},</if> |
| | | <if test="state != null">#{state,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=BIGINT},</if> |
| | | <if test="handleTime != null">#{handleTime,jdbcType=BIGINT},</if> |
| | | <if test="userInfo != null">#{userInfo.id,jdbcType=BIGINT},</if> |
| | | <if test="order != null">#{order.id,jdbcType=BIGINT},</if> |
| | | <if test="remake != null">#{remake,jdbcType=VARCHAR},</if> |
| | | <if test="judge != null">#{judge,jdbcType=VARCHAR},</if> |
| | | <if test="resultCode != null">#{resultCode,jdbcType=INTEGER},</if> |
| | | <if test="ipInfo != null">#{ipInfo,jdbcType=VARCHAR}</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.LostOrder">update |
| | | yeshi_ec_lost_order set orderId = #{orderId,jdbcType=VARCHAR},type = |
| | | #{type,jdbcType=INTEGER},state = #{state,jdbcType=INTEGER},createTime |
| | | = #{createTime,jdbcType=BIGINT},handleTime = |
| | | #{handleTime,jdbcType=BIGINT},uid = #{userInfo.id,jdbcType=BIGINT},oid |
| | | = #{order.id,jdbcType=BIGINT},remake = |
| | | #{remake,jdbcType=VARCHAR},judge = |
| | | #{judge,jdbcType=VARCHAR},result_code = #{resultCode,jdbcType=INTEGER} |
| | | ,ip_info =#{ipInfo,jdbcType=VARCHAR} where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <delete id="deleteByUid" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_lost_order where uid = #{0} |
| | | </delete> |
| | | <select id="listByUidOrderByCreateTimeDesc" resultMap="BaseResultMap">select * |
| | | from yeshi_ec_lost_order where uid=#{uid} order by id desc limit |
| | | #{start},#{count} |
| | | </select> |
| | | <select id="countAllByUid" resultType="java.lang.Long">select count(id) from |
| | | yeshi_ec_lost_order where uid=#{0} |
| | | </select> |
| | | <select id="listByOrderIdAndTypeAndState" resultMap="BaseResultMap"> |
| | | select * from yeshi_ec_lost_order where orderId=#{orderId} |
| | | <if test="type!=null">and type=#{type}</if> |
| | | <if test="stateList!=null"> |
| | | <foreach collection="stateList" item="state" open="and (" |
| | | close=")" separator=" or ">state=#{state}</foreach> |
| | | </if> |
| | | </select> |
| | | <update id="processFail">UPDATE `yeshi_ec_lost_order` lo SET |
| | | lo.`result_code`=3 WHERE lo.`state`=1 AND lo.`result_code`=1 AND |
| | | UNIX_TIMESTAMP()*1000- lo.`handleTime`>1000* 60 * 60 * 24 * 3 |
| | | </update> |
| | | |
| | | <select id="countTodayAppeal" resultType="java.lang.Long"> |
| | | SELECT |
| | | IFNULL(COUNT(t.`id`),0) FROM yeshi_ec_lost_order t |
| | | WHERE t.`uid` = |
| | | #{uid} |
| | | AND FROM_UNIXTIME(t.`createTime`/1000, '%Y-%m-%d') |
| | | =DATE_FORMAT(NOW(),'%Y-%m-%d') |
| | | </select> |
| | | |
| | | </mapper> |
| | | <?xml version="1.0" encoding="UTF-8"?>
|
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | |
|
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.order.LostOrderMapper">
|
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.LostOrder">
|
| | | <id column="id" property="id" jdbcType="BIGINT" />
|
| | | <result column="orderId" property="orderId" jdbcType="VARCHAR" />
|
| | | <result column="type" property="type" jdbcType="INTEGER" />
|
| | | <result column="state" property="state" jdbcType="INTEGER" />
|
| | | <result column="createTime" property="createTime" jdbcType="BIGINT" />
|
| | | <result column="handleTime" property="handleTime" jdbcType="BIGINT" />
|
| | | <result column="remake" property="remake" jdbcType="VARCHAR" />
|
| | | <result column="judge" property="judge" jdbcType="VARCHAR" />
|
| | | <result column="result_code" property="resultCode" jdbcType="INTEGER" />
|
| | | <result column="ip_info" property="ipInfo" jdbcType="VARCHAR" />
|
| | | <association property="userInfo" column="uid"
|
| | | javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
|
| | | <id column="uid" property="id" jdbcType="BIGINT" />
|
| | | </association>
|
| | | <association property="order" column="oid"
|
| | | javaType="com.yeshi.fanli.entity.bus.user.Order">
|
| | | <id column="oid" property="id" jdbcType="BIGINT" />
|
| | | </association>
|
| | | </resultMap>
|
| | | <resultMap id="AllResultMap" type="com.yeshi.fanli.entity.bus.user.LostOrder">
|
| | | <id column="id" property="id" jdbcType="BIGINT" />
|
| | | <result column="orderId" property="orderId" jdbcType="VARCHAR" />
|
| | | <result column="type" property="type" jdbcType="INTEGER" />
|
| | | <result column="state" property="state" jdbcType="INTEGER" />
|
| | | <result column="createTime" property="createTime" jdbcType="BIGINT" />
|
| | | <result column="handleTime" property="handleTime" jdbcType="BIGINT" />
|
| | | <result column="remake" property="remake" jdbcType="VARCHAR" />
|
| | | <result column="judge" property="judge" jdbcType="VARCHAR" />
|
| | | <result column="result_code" property="resultCode" jdbcType="INTEGER" />
|
| | | <association property="userInfo" column="uid"
|
| | | select="com.yeshi.fanli.dao.mybatis.UserInfoMapper.selectByPKey" />
|
| | | <association property="order" column="oid"
|
| | | select="com.yeshi.fanli.dao.mybatis.order.OrderMapper.selectByPrimaryKey" />
|
| | | </resultMap>
|
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
|
| | | yeshi_ec_lost_order where id = #{id,jdbcType=BIGINT}
|
| | | </delete>
|
| | | <select id="selectByOrderIdAndType" resultMap="BaseResultMap">select * from
|
| | | yeshi_ec_lost_order where orderId=#{orderId} and `type`=#{type}
|
| | | </select>
|
| | |
|
| | |
|
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
| | | parameterType="java.lang.Long">select * from yeshi_ec_lost_order where id=#{0}</select>
|
| | | <select id="listByStateAndResultCode" resultMap="BaseResultMap">select * from
|
| | | yeshi_ec_lost_order where `state`=#{state} and
|
| | | `result_code`=#{resultCode} ORDER BY id DESC limit #{start},#{count}
|
| | | </select>
|
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.LostOrder">
|
| | | update yeshi_ec_lost_order
|
| | | <set>
|
| | | <if test="orderId != null">orderId=#{orderId,jdbcType=VARCHAR},</if>
|
| | | <if test="type != null">type=#{type,jdbcType=INTEGER},</if>
|
| | | <if test="state != null">state=#{state,jdbcType=INTEGER},</if>
|
| | | <if test="createTime != null">createTime=#{createTime,jdbcType=BIGINT},</if>
|
| | | <if test="handleTime != null">handleTime=#{handleTime,jdbcType=BIGINT},</if>
|
| | | <if test="userInfo != null">uid=#{userInfo.id,jdbcType=BIGINT},</if>
|
| | | <if test="order != null">oid=#{order.id,jdbcType=BIGINT},</if>
|
| | | <if test="remake != null">remake=#{remake,jdbcType=VARCHAR},</if>
|
| | | <if test="judge != null">judge=#{judge,jdbcType=VARCHAR},</if>
|
| | | <if test="resultCode != null">result_code=#{resultCode,jdbcType=INTEGER},</if>
|
| | | <if test="ipInfo !=null">ip_info =#{ipInfo,jdbcType=VARCHAR},</if>
|
| | | </set>
|
| | | where id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | | <select id="countByUid" resultType="java.util.HashMap">SELECT IFNULL(COUNT(id), 0)
|
| | | AS total,IFNULL(SUM(CASE WHEN state = 1 THEN 1 ELSE 0 END),0) AS
|
| | | totalPass, IFNULL(SUM(CASE WHEN state = 2 THEN 1 ELSE 0 END),0) AS
|
| | | totalReject FROM yeshi_ec_lost_order WHERE uid = #{uid};
|
| | | </select>
|
| | | <select id="listQuery" resultMap="AllResultMap">
|
| | | SELECT d.* FROM yeshi_ec_lost_order d left join yeshi_ec_user u on
|
| | | d.uid = u.id WHERE 1=1
|
| | | <if test="key != null and key != """>AND (d.orderId like '%${key}%' or d.uid like '%${key}%' or
|
| | | u.nick_name like '%${key}%')</if>
|
| | | <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">
|
| | | SELECT IFNULL(count(d.id),0) FROM yeshi_ec_lost_order d left join
|
| | | yeshi_ec_user u on d.uid = u.id WHERE 1=1
|
| | | <if test="key != null and key != """>AND (d.orderId like '%${key}%' or d.uid like '%${key}%' or
|
| | | u.nick_name like '%${key}%')</if>
|
| | | <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,
|
| | | <if test="dateType == 1">FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m-%d') AS
|
| | | 'showDate'
|
| | | </if>
|
| | | <if test="dateType == 2">FROM_UNIXTIME(t.`createTime`/1000,'%m') AS 'showDate'</if>
|
| | | <if test="dateType == 3">FROM_UNIXTIME(t.`createTime`/1000,'%Y') AS 'showDate'</if>
|
| | | FROM `yeshi_ec_lost_order` t WHERE t.`createTime`IS NOT NULL
|
| | | <if test="startTime != null and startTime != '' ">
|
| | | AND FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m-%d')<![CDATA[ >= ]]>'${startTime}'
|
| | | </if>
|
| | | <if test="endTime != null and endTime != '' ">
|
| | | AND FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m-%d') <![CDATA[ <= ]]>
|
| | | '${endTime}'
|
| | | </if>
|
| | | <if test="year != null and year != '' ">AND FROM_UNIXTIME(t.`createTime`/1000,'%Y') = '${year}'
|
| | | </if>
|
| | | <if test="resultCode != null and resultCode != 0 ">AND t.`result_code` = ${resultCode}</if>
|
| | | <if test="dateType == 1">GROUP BY FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m-%d')
|
| | | </if>
|
| | | <if test="dateType == 2">GROUP BY FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m')</if>
|
| | | <if test="dateType == 3">GROUP BY FROM_UNIXTIME(t.`createTime`/1000,'%Y')</if>
|
| | | ORDER BY t.`createTime`
|
| | | </select>
|
| | | <select id="countAppealMoney" resultType="java.util.HashMap">
|
| | | SELECT CAST(SUM(v.`hb_money`)AS DECIMAL(19,2)) AS showValue,
|
| | | <if test="dateType == 1">FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m-%d') AS
|
| | | 'showDate'
|
| | | </if>
|
| | | <if test="dateType == 2">FROM_UNIXTIME(t.`createTime`/1000,'%m') AS 'showDate'</if>
|
| | | <if test="dateType == 3">FROM_UNIXTIME(t.`createTime`/1000,'%Y') AS 'showDate'</if>
|
| | | FROM `yeshi_ec_lost_order` t LEFT JOIN `yeshi_ec_common_order` tc ON
|
| | | tc.`co_order_no` = t.`orderId` LEFT JOIN `yeshi_ec_hongbao_order` h ON
|
| | | h.`ho_order_id` = tc.`co_id` LEFT JOIN `yeshi_ec_hongbao_v2`v ON
|
| | | h.`ho_hongbao_id` = v.`hb_id` WHERE t.`createTime`IS NOT NULL AND
|
| | | t.`result_code` = 2 AND (v.`hb_type` =1 OR v.`hb_type` = 2)
|
| | | <if test="startTime != null and startTime != '' ">
|
| | | AND FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m-%d')<![CDATA[ >= ]]>'${startTime}'
|
| | | </if>
|
| | | <if test="endTime != null and endTime != '' ">
|
| | | AND FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m-%d') <![CDATA[ <= ]]>
|
| | | '${endTime}'
|
| | | </if>
|
| | | <if test="year != null and year != '' ">AND FROM_UNIXTIME(t.`createTime`/1000,'%Y') = '${year}'
|
| | | </if>
|
| | | <if test="dateType == 1">GROUP BY FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m-%d')
|
| | | </if>
|
| | | <if test="dateType == 2">GROUP BY FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m')</if>
|
| | | <if test="dateType == 3">GROUP BY FROM_UNIXTIME(t.`createTime`/1000,'%Y')</if>
|
| | | ORDER BY t.`createTime`
|
| | | </select>
|
| | |
|
| | |
|
| | |
|
| | | <select id="listByMaxHandleTimeAndStateAndResultCode" resultMap="BaseResultMap">
|
| | | select * from yeshi_ec_lost_order lo where #{maxTime} >
|
| | | lo.`handleTime`
|
| | | <if test="state!=null"> and lo.`state`=#{state} and result_code=#{resultCode}
|
| | | </if>
|
| | |
|
| | | <if test="resultCode!=null"> and lo.`result_code`=#{resultCode}
|
| | | </if>
|
| | | </select>
|
| | |
|
| | |
|
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.LostOrder"
|
| | | useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_lost_order
|
| | | (id,orderId,type,state,createTime,handleTime,uid,oid,remake,judge,result_code,id,ip_info)
|
| | | values
|
| | | (#{id,jdbcType=BIGINT},#{orderId,jdbcType=VARCHAR},#{type,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createTime,jdbcType=BIGINT},#{handleTime,jdbcType=BIGINT},#{userInfo.id,jdbcType=BIGINT},#{order.id,jdbcType=BIGINT},#{remake,jdbcType=VARCHAR},#{judge,jdbcType=VARCHAR},#{resultCode,jdbcType=INTEGER},#{id,jdbcType=BIGINT},#{ipInfo,jdbcType=VARCHAR})
|
| | | </insert>
|
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.LostOrder"
|
| | | useGeneratedKeys="true" keyProperty="id">
|
| | | insert into yeshi_ec_lost_order
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">id,</if>
|
| | | <if test="orderId != null">orderId,</if>
|
| | | <if test="type != null">type,</if>
|
| | | <if test="state != null">state,</if>
|
| | | <if test="createTime != null">createTime,</if>
|
| | | <if test="handleTime != null">handleTime,</if>
|
| | | <if test="userInfo != null">uid,</if>
|
| | | <if test="order != null">oid,</if>
|
| | | <if test="remake != null">remake,</if>
|
| | | <if test="judge != null">judge,</if>
|
| | | <if test="resultCode != null">result_code,</if>
|
| | | <if test="ipInfo != null">ip_info,</if>
|
| | | </trim>
|
| | | values
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if>
|
| | | <if test="orderId != null">#{orderId,jdbcType=VARCHAR},</if>
|
| | | <if test="type != null">#{type,jdbcType=INTEGER},</if>
|
| | | <if test="state != null">#{state,jdbcType=INTEGER},</if>
|
| | | <if test="createTime != null">#{createTime,jdbcType=BIGINT},</if>
|
| | | <if test="handleTime != null">#{handleTime,jdbcType=BIGINT},</if>
|
| | | <if test="userInfo != null">#{userInfo.id,jdbcType=BIGINT},</if>
|
| | | <if test="order != null">#{order.id,jdbcType=BIGINT},</if>
|
| | | <if test="remake != null">#{remake,jdbcType=VARCHAR},</if>
|
| | | <if test="judge != null">#{judge,jdbcType=VARCHAR},</if>
|
| | | <if test="resultCode != null">#{resultCode,jdbcType=INTEGER},</if>
|
| | | <if test="ipInfo != null">#{ipInfo,jdbcType=VARCHAR}</if>
|
| | | </trim>
|
| | | </insert>
|
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.LostOrder">update
|
| | | yeshi_ec_lost_order set orderId = #{orderId,jdbcType=VARCHAR},type =
|
| | | #{type,jdbcType=INTEGER},state = #{state,jdbcType=INTEGER},createTime
|
| | | = #{createTime,jdbcType=BIGINT},handleTime =
|
| | | #{handleTime,jdbcType=BIGINT},uid = #{userInfo.id,jdbcType=BIGINT},oid
|
| | | = #{order.id,jdbcType=BIGINT},remake =
|
| | | #{remake,jdbcType=VARCHAR},judge =
|
| | | #{judge,jdbcType=VARCHAR},result_code = #{resultCode,jdbcType=INTEGER}
|
| | | ,ip_info =#{ipInfo,jdbcType=VARCHAR} where id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | | <delete id="deleteByUid" parameterType="java.lang.Long">delete from
|
| | | yeshi_ec_lost_order where uid = #{0}
|
| | | </delete>
|
| | | <select id="listByUidOrderByCreateTimeDesc" resultMap="BaseResultMap">select *
|
| | | from yeshi_ec_lost_order where uid=#{uid} order by id desc limit
|
| | | #{start},#{count}
|
| | | </select>
|
| | | <select id="countAllByUid" resultType="java.lang.Long">select count(id) from
|
| | | yeshi_ec_lost_order where uid=#{0}
|
| | | </select>
|
| | | <select id="listByOrderIdAndTypeAndState" resultMap="BaseResultMap">
|
| | | select * from yeshi_ec_lost_order where orderId=#{orderId}
|
| | | <if test="type!=null">and type=#{type}</if>
|
| | | <if test="stateList!=null">
|
| | | <foreach collection="stateList" item="state" open="and ("
|
| | | close=")" separator=" or ">state=#{state}</foreach>
|
| | | </if>
|
| | | </select>
|
| | | <update id="processFail">UPDATE `yeshi_ec_lost_order` lo SET
|
| | | lo.`result_code`=3 WHERE lo.`state`=1 AND lo.`result_code`=1 AND
|
| | | UNIX_TIMESTAMP()*1000- lo.`handleTime`>1000* 60 * 60 * 24 * 3
|
| | | </update>
|
| | |
|
| | | <select id="countTodayAppeal" resultType="java.lang.Long">
|
| | | SELECT
|
| | | IFNULL(COUNT(t.`id`),0) FROM yeshi_ec_lost_order t
|
| | | WHERE t.`uid` =
|
| | | #{uid}
|
| | | AND FROM_UNIXTIME(t.`createTime`/1000, '%Y-%m-%d')
|
| | | =DATE_FORMAT(NOW(),'%Y-%m-%d')
|
| | | </select>
|
| | |
|
| | | </mapper>
|
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.user.UserSystemCouponRecordMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord"> |
| | | <id column="ucr_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="ucr_good_id" property="goodId" jdbcType="BIGINT"/> |
| | | <result column="ucr_good_source" property="goodSource" jdbcType="VARCHAR"/> |
| | | <result column="ucr_coupon_type" property="couponType" jdbcType="VARCHAR"/> |
| | | <result column="ucr_order_no" property="orderNo" jdbcType="VARCHAR"/> |
| | | <result column="ucr_state" property="state" jdbcType="INTEGER"/> |
| | | <result column="ucr_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="ucr_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | |
| | | <association property="userSystemCoupon" column="ucr_user_coupon_id" |
| | | resultMap="com.yeshi.fanli.dao.mybatis.user.UserSystemCouponMapper.BaseResultMap"/> |
| | | |
| | | </resultMap> |
| | | <sql id="Base_Column_List">ucr_id,ucr_good_id,ucr_good_source,ucr_user_coupon_id,ucr_coupon_type,ucr_order_no,ucr_state,ucr_create_time,ucr_update_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_user_system_coupon_record where ucr_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_user_system_coupon_record where ucr_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_system_coupon_record (ucr_id,ucr_good_id,ucr_good_source,ucr_user_coupon_id,ucr_coupon_type,ucr_order_no,ucr_state,ucr_create_time,ucr_update_time) values (#{id,jdbcType=BIGINT},#{goodId,jdbcType=BIGINT},#{goodSource,jdbcType=VARCHAR},#{userSystemCoupon.id,jdbcType=BIGINT},#{couponType,jdbcType=VARCHAR},#{orderNo,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_system_coupon_record |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">ucr_id,</if> |
| | | <if test="goodId != null">ucr_good_id,</if> |
| | | <if test="goodSource != null">ucr_good_source,</if> |
| | | <if test="userSystemCoupon != null">ucr_user_coupon_id,</if> |
| | | <if test="couponType != null">ucr_coupon_type,</if> |
| | | <if test="orderNo != null">ucr_order_no,</if> |
| | | <if test="state != null">ucr_state,</if> |
| | | <if test="createTime != null">ucr_create_time,</if> |
| | | <if test="updateTime != null">ucr_update_time,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="goodId != null">#{goodId,jdbcType=BIGINT},</if> |
| | | <if test="goodSource != null">#{goodSource,jdbcType=VARCHAR},</if> |
| | | <if test="userSystemCoupon != null">#{userSystemCoupon.id,jdbcType=BIGINT},</if> |
| | | <if test="couponType != null">#{couponType,jdbcType=VARCHAR},</if> |
| | | <if test="orderNo != null">#{orderNo,jdbcType=VARCHAR},</if> |
| | | <if test="state != null">#{state,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord">update yeshi_ec_user_system_coupon_record set ucr_good_id = #{goodId,jdbcType=BIGINT},ucr_good_source = #{goodSource,jdbcType=VARCHAR},ucr_user_coupon_id = #{userSystemCoupon.id,jdbcType=BIGINT},ucr_coupon_type = #{couponType,jdbcType=VARCHAR},ucr_order_no = #{orderNo,jdbcType=VARCHAR},ucr_state = #{state,jdbcType=INTEGER},ucr_create_time = #{createTime,jdbcType=TIMESTAMP},ucr_update_time = #{updateTime,jdbcType=TIMESTAMP} where ucr_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord">update yeshi_ec_user_system_coupon_record |
| | | <set> |
| | | <if test="goodId != null">ucr_good_id=#{goodId,jdbcType=BIGINT},</if> |
| | | <if test="goodSource != null">ucr_good_source=#{goodSource,jdbcType=VARCHAR},</if> |
| | | <if test="userSystemCoupon != null">ucr_user_coupon_id=#{userSystemCoupon.id,jdbcType=BIGINT},</if> |
| | | <if test="couponType != null">ucr_coupon_type=#{couponType,jdbcType=VARCHAR},</if> |
| | | <if test="orderNo != null">ucr_order_no=#{orderNo,jdbcType=VARCHAR},</if> |
| | | <if test="state != null">ucr_state=#{state,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">ucr_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">ucr_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where ucr_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | |
| | | <select id="getRecordByState" 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 uc.`usc_uid` = #{uid} AND cd.`ucr_state` = #{state} |
| | | </select> |
| | | |
| | | <select id="getRecordByOrderNo" 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` = #{orderNo} |
| | | <if test="state != null"> |
| | | AND cd.`ucr_state` = #{state} |
| | | </if> |
| | | </select> |
| | | |
| | | <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 |
| | | <foreach collection="list" item="item" open="(" close=")" |
| | | separator=",">#{item}</foreach> |
| | | </select> |
| | | |
| | | <select id="getCouponByUsingTimeOut" resultMap="BaseResultMap"> |
| | | SELECT * FROM `yeshi_ec_user_system_coupon` cp |
| | | LEFT JOIN `yeshi_ec_user_system_coupon_record` rd ON rd.`ucr_user_coupon_id` = cp.`usc_id` |
| | | WHERE cp.`usc_uid` = #{uid} AND cp.`usc_state` = 2 AND rd.`ucr_state` = 0 |
| | | AND (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(cp.`usc_use_time`)) <![CDATA[>]]> #{number}; |
| | | </select> |
| | | |
| | | </mapper> |
| | | <?xml version="1.0" encoding="UTF-8"?>
|
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | |
|
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.user.UserSystemCouponRecordMapper">
|
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord">
|
| | | <id column="ucr_id" property="id" jdbcType="BIGINT"/>
|
| | | <result column="ucr_good_id" property="goodId" jdbcType="BIGINT"/>
|
| | | <result column="ucr_good_source" property="goodSource" jdbcType="VARCHAR"/>
|
| | | <result column="ucr_coupon_type" property="couponType" jdbcType="VARCHAR"/>
|
| | | <result column="ucr_order_no" property="orderNo" jdbcType="VARCHAR"/>
|
| | | <result column="ucr_state" property="state" jdbcType="INTEGER"/>
|
| | | <result column="ucr_create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="ucr_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
| | | |
| | | <association property="userSystemCoupon" column="ucr_user_coupon_id" |
| | | resultMap="com.yeshi.fanli.dao.mybatis.user.UserSystemCouponMapper.BaseResultMap"/>
|
| | | |
| | | </resultMap>
|
| | | <sql id="Base_Column_List">ucr_id,ucr_good_id,ucr_good_source,ucr_user_coupon_id,ucr_coupon_type,ucr_order_no,ucr_state,ucr_create_time,ucr_update_time</sql>
|
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
|
| | | <include refid="Base_Column_List"/>from yeshi_ec_user_system_coupon_record where ucr_id = #{id,jdbcType=BIGINT}
|
| | | </select>
|
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_user_system_coupon_record where ucr_id = #{id,jdbcType=BIGINT}</delete>
|
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_system_coupon_record (ucr_id,ucr_good_id,ucr_good_source,ucr_user_coupon_id,ucr_coupon_type,ucr_order_no,ucr_state,ucr_create_time,ucr_update_time) values (#{id,jdbcType=BIGINT},#{goodId,jdbcType=BIGINT},#{goodSource,jdbcType=VARCHAR},#{userSystemCoupon.id,jdbcType=BIGINT},#{couponType,jdbcType=VARCHAR},#{orderNo,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
|
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_system_coupon_record
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">ucr_id,</if>
|
| | | <if test="goodId != null">ucr_good_id,</if>
|
| | | <if test="goodSource != null">ucr_good_source,</if>
|
| | | <if test="userSystemCoupon != null">ucr_user_coupon_id,</if>
|
| | | <if test="couponType != null">ucr_coupon_type,</if>
|
| | | <if test="orderNo != null">ucr_order_no,</if>
|
| | | <if test="state != null">ucr_state,</if>
|
| | | <if test="createTime != null">ucr_create_time,</if>
|
| | | <if test="updateTime != null">ucr_update_time,</if>
|
| | | </trim>values
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if>
|
| | | <if test="goodId != null">#{goodId,jdbcType=BIGINT},</if>
|
| | | <if test="goodSource != null">#{goodSource,jdbcType=VARCHAR},</if>
|
| | | <if test="userSystemCoupon != null">#{userSystemCoupon.id,jdbcType=BIGINT},</if>
|
| | | <if test="couponType != null">#{couponType,jdbcType=VARCHAR},</if>
|
| | | <if test="orderNo != null">#{orderNo,jdbcType=VARCHAR},</if>
|
| | | <if test="state != null">#{state,jdbcType=INTEGER},</if>
|
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
|
| | | </trim>
|
| | | </insert>
|
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord">update yeshi_ec_user_system_coupon_record set ucr_good_id = #{goodId,jdbcType=BIGINT},ucr_good_source = #{goodSource,jdbcType=VARCHAR},ucr_user_coupon_id = #{userSystemCoupon.id,jdbcType=BIGINT},ucr_coupon_type = #{couponType,jdbcType=VARCHAR},ucr_order_no = #{orderNo,jdbcType=VARCHAR},ucr_state = #{state,jdbcType=INTEGER},ucr_create_time = #{createTime,jdbcType=TIMESTAMP},ucr_update_time = #{updateTime,jdbcType=TIMESTAMP} where ucr_id = #{id,jdbcType=BIGINT}</update>
|
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord">update yeshi_ec_user_system_coupon_record
|
| | | <set>
|
| | | <if test="goodId != null">ucr_good_id=#{goodId,jdbcType=BIGINT},</if>
|
| | | <if test="goodSource != null">ucr_good_source=#{goodSource,jdbcType=VARCHAR},</if>
|
| | | <if test="userSystemCoupon != null">ucr_user_coupon_id=#{userSystemCoupon.id,jdbcType=BIGINT},</if>
|
| | | <if test="couponType != null">ucr_coupon_type=#{couponType,jdbcType=VARCHAR},</if>
|
| | | <if test="orderNo != null">ucr_order_no=#{orderNo,jdbcType=VARCHAR},</if>
|
| | | <if test="state != null">ucr_state=#{state,jdbcType=INTEGER},</if>
|
| | | <if test="createTime != null">ucr_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="updateTime != null">ucr_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
|
| | | </set> where ucr_id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | | |
| | | |
| | | <select id="getRecordByState" 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 uc.`usc_uid` = #{uid} AND cd.`ucr_state` = #{state}
|
| | | </select>
|
| | | |
| | | <select id="getRecordByOrderNo" 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` = #{orderNo} |
| | | <if test="state != null">
|
| | | AND cd.`ucr_state` = #{state}
|
| | | </if>
|
| | | </select>
|
| | | |
| | | <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_good_source = #{source} AND cd.`ucr_order_no` in
|
| | | <foreach collection="list" item="item" open="(" close=")"
|
| | | separator=",">#{item}</foreach>
|
| | | </select>
|
| | | |
| | | <select id="getCouponByUsingTimeOut" resultMap="BaseResultMap">
|
| | | SELECT * FROM `yeshi_ec_user_system_coupon` cp
|
| | | LEFT JOIN `yeshi_ec_user_system_coupon_record` rd ON rd.`ucr_user_coupon_id` = cp.`usc_id`
|
| | | WHERE cp.`usc_uid` = #{uid} AND cp.`usc_state` = 2 AND rd.`ucr_state` = 0
|
| | | AND (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(cp.`usc_use_time`)) <![CDATA[>]]> #{number}; |
| | | </select>
|
| | | |
| | | </mapper>
|
| | |
| | | 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 = "已维权";
|
| | |
|
| | | /* 订单维权 判断是否全部维权 */
|
| | | List<TaoBaoWeiQuanOrder> listWQ = taoBaoWeiQuanOrderMapper
|
| | | .selectListByOrderIdAndState(order.getOrderNo(), "维权成功");
|
| | | Integer sourceType = order.getSourceType();
|
| | | if (sourceType != null && sourceType == Constant.SOURCE_TYPE_TAOBAO) {
|
| | | /* 订单维权 判断是否全部维权 */
|
| | | List<TaoBaoWeiQuanOrder> listWQ = taoBaoWeiQuanOrderMapper
|
| | | .selectListByOrderIdAndState(order.getOrderNo(), "维权成功");
|
| | |
|
| | | boolean isPart = false;// 默认失效
|
| | | boolean isPart = false;// 默认失效
|
| | |
|
| | | if (listWQ != null && listWQ.size() > 0) {
|
| | | BigDecimal fanTotalMoney = new BigDecimal(0);
|
| | | for (TaoBaoWeiQuanOrder weiQuanOrder : listWQ) {
|
| | | BigDecimal fanMoney = weiQuanOrder.getFanMoney();
|
| | | if (fanMoney != null) {
|
| | | fanTotalMoney = MoneyBigDecimalUtil.add(fanTotalMoney, fanMoney);
|
| | | if (listWQ != null && listWQ.size() > 0) {
|
| | | BigDecimal fanTotalMoney = new BigDecimal(0);
|
| | | for (TaoBaoWeiQuanOrder weiQuanOrder : listWQ) {
|
| | | BigDecimal fanMoney = weiQuanOrder.getFanMoney();
|
| | | if (fanMoney != null) {
|
| | | fanTotalMoney = MoneyBigDecimalUtil.add(fanTotalMoney, fanMoney);
|
| | | }
|
| | | }
|
| | |
|
| | | if (fanTotalMoney.compareTo(order.getHongBao()) < 0) {
|
| | | isPart = true;
|
| | | }
|
| | | }
|
| | |
|
| | | if (fanTotalMoney.compareTo(order.getHongBao()) < 0) {
|
| | | isPart = true;
|
| | | if (isPart) {
|
| | | hongBaoState = HongBaoV2.STATE_BUFENSHIXIAO; // 部分失效
|
| | | } else {
|
| | | hongBaoState = HongBaoV2.STATE_SHIXIAO; // 全部失效
|
| | | }
|
| | | }
|
| | |
|
| | | if (isPart) {
|
| | | hongBaoState = HongBaoV2.STATE_BUFENSHIXIAO; // 部分失效
|
| | | } else {
|
| | | hongBaoState = HongBaoV2.STATE_SHIXIAO; // 全部失效
|
| | | }
|
| | | }
|
| | | orderStateMap.put("content", orderStateContent);
|
| | |
| | |
|
| | | // 非自购的订单 不显示返利、免单详情
|
| | | if (HongBaoV2.TYPE_ZIGOU != hongBaoType) {
|
| | | // 订单标识
|
| | | order.setSignList(signList);
|
| | |
|
| | | } else {
|
| | |
|
| | | // 是否免单商品
|
| | | boolean freeOrder = false;
|
| | | // 是否奖励成功
|
| | | boolean rewardSuccess = false;
|
| | |
|
| | | Integer sourceType = order.getSourceType();
|
| | | // 奖励订单、免单 使用记录
|
| | | if (couponRecordList != null && couponRecordList.size() > 0) {
|
| | |
|
| | | for (UserSystemCouponRecord couponRecord : couponRecordList) {
|
| | | // 订单号匹配
|
| | | if (order.getOrderNo().equals(couponRecord.getOrderNo())) {
|
| | |
|
| | | String systemCouponType = couponRecord.getCouponType();
|
| | | Integer state = couponRecord.getState();
|
| | |
|
| | | // 奖励订单: 且成功
|
| | | if (CouponTypeEnum.rebatePercentCoupon.name().equals(systemCouponType)
|
| | | && UserSystemCouponRecord.STATE_SUCCESS == state) {
|
| | | rewardSuccess = true;
|
| | | signList.add(PIC_REWARD); // 加入奖励成功图片
|
| | |
|
| | | } else if (CouponTypeEnum.freeCoupon.name().equals(systemCouponType)
|
| | | || CouponTypeEnum.welfareFreeCoupon.name().equals(systemCouponType)) {
|
| | |
|
| | | if (UserSystemCouponRecord.STATE_FREE_ON == state) {
|
| | | // 免单中
|
| | | freeOrder = true;
|
| | | signList.add(PIC_FREE_ON);
|
| | | } else if (UserSystemCouponRecord.STATE_SUCCESS == state) {
|
| | | // 免单成功
|
| | | freeOrder = true;
|
| | | signList.add(PIC_FREE_SUCCEED);
|
| | | } else if (UserSystemCouponRecord.STATE_FAIL_RULE == state
|
| | | || UserSystemCouponRecord.STATE_FAIL_DRAWBACK == state) {
|
| | | // 规则不匹配、退款
|
| | | freeOrder = true;
|
| | | signList.add(PIC_FREE_FAIL);
|
| | | }
|
| | | }
|
| | |
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | // 订单标识
|
| | | order.setSignList(signList);
|
| | |
|
| | | boolean rewardOrder = false;
|
| | |
|
| | | int type = 1; // 1 常规跳转页面 2弹出选项(奖励券)
|
| | | if (rewardSuccess) {
|
| | | // 奖励成功
|
| | | rewardOrder = true;
|
| | | } else if (hasRewardCoupon && !freeOrder && HongBaoV2.TYPE_ZIGOU == hongBaoType
|
| | | && HongBaoV2.STATE_YILINGQU == hongBaoState) {
|
| | | // 有可用的奖励券 、非免单订单 、且已到账的 、返利订单
|
| | | type = 2;
|
| | | rewardOrder = true;
|
| | | }
|
| | |
|
| | | if (rewardOrder) {
|
| | | ClientTextStyleVO rewardStyleVO = new ClientTextStyleVO();
|
| | | // 奖励券进度详情
|
| | | rewardStyleVO.setContent("返利奖励 >");
|
| | | rewardStyleVO.setColor("#E5005C");
|
| | | rewardStyleVO.setBottomColor("#FFDCEA");
|
| | |
|
| | | Map<String, Object> jumpLink = new HashMap<String, Object>();
|
| | | jumpLink.put("orderNo", order.getOrderNo());
|
| | |
|
| | | Map<String, Object> jump = new HashMap<String, Object>();
|
| | | jump.put("type", type);
|
| | | jump.put("params", jumpLink);
|
| | | jump.put("jumpDetail", jumpDetailV2Service.getByTypeCache("rewardCouponDetail"));
|
| | |
|
| | | Map<String, Object> rewardMap = new HashMap<String, Object>();
|
| | | rewardMap.put("text", rewardStyleVO);
|
| | | rewardMap.put("jump", jump);
|
| | |
|
| | | order.setRewardDetail(rewardMap);
|
| | | }
|
| | |
|
| | | if (freeOrder) {
|
| | | ClientTextStyleVO rewardStyleVO = new ClientTextStyleVO();
|
| | | // 返利、免单详情
|
| | | rewardStyleVO.setContent("免单详情 >");
|
| | | rewardStyleVO.setColor("#E5005C");
|
| | | rewardStyleVO.setBottomColor("#FFDCEA");
|
| | |
|
| | | Map<String, Object> jumpLink = new HashMap<String, Object>();
|
| | | jumpLink.put("orderNo", order.getOrderNo());
|
| | |
|
| | | Map<String, Object> jump = new HashMap<String, Object>();
|
| | | jump.put("type", 1); // 页面跳转
|
| | | jump.put("params", jumpLink);
|
| | | jump.put("jumpDetail", jumpDetailV2Service.getByTypeCache("freeCouponDetail"));
|
| | |
|
| | | Map<String, Object> rewardMap = new HashMap<String, Object>();
|
| | | rewardMap.put("text", rewardStyleVO);
|
| | | rewardMap.put("jump", jump);
|
| | |
|
| | | order.setRewardDetail(rewardMap);
|
| | | 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 (list != null && list.size() > 0) {
|
| | | for (UserSystemCouponRecord couponRecord : list) {
|
| | | // 订单号匹配
|
| | | if (order.getOrderNo().equals(couponRecord.getOrderNo())) {
|
| | | Integer state = couponRecord.getState();
|
| | | String systemCouponType = couponRecord.getCouponType();
|
| | | // 奖励订单: 且成功
|
| | | if (CouponTypeEnum.rebatePercentCoupon.name().equals(systemCouponType)
|
| | | && UserSystemCouponRecord.STATE_SUCCESS == state) {
|
| | | rewardSuccess = true;
|
| | | signList.add(PIC_REWARD); // 加入奖励成功图片
|
| | |
|
| | | } else if (CouponTypeEnum.freeCoupon.name().equals(systemCouponType)
|
| | | || CouponTypeEnum.welfareFreeCoupon.name().equals(systemCouponType)) {
|
| | |
|
| | | if (UserSystemCouponRecord.STATE_FREE_ON == state) {
|
| | | // 免单中
|
| | | freeOrder = true;
|
| | | signList.add(PIC_FREE_ON);
|
| | | } else if (UserSystemCouponRecord.STATE_SUCCESS == state) {
|
| | | // 免单成功
|
| | | freeOrder = true;
|
| | | signList.add(PIC_FREE_SUCCEED);
|
| | | } else if (UserSystemCouponRecord.STATE_FAIL_RULE == state
|
| | | || UserSystemCouponRecord.STATE_FAIL_DRAWBACK == state) {
|
| | | // 规则不匹配、退款
|
| | | freeOrder = true;
|
| | | signList.add(PIC_FREE_FAIL);
|
| | | }
|
| | | }
|
| | |
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | // 订单标识
|
| | | order.setSignList(signList);
|
| | |
|
| | | boolean rewardOrder = false;
|
| | |
|
| | | int type = 1; // 1 常规跳转页面 2弹出选项(奖励券)
|
| | | if (rewardSuccess) {
|
| | | // 奖励成功
|
| | | rewardOrder = true;
|
| | | } else if (hasRewardCoupon && !freeOrder && HongBaoV2.TYPE_ZIGOU == hongBaoType
|
| | | && HongBaoV2.STATE_YILINGQU == hongBaoState) {
|
| | | // 有可用的奖励券 、非免单订单 、且已到账的 、返利订单
|
| | | type = 2;
|
| | | rewardOrder = true;
|
| | | }
|
| | |
|
| | | if (rewardOrder) {
|
| | | ClientTextStyleVO rewardStyleVO = new ClientTextStyleVO();
|
| | | // 奖励券进度详情
|
| | | rewardStyleVO.setContent("返利奖励 >");
|
| | | rewardStyleVO.setColor("#E5005C");
|
| | | rewardStyleVO.setBottomColor("#FFDCEA");
|
| | |
|
| | | Map<String, Object> jumpLink = new HashMap<String, Object>();
|
| | | jumpLink.put("orderNo", order.getOrderNo());
|
| | |
|
| | | Map<String, Object> jump = new HashMap<String, Object>();
|
| | | jump.put("type", type);
|
| | | jump.put("params", jumpLink);
|
| | | jump.put("jumpDetail", jumpDetailV2Service.getByTypeCache("rewardCouponDetail"));
|
| | |
|
| | | Map<String, Object> rewardMap = new HashMap<String, Object>();
|
| | | rewardMap.put("text", rewardStyleVO);
|
| | | rewardMap.put("jump", jump);
|
| | |
|
| | | order.setRewardDetail(rewardMap);
|
| | | }
|
| | |
|
| | | if (freeOrder) {
|
| | | ClientTextStyleVO rewardStyleVO = new ClientTextStyleVO();
|
| | | // 返利、免单详情
|
| | | rewardStyleVO.setContent("免单详情 >");
|
| | | rewardStyleVO.setColor("#E5005C");
|
| | | rewardStyleVO.setBottomColor("#FFDCEA");
|
| | |
|
| | | Map<String, Object> jumpLink = new HashMap<String, Object>();
|
| | | jumpLink.put("orderNo", order.getOrderNo());
|
| | |
|
| | | Map<String, Object> jump = new HashMap<String, Object>();
|
| | | jump.put("type", 1); // 页面跳转
|
| | | jump.put("params", jumpLink);
|
| | | jump.put("jumpDetail", jumpDetailV2Service.getByTypeCache("freeCouponDetail"));
|
| | |
|
| | | Map<String, Object> rewardMap = new HashMap<String, Object>();
|
| | | rewardMap.put("text", rewardStyleVO);
|
| | | 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) {
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | Integer sourceType = order.getSourceType();
|
| | | // 奖励订单、免单 使用记录
|
| | | if (couponRecordList != null && couponRecordList.size() > 0) {
|
| | | for (UserSystemCouponRecord couponRecord : couponRecordList) {
|
| | | // 订单号匹配
|
| | | 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();
|
| | | moneyInfoVO.setMoneyType(1); // 默认显示:返 ¥6.6
|
| | |
| | | // 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
|
| | | private boolean iosOnling;
|
| | |
| | | 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
|
| | |
| | | @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
|
| | | private String url;
|
| | |
| | | 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
|