回收订单
This commit is contained in:
parent
fa547223a4
commit
66337d1bcf
@ -23,6 +23,11 @@
|
||||
<artifactId>tmerclub-common-cache</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.moyuer.cloud</groupId>
|
||||
<artifactId>tmerclub-common-loacl</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.moyuer.cloud</groupId>
|
||||
<artifactId>tmerclub-api-product</artifactId>
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
package com.tmerclub.cloud.api.order.feign;
|
||||
|
||||
import com.tmerclub.cloud.api.multishop.bo.OrderChangeShopWalletAmountBO;
|
||||
@ -12,6 +11,7 @@ import com.tmerclub.cloud.api.user.bo.UserOrderStatisticBO;
|
||||
import com.tmerclub.cloud.api.user.bo.UserOrderStatisticListBO;
|
||||
import com.tmerclub.cloud.api.user.dto.MemberReqDTO;
|
||||
import com.tmerclub.cloud.common.exception.LuckException;
|
||||
import com.tmerclub.cloud.common.local.dto.SaveOrderToMallDTO;
|
||||
import com.tmerclub.cloud.common.order.bo.EsOrderBO;
|
||||
import com.tmerclub.cloud.common.order.bo.OrderIdWithRefundIdBO;
|
||||
import com.tmerclub.cloud.common.order.bo.OrderStatusBO;
|
||||
@ -85,6 +85,7 @@ public interface OrderFeignClient {
|
||||
|
||||
/**
|
||||
* 会员管理部分获取用户相关的订单统计数据
|
||||
*
|
||||
* @param queryOrderDTO
|
||||
* @return 相关用户的订单中的信息
|
||||
*/
|
||||
@ -334,7 +335,7 @@ public interface OrderFeignClient {
|
||||
/**
|
||||
* 获取活动销售的商品数量
|
||||
*
|
||||
* @param orderIds 订单id列表
|
||||
* @param orderIds 订单id列表
|
||||
* @param activityType
|
||||
* @return
|
||||
*/
|
||||
@ -511,6 +512,7 @@ public interface OrderFeignClient {
|
||||
|
||||
/**
|
||||
* 获取待采购订单和支付定金未支付尾款的订单Ids
|
||||
*
|
||||
* @param paySysType 支付类型
|
||||
* @return
|
||||
*/
|
||||
@ -518,13 +520,16 @@ public interface OrderFeignClient {
|
||||
|
||||
/**
|
||||
* 建议订单搜索数据
|
||||
*
|
||||
* @param orderSearchDTO
|
||||
* @return
|
||||
*/
|
||||
ServerResponseEntity<OrderSearchDTO> checkOrderSearchInfo(OrderSearchDTO orderSearchDTO);
|
||||
|
||||
/**
|
||||
* 批量获取指定的订单列表(数据必须在同一个表中)
|
||||
* 注意: 使用该接口时,请确认订单都是属于同一个用户或者订单在同一表中, 如果涉及多个表的数据,请使用es查询
|
||||
*
|
||||
* @param orderIds
|
||||
* @return
|
||||
*/
|
||||
@ -533,8 +538,14 @@ public interface OrderFeignClient {
|
||||
|
||||
/**
|
||||
* 获取订单商品流量统计数据
|
||||
*
|
||||
* @param flowOrderItemDTO 查询参数
|
||||
* @return 订单商品流量统计数据
|
||||
*/
|
||||
List<FlowOrderItemVO> listFlowOrderItems(FlowOrderItemDTO flowOrderItemDTO);
|
||||
|
||||
/**
|
||||
* 向商城订单写入球杆回收订单
|
||||
*/
|
||||
Long saveOrderToMall(SaveOrderToMallDTO saveOrderToMallDTO);
|
||||
}
|
||||
|
@ -0,0 +1,35 @@
|
||||
package com.tmerclub.cloud.common.local.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 向商城订单插入回收订单业务对象
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-15
|
||||
**/
|
||||
@Data
|
||||
public class SaveOrderToMallDTO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
/**
|
||||
* 预计金额
|
||||
*/
|
||||
private Long estimatedAmount;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String productName;
|
||||
/**
|
||||
* 商品图片
|
||||
*/
|
||||
private String productImages;
|
||||
}
|
@ -24,7 +24,12 @@ public enum OrderType {
|
||||
/**
|
||||
* 积分订单
|
||||
*/
|
||||
SCORE(3);
|
||||
SCORE(3),
|
||||
/**
|
||||
* 回收订单
|
||||
*/
|
||||
RECYCLE(4);
|
||||
|
||||
|
||||
private final Integer num;
|
||||
|
||||
|
@ -29,6 +29,11 @@
|
||||
<artifactId>tmerclub-common-security</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.moyuer.cloud</groupId>
|
||||
<artifactId>tmerclub-common-loacl</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.moyuer.cloud</groupId>
|
||||
<artifactId>tmerclub-common-leaf</artifactId>
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
@ -1,10 +1,13 @@
|
||||
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.mapper.CueOrderFlawMapper;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueOrderDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueOrderFlawDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.CueOrderFlawVO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.CueOrderVO;
|
||||
import com.tmerclub.cloud.common.database.dto.PageDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.service.CueOrderService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@ -12,6 +15,8 @@ import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 回收订单
|
||||
*
|
||||
@ -24,14 +29,16 @@ import org.springframework.web.bind.annotation.*;
|
||||
public class CueOrderController {
|
||||
@Resource
|
||||
CueOrderService cueOrderService;
|
||||
@Resource
|
||||
CueOrderFlawMapper cueOrderFlawMapper;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param pageDTO 分页参数
|
||||
* @param cueOrderDTO 查询参数
|
||||
* @return 分页数据
|
||||
*/
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param pageDTO 分页参数
|
||||
* @param cueOrderDTO 查询参数
|
||||
* @return 分页数据
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "查询回收订单分页列表", description = "查询回收订单分页列表")
|
||||
public ServerResponseEntity<PageVO<CueOrderVO>> page(@Valid PageDTO pageDTO, CueOrderDTO cueOrderDTO) {
|
||||
@ -39,56 +46,49 @@ public class CueOrderController {
|
||||
return ServerResponseEntity.success(cueOrderPage);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键id获取回收订单
|
||||
*
|
||||
* @param id 主键id
|
||||
* @param orderId 主键id
|
||||
* @return CueOrderVO
|
||||
*/
|
||||
@GetMapping
|
||||
@Operation(summary = "根据id获取回收订单", description = "根据id获取回收订单")
|
||||
public ServerResponseEntity<CueOrderVO> getById(@RequestParam Long id) {
|
||||
CueOrderVO cueOrder = cueOrderService.getById(id);
|
||||
public ServerResponseEntity<CueOrderVO> getById(@RequestParam Long orderId) {
|
||||
CueOrderVO cueOrder = cueOrderService.getById(orderId);
|
||||
// 查询瑕疵项目
|
||||
CueOrderFlawDTO cueOrderFlawDTO = new CueOrderFlawDTO();
|
||||
cueOrderFlawDTO.setOrderId(orderId);
|
||||
List<CueOrderFlawVO> list = cueOrderFlawMapper.list(cueOrderFlawDTO);
|
||||
cueOrder.setFlawList(list);
|
||||
return ServerResponseEntity.success(cueOrder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增回收订单
|
||||
* 修改审核状态(审核通过,审核拒绝)
|
||||
*
|
||||
* @param cueOrderDTO CueOrderDTO
|
||||
* @return ServerResponseEntity
|
||||
* @param cueOrderDTO 回收订单
|
||||
* @return Void
|
||||
*/
|
||||
@PostMapping
|
||||
@Operation(summary = "新增回收订单", description = "新增回收订单")
|
||||
public ServerResponseEntity<Void> save(@Valid @RequestBody CueOrderDTO cueOrderDTO) {
|
||||
int insert = cueOrderService.save(cueOrderDTO);
|
||||
return insert > 0 ? ServerResponseEntity.success() : ServerResponseEntity.showFailMsg("保存失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改回收订单
|
||||
*
|
||||
* @param cueOrderDTO CueOrderDTO
|
||||
* @return ServerResponseEntity
|
||||
*/
|
||||
@PutMapping
|
||||
@Operation(summary = "修改回收订单", description = "修改回收订单")
|
||||
public ServerResponseEntity<Void> update(@Valid @RequestBody CueOrderDTO cueOrderDTO) {
|
||||
int update = cueOrderService.update(cueOrderDTO);
|
||||
@PutMapping("/updateAuditStatus")
|
||||
@Operation(summary = "修改审核状态(审核通过,审核拒绝)", description = "修改审核状态(审核通过,审核拒绝)")
|
||||
public ServerResponseEntity<Void> updateAuditStatus(@Valid @RequestBody CueOrderDTO cueOrderDTO) {
|
||||
int update = cueOrderService.updateAuditStatus(cueOrderDTO);
|
||||
return update > 0 ? ServerResponseEntity.success() : ServerResponseEntity.showFailMsg("修改失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除回收订单
|
||||
* 修改评估状态(评估通过,评估拒绝)
|
||||
*
|
||||
* @param id 主键id
|
||||
* @return ServerResponseEntity
|
||||
* @param cueOrderDTO 回收订单
|
||||
* @return Void
|
||||
*/
|
||||
@DeleteMapping
|
||||
@Operation(summary = "删除回收订单", description = "删除回收订单")
|
||||
public ServerResponseEntity<Void> delete(@RequestParam Long id) {
|
||||
int delete = cueOrderService.delete(id);
|
||||
return delete > 0 ? ServerResponseEntity.success() : ServerResponseEntity.showFailMsg("删除失败");
|
||||
@PutMapping("/updateEvaluateStatus")
|
||||
@Operation(summary = "修改评估状态(评估通过,评估拒绝)", description = "修改评估状态(评估通过,评估拒绝)")
|
||||
public ServerResponseEntity<Void> updateEvaluateStatus(@Valid @RequestBody CueOrderDTO cueOrderDTO) {
|
||||
int update = cueOrderService.updateEvaluateStatus(cueOrderDTO);
|
||||
return update > 0 ? ServerResponseEntity.success() : ServerResponseEntity.showFailMsg("修改失败");
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
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.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.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 回收订单
|
||||
*
|
||||
* @author : frank
|
||||
* @create : 2025-04-15
|
||||
*/
|
||||
@Tag(name = "App-回收订单")
|
||||
@RestController("appCueOrderController")
|
||||
@RequestMapping("/app/cueOrder")
|
||||
public class CueOrderController {
|
||||
@Resource
|
||||
CueOrderService cueOrderService;
|
||||
@Resource
|
||||
CreateOrderManager createOrderManager;
|
||||
|
||||
/**
|
||||
* 创建订单
|
||||
*
|
||||
* @param createOrderDTO 创建订单参数
|
||||
* @return ServerResponseEntity<CueOrderVO>
|
||||
*/
|
||||
@Operation(summary = "创建订单", description = "创建订单")
|
||||
@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) {
|
||||
// return ServerResponseEntity.fail(ResponseEnum.REPEAT_ORDER);
|
||||
// }
|
||||
// 保存订单信息
|
||||
Long orderId = createOrderManager.saveOrder(createOrderDTO);
|
||||
// 插入瑕疵信息
|
||||
Long flawPrice = createOrderManager.addFlawItem(orderId, createOrderDTO);
|
||||
// 向商城order插入信息
|
||||
createOrderManager.saveOrderToMall(orderId, createOrderDTO.getProductPrice() - flawPrice, createOrderDTO);
|
||||
return ServerResponseEntity.success();
|
||||
}
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
package com.tmerclub.cloud.cuerecycle.manager;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.tmerclub.cloud.api.order.feign.OrderFeignClient;
|
||||
import com.tmerclub.cloud.common.local.dto.SaveOrderToMallDTO;
|
||||
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.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;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 确认订单管理器
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-15
|
||||
**/
|
||||
@Component
|
||||
public class CreateOrderManager {
|
||||
private final Logger log = LoggerFactory.getLogger(CreateOrderManager.class);
|
||||
|
||||
@Resource
|
||||
CueFlawService cueFlawService;
|
||||
@Resource
|
||||
CueOrderMapper cueOrderMapper;
|
||||
@Resource
|
||||
CueOrderFlawMapper cueOrderFlawMapper;
|
||||
@DubboReference
|
||||
private OrderFeignClient orderFeignClient;
|
||||
|
||||
/**
|
||||
* 保存订单信息
|
||||
*
|
||||
* @param createOrderDTO 订单信息
|
||||
* @return 订单id
|
||||
*/
|
||||
public Long saveOrder(CreateOrderDTO createOrderDTO) {
|
||||
// 保存订单信息
|
||||
CueOrder cueOrder = BeanUtil.toBean(createOrderDTO, CueOrder.class);
|
||||
cueOrder.setOrderStatus(CueOrderStatus.PENDING_AUDIT.value());
|
||||
cueOrder.setCreateTime(DateUtil.date());
|
||||
cueOrderMapper.save(cueOrder);
|
||||
return cueOrder.getOrderId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加瑕疵项
|
||||
*
|
||||
* @param createOrderDTO 订单信息
|
||||
*/
|
||||
public Long addFlawItem(Long orderId, CreateOrderDTO createOrderDTO) {
|
||||
// 循环插入瑕疵信息并累计选择金额
|
||||
Long flawPrice = 0L;
|
||||
for (CreateOrderFlawDTO createOrderFlawDTO : createOrderDTO.getFlawList()) {
|
||||
if (createOrderFlawDTO.getIsFlaw() == 1) {
|
||||
// 累加瑕疵金额
|
||||
flawPrice += createOrderFlawDTO.getFlawPrice();
|
||||
}
|
||||
CueOrderFlaw cueOrderFlaw = BeanUtil.toBean(createOrderFlawDTO, CueOrderFlaw.class);
|
||||
cueOrderFlaw.setOrderId(orderId);
|
||||
cueOrderFlawMapper.save(cueOrderFlaw);
|
||||
}
|
||||
return flawPrice;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存订单到mallOrder
|
||||
*/
|
||||
public void saveOrderToMall(Long orderId, Long estimatedAmount, CreateOrderDTO createOrderDTO) {
|
||||
SaveOrderToMallDTO saveOrderToMallDTO = new SaveOrderToMallDTO();
|
||||
saveOrderToMallDTO.setUserId(createOrderDTO.getUserId());
|
||||
saveOrderToMallDTO.setEstimatedAmount(estimatedAmount);
|
||||
saveOrderToMallDTO.setProductName(createOrderDTO.getProductName());
|
||||
saveOrderToMallDTO.setProductImages(createOrderDTO.getProductImages());
|
||||
Long mallOrderId = orderFeignClient.saveOrderToMall(saveOrderToMallDTO);
|
||||
CueOrder cueOrder = new CueOrder();
|
||||
cueOrder.setOrderId(orderId);
|
||||
cueOrder.setMallOrderId(mallOrderId);
|
||||
cueOrder.setEstimatedAmount(estimatedAmount);
|
||||
cueOrderMapper.update(cueOrder);
|
||||
}
|
||||
}
|
@ -26,10 +26,10 @@ public interface CueOrderMapper{
|
||||
/**
|
||||
* 获取回收订单详情
|
||||
*
|
||||
* @param id 主键
|
||||
* @param orderId 主键
|
||||
* @return 回收订单详情
|
||||
*/
|
||||
CueOrderVO getById(Long id);
|
||||
CueOrderVO getById(Long orderId);
|
||||
|
||||
/**
|
||||
* 新增回收订单
|
||||
|
@ -24,6 +24,18 @@ public class CueOrder extends BaseModel implements Serializable {
|
||||
* 主键ID
|
||||
*/
|
||||
private Long orderId;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String productName;
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
private Long productPrice;
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@ -93,4 +105,8 @@ public class CueOrder extends BaseModel implements Serializable {
|
||||
*/
|
||||
private Date finallyTime;
|
||||
|
||||
/**
|
||||
* 商城订单id
|
||||
*/
|
||||
private Long mallOrderId;
|
||||
}
|
@ -9,39 +9,39 @@ import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 球杆商品瑕疵项对象
|
||||
*
|
||||
*
|
||||
* @author : frank
|
||||
* @create : 2025-04-15
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CueOrderFlaw extends BaseModel implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
private Long orderFlawId;
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
private Long orderId;
|
||||
/**
|
||||
* 瑕疵ID
|
||||
*/
|
||||
private Long flawId;
|
||||
/**
|
||||
* 瑕疵名称
|
||||
*/
|
||||
private String flawName;
|
||||
/**
|
||||
* 是否瑕疵
|
||||
*/
|
||||
private Integer isFlaw;
|
||||
/**
|
||||
* 影响价格
|
||||
*/
|
||||
private Long flawPrice;
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
private Long orderFlawId;
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
private Long orderId;
|
||||
/**
|
||||
* 瑕疵ID
|
||||
*/
|
||||
private Long flawId;
|
||||
/**
|
||||
* 瑕疵名称
|
||||
*/
|
||||
private String flawName;
|
||||
/**
|
||||
* 是否瑕疵
|
||||
*/
|
||||
private Integer isFlaw;
|
||||
/**
|
||||
* 影响价格
|
||||
*/
|
||||
private Long flawPrice;
|
||||
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package com.tmerclub.cloud.cuerecycle.model.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 创建订单业务对象
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-15
|
||||
**/
|
||||
@Data
|
||||
public class CreateOrderDTO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String productName;
|
||||
/**
|
||||
* 商品图片
|
||||
*/
|
||||
private String productImages;
|
||||
/**
|
||||
* 商品价格
|
||||
*/
|
||||
private Long productPrice;
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
/**
|
||||
* 类型:1-回收,2-置换,3-寄售
|
||||
*/
|
||||
private Integer orderType;
|
||||
/**
|
||||
* 瑕疵图片,逗号隔开
|
||||
*/
|
||||
private String flawImgUrl;
|
||||
/**
|
||||
* 付款凭证
|
||||
*/
|
||||
private String evidenceOfPayment;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String orderRemark;
|
||||
/**
|
||||
* 瑕疵列表
|
||||
*/
|
||||
private List<CreateOrderFlawDTO> flawList;
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.tmerclub.cloud.cuerecycle.model.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 创建订单瑕疵项业务对象
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-15
|
||||
**/
|
||||
@Data
|
||||
public class CreateOrderFlawDTO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 瑕疵ID
|
||||
*/
|
||||
private Long flawId;
|
||||
/**
|
||||
* 瑕疵名称
|
||||
*/
|
||||
private String flawName;
|
||||
/**
|
||||
* 是否瑕疵 0-否 1-是
|
||||
*/
|
||||
private Integer isFlaw;
|
||||
/**
|
||||
* 影响价格
|
||||
*/
|
||||
private Long flawPrice;
|
||||
}
|
@ -33,7 +33,7 @@ public class CueOrderFlawDTO implements Serializable {
|
||||
*/
|
||||
private String flawName;
|
||||
/**
|
||||
* 是否瑕疵
|
||||
* 是否瑕疵 0-否 1-是
|
||||
*/
|
||||
private Integer isFlaw;
|
||||
/**
|
||||
|
@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 回收订单视图对象
|
||||
@ -31,6 +32,21 @@ public class CueOrderVO extends BaseVO implements Serializable {
|
||||
*/
|
||||
@Schema(description = "用户ID")
|
||||
private Long userId;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
@Schema(description = "商品ID")
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@Schema(description = "商品名称")
|
||||
private String productName;
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
@Schema(description = "价格")
|
||||
private Long productPrice;
|
||||
/**
|
||||
* 用户姓名
|
||||
*/
|
||||
@ -106,4 +122,9 @@ public class CueOrderVO extends BaseVO implements Serializable {
|
||||
*/
|
||||
@Schema(description = "完成时间")
|
||||
private Date finallyTime;
|
||||
/**
|
||||
* 瑕疵项
|
||||
*/
|
||||
@Schema(description = "瑕疵项")
|
||||
private List<CueOrderFlawVO> flawList;
|
||||
}
|
@ -13,38 +13,46 @@ import com.tmerclub.cloud.cuerecycle.model.vo.CueOrderVO;
|
||||
*/
|
||||
public interface CueOrderService {
|
||||
|
||||
/**
|
||||
* 获取回收订单分页列表
|
||||
*
|
||||
* @param pageDTO 分页参数
|
||||
* @param cueOrderDTO 查询参数
|
||||
* @return 分页数据
|
||||
*/
|
||||
PageVO<CueOrderVO> page(PageDTO pageDTO,CueOrderDTO cueOrderDTO);
|
||||
/**
|
||||
* 获取回收订单分页列表
|
||||
*
|
||||
* @param pageDTO 分页参数
|
||||
* @param cueOrderDTO 查询参数
|
||||
* @return 分页数据
|
||||
*/
|
||||
PageVO<CueOrderVO> page(PageDTO pageDTO, CueOrderDTO cueOrderDTO);
|
||||
|
||||
/**
|
||||
* 获取回收订单详情
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 回收订单详情
|
||||
*/
|
||||
CueOrderVO getById(Long id);
|
||||
/**
|
||||
* 获取回收订单详情
|
||||
*
|
||||
* @param orderId 主键
|
||||
* @return 回收订单详情
|
||||
*/
|
||||
CueOrderVO getById(Long orderId);
|
||||
|
||||
/**
|
||||
* 新增回收订单
|
||||
*
|
||||
* @param cueOrderDTO 新增参数
|
||||
* @return 新增结果
|
||||
*/
|
||||
/**
|
||||
* 新增回收订单
|
||||
*
|
||||
* @param cueOrderDTO 新增参数
|
||||
* @return 新增结果
|
||||
*/
|
||||
int save(CueOrderDTO cueOrderDTO);
|
||||
|
||||
/**
|
||||
* 修改回收订单
|
||||
*
|
||||
* @param cueOrderDTO 修改参数
|
||||
* @return 修改结果
|
||||
*/
|
||||
int update(CueOrderDTO cueOrderDTO);
|
||||
/**
|
||||
* 修改回收订单审核状态
|
||||
*
|
||||
* @param cueOrderDTO 修改参数
|
||||
* @return 修改结果
|
||||
*/
|
||||
int updateAuditStatus(CueOrderDTO cueOrderDTO);
|
||||
|
||||
/**
|
||||
* 修改回收订单评估状态
|
||||
*
|
||||
* @param cueOrderDTO 修改参数
|
||||
* @return 修改结果
|
||||
*/
|
||||
int updateEvaluateStatus(CueOrderDTO cueOrderDTO);
|
||||
|
||||
/**
|
||||
* 删除回收订单
|
||||
|
@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil;
|
||||
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.cuerecycle.constant.CueOrderStatus;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueOrderDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.CueOrderVO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.CueOrder;
|
||||
@ -13,6 +14,8 @@ import com.tmerclub.cloud.cuerecycle.service.CueOrderService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 回收订单Service实现类
|
||||
*
|
||||
@ -31,8 +34,8 @@ public class CueOrderServiceImpl implements CueOrderService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public CueOrderVO getById(Long id) {
|
||||
return cueOrderMapper.getById(id);
|
||||
public CueOrderVO getById(Long orderId) {
|
||||
return cueOrderMapper.getById(orderId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -43,8 +46,23 @@ public class CueOrderServiceImpl implements CueOrderService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(CueOrderDTO cueOrderDTO) {
|
||||
CueOrder cueOrder = BeanUtil.toBean(cueOrderDTO, CueOrder.class);
|
||||
public int updateAuditStatus(CueOrderDTO cueOrderDTO) {
|
||||
CueOrder cueOrder = new CueOrder();
|
||||
cueOrder.setOrderId(cueOrderDTO.getOrderId());
|
||||
cueOrder.setOrderStatus(cueOrderDTO.getOrderStatus());
|
||||
cueOrder.setUpdateTime(DateUtil.date());
|
||||
return cueOrderMapper.update(cueOrder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateEvaluateStatus(CueOrderDTO cueOrderDTO) {
|
||||
CueOrder cueOrder = new CueOrder();
|
||||
cueOrder.setOrderId(cueOrderDTO.getOrderId());
|
||||
cueOrder.setOrderStatus(cueOrderDTO.getOrderStatus());
|
||||
if(Objects.equals(cueOrderDTO.getOrderStatus(), CueOrderStatus.EVALUATION_SUCCESS.value())){
|
||||
cueOrder.setActualAmount(cueOrderDTO.getActualAmount());
|
||||
cueOrder.setVoucherAmount(cueOrderDTO.getVoucherAmount());
|
||||
}
|
||||
cueOrder.setUpdateTime(DateUtil.date());
|
||||
return cueOrderMapper.update(cueOrder);
|
||||
}
|
||||
|
@ -27,6 +27,8 @@
|
||||
AND order_id = #{dto.orderId}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY
|
||||
order_flaw_id DESC
|
||||
</select>
|
||||
|
||||
<insert id="save" useGeneratedKeys="true" keyProperty="orderFlawId">
|
||||
|
@ -7,6 +7,9 @@
|
||||
<resultMap id="cueOrderVOMap" type="com.tmerclub.cloud.cuerecycle.model.vo.CueOrderVO">
|
||||
<result property="orderId" column="order_id"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="productId" column="product_id"/>
|
||||
<result property="productName" column="product_name"/>
|
||||
<result property="productPrice" column="product_price"/>
|
||||
<result property="userName" column="user_name"/>
|
||||
<result property="userPhone" column="user_phone"/>
|
||||
<result property="orderType" column="order_type"/>
|
||||
@ -24,10 +27,11 @@
|
||||
<result property="payTime" column="pay_time"/>
|
||||
<result property="deliveryTime" column="delivery_time"/>
|
||||
<result property="finallyTime" column="finally_time"/>
|
||||
<result property="finallyTime" column="finally_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Vo_Column_List">
|
||||
order_id,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
|
||||
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">
|
||||
@ -40,20 +44,20 @@
|
||||
<if test="dto.userName != null and dto.userName != ''">
|
||||
AND user_name LIKE CONCAT('%', #{dto.userName}, '%')
|
||||
</if>
|
||||
<if test="userPhone != null and dto.userPhone != ''">
|
||||
<if test="dto.userPhone != null and dto.userPhone != ''">
|
||||
AND user_phone LIKE CONCAT('%', #{dto.userPhone}, '%')
|
||||
</if>
|
||||
<if test="orderType != null">
|
||||
AND order_type = #{orderType}
|
||||
<if test="dto.orderType != null">
|
||||
AND order_type = #{dto.orderType}
|
||||
</if>
|
||||
<if test="orderStatus != null">
|
||||
AND order_status = #{orderStatus}
|
||||
<if test="dto.orderStatus != null">
|
||||
AND order_status = #{dto.orderStatus}
|
||||
</if>
|
||||
<if test="isPayed != null">
|
||||
AND is_payed = #{isPayed}
|
||||
<if test="dto.isPayed != null">
|
||||
AND is_payed = #{dto.isPayed}
|
||||
</if>
|
||||
<if test="payType != null">
|
||||
AND pay_type = #{payType}
|
||||
<if test="dto.payType != null">
|
||||
AND pay_type = #{dto.payType}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY
|
||||
@ -73,14 +77,17 @@
|
||||
INSERT INTO cue_order
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<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="productPrice != null">product_price,</if>
|
||||
<if test="userName != null and userName != ''">user_name,</if>
|
||||
<if test="userPhone != null and userPhone != ''">user_phone,</if>
|
||||
<if test="orderType != null">order_type,</if>
|
||||
<if test="orderStatus != null">order_status,</if>
|
||||
<if test="flawImgUrl != null and flawImgUrl != ''">flaw_img_url,</if>
|
||||
<if test="evidenceOfPayment != null">evidence_of_payment,</if>
|
||||
<if test="evidenceOfPayment != null and evidenceOfPayment != ''">evidence_of_payment,</if>
|
||||
<if test="orderRemark != null and orderRemark != ''">order_remark,</if>
|
||||
<if test="estimatedAmount != null and evidenceOfPayment != ''">estimated_amount,</if>
|
||||
<if test="estimatedAmount != null">estimated_amount,</if>
|
||||
<if test="actualAmount != null">actual_amount,</if>
|
||||
<if test="voucherAmount != null">voucher_amount,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
@ -92,6 +99,9 @@
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="productId != null">#{productId},</if>
|
||||
<if test="productName != null and productName != ''">#{productName},</if>
|
||||
<if test="productPrice != null">#{productPrice},</if>
|
||||
<if test="userName != null and userName != ''">#{userName},</if>
|
||||
<if test="userPhone != null and userPhone != ''">#{userPhone},</if>
|
||||
<if test="orderType != null">#{orderType},</if>
|
||||
@ -114,9 +124,6 @@
|
||||
<update id="update">
|
||||
UPDATE cue_order
|
||||
<set>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId},
|
||||
</if>
|
||||
<if test="userName != null and userName != ''">
|
||||
user_name = #{userName},
|
||||
</if>
|
||||
@ -168,6 +175,7 @@
|
||||
<if test="finallyTime != null">
|
||||
finally_time = #{finallyTime},
|
||||
</if>
|
||||
<if test="mallOrderId != null">mall_order_id = #{mallOrderId},</if>
|
||||
</set>
|
||||
where
|
||||
order_id = #{orderId}
|
||||
|
@ -40,6 +40,11 @@
|
||||
<artifactId>tmerclub-common-database</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.moyuer.cloud</groupId>
|
||||
<artifactId>tmerclub-common-loacl</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.moyuer.cloud</groupId>
|
||||
<artifactId>tmerclub-api-order</artifactId>
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
package com.tmerclub.cloud.order.feign;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
@ -20,11 +19,14 @@ import com.tmerclub.cloud.api.user.dto.MemberReqDTO;
|
||||
import com.tmerclub.cloud.api.vo.EsPageVO;
|
||||
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.dto.SaveOrderToMallDTO;
|
||||
import com.tmerclub.cloud.common.order.bo.EsOrderBO;
|
||||
import com.tmerclub.cloud.common.order.bo.OrderIdWithRefundIdBO;
|
||||
import com.tmerclub.cloud.common.order.bo.OrderStatusBO;
|
||||
import com.tmerclub.cloud.common.order.constant.DeliveryType;
|
||||
import com.tmerclub.cloud.common.order.constant.OrderType;
|
||||
import com.tmerclub.cloud.common.order.constant.RefundStatusEnum;
|
||||
import com.tmerclub.cloud.common.order.dto.OrderDTO;
|
||||
import com.tmerclub.cloud.common.order.dto.OrderSearchDTO;
|
||||
@ -36,11 +38,12 @@ import com.tmerclub.cloud.common.rocketmq.config.RocketMqConstant;
|
||||
import com.tmerclub.cloud.common.util.BeanUtil;
|
||||
import com.tmerclub.cloud.constant.DistributedIdKey;
|
||||
import com.tmerclub.cloud.order.manager.MongoOrderManager;
|
||||
import com.tmerclub.cloud.order.mapper.OrderItemLangMapper;
|
||||
import com.tmerclub.cloud.order.mapper.OrderItemMapper;
|
||||
import com.tmerclub.cloud.order.mapper.OrderMapper;
|
||||
import com.tmerclub.cloud.order.model.Order;
|
||||
import com.tmerclub.cloud.order.model.OrderItem;
|
||||
import com.tmerclub.cloud.order.service.*;
|
||||
import com.tmerclub.cloud.order.model.OrderItemLang;
|
||||
import com.tmerclub.cloud.order.service.*;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
@ -75,6 +78,8 @@ public class OrderFeignController implements OrderFeignClient {
|
||||
@Autowired
|
||||
private OrderItemService orderItemService;
|
||||
@Autowired
|
||||
private OrderItemLangMapper orderItemLangMapper;
|
||||
@Autowired
|
||||
private OrderAnalysisService orderAnalysisService;
|
||||
@Autowired
|
||||
private OrderStatisticsService orderStatisticsService;
|
||||
@ -273,7 +278,8 @@ public class OrderFeignController implements OrderFeignClient {
|
||||
|
||||
@Override
|
||||
public ServerResponseEntity<Integer> countNormalOrderByOrderIds(List<Long> orderIds) {
|
||||
int count = orderMapper.countNormalOrderByOrderIds(orderIds);;
|
||||
int count = orderMapper.countNormalOrderByOrderIds(orderIds);
|
||||
;
|
||||
return ServerResponseEntity.success(count);
|
||||
}
|
||||
|
||||
@ -479,7 +485,7 @@ public class OrderFeignController implements OrderFeignClient {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServerResponseEntity<Boolean> orderStationByOrderId(List<Long> orderIds, Long stationId) throws LuckException{
|
||||
public ServerResponseEntity<Boolean> orderStationByOrderId(List<Long> orderIds, Long stationId) throws LuckException {
|
||||
orderService.orderStationByOrderId(orderIds, null, stationId);
|
||||
return ServerResponseEntity.success(Boolean.TRUE);
|
||||
}
|
||||
@ -521,7 +527,7 @@ public class OrderFeignController implements OrderFeignClient {
|
||||
List<OrderVO> orderList = orderMapper.listWaitPurchaseAndUnPayBalanceOrderIds(paySysType);
|
||||
List<OrderIdWithRefundIdBO> orderIdWithRefundIdList = new ArrayList<>();
|
||||
for (OrderVO orderVO : orderList) {
|
||||
Long segmentId = segmentManager.getSegmentIdWithDateTime(DistributedIdKey.tmerclub_REFUND,orderVO.getUserId());
|
||||
Long segmentId = segmentManager.getSegmentIdWithDateTime(DistributedIdKey.tmerclub_REFUND, orderVO.getUserId());
|
||||
OrderIdWithRefundIdBO orderIdWithRefundIdBO = new OrderIdWithRefundIdBO();
|
||||
orderIdWithRefundIdBO.setOrderId(orderVO.getOrderId());
|
||||
orderIdWithRefundIdBO.setRefundId(segmentId);
|
||||
@ -553,4 +559,41 @@ public class OrderFeignController implements OrderFeignClient {
|
||||
return mongoOrderManager.listFlowOrderItems(flowOrderItemDTO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long saveOrderToMall(SaveOrderToMallDTO saveOrderToMallDTO) {
|
||||
// order
|
||||
Order order = new Order();
|
||||
order.setUserId(saveOrderToMallDTO.getUserId());
|
||||
order.setTotal(saveOrderToMallDTO.getEstimatedAmount());
|
||||
order.setActualTotal(saveOrderToMallDTO.getEstimatedAmount());
|
||||
order.setStatus(OrderStatus.UNPAY.value());
|
||||
order.setAllCount(1);
|
||||
order.setOrderType(OrderType.RECYCLE.value());
|
||||
order.setOrderId(segmentManager.getSegmentIdWithDateTime(DistributedIdKey.tmerclub_ORDER, order.getUserId()));
|
||||
order.setCreateTime(new Date());
|
||||
order.setShopId(0L);
|
||||
order.setDeliveryType(DeliveryType.DELIVERY.value());
|
||||
orderMapper.saveCueOrder(order);
|
||||
// order_item
|
||||
OrderItem orderItem = new OrderItem();
|
||||
orderItem.setOrderItemId(segmentManager.getSegmentIdWithDateTime(DistributedIdKey.tmerclub_ORDER_ITEM, order.getUserId()));
|
||||
orderItem.setCreateTime(new Date());
|
||||
orderItem.setShopId(0L);
|
||||
orderItem.setOrderId(order.getOrderId());
|
||||
orderItem.setSpuId(0L);
|
||||
orderItem.setSkuId(0L);
|
||||
orderItem.setUserId(saveOrderToMallDTO.getUserId());
|
||||
orderItem.setCount(1);
|
||||
orderItem.setPrice(saveOrderToMallDTO.getEstimatedAmount());
|
||||
orderItem.setPic(saveOrderToMallDTO.getProductImages());
|
||||
orderItem.setSpuTotalAmount(saveOrderToMallDTO.getEstimatedAmount());
|
||||
orderItemMapper.saveCueOrderItem(orderItem);
|
||||
// order_item_lang
|
||||
OrderItemLang orderItemLang = new OrderItemLang();
|
||||
orderItemLang.setOrderItemId(orderItem.getOrderItemId());
|
||||
orderItemLang.setLang(LanguageEnum.LANGUAGE_ZH_CN.getLang());
|
||||
orderItemLang.setSpuName(saveOrderToMallDTO.getProductName());
|
||||
orderItemLangMapper.saveCueOrderItemLang(orderItemLang);
|
||||
return order.getOrderId();
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
package com.tmerclub.cloud.order.mapper;
|
||||
|
||||
import com.tmerclub.cloud.common.order.vo.OrderItemLangVO;
|
||||
@ -54,6 +53,7 @@ public interface OrderItemLangMapper {
|
||||
|
||||
/**
|
||||
* 获取订单项国际化信息
|
||||
*
|
||||
* @param orderIdList 订单id列表
|
||||
* @return 订单项国际化数据列表
|
||||
*/
|
||||
@ -61,6 +61,7 @@ public interface OrderItemLangMapper {
|
||||
|
||||
/**
|
||||
* 根据订单项id列表获取订单项国际化信息列表
|
||||
*
|
||||
* @param orderItemIds
|
||||
* @param lang
|
||||
* @return
|
||||
@ -69,6 +70,7 @@ public interface OrderItemLangMapper {
|
||||
|
||||
/**
|
||||
* 根据订单项id列表获取订单项信息列表
|
||||
*
|
||||
* @param orderItemIds
|
||||
* @param lang
|
||||
* @return
|
||||
@ -81,4 +83,11 @@ public interface OrderItemLangMapper {
|
||||
* @param removeItemIds
|
||||
*/
|
||||
void deleteBatchByIds(@Param("orderItemIds") List<Long> removeItemIds);
|
||||
|
||||
/**
|
||||
* 保存cue订单项
|
||||
*
|
||||
* @param orderItemLang cue订单项
|
||||
*/
|
||||
void saveCueOrderItemLang(@Param("orderItemLang") OrderItemLang orderItemLang);
|
||||
}
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
package com.tmerclub.cloud.order.mapper;
|
||||
|
||||
import com.tmerclub.cloud.api.delivery.dto.DeliveryOrderItemDTO;
|
||||
@ -253,4 +252,11 @@ public interface OrderItemMapper {
|
||||
* @return
|
||||
*/
|
||||
List<OrderItemVO> listOrderItemAndLangByOrderItemIds(@Param("orderItemIds") List<Long> orderItemIds);
|
||||
|
||||
/**
|
||||
* 保存cue订单项
|
||||
*
|
||||
* @param orderItem 订单项
|
||||
*/
|
||||
void saveCueOrderItem(@Param("orderItem") OrderItem orderItem);
|
||||
}
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
package com.tmerclub.cloud.order.mapper;
|
||||
|
||||
import com.tmerclub.cloud.common.database.util.PageAdapter;
|
||||
@ -105,8 +104,8 @@ public interface OrderMapper {
|
||||
/**
|
||||
* 根据订单号和自提点id获取订单
|
||||
*
|
||||
* @param orderId orderId
|
||||
* @param stationId stationId
|
||||
* @param orderId orderId
|
||||
* @param stationId stationId
|
||||
* @return Order
|
||||
*/
|
||||
Order getOrderByOrderIdAndStationId(@Param("orderId") Long orderId, @Param("stationId") Long stationId);
|
||||
@ -184,8 +183,8 @@ public interface OrderMapper {
|
||||
/**
|
||||
* 将订单更新为待成团状态
|
||||
*
|
||||
* @param orderIds 需要更新的订单id
|
||||
* @param payType 支付方式
|
||||
* @param orderIds 需要更新的订单id
|
||||
* @param payType 支付方式
|
||||
* @param paySysType
|
||||
*/
|
||||
void updateByToGroupPaySuccess(@Param("orderIds") List<Long> orderIds, @Param("payType") Integer payType, @Param("paySysType") Integer paySysType);
|
||||
@ -348,6 +347,7 @@ public interface OrderMapper {
|
||||
|
||||
/**
|
||||
* 根据信息获取
|
||||
*
|
||||
* @param orderIds
|
||||
* @return
|
||||
*/
|
||||
@ -357,14 +357,15 @@ public interface OrderMapper {
|
||||
* 获取待自提的订单
|
||||
*
|
||||
* @param orderIdList 订单编号列表
|
||||
* @param userId 用户id
|
||||
* @param stationId 自提点id
|
||||
* @param userId 用户id
|
||||
* @param stationId 自提点id
|
||||
* @return 订单列表
|
||||
*/
|
||||
List<OrderVO> getStationOrderByOrderIds(@Param("orderIdList") List<Long> orderIdList, @Param("userId") Long userId, @Param("stationId") Long stationId);
|
||||
|
||||
/**
|
||||
* 获取自提点订单列表
|
||||
*
|
||||
* @param orderDTO
|
||||
* @return
|
||||
*/
|
||||
@ -372,6 +373,7 @@ public interface OrderMapper {
|
||||
|
||||
/**
|
||||
* 获取待采购订单和支付定金未支付尾款的订单Ids
|
||||
*
|
||||
* @param paySysType
|
||||
* @return 订单Ids
|
||||
*/
|
||||
@ -384,4 +386,11 @@ public interface OrderMapper {
|
||||
* @return
|
||||
*/
|
||||
List<OrderVO> listOrderByOrderIds(@Param("orderIds") List<Long> orderIds);
|
||||
|
||||
/**
|
||||
* 保存cue订单
|
||||
*
|
||||
* @param order 参数
|
||||
*/
|
||||
void saveCueOrder(Order order);
|
||||
}
|
||||
|
@ -27,7 +27,18 @@
|
||||
(#{orderItemLang.orderItemId},#{orderItemLang.lang},#{orderItemLang.spuName},#{orderItemLang.skuName},#{orderItemLang.supplierSpuName},#{orderItemLang.supplierSkuName})
|
||||
</foreach>
|
||||
</insert>
|
||||
<update id="update">
|
||||
<insert id="saveCueOrderItemLang">
|
||||
insert into order_item_lang (
|
||||
`order_item_id`,
|
||||
`lang`,
|
||||
`spu_name`
|
||||
) values (
|
||||
#{orderItemLang.orderItemId},
|
||||
#{orderItemLang.lang},
|
||||
#{orderItemLang.spuName}
|
||||
)
|
||||
</insert>
|
||||
<update id="update">
|
||||
update order_item_lang
|
||||
<set>
|
||||
<if test="orderItemLang.lang != null">
|
||||
|
@ -269,6 +269,33 @@
|
||||
#{orderItem.writeOffNum}, #{orderItem.writeOffMultipleCount}, #{orderItem.writeOffStart}, #{orderItem.writeOffEnd}, #{orderItem.stockPointId})
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="saveCueOrderItem">
|
||||
insert into order_item (
|
||||
`order_item_id`,
|
||||
`create_time`,
|
||||
`shop_id`,
|
||||
`order_id`,
|
||||
`spu_id`,
|
||||
`sku_id`,
|
||||
`user_id`,
|
||||
`count`,
|
||||
`pic`,
|
||||
`price`,
|
||||
`spu_total_amount`
|
||||
) values (
|
||||
#{orderItem.orderItemId},
|
||||
#{orderItem.createTime},
|
||||
#{orderItem.shopId},
|
||||
#{orderItem.orderId},
|
||||
#{orderItem.spuId},
|
||||
#{orderItem.skuId},
|
||||
#{orderItem.userId},
|
||||
#{orderItem.count},
|
||||
#{orderItem.pic},
|
||||
#{orderItem.price},
|
||||
#{orderItem.spuTotalAmount}
|
||||
)
|
||||
</insert>
|
||||
<update id="update">
|
||||
update order_item
|
||||
<set>
|
||||
|
@ -959,6 +959,31 @@
|
||||
#{order.createTime})
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="saveCueOrder">
|
||||
insert into `order` (
|
||||
`order_id`,
|
||||
`create_time`,
|
||||
`shop_id`,
|
||||
`user_id`,
|
||||
`delivery_type`,
|
||||
`total`,
|
||||
`actual_total`,
|
||||
`status`,
|
||||
`all_count`,
|
||||
`order_type`
|
||||
) values (
|
||||
#{orderId},
|
||||
#{createTime},
|
||||
#{shopId},
|
||||
#{userId},
|
||||
#{deliveryType},
|
||||
#{total},
|
||||
#{actualTotal},
|
||||
#{status},
|
||||
#{allCount},
|
||||
#{orderType}
|
||||
)
|
||||
</insert>
|
||||
<select id="getOrdersStatus" resultType="com.tmerclub.cloud.common.order.bo.OrderStatusBO">
|
||||
SELECT o.`status`, o.`order_id`, o.`order_type`,o.`shop_id`,o.actual_total,o.order_mold,o.user_id,o.supplier_id,o.freight_amount,o.platform_free_freight_amount,
|
||||
o.pre_sale_type,o.delivery_type,op.`balance_amount`,op.`deposit_amount`,op.`balance_end_time`
|
||||
|
Loading…
x
Reference in New Issue
Block a user