feat(智能柜): 添加订单关联字段以支持订单信息展示
在CabinetCellEntity、CabinetDetailDTO和SmartCabinetApplicationService中添加orderId和orderGoodsId字段 修改CabinetCellMapper查询以获取关联订单信息
This commit is contained in:
parent
ebe6ac21c6
commit
11743ff77d
|
@ -77,6 +77,14 @@ public class CabinetCellEntity extends BaseEntity<CabinetCellEntity> {
|
|||
@TableField("goods_id")
|
||||
private Long goodsId;
|
||||
|
||||
@ApiModelProperty("关联订单ID")
|
||||
@TableField(exist = false)
|
||||
private Long orderId;
|
||||
|
||||
@ApiModelProperty("关联订单商品ID")
|
||||
@TableField(exist = false)
|
||||
private Long orderGoodsId;
|
||||
|
||||
|
||||
@Override
|
||||
public Serializable pkVal() {
|
||||
|
|
|
@ -112,7 +112,7 @@ public interface CabinetCellMapper extends BaseMapper<CabinetCellEntity> {
|
|||
"${ew.customSqlSegment} ")
|
||||
List<CabinetCellLatestOrderDTO> selectLatestOrderInfoByCell(@Param(Constants.WRAPPER) Wrapper<?> queryWrapper);
|
||||
|
||||
@Select("SELECT DISTINCT cc.* " +
|
||||
@Select("SELECT DISTINCT cc.*, sog.order_id as orderId, sog.order_goods_id as orderGoodsId " +
|
||||
"FROM cabinet_cell cc " +
|
||||
"INNER JOIN shop_order_goods sog ON cc.cell_id = sog.cell_id AND sog.deleted = 0 " +
|
||||
"INNER JOIN shop_order so ON sog.order_id = so.order_id AND so.deleted = 0 " +
|
||||
|
|
|
@ -353,6 +353,8 @@ public class SmartCabinetApplicationService {
|
|||
cellInfo.setPinNo(cell.getPinNo());
|
||||
cellInfo.setStock(cell.getStock());
|
||||
cellInfo.setCellPrice(cell.getCellPrice());
|
||||
cellInfo.setOrderId(cell.getOrderId());
|
||||
cellInfo.setOrderGoodsId(cell.getOrderGoodsId());
|
||||
|
||||
return cellInfo;
|
||||
}).collect(Collectors.toList());
|
||||
|
|
|
@ -19,6 +19,8 @@ public class CabinetDetailDTO {
|
|||
private Integer pinNo;
|
||||
private Integer stock;
|
||||
private BigDecimal cellPrice;
|
||||
private Long orderId;
|
||||
private Long orderGoodsId;
|
||||
private ProductInfoDTO product;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue