球杆
This commit is contained in:
parent
7d65a5d640
commit
ebd00f134e
@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
package com.tmerclub.cloud.api.delivery.feign;
|
package com.tmerclub.cloud.api.delivery.feign;
|
||||||
|
|
||||||
import com.tmerclub.cloud.api.delivery.dto.CalculateAndGetDeliverInfoDTO;
|
import com.tmerclub.cloud.api.delivery.dto.CalculateAndGetDeliverInfoDTO;
|
||||||
import com.tmerclub.cloud.api.delivery.vo.ShopTransportVO;
|
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.TransportVO;
|
||||||
import com.tmerclub.cloud.common.order.vo.UserDeliveryInfoVO;
|
import com.tmerclub.cloud.common.order.vo.UserDeliveryInfoVO;
|
||||||
import com.tmerclub.cloud.common.response.ServerResponseEntity;
|
import com.tmerclub.cloud.common.response.ServerResponseEntity;
|
||||||
@ -17,6 +17,7 @@ public interface DeliveryFeignClient {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 计算运费,并计算获取配送信息
|
* 计算运费,并计算获取配送信息
|
||||||
|
*
|
||||||
* @param param 用户地址和订单信息
|
* @param param 用户地址和订单信息
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
@ -24,6 +25,7 @@ public interface DeliveryFeignClient {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取店铺运费模板列表
|
* 获取店铺运费模板列表
|
||||||
|
*
|
||||||
* @param shopId 店铺id
|
* @param shopId 店铺id
|
||||||
* @return 运费模板列表
|
* @return 运费模板列表
|
||||||
*/
|
*/
|
||||||
@ -31,6 +33,7 @@ public interface DeliveryFeignClient {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id列表获取运费模板
|
* 根据id列表获取运费模板
|
||||||
|
*
|
||||||
* @param transportIds
|
* @param transportIds
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -38,6 +41,7 @@ public interface DeliveryFeignClient {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断用户地址是否包含在配送范围内
|
* 判断用户地址是否包含在配送范围内
|
||||||
|
*
|
||||||
* @param deliveryTemplateId
|
* @param deliveryTemplateId
|
||||||
* @param userId
|
* @param userId
|
||||||
* @param addrId
|
* @param addrId
|
||||||
@ -47,6 +51,7 @@ public interface DeliveryFeignClient {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查配送范围
|
* 检查配送范围
|
||||||
|
*
|
||||||
* @param deliveryTemplateId 运费模板id
|
* @param deliveryTemplateId 运费模板id
|
||||||
* @param addrId 用户地址id
|
* @param addrId 用户地址id
|
||||||
* @return
|
* @return
|
||||||
@ -57,10 +62,17 @@ public interface DeliveryFeignClient {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取商品物流模板
|
* 获取商品物流模板
|
||||||
|
*
|
||||||
* @param deliveryTemplateId
|
* @param deliveryTemplateId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
TransportVO getTransportAndAllItemsById(Long deliveryTemplateId);
|
TransportVO getTransportAndAllItemsById(Long deliveryTemplateId);
|
||||||
|
|
||||||
void curOderReturns();
|
/**
|
||||||
|
* 球杆订单退货
|
||||||
|
*
|
||||||
|
* @param curOderReturnsDTO 订单信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
ServerResponseEntity<String> curOderReturns(CurOderReturnsDTO curOderReturnsDTO);
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
package com.tmerclub.cloud.api.user.feign;
|
package com.tmerclub.cloud.api.user.feign;
|
||||||
|
|
||||||
import com.tmerclub.cloud.api.payment.vo.ShopAccountDetailVO;
|
import com.tmerclub.cloud.api.payment.vo.ShopAccountDetailVO;
|
||||||
@ -11,17 +10,20 @@ import com.tmerclub.cloud.api.user.vo.UserPayInfoVO;
|
|||||||
import com.tmerclub.cloud.common.database.vo.PageVO;
|
import com.tmerclub.cloud.common.database.vo.PageVO;
|
||||||
import com.tmerclub.cloud.common.response.ServerResponseEntity;
|
import com.tmerclub.cloud.common.response.ServerResponseEntity;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 充值信息
|
* 充值信息
|
||||||
|
*
|
||||||
* @author tmerclub
|
* @author tmerclub
|
||||||
*/
|
*/
|
||||||
public interface UserBalanceLogFeignClient {
|
public interface UserBalanceLogFeignClient {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取充值金额
|
* 获取充值金额
|
||||||
|
*
|
||||||
* @param balanceLogId 充值记录id
|
* @param balanceLogId 充值记录id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -29,6 +31,7 @@ public interface UserBalanceLogFeignClient {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取充值记录是否已经支付
|
* 获取充值记录是否已经支付
|
||||||
|
*
|
||||||
* @param balanceLogId 充值记录id
|
* @param balanceLogId 充值记录id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -37,6 +40,7 @@ public interface UserBalanceLogFeignClient {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 余额支付记录
|
* 余额支付记录
|
||||||
|
*
|
||||||
* @param balancePayBO 记录信息
|
* @param balancePayBO 记录信息
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -44,6 +48,7 @@ public interface UserBalanceLogFeignClient {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 余额退款记录 + 执行退款
|
* 余额退款记录 + 执行退款
|
||||||
|
*
|
||||||
* @param balanceRefundBO 记录信息
|
* @param balanceRefundBO 记录信息
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -51,6 +56,7 @@ public interface UserBalanceLogFeignClient {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页获取余额充值财务对账信息
|
* 分页获取余额充值财务对账信息
|
||||||
|
*
|
||||||
* @param financeDetailDTO
|
* @param financeDetailDTO
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -58,6 +64,7 @@ public interface UserBalanceLogFeignClient {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取余额充值财务对账信息
|
* 获取余额充值财务对账信息
|
||||||
|
*
|
||||||
* @param financeDetailDTO
|
* @param financeDetailDTO
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -65,6 +72,7 @@ public interface UserBalanceLogFeignClient {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取平台财务信息
|
* 获取平台财务信息
|
||||||
|
*
|
||||||
* @param startTime
|
* @param startTime
|
||||||
* @param endTime
|
* @param endTime
|
||||||
* @return
|
* @return
|
||||||
@ -74,6 +82,7 @@ public interface UserBalanceLogFeignClient {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户充值,购买会员财务信息
|
* 获取用户充值,购买会员财务信息
|
||||||
|
*
|
||||||
* @param startTime
|
* @param startTime
|
||||||
* @param endTime
|
* @param endTime
|
||||||
* @param financeType
|
* @param financeType
|
||||||
@ -89,6 +98,7 @@ public interface UserBalanceLogFeignClient {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户充值,购买会员财务信息
|
* 获取用户充值,购买会员财务信息
|
||||||
|
*
|
||||||
* @param startTime
|
* @param startTime
|
||||||
* @param endTime
|
* @param endTime
|
||||||
* @param financeType
|
* @param financeType
|
||||||
@ -100,8 +110,18 @@ public interface UserBalanceLogFeignClient {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 扣减用户余额,更新余额支付记录为支付成功
|
* 扣减用户余额,更新余额支付记录为支付成功
|
||||||
|
*
|
||||||
* @param payId
|
* @param payId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
ServerResponseEntity<Void> updateToOrderPaySuccess(Long payId);
|
ServerResponseEntity<Void> updateToOrderPaySuccess(Long payId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出售球杆更新用户余额
|
||||||
|
*
|
||||||
|
* @param userId 用户id
|
||||||
|
* @param money 金额(单位分)
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
ServerResponseEntity<Void> sellCueUpdateBalance(Long userId, Long money);
|
||||||
}
|
}
|
||||||
|
@ -8,17 +8,19 @@ package com.tmerclub.cloud.common.local.constant;
|
|||||||
**/
|
**/
|
||||||
public enum CueOrderStatus {
|
public enum CueOrderStatus {
|
||||||
|
|
||||||
|
|
||||||
PENDING_AUDIT(0, "待审核"),
|
PENDING_AUDIT(0, "待审核"),
|
||||||
AUDIT_PASS(1, "审核通过(待发货)"),
|
AUDIT_PASS(1, "审核通过(待发货)"),
|
||||||
AUDIT_FAIL(2, "审核拒绝"),
|
AUDIT_FAIL(2, "审核拒绝"),
|
||||||
PENDING_DELIVERY(3, "待发货(已发货)"),
|
FINISH_DELIVERY(3, "已发货"),
|
||||||
PENDING_RECEIPT(4, "已收货(评估中)"),
|
FINISH_RECEIPT(4, "已收货(评估中)"),
|
||||||
RECEIPT_EVALUATION(5, "评估失败(退回)"),
|
EVALUATION_SUCCESS(5, "评估成功(给出价格)"),
|
||||||
EVALUATION_SUCCESS(6, "评估成功(给出价格)"),
|
EVALUATION_FAIL(6, "评估失败(退回)"),
|
||||||
EVALUATION_FAIL(7, "价格不满意(退回)"),
|
EVALUATION_FAIL_FILLED_RETURN_ADDRESS(7, "评估失败用户已填写回邮地址"),
|
||||||
EVALUATION_SUCCESS_AND_PAY(8, "价格满意(结束)"),
|
EVALUATION_FAIL_COMPLETED(8, "评估失败(已退回)"),
|
||||||
EVALUATION_FAIL_AND_BACK(9, "价格不满意(已退回)"),
|
EVALUATION_SUCCESS_PAY(9, "价格满意(结束)"),
|
||||||
RECEIPT_EVALUATION_AND_BACK(10, "评估失败(已退回)");
|
EVALUATION_SUCCESS_PRICE_DISCONTENT(10, "价格不满意(已填写回邮地址)"),
|
||||||
|
EVALUATION_SUCCESS_COMPLETED(11, "价格不满意(已完成)");
|
||||||
|
|
||||||
|
|
||||||
private final Integer num;
|
private final Integer num;
|
||||||
|
@ -0,0 +1,34 @@
|
|||||||
|
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;
|
||||||
|
}
|
@ -3,9 +3,11 @@ package com.tmerclub.cloud.cuerecycle.controller.admin;
|
|||||||
import com.tmerclub.cloud.common.database.dto.PageDTO;
|
import com.tmerclub.cloud.common.database.dto.PageDTO;
|
||||||
import com.tmerclub.cloud.common.database.vo.PageVO;
|
import com.tmerclub.cloud.common.database.vo.PageVO;
|
||||||
import com.tmerclub.cloud.common.response.ServerResponseEntity;
|
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.mapper.CueOrderFlawMapper;
|
||||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueOrderDTO;
|
import com.tmerclub.cloud.cuerecycle.model.dto.CueOrderDTO;
|
||||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueOrderFlawDTO;
|
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.CueOrderFlawVO;
|
||||||
import com.tmerclub.cloud.cuerecycle.model.vo.CueOrderVO;
|
import com.tmerclub.cloud.cuerecycle.model.vo.CueOrderVO;
|
||||||
import com.tmerclub.cloud.cuerecycle.service.CueOrderService;
|
import com.tmerclub.cloud.cuerecycle.service.CueOrderService;
|
||||||
@ -31,6 +33,8 @@ public class CueOrderController {
|
|||||||
CueOrderService cueOrderService;
|
CueOrderService cueOrderService;
|
||||||
@Resource
|
@Resource
|
||||||
CueOrderFlawMapper cueOrderFlawMapper;
|
CueOrderFlawMapper cueOrderFlawMapper;
|
||||||
|
@Resource
|
||||||
|
CreateOrderManager createOrderManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询
|
* 分页查询
|
||||||
@ -91,4 +95,16 @@ 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();
|
||||||
|
}
|
||||||
}
|
}
|
@ -3,7 +3,8 @@ package com.tmerclub.cloud.cuerecycle.controller.app;
|
|||||||
import com.tmerclub.cloud.common.response.ServerResponseEntity;
|
import com.tmerclub.cloud.common.response.ServerResponseEntity;
|
||||||
import com.tmerclub.cloud.cuerecycle.manager.CreateOrderManager;
|
import com.tmerclub.cloud.cuerecycle.manager.CreateOrderManager;
|
||||||
import com.tmerclub.cloud.cuerecycle.model.dto.CreateOrderDTO;
|
import com.tmerclub.cloud.cuerecycle.model.dto.CreateOrderDTO;
|
||||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueRefuseOrderDTO;
|
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.dto.CueSaveMailingDTO;
|
||||||
import com.tmerclub.cloud.cuerecycle.model.vo.AppCueOrderVO;
|
import com.tmerclub.cloud.cuerecycle.model.vo.AppCueOrderVO;
|
||||||
import com.tmerclub.cloud.cuerecycle.service.CueOrderService;
|
import com.tmerclub.cloud.cuerecycle.service.CueOrderService;
|
||||||
@ -34,9 +35,9 @@ public class CueOrderController {
|
|||||||
* @param createOrderDTO 创建订单参数
|
* @param createOrderDTO 创建订单参数
|
||||||
* @return ServerResponseEntity<CueOrderVO>
|
* @return ServerResponseEntity<CueOrderVO>
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "创建订单", description = "创建订单")
|
|
||||||
@PostMapping("/createOrder")
|
@PostMapping("/createOrder")
|
||||||
public ServerResponseEntity<Void> createOrder(@Valid @RequestBody CreateOrderDTO createOrderDTO) {
|
@Operation(summary = "创建订单", description = "创建订单")
|
||||||
|
public ServerResponseEntity<Long> createOrder(@Valid @RequestBody CreateOrderDTO createOrderDTO) {
|
||||||
// 防止重复提交 TODO:不清楚为啥不好使
|
// 防止重复提交 TODO:不清楚为啥不好使
|
||||||
// boolean cad = RedisUtil.cad(OrderCacheNames.ORDER_CONFIRM_UUID_KEY + CacheNames.UNION + createOrderDTO.getUserId(), String.valueOf(createOrderDTO.getUserId()));
|
// boolean cad = RedisUtil.cad(OrderCacheNames.ORDER_CONFIRM_UUID_KEY + CacheNames.UNION + createOrderDTO.getUserId(), String.valueOf(createOrderDTO.getUserId()));
|
||||||
// if (!cad) {
|
// if (!cad) {
|
||||||
@ -48,7 +49,7 @@ public class CueOrderController {
|
|||||||
Long flawPrice = createOrderManager.addFlawItem(orderId, createOrderDTO);
|
Long flawPrice = createOrderManager.addFlawItem(orderId, createOrderDTO);
|
||||||
// 向商城order插入信息
|
// 向商城order插入信息
|
||||||
createOrderManager.saveOrderToMall(orderId, createOrderDTO.getProductPrice() - flawPrice, createOrderDTO);
|
createOrderManager.saveOrderToMall(orderId, createOrderDTO.getProductPrice() - flawPrice, createOrderDTO);
|
||||||
return ServerResponseEntity.success();
|
return ServerResponseEntity.success(orderId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -71,28 +72,36 @@ public class CueOrderController {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@PostMapping("/saveMailing")
|
@PostMapping("/saveMailing")
|
||||||
|
@Operation(summary = "邮寄填写订单", description = "邮寄填写订单")
|
||||||
public ServerResponseEntity<Void> saveMailing(@Valid @RequestBody CueSaveMailingDTO cueSaveMailingDTO) {
|
public ServerResponseEntity<Void> saveMailing(@Valid @RequestBody CueSaveMailingDTO cueSaveMailingDTO) {
|
||||||
int update = cueOrderService.saveMailing(cueSaveMailingDTO);
|
int update = cueOrderService.saveMailing(cueSaveMailingDTO);
|
||||||
return update > 0 ? ServerResponseEntity.success() : ServerResponseEntity.showFailMsg("提交失败");
|
return update > 0 ? ServerResponseEntity.success() : ServerResponseEntity.showFailMsg("提交失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 同意回收
|
/**
|
||||||
|
* 同意回收
|
||||||
|
*
|
||||||
|
* @param cueAgreeOrderDTO 同意回收参数
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
@PostMapping("/agreeOrder")
|
@PostMapping("/agreeOrder")
|
||||||
public ServerResponseEntity<Void> agreeOrder(@RequestBody CreateOrderDTO createOrderDTO) {
|
@Operation(summary = "同意回收", description = "同意回收")
|
||||||
createOrderManager.agreeOrder(createOrderDTO);
|
public ServerResponseEntity<Void> agreeOrder(@Valid @RequestBody CueAgreeOrderDTO cueAgreeOrderDTO) {
|
||||||
|
createOrderManager.agreeOrder(cueAgreeOrderDTO);
|
||||||
return ServerResponseEntity.success();
|
return ServerResponseEntity.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拒绝回收
|
* 填写不合格或不满意回邮地址
|
||||||
*
|
*
|
||||||
* @param cueRefuseOrderDTO 拒绝订单入参
|
* @param cueFillAddrDTO 回邮地址入参
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@PostMapping("/refuseOrder")
|
@PostMapping("/fillAddr")
|
||||||
public ServerResponseEntity<Void> refuseOrder(@RequestBody CueRefuseOrderDTO cueRefuseOrderDTO) {
|
@Operation(summary = "填写回邮地址", description = "填写回邮地址")
|
||||||
createOrderManager.refuseOrder(cueRefuseOrderDTO);
|
public ServerResponseEntity<Void> fillAddr(@Valid @RequestBody CueFillAddrDTO cueFillAddrDTO) {
|
||||||
|
createOrderManager.fillAddr(cueFillAddrDTO);
|
||||||
return ServerResponseEntity.success();
|
return ServerResponseEntity.success();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -8,8 +8,10 @@ import com.tmerclub.cloud.api.delivery.feign.DeliveryFeignClient;
|
|||||||
import com.tmerclub.cloud.api.order.feign.OrderAddrFeignClient;
|
import com.tmerclub.cloud.api.order.feign.OrderAddrFeignClient;
|
||||||
import com.tmerclub.cloud.api.order.feign.OrderFeignClient;
|
import com.tmerclub.cloud.api.order.feign.OrderFeignClient;
|
||||||
import com.tmerclub.cloud.api.user.feign.UserAddrFeignClient;
|
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.exception.LuckException;
|
||||||
import com.tmerclub.cloud.common.local.constant.CueOrderStatus;
|
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.local.dto.SaveOrderToMallDTO;
|
||||||
import com.tmerclub.cloud.common.order.vo.OrderAddrVO;
|
import com.tmerclub.cloud.common.order.vo.OrderAddrVO;
|
||||||
import com.tmerclub.cloud.common.order.vo.UserAddrVO;
|
import com.tmerclub.cloud.common.order.vo.UserAddrVO;
|
||||||
@ -18,9 +20,7 @@ import com.tmerclub.cloud.cuerecycle.mapper.CueOrderFlawMapper;
|
|||||||
import com.tmerclub.cloud.cuerecycle.mapper.CueOrderMapper;
|
import com.tmerclub.cloud.cuerecycle.mapper.CueOrderMapper;
|
||||||
import com.tmerclub.cloud.cuerecycle.model.CueOrder;
|
import com.tmerclub.cloud.cuerecycle.model.CueOrder;
|
||||||
import com.tmerclub.cloud.cuerecycle.model.CueOrderFlaw;
|
import com.tmerclub.cloud.cuerecycle.model.CueOrderFlaw;
|
||||||
import com.tmerclub.cloud.cuerecycle.model.dto.CreateOrderDTO;
|
import com.tmerclub.cloud.cuerecycle.model.dto.*;
|
||||||
import com.tmerclub.cloud.cuerecycle.model.dto.CreateOrderFlawDTO;
|
|
||||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueRefuseOrderDTO;
|
|
||||||
import com.tmerclub.cloud.cuerecycle.model.vo.CueOrderVO;
|
import com.tmerclub.cloud.cuerecycle.model.vo.CueOrderVO;
|
||||||
import com.tmerclub.cloud.cuerecycle.service.CueFlawService;
|
import com.tmerclub.cloud.cuerecycle.service.CueFlawService;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
@ -50,13 +50,15 @@ public class CreateOrderManager {
|
|||||||
@DubboReference
|
@DubboReference
|
||||||
CouponFeignClient couponFeignClient;
|
CouponFeignClient couponFeignClient;
|
||||||
@DubboReference
|
@DubboReference
|
||||||
private OrderFeignClient orderFeignClient;
|
|
||||||
@DubboReference
|
|
||||||
DeliveryFeignClient deliveryFeignClient;
|
DeliveryFeignClient deliveryFeignClient;
|
||||||
@DubboReference
|
@DubboReference
|
||||||
UserAddrFeignClient userAddrFeignClient;
|
UserAddrFeignClient userAddrFeignClient;
|
||||||
@DubboReference
|
@DubboReference
|
||||||
OrderAddrFeignClient orderAddrFeignClient;
|
OrderAddrFeignClient orderAddrFeignClient;
|
||||||
|
@DubboReference
|
||||||
|
UserBalanceLogFeignClient userBalanceLogFeignClient;
|
||||||
|
@DubboReference
|
||||||
|
OrderFeignClient orderFeignClient;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存订单信息
|
* 保存订单信息
|
||||||
@ -120,9 +122,9 @@ public class CreateOrderManager {
|
|||||||
orderFeignClient.updateOrderMall(mallOrderId, orderStatus);
|
orderFeignClient.updateOrderMall(mallOrderId, orderStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void agreeOrder(CreateOrderDTO createOrderDTO) {
|
public void agreeOrder(CueAgreeOrderDTO cueAgreeOrderDTO) {
|
||||||
// 查询订单信息
|
// 查询订单信息
|
||||||
CueOrderVO cueOrderVO = cueOrderMapper.getById(createOrderDTO.getOrderId());
|
CueOrderVO cueOrderVO = cueOrderMapper.getById(cueAgreeOrderDTO.getOrderId());
|
||||||
if (ObjectUtil.isNull(cueOrderVO)) {
|
if (ObjectUtil.isNull(cueOrderVO)) {
|
||||||
throw new LuckException("订单不存在,请检查!");
|
throw new LuckException("订单不存在,请检查!");
|
||||||
}
|
}
|
||||||
@ -131,14 +133,14 @@ public class CreateOrderManager {
|
|||||||
throw new LuckException("状态已变更,请检查!");
|
throw new LuckException("状态已变更,请检查!");
|
||||||
}
|
}
|
||||||
CueOrder cueOrder = new CueOrder();
|
CueOrder cueOrder = new CueOrder();
|
||||||
cueOrder.setOrderId(createOrderDTO.getOrderId());
|
cueOrder.setOrderId(cueAgreeOrderDTO.getOrderId());
|
||||||
cueOrder.setOrderType(createOrderDTO.getOrderType());
|
cueOrder.setOrderType(cueAgreeOrderDTO.getOrderType());
|
||||||
cueOrder.setOrderStatus(CueOrderStatus.EVALUATION_SUCCESS_AND_PAY.value());
|
cueOrder.setOrderStatus(CueOrderStatus.EVALUATION_SUCCESS_PAY.value());
|
||||||
cueOrder.setUpdateTime(DateUtil.date());
|
cueOrder.setUpdateTime(DateUtil.date());
|
||||||
cueOrder.setFinallyTime(DateUtil.date());
|
cueOrder.setFinallyTime(DateUtil.date());
|
||||||
cueOrder.setIsPayed(1);
|
cueOrder.setIsPayed(1);
|
||||||
// 根据回收类型进行不同操作
|
// 根据回收类型进行不同操作
|
||||||
switch (createOrderDTO.getOrderType()) {
|
switch (cueAgreeOrderDTO.getOrderType()) {
|
||||||
case 1:
|
case 1:
|
||||||
// 回收
|
// 回收
|
||||||
cueOrder.setPayType(1);
|
cueOrder.setPayType(1);
|
||||||
@ -158,6 +160,7 @@ public class CreateOrderManager {
|
|||||||
switch (cueOrder.getPayType()) {
|
switch (cueOrder.getPayType()) {
|
||||||
case 1:
|
case 1:
|
||||||
// 余额支付 直接向用户账户打款
|
// 余额支付 直接向用户账户打款
|
||||||
|
userBalanceLogFeignClient.sellCueUpdateBalance(cueOrderVO.getUserId(), cueOrderVO.getActualAmount());
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
// 代金卷支付
|
// 代金卷支付
|
||||||
@ -170,24 +173,28 @@ public class CreateOrderManager {
|
|||||||
this.updateOrderMall(cueOrderVO.getMallOrderId(), CueOrderStatus.EVALUATION_FAIL.value());
|
this.updateOrderMall(cueOrderVO.getMallOrderId(), CueOrderStatus.EVALUATION_FAIL.value());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void refuseOrder(CueRefuseOrderDTO cueRefuseOrderDTO) {
|
/**
|
||||||
|
* 填写回邮地址
|
||||||
Long orderId = cueRefuseOrderDTO.getOrderId();
|
*
|
||||||
|
* @param cueFillAddrDTO 订单信息
|
||||||
|
*/
|
||||||
|
public void fillAddr(CueFillAddrDTO cueFillAddrDTO) {
|
||||||
|
Long orderId = cueFillAddrDTO.getOrderId();
|
||||||
// 查询订单信息
|
// 查询订单信息
|
||||||
CueOrderVO cueOrderVO = cueOrderMapper.getById(orderId);
|
CueOrderVO cueOrderVO = cueOrderMapper.getById(orderId);
|
||||||
if (ObjectUtil.isNull(cueOrderVO)) {
|
if (ObjectUtil.isNull(cueOrderVO)) {
|
||||||
throw new LuckException("订单不存在,请检查!");
|
throw new LuckException("订单不存在,请检查!");
|
||||||
}
|
}
|
||||||
// 两种情况会导致退款 5不合格退款 6价格不满意退款
|
// 两种情况会导致退货 5不合格 6价格不满意
|
||||||
// 检查当前状态
|
// 检查当前状态
|
||||||
if (!Objects.equals(cueOrderVO.getOrderStatus(), CueOrderStatus.EVALUATION_SUCCESS.value()) || !Objects.equals(cueOrderVO.getOrderStatus(), CueOrderStatus.RECEIPT_EVALUATION.value())) {
|
if (!Objects.equals(cueOrderVO.getOrderStatus(), CueOrderStatus.EVALUATION_FAIL.value()) || !Objects.equals(cueOrderVO.getOrderStatus(), CueOrderStatus.EVALUATION_SUCCESS.value())) {
|
||||||
throw new LuckException("状态已变更,请检查!");
|
throw new LuckException("状态已变更,请检查!");
|
||||||
}
|
}
|
||||||
|
|
||||||
CueOrder cueOrder = new CueOrder();
|
CueOrder cueOrder = new CueOrder();
|
||||||
cueOrder.setOrderId(orderId);
|
cueOrder.setOrderId(orderId);
|
||||||
// 需要向order_addr插入一条数据
|
// 需要向order_addr插入一条数据
|
||||||
ServerResponseEntity<UserAddrVO> userAddrVO = userAddrFeignClient.cueGetUserAddrByAddrId(cueRefuseOrderDTO.getAddrId(), cueOrderVO.getUserId());
|
ServerResponseEntity<UserAddrVO> userAddrVO = userAddrFeignClient.cueGetUserAddrByAddrId(cueFillAddrDTO.getAddrId(), cueOrderVO.getUserId());
|
||||||
if (userAddrVO.isSuccess()) {
|
if (userAddrVO.isSuccess()) {
|
||||||
// 将地址信息插入到order_addr中
|
// 将地址信息插入到order_addr中
|
||||||
OrderAddrVO orderAddrVO = BeanUtil.toBean(userAddrVO, OrderAddrVO.class);
|
OrderAddrVO orderAddrVO = BeanUtil.toBean(userAddrVO, OrderAddrVO.class);
|
||||||
@ -198,13 +205,49 @@ public class CreateOrderManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Objects.equals(cueOrderVO.getOrderStatus(), CueOrderStatus.EVALUATION_SUCCESS.value())) {
|
if (Objects.equals(cueOrderVO.getOrderStatus(), CueOrderStatus.EVALUATION_SUCCESS.value())) {
|
||||||
cueOrder.setOrderStatus(CueOrderStatus.EVALUATION_FAIL.value());
|
cueOrder.setOrderStatus(CueOrderStatus.EVALUATION_SUCCESS_PRICE_DISCONTENT.value());
|
||||||
} else {
|
} else {
|
||||||
cueOrder.setOrderStatus(CueOrderStatus.EVALUATION_FAIL.value());
|
cueOrder.setOrderStatus(CueOrderStatus.EVALUATION_SUCCESS_COMPLETED.value());
|
||||||
}
|
}
|
||||||
|
|
||||||
cueOrder.setUpdateTime(DateUtil.date());
|
cueOrder.setUpdateTime(DateUtil.date());
|
||||||
cueOrderMapper.update(cueOrder);
|
cueOrderMapper.update(cueOrder);
|
||||||
this.updateOrderMall(cueOrderVO.getMallOrderId(), CueOrderStatus.EVALUATION_FAIL.value());
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -144,4 +144,8 @@ public class CueOrder extends BaseModel implements Serializable {
|
|||||||
* 用户退货打印机id
|
* 用户退货打印机id
|
||||||
*/
|
*/
|
||||||
private Long printerId;
|
private Long printerId;
|
||||||
|
/**
|
||||||
|
* 退货物流单号
|
||||||
|
*/
|
||||||
|
private String backTrackingNumber;
|
||||||
}
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
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,5 +1,6 @@
|
|||||||
package com.tmerclub.cloud.cuerecycle.model.dto;
|
package com.tmerclub.cloud.cuerecycle.model.dto;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
@ -12,13 +13,17 @@ import java.io.Serializable;
|
|||||||
* @create: 2025-04-18
|
* @create: 2025-04-18
|
||||||
**/
|
**/
|
||||||
@Data
|
@Data
|
||||||
public class CueRefuseOrderDTO implements Serializable {
|
public class CueFillAddrDTO implements Serializable {
|
||||||
@Serial
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
/**
|
/**
|
||||||
* 订单ID
|
* 订单ID
|
||||||
*/
|
*/
|
||||||
|
@NotNull(message = "订单ID不能为空")
|
||||||
private Long orderId;
|
private Long orderId;
|
||||||
|
/**
|
||||||
|
* 地址ID
|
||||||
|
*/
|
||||||
|
@NotNull(message = "地址ID不能为空")
|
||||||
private Long addrId;
|
private Long addrId;
|
||||||
}
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
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;
|
||||||
|
}
|
@ -137,4 +137,9 @@ public class CueOrderVO extends BaseVO implements Serializable {
|
|||||||
* 寄出单号
|
* 寄出单号
|
||||||
*/
|
*/
|
||||||
private String sendNumber;
|
private String sendNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户退款地址id
|
||||||
|
*/
|
||||||
|
private Long orderAddrId;
|
||||||
}
|
}
|
@ -134,10 +134,10 @@ public class CueOrderServiceImpl implements CueOrderService {
|
|||||||
@Override
|
@Override
|
||||||
public int saveMailing(CueSaveMailingDTO cueSaveMailingDTO) {
|
public int saveMailing(CueSaveMailingDTO cueSaveMailingDTO) {
|
||||||
// 修改系统订单的状态
|
// 修改系统订单的状态
|
||||||
createOrderManager.updateOrderMall(cueSaveMailingDTO.getMallOrderId(), CueOrderStatus.PENDING_DELIVERY.value());
|
createOrderManager.updateOrderMall(cueSaveMailingDTO.getMallOrderId(), CueOrderStatus.FINISH_DELIVERY.value());
|
||||||
// 修改回收单状态
|
// 修改回收单状态
|
||||||
CueOrder cueOrder = BeanUtil.toBean(cueSaveMailingDTO, CueOrder.class);
|
CueOrder cueOrder = BeanUtil.toBean(cueSaveMailingDTO, CueOrder.class);
|
||||||
cueOrder.setOrderStatus(CueOrderStatus.PENDING_DELIVERY.value());
|
cueOrder.setOrderStatus(CueOrderStatus.FINISH_DELIVERY.value());
|
||||||
cueOrder.setDeliveryTime(DateUtil.date());
|
cueOrder.setDeliveryTime(DateUtil.date());
|
||||||
return cueOrderMapper.update(cueOrder);
|
return cueOrderMapper.update(cueOrder);
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
<sql id="Vo_Column_List">
|
<sql id="Vo_Column_List">
|
||||||
order_id,product_id,product_name,product_images,product_price,user_id,user_name,user_phone,order_type,
|
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,
|
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
|
create_time,update_time,is_payed,pay_type,pay_time,delivery_time,finally_time,mall_order_id,send_number,order_addr_id
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="list" resultMap="cueOrderVOMap">
|
<select id="list" resultMap="cueOrderVOMap">
|
||||||
@ -205,6 +205,9 @@
|
|||||||
<if test="printerId != null">
|
<if test="printerId != null">
|
||||||
printer_id = #{printerId},
|
printer_id = #{printerId},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="backTrackingNumber != null and backTrackingNumber != ''">
|
||||||
|
back_tracking_number = #{backTrackingNumber},
|
||||||
|
</if>
|
||||||
</set>
|
</set>
|
||||||
where
|
where
|
||||||
order_id = #{orderId}
|
order_id = #{orderId}
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
package com.tmerclub.cloud.delivery.feign;
|
package com.tmerclub.cloud.delivery.feign;
|
||||||
|
|
||||||
import com.tmerclub.cloud.api.delivery.dto.CalculateAndGetDeliverInfoDTO;
|
import com.tmerclub.cloud.api.delivery.dto.CalculateAndGetDeliverInfoDTO;
|
||||||
@ -8,6 +7,7 @@ import com.tmerclub.cloud.api.delivery.feign.DeliveryFeignClient;
|
|||||||
import com.tmerclub.cloud.api.delivery.vo.ShopTransportVO;
|
import com.tmerclub.cloud.api.delivery.vo.ShopTransportVO;
|
||||||
import com.tmerclub.cloud.api.user.feign.UserAddrFeignClient;
|
import com.tmerclub.cloud.api.user.feign.UserAddrFeignClient;
|
||||||
import com.tmerclub.cloud.common.constant.Constant;
|
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.order.vo.*;
|
||||||
import com.tmerclub.cloud.common.response.ServerResponseEntity;
|
import com.tmerclub.cloud.common.response.ServerResponseEntity;
|
||||||
import com.tmerclub.cloud.common.util.BeanUtil;
|
import com.tmerclub.cloud.common.util.BeanUtil;
|
||||||
@ -15,6 +15,8 @@ import com.tmerclub.cloud.delivery.manager.DeliveryManager;
|
|||||||
import com.tmerclub.cloud.delivery.manager.DeliveryPrintManager;
|
import com.tmerclub.cloud.delivery.manager.DeliveryPrintManager;
|
||||||
import com.tmerclub.cloud.delivery.service.DeliveryOrderService;
|
import com.tmerclub.cloud.delivery.service.DeliveryOrderService;
|
||||||
import com.tmerclub.cloud.delivery.service.TransportService;
|
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.DubboReference;
|
||||||
import org.apache.dubbo.config.annotation.DubboService;
|
import org.apache.dubbo.config.annotation.DubboService;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@ -33,24 +35,19 @@ import java.util.stream.Collectors;
|
|||||||
@DubboService
|
@DubboService
|
||||||
public class DeliveryFeignController implements DeliveryFeignClient {
|
public class DeliveryFeignController implements DeliveryFeignClient {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(DeliveryFeignController.class);
|
private static final Logger logger = LoggerFactory.getLogger(DeliveryFeignController.class);
|
||||||
|
private static final long TWO = -2;
|
||||||
|
@Autowired
|
||||||
|
DeliveryPrintManager deliveryPrintManager;
|
||||||
@DubboReference
|
@DubboReference
|
||||||
private UserAddrFeignClient userAddrFeignClient;
|
private UserAddrFeignClient userAddrFeignClient;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private TransportService transportService;
|
private TransportService transportService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private DeliveryOrderService deliveryOrderService;
|
private DeliveryOrderService deliveryOrderService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private DeliveryManager deliveryManager;
|
private DeliveryManager deliveryManager;
|
||||||
@Autowired
|
@Autowired
|
||||||
DeliveryPrintManager deliveryPrintManager;
|
private OrderAddrService orderAddrService;
|
||||||
|
|
||||||
private static final long TWO = -2;
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ServerResponseEntity<UserDeliveryInfoVO> calculateAndGetDeliverInfo(CalculateAndGetDeliverInfoDTO param) {
|
public ServerResponseEntity<UserDeliveryInfoVO> calculateAndGetDeliverInfo(CalculateAndGetDeliverInfoDTO param) {
|
||||||
@ -131,18 +128,22 @@ public class DeliveryFeignController implements DeliveryFeignClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void curOderReturns() {
|
public ServerResponseEntity<String> curOderReturns(CurOderReturnsDTO curOderReturnsDTO) {
|
||||||
DeliveryOrderDTO deliveryOrderDTO = new DeliveryOrderDTO();
|
DeliveryOrderDTO deliveryOrderDTO = new DeliveryOrderDTO();
|
||||||
// 网点id
|
// 网点id
|
||||||
deliveryOrderDTO.setOutletConfigId(1L);
|
deliveryOrderDTO.setOutletConfigId(curOderReturnsDTO.getOutletConfigId());
|
||||||
// 打印机id
|
// 打印机id
|
||||||
deliveryOrderDTO.setPrinterId(1L);
|
deliveryOrderDTO.setPrinterId(curOderReturnsDTO.getPrinterId());
|
||||||
|
|
||||||
|
// 根据订单地址id查询详情
|
||||||
|
OrderAddr orderAddr = orderAddrService.getById(curOderReturnsDTO.getOrderAddrId());
|
||||||
|
|
||||||
// 收件人姓名
|
// 收件人姓名
|
||||||
deliveryOrderDTO.setConsignee("张三");
|
deliveryOrderDTO.setConsignee(orderAddr.getConsignee());
|
||||||
// 收件人手机号
|
// 收件人手机号
|
||||||
deliveryOrderDTO.setMobile("13144611867");
|
deliveryOrderDTO.setMobile(orderAddr.getMobile());
|
||||||
// 订单地址id
|
// 订单地址id
|
||||||
deliveryOrderDTO.setOrderAddrId(2504170000012003L);//-;
|
deliveryOrderDTO.setOrderAddrId(curOderReturnsDTO.getOrderAddrId());
|
||||||
// 物流订单项
|
// 物流订单项
|
||||||
List<DeliveryOrderItemDTO> deliveryOrderItemDTOList = new ArrayList<>();
|
List<DeliveryOrderItemDTO> deliveryOrderItemDTOList = new ArrayList<>();
|
||||||
DeliveryOrderItemDTO deliveryOrderItemDTO = new DeliveryOrderItemDTO();
|
DeliveryOrderItemDTO deliveryOrderItemDTO = new DeliveryOrderItemDTO();
|
||||||
@ -151,7 +152,8 @@ public class DeliveryFeignController implements DeliveryFeignClient {
|
|||||||
deliveryOrderDTO.setSelectOrderItems(deliveryOrderItemDTOList);
|
deliveryOrderDTO.setSelectOrderItems(deliveryOrderItemDTOList);
|
||||||
deliveryOrderDTO.setOrderId(1L);
|
deliveryOrderDTO.setOrderId(1L);
|
||||||
|
|
||||||
String kuaidinum = deliveryPrintManager.deliveryPrint(deliveryOrderDTO, 1, 2);
|
String trackingNumber = deliveryPrintManager.deliveryPrint(deliveryOrderDTO, 1, 2);
|
||||||
|
return ServerResponseEntity.success(trackingNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,12 @@ public enum RechargeTypeEnum {
|
|||||||
/**
|
/**
|
||||||
* 提现
|
* 提现
|
||||||
*/
|
*/
|
||||||
WITHDRAW(7);
|
WITHDRAW(7),
|
||||||
|
/**
|
||||||
|
* 出售球杆
|
||||||
|
*/
|
||||||
|
SELL(8),
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
private final Integer num;
|
private final Integer num;
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
|
|
||||||
package com.tmerclub.cloud.user.feign;
|
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.order.constant.FinanceType;
|
||||||
|
import com.tmerclub.cloud.api.payment.constant.PaySysType;
|
||||||
import com.tmerclub.cloud.api.payment.vo.ShopAccountDetailVO;
|
import com.tmerclub.cloud.api.payment.vo.ShopAccountDetailVO;
|
||||||
import com.tmerclub.cloud.api.platform.feign.ConfigFeignClient;
|
import com.tmerclub.cloud.api.platform.feign.ConfigFeignClient;
|
||||||
import com.tmerclub.cloud.api.user.bo.BalancePayBO;
|
import com.tmerclub.cloud.api.user.bo.BalancePayBO;
|
||||||
@ -23,15 +24,13 @@ import com.tmerclub.cloud.user.constant.DistributedIdKey;
|
|||||||
import com.tmerclub.cloud.user.constant.RechargeIoTypeEnum;
|
import com.tmerclub.cloud.user.constant.RechargeIoTypeEnum;
|
||||||
import com.tmerclub.cloud.user.constant.RechargeTypeEnum;
|
import com.tmerclub.cloud.user.constant.RechargeTypeEnum;
|
||||||
import com.tmerclub.cloud.user.service.UserBalanceLogService;
|
import com.tmerclub.cloud.user.service.UserBalanceLogService;
|
||||||
|
import com.tmerclub.cloud.user.service.UserExtensionService;
|
||||||
import com.tmerclub.cloud.user.service.UserLevelLogService;
|
import com.tmerclub.cloud.user.service.UserLevelLogService;
|
||||||
import org.apache.dubbo.config.annotation.DubboReference;
|
import org.apache.dubbo.config.annotation.DubboReference;
|
||||||
import org.apache.dubbo.config.annotation.DubboService;
|
import org.apache.dubbo.config.annotation.DubboService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 充值信息
|
* 充值信息
|
||||||
@ -49,6 +48,8 @@ public class UserBalanceLogFeignController implements UserBalanceLogFeignClient
|
|||||||
private SegmentManager segmentManager;
|
private SegmentManager segmentManager;
|
||||||
@DubboReference
|
@DubboReference
|
||||||
private ConfigFeignClient configFeignClient;
|
private ConfigFeignClient configFeignClient;
|
||||||
|
@Autowired
|
||||||
|
private UserExtensionService userExtensionService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ServerResponseEntity<Long> getPayAmount(Long rechargeLogId) {
|
public ServerResponseEntity<Long> getPayAmount(Long rechargeLogId) {
|
||||||
@ -142,4 +143,23 @@ public class UserBalanceLogFeignController implements UserBalanceLogFeignClient
|
|||||||
return ServerResponseEntity.success();
|
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