| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | if (record.getExtraInfo() != null) {
|
| | | if (record.getExtraInfo().getOrderCount50More() > 0
|
| | | || record.getExtraInfo().getWeiQuanOrderCount() > 0
|
| | | || record.getExtraInfo().getWeiQuanOrderFanAmount().compareTo(new BigDecimal(0)) > 0)
|
| | | warnLevel = 2;
|
| | | StringBuffer desc = new StringBuffer();
|
| | | desc.append("大于50元订单:" + record.getExtraInfo().getOrderCount50More() + "\n#");
|
| | | desc.append("维权订单数:" + record.getExtraInfo().getWeiQuanOrderCount() + "\n#");
|
| | | desc.append("维权订单退回金额:" + record.getExtraInfo().getWeiQuanOrderFanAmount() + "\n#");
|
| | | desc.append("180天安全订单数:" + record.getExtraInfo().getSafeOrderCount());
|
| | | if (System.currentTimeMillis() > TimeUtil.convertToTimeTemp("2019-06-21", "yyyy-MM-dd")) {
|
| | | desc.append("大笔订单数:" + record.getExtraInfo().getOrderCount50More() + "\n#");
|
| | | desc.append("维权订单数:" + record.getExtraInfo().getWeiQuanOrderCount() + "\n#");
|
| | | desc.append("维权订单佣金:" + record.getExtraInfo().getWeiQuanOrderFanAmount() + "\n#"); |
| | | if (record.getExtraInfo().getOrderCount50More() > 0
|
| | | || record.getExtraInfo().getWeiQuanOrderCount() >1
|
| | | || record.getExtraInfo().getWeiQuanOrderFanAmount().compareTo(new BigDecimal(10)) >= 0)
|
| | | warnLevel = 2;
|
| | | } else {
|
| | | if (record.getExtraInfo().getOrderCount50More() > 0
|
| | | || record.getExtraInfo().getWeiQuanOrderCount() > 0
|
| | | || record.getExtraInfo().getWeiQuanOrderFanAmount().compareTo(new BigDecimal(0)) > 0)
|
| | | warnLevel = 2;
|
| | | desc.append("大于50元订单:" + record.getExtraInfo().getOrderCount50More() + "\n#");
|
| | | desc.append("维权订单数:" + record.getExtraInfo().getWeiQuanOrderCount() + "\n#");
|
| | | desc.append("维权订单退回金额:" + record.getExtraInfo().getWeiQuanOrderFanAmount() + "\n#");
|
| | | desc.append("180天安全订单数:" + record.getExtraInfo().getSafeOrderCount());
|
| | | }
|
| | | record.setExtraInfoStr(desc.toString());
|
| | | }
|
| | | record.setWarnLevel(warnLevel);
|
| | |
| | | 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;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanDrawBack;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanOrder;
|
| | | import com.yeshi.fanli.exception.order.CommonOrderException;
|
| | | import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
|
| | | import com.yeshi.fanli.service.inter.count.TaoBaoOrderCountService;
|
| | |
| | | import com.yeshi.fanli.service.inter.order.CommonOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoWeiQuanDrawBackService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoWeiQuanOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.UserMoneyDetailService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | | @Resource
|
| | | private OrderService orderService;
|
| | |
|
| | |
|
| | | @Resource
|
| | | private HongBaoV2CountService hongBaoV2CountService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private CommonOrderCountService commonOrderCountService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private CommonOrderService commonOrderService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private TaoBaoOrderService taoBaoOrderService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private TaoBaoOrderCountService taoBaoOrderCountService;
|
| | |
|
| | | |
| | | @Resource
|
| | | private TaoBaoWeiQuanDrawBackService taoBaoWeiQuanDrawBackService;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoWeiQuanOrderService taoBaoWeiQuanOrderService;
|
| | |
|
| | | @Resource
|
| | | private UserMoneyDetailService userMoneyDetailService;
|
| | |
|
| | | /**
|
| | | * 统计历史订单-淘宝订单
|
| | | * |
| | | * @param callback
|
| | | * @param request
|
| | | * @param out
|
| | |
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("typeOrder", countByOdrerType);
|
| | | |
| | |
|
| | | // 统计今日 未失效订单数量 相同订单号合并为一单
|
| | | int todayOrder = taoBaoOrderCountService.countToday();
|
| | | // 统计昨日 未失效订单数量 相同订单号合并为一单
|
| | |
| | |
|
| | | data.put("todayOrder", todayOrder);
|
| | | data.put("yesterdayOrder", yesterdayOrder);
|
| | | |
| | |
|
| | | data.put("genzong", yesterdayOrder);
|
| | | data.put("yesterdayOrder", yesterdayOrder);
|
| | | |
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 查询所有用户订单列表
|
| | | * |
| | | * @param callback
|
| | | * @param pageIndex
|
| | | * @param pageSize
|
| | |
| | | * @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, PrintWriter out) {
|
| | |
|
| | | if (pageIndex == null || pageIndex < 1) {
|
| | | pageIndex = 1;
|
| | | }
|
| | | |
| | |
|
| | | if (pageSize == null)
|
| | | pageSize = Constant.PAGE_SIZE;
|
| | |
|
| | |
| | | if (type != null && type == 0) {
|
| | | type = null; // 所有类型订单
|
| | | }
|
| | | |
| | |
|
| | | if (endTime != null && endTime.trim().length() > 0) {
|
| | | endTime += " 23:59:59";
|
| | | }
|
| | |
| | | long count = 0;
|
| | |
|
| | | // 查询列表
|
| | | List<CommonOrderVO> list = commonOrderService.listQuery((pageIndex - 1) * pageSize, pageSize, |
| | | keyType, key, state, type, orderState, startTime, endTime);
|
| | | |
| | | List<CommonOrderVO> list = commonOrderService.listQuery((pageIndex - 1) * pageSize, pageSize, keyType, key,
|
| | | state, type, orderState, startTime, endTime);
|
| | |
|
| | | if (list != null && list.size() > 0) {
|
| | | // 统计总数
|
| | | count = commonOrderService.countQuery(keyType, key, state, type, orderState, startTime, endTime);
|
| | | }
|
| | | |
| | |
|
| | | // 查询是否维权
|
| | | for (CommonOrderVO order : list) {
|
| | | // 查询是否维权
|
| | | TaoBaoWeiQuanOrder weiQuanOrder = taoBaoWeiQuanOrderService.listByorderItemId(order.getTradeId());
|
| | | if (weiQuanOrder != null)// 有维权
|
| | | {
|
| | | order.setState(CommonOrder.STATE_WQ);
|
| | | TaoBaoWeiQuanDrawBack drawBack = taoBaoWeiQuanDrawBackService
|
| | | .selectByOrderItemId(weiQuanOrder.getOrderItemId());
|
| | | if (drawBack != null) {// 已经退款
|
| | | order.setWeiQuanState(weiQuanOrder.getState());
|
| | | // 计算退款资金
|
| | | UserMoneyDetail detail = null;
|
| | | switch (order.getHongBaoType()) {
|
| | | case HongBaoV2.TYPE_ZIGOU:
|
| | | detail = userMoneyDetailService.selectByTypeAndUidAndIdentifyCode(
|
| | | UserMoneyDetailTypeEnum.fanliWeiQuan, Long.parseLong(order.getUserId()),
|
| | | drawBack.getId());
|
| | | if (detail == null)
|
| | | detail = userMoneyDetailService.selectByTypeAndUidAndIdentifyCode(
|
| | | UserMoneyDetailTypeEnum.weiQuan, Long.parseLong(order.getUserId()),
|
| | | drawBack.getId());
|
| | | break;
|
| | | case HongBaoV2.TYPE_YIJI:
|
| | | case HongBaoV2.TYPE_ERJI:
|
| | | case HongBaoV2.TYPE_SHARE_YIJI:
|
| | | case HongBaoV2.TYPE_SHARE_ERJI:
|
| | | detail = userMoneyDetailService.selectByTypeAndUidAndIdentifyCode(
|
| | | UserMoneyDetailTypeEnum.inviteWeiQuan, Long.parseLong(order.getUserId()),
|
| | | drawBack.getId());
|
| | | break;
|
| | |
|
| | | case HongBaoV2.TYPE_SHARE_GOODS:
|
| | | detail = userMoneyDetailService.selectByTypeAndUidAndIdentifyCode(
|
| | | UserMoneyDetailTypeEnum.shareWeiQuan, Long.parseLong(order.getUserId()),
|
| | | drawBack.getId());
|
| | | break;
|
| | | }
|
| | | if (detail != null) {
|
| | | // 退款成功
|
| | | order.setWeiQuanBackMoney(detail.getMoney().abs().toString());
|
| | | } else {// 尚未退款
|
| | | order.setWeiQuanBackMoney("-" + order.getHongBao());
|
| | | }
|
| | |
|
| | | } else {// 尚未退款
|
| | | order.setWeiQuanBackMoney("-" + order.getHongBao());
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 查询订单列表用户uid
|
| | | * |
| | | * @param callback
|
| | | * @param pageIndex
|
| | | * @param pageSize
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getHistoryOrder")
|
| | | public void getHistoryOrder(String callback, Integer pageIndex, Integer pageSize, Long uid, Integer state, Integer type, |
| | | Integer orderState, String orderNo, String startTime, String endTime, PrintWriter out) {
|
| | | public void getHistoryOrder(String callback, Integer pageIndex, Integer pageSize, Long uid, Integer state,
|
| | | Integer type, Integer orderState, String orderNo, String startTime, String endTime, PrintWriter out) {
|
| | |
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("uid不能为空"));
|
| | |
| | | if (pageIndex == null || pageIndex < 1) {
|
| | | pageIndex = 1;
|
| | | }
|
| | | |
| | |
|
| | | if (pageSize == null)
|
| | | pageSize = Constant.PAGE_SIZE;
|
| | |
|
| | |
| | | if (type != null && type == 0) {
|
| | | type = null; // 所有类型订单
|
| | | }
|
| | | |
| | |
|
| | | if (endTime != null && endTime.trim().length() > 0) {
|
| | | endTime += " 23:59:59";
|
| | | }
|
| | |
| | | long count = 0;
|
| | |
|
| | | // 查询列表
|
| | | List<CommonOrderVO> list = commonOrderService.listQueryByUid((pageIndex - 1) * pageSize, pageSize , |
| | | uid, state, type, orderState, orderNo, startTime, endTime, null);
|
| | | List<CommonOrderVO> list = commonOrderService.listQueryByUid((pageIndex - 1) * pageSize, pageSize, uid,
|
| | | state, type, orderState, orderNo, startTime, endTime, null);
|
| | |
|
| | | if (list != null && list.size() > 0) {
|
| | | // 统计总数
|
| | | count = commonOrderService.countQueryByUid(uid, state, type, orderState, orderNo, startTime,
|
| | | endTime, null);
|
| | | count = commonOrderService.countQueryByUid(uid, state, type, orderState, orderNo, startTime, endTime,
|
| | | null);
|
| | | }
|
| | | |
| | |
|
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | |
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "get24HOderChannelCharts")
|
| | | public void get24HOderChannelCharts(String callback, String channelArray, Integer dateType,
|
| | | String year, String startTime, String endTime, PrintWriter out) {
|
| | | public void get24HOderChannelCharts(String callback, String channelArray, Integer dateType, String year,
|
| | | String startTime, String endTime, PrintWriter out) {
|
| | |
|
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
|
| | | if (validateMsg != null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(validateMsg));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) {
|
| | | startTime = null;
|
| | | endTime = null;
|
| | | }
|
| | |
|
| | | |
| | | List<String> channelList = null;
|
| | | if (channelArray != null && channelArray.trim().length() > 0) {
|
| | | Gson gson = new Gson();
|
| | | channelList = gson.fromJson(channelArray, new TypeToken<ArrayList<String>>() {}.getType());
|
| | | channelList = gson.fromJson(channelArray, new TypeToken<ArrayList<String>>() {
|
| | | }.getType());
|
| | | }
|
| | |
|
| | | if (channelList == null || channelList.size() == 0) {
|
| | |
| | | channelList.add("all");
|
| | | }
|
| | |
|
| | | |
| | | if (dateType == 1 && year != null) {
|
| | | year = null; // 设置为空
|
| | | } else if (dateType == 2) {
|
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | |
| | | if (startTime != null)
|
| | | startTime = null;
|
| | |
|
| | | if (endTime != null)
|
| | | endTime = null;
|
| | |
|
| | | } else if (dateType == 3) {
|
| | | if (year != null)
|
| | | year = null; |
| | | |
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | year = null;
|
| | |
|
| | | if (startTime != null)
|
| | | startTime = null;
|
| | |
|
| | | if (endTime != null)
|
| | | endTime = null;
|
| | | }
|
| | | |
| | |
|
| | | try {
|
| | |
|
| | | Gson gson = new Gson();
|
| | |
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | |
|
| | | JSONArray line_list = new JSONArray();
|
| | | |
| | | for (String channel : channelList) {
|
| | | List<Map<String, Object>> list = hongBaoV2CountService.count24HOderByChannel(channel, dateType, year, startTime, endTime);
|
| | |
|
| | | |
| | | for (String channel : channelList) {
|
| | | List<Map<String, Object>> list = hongBaoV2CountService.count24HOderByChannel(channel, dateType, year,
|
| | | startTime, endTime);
|
| | |
|
| | | if ("all".equalsIgnoreCase(channel)) {
|
| | | channel = "总计";
|
| | | }
|
| | | |
| | |
|
| | | JSONObject innerList = new JSONObject();
|
| | | innerList.put("name", channel);
|
| | |
|
| | |
| | | }
|
| | | innerList.put("data", gson.toJson(map.get("value")));
|
| | | }
|
| | | |
| | |
|
| | | line_list.add(innerList);
|
| | | }
|
| | |
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | if (objectDate != null) {
|
| | |
| | | } else {
|
| | | data.put("xAxis_list", gson.toJson(dateList));
|
| | | }
|
| | | |
| | |
|
| | | data.put("line_list", line_list);
|
| | | |
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | |
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 统计提现申请总次数
|
| | | * |
| | | * @param callback
|
| | | * @param channelArray 渠道名 为空是统计所有
|
| | | * @param dateType 显示视图:日-1 、月-2、 年-3
|
| | | * @param state 状态: 1-未到账 2-已到账 3-已失效
|
| | | * @param year |
| | | * @param channelArray
|
| | | * 渠道名 为空是统计所有
|
| | | * @param dateType
|
| | | * 显示视图:日-1 、月-2、 年-3
|
| | | * @param state
|
| | | * 状态: 1-未到账 2-已到账 3-已失效
|
| | | * @param year
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getHongBaoNum")
|
| | | public void getHongBaoNum(String callback,String channelArray, Integer dateType, Integer state,
|
| | | String year, String startTime, String endTime, PrintWriter out) {
|
| | | public void getHongBaoNum(String callback, String channelArray, Integer dateType, Integer state, String year,
|
| | | String startTime, String endTime, PrintWriter out) {
|
| | |
|
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
|
| | | if (validateMsg != null) {
|
| | |
| | | }
|
| | |
|
| | | try {
|
| | | JSONObject data = countHistoryHongBao(channelArray, dateType, state, year, startTime, endTime, 1);
|
| | | JSONObject data = countHistoryHongBao(channelArray, dateType, state, year, startTime, endTime, 1);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("系统异常"));
|
| | |
| | |
|
| | | /**
|
| | | * 统计提现申请总金额
|
| | | * |
| | | * @param callback
|
| | | * @param channelArray 渠道名 为空是统计所有
|
| | | * @param dateType 显示视图:日-1 、月-2、 年-3
|
| | | * @param state 状态: 1-未到账 2-已到账 3-已失效
|
| | | * @param year |
| | | * @param channelArray
|
| | | * 渠道名 为空是统计所有
|
| | | * @param dateType
|
| | | * 显示视图:日-1 、月-2、 年-3
|
| | | * @param state
|
| | | * 状态: 1-未到账 2-已到账 3-已失效
|
| | | * @param year
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getHongBaoMoney")
|
| | | public void getHongBaoMoney(String callback,String channelArray, Integer dateType, Integer state,
|
| | | String year, String startTime, String endTime, PrintWriter out) {
|
| | | public void getHongBaoMoney(String callback, String channelArray, Integer dateType, Integer state, String year,
|
| | | String startTime, String endTime, PrintWriter out) {
|
| | |
|
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
|
| | | if (validateMsg != null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(validateMsg));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | try {
|
| | | |
| | | JSONObject data = countHistoryHongBao(channelArray, dateType, state, year, startTime, endTime, 2);
|
| | |
|
| | | JSONObject data = countHistoryHongBao(channelArray, dateType, state, year, startTime, endTime, 2);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("系统异常"));
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
|
| | | |
| | | /**
|
| | | * 统计红包信息
|
| | | * |
| | | * @param channelArray
|
| | | * @param dateType
|
| | | * @param state
|
| | |
| | | * @return
|
| | | * @throws Exception
|
| | | */
|
| | | public JSONObject countHistoryHongBao(String channelArray, Integer dateType, Integer state, String year, String startTime,
|
| | | String endTime, int countType) throws Exception {
|
| | | public JSONObject countHistoryHongBao(String channelArray, Integer dateType, Integer state, String year,
|
| | | String startTime, String endTime, int countType) throws Exception {
|
| | |
|
| | | if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) {
|
| | | startTime = null;
|
| | | endTime = null;
|
| | | }
|
| | |
|
| | | |
| | | List<String> channelList = null;
|
| | | if (channelArray != null && channelArray.trim().length() > 0) {
|
| | | Gson gson = new Gson();
|
| | | channelList = gson.fromJson(channelArray, new TypeToken<ArrayList<String>>() {}.getType());
|
| | | channelList = gson.fromJson(channelArray, new TypeToken<ArrayList<String>>() {
|
| | | }.getType());
|
| | | }
|
| | |
|
| | | if (channelList == null || channelList.size() == 0) {
|
| | |
| | | channelList.add("all");
|
| | | }
|
| | |
|
| | | |
| | | if (dateType == 1 && year != null) {
|
| | | year = null; // 设置为空
|
| | | } else if (dateType == 2) {
|
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | |
| | | if (startTime != null)
|
| | | startTime = null;
|
| | |
|
| | | if (endTime != null)
|
| | | endTime = null;
|
| | |
|
| | | } else if (dateType == 3) {
|
| | | if (year != null)
|
| | | year = null; |
| | | |
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | year = null;
|
| | |
|
| | | if (startTime != null)
|
| | | startTime = null;
|
| | |
|
| | | if (endTime != null)
|
| | | endTime = null;
|
| | | }
|
| | | |
| | |
|
| | | Gson gson = new Gson();
|
| | | Object objectDate = null;
|
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | | |
| | |
|
| | | JSONArray line_list = new JSONArray();
|
| | | for (String channel : channelList) {
|
| | | List<Map<String, Object>> list = null;
|
| | | if (countType == 1 ) {
|
| | | list = hongBaoV2CountService.countHongBaoNum(channel, dateType, state, year, |
| | | startTime, endTime);
|
| | | if (countType == 1) {
|
| | | list = hongBaoV2CountService.countHongBaoNum(channel, dateType, state, year, startTime, endTime);
|
| | | } else if (countType == 2) {
|
| | | list = hongBaoV2CountService.countHongBaoMoney(channel, dateType, state, year, |
| | | startTime, endTime);
|
| | | list = hongBaoV2CountService.countHongBaoMoney(channel, dateType, state, year, startTime, endTime);
|
| | | }
|
| | | |
| | |
|
| | | if ("all".equalsIgnoreCase(channel)) {
|
| | | channel = "总计";
|
| | | }
|
| | | |
| | |
|
| | | JSONObject innerList = new JSONObject();
|
| | | innerList.put("name", channel);
|
| | |
|
| | |
| | | }
|
| | | innerList.put("data", gson.toJson(map.get("value")));
|
| | | }
|
| | | |
| | |
|
| | | line_list.add(innerList);
|
| | | }
|
| | |
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | if (objectDate != null) {
|
| | |
| | | } else {
|
| | | data.put("xAxis_list", gson.toJson(dateList));
|
| | | }
|
| | | |
| | |
|
| | | data.put("line_list", line_list);
|
| | | |
| | |
|
| | | return data;
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 分类型订单数与比例 |
| | | * 分类型订单数与比例
|
| | | * |
| | | * @param callback
|
| | | * @param dateType 日 -1 月-2 年-3
|
| | | * @param type 返利订单-1 分享订单-2 邀请订单-3 |
| | | * @param dateType
|
| | | * 日 -1 月-2 年-3
|
| | | * @param type
|
| | | * 返利订单-1 分享订单-2 邀请订单-3
|
| | | * @param year
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getTypeNumber")
|
| | | public void getTypeNumber(String callback, Integer dateType, String typeArray, String year,
|
| | | String startTime, String endTime, PrintWriter out) {
|
| | | |
| | | public void getTypeNumber(String callback, Integer dateType, String typeArray, String year, String startTime,
|
| | | String endTime, PrintWriter out) {
|
| | |
|
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
|
| | | if (validateMsg != null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(validateMsg));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) {
|
| | | startTime = null;
|
| | | endTime = null;
|
| | | }
|
| | |
|
| | | |
| | | List<Integer> channelList = null;
|
| | | if (typeArray != null && typeArray.trim().length() > 0) {
|
| | | Gson gson = new Gson();
|
| | | channelList = gson.fromJson(typeArray, new TypeToken<ArrayList<Integer>>() {}.getType());
|
| | | channelList = gson.fromJson(typeArray, new TypeToken<ArrayList<Integer>>() {
|
| | | }.getType());
|
| | | }
|
| | |
|
| | | if (channelList == null || channelList.size() == 0) {
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | |
| | | if (dateType == 1 && year != null) {
|
| | | year = null; // 设置为空
|
| | | } else if (dateType == 2) {
|
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | |
| | | if (startTime != null)
|
| | | startTime = null;
|
| | |
|
| | | if (endTime != null)
|
| | | endTime = null;
|
| | |
|
| | | } else if (dateType == 3) {
|
| | | if (year != null)
|
| | | year = null; |
| | | |
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | year = null;
|
| | |
|
| | | if (startTime != null)
|
| | | startTime = null;
|
| | |
|
| | | if (endTime != null)
|
| | | endTime = null;
|
| | | }
|
| | | |
| | |
|
| | | Gson gson = new Gson();
|
| | | Object objectDate = null;
|
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | | |
| | |
|
| | | try {
|
| | |
|
| | | |
| | | JSONArray line_list = new JSONArray();
|
| | | for (Integer type : channelList) {
|
| | | |
| | | List<Map<String, Object>> list = hongBaoV2CountService.countHongBaoType(dateType,
|
| | | type, year, startTime, endTime);
|
| | | |
| | | |
| | |
|
| | | List<Map<String, Object>> list = hongBaoV2CountService.countHongBaoType(dateType, type, year, startTime,
|
| | | endTime);
|
| | |
|
| | | JSONObject innerList = new JSONObject();
|
| | | if (type == 1) {
|
| | | innerList.put("name", "返利订单");
|
| | |
| | | }
|
| | | innerList.put("data", gson.toJson(map.get("value")));
|
| | | }
|
| | | |
| | |
|
| | | line_list.add(innerList);
|
| | | }
|
| | |
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | if (objectDate != null) {
|
| | |
| | | } else {
|
| | | data.put("xAxis_list", gson.toJson(dateList));
|
| | | }
|
| | | |
| | |
|
| | | data.put("line_list", line_list);
|
| | | |
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 订单跟踪准确率(返利券用户订单/淘宝联盟订单)
|
| | | * |
| | | * @param callback
|
| | | * @param dateType
|
| | | * @param year
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getTrackAccuracyRate")
|
| | | public void getTrackAccuracyRate(String callback, Integer dateType, String year,
|
| | | String startTime, String endTime, PrintWriter out) {
|
| | | |
| | | public void getTrackAccuracyRate(String callback, Integer dateType, String year, String startTime, String endTime,
|
| | | PrintWriter out) {
|
| | |
|
| | | if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) {
|
| | | startTime = null;
|
| | |
| | | if (dateType == 1 && year != null) {
|
| | | year = null; // 设置为空
|
| | | } else if (dateType == 2) {
|
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | |
| | | if (startTime != null)
|
| | | startTime = null;
|
| | |
|
| | | if (endTime != null)
|
| | | endTime = null;
|
| | |
|
| | | } else if (dateType == 3) {
|
| | | if (year != null)
|
| | | year = null; |
| | | |
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | year = null;
|
| | |
|
| | | if (startTime != null)
|
| | | startTime = null;
|
| | |
|
| | | if (endTime != null)
|
| | | endTime = null;
|
| | | }
|
| | | |
| | |
|
| | | try {
|
| | | |
| | |
|
| | | Gson gson = new Gson();
|
| | | Object objectDate = null;
|
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | | |
| | |
|
| | | JSONArray line_list = new JSONArray();
|
| | | |
| | | List<Map<String, Object>> list = commonOrderCountService.getTrackAccuracyRate(dateType,
|
| | | year, startTime, endTime);
|
| | | |
| | |
|
| | | List<Map<String, Object>> list = commonOrderCountService.getTrackAccuracyRate(dateType, year, startTime,
|
| | | endTime);
|
| | |
|
| | | JSONObject innerList = new JSONObject();
|
| | | innerList.put("name", "总计");
|
| | |
|
| | |
| | | }
|
| | | innerList.put("data", gson.toJson(map.get("value")));
|
| | | }
|
| | | |
| | | line_list.add(innerList);
|
| | |
|
| | | line_list.add(innerList);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | if (objectDate != null) {
|
| | |
| | | } else {
|
| | | data.put("xAxis_list", gson.toJson(dateList));
|
| | | }
|
| | | |
| | |
|
| | | data.put("line_list", line_list);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 当前未收货订单数
|
| | | * |
| | | * @param callback
|
| | | * @param type 订单状态-暂未使用
|
| | | * @param type
|
| | | * 订单状态-暂未使用
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getHistoryUnreceived")
|
| | | public void getHistoryUnreceived(String callback, Integer type, PrintWriter out) {
|
| | | try {
|
| | | |
| | |
|
| | | Long total = commonOrderCountService.countByState(1);
|
| | | if (total == null) {
|
| | | total = 0L;
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 维权订单数
|
| | | * |
| | | * @param callback
|
| | | * @param dateType
|
| | | * @param year
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getWeiQaunOrderNumber")
|
| | | public void getWeiQaunOrderNumber(String callback, Integer dateType, String year,
|
| | | String startTime, String endTime, PrintWriter out) {
|
| | | |
| | | public void getWeiQaunOrderNumber(String callback, Integer dateType, String year, String startTime, String endTime,
|
| | | PrintWriter out) {
|
| | |
|
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
|
| | | if (validateMsg != null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(validateMsg));
|
| | |
| | | }
|
| | |
|
| | | try {
|
| | | JSONObject data = countWeiQaunOrder(dateType, year, startTime, endTime, 1);
|
| | | JSONObject data = countWeiQaunOrder(dateType, year, startTime, endTime, 1);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("系统异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 维权订单金额
|
| | | * |
| | | * @param callback
|
| | | * @param dateType
|
| | | * @param year
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getWeiQaunOrderMoney")
|
| | | public void getWeiQaunOrderMoney(String callback, Integer dateType, String year,
|
| | | String startTime, String endTime, PrintWriter out) {
|
| | | |
| | | public void getWeiQaunOrderMoney(String callback, Integer dateType, String year, String startTime, String endTime,
|
| | | PrintWriter out) {
|
| | |
|
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
|
| | | if (validateMsg != null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(validateMsg));
|
| | |
| | | }
|
| | |
|
| | | try {
|
| | | JSONObject data = countWeiQaunOrder(dateType, year, startTime, endTime, 2);
|
| | | JSONObject data = countWeiQaunOrder(dateType, year, startTime, endTime, 2);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("系统异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 统计红包信息
|
| | | * |
| | | * @param channelArray
|
| | | * @param dateType
|
| | | * @param state
|
| | |
| | | * @return
|
| | | * @throws Exception
|
| | | */
|
| | | public JSONObject countWeiQaunOrder(Integer dateType, String year, String startTime,
|
| | | String endTime, int countType) throws Exception {
|
| | | public JSONObject countWeiQaunOrder(Integer dateType, String year, String startTime, String endTime, int countType)
|
| | | throws Exception {
|
| | |
|
| | | if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) {
|
| | | startTime = null;
|
| | |
| | | if (dateType == 1 && year != null) {
|
| | | year = null; // 设置为空
|
| | | } else if (dateType == 2) {
|
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | |
| | | if (startTime != null)
|
| | | startTime = null;
|
| | |
|
| | | if (endTime != null)
|
| | | endTime = null;
|
| | |
|
| | | } else if (dateType == 3) {
|
| | | if (year != null)
|
| | | year = null; |
| | | |
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | year = null;
|
| | |
|
| | | if (startTime != null)
|
| | | startTime = null;
|
| | |
|
| | | if (endTime != null)
|
| | | endTime = null;
|
| | | }
|
| | | |
| | |
|
| | | Gson gson = new Gson();
|
| | | Object objectDate = null;
|
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | | |
| | |
|
| | | JSONArray line_list = new JSONArray();
|
| | | List<Map<String, Object>> list = null;
|
| | | if (countType == 1 ) {
|
| | | if (countType == 1) {
|
| | | list = commonOrderCountService.countWeiQaunOrderNumber(dateType, year, startTime, endTime);
|
| | | } else if (countType == 2) {
|
| | | list = commonOrderCountService.countWeiQaunOrderMoney(dateType, year, startTime, endTime);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | JSONObject innerList = new JSONObject();
|
| | | innerList.put("name", "总计");
|
| | |
|
| | |
| | | }
|
| | | innerList.put("data", gson.toJson(map.get("value")));
|
| | | }
|
| | | |
| | | line_list.add(innerList);
|
| | |
|
| | | line_list.add(innerList);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | if (objectDate != null) {
|
| | |
| | | } else {
|
| | | data.put("xAxis_list", gson.toJson(dateList));
|
| | | }
|
| | | |
| | |
|
| | | data.put("line_list", line_list);
|
| | | |
| | |
|
| | | return data;
|
| | | }
|
| | |
|
| | |
| | | import com.yeshi.fanli.dto.common.CommonContentTypeEnum;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.taobao.SearchFilter;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.service.inter.goods.CommonTemplateContentService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
|
| | |
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
|
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsSecondClass;
|
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsSubClass;
|
| | | import com.yeshi.fanli.entity.bus.clazz.TaoBaoClass;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.bus.lable.QualityFactory;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | |
| | | goodsSubClassService.countClick(acceptData, goodsSubClass);
|
| | | }
|
| | |
|
| | | SearchFilter sf = new SearchFilter();
|
| | | String catesId = "";
|
| | | // 查询是否有淘宝分类ID
|
| | | List<TaoBaoClass> tbClassList = taoBaoClassService.listBySystemSubCid(0, 10, goodsSubClass.getId());
|
| | | if (tbClassList != null && tbClassList.size() > 0)
|
| | | for (TaoBaoClass tbc : tbClassList) {
|
| | | catesId += tbc.getCategoryId() + ",";
|
| | | }
|
| | | if (catesId.endsWith(","))
|
| | | catesId = catesId.substring(0, catesId.length() - 1);
|
| | | sf.setCateIds(catesId);
|
| | | if (!StringUtil.isNullOrEmpty(catesId))// 按分类名称搜索
|
| | | {
|
| | | String searchParam = goodsSubClass.getSearchJson();
|
| | | Gson gs = new Gson();
|
| | | SearchFilter searchfilter = gs.fromJson(searchParam, SearchFilter.class);
|
| | | searchfilter.setCateIds(catesId);
|
| | | searchfilter.setPage(page);
|
| | | searchfilter.setPageSize(20);
|
| | | if (Integer.parseInt(order) == 0)
|
| | | searchfilter.setMaterialId("6707");
|
| | | taoKeGoodsService.setSearchFilter(searchfilter, filter, order, startprice, endprice, fastFilter,
|
| | | totalSales);
|
| | | TaoBaoSearchResult searchResult = TaoKeApiUtil.searchWuLiao(searchfilter);
|
| | | long count = searchResult.getPageEntity().getTotalCount();
|
| | |
|
| | | JSONObject result = new JSONObject();
|
| | |
|
| | | BigDecimal rate = hongBaoManageService.getFanLiRate();
|
| | |
|
| | | List<TaoBaoGoodsBrief> resultGoodsList = searchResult.getTaoBaoGoodsBriefs();
|
| | | // 查询是否超过了最大的商品数
|
| | | if ((resultGoodsList == null || resultGoodsList.size() < 20)
|
| | | && !StringUtil.isNullOrEmpty(goodsSubClass.getKey())) {
|
| | | if (resultGoodsList == null)
|
| | | resultGoodsList = new ArrayList<>();
|
| | |
|
| | | // 需要根据关键字查询
|
| | | searchfilter.setCateIds(null);
|
| | | searchfilter.setPage((int) (count % 20 == 0 ? count / 20 - 1 : count / 20));
|
| | | searchfilter.setPageSize(20);
|
| | | searchfilter.setKey(goodsSubClass.getKey());
|
| | | TaoBaoSearchResult searchResult2 = TaoKeApiUtil.searchWuLiao(searchfilter);
|
| | | if (searchResult2 != null) {
|
| | | List<TaoBaoGoodsBrief> resultListTemp = searchResult2.getTaoBaoGoodsBriefs();
|
| | | if (resultListTemp != null)
|
| | | resultGoodsList.addAll(resultListTemp);
|
| | | }
|
| | | }
|
| | | JSONArray array = new JSONArray();
|
| | | Gson gson2 = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().create();
|
| | | if (resultGoodsList != null)
|
| | | for (TaoBaoGoodsBrief goods : resultGoodsList) {
|
| | | array.add(gson2.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(goods, rate + "", null)));
|
| | | }
|
| | | result.put("result", array);
|
| | | result.put("count", result.optLong("count") + count);
|
| | | out.print(JsonUtil.loadTrueResult(result));
|
| | | return;
|
| | | } else {
|
| | | String searchParam = goodsSubClass.getSearchJson();
|
| | | Gson gs = new Gson();
|
| | | SearchFilter searchfilter = gs.fromJson(searchParam, SearchFilter.class);
|
| | | searchfilter.setCateIds(catesId);
|
| | | searchfilter.setPage(page);
|
| | | searchfilter.setPageSize(20);
|
| | | if (Integer.parseInt(order) == 0)
|
| | | searchfilter.setMaterialId("6707");
|
| | | searchfilter.setKey(goodsSubClass.getKey());
|
| | | taoKeGoodsService.setSearchFilter(searchfilter, filter, order, startprice, endprice, fastFilter,
|
| | | totalSales);
|
| | | JSONObject result = taoKeGoodsService.searchWuLiao(searchfilter);
|
| | | if (1 > 0) {
|
| | | out.print(JsonUtil.loadTrueResult(result));
|
| | | return;
|
| | | }
|
| | | }
|
| | | /* 搜索关键词 */
|
| | | String searchKey = goodsSubClass.getName();
|
| | | String key = goodsSubClass.getKey();
|
| | |
| | | // }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(kw) && (kw.startsWith("http://") || kw.startsWith("https://"))) {
|
| | | out.print(JsonUtil.loadFalseResult("无法搜索链接"));
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("result", new JSONArray());
|
| | | data.put("count", 0);
|
| | | data.put("nav", new JSONArray());
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | listRecommendWords = new ArrayList<String>();
|
| | | }
|
| | |
|
| | | List<TaoBaoShopVO> listShop = taoBaoShopService.getShopByKey(kw);
|
| | | 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)));
|
| | |
| | | List<TaoBaoGoodsBriefExtra> listExtra = new ArrayList<TaoBaoGoodsBriefExtra>();
|
| | | BigDecimal proportion = manageService.getFanLiRate();
|
| | |
|
| | | DaTaoKeGoodsResult result = DaTaoKeApiUtil.search(key, null,null,null, page, 20, sort);
|
| | | DaTaoKeGoodsResult result = DaTaoKeApiUtil.search(key, null, null, null, page, 20, sort);
|
| | | if (result != null && result.getGoodsList() != null)
|
| | | for (DaTaoKeDetailV2 goods : result.getGoodsList()) {
|
| | | listExtra.add(
|
| | |
| | | out.print(JsonUtil.loadFalseResult(4, "商品已下架"));
|
| | | return;
|
| | | }
|
| | |
|
| | | String from = null;
|
| | | if (tljId != null) {
|
| | | from = "taolijin";
|
| | | }
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(template))
|
| | | template = getShareTemplate(uid, hasCoupon, from);
|
| | | template = getShareTemplate(uid, hasCoupon, tljId);
|
| | |
|
| | | // 校验券模板是否正确
|
| | | if (hasCoupon) {
|
| | |
| | | : goodsLink.getCouponLink());
|
| | | }
|
| | | String content = shareGoodsTextTemplateService.createContentByTemplate(template, uid, goods, token, shortLink,
|
| | | hasCoupon, from);
|
| | | hasCoupon, tljId);
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("content", content);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | | }
|
| | |
|
| | | private String getShareTemplate(Long uid, boolean hasCoupon, String from) {
|
| | | private String getShareTemplate(Long uid, boolean hasCoupon, Long tljId) {
|
| | | if (hasCoupon) {
|
| | | if (!StringUtil.isNullOrEmpty(from) && "taolijin".equals(from)) {
|
| | | if (tljId != null) {
|
| | | String template = shareGoodsTextTemplateService.getTaoLiJinTemplate(uid);
|
| | | if (StringUtil.isNullOrEmpty(template))
|
| | | template = configTaoLiJinService.getValueByKey("goods_share_text");
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getShareTextTemplate", method = RequestMethod.POST)
|
| | | public void getShareTextTemplate(AcceptData acceptData, Long uid, String from, Boolean hasCoupon, PrintWriter out) {
|
| | | public void getShareTextTemplate(AcceptData acceptData, Long uid, Long tljId, Boolean hasCoupon, PrintWriter out) {
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | | |
| | | if (hasCoupon == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "是否有券字段为空"));
|
| | | return;
|
| | | }
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("template", getShareTemplate(uid, hasCoupon, from));
|
| | | data.put("template", getShareTemplate(uid, hasCoupon, tljId));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getShareTextTemplateRules", method = RequestMethod.POST)
|
| | | public void getShareTextTemplateRules(AcceptData acceptData, String from, PrintWriter out) {
|
| | | if (!StringUtil.isNullOrEmpty(from) && "taolijin".equals(from)) {
|
| | | public void getShareTextTemplateRules(AcceptData acceptData, Long tljId, PrintWriter out) {
|
| | | if (tljId != null) {
|
| | | out.print(JsonUtil.loadTrueResult( configTaoLiJinService.getValueByKey("share_goods_rules")));
|
| | | } else {
|
| | | out.print(JsonUtil.loadTrueResult(configService.get("share_goods_template_rules")));
|
| | |
| | | import com.yeshi.fanli.service.inter.order.HongBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.LostOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderService;
|
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinDetailService;
|
| | | import com.yeshi.fanli.service.inter.user.AccountMessageService;
|
| | | import com.yeshi.fanli.service.inter.user.BindingAccountService;
|
| | | import com.yeshi.fanli.service.inter.user.ExtractRecordService;
|
| | |
| | |
|
| | | @Resource
|
| | | private MaskKeyService maskKeyService;
|
| | | |
| | | @Resource
|
| | | private UserTaoLiJinDetailService userTaoLiJinDetailService;
|
| | |
|
| | |
|
| | | private static final String PASSWORD_MAX_ERROR = "password_max_error";
|
| | |
| | | if (mySettings.getNoInvitationBonus() == null) {
|
| | | mySettings.setNoInvitationBonus(0);
|
| | | }
|
| | | |
| | | if (mySettings.getOpenSpreadHongBao() == null) {
|
| | | mySettings.setOpenSpreadHongBao(0);
|
| | | if(userTaoLiJinDetailService.countDetail(uid) > 0) {
|
| | | mySettings.setOpenSpreadHongBao(1);
|
| | | } else {
|
| | | mySettings.setOpenSpreadHongBao(0);
|
| | | }
|
| | | }
|
| | | data.put("moduleState", mySettings);
|
| | | |
| | | |
| | | |
| | |
|
| | | int welfareCenterNews = 0;
|
| | | String invitCode = null;
|
| | |
| | | */
|
| | | @RequestMapping(value = "listClass", method = RequestMethod.POST)
|
| | | public void listClass(AcceptData acceptData, PrintWriter out) {
|
| | | List<GoodsClass> list = goodsClassService.getEffectiveClassCache();
|
| | | List<GoodsClass> list =goodsClassService.getEffectiveClassCache();
|
| | | if (list == null ) {
|
| | | list = new ArrayList<GoodsClass>();
|
| | | }
|
| | |
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.taobao.TbImgUtil;
|
| | |
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 处理条件
|
| | | * |
| | | * @param uid
|
| | | * @param tid
|
| | | * @param out
|
| | | */
|
| | | private void doTaoLiJin(String callback, Long uid, Long tid, PrintWriter out) {
|
| | | String tljLink = "";
|
| | | Long auctionId = null;
|
| | | BigDecimal tljMoney=null;
|
| | | TaoBaoGoodsBrief goods = null;
|
| | | try {
|
| | | goods = redisManager.getTaoBaoGoodsBrief(auctionId);
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | }
|
| | |
|
| | | if (goods == null) {// 已经下线
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("商品信息获取失败")));
|
| | | return;
|
| | | }
|
| | |
|
| | | String token = redisManager.getTLJToken(tljLink);
|
| | | if (StringUtil.isNullOrEmpty(token)) {
|
| | | token = TaoKeApiUtil.getTKToken(goods.getPictUrl(), goods.getTitle(), tljLink);
|
| | | }
|
| | |
|
| | | // 券后价
|
| | | BigDecimal afterCouponPrice = TaoBaoUtil.getAfterUseCouplePrice(goods);
|
| | | TaoBaoLink link = new TaoBaoLink();
|
| | | link.setTaoToken(token);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("title", goods.getTitle());
|
| | | if (goods.getImgList() == null)
|
| | | goods.setImgList(new ArrayList<>());
|
| | | goods.getImgList().add(0, TbImgUtil.getTBSizeImg(goods.getPictUrl(), 300));
|
| | | data.put("imgs", goods.getImgList());
|
| | | data.put("couponPrice", afterCouponPrice);
|
| | | // 老版本兼容
|
| | | data.put("quanPrice", afterCouponPrice);
|
| | | data.put("zkPrice", goods.getZkPrice());
|
| | | data.put("shareContent", "长按复制本段文字,打开【手机淘宝】即可领取【特别优惠券】购买下单,");
|
| | | data.put("token", link.getTaoToken());
|
| | | data.put("reservePrice", goods.getReservePrice());
|
| | | data.put("shopType", goods.getUserType() == 1 ? 2 : 1);
|
| | | if (!StringUtil.isNullOrEmpty(goods.getCouponInfo()) && !"无".equalsIgnoreCase(goods.getCouponInfo())) {
|
| | | data.put("couponAmount", MoneyBigDecimalUtil.getWithNoZera(goods.getCouponAmount()));
|
| | | data.put("coupon", true);
|
| | | } else {
|
| | | data.put("coupon", false);
|
| | | }
|
| | | data.put("tljMoney", tljMoney);
|
| | | |
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | }
|
| | |
|
| | | /**
|
| | | *
|
| | | * 方法说明: 获取商品详情
|
| | | *
|
| | |
| | |
|
| | | @SuppressWarnings("unused")
|
| | | @RequestMapping(value = "getGoodsDetail", method = RequestMethod.GET)
|
| | | public void getGoodsDetail(final AcceptData acceptData, final String id, String uid, String callback,
|
| | | public void getGoodsDetail(final AcceptData acceptData, final String id, Long tid, String uid, String callback,
|
| | | PrintWriter out) {
|
| | | long begin = java.lang.System.currentTimeMillis();
|
| | | if (StringUtil.isNullOrEmpty(id)) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "请上传id"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(uid)) {
|
| | | uid = AESUtil.decrypt(uid, Constant.UIDAESKEY);
|
| | | }
|
| | |
|
| | | if (tid != null && tid != 0) {
|
| | | doTaoLiJin(callback, StringUtil.isNullOrEmpty(uid) || Long.parseLong(uid) == 0 ? null : Long.parseLong(uid),
|
| | | tid, out);
|
| | | return;
|
| | | }
|
| | |
|
| | | TaoBaoGoodsBrief goods = null;
|
| | | String token = null;
|
| | | if (!StringUtil.isNullOrEmpty(uid)) {
|
| | |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail; |
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail.UserMoneyDetailTypeEnum; |
| | | import com.yeshi.fanli.vo.money.UserMonthMoneyVO; |
| | | |
| | | public interface UserMoneyDetailMapper extends BaseMapper<UserMoneyDetail> { |
| | |
| | | BigDecimal getTotalMoneyByTypeAndUidWithDate(@Param("uid") Long uid, @Param("typeList") List<String> typeList, |
| | | @Param("minDate") Date minDate, @Param("maxDate") Date maxDate); |
| | | |
| | | /** |
| | | * 根据类型,用户ID,唯一标识查询 |
| | | * @param type |
| | | * @param uid |
| | | * @param sourceIdentifyId |
| | | * @return |
| | | */ |
| | | UserMoneyDetail selectByTypeAndUidAndIdentifyCode(@Param("type") UserMoneyDetailTypeEnum type, |
| | | @Param("uid") Long uid, @Param("sourceIdentifyId") Long sourceIdentifyId); |
| | | |
| | | } |
| | |
| | | package com.yeshi.fanli.dao.mybatis.order; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | @Param("sourceType") int sourceType); |
| | | |
| | | /** |
| | | * 返利超过一定金额的订单数量 |
| | | * 返利超过100的,且最小时间 |
| | | * |
| | | * @param uid |
| | | * @param minTime |
| | | * @return |
| | | */ |
| | | public int countHongBaoOrderCountMoreByUid(@Param("money") BigDecimal money, @Param("uid") Long uid); |
| | | public int countOrderCountMoneyMoreByUidAndMinTime(@Param("uid") Long uid, @Param("minTime") Date minTime, |
| | | @Param("money") BigDecimal money); |
| | | |
| | | /** |
| | | * 维权订单数量(包含邀请赚) |
| | |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | public int countWeiQuanOrderByUid(Long uid); |
| | | public int countWeiQuanOrderByUid(@Param("uid") Long uid, @Param("minTime") Date minTime); |
| | | |
| | | /** |
| | | * 维权订单返还的金额 |
| | |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | public BigDecimal sumWeiQuanOrderFanAmountByUid(Long uid); |
| | | public BigDecimal sumWeiQuanOrderFanAmountByUid(@Param("uid") Long uid, @Param("minTime") Date minTime); |
| | | |
| | | /** |
| | | * 安全订单数量 |
| | | * |
| | | * 维权订单数量 |
| | | * @param uid |
| | | * @param minMoney |
| | | * @param minTime |
| | | * @return |
| | | */ |
| | | public int countSafeOrderByUid(Long uid); |
| | | public int countWeiQuanOrderWithMinCommision(@Param("uid")Long uid,@Param("minMoney") BigDecimal minMoney,@Param("minTime") Date minTime); |
| | | |
| | | } |
| | |
| | | List<DeviceTokenHW> selectByDeviceAndUid(@Param("device") String device, @Param("uid") Long uid); |
| | | |
| | | List<DeviceTokenHW> selectList(@Param("start") long start, @Param("count") int count); |
| | | |
| | | |
| | | List<DeviceTokenHW> selectByUid(Long uid); |
| | | |
| | | Long selectCount(); |
| | | |
| | | List<DeviceTokenHW> selectByDevice(String device); |
| | | |
| | | int bindUidByDevice(@Param("uid") Long uid, @Param("device") String device); |
| | | |
| | | } |
| | |
| | | TaoBaoWeiQuanOrder selectByOrderIdAndOrderItemId(@Param("orderId") String orderId, |
| | | @Param("orderItemId") String orderItemId); |
| | | |
| | | TaoBaoWeiQuanOrder selectByOrderItemId(String orderItemId); |
| | | |
| | | // 按订单号和维权状态查询 |
| | | List<TaoBaoWeiQuanOrder> selectListByOrderIdAndState(@Param("orderId") String orderId, |
| | | @Param("state") String state); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 统计总金额 |
| | | * @param dateType |
| | | * |
| | | * @param dateType |
| | | * @param years |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> countWeiQaunOrderNumber(@Param("dateType")Integer dateType, @Param("year") String year, |
| | | @Param("startTime")String startTime, @Param("endTime")String endTime); |
| | | |
| | | List<Map<String, Object>> countWeiQaunOrderNumber(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | /** |
| | | * 统计总个数 |
| | | * @param dateType |
| | | * |
| | | * @param dateType |
| | | * @param years |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> countWeiQaunOrderMoney(@Param("dateType")Integer dateType, @Param("year") String year, |
| | | @Param("startTime")String startTime, @Param("endTime")String endTime); |
| | | |
| | | List<Map<String, Object>> countWeiQaunOrderMoney(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | } |
| | |
| | | */ |
| | | long countByRankId(Long rankId); |
| | | |
| | | |
| | | /** |
| | | * 获取用户附加信息 |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | UserInfoExtra gerUserRank(Long uid); |
| | | |
| | | } |
| | |
| | | import java.math.BigDecimal;
|
| | | import java.util.List;
|
| | |
|
| | | import org.springframework.data.domain.Sort;
|
| | | import org.springframework.data.mongodb.core.query.Criteria;
|
| | | import org.springframework.data.mongodb.core.query.Query;
|
| | | import org.springframework.stereotype.Repository;
|
| | |
| | | Criteria.where("finalPrice").gte(minPrice.multiply(new BigDecimal(100)).intValue()));
|
| | | query.addCriteria(ca);
|
| | | query.limit(count);
|
| | | query.skip(start);
|
| | | query.skip(start).with(new Sort(Sort.Direction.DESC, "goods.biz30day"));
|
| | | return mongoTemplate.find(query, SuperTaoBaoGoods.class);
|
| | | }
|
| | |
|
| | |
| | | */
|
| | | public class ExtractOrderStatisticDTO {
|
| | |
|
| | | private int orderCount50More;// 返利超过超过50元的订单数量
|
| | | private int orderCount50More;// 返利超过50元的订单数量
|
| | |
|
| | | private Integer orderCount100More;// 返利超过100元的订单数量
|
| | |
|
| | | private int weiQuanOrderCount;// 维权订单数量
|
| | |
|
| | |
| | | this.safeOrderCount = safeOrderCount;
|
| | | }
|
| | |
|
| | | public Integer getOrderCount100More() {
|
| | | return orderCount100More;
|
| | | }
|
| | |
|
| | | public void setOrderCount100More(Integer orderCount100More) {
|
| | | this.orderCount100More = orderCount100More;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | private String salesTip;// 模糊销量
|
| | | @SerializedName("activity_type")
|
| | | private Integer activityType;// 活动类型,0-无活动;1-秒杀;3-限量折扣;12-限时折扣;13-大促活动;14-名品折扣;15-品牌清仓;16-食品超市;17-一元幸运团;18-爱逛街;19-时尚穿搭;20-男人帮;21-9块9;22-竞价活动;23-榜单活动;24-幸运半价购;25-定金预售;26-幸运人气购;27-特色主题活动;28-断码清仓;29-一元话费;30-电器城;31-每日好店;32-品牌卡;101-大促搜索池;102-大促品类分会场;
|
| | |
|
| | | @SerializedName("mall_id")
|
| | | private Long mallId;//店铺ID
|
| | | // mall_id:4217177,cps_sign:null,cat_id:null mall_rate:10
|
| | | |
| | | private Integer state;//状态 1-下线 0-正常
|
| | |
|
| | | public Integer getState() {
|
| | | return state;
|
| | | }
|
| | |
|
| | | public void setState(Integer state) {
|
| | | this.state = state;
|
| | | }
|
| | |
|
| | | public Long getMallId() {
|
| | | return mallId;
|
| | | }
|
| | |
|
| | | public void setMallId(Long mallId) {
|
| | | this.mallId = mallId;
|
| | | }
|
| | |
|
| | | public Long getGoodsId() {
|
| | | return goodsId;
|
| | |
| | | private int totalCount;// 总数量
|
| | | private List<PDDOrder> orderList;// 商品列表
|
| | |
|
| | | public PDDOrderResult() {
|
| | | }
|
| | |
|
| | | public PDDOrderResult(int totalCount, List<PDDOrder> orderList) {
|
| | | this.totalCount = totalCount;
|
| | | this.orderList = orderList;
|
| | | }
|
| | |
|
| | | public int getTotalCount() {
|
| | | return totalCount;
|
| | | }
|
| | |
| | | this.totalCount = totalCount;
|
| | | }
|
| | |
|
| | | public List<PDDOrder> getGoodsList() {
|
| | | public List<PDDOrder> getOrderList() {
|
| | | return orderList;
|
| | | }
|
| | |
|
| | | public void setGoodsList(List<PDDOrder> orderList) {
|
| | | public void setOrderList(List<PDDOrder> orderList) {
|
| | | this.orderList = orderList;
|
| | | }
|
| | |
|
| | | public PDDOrderResult() {
|
| | | }
|
| | |
|
| | | public PDDOrderResult(int totalCount, List<PDDOrder> orderList) {
|
| | | this.totalCount = totalCount;
|
| | | this.orderList = orderList;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | public final static int RULE_HOT_HUWAI = 100 + 13;
|
| | | public final static int RULE_HOT_XIANGBAO = 100 + 11;
|
| | | public final static int RULE_HAOHUO = 200;
|
| | | public final static int RULE_HAODIAN = 300;
|
| | |
|
| | | public static ActivityUserRule[] RULES = new ActivityUserRule[] { new ActivityUserRule(RULE_DEFAULT, "默认"),
|
| | | new ActivityUserRule(RULE_HOT, "单品热销"), new ActivityUserRule(RULE_HOT_JUJIA, "居家百货"),
|
| | |
| | | package com.yeshi.fanli.entity.bus.help;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | |
| | | * @date 2018年8月14日
|
| | | */
|
| | | @org.yeshi.utils.mybatis.Table("yeshi_ec_help_center")
|
| | | public class HelpCenter {
|
| | | public class HelpCenter implements Serializable{
|
| | |
|
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Column(name = "h_id")
|
| | | private Long id;
|
| | |
| | | package com.yeshi.fanli.entity.bus.help;
|
| | |
|
| | | import java.io.Serializable;
|
| | |
|
| | | import org.springframework.data.annotation.Id;
|
| | | import org.springframework.data.annotation.PersistenceConstructor;
|
| | | import org.springframework.data.mongodb.core.mapping.Document;
|
| | |
| | | *
|
| | | */
|
| | | @Document(collection = "helpInfo")
|
| | | public class HelpInfo {
|
| | | public class HelpInfo implements Serializable{
|
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | | @Id
|
| | | private Long id;// 帮助中心ID
|
| | | private String content;// 具体内容
|
| | |
| | | package com.yeshi.fanli.entity.bus.lable;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | |
| | | * @date 2018年7月3日
|
| | | */
|
| | | @Table("yeshi_ec_quality_factory")
|
| | | public class QualityFactory {
|
| | | public class QualityFactory implements Serializable{
|
| | |
|
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | | // 人工筛选入库
|
| | | public final static int MODE_MANUAL = 1;
|
| | | // 系统算法 -自动入库
|
| | |
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherCouponContentDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherTaoLiJinContentDTO;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | |
|
| | | /**
|
| | |
| | | @Table("yeshi_ec_msg_other")
|
| | | public class MsgOtherDetail {
|
| | | public enum MsgTypeOtherTypeEnum {
|
| | | couponMianDan("免单券"), couponWelfareMianDan("福利免单券"), couponReward("奖励券");
|
| | | couponMianDan("免单券"), couponWelfareMianDan("福利免单券"), couponReward("奖励券"),
|
| | | taoLiJin("推广红包");
|
| | | |
| | | private final String desc;
|
| | |
|
| | | private MsgTypeOtherTypeEnum(String desc) {
|
| | |
| | | // 券内容
|
| | | private MsgOtherCouponContentDTO coupnContent;
|
| | |
|
| | | // 淘礼金参数
|
| | | private MsgOtherTaoLiJinContentDTO taoLiJinContent;
|
| | | |
| | | |
| | | public MsgOtherCouponContentDTO getCoupnContent() {
|
| | | return coupnContent;
|
| | | }
|
| | |
| | | public void setSourceId(Long sourceId) {
|
| | | this.sourceId = sourceId;
|
| | | }
|
| | |
|
| | | public MsgOtherTaoLiJinContentDTO getTaoLiJinContent() {
|
| | | return taoLiJinContent;
|
| | | }
|
| | |
|
| | | public void setTaoLiJinContent(MsgOtherTaoLiJinContentDTO taoLiJinContent) {
|
| | | this.taoLiJinContent = taoLiJinContent;
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | public final static int ORDER_TYPE_TAOBAO = 1;// 淘宝
|
| | | public final static int ORDER_TYPE_JINGDONG = 2;// 京东
|
| | | public final static int ORDER_TYPE_PDD = 3;// 拼多多
|
| | |
|
| | | @Id
|
| | | @GeneratedValue(strategy = GenerationType.AUTO)
|
| | |
| | | // 状态: 默认0 1选中
|
| | | @Column(name = "ucs_state")
|
| | | private Integer state;
|
| | |
|
| | | |
| | | // 创建时间
|
| | | @Column(name = "ucs_create_time")
|
| | | private Date createTime;
|
| | |
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | | |
| | | }
|
| | |
| | | package com.yeshi.fanli.entity.dynamic;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | |
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | |
|
| | | @Document(collection = "dynamic_info")
|
| | | public class DynamicInfo {
|
| | | public class DynamicInfo implements Serializable{
|
| | |
|
| | |
|
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | | // 分享类型 1:单图分享 、2:4图分享、 3:9图分享 、 4:邀请分享
|
| | | public final static int SHARE_TYPE_ONE = 1;
|
| | | public final static int SHARE_TYPE_FOUR = 2;
|
| | |
| | | public class CommonGoods {
|
| | | public static int GOODS_TYPE_TB = 1;// 淘宝天猫
|
| | | public static int GOODS_TYPE_JD = 2;// 京东
|
| | | public static int GOODS_TYPE_PDD = 3;// 拼多多
|
| | |
|
| | | public static int SHOP_TYPE_TB = 1;// 淘宝
|
| | | public static int SHOP_TYPE_TM = 2;// 天猫
|
| | |
| | | private Long id;
|
| | | @Column(name = "dh_token")
|
| | | private String deviceToken;
|
| | | @Column(name = "dh_token_md5")
|
| | | private String deviceTokenMd5;
|
| | | @Column(name = "dh_device")
|
| | | private String device;
|
| | | @Column(name = "dh_uid")
|
| | |
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | |
|
| | | public String getDeviceTokenMd5() {
|
| | | return deviceTokenMd5;
|
| | | }
|
| | |
|
| | | public void setDeviceTokenMd5(String deviceTokenMd5) {
|
| | | this.deviceTokenMd5 = deviceTokenMd5;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsService;
|
| | | |
| | |
|
| | | /**
|
| | | * 限时秒杀 数据更新
|
| | |
| | | if (listTaoKe == null || listTaoKe.size() == 0) {
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | List<Long> listDaoKeId = new ArrayList<Long>();
|
| | | for (DaTaoKeDetail daTaoKeDetail: listTaoKe) {
|
| | | for (DaTaoKeDetail daTaoKeDetail : listTaoKe) {
|
| | | listDaoKeId.add(daTaoKeDetail.getId());
|
| | | }
|
| | | |
| | |
|
| | | List<DaTaoKeDetail> listDetail = daTaoKeGoodsService.listByIds(listDaoKeId);
|
| | | if (listDetail == null || listDetail.size() == 0) {
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | List<TaoBaoGoodsBrief> listgoods = new ArrayList<TaoBaoGoodsBrief>();
|
| | | for (DaTaoKeDetail daTaoKeDetail: listDetail) {
|
| | | listgoods.add( TaoBaoUtil.convert(daTaoKeDetail));
|
| | | for (DaTaoKeDetail daTaoKeDetail : listDetail) {
|
| | | listgoods.add(TaoBaoUtil.convert(daTaoKeDetail));
|
| | | }
|
| | |
|
| | | String formatDate = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date());
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | // 20分钟更新一次
|
| | | @Scheduled(cron = "0 0/20 * * * ? ")
|
| | | // 1个小时更新一次
|
| | | @Scheduled(cron = "0 0 0/1 * * ? ")
|
| | | public void doSyncJob() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | |
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | // 每天早上同步一次
|
| | | @Scheduled(cron = "0 0 6 * * ? ")
|
| | | public void doSyncJobNew() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | |
| | | */
|
| | | @Scheduled(cron = "0 15 0/6 * * ? ")
|
| | | public void removeFlashSaleGoods() {
|
| | |
|
| | | if (!Constant.IS_TASK) {
|
| | | return;
|
| | | }
|
| | |
| | | // 更新品牌商品,每天早上6点执行一次
|
| | | @Scheduled(cron = "0 0 6 * * ? ")
|
| | | public void updateBrandGoods() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | brandClassShopService.updateShopGoods();
|
| | | }
|
| | |
|
| | |
| | | */
|
| | | @Scheduled(cron = "0 0 0/1 * * ?")
|
| | | public void update618() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | LogHelper.test("更新618商品");
|
| | | taoBaoGoodsActivityService.sysncS618Goods();
|
| | | }
|
| | |
| | | income ,if(b.money is null,0,b.money) as expend |
| | | FROM |
| | | |
| | | (select #{item} as `time`) c |
| | | (select #{item} |
| | | as `time`) c |
| | | |
| | | left join |
| | | |
| | | ( |
| | | SELECT |
| | | DATE_FORMAT( |
| | | d.`umd_createtime`,'%Y-%m') AS |
| | | d.`umd_createtime`,'%Y-%m') |
| | | AS |
| | | `time`,SUM(d.`umd_money`) |
| | | AS money |
| | | FROM |
| | |
| | | |
| | | LEFT JOIN |
| | | ( |
| | | SELECT DATE_FORMAT( |
| | | SELECT |
| | | DATE_FORMAT( |
| | | d.`umd_createtime`,'%Y-%m') AS |
| | | `time`,SUM(d.`umd_money`) AS money |
| | | `time`,SUM(d.`umd_money`) |
| | | AS money |
| | | FROM |
| | | `yeshi_ec_user_money_detail` |
| | | d |
| | | WHERE d.`umd_uid`=#{uid} AND |
| | | WHERE d.`umd_uid`=#{uid} |
| | | AND |
| | | d.`umd_money` <![CDATA[<0]]> |
| | | AND DATE_FORMAT( |
| | | d.`umd_createtime`,'%Y-%m')=#{item} GROUP BY |
| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <select id="selectByTypeAndUidAndIdentifyCode" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_user_money_detail where |
| | | umd_uid=#{uid} and |
| | | umd_type=#{type} and umd_source_identify_id=#{sourceIdentifyId} |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | |
| | | </select> |
| | | |
| | | |
| | | <select id="countWeiQuanOrderByUid" parameterType="java.lang.Long" |
| | | <select id="countOrderCountMoneyMoreByUidAndMinTime" resultType="java.lang.Integer"> |
| | | SELECT COUNT(DISTINCT( h.id)) FROM |
| | | ( |
| | | SELECT IF(v.`hb_pid` IS NOT |
| | | NULL,v.`hb_pid`,v.`hb_id`) AS id FROM |
| | | yeshi_ec_hongbao_v2 v WHERE |
| | | v.`hb_uid`=#{uid} |
| | | ) h LEFT JOIN yeshi_ec_hongbao_order ho ON |
| | | h.id=ho.`ho_hongbao_id` LEFT |
| | | JOIN yeshi_ec_common_order co ON |
| | | co.`co_id`=ho.`ho_order_id` WHERE co.`co_third_create_time`>#{minTime} |
| | | and |
| | | (co.`co_estimate`>=#{money} OR co.`co_eIncome`>=#{money}) |
| | | </select> |
| | | |
| | | <select id="countWeiQuanOrderByUid" |
| | | resultType="java.lang.Integer"> |
| | | SELECT COUNT(*) FROM |
| | | ( |
| | | SELECT IF(v.`hb_pid` IS NOT NULL,p.`hb_id`,v.`hb_id`) AS id FROM |
| | | yeshi_ec_hongbao_v2 v LEFT JOIN yeshi_ec_hongbao_v2 p ON |
| | | p.`hb_id`=v.`hb_pid` WHERE v.`hb_uid`=#{0} |
| | | ) a LEFT JOIN yeshi_ec_hongbao_order ho ON ho.`ho_hongbao_id`=a.id LEFT |
| | | JOIN yeshi_ec_common_order co ON co.co_id=ho.`ho_order_id` |
| | | LEFT JOIN `yeshi_ec_taobao_weiqaun_order` wo ON |
| | | SELECT IF(v.`hb_pid` IS NOT |
| | | NULL,p.`hb_id`,v.`hb_id`) AS id FROM |
| | | yeshi_ec_hongbao_v2 v LEFT JOIN |
| | | yeshi_ec_hongbao_v2 p ON |
| | | p.`hb_id`=v.`hb_pid` WHERE v.`hb_uid`=#{uid} and |
| | | v.`hb_create_time`>=#{minTime} |
| | | ) a |
| | | LEFT JOIN yeshi_ec_hongbao_order ho |
| | | ON ho.`ho_hongbao_id`=a.id LEFT |
| | | JOIN yeshi_ec_common_order co ON |
| | | co.co_id=ho.`ho_order_id` |
| | | LEFT JOIN |
| | | `yeshi_ec_taobao_weiqaun_order` wo |
| | | ON |
| | | wo.`tmo_order_item_id`=co.`co_trade_id` |
| | | WHERE co.`co_id`>0 AND wo.`tmo_id`>0 |
| | | WHERE co.`co_id`>0 AND |
| | | wo.`tmo_id`>0 |
| | | |
| | | </select> |
| | | |
| | | <select id="sumWeiQuanOrderFanAmountByUid" parameterType="java.lang.Long" |
| | | resultType="java.math.BigDecimal"> |
| | | SELECT SUM(wo.`tmo_fan_money`) FROM |
| | | <select id="sumWeiQuanOrderFanAmountByUid" resultType="java.math.BigDecimal"> |
| | | SELECT |
| | | SUM(wo.`tmo_fan_money`) FROM |
| | | ( |
| | | SELECT IF(v.`hb_pid` IS NOT NULL,p.`hb_id`,v.`hb_id`) AS id FROM |
| | | yeshi_ec_hongbao_v2 v LEFT JOIN yeshi_ec_hongbao_v2 p ON |
| | | p.`hb_id`=v.`hb_pid` WHERE v.`hb_uid`=#{0} |
| | | ) a LEFT JOIN yeshi_ec_hongbao_order ho ON ho.`ho_hongbao_id`=a.id LEFT |
| | | JOIN yeshi_ec_common_order co ON co.co_id=ho.`ho_order_id` |
| | | SELECT IF(v.`hb_pid` IS |
| | | NOT |
| | | NULL,p.`hb_id`,v.`hb_id`) AS id FROM |
| | | yeshi_ec_hongbao_v2 v LEFT |
| | | JOIN |
| | | yeshi_ec_hongbao_v2 p ON |
| | | p.`hb_id`=v.`hb_pid` WHERE |
| | | v.`hb_uid`=#{uid} |
| | | ) a |
| | | LEFT JOIN yeshi_ec_hongbao_order ho ON |
| | | ho.`ho_hongbao_id`=a.id LEFT |
| | | JOIN yeshi_ec_common_order co ON |
| | | co.co_id=ho.`ho_order_id` |
| | | |
| | | LEFT JOIN `yeshi_ec_taobao_weiqaun_order` wo ON |
| | | LEFT JOIN |
| | | `yeshi_ec_taobao_weiqaun_order` wo |
| | | ON |
| | | wo.`tmo_order_item_id`=co.`co_trade_id` |
| | | WHERE co.`co_id`>0 AND wo.`tmo_id`>0 |
| | | WHERE co.`co_id`>0 AND |
| | | wo.`tmo_id`>0 and co_third_create_time>=#{minTime} |
| | | </select> |
| | | |
| | | |
| | | <select id="countSafeOrderByUid" parameterType="java.lang.Long" |
| | | resultType="java.lang.Integer"> |
| | | SELECT COUNT(co.`co_id`) FROM |
| | | |
| | | <select id="countWeiQuanOrderWithMinCommision" resultType="java.lang.Integer"> |
| | | |
| | | SELECT count(distinct(a.id)) FROM |
| | | ( |
| | | SELECT IF(v.`hb_pid` IS NOT NULL,p.`hb_id`,v.`hb_id`) AS id FROM |
| | | yeshi_ec_hongbao_v2 v LEFT JOIN yeshi_ec_hongbao_v2 p ON |
| | | p.`hb_id`=v.`hb_pid` WHERE v.`hb_uid`=#{0} |
| | | ) a LEFT JOIN yeshi_ec_hongbao_order ho ON ho.`ho_hongbao_id`=a.id LEFT |
| | | JOIN yeshi_ec_common_order co ON co.co_id=ho.`ho_order_id` |
| | | SELECT IF(v.`hb_pid` IS |
| | | NOT |
| | | NULL,p.`hb_id`,v.`hb_id`) AS id FROM |
| | | yeshi_ec_hongbao_v2 v LEFT |
| | | JOIN |
| | | yeshi_ec_hongbao_v2 p ON |
| | | p.`hb_id`=v.`hb_pid` WHERE |
| | | v.`hb_uid`=#{0} |
| | | ) a |
| | | LEFT JOIN yeshi_ec_hongbao_order ho ON |
| | | ho.`ho_hongbao_id`=a.id LEFT |
| | | JOIN yeshi_ec_common_order co ON |
| | | co.co_id=ho.`ho_order_id` |
| | | |
| | | WHERE co.`co_id`>0 AND co.`co_settle_time` IS NOT NULL AND |
| | | (UNIX_TIMESTAMP()- UNIX_TIMESTAMP(co.`co_settle_time`))>180*24*60*60; |
| | | |
| | | LEFT JOIN |
| | | `yeshi_ec_taobao_weiqaun_order` wo |
| | | ON |
| | | wo.`tmo_order_item_id`=co.`co_trade_id` |
| | | WHERE co.`co_id`>0 AND |
| | | tmo_fan_money>=#{minMoney} and co_third_create_time>=#{minTime} |
| | | wo.`tmo_id`>0 and wo |
| | | </select> |
| | | |
| | | |
| | |
| | | <?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.entity.dao.PDDOrderMapper"> |
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.pdd.PDDOrderMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.pdd.PDDOrder"> |
| | | <id column="po_id" property="id" jdbcType="BIGINT" /> |
| | | <result column="po_order_sn" property="orderSn" jdbcType="VARCHAR" /> |
| | |
| | | <result column="dh_token" property="deviceToken" jdbcType="VARCHAR" /> |
| | | <result column="dh_device" property="device" jdbcType="VARCHAR" /> |
| | | <result column="dh_updatetime" property="updateTime" jdbcType="TIMESTAMP" /> |
| | | <result column="dh_token_md5" property="deviceTokenMd5" |
| | | jdbcType="VARCHAR" /> |
| | | <association property="user" column="dh_uid" |
| | | resultMap="com.yeshi.fanli.dao.mybatis.UserInfoMapper.BaseResultMap" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">dh_id,dh_token,dh_device,dh_uid as id,dh_updatetime</sql> |
| | | <sql id="Base_Column_List">dh_id,dh_token,dh_device,dh_uid as |
| | | id,dh_updatetime,dh_token_md5 |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_uid_devicetoken_hw where dh_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectByDeviceAndUid" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_uid_devicetoken_hw where dh_device = #{device} and |
| | | dh_uid=#{uid} |
| | | </select> |
| | | |
| | | <select id="selectList" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_uid_devicetoken_hw limit #{start},#{count} |
| | | </select> |
| | | |
| | | <select id="selectByUid" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_uid_devicetoken_hw where dh_uid = #{0} |
| | | </select> |
| | | |
| | | <select id="selectCount" resultType="java.lang.Long"> |
| | | select |
| | | count(dh_id) |
| | | from |
| | | <select id="selectCount" resultType="java.lang.Long">select count(dh_id) from |
| | | yeshi_ec_uid_devicetoken_hw |
| | | </select> |
| | | |
| | | <select id="selectByDevice" resultMap="BaseResultMap" |
| | | parameterType="java.lang.String"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_uid_devicetoken_hw where dh_device = #{0} |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_uid_devicetoken_hw where dh_id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.push.DeviceTokenHW" |
| | | useGeneratedKeys="true" keyProperty="id">insert into |
| | | yeshi_ec_uid_devicetoken_hw |
| | | (dh_id,dh_token,dh_device,dh_uid,dh_updatetime) values |
| | | (#{id,jdbcType=BIGINT},#{deviceToken,jdbcType=VARCHAR},#{device,jdbcType=VARCHAR},#{user.id,jdbcType=BIGINT},#{updateTime,jdbcType=TIMESTAMP}) |
| | | (dh_id,dh_token,dh_device,dh_uid,dh_updatetime,dh_token_md5) values |
| | | (#{id,jdbcType=BIGINT},#{deviceToken,jdbcType=VARCHAR},#{device,jdbcType=VARCHAR},#{user.id,jdbcType=BIGINT},#{updateTime,jdbcType=TIMESTAMP},#{deviceTokenMd5,jdbcType=VARCHAR}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.push.DeviceTokenHW" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | |
| | | <if test="device != null">dh_device,</if> |
| | | <if test="user != null">dh_uid,</if> |
| | | <if test="updateTime != null">dh_updatetime,</if> |
| | | <if test="deviceTokenMd5 != null">dh_token_md5,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="device != null">#{device,jdbcType=VARCHAR},</if> |
| | | <if test="user != null">#{user.id,jdbcType=BIGINT},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="deviceTokenMd5 != null">#{deviceTokenMd5,jdbcType=VARCHAR}</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.push.DeviceTokenHW">update |
| | |
| | | #{deviceToken,jdbcType=VARCHAR},dh_device = |
| | | #{device,jdbcType=VARCHAR},dh_uid = |
| | | #{user.id,jdbcType=BIGINT},dh_updatetime = |
| | | #{updateTime,jdbcType=TIMESTAMP} where dh_id = |
| | | #{updateTime,jdbcType=TIMESTAMP} ,dh_token_md5 |
| | | =#{deviceTokenMd5,jdbcType=VARCHAR} where dh_id = |
| | | #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.push.DeviceTokenHW"> |
| | | update yeshi_ec_uid_devicetoken_hw |
| | | <set> |
| | |
| | | <if test="device != null">dh_device=#{device,jdbcType=VARCHAR},</if> |
| | | <if test="user != null">dh_uid=#{user.id,jdbcType=BIGINT},</if> |
| | | <if test="updateTime != null">dh_updatetime=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="deviceTokenMd5 !=null">dh_token_md5 =#{deviceTokenMd5,jdbcType=VARCHAR},</if> |
| | | </set> |
| | | where dh_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | |
| | | <update id="bindUidByDevice"> |
| | | update yeshi_ec_uid_devicetoken_hw |
| | | <set> |
| | | dh_uid=#{uid} |
| | | </set> |
| | | where dh_device = #{device} |
| | | </update> |
| | | |
| | | </mapper> |
| | |
| | | from yeshi_ec_taobao_weiqaun_order where tmo_order_id =#{orderId} and |
| | | tmo_state=#{state} |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="selectByOrderItemId" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_taobao_weiqaun_order where tmo_order_item_id =#{0} |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_taobao_weiqaun_order where tmo_id = #{id,jdbcType=BIGINT} |
| | |
| | | |
| | | </resultMap> |
| | | |
| | | <resultMap id="AllResultMap" type="com.yeshi.fanli.entity.bus.user.UserInfoExtra"> |
| | | <id column="uie_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="uie_rank_source" property="rankSource" jdbcType="INTEGER"/> |
| | | <result column="uie_rank_order_num" property="rankOrderNum" jdbcType="INTEGER"/> |
| | | <result column="uie_rank_update_time" property="rankUpdateTime" jdbcType="TIMESTAMP"/> |
| | | <result column="uie_invite_code" property="inviteCode" jdbcType="VARCHAR"/> |
| | | <result column="uie_lottery_newbies" property="lotteryNewbies" jdbcType="INTEGER"/> |
| | | <result column="uie_coupon_news" property="couponNews" jdbcType="INTEGER"/> |
| | | <result column="uie_synch_navbar" property="synchNavbar" jdbcType="VARCHAR"/> |
| | | <result column="uie_first_login_time" property="firstLoginTime" jdbcType="TIMESTAMP"/> |
| | | <result column="uie_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="uie_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | |
| | | <association property="userInfo" column="uie_uid" javaType="com.yeshi.fanli.entity.bus.user.UserInfo"> |
| | | <id column="uie_uid" property="id" jdbcType="BIGINT" /> |
| | | </association> |
| | | |
| | | <association property="userRank" column="uie_rank_id" |
| | | resultMap="com.yeshi.fanli.dao.mybatis.user.UserRankMapper.BaseResultMap"/> |
| | | </resultMap> |
| | | |
| | | |
| | | |
| | | <sql id="Base_Column_List">uie_id,uie_uid,uie_rank_id,uie_rank_source,uie_rank_order_num,uie_rank_update_time,uie_invite_code,uie_lottery_newbies,uie_coupon_news,uie_synch_navbar,uie_first_login_time,uie_create_time,uie_update_time</sql> |
| | | |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | |
| | | WHERE t.`uie_rank_id` = #{rankId} |
| | | </select> |
| | | |
| | | |
| | | <select id="gerUserRank" resultMap="AllResultMap"> |
| | | SELECT * FROM yeshi_ec_user_info_extra ue |
| | | LEFT JOIN yeshi_ec_user_rank rk ON rk.`ur_id` = ue.`uie_rank_id` |
| | | WHERE ue.`uie_uid` = #{uid} |
| | | </select> |
| | | </mapper> |
| | |
| | |
|
| | | import com.yeshi.fanli.dao.dynamic.DynamicInfoDao;
|
| | | import com.yeshi.fanli.dto.taobao.TaoBaoShopDTO;
|
| | | import com.yeshi.fanli.entity.bus.activity.ActivityRuleUser;
|
| | | import com.yeshi.fanli.entity.bus.activity.ActivityUser;
|
| | | import com.yeshi.fanli.entity.bus.activity.RecommendActivity;
|
| | | import com.yeshi.fanli.entity.bus.activity.RecommendActivityInviteInfo;
|
| | |
| | |
|
| | | @Service
|
| | | public class DynamicInfoServiceImpl implements DynamicInfoService {
|
| | | |
| | |
|
| | | @Resource(name = "taskExecutor")
|
| | | private TaskExecutor executor;
|
| | | |
| | |
|
| | | @Resource
|
| | | private DynamicInfoDao dynamicInfoDao;
|
| | |
|
| | | @Resource
|
| | | private RedisManager redisManager;
|
| | | |
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsService daTaoKeGoodsService;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private HongBaoManageService hongBaoManageService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private TaoBaoShopService taoBaoShopService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private InviteMaterialService inviteMaterialService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private QrCodeService qrCodeService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService;
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public void insert(DynamicInfo record) {
|
| | | dynamicInfoDao.insert(record);
|
| | | dynamicInfoDao.insert(record);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public DynamicInfo getById(String id) {
|
| | | return dynamicInfoDao.getById(id);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public void insertTimeInvite() {
|
| | | InviteMaterial inviteMaterial = inviteMaterialService.getInviteMaterial();
|
| | | if (inviteMaterial == null) {
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | Date date = new Date();
|
| | | String materialId = inviteMaterial.getId();
|
| | | String content = inviteMaterial.getText();
|
| | | |
| | | ActivityUser user=activityUserService.selectByPrimaryKey(2L);
|
| | | |
| | |
|
| | | ActivityUser user = activityUserService.selectByPrimaryKey(2L);
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(content)) {
|
| | | DynamicInfo dynamicTxt= new DynamicInfo();
|
| | | DynamicInfo dynamicTxt = new DynamicInfo();
|
| | | dynamicTxt.setId(UUID.randomUUID().toString().replace("-", ""));
|
| | | dynamicTxt.setInviteMaterialId(materialId);
|
| | | dynamicTxt.setClassId(4L);
|
| | |
| | | dynamicTxt.setShareCount(1000 + (int) (Math.random() * 8000));
|
| | | dynamicTxt.setCreateTime(date);
|
| | | dynamicTxt.setUpdateTime(date);
|
| | | |
| | |
|
| | | SimpleDateFormat format = new SimpleDateFormat("MM月dd日");
|
| | | |
| | |
|
| | | StringBuffer buffer = new StringBuffer();
|
| | | buffer.append("-------------------\n");
|
| | | buffer.append("今天 : " + format.format(date));
|
| | |
| | | buffer.append("早安~\n");
|
| | | buffer.append("我的邀请码:【邀请码】\n");
|
| | | buffer.append("购物省钱返利券App:【邀请链接】");
|
| | | |
| | | content = content.replaceAll("\\,", "\\,").replaceAll("\\.", "\\。") .replaceAll("\\;", "\\;")
|
| | |
|
| | | content = content.replaceAll("\\,", "\\,").replaceAll("\\.", "\\。").replaceAll("\\;", "\\;")
|
| | | .replaceAll("\\!", "\\!").replaceAll("\\?", "\\?").replaceAll("\\:", "\\:");
|
| | | |
| | |
|
| | | ClientTextStyleVO row1 = new ClientTextStyleVO();
|
| | | row1.setColor("#333333");
|
| | | row1.setContent(content + "\n" + buffer.toString());
|
| | | List<ClientTextStyleVO> listtitle = new ArrayList<ClientTextStyleVO>();
|
| | | listtitle.add(row1);
|
| | | dynamicTxt.setTitle(listtitle);
|
| | | |
| | |
|
| | | // 空数据
|
| | | List<GoodsPicture> listImg = new ArrayList<GoodsPicture>();
|
| | | dynamicTxt.setImgs(listImg);
|
| | | |
| | |
|
| | | dynamicInfoDao.insert(dynamicTxt);
|
| | | }
|
| | | |
| | |
|
| | | String picture = inviteMaterial.getPicture();
|
| | | if (!StringUtil.isNullOrEmpty(picture)) {
|
| | | DynamicInfo dynamicPic = new DynamicInfo();
|
| | |
| | | dynamicPic.setShareCount(1000 + (int) (Math.random() * 8000));
|
| | | dynamicPic.setCreateTime(date);
|
| | | dynamicPic.setUpdateTime(date);
|
| | | |
| | |
|
| | | try {
|
| | | // 画图
|
| | | String url = qrCodeService.drawInviteToGreet(picture, null, null, null, content, new Date());
|
| | | |
| | |
|
| | | List<ClientTextStyleVO> listtitle = new ArrayList<ClientTextStyleVO>();
|
| | | dynamicPic.setTitle(listtitle);
|
| | | |
| | |
|
| | | GoodsPicture p2 = new GoodsPicture();
|
| | | p2.setW(100);
|
| | | p2.setH(100);
|
| | |
| | | List<GoodsPicture> listImg = new ArrayList<GoodsPicture>();
|
| | | listImg.add(p2);
|
| | | dynamicPic.setImgs(listImg);
|
| | | |
| | |
|
| | | dynamicInfoDao.insert(dynamicPic);
|
| | | } catch (Exception e) {
|
| | | try {
|
| | |
| | | inviteMaterialService.updateState(1, materialId);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public void insertShopInfo() {
|
| | | List<String> brandIdList = DaTaoKeApiUtil.getBrandIdList();
|
| | |
| | | LogHelper.test("大淘客品牌id获取失败(DynamicInfoService-insertShopInfo)");
|
| | | return;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | Long classId = 3L;
|
| | | Long subclassId = 0L;
|
| | | List<DynamicInfo> listInfo = dynamicInfoDao.query(classId, subclassId);
|
| | |
| | | if (listInfo != null && listInfo.size() > 0) {
|
| | | for (int i = 0; i < brandIdList.size(); i++) {
|
| | | String brandId = brandIdList.get(i);
|
| | | |
| | |
|
| | | for (int j = 0; j < listInfo.size(); j++) {
|
| | | String id = listInfo.get(j).getId();
|
| | | if (brandId.equals(id)) {
|
| | | brandIdList.remove(brandId);
|
| | | i--;
|
| | | |
| | |
|
| | | listInfo.remove(listInfo.get(j));
|
| | | j--;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | if (brandIdList == null || brandIdList.size() == 0) {
|
| | | LogHelper.test("大淘客品牌已全部爬取(DynamicInfoService-insertShopInfo)");
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | int index = (int) (Math.random() * brandIdList.size());
|
| | | String brandId = brandIdList.get(index);
|
| | | |
| | |
|
| | | TaoBaoShopDTO dynamicShopInfo = DaTaoKeApiUtil.getDynamicShopInfo(brandId);
|
| | | if (dynamicShopInfo == null) {
|
| | | LogHelper.test("大淘客品牌信息爬取失败(DynamicInfoService-insertShopInfo)");
|
| | | return;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | List<TaoBaoGoodsBrief> listGoods = dynamicShopInfo.getListGoods();
|
| | | if (listGoods == null || listGoods.size() == 0) {
|
| | | LogHelper.test("大淘客品牌商品信息爬取失败(DynamicInfoService-insertShopInfo)");
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | Long sellerId = dynamicShopInfo.getSellerId();
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = listGoods.get(0);
|
| | | TaoBaoShop taoBaoShop = taoBaoShopService.getTaoBaoShop(taoBaoGoodsBrief.getAuctionId(), sellerId);
|
| | |
| | | if (StringUtil.isNullOrEmpty(shopLink)) {
|
| | | taoBaoShop.setShopLink(TaoBaoUtil.getShopLink(taoBaoShop.getId()));
|
| | | }
|
| | | |
| | |
|
| | | DynamicInfo dynamicVO = new DynamicInfo();
|
| | | dynamicVO.setId(brandId);
|
| | | dynamicVO.setClassId(classId);
|
| | | dynamicVO.setSubclassId(subclassId);
|
| | | dynamicVO.setShowType(DynamicInfo.SHOW_TYPE_TWO);
|
| | | dynamicVO.setShop(taoBaoShop);
|
| | | dynamicVO.setUser(activityUserService.listRand(1).get(0));
|
| | | dynamicVO.setCreateTime(DateUtil.reduceRandomMinute(new Date(), 8)); |
| | | List<ActivityRuleUser> userList = activityUserService.listByRuleCode(ActivityRuleUser.RULE_HAODIAN, 1, 50);
|
| | | dynamicVO.setUser(userList.get((int) (userList.size() * Math.random())).getActivityUser());
|
| | | dynamicVO.setCreateTime(DateUtil.reduceRandomMinute(new Date(), 8));
|
| | | dynamicVO.setUpdateTime(new Date());
|
| | | |
| | |
|
| | | // 介绍内容
|
| | | ClientTextStyleVO row1 = new ClientTextStyleVO();
|
| | | row1.setColor("#333333");
|
| | |
| | | List<ClientTextStyleVO> listTitle = new ArrayList<ClientTextStyleVO>();
|
| | | listTitle.add(row1);
|
| | | dynamicVO.setTitle(listTitle);
|
| | | |
| | |
|
| | | // 商品信息
|
| | | List<GoodsPicture> listPicture = new ArrayList<GoodsPicture>();
|
| | | for (TaoBaoGoodsBrief goodsBrief : listGoods) {
|
| | | BigDecimal proportion = hongBaoManageService.getFanLiRate();
|
| | | TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(goodsBrief, proportion.toString(), null);
|
| | | TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(goodsBrief,
|
| | | proportion.toString(), null);
|
| | | taoBaoGoodsBriefExtra.setCouponInfo(null);
|
| | | taoBaoGoodsBriefExtra.setUpdatetime(new Date());
|
| | | |
| | |
|
| | | if (!taoBaoGoodsBriefExtra.isCoupon()) {
|
| | | taoBaoGoodsBriefExtra.setState(1);
|
| | | }
|
| | | |
| | |
|
| | | String goodsId = goodsBrief.getAuctionId().toString();
|
| | | JSONObject item = new JSONObject();
|
| | | item.put("id", goodsId);
|
| | | item.put("from", "dynamics");
|
| | | |
| | |
|
| | | GoodsPicture goodsPicture = new GoodsPicture();
|
| | | goodsPicture.setH(100);
|
| | | goodsPicture.setW(100);
|
| | |
| | | goodsPicture.setJumpDetail(jumpDetailV2Service.getByTypeCache("goodsdetail"));
|
| | | goodsPicture.setParams(item.toString());
|
| | | goodsPicture.setGoods(taoBaoGoodsBriefExtra);
|
| | | |
| | |
|
| | | listPicture.add(goodsPicture);
|
| | | }
|
| | | dynamicVO.setImgs(listPicture);
|
| | | |
| | |
|
| | | dynamicInfoDao.insert(dynamicVO);
|
| | | }
|
| | | |
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public void insertTimeRecommend() {
|
| | | try {
|
| | |
| | | List<GoodsClass> list = DaTaoKeUtil.goodsClasses;
|
| | | int index = (int) (Math.random() * list.size());
|
| | | Long subclassId = list.get(index).getId();
|
| | | int cid = Integer.parseInt(subclassId +"");
|
| | | int cid = Integer.parseInt(subclassId + "");
|
| | | int count = 0;
|
| | | double random = Math.random();
|
| | | if (random > 0.4) {
|
| | |
| | | // 分享奖金
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = TaoBaoUtil.convert(daTaoKe);
|
| | | listGoods.add(taoBaoGoodsBrief);
|
| | | |
| | | TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null);
|
| | |
|
| | | TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief,
|
| | | proportion.toString(), null);
|
| | | if (!taoBaoGoodsBriefExtra.isCoupon()) {
|
| | | taoBaoGoodsBriefExtra.setState(1);
|
| | | }
|
| | | |
| | |
|
| | | BigDecimal money = taoBaoGoodsBriefService.getShareGoodsUserHongBao(taoBaoGoodsBrief);
|
| | | shareMoney = MoneyBigDecimalUtil.add(shareMoney, money);
|
| | | // 商品图片
|
| | |
| | | taoBaoGoodsBriefExtra.setCouponInfo(null);
|
| | | GoodsPicture goodsPicture = getGoodsPicture(daTaoKe);
|
| | | goodsPicture.setGoods(taoBaoGoodsBriefExtra);
|
| | | |
| | |
|
| | | listPicture.add(goodsPicture);
|
| | | }
|
| | |
|
| | |
| | | List<TaoBaoGoodsBrief> listGoods = new ArrayList<TaoBaoGoodsBrief>();
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = TaoBaoUtil.convert(daTaoKe);
|
| | | listGoods.add(taoBaoGoodsBrief);
|
| | | |
| | |
|
| | | BigDecimal proportion = hongBaoManageService.getFanLiRate();
|
| | | TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null);
|
| | | TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief,
|
| | | proportion.toString(), null);
|
| | | if (!taoBaoGoodsBriefExtra.isCoupon()) {
|
| | | taoBaoGoodsBriefExtra.setState(1);
|
| | | }
|
| | | taoBaoGoodsBriefExtra.setTkRate(taoBaoGoodsBrief.getTkRate());
|
| | | |
| | |
|
| | | // 分享奖金
|
| | | BigDecimal shareMoney = taoBaoGoodsBriefService.getShareGoodsUserHongBao(taoBaoGoodsBrief);
|
| | | ClientTextStyleVO shareMoneyDesc = new ClientTextStyleVO();
|
| | |
| | | if (pic.equals(img)) {
|
| | | continue;
|
| | | }
|
| | | |
| | |
|
| | | listimgs.add(img);
|
| | | GoodsPicture picture = new GoodsPicture();
|
| | | picture.setH(100);
|
| | |
| | | listPicture.add(picture);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | taoBaoGoodsBriefExtra.setImgList(imgList);
|
| | |
|
| | | // 组织动态信息
|
| | |
| | | dynamicInfo.setShareType(DynamicInfo.SHARE_TYPE_ONE);
|
| | | dynamicInfo.setShowType(DynamicInfo.SHOW_TYPE_TWO);
|
| | | dynamicInfo.setListGoodsBrief(listGoods);
|
| | | |
| | |
|
| | | String desc = DaTaoKeUtil.getDesc(daTaoKe);
|
| | | if (!StringUtil.isNullOrEmpty(desc)) {
|
| | | int index = desc.lastIndexOf("\n");
|
| | | String newDesc = desc.substring(index + 1);
|
| | | if(StringUtil.isNullOrEmpty(newDesc)) {
|
| | | if (StringUtil.isNullOrEmpty(newDesc)) {
|
| | | desc = desc.substring(0, index);
|
| | | }
|
| | | }
|
| | |
| | | goodsPicture.setW(100);
|
| | | goodsPicture.setUrl(TbImgUtil.getTBSize320Img(daTaoKe.getPic()));
|
| | | goodsPicture.setJumpDetail(jumpDetailV2Service.getByTypeCache("goodsdetail"));
|
| | | |
| | |
|
| | | String goodsId = daTaoKe.getGoodsId().toString();
|
| | | JSONObject item = new JSONObject();
|
| | | item.put("id", goodsId);
|
| | |
| | | return goodsPicture;
|
| | | }
|
| | |
|
| | | |
| | | |
| | | @Override
|
| | | public void insertInviteActivity(RecommendActivity activity) throws Exception{
|
| | | |
| | | public void insertInviteActivity(RecommendActivity activity) throws Exception {
|
| | |
|
| | | String title = activity.getTitle();
|
| | | |
| | |
|
| | | String picUrl = null;
|
| | | List<String> imageList = activity.getImageList();
|
| | | if (imageList != null && imageList.size() > 0) {
|
| | | picUrl = imageList.get(0);
|
| | | }
|
| | | |
| | |
|
| | | if (StringUtil.isNullOrEmpty(title) || StringUtil.isNullOrEmpty(picUrl)) {
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | // 判断是否已存在
|
| | | String dynamicInfoId = null;
|
| | | |
| | | Long activityId = activity.getId();
|
| | |
|
| | | Long activityId = activity.getId();
|
| | | DynamicInfo dynamicVO = dynamicInfoDao.getByActivityId(activityId);
|
| | | if (dynamicVO == null) {
|
| | | dynamicVO = new DynamicInfo();
|
| | |
| | | } else {
|
| | | dynamicInfoId = dynamicVO.getId();
|
| | | }
|
| | | |
| | |
|
| | | if (!StringUtil.isNullOrEmpty(title)) {
|
| | | title = title.replaceAll("<p>", "").replaceAll("</p>", "").replaceAll("<br>", "\n");
|
| | | |
| | |
|
| | | int index = title.lastIndexOf("\n");
|
| | | String newDesc = title.substring(index + 1);
|
| | | if(StringUtil.isNullOrEmpty(newDesc)) {
|
| | | if (StringUtil.isNullOrEmpty(newDesc)) {
|
| | | title = title.substring(0, index);
|
| | | }
|
| | | |
| | | title = title.replaceAll("\\,", "\\,").replaceAll("\\.", "\\。") .replaceAll("\\;", "\\;")
|
| | |
|
| | | title = title.replaceAll("\\,", "\\,").replaceAll("\\.", "\\。").replaceAll("\\;", "\\;")
|
| | | .replaceAll("\\!", "\\!").replaceAll("\\?", "\\?").replaceAll("\\:", "\\:");
|
| | | }
|
| | | |
| | |
|
| | | dynamicVO.setId(UUID.randomUUID().toString().replace("-", ""));
|
| | | dynamicVO.setActivityId(activityId);
|
| | | dynamicVO.setClassId(4L);
|
| | | dynamicVO.setSubclassId(0L);
|
| | | dynamicVO.setShareType(DynamicInfo.SHARE_TYPE_INVITE);
|
| | | dynamicVO.setUpdateTime(new Date());
|
| | | |
| | | |
| | |
|
| | | Integer shareCount = activity.getShareCount();
|
| | | if (shareCount == null || shareCount <= 0) {
|
| | | dynamicVO.setShareCount(1000 + (int) (Math.random() * 8000));
|
| | | } else {
|
| | | dynamicVO.setShareCount(shareCount);
|
| | | }
|
| | | |
| | |
|
| | | // 发布用户
|
| | | ActivityUser activityUser = activity.getActivityUser();
|
| | | if (activityUser == null) {
|
| | |
| | | } else {
|
| | | dynamicVO.setUser(activityUser);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | // 介绍内容
|
| | | List<ClientTextStyleVO> listtitle = new ArrayList<ClientTextStyleVO>();
|
| | | if(!StringUtil.isNullOrEmpty(title)) {
|
| | | if (!StringUtil.isNullOrEmpty(title)) {
|
| | | ClientTextStyleVO row1 = new ClientTextStyleVO();
|
| | | row1.setColor("#333333");
|
| | | row1.setContent(title );
|
| | | row1.setContent(title);
|
| | | listtitle.add(row1);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | // 图片
|
| | | List<GoodsPicture> listImg = new ArrayList<GoodsPicture>();
|
| | | if(StringUtil.isNullOrEmpty(picUrl)) {
|
| | | if (StringUtil.isNullOrEmpty(picUrl)) {
|
| | | dynamicVO.setShowType(DynamicInfo.SHOW_TYPE_ZERO);
|
| | | } else {
|
| | | dynamicVO.setShowType(DynamicInfo.SHOW_TYPE_ONE);
|
| | | RecommendActivityInviteInfo inviteInfo = activity.getInviteInfo();
|
| | | |
| | | Integer pX = null; |
| | |
|
| | | Integer pX = null;
|
| | | Integer pY = null;
|
| | | Integer size = null;
|
| | | if (inviteInfo != null) {
|
| | |
| | | pY = inviteInfo.getPy();
|
| | | size = inviteInfo.getSize();
|
| | | }
|
| | | |
| | |
|
| | | // 图片
|
| | | String imgLink = qrCodeService.drawInviteQrCodeNew(picUrl , null, null, pX, pY, size, null);
|
| | | String imgLink = qrCodeService.drawInviteQrCodeNew(picUrl, null, null, pX, pY, size, null);
|
| | | GoodsPicture p2 = new GoodsPicture();
|
| | | p2.setW(100);
|
| | | p2.setH(100);
|
| | |
| | | p2.setPx(pX);
|
| | | p2.setPy(pY);
|
| | | p2.setSize(size);
|
| | | |
| | |
|
| | | listImg.add(p2);
|
| | | }
|
| | | |
| | |
|
| | | dynamicVO.setImgs(listImg);
|
| | | dynamicVO.setTitle(listtitle);
|
| | | |
| | |
|
| | | if (!StringUtil.isNullOrEmpty(dynamicInfoId)) {
|
| | | dynamicInfoDao.deleteById(dynamicInfoId);
|
| | | }
|
| | | |
| | |
|
| | | dynamicInfoDao.insert(dynamicVO);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public void insertActivityRecommend(RecommendActivity activity) {
|
| | | if (activity == null || activity.getGoodsList() == null) {
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | try {
|
| | | String dynamicInfoId = null;
|
| | | DynamicInfo dynamicInfo = dynamicInfoDao.getByActivityId(activity.getId());
|
| | |
| | | } else {
|
| | | dynamicInfoId = dynamicInfo.getId();
|
| | | }
|
| | | |
| | |
|
| | | dynamicInfo.setClassId(2L);
|
| | | dynamicInfo.setSubclassId(0L);
|
| | | dynamicInfo.setUser(activity.getActivityUser());
|
| | | dynamicInfo.setActivityId(activity.getId());
|
| | | dynamicInfo.setUpdateTime(new Date());
|
| | | |
| | | |
| | |
|
| | | List<ClientTextStyleVO> listtitle = new ArrayList<ClientTextStyleVO>();
|
| | | String title = activity.getTitle();
|
| | | if (!StringUtil.isNullOrEmpty(title)) {
|
| | | title = title.replaceAll("<p>", "");
|
| | | title = title.replaceAll("</p>", "");
|
| | | title = title.replaceAll("<br>", "\n");
|
| | | |
| | |
|
| | | int index = title.lastIndexOf("\n");
|
| | | String newDesc = title.substring(index + 1);
|
| | | if(StringUtil.isNullOrEmpty(newDesc)) {
|
| | | if (StringUtil.isNullOrEmpty(newDesc)) {
|
| | | title = title.substring(0, index);
|
| | | }
|
| | | |
| | |
|
| | | ClientTextStyleVO row1 = new ClientTextStyleVO();
|
| | | row1.setColor("#333333");
|
| | | row1.setContent(title );
|
| | | row1.setContent(title);
|
| | | listtitle.add(row1);
|
| | | }
|
| | | dynamicInfo.setTitle(listtitle);
|
| | | |
| | | |
| | |
|
| | | Integer shareCount = activity.getShareCount();
|
| | | if (shareCount == null || shareCount <= 0) {
|
| | | dynamicInfo.setShareCount(1000 + (int) (Math.random() * 8000));
|
| | | } else {
|
| | | dynamicInfo.setShareCount(shareCount);
|
| | | }
|
| | | |
| | |
|
| | | // 发布用户
|
| | | ActivityUser activityUser = activity.getActivityUser();
|
| | | if (activityUser == null) {
|
| | |
| | |
|
| | | if (activity.getGoodsList() != null) {
|
| | | for (RecommendActivityTaoBaoGoods activityGoods : activity.getGoodsList()) {
|
| | | |
| | |
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = null;
|
| | | TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = null;
|
| | | TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = null;
|
| | | String auctionId = activityGoods.getAuctionId();
|
| | | try {
|
| | | taoBaoGoodsBrief = redisManager.getTaoBaoGoodsBrief(Long.parseLong(auctionId));
|
| | | |
| | | taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null);
|
| | |
|
| | | taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief,
|
| | | proportion.toString(), null);
|
| | | if (!taoBaoGoodsBriefExtra.isCoupon()) {
|
| | | taoBaoGoodsBriefExtra.setState(1);
|
| | | }
|
| | | |
| | |
|
| | | BigDecimal money = taoBaoGoodsBriefService.getShareGoodsUserHongBao(taoBaoGoodsBrief);
|
| | | shareMoney = MoneyBigDecimalUtil.add(shareMoney, money);
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | taoBaoGoodsBrief = activityGoods.getTaoBaoGoodsBrief();
|
| | | taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null);
|
| | | taoBaoGoodsBriefExtra.setState(1);
|
| | | taoBaoGoodsBriefExtra.setCoupon(false);
|
| | | taoBaoGoodsBrief = activityGoods.getTaoBaoGoodsBrief();
|
| | | taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief,
|
| | | proportion.toString(), null);
|
| | | taoBaoGoodsBriefExtra.setState(1);
|
| | | taoBaoGoodsBriefExtra.setCoupon(false);
|
| | | }
|
| | | listGoods.add(taoBaoGoodsBrief);
|
| | | |
| | |
|
| | | // 商品图片
|
| | | taoBaoGoodsBriefExtra.setCouponInfo(null);
|
| | | taoBaoGoodsBriefExtra.setUpdatetime(new Date());
|
| | | |
| | |
|
| | | JSONObject item = new JSONObject();
|
| | | item.put("id", auctionId);
|
| | | item.put("from", "dynamics");
|
| | | |
| | |
|
| | | GoodsPicture goodsPicture = new GoodsPicture();
|
| | | goodsPicture.setH(100);
|
| | | goodsPicture.setW(100);
|
| | |
| | | goodsPicture.setJumpDetail(jumpDetailV2Service.getByTypeCache("goodsdetail"));
|
| | | goodsPicture.setParams(item.toString());
|
| | | goodsPicture.setGoods(taoBaoGoodsBriefExtra);
|
| | | |
| | |
|
| | | listPicture.add(goodsPicture);
|
| | | }
|
| | | }
|
| | | dynamicInfo.setImgs(listPicture);
|
| | | dynamicInfo.setListGoodsBrief(listGoods);
|
| | | |
| | |
|
| | | ClientTextStyleVO shareMoneyDesc = new ClientTextStyleVO();
|
| | | shareMoneyDesc.setColor("#FFFFFF");
|
| | | shareMoneyDesc.setBottomColor("#E8AE48");
|
| | |
| | | dynamicInfo.setShowType(DynamicInfo.SHOW_TYPE_THREE);
|
| | | dynamicInfo.setShareType(DynamicInfo.SHARE_TYPE_NINE); // 分享类型9图
|
| | | }
|
| | | |
| | | |
| | |
|
| | | if (!StringUtil.isNullOrEmpty(dynamicInfoId)) {
|
| | | dynamicInfoDao.deleteById(dynamicInfoId);
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public void deleteActivity(Long activityId) {
|
| | | DynamicInfo dynamicInfo = dynamicInfoDao.getByActivityId(activityId);
|
| | |
| | | dynamicInfoDao.deleteById(dynamicInfo.getId());
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public void removeByDate(Date createTime) {
|
| | | dynamicInfoDao.removeByDate(createTime);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public void updateShareCount(DynamicInfo record) {
|
| | | dynamicInfoDao.updateShareCount(record);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | @Cacheable(value = "dynamicCache", key = "'count-'+#cid+'-'+#subId")
|
| | | public long count(Long cid, Long subId) {
|
| | |
| | | @Cacheable(value = "dynamicCache", key = "'query-'+#start+'-'+#count+'-'+#cid+'-'+#subId")
|
| | | public List<DynamicInfo> query(int start, int count, Long cid, Long subId) {
|
| | | List<DynamicInfo> list = dynamicInfoDao.query(start, count, cid, subId);
|
| | | |
| | |
|
| | | // 更新商品信息
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | |
| | | updateGoodInfo(list);
|
| | | }
|
| | | });
|
| | | |
| | |
|
| | | return list;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 更新商品信息
|
| | | */
|
| | | public void updateGoodInfo(List<DynamicInfo> list) {
|
| | | |
| | |
|
| | | // 外网进行更新
|
| | | if (!Constant.IS_OUTNET) {
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | if (list == null || list.size() == 0) {
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | BigDecimal proportion = hongBaoManageService.getFanLiRate();
|
| | | for (DynamicInfo dynamicInfo: list) {
|
| | | for (DynamicInfo dynamicInfo : list) {
|
| | | // 邀请数据不做更新
|
| | | long classId = dynamicInfo.getClassId();
|
| | | if (classId == 4) {
|
| | | break;
|
| | | }
|
| | | |
| | |
|
| | | // 更新商品信息
|
| | | List<GoodsPicture> imgs = dynamicInfo.getImgs();
|
| | | if (imgs == null || imgs.size() == 0) {
|
| | | continue;
|
| | | }
|
| | | |
| | |
|
| | | // 是否一个小时之内已更新
|
| | | Date updateTime = dynamicInfo.getUpdateTime();
|
| | | if (updateTime != null) {
|
| | | long nd = 1000 * 24 * 60 * 60;// 一天的毫秒数 |
| | | long nh = 1000 * 60 * 60;// 一小时的毫秒数 |
| | | long diff = System.currentTimeMillis() - updateTime.getTime(); |
| | | long day = diff / nd;// 计算差多少天 |
| | | long hour = diff % nd / nh + day * 24;// 计算差多少小时 |
| | | long nd = 1000 * 24 * 60 * 60;// 一天的毫秒数
|
| | | long nh = 1000 * 60 * 60;// 一小时的毫秒数
|
| | | long diff = System.currentTimeMillis() - updateTime.getTime();
|
| | | long day = diff / nd;// 计算差多少天
|
| | | long hour = diff % nd / nh + day * 24;// 计算差多少小时
|
| | | if (hour < 1) {
|
| | | continue;
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | // 已下架ID
|
| | | List<Long> listDown = new ArrayList<Long>();
|
| | | // 商品列表
|
| | | List<TaoBaoGoodsBrief> listGoods = new ArrayList<TaoBaoGoodsBrief>();
|
| | | |
| | | for (GoodsPicture goodsPicture: imgs) {
|
| | |
|
| | | for (GoodsPicture goodsPicture : imgs) {
|
| | | TaoBaoGoodsBriefExtra oldExtra = goodsPicture.getGoods();
|
| | | if (oldExtra == null) {
|
| | | continue;
|
| | | }
|
| | | |
| | |
|
| | | Integer state = oldExtra.getState();
|
| | | if (state != null && state == 1) {
|
| | | continue;
|
| | | }
|
| | | |
| | |
|
| | | try {
|
| | | TaoBaoGoodsBrief goodsBrief = redisManager.getTaoBaoGoodsBrief(oldExtra.getAuctionId());
|
| | | |
| | |
|
| | | // 更新商品信息
|
| | | try {
|
| | | taoBaoGoodsUpdateService.updateTaoBaoGoods(goodsBrief);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | |
| | |
|
| | | listGoods.add(goodsBrief);
|
| | | |
| | | // 更新热销单品的分享奖金 ,其余不做更新
|
| | |
|
| | | // 更新热销单品的分享奖金 ,其余不做更新
|
| | | if (classId == 1) {
|
| | | BigDecimal shareMoney = taoBaoGoodsBriefService.getShareGoodsUserHongBao(goodsBrief);
|
| | | ClientTextStyleVO shareMoneyDesc = new ClientTextStyleVO();
|
| | |
| | | shareMoneyDesc.setContent("预估分享奖金:¥" + shareMoney);
|
| | | dynamicInfo.setDesc(shareMoneyDesc);
|
| | | }
|
| | | |
| | | TaoBaoGoodsBriefExtra newExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(goodsBrief, proportion.toString(), null);
|
| | | |
| | |
|
| | | TaoBaoGoodsBriefExtra newExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(goodsBrief,
|
| | | proportion.toString(), null);
|
| | |
|
| | | if (!newExtra.isCoupon()) {
|
| | | newExtra.setState(1);
|
| | | }
|
| | | newExtra.setUpdatetime(new Date());
|
| | | goodsPicture.setGoods(oldExtra);
|
| | | |
| | |
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | listDown.add(oldExtra.getAuctionId());
|
| | | |
| | |
|
| | | oldExtra.setState(1);
|
| | | oldExtra.setCoupon(false);
|
| | | oldExtra.setUpdatetime(new Date());
|
| | | goodsPicture.setGoods(oldExtra);
|
| | | |
| | |
|
| | | // 商品真实下架
|
| | | goodsPicture.setGoodState(1);
|
| | | |
| | | // 更新热销单品的分享奖金 ,其余不做更新
|
| | |
|
| | | // 更新热销单品的分享奖金 ,其余不做更新
|
| | | if (classId == 1) {
|
| | | ClientTextStyleVO shareMoneyDesc = new ClientTextStyleVO();
|
| | | shareMoneyDesc.setColor("#FFFFFF");
|
| | |
| | | }
|
| | | }
|
| | | dynamicInfo.setImgs(imgs);
|
| | | |
| | |
|
| | | // 商品已下架
|
| | | List<TaoBaoGoodsBrief> listGoodsBrief = dynamicInfo.getListGoodsBrief();
|
| | | if (listGoodsBrief != null && listGoodsBrief.size() > 0) {
|
| | | |
| | | if (listGoods.size() > 0 ) {
|
| | |
|
| | | if (listGoods.size() > 0) {
|
| | | if (classId == 1) {
|
| | | dynamicInfo.setListGoodsBrief(listGoods);
|
| | | } else {
|
| | | for (int i =0; i < listGoodsBrief.size(); i ++) {
|
| | | for (int i = 0; i < listGoodsBrief.size(); i++) {
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = listGoodsBrief.get(i);
|
| | | Long auctionId = taoBaoGoodsBrief.getAuctionId();
|
| | | |
| | |
|
| | | boolean isadd = true;
|
| | | for (TaoBaoGoodsBrief goods: listGoods) {
|
| | | if(goods.getAuctionId().equals(auctionId) || goods.getAuctionId() == auctionId) {
|
| | | for (TaoBaoGoodsBrief goods : listGoods) {
|
| | | if (goods.getAuctionId().equals(auctionId) || goods.getAuctionId() == auctionId) {
|
| | | isadd = false;
|
| | | break;
|
| | | } |
| | | }
|
| | | }
|
| | | |
| | |
|
| | | if (isadd) {
|
| | | // 商品已下架 则添加原来商品信息
|
| | | if (listDown.size() > 0 && listDown.contains(taoBaoGoodsBrief.getAuctionId())) {
|
| | |
| | | }
|
| | | } else {
|
| | | if (listDown.size() > 0) {
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief: listGoodsBrief) {
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) {
|
| | | if (listDown.contains(taoBaoGoodsBrief.getAuctionId())) {
|
| | | taoBaoGoodsBrief.setState(1);
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | dynamicInfo.setUpdateTime(new Date());
|
| | | dynamicInfoDao.updateGoodInfo(dynamicInfo);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | |
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Collections;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | |
|
| | | private static List<CommonContentNav> getCommonNav() {
|
| | | List<CommonContentNav> navList = new ArrayList<>();
|
| | | navList.add(new CommonContentNav("1", "综合"));
|
| | | navList.add(new CommonContentNav("2", "最新"));
|
| | | navList.add(new CommonContentNav("3", "热卖"));
|
| | | navList.add(new CommonContentNav("4", "销量"));
|
| | | navList.add(new CommonContentNav("5", "返利比"));
|
| | | return navList;
|
| | | }
|
| | |
|
| | | private static int getCommonSort(String cid) {
|
| | | int sort = DaTaoKeApiUtil.SORT_DEFAULT;
|
| | | if ("1".equalsIgnoreCase(cid))
|
| | | sort = DaTaoKeApiUtil.SORT_DEFAULT;
|
| | | else if ("2".equalsIgnoreCase(cid))
|
| | | sort = DaTaoKeApiUtil.SORT_CREATETIME;
|
| | | else if ("3".equalsIgnoreCase(cid))
|
| | | sort = DaTaoKeApiUtil.SORT_COUPON_NUM;
|
| | | else if ("4".equalsIgnoreCase(cid))
|
| | | sort = DaTaoKeApiUtil.SORT_SALES;
|
| | | else if ("5".equalsIgnoreCase(cid))
|
| | | sort = DaTaoKeApiUtil.SORT_COMMISSION;
|
| | |
|
| | | return sort;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<CommonContentNav> getNavList(CommonContentTypeEnum type) {
|
| | | List<CommonContentNav> navList = new ArrayList<>();
|
| | |
| | | navList.add(new CommonContentNav("3", "30~50元券"));
|
| | | navList.add(new CommonContentNav("4", "50元以上券"));
|
| | | } else if (type == CommonContentTypeEnum.juJia) {
|
| | | navList.add(new CommonContentNav("1", "综合"));
|
| | | navList.add(new CommonContentNav("2", "最新"));
|
| | | navList.add(new CommonContentNav("3", "热卖"));
|
| | | navList.add(new CommonContentNav("4", "销量"));
|
| | | navList.add(new CommonContentNav("5", "返利比"));
|
| | | navList = getCommonNav();
|
| | | } else if (type == CommonContentTypeEnum.meiShi) {
|
| | | navList.add(new CommonContentNav("1", "综合"));
|
| | | navList.add(new CommonContentNav("2", "最新"));
|
| | | navList.add(new CommonContentNav("3", "热卖"));
|
| | | navList.add(new CommonContentNav("4", "销量"));
|
| | | navList.add(new CommonContentNav("5", "返利比"));
|
| | | navList = getCommonNav();
|
| | | } else if (type == CommonContentTypeEnum.muYin) {
|
| | | navList.add(new CommonContentNav("1", "精选"));
|
| | | navList.add(new CommonContentNav("2", "备孕"));
|
| | |
| | | navList.add(new CommonContentNav("6", "4~6岁"));
|
| | | navList.add(new CommonContentNav("7", "7~12岁"));
|
| | | } else if (type == CommonContentTypeEnum.reMai) {
|
| | | navList.add(new CommonContentNav("1", "综合"));
|
| | | navList.add(new CommonContentNav("2", "最新"));
|
| | | navList.add(new CommonContentNav("3", "热卖"));
|
| | | navList.add(new CommonContentNav("4", "销量"));
|
| | | navList.add(new CommonContentNav("5", "返利比"));
|
| | | navList = getCommonNav();
|
| | | } else if (type == CommonContentTypeEnum.chuanYiDaPei) {
|
| | | navList = getCommonNav();
|
| | | } else if (type == CommonContentTypeEnum.meiZhuangGehu) {
|
| | | navList = getCommonNav();
|
| | | } else if (type == CommonContentTypeEnum.jingPinXieBao) {
|
| | | navList = getCommonNav();
|
| | | } else if (type == CommonContentTypeEnum.chaoNanReMai) {
|
| | | navList = getCommonNav();
|
| | | } else if (type == CommonContentTypeEnum.shuMaShouJi) {
|
| | | navList = getCommonNav();
|
| | | } else if (type == CommonContentTypeEnum.yunDongKuXie) {
|
| | | navList = getCommonNav();
|
| | | }
|
| | |
|
| | | return navList;
|
| | | }
|
| | |
|
| | | |
| | | |
| | | @Cacheable(value = "commonContentCache", key = "#type+'-'+#cid+'-'+#page+'-'+#pageSize")
|
| | | @Override
|
| | | public CommonContentResult getContentList(CommonContentTypeEnum type, String cid, int page, int pageSize) {
|
| | | if (type == CommonContentTypeEnum._9k9)
|
| | | if (type == CommonContentTypeEnum._9k9) {
|
| | | return get9K9Content(cid, page, pageSize);
|
| | |
|
| | | } else if (type == CommonContentTypeEnum.chuanYiDaPei) {
|
| | | return getChuanYiDaPeiContent(cid, page, pageSize);
|
| | | } else if (type == CommonContentTypeEnum.meiZhuangGehu) {
|
| | | return getMeiZhuangGeHuContent(cid, page, pageSize);
|
| | | } else if (type == CommonContentTypeEnum.jingPinXieBao) {
|
| | | return getJingPinXieBaoContent(cid, page, pageSize);
|
| | | } else if (type == CommonContentTypeEnum.chaoNanReMai) {
|
| | | return getJingPinXieBaoContent(cid, page, pageSize);
|
| | | } else if (type == CommonContentTypeEnum.shuMaShouJi) {
|
| | | return getJingPinXieBaoContent(cid, page, pageSize);
|
| | | } else if (type == CommonContentTypeEnum.yunDongKuXie) {
|
| | | return getJingPinXieBaoContent(cid, page, pageSize);
|
| | | } else if (type == CommonContentTypeEnum.chaoNanReMai) {
|
| | | return getChaoNanReMaiContent(cid, page, pageSize);
|
| | | } else if (type == CommonContentTypeEnum.shuMaShouJi) {
|
| | | return getShuMaShouJiContent(cid, page, pageSize);
|
| | | } else if (type == CommonContentTypeEnum.yunDongKuXie) {
|
| | | return getYunDongKuXieContent(cid, page, pageSize);
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | |
| | | return new CommonContentResult(goodsList, count);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 穿衣搭配
|
| | | * |
| | | * @param cid
|
| | | * @param page
|
| | | * @param pageSize
|
| | | * @return
|
| | | */
|
| | | private CommonContentResult getChuanYiDaPeiContent(String cid, int page, int pageSize) {
|
| | | DaTaoKeGoodsResult result = null;
|
| | | List<Integer> cidList = new ArrayList<>();
|
| | | cidList.add(1);// 女装
|
| | | int sort = getCommonSort(cid);
|
| | | result = DaTaoKeApiUtil.search("内衣 女", cidList, null, null, page, pageSize, sort);
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | long count = 0;
|
| | | if (result != null) {
|
| | | count = result.getTotalCount();
|
| | | if (result.getGoodsList() != null)
|
| | | for (DaTaoKeDetailV2 detail : result.getGoodsList())
|
| | | goodsList.add(TaoBaoUtil.convert(detail));
|
| | | }
|
| | | return new CommonContentResult(goodsList, count);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 美妆个护
|
| | | * |
| | | * @param cid
|
| | | * @param page
|
| | | * @param pageSize
|
| | | * @return
|
| | | */
|
| | | private CommonContentResult getMeiZhuangGeHuContent(String cid, int page, int pageSize) {
|
| | | DaTaoKeGoodsResult result = null;
|
| | | List<Integer> cidList = new ArrayList<>();
|
| | | cidList.add(3);// 美妆
|
| | | int sort = getCommonSort(cid);
|
| | | result = DaTaoKeApiUtil.search("洗护", cidList, null, null, page, pageSize, sort);
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | long count = 0;
|
| | | if (result != null) {
|
| | | count = result.getTotalCount();
|
| | | if (result.getGoodsList() != null)
|
| | | for (DaTaoKeDetailV2 detail : result.getGoodsList())
|
| | | goodsList.add(TaoBaoUtil.convert(detail));
|
| | | }
|
| | | return new CommonContentResult(goodsList, count);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 精品鞋包
|
| | | * |
| | | * @param cid
|
| | | * @param page
|
| | | * @param pageSize
|
| | | * @return
|
| | | */
|
| | |
|
| | | private CommonContentResult getJingPinXieBaoContent(String cid, int page, int pageSize) {
|
| | | DaTaoKeGoodsResult result = null;
|
| | | int sort = getCommonSort(cid);
|
| | | result = DaTaoKeApiUtil.search("鞋 女", null, null, null, page, pageSize, sort);
|
| | | DaTaoKeGoodsResult result1 = DaTaoKeApiUtil.search("包 女", null, null, null, page, pageSize, sort);
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | long count = 0;
|
| | | if (result != null) {
|
| | | count = result.getTotalCount() + result1.getTotalCount();
|
| | | if (result.getGoodsList() != null)
|
| | | for (DaTaoKeDetailV2 detail : result.getGoodsList())
|
| | | goodsList.add(TaoBaoUtil.convert(detail));
|
| | | if (result1.getGoodsList() != null)
|
| | | for (DaTaoKeDetailV2 detail : result1.getGoodsList())
|
| | | goodsList.add(TaoBaoUtil.convert(detail));
|
| | | }
|
| | | Collections.shuffle(goodsList);
|
| | | return new CommonContentResult(goodsList, count);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 潮男热卖
|
| | | * |
| | | * @param cid
|
| | | * @param page
|
| | | * @param pageSize
|
| | | * @return
|
| | | */
|
| | | private CommonContentResult getChaoNanReMaiContent(String cid, int page, int pageSize) {
|
| | | DaTaoKeGoodsResult result = null;
|
| | | int sort = getCommonSort(cid);
|
| | | result = DaTaoKeApiUtil.search("潮 男", null, null, null, page, pageSize, sort);
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | long count = 0;
|
| | | if (result != null) {
|
| | | count = result.getTotalCount();
|
| | | if (result.getGoodsList() != null)
|
| | | for (DaTaoKeDetailV2 detail : result.getGoodsList())
|
| | | goodsList.add(TaoBaoUtil.convert(detail));
|
| | | }
|
| | | Collections.shuffle(goodsList);
|
| | | return new CommonContentResult(goodsList, count);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 数码手机
|
| | | * |
| | | * @param cid
|
| | | * @param page
|
| | | * @param pageSize
|
| | | * @return
|
| | | */
|
| | | private CommonContentResult getShuMaShouJiContent(String cid, int page, int pageSize) {
|
| | | DaTaoKeGoodsResult result = null;
|
| | | int sort = getCommonSort(cid);
|
| | | result = DaTaoKeApiUtil.search("电", null, null, null, page, pageSize, sort);
|
| | | DaTaoKeGoodsResult result1 = DaTaoKeApiUtil.search("手机", null, null, null, page, pageSize, sort);
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | long count = 0;
|
| | | if (result != null) {
|
| | | count = result.getTotalCount() + result1.getTotalCount();
|
| | | if (result.getGoodsList() != null)
|
| | | for (DaTaoKeDetailV2 detail : result.getGoodsList())
|
| | | goodsList.add(TaoBaoUtil.convert(detail));
|
| | | if (result1.getGoodsList() != null)
|
| | | for (DaTaoKeDetailV2 detail : result1.getGoodsList())
|
| | | goodsList.add(TaoBaoUtil.convert(detail));
|
| | | }
|
| | | Collections.shuffle(goodsList);
|
| | | return new CommonContentResult(goodsList, count);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 运动酷鞋
|
| | | * |
| | | * @param cid
|
| | | * @param page
|
| | | * @param pageSize
|
| | | * @return
|
| | | */
|
| | | private CommonContentResult getYunDongKuXieContent(String cid, int page, int pageSize) {
|
| | | DaTaoKeGoodsResult result = null;
|
| | | int sort = getCommonSort(cid);
|
| | | result = DaTaoKeApiUtil.search("鞋 男", null, null, null, page, pageSize, sort);
|
| | | DaTaoKeGoodsResult result1 = DaTaoKeApiUtil.search("运动 男", null, null, null, page, pageSize, sort);
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | long count = 0;
|
| | | if (result != null) {
|
| | | count = result.getTotalCount() + result1.getTotalCount();
|
| | | if (result.getGoodsList() != null)
|
| | | for (DaTaoKeDetailV2 detail : result.getGoodsList())
|
| | | goodsList.add(TaoBaoUtil.convert(detail));
|
| | | if (result1.getGoodsList() != null)
|
| | | for (DaTaoKeDetailV2 detail : result1.getGoodsList())
|
| | | goodsList.add(TaoBaoUtil.convert(detail));
|
| | | }
|
| | | Collections.shuffle(goodsList);
|
| | | return new CommonContentResult(goodsList, count);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.goods.ShareGoodsTextTemplateService;
|
| | | import com.yeshi.fanli.service.inter.tlj.GoodsTaoLiJinRateService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | |
|
| | | /**
|
| | |
| | |
|
| | | @Override
|
| | | public String createContentByTemplate(String template, Long uid, TaoBaoGoodsBrief goods, String token,
|
| | | String shortLink, boolean hasCoupon, String from) {
|
| | | String shortLink, boolean hasCoupon, Long tljId) {
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(from) && "taolijin".equals(from)) {
|
| | | if (tljId != null) {
|
| | | BigDecimal spreadMoney = goodsTaoLiJinRateService.getGoodsSpreadMoney(goods);
|
| | | return template.replace("{标题}", goods.getTitle()).replace("{商品原价}", BigDecimalUtil.getWithNoZera( goods.getZkPrice()).toString())
|
| | | .replace("{月销量}", TaoBaoUtil.getSaleCount(goods.getBiz30day())).replace("{领券短链}", shortLink)
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.ThreeSaleExtraInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.exception.ThreeSaleException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.msg.MsgInviteDetailService;
|
| | | import com.yeshi.fanli.service.inter.msg.UserInviteMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private MsgInviteDetailService msgInviteDetailService;
|
| | | |
| | | @Resource
|
| | | private UserTaoLiJinOriginService userTaoLiJinOriginService;
|
| | | |
| | |
|
| | | public UserInfo getBoss(final long uid) {
|
| | | return threeSaleMapper.selectBoss(uid);
|
| | |
| | |
|
| | | // 邀请消息
|
| | | userInviteMsgNotificationService.inviteSuccess(inviter.getId(), threeSale);
|
| | | |
| | | // 奖励淘礼金红包
|
| | | try {
|
| | | String inviteName= invitee.getNickName();
|
| | | if (StringUtil.isNullOrEmpty(inviteName)) {
|
| | | UserInfo userInfo = userInfoService.selectByPKey(invitee.getId());
|
| | | if (userInfo != null) {
|
| | | inviteName= userInfo.getNickName();
|
| | | }
|
| | | }
|
| | | userTaoLiJinOriginService.addInviteWinMoney(inviter.getId(), inviteName);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | ThreeSaleCMQManager.getInstance().addThreeSaleMsg(threeSale);
|
| | | // 邀请消息
|
| | | userInviteMsgNotificationService.inviteSuccess(threeSale.getBoss().getId(), threeSale);
|
| | | |
| | | // 奖励淘礼金红包
|
| | | try {
|
| | | String inviteName= invitee.getNickName();
|
| | | if (StringUtil.isNullOrEmpty(inviteName)) {
|
| | | UserInfo userInfo = userInfoService.selectByPKey(invitee.getId());
|
| | | if (userInfo != null) {
|
| | | inviteName= userInfo.getNickName();
|
| | | }
|
| | | }
|
| | | userTaoLiJinOriginService.addInviteWinMoney(inviterId, inviteName);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | | /**
|
| | |
| | |
|
| | | return data;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | @Cacheable(value = "searchWuLiaoCache", key = "'searchWuLiaoList-'+#sf")
|
| | |
| | | detail.setCreateTime(new Date());
|
| | | msgOtherDetailMapper.insertSelective(detail);
|
| | | userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | } else if (detail.getType() == MsgTypeOtherTypeEnum.taoLiJin) {
|
| | | msgOtherDetailMapper.insertSelective(detail);
|
| | | userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | MsgOrderDetail detail = MsgOrderDetailFactory.createShareOrder(uid, orderId, 0, orderState, payMoney, money,
|
| | | null);
|
| | | // 暂时不推送
|
| | | try {
|
| | | msgOrderDetailService.updateMsgOrderDetail(detail, false);
|
| | | } catch (MsgOrderDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | // try {
|
| | | // msgOrderDetailService.updateMsgOrderDetail(detail, false);
|
| | | // } catch (MsgOrderDetailException e) {
|
| | | // e.printStackTrace();
|
| | | // }
|
| | |
|
| | | }
|
| | |
|
| | |
| | | MsgOrderDetail detail = MsgOrderDetailFactory.createInviteOrder(uid, orderId, 0, orderState, payMoney, money,
|
| | | null);
|
| | | // 暂时不推送
|
| | | try {
|
| | | msgOrderDetailService.updateMsgOrderDetail(detail, false);
|
| | | } catch (MsgOrderDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | // try {
|
| | | // msgOrderDetailService.updateMsgOrderDetail(detail, false);
|
| | | // } catch (MsgOrderDetailException e) {
|
| | | // e.printStackTrace();
|
| | | // }
|
| | |
|
| | | }
|
| | |
|
| | |
| | | package com.yeshi.fanli.service.impl.msg;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.Date;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherCouponContentDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherTaoLiJinContentDTO;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail.MsgTypeOtherTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | // @Override
|
| | | // public void taoLiJinGet(UserSystemCoupon coupon, int percent) {
|
| | | // if (coupon == null || coupon.getUid() == null)
|
| | | // return;
|
| | | // MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createRewardCouponGet(getLeftDay(coupon),
|
| | | // coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
|
| | | // try {
|
| | | // msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
|
| | | // coupon.getId(), dto, MsgTypeOtherTypeEnum.couponReward, "返利已到账后再奖励返利的" + percent + "%"));
|
| | | // } catch (MsgOtherDetailException e) {
|
| | | // e.printStackTrace();
|
| | | // }
|
| | | // }
|
| | | |
| | | @Override
|
| | | public void taoLiJinMsg(Long uid, String beiZhu, MsgOtherTaoLiJinContentDTO content) {
|
| | | try {
|
| | | MsgOtherDetail detail = new MsgOtherDetail();
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setRead(false);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setContent(new Gson().toJson(content));
|
| | | detail.setType(MsgTypeOtherTypeEnum.taoLiJin);
|
| | | msgOtherDetailService.addMsgOtherDetail(detail);
|
| | | } catch (MsgOtherDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.dao.mybatis.order.CommonOrderMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.order.CommonOrderTradeIdMapMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoWeiQuanOrderMapper;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.jd.JDOrder;
|
| | | import com.yeshi.fanli.entity.jd.JDOrderItem;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.entity.order.CommonOrderGoods;
|
| | | import com.yeshi.fanli.entity.order.CommonOrderTradeIdMap;
|
| | | import com.yeshi.fanli.entity.pdd.PDDOrder;
|
| | | import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | |
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.factory.CommonOrderGoodsFactory;
|
| | | import com.yeshi.fanli.util.factory.goods.CommonOrderFactory;
|
| | | import com.yeshi.fanli.util.jd.JDApiUtil;
|
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
| | | wholeOrderState = CommonOrder.STATE_WHOLE_ORDER_BUFENYOUXIAO;
|
| | |
|
| | | for (TaoBaoOrder taoBaoOrder : taoBaoOrders) {
|
| | | CommonOrder commonOrder = commonOrderMapper.selectByOrderNoAndOrderTypeAndOrderBy(taoBaoOrder.getOrderId(),
|
| | | Constant.SOURCE_TYPE_TAOBAO, taoBaoOrder.getOrderBy());
|
| | | if (commonOrder == null)// 新增
|
| | | CommonOrder newCommonOrder = TaoBaoOrderUtil.convert(taoBaoOrder);
|
| | | CommonOrderGoods cog = new CommonOrderGoods();
|
| | | cog.setGoodsId(taoBaoOrder.getAuctionId() + "");
|
| | | cog.setGoodsType(Constant.SOURCE_TYPE_TAOBAO);
|
| | | newCommonOrder.setCommonOrderGoods(cog);
|
| | | newCommonOrder.setStateWholeOrder(wholeOrderState);
|
| | | // 订单商品插入
|
| | | List<CommonOrderGoods> commonGoodsList = commonOrderGoodsMapper.listByGoodsIdAndGoodsType(cog.getGoodsId(),
|
| | | cog.getGoodsType());
|
| | | if (commonGoodsList.size() <= 0)// 不存在就插入商品
|
| | | {
|
| | | commonOrder = TaoBaoOrderUtil.convert(taoBaoOrder);
|
| | | CommonOrderGoods goods = new CommonOrderGoods();
|
| | | goods.setGoodsId(taoBaoOrder.getAuctionId() + "");
|
| | | goods.setGoodsType(Constant.SOURCE_TYPE_TAOBAO);
|
| | |
|
| | | // 商品是否已经插入
|
| | | List<CommonOrderGoods> commonGoodsList = commonOrderGoodsMapper
|
| | | .listByGoodsIdAndGoodsType(goods.getGoodsId(), goods.getGoodsType());
|
| | | if (commonGoodsList.size() <= 0)// 不存在就插入商品
|
| | | {
|
| | | TaoBaoGoodsBrief taoBaoGoods = null;
|
| | | TaoBaoGoodsBrief taoBaoGoods = null;
|
| | | try {
|
| | | taoBaoGoods = TaoKeApiUtil.getSimpleGoodsInfo(taoBaoOrder.getAuctionId());
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | e.printStackTrace();
|
| | | LogHelper.errorDetailInfo(e, "AUCTIONID:" + taoBaoOrder.getAuctionId(), "");
|
| | | try {
|
| | | taoBaoGoods = TaoKeApiUtil.getSimpleGoodsInfo(taoBaoOrder.getAuctionId());
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | e.printStackTrace();
|
| | | LogHelper.errorDetailInfo(e, "AUCTIONID:" + taoBaoOrder.getAuctionId(), "");
|
| | | try {
|
| | | taoBaoGoods = TaoBaoUtil.getSimpleGoodsBrief(taoBaoOrder.getAuctionId());
|
| | | } catch (Exception e1) {
|
| | | CommonGoods commonGoods = commonGoodsService.getCommonGoodsByGoodsIdAndGoodsType(
|
| | | taoBaoOrder.getAuctionId(), Constant.SOURCE_TYPE_TAOBAO);
|
| | | if (commonGoods != null)
|
| | | taoBaoGoods = TaoBaoUtil.convert(commonGoods);
|
| | | }
|
| | | taoBaoGoods = TaoBaoUtil.getSimpleGoodsBrief(taoBaoOrder.getAuctionId());
|
| | | } catch (Exception e1) {
|
| | | CommonGoods commonGoods = commonGoodsService.getCommonGoodsByGoodsIdAndGoodsType(
|
| | | taoBaoOrder.getAuctionId(), Constant.SOURCE_TYPE_TAOBAO);
|
| | | if (commonGoods != null)
|
| | | taoBaoGoods = TaoBaoUtil.convert(commonGoods);
|
| | | }
|
| | | if (taoBaoGoods != null) {
|
| | | goods = CommonOrderGoodsFactory.create(taoBaoGoods);
|
| | | }
|
| | | goods.setCreateTime(new Date());
|
| | | goods.setUpdateTime(new Date());
|
| | | commonOrderGoodsMapper.insertSelective(goods);
|
| | | } else
|
| | | goods.setId(commonGoodsList.get(commonGoodsList.size() - 1).getId());
|
| | | commonOrder.setCommonOrderGoods(goods);
|
| | | commonOrder.setUserInfo(new UserInfo(uid));
|
| | | commonOrder.setCreateTime(new Date());
|
| | | commonOrder.setStateWholeOrder(wholeOrderState);
|
| | | commonOrderMapper.insertSelective(commonOrder);
|
| | |
|
| | | // 插入映射,保证交易ID的完整性
|
| | | commonOrderTradeIdMapMapper.insertSelective(new CommonOrderTradeIdMap(commonOrder.getId(),
|
| | | commonOrder.getTradeId(), new Date(), commonOrder.getSourceType()));
|
| | |
|
| | | commonOrderList.add(commonOrder);
|
| | | continue;
|
| | | } else {// 修改
|
| | | // 已经结算或者已经失效的订单不处理
|
| | | if (commonOrder.getState() == CommonOrder.STATE_JS || commonOrder.getState() == CommonOrder.STATE_SX) {
|
| | | commonOrderList.add(commonOrder);
|
| | | continue;
|
| | | }
|
| | | CommonOrder newCommonOrder = TaoBaoOrderUtil.convert(taoBaoOrder);
|
| | |
|
| | | // 交易ID一致才修改
|
| | | if (commonOrder.getTradeId() != null
|
| | | && commonOrder.getTradeId().equalsIgnoreCase(newCommonOrder.getTradeId())) {
|
| | |
|
| | | CommonOrder updateCommonOrder = new CommonOrder(commonOrder.getId());
|
| | | updateCommonOrder.seteIncome(newCommonOrder.geteIncome());
|
| | | updateCommonOrder.setEstimate(newCommonOrder.getEstimate());
|
| | | updateCommonOrder.setPayment(newCommonOrder.getPayment());
|
| | | updateCommonOrder.setSettlement(newCommonOrder.getSettlement());
|
| | | updateCommonOrder.setSettleTime(newCommonOrder.getSettleTime());
|
| | | updateCommonOrder.setState(newCommonOrder.getState());
|
| | | updateCommonOrder.setStateWholeOrder(wholeOrderState);
|
| | | updateCommonOrder.setUpdateTime(new Date());
|
| | | updateCommonOrder.setTradeId(newCommonOrder.getTradeId());
|
| | | commonOrderMapper.updateByPrimaryKeySelective(updateCommonOrder);
|
| | | commonOrderList.add(commonOrderMapper.selectByPrimaryKey(updateCommonOrder.getId()));
|
| | | } else
|
| | | commonOrderList.add(commonOrder);
|
| | | if (taoBaoGoods != null) {
|
| | | cog = CommonOrderGoodsFactory.create(taoBaoGoods);
|
| | | }
|
| | | cog.setCreateTime(new Date());
|
| | | cog.setUpdateTime(new Date());
|
| | | commonOrderGoodsMapper.insertSelective(cog);
|
| | | }
|
| | | newCommonOrder.setUserInfo(new UserInfo(uid));
|
| | | commonOrderList.add(addCommonOrder(newCommonOrder));
|
| | | }
|
| | | return commonOrderList;
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public List<CommonOrder> addPDDOrder(List<PDDOrder> pddOrderList, Long uid) throws CommonOrderException {
|
| | | List<CommonOrder> commonOrderList = new ArrayList<>();
|
| | | // 判断所有的订单状态
|
| | | int invalidCount = 0;
|
| | | for (PDDOrder order : pddOrderList) {
|
| | | if (order.getOrderStatus() == -1 || order.getOrderStatus() == 4 || order.getOrderStatus() == 8) {
|
| | | invalidCount++;
|
| | | }
|
| | | }
|
| | | // 获取整体订单的状态
|
| | | int wholeOrderState = 0;
|
| | | if (pddOrderList.size() == invalidCount)
|
| | | wholeOrderState = CommonOrder.STATE_WHOLE_ORDER_SHIXIAO;
|
| | | else if (invalidCount == 0)
|
| | | wholeOrderState = CommonOrder.STATE_WHOLE_ORDER_YOUXIAO;
|
| | | else
|
| | | wholeOrderState = CommonOrder.STATE_WHOLE_ORDER_BUFENYOUXIAO;
|
| | |
|
| | | for (PDDOrder pddOrder : pddOrderList) {
|
| | | CommonOrder newCommonOrder = CommonOrderFactory.create(pddOrder);
|
| | | CommonOrderGoods cog = new CommonOrderGoods();
|
| | | cog.setGoodsId(pddOrder.getGoodsId() + "");
|
| | | cog.setGoodsType(Constant.SOURCE_TYPE_PDD);
|
| | | newCommonOrder.setCommonOrderGoods(cog);
|
| | | newCommonOrder.setStateWholeOrder(wholeOrderState);
|
| | | // 订单商品插入
|
| | | List<CommonOrderGoods> commonGoodsList = commonOrderGoodsMapper.listByGoodsIdAndGoodsType(cog.getGoodsId(),
|
| | | cog.getGoodsType());
|
| | | if (commonGoodsList.size() <= 0)// 不存在就插入商品
|
| | | {
|
| | | PDDGoodsDetail pddGoods = null;
|
| | | pddGoods = PinDuoDuoApiUtil.getGoodsDetail(Long.parseLong(cog.getGoodsId()));
|
| | | if (pddGoods != null) {
|
| | | cog = CommonOrderGoodsFactory.create(pddGoods);
|
| | | }
|
| | | cog.setCreateTime(new Date());
|
| | | cog.setUpdateTime(new Date());
|
| | | commonOrderGoodsMapper.insertSelective(cog);
|
| | | newCommonOrder.setCommonOrderGoods(cog);
|
| | | }
|
| | | newCommonOrder.setUserInfo(new UserInfo(uid));
|
| | | commonOrderList.add(addCommonOrder(newCommonOrder));
|
| | | }
|
| | | return commonOrderList;
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public List<CommonOrder> addJDOrder(JDOrder jdOrder, Long uid) throws CommonOrderException {
|
| | | List<CommonOrder> commonOrderList = new ArrayList<>();
|
| | | // 判断所有的订单状态
|
| | | int invalidCount = 0;
|
| | | for (JDOrderItem tb : jdOrder.getOrderItemList()) {
|
| | | if (tb.getValidCode() < 16) {
|
| | | invalidCount++;
|
| | | }
|
| | | }
|
| | |
|
| | | // 获取整体订单的状态
|
| | | int wholeOrderState = 0;
|
| | | if (jdOrder.getOrderItemList().size() == invalidCount)
|
| | | wholeOrderState = CommonOrder.STATE_WHOLE_ORDER_SHIXIAO;
|
| | | else if (invalidCount == 0)
|
| | | wholeOrderState = CommonOrder.STATE_WHOLE_ORDER_YOUXIAO;
|
| | | else
|
| | | wholeOrderState = CommonOrder.STATE_WHOLE_ORDER_BUFENYOUXIAO;
|
| | |
|
| | | List<JDOrderItem> orderItemList = jdOrder.getOrderItemList();
|
| | | jdOrder.setOrderItemList(null);
|
| | |
|
| | | for (JDOrderItem itemOrder : orderItemList) {
|
| | | itemOrder.setOrder(jdOrder);
|
| | | CommonOrder newCommonOrder = CommonOrderFactory.create(itemOrder);
|
| | | CommonOrderGoods cog = new CommonOrderGoods();
|
| | | cog.setGoodsId(itemOrder.getSkuId() + "");
|
| | | cog.setGoodsType(Constant.SOURCE_TYPE_JD);
|
| | | newCommonOrder.setCommonOrderGoods(cog);
|
| | | newCommonOrder.setStateWholeOrder(wholeOrderState);
|
| | | // 订单商品插入
|
| | | List<CommonOrderGoods> commonGoodsList = commonOrderGoodsMapper.listByGoodsIdAndGoodsType(cog.getGoodsId(),
|
| | | cog.getGoodsType());
|
| | | if (commonGoodsList.size() <= 0)// 不存在就插入商品
|
| | | {
|
| | | JDGoods goods = JDApiUtil.getGoodsDetail(itemOrder.getSkuId());
|
| | |
|
| | | if (goods != null) {
|
| | | cog = CommonOrderGoodsFactory.create(goods);
|
| | | }
|
| | | cog.setCreateTime(new Date());
|
| | | cog.setUpdateTime(new Date());
|
| | | commonOrderGoodsMapper.insertSelective(cog);
|
| | | }
|
| | | newCommonOrder.setUserInfo(new UserInfo(uid));
|
| | | commonOrderList.add(addCommonOrder(newCommonOrder));
|
| | | }
|
| | | return commonOrderList;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 添加订单
|
| | | * |
| | | * @param commonOrder
|
| | | */
|
| | | @Transactional
|
| | | private CommonOrder addCommonOrder(CommonOrder commonOrder) throws CommonOrderException {
|
| | | // 判断商品是否存在
|
| | | if (commonOrder == null)
|
| | | throw new CommonOrderException(1, "订单为空");
|
| | | if (commonOrder.getUserInfo() == null)
|
| | | throw new CommonOrderException(2, "订单用户为空");
|
| | |
|
| | | if (commonOrder.getCommonOrderGoods() == null || commonOrder.getCommonOrderGoods().getGoodsId() == null
|
| | | || commonOrder.getCommonOrderGoods().getGoodsType() == null)
|
| | | throw new CommonOrderException(3, "订单商品为空");
|
| | | // 不存在就插入,存在就不管
|
| | | CommonOrderGoods goods = commonOrder.getCommonOrderGoods();
|
| | |
|
| | | // 之前不存在于数据库
|
| | | if (commonOrder.getCommonOrderGoods().getId() == null) {
|
| | | List<CommonOrderGoods> commonGoodsList = commonOrderGoodsMapper
|
| | | .listByGoodsIdAndGoodsType(goods.getGoodsId(), goods.getGoodsType());
|
| | |
|
| | | if (commonGoodsList == null || commonGoodsList.size() < 1) {// 不存在
|
| | | commonOrderGoodsMapper.insertSelective(goods);
|
| | | } else {// 存在
|
| | | goods = commonGoodsList.get(0);
|
| | | }
|
| | | if (goods.getId() == null)
|
| | | throw new CommonOrderException(4, "商品插入失败");
|
| | | commonOrder.setCommonOrderGoods(goods);
|
| | | }
|
| | |
|
| | | CommonOrder oldCommonOrder = commonOrderMapper.selectByOrderNoAndOrderTypeAndOrderBy(commonOrder.getOrderNo(),
|
| | | commonOrder.getSourceType(), commonOrder.getOrderBy());
|
| | |
|
| | | if (oldCommonOrder == null)// 新增
|
| | | {
|
| | | commonOrder.setCreateTime(new Date());
|
| | | commonOrderMapper.insertSelective(commonOrder);
|
| | | // 插入映射,保证交易ID的完整性
|
| | | commonOrderTradeIdMapMapper.insertSelective(new CommonOrderTradeIdMap(commonOrder.getId(),
|
| | | commonOrder.getTradeId(), new Date(), commonOrder.getSourceType()));
|
| | | return commonOrder;
|
| | | } else {// 修改
|
| | | // 已经结算或者已经失效的订单不处理
|
| | | if (oldCommonOrder.getState() == CommonOrder.STATE_JS || oldCommonOrder.getState() == CommonOrder.STATE_SX) {
|
| | | return oldCommonOrder;
|
| | | }
|
| | | // 交易ID一致才修改
|
| | | if (commonOrder.getTradeId() != null
|
| | | && commonOrder.getTradeId().equalsIgnoreCase(oldCommonOrder.getTradeId())) {
|
| | | CommonOrder updateCommonOrder = new CommonOrder(oldCommonOrder.getId());
|
| | | updateCommonOrder.seteIncome(commonOrder.geteIncome());
|
| | | updateCommonOrder.setEstimate(commonOrder.getEstimate());
|
| | | updateCommonOrder.setPayment(commonOrder.getPayment());
|
| | | updateCommonOrder.setSettlement(commonOrder.getSettlement());
|
| | | updateCommonOrder.setSettleTime(commonOrder.getSettleTime());
|
| | | updateCommonOrder.setState(commonOrder.getState());
|
| | | updateCommonOrder.setStateWholeOrder(commonOrder.getStateWholeOrder());
|
| | | updateCommonOrder.setUpdateTime(new Date());
|
| | | updateCommonOrder.setTradeId(commonOrder.getTradeId());
|
| | | commonOrderMapper.updateByPrimaryKeySelective(updateCommonOrder);
|
| | | return commonOrderMapper.selectByPrimaryKey(updateCommonOrder.getId());
|
| | | } else
|
| | | return oldCommonOrder;
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | |
|
| | | return commonOrderMapper.selectBySourceTypeAndTradeId(sourceType, tradeId);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | LogHelper.error("返利失败:" + hb1.getId());
|
| | | return;
|
| | | }
|
| | | // 维权中的不返利
|
| | | List<TaoBaoWeiQuanOrder> taoBaoWeiQuanList = taoBaoWeiQuanOrderMapper
|
| | | .selectListByOrderIdAndState(hongBaoOrder.getCommonOrder().getOrderNo(), "维权创建");
|
| | | if (taoBaoWeiQuanList != null && taoBaoWeiQuanList.size() > 0)
|
| | | return;
|
| | |
|
| | | taoBaoWeiQuanList = taoBaoWeiQuanOrderMapper
|
| | | .selectListByOrderIdAndState(hongBaoOrder.getCommonOrder().getOrderNo(), "等待处理");
|
| | | if (taoBaoWeiQuanList != null && taoBaoWeiQuanList.size() > 0)
|
| | | return;
|
| | | if (hongBaoOrder.getCommonOrder() != null
|
| | | && hongBaoOrder.getCommonOrder().getSourceType() == Constant.SOURCE_TYPE_TAOBAO) {
|
| | | // 维权中的不返利
|
| | | List<TaoBaoWeiQuanOrder> taoBaoWeiQuanList = taoBaoWeiQuanOrderMapper
|
| | | .selectListByOrderIdAndState(hongBaoOrder.getCommonOrder().getOrderNo(), "维权创建");
|
| | | if (taoBaoWeiQuanList != null && taoBaoWeiQuanList.size() > 0)
|
| | | return;
|
| | |
|
| | | taoBaoWeiQuanList = taoBaoWeiQuanOrderMapper
|
| | | .selectListByOrderIdAndState(hongBaoOrder.getCommonOrder().getOrderNo(), "等待处理");
|
| | | if (taoBaoWeiQuanList != null && taoBaoWeiQuanList.size() > 0)
|
| | | return;
|
| | | }
|
| | |
|
| | | // 查询同一订单号的红包
|
| | | List<CommonOrder> orderList = commonOrderService.listBySourceTypeAndOrderId(
|
| | |
| | | if (hongBaoOrder.getCommonOrder().getSettleTime() != null && hongBaoOrder.getCommonOrder().getSettleTime()
|
| | | .getTime() >= TimeUtil.convertToTimeTemp("2018-08-05", "yyyy-MM-dd")) {
|
| | | try {
|
| | |
|
| | | taoBaoWeiQuanDrawBackService.doWeiQuanFanli(hongBaoOrder.getCommonOrder().getOrderNo());
|
| | |
|
| | | if (hongBaoOrder.getCommonOrder().getSourceType() == Constant.SOURCE_TYPE_TAOBAO)
|
| | | taoBaoWeiQuanDrawBackService.doWeiQuanFanli(hongBaoOrder.getCommonOrder().getOrderNo());
|
| | | } catch (TaoBaoWeiQuanException e) {
|
| | | if (e.getCode() == TaoBaoWeiQuanException.CODE_NEDD_UPDATE_ORDER) {
|
| | | List<TaoBaoOrder> olist = taoBaoOrderService
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | if (uid == null)
|
| | | return;
|
| | |
|
| | |
| | | package com.yeshi.fanli.service.impl.order;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | |
| | | private HongBaoOrderMapper hongBaoOrderMapper;
|
| | |
|
| | | @Override
|
| | | public int countHongBaoOrderCount50MoreByUid(Long uid) {
|
| | | return hongBaoOrderMapper.countHongBaoOrderCountMoreByUid(new BigDecimal(50), uid);
|
| | | public int countOrderCount100MoreByUidAndMinTime(Long uid, Date minTime) {
|
| | | return hongBaoOrderMapper.countOrderCountMoneyMoreByUidAndMinTime(uid, minTime, new BigDecimal(100));
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int countWeiQuanOrderByUid(Long uid) {
|
| | | return hongBaoOrderMapper.countWeiQuanOrderByUid(uid);
|
| | | public int countWeiQuanOrderByUid(Long uid, Date minTime) {
|
| | | return hongBaoOrderMapper.countWeiQuanOrderByUid(uid, minTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public BigDecimal sumWeiQuanOrderFanAmountByUid(Long uid) {
|
| | | BigDecimal money = hongBaoOrderMapper.sumWeiQuanOrderFanAmountByUid(uid);
|
| | | public BigDecimal sumWeiQuanOrderFanAmountByUid(Long uid,Date minTime) {
|
| | | BigDecimal money = hongBaoOrderMapper.sumWeiQuanOrderFanAmountByUid(uid,minTime);
|
| | | return money == null ? new BigDecimal(0) : money;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int countSafeOrderByUid(Long uid) {
|
| | | return hongBaoOrderMapper.countSafeOrderByUid(uid);
|
| | | public int countWeiQuanOrderWithMinCommision(Long uid, BigDecimal minMoney, Date minTime) {
|
| | | return hongBaoOrderMapper.countWeiQuanOrderWithMinCommision(uid, minMoney, minTime);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | DeviceTokenHW deviceTokenHW = new DeviceTokenHW();
|
| | | deviceTokenHW.setDevice(device);
|
| | | deviceTokenHW.setDeviceToken(token);
|
| | | deviceTokenHW.setDeviceTokenMd5(StringUtil.Md5(token));
|
| | | deviceTokenHW.setUpdateTime(new Date());
|
| | | if (uid != null)
|
| | | deviceTokenHW.setUser(new UserInfo(uid));
|
| | |
| | | for (DeviceTokenHW deviceTokenHW : list) {
|
| | | DeviceTokenHW update = new DeviceTokenHW();
|
| | | update.setId(deviceTokenHW.getId());
|
| | | if (!StringUtil.isNullOrEmpty(token))
|
| | | if (!StringUtil.isNullOrEmpty(token)) {
|
| | | update.setDeviceToken(token);
|
| | | update.setDeviceTokenMd5(StringUtil.Md5(token));
|
| | | }
|
| | | update.setUpdateTime(new Date());
|
| | | if (uid != null)
|
| | | update.setUser(new UserInfo(uid));
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void bindUid(String device, Long uid) {
|
| | | deviceTokenHWMapper.bindUidByDevice(uid, device);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.money.UserMoneyDebtService;
|
| | | import com.yeshi.fanli.service.inter.msg.UserMoneyMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoWeiQuanDrawBackService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoWeiQuanOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.UserMoneyService;
|
| | |
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.factory.UserMoneyDetailFactory;
|
| | | import com.yeshi.fanli.vo.order.CommonOrderVO;
|
| | |
|
| | |
| | |
|
| | | // 退款金额
|
| | | BigDecimal drawBackMoney = MoneyBigDecimalUtil.div(userGetMoney.multiply(fanMoney), sumFee);
|
| | | if (drawBackMoney.compareTo(userGetMoney) > 0)
|
| | | drawBackMoney = userGetMoney;// 退款金额不能比获得的金额大
|
| | | // 计算资金是否充足
|
| | | UserInfo user = userInfoMapper.selectByPKey(uid);
|
| | | if (user != null && user.getMyHongBao().compareTo(drawBackMoney) < 0)// 资金不足
|
| | |
| | |
|
| | | // 退款金额
|
| | | BigDecimal drawBackMoney = MoneyBigDecimalUtil.div(userGetMoney.multiply(fanMoney), sumFee);
|
| | | if (drawBackMoney.compareTo(userGetMoney) > 0)
|
| | | drawBackMoney = userGetMoney;
|
| | |
|
| | | for (TaoBaoWeiQuanDrawBack drawBack : newWeiQuanDrawBackList)
|
| | | taoBaoWeiQuanDrawBackMapper.insertSelective(drawBack);
|
| | |
| | | if (weiQuanDrawBack != null)
|
| | | continue;
|
| | | BigDecimal drawBackMoney = MoneyBigDecimalUtil.div(child.getMoney().multiply(fanMoney), sumFee);
|
| | | if (drawBackMoney.compareTo(child.getMoney()) > 0)
|
| | | drawBackMoney = child.getMoney();
|
| | | weiQuanDrawBack = new TaoBaoWeiQuanDrawBack();
|
| | | weiQuanDrawBack.setCreateTime(new Date());
|
| | | weiQuanDrawBack.setDrawBackMoney(drawBackMoney);
|
| | |
| | | return taoBaoWeiQuanOrderMapper.selectListByOrderIdAndState(orderId, "维权成功");
|
| | | }
|
| | |
|
| | | @Override
|
| | | public TaoBaoWeiQuanOrder listByorderItemId(String tradeId) {
|
| | | return taoBaoWeiQuanOrderMapper.selectByOrderItemId(tradeId);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | auditRecord.setBeforeMoney(user.getMyHongBao());
|
| | | auditRecord.setExtract(extract);
|
| | |
|
| | | Date minTime = new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24 * 180L);
|
| | | // 统计数据
|
| | | int orderCount50More = orderUserStatisticService.countHongBaoOrderCount50MoreByUid(user.getId());
|
| | | BigDecimal weiQuanOrderFanAmount = orderUserStatisticService.sumWeiQuanOrderFanAmountByUid(user.getId());
|
| | | int weiQuanOrderCount = orderUserStatisticService.countWeiQuanOrderByUid(user.getId());
|
| | | int safeOrderCount = orderUserStatisticService.countSafeOrderByUid(user.getId());
|
| | | auditRecord.setExtraInfoStr(new Gson().toJson(new ExtractOrderStatisticDTO(orderCount50More, weiQuanOrderCount,
|
| | | weiQuanOrderFanAmount, safeOrderCount)));
|
| | | int orderCount50More = orderUserStatisticService.countOrderCount100MoreByUidAndMinTime(user.getId(), minTime);
|
| | |
|
| | | BigDecimal weiQuanOrderFanAmount = orderUserStatisticService.sumWeiQuanOrderFanAmountByUid(user.getId(),
|
| | | minTime);
|
| | | int weiQuanOrderCount = orderUserStatisticService.countWeiQuanOrderByUid(user.getId(), minTime);
|
| | | auditRecord.setExtraInfoStr(new Gson()
|
| | | .toJson(new ExtractOrderStatisticDTO(orderCount50More, weiQuanOrderCount, weiQuanOrderFanAmount, 0)));
|
| | | extractAuditRecordMapper.insertSelective(auditRecord);
|
| | |
|
| | | // 新版资金详情
|
| | |
| | | return isNew;
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public UserRank gerUserRank(Long uid) {
|
| | | if(uid == null) {
|
| | | return null;
|
| | | }
|
| | | |
| | | UserInfoExtra userInfoExtra = userInfoExtraMapper.gerUserRank(uid);
|
| | | if (userInfoExtra == null) {
|
| | | return null;
|
| | | }
|
| | | return userInfoExtra.getUserRank();
|
| | | }
|
| | | |
| | | |
| | | }
|
| | |
| | | return money == null ? new BigDecimal(0) : money;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public UserMoneyDetail selectByTypeAndUidAndIdentifyCode(UserMoneyDetailTypeEnum type, Long uid,
|
| | | Long sourceIdentifyId) {
|
| | | return userMoneyDetailMapper.selectByTypeAndUidAndIdentifyCode(type, uid, sourceIdentifyId);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | * @return
|
| | | */
|
| | | public String createContentByTemplate(String template, Long uid, TaoBaoGoodsBrief goods,String token,
|
| | | String shortLink, boolean hasCoupon, String from);
|
| | | String shortLink, boolean hasCoupon, Long tljId);
|
| | |
|
| | | /**
|
| | | * 还原普通模板
|
| | |
| | |
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherTaoLiJinContentDTO;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
|
| | |
|
| | |
| | | */
|
| | | public void rewardCouponAlreadyOutOfDate(UserSystemCoupon coupon);
|
| | |
|
| | |
|
| | | /**
|
| | | * 淘礼金消息
|
| | | * @param uid
|
| | | * @param beiZhu
|
| | | * @param content
|
| | | */
|
| | | public void taoLiJinMsg(Long uid, String beiZhu, MsgOtherTaoLiJinContentDTO content);
|
| | | }
|
| | |
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import com.yeshi.fanli.entity.jd.JDOrder;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.entity.pdd.PDDOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | | import com.yeshi.fanli.exception.order.CommonOrderException;
|
| | | import com.yeshi.fanli.vo.order.CommonOrderVO;
|
| | |
| | | public List<CommonOrder> listBySourceTypeAndOrderId(int sourceType, String orderId);
|
| | |
|
| | | /**
|
| | | * 缓存普通订单
|
| | | * 缓存淘宝类普通订单
|
| | | *
|
| | | * @param taoBaoOrder
|
| | | * @param uid
|
| | | * @return
|
| | | * @throws CommonOrderException
|
| | | */
|
| | | public List<CommonOrder> addTaoBaoOrder(List<TaoBaoOrder> taoBaoOrder, Long uid) throws CommonOrderException;
|
| | |
|
| | | /**
|
| | | * 缓存拼多多类普通订单
|
| | | * |
| | | * @param pddOrderList
|
| | | * @param uid
|
| | | * @return
|
| | | * @throws CommonOrderException
|
| | | */
|
| | | public List<CommonOrder> addPDDOrder(List<PDDOrder> pddOrderList, Long uid) throws CommonOrderException;
|
| | |
|
| | | /**
|
| | | * 缓存京东普通订单
|
| | | * |
| | | * @param jdOrderList
|
| | | * @param uid
|
| | | * @return
|
| | | * @throws CommonOrderException
|
| | | */
|
| | | public List<CommonOrder> addJDOrder(JDOrder jdOrder, Long uid) throws CommonOrderException;
|
| | |
|
| | | /**
|
| | | * 根据用户ID,订单状态,结算时间统计订单数量
|
| | | *
|
| | | * @param uid
|
| | |
| | | package com.yeshi.fanli.service.inter.order;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | |
|
| | | /**
|
| | | * 用户订单统计服务
|
| | |
| | | */
|
| | | public interface OrderUserStatisticService {
|
| | | /**
|
| | | * 返利超过超过50元的订单数量
|
| | | * 订单佣金大于100的数量(大于某个最小时间)
|
| | | *
|
| | | * @param uid
|
| | | * @param minTime
|
| | | * @return
|
| | | */
|
| | | public int countHongBaoOrderCount50MoreByUid(Long uid);
|
| | | public int countOrderCount100MoreByUidAndMinTime(Long uid, Date minTime);
|
| | |
|
| | | /**
|
| | | * 维权订单数量(包含邀请赚)
|
| | |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public int countWeiQuanOrderByUid(Long uid);
|
| | | public int countWeiQuanOrderByUid(Long uid, Date minTime);
|
| | |
|
| | | /**
|
| | | * 维权订单返还的金额
|
| | |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public BigDecimal sumWeiQuanOrderFanAmountByUid(Long uid);
|
| | | public BigDecimal sumWeiQuanOrderFanAmountByUid(Long uid,Date minTime);
|
| | |
|
| | | /**
|
| | | * 安全订单数量
|
| | | * |
| | | * 维权订单数量
|
| | | * @param uid
|
| | | * @param minMoney
|
| | | * @param minTime
|
| | | * @return
|
| | | */
|
| | | public int countSafeOrderByUid(Long uid);
|
| | | public int countWeiQuanOrderWithMinCommision(Long uid, BigDecimal minMoney, Date minTime);
|
| | |
|
| | | }
|
| | |
| | | */
|
| | | void unBindDeviceToken(String device);
|
| | |
|
| | | /**
|
| | | * 将用户ID绑定到设备上
|
| | | * |
| | | * @param device
|
| | | * @param uid
|
| | | */
|
| | | void bindUid(String device, Long uid);
|
| | |
|
| | | }
|
| | |
| | | * @return
|
| | | */
|
| | | public List<TaoBaoWeiQuanOrder> getWeiQuanSuccessOrders(String orderId);
|
| | | |
| | | |
| | | /**
|
| | | * 根据交易ID查询维权状态
|
| | | * @param tradeId
|
| | | * @return
|
| | | */
|
| | | public TaoBaoWeiQuanOrder listByorderItemId(String tradeId);
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.inter.user;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.bus.user.UserRank;
|
| | | import com.yeshi.fanli.exception.user.UserInfoExtraException;
|
| | | import com.yeshi.fanli.vo.user.UserInfoExtraVO;
|
| | |
|
| | |
| | | */
|
| | | public void createUserInfoExtra(Long uid) throws UserInfoExtraException;
|
| | |
|
| | | /**
|
| | | * 获取用户等级
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public UserRank gerUserRank(Long uid);
|
| | | |
| | | }
|
| | |
| | | public BigDecimal statisticUserTypeMoneyWithDate(Long uid, List<UserMoneyDetailTypeEnum> typeList, Date minDate,
|
| | | Date maxDate);
|
| | |
|
| | | /**
|
| | | * 根据类型,用户ID与唯一标识符查询
|
| | | * |
| | | * @param type
|
| | | * @param uid
|
| | | * @param sourceIdentifyId
|
| | | * @return
|
| | | */
|
| | | public UserMoneyDetail selectByTypeAndUidAndIdentifyCode(UserMoneyDetailTypeEnum type, Long uid,
|
| | | Long sourceIdentifyId);
|
| | |
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 保存淘礼金的口令
|
| | | * |
| | | * @param url
|
| | | * @param token
|
| | | */
|
| | | public void saveTLJToken(String url, String token) {
|
| | | String key = "taobao-tlj-token-" + StringUtil.Md5(url);
|
| | | if (Constant.IS_OUTNET) {
|
| | | if (!StringUtil.isNullOrEmpty(token)) {
|
| | | // 口令缓存10天
|
| | | cacheCommonString(key, token, 60 * 60 * 24 * 10);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取淘礼金口令
|
| | | * |
| | | * @param url
|
| | | * @return
|
| | | */
|
| | | public String getTLJToken(String url) {
|
| | | String key = "taobao-common-token-" + StringUtil.Md5(url);
|
| | |
|
| | | if (Constant.IS_OUTNET) {
|
| | | return getCommonString(key);
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 保存对象
|
| | | *
|
| | | * @param T
|
| | |
| | | import java.lang.reflect.Method;
|
| | | import java.security.MessageDigest;
|
| | | import java.security.NoSuchAlgorithmException;
|
| | | import java.util.List;
|
| | | import java.util.regex.Matcher;
|
| | | import java.util.regex.Pattern;
|
| | |
|
| | |
| | | // 是否为电话号码
|
| | | public static boolean isMobile(String mobile) {
|
| | |
|
| | | String regex = "^((13[0-9])|(17[0-9])|(15[^4,\\D])|(18[0-9])|(19[0-9])|(16[0-9]))\\d{8}$";
|
| | | String regex = "^((13[0-9])|(14[0-9])|(17[0-9])|(15[^4,\\D])|(18[0-9])|(19[0-9])|(16[0-9]))\\d{8}$";
|
| | | Pattern p = Pattern.compile(regex);
|
| | | Matcher m = p.matcher(mobile);
|
| | |
|
| | |
| | | }
|
| | | return code;
|
| | | }
|
| | | |
| | |
|
| | | public static String getVerifyCode(int count) {
|
| | | String sts = "0123456789";
|
| | | String code = "";
|
| | |
| | | }
|
| | | return code;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | // ��ȡ���ŷ��͵ĸ�ʽ
|
| | | public static String getMessageStyle(String code) {
|
| | |
| | | }
|
| | |
|
| | | public static boolean isJson(String content) {
|
| | | try {
|
| | | JSONObject.fromObject(content);
|
| | | return true;
|
| | | } catch (Exception e) {
|
| | | return false;
|
| | | }
|
| | | }
|
| | | try {
|
| | | JSONObject.fromObject(content);
|
| | | return true;
|
| | | } catch (Exception e) {
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
|
| | | public static String concat(List list, String sperator) {
|
| | | if (list == null)
|
| | | return null;
|
| | | String str = "";
|
| | | for (Object obj : list) {
|
| | | str += obj + sperator;
|
| | | }
|
| | | if (str.endsWith(sperator))
|
| | | str = str.substring(0, str.length() - sperator.length());
|
| | | return str;
|
| | | }
|
| | | }
|
| | |
| | | package com.yeshi.fanli.util.dataoke;
|
| | |
|
| | | import java.io.IOException;
|
| | | import java.io.InputStream;
|
| | | import java.lang.reflect.Type;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | |
| | | import java.util.Set;
|
| | | import java.util.TreeMap;
|
| | |
|
| | | import org.apache.commons.httpclient.HttpClient;
|
| | | import org.apache.commons.httpclient.HttpException;
|
| | | import org.apache.commons.httpclient.methods.GetMethod;
|
| | | import org.jsoup.Jsoup;
|
| | | import org.jsoup.nodes.Document;
|
| | | import org.jsoup.nodes.Element;
|
| | |
| | | import com.yeshi.fanli.entity.taobao.TaoKeAppInfo;
|
| | | 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.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | |
| | |
|
| | | static Gson gson = new Gson();
|
| | |
|
| | | private static String get(String url) {
|
| | | HttpClient client = new HttpClient();
|
| | | try {
|
| | | client.getHttpConnectionManager().getParams().setConnectionTimeout(5000);
|
| | | client.getHttpConnectionManager().getParams().setSoTimeout(5000);
|
| | | GetMethod method = new GetMethod(url);
|
| | | client.executeMethod(method);
|
| | | return method.getResponseBodyAsString();
|
| | | } catch (HttpException e) {
|
| | | e.printStackTrace();
|
| | | } catch (IOException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return "";
|
| | | }
|
| | |
|
| | | private static String request(String url) {
|
| | | String result = null;
|
| | |
|
| | | while (result == null) {
|
| | | try {
|
| | | result = HttpUtil.get(url);
|
| | | if (result != null && result.startsWith("<html>"))
|
| | | result = get(url);
|
| | | if ((result != null && result.startsWith("<html>")) || StringUtil.isNullOrEmpty(result))
|
| | | result = null;
|
| | | } catch (Exception e) {
|
| | | try {
|
| | |
| | | package com.yeshi.fanli.util.factory;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | |
|
| | | public class CommonGoodsFactory {
|
| | |
|
| | |
| | | return cg;
|
| | | }
|
| | |
|
| | | public static CommonGoods create(PDDGoodsDetail goods) {
|
| | | if (goods == null)
|
| | | return null;
|
| | |
|
| | | CommonGoods cg = new CommonGoods();
|
| | |
|
| | | if (goods.getCouponRemainQuantity() != null)
|
| | | cg.setCouponLeftCount(Integer.parseInt(goods.getCouponRemainQuantity() + ""));
|
| | | else
|
| | | cg.setCouponLeftCount(0);
|
| | | if (goods.getCouponMinOrderAmount() != null)
|
| | | cg.setCouponStartPrice(
|
| | | MoneyBigDecimalUtil.div(new BigDecimal(goods.getCouponMinOrderAmount()), new BigDecimal(100)));
|
| | | else
|
| | | cg.setCouponStartPrice(new BigDecimal(0));
|
| | |
|
| | | if (goods.getCouponDiscount() != null && goods.getCouponDiscount() > 0) {
|
| | | cg.setCouponAmount(MoneyBigDecimalUtil.div(new BigDecimal(goods.getCouponDiscount()), new BigDecimal(100)));
|
| | | if (cg.getCouponStartPrice().compareTo(new BigDecimal(0)) > 0)
|
| | | cg.setCouponInfo(String.format("满%s元减%s元", cg.getCouponStartPrice() + "", cg.getCouponAmount() + ""));
|
| | | else
|
| | | cg.setCouponInfo(String.format("%s元无条件券", cg.getCouponAmount() + ""));
|
| | | } else {
|
| | | cg.setCouponAmount(new BigDecimal(0));
|
| | | }
|
| | |
|
| | | cg.setCouponTotalCount(Integer.parseInt(goods.getCouponTotalQuantity() + ""));
|
| | | cg.setGoodsId(goods.getGoodsId());
|
| | | cg.setGoodsType(CommonGoods.GOODS_TYPE_PDD);
|
| | | cg.setPicture(goods.getGoodsThumbnailUrl());
|
| | | cg.setPictureWhite(null);
|
| | | cg.setPrice(MoneyBigDecimalUtil.div(new BigDecimal(goods.getMinNormalPrice()), new BigDecimal(100)));
|
| | | cg.setSales(Integer.parseInt(goods.getSoldQuantity() + ""));
|
| | | cg.setRate(MoneyBigDecimalUtil.div(new BigDecimal(goods.getPromotionRate()), new BigDecimal(10)));
|
| | | cg.setSellerId(goods.getMallId());
|
| | | cg.setSellerName(goods.getMallName());
|
| | | cg.setShopType(goods.getMerchantType());
|
| | | cg.setState(CommonGoods.STATE_NORMAL);
|
| | | cg.setTitle(goods.getGoodsName());
|
| | | // 保留字段
|
| | | cg.setVideoCover(null);
|
| | | cg.setVideoUrl(null);
|
| | | cg.setState(goods.getState());
|
| | | cg.setMaterialLibType(1);
|
| | | return cg;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.util.factory;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | |
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.order.CommonOrderGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | |
|
| | | public class CommonOrderGoodsFactory {
|
| | |
|
| | |
| | | return orderGoods;
|
| | | }
|
| | |
|
| | | public static CommonOrderGoods create(PDDGoodsDetail detail) {
|
| | | CommonOrderGoods goods = new CommonOrderGoods();
|
| | | goods.setGoodsId(detail.getGoodsId() + "");
|
| | | goods.setCreateTime(new Date());
|
| | | goods.setGoodsType(Constant.SOURCE_TYPE_PDD);
|
| | | goods.setPicture(detail.getGoodsImageUrl());
|
| | | goods.setPrice(MoneyBigDecimalUtil.div(new BigDecimal(detail.getMinNormalPrice()), new BigDecimal(100)));
|
| | | goods.setShopId(detail.getMallId());
|
| | | goods.setShopName(detail.getMallName());
|
| | | goods.setShopType(detail.getMerchantType() + "");
|
| | | goods.setState(0);
|
| | | goods.setTitle(detail.getGoodsName());
|
| | | return goods;
|
| | | }
|
| | |
|
| | | public static CommonOrderGoods create(JDGoods jdGoods) {
|
| | | CommonOrderGoods goods = new CommonOrderGoods();
|
| | | goods.setGoodsId(jdGoods.getSkuId() + "");
|
| | | goods.setCreateTime(new Date());
|
| | | goods.setGoodsType(Constant.SOURCE_TYPE_JD);
|
| | | if (jdGoods.getImageList() != null && jdGoods.getImageList().size() > 0)
|
| | | goods.setPicture(jdGoods.getImageList().get(0));
|
| | | goods.setPrice(jdGoods.getPrice());
|
| | | goods.setShopId((long) jdGoods.getShopInfo().getShopId());
|
| | | goods.setShopName(jdGoods.getShopInfo().getShopName());
|
| | | goods.setShopType(jdGoods.getOwner());
|
| | | goods.setState(0);
|
| | | goods.setTitle(jdGoods.getSkuName());
|
| | | return goods;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | detail.setSourceId(userCouponId);
|
| | | return detail;
|
| | | }
|
| | | |
| | | /**
|
| | | * 券相关信息的通知
|
| | | * |
| | | * @param uid
|
| | | * @param content
|
| | | * @param type
|
| | | * @param beiZhu
|
| | | * @return
|
| | | */
|
| | | public static MsgOtherDetail createTaoLiJinMsg(Long uid, Long userCouponId, MsgOtherCouponContentDTO content,
|
| | | MsgTypeOtherTypeEnum type, String beiZhu) {
|
| | | if (uid == null)
|
| | | return null;
|
| | | MsgOtherDetail detail = new MsgOtherDetail();
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setRead(false);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setCoupnContent(content);
|
| | | detail.setType(type);
|
| | | detail.setSourceId(userCouponId);
|
| | | return detail;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherCouponContentDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherTaoLiJinContentDTO;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgInviteDetail;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail;
|
| | |
| | | */
|
| | | public static UserMsgVO create(MsgOtherDetail msg) {
|
| | | List<CommonMsgItemVO> items = new ArrayList<>();
|
| | | |
| | | String icon = null;
|
| | | |
| | | if (msg.getType() == MsgTypeOtherTypeEnum.couponMianDan
|
| | | || msg.getType() == MsgTypeOtherTypeEnum.couponWelfareMianDan
|
| | | || msg.getType() == MsgTypeOtherTypeEnum.couponReward) {
|
| | |
| | | MsgOtherCouponContentDTO dto = new Gson().fromJson(msg.getContent(), MsgOtherCouponContentDTO.class);
|
| | | if (dto == null)
|
| | | return null;
|
| | |
|
| | | |
| | | icon = "http://img.flqapp.com/resource/msg/icon_msg_other_coupon.png";
|
| | | |
| | | List<ClientTextStyleVO> contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(dto.getState(), COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("状态", COLOR_TITLE), contentList));
|
| | |
| | | contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
|
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | | |
| | | } else if (msg.getType() == MsgTypeOtherTypeEnum.taoLiJin) {
|
| | | if (StringUtil.isNullOrEmpty(msg.getContent()))
|
| | | return null;
|
| | | |
| | | MsgOtherTaoLiJinContentDTO dto = new Gson().fromJson(msg.getContent(), MsgOtherTaoLiJinContentDTO.class);
|
| | | if (dto == null)
|
| | | return null;
|
| | | |
| | | icon = "http://img.flqapp.com/resource/msg/icon_msg_other_tlj.png";
|
| | | |
| | | List<ClientTextStyleVO> contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(dto.getState(), COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("状态", COLOR_TITLE), contentList));
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(dto.getSource())) {
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(dto.getSource() + "", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("来源", COLOR_TITLE), contentList));
|
| | | }
|
| | | |
| | | if (dto.getMoney() != null) {
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("¥" + filterMoney(dto.getMoney().setScale(2)),
|
| | | COLOR_HIGHLIGHT_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("面额", COLOR_TITLE), contentList));
|
| | | }
|
| | | |
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
|
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | | |
| | | }
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_other_coupon.png", msg.getType().getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | return new UserMsgVO(icon, msg.getType().getDesc(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | return searchResult;
|
| | | }
|
| | |
|
| | | public static JDGoods getGoodsDetail(Long skuId) {
|
| | | JDSearchFilter sf = new JDSearchFilter();
|
| | | sf.setKey(skuId + "");
|
| | | sf.setPageNo(1);
|
| | | sf.setPageSize(20);
|
| | | JDSearchResult result = searchByKey(sf);
|
| | | if (result != null && result.getGoodsList() != null && result.getGoodsList().size() > 0)
|
| | | return result.getGoodsList().get(0);
|
| | | return null;
|
| | | }
|
| | |
|
| | | private static JDGoods parseGoods(String data) {
|
| | | JDGoods goods = new JDGoods();
|
| | | JSONObject json = JSONObject.fromObject(data);
|
| | |
| | | goods.setOwner("g");
|
| | | else
|
| | | goods.setOwner("p");
|
| | | goods.setMaterialUrl("http://img14.360buyimg.com/n1/"+json.optString("materialUrl"));
|
| | | goods.setMaterialUrl("http://img14.360buyimg.com/n1/" + json.optString("materialUrl"));
|
| | | JDCommissionInfo commission = new JDCommissionInfo();
|
| | | commission.setCommission(new BigDecimal(json.optString("wlCommission")));
|
| | | commission.setCommissionShare(new BigDecimal(json.optString("wlCommissionRatio")));
|
| | |
| | | System.out.println(result);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取订单
|
| | | * |
| | | * @param page
|
| | | * -页码
|
| | | * @param pageSize-每页数量
|
| | | * @param startTime-开始时间
|
| | | * @param endTime-结束时间
|
| | | * 与开始时间不得大于24小时
|
| | | * @return
|
| | | */
|
| | | public static PDDOrderResult getOrders(int page, int pageSize, long startTime, long endTime) {
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("type", "pdd.ddk.order.list.increment.get");
|
| | |
| | | package com.yeshi.fanli.vo.goods;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.List;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsSubClass;
|
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsSubClassLabel;
|
| | |
|
| | | public class GoodsSubClassLabelVO extends GoodsSubClassLabel {
|
| | | public class GoodsSubClassLabelVO extends GoodsSubClassLabel implements Serializable {
|
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | | @Expose
|
| | | private List<GoodsSubClass> listSub;
|
| | |
|
| | |
| | | public void setListSub(List<GoodsSubClass> listSub) {
|
| | | this.listSub = listSub;
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | |
| | | // 二级收益人-金额
|
| | | private String levelTwoMoney;
|
| | |
|
| | | private String weiQuanState;//维权状态
|
| | |
|
| | | private String weiQuanBackMoney;//维权资金
|
| | |
|
| | | public String getWeiQuanState() {
|
| | | return weiQuanState;
|
| | | }
|
| | |
|
| | | public void setWeiQuanState(String weiQuanState) {
|
| | | this.weiQuanState = weiQuanState;
|
| | | }
|
| | |
|
| | | public String getWeiQuanBackMoney() {
|
| | | return weiQuanBackMoney;
|
| | | }
|
| | |
|
| | | public void setWeiQuanBackMoney(String weiQuanBackMoney) {
|
| | | this.weiQuanBackMoney = weiQuanBackMoney;
|
| | | }
|
| | |
|
| | | public Date getAccountTime() {
|
| | | return accountTime;
|
| | | }
|