Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
iBiz商业中心
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz商业套件
iBiz商业中心
提交
23c6b021
提交
23c6b021
编写于
10月 26, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
xignzi006 发布系统代码
上级
547144c8
变更
5
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
48 行增加
和
0 行删除
+48
-0
Ir_attachmentMapper.java
...inesscentral/core/odoo_ir/mapper/Ir_attachmentMapper.java
+1
-0
IIr_attachmentService.java
...sscentral/core/odoo_ir/service/IIr_attachmentService.java
+1
-0
Ir_attachmentServiceImpl.java
...l/core/odoo_ir/service/impl/Ir_attachmentServiceImpl.java
+9
-0
Ir_attachmentMapper.xml
...rces/mapper/odoo_ir/ir_attachment/Ir_attachmentMapper.xml
+15
-0
Ir_attachmentResource.java
...zlab/businesscentral/core/rest/Ir_attachmentResource.java
+22
-0
未找到文件。
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/odoo_ir/mapper/Ir_attachmentMapper.java
浏览文件 @
23c6b021
...
...
@@ -19,6 +19,7 @@ import com.alibaba.fastjson.JSONObject;
public
interface
Ir_attachmentMapper
extends
BaseMapper
<
Ir_attachment
>{
Page
<
Ir_attachment
>
searchByRes
(
IPage
page
,
@Param
(
"srf"
)
Ir_attachmentSearchContext
context
,
@Param
(
"ew"
)
Wrapper
<
Ir_attachment
>
wrapper
)
;
Page
<
Ir_attachment
>
searchDefault
(
IPage
page
,
@Param
(
"srf"
)
Ir_attachmentSearchContext
context
,
@Param
(
"ew"
)
Wrapper
<
Ir_attachment
>
wrapper
)
;
@Override
Ir_attachment
selectById
(
Serializable
id
);
...
...
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/odoo_ir/service/IIr_attachmentService.java
浏览文件 @
23c6b021
...
...
@@ -37,6 +37,7 @@ public interface IIr_attachmentService extends IService<Ir_attachment>{
boolean
checkKey
(
Ir_attachment
et
)
;
boolean
save
(
Ir_attachment
et
)
;
void
saveBatch
(
List
<
Ir_attachment
>
list
)
;
Page
<
Ir_attachment
>
searchByRes
(
Ir_attachmentSearchContext
context
)
;
Page
<
Ir_attachment
>
searchDefault
(
Ir_attachmentSearchContext
context
)
;
List
<
Ir_attachment
>
selectByCompanyId
(
Long
id
)
;
void
removeByCompanyId
(
Long
id
)
;
...
...
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/odoo_ir/service/impl/Ir_attachmentServiceImpl.java
浏览文件 @
23c6b021
...
...
@@ -199,6 +199,15 @@ public class Ir_attachmentServiceImpl extends EBSServiceImpl<Ir_attachmentMapper
}
/**
* 查询集合 ByRes
*/
@Override
public
Page
<
Ir_attachment
>
searchByRes
(
Ir_attachmentSearchContext
context
)
{
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
<
Ir_attachment
>
pages
=
baseMapper
.
searchByRes
(
context
.
getPages
(),
context
,
context
.
getSelectCond
());
return
new
PageImpl
<
Ir_attachment
>(
pages
.
getRecords
(),
context
.
getPageable
(),
pages
.
getTotal
());
}
/**
* 查询集合 数据集
*/
...
...
businesscentral-core/src/main/resources/mapper/odoo_ir/ir_attachment/Ir_attachmentMapper.xml
浏览文件 @
23c6b021
...
...
@@ -34,6 +34,15 @@
where company_id=#{id}
</select>
<!--数据集合[ByRes]-->
<select
id=
"searchByRes"
parameterType=
"cn.ibizlab.businesscentral.core.odoo_ir.filter.Ir_attachmentSearchContext"
resultMap=
"Ir_attachmentResultMap"
>
select t1.* from (
<include
refid=
"ByRes"
/>
)t1
<where><if
test=
"ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere"
>
${ew.sqlSegment}
</if></where>
<if
test=
"ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere"
>
${ew.sqlSegment}
</if>
</select>
<!--数据集合[Default]-->
<select
id=
"searchDefault"
parameterType=
"cn.ibizlab.businesscentral.core.odoo_ir.filter.Ir_attachmentSearchContext"
resultMap=
"Ir_attachmentResultMap"
>
select t1.* from (
...
...
@@ -43,6 +52,12 @@
<if
test=
"ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere"
>
${ew.sqlSegment}
</if>
</select>
<!--数据查询[ByRes]-->
<sql
id=
"ByRes"
databaseId=
"postgresql"
>
<![CDATA[ SELECT t1.ACCESS_TOKEN, t1.CHECKSUM, t1.COMPANY_ID, t1.FILE_SIZE, t1.ID, t1.KEY, t1.MIMETYPE, t1.NAME, t1.PUBLIC, t1.RES_FIELD, t1.RES_ID, t1.RES_MODEL, t1.STORE_FNAME, t1.TYPE, t1.URL FROM IR_ATTACHMENT t1
WHERE ( t1.RES_MODEL = #{srf.webcontext.res_model} AND t1.RES_ID = #{srf.webcontext.res_id} )
]]>
</sql>
<!--数据查询[Default]-->
<sql
id=
"Default"
databaseId=
"postgresql"
>
<![CDATA[ SELECT t1.ACCESS_TOKEN, t1.CHECKSUM, t1.COMPANY_ID, t1.FILE_SIZE, t1.ID, t1.KEY, t1.MIMETYPE, t1.NAME, t1.PUBLIC, t1.RES_FIELD, t1.RES_ID, t1.RES_MODEL, t1.STORE_FNAME, t1.TYPE, t1.URL FROM IR_ATTACHMENT t1
...
...
businesscentral-provider/businesscentral-provider-core/src/main/java/cn/ibizlab/businesscentral/core/rest/Ir_attachmentResource.java
浏览文件 @
23c6b021
...
...
@@ -135,6 +135,28 @@ public class Ir_attachmentResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Ir_attachment-searchByRes-all')"
)
@ApiOperation
(
value
=
"获取ByRes"
,
tags
=
{
"附件"
}
,
notes
=
"获取ByRes"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ir_attachments/fetchbyres"
)
public
ResponseEntity
<
List
<
Ir_attachmentDTO
>>
fetchByRes
(
Ir_attachmentSearchContext
context
)
{
Page
<
Ir_attachment
>
domains
=
ir_attachmentService
.
searchByRes
(
context
)
;
List
<
Ir_attachmentDTO
>
list
=
ir_attachmentMapping
.
toDto
(
domains
.
getContent
());
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
header
(
"x-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageNumber
()))
.
header
(
"x-per-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageSize
()))
.
header
(
"x-total"
,
String
.
valueOf
(
domains
.
getTotalElements
()))
.
body
(
list
);
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Ir_attachment-searchByRes-all')"
)
@ApiOperation
(
value
=
"查询ByRes"
,
tags
=
{
"附件"
}
,
notes
=
"查询ByRes"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/ir_attachments/searchbyres"
)
public
ResponseEntity
<
Page
<
Ir_attachmentDTO
>>
searchByRes
(
@RequestBody
Ir_attachmentSearchContext
context
)
{
Page
<
Ir_attachment
>
domains
=
ir_attachmentService
.
searchByRes
(
context
)
;
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
body
(
new
PageImpl
(
ir_attachmentMapping
.
toDto
(
domains
.
getContent
()),
context
.
getPageable
(),
domains
.
getTotalElements
()));
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-Ir_attachment-searchDefault-all')"
)
@ApiOperation
(
value
=
"获取数据集"
,
tags
=
{
"附件"
}
,
notes
=
"获取数据集"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/ir_attachments/fetchdefault"
)
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录