1. fix bugs
This commit is contained in:
2025-10-12 14:33:53 +08:00
parent fe081ff1ee
commit 9c18426b23
10 changed files with 74 additions and 10 deletions

View File

@@ -48,4 +48,5 @@ public interface StickersAttachmentRMapper extends BaseMapper<StickersAttachment
*/
List<StickersAttachmentRVO> selectStickersAttachmentRPage(IPage page, StickersAttachmentRVO stickersAttachmentR);
List<String> selectStickersUrlByPhotoId(Long photoId);
}

View File

@@ -22,4 +22,8 @@
select * from kiosk_stickers_attachment_r where is_deleted = 0
</select>
<select id="selectStickersUrlByPhotoId" resultType="String">
select ks.link from kiosk_stickers_attachment_r ksar left join kiosk_stickers ks on ksar.stickers_id = ks.id
where ksar.is_deleted = 0 and ksar.photo_id = #{photoId}
</select>
</mapper>

View File

@@ -25,7 +25,9 @@
*/
package org.springblade.modules.kiosk.pojo.vo;
import jakarta.validation.constraints.NotNull;
import org.springblade.core.tenant.mp.TenantEntity;
import org.springblade.modules.kiosk.pojo.dto.OrderApiRequest;
import org.springblade.modules.kiosk.pojo.entity.OrderDetailEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -64,16 +66,27 @@ public class OrderDetailVO extends TenantEntity {
private BigDecimal totalAmount;
private List<String> photos;
private List<Photo> photos;
private List<Text> texts;
@Data
public static class Photo {
private List<String> stickers;
@NotNull(message = "photo is missing")
private String photo;
@NotNull(message = "snapshot is missing")
private String snapshot;
private List<Text> texts;
private List<String> stickers;
}
@Data
public static class Text {
private Integer size;
private String content;
private String font;
}

View File

@@ -30,6 +30,8 @@ import org.springblade.modules.kiosk.pojo.entity.OrderDetailPhotoAttachmentREnti
import org.springblade.modules.kiosk.pojo.vo.OrderDetailPhotoAttachmentRVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
* 自助终端订单详情照片关联表 服务类
*
@@ -46,4 +48,5 @@ public interface IOrderDetailPhotoAttachmentRService extends BaseService<OrderDe
*/
IPage<OrderDetailPhotoAttachmentRVO> selectOrderDetailPhotoAttachmentRPage(IPage<OrderDetailPhotoAttachmentRVO> page, OrderDetailPhotoAttachmentRVO orderDetailPhotoAttachmentR);
List<OrderDetailPhotoAttachmentREntity> selectOrderDetailPhotoAttachmentRByOrderDetailId(Long orderDetailId);
}

View File

@@ -28,6 +28,7 @@ package org.springblade.modules.kiosk.service;
import org.springblade.core.mp.base.BaseService;
import org.springblade.modules.kiosk.pojo.dto.OrderApiRequest;
import org.springblade.modules.kiosk.pojo.entity.PhotoAttachmentEntity;
import org.springblade.modules.kiosk.pojo.vo.OrderDetailVO;
import org.springblade.modules.kiosk.pojo.vo.PhotoAttachmentVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -52,4 +53,6 @@ public interface IPhotoAttachmentService extends BaseService<PhotoAttachmentEnti
List<PhotoAttachmentEntity> selectPhotoAttachmentListByOrderDetailId(Long orderDetailId);
void createPhotoDetail(OrderApiRequest.Photo photo, Long orderDetailId);
List<OrderDetailVO.Photo> selectPhotoDetailByOrderDetailId(Long orderDetailId);
}

View File

@@ -30,6 +30,8 @@ import org.springblade.modules.kiosk.pojo.entity.StickersAttachmentREntity;
import org.springblade.modules.kiosk.pojo.vo.StickersAttachmentRVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
* 自助终端贴纸附件关联表 服务类
*
@@ -46,4 +48,5 @@ public interface IStickersAttachmentRService extends BaseService<StickersAttachm
*/
IPage<StickersAttachmentRVO> selectStickersAttachmentRPage(IPage<StickersAttachmentRVO> page, StickersAttachmentRVO stickersAttachmentR);
List<String> selectStickersUrlByPhotoId(Long photoId);
}

View File

@@ -25,6 +25,7 @@
*/
package org.springblade.modules.kiosk.service.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.modules.kiosk.pojo.entity.OrderDetailPhotoAttachmentREntity;
import org.springblade.modules.kiosk.pojo.vo.OrderDetailPhotoAttachmentRVO;
@@ -33,6 +34,8 @@ import org.springblade.modules.kiosk.service.IOrderDetailPhotoAttachmentRService
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
* 自助终端订单详情照片关联表 服务实现类
*
@@ -47,4 +50,9 @@ public class OrderDetailPhotoAttachmentRServiceImpl extends BaseServiceImpl<Orde
return page.setRecords(baseMapper.selectOrderDetailPhotoAttachmentRPage(page, orderDetailPhotoAttachmentR));
}
@Override
public List<OrderDetailPhotoAttachmentREntity> selectOrderDetailPhotoAttachmentRByOrderDetailId(Long orderDetailId) {
return list(Wrappers.<OrderDetailPhotoAttachmentREntity>lambdaQuery().eq(OrderDetailPhotoAttachmentREntity::getDetailId, orderDetailId));
}
}

View File

@@ -52,13 +52,9 @@ public class OrderDetailServiceImpl extends BaseServiceImpl<OrderDetailMapper, O
@Override
public IPage<OrderDetailVO> selectOrderDetailPage(IPage<OrderDetailVO> page, OrderDetailVO orderDetail) {
List<OrderDetailVO> vos = baseMapper.selectOrderDetailPage(page, orderDetail);
vos.forEach(vo -> {
List<PhotoAttachmentEntity> photoList = photoAttachmentService.selectPhotoAttachmentListByOrderDetailId(vo.getId());
vo.setPhotos(photoList.stream().map(PhotoAttachmentEntity::getLink).toList());
vo.setPhotos(photoAttachmentService.selectPhotoDetailByOrderDetailId(vo.getId()));
});
return page.setRecords(vos);
}

View File

@@ -25,6 +25,7 @@
*/
package org.springblade.modules.kiosk.service.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
@@ -34,6 +35,7 @@ import org.springblade.modules.kiosk.pojo.entity.OrderDetailPhotoAttachmentREnti
import org.springblade.modules.kiosk.pojo.entity.PhotoAttachmentEntity;
import org.springblade.modules.kiosk.pojo.entity.StickersAttachmentREntity;
import org.springblade.modules.kiosk.pojo.entity.TextAttachmentREntity;
import org.springblade.modules.kiosk.pojo.vo.OrderDetailVO;
import org.springblade.modules.kiosk.pojo.vo.PhotoAttachmentVO;
import org.springblade.modules.kiosk.mapper.PhotoAttachmentMapper;
import org.springblade.modules.kiosk.service.IOrderDetailPhotoAttachmentRService;
@@ -105,10 +107,34 @@ public class PhotoAttachmentServiceImpl extends BaseServiceImpl<PhotoAttachmentM
textAttachmentRService.saveBatch(textRList);
}
log.info("createPhotoDetail successfully");
}catch (Exception e){
} catch (Exception e) {
log.error("createPhotoDetail error:", e);
throw e;
}
}
@Override
public List<OrderDetailVO.Photo> selectPhotoDetailByOrderDetailId(Long orderDetailId) {
List<OrderDetailPhotoAttachmentREntity> pars = orderDetailPhotoAttachmentRService.selectOrderDetailPhotoAttachmentRByOrderDetailId(orderDetailId);
return pars.stream().map(p -> {
OrderDetailVO.Photo vo = new OrderDetailVO.Photo();
PhotoAttachmentEntity photo = getById(p.getPhotoId());
vo.setPhoto(photo.getLink());
if(p.getSnapshot() != null) {
PhotoAttachmentEntity snapshot = getById(p.getSnapshot());
vo.setSnapshot(snapshot.getLink());
}
List<String> stickersUrls = stickersAttachmentRService.selectStickersUrlByPhotoId(p.getPhotoId());
vo.setStickers(stickersUrls);
List<TextAttachmentREntity> tars = textAttachmentRService.list(Wrappers.<TextAttachmentREntity>lambdaQuery().eq(TextAttachmentREntity::getPhotoId, p.getPhotoId()));
vo.setTexts(tars.stream().map(t -> {
OrderDetailVO.Text text = new OrderDetailVO.Text();
text.setFont(t.getFontName());
text.setContent(t.getTextContent());
return text;
}).toList());
return vo;
}).toList();
}
}

View File

@@ -33,6 +33,8 @@ import org.springblade.modules.kiosk.service.IStickersAttachmentRService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
* 自助终端贴纸附件关联表 服务实现类
*
@@ -47,4 +49,9 @@ public class StickersAttachmentRServiceImpl extends BaseServiceImpl<StickersAtta
return page.setRecords(baseMapper.selectStickersAttachmentRPage(page, stickersAttachmentR));
}
@Override
public List<String> selectStickersUrlByPhotoId(Long photoId) {
return baseMapper.selectStickersUrlByPhotoId(photoId);
}
}