| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoHongBaoInfo;
|
| | | import com.yeshi.fanli.entity.taobao.TaobaoMeterial;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
|
| | | import com.yeshi.fanli.exception.taobao.TaoKeApiException;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | |
| | | import com.yeshi.fanli.service.inter.lable.TaoKeGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsActivityService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaobaoMeterialService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private TaoBaoGoodsActivityService taoBaoGoodsActivityService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | |
|
| | | /**
|
| | | * 9.9商品
|
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | @RequestMapping("getFlashSaleNew")
|
| | | public void getFlashSaleNew(String callback, Integer page, Long auctionId, String time, PrintWriter out) {
|
| | | List<DaTaoKeDetail> detailList0 = daTaoKeGoodsDetailService.getDingDongQiangData(time);
|
| | | if (detailList0 == null)
|
| | | detailList0 = new ArrayList<>();
|
| | | List<DaTaoKeDetail> detailList = new ArrayList<>();
|
| | | detailList.addAll(detailList0);
|
| | | JSONArray array = new JSONArray();
|
| | | if (page == 1) {
|
| | | if (auctionId != null && detailList != null)
|
| | | for (int i = 0; i < detailList.size(); i++) {
|
| | | if (detailList.get(i).getGoodsId().longValue() == auctionId) {
|
| | | DaTaoKeDetail goods = detailList.get(i);
|
| | | detailList.remove(i);
|
| | | detailList.add(0, goods);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | if (detailList != null)
|
| | | for (DaTaoKeDetail detail : detailList) {
|
| | | array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(TaoBaoUtil.convert(detail),
|
| | | hongBaoManageService.getFanLiRate() + "", null)));
|
| | | }
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", detailList.size());
|
| | | data.put("result_list", array);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 大额券(券面值范围)
|
| | | *
|
| | |
| | |
|
| | | public enum CommonContentTypeEnum {
|
| | |
|
| | | _9k9("9块9包邮"), haoQuan("高额好券"), chaoSheng("超级省钱"), muYin("母婴精选"), reMai("潮品热卖"), meiShi("优选美食"), juJia(
|
| | | _9k9("9.9包邮"), haoQuan("高额好券"), chaoSheng("超级省钱"), muYin("母婴精选"), reMai("潮品热卖"), meiShi("优选美食"), juJia(
|
| | | "居家生活"), chuanYiDaPei("穿衣搭配"), meiZhuangGehu("美妆个护"), jingPinXieBao("精品鞋包"), chaoNanReMai(
|
| | | "潮男热卖"), shuMaShouJi("数码手机"), yunDongKuXie("运动酷鞋"), qiCheHuWai("汽车户外"), chaoPinReMai("新款潮品");
|
| | | private final String desc;
|
| | |
| | | package com.yeshi.fanli.entity.taobao.dataoke;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | |
|
| | |
| | | *
|
| | | */
|
| | | @Table("yeshi_ec_goods_dataoke")
|
| | | public class DaTaoKeDetail {
|
| | | public class DaTaoKeDetail implements Serializable{
|
| | |
|
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | public DaTaoKeDetail(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
| | | import org.springframework.scheduling.annotation.Scheduled;
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import com.yeshi.fanli.dto.taobao.WeiQuanOrderResult;
|
| | | import com.yeshi.fanli.entity.bus.user.LostOrder;
|
| | | import com.yeshi.fanli.entity.bus.user.Order;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.entity.taobao.PidUser;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoUnionConfig;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanOrder;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.common.DataMonitorService;
|
| | |
| | | public void doTaoBaoWeiQuan() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | List<TaoBaoUnionConfig> configList = taoBaoUnionConfigService.getConfigByTypeCache(PidUser.TYPE_FANLI_ANDROID);
|
| | | List<TaoBaoWeiQuanOrder> orderList = TaoBaoOrderUtil.getWeiQuanOrders(
|
| | | System.currentTimeMillis() - 1000 * 60 * 60 * 24 * 60L, System.currentTimeMillis(), configList.get(0));
|
| | | if (orderList != null)
|
| | | // 新版维权订单处理
|
| | | for (int i = 0; i < 60; i++) {
|
| | | List<TaoBaoWeiQuanOrder> orderList = new ArrayList<>();
|
| | | WeiQuanOrderResult result = TaoKeOrderApiUtil
|
| | | .getTaoBaoSpecialWeiQuanOrderList(new Date(TimeUtil.convertToTimeTemp(
|
| | | TimeUtil.getGernalTime(System.currentTimeMillis() - 1000 * 60 * 60 * 24L * i, "yyyy-MM-dd"),
|
| | | "yyyy-MM-dd")), 1, false);
|
| | | orderList.addAll(result.orderList);
|
| | |
|
| | | result = TaoKeOrderApiUtil.getTaoBaoSpecialWeiQuanOrderList(new Date(TimeUtil.convertToTimeTemp(
|
| | | TimeUtil.getGernalTime(System.currentTimeMillis() - 1000 * 60 * 60 * 24L * i, "yyyy-MM-dd"),
|
| | | "yyyy-MM-dd")), 1, true);
|
| | | orderList.addAll(result.orderList);
|
| | |
|
| | | result = TaoKeOrderApiUtil.getTaoBaoRelationWeiQuanOrderList(new Date(TimeUtil.convertToTimeTemp(
|
| | | TimeUtil.getGernalTime(System.currentTimeMillis() - 1000 * 60 * 60 * 24L * i, "yyyy-MM-dd"),
|
| | | "yyyy-MM-dd")), 1, false);
|
| | | orderList.addAll(result.orderList);
|
| | |
|
| | | result = TaoKeOrderApiUtil.getTaoBaoRelationWeiQuanOrderList(new Date(TimeUtil.convertToTimeTemp(
|
| | | TimeUtil.getGernalTime(System.currentTimeMillis() - 1000 * 60 * 60 * 24L * i, "yyyy-MM-dd"),
|
| | | "yyyy-MM-dd")), 1, true);
|
| | | orderList.addAll(result.orderList);
|
| | |
|
| | | for (TaoBaoWeiQuanOrder order : orderList)
|
| | | taoBaoWeiQuanOrderService.addWeiQuanOrder(order);// 添加维权订单到数据库
|
| | | // 处理维权订单
|
| | | orderProcessService.weiQuanOrder(orderList);
|
| | | // 处理维权订单
|
| | | orderProcessService.weiQuanOrder(orderList);
|
| | | }
|
| | | }
|
| | |
|
| | | // 每6个小时执行一次
|
| | |
| | | HongBaoV2 oldHongBao = hongBaoV2Mapper.selectByPrimaryKey(hongBaoOrder.getHongBaoV2().getId());
|
| | | if (oldHongBao == null)
|
| | | throw new HongBaoException(10, "红包对象不存在");
|
| | | // 已经失效或者已经领取的红包不做处理
|
| | | // 已经失效,已经领取,新老状态一致的红包不做处理
|
| | | if (oldHongBao.getState() == HongBaoV2.STATE_SHIXIAO || oldHongBao.getState() == HongBaoV2.STATE_YILINGQU)
|
| | | return;
|
| | |
|
| | |
| | | } else if (commonOrder.getState() == CommonOrder.STATE_SX) {
|
| | | hongBao.setState(HongBaoV2.STATE_SHIXIAO);
|
| | | hongBao.setMoney(new BigDecimal(0));
|
| | |
|
| | | }
|
| | |
|
| | | // 新老红包状态一致不处理
|
| | | if (oldHongBao.getState().intValue() == hongBao.getState())
|
| | | return;
|
| | |
|
| | | if (hongBao.getState() == HongBaoV2.STATE_SHIXIAO) {
|
| | | if (mianDan) {
|
| | | try {
|
| | | userSystemCouponService.updateStateByDrawback(commonOrder.getOrderNo());
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | hongBaoV2Mapper.updateByPrimaryKeySelective(hongBao);
|
| | |
|
| | | // 加入通知
|
| | |
| | | commonOrder.getTradeId(), new Date(), commonOrder.getSourceType()));
|
| | | return commonOrder;
|
| | | } else {// 修改
|
| | | // 已经结算或者已经失效的订单不处理
|
| | | if (oldCommonOrder.getState() == CommonOrder.STATE_JS
|
| | | || oldCommonOrder.getState() == CommonOrder.STATE_SX) {
|
| | | // 已经结算,已经失效,状态未改变的订单不处理
|
| | | if (oldCommonOrder.getState() == CommonOrder.STATE_JS || oldCommonOrder.getState() == CommonOrder.STATE_SX
|
| | | || (oldCommonOrder.getState().intValue() == commonOrder.getState())) {
|
| | | return oldCommonOrder;
|
| | | }
|
| | | // 交易ID一致才修改
|
| | |
| | | public void weiQuanOrder(List<TaoBaoWeiQuanOrder> orderList) {
|
| | | if (orderList != null)
|
| | | for (TaoBaoWeiQuanOrder order : orderList) {
|
| | | if (order.getState().equalsIgnoreCase("维权成功")) {
|
| | | if (order.getState().contains("维权成功")) {
|
| | | CMQManager.getInstance().addWeiQuanOrderMsg(order);
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | @Override
|
| | | public void deleteOutOfDate() {
|
| | | TaoBaoGoodsBriefMapper taoBaoGoodsBriefMapper = BeanUtil.getBean(TaoBaoGoodsBriefMapper.class);
|
| | | List<Long> list = taoBaoGoodsBriefMapper
|
| | | .queryCanDeleteGoods(new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24 * 2), 0, 2000);
|
| | | for (Long auctionId : list) {
|
| | |
| | | .selectByOrderIdAndOrderItemId(order.getOrderId(), order.getOrderItemId());
|
| | | if (taoBaoWeiQuanOrder != null) {
|
| | | // 已经是最新的状态了
|
| | | if (taoBaoWeiQuanOrder.getState().equalsIgnoreCase("维权成功")
|
| | | || taoBaoWeiQuanOrder.getState().equalsIgnoreCase("维权失败"))
|
| | | if (taoBaoWeiQuanOrder.getState().contains("维权成功")
|
| | | || taoBaoWeiQuanOrder.getState().contains("维权失败"))
|
| | | return;
|
| | | // 更新金额,状态与时间
|
| | | TaoBaoWeiQuanOrder update = new TaoBaoWeiQuanOrder();
|
| | |
| | | taoBaoWeiQuanOrderMapper.updateByPrimaryKeySelective(update);
|
| | |
|
| | | try {
|
| | | if (order.getState().equalsIgnoreCase("维权成功")) {
|
| | | if (order.getState().contains("维权成功")) {
|
| | | List<MsgOrderDetail> msgList = msgOrderDetailService.listMsgOrderByOrderId(order.getOrderId());
|
| | | for (MsgOrderDetail msg : msgList) {
|
| | | if (msg.getType() == MsgTypeOrderTypeEnum.fanli) {
|
| | |
| | | return null;
|
| | | Map<String, DingDongQiangDTO> map = new HashMap<>();
|
| | | for (DingDongQiangDTO dto : list)
|
| | |
|
| | | map.put(dto.getTime(), dto);
|
| | |
|
| | | DingDongQiangDTO dto = map.get(time);
|
| | |
| | | List<Long> idList = new ArrayList<>();
|
| | | for (DaTaoKeDetail td : dto.getGoodsList())
|
| | | idList.add(td.getId());
|
| | | return listByIds(idList);
|
| | | List<DaTaoKeDetail> finalList = listByIds(idList);
|
| | | for (DaTaoKeDetail detail : finalList) {
|
| | | detail.setQuanReceive(
|
| | | detail.getQuanSurplus() + detail.getQuanReceive() - (int) (200 + Math.random() * 1000));
|
| | | }
|
| | | return finalList;
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
| | | */
|
| | | @Transactional
|
| | | private void extractByZhiFuBao(Extract extract, AdminUser adminUser) {
|
| | | LogHelper.userErrorInfo("提现:开始通过提现-"+extract.getId());
|
| | | String privateKey = Constant.alipayConfig.getPrivateKey();
|
| | | AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do",
|
| | | Constant.alipayConfig.getAppId(), privateKey, "json", "gbk", null, "RSA2");
|
| | |
| | | AlipayFundTransToaccountTransferResponse response = null;
|
| | | try {
|
| | | response = alipayClient.execute(request);
|
| | | LogHelper.userErrorInfo("提现:支付宝通过提现成功-"+extract.getId());
|
| | | } catch (AlipayApiException e) {
|
| | | e.printStackTrace();
|
| | | LogHelper.userErrorInfo("支付宝提现异常:" + response + ",提现信息" + GsonUtil.toJson(extract));
|
| | | LogHelper.userErrorInfo("提现:支付宝提现异常:" + response + ",提现信息" + GsonUtil.toJson(extract));
|
| | | }
|
| | |
|
| | | try {
|
| | | CMQManager.getInstance().addExtractResultMsg(extract, response, adminUser);
|
| | | LogHelper.userErrorInfo("提现:添加处理队列成功-"+extract.getId());
|
| | | } catch (Exception e) {
|
| | | LogHelper.userErrorInfo("支付宝提现CMQ异常:" + new Gson().toJson(response) + ",提现信息" + GsonUtil.toJson(extract));
|
| | | LogHelper.userErrorInfo("提现:支付宝提现CMQ异常:" + new Gson().toJson(response) + ",提现信息" + GsonUtil.toJson(extract));
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | */
|
| | | public void doTaoBaoOrders() {
|
| | | // 同时开启3个线程处理
|
| | | for (int i = 0; i < 1; i++) {
|
| | | for (int i = 0; i < 3; i++) {
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | |
| | |
|
| | | for (int i = 0; i < subscripts.length; i++) {
|
| | | String queueName = queues[i];
|
| | | cmqUtil.createQueue(queueName);
|
| | | cmqUtil.subscribeTopic(TOPIC_NAME, subscripts[i], queueName);
|
| | | try {
|
| | | cmqUtil.createQueue(queueName);
|
| | | } catch (Exception e) {
|
| | | }
|
| | | try {
|
| | | cmqUtil.subscribeTopic(TOPIC_NAME, subscripts[i], queueName);
|
| | | } catch (Exception e) {
|
| | |
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | if (dto == null)
|
| | | return;
|
| | | cmqUtil.publishTopicMessage(TOPIC_NAME, new Gson().toJson(dto));
|
| | | LogHelper.test("邀请消息投递成功");
|
| | | LogHelper.test("资金消息投递成功");
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | package com.yeshi.fanli.util.taobao;
|
| | |
|
| | | import java.io.File;
|
| | | import java.io.FileInputStream;
|
| | | import java.io.FileNotFoundException;
|
| | | import java.io.IOException;
|
| | | import java.io.InputStream;
|
| | | import java.math.BigDecimal;
|
| | | import java.net.URLEncoder;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Comparator;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.Iterator;
|
| | |
| | | return getOrderList(30, config);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取维权成功订单
|
| | | * |
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public static List<TaoBaoWeiQuanOrder> getWeiQuanOrders(long startTime, long endTime, TaoBaoUnionConfig config) {
|
| | | String cookie = getTaoBaoCookie(config.getAccount());
|
| | | return getWeiQuanOrders(cookie, startTime, endTime);
|
| | |
|
| | |
|
| | | public static List<TaoBaoWeiQuanOrder> getWeiQuanOrders(String excelPath) {
|
| | | try {
|
| | | return parseWeiQuanOrder(new FileInputStream(new File(excelPath)));
|
| | | } catch (FileNotFoundException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | private static List<TaoBaoWeiQuanOrder> getWeiQuanOrders(String cookies, long startTime, long endTime) {
|
| | |
| | | for (int c = 0; c < sheet.getColumns(); c++) {
|
| | | String content = sheet.getCell(c, r).getContents().trim();
|
| | | switch (c) {
|
| | | case 0://
|
| | | orderRecord.setOrderId(content);
|
| | | break;
|
| | | case 1://
|
| | | orderRecord.setOrderItemId(content);
|
| | | break;
|
| | | case 2://
|
| | | orderRecord.setGoodsName(content);
|
| | | break;
|
| | | case 3:
|
| | | orderRecord.setMoney(StringUtil.isNullOrEmpty(content) ? null : new BigDecimal(content));
|
| | | break;
|
| | | case 4:
|
| | | orderRecord.setFanMoney(StringUtil.isNullOrEmpty(content) ? null : new BigDecimal(content));
|
| | | break;
|
| | | case 5://
|
| | | orderRecord.setState(content);
|
| | | break;
|
| | | case 6://
|
| | | if (!StringUtil.isNullOrEmpty(content))
|
| | | orderRecord.setJieSuanTime(
|
| | | new Date(TimeUtil.convertToTimeTemp(content, "yyyy-MM-dd HH:mm:ss")));
|
| | | break;
|
| | | case 7://
|
| | | case 0://维权时间
|
| | | if (!StringUtil.isNullOrEmpty(content))
|
| | | orderRecord.setWeiQuanTime(
|
| | | new Date(TimeUtil.convertToTimeTemp(content, "yyyy-MM-dd HH:mm:ss")));
|
| | | break;
|
| | | case 8://
|
| | | case 1://维权完成时间
|
| | | if (!StringUtil.isNullOrEmpty(content))
|
| | | orderRecord.setWeiQuanFinishTime(
|
| | | new Date(TimeUtil.convertToTimeTemp(content, "yyyy-MM-dd HH:mm:ss")));
|
| | | break;
|
| | | case 2://结算时间
|
| | | if (!StringUtil.isNullOrEmpty(content))
|
| | | orderRecord.setJieSuanTime(
|
| | | new Date(TimeUtil.convertToTimeTemp(content, "yyyy-MM-dd HH:mm:ss")));
|
| | | break;
|
| | | case 3://商品名称
|
| | | orderRecord.setGoodsName(content);
|
| | | break;
|
| | | case 5://淘宝订单号
|
| | | orderRecord.setOrderId(content);
|
| | | break;
|
| | | case 6://淘宝子订单号
|
| | | orderRecord.setOrderItemId(content);
|
| | | break;
|
| | | case 7://维权状态
|
| | | orderRecord.setState(content);
|
| | | break;
|
| | | case 8://结算金额
|
| | | |
| | | break;
|
| | | case 9://退款金额
|
| | | orderRecord.setMoney(StringUtil.isNullOrEmpty(content) ? null : new BigDecimal(content));
|
| | | break;
|
| | | |
| | | case 10://返还商家金额 |
| | | orderRecord.setFanMoney(StringUtil.isNullOrEmpty(content) ? null : new BigDecimal(content));
|
| | | break;
|
| | | }
|
| | | }
|
| | | if (!StringUtil.isNullOrEmpty(orderRecord.getOrderId()))
|
| | |
| | | MoneyBigDecimalUtil.getWithNoZera(detail.getQuanPrice())));
|
| | | taoBaoGoods.setCouponLeftCount(detail.getQuanSurplus());
|
| | | taoBaoGoods.setCouponStartFee(new BigDecimal(detail.getQuanCondition()));
|
| | | taoBaoGoods.setCouponTotalCount(detail.getQuanSurplus());
|
| | | if (detail.getQuanReceive() != null)
|
| | | taoBaoGoods.setCouponTotalCount(detail.getQuanSurplus() + detail.getQuanReceive());
|
| | | taoBaoGoods.setPictUrl(detail.getPic());
|
| | | taoBaoGoods.setPictUrlWhite(detail.getPic());
|
| | | taoBaoGoods.setSellerId(detail.getSellerId());
|
| | |
| | | for (int i = 0; i < count; i++) {
|
| | | int totalSpanOrderCount = 0;
|
| | | List<TaoBaoPunishOrder> spanOrderList = new ArrayList<>();
|
| | | long startT = startTime + i * span*1000;
|
| | | long startT = startTime + i * span * 1000;
|
| | | data.put("start_time", TimeUtil.getGernalTime(startT, "yyyy-MM-dd HH:mm:ss"));
|
| | | data.put("span", 1800 + "");
|
| | | map.put("af_order_option", data.toString());
|
| | | try {
|
| | | JSONObject json = TaoKeBaseUtil.baseRequest(map, app);
|
| | | JSONObject dataJson = json.optJSONObject("tbk_dg_punish_order_get_response").optJSONObject("result").optJSONObject("data");
|
| | | JSONObject dataJson = json.optJSONObject("tbk_dg_punish_order_get_response").optJSONObject("result")
|
| | | .optJSONObject("data");
|
| | | JSONArray array = dataJson.optJSONObject("results").optJSONArray("result");
|
| | | if (array != null)
|
| | | for (int n = 0; n < array.size(); n++) {
|
| | |
| | | map.put("method", "taobao.tbk.relation.refund");
|
| | |
|
| | | JSONObject option = new JSONObject();
|
| | | option.put("search_type", 1);
|
| | | option.put("search_type", 2);
|
| | | option.put("refund_type", third ? 2 : 1);
|
| | | option.put("start_time", TimeUtil.getGernalTime(startTime.getTime(), "yyyy-MM-dd HH:mm:ss"));
|
| | | option.put("page_no", page);
|
| | |
| | | int count = results.optInt("total_count");
|
| | | finalResult.totalCount = count;
|
| | | JSONArray array = results.optJSONArray("result");
|
| | | for (int i = 0; i < array.size(); i++) {
|
| | | JSONObject item = array.optJSONObject(i);
|
| | | TaoBaoWeiQuanOrder order = new TaoBaoWeiQuanOrder();
|
| | | order.setGoodsName(item.optString("tb_auction_title"));
|
| | | BigDecimal fanMoney = new BigDecimal(0);
|
| | | if (!StringUtil.isNullOrEmpty(item.optString("tk_subsidy_fee_refund3rd_pub"))) {
|
| | | fanMoney.add(new BigDecimal(item.optString("tk_subsidy_fee_refund3rd_pub")));
|
| | | }
|
| | | if (!StringUtil.isNullOrEmpty(item.optString("tk_commission_fee_refund3rd_pub"))) {
|
| | | fanMoney.add(new BigDecimal(item.optString("tk_commission_fee_refund3rd_pub")));
|
| | | }
|
| | | if (!StringUtil.isNullOrEmpty(item.optString("tk_subsidy_fee_refund_pub"))) {
|
| | | fanMoney.add(new BigDecimal(item.optString("tk_subsidy_fee_refund_pub")));
|
| | | }
|
| | | if (!StringUtil.isNullOrEmpty(item.optString("tk_commission_fee_refund_pub"))) {
|
| | | fanMoney.add(new BigDecimal(item.optString("tk_commission_fee_refund_pub")));
|
| | | }
|
| | | if (array != null)
|
| | | for (int i = 0; i < array.size(); i++) {
|
| | | JSONObject item = array.optJSONObject(i);
|
| | | TaoBaoWeiQuanOrder order = new TaoBaoWeiQuanOrder();
|
| | | order.setGoodsName(item.optString("tb_auction_title"));
|
| | | BigDecimal fanMoney = new BigDecimal(0);
|
| | | if (!StringUtil.isNullOrEmpty(item.optString("tk_subsidy_fee_refund3rd_pub"))) {
|
| | | fanMoney= fanMoney.add(new BigDecimal(item.optString("tk_subsidy_fee_refund3rd_pub")));
|
| | | }
|
| | | if (!StringUtil.isNullOrEmpty(item.optString("tk_commission_fee_refund3rd_pub"))) {
|
| | | fanMoney= fanMoney.add(new BigDecimal(item.optString("tk_commission_fee_refund3rd_pub")));
|
| | | }
|
| | | if (!StringUtil.isNullOrEmpty(item.optString("tk_subsidy_fee_refund_pub"))) {
|
| | | fanMoney= fanMoney.add(new BigDecimal(item.optString("tk_subsidy_fee_refund_pub")));
|
| | | }
|
| | | if (!StringUtil.isNullOrEmpty(item.optString("tk_commission_fee_refund_pub"))) {
|
| | | fanMoney= fanMoney.add(new BigDecimal(item.optString("tk_commission_fee_refund_pub")));
|
| | | }
|
| | |
|
| | | if (fanMoney.compareTo(new BigDecimal(0)) == 0)
|
| | | fanMoney = null;
|
| | | if (fanMoney.compareTo(new BigDecimal(0)) == 0)
|
| | | fanMoney = null;
|
| | |
|
| | | order.setFanMoney(fanMoney);
|
| | | order.setJieSuanTime(
|
| | | new Date(TimeUtil.convertToTimeTemp(item.optString("earning_time"), "yyyy-MM-dd HH:mm:ss")));
|
| | | if (!StringUtil.isNullOrEmpty(item.optString("refund_fee")))
|
| | | order.setMoney(new BigDecimal(item.optString("refund_fee")));
|
| | | order.setOrderId(item.optString("tb_trade_parent_id"));
|
| | | order.setOrderItemId(item.optString("tb_trade_id"));
|
| | | int state = item.optInt("refund_status");
|
| | | if (state == 4)
|
| | | order.setState("维权创建");
|
| | | else if (state == 2)
|
| | | order.setState("维权成功");
|
| | | else if (state == 3)
|
| | | order.setState("维权失败");
|
| | | order.setFanMoney(fanMoney);
|
| | | order.setJieSuanTime(new Date(
|
| | | TimeUtil.convertToTimeTemp(item.optString("earning_time"), "yyyy-MM-dd HH:mm:ss")));
|
| | | if (!StringUtil.isNullOrEmpty(item.optString("refund_fee")))
|
| | | order.setMoney(new BigDecimal(item.optString("refund_fee")));
|
| | | order.setOrderId(item.optString("tb_trade_parent_id"));
|
| | | order.setOrderItemId(item.optString("tb_trade_id"));
|
| | | int state = item.optInt("refund_status");
|
| | | if (state == 4)
|
| | | order.setState("维权创建");
|
| | | else if (state == 2)
|
| | | order.setState("维权成功");
|
| | | else if (state == 3)
|
| | | order.setState("维权失败");
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(item.optString("tk_refund_suit_time")))
|
| | | order.setWeiQuanFinishTime(new Date(
|
| | | TimeUtil.convertToTimeTemp(item.optString("tk_refund_suit_time"), "yyyy-MM-dd HH:mm:ss")));
|
| | | order.setWeiQuanTime(
|
| | | new Date(TimeUtil.convertToTimeTemp(item.optString("tk_refund_time"), "yyyy-MM-dd HH:mm:ss")));
|
| | | list.add(order);
|
| | | }
|
| | | if (!StringUtil.isNullOrEmpty(item.optString("tk_refund_suit_time")))
|
| | | order.setWeiQuanFinishTime(new Date(TimeUtil
|
| | | .convertToTimeTemp(item.optString("tk_refund_suit_time"), "yyyy-MM-dd HH:mm:ss")));
|
| | | order.setWeiQuanTime(new Date(
|
| | | TimeUtil.convertToTimeTemp(item.optString("tk_refund_time"), "yyyy-MM-dd HH:mm:ss")));
|
| | | list.add(order);
|
| | | }
|
| | |
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|