From 17caebabf7a6a529b7039c71e21e5a324e31ea20 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期五, 27 九月 2024 16:23:42 +0800 Subject: [PATCH] 代理新功能完善 --- src/main/java/com/taoke/autopay/factory/OrderFactory.java | 31 +++++++++++++++---------------- 1 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/taoke/autopay/factory/OrderFactory.java b/src/main/java/com/taoke/autopay/factory/OrderFactory.java index e05b0c3..21b4df4 100644 --- a/src/main/java/com/taoke/autopay/factory/OrderFactory.java +++ b/src/main/java/com/taoke/autopay/factory/OrderFactory.java @@ -4,9 +4,11 @@ import com.taoke.autopay.entity.KeyOrder; import com.taoke.autopay.entity.OrderChannelEnum; import com.taoke.autopay.entity.WxUserOrderCount; +import com.taoke.autopay.entity.agent.ChannelAgent; import com.taoke.autopay.utils.Constant; import com.taoke.autopay.utils.StringUtil; import com.taoke.autopay.utils.TimeUtil; +import com.taoke.autopay.utils.order.OrderChannelUtil; import com.taoke.autopay.vo.AgentOrderVO; import com.taoke.autopay.vo.UserInfoVO; import com.taoke.autopay.vo.admin.AdminOrderVO; @@ -46,6 +48,7 @@ vo.setState(KeyOrderVO.STATE_PROCESSED); break; } + vo.setPayType(order.getPayType()); return vo; } @@ -91,25 +94,12 @@ } - public static AdminOrderVO createAdminVO(KeyOrder order, ClientInfo info) { + public static AdminOrderVO createAdminVO(KeyOrder order, ClientInfo info, ChannelAgent agent) { AdminOrderVO vo = new AdminOrderVO(); vo.setCreateTime(order.getCreateTime()); vo.setId(order.getId()); vo.setKey(order.getKey()); - switch (order.getState()) { - case KeyOrder.STATE_NOT_PROCESS: - vo.setState(KeyOrderVO.STATE_NOT_PROCESS); - break; - case KeyOrder.STATE_NOT_PAY: - vo.setState(KeyOrderVO.STATE_PROCESS_ERROR); - break; - case KeyOrder.STATE_PAY: - vo.setState(KeyOrderVO.STATE_PROCESSED); - break; - case KeyOrder.STATE_REJECT_PAY: - vo.setState(KeyOrderVO.STATE_PROCESSED); - break; - } + vo.setState(order.getState()); vo.setStateDesc(order.getStateDesc()); vo.setOrderStateDesc(getOrderStateDesc(order.getOrderState(), order.getOrderType())); vo.setExcutePayTime(order.getExcutePayTime()); @@ -119,11 +109,20 @@ vo.setDistributedTime(order.getDistributeTime()); vo.setDistributedClientInfo(info); vo.setUid(order.getUid()); + OrderChannelEnum orderChannel=OrderChannelUtil.getChannelByKey(order.getOrderChannel()); + vo.setOrderChannel(orderChannel==null?"鏈煡":orderChannel.getName()); + vo.setPayMerchant(order.getPayMerchant()); + if(agent!=null){ + vo.setAgent(agent.getName()); + }else{ + vo.setAgent(""); + } + return vo; } public static String createId(WxUserOrderCount orderCountInfo) { - return String.format("%s-%s-%s", orderCountInfo.getDay(), orderCountInfo.getUid(), orderCountInfo.getOrderType()); + return String.format("%s-%s-%s-%s", orderCountInfo.getDay(), orderCountInfo.getUid(), orderCountInfo.getOrderType(),orderCountInfo.getOrderChannel()==null?"": orderCountInfo.getOrderChannel().name()); } -- Gitblit v1.8.0