| | |
| | | }
|
| | |
|
| | | // 数据加工重新组织
|
| | | listDataFactory(listOrder, listGoods);
|
| | | listDataFactory(listOrder, listGoods, uid);
|
| | |
|
| | | return listOrder;
|
| | | }
|
| | |
| | | return commonOrderMapper.countByUidAndOrderState(uid, type, startTime, endTime, day);
|
| | | }
|
| | |
|
| | | public void listDataFactory(List<CommonOrderVO> listOrder, List<CommonOrderVO> listGoods) {
|
| | | public void listDataFactory(List<CommonOrderVO> listOrder, List<CommonOrderVO> listGoods, Long uid) {
|
| | |
|
| | | /* 组合商品信息 */
|
| | | for (CommonOrderVO commonOrder : listGoods) {
|
| | |
| | | SimpleDateFormat formatday = new SimpleDateFormat("yyyy.MM.dd");
|
| | |
|
| | | for (CommonOrderVO order : listOrder) {
|
| | | Date createTime = order.getCreateTime();
|
| | | if (createTime != null) {
|
| | | order.setObtainTime(createTime.getTime());
|
| | | }
|
| | |
|
| | | Date thirdCreateTime = order.getThirdCreateTime();
|
| | | if (thirdCreateTime != null) {
|
| | | order.setDownTime("下单时间:" + format.format(thirdCreateTime));
|
| | | order.setObtainTime(thirdCreateTime.getTime());
|
| | | }
|
| | |
|
| | | Date settleTime = order.getSettleTime();
|
| | |
| | | /* 订单状态 转换处理 */
|
| | | String orderStateContent = "";
|
| | | Map<String, String> orderStateMap = new HashMap<String, String>();
|
| | |
|
| | | Integer hongBaoState = order.getHongBaoState();
|
| | |
|
| | | |
| | | // 订单状态
|
| | | Integer orderState = order.getState();
|
| | | // 红包状态
|
| | | Integer hongBaoState = order.getHongBaoState();
|
| | | |
| | | Integer stateWholeOrder = order.getStateWholeOrder();
|
| | | if (CommonOrder.STATE_WHOLE_ORDER_BUFENYOUXIAO == stateWholeOrder) {
|
| | | // 整个订单部分失效:判断真实状态 订单、红包
|
| | | CommonOrderVO buFenOrder = commonOrderMapper.getBuFenOrderState(uid, order.getOrderNo());
|
| | | if (buFenOrder != null) {
|
| | | // 有效的订单状态
|
| | | orderState = buFenOrder.getState();
|
| | | // 有效的红包状态
|
| | | hongBaoState = buFenOrder.getHongBaoState();
|
| | | }
|
| | | } |
| | | |
| | | |
| | | if (CommonOrder.STATE_FK == orderState) {
|
| | | orderStateContent = "已付款";
|
| | | } else if (CommonOrder.STATE_JS == orderState) {
|
| | |
| | | }
|
| | |
|
| | |
|
| | | |
| | | @Override
|
| | | public List<CommonOrderVO> listQuery(long start, int count, Integer keyType, String key, Integer state, |
| | | Integer type, Integer orderState, String startTime, String endTime) throws CommonOrderException {
|
| | | |
| | | |
| | | List<CommonOrderVO> list = commonOrderMapper.listQuery(start, count,keyType, key, state, type, |
| | | orderState, startTime, endTime);
|
| | | |
| | | |
| | | if (list == null) {
|
| | | list = new ArrayList<CommonOrderVO>();
|
| | | }
|
| | | |
| | | if (list.size() == 0) {
|
| | | return list;
|
| | | }
|
| | | |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
| | | for (CommonOrderVO order : list) {
|
| | | |
| | | // 下单时间
|
| | | Date thirdCreateTime = order.getThirdCreateTime();
|
| | | if (thirdCreateTime != null) {
|
| | | order.setDownTime(format.format(thirdCreateTime));
|
| | | }
|
| | | // 收货时间
|
| | | Date settleTime = order.getSettleTime();
|
| | | if (settleTime != null) {
|
| | | order.setReceiveTime(format.format(settleTime));
|
| | | }
|
| | | |
| | | // 到账时间
|
| | | Date accountTime = order.getAccountTime();
|
| | | if (accountTime != null) {
|
| | | order.setHongBaoDate(format.format(accountTime));
|
| | | }
|
| | | |
| | | BigDecimal settlement = order.getSettlement();
|
| | | if (settlement != null && settlement.compareTo(new BigDecimal(0)) > 0) {
|
| | | order.setPayment(settlement); // 实际付款金额
|
| | | }
|
| | |
|
| | | /* 订单返利类型 转换 */
|
| | | Integer hongBaoType = order.getHongBaoType();
|
| | | if (HongBaoV2.TYPE_ZIGOU == hongBaoType || 2 == hongBaoType) {
|
| | | // 自购
|
| | | order.setHongBaoType(1);
|
| | | } else if (HongBaoV2.TYPE_SHARE_GOODS == hongBaoType) {
|
| | | // 分享
|
| | | order.setHongBaoType(2);
|
| | | } else if (HongBaoV2.TYPE_YAOQING == hongBaoType || HongBaoV2.TYPE_YIJI == hongBaoType
|
| | | || HongBaoV2.TYPE_ERJI == hongBaoType || HongBaoV2.TYPE_SHARE_YIJI == hongBaoType
|
| | | || HongBaoV2.TYPE_SHARE_ERJI == hongBaoType) {
|
| | | // 邀请
|
| | | order.setHongBaoType(3);
|
| | | }
|
| | |
|
| | | Integer hongBaoState = order.getHongBaoState();
|
| | | if (HongBaoV2.STATE_KELINGQU == hongBaoState || HongBaoV2.STATE_BUKELINGQU == hongBaoState) {
|
| | | // 未到账
|
| | | order.setHongBaoState(1);
|
| | |
|
| | | } else if (HongBaoV2.STATE_YILINGQU == hongBaoState) {
|
| | | // 已到账
|
| | | order.setHongBaoState(2);
|
| | |
|
| | | } else if (HongBaoV2.STATE_SHIXIAO == hongBaoState) {
|
| | | // 已失效
|
| | | order.setHongBaoState(3);
|
| | | }
|
| | | |
| | | }
|
| | | |
| | | return list;
|
| | | |
| | | }
|
| | |
|
| | | @Override
|
| | | public long countQuery(Integer keyType, String key, Integer state, Integer type, Integer orderState,
|
| | | String startTime, String endTime) throws CommonOrderException {
|
| | | return commonOrderMapper.countQuery(keyType, key, state, type, orderState, startTime, endTime);
|
| | | }
|
| | | |
| | | }
|