在架构的强迫下,提交了一堆没写完的bug
parent
92c8e88559
commit
bc3ff687f6
@ -1,81 +0,0 @@
|
|||||||
package com.docus.server.api.segmentation;
|
|
||||||
|
|
||||||
import com.docus.infrastructure.web.request.SearchDTO;
|
|
||||||
import com.docus.infrastructure.web.response.PageResult;
|
|
||||||
import com.docus.server.dto.segmentation.ocrsprule.AddOcrSpRuleDTO;
|
|
||||||
import com.docus.server.dto.segmentation.ocrsprule.DeleteOcrSpRuleDTO;
|
|
||||||
import com.docus.server.dto.segmentation.ocrsprule.EditOcrSpRuleDTO;
|
|
||||||
import com.docus.server.vo.segmentation.ocrsprule.OcrSpRuleVO;
|
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 特殊策略表 API
|
|
||||||
*
|
|
||||||
* @author AutoGenerator
|
|
||||||
* @since 2023-08-21
|
|
||||||
*/
|
|
||||||
@FeignClient(value = "docus-segmentation", contextId = "docus-segmentation.OcrSpRuleApi")
|
|
||||||
@RequestMapping("/ocr/SpRule")
|
|
||||||
public interface OcrSpRuleApi {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 按主键查询
|
|
||||||
*
|
|
||||||
* @param id 主键id
|
|
||||||
* @return 实体
|
|
||||||
*/
|
|
||||||
@GetMapping("/find/{id}")
|
|
||||||
OcrSpRuleVO findById(@PathVariable(value = "id") Long id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询所有
|
|
||||||
*
|
|
||||||
* @return 实体
|
|
||||||
*/
|
|
||||||
@GetMapping("/findAll")
|
|
||||||
List<OcrSpRuleVO> findAll();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关键字搜索
|
|
||||||
*
|
|
||||||
* @param searchDTO 搜索参数
|
|
||||||
* @return 分页列表
|
|
||||||
*/
|
|
||||||
@PostMapping("/search")
|
|
||||||
PageResult<OcrSpRuleVO> search(@RequestBody SearchDTO searchDTO);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增
|
|
||||||
*
|
|
||||||
* @param addOcrSpRuleDTO 新增参数
|
|
||||||
*/
|
|
||||||
@PostMapping("/add")
|
|
||||||
boolean add(@RequestBody AddOcrSpRuleDTO addOcrSpRuleDTO);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑
|
|
||||||
*
|
|
||||||
* @param editOcrSpRuleDTO 编辑参数
|
|
||||||
*/
|
|
||||||
@PutMapping("/edit")
|
|
||||||
boolean edit(@RequestBody EditOcrSpRuleDTO editOcrSpRuleDTO);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除
|
|
||||||
*
|
|
||||||
* @param deleteOcrSpRuleDTO 删除参数
|
|
||||||
* @return 成功或失败
|
|
||||||
*/
|
|
||||||
@DeleteMapping("/delete")
|
|
||||||
int delete(@RequestBody DeleteOcrSpRuleDTO deleteOcrSpRuleDTO);
|
|
||||||
}
|
|
@ -1,44 +0,0 @@
|
|||||||
package com.docus.server.dto.segmentation.ocrsprule;
|
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
import com.docus.server.enums.*;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* 特殊策略表 AddDTO
|
|
||||||
*
|
|
||||||
* @author AutoGenerator
|
|
||||||
* @since 2023-08-21
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
@ApiModel(value="AddOcrSpRuleDTO对象", description="特殊策略表")
|
|
||||||
public class AddOcrSpRuleDTO implements Serializable {
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "id")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
private String assortId;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "规则开始json")
|
|
||||||
private String startJson;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "规则结束json")
|
|
||||||
private String endJson;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,34 +0,0 @@
|
|||||||
package com.docus.server.dto.segmentation.ocrsprule;
|
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
import com.docus.server.enums.*;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* 特殊策略表 DeleteDTO
|
|
||||||
*
|
|
||||||
* @author AutoGenerator
|
|
||||||
* @since 2023-08-21
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
@ApiModel(value="DeleteOcrSpRuleDTO对象", description="特殊策略表")
|
|
||||||
public class DeleteOcrSpRuleDTO implements Serializable {
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "ids")
|
|
||||||
private List<Long> ids;
|
|
||||||
|
|
||||||
}
|
|
@ -1,44 +0,0 @@
|
|||||||
package com.docus.server.dto.segmentation.ocrsprule;
|
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
import com.docus.server.enums.*;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* 特殊策略表 EditDTO
|
|
||||||
*
|
|
||||||
* @author AutoGenerator
|
|
||||||
* @since 2023-08-21
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
@ApiModel(value="EditOcrSpRuleDTO对象", description="特殊策略表")
|
|
||||||
public class EditOcrSpRuleDTO implements Serializable {
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "id")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
private String assortId;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "规则开始json")
|
|
||||||
private String startJson;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "规则结束json")
|
|
||||||
private String endJson;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -0,0 +1,28 @@
|
|||||||
|
package com.docus.server.entity.segmentation;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
public class OcrRuleJson {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分段id")
|
||||||
|
private String assortId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分段名称")
|
||||||
|
private String assortName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "占比分")
|
||||||
|
private Integer matchRatio;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "匹配关键词 多个#分割")
|
||||||
|
private String keyWord;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package com.docus.server.entity.segmentation;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class OcrRuleResult {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -1,49 +0,0 @@
|
|||||||
package com.docus.server.entity.segmentation;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 特殊策略表
|
|
||||||
*
|
|
||||||
* @author AutoGenerator
|
|
||||||
* @since 2023-08-21
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@TableName("ocr_sp_rule")
|
|
||||||
@ApiModel(value = "OcrSpRule对象", description = "特殊策略表")
|
|
||||||
public class OcrSpRule implements Serializable {
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "id")
|
|
||||||
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
@TableField("assort_id")
|
|
||||||
private String assortId;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "规则开始json")
|
|
||||||
@TableField("start_json")
|
|
||||||
private String startJson;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "规则结束json")
|
|
||||||
@TableField("end_json")
|
|
||||||
private String endJson;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -0,0 +1,13 @@
|
|||||||
|
package com.docus.server.entity.segmentation;
|
||||||
|
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class OcrSpecialResult {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
package com.docus.server.entity.segmentation;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
public class OcrSpecialRuleJson {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "命中分数")
|
||||||
|
private Integer score;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "匹配关键词 多个#分割")
|
||||||
|
private String keyWord;
|
||||||
|
|
||||||
|
}
|
@ -1,44 +0,0 @@
|
|||||||
package com.docus.server.vo.segmentation.ocrsprule;
|
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
import com.docus.server.enums.*;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* 特殊策略表 VO
|
|
||||||
*
|
|
||||||
* @author AutoGenerator
|
|
||||||
* @since 2023-08-21
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
@ApiModel(value="OcrSpRuleVO对象", description="特殊策略表")
|
|
||||||
public class OcrSpRuleVO implements Serializable {
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "id")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
private String assortId;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "规则开始json")
|
|
||||||
private String startJson;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "规则结束json")
|
|
||||||
private String endJson;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,100 +0,0 @@
|
|||||||
package com.docus.server.controller;
|
|
||||||
|
|
||||||
import com.docus.infrastructure.web.request.SearchDTO;
|
|
||||||
import com.docus.infrastructure.web.response.PageResult;
|
|
||||||
import com.docus.server.api.segmentation.OcrSpRuleApi;
|
|
||||||
import com.docus.server.dto.segmentation.ocrsprule.AddOcrSpRuleDTO;
|
|
||||||
import com.docus.server.dto.segmentation.ocrsprule.DeleteOcrSpRuleDTO;
|
|
||||||
import com.docus.server.dto.segmentation.ocrsprule.EditOcrSpRuleDTO;
|
|
||||||
import com.docus.server.service.IOcrSpRuleService;
|
|
||||||
import com.docus.server.vo.segmentation.ocrsprule.OcrSpRuleVO;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 特殊策略表 控制器类
|
|
||||||
*
|
|
||||||
* @author AutoGenerator
|
|
||||||
* @since 2023-08-21
|
|
||||||
*/
|
|
||||||
@Api(value = "特殊策略表", tags = "特殊策略表")
|
|
||||||
@RestController
|
|
||||||
public class OcrSpRuleController implements OcrSpRuleApi {
|
|
||||||
@Resource
|
|
||||||
private IOcrSpRuleService iOcrSpRuleService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 按主键查询
|
|
||||||
*
|
|
||||||
* @param id 主键Id
|
|
||||||
* @return 实体
|
|
||||||
*/
|
|
||||||
@ApiOperation("按主键查询")
|
|
||||||
@Override
|
|
||||||
public OcrSpRuleVO findById(Long id) {
|
|
||||||
return iOcrSpRuleService.findById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询所有
|
|
||||||
*
|
|
||||||
* @return 实体
|
|
||||||
*/
|
|
||||||
@ApiOperation("查询所有")
|
|
||||||
@Override
|
|
||||||
public List<OcrSpRuleVO> findAll() {
|
|
||||||
return iOcrSpRuleService.findAll();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关键字搜索
|
|
||||||
*
|
|
||||||
* @param searchDTO 搜索参数
|
|
||||||
* @return 分页列表
|
|
||||||
*/
|
|
||||||
@ApiOperation("关键字搜索")
|
|
||||||
@Override
|
|
||||||
public PageResult<OcrSpRuleVO> search(SearchDTO searchDTO) {
|
|
||||||
return iOcrSpRuleService.search(searchDTO);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增
|
|
||||||
*
|
|
||||||
* @param addOcrSpRuleDTO 编辑参数
|
|
||||||
* @return 成功或失败
|
|
||||||
*/
|
|
||||||
@ApiOperation("新增")
|
|
||||||
@Override
|
|
||||||
public boolean add(AddOcrSpRuleDTO addOcrSpRuleDTO) {
|
|
||||||
return iOcrSpRuleService.add(addOcrSpRuleDTO);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑
|
|
||||||
*
|
|
||||||
* @param editOcrSpRuleDTO 编辑参数
|
|
||||||
* @return 成功或失败
|
|
||||||
*/
|
|
||||||
@ApiOperation("编辑")
|
|
||||||
@Override
|
|
||||||
public boolean edit(EditOcrSpRuleDTO editOcrSpRuleDTO) {
|
|
||||||
return iOcrSpRuleService.edit(editOcrSpRuleDTO);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除
|
|
||||||
*
|
|
||||||
* @param deleteOcrSpRuleDTO 删除参数
|
|
||||||
* @return 成功或失败
|
|
||||||
*/
|
|
||||||
@ApiOperation("批量删除")
|
|
||||||
@Override
|
|
||||||
public int delete(DeleteOcrSpRuleDTO deleteOcrSpRuleDTO) {
|
|
||||||
return iOcrSpRuleService.delete(deleteOcrSpRuleDTO);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,49 +0,0 @@
|
|||||||
package com.docus.server.convert;
|
|
||||||
|
|
||||||
import com.docus.infrastructure.web.response.PageResult;
|
|
||||||
import com.docus.server.entity.segmentation.OcrSpRule;
|
|
||||||
import com.docus.server.dto.segmentation.ocrsprule.AddOcrSpRuleDTO;
|
|
||||||
import com.docus.server.dto.segmentation.ocrsprule.EditOcrSpRuleDTO;
|
|
||||||
import com.docus.server.dto.segmentation.ocrsprule.DeleteOcrSpRuleDTO;
|
|
||||||
import com.docus.server.vo.segmentation.ocrsprule.OcrSpRuleVO;
|
|
||||||
|
|
||||||
import org.mapstruct.Mapper;
|
|
||||||
import org.mapstruct.Mappings;
|
|
||||||
import org.mapstruct.factory.Mappers;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* 特殊策略表 服务转换器
|
|
||||||
*
|
|
||||||
* @author AutoGenerator
|
|
||||||
* @since 2023-08-21
|
|
||||||
*/
|
|
||||||
@Mapper
|
|
||||||
public interface OcrSpRuleConvert {
|
|
||||||
|
|
||||||
OcrSpRuleConvert INSTANCE = Mappers.getMapper(OcrSpRuleConvert.class);
|
|
||||||
|
|
||||||
@Mappings({})
|
|
||||||
OcrSpRule convertDO(AddOcrSpRuleDTO addOcrSpRuleDTO);
|
|
||||||
|
|
||||||
@Mappings({})
|
|
||||||
OcrSpRule convertDO(EditOcrSpRuleDTO editOcrSpRuleDTO);
|
|
||||||
|
|
||||||
@Mappings({})
|
|
||||||
List<OcrSpRule> convertAddDOList(List<AddOcrSpRuleDTO> addOcrSpRuleDTO);
|
|
||||||
|
|
||||||
@Mappings({})
|
|
||||||
List<OcrSpRule> convertEditDOList(List<EditOcrSpRuleDTO> editOcrSpRuleDTO);
|
|
||||||
|
|
||||||
@Mappings({})
|
|
||||||
OcrSpRuleVO convertVO(OcrSpRule ocrSpRule);
|
|
||||||
|
|
||||||
@Mappings({})
|
|
||||||
List<OcrSpRuleVO> convertVO(List<OcrSpRule> ocrSpRuleList);
|
|
||||||
|
|
||||||
@Mappings({})
|
|
||||||
PageResult<OcrSpRuleVO> convertVO(PageResult<OcrSpRule> pageResult);
|
|
||||||
}
|
|
||||||
|
|
@ -1,65 +0,0 @@
|
|||||||
package com.docus.server.infrastructure.dao;
|
|
||||||
|
|
||||||
import com.docus.infrastructure.core.db.dao.IBaseDao;
|
|
||||||
import com.docus.infrastructure.web.request.SearchDTO;
|
|
||||||
import com.docus.infrastructure.web.response.PageResult;
|
|
||||||
import com.docus.server.entity.segmentation.OcrSpRule;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 特殊策略表 数据访问接口
|
|
||||||
*
|
|
||||||
* @author AutoGenerator
|
|
||||||
* @since 2023-08-21
|
|
||||||
*/
|
|
||||||
public interface IOcrSpRuleDao extends IBaseDao<OcrSpRule> {
|
|
||||||
/**
|
|
||||||
* 按主键查询
|
|
||||||
*
|
|
||||||
* @param id 主键id
|
|
||||||
* @return 实体
|
|
||||||
*/
|
|
||||||
OcrSpRule findById(Long id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增
|
|
||||||
*
|
|
||||||
* @param ocrSpRule 新增参数
|
|
||||||
* @return 成功或失败
|
|
||||||
*/
|
|
||||||
boolean add(OcrSpRule ocrSpRule);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑
|
|
||||||
*
|
|
||||||
* @param ocrSpRule 编辑参数
|
|
||||||
* @return 成功或失败
|
|
||||||
*/
|
|
||||||
boolean edit(OcrSpRule ocrSpRule);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除
|
|
||||||
*
|
|
||||||
* @param ids 主键ids
|
|
||||||
* @return 成功或失败
|
|
||||||
*/
|
|
||||||
int delete(List<Long> ids);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关键字搜索
|
|
||||||
*
|
|
||||||
* @param searchDTO 搜索参数
|
|
||||||
* @return 分页列表
|
|
||||||
*/
|
|
||||||
PageResult<OcrSpRule> search(SearchDTO searchDTO);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 名称不重复
|
|
||||||
*
|
|
||||||
* @param id 主键
|
|
||||||
* @param name 名称
|
|
||||||
* @return 名称重复数量
|
|
||||||
*/
|
|
||||||
int findByIdAndName(Long id, String name);
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
package com.docus.server.infrastructure.mapper;
|
|
||||||
|
|
||||||
import com.docus.server.entity.segmentation.OcrSpRule;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* 特殊策略表 Mapper 接口
|
|
||||||
*
|
|
||||||
* @author AutoGenerator
|
|
||||||
* @since 2023-08-21
|
|
||||||
*/
|
|
||||||
@Mapper
|
|
||||||
public interface OcrSpRuleMapper extends BaseMapper<OcrSpRule> {
|
|
||||||
|
|
||||||
}
|
|
@ -1,65 +0,0 @@
|
|||||||
package com.docus.server.service;
|
|
||||||
|
|
||||||
import com.docus.infrastructure.web.request.SearchDTO;
|
|
||||||
import com.docus.infrastructure.web.response.PageResult;
|
|
||||||
import com.docus.server.dto.segmentation.ocrsprule.AddOcrSpRuleDTO;
|
|
||||||
import com.docus.server.dto.segmentation.ocrsprule.DeleteOcrSpRuleDTO;
|
|
||||||
import com.docus.server.dto.segmentation.ocrsprule.EditOcrSpRuleDTO;
|
|
||||||
import com.docus.server.vo.segmentation.ocrsprule.OcrSpRuleVO;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 特殊策略表 服务接口
|
|
||||||
*
|
|
||||||
* @author AutoGenerator
|
|
||||||
* @since 2023-08-21
|
|
||||||
*/
|
|
||||||
public interface IOcrSpRuleService {
|
|
||||||
/**
|
|
||||||
* 按主键查询
|
|
||||||
*
|
|
||||||
* @param id 主键id
|
|
||||||
* @return 实体
|
|
||||||
*/
|
|
||||||
OcrSpRuleVO findById(Long id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询所有
|
|
||||||
*
|
|
||||||
* @return 实体
|
|
||||||
*/
|
|
||||||
List<OcrSpRuleVO> findAll();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增
|
|
||||||
*
|
|
||||||
* @param addOcrSpRuleDTO 新增参数
|
|
||||||
* @return 成功或失败
|
|
||||||
*/
|
|
||||||
boolean add(AddOcrSpRuleDTO addOcrSpRuleDTO);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑
|
|
||||||
*
|
|
||||||
* @param editOcrSpRuleDTO 编辑参数
|
|
||||||
* @return 成功或失败
|
|
||||||
*/
|
|
||||||
boolean edit(EditOcrSpRuleDTO editOcrSpRuleDTO);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除
|
|
||||||
*
|
|
||||||
* @param deleteOcrSpRuleDTO 删除参数
|
|
||||||
* @return 成功或失败
|
|
||||||
*/
|
|
||||||
int delete(DeleteOcrSpRuleDTO deleteOcrSpRuleDTO);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关键字搜索
|
|
||||||
*
|
|
||||||
* @param searchDTO 搜索参数
|
|
||||||
* @return 分页列表
|
|
||||||
*/
|
|
||||||
PageResult<OcrSpRuleVO> search(SearchDTO searchDTO);
|
|
||||||
}
|
|
@ -1,145 +0,0 @@
|
|||||||
package com.docus.server.service.impl;
|
|
||||||
|
|
||||||
import com.docus.infrastructure.redis.service.IdService;
|
|
||||||
import com.docus.infrastructure.web.request.SearchDTO;
|
|
||||||
import com.docus.infrastructure.web.response.PageResult;
|
|
||||||
import com.docus.server.convert.OcrSpRuleConvert;
|
|
||||||
import com.docus.server.dto.segmentation.ocrsprule.AddOcrSpRuleDTO;
|
|
||||||
import com.docus.server.dto.segmentation.ocrsprule.DeleteOcrSpRuleDTO;
|
|
||||||
import com.docus.server.dto.segmentation.ocrsprule.EditOcrSpRuleDTO;
|
|
||||||
import com.docus.server.entity.segmentation.OcrSpRule;
|
|
||||||
import com.docus.server.infrastructure.dao.IOcrSpRuleDao;
|
|
||||||
import com.docus.server.service.IOcrSpRuleService;
|
|
||||||
import com.docus.server.vo.segmentation.ocrsprule.OcrSpRuleVO;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 特殊策略表 服务实现类
|
|
||||||
*
|
|
||||||
* @author AutoGenerator
|
|
||||||
* @since 2023-08-21
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class OcrSpRuleServiceImpl implements IOcrSpRuleService {
|
|
||||||
@Resource
|
|
||||||
private IOcrSpRuleDao iOcrSpRuleDao;
|
|
||||||
@Resource
|
|
||||||
private IdService idService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 按主键查询
|
|
||||||
*
|
|
||||||
* @param id 主键Id
|
|
||||||
* @return 实体
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public OcrSpRuleVO findById(Long id) {
|
|
||||||
return OcrSpRuleConvert.INSTANCE.convertVO(iOcrSpRuleDao.findById(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询所有
|
|
||||||
*
|
|
||||||
* @return 实体
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<OcrSpRuleVO> findAll() {
|
|
||||||
return OcrSpRuleConvert.INSTANCE.convertVO(iOcrSpRuleDao.findAll());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关键字搜索
|
|
||||||
*
|
|
||||||
* @param searchDTO 搜索参数
|
|
||||||
* @return 分页列表
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public PageResult<OcrSpRuleVO> search(SearchDTO searchDTO) {
|
|
||||||
return OcrSpRuleConvert.INSTANCE.convertVO(iOcrSpRuleDao.search(searchDTO));
|
|
||||||
|
|
||||||
//PageResult<OcrSpRuleVO> result = OcrSpRuleConvert.INSTANCE.convertVO(iOcrSpRuleDao.search(searchDTO));
|
|
||||||
|
|
||||||
//if (CollectionUtils.isEmpty(result.getList())) {
|
|
||||||
//return new PageResult<>();
|
|
||||||
//}
|
|
||||||
|
|
||||||
//Map<String, SchSystemParams> map = iSchSystemParamsService.find(ListUtils.distinctSelect(result.getList(), SchCollectorVO::getCollectorId));
|
|
||||||
|
|
||||||
//result.getList().forEach(p -> {
|
|
||||||
// String collectorId = String.valueOf(p.getCollectorId());
|
|
||||||
// if (map.containsKey(collectorId)) {
|
|
||||||
// p.setCollectorName(map.get(collectorId).getParamName());
|
|
||||||
// }
|
|
||||||
//});
|
|
||||||
|
|
||||||
//return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增
|
|
||||||
*
|
|
||||||
* @param addOcrSpRuleDTO 编辑参数
|
|
||||||
* @return 成功或失败
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public boolean add(AddOcrSpRuleDTO addOcrSpRuleDTO) {
|
|
||||||
OcrSpRule ocrSpRule = OcrSpRuleConvert.INSTANCE.convertDO(addOcrSpRuleDTO);
|
|
||||||
ocrSpRule.setId(idService.getDateSeq());
|
|
||||||
return iOcrSpRuleDao.add(ocrSpRule);
|
|
||||||
|
|
||||||
// String name = addOcrSpRuleDTO.getName();
|
|
||||||
|
|
||||||
//OcrSpRule ocrSpRule = iOcrSpRuleDao.findOneBy("name", name);
|
|
||||||
|
|
||||||
//if (Func.notNull(ocrSpRule)) {
|
|
||||||
// throw new ApiException(ExceptionCode.ParamIllegal.getCode(), "特殊策略表已经存在");
|
|
||||||
// }
|
|
||||||
|
|
||||||
// OcrSpRule ocrSpRule =OcrSpRuleConvert.INSTANCE.convertDO(addOcrSpRuleDTO);
|
|
||||||
// ocrSpRule.setId(idService.getDateSeq());
|
|
||||||
|
|
||||||
// return iOcrSpRuleDao.add(schCollector);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑
|
|
||||||
*
|
|
||||||
* @param editOcrSpRuleDTO 编辑参数
|
|
||||||
* @return 成功或失败
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public boolean edit(EditOcrSpRuleDTO editOcrSpRuleDTO) {
|
|
||||||
OcrSpRule ocrSpRule = OcrSpRuleConvert.INSTANCE.convertDO(editOcrSpRuleDTO);
|
|
||||||
return iOcrSpRuleDao.edit(ocrSpRule);
|
|
||||||
|
|
||||||
// Long id = editOcrSpRuleDTO.getId();
|
|
||||||
|
|
||||||
// OcrSpRule ocrSpRule = iOcrSpRuleDao.findById(id);
|
|
||||||
|
|
||||||
// if (Func.isNull(ocrSpRule)) {
|
|
||||||
// throw new ApiException(ExceptionCode.ParamIllegal.getCode(), "特殊策略表,无法更新!");
|
|
||||||
// }
|
|
||||||
|
|
||||||
// ocrSpRule.setUpdateTime(LocalDateTime.now());
|
|
||||||
// return iOcrSpRuleDao.edit(ocrSpRule);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除
|
|
||||||
*
|
|
||||||
* @param deleteOcrSpRuleDTO 删除参数
|
|
||||||
* @return 成功或失败
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int delete(DeleteOcrSpRuleDTO deleteOcrSpRuleDTO) {
|
|
||||||
return iOcrSpRuleDao.delete(deleteOcrSpRuleDTO.getIds());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
|||||||
<?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="com.docus.server.infrastructure.mapper.OcrSpRuleMapper">
|
|
||||||
|
|
||||||
<!-- 通用查询映射结果 -->
|
|
||||||
<resultMap id="BaseResultMap"
|
|
||||||
type="com.docus.server.entity.segmentation.OcrSpRule">
|
|
||||||
<id column="id" property="id"/>
|
|
||||||
<result column="assort_id" property="assortId"/>
|
|
||||||
<result column="start_json" property="startJson"/>
|
|
||||||
<result column="end_json" property="endJson"/>
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<!-- 通用查询结果列 -->
|
|
||||||
<sql id="Base_Column_List">
|
|
||||||
id, assort_id, start_json, end_json
|
|
||||||
</sql>
|
|
||||||
|
|
||||||
</mapper>
|
|
Loading…
Reference in New Issue