| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.sxkj.gd.airesults.controller; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import lombok.AllArgsConstructor; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.sxkj.gd.common.GenericConverter; |
| | | import org.sxkj.gd.airesults.entity.GdAiResultsEntity; |
| | | import org.sxkj.gd.airesults.param.GdAiResultsAddParam; |
| | | import org.sxkj.gd.airesults.param.GdAiResultsPageParam; |
| | | import org.sxkj.gd.airesults.param.GdAiResultsParam; |
| | | import org.sxkj.gd.airesults.vo.GdAiResultsVO; |
| | | import org.sxkj.gd.airesults.excel.GdAiResultsExcel; |
| | | import org.sxkj.gd.airesults.wrapper.GdAiResultsWrapper; |
| | | import org.sxkj.gd.airesults.service.IGdAiResultsService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.tool.constant.BladeConstant; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | import java.util.Map; |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * AI成果表 控制器 |
| | | * |
| | | * @author lw |
| | | * @since 2026-02-28 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("airesults/gdAiResults") |
| | | @Api(value = "AI成果表", tags = "AI成果表接口") |
| | | public class GdAiResultsController extends BladeController { |
| | | |
| | | private final IGdAiResultsService gdAiResultsService; |
| | | |
| | | /** |
| | | * AI成果表 详情 |
| | | * |
| | | * @param gdAiResults 查询参数 |
| | | * @return AI成果详情信息 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入gdAiResults") |
| | | public R<GdAiResultsVO> detail(GdAiResultsParam gdAiResults) { |
| | | GdAiResultsEntity detail = gdAiResultsService.getOne(Condition.getQueryWrapper(GenericConverter.convert(gdAiResults, GdAiResultsEntity.class))); |
| | | return R.data(GdAiResultsWrapper.build().entityVO(detail)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * AI成果表 自定义分页 |
| | | * |
| | | * @param gdAiResults 查询参数 |
| | | * @param query 分页参数 |
| | | * @return AI成果分页列表 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入gdAiResults") |
| | | public R<IPage<GdAiResultsVO>> page(GdAiResultsPageParam gdAiResults, Query query) { |
| | | IPage<GdAiResultsVO> pages = gdAiResultsService.selectGdAiResultsPage(Condition.getPage(query), gdAiResults); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * AI成果表 新增或修改 |
| | | * |
| | | * @param gdAiResults 新增或修改参数 |
| | | * @return 操作结果 |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入gdAiResults") |
| | | public R submit(@Valid @RequestBody GdAiResultsAddParam gdAiResults) { |
| | | return R.status(gdAiResultsService.saveOrUpdateAiResults(GenericConverter.convert(gdAiResults, GdAiResultsEntity.class))); |
| | | } |
| | | |
| | | /** |
| | | * AI成果表 删除 |
| | | * |
| | | * @param ids 主键集合 |
| | | * @return 操作结果 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "逻辑删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(gdAiResultsService.deleteLogic(Func.toLongList(ids))); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.sxkj.gd.airesults.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | |
| | | /** |
| | | * AI成果表 数据传输对象实体类 |
| | | * |
| | | * @author lw |
| | | * @since 2026-02-28 |
| | | */ |
| | | @Data |
| | | public class GdAiResultsDTO implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty("主键id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | |
| | | /** |
| | | * AI流请求key |
| | | */ |
| | | @ApiModelProperty(value = "AI流请求key") |
| | | private String aiReqKey; |
| | | |
| | | /** |
| | | * 识别结果附件地址无框 |
| | | */ |
| | | @ApiModelProperty(value = "识别结果附件地址无框") |
| | | private String orgAttUrl; |
| | | |
| | | /** |
| | | * 识别框坐标点,格式:x1,y1,x2,y2,x3,y3,x4,y4 |
| | | */ |
| | | @ApiModelProperty(value = "识别框坐标点,格式:x1,y1,x2,y2,x3,y3,x4,y4") |
| | | private List<String> points; |
| | | |
| | | /** |
| | | * 区域编码 |
| | | */ |
| | | @ApiModelProperty(value = "区域编码") |
| | | private String areaCode; |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | @ApiModelProperty(value = "创建人") |
| | | private Long createUser; |
| | | |
| | | /** |
| | | * 创建部门 |
| | | */ |
| | | @ApiModelProperty(value = "创建部门") |
| | | private Long createDept; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 更新人 |
| | | */ |
| | | @ApiModelProperty(value = "更新人") |
| | | private Long updateUser; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @ApiModelProperty(value = "更新时间") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 状态(0正常 1停用) |
| | | */ |
| | | @ApiModelProperty(value = "状态(0正常 1停用)") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 删除标志(0存在 1删除) |
| | | */ |
| | | @ApiModelProperty(value = "删除标志(0存在 1删除)") |
| | | private Integer isDeleted; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.sxkj.gd.airesults.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.core.mp.base.BaseEntity; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * AI成果表 实体类 |
| | | * |
| | | * @author lw |
| | | * @since 2026-02-28 |
| | | */ |
| | | @Data |
| | | @TableName(value = "ja_gd_ai_results", autoResultMap = true) |
| | | @ApiModel(value = "GdAiResults对象", description = "AI成果表") |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class GdAiResultsEntity extends BaseEntity { |
| | | |
| | | /** |
| | | * AI流请求key |
| | | */ |
| | | @ApiModelProperty(value = "AI流请求key") |
| | | private String aiReqKey; |
| | | |
| | | /** |
| | | * 识别结果附件地址无框 |
| | | */ |
| | | @ApiModelProperty(value = "识别结果附件地址无框") |
| | | private String orgAttUrl; |
| | | |
| | | /** |
| | | * 识别框坐标点,格式:x1,y1,x2,y2,x3,y3,x4,y4 |
| | | */ |
| | | @ApiModelProperty(value = "识别框坐标点,格式:x1,y1,x2,y2,x3,y3,x4,y4") |
| | | // @TableField(typeHandler = JacksonTypeHandler.class) |
| | | private String points; |
| | | |
| | | /** |
| | | * 区域编码 |
| | | */ |
| | | @ApiModelProperty(value = "区域编码") |
| | | private String areaCode; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.sxkj.gd.airesults.excel; |
| | | |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.write.style.ColumnWidth; |
| | | import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
| | | import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | |
| | | /** |
| | | * AI成果表 Excel实体类 |
| | | * |
| | | * @author lw |
| | | * @since 2026-02-28 |
| | | */ |
| | | @Data |
| | | @ColumnWidth(25) |
| | | @HeadRowHeight(20) |
| | | @ContentRowHeight(18) |
| | | public class GdAiResultsExcel implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * AI流请求key |
| | | */ |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("AI流请求key") |
| | | private String aiReqKey; |
| | | |
| | | /** |
| | | * 识别结果附件地址无框 |
| | | */ |
| | | @ColumnWidth(30) |
| | | @ExcelProperty("识别结果附件地址无框") |
| | | private String orgAttUrl; |
| | | |
| | | /** |
| | | * 区域编码 |
| | | */ |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("区域编码") |
| | | private String areaCode; |
| | | |
| | | /** |
| | | * 状态(0正常 1停用) |
| | | */ |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("状态") |
| | | private String status; |
| | | |
| | | /** |
| | | * 删除标志(0存在 1删除) |
| | | */ |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("删除标志") |
| | | private Byte isDeleted; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.sxkj.gd.airesults.mapper; |
| | | |
| | | import org.sxkj.gd.airesults.entity.GdAiResultsEntity; |
| | | import org.sxkj.gd.airesults.param.GdAiResultsPageParam; |
| | | import org.sxkj.gd.airesults.vo.GdAiResultsVO; |
| | | import org.sxkj.gd.airesults.excel.GdAiResultsExcel; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * AI成果表 Mapper 接口 |
| | | * |
| | | * @author lw |
| | | * @since 2026-02-28 |
| | | */ |
| | | public interface GdAiResultsMapper extends BaseMapper<GdAiResultsEntity> { |
| | | |
| | | /** |
| | | * 自定义分页查询 |
| | | * |
| | | * @param page 分页对象 |
| | | * @param gdAiResults 查询参数 |
| | | * @return AI成果VO列表 |
| | | */ |
| | | List<GdAiResultsVO> selectGdAiResultsPage(IPage page, GdAiResultsPageParam gdAiResults); |
| | | |
| | | /** |
| | | * 获取导出数据 |
| | | * |
| | | * @param queryWrapper 查询条件 |
| | | * @return AI成果Excel列表 |
| | | */ |
| | | List<GdAiResultsExcel> exportGdAiResults(@Param("ew") Wrapper<GdAiResultsEntity> queryWrapper); |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.sxkj.gd.airesults.mapper.GdAiResultsMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="gdAiResultsResultMap" type="org.sxkj.gd.airesults.entity.GdAiResultsEntity"> |
| | | <result column="id" property="id"/> |
| | | <result column="ai_req_key" property="aiReqKey"/> |
| | | <result column="org_att_url" property="orgAttUrl"/> |
| | | <result column="points" property="points" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/> |
| | | <result column="area_code" property="areaCode"/> |
| | | <result column="create_user" property="createUser"/> |
| | | <result column="create_dept" property="createDept"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_user" property="updateUser"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | <result column="status" property="status"/> |
| | | <result column="is_deleted" property="isDeleted"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="gdAiResultsVOResultMap" type="org.sxkj.gd.airesults.vo.GdAiResultsVO"> |
| | | <result column="id" property="id"/> |
| | | <result column="ai_req_key" property="aiReqKey"/> |
| | | <result column="org_att_url" property="orgAttUrl"/> |
| | | <result column="points" property="points"/> |
| | | <result column="area_code" property="areaCode"/> |
| | | </resultMap> |
| | | |
| | | <select id="selectGdAiResultsPage" resultMap="gdAiResultsVOResultMap"> |
| | | select |
| | | * |
| | | from |
| | | ja_gd_ai_results |
| | | <where> |
| | | is_deleted = 0 |
| | | <if test="param2.aiReqKey != null and param2.aiReqKey != ''"> |
| | | and ai_req_key = #{param2.aiReqKey} |
| | | </if> |
| | | |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | <select id="exportGdAiResults" resultType="org.sxkj.gd.airesults.excel.GdAiResultsExcel"> |
| | | SELECT * FROM ja_gd_ai_results ${ew.customSqlSegment} |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | package org.sxkj.gd.airesults.param; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * AI成果表 新增/修改参数类 |
| | | * |
| | | * @author lw |
| | | * @since 2026-02-28 |
| | | */ |
| | | @Data |
| | | public class GdAiResultsAddParam { |
| | | @ApiModelProperty("主键id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | |
| | | /** |
| | | * AI流请求key |
| | | */ |
| | | @ApiModelProperty(value = "AI流请求key") |
| | | private String aiReqKey; |
| | | |
| | | /** |
| | | * 识别结果附件地址无框 |
| | | */ |
| | | @ApiModelProperty(value = "识别结果附件地址无框") |
| | | private String orgAttUrl; |
| | | |
| | | /** |
| | | * 识别框坐标点,格式:x1,y1,x2,y2,x3,y3,x4,y4 |
| | | */ |
| | | @ApiModelProperty(value = "识别框坐标点,格式:x1,y1,x2,y2,x3,y3,x4,y4") |
| | | private List<String> points; |
| | | |
| | | /** |
| | | * 区域编码 |
| | | */ |
| | | @ApiModelProperty(value = "区域编码") |
| | | private String areaCode; |
| | | } |
| New file |
| | |
| | | package org.sxkj.gd.airesults.param; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * AI成果表 分页查询参数类 |
| | | * |
| | | * @author lw |
| | | * @since 2026-02-28 |
| | | */ |
| | | @Data |
| | | public class GdAiResultsPageParam { |
| | | |
| | | /** |
| | | * AI流请求key |
| | | */ |
| | | @ApiModelProperty(value = "AI流请求key") |
| | | private String aiReqKey; |
| | | |
| | | } |
| New file |
| | |
| | | package org.sxkj.gd.airesults.param; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * AI成果表 查询参数类 |
| | | * |
| | | * @author lw |
| | | * @since 2026-02-28 |
| | | */ |
| | | @Data |
| | | public class GdAiResultsParam { |
| | | @ApiModelProperty("主键id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.sxkj.gd.airesults.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import org.sxkj.gd.airesults.entity.GdAiResultsEntity; |
| | | import org.sxkj.gd.airesults.param.GdAiResultsPageParam; |
| | | import org.sxkj.gd.airesults.vo.GdAiResultsVO; |
| | | import org.sxkj.gd.airesults.excel.GdAiResultsExcel; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * AI成果表 服务类 |
| | | * |
| | | * @author lw |
| | | * @since 2026-02-28 |
| | | */ |
| | | public interface IGdAiResultsService extends BaseService<GdAiResultsEntity> { |
| | | |
| | | /** |
| | | * 自定义分页查询 |
| | | * |
| | | * @param page 分页对象 |
| | | * @param gdAiResults 查询参数 |
| | | * @return AI成果分页结果 |
| | | */ |
| | | IPage<GdAiResultsVO> selectGdAiResultsPage(IPage<GdAiResultsVO> page, GdAiResultsPageParam gdAiResults); |
| | | |
| | | /** |
| | | * 导出数据 |
| | | * |
| | | * @param queryWrapper 查询条件 |
| | | * @return AI成果Excel列表 |
| | | */ |
| | | List<GdAiResultsExcel> exportGdAiResults(Wrapper<GdAiResultsEntity> queryWrapper); |
| | | |
| | | /** |
| | | * 新增或修改AI成果 |
| | | * |
| | | * @param entity AI成果实体对象 |
| | | * @return 保存或更新成功返回true,失败返回false |
| | | */ |
| | | boolean saveOrUpdateAiResults(GdAiResultsEntity entity); |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.sxkj.gd.airesults.service.impl; |
| | | |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.sxkj.gd.airesults.entity.GdAiResultsEntity; |
| | | import org.sxkj.gd.airesults.param.GdAiResultsPageParam; |
| | | import org.sxkj.gd.airesults.vo.GdAiResultsVO; |
| | | import org.sxkj.gd.airesults.excel.GdAiResultsExcel; |
| | | import org.sxkj.gd.airesults.mapper.GdAiResultsMapper; |
| | | import org.sxkj.gd.airesults.service.IGdAiResultsService; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * AI成果表 服务实现类 |
| | | * |
| | | * @author lw |
| | | * @since 2026-02-28 |
| | | */ |
| | | @Service |
| | | public class GdAiResultsServiceImpl extends BaseServiceImpl<GdAiResultsMapper, GdAiResultsEntity> implements IGdAiResultsService { |
| | | |
| | | /** |
| | | * 自定义分页查询 |
| | | * |
| | | * @param page 分页对象 |
| | | * @param gdAiResults 查询参数 |
| | | * @return AI成果分页结果 |
| | | */ |
| | | @Override |
| | | public IPage<GdAiResultsVO> selectGdAiResultsPage(IPage<GdAiResultsVO> page, GdAiResultsPageParam gdAiResults) { |
| | | return page.setRecords(baseMapper.selectGdAiResultsPage(page, gdAiResults)); |
| | | } |
| | | |
| | | /** |
| | | * 导出数据 |
| | | * |
| | | * @param queryWrapper 查询条件 |
| | | * @return AI成果Excel列表 |
| | | */ |
| | | @Override |
| | | public List<GdAiResultsExcel> exportGdAiResults(Wrapper<GdAiResultsEntity> queryWrapper) { |
| | | List<GdAiResultsExcel> gdAiResultsList = baseMapper.exportGdAiResults(queryWrapper); |
| | | return gdAiResultsList; |
| | | } |
| | | |
| | | /** |
| | | * 新增或修改AI成果 |
| | | * |
| | | * @param entity AI成果实体对象 |
| | | * @return 保存或更新成功返回true,失败返回false |
| | | */ |
| | | @Override |
| | | public boolean saveOrUpdateAiResults(GdAiResultsEntity entity) { |
| | | // 步骤1:校验AI流请求key是否为空 |
| | | if (StringUtil.isNotBlank(entity.getAiReqKey())) { |
| | | // 步骤2:查询数据库中是否存在相同AI流请求key的记录 |
| | | Long count = baseMapper.selectCount( |
| | | new com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<GdAiResultsEntity>() |
| | | .eq(GdAiResultsEntity::getAiReqKey, entity.getAiReqKey()) |
| | | .ne(entity.getId() != null, GdAiResultsEntity::getId, entity.getId()) |
| | | ); |
| | | // 步骤3:如果存在重复的AI流请求key,抛出异常 |
| | | if (count > 0) { |
| | | throw new RuntimeException("AI流请求key已存在,请使用其他key"); |
| | | } |
| | | } |
| | | // 步骤4:执行保存或更新操作 |
| | | return saveOrUpdate(entity); |
| | | } |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.sxkj.gd.airesults.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | |
| | | /** |
| | | * AI成果表 视图实体类 |
| | | * |
| | | * @author lw |
| | | * @since 2026-02-28 |
| | | */ |
| | | @Data |
| | | public class GdAiResultsVO implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty("主键id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | |
| | | /** |
| | | * AI流请求key |
| | | */ |
| | | @ApiModelProperty(value = "AI流请求key") |
| | | private String aiReqKey; |
| | | |
| | | /** |
| | | * 识别结果附件地址无框 |
| | | */ |
| | | @ApiModelProperty(value = "识别结果附件地址无框") |
| | | private String orgAttUrl; |
| | | |
| | | /** |
| | | * 识别框坐标点,格式:x1,y1,x2,y2,x3,y3,x4,y4 |
| | | */ |
| | | @ApiModelProperty(value = "识别框坐标点,格式:x1,y1,x2,y2,x3,y3,x4,y4") |
| | | private String points; |
| | | |
| | | /** |
| | | * 区域编码 |
| | | */ |
| | | @ApiModelProperty(value = "区域编码") |
| | | private String areaCode; |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.sxkj.gd.airesults.wrapper; |
| | | |
| | | import org.springblade.core.mp.support.BaseEntityWrapper; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.sxkj.gd.airesults.entity.GdAiResultsEntity; |
| | | import org.sxkj.gd.airesults.vo.GdAiResultsVO; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * AI成果表 包装类,返回视图层所需的字段 |
| | | * |
| | | * @author lw |
| | | * @since 2026-02-28 |
| | | */ |
| | | public class GdAiResultsWrapper extends BaseEntityWrapper<GdAiResultsEntity, GdAiResultsVO> { |
| | | |
| | | /** |
| | | * 构建Wrapper实例 |
| | | * |
| | | * @return Wrapper实例 |
| | | */ |
| | | public static GdAiResultsWrapper build() { |
| | | return new GdAiResultsWrapper(); |
| | | } |
| | | |
| | | /** |
| | | * 实体转VO |
| | | * |
| | | * @param entity AI成果实体对象 |
| | | * @return AI成果VO对象 |
| | | */ |
| | | @Override |
| | | public GdAiResultsVO entityVO(GdAiResultsEntity entity) { |
| | | GdAiResultsVO vo = Objects.requireNonNull(BeanUtil.copy(entity, GdAiResultsVO.class)); |
| | | return vo; |
| | | } |
| | | |
| | | |
| | | } |