Compare commits
No commits in common. "ebd00f134ea7da94ef943bf35c20b4f244f28a7b" and "1da65447dac0f8b3fa8132a44959b3f45a886b9a" have entirely different histories.
ebd00f134e
...
1da65447da
@ -103,10 +103,4 @@ public interface CouponFeignClient {
|
||||
* @return
|
||||
*/
|
||||
ServerResponseEntity<Integer> getStockByCouponId(Long couponId);
|
||||
|
||||
/**
|
||||
* 直接向用户发放代金卷
|
||||
* @return
|
||||
*/
|
||||
void sendUserCoupon(Long userId, Long reduceAmount);
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
|
||||
package com.tmerclub.cloud.api.delivery.feign;
|
||||
|
||||
import com.tmerclub.cloud.api.delivery.dto.CalculateAndGetDeliverInfoDTO;
|
||||
import com.tmerclub.cloud.api.delivery.vo.ShopTransportVO;
|
||||
import com.tmerclub.cloud.common.local.dto.CurOderReturnsDTO;
|
||||
import com.tmerclub.cloud.common.order.vo.TransportVO;
|
||||
import com.tmerclub.cloud.common.order.vo.UserDeliveryInfoVO;
|
||||
import com.tmerclub.cloud.common.response.ServerResponseEntity;
|
||||
@ -17,7 +17,6 @@ public interface DeliveryFeignClient {
|
||||
|
||||
/**
|
||||
* 计算运费,并计算获取配送信息
|
||||
*
|
||||
* @param param 用户地址和订单信息
|
||||
* @return void
|
||||
*/
|
||||
@ -25,7 +24,6 @@ public interface DeliveryFeignClient {
|
||||
|
||||
/**
|
||||
* 获取店铺运费模板列表
|
||||
*
|
||||
* @param shopId 店铺id
|
||||
* @return 运费模板列表
|
||||
*/
|
||||
@ -33,7 +31,6 @@ public interface DeliveryFeignClient {
|
||||
|
||||
/**
|
||||
* 根据id列表获取运费模板
|
||||
*
|
||||
* @param transportIds
|
||||
* @return
|
||||
*/
|
||||
@ -41,7 +38,6 @@ public interface DeliveryFeignClient {
|
||||
|
||||
/**
|
||||
* 判断用户地址是否包含在配送范围内
|
||||
*
|
||||
* @param deliveryTemplateId
|
||||
* @param userId
|
||||
* @param addrId
|
||||
@ -51,9 +47,8 @@ public interface DeliveryFeignClient {
|
||||
|
||||
/**
|
||||
* 检查配送范围
|
||||
*
|
||||
* @param deliveryTemplateId 运费模板id
|
||||
* @param addrId 用户地址id
|
||||
* @param addrId 用户地址id
|
||||
* @return
|
||||
*/
|
||||
ServerResponseEntity<Boolean> checkDeliveryRange(Long deliveryTemplateId,
|
||||
@ -62,17 +57,8 @@ public interface DeliveryFeignClient {
|
||||
|
||||
/**
|
||||
* 获取商品物流模板
|
||||
*
|
||||
* @param deliveryTemplateId
|
||||
* @return
|
||||
*/
|
||||
TransportVO getTransportAndAllItemsById(Long deliveryTemplateId);
|
||||
|
||||
/**
|
||||
* 球杆订单退货
|
||||
*
|
||||
* @param curOderReturnsDTO 订单信息
|
||||
* @return 结果
|
||||
*/
|
||||
ServerResponseEntity<String> curOderReturns(CurOderReturnsDTO curOderReturnsDTO);
|
||||
}
|
||||
|
@ -16,7 +16,4 @@ public interface OrderAddrFeignClient {
|
||||
* @return
|
||||
*/
|
||||
ServerResponseEntity<OrderAddrVO> getOrderAddrByOrderId(Long orderId);
|
||||
|
||||
// 增加cue退货地址
|
||||
ServerResponseEntity<Long> addCueAddr(OrderAddrVO orderAddrVO);
|
||||
}
|
||||
|
@ -548,6 +548,4 @@ public interface OrderFeignClient {
|
||||
* 向商城订单写入球杆回收订单
|
||||
*/
|
||||
Long saveOrderToMall(SaveOrderToMallDTO saveOrderToMallDTO);
|
||||
|
||||
void updateOrderMall(Long mallOrderId, Integer orderStatus);
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
|
||||
package com.tmerclub.cloud.api.user.feign;
|
||||
|
||||
import com.tmerclub.cloud.common.order.vo.UserAddrVO;
|
||||
@ -5,7 +6,6 @@ import com.tmerclub.cloud.common.response.ServerResponseEntity;
|
||||
|
||||
/**
|
||||
* 用户地址feign连接
|
||||
*
|
||||
* @author tmerclub
|
||||
* @date 2020/12/07
|
||||
*/
|
||||
@ -14,7 +14,6 @@ public interface UserAddrFeignClient {
|
||||
|
||||
/**
|
||||
* 根据地址id获取用户地址信息
|
||||
*
|
||||
* @param addrId 地址id
|
||||
* @return 用户地址信息
|
||||
*/
|
||||
@ -22,18 +21,9 @@ public interface UserAddrFeignClient {
|
||||
|
||||
/**
|
||||
* 根据用户id获取默认地址
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
ServerResponseEntity<UserAddrVO> getUserAddrByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 根据地址id获取用户地址信息
|
||||
*
|
||||
* @param addrId 地址id
|
||||
* @param userId 用户id
|
||||
* @return 用户地址信息
|
||||
*/
|
||||
ServerResponseEntity<UserAddrVO> cueGetUserAddrByAddrId(Long addrId, Long userId);
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
|
||||
package com.tmerclub.cloud.api.user.feign;
|
||||
|
||||
import com.tmerclub.cloud.api.payment.vo.ShopAccountDetailVO;
|
||||
@ -10,20 +11,17 @@ import com.tmerclub.cloud.api.user.vo.UserPayInfoVO;
|
||||
import com.tmerclub.cloud.common.database.vo.PageVO;
|
||||
import com.tmerclub.cloud.common.response.ServerResponseEntity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 充值信息
|
||||
*
|
||||
* @author tmerclub
|
||||
*/
|
||||
public interface UserBalanceLogFeignClient {
|
||||
|
||||
/**
|
||||
* 获取充值金额
|
||||
*
|
||||
* @param balanceLogId 充值记录id
|
||||
* @return
|
||||
*/
|
||||
@ -31,7 +29,6 @@ public interface UserBalanceLogFeignClient {
|
||||
|
||||
/**
|
||||
* 获取充值记录是否已经支付
|
||||
*
|
||||
* @param balanceLogId 充值记录id
|
||||
* @return
|
||||
*/
|
||||
@ -40,7 +37,6 @@ public interface UserBalanceLogFeignClient {
|
||||
|
||||
/**
|
||||
* 余额支付记录
|
||||
*
|
||||
* @param balancePayBO 记录信息
|
||||
* @return
|
||||
*/
|
||||
@ -48,7 +44,6 @@ public interface UserBalanceLogFeignClient {
|
||||
|
||||
/**
|
||||
* 余额退款记录 + 执行退款
|
||||
*
|
||||
* @param balanceRefundBO 记录信息
|
||||
* @return
|
||||
*/
|
||||
@ -56,7 +51,6 @@ public interface UserBalanceLogFeignClient {
|
||||
|
||||
/**
|
||||
* 分页获取余额充值财务对账信息
|
||||
*
|
||||
* @param financeDetailDTO
|
||||
* @return
|
||||
*/
|
||||
@ -64,7 +58,6 @@ public interface UserBalanceLogFeignClient {
|
||||
|
||||
/**
|
||||
* 获取余额充值财务对账信息
|
||||
*
|
||||
* @param financeDetailDTO
|
||||
* @return
|
||||
*/
|
||||
@ -72,7 +65,6 @@ public interface UserBalanceLogFeignClient {
|
||||
|
||||
/**
|
||||
* 获取平台财务信息
|
||||
*
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @return
|
||||
@ -82,7 +74,6 @@ public interface UserBalanceLogFeignClient {
|
||||
|
||||
/**
|
||||
* 获取用户充值,购买会员财务信息
|
||||
*
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @param financeType
|
||||
@ -98,7 +89,6 @@ public interface UserBalanceLogFeignClient {
|
||||
|
||||
/**
|
||||
* 获取用户充值,购买会员财务信息
|
||||
*
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @param financeType
|
||||
@ -110,18 +100,8 @@ public interface UserBalanceLogFeignClient {
|
||||
|
||||
/**
|
||||
* 扣减用户余额,更新余额支付记录为支付成功
|
||||
*
|
||||
* @param payId
|
||||
* @return
|
||||
*/
|
||||
ServerResponseEntity<Void> updateToOrderPaySuccess(Long payId);
|
||||
|
||||
/**
|
||||
* 出售球杆更新用户余额
|
||||
*
|
||||
* @param userId 用户id
|
||||
* @param money 金额(单位分)
|
||||
* @return 结果
|
||||
*/
|
||||
ServerResponseEntity<Void> sellCueUpdateBalance(Long userId, Long money);
|
||||
}
|
||||
|
@ -170,11 +170,6 @@ public enum SendTypeEnum {
|
||||
*/
|
||||
PRODUCT_AUDIT_TO_SUPPLIER(1007, 3, "供应商端的商品审核结果提醒", "商品", "平台审核商品后"),
|
||||
|
||||
/**
|
||||
* 回收订单审核信息
|
||||
*/
|
||||
CUE_ORDER_AUDIT_RESULT(2001, 1, "回收订单审核信息", null, null)
|
||||
|
||||
|
||||
;
|
||||
|
||||
|
@ -1,37 +0,0 @@
|
||||
package com.tmerclub.cloud.common.local.constant;
|
||||
|
||||
/**
|
||||
* 订单状态
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-15
|
||||
**/
|
||||
public enum CueOrderStatus {
|
||||
|
||||
|
||||
PENDING_AUDIT(0, "待审核"),
|
||||
AUDIT_PASS(1, "审核通过(待发货)"),
|
||||
AUDIT_FAIL(2, "审核拒绝"),
|
||||
FINISH_DELIVERY(3, "已发货"),
|
||||
FINISH_RECEIPT(4, "已收货(评估中)"),
|
||||
EVALUATION_SUCCESS(5, "评估成功(给出价格)"),
|
||||
EVALUATION_FAIL(6, "评估失败(退回)"),
|
||||
EVALUATION_FAIL_FILLED_RETURN_ADDRESS(7, "评估失败用户已填写回邮地址"),
|
||||
EVALUATION_FAIL_COMPLETED(8, "评估失败(已退回)"),
|
||||
EVALUATION_SUCCESS_PAY(9, "价格满意(结束)"),
|
||||
EVALUATION_SUCCESS_PRICE_DISCONTENT(10, "价格不满意(已填写回邮地址)"),
|
||||
EVALUATION_SUCCESS_COMPLETED(11, "价格不满意(已完成)");
|
||||
|
||||
|
||||
private final Integer num;
|
||||
private final String description;
|
||||
|
||||
CueOrderStatus(Integer num, String description) {
|
||||
this.num = num;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public Integer value() {
|
||||
return num;
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
package com.tmerclub.cloud.common.local.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 球杆订单退货物流业务对象
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-18
|
||||
**/
|
||||
@Data
|
||||
public class CurOderReturnsDTO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
private Long orderId;
|
||||
/**
|
||||
* 网点id
|
||||
*/
|
||||
private Long outletConfigId;
|
||||
/**
|
||||
* 打印机id
|
||||
*/
|
||||
private Long printerId;
|
||||
/**
|
||||
* 订单地址id
|
||||
*/
|
||||
private Long orderAddrId;
|
||||
}
|
@ -1,236 +0,0 @@
|
||||
|
||||
package com.tmerclub.cloud.config;
|
||||
|
||||
import com.tmerclub.cloud.common.rocketmq.config.RocketMqAdapter;
|
||||
import com.tmerclub.cloud.common.rocketmq.config.RocketMqConstant;
|
||||
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
|
||||
/**
|
||||
* @author tmerclub
|
||||
* @date 2021/3/30
|
||||
*/
|
||||
@RefreshScope
|
||||
@Configuration
|
||||
public class RocketMqConfig {
|
||||
|
||||
@Autowired
|
||||
private RocketMqAdapter rocketMqAdapter;
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate stockMqTemplate() {
|
||||
return rocketMqAdapter.getTemplateByTopicName(RocketMqConstant.STOCK_UNLOCK_TOPIC_BY_ORDER_ID);
|
||||
}
|
||||
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate couponMqTemplate() {
|
||||
return rocketMqAdapter.getTemplateByTopicName(RocketMqConstant.COUPON_UNLOCK_TOPIC);
|
||||
}
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate orderCancelTemplate() {
|
||||
return rocketMqAdapter.getTemplateByTopicName(RocketMqConstant.ORDER_CANCEL_TOPIC);
|
||||
}
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate orderSubmitShopCartTemplate() {
|
||||
return rocketMqAdapter.getTemplateByTopicName(RocketMqConstant.ORDER_SUBMIT_SHOP_CART);
|
||||
}
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate orderPurchaseNotifyShopTemplate() {
|
||||
return rocketMqAdapter.getTemplateByTopicName(RocketMqConstant.ORDER_PURCHASE_NOTIFY_SHOP_TOPIC);
|
||||
}
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate orderNotifyServiceTemplate() {
|
||||
return rocketMqAdapter.getTemplateByTopicName(RocketMqConstant.ORDER_NOTIFY_SERVICE_TOPIC);
|
||||
}
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate allinPayBalanceOrderSuccessTemplate() {
|
||||
return rocketMqAdapter.getTemplateByTopicName(RocketMqConstant.ALLINPAY_BALANCE_ORDER_SUCCESS_TOPIC);
|
||||
}
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate orderReceiptTemplate() {
|
||||
return rocketMqAdapter.getTransactionTemplateByTopicName(RocketMqConstant.ORDER_RECEIPT_TOPIC);
|
||||
}
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate orderSettledShopTemplate() {
|
||||
return rocketMqAdapter.getTransactionTemplateByTopicName(RocketMqConstant.ORDER_SETTLED_SHOP_TOPIC);
|
||||
}
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate orderRefundTemplate() {
|
||||
return rocketMqAdapter.getTransactionTemplateByTopicName(RocketMqConstant.ORDER_REFUND_TOPIC);
|
||||
}
|
||||
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate orderRefundPaymentTemplate() {
|
||||
return rocketMqAdapter.getTemplateByTopicName(RocketMqConstant.ORDER_REFUND_PAYMENT_TOPIC);
|
||||
}
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate orderRefundShopTemplate() {
|
||||
return rocketMqAdapter.getTemplateByTopicName(RocketMqConstant.ORDER_REFUND_SHOP_TOPIC);
|
||||
}
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate orderRefundSuccessSettlementTemplate() {
|
||||
return rocketMqAdapter.getTemplateByTopicName(RocketMqConstant.ORDER_REFUND_SUCCESS_SETTLEMENT_TOPIC);
|
||||
}
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate refundSuccessNotifySupplierTemplate() {
|
||||
return rocketMqAdapter.getTemplateByTopicName(RocketMqConstant.ORDER_REFUND_SUCCESS_SETTLEMENT_SUPPLIER_TOPIC);
|
||||
}
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate orderRefundSuccessServiceTemplate() {
|
||||
return rocketMqAdapter.getTemplateByTopicName(RocketMqConstant.ORDER_REFUND_SUCCESS_SERVICE_TOPIC);
|
||||
}
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate orderRefundSuccessStockTemplate() {
|
||||
return rocketMqAdapter.getTemplateByTopicName(RocketMqConstant.ORDER_REFUND_SUCCESS_STOCK_TOPIC);
|
||||
}
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate groupOrderCancelMqTemplate() {
|
||||
return rocketMqAdapter.getTemplateByTopicName(RocketMqConstant.GROUP_ORDER_CANCEL_TOPIC);
|
||||
}
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate seckillOrderCancelMqTemplate() {
|
||||
return rocketMqAdapter.getTemplateByTopicName(RocketMqConstant.SECKILL_ORDER_CANCEL_TOPIC);
|
||||
}
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate seckillOrderRefundMqTemplate() {
|
||||
return rocketMqAdapter.getTemplateByTopicName(RocketMqConstant.SECKILL_ORDER_REFUND_TOPIC);
|
||||
}
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate sendNotifyToShopTemplate() {
|
||||
return rocketMqAdapter.getTemplateByTopicName(RocketMqConstant.SEND_NOTIFY_TO_SHOP_TOPIC);
|
||||
}
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate sendNotifyToUserTemplate() {
|
||||
return rocketMqAdapter.getTemplateByTopicName(RocketMqConstant.SEND_NOTIFY_TO_USER_TOPIC);
|
||||
}
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate userScoreTemplate() {
|
||||
return rocketMqAdapter.getTemplateByTopicName(RocketMqConstant.SCORE_UNLOCK_TOPIC);
|
||||
}
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate sendNotifyToUserExtensionTemplate() {
|
||||
return rocketMqAdapter.getTemplateByTopicName(RocketMqConstant.SEND_NOTIFY_TO_USER_EXTENSION_TOPIC);
|
||||
}
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate stockBillLogTemplate() {
|
||||
return rocketMqAdapter.getTemplateByTopicName(RocketMqConstant.STOCK_BILL_LOG_TOPIC);
|
||||
}
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate stockBillLogPurchaseStorageTemplate() {
|
||||
return rocketMqAdapter.getTransactionTemplateByTopicName(RocketMqConstant.STOCK_BILL_LOG_PURCHASE_STORAGE_TOPIC);
|
||||
}
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate outStockLogTemplate() {
|
||||
return rocketMqAdapter.getTemplateByTopicName(RocketMqConstant.OUT_STOCK_LOG_TOPIC);
|
||||
}
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate orderNotifyTemplate() {
|
||||
return rocketMqAdapter.getTemplateByTopicName(RocketMqConstant.ORDER_NOTIFY_TOPIC);
|
||||
}
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate orderPreSaleFailSettlementTemplate() {
|
||||
return rocketMqAdapter.getTemplateByTopicName(RocketMqConstant.ORDER_PRE_SALE_FAIL_SETTLEMENT_TOPIC);
|
||||
}
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate presaleOrderCanalMqTemplate() {
|
||||
return rocketMqAdapter.getTemplateByTopicName(RocketMqConstant.PRESALE_ORDER_CANAL_TOPIC);
|
||||
}
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate orderRefundCancelMqTemplate() {
|
||||
return rocketMqAdapter.getTemplateByTopicName(RocketMqConstant.ORDER_REFUND_CANAL_TOPIC);
|
||||
}
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate comboOrderMqTemplate() {
|
||||
return rocketMqAdapter.getTemplateByTopicName(RocketMqConstant.COMBO_ORDER_TOPIC);
|
||||
}
|
||||
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate sendOrderToPurchaseNotifyToShopTemplate() {
|
||||
return rocketMqAdapter.getTransactionTemplateByTopicName(RocketMqConstant.SEND_ORDER_TO_PURCHASE_NOTIFY_TO_SHOP_TOPIC);
|
||||
}
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate orderSettlementShopByAllinpayTemplate() {
|
||||
return rocketMqAdapter.getTemplateByTopicName(RocketMqConstant.ORDER_SETTLED_SHOP_BY_ALLINPAY_TOPIC);
|
||||
}
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate orderRefundUpdateRefundStatusMqTemplate() {
|
||||
return rocketMqAdapter.getTemplateByTopicName(RocketMqConstant.ORDER_REFUND_UPDATE_REFUND_STATUS);
|
||||
}
|
||||
|
||||
@Lazy
|
||||
@Bean(destroyMethod = "destroy")
|
||||
public RocketMQTemplate addPurchaseAmountLogTemplate() {
|
||||
return rocketMqAdapter.getTransactionTemplateByTopicName(RocketMqConstant.ADD_PURCHASE_AMOUNT_LOG_TOPIC);
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.tmerclub.cloud.cuerecycle.constant;
|
||||
|
||||
/**
|
||||
* 订单状态
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-15
|
||||
**/
|
||||
public enum CueOrderStatus {
|
||||
|
||||
|
||||
PENDING_AUDIT(0, "待审核"),
|
||||
AUDIT_PASS(1, "审核通过"),
|
||||
AUDIT_FAIL(2, "审核拒绝"),
|
||||
PENDING_DELIVERY(3, "待发货"),
|
||||
PENDING_RECEIPT(4, "待收货"),
|
||||
RECEIPT_EVALUATION(5, "已收货(评估中)"),
|
||||
EVALUATION_FAIL(6, "评估失败(退回)"),
|
||||
EVALUATION_SUCCESS(7, "评估成功"),
|
||||
COMPLETED(8, "已完成"),
|
||||
PRICE_UNSATISFIED(9, "价格不满意(退回)");
|
||||
|
||||
private final Integer num;
|
||||
private final String description;
|
||||
|
||||
public Integer value() {
|
||||
return num;
|
||||
}
|
||||
|
||||
CueOrderStatus(Integer num, String description) {
|
||||
this.num = num;
|
||||
this.description = description;
|
||||
}
|
||||
}
|
@ -3,11 +3,9 @@ package com.tmerclub.cloud.cuerecycle.controller.admin;
|
||||
import com.tmerclub.cloud.common.database.dto.PageDTO;
|
||||
import com.tmerclub.cloud.common.database.vo.PageVO;
|
||||
import com.tmerclub.cloud.common.response.ServerResponseEntity;
|
||||
import com.tmerclub.cloud.cuerecycle.manager.CreateOrderManager;
|
||||
import com.tmerclub.cloud.cuerecycle.mapper.CueOrderFlawMapper;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueOrderDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueOrderFlawDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueRetractedDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.CueOrderFlawVO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.CueOrderVO;
|
||||
import com.tmerclub.cloud.cuerecycle.service.CueOrderService;
|
||||
@ -33,8 +31,6 @@ public class CueOrderController {
|
||||
CueOrderService cueOrderService;
|
||||
@Resource
|
||||
CueOrderFlawMapper cueOrderFlawMapper;
|
||||
@Resource
|
||||
CreateOrderManager createOrderManager;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
@ -95,16 +91,4 @@ public class CueOrderController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 球杆退回
|
||||
*
|
||||
* @param cueRetractedDTO 退回参数
|
||||
* @return 结果
|
||||
*/
|
||||
@PutMapping("/cueRetracted")
|
||||
@Operation(summary = "球杆退回", description = "球杆退回")
|
||||
public ServerResponseEntity<Void> cueRetracted(@Valid @RequestParam CueRetractedDTO cueRetractedDTO) {
|
||||
createOrderManager.cueRetracted(cueRetractedDTO);
|
||||
return ServerResponseEntity.success();
|
||||
}
|
||||
}
|
@ -1,18 +1,21 @@
|
||||
package com.tmerclub.cloud.cuerecycle.controller.app;
|
||||
|
||||
import com.tmerclub.cloud.common.cache.constant.CacheNames;
|
||||
import com.tmerclub.cloud.common.cache.constant.OrderCacheNames;
|
||||
import com.tmerclub.cloud.common.cache.util.RedisUtil;
|
||||
import com.tmerclub.cloud.common.response.ResponseEnum;
|
||||
import com.tmerclub.cloud.common.response.ServerResponseEntity;
|
||||
import com.tmerclub.cloud.cuerecycle.manager.CreateOrderManager;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CreateOrderDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueAgreeOrderDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueFillAddrDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueSaveMailingDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.AppCueOrderVO;
|
||||
import com.tmerclub.cloud.cuerecycle.service.CueOrderService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 回收订单
|
||||
@ -35,9 +38,9 @@ public class CueOrderController {
|
||||
* @param createOrderDTO 创建订单参数
|
||||
* @return ServerResponseEntity<CueOrderVO>
|
||||
*/
|
||||
@PostMapping("/createOrder")
|
||||
@Operation(summary = "创建订单", description = "创建订单")
|
||||
public ServerResponseEntity<Long> createOrder(@Valid @RequestBody CreateOrderDTO createOrderDTO) {
|
||||
@PostMapping("/createOrder")
|
||||
public ServerResponseEntity<Void> createOrder(@Valid @RequestBody CreateOrderDTO createOrderDTO) {
|
||||
// 防止重复提交 TODO:不清楚为啥不好使
|
||||
// boolean cad = RedisUtil.cad(OrderCacheNames.ORDER_CONFIRM_UUID_KEY + CacheNames.UNION + createOrderDTO.getUserId(), String.valueOf(createOrderDTO.getUserId()));
|
||||
// if (!cad) {
|
||||
@ -49,59 +52,6 @@ public class CueOrderController {
|
||||
Long flawPrice = createOrderManager.addFlawItem(orderId, createOrderDTO);
|
||||
// 向商城order插入信息
|
||||
createOrderManager.saveOrderToMall(orderId, createOrderDTO.getProductPrice() - flawPrice, createOrderDTO);
|
||||
return ServerResponseEntity.success(orderId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据订单id查询订单信息
|
||||
*
|
||||
* @param orderId 订单id
|
||||
* @return ServerResponseEntity<CueOrderVO>
|
||||
*/
|
||||
@GetMapping("/getOrderById")
|
||||
@Operation(summary = "根据订单id查询订单信息", description = "根据订单id查询订单信息")
|
||||
public ServerResponseEntity<AppCueOrderVO> getOrderById(@RequestParam("orderId") Long orderId) {
|
||||
AppCueOrderVO appCueOrderVO = cueOrderService.getByAppCueOrderId(orderId);
|
||||
return ServerResponseEntity.success(appCueOrderVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 邮寄填写订单
|
||||
*
|
||||
* @param cueSaveMailingDTO 提交参数
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping("/saveMailing")
|
||||
@Operation(summary = "邮寄填写订单", description = "邮寄填写订单")
|
||||
public ServerResponseEntity<Void> saveMailing(@Valid @RequestBody CueSaveMailingDTO cueSaveMailingDTO) {
|
||||
int update = cueOrderService.saveMailing(cueSaveMailingDTO);
|
||||
return update > 0 ? ServerResponseEntity.success() : ServerResponseEntity.showFailMsg("提交失败");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 同意回收
|
||||
*
|
||||
* @param cueAgreeOrderDTO 同意回收参数
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping("/agreeOrder")
|
||||
@Operation(summary = "同意回收", description = "同意回收")
|
||||
public ServerResponseEntity<Void> agreeOrder(@Valid @RequestBody CueAgreeOrderDTO cueAgreeOrderDTO) {
|
||||
createOrderManager.agreeOrder(cueAgreeOrderDTO);
|
||||
return ServerResponseEntity.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 填写不合格或不满意回邮地址
|
||||
*
|
||||
* @param cueFillAddrDTO 回邮地址入参
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping("/fillAddr")
|
||||
@Operation(summary = "填写回邮地址", description = "填写回邮地址")
|
||||
public ServerResponseEntity<Void> fillAddr(@Valid @RequestBody CueFillAddrDTO cueFillAddrDTO) {
|
||||
createOrderManager.fillAddr(cueFillAddrDTO);
|
||||
return ServerResponseEntity.success();
|
||||
}
|
||||
}
|
@ -2,26 +2,15 @@ package com.tmerclub.cloud.cuerecycle.manager;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.tmerclub.cloud.api.coupon.feign.CouponFeignClient;
|
||||
import com.tmerclub.cloud.api.delivery.feign.DeliveryFeignClient;
|
||||
import com.tmerclub.cloud.api.order.feign.OrderAddrFeignClient;
|
||||
import com.tmerclub.cloud.api.order.feign.OrderFeignClient;
|
||||
import com.tmerclub.cloud.api.user.feign.UserAddrFeignClient;
|
||||
import com.tmerclub.cloud.api.user.feign.UserBalanceLogFeignClient;
|
||||
import com.tmerclub.cloud.common.exception.LuckException;
|
||||
import com.tmerclub.cloud.common.local.constant.CueOrderStatus;
|
||||
import com.tmerclub.cloud.common.local.dto.CurOderReturnsDTO;
|
||||
import com.tmerclub.cloud.common.local.dto.SaveOrderToMallDTO;
|
||||
import com.tmerclub.cloud.common.order.vo.OrderAddrVO;
|
||||
import com.tmerclub.cloud.common.order.vo.UserAddrVO;
|
||||
import com.tmerclub.cloud.common.response.ServerResponseEntity;
|
||||
import com.tmerclub.cloud.cuerecycle.constant.CueOrderStatus;
|
||||
import com.tmerclub.cloud.cuerecycle.mapper.CueOrderFlawMapper;
|
||||
import com.tmerclub.cloud.cuerecycle.mapper.CueOrderMapper;
|
||||
import com.tmerclub.cloud.cuerecycle.model.CueOrder;
|
||||
import com.tmerclub.cloud.cuerecycle.model.CueOrderFlaw;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.*;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.CueOrderVO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CreateOrderDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CreateOrderFlawDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.service.CueFlawService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
@ -29,8 +18,6 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 确认订单管理器
|
||||
*
|
||||
@ -48,17 +35,7 @@ public class CreateOrderManager {
|
||||
@Resource
|
||||
CueOrderFlawMapper cueOrderFlawMapper;
|
||||
@DubboReference
|
||||
CouponFeignClient couponFeignClient;
|
||||
@DubboReference
|
||||
DeliveryFeignClient deliveryFeignClient;
|
||||
@DubboReference
|
||||
UserAddrFeignClient userAddrFeignClient;
|
||||
@DubboReference
|
||||
OrderAddrFeignClient orderAddrFeignClient;
|
||||
@DubboReference
|
||||
UserBalanceLogFeignClient userBalanceLogFeignClient;
|
||||
@DubboReference
|
||||
OrderFeignClient orderFeignClient;
|
||||
private OrderFeignClient orderFeignClient;
|
||||
|
||||
/**
|
||||
* 保存订单信息
|
||||
@ -111,143 +88,4 @@ public class CreateOrderManager {
|
||||
cueOrder.setEstimatedAmount(estimatedAmount);
|
||||
cueOrderMapper.update(cueOrder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改mallOrder订单
|
||||
*
|
||||
* @param mallOrderId mallOrderId
|
||||
* @param orderStatus 状态
|
||||
*/
|
||||
public void updateOrderMall(Long mallOrderId, Integer orderStatus) {
|
||||
orderFeignClient.updateOrderMall(mallOrderId, orderStatus);
|
||||
}
|
||||
|
||||
public void agreeOrder(CueAgreeOrderDTO cueAgreeOrderDTO) {
|
||||
// 查询订单信息
|
||||
CueOrderVO cueOrderVO = cueOrderMapper.getById(cueAgreeOrderDTO.getOrderId());
|
||||
if (ObjectUtil.isNull(cueOrderVO)) {
|
||||
throw new LuckException("订单不存在,请检查!");
|
||||
}
|
||||
// 判断状态是否允许修改
|
||||
if (!Objects.equals(cueOrderVO.getOrderStatus(), CueOrderStatus.EVALUATION_SUCCESS.value())) {
|
||||
throw new LuckException("状态已变更,请检查!");
|
||||
}
|
||||
CueOrder cueOrder = new CueOrder();
|
||||
cueOrder.setOrderId(cueAgreeOrderDTO.getOrderId());
|
||||
cueOrder.setOrderType(cueAgreeOrderDTO.getOrderType());
|
||||
cueOrder.setOrderStatus(CueOrderStatus.EVALUATION_SUCCESS_PAY.value());
|
||||
cueOrder.setUpdateTime(DateUtil.date());
|
||||
cueOrder.setFinallyTime(DateUtil.date());
|
||||
cueOrder.setIsPayed(1);
|
||||
// 根据回收类型进行不同操作
|
||||
switch (cueAgreeOrderDTO.getOrderType()) {
|
||||
case 1:
|
||||
// 回收
|
||||
cueOrder.setPayType(1);
|
||||
break;
|
||||
case 2:
|
||||
// 置换
|
||||
cueOrder.setPayType(2);
|
||||
break;
|
||||
case 3:
|
||||
// 寄售
|
||||
cueOrder.setPayType(1);
|
||||
break;
|
||||
default:
|
||||
throw new LuckException("订单类型错误,请检查!");
|
||||
}
|
||||
// 根据支付方式进行不同操作
|
||||
switch (cueOrder.getPayType()) {
|
||||
case 1:
|
||||
// 余额支付 直接向用户账户打款
|
||||
userBalanceLogFeignClient.sellCueUpdateBalance(cueOrderVO.getUserId(), cueOrderVO.getActualAmount());
|
||||
break;
|
||||
case 2:
|
||||
// 代金卷支付
|
||||
couponFeignClient.sendUserCoupon(cueOrderVO.getUserId(), cueOrderVO.getVoucherAmount());
|
||||
break;
|
||||
default:
|
||||
throw new LuckException("支付方式错误,请检查!");
|
||||
}
|
||||
cueOrderMapper.update(cueOrder);
|
||||
this.updateOrderMall(cueOrderVO.getMallOrderId(), CueOrderStatus.EVALUATION_FAIL.value());
|
||||
}
|
||||
|
||||
/**
|
||||
* 填写回邮地址
|
||||
*
|
||||
* @param cueFillAddrDTO 订单信息
|
||||
*/
|
||||
public void fillAddr(CueFillAddrDTO cueFillAddrDTO) {
|
||||
Long orderId = cueFillAddrDTO.getOrderId();
|
||||
// 查询订单信息
|
||||
CueOrderVO cueOrderVO = cueOrderMapper.getById(orderId);
|
||||
if (ObjectUtil.isNull(cueOrderVO)) {
|
||||
throw new LuckException("订单不存在,请检查!");
|
||||
}
|
||||
// 两种情况会导致退货 5不合格 6价格不满意
|
||||
// 检查当前状态
|
||||
if (!Objects.equals(cueOrderVO.getOrderStatus(), CueOrderStatus.EVALUATION_FAIL.value()) || !Objects.equals(cueOrderVO.getOrderStatus(), CueOrderStatus.EVALUATION_SUCCESS.value())) {
|
||||
throw new LuckException("状态已变更,请检查!");
|
||||
}
|
||||
|
||||
CueOrder cueOrder = new CueOrder();
|
||||
cueOrder.setOrderId(orderId);
|
||||
// 需要向order_addr插入一条数据
|
||||
ServerResponseEntity<UserAddrVO> userAddrVO = userAddrFeignClient.cueGetUserAddrByAddrId(cueFillAddrDTO.getAddrId(), cueOrderVO.getUserId());
|
||||
if (userAddrVO.isSuccess()) {
|
||||
// 将地址信息插入到order_addr中
|
||||
OrderAddrVO orderAddrVO = BeanUtil.toBean(userAddrVO, OrderAddrVO.class);
|
||||
orderAddrVO.setUserId(cueOrderVO.getUserId());
|
||||
ServerResponseEntity<Long> longServerResponseEntity = orderAddrFeignClient.addCueAddr(orderAddrVO);
|
||||
if (longServerResponseEntity.isSuccess()) {
|
||||
cueOrder.setOrderAddrId(longServerResponseEntity.getData());
|
||||
}
|
||||
}
|
||||
if (Objects.equals(cueOrderVO.getOrderStatus(), CueOrderStatus.EVALUATION_SUCCESS.value())) {
|
||||
cueOrder.setOrderStatus(CueOrderStatus.EVALUATION_SUCCESS_PRICE_DISCONTENT.value());
|
||||
} else {
|
||||
cueOrder.setOrderStatus(CueOrderStatus.EVALUATION_SUCCESS_COMPLETED.value());
|
||||
}
|
||||
|
||||
cueOrder.setUpdateTime(DateUtil.date());
|
||||
cueOrderMapper.update(cueOrder);
|
||||
this.updateOrderMall(cueOrderVO.getMallOrderId(), cueOrder.getOrderStatus());
|
||||
}
|
||||
|
||||
/**
|
||||
* 后管操作球杆退回
|
||||
*
|
||||
* @param cueRetractedDTO 订单信息
|
||||
*/
|
||||
public void cueRetracted(CueRetractedDTO cueRetractedDTO) {
|
||||
CueOrderVO cueOrderVO = cueOrderMapper.getById(cueRetractedDTO.getOrderId());
|
||||
if (ObjectUtil.isNull(cueOrderVO)) {
|
||||
throw new LuckException("订单不存在,请检查!");
|
||||
}
|
||||
if (!Objects.equals(cueOrderVO.getOrderStatus(), CueOrderStatus.EVALUATION_FAIL_FILLED_RETURN_ADDRESS.value()) || !Objects.equals(cueOrderVO.getOrderStatus(), CueOrderStatus.EVALUATION_SUCCESS_PRICE_DISCONTENT.value())) {
|
||||
throw new LuckException("状态已变更,请检查!");
|
||||
}
|
||||
CueOrder cueOrder = new CueOrder();
|
||||
cueOrder.setOrderId(cueRetractedDTO.getOrderId());
|
||||
cueOrder.setOutletConfigId(cueRetractedDTO.getOutletConfigId());
|
||||
cueOrder.setPrinterId(cueRetractedDTO.getPrinterId());
|
||||
CurOderReturnsDTO curOderReturnsDTO = new CurOderReturnsDTO();
|
||||
curOderReturnsDTO.setOrderId(cueOrderVO.getMallOrderId());
|
||||
curOderReturnsDTO.setOutletConfigId(cueRetractedDTO.getOutletConfigId());
|
||||
curOderReturnsDTO.setPrinterId(cueRetractedDTO.getPrinterId());
|
||||
curOderReturnsDTO.setOrderAddrId(cueOrderVO.getOrderAddrId());
|
||||
ServerResponseEntity<String> stringServerResponseEntity = deliveryFeignClient.curOderReturns(curOderReturnsDTO);
|
||||
if (stringServerResponseEntity.isSuccess()) {
|
||||
cueOrder.setBackTrackingNumber(stringServerResponseEntity.getData());
|
||||
|
||||
}
|
||||
// 判断状态
|
||||
if (Objects.equals(cueOrderVO.getOrderStatus(), CueOrderStatus.EVALUATION_FAIL_FILLED_RETURN_ADDRESS.value())) {
|
||||
cueOrder.setOrderStatus(CueOrderStatus.EVALUATION_FAIL_COMPLETED.value());
|
||||
} else {
|
||||
cueOrder.setOrderStatus(CueOrderStatus.EVALUATION_SUCCESS_COMPLETED.value());
|
||||
}
|
||||
cueOrderMapper.update(cueOrder);
|
||||
}
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
package com.tmerclub.cloud.cuerecycle.mapper;
|
||||
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueOrderDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.AppCueOrderVO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.CueOrderVO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.CueOrder;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
@ -32,10 +32,6 @@ public class CueOrder extends BaseModel implements Serializable {
|
||||
* 商品名称
|
||||
*/
|
||||
private String productName;
|
||||
/**
|
||||
* 商品图片
|
||||
*/
|
||||
private String productImages;
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
@ -57,7 +53,7 @@ public class CueOrder extends BaseModel implements Serializable {
|
||||
*/
|
||||
private Integer orderType;
|
||||
/**
|
||||
* 0-待审核,1-审核通过(待发货),2-审核拒绝,3-待收货(已发货),4-已收货(评估中),5-评估失败(退回),6-评估成功(给出价格),7-价格不满意(退回),8-价格满意(结束),9-价格不满意(已退回)
|
||||
* 状态:0-待审核,1-审核通过,2-审核拒绝,3-待发货,4-待收货(已发货),5-已收货(评估中),6-评估失败(退回),7-评估成功,8-已完成,9-价格不满意(退回)
|
||||
*/
|
||||
private Integer orderStatus;
|
||||
/**
|
||||
@ -113,39 +109,4 @@ public class CueOrder extends BaseModel implements Serializable {
|
||||
* 商城订单id
|
||||
*/
|
||||
private Long mallOrderId;
|
||||
|
||||
/**
|
||||
* 寄售佣金
|
||||
*/
|
||||
private Long brokerage;
|
||||
/**
|
||||
* 服务费
|
||||
*/
|
||||
private Long serviceCharge;
|
||||
|
||||
/**
|
||||
* 寄出单号
|
||||
*/
|
||||
private String sendNumber;
|
||||
/**
|
||||
* 寄出时候选定的仓库id
|
||||
*/
|
||||
private Long warehouseId;
|
||||
|
||||
/**
|
||||
* 用户退款地址id
|
||||
*/
|
||||
private Long orderAddrId;
|
||||
/**
|
||||
* 用户退货网点id
|
||||
*/
|
||||
private Long outletConfigId;
|
||||
/**
|
||||
* 用户退货打印机id
|
||||
*/
|
||||
private Long printerId;
|
||||
/**
|
||||
* 退货物流单号
|
||||
*/
|
||||
private String backTrackingNumber;
|
||||
}
|
@ -17,10 +17,6 @@ public class CreateOrderDTO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
private Long orderId;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
|
@ -1,34 +0,0 @@
|
||||
package com.tmerclub.cloud.cuerecycle.model.dto;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 同意回收业务对象
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-18
|
||||
**/
|
||||
@Data
|
||||
public class CueAgreeOrderDTO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
@NotNull(message = "订单ID不能为空")
|
||||
private Long orderId;
|
||||
/**
|
||||
* 地址ID
|
||||
*/
|
||||
@NotNull(message = "地址ID不能为空")
|
||||
private Long addrId;
|
||||
/**
|
||||
* 类型:1-回收,2-置换,3-寄售
|
||||
*/
|
||||
@NotNull(message = "类型不能为空")
|
||||
private Integer orderType;
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
package com.tmerclub.cloud.cuerecycle.model.dto;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 拒绝回收业务对象
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-18
|
||||
**/
|
||||
@Data
|
||||
public class CueFillAddrDTO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
@NotNull(message = "订单ID不能为空")
|
||||
private Long orderId;
|
||||
/**
|
||||
* 地址ID
|
||||
*/
|
||||
@NotNull(message = "地址ID不能为空")
|
||||
private Long addrId;
|
||||
}
|
@ -38,7 +38,7 @@ public class CueOrderDTO implements Serializable {
|
||||
*/
|
||||
private Integer orderType;
|
||||
/**
|
||||
* 状态:0-待审核,1-审核通过(待发货),2-审核拒绝,3-待收货(已发货),4-已收货(评估中),5-评估失败(退回),6-评估成功(给出价格),7-价格不满意(退回),8-价格满意(结束),9-价格不满意(已退回)
|
||||
* 状态:0-待审核,1-审核通过,2-审核拒绝,3-待发货,4-待收货(已发货),5-已收货(评估中),6-评估失败(退回),7-评估成功,8-已完成,9-价格不满意(退回)
|
||||
*/
|
||||
private Integer orderStatus;
|
||||
/**
|
||||
@ -89,16 +89,5 @@ public class CueOrderDTO implements Serializable {
|
||||
* 完成时间
|
||||
*/
|
||||
private Date finallyTime;
|
||||
/**
|
||||
* 订单关联的商城订单ID
|
||||
*/
|
||||
private Long mallOrderId;
|
||||
/**
|
||||
* 寄售佣金
|
||||
*/
|
||||
private Long brokerage;
|
||||
/**
|
||||
* 服务费
|
||||
*/
|
||||
private Long serviceCharge;
|
||||
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
package com.tmerclub.cloud.cuerecycle.model.dto;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 后管操作球杆退回业务对象
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-18
|
||||
**/
|
||||
@Data
|
||||
public class CueRetractedDTO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
@NotNull(message = "订单ID不能为空")
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 用户退货网点ids
|
||||
*/
|
||||
@NotNull(message = "网点不能为空")
|
||||
private Long outletConfigId;
|
||||
/**
|
||||
* 用户退货打印机id
|
||||
*/
|
||||
@NotNull(message = "打印机不能为空")
|
||||
private Long printerId;
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
package com.tmerclub.cloud.cuerecycle.model.dto;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 上传订单号业务对象
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-15
|
||||
**/
|
||||
@Data
|
||||
public class CueSaveMailingDTO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
@NotNull(message = "订单ID不能为空")
|
||||
private Long orderId;
|
||||
/**
|
||||
* 商城订单id
|
||||
*/
|
||||
@NotNull(message = "商城订单ID不能为空")
|
||||
private Long mallOrderId;
|
||||
/**
|
||||
* 寄出单号
|
||||
*/
|
||||
@NotEmpty(message = "寄出单号不能为空")
|
||||
private String sendNumber;
|
||||
/**
|
||||
* 订单状态
|
||||
*/
|
||||
@NotNull(message = "订单状态不能为空")
|
||||
private Integer orderStatus;
|
||||
}
|
@ -1,124 +0,0 @@
|
||||
package com.tmerclub.cloud.cuerecycle.model.vo;
|
||||
|
||||
import com.tmerclub.cloud.common.vo.BaseVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 回收订单视图对象
|
||||
*
|
||||
* @author : frank
|
||||
* @create : 2025-04-15
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AppCueOrderVO extends BaseVO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Schema(description = "主键ID")
|
||||
private Long orderId;
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@Schema(description = "用户ID")
|
||||
private Long userId;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
@Schema(description = "商品ID")
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@Schema(description = "商品名称")
|
||||
private String productName;
|
||||
/**
|
||||
* 商品图片
|
||||
*/
|
||||
@Schema(description = "商品图片")
|
||||
private String productImages;
|
||||
/**
|
||||
* 类型:1-回收,2-置换,3-寄售
|
||||
*/
|
||||
@Schema(description = "类型:1-回收,2-置换,3-寄售")
|
||||
private Integer orderType;
|
||||
/**
|
||||
* 状态:0-待审核,1-审核通过(待发货),2-审核拒绝,3-待收货(已发货),4-已收货(评估中),5-评估失败(退回),6-评估成功(给出价格),7-价格不满意(退回),8-价格满意(结束),9-价格不满意(已退回)
|
||||
*/
|
||||
@Schema(description = "0-待审核,1-审核通过(待发货),2-审核拒绝,3-待收货(已发货),4-已收货(评估中),5-评估失败(退回),6-评估成功(给出价格),7-价格不满意(退回),8-价格满意(结束),9-价格不满意(已退回)")
|
||||
private Integer orderStatus;
|
||||
/**
|
||||
* 预计金额
|
||||
*/
|
||||
@Schema(description = "预计金额")
|
||||
private Long estimatedAmount;
|
||||
/**
|
||||
* 评估金额
|
||||
*/
|
||||
@Schema(description = "评估金额")
|
||||
private Long actualAmount;
|
||||
/**
|
||||
* 代金卷金额
|
||||
*/
|
||||
@Schema(description = "代金卷金额")
|
||||
private Long voucherAmount;
|
||||
/**
|
||||
* 是否已支付,1.已支付0.未支付
|
||||
*/
|
||||
@Schema(description = "是否已支付,1.已支付0.未支付")
|
||||
private Integer isPayed;
|
||||
/**
|
||||
* 支付方式:1-余额,2-代金卷
|
||||
*/
|
||||
@Schema(description = "支付方式:1-余额,2-代金卷")
|
||||
private Integer payType;
|
||||
/**
|
||||
* 付款时间
|
||||
*/
|
||||
@Schema(description = "付款时间")
|
||||
private Date payTime;
|
||||
/**
|
||||
* 发货时间
|
||||
*/
|
||||
@Schema(description = "发货时间")
|
||||
private Date deliveryTime;
|
||||
/**
|
||||
* 完成时间
|
||||
*/
|
||||
@Schema(description = "完成时间")
|
||||
private Date finallyTime;
|
||||
/**
|
||||
* 商城订单ID
|
||||
*/
|
||||
@Schema(description = "商城订单ID")
|
||||
private Long mallOrderId;
|
||||
/**
|
||||
* 寄售佣金
|
||||
*/
|
||||
@Schema(description = "寄售佣金")
|
||||
private Long brokerage;
|
||||
/**
|
||||
* 服务费
|
||||
*/
|
||||
@Schema(description = "服务费")
|
||||
private Long serviceCharge;
|
||||
/**
|
||||
* 寄出时快递单号
|
||||
*/
|
||||
@Schema(description = "寄出时快递单号")
|
||||
private String sendNumber;
|
||||
/**
|
||||
* 寄出时候选定的仓库id
|
||||
*/
|
||||
@Schema(description = "寄出时候选定的仓库id")
|
||||
private Long warehouseId;
|
||||
}
|
@ -63,9 +63,9 @@ public class CueOrderVO extends BaseVO implements Serializable {
|
||||
@Schema(description = "类型:1-回收,2-置换,3-寄售")
|
||||
private Integer orderType;
|
||||
/**
|
||||
* 状态:0-待审核,1-审核通过(待发货),2-审核拒绝,3-待收货(已发货),4-已收货(评估中),5-评估失败(退回),6-评估成功(给出价格),7-价格不满意(退回),8-价格满意(结束),9-价格不满意(已退回)
|
||||
* 状态:0-待审核,1-审核通过,2-审核拒绝,3-待发货,4-待收货(已发货),5-已收货(评估中),6-评估失败(退回),7-评估成功,8-已完成,9-价格不满意(退回)
|
||||
*/
|
||||
@Schema(description = "0-待审核,1-审核通过(待发货),2-审核拒绝,3-待收货(已发货),4-已收货(评估中),5-评估失败(退回),6-评估成功(给出价格),7-价格不满意(退回),8-价格满意(结束),9-价格不满意(已退回)")
|
||||
@Schema(description = "状态:0-待审核,1-审核通过,2-审核拒绝,3-待发货,4-待收货(已发货),5-已收货(评估中),6-评估失败(退回),7-评估成功,8-已完成,9-价格不满意(退回)")
|
||||
private Integer orderStatus;
|
||||
/**
|
||||
* 瑕疵图片,逗号隔开
|
||||
@ -127,19 +127,4 @@ public class CueOrderVO extends BaseVO implements Serializable {
|
||||
*/
|
||||
@Schema(description = "瑕疵项")
|
||||
private List<CueOrderFlawVO> flawList;
|
||||
/**
|
||||
* 商城订单ID
|
||||
*/
|
||||
@Schema(description = "商城订单ID")
|
||||
private Long mallOrderId;
|
||||
|
||||
/**
|
||||
* 寄出单号
|
||||
*/
|
||||
private String sendNumber;
|
||||
|
||||
/**
|
||||
* 用户退款地址id
|
||||
*/
|
||||
private Long orderAddrId;
|
||||
}
|
@ -3,8 +3,6 @@ package com.tmerclub.cloud.cuerecycle.service;
|
||||
import com.tmerclub.cloud.common.database.dto.PageDTO;
|
||||
import com.tmerclub.cloud.common.database.vo.PageVO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueOrderDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueSaveMailingDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.AppCueOrderVO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.CueOrderVO;
|
||||
|
||||
/**
|
||||
@ -63,20 +61,4 @@ public interface CueOrderService {
|
||||
* @return 删除结果
|
||||
*/
|
||||
int delete(Long id);
|
||||
|
||||
/**
|
||||
* 根据订单ID获取回收订单详情
|
||||
*
|
||||
* @param orderId 订单ID
|
||||
* @return 回收订单详情
|
||||
*/
|
||||
AppCueOrderVO getByAppCueOrderId(Long orderId);
|
||||
|
||||
/**
|
||||
* 邮寄填写订单
|
||||
*
|
||||
* @param cueSaveMailingDTO 提交参数
|
||||
* @return 结果
|
||||
*/
|
||||
int saveMailing(CueSaveMailingDTO cueSaveMailingDTO);
|
||||
}
|
@ -2,33 +2,18 @@ package com.tmerclub.cloud.cuerecycle.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.tmerclub.cloud.common.constant.Constant;
|
||||
import com.tmerclub.cloud.common.constant.SendTypeEnum;
|
||||
import com.tmerclub.cloud.common.database.dto.PageDTO;
|
||||
import com.tmerclub.cloud.common.database.util.PageUtil;
|
||||
import com.tmerclub.cloud.common.database.dto.PageDTO;
|
||||
import com.tmerclub.cloud.common.database.vo.PageVO;
|
||||
import com.tmerclub.cloud.common.exception.LuckException;
|
||||
import com.tmerclub.cloud.common.local.constant.CueOrderStatus;
|
||||
import com.tmerclub.cloud.common.order.vo.SendNotifyBO;
|
||||
import com.tmerclub.cloud.common.response.ResponseEnum;
|
||||
import com.tmerclub.cloud.common.rocketmq.config.RocketMqConstant;
|
||||
import com.tmerclub.cloud.cuerecycle.manager.CreateOrderManager;
|
||||
import com.tmerclub.cloud.cuerecycle.mapper.CueOrderMapper;
|
||||
import com.tmerclub.cloud.cuerecycle.model.CueOrder;
|
||||
import com.tmerclub.cloud.cuerecycle.constant.CueOrderStatus;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueOrderDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueSaveMailingDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.AppCueOrderVO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.CueOrderVO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.CueOrder;
|
||||
import com.tmerclub.cloud.cuerecycle.mapper.CueOrderMapper;
|
||||
import com.tmerclub.cloud.cuerecycle.service.CueOrderService;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.rocketmq.client.producer.SendStatus;
|
||||
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
||||
import org.springframework.messaging.support.GenericMessage;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
@ -37,16 +22,11 @@ import java.util.Objects;
|
||||
* @author : frank
|
||||
* @create : 2025-04-15
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class CueOrderServiceImpl implements CueOrderService {
|
||||
|
||||
@Resource
|
||||
CueOrderMapper cueOrderMapper;
|
||||
@Resource
|
||||
CreateOrderManager createOrderManager;
|
||||
@Resource
|
||||
private RocketMQTemplate sendNotifyToUserTemplate;
|
||||
|
||||
@Override
|
||||
public PageVO<CueOrderVO> page(PageDTO pageDTO, CueOrderDTO cueOrderDTO) {
|
||||
@ -70,12 +50,7 @@ public class CueOrderServiceImpl implements CueOrderService {
|
||||
CueOrder cueOrder = new CueOrder();
|
||||
cueOrder.setOrderId(cueOrderDTO.getOrderId());
|
||||
cueOrder.setOrderStatus(cueOrderDTO.getOrderStatus());
|
||||
if (Objects.equals(cueOrderDTO.getOrderStatus(), CueOrderStatus.AUDIT_PASS.value())) {
|
||||
cueOrder.setEstimatedAmount(cueOrderDTO.getEstimatedAmount());
|
||||
}
|
||||
cueOrder.setUpdateTime(DateUtil.date());
|
||||
// 发送消息
|
||||
syncSend(cueOrderDTO);
|
||||
return cueOrderMapper.update(cueOrder);
|
||||
}
|
||||
|
||||
@ -84,38 +59,14 @@ public class CueOrderServiceImpl implements CueOrderService {
|
||||
CueOrder cueOrder = new CueOrder();
|
||||
cueOrder.setOrderId(cueOrderDTO.getOrderId());
|
||||
cueOrder.setOrderStatus(cueOrderDTO.getOrderStatus());
|
||||
if (Objects.equals(cueOrderDTO.getOrderStatus(), CueOrderStatus.EVALUATION_SUCCESS.value())) {
|
||||
if(Objects.equals(cueOrderDTO.getOrderStatus(), CueOrderStatus.EVALUATION_SUCCESS.value())){
|
||||
cueOrder.setActualAmount(cueOrderDTO.getActualAmount());
|
||||
// 寄售需要填写服务费和佣金
|
||||
if (cueOrderDTO.getOrderType().equals(3)) {
|
||||
cueOrder.setServiceCharge(cueOrderDTO.getServiceCharge());
|
||||
cueOrder.setBrokerage(cueOrderDTO.getBrokerage());
|
||||
} else {
|
||||
cueOrder.setVoucherAmount(cueOrderDTO.getVoucherAmount());
|
||||
}
|
||||
cueOrder.setVoucherAmount(cueOrderDTO.getVoucherAmount());
|
||||
}
|
||||
cueOrder.setUpdateTime(DateUtil.date());
|
||||
// 发送消息
|
||||
syncSend(cueOrderDTO);
|
||||
return cueOrderMapper.update(cueOrder);
|
||||
}
|
||||
|
||||
private void syncSend(CueOrderDTO cueOrderDTO) {
|
||||
// 修改系统订单的状态
|
||||
createOrderManager.updateOrderMall(cueOrderDTO.getMallOrderId(), cueOrderDTO.getOrderStatus());
|
||||
// 发送消息
|
||||
List<SendNotifyBO> notifyList = new ArrayList<>(Constant.INITIAL_CAPACITY);
|
||||
SendNotifyBO sendNotifyBO = new SendNotifyBO();
|
||||
sendNotifyBO.setSendType(SendTypeEnum.CUE_ORDER_AUDIT_RESULT.getValue());
|
||||
sendNotifyBO.setUserId(cueOrderDTO.getUserId());
|
||||
sendNotifyBO.setShopId(Constant.PLATFORM_SHOP_ID);
|
||||
notifyList.add(sendNotifyBO);
|
||||
SendStatus sendStockStatus = sendNotifyToUserTemplate.syncSend(RocketMqConstant.SEND_NOTIFY_TO_USER_TOPIC, new GenericMessage<>(notifyList)).getSendStatus();
|
||||
if (!Objects.equals(sendStockStatus, SendStatus.SEND_OK)) {
|
||||
throw new LuckException(ResponseEnum.EXCEPTION);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delete(Long id) {
|
||||
CueOrderVO cueOrderVO = cueOrderMapper.getById(id);
|
||||
@ -124,21 +75,4 @@ public class CueOrderServiceImpl implements CueOrderService {
|
||||
cueOrder.setDeleted(1);
|
||||
return cueOrderMapper.update(cueOrder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AppCueOrderVO getByAppCueOrderId(Long orderId) {
|
||||
CueOrderVO cueOrderVO = cueOrderMapper.getById(orderId);
|
||||
return BeanUtil.toBean(cueOrderVO, AppCueOrderVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int saveMailing(CueSaveMailingDTO cueSaveMailingDTO) {
|
||||
// 修改系统订单的状态
|
||||
createOrderManager.updateOrderMall(cueSaveMailingDTO.getMallOrderId(), CueOrderStatus.FINISH_DELIVERY.value());
|
||||
// 修改回收单状态
|
||||
CueOrder cueOrder = BeanUtil.toBean(cueSaveMailingDTO, CueOrder.class);
|
||||
cueOrder.setOrderStatus(CueOrderStatus.FINISH_DELIVERY.value());
|
||||
cueOrder.setDeliveryTime(DateUtil.date());
|
||||
return cueOrderMapper.update(cueOrder);
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.tmerclub.cloud.warehouse.controller.admin;
|
||||
package com.tmerclub.cloud.warehouse.controller;
|
||||
|
||||
import com.tmerclub.cloud.common.database.dto.PageDTO;
|
||||
import com.tmerclub.cloud.common.database.vo.PageVO;
|
@ -1,58 +0,0 @@
|
||||
package com.tmerclub.cloud.warehouse.controller.app;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.tmerclub.cloud.common.response.ServerResponseEntity;
|
||||
import com.tmerclub.cloud.warehouse.model.vo.WarehouseVO;
|
||||
import com.tmerclub.cloud.warehouse.service.WarehouseService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* app-仓库
|
||||
*
|
||||
* @author : frank
|
||||
* @create : 2025-04-14
|
||||
*/
|
||||
@Tag(name = "app-仓库")
|
||||
@RestController("appWarehouseController")
|
||||
@RequestMapping("/app/warehouse")
|
||||
public class WarehouseController {
|
||||
@Resource
|
||||
WarehouseService warehouseService;
|
||||
|
||||
/**
|
||||
* 根据经纬度获取最近的仓库信息
|
||||
*
|
||||
* @param lat 纬度
|
||||
* @param lng 经度
|
||||
* @return 最近的仓库信息
|
||||
*/
|
||||
@GetMapping("/getNearbyWarehouse")
|
||||
public ServerResponseEntity<WarehouseVO> getNearbyWarehouse(@RequestParam("orderId") Long orderId, @RequestParam("lat") BigDecimal lat, @RequestParam("lng") BigDecimal lng) {
|
||||
WarehouseVO nearbyWarehouse = warehouseService.getNearbyWarehouse(orderId, lat, lng);
|
||||
return ServerResponseEntity.success(nearbyWarehouse);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询仓库信息
|
||||
*
|
||||
* @param warehouseId 仓库id
|
||||
* @return 仓库信息
|
||||
*/
|
||||
@GetMapping("/getWarehouseById")
|
||||
@Operation(summary = "根据id查询仓库信息", description = "根据id查询仓库信息")
|
||||
public ServerResponseEntity<WarehouseVO> getById(@RequestParam("warehouseId") Long warehouseId) {
|
||||
WarehouseVO warehouseVO = warehouseService.getById(warehouseId);
|
||||
if (ObjectUtil.isNull(warehouseVO)) {
|
||||
return ServerResponseEntity.showFailMsg("暂无仓库信息");
|
||||
}
|
||||
return ServerResponseEntity.success(warehouseVO);
|
||||
}
|
||||
}
|
@ -5,7 +5,6 @@ import com.tmerclub.cloud.warehouse.model.dto.WarehouseDTO;
|
||||
import com.tmerclub.cloud.warehouse.model.vo.WarehouseVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -47,12 +46,4 @@ public interface WarehouseMapper {
|
||||
* @return 修改结果
|
||||
*/
|
||||
int update(Warehouse warehouse);
|
||||
/**
|
||||
* 根据经纬度获取最近的仓库信息
|
||||
*
|
||||
* @param lat 纬度
|
||||
* @param lng 经度
|
||||
* @return 最近的仓库信息
|
||||
*/
|
||||
WarehouseVO getNearbyWarehouse(@Param("lat")BigDecimal lat, @Param("lng")BigDecimal lng);
|
||||
}
|
@ -5,8 +5,6 @@ import com.tmerclub.cloud.common.database.vo.PageVO;
|
||||
import com.tmerclub.cloud.warehouse.model.dto.WarehouseDTO;
|
||||
import com.tmerclub.cloud.warehouse.model.vo.WarehouseVO;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 仓库Service接口
|
||||
*
|
||||
@ -55,13 +53,4 @@ public interface WarehouseService {
|
||||
* @return 删除结果
|
||||
*/
|
||||
int delete(Long id);
|
||||
|
||||
/**
|
||||
* 根据经纬度获取最近的仓库信息
|
||||
*
|
||||
* @param lat 纬度
|
||||
* @param lng 经度
|
||||
* @return 最近的仓库信息
|
||||
*/
|
||||
WarehouseVO getNearbyWarehouse(Long orderId, BigDecimal lat, BigDecimal lng);
|
||||
}
|
@ -2,14 +2,9 @@ package com.tmerclub.cloud.warehouse.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.tmerclub.cloud.common.database.dto.PageDTO;
|
||||
import com.tmerclub.cloud.common.database.util.PageUtil;
|
||||
import com.tmerclub.cloud.common.database.vo.PageVO;
|
||||
import com.tmerclub.cloud.common.exception.LuckException;
|
||||
import com.tmerclub.cloud.cuerecycle.mapper.CueOrderMapper;
|
||||
import com.tmerclub.cloud.cuerecycle.model.CueOrder;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.CueOrderVO;
|
||||
import com.tmerclub.cloud.warehouse.mapper.WarehouseMapper;
|
||||
import com.tmerclub.cloud.warehouse.model.Warehouse;
|
||||
import com.tmerclub.cloud.warehouse.model.dto.WarehouseDTO;
|
||||
@ -18,8 +13,6 @@ import com.tmerclub.cloud.warehouse.service.WarehouseService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 仓库Service实现类
|
||||
*
|
||||
@ -31,8 +24,6 @@ public class WarehouseServiceImpl implements WarehouseService {
|
||||
|
||||
@Resource
|
||||
WarehouseMapper warehouseMapper;
|
||||
@Resource
|
||||
CueOrderMapper cueOrderMapper;
|
||||
|
||||
@Override
|
||||
public PageVO<WarehouseVO> page(PageDTO pageDTO, WarehouseDTO warehouseDTO) {
|
||||
@ -66,27 +57,4 @@ public class WarehouseServiceImpl implements WarehouseService {
|
||||
warehouse.setDeleted(1);
|
||||
return warehouseMapper.update(warehouse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WarehouseVO getNearbyWarehouse(Long orderId, BigDecimal lat, BigDecimal lng) {
|
||||
CueOrderVO orderVO = cueOrderMapper.getById(orderId);
|
||||
if (ObjectUtil.isNull(orderVO)) {
|
||||
throw new LuckException("暂无订单信息");
|
||||
}
|
||||
if (ObjectUtil.isNull(orderVO.getMallOrderId())) {
|
||||
WarehouseVO nearbyWarehouse = warehouseMapper.getNearbyWarehouse(lat, lng);
|
||||
if (ObjectUtil.isNull(nearbyWarehouse)) {
|
||||
throw new LuckException("暂无仓库信息");
|
||||
}
|
||||
// 将仓库id与订单绑定
|
||||
CueOrder cueOrder = new CueOrder();
|
||||
cueOrder.setOrderId(orderId);
|
||||
cueOrder.setMallOrderId(nearbyWarehouse.getWarehouseId());
|
||||
cueOrderMapper.update(cueOrder);
|
||||
return nearbyWarehouse;
|
||||
} else {
|
||||
return warehouseMapper.getById(orderVO.getMallOrderId());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -28,14 +28,10 @@
|
||||
<result property="deliveryTime" column="delivery_time"/>
|
||||
<result property="finallyTime" column="finally_time"/>
|
||||
<result property="finallyTime" column="finally_time"/>
|
||||
<result property="mallOrderId" column="mall_order_id"/>
|
||||
<result property="sendNumber" column="send_number"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Vo_Column_List">
|
||||
order_id,product_id,product_name,product_images,product_price,user_id,user_name,user_phone,order_type,
|
||||
order_status,flaw_img_url,evidence_of_payment,order_remark,estimated_amount,actual_amount,voucher_amount,deleted,
|
||||
create_time,update_time,is_payed,pay_type,pay_time,delivery_time,finally_time,mall_order_id,send_number,order_addr_id
|
||||
order_id,product_id,product_name,product_price,user_id,user_name,user_phone,order_type,order_status,flaw_img_url,evidence_of_payment,order_remark,estimated_amount,actual_amount,voucher_amount,deleted,create_time,update_time,is_payed,pay_type,pay_time,delivery_time,finally_time
|
||||
</sql>
|
||||
|
||||
<select id="list" resultMap="cueOrderVOMap">
|
||||
@ -83,7 +79,6 @@
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="productId != null">product_id,</if>
|
||||
<if test="productName != null and productName != ''">product_name,</if>
|
||||
<if test="productImages != null and productImages != ''">product_images,</if>
|
||||
<if test="productPrice != null">product_price,</if>
|
||||
<if test="userName != null and userName != ''">user_name,</if>
|
||||
<if test="userPhone != null and userPhone != ''">user_phone,</if>
|
||||
@ -106,7 +101,6 @@
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="productId != null">#{productId},</if>
|
||||
<if test="productName != null and productName != ''">#{productName},</if>
|
||||
<if test="productImages != null and productImages != ''">#{productImages},</if>
|
||||
<if test="productPrice != null">#{productPrice},</if>
|
||||
<if test="userName != null and userName != ''">#{userName},</if>
|
||||
<if test="userPhone != null and userPhone != ''">#{userPhone},</if>
|
||||
@ -181,33 +175,7 @@
|
||||
<if test="finallyTime != null">
|
||||
finally_time = #{finallyTime},
|
||||
</if>
|
||||
<if test="mallOrderId != null">
|
||||
mall_order_id = #{mallOrderId},
|
||||
</if>
|
||||
<if test="mallOrderId != null">
|
||||
service_charge = #{serviceCharge},
|
||||
</if>
|
||||
<if test="brokerage != null">
|
||||
brokerage = #{brokerage},
|
||||
</if>
|
||||
<if test="sendNumber != null and sendNumber != ''">
|
||||
send_number = #{sendNumber},
|
||||
</if>
|
||||
<if test="warehouse_id != null">
|
||||
warehouse_id = #{warehouseId},
|
||||
</if>
|
||||
<if test="orderAddrId != null">
|
||||
order_addr_id = #{orderAddrId},
|
||||
</if>
|
||||
<if test="outletConfigId != null">
|
||||
outlet_config_id = #{outletConfigId},
|
||||
</if>
|
||||
<if test="printerId != null">
|
||||
printer_id = #{printerId},
|
||||
</if>
|
||||
<if test="backTrackingNumber != null and backTrackingNumber != ''">
|
||||
back_tracking_number = #{backTrackingNumber},
|
||||
</if>
|
||||
<if test="mallOrderId != null">mall_order_id = #{mallOrderId},</if>
|
||||
</set>
|
||||
where
|
||||
order_id = #{orderId}
|
||||
|
@ -75,37 +75,6 @@
|
||||
WHERE
|
||||
warehouse_id = #{warehouseId}
|
||||
</select>
|
||||
<select id="getNearbyWarehouse" resultType="com.tmerclub.cloud.warehouse.model.vo.WarehouseVO">
|
||||
SELECT
|
||||
warehouse_id,
|
||||
warehouse_name,
|
||||
warehouse_status,
|
||||
principal_name,
|
||||
principal_phone,
|
||||
province_id,
|
||||
province,
|
||||
city_id,
|
||||
city,
|
||||
area_id,
|
||||
area,
|
||||
post_code,
|
||||
addr,
|
||||
lng,
|
||||
lat,
|
||||
deleted,
|
||||
update_time,
|
||||
create_time,
|
||||
(6371 * ACOS(
|
||||
COS(RADIANS(#{lat})) * COS(RADIANS(lat)) *
|
||||
COS(RADIANS(lng) - RADIANS(#{lng})) +
|
||||
SIN(RADIANS(#{lat})) * SIN(RADIANS(lat))
|
||||
)) AS distance
|
||||
FROM
|
||||
warehouse
|
||||
ORDER BY
|
||||
distance
|
||||
LIMIT 1;
|
||||
</select>
|
||||
|
||||
<insert id="save" useGeneratedKeys="true" keyProperty="warehouseId">
|
||||
INSERT INTO warehouse
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
package com.tmerclub.cloud.coupon.feign;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.tmerclub.cloud.api.coupon.constant.CouponType;
|
||||
import com.tmerclub.cloud.api.coupon.constant.PutOnStatus;
|
||||
import com.tmerclub.cloud.api.coupon.dto.BindCouponDTO;
|
||||
import com.tmerclub.cloud.api.coupon.dto.ReceiveCouponDTO;
|
||||
@ -15,7 +15,6 @@ import com.tmerclub.cloud.common.security.AuthUserContext;
|
||||
import com.tmerclub.cloud.common.util.BeanUtil;
|
||||
import com.tmerclub.cloud.coupon.constant.CouponStatus;
|
||||
import com.tmerclub.cloud.coupon.constant.SuitableProdType;
|
||||
import com.tmerclub.cloud.coupon.dto.CouponDTO;
|
||||
import com.tmerclub.cloud.coupon.manager.CouponStockManager;
|
||||
import com.tmerclub.cloud.coupon.model.Coupon;
|
||||
import com.tmerclub.cloud.coupon.service.CouponService;
|
||||
@ -127,26 +126,4 @@ public class CouponFeignController implements CouponFeignClient {
|
||||
public ServerResponseEntity<Integer> getStockByCouponId(Long couponId) {
|
||||
return ServerResponseEntity.success(couponStockManager.getStockByCouponId(couponId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendUserCoupon(Long userId, Long reduceAmount) {
|
||||
// 创建优惠卷
|
||||
CouponDTO couponDTO = new CouponDTO();
|
||||
couponDTO.setCouponName("球杆置换代金卷");
|
||||
couponDTO.setSuitableProdType(SuitableProdType.ALL_SPU.value());
|
||||
couponDTO.setLimitNum(1);
|
||||
couponDTO.setCashCondition(reduceAmount + 1);
|
||||
couponDTO.setCouponType(CouponType.C2M.value());
|
||||
couponDTO.setReduceAmount(reduceAmount);
|
||||
couponDTO.setPutonStatus(PutOnStatus.PUT_ON.value());
|
||||
couponDTO.setGetWay(1);
|
||||
couponDTO.setValidTimeType(1);
|
||||
couponDTO.setAfterReceiveDays(0);
|
||||
couponDTO.setValidDays(3652);
|
||||
couponDTO.setTotalStock(1);
|
||||
couponDTO.setStocks(1);
|
||||
Long save = couponService.save(couponDTO);
|
||||
// 绑定优惠卷
|
||||
couponService.batchBindCouponByCouponIds(Collections.singletonList(save), userId);
|
||||
}
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ public interface CouponService {
|
||||
*
|
||||
* @param couponDTO
|
||||
*/
|
||||
Long save(CouponDTO couponDTO);
|
||||
void save(CouponDTO couponDTO);
|
||||
|
||||
/**
|
||||
* 更新优惠券
|
||||
|
@ -183,7 +183,7 @@ public class CouponServiceImpl implements CouponService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long save(CouponDTO couponDTO) {
|
||||
public void save(CouponDTO couponDTO) {
|
||||
checkCoupon(couponDTO);
|
||||
Coupon coupon = BeanUtil.map(couponDTO, Coupon.class);
|
||||
coupon.setTotalStock(coupon.getStocks());
|
||||
@ -215,8 +215,6 @@ public class CouponServiceImpl implements CouponService {
|
||||
multiRedisStockManager.doCouponZone(multiDecrementBO, coupon.getTotalStock());
|
||||
// 删除商品缓存
|
||||
removeSpuCache(coupon.getShopId(), couponDTO.getSpuIds());
|
||||
|
||||
return coupon.getCouponId();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,22 +1,17 @@
|
||||
|
||||
package com.tmerclub.cloud.delivery.feign;
|
||||
|
||||
import com.tmerclub.cloud.api.delivery.dto.CalculateAndGetDeliverInfoDTO;
|
||||
import com.tmerclub.cloud.api.delivery.dto.DeliveryOrderDTO;
|
||||
import com.tmerclub.cloud.api.delivery.dto.DeliveryOrderItemDTO;
|
||||
import com.tmerclub.cloud.api.delivery.feign.DeliveryFeignClient;
|
||||
import com.tmerclub.cloud.api.delivery.vo.ShopTransportVO;
|
||||
import com.tmerclub.cloud.api.user.feign.UserAddrFeignClient;
|
||||
import com.tmerclub.cloud.common.constant.Constant;
|
||||
import com.tmerclub.cloud.common.local.dto.CurOderReturnsDTO;
|
||||
import com.tmerclub.cloud.common.order.vo.*;
|
||||
import com.tmerclub.cloud.common.response.ServerResponseEntity;
|
||||
import com.tmerclub.cloud.common.util.BeanUtil;
|
||||
import com.tmerclub.cloud.delivery.manager.DeliveryManager;
|
||||
import com.tmerclub.cloud.delivery.manager.DeliveryPrintManager;
|
||||
import com.tmerclub.cloud.delivery.service.DeliveryOrderService;
|
||||
import com.tmerclub.cloud.delivery.service.TransportService;
|
||||
import com.tmerclub.cloud.order.model.OrderAddr;
|
||||
import com.tmerclub.cloud.order.service.OrderAddrService;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.slf4j.Logger;
|
||||
@ -35,19 +30,23 @@ import java.util.stream.Collectors;
|
||||
@DubboService
|
||||
public class DeliveryFeignController implements DeliveryFeignClient {
|
||||
private static final Logger logger = LoggerFactory.getLogger(DeliveryFeignController.class);
|
||||
private static final long TWO = -2;
|
||||
@Autowired
|
||||
DeliveryPrintManager deliveryPrintManager;
|
||||
|
||||
|
||||
@DubboReference
|
||||
private UserAddrFeignClient userAddrFeignClient;
|
||||
|
||||
@Autowired
|
||||
private TransportService transportService;
|
||||
|
||||
@Autowired
|
||||
private DeliveryOrderService deliveryOrderService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private DeliveryManager deliveryManager;
|
||||
@Autowired
|
||||
private OrderAddrService orderAddrService;
|
||||
|
||||
private static final long TWO = -2;
|
||||
|
||||
|
||||
@Override
|
||||
public ServerResponseEntity<UserDeliveryInfoVO> calculateAndGetDeliverInfo(CalculateAndGetDeliverInfoDTO param) {
|
||||
@ -127,33 +126,4 @@ public class DeliveryFeignController implements DeliveryFeignClient {
|
||||
return transportService.getTransportAndAllItemsById(deliveryTemplateId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServerResponseEntity<String> curOderReturns(CurOderReturnsDTO curOderReturnsDTO) {
|
||||
DeliveryOrderDTO deliveryOrderDTO = new DeliveryOrderDTO();
|
||||
// 网点id
|
||||
deliveryOrderDTO.setOutletConfigId(curOderReturnsDTO.getOutletConfigId());
|
||||
// 打印机id
|
||||
deliveryOrderDTO.setPrinterId(curOderReturnsDTO.getPrinterId());
|
||||
|
||||
// 根据订单地址id查询详情
|
||||
OrderAddr orderAddr = orderAddrService.getById(curOderReturnsDTO.getOrderAddrId());
|
||||
|
||||
// 收件人姓名
|
||||
deliveryOrderDTO.setConsignee(orderAddr.getConsignee());
|
||||
// 收件人手机号
|
||||
deliveryOrderDTO.setMobile(orderAddr.getMobile());
|
||||
// 订单地址id
|
||||
deliveryOrderDTO.setOrderAddrId(curOderReturnsDTO.getOrderAddrId());
|
||||
// 物流订单项
|
||||
List<DeliveryOrderItemDTO> deliveryOrderItemDTOList = new ArrayList<>();
|
||||
DeliveryOrderItemDTO deliveryOrderItemDTO = new DeliveryOrderItemDTO();
|
||||
deliveryOrderItemDTO.setSpuName("球杆");
|
||||
deliveryOrderItemDTOList.add(deliveryOrderItemDTO);
|
||||
deliveryOrderDTO.setSelectOrderItems(deliveryOrderItemDTOList);
|
||||
deliveryOrderDTO.setOrderId(1L);
|
||||
|
||||
String trackingNumber = deliveryPrintManager.deliveryPrint(deliveryOrderDTO, 1, 2);
|
||||
return ServerResponseEntity.success(trackingNumber);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -74,10 +74,9 @@ public class OutletConfigServiceImpl implements OutletConfigService {
|
||||
throw new LuckException("暂无权限查看该配置");
|
||||
}
|
||||
} else {
|
||||
// TODO : 本地开发先注释掉
|
||||
// if (!Objects.equals(outletConfig.getShopId(), AuthUserContext.get().getTenantId())) {
|
||||
// throw new LuckException("暂无权限查看该配置");
|
||||
// }
|
||||
if (!Objects.equals(outletConfig.getShopId(), AuthUserContext.get().getTenantId())) {
|
||||
throw new LuckException("暂无权限查看该配置");
|
||||
}
|
||||
}
|
||||
return outletConfig;
|
||||
}
|
||||
|
@ -40,21 +40,20 @@ public class PrinterServiceImpl implements PrinterService {
|
||||
|
||||
@Override
|
||||
public Printer getByPrinterId(Long printerId) {
|
||||
// TODO : 本地暂时注释
|
||||
// Integer sysType = AuthUserContext.get().getSysType();
|
||||
Integer sysType = AuthUserContext.get().getSysType();
|
||||
Printer printer = printerMapper.getByPrinterId(printerId);
|
||||
if (Objects.isNull(printer)) {
|
||||
throw new LuckException("打印机信息为空");
|
||||
}
|
||||
// if (Objects.equals(sysType, SysTypeEnum.SUPPLIER.value())) {
|
||||
// if (!Objects.equals(printer.getSupplierId(), AuthUserContext.get().getTenantId())) {
|
||||
// throw new LuckException("暂无权限查看该配置");
|
||||
// }
|
||||
// } else {
|
||||
// if (!Objects.equals(printer.getShopId(), AuthUserContext.get().getTenantId())) {
|
||||
// throw new LuckException("暂无权限查看该配置");
|
||||
// }
|
||||
// }
|
||||
if (Objects.equals(sysType, SysTypeEnum.SUPPLIER.value())) {
|
||||
if (!Objects.equals(printer.getSupplierId(), AuthUserContext.get().getTenantId())) {
|
||||
throw new LuckException("暂无权限查看该配置");
|
||||
}
|
||||
} else {
|
||||
if (!Objects.equals(printer.getShopId(), AuthUserContext.get().getTenantId())) {
|
||||
throw new LuckException("暂无权限查看该配置");
|
||||
}
|
||||
}
|
||||
return printer;
|
||||
}
|
||||
|
||||
|
@ -1,13 +1,9 @@
|
||||
|
||||
package com.tmerclub.cloud.order.feign;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.tmerclub.cloud.api.order.feign.OrderAddrFeignClient;
|
||||
import com.tmerclub.cloud.common.leaf.manager.SegmentManager;
|
||||
import com.tmerclub.cloud.common.order.vo.OrderAddrVO;
|
||||
import com.tmerclub.cloud.common.response.ServerResponseEntity;
|
||||
import com.tmerclub.cloud.constant.DistributedIdKey;
|
||||
import com.tmerclub.cloud.order.model.OrderAddr;
|
||||
import com.tmerclub.cloud.order.service.OrderAddrService;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -21,21 +17,10 @@ public class OrderAddrFeignController implements OrderAddrFeignClient {
|
||||
|
||||
@Autowired
|
||||
private OrderAddrService orderAddrService;
|
||||
@Autowired
|
||||
private SegmentManager segmentManager;
|
||||
|
||||
@Override
|
||||
public ServerResponseEntity<OrderAddrVO> getOrderAddrByOrderId(Long orderId) {
|
||||
OrderAddrVO orderAddrVO = orderAddrService.getByOrderId(orderId);
|
||||
return ServerResponseEntity.success(orderAddrVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServerResponseEntity<Long> addCueAddr(OrderAddrVO orderAddrVO) {
|
||||
OrderAddr orderAddr = BeanUtil.toBean(orderAddrVO, OrderAddr.class);
|
||||
Long addrId = segmentManager.getSegmentIdWithDateTime(DistributedIdKey.tmerclub_ORDER_ADDR, orderAddr.getUserId());
|
||||
orderAddr.setOrderAddrId(addrId);
|
||||
orderAddrService.save(orderAddr);
|
||||
return ServerResponseEntity.success(addrId);
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,6 @@ import com.tmerclub.cloud.common.constant.Constant;
|
||||
import com.tmerclub.cloud.common.exception.LuckException;
|
||||
import com.tmerclub.cloud.common.i18n.LanguageEnum;
|
||||
import com.tmerclub.cloud.common.leaf.manager.SegmentManager;
|
||||
import com.tmerclub.cloud.common.local.constant.CueOrderStatus;
|
||||
import com.tmerclub.cloud.common.local.dto.SaveOrderToMallDTO;
|
||||
import com.tmerclub.cloud.common.order.bo.EsOrderBO;
|
||||
import com.tmerclub.cloud.common.order.bo.OrderIdWithRefundIdBO;
|
||||
@ -567,7 +566,7 @@ public class OrderFeignController implements OrderFeignClient {
|
||||
order.setUserId(saveOrderToMallDTO.getUserId());
|
||||
order.setTotal(saveOrderToMallDTO.getEstimatedAmount());
|
||||
order.setActualTotal(saveOrderToMallDTO.getEstimatedAmount());
|
||||
order.setStatus(CueOrderStatus.PENDING_AUDIT.value());
|
||||
order.setStatus(OrderStatus.UNPAY.value());
|
||||
order.setAllCount(1);
|
||||
order.setOrderType(OrderType.RECYCLE.value());
|
||||
order.setOrderId(segmentManager.getSegmentIdWithDateTime(DistributedIdKey.tmerclub_ORDER, order.getUserId()));
|
||||
@ -597,12 +596,4 @@ public class OrderFeignController implements OrderFeignClient {
|
||||
orderItemLangMapper.saveCueOrderItemLang(orderItemLang);
|
||||
return order.getOrderId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateOrderMall(Long mallOrderId, Integer orderStatus) {
|
||||
Order order = new Order();
|
||||
order.setOrderId(mallOrderId);
|
||||
order.setStatus(orderStatus);
|
||||
orderMapper.updateCueOrder(order);
|
||||
}
|
||||
}
|
||||
|
@ -393,5 +393,4 @@ public interface OrderMapper {
|
||||
* @param order 参数
|
||||
*/
|
||||
void saveCueOrder(Order order);
|
||||
void updateCueOrder(Order order);
|
||||
}
|
||||
|
@ -1340,14 +1340,6 @@
|
||||
update `order` set `distribution_amount` = #{order.distributionAmount}
|
||||
where order_id = #{order.orderId}
|
||||
</update>
|
||||
<update id="updateCueOrder">
|
||||
update
|
||||
`order`
|
||||
set
|
||||
`cue_order` = #{status}
|
||||
where
|
||||
order_id = #{orderId}
|
||||
</update>
|
||||
|
||||
<select id="getUserFirstUserOrder" resultType="com.tmerclub.cloud.common.mongodb.bo.order.MongoOrderBO">
|
||||
SELECT IF(MIN(order_id) = #{orderId}, 1, 0) firstOrder
|
||||
|
@ -42,12 +42,7 @@ public enum RechargeTypeEnum {
|
||||
/**
|
||||
* 提现
|
||||
*/
|
||||
WITHDRAW(7),
|
||||
/**
|
||||
* 出售球杆
|
||||
*/
|
||||
SELL(8),
|
||||
;
|
||||
WITHDRAW(7);
|
||||
|
||||
|
||||
private final Integer num;
|
||||
|
@ -37,9 +37,4 @@ public class UserAddrFeignController implements UserAddrFeignClient {
|
||||
public ServerResponseEntity<UserAddrVO> getUserAddrByUserId(Long userId) {
|
||||
return ServerResponseEntity.success(userAddrService.getUserAddrByUserId(0L, userId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServerResponseEntity<UserAddrVO> cueGetUserAddrByAddrId(Long addrId, Long userId) {
|
||||
return ServerResponseEntity.success(userAddrService.getUserAddrByUserId(addrId, userId));
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,7 @@
|
||||
|
||||
package com.tmerclub.cloud.user.feign;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.tmerclub.cloud.api.order.constant.FinanceType;
|
||||
import com.tmerclub.cloud.api.payment.constant.PaySysType;
|
||||
import com.tmerclub.cloud.api.payment.vo.ShopAccountDetailVO;
|
||||
import com.tmerclub.cloud.api.platform.feign.ConfigFeignClient;
|
||||
import com.tmerclub.cloud.api.user.bo.BalancePayBO;
|
||||
@ -24,13 +23,15 @@ import com.tmerclub.cloud.user.constant.DistributedIdKey;
|
||||
import com.tmerclub.cloud.user.constant.RechargeIoTypeEnum;
|
||||
import com.tmerclub.cloud.user.constant.RechargeTypeEnum;
|
||||
import com.tmerclub.cloud.user.service.UserBalanceLogService;
|
||||
import com.tmerclub.cloud.user.service.UserExtensionService;
|
||||
import com.tmerclub.cloud.user.service.UserLevelLogService;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 充值信息
|
||||
@ -48,8 +49,6 @@ public class UserBalanceLogFeignController implements UserBalanceLogFeignClient
|
||||
private SegmentManager segmentManager;
|
||||
@DubboReference
|
||||
private ConfigFeignClient configFeignClient;
|
||||
@Autowired
|
||||
private UserExtensionService userExtensionService;
|
||||
|
||||
@Override
|
||||
public ServerResponseEntity<Long> getPayAmount(Long rechargeLogId) {
|
||||
@ -143,23 +142,4 @@ public class UserBalanceLogFeignController implements UserBalanceLogFeignClient
|
||||
return ServerResponseEntity.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServerResponseEntity<Void> sellCueUpdateBalance(Long userId, Long money) {
|
||||
// 修改余额
|
||||
userExtensionService.updateBatchUserBalanceByUserIds(Collections.singletonList(userId), money, DateUtil.date());
|
||||
// 创建日志
|
||||
List<MongoUserBalanceLogBO> userBalanceLogs = new ArrayList<>(Constant.INITIAL_CAPACITY);
|
||||
List<Long> userBalanceLogIds = segmentManager.listSegmentId(DistributedIdKey.tmerclub_USER_BALANCE_LOG, 1);
|
||||
MongoUserBalanceLogBO userBalanceLog = new MongoUserBalanceLogBO();
|
||||
userBalanceLog.setBalanceLogId(userBalanceLogIds.get(0));
|
||||
userBalanceLog.setUserId(userId);
|
||||
userBalanceLog.setChangeBalance(money);
|
||||
userBalanceLog.setPaySysType(PaySysType.DEFAULT.value());
|
||||
userBalanceLog.setIoType(RechargeIoTypeEnum.INCOME.value());
|
||||
userBalanceLog.setType(RechargeTypeEnum.SELL.value());
|
||||
userBalanceLogs.add(userBalanceLog);
|
||||
userBalanceLogService.saveBatchToMongodb(userBalanceLogs);
|
||||
return ServerResponseEntity.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user