Compare commits
2 Commits
f392e43ae7
...
04437369c1
| Author | SHA1 | Date | |
|---|---|---|---|
| 04437369c1 | |||
| 3c2f46b008 |
@@ -33,9 +33,9 @@ public interface AppCommonConvert {
|
||||
@Mapping(target = "imageUrl", source = "product.thumbImageUrl")
|
||||
CommonUserOrderEntity convertMallProductToOrder(CreateOrderRequest request, MallProductEntity product);
|
||||
|
||||
CommonUserOrderVO convertUserOrderEntityToVO(CommonUserOrderEntity entity);
|
||||
CommonUserOrderApiVO convertUserOrderEntityToApi(CommonUserOrderEntity entity);
|
||||
|
||||
List<CommonUserOrderVO> convertUserOrderEntityListTOVOList(List<CommonUserOrderEntity> entityList);
|
||||
List<CommonUserOrderApiVO> convertUserOrderEntityListTOApiList(List<CommonUserOrderEntity> entityList);
|
||||
|
||||
CommonUserOrderApiVO convertOrderApiVO(CommonUserOrderVO vo);
|
||||
|
||||
|
||||
@@ -51,6 +51,8 @@ public interface CommonUserOrderMapper extends BaseMapper<CommonUserOrderEntity>
|
||||
*/
|
||||
List<CommonUserOrderVO> selectOrderPage(IPage page, CommonUserOrderVO order);
|
||||
|
||||
List<CommonUserOrderEntity> selectOrderEntityPage(IPage page, CommonUserOrderEntity order);
|
||||
|
||||
|
||||
/**
|
||||
* 获取导出数据
|
||||
|
||||
@@ -34,6 +34,16 @@
|
||||
|
||||
|
||||
<select id="selectOrderPage" resultType="org.springblade.modules.common.pojo.vo.CommonUserOrderVO">
|
||||
select uo.*, bu.account as account
|
||||
from user_order uo
|
||||
left join blade_user bu on uo.user_id = bu.id
|
||||
where uo.is_deleted = 0
|
||||
<if test="order.id != null">
|
||||
and uo.id = #{order.id}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectOrderEntityPage" resultType="org.springblade.modules.common.pojo.entity.CommonUserOrderEntity">
|
||||
select * from user_order where is_deleted = 0 and user_id = #{order.userId}
|
||||
<if test="order.orderStatus !=null and order.orderStatus > 0 ">
|
||||
and order_status = #{order.orderStatus}
|
||||
@@ -42,7 +52,8 @@
|
||||
|
||||
|
||||
<select id="exportOrder" resultType="org.springblade.modules.common.excel.CommonUserOrderExcel">
|
||||
SELECT * FROM user_order ${ew.customSqlSegment}
|
||||
SELECT *
|
||||
FROM user_order ${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -29,6 +29,9 @@ import org.springblade.modules.common.pojo.entity.CommonUserOrderEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 用户订单 视图实体类
|
||||
@@ -37,9 +40,50 @@ import java.io.Serial;
|
||||
* @since 2026-02-06
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CommonUserOrderVO extends CommonUserOrderEntity {
|
||||
public class CommonUserOrderVO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
private String account;
|
||||
|
||||
private String consigneePhone;
|
||||
|
||||
private String consignee;
|
||||
|
||||
private String deliveryAddress;
|
||||
|
||||
private String orderType;
|
||||
|
||||
private String itemName;
|
||||
|
||||
private String imageUrl;
|
||||
|
||||
private Integer quantity;
|
||||
|
||||
private String expressCompany;
|
||||
|
||||
private String expressNo;
|
||||
|
||||
private Integer orderStatus;
|
||||
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
private BigDecimal actualAmount;
|
||||
|
||||
private Integer paymentType;
|
||||
|
||||
private Date paymentTime;
|
||||
|
||||
private Integer paymentStatus;
|
||||
|
||||
private Long createUser;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private Long updateUser;
|
||||
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -124,11 +124,11 @@ public class CommonUserOrderServiceImpl extends ServiceImpl<CommonUserOrderMappe
|
||||
|
||||
@Override
|
||||
public IPage<CommonUserOrderApiVO> selectOrderApiPage(IPage<CommonUserOrderApiVO> page, CommonUserOrderApiVO userOrder) {
|
||||
CommonUserOrderVO vo = new CommonUserOrderVO();
|
||||
vo.setOrderStatus(userOrder.getOrderStatus());
|
||||
vo.setUserId(AuthUtil.getUserId());
|
||||
List<CommonUserOrderVO> commonUserOrderVOS = baseMapper.selectOrderPage(page, vo);
|
||||
return page.setRecords(AppCommonConvert.INSTANCE.convertOrderApiListVO(commonUserOrderVOS));
|
||||
CommonUserOrderEntity entity = new CommonUserOrderEntity();
|
||||
entity.setOrderStatus(userOrder.getOrderStatus());
|
||||
entity.setUserId(AuthUtil.getUserId());
|
||||
List<CommonUserOrderEntity> commonUserOrderEntityList = baseMapper.selectOrderEntityPage(page, entity);
|
||||
return page.setRecords(AppCommonConvert.INSTANCE.convertUserOrderEntityListTOApiList(commonUserOrderEntityList));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user