feat:二维码
This commit is contained in:
1 parent
872ebe235f
commit
fdab8dfd7a
55 files changed
+854
-173
No files matched your search
+9
@@ -5,6 +5,8 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 硬件设备类型
|
||||
@@ -21,6 +23,13 @@ public enum HardTypeEnum {
|
||||
private final String type;
|
||||
private final String description;
|
||||
|
||||
// 是否能预定
|
||||
private static final List<HardTypeEnum> isReserveList = List.of(SUPERMARKET, CANTEEN);
|
||||
|
||||
public static Boolean isReserve(HardTypeEnum type) {
|
||||
return isReserveList.contains(type);
|
||||
}
|
||||
|
||||
public static HardTypeEnum valueOfByType(String type) {
|
||||
if (ObjectUtil.isEmpty(type)) return null;
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get();
|
||||
|
||||
+3
@@ -3,6 +3,9 @@ package com.bsd.pjcloud.hard.api.constant.refund;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* 订单退款类型
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum HardRefundStatusEnum {
|
||||
|
||||
+4
-1
@@ -1,6 +1,6 @@
|
||||
package com.bsd.pjcloud.hard.api.dto.app;
|
||||
|
||||
import com.bsd.pjcloud.hard.api.dto.order.HardCarDto;
|
||||
import com.bsd.pjcloud.hard.api.constant.HardTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.HardCreateCarDto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
@@ -29,6 +29,9 @@ public class HardCarSaveOrUpdateDto {
|
||||
@Schema(description = "用户id")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "硬件设备类型")
|
||||
private HardTypeEnum hardType;
|
||||
|
||||
@Schema(description = "订单类型")
|
||||
private String orderType;
|
||||
|
||||
|
||||
+9
@@ -3,6 +3,15 @@ package com.bsd.pjcloud.hard.api.dto.order;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardAfterSaleEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class HardAfterSaleDto extends HardAfterSaleEntity {
|
||||
|
||||
private List<Long> userIds;
|
||||
|
||||
private LocalDate[] createTimeList;
|
||||
|
||||
}
|
||||
+12
@@ -3,6 +3,8 @@ package com.bsd.pjcloud.hard.api.dto.order;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardOrderEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@@ -13,6 +15,16 @@ public class HardOrderDto extends HardOrderEntity {
|
||||
*/
|
||||
private List<Long> userIds;
|
||||
|
||||
private List<Long> orderIds;
|
||||
|
||||
private List<Long> hardIds;
|
||||
|
||||
private List<Long> mchIds;
|
||||
|
||||
private LocalDate[] createTimeList;
|
||||
|
||||
private LocalDate[] payTimeList;
|
||||
|
||||
/**
|
||||
* 是否查询购物车列表
|
||||
*/
|
||||
|
||||
+4
@@ -1,5 +1,6 @@
|
||||
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 com.bsd.pjcloud.hard.api.constant.order.HardPayTypeEnum;
|
||||
import com.bsd.pjcloud.wallet.api.constant.WalletTypeEnum;
|
||||
@@ -30,6 +31,9 @@ public class HardAppCreateOrderDto {
|
||||
@NotNull(message = "支付类型不能为空")
|
||||
private HardPayTypeEnum payType;
|
||||
|
||||
@NotNull(message = "硬件设备类型不能为空")
|
||||
private HardTypeEnum hardType;
|
||||
|
||||
private Long orderSourceTypeId;
|
||||
|
||||
}
|
||||
+7
@@ -43,6 +43,13 @@ public class HardParentCarEntity extends Model<HardParentCarEntity> {
|
||||
@Schema(description="商户id")
|
||||
private Long merchantId;
|
||||
|
||||
/**
|
||||
* 硬件设备类型
|
||||
*/
|
||||
@Schema(description="硬件设备类型")
|
||||
private String hardType;
|
||||
|
||||
|
||||
/**
|
||||
* 订单状态
|
||||
*/
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.bsd.pjcloud.hard.api.feign;
|
||||
|
||||
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.entity.order.HardOrderEntity;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(contextId = "remoteHardOrderService", value = ServiceNameConstants.HARDWARE_SERVICE)
|
||||
public interface RemoteHardOrderService {
|
||||
|
||||
@NoToken
|
||||
@GetMapping("/hard-order/get-by-ids")
|
||||
R<List<HardOrderEntity>> getByIds(@RequestParam List<Long> ids);
|
||||
|
||||
}
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
/*
|
||||
@author pigx archetype
|
||||
* <p>
|
||||
* feign client 存放目录,注意 @EnablePigxFeignClients 的扫描范围
|
||||
*/
|
||||
package com.bsd.pjcloud.hard.api.feign;
|
||||
+26
@@ -4,11 +4,19 @@ import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.lang.Pair;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysDept;
|
||||
import com.bsd.pjcloud.admin.api.vo.base.BaseDeptInterface;
|
||||
import com.bsd.pjcloud.common.core.util.CollectionUtils;
|
||||
import com.bsd.pjcloud.hard.api.dto.code.QRCodeDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardOrderEntity;
|
||||
import com.bsd.pjcloud.hard.api.vo.base.BaseOrderInterface;
|
||||
import com.bsd.pjcloud.hard.api.vo.order.HardOrderVo;
|
||||
import lombok.experimental.UtilityClass;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
|
||||
import javax.xml.stream.events.StartDocument;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@UtilityClass
|
||||
public class HardUtil {
|
||||
@@ -44,4 +52,22 @@ public class HardUtil {
|
||||
return ImmutablePair.of(fileName, coeContent);
|
||||
}
|
||||
|
||||
public <T extends BaseOrderInterface> List<T> convertOrderList(List<T> list, Map<Long, HardOrderEntity> map) {
|
||||
return CollectionUtils.convertList(list, v -> convertOrder(v, map.get(v.getOrderId())));
|
||||
}
|
||||
|
||||
public <T extends BaseOrderInterface> T convertOrder(T v, HardOrderEntity order) {
|
||||
if (ObjectUtil.isEmpty(order)) return v;
|
||||
v.setOrderHardId(order.getHardId());
|
||||
v.setOrderId(order.getId());
|
||||
v.setOrderDeptId(order.getDeptId());
|
||||
v.setOrderWalletId(order.getWalletId());
|
||||
v.setOrderParentCarId(order.getParentCarId());
|
||||
v.setOrderTotalPrice(order.getTotalPrice());
|
||||
v.setOrderExtraPrice(order.getExtraPrice());
|
||||
v.setOrderPayPrice(order.getPayPrice());
|
||||
v.setOrderPayTime(order.getPayTime());
|
||||
return v;
|
||||
}
|
||||
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
package com.bsd.pjcloud.hard.api.vo.base;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public interface BaseOrderInterface {
|
||||
|
||||
Long getOrderHardId();
|
||||
|
||||
void setOrderHardId(Long orderHardId);
|
||||
|
||||
Long getOrderId();
|
||||
|
||||
void setOrderId(Long orderId);
|
||||
|
||||
Long getOrderDeptId();
|
||||
|
||||
void setOrderDeptId(Long orderDeptId);
|
||||
|
||||
Long getOrderWalletId();
|
||||
|
||||
void setOrderWalletId(Long orderWalletId);
|
||||
|
||||
Long getOrderParentCarId();
|
||||
|
||||
void setOrderParentCarId(Long orderParentCarId);
|
||||
|
||||
Integer getOrderTotalPrice();
|
||||
|
||||
void setOrderTotalPrice(Integer orderTotalPrice);
|
||||
|
||||
Integer getOrderExtraPrice();
|
||||
|
||||
void setOrderExtraPrice(Integer orderExtraPrice);
|
||||
|
||||
Integer getOrderPayPrice();
|
||||
|
||||
void setOrderPayPrice(Integer orderPayPrice);
|
||||
|
||||
LocalDateTime getOrderPayTime();
|
||||
|
||||
void setOrderPayTime(LocalDateTime orderPayTime);
|
||||
}
|
||||
+25
-1
@@ -3,10 +3,13 @@ package com.bsd.pjcloud.hard.api.vo.order;
|
||||
import com.bsd.pjcloud.admin.api.vo.base.BaseDeptInterface;
|
||||
import com.bsd.pjcloud.admin.api.vo.base.BaseUserInterface;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardAfterSaleEntity;
|
||||
import com.bsd.pjcloud.hard.api.vo.base.BaseOrderInterface;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class HardAfterSaleVo extends HardAfterSaleEntity implements BaseUserInterface, BaseDeptInterface {
|
||||
public class HardAfterSaleVo extends HardAfterSaleEntity implements BaseUserInterface, BaseDeptInterface, BaseOrderInterface {
|
||||
/**
|
||||
* 用户相关
|
||||
*/
|
||||
@@ -22,4 +25,25 @@ public class HardAfterSaleVo extends HardAfterSaleEntity implements BaseUserInte
|
||||
private Long deptId;
|
||||
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 订单相关
|
||||
*/
|
||||
private Long orderHardId;
|
||||
|
||||
private Long orderId;
|
||||
|
||||
private Long orderDeptId;
|
||||
|
||||
private Long orderWalletId;
|
||||
|
||||
private Long orderParentCarId;
|
||||
|
||||
private Integer orderTotalPrice;
|
||||
|
||||
private Integer orderExtraPrice;
|
||||
|
||||
private Integer orderPayPrice;
|
||||
|
||||
private LocalDateTime orderPayTime;
|
||||
}
|
||||
+4
@@ -5,4 +5,8 @@ import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HardCarVo extends HardCarEntity {
|
||||
|
||||
// 商品id【超市的商品存的是 sku id】
|
||||
private Long supId;
|
||||
|
||||
}
|
||||
+6
@@ -3,6 +3,7 @@ package com.bsd.pjcloud.hard.api.vo.order;
|
||||
import com.bsd.pjcloud.admin.api.vo.base.BaseDeptInterface;
|
||||
import com.bsd.pjcloud.admin.api.vo.base.BaseUserInterface;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardOrderEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletCodeUseEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.base.BaseMchInterface;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -42,4 +43,9 @@ public class HardOrderVo extends HardOrderEntity implements BaseUserInterface, B
|
||||
* 购物车
|
||||
*/
|
||||
private List<HardCarVo> carList;
|
||||
|
||||
/**
|
||||
* 预约二维码信息
|
||||
*/
|
||||
private String reserveCode;
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
com.bsd.pjcloud.hard.api.feign.RemoteHardOrderService
|
||||
Reference in new issue
Block a user