Commit 7e7a79ca by xiaoer.li@freemud.com

Merge remote-tracking branch 'remotes/origin/feature/1.9.22_C端订单状态描述' into develop

parents cc4d8d58 6d590e1e
......@@ -917,6 +917,21 @@ public class OrderAdapter {
}
}
responseVo.setOrderCreateTime(yyyyMMddHHmmss.format(new Date(ordersBean.getGmtCreate())));
//到店的用餐方式有:打包带走、店内就餐 ,外卖没有用餐方式
if (OrderType.COLLECT_GOODS.getCode().equals(ordersBean.getType())) {
responseVo.setTakeOut(1);
responseVo.setTakeOutDesc("打包带走");
}
else if (OrderType.EAT_IN.getCode().equals(ordersBean.getType())) {
responseVo.setTakeOut(0);
responseVo.setTakeOutDesc("店内就餐");
}
else {
responseVo.setTakeOut(0);
responseVo.setTakeOutDesc("");
}
/*
if (OrderType.COLLECT_GOODS.getCode().equals(ordersBean.getType())) {
responseVo.setTakeOut(1);
responseVo.setTakeOutDesc("打包带走");
......@@ -924,6 +939,7 @@ public class OrderAdapter {
responseVo.setTakeOut(0);
responseVo.setTakeOutDesc("店内就餐");
}
*/
responseVo.setTableNumber(ordersBean.getBarCounter());
responseVo.setPayStatus(ordersBean.getPayStatus());
responseVo.setPayStatusDesc(Optional.ofNullable(PayStatus.getByCode(ordersBean.getPayStatus()))
......@@ -941,7 +957,7 @@ public class OrderAdapter {
//取餐码用日订单序号代替- v1.5.4变更为四位随机数
responseVo.setTakeCode(ordersBean.getOtherCode());
responseVo.setAmount(ordersBean.getAmount());
OrderViewStatusDto orderViewStatusDto = getOrderViewStatusDesc(ordersBean, wxAppId);
OrderViewStatusDto orderViewStatusDto = getOrderViewStatusDesc(ordersBean, wxAppId);
//围餐需求 订单中存在未称重的商品称重商品则金额为0
if (IappIdType.WC_XCX.getCode().equals(iAppId)) {
if (!orderCommonService.queryExistWeightNoNum(ordersBean)) {
......@@ -987,8 +1003,8 @@ public class OrderAdapter {
responseVo.setButtonEvaluate(orderViewStatusDto.getButtonEvaluate());
responseVo.setButtonMealCode(orderViewStatusDto.getButtonMealCode());
responseVo.setOrderType(ordersBean.getType());
responseVo.setOrderTypeDesc(Optional.ofNullable(OrderType.getByCode(ordersBean.getType()))
.map(OrderType::getDesc).orElse(""));
responseVo.setOrderTypeDesc(Optional.ofNullable(OrderTypeGather.getByCode(ordersBean.getType()))
.map(OrderTypeGather::getDesc).orElse(""));
responseVo.setOrderRemark(ordersBean.getRemark());
if (ordersBean.getGmtModified() != null) {
responseVo.setModifiedTime(DateUtil.convert2String(new Date(ordersBean.getGmtModified()), "yyyy-MM-dd HH:mm:ss"));
......@@ -1478,25 +1494,25 @@ public class OrderAdapter {
if (refundBean != null && RefundStatus.AGREE_REFUND.getCode().equals(refundBean.getStatus())) {
orderViewStatusDto.setOrderStatus(OrderStatus.CALCEL.getCode());
orderViewStatusDto.setOrderStatusDesc("已退款");
orderViewStatusDto.setOrderStatusDescText("感谢您对我们的信任,期待再次光临~");
orderViewStatusDto.setOrderStatusDescText("订单金额已原路退还,请及时查看~");
orderViewStatusDto.setButtonContactPartner(true);
}
if (refundBean != null && RefundStatus.ALREADY_REFUND.getCode().equals(refundBean.getStatus())) {
orderViewStatusDto.setOrderStatus(OrderStatus.CALCEL.getCode());
orderViewStatusDto.setOrderStatusDesc("退款中");
orderViewStatusDto.setOrderStatusDescText("感谢您对我们的信任,期待再次光临~");
orderViewStatusDto.setOrderStatusDescText("若48小时后商家未处理,则自动【同意】/【拒绝】退款~");
orderViewStatusDto.setButtonContactPartner(true);
}
if (OrderStatus.REFUSE.getCode().equals(orderBean.getStatus())) {
orderViewStatusDto.setOrderStatus(OrderStatus.REFUSE.getCode());
orderViewStatusDto.setOrderStatusDesc("已退款");
orderViewStatusDto.setOrderStatusDescText("感谢您对我们的信任,期待再次光临~");
orderViewStatusDto.setOrderStatusDescText("订单金额已原路退还,请及时查看~");
orderViewStatusDto.setButtonContactPartner(true);
}
if (PayStatus.HAVE_REFUND.getCode().equals(orderBean.getPayStatus())) {
orderViewStatusDto.setOrderStatus(OrderStatus.REFUSE.getCode());
orderViewStatusDto.setOrderStatusDesc("已退款");
orderViewStatusDto.setOrderStatusDescText("感谢您对我们的信任,期待再次光临~");
orderViewStatusDto.setOrderStatusDescText("订单金额已原路退还,请及时查看~");
orderViewStatusDto.setButtonContactPartner(true);
}
......@@ -1509,7 +1525,7 @@ public class OrderAdapter {
}
orderViewStatusDto.setOrderStatus(OrderStatus.COMPLETE.getCode());
orderViewStatusDto.setOrderStatusDesc("已完成");
orderViewStatusDto.setOrderStatusDescText("感谢您对我们的信任,期待再次光临~");
orderViewStatusDto.setOrderStatusDescText("订单已完成,记得来评价一下哦~");
orderViewStatusDto.setButtonContactPartner(true);
orderViewStatusDto.setButtonEvaluate(true);
if (OrderType.TAKE_OUT.getCode().equals(orderBean.getType())) {
......
package cn.freemud.enums;
/**
* All rights Reserved, Designed By www.freemud.cn
*
* @Title: cn.freemud.enums OrderTypeGather
* @Description: TDO 描述....
* @author: family
* @date: 2020/5/7
* @Copyright: www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
public enum OrderTypeGather {
TAKE_OUT(1, "外卖"),
PRE_ORDER(2, "预订单"),
MALL(3, "商城"),
COLLECT_GOODS(4, "到店"),
EAT_IN(5, "到店");
private Integer code;
private String desc;
//订单服务订单类型 1=外卖 4=自提,5=堂食
//外卖平台订单类型 1=常规堂食,2=预约堂食,3=常规外送,4=预约外送,5=常规自取,6=预约自取
OrderTypeGather(Integer code, String desc) {
this.code = code;
this.desc = desc;
}
public static OrderTypeGather getByCode(Integer code) {
if (code==null) {
return null;
}
for (OrderTypeGather orderTypeGather : values()) {
if (orderTypeGather.getCode().equals(code)) {
return orderTypeGather;
}
}
return null;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment