bug修复

segment2.0
zhanglb 2 years ago
parent d228bbb3fc
commit ec48af7364

@ -40,6 +40,9 @@ public class AddOcrCutConfigDTO implements Serializable {
@ApiModelProperty(value = "半截图纵向区域结束")
private Double widthEnd;
@ApiModelProperty(value = "版本号")
private Integer version;
@ApiModelProperty(value = "创建时间")
private Date createTime;

@ -1,5 +1,6 @@
package com.docus.server.dto.segmentation.ocrcutconfig;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
@ -40,6 +41,9 @@ public class EditOcrCutConfigDTO implements Serializable {
@ApiModelProperty(value = "半截图纵向区域结束")
private Double widthEnd;
@ApiModelProperty(value = "版本号")
private Integer version;
@ApiModelProperty(value = "创建时间")
private Date createTime;

@ -40,6 +40,9 @@ public class AddOcrCutConfigTestDTO implements Serializable {
@ApiModelProperty(value = "半截图纵向区域结束")
private Double widthEnd;
@ApiModelProperty(value = "版本号")
private Integer version;
@ApiModelProperty(value = "创建时间")
private Date createTime;

@ -40,6 +40,9 @@ public class EditOcrCutConfigTestDTO implements Serializable {
@ApiModelProperty(value = "半截图纵向区域结束")
private Double widthEnd;
@ApiModelProperty(value = "版本号")
private Integer version;
@ApiModelProperty(value = "创建时间")
private Date createTime;

@ -34,6 +34,9 @@ public class AddOcrUrlConfigDTO implements Serializable {
@ApiModelProperty(value = "路径地址")
private String url;
@ApiModelProperty(value = "版本号")
private Integer version;
@ApiModelProperty(value = "创建时间")
private Date createTime;

@ -1,5 +1,6 @@
package com.docus.server.dto.segmentation.ocrurlconfig;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
@ -34,6 +35,9 @@ public class EditOcrUrlConfigDTO implements Serializable {
@ApiModelProperty(value = "路径地址")
private String url;
@ApiModelProperty(value = "版本号")
private Integer version;
@ApiModelProperty(value = "创建时间")
private Date createTime;

@ -34,6 +34,9 @@ public class AddOcrUrlConfigTestDTO implements Serializable {
@ApiModelProperty(value = "路径地址")
private String url;
@ApiModelProperty(value = "版本号")
private Integer version;
@ApiModelProperty(value = "创建时间")
private Date createTime;

@ -34,6 +34,9 @@ public class EditOcrUrlConfigTestDTO implements Serializable {
@ApiModelProperty(value = "路径地址")
private String url;
@ApiModelProperty(value = "版本号")
private Integer version;
@ApiModelProperty(value = "创建时间")
private Date createTime;

@ -49,6 +49,10 @@ public class OcrCutConfig implements Serializable {
@TableField("width_end")
private Double widthEnd;
@ApiModelProperty(value = "版本号")
@TableField("version")
private Integer version;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;

@ -41,6 +41,10 @@ public class OcrUrlConfig implements Serializable {
@TableField("url")
private String url;
@ApiModelProperty(value = "版本号")
@TableField("version")
private Integer version;
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
private Date createTime;

@ -40,6 +40,9 @@ public class OcrCutConfigVO implements Serializable {
@ApiModelProperty(value = "半截图纵向区域结束")
private Double widthEnd;
@ApiModelProperty(value = "版本号")
private Integer version;
@ApiModelProperty(value = "创建时间")
private Date createTime;

@ -40,6 +40,9 @@ public class OcrCutConfigTestVO implements Serializable {
@ApiModelProperty(value = "半截图纵向区域结束")
private Double widthEnd;
@ApiModelProperty(value = "版本号")
private Integer version;
@ApiModelProperty(value = "创建时间")
private Date createTime;

@ -34,6 +34,9 @@ public class OcrUrlConfigVO implements Serializable {
@ApiModelProperty(value = "路径地址")
private String url;
@ApiModelProperty(value = "版本号")
private Integer version;
@ApiModelProperty(value = "创建时间")
private Date createTime;

@ -34,6 +34,9 @@ public class OcrUrlConfigTestVO implements Serializable {
@ApiModelProperty(value = "路径地址")
private String url;
@ApiModelProperty(value = "版本号")
private Integer version;
@ApiModelProperty(value = "创建时间")
private Date createTime;

@ -6,6 +6,7 @@ import com.docus.infrastructure.core.db.dao.impl.BaseDaoImpl;
import com.docus.infrastructure.web.request.SearchDTO;
import com.docus.infrastructure.web.response.PageResult;
import com.docus.server.entity.segmentation.OcrCutConfig;
import com.docus.server.entity.segmentation.OcrSpecialRule;
import com.docus.server.infrastructure.dao.IOcrCutConfigDao;
import com.docus.server.infrastructure.mapper.OcrCutConfigMapper;
import com.github.pagehelper.PageHelper;
@ -86,16 +87,11 @@ public class OcrCutConfigDaoImpl extends BaseDaoImpl<OcrCutConfigMapper, OcrCutC
Date endTime = searchDTO.getEndTime();
query.le(OcrCutConfig::getCreateTime, endTime);
}
//关键字比较多个列or
//if (!StringUtils.isEmpty(searchDTO.getKeyword())) {
//单个列用like
//query. like(OcrCutConfig::getxxx, searchDTO.getKeyword());
//多个列用like
//query. and(sub -> sub.like(OcrCutConfig::getxx1, searchDTO.getKeyword())
// оr(). like(OcrCutConfig::getXX2, searchDTO.getKeyword()))
//);
//}
//默认createTime倒序排序
Object version = searchDTO.getParams("version");
query.eq(OcrCutConfig::getVersion,version);
query.orderByDesc(OcrCutConfig::getCreateTime);
List<OcrCutConfig> list = super.find(query);
return new PageResult<>(list);

@ -6,6 +6,7 @@ import com.docus.core.util.Func;
import com.docus.infrastructure.core.db.dao.impl.BaseDaoImpl;
import com.docus.infrastructure.web.request.SearchDTO;
import com.docus.infrastructure.web.response.PageResult;
import com.docus.server.entity.segmentation.OcrBasicTest;
import com.docus.server.entity.segmentation.OcrFileInfo;
import com.docus.server.infrastructure.dao.IOcrFileInfoDao;
import com.docus.server.infrastructure.mapper.OcrFileInfoMapper;
@ -79,18 +80,24 @@ public class OcrFileInfoDaoImpl extends BaseDaoImpl<OcrFileInfoMapper, OcrFileIn
//分页
PageHelper.startPage(searchDTO.getPageNum(), searchDTO.getPageSize());
LambdaQueryWrapper<OcrFileInfo> query = Wrappers.lambdaQuery();
//时间范围默认按createTime
if (searchDTO.getBeginTime() != null) {
query.ge(OcrFileInfo::getCreateTime, searchDTO.getBeginTime());
}
if (searchDTO.getEndTime() != null) {
Date endTime = searchDTO.getEndTime();
query.le(OcrFileInfo::getCreateTime, endTime);
}
Object patientId = searchDTO.getParams("patientId");
Object assortId = searchDTO.getParams("assortId");
Object picName = searchDTO.getParams("picName");
if (Func.isNotEmpty(patientId)) {
query.eq(OcrFileInfo::getPatientId, patientId);
}
if (Func.isNotEmpty(assortId)) {
query.like(OcrFileInfo::getAssortId, String.format("%s%s%s","%", assortId,"%"));
}
if (Func.isNotEmpty(picName)) {
query.like(OcrFileInfo::getPicName, String.format("%s%s%s","%", picName,"%"));
}
//默认createTime倒序排序
query.orderByDesc(OcrFileInfo::getCreateTime);
List<OcrFileInfo> list = super.find(query);

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.docus.infrastructure.core.db.dao.impl.BaseDaoImpl;
import com.docus.infrastructure.web.request.SearchDTO;
import com.docus.infrastructure.web.response.PageResult;
import com.docus.server.entity.segmentation.OcrRuleTest;
import com.docus.server.entity.segmentation.OcrSpecialRule;
import com.docus.server.infrastructure.dao.IOcrSpecialRuleDao;
import com.docus.server.infrastructure.mapper.OcrSpecialRuleMapper;
@ -86,15 +87,10 @@ public class OcrSpecialRuleDaoImpl extends BaseDaoImpl<OcrSpecialRuleMapper, Ocr
Date endTime = searchDTO.getEndTime();
query.le(OcrSpecialRule::getCreateTime, endTime);
}
//关键字比较多个列or
//if (!StringUtils.isEmpty(searchDTO.getKeyword())) {
//单个列用like
//query. like(OcrSpecialRule::getxxx, searchDTO.getKeyword());
//多个列用like
//query. and(sub -> sub.like(OcrSpecialRule::getxx1, searchDTO.getKeyword())
// оr(). like(OcrSpecialRule::getXX2, searchDTO.getKeyword()))
//);
//}
Object version = searchDTO.getParams("version");
query.eq(OcrSpecialRule::getVersion,version);
//默认createTime倒序排序
query.orderByDesc(OcrSpecialRule::getCreateTime);
List<OcrSpecialRule> list = super.find(query);

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.docus.infrastructure.core.db.dao.impl.BaseDaoImpl;
import com.docus.infrastructure.web.request.SearchDTO;
import com.docus.infrastructure.web.response.PageResult;
import com.docus.server.entity.segmentation.OcrSpecialRule;
import com.docus.server.entity.segmentation.OcrUrlConfig;
import com.docus.server.infrastructure.dao.IOcrUrlConfigDao;
import com.docus.server.infrastructure.mapper.OcrUrlConfigMapper;
@ -86,15 +87,10 @@ public class OcrUrlConfigDaoImpl extends BaseDaoImpl<OcrUrlConfigMapper, OcrUrlC
Date endTime = searchDTO.getEndTime();
query.le(OcrUrlConfig::getCreateTime, endTime);
}
//关键字比较多个列or
//if (!StringUtils.isEmpty(searchDTO.getKeyword())) {
//单个列用like
//query. like(OcrUrlConfig::getxxx, searchDTO.getKeyword());
//多个列用like
//query. and(sub -> sub.like(OcrUrlConfig::getxx1, searchDTO.getKeyword())
// оr(). like(OcrUrlConfig::getXX2, searchDTO.getKeyword()))
//);
//}
Object version = searchDTO.getParams("version");
query.eq(OcrUrlConfig::getVersion,version);
//默认createTime倒序排序
query.orderByDesc(OcrUrlConfig::getCreateTime);
List<OcrUrlConfig> list = super.find(query);

@ -129,6 +129,7 @@ public class OcrVersionServiceImpl implements IOcrVersionService {
BeanUtil.copyProperties(m,ocrRule);
return ocrRule;
}).collect(Collectors.toList());
List<OcrSpecialRule> ocrSpecialRuleTestDaoAll = iOcrSpecialRuleTestDao.findAll().stream().map(m-> {
m.setVersion(finalVersion);
m.setId(idService.getDateSeq());
@ -137,8 +138,26 @@ public class OcrVersionServiceImpl implements IOcrVersionService {
return ocrSpecialRule;
}).collect(Collectors.toList());
List<OcrCutConfig> ocrCutConfigList = iOcrCutConfigTestDao.findAll().stream().map(m-> {
OcrCutConfig ocrCutConfig = new OcrCutConfig();
BeanUtil.copyProperties(m,ocrCutConfig);
ocrCutConfig.setVersion(finalVersion);
ocrCutConfig.setId(idService.getDateSeq());
return ocrCutConfig;
}).collect(Collectors.toList());
List<OcrUrlConfig> ocrUrlConfigList = iOcrUrlConfigTestDao.findAll().stream().map(m-> {
OcrUrlConfig ocrUrlConfig = new OcrUrlConfig();
BeanUtil.copyProperties(m,ocrUrlConfig);
ocrUrlConfig.setVersion(finalVersion);
ocrUrlConfig.setId(idService.getDateSeq());
return ocrUrlConfig;
}).collect(Collectors.toList());
iOcrRuleDao.saveBatch(ocrRuleList,iOcrRuleDao.DEFAULT_BATCH_SIZE);
iOcrSpecialRuleDao.saveBatch(ocrSpecialRuleTestDaoAll,iOcrSpecialRuleDao.DEFAULT_BATCH_SIZE);
iOcrCutConfigDao.saveBatch(ocrCutConfigList,iOcrRuleDao.DEFAULT_BATCH_SIZE);
iOcrUrlConfigDao.saveBatch(ocrUrlConfigList,iOcrSpecialRuleDao.DEFAULT_BATCH_SIZE);
List<OcrVersion> isEnableList = iOcrVersionDao.findBy("isEnable", "1").stream().peek(p-> p.setIsEnable(false)).collect(Collectors.toList());
iOcrVersionDao.updateBatchById(isEnableList,1000);

Loading…
Cancel
Save