feat:商城支付
This commit is contained in:
1 parent
0f7c3c496b
commit
5e17576074
32 files changed
+774
-156
No files matched your search
+2
-3
@@ -6,7 +6,6 @@ import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 硬件设备类型
|
||||
@@ -23,7 +22,7 @@ public enum HardTypeEnum {
|
||||
MERCHANT_QR_CODE("5", "商户二维码扣款牌"),
|
||||
OTHER("6", "其他支付方式(第三方接口对接)"),
|
||||
MERCHANT_ACT("7", "商户活动"),
|
||||
FARMER("8", "共富商城(助农)"),
|
||||
SELF_APP("8", "无设备或者用户自己的手机"),
|
||||
YUN_XFJ("9", "云版消费机"),
|
||||
YYX_4G("10", "4G-云音响"),
|
||||
YYX_WIFI("11", "wifi-云音响"),
|
||||
@@ -32,7 +31,7 @@ public enum HardTypeEnum {
|
||||
private final String description;
|
||||
|
||||
// 是否能预定
|
||||
public static final List<HardTypeEnum> isReserveList = List.of(SUPERMARKET, CANTEEN, FARMER);
|
||||
public static final List<HardTypeEnum> isReserveList = List.of(SUPERMARKET, CANTEEN, SELF_APP);
|
||||
|
||||
// 不需要创建购物车
|
||||
public static final List<HardTypeEnum> isNoneCar = List.of(MERCHANT_QR_CODE);
|
||||
|
||||
+8
-3
@@ -10,21 +10,26 @@ import java.util.List;
|
||||
/**
|
||||
* 订单状态
|
||||
* 外卖状态 100(待接单(外卖))->110(配送中(外卖))-> 200(已核销(已完成))
|
||||
* 商城状态 1(创建订单未支付) -> 200(已经支付/待发货) -> 200(待收货) -> 210(待评价) ->220(已评价)
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum HardOrderStatusEnum {
|
||||
CREATE("1", "创建订单(未支付)"),
|
||||
OFFLINE_CREATE("2", "离线创建订单(未支付)"),
|
||||
PAY("5", "已经支付"),
|
||||
PAY("5", "已经支付/待发货"),
|
||||
OFFLINE_PAY("6", "没有网络本地支付"),
|
||||
REFUND("10", "退款"),
|
||||
CANCEL("20", "已核销(已完成)"),
|
||||
UNFOLLOW("30", "已取消(智能柜)"),
|
||||
UNFOLLOW("30", "已取消、未支付自动取消(智能柜、商城购买)"),
|
||||
|
||||
TAKE_OUT_AWAIT("100", "待接单(外卖)"),
|
||||
TAKE_OUT_ING("110", "配送中(外卖)"),
|
||||
|
||||
SHOP_WAIT_PAY_SUCCESS("200","待发货/已支付(商城购买)"),
|
||||
SHOP_WAIT_RECEIVE("210","待收货(商城购买)"),
|
||||
SHOP_WAIT_EVALUATE("220","订单完成/待评价(商城购买)"),
|
||||
// SHOP_EVALUATED("230","已评价(商城购买)"),
|
||||
;
|
||||
private final String type;
|
||||
private final String description;
|
||||
@@ -54,4 +59,4 @@ public enum HardOrderStatusEnum {
|
||||
if (ObjectUtil.isEmpty(type)) return null;
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get();
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -19,7 +19,7 @@ public enum HardOrderTypeEnum {
|
||||
STRIDE_DEPT("4", "跨单位"),
|
||||
ZY("5", "正元公务餐"),
|
||||
LB("6", "宁波银行(美好生活)"),
|
||||
FARMER("7", "共富商城(助农)"),
|
||||
FARMER("7", "共富商城(助农),现在用于商城"),
|
||||
TOC_VISITOR("8", "toc访客购买(不记名用户)"),
|
||||
XFJ("9", "消费机支付"),
|
||||
TAKE_OUT("10", "外卖"),
|
||||
|
||||
+20
-2
@@ -2,6 +2,7 @@ package com.bsd.pjcloud.hard.api.constant.order;
|
||||
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.bsd.pjcloud.thirdparty.constant.miniplatform.AppPlusPlatformTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@@ -25,7 +26,9 @@ public enum HardPayTypeEnum {
|
||||
CASH("8", "现金支付"),
|
||||
HARD_DOOR_FREE_PAY("9", "智能柜免密支付"),
|
||||
WECHANT_SELF_QR_CODE_PAY("10", "微信付款码支付"),
|
||||
WECHANT_APP_PAY("100", "微信App支付"),
|
||||
ALI_SELF_QR_CODE_PAY("11", "支付宝付款码支付"),
|
||||
ALI_APP_PAY("110", "支付宝App支付"),
|
||||
ZYY("12", "中医院"),
|
||||
RMYY("13", "人民医院"),
|
||||
CSXFK("14", "超市消费卡"),
|
||||
@@ -53,7 +56,9 @@ public enum HardPayTypeEnum {
|
||||
STRIDE_DEPT_QR_CODE,
|
||||
FOREIGN_TICKET_QR_CODE,
|
||||
WECHANT_SELF_QR_CODE_PAY,
|
||||
ALI_SELF_QR_CODE_PAY
|
||||
ALI_SELF_QR_CODE_PAY,
|
||||
WECHANT_APP_PAY,
|
||||
ALI_APP_PAY
|
||||
);
|
||||
|
||||
// 可以核销的订单
|
||||
@@ -77,8 +82,21 @@ public enum HardPayTypeEnum {
|
||||
WALLET_CARD
|
||||
);
|
||||
|
||||
public static HardPayTypeEnum transformHardPayTypeEnum(AppPlusPlatformTypeEnum appPlusPlatformTypeEnum) {
|
||||
switch (appPlusPlatformTypeEnum) {
|
||||
case WECHAT:
|
||||
return HardPayTypeEnum.WECHANT_APP_PAY;
|
||||
case ALI_PAY:
|
||||
return HardPayTypeEnum.ALI_APP_PAY;
|
||||
case ZAX_APP_WALLET:
|
||||
return HardPayTypeEnum.WALLET_DEFAULT;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static HardPayTypeEnum valueOfByType(String type) {
|
||||
if (ObjectUtil.isEmpty(type)) return null;
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get();
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().orElse(null);
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.bsd.pjcloud.hard.api.dto.order;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HardShipmentDto {
|
||||
|
||||
/**
|
||||
* 发货地址id
|
||||
*/
|
||||
@NotNull(message = "发货地址id不能为空")
|
||||
private Long addressId;
|
||||
|
||||
/**
|
||||
* 快递物流编号
|
||||
*/
|
||||
@NotNull(message = "快递物流编号不能为空")
|
||||
private String shipmentNo;
|
||||
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
package com.bsd.pjcloud.hard.api.dto.order.app;
|
||||
|
||||
import com.bsd.pjcloud.hard.api.constant.HardTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.order.HardOrderTypeEnum;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class HardAppCreateShopOrderDto {
|
||||
|
||||
/**
|
||||
* 父购物车id
|
||||
*/
|
||||
@NotNull(message = "父购物车id不能为空")
|
||||
private Long carParentId;
|
||||
|
||||
/**
|
||||
* 地图地址
|
||||
*/
|
||||
@NotNull(message = "地图地址不能为空")
|
||||
private Long mapAddressId;
|
||||
|
||||
/**
|
||||
* 支付方式
|
||||
*/
|
||||
@NotNull(message = "地图地址不能为空")
|
||||
private String payType;
|
||||
|
||||
/**
|
||||
* 钱包类型
|
||||
*/
|
||||
private Long walletTypeId;
|
||||
|
||||
/**
|
||||
* 自动填充
|
||||
*/
|
||||
private HardTypeEnum hardType;
|
||||
|
||||
private HardOrderTypeEnum orderType;
|
||||
|
||||
private Long userId;
|
||||
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.bsd.pjcloud.hard.api.dto.order.remote;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HardUpdateShopStatusDto {
|
||||
@NotNull(message = "订单id不能为空")
|
||||
private Long orderId;
|
||||
|
||||
@NotNull(message = "订单状态不能为空")
|
||||
private HardUpdateShopStatusDto.ChangeShopStatus status;
|
||||
|
||||
public enum ChangeShopStatus {
|
||||
// 支付成功
|
||||
PAY_SUCCESS,
|
||||
// 退款成功
|
||||
REFUND_SUCCESS,
|
||||
;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -9,7 +9,7 @@ public class HardUpdateTakeOutStatusDto {
|
||||
@NotNull(message = "订单id不能为空")
|
||||
private Long orderId;
|
||||
|
||||
@NotNull(message = "订单id不能为空")
|
||||
@NotNull(message = "订单状态不能为空")
|
||||
private HardUpdateTakeOutStatusDto.TakeOutStatus status;
|
||||
|
||||
public enum TakeOutStatus {
|
||||
|
||||
+81
@@ -2,11 +2,13 @@ package com.bsd.pjcloud.hard.api.entity.order;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.bsd.pjcloud.hard.api.entity.address.HardUserMapAddressEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
@@ -99,6 +101,66 @@ public class HardOrderAddressEntity extends Model<HardOrderAddressEntity> {
|
||||
@Schema(description = "详细地址")
|
||||
private String fullAddress;
|
||||
|
||||
/**
|
||||
* 省
|
||||
*/
|
||||
@Schema(description = "省")
|
||||
private String province;
|
||||
|
||||
/**
|
||||
* 市
|
||||
*/
|
||||
@Schema(description = "市")
|
||||
private String city;
|
||||
|
||||
/**
|
||||
* 区
|
||||
*/
|
||||
@Schema(description = "区")
|
||||
private String district;
|
||||
|
||||
/**
|
||||
* 街道
|
||||
*/
|
||||
@Schema(description = "街道")
|
||||
private String street;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@Schema(description = "经度")
|
||||
private BigDecimal longitude;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
@Schema(description = "纬度")
|
||||
private BigDecimal latitude;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
@Schema(description = "联系人")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@Schema(description = "手机号")
|
||||
private String userMoblie;
|
||||
|
||||
/**
|
||||
* tag
|
||||
*/
|
||||
@Schema(description = "tag")
|
||||
private String tag;
|
||||
|
||||
/**
|
||||
* 用户手动输入地址
|
||||
*/
|
||||
@Schema(description = "用户手动输入地址")
|
||||
private String inputAddress;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@@ -140,4 +202,23 @@ public class HardOrderAddressEntity extends Model<HardOrderAddressEntity> {
|
||||
*/
|
||||
@Schema(description = "租户ID")
|
||||
private Long tenantId;
|
||||
|
||||
public static HardOrderAddressEntity of(HardUserMapAddressEntity entity) {
|
||||
HardOrderAddressEntity orderAddress = new HardOrderAddressEntity();
|
||||
orderAddress.setUserId(entity.getUserId());
|
||||
orderAddress.setAddressId(entity.getId());
|
||||
orderAddress.setAddressName(entity.getAdressDetail());
|
||||
orderAddress.setFullAddress(entity.getFullAddress());
|
||||
orderAddress.setProvince(entity.getProvince());
|
||||
orderAddress.setCity(entity.getCity());
|
||||
orderAddress.setDistrict(entity.getDistrict());
|
||||
orderAddress.setStreet(entity.getStreet());
|
||||
orderAddress.setLongitude(entity.getLongitude());
|
||||
orderAddress.setLatitude(entity.getLatitude());
|
||||
orderAddress.setUsername(entity.getUsername());
|
||||
orderAddress.setUserMoblie(entity.getUserMoblie());
|
||||
orderAddress.setTag(entity.getTag());
|
||||
orderAddress.setInputAddress(entity.getInputAddress());
|
||||
return orderAddress;
|
||||
}
|
||||
}
|
||||
+26
-1
@@ -36,7 +36,7 @@ public class HardOrderEntity extends Model<HardOrderEntity> {
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
@Schema(description = "订单编号 目前正元、微信支付、云消费机、支付宝支付正在使用")
|
||||
@Schema(description = "订单编号 目前正元、微信支付、云消费机、微信、支付宝支付正在使用")
|
||||
private String orderNo;
|
||||
|
||||
/**
|
||||
@@ -231,12 +231,37 @@ public class HardOrderEntity extends Model<HardOrderEntity> {
|
||||
@Schema(description = "离线自动支付是否成功")
|
||||
private String offlinePaySuccess;
|
||||
|
||||
/**
|
||||
* 地址id
|
||||
*/
|
||||
@Schema(description = "地址id")
|
||||
private Long addressId;
|
||||
|
||||
/**
|
||||
* 收货地址
|
||||
*/
|
||||
@Schema(description = "收货地址")
|
||||
private String addressName;
|
||||
|
||||
/**
|
||||
* 快递单号
|
||||
*/
|
||||
@Schema(description = "快递单号")
|
||||
private String shipmentNo;
|
||||
|
||||
/**
|
||||
* 发货时间
|
||||
* 自动收货时间=发货时间+15天
|
||||
*/
|
||||
@Schema(description = "发货时间")
|
||||
private LocalDateTime shippedTime;
|
||||
|
||||
/**
|
||||
* 收货时间
|
||||
*/
|
||||
@Schema(description = "收货时间")
|
||||
private LocalDateTime deliveredTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
|
||||
+6
@@ -5,6 +5,7 @@ import com.bsd.pjcloud.common.core.constant.ServiceNameConstants;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.feign.annotation.NoToken;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.HardOrderPreferencesDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.remote.HardUpdateShopStatusDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.remote.HardUpdateTakeOutStatusDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardOrderEntity;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
@@ -32,4 +33,9 @@ public interface RemoteHardOrderService {
|
||||
@NoToken
|
||||
@PostMapping("/hard-order/update-take-out-status")
|
||||
R<Boolean> updateTakeOutStatus(@RequestBody HardUpdateTakeOutStatusDto dto);
|
||||
|
||||
@NoToken
|
||||
@PostMapping("/hard-order/update-shop-status")
|
||||
R<Boolean> updateShopStatus(@RequestBody HardUpdateShopStatusDto dto);
|
||||
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package com.bsd.pjcloud.hard.api.vo.order.app;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class HardAppCreateShopOrderVo {
|
||||
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 支付单号
|
||||
*/
|
||||
private String payNo;
|
||||
|
||||
/**
|
||||
* 发起支付参数
|
||||
*/
|
||||
private Map<String, Object> appPlusPayParams;
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user