You've already forked FrameTour-BE
feat(puzzle): 支持拼图原图保存与自动打印功能
- 在PuzzleGenerationRecordEntity中新增originalImageUrl字段用于存储未裁切的原图URL - 在PuzzleTemplateEntity中新增autoAddPrint、canPrint和userArea字段支持打印配置 - 更新PuzzleGenerationRecordMapper.xml以支持新字段的读写操作 - 在PuzzleGenerateServiceImpl中实现原图上传、用户区域裁切以及自动添加到打印队列逻辑 - 新增cropImage方法处理图片按指定区域裁切 - 集成PrinterService实现拼图完成后自动添加到打印队列功能 - 优化生成流程日志记录,区分原图和最终图片的URL信息
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
<result column="generation_params" property="generationParams"/>
|
||||
<result column="content_hash" property="contentHash"/>
|
||||
<result column="result_image_url" property="resultImageUrl"/>
|
||||
<result column="original_image_url" property="originalImageUrl"/>
|
||||
<result column="result_file_size" property="resultFileSize"/>
|
||||
<result column="result_width" property="resultWidth"/>
|
||||
<result column="result_height" property="resultHeight"/>
|
||||
@@ -32,7 +33,7 @@
|
||||
<sql id="Base_Column_List">
|
||||
id, template_id, template_code, user_id, face_id, business_type,
|
||||
generation_params, content_hash,
|
||||
result_image_url, result_file_size, result_width, result_height,
|
||||
result_image_url, original_image_url, result_file_size, result_width, result_height,
|
||||
status, error_message, generation_duration, retry_count,
|
||||
scenic_id, client_ip, user_agent, create_time, update_time
|
||||
</sql>
|
||||
@@ -77,13 +78,13 @@
|
||||
INSERT INTO puzzle_generation_record (
|
||||
template_id, template_code, user_id, face_id, business_type,
|
||||
generation_params, content_hash,
|
||||
result_image_url, result_file_size, result_width, result_height,
|
||||
result_image_url, original_image_url, result_file_size, result_width, result_height,
|
||||
status, error_message, generation_duration, retry_count,
|
||||
scenic_id, client_ip, user_agent, create_time, update_time
|
||||
) VALUES (
|
||||
#{templateId}, #{templateCode}, #{userId}, #{faceId}, #{businessType},
|
||||
#{generationParams}, #{contentHash},
|
||||
#{resultImageUrl}, #{resultFileSize}, #{resultWidth}, #{resultHeight},
|
||||
#{resultImageUrl}, #{originalImageUrl}, #{resultFileSize}, #{resultWidth}, #{resultHeight},
|
||||
#{status}, #{errorMessage}, #{generationDuration}, #{retryCount},
|
||||
#{scenicId}, #{clientIp}, #{userAgent}, NOW(), NOW()
|
||||
)
|
||||
@@ -94,6 +95,7 @@
|
||||
UPDATE puzzle_generation_record
|
||||
<set>
|
||||
<if test="resultImageUrl != null">result_image_url = #{resultImageUrl},</if>
|
||||
<if test="originalImageUrl != null">original_image_url = #{originalImageUrl},</if>
|
||||
<if test="resultFileSize != null">result_file_size = #{resultFileSize},</if>
|
||||
<if test="resultWidth != null">result_width = #{resultWidth},</if>
|
||||
<if test="resultHeight != null">result_height = #{resultHeight},</if>
|
||||
@@ -111,6 +113,7 @@
|
||||
UPDATE puzzle_generation_record
|
||||
SET status = 1,
|
||||
result_image_url = #{resultImageUrl},
|
||||
original_image_url = #{originalImageUrl},
|
||||
result_file_size = #{resultFileSize},
|
||||
result_width = #{resultWidth},
|
||||
result_height = #{resultHeight},
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
<result column="category" property="category"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="scenic_id" property="scenicId"/>
|
||||
<result column="auto_add_print" property="autoAddPrint"/>
|
||||
<result column="can_print" property="canPrint"/>
|
||||
<result column="user_area" property="userArea"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="deleted" property="deleted"/>
|
||||
@@ -27,7 +30,8 @@
|
||||
<!-- 基础列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, name, code, canvas_width, canvas_height, background_type, background_color,
|
||||
background_image, cover_image, description, category, status, scenic_id, create_time, update_time, deleted, deleted_at
|
||||
background_image, cover_image, description, category, status, scenic_id,
|
||||
auto_add_print, can_print, user_area, create_time, update_time, deleted, deleted_at
|
||||
</sql>
|
||||
|
||||
<!-- 根据ID查询 -->
|
||||
@@ -68,10 +72,12 @@
|
||||
useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO puzzle_template (
|
||||
name, code, canvas_width, canvas_height, background_type, background_color,
|
||||
background_image, cover_image, description, category, status, scenic_id, create_time, update_time, deleted
|
||||
background_image, cover_image, description, category, status, scenic_id,
|
||||
auto_add_print, can_print, user_area, create_time, update_time, deleted
|
||||
) VALUES (
|
||||
#{name}, #{code}, #{canvasWidth}, #{canvasHeight}, #{backgroundType}, #{backgroundColor},
|
||||
#{backgroundImage}, #{coverImage}, #{description}, #{category}, #{status}, #{scenicId}, NOW(), NOW(), 0
|
||||
#{backgroundImage}, #{coverImage}, #{description}, #{category}, #{status}, #{scenicId},
|
||||
#{autoAddPrint}, #{canPrint}, #{userArea}, NOW(), NOW(), 0
|
||||
)
|
||||
</insert>
|
||||
|
||||
@@ -91,6 +97,9 @@
|
||||
<if test="category != null">category = #{category},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="scenicId != null">scenic_id = #{scenicId},</if>
|
||||
<if test="autoAddPrint != null">auto_add_print = #{autoAddPrint},</if>
|
||||
<if test="canPrint != null">can_print = #{canPrint},</if>
|
||||
<if test="userArea != null">user_area = #{userArea},</if>
|
||||
update_time = NOW()
|
||||
</set>
|
||||
WHERE id = #{id} AND deleted = 0
|
||||
|
||||
Reference in New Issue
Block a user