Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
iBiz企业中心
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz企业套件
iBiz企业中心
提交
b3737bd6
提交
b3737bd6
编写于
6月 29, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
lab_gzf 发布系统代码
上级
fdbe8b2c
变更
45
隐藏空白字符变更
内嵌
并排
正在显示
45 个修改的文件
包含
4865 行增加
和
339 行删除
+4865
-339
product-sales-literature.ts
app_CRM/src/interface/entity/product-sales-literature.ts
+96
-0
sales-literature-item.ts
app_CRM/src/interface/entity/sales-literature-item.ts
+208
-0
en-US.ts
app_CRM/src/locale/lang/en-US.ts
+4
-0
zh-CN.ts
app_CRM/src/locale/lang/zh-CN.ts
+4
-0
product-sales-literature_en_US.ts
...roduct-sales-literature/product-sales-literature_en_US.ts
+16
-0
product-sales-literature_zh_CN.ts
...roduct-sales-literature/product-sales-literature_zh_CN.ts
+15
-0
sales-literature-item_en_US.ts
...ties/sales-literature-item/sales-literature-item_en_US.ts
+30
-0
sales-literature-item_zh_CN.ts
...ties/sales-literature-item/sales-literature-item_zh_CN.ts
+29
-0
product-sales-literatures.ts
...ty/product-sales-literatures/product-sales-literatures.ts
+380
-0
sales-literature-items.ts
...k/entity/sales-literature-items/sales-literature-items.ts
+380
-0
index.ts
app_CRM/src/mock/index.ts
+2
-0
entity-service-register.ts
app_CRM/src/service/entity-service-register.ts
+2
-0
product-sales-literature-service-base.ts
...sales-literature/product-sales-literature-service-base.ts
+177
-0
product-sales-literature-service.ts
...duct-sales-literature/product-sales-literature-service.ts
+25
-0
sales-literature-item-service-base.ts
...les-literature-item/sales-literature-item-service-base.ts
+177
-0
sales-literature-item-service.ts
...ce/sales-literature-item/sales-literature-item-service.ts
+25
-0
product-sales-literature-ui-service-base.ts
...es-literature/product-sales-literature-ui-service-base.ts
+210
-0
product-sales-literature-ui-service.ts
...t-sales-literature/product-sales-literature-ui-service.ts
+21
-0
sales-literature-item-ui-service-base.ts
...-literature-item/sales-literature-item-ui-service-base.ts
+210
-0
sales-literature-item-ui-service.ts
...sales-literature-item/sales-literature-item-ui-service.ts
+21
-0
ui-service-register.ts
app_CRM/src/uiservice/ui-service-register.ts
+2
-0
application-crm-prod.yml
...ntral-app-crm/src/main/resources/application-crm-prod.yml
+8
-0
ProductSalesLiterature.java
...sscentral/core/product/domain/ProductSalesLiterature.java
+197
-0
ProductSalesLiteratureSearchContext.java
...e/product/filter/ProductSalesLiteratureSearchContext.java
+103
-0
ProductSalesLiteratureMapper.java
...ral/core/product/mapper/ProductSalesLiteratureMapper.java
+69
-0
IProductSalesLiteratureService.java
.../core/product/service/IProductSalesLiteratureService.java
+65
-0
ProductSalesLiteratureServiceImpl.java
...oduct/service/impl/ProductSalesLiteratureServiceImpl.java
+265
-0
ProductServiceImpl.java
...central/core/product/service/impl/ProductServiceImpl.java
+3
-0
CompetitorSalesLiterature.java
...scentral/core/sales/domain/CompetitorSalesLiterature.java
+197
-0
CompetitorSalesLiteratureSearchContext.java
.../sales/filter/CompetitorSalesLiteratureSearchContext.java
+103
-0
CompetitorSalesLiteratureMapper.java
...al/core/sales/mapper/CompetitorSalesLiteratureMapper.java
+69
-0
ICompetitorSalesLiteratureService.java
...core/sales/service/ICompetitorSalesLiteratureService.java
+65
-0
CompetitorSalesLiteratureServiceImpl.java
...es/service/impl/CompetitorSalesLiteratureServiceImpl.java
+265
-0
CompetitorServiceImpl.java
...entral/core/sales/service/impl/CompetitorServiceImpl.java
+3
-0
SalesLiteratureServiceImpl.java
...l/core/sales/service/impl/SalesLiteratureServiceImpl.java
+6
-0
h2_table.xml
...esscentral-core/src/main/resources/liquibase/h2_table.xml
+356
-339
ProductSalesLiteratureMapper.xml
...t/productsalesliterature/ProductSalesLiteratureMapper.xml
+61
-0
CompetitorSalesLiteratureMapper.xml
...etitorsalesliterature/CompetitorSalesLiteratureMapper.xml
+61
-0
systemResource.json
...al-core/src/main/resources/permission/systemResource.json
+16
-0
ProductSalesLiteratureDTO.java
...nesscentral/centralapi/dto/ProductSalesLiteratureDTO.java
+167
-0
SalesLiteratureItemDTO.java
...usinesscentral/centralapi/dto/SalesLiteratureItemDTO.java
+392
-0
ProductSalesLiteratureMapping.java
...ral/centralapi/mapping/ProductSalesLiteratureMapping.java
+16
-0
SalesLiteratureItemMapping.java
...entral/centralapi/mapping/SalesLiteratureItemMapping.java
+16
-0
ProductSalesLiteratureResource.java
...ntral/centralapi/rest/ProductSalesLiteratureResource.java
+164
-0
SalesLiteratureItemResource.java
...scentral/centralapi/rest/SalesLiteratureItemResource.java
+164
-0
未找到文件。
app_CRM/src/interface/entity/product-sales-literature.ts
0 → 100644
浏览文件 @
b3737bd6
/**
* 实体
*
* @export
* @interface ProductSalesLiterature
*/
export
interface
ProductSalesLiterature
{
/**
* 建立时间
*
* @returns {*}
* @memberof ProductSalesLiterature
*/
createdate
?:
any
;
/**
* 建立人
*
* @returns {*}
* @memberof ProductSalesLiterature
*/
createman
?:
any
;
/**
* 关系标识
*
* @returns {*}
* @memberof ProductSalesLiterature
*/
relationshipsid
?:
any
;
/**
* 关系名称
*
* @returns {*}
* @memberof ProductSalesLiterature
*/
relationshipsname
?:
any
;
/**
* 关系类型
*
* @returns {*}
* @memberof ProductSalesLiterature
*/
relationshipstype
?:
any
;
/**
* 更新时间
*
* @returns {*}
* @memberof ProductSalesLiterature
*/
updatedate
?:
any
;
/**
* 更新人
*
* @returns {*}
* @memberof ProductSalesLiterature
*/
updateman
?:
any
;
/**
* 产品
*
* @returns {*}
* @memberof ProductSalesLiterature
*/
entityid
?:
any
;
/**
* 销售宣传资料
*
* @returns {*}
* @memberof ProductSalesLiterature
*/
entity2id
?:
any
;
/**
* 产品
*
* @returns {*}
* @memberof ProductSalesLiterature
*/
entityname
?:
any
;
/**
* 销售宣传资料
*
* @returns {*}
* @memberof ProductSalesLiterature
*/
entity2name
?:
any
;
}
\ No newline at end of file
app_CRM/src/interface/entity/sales-literature-item.ts
0 → 100644
浏览文件 @
b3737bd6
/**
* 销售附件
*
* @export
* @interface SalesLiteratureItem
*/
export
interface
SalesLiteratureItem
{
/**
* 作者姓名
*
* @returns {*}
* @memberof SalesLiteratureItem
*/
authorname
?:
any
;
/**
* Time Zone Rule Version Number
*
* @returns {*}
* @memberof SalesLiteratureItem
*/
timezoneruleversionnumber
?:
any
;
/**
* 标题
*
* @returns {*}
* @memberof SalesLiteratureItem
*/
title
?:
any
;
/**
* 文件大小(字节)
*
* @returns {*}
* @memberof SalesLiteratureItem
*/
filesize
?:
any
;
/**
* Mode
*
* @returns {*}
* @memberof SalesLiteratureItem
*/
mode
?:
any
;
/**
* 文件类型
*
* @returns {*}
* @memberof SalesLiteratureItem
*/
filetypecode
?:
any
;
/**
* Import Sequence Number
*
* @returns {*}
* @memberof SalesLiteratureItem
*/
importsequencenumber
?:
any
;
/**
* 销售宣传资料项
*
* @returns {*}
* @memberof SalesLiteratureItem
*/
salesliteratureitemid
?:
any
;
/**
* 更新时间
*
* @returns {*}
* @memberof SalesLiteratureItem
*/
updatedate
?:
any
;
/**
* 更新人
*
* @returns {*}
* @memberof SalesLiteratureItem
*/
updateman
?:
any
;
/**
* MIME 类型
*
* @returns {*}
* @memberof SalesLiteratureItem
*/
mimetype
?:
any
;
/**
* 建立人
*
* @returns {*}
* @memberof SalesLiteratureItem
*/
createman
?:
any
;
/**
* 关键字
*
* @returns {*}
* @memberof SalesLiteratureItem
*/
keywords
?:
any
;
/**
* FileType
*
* @returns {*}
* @memberof SalesLiteratureItem
*/
filetype
?:
any
;
/**
* 附加文档 URL
*
* @returns {*}
* @memberof SalesLiteratureItem
*/
attacheddocumenturl
?:
any
;
/**
* 显示销售宣传资料文档附件的编码内容。
*
* @returns {*}
* @memberof SalesLiteratureItem
*/
documentbody
?:
any
;
/**
* Version Number
*
* @returns {*}
* @memberof SalesLiteratureItem
*/
versionnumber
?:
any
;
/**
* 是否抽象
*
* @returns {*}
* @memberof SalesLiteratureItem
*/
ibizabstract
?:
any
;
/**
* Record Created On
*
* @returns {*}
* @memberof SalesLiteratureItem
*/
overriddencreatedon
?:
any
;
/**
* 向客户公开
*
* @returns {*}
* @memberof SalesLiteratureItem
*/
customerviewable
?:
any
;
/**
* 文件名
*
* @returns {*}
* @memberof SalesLiteratureItem
*/
filename
?:
any
;
/**
* 组织
*
* @returns {*}
* @memberof SalesLiteratureItem
*/
organizationid
?:
any
;
/**
* 建立时间
*
* @returns {*}
* @memberof SalesLiteratureItem
*/
createdate
?:
any
;
/**
* UTC Conversion Time Zone Code
*
* @returns {*}
* @memberof SalesLiteratureItem
*/
utcconversiontimezonecode
?:
any
;
/**
* 销售宣传资料
*
* @returns {*}
* @memberof SalesLiteratureItem
*/
salesliteratureid
?:
any
;
}
\ No newline at end of file
app_CRM/src/locale/lang/en-US.ts
浏览文件 @
b3737bd6
...
@@ -30,12 +30,14 @@ import quote_en_US from '@locale/lanres/entities/quote/quote_en_US';
...
@@ -30,12 +30,14 @@ import quote_en_US from '@locale/lanres/entities/quote/quote_en_US';
import
campaignactivity_en_US
from
'@locale/lanres/entities/campaign-activity/campaign-activity_en_US'
;
import
campaignactivity_en_US
from
'@locale/lanres/entities/campaign-activity/campaign-activity_en_US'
;
import
listlead_en_US
from
'@locale/lanres/entities/list-lead/list-lead_en_US'
;
import
listlead_en_US
from
'@locale/lanres/entities/list-lead/list-lead_en_US'
;
import
opportunitycompetitor_en_US
from
'@locale/lanres/entities/opportunity-competitor/opportunity-competitor_en_US'
;
import
opportunitycompetitor_en_US
from
'@locale/lanres/entities/opportunity-competitor/opportunity-competitor_en_US'
;
import
salesliteratureitem_en_US
from
'@locale/lanres/entities/sales-literature-item/sales-literature-item_en_US'
;
import
contact_en_US
from
'@locale/lanres/entities/contact/contact_en_US'
;
import
contact_en_US
from
'@locale/lanres/entities/contact/contact_en_US'
;
import
product_en_US
from
'@locale/lanres/entities/product/product_en_US'
;
import
product_en_US
from
'@locale/lanres/entities/product/product_en_US'
;
import
competitor_en_US
from
'@locale/lanres/entities/competitor/competitor_en_US'
;
import
competitor_en_US
from
'@locale/lanres/entities/competitor/competitor_en_US'
;
import
account_en_US
from
'@locale/lanres/entities/account/account_en_US'
;
import
account_en_US
from
'@locale/lanres/entities/account/account_en_US'
;
import
salesorder_en_US
from
'@locale/lanres/entities/sales-order/sales-order_en_US'
;
import
salesorder_en_US
from
'@locale/lanres/entities/sales-order/sales-order_en_US'
;
import
quotedetail_en_US
from
'@locale/lanres/entities/quote-detail/quote-detail_en_US'
;
import
quotedetail_en_US
from
'@locale/lanres/entities/quote-detail/quote-detail_en_US'
;
import
productsalesliterature_en_US
from
'@locale/lanres/entities/product-sales-literature/product-sales-literature_en_US'
;
import
subject_en_US
from
'@locale/lanres/entities/subject/subject_en_US'
;
import
subject_en_US
from
'@locale/lanres/entities/subject/subject_en_US'
;
import
components_en_US
from
'@locale/lanres/components/components_en_US'
;
import
components_en_US
from
'@locale/lanres/components/components_en_US'
;
import
codelist_en_US
from
'@locale/lanres/codelist/codelist_en_US'
;
import
codelist_en_US
from
'@locale/lanres/codelist/codelist_en_US'
;
...
@@ -174,12 +176,14 @@ export default {
...
@@ -174,12 +176,14 @@ export default {
campaignactivity
:
campaignactivity_en_US
,
campaignactivity
:
campaignactivity_en_US
,
listlead
:
listlead_en_US
,
listlead
:
listlead_en_US
,
opportunitycompetitor
:
opportunitycompetitor_en_US
,
opportunitycompetitor
:
opportunitycompetitor_en_US
,
salesliteratureitem
:
salesliteratureitem_en_US
,
contact
:
contact_en_US
,
contact
:
contact_en_US
,
product
:
product_en_US
,
product
:
product_en_US
,
competitor
:
competitor_en_US
,
competitor
:
competitor_en_US
,
account
:
account_en_US
,
account
:
account_en_US
,
salesorder
:
salesorder_en_US
,
salesorder
:
salesorder_en_US
,
quotedetail
:
quotedetail_en_US
,
quotedetail
:
quotedetail_en_US
,
productsalesliterature
:
productsalesliterature_en_US
,
subject
:
subject_en_US
,
subject
:
subject_en_US
,
},
},
components
:
components_en_US
,
components
:
components_en_US
,
...
...
app_CRM/src/locale/lang/zh-CN.ts
浏览文件 @
b3737bd6
...
@@ -30,12 +30,14 @@ import quote_zh_CN from '@locale/lanres/entities/quote/quote_zh_CN';
...
@@ -30,12 +30,14 @@ import quote_zh_CN from '@locale/lanres/entities/quote/quote_zh_CN';
import
campaignactivity_zh_CN
from
'@locale/lanres/entities/campaign-activity/campaign-activity_zh_CN'
;
import
campaignactivity_zh_CN
from
'@locale/lanres/entities/campaign-activity/campaign-activity_zh_CN'
;
import
listlead_zh_CN
from
'@locale/lanres/entities/list-lead/list-lead_zh_CN'
;
import
listlead_zh_CN
from
'@locale/lanres/entities/list-lead/list-lead_zh_CN'
;
import
opportunitycompetitor_zh_CN
from
'@locale/lanres/entities/opportunity-competitor/opportunity-competitor_zh_CN'
;
import
opportunitycompetitor_zh_CN
from
'@locale/lanres/entities/opportunity-competitor/opportunity-competitor_zh_CN'
;
import
salesliteratureitem_zh_CN
from
'@locale/lanres/entities/sales-literature-item/sales-literature-item_zh_CN'
;
import
contact_zh_CN
from
'@locale/lanres/entities/contact/contact_zh_CN'
;
import
contact_zh_CN
from
'@locale/lanres/entities/contact/contact_zh_CN'
;
import
product_zh_CN
from
'@locale/lanres/entities/product/product_zh_CN'
;
import
product_zh_CN
from
'@locale/lanres/entities/product/product_zh_CN'
;
import
competitor_zh_CN
from
'@locale/lanres/entities/competitor/competitor_zh_CN'
;
import
competitor_zh_CN
from
'@locale/lanres/entities/competitor/competitor_zh_CN'
;
import
account_zh_CN
from
'@locale/lanres/entities/account/account_zh_CN'
;
import
account_zh_CN
from
'@locale/lanres/entities/account/account_zh_CN'
;
import
salesorder_zh_CN
from
'@locale/lanres/entities/sales-order/sales-order_zh_CN'
;
import
salesorder_zh_CN
from
'@locale/lanres/entities/sales-order/sales-order_zh_CN'
;
import
quotedetail_zh_CN
from
'@locale/lanres/entities/quote-detail/quote-detail_zh_CN'
;
import
quotedetail_zh_CN
from
'@locale/lanres/entities/quote-detail/quote-detail_zh_CN'
;
import
productsalesliterature_zh_CN
from
'@locale/lanres/entities/product-sales-literature/product-sales-literature_zh_CN'
;
import
subject_zh_CN
from
'@locale/lanres/entities/subject/subject_zh_CN'
;
import
subject_zh_CN
from
'@locale/lanres/entities/subject/subject_zh_CN'
;
import
components_zh_CN
from
'@locale/lanres/components/components_zh_CN'
;
import
components_zh_CN
from
'@locale/lanres/components/components_zh_CN'
;
import
codelist_zh_CN
from
'@locale/lanres/codelist/codelist_zh_CN'
;
import
codelist_zh_CN
from
'@locale/lanres/codelist/codelist_zh_CN'
;
...
@@ -174,12 +176,14 @@ export default {
...
@@ -174,12 +176,14 @@ export default {
campaignactivity
:
campaignactivity_zh_CN
,
campaignactivity
:
campaignactivity_zh_CN
,
listlead
:
listlead_zh_CN
,
listlead
:
listlead_zh_CN
,
opportunitycompetitor
:
opportunitycompetitor_zh_CN
,
opportunitycompetitor
:
opportunitycompetitor_zh_CN
,
salesliteratureitem
:
salesliteratureitem_zh_CN
,
contact
:
contact_zh_CN
,
contact
:
contact_zh_CN
,
product
:
product_zh_CN
,
product
:
product_zh_CN
,
competitor
:
competitor_zh_CN
,
competitor
:
competitor_zh_CN
,
account
:
account_zh_CN
,
account
:
account_zh_CN
,
salesorder
:
salesorder_zh_CN
,
salesorder
:
salesorder_zh_CN
,
quotedetail
:
quotedetail_zh_CN
,
quotedetail
:
quotedetail_zh_CN
,
productsalesliterature
:
productsalesliterature_zh_CN
,
subject
:
subject_zh_CN
,
subject
:
subject_zh_CN
,
},
},
components
:
components_zh_CN
,
components
:
components_zh_CN
,
...
...
app_CRM/src/locale/lanres/entities/product-sales-literature/product-sales-literature_en_US.ts
0 → 100644
浏览文件 @
b3737bd6
export
default
{
fields
:
{
createdate
:
"建立时间"
,
createman
:
"建立人"
,
relationshipsid
:
"关系标识"
,
relationshipsname
:
"关系名称"
,
relationshipstype
:
"关系类型"
,
updatedate
:
"更新时间"
,
updateman
:
"更新人"
,
entityid
:
"产品"
,
entity2id
:
"销售宣传资料"
,
entityname
:
"产品"
,
entity2name
:
"销售宣传资料"
,
},
};
app_CRM/src/locale/lanres/entities/product-sales-literature/product-sales-literature_zh_CN.ts
0 → 100644
浏览文件 @
b3737bd6
export
default
{
fields
:
{
createdate
:
"建立时间"
,
createman
:
"建立人"
,
relationshipsid
:
"关系标识"
,
relationshipsname
:
"关系名称"
,
relationshipstype
:
"关系类型"
,
updatedate
:
"更新时间"
,
updateman
:
"更新人"
,
entityid
:
"产品"
,
entity2id
:
"销售宣传资料"
,
entityname
:
"产品"
,
entity2name
:
"销售宣传资料"
,
},
};
\ No newline at end of file
app_CRM/src/locale/lanres/entities/sales-literature-item/sales-literature-item_en_US.ts
0 → 100644
浏览文件 @
b3737bd6
export
default
{
fields
:
{
authorname
:
"作者姓名"
,
timezoneruleversionnumber
:
"Time Zone Rule Version Number"
,
title
:
"标题"
,
filesize
:
"文件大小(字节)"
,
mode
:
"Mode"
,
filetypecode
:
"文件类型"
,
importsequencenumber
:
"Import Sequence Number"
,
salesliteratureitemid
:
"销售宣传资料项"
,
updatedate
:
"更新时间"
,
updateman
:
"更新人"
,
mimetype
:
"MIME 类型"
,
createman
:
"建立人"
,
keywords
:
"关键字"
,
filetype
:
"FileType"
,
attacheddocumenturl
:
"附加文档 URL"
,
documentbody
:
"显示销售宣传资料文档附件的编码内容。"
,
versionnumber
:
"Version Number"
,
ibizabstract
:
"是否抽象"
,
overriddencreatedon
:
"Record Created On"
,
customerviewable
:
"向客户公开"
,
filename
:
"文件名"
,
organizationid
:
"组织"
,
createdate
:
"建立时间"
,
utcconversiontimezonecode
:
"UTC Conversion Time Zone Code"
,
salesliteratureid
:
"销售宣传资料"
,
},
};
app_CRM/src/locale/lanres/entities/sales-literature-item/sales-literature-item_zh_CN.ts
0 → 100644
浏览文件 @
b3737bd6
export
default
{
fields
:
{
authorname
:
"作者姓名"
,
timezoneruleversionnumber
:
"Time Zone Rule Version Number"
,
title
:
"标题"
,
filesize
:
"文件大小(字节)"
,
mode
:
"Mode"
,
filetypecode
:
"文件类型"
,
importsequencenumber
:
"Import Sequence Number"
,
salesliteratureitemid
:
"销售宣传资料项"
,
updatedate
:
"更新时间"
,
updateman
:
"更新人"
,
mimetype
:
"MIME 类型"
,
createman
:
"建立人"
,
keywords
:
"关键字"
,
filetype
:
"FileType"
,
attacheddocumenturl
:
"附加文档 URL"
,
documentbody
:
"显示销售宣传资料文档附件的编码内容。"
,
versionnumber
:
"Version Number"
,
ibizabstract
:
"是否抽象"
,
overriddencreatedon
:
"Record Created On"
,
customerviewable
:
"向客户公开"
,
filename
:
"文件名"
,
organizationid
:
"组织"
,
createdate
:
"建立时间"
,
utcconversiontimezonecode
:
"UTC Conversion Time Zone Code"
,
salesliteratureid
:
"销售宣传资料"
,
},
};
\ No newline at end of file
app_CRM/src/mock/entity/product-sales-literatures/product-sales-literatures.ts
0 → 100644
浏览文件 @
b3737bd6
import
qs
from
'qs'
;
import
{
MockAdapter
}
from
'@/mock/mock-adapter'
;
const
mock
=
MockAdapter
.
getInstance
();
// 模拟数据
const
mockDatas
:
Array
<
any
>
=
[
];
//getwflink
mock
.
onGet
(
new
RegExp
(
/^
\/
wfcore
\/
ibizbusinesscentral-app-crm
\/
productsalesliteratures
\/[
a-zA-Z0-9
\-\;]
+
\/
usertasks
\/[
a-zA-Z0-9
\-\;]
+
\/
ways$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:productsalesliterature 方法: getwflink"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
}
return
[
status
,[
{
"sequenceFlowId"
:
"dfdsfdsfdsfdsfds"
,
"sequenceFlowName"
:
"同意"
,
"taskId"
:
"aaaaddddccccddddd"
,
"processDefinitionKey"
:
"support-workorders-approve-v1"
,
"processInstanceId"
:
"ddlfldldfldsfds"
,
"refViewKey"
:
""
},
{
"sequenceFlowId"
:
"ddssdfdfdfdfsfdf"
,
"sequenceFlowName"
:
"不同意"
,
"taskId"
:
"aaaaddddccccddddd"
,
"processDefinitionKey"
:
"support-workorders-approve-v1"
,
"processInstanceId"
:
"ddfdsldlfdlldsf"
,
"refViewKey"
:
"workorder_ltform_editview"
}
]];
});
// getwfstep
mock
.
onGet
(
new
RegExp
(
/^
\/
wfcore
\/
ibizbusinesscentral-app-crm
\/
productsalesliteratures
\/
process-definitions-nodes$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:productsalesliterature 方法: getwfstep"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
}
return
[
status
,
[
{
"userTaskId"
:
"sddfddfd-dfdf-fdfd-fdf-dfdfd"
,
"userTaskName"
:
"待审"
,
"cnt"
:
0
,
"processDefinitionKey"
:
"support-workorders-approve-v1"
,
"processDefinitionName"
:
"工单审批流程v1"
},
{
"userTaskId"
:
"sddfddfd-dfdf-fdfd-fdf-87927"
,
"userTaskName"
:
"待分配"
,
"cnt"
:
3
,
"processDefinitionKey"
:
"support-workorders-approve-v1"
,
"processDefinitionName"
:
"工单审批流程v1"
}
]];
});
// createBatch
mock
.
onPost
(
new
RegExp
(
/^
\/
productsalesliteratures
\/
batch$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:productsalesliterature 方法: createBatch"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
}
return
[
status
,
{}];
});
// updateBatch
mock
.
onPut
(
new
RegExp
(
/^
\/
productsalesliteratures
\/
batch$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:productsalesliterature 方法: updateBatch"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
}
return
[
status
,
{}];
});
// removeBatch
mock
.
onDelete
(
new
RegExp
(
/^
\/
productsalesliteratures
\/
batch$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:productsalesliterature 方法: removeBatch"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
}
return
[
status
,
{}];
});
// Select
mock
.
onGet
(
new
RegExp
(
/^
\/
productsalesliteratures
\/([
a-zA-Z0-9
\-\;]{1,35})\/
select$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:productsalesliterature 方法: Select"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'relationshipsid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
productsalesliteratures
\/([
a-zA-Z0-9
\-\;]{1,35})\/
select$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
relationshipsid
,
tempValue
.
relationshipsid
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
];
});
// Update
mock
.
onPut
(
new
RegExp
(
/^
\/
productsalesliteratures
\/?([
a-zA-Z0-9
\-\;]{0,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:productsalesliterature 方法: Update"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'relationshipsid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
productsalesliteratures
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.relationshipsid, tempValue.relationshipsid));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'relationshipsid'
]
==
tempValue
[
'relationshipsid'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// CheckKey
mock
.
onPost
(
new
RegExp
(
/^
\/
productsalesliteratures
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
checkkey$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:productsalesliterature 方法: CheckKey"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'relationshipsid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
productsalesliteratures
\/([
a-zA-Z0-9
\-\;]{1,35})\/
checkkey$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.relationshipsid, tempValue.relationshipsid));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'relationshipsid'
]
==
tempValue
[
'relationshipsid'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// GetDraft
mock
.
onGet
(
new
RegExp
(
/^
\/
productsalesliteratures
\/
getdraft$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:productsalesliterature 方法: GetDraft"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
// GetDraft
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// Save
mock
.
onPost
(
new
RegExp
(
/^
\/
productsalesliteratures
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
save$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:productsalesliterature 方法: Save"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'relationshipsid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
productsalesliteratures
\/([
a-zA-Z0-9
\-\;]{1,35})\/
save$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.relationshipsid, tempValue.relationshipsid));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'relationshipsid'
]
==
tempValue
[
'relationshipsid'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// Create
mock
.
onPost
(
new
RegExp
(
/^
\/
productsalesliteratures
\/?([
a-zA-Z0-9
\-\;]{0,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:productsalesliterature 方法: Create"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'relationshipsid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
productsalesliteratures
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
mockDatas
[
0
]);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
mockDatas
[
0
]];
});
// FetchDefault
mock
.
onGet
(
new
RegExp
(
/^
\/
productsalesliteratures
\/
fetchdefault$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:productsalesliterature 方法: FetchDefault"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
mockDatas
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
mockDatas
?
mockDatas
:
[]];
});
// FetchDefault
mock
.
onGet
(
new
RegExp
(
/^
\/
productsalesliteratures
\/
fetchdefault
(\?[\w
-.
/
?%&=,
]
*
)
*$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:productsalesliterature 方法: FetchDefault"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
if
(
config
.
url
.
includes
(
'page'
)){
let
url
=
config
.
url
.
split
(
'?'
)[
1
];
let
params
=
qs
.
parse
(
url
);
Object
.
assign
(
config
,
params
);
}
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
let
total
=
mockDatas
.
length
;
let
records
:
Array
<
any
>
=
[];
if
(
!
config
.
page
||
!
config
.
size
){
records
=
mockDatas
;
}
else
{
if
((
config
.
page
-
1
)
*
config
.
size
<
total
){
records
=
mockDatas
.
slice
(
config
.
page
,
config
.
size
);
}
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
records
?
records
:
[]);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
records
?
records
:
[]];
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// Remove
mock
.
onDelete
(
new
RegExp
(
/^
\/
productsalesliteratures
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:productsalesliterature 方法: Remove"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'relationshipsid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
productsalesliteratures
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
relationshipsid
,
tempValue
.
relationshipsid
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
// Get
mock
.
onGet
(
new
RegExp
(
/^
\/
productsalesliteratures
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:productsalesliterature 方法: Get"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'relationshipsid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
productsalesliteratures
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
relationshipsid
,
tempValue
.
relationshipsid
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
app_CRM/src/mock/entity/sales-literature-items/sales-literature-items.ts
0 → 100644
浏览文件 @
b3737bd6
import
qs
from
'qs'
;
import
{
MockAdapter
}
from
'@/mock/mock-adapter'
;
const
mock
=
MockAdapter
.
getInstance
();
// 模拟数据
const
mockDatas
:
Array
<
any
>
=
[
];
//getwflink
mock
.
onGet
(
new
RegExp
(
/^
\/
wfcore
\/
ibizbusinesscentral-app-crm
\/
salesliteratureitems
\/[
a-zA-Z0-9
\-\;]
+
\/
usertasks
\/[
a-zA-Z0-9
\-\;]
+
\/
ways$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:salesliteratureitem 方法: getwflink"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
}
return
[
status
,[
{
"sequenceFlowId"
:
"dfdsfdsfdsfdsfds"
,
"sequenceFlowName"
:
"同意"
,
"taskId"
:
"aaaaddddccccddddd"
,
"processDefinitionKey"
:
"support-workorders-approve-v1"
,
"processInstanceId"
:
"ddlfldldfldsfds"
,
"refViewKey"
:
""
},
{
"sequenceFlowId"
:
"ddssdfdfdfdfsfdf"
,
"sequenceFlowName"
:
"不同意"
,
"taskId"
:
"aaaaddddccccddddd"
,
"processDefinitionKey"
:
"support-workorders-approve-v1"
,
"processInstanceId"
:
"ddfdsldlfdlldsf"
,
"refViewKey"
:
"workorder_ltform_editview"
}
]];
});
// getwfstep
mock
.
onGet
(
new
RegExp
(
/^
\/
wfcore
\/
ibizbusinesscentral-app-crm
\/
salesliteratureitems
\/
process-definitions-nodes$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:salesliteratureitem 方法: getwfstep"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
}
return
[
status
,
[
{
"userTaskId"
:
"sddfddfd-dfdf-fdfd-fdf-dfdfd"
,
"userTaskName"
:
"待审"
,
"cnt"
:
0
,
"processDefinitionKey"
:
"support-workorders-approve-v1"
,
"processDefinitionName"
:
"工单审批流程v1"
},
{
"userTaskId"
:
"sddfddfd-dfdf-fdfd-fdf-87927"
,
"userTaskName"
:
"待分配"
,
"cnt"
:
3
,
"processDefinitionKey"
:
"support-workorders-approve-v1"
,
"processDefinitionName"
:
"工单审批流程v1"
}
]];
});
// createBatch
mock
.
onPost
(
new
RegExp
(
/^
\/
salesliteratureitems
\/
batch$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:salesliteratureitem 方法: createBatch"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
}
return
[
status
,
{}];
});
// updateBatch
mock
.
onPut
(
new
RegExp
(
/^
\/
salesliteratureitems
\/
batch$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:salesliteratureitem 方法: updateBatch"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
}
return
[
status
,
{}];
});
// removeBatch
mock
.
onDelete
(
new
RegExp
(
/^
\/
salesliteratureitems
\/
batch$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:salesliteratureitem 方法: removeBatch"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
groupEnd
();
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
{}];
}
return
[
status
,
{}];
});
// Select
mock
.
onGet
(
new
RegExp
(
/^
\/
salesliteratureitems
\/([
a-zA-Z0-9
\-\;]{1,35})\/
select$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:salesliteratureitem 方法: Select"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'salesliteratureitemid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
salesliteratureitems
\/([
a-zA-Z0-9
\-\;]{1,35})\/
select$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
salesliteratureitemid
,
tempValue
.
salesliteratureitemid
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
];
});
// Save
mock
.
onPost
(
new
RegExp
(
/^
\/
salesliteratureitems
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
save$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:salesliteratureitem 方法: Save"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'salesliteratureitemid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
salesliteratureitems
\/([
a-zA-Z0-9
\-\;]{1,35})\/
save$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.salesliteratureitemid, tempValue.salesliteratureitemid));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'salesliteratureitemid'
]
==
tempValue
[
'salesliteratureitemid'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// GetDraft
mock
.
onGet
(
new
RegExp
(
/^
\/
salesliteratureitems
\/
getdraft$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:salesliteratureitem 方法: GetDraft"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
// GetDraft
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// Update
mock
.
onPut
(
new
RegExp
(
/^
\/
salesliteratureitems
\/?([
a-zA-Z0-9
\-\;]{0,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:salesliteratureitem 方法: Update"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'salesliteratureitemid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
salesliteratureitems
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.salesliteratureitemid, tempValue.salesliteratureitemid));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'salesliteratureitemid'
]
==
tempValue
[
'salesliteratureitemid'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// CheckKey
mock
.
onPost
(
new
RegExp
(
/^
\/
salesliteratureitems
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
checkkey$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:salesliteratureitem 方法: CheckKey"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'salesliteratureitemid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
salesliteratureitems
\/([
a-zA-Z0-9
\-\;]{1,35})\/
checkkey$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.salesliteratureitemid, tempValue.salesliteratureitemid));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'salesliteratureitemid'
]
==
tempValue
[
'salesliteratureitemid'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// Create
mock
.
onPost
(
new
RegExp
(
/^
\/
salesliteratureitems
\/?([
a-zA-Z0-9
\-\;]{0,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:salesliteratureitem 方法: Create"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'salesliteratureitemid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
salesliteratureitems
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
mockDatas
[
0
]);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
mockDatas
[
0
]];
});
// FetchDefault
mock
.
onGet
(
new
RegExp
(
/^
\/
salesliteratureitems
\/
fetchdefault$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:salesliteratureitem 方法: FetchDefault"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
mockDatas
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
mockDatas
?
mockDatas
:
[]];
});
// FetchDefault
mock
.
onGet
(
new
RegExp
(
/^
\/
salesliteratureitems
\/
fetchdefault
(\?[\w
-.
/
?%&=,
]
*
)
*$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:salesliteratureitem 方法: FetchDefault"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
if
(
config
.
url
.
includes
(
'page'
)){
let
url
=
config
.
url
.
split
(
'?'
)[
1
];
let
params
=
qs
.
parse
(
url
);
Object
.
assign
(
config
,
params
);
}
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
let
total
=
mockDatas
.
length
;
let
records
:
Array
<
any
>
=
[];
if
(
!
config
.
page
||
!
config
.
size
){
records
=
mockDatas
;
}
else
{
if
((
config
.
page
-
1
)
*
config
.
size
<
total
){
records
=
mockDatas
.
slice
(
config
.
page
,
config
.
size
);
}
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
records
?
records
:
[]);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
records
?
records
:
[]];
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// Get
mock
.
onGet
(
new
RegExp
(
/^
\/
salesliteratureitems
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:salesliteratureitem 方法: Get"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'salesliteratureitemid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
salesliteratureitems
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
salesliteratureitemid
,
tempValue
.
salesliteratureitemid
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
// Remove
mock
.
onDelete
(
new
RegExp
(
/^
\/
salesliteratureitems
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:salesliteratureitem 方法: Remove"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'salesliteratureitemid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
salesliteratureitems
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
salesliteratureitemid
,
tempValue
.
salesliteratureitemid
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
app_CRM/src/mock/index.ts
浏览文件 @
b3737bd6
...
@@ -39,10 +39,12 @@ import './entity/quotes/quotes';
...
@@ -39,10 +39,12 @@ import './entity/quotes/quotes';
import
'./entity/campaign-activitys/campaign-activitys'
;
import
'./entity/campaign-activitys/campaign-activitys'
;
import
'./entity/list-leads/list-leads'
;
import
'./entity/list-leads/list-leads'
;
import
'./entity/opportunity-competitors/opportunity-competitors'
;
import
'./entity/opportunity-competitors/opportunity-competitors'
;
import
'./entity/sales-literature-items/sales-literature-items'
;
import
'./entity/contacts/contacts'
;
import
'./entity/contacts/contacts'
;
import
'./entity/products/products'
;
import
'./entity/products/products'
;
import
'./entity/competitors/competitors'
;
import
'./entity/competitors/competitors'
;
import
'./entity/accounts/accounts'
;
import
'./entity/accounts/accounts'
;
import
'./entity/sales-orders/sales-orders'
;
import
'./entity/sales-orders/sales-orders'
;
import
'./entity/quote-details/quote-details'
;
import
'./entity/quote-details/quote-details'
;
import
'./entity/product-sales-literatures/product-sales-literatures'
;
import
'./entity/subjects/subjects'
;
import
'./entity/subjects/subjects'
;
app_CRM/src/service/entity-service-register.ts
浏览文件 @
b3737bd6
...
@@ -71,12 +71,14 @@ export class EntityServiceRegister {
...
@@ -71,12 +71,14 @@ export class EntityServiceRegister {
this
.
allEntityService
.
set
(
'campaignactivity'
,
()
=>
import
(
'@/service/campaign-activity/campaign-activity-service'
));
this
.
allEntityService
.
set
(
'campaignactivity'
,
()
=>
import
(
'@/service/campaign-activity/campaign-activity-service'
));
this
.
allEntityService
.
set
(
'listlead'
,
()
=>
import
(
'@/service/list-lead/list-lead-service'
));
this
.
allEntityService
.
set
(
'listlead'
,
()
=>
import
(
'@/service/list-lead/list-lead-service'
));
this
.
allEntityService
.
set
(
'opportunitycompetitor'
,
()
=>
import
(
'@/service/opportunity-competitor/opportunity-competitor-service'
));
this
.
allEntityService
.
set
(
'opportunitycompetitor'
,
()
=>
import
(
'@/service/opportunity-competitor/opportunity-competitor-service'
));
this
.
allEntityService
.
set
(
'salesliteratureitem'
,
()
=>
import
(
'@/service/sales-literature-item/sales-literature-item-service'
));
this
.
allEntityService
.
set
(
'contact'
,
()
=>
import
(
'@/service/contact/contact-service'
));
this
.
allEntityService
.
set
(
'contact'
,
()
=>
import
(
'@/service/contact/contact-service'
));
this
.
allEntityService
.
set
(
'product'
,
()
=>
import
(
'@/service/product/product-service'
));
this
.
allEntityService
.
set
(
'product'
,
()
=>
import
(
'@/service/product/product-service'
));
this
.
allEntityService
.
set
(
'competitor'
,
()
=>
import
(
'@/service/competitor/competitor-service'
));
this
.
allEntityService
.
set
(
'competitor'
,
()
=>
import
(
'@/service/competitor/competitor-service'
));
this
.
allEntityService
.
set
(
'account'
,
()
=>
import
(
'@/service/account/account-service'
));
this
.
allEntityService
.
set
(
'account'
,
()
=>
import
(
'@/service/account/account-service'
));
this
.
allEntityService
.
set
(
'salesorder'
,
()
=>
import
(
'@/service/sales-order/sales-order-service'
));
this
.
allEntityService
.
set
(
'salesorder'
,
()
=>
import
(
'@/service/sales-order/sales-order-service'
));
this
.
allEntityService
.
set
(
'quotedetail'
,
()
=>
import
(
'@/service/quote-detail/quote-detail-service'
));
this
.
allEntityService
.
set
(
'quotedetail'
,
()
=>
import
(
'@/service/quote-detail/quote-detail-service'
));
this
.
allEntityService
.
set
(
'productsalesliterature'
,
()
=>
import
(
'@/service/product-sales-literature/product-sales-literature-service'
));
this
.
allEntityService
.
set
(
'subject'
,
()
=>
import
(
'@/service/subject/subject-service'
));
this
.
allEntityService
.
set
(
'subject'
,
()
=>
import
(
'@/service/subject/subject-service'
));
}
}
...
...
app_CRM/src/service/product-sales-literature/product-sales-literature-service-base.ts
0 → 100644
浏览文件 @
b3737bd6
import
{
Http
,
Util
}
from
'@/utils'
;
import
EntityService
from
'../entity-service'
;
/**
* 产品宣传资料服务对象基类
*
* @export
* @class ProductSalesLiteratureServiceBase
* @extends {EntityServie}
*/
export
default
class
ProductSalesLiteratureServiceBase
extends
EntityService
{
/**
* Creates an instance of ProductSalesLiteratureServiceBase.
*
* @param {*} [opts={}]
* @memberof ProductSalesLiteratureServiceBase
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
}
/**
* 初始化基础数据
*
* @memberof ProductSalesLiteratureServiceBase
*/
public
initBasicData
(){
this
.
APPLYDEKEY
=
'productsalesliterature'
;
this
.
APPDEKEY
=
'relationshipsid'
;
this
.
APPDENAME
=
'productsalesliteratures'
;
this
.
APPDETEXT
=
'relationshipsname'
;
this
.
APPNAME
=
'crm'
;
this
.
SYSTEMNAME
=
'ibizbusinesscentral'
;
}
// 实体接口
/**
* Select接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof ProductSalesLiteratureServiceBase
*/
public
async
Select
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
return
Http
.
getInstance
().
get
(
`/productsalesliteratures/
${
context
.
productsalesliterature
}
/select`
,
isloading
);
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof ProductSalesLiteratureServiceBase
*/
public
async
Remove
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
return
Http
.
getInstance
().
delete
(
`/productsalesliteratures/
${
context
.
productsalesliterature
}
`
,
isloading
);
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof ProductSalesLiteratureServiceBase
*/
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/productsalesliteratures/
${
context
.
productsalesliterature
}
`
,
isloading
);
return
res
;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof ProductSalesLiteratureServiceBase
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/productsalesliteratures/
${
context
.
productsalesliterature
}
`
,
data
,
isloading
);
return
res
;
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof ProductSalesLiteratureServiceBase
*/
public
async
CheckKey
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
return
Http
.
getInstance
().
post
(
`/productsalesliteratures/
${
context
.
productsalesliterature
}
/checkkey`
,
data
,
isloading
);
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof ProductSalesLiteratureServiceBase
*/
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/productsalesliteratures/getdraft`
,
isloading
);
res
.
data
.
productsalesliterature
=
data
.
productsalesliterature
;
return
res
;
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof ProductSalesLiteratureServiceBase
*/
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/productsalesliteratures/
${
context
.
productsalesliterature
}
/save`
,
data
,
isloading
);
return
res
;
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof ProductSalesLiteratureServiceBase
*/
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/productsalesliteratures`
,
data
,
isloading
);
return
res
;
}
/**
* FetchDefault接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof ProductSalesLiteratureServiceBase
*/
public
async
FetchDefault
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
Http
.
getInstance
().
get
(
`/productsalesliteratures/fetchdefault`
,
tempData
,
isloading
);
}
}
\ No newline at end of file
app_CRM/src/service/product-sales-literature/product-sales-literature-service.ts
0 → 100644
浏览文件 @
b3737bd6
import
{
Http
,
Util
}
from
'@/utils'
;
import
ProductSalesLiteratureServiceBase
from
'./product-sales-literature-service-base'
;
/**
* 产品宣传资料服务对象
*
* @export
* @class ProductSalesLiteratureService
* @extends {ProductSalesLiteratureServiceBase}
*/
export
default
class
ProductSalesLiteratureService
extends
ProductSalesLiteratureServiceBase
{
/**
* Creates an instance of ProductSalesLiteratureService.
*
* @param {*} [opts={}]
* @memberof ProductSalesLiteratureService
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
}
}
\ No newline at end of file
app_CRM/src/service/sales-literature-item/sales-literature-item-service-base.ts
0 → 100644
浏览文件 @
b3737bd6
import
{
Http
,
Util
}
from
'@/utils'
;
import
EntityService
from
'../entity-service'
;
/**
* 销售附件服务对象基类
*
* @export
* @class SalesLiteratureItemServiceBase
* @extends {EntityServie}
*/
export
default
class
SalesLiteratureItemServiceBase
extends
EntityService
{
/**
* Creates an instance of SalesLiteratureItemServiceBase.
*
* @param {*} [opts={}]
* @memberof SalesLiteratureItemServiceBase
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
}
/**
* 初始化基础数据
*
* @memberof SalesLiteratureItemServiceBase
*/
public
initBasicData
(){
this
.
APPLYDEKEY
=
'salesliteratureitem'
;
this
.
APPDEKEY
=
'salesliteratureitemid'
;
this
.
APPDENAME
=
'salesliteratureitems'
;
this
.
APPDETEXT
=
'title'
;
this
.
APPNAME
=
'crm'
;
this
.
SYSTEMNAME
=
'ibizbusinesscentral'
;
}
// 实体接口
/**
* Select接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SalesLiteratureItemServiceBase
*/
public
async
Select
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
return
Http
.
getInstance
().
get
(
`/salesliteratureitems/
${
context
.
salesliteratureitem
}
/select`
,
isloading
);
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SalesLiteratureItemServiceBase
*/
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/salesliteratureitems/
${
context
.
salesliteratureitem
}
/save`
,
data
,
isloading
);
return
res
;
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SalesLiteratureItemServiceBase
*/
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/salesliteratureitems/
${
context
.
salesliteratureitem
}
`
,
isloading
);
return
res
;
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SalesLiteratureItemServiceBase
*/
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/salesliteratureitems/getdraft`
,
isloading
);
res
.
data
.
salesliteratureitem
=
data
.
salesliteratureitem
;
return
res
;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SalesLiteratureItemServiceBase
*/
public
async
Remove
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
return
Http
.
getInstance
().
delete
(
`/salesliteratureitems/
${
context
.
salesliteratureitem
}
`
,
isloading
);
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SalesLiteratureItemServiceBase
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/salesliteratureitems/
${
context
.
salesliteratureitem
}
`
,
data
,
isloading
);
return
res
;
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SalesLiteratureItemServiceBase
*/
public
async
CheckKey
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
return
Http
.
getInstance
().
post
(
`/salesliteratureitems/
${
context
.
salesliteratureitem
}
/checkkey`
,
data
,
isloading
);
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SalesLiteratureItemServiceBase
*/
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/salesliteratureitems`
,
data
,
isloading
);
return
res
;
}
/**
* FetchDefault接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SalesLiteratureItemServiceBase
*/
public
async
FetchDefault
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
Http
.
getInstance
().
get
(
`/salesliteratureitems/fetchdefault`
,
tempData
,
isloading
);
}
}
\ No newline at end of file
app_CRM/src/service/sales-literature-item/sales-literature-item-service.ts
0 → 100644
浏览文件 @
b3737bd6
import
{
Http
,
Util
}
from
'@/utils'
;
import
SalesLiteratureItemServiceBase
from
'./sales-literature-item-service-base'
;
/**
* 销售附件服务对象
*
* @export
* @class SalesLiteratureItemService
* @extends {SalesLiteratureItemServiceBase}
*/
export
default
class
SalesLiteratureItemService
extends
SalesLiteratureItemServiceBase
{
/**
* Creates an instance of SalesLiteratureItemService.
*
* @param {*} [opts={}]
* @memberof SalesLiteratureItemService
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
}
}
\ No newline at end of file
app_CRM/src/uiservice/product-sales-literature/product-sales-literature-ui-service-base.ts
0 → 100644
浏览文件 @
b3737bd6
import
{
Environment
}
from
'@/environments/environment'
;
import
{
UIActionTool
,
Util
}
from
'@/utils'
;
import
UIService
from
'../ui-service'
;
import
{
Subject
}
from
'rxjs'
;
import
ProductSalesLiteratureService
from
'@/service/product-sales-literature/product-sales-literature-service'
;
/**
* 产品宣传资料UI服务对象基类
*
* @export
* @class ProductSalesLiteratureUIServiceBase
*/
export
default
class
ProductSalesLiteratureUIServiceBase
extends
UIService
{
/**
* 是否支持工作流
*
* @memberof ProductSalesLiteratureUIServiceBase
*/
public
isEnableWorkflow
:
boolean
=
false
;
/**
* 当前UI服务对应的数据服务对象
*
* @memberof ProductSalesLiteratureUIServiceBase
*/
public
dataService
:
ProductSalesLiteratureService
=
new
ProductSalesLiteratureService
();
/**
* 所有关联视图
*
* @memberof ProductSalesLiteratureUIServiceBase
*/
public
allViewMap
:
Map
<
string
,
Object
>
=
new
Map
();
/**
* 状态值
*
* @memberof ProductSalesLiteratureUIServiceBase
*/
public
stateValue
:
number
=
0
;
/**
* 状态属性
*
* @memberof ProductSalesLiteratureUIServiceBase
*/
public
stateField
:
string
=
""
;
/**
* 主状态属性集合
*
* @memberof ProductSalesLiteratureUIServiceBase
*/
public
mainStateFields
:
Array
<
any
>
=
[];
/**
* 主状态集合Map
*
* @memberof ProductSalesLiteratureUIServiceBase
*/
public
allDeMainStateMap
:
Map
<
string
,
string
>
=
new
Map
();
/**
* Creates an instance of ProductSalesLiteratureUIServiceBase.
*
* @param {*} [opts={}]
* @memberof ProductSalesLiteratureUIServiceBase
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
this
.
initViewMap
();
this
.
initDeMainStateMap
();
}
/**
* 初始化视图Map
*
* @memberof ProductSalesLiteratureUIServiceBase
*/
public
initViewMap
(){
}
/**
* 初始化主状态集合
*
* @memberof ProductSalesLiteratureUIServiceBase
*/
public
initDeMainStateMap
(){
}
/**
* 获取指定数据的重定向页面
*
* @param srfkey 数据主键
* @param isEnableWorkflow 重定向视图是否需要处理流程中的数据
* @memberof ProductSalesLiteratureUIServiceBase
*/
public
async
getRDAppView
(
srfkey
:
string
,
isEnableWorkflow
:
boolean
){
this
.
isEnableWorkflow
=
isEnableWorkflow
;
// 进行数据查询
let
result
:
any
=
await
this
.
dataService
.
Get
({
productsalesliterature
:
srfkey
});
const
curData
:
any
=
result
.
data
;
//判断当前数据模式,默认为true,todo
const
iRealDEModel
:
boolean
=
true
;
let
bDataInWF
:
boolean
=
false
;
let
bWFMode
:
any
=
false
;
// 计算数据模式
if
(
this
.
isEnableWorkflow
)
{
bDataInWF
=
await
this
.
dataService
.
testDataInWF
({
stateValue
:
this
.
stateValue
,
stateField
:
this
.
stateField
},
curData
);
if
(
bDataInWF
)
{
bDataInWF
=
true
;
bWFMode
=
await
this
.
dataService
.
testUserExistWorklist
(
null
,
curData
);
}
}
let
strPDTViewParam
:
string
=
await
this
.
getDESDDEViewPDTParam
(
curData
,
bDataInWF
,
bWFMode
);
//若不是当前数据模式,处理strPDTViewParam,todo
//查找视图
//返回视图
return
this
.
allViewMap
.
get
(
strPDTViewParam
);
}
/**
* 获取实际的数据类型
*
* @memberof ProductSalesLiteratureUIServiceBase
*/
public
getRealDEType
(
entity
:
any
){
}
/**
* 获取实体单数据实体视图预定义参数
*
* @param curData 当前数据
* @param bDataInWF 是否有数据在工作流中
* @param bWFMode 是否工作流模式
* @memberof ProductSalesLiteratureUIServiceBase
*/
public
async
getDESDDEViewPDTParam
(
curData
:
any
,
bDataInWF
:
boolean
,
bWFMode
:
boolean
){
let
strPDTParam
:
string
=
''
;
if
(
bDataInWF
)
{
// 判断数据是否在流程中
}
//多表单,todo
const
isEnableMultiForm
:
boolean
=
false
;
const
multiFormDEField
:
string
|
null
=
null
;
if
(
isEnableMultiForm
&&
multiFormDEField
)
{
const
objFormValue
:
string
=
curData
[
multiFormDEField
];
if
(
!
Environment
.
isAppMode
){
return
'MOBEDITVIEW'
+
objFormValue
;
}
return
'EDITVIEW'
+
objFormValue
;
}
if
(
!
Environment
.
isAppMode
){
if
(
this
.
getDEMainStateTag
(
curData
)){
return
`MOBEDITVIEW:MSTAG:
${
await
this
.
getDEMainStateTag
(
curData
)}
`
;
}
return
'MOBEDITVIEW:'
;
}
if
(
this
.
getDEMainStateTag
(
curData
)){
return
`EDITVIEW:MSTAG:
${
await
this
.
getDEMainStateTag
(
curData
)}
`
;
}
return
'EDITVIEW:'
;
}
/**
* 获取数据对象的主状态标识
*
* @param curData 当前数据
* @memberof ProductSalesLiteratureUIServiceBase
*/
public
async
getDEMainStateTag
(
curData
:
any
){
if
(
this
.
mainStateFields
.
length
===
0
)
return
null
;
this
.
mainStateFields
.
forEach
((
singleMainField
:
any
)
=>
{
if
(
!
(
singleMainField
in
curData
)){
console
.
error
(
`当前数据对象不包含属性singleMainField,可能会发生错误`
);
}
})
let
strTag
:
String
=
""
;
for
(
let
i
=
0
;
i
<=
1
;
i
++
)
{
let
strTag
:
string
=
(
curData
[
this
.
mainStateFields
[
0
]])?(
i
==
0
)
?
curData
[
this
.
mainStateFields
[
0
]]
:
""
:
""
;
if
(
this
.
mainStateFields
.
length
>=
2
)
{
for
(
let
j
=
0
;
j
<=
1
;
j
++
)
{
let
strTag2
:
string
=
(
curData
[
this
.
mainStateFields
[
1
]])?
`
${
strTag
}
__
${(
j
==
0
)
?
curData
[
this
.
mainStateFields
[
1
]]
:
""
}
`
:
strTag
;
if
(
this
.
mainStateFields
.
length
>=
3
)
{
for
(
let
k
=
0
;
k
<=
1
;
k
++
)
{
let
strTag3
:
string
=
(
curData
[
this
.
mainStateFields
[
2
]])?
`
${
strTag2
}
__
${(
k
==
0
)
?
curData
[
this
.
mainStateFields
[
2
]]
:
""
}
`
:
strTag2
;
// 判断是否存在
return
this
.
allDeMainStateMap
.
get
(
strTag3
);
}
}
else
{
return
this
.
allDeMainStateMap
.
get
(
strTag2
);
}
}
}
else
{
return
this
.
allDeMainStateMap
.
get
(
strTag
);
}
}
return
null
;
}
}
\ No newline at end of file
app_CRM/src/uiservice/product-sales-literature/product-sales-literature-ui-service.ts
0 → 100644
浏览文件 @
b3737bd6
import
ProductSalesLiteratureUIServiceBase
from
'./product-sales-literature-ui-service-base'
;
/**
* 产品宣传资料UI服务对象
*
* @export
* @class ProductSalesLiteratureUIService
*/
export
default
class
ProductSalesLiteratureUIService
extends
ProductSalesLiteratureUIServiceBase
{
/**
* Creates an instance of ProductSalesLiteratureUIService.
*
* @param {*} [opts={}]
* @memberof ProductSalesLiteratureUIService
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
}
}
\ No newline at end of file
app_CRM/src/uiservice/sales-literature-item/sales-literature-item-ui-service-base.ts
0 → 100644
浏览文件 @
b3737bd6
import
{
Environment
}
from
'@/environments/environment'
;
import
{
UIActionTool
,
Util
}
from
'@/utils'
;
import
UIService
from
'../ui-service'
;
import
{
Subject
}
from
'rxjs'
;
import
SalesLiteratureItemService
from
'@/service/sales-literature-item/sales-literature-item-service'
;
/**
* 销售附件UI服务对象基类
*
* @export
* @class SalesLiteratureItemUIServiceBase
*/
export
default
class
SalesLiteratureItemUIServiceBase
extends
UIService
{
/**
* 是否支持工作流
*
* @memberof SalesLiteratureItemUIServiceBase
*/
public
isEnableWorkflow
:
boolean
=
false
;
/**
* 当前UI服务对应的数据服务对象
*
* @memberof SalesLiteratureItemUIServiceBase
*/
public
dataService
:
SalesLiteratureItemService
=
new
SalesLiteratureItemService
();
/**
* 所有关联视图
*
* @memberof SalesLiteratureItemUIServiceBase
*/
public
allViewMap
:
Map
<
string
,
Object
>
=
new
Map
();
/**
* 状态值
*
* @memberof SalesLiteratureItemUIServiceBase
*/
public
stateValue
:
number
=
0
;
/**
* 状态属性
*
* @memberof SalesLiteratureItemUIServiceBase
*/
public
stateField
:
string
=
""
;
/**
* 主状态属性集合
*
* @memberof SalesLiteratureItemUIServiceBase
*/
public
mainStateFields
:
Array
<
any
>
=
[];
/**
* 主状态集合Map
*
* @memberof SalesLiteratureItemUIServiceBase
*/
public
allDeMainStateMap
:
Map
<
string
,
string
>
=
new
Map
();
/**
* Creates an instance of SalesLiteratureItemUIServiceBase.
*
* @param {*} [opts={}]
* @memberof SalesLiteratureItemUIServiceBase
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
this
.
initViewMap
();
this
.
initDeMainStateMap
();
}
/**
* 初始化视图Map
*
* @memberof SalesLiteratureItemUIServiceBase
*/
public
initViewMap
(){
}
/**
* 初始化主状态集合
*
* @memberof SalesLiteratureItemUIServiceBase
*/
public
initDeMainStateMap
(){
}
/**
* 获取指定数据的重定向页面
*
* @param srfkey 数据主键
* @param isEnableWorkflow 重定向视图是否需要处理流程中的数据
* @memberof SalesLiteratureItemUIServiceBase
*/
public
async
getRDAppView
(
srfkey
:
string
,
isEnableWorkflow
:
boolean
){
this
.
isEnableWorkflow
=
isEnableWorkflow
;
// 进行数据查询
let
result
:
any
=
await
this
.
dataService
.
Get
({
salesliteratureitem
:
srfkey
});
const
curData
:
any
=
result
.
data
;
//判断当前数据模式,默认为true,todo
const
iRealDEModel
:
boolean
=
true
;
let
bDataInWF
:
boolean
=
false
;
let
bWFMode
:
any
=
false
;
// 计算数据模式
if
(
this
.
isEnableWorkflow
)
{
bDataInWF
=
await
this
.
dataService
.
testDataInWF
({
stateValue
:
this
.
stateValue
,
stateField
:
this
.
stateField
},
curData
);
if
(
bDataInWF
)
{
bDataInWF
=
true
;
bWFMode
=
await
this
.
dataService
.
testUserExistWorklist
(
null
,
curData
);
}
}
let
strPDTViewParam
:
string
=
await
this
.
getDESDDEViewPDTParam
(
curData
,
bDataInWF
,
bWFMode
);
//若不是当前数据模式,处理strPDTViewParam,todo
//查找视图
//返回视图
return
this
.
allViewMap
.
get
(
strPDTViewParam
);
}
/**
* 获取实际的数据类型
*
* @memberof SalesLiteratureItemUIServiceBase
*/
public
getRealDEType
(
entity
:
any
){
}
/**
* 获取实体单数据实体视图预定义参数
*
* @param curData 当前数据
* @param bDataInWF 是否有数据在工作流中
* @param bWFMode 是否工作流模式
* @memberof SalesLiteratureItemUIServiceBase
*/
public
async
getDESDDEViewPDTParam
(
curData
:
any
,
bDataInWF
:
boolean
,
bWFMode
:
boolean
){
let
strPDTParam
:
string
=
''
;
if
(
bDataInWF
)
{
// 判断数据是否在流程中
}
//多表单,todo
const
isEnableMultiForm
:
boolean
=
false
;
const
multiFormDEField
:
string
|
null
=
null
;
if
(
isEnableMultiForm
&&
multiFormDEField
)
{
const
objFormValue
:
string
=
curData
[
multiFormDEField
];
if
(
!
Environment
.
isAppMode
){
return
'MOBEDITVIEW'
+
objFormValue
;
}
return
'EDITVIEW'
+
objFormValue
;
}
if
(
!
Environment
.
isAppMode
){
if
(
this
.
getDEMainStateTag
(
curData
)){
return
`MOBEDITVIEW:MSTAG:
${
await
this
.
getDEMainStateTag
(
curData
)}
`
;
}
return
'MOBEDITVIEW:'
;
}
if
(
this
.
getDEMainStateTag
(
curData
)){
return
`EDITVIEW:MSTAG:
${
await
this
.
getDEMainStateTag
(
curData
)}
`
;
}
return
'EDITVIEW:'
;
}
/**
* 获取数据对象的主状态标识
*
* @param curData 当前数据
* @memberof SalesLiteratureItemUIServiceBase
*/
public
async
getDEMainStateTag
(
curData
:
any
){
if
(
this
.
mainStateFields
.
length
===
0
)
return
null
;
this
.
mainStateFields
.
forEach
((
singleMainField
:
any
)
=>
{
if
(
!
(
singleMainField
in
curData
)){
console
.
error
(
`当前数据对象不包含属性singleMainField,可能会发生错误`
);
}
})
let
strTag
:
String
=
""
;
for
(
let
i
=
0
;
i
<=
1
;
i
++
)
{
let
strTag
:
string
=
(
curData
[
this
.
mainStateFields
[
0
]])?(
i
==
0
)
?
curData
[
this
.
mainStateFields
[
0
]]
:
""
:
""
;
if
(
this
.
mainStateFields
.
length
>=
2
)
{
for
(
let
j
=
0
;
j
<=
1
;
j
++
)
{
let
strTag2
:
string
=
(
curData
[
this
.
mainStateFields
[
1
]])?
`
${
strTag
}
__
${(
j
==
0
)
?
curData
[
this
.
mainStateFields
[
1
]]
:
""
}
`
:
strTag
;
if
(
this
.
mainStateFields
.
length
>=
3
)
{
for
(
let
k
=
0
;
k
<=
1
;
k
++
)
{
let
strTag3
:
string
=
(
curData
[
this
.
mainStateFields
[
2
]])?
`
${
strTag2
}
__
${(
k
==
0
)
?
curData
[
this
.
mainStateFields
[
2
]]
:
""
}
`
:
strTag2
;
// 判断是否存在
return
this
.
allDeMainStateMap
.
get
(
strTag3
);
}
}
else
{
return
this
.
allDeMainStateMap
.
get
(
strTag2
);
}
}
}
else
{
return
this
.
allDeMainStateMap
.
get
(
strTag
);
}
}
return
null
;
}
}
\ No newline at end of file
app_CRM/src/uiservice/sales-literature-item/sales-literature-item-ui-service.ts
0 → 100644
浏览文件 @
b3737bd6
import
SalesLiteratureItemUIServiceBase
from
'./sales-literature-item-ui-service-base'
;
/**
* 销售附件UI服务对象
*
* @export
* @class SalesLiteratureItemUIService
*/
export
default
class
SalesLiteratureItemUIService
extends
SalesLiteratureItemUIServiceBase
{
/**
* Creates an instance of SalesLiteratureItemUIService.
*
* @param {*} [opts={}]
* @memberof SalesLiteratureItemUIService
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
}
}
\ No newline at end of file
app_CRM/src/uiservice/ui-service-register.ts
浏览文件 @
b3737bd6
...
@@ -71,12 +71,14 @@ export class UIServiceRegister {
...
@@ -71,12 +71,14 @@ export class UIServiceRegister {
this
.
allUIService
.
set
(
'campaignactivity'
,
()
=>
import
(
'@/uiservice/campaign-activity/campaign-activity-ui-service'
));
this
.
allUIService
.
set
(
'campaignactivity'
,
()
=>
import
(
'@/uiservice/campaign-activity/campaign-activity-ui-service'
));
this
.
allUIService
.
set
(
'listlead'
,
()
=>
import
(
'@/uiservice/list-lead/list-lead-ui-service'
));
this
.
allUIService
.
set
(
'listlead'
,
()
=>
import
(
'@/uiservice/list-lead/list-lead-ui-service'
));
this
.
allUIService
.
set
(
'opportunitycompetitor'
,
()
=>
import
(
'@/uiservice/opportunity-competitor/opportunity-competitor-ui-service'
));
this
.
allUIService
.
set
(
'opportunitycompetitor'
,
()
=>
import
(
'@/uiservice/opportunity-competitor/opportunity-competitor-ui-service'
));
this
.
allUIService
.
set
(
'salesliteratureitem'
,
()
=>
import
(
'@/uiservice/sales-literature-item/sales-literature-item-ui-service'
));
this
.
allUIService
.
set
(
'contact'
,
()
=>
import
(
'@/uiservice/contact/contact-ui-service'
));
this
.
allUIService
.
set
(
'contact'
,
()
=>
import
(
'@/uiservice/contact/contact-ui-service'
));
this
.
allUIService
.
set
(
'product'
,
()
=>
import
(
'@/uiservice/product/product-ui-service'
));
this
.
allUIService
.
set
(
'product'
,
()
=>
import
(
'@/uiservice/product/product-ui-service'
));
this
.
allUIService
.
set
(
'competitor'
,
()
=>
import
(
'@/uiservice/competitor/competitor-ui-service'
));
this
.
allUIService
.
set
(
'competitor'
,
()
=>
import
(
'@/uiservice/competitor/competitor-ui-service'
));
this
.
allUIService
.
set
(
'account'
,
()
=>
import
(
'@/uiservice/account/account-ui-service'
));
this
.
allUIService
.
set
(
'account'
,
()
=>
import
(
'@/uiservice/account/account-ui-service'
));
this
.
allUIService
.
set
(
'salesorder'
,
()
=>
import
(
'@/uiservice/sales-order/sales-order-ui-service'
));
this
.
allUIService
.
set
(
'salesorder'
,
()
=>
import
(
'@/uiservice/sales-order/sales-order-ui-service'
));
this
.
allUIService
.
set
(
'quotedetail'
,
()
=>
import
(
'@/uiservice/quote-detail/quote-detail-ui-service'
));
this
.
allUIService
.
set
(
'quotedetail'
,
()
=>
import
(
'@/uiservice/quote-detail/quote-detail-ui-service'
));
this
.
allUIService
.
set
(
'productsalesliterature'
,
()
=>
import
(
'@/uiservice/product-sales-literature/product-sales-literature-ui-service'
));
this
.
allUIService
.
set
(
'subject'
,
()
=>
import
(
'@/uiservice/subject/subject-ui-service'
));
this
.
allUIService
.
set
(
'subject'
,
()
=>
import
(
'@/uiservice/subject/subject-ui-service'
));
}
}
...
...
businesscentral-app/businesscentral-app-crm/src/main/resources/application-crm-prod.yml
浏览文件 @
b3737bd6
...
@@ -135,6 +135,10 @@ zuul:
...
@@ -135,6 +135,10 @@ zuul:
path
:
/opportunitycompetitors/**
path
:
/opportunitycompetitors/**
serviceId
:
ibizbusinesscentral-centralapi
serviceId
:
ibizbusinesscentral-centralapi
stripPrefix
:
false
stripPrefix
:
false
salesliteratureitem
:
path
:
/salesliteratureitems/**
serviceId
:
ibizbusinesscentral-centralapi
stripPrefix
:
false
contact
:
contact
:
path
:
/contacts/**
path
:
/contacts/**
serviceId
:
ibizbusinesscentral-centralapi
serviceId
:
ibizbusinesscentral-centralapi
...
@@ -159,6 +163,10 @@ zuul:
...
@@ -159,6 +163,10 @@ zuul:
path
:
/quotedetails/**
path
:
/quotedetails/**
serviceId
:
ibizbusinesscentral-centralapi
serviceId
:
ibizbusinesscentral-centralapi
stripPrefix
:
false
stripPrefix
:
false
productsalesliterature
:
path
:
/productsalesliteratures/**
serviceId
:
ibizbusinesscentral-centralapi
stripPrefix
:
false
subject
:
subject
:
path
:
/subjects/**
path
:
/subjects/**
serviceId
:
ibizbusinesscentral-centralapi
serviceId
:
ibizbusinesscentral-centralapi
...
...
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/product/domain/ProductSalesLiterature.java
0 → 100644
浏览文件 @
b3737bd6
package
cn
.
ibizlab
.
businesscentral
.
core
.
product
.
domain
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.math.BigInteger
;
import
java.util.HashMap
;
import
java.math.BigDecimal
;
import
java.text.SimpleDateFormat
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.DigestUtils
;
import
cn.ibizlab.businesscentral.util.domain.EntityBase
;
import
cn.ibizlab.businesscentral.util.annotation.DEField
;
import
cn.ibizlab.businesscentral.util.enums.DEPredefinedFieldType
;
import
cn.ibizlab.businesscentral.util.enums.DEFieldDefaultValueType
;
import
java.io.Serializable
;
import
lombok.*
;
import
org.springframework.data.annotation.Transient
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
com.baomidou.mybatisplus.annotation.*
;
import
cn.ibizlab.businesscentral.util.domain.EntityMP
;
/**
* 实体[产品宣传资料]
*/
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties
(
value
=
"handler"
)
@TableName
(
value
=
"RELATIONSHIPS"
,
resultMap
=
"ProductSalesLiteratureResultMap"
)
public
class
ProductSalesLiterature
extends
EntityMP
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 建立时间
*/
@DEField
(
preType
=
DEPredefinedFieldType
.
CREATEDATE
)
@TableField
(
value
=
"createdate"
,
fill
=
FieldFill
.
INSERT
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
locale
=
"zh"
,
timezone
=
"GMT+8"
)
@JSONField
(
name
=
"createdate"
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonProperty
(
"createdate"
)
private
Timestamp
createdate
;
/**
* 建立人
*/
@DEField
(
preType
=
DEPredefinedFieldType
.
CREATEMAN
)
@TableField
(
value
=
"createman"
,
fill
=
FieldFill
.
INSERT
)
@JSONField
(
name
=
"createman"
)
@JsonProperty
(
"createman"
)
private
String
createman
;
/**
* 关系标识
*/
@DEField
(
isKeyField
=
true
)
@TableId
(
value
=
"relationshipsid"
,
type
=
IdType
.
ASSIGN_UUID
)
@JSONField
(
name
=
"relationshipsid"
)
@JsonProperty
(
"relationshipsid"
)
private
String
relationshipsid
;
/**
* 关系名称
*/
@TableField
(
value
=
"relationshipsname"
)
@JSONField
(
name
=
"relationshipsname"
)
@JsonProperty
(
"relationshipsname"
)
private
String
relationshipsname
;
/**
* 关系类型
*/
@DEField
(
defaultValue
=
"PRODUCTSALESLITERATURE"
)
@TableField
(
value
=
"relationshipstype"
)
@JSONField
(
name
=
"relationshipstype"
)
@JsonProperty
(
"relationshipstype"
)
private
String
relationshipstype
;
/**
* 更新时间
*/
@DEField
(
preType
=
DEPredefinedFieldType
.
UPDATEDATE
)
@TableField
(
value
=
"updatedate"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
locale
=
"zh"
,
timezone
=
"GMT+8"
)
@JSONField
(
name
=
"updatedate"
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonProperty
(
"updatedate"
)
private
Timestamp
updatedate
;
/**
* 更新人
*/
@DEField
(
preType
=
DEPredefinedFieldType
.
UPDATEMAN
)
@TableField
(
value
=
"updateman"
)
@JSONField
(
name
=
"updateman"
)
@JsonProperty
(
"updateman"
)
private
String
updateman
;
/**
* 产品
*/
@TableField
(
value
=
"entityid"
)
@JSONField
(
name
=
"entityid"
)
@JsonProperty
(
"entityid"
)
private
String
entityid
;
/**
* 销售宣传资料
*/
@TableField
(
value
=
"entity2id"
)
@JSONField
(
name
=
"entity2id"
)
@JsonProperty
(
"entity2id"
)
private
String
entity2id
;
/**
* 产品
*/
@TableField
(
value
=
"entityname"
)
@JSONField
(
name
=
"entityname"
)
@JsonProperty
(
"entityname"
)
private
String
entityname
;
/**
* 销售宣传资料
*/
@TableField
(
value
=
"entity2name"
)
@JSONField
(
name
=
"entity2name"
)
@JsonProperty
(
"entity2name"
)
private
String
entity2name
;
/**
*
*/
@JsonIgnore
@JSONField
(
serialize
=
false
)
@TableField
(
exist
=
false
)
private
cn
.
ibizlab
.
businesscentral
.
core
.
product
.
domain
.
Product
product
;
/**
*
*/
@JsonIgnore
@JSONField
(
serialize
=
false
)
@TableField
(
exist
=
false
)
private
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
domain
.
SalesLiterature
salesliterature
;
/**
* 设置 [关系名称]
*/
public
void
setRelationshipsname
(
String
relationshipsname
){
this
.
relationshipsname
=
relationshipsname
;
this
.
modify
(
"relationshipsname"
,
relationshipsname
);
}
/**
* 设置 [关系类型]
*/
public
void
setRelationshipstype
(
String
relationshipstype
){
this
.
relationshipstype
=
relationshipstype
;
this
.
modify
(
"relationshipstype"
,
relationshipstype
);
}
/**
* 设置 [产品]
*/
public
void
setEntityid
(
String
entityid
){
this
.
entityid
=
entityid
;
this
.
modify
(
"entityid"
,
entityid
);
}
/**
* 设置 [销售宣传资料]
*/
public
void
setEntity2id
(
String
entity2id
){
this
.
entity2id
=
entity2id
;
this
.
modify
(
"entity2id"
,
entity2id
);
}
/**
* 设置 [产品]
*/
public
void
setEntityname
(
String
entityname
){
this
.
entityname
=
entityname
;
this
.
modify
(
"entityname"
,
entityname
);
}
/**
* 设置 [销售宣传资料]
*/
public
void
setEntity2name
(
String
entity2name
){
this
.
entity2name
=
entity2name
;
this
.
modify
(
"entity2name"
,
entity2name
);
}
}
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/product/filter/ProductSalesLiteratureSearchContext.java
0 → 100644
浏览文件 @
b3737bd6
package
cn
.
ibizlab
.
businesscentral
.
core
.
product
.
filter
;
import
java.math.BigDecimal
;
import
java.math.BigInteger
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.HashMap
;
import
lombok.*
;
import
lombok.extern.slf4j.Slf4j
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
cn.ibizlab.businesscentral.util.filter.QueryWrapperContext
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
cn.ibizlab.businesscentral.core.product.domain.ProductSalesLiterature
;
/**
* 关系型数据实体[ProductSalesLiterature] 查询条件对象
*/
@Slf4j
@Data
public
class
ProductSalesLiteratureSearchContext
extends
QueryWrapperContext
<
ProductSalesLiterature
>
{
private
String
n_relationshipsname_like
;
//[关系名称]
public
void
setN_relationshipsname_like
(
String
n_relationshipsname_like
)
{
this
.
n_relationshipsname_like
=
n_relationshipsname_like
;
if
(!
ObjectUtils
.
isEmpty
(
this
.
n_relationshipsname_like
)){
this
.
getSearchCond
().
like
(
"relationshipsname"
,
n_relationshipsname_like
);
}
}
private
String
n_relationshipstype_eq
;
//[关系类型]
public
void
setN_relationshipstype_eq
(
String
n_relationshipstype_eq
)
{
this
.
n_relationshipstype_eq
=
n_relationshipstype_eq
;
if
(!
ObjectUtils
.
isEmpty
(
this
.
n_relationshipstype_eq
)){
this
.
getSearchCond
().
eq
(
"relationshipstype"
,
n_relationshipstype_eq
);
}
}
private
String
n_entityid_eq
;
//[产品]
public
void
setN_entityid_eq
(
String
n_entityid_eq
)
{
this
.
n_entityid_eq
=
n_entityid_eq
;
if
(!
ObjectUtils
.
isEmpty
(
this
.
n_entityid_eq
)){
this
.
getSearchCond
().
eq
(
"entityid"
,
n_entityid_eq
);
}
}
private
String
n_entity2id_eq
;
//[销售宣传资料]
public
void
setN_entity2id_eq
(
String
n_entity2id_eq
)
{
this
.
n_entity2id_eq
=
n_entity2id_eq
;
if
(!
ObjectUtils
.
isEmpty
(
this
.
n_entity2id_eq
)){
this
.
getSearchCond
().
eq
(
"entity2id"
,
n_entity2id_eq
);
}
}
private
String
n_entityname_eq
;
//[产品]
public
void
setN_entityname_eq
(
String
n_entityname_eq
)
{
this
.
n_entityname_eq
=
n_entityname_eq
;
if
(!
ObjectUtils
.
isEmpty
(
this
.
n_entityname_eq
)){
this
.
getSearchCond
().
eq
(
"entityname"
,
n_entityname_eq
);
}
}
private
String
n_entityname_like
;
//[产品]
public
void
setN_entityname_like
(
String
n_entityname_like
)
{
this
.
n_entityname_like
=
n_entityname_like
;
if
(!
ObjectUtils
.
isEmpty
(
this
.
n_entityname_like
)){
this
.
getSearchCond
().
like
(
"entityname"
,
n_entityname_like
);
}
}
private
String
n_entity2name_eq
;
//[销售宣传资料]
public
void
setN_entity2name_eq
(
String
n_entity2name_eq
)
{
this
.
n_entity2name_eq
=
n_entity2name_eq
;
if
(!
ObjectUtils
.
isEmpty
(
this
.
n_entity2name_eq
)){
this
.
getSearchCond
().
eq
(
"entity2name"
,
n_entity2name_eq
);
}
}
private
String
n_entity2name_like
;
//[销售宣传资料]
public
void
setN_entity2name_like
(
String
n_entity2name_like
)
{
this
.
n_entity2name_like
=
n_entity2name_like
;
if
(!
ObjectUtils
.
isEmpty
(
this
.
n_entity2name_like
)){
this
.
getSearchCond
().
like
(
"entity2name"
,
n_entity2name_like
);
}
}
/**
* 启用快速搜索
*/
public
void
setQuery
(
String
query
)
{
this
.
query
=
query
;
if
(!
StringUtils
.
isEmpty
(
query
)){
this
.
getSearchCond
().
and
(
wrapper
->
wrapper
.
like
(
"relationshipsname"
,
query
)
);
}
}
}
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/product/mapper/ProductSalesLiteratureMapper.java
0 → 100644
浏览文件 @
b3737bd6
package
cn
.
ibizlab
.
businesscentral
.
core
.
product
.
mapper
;
import
java.util.List
;
import
org.apache.ibatis.annotations.*
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.conditions.Wrapper
;
import
java.util.HashMap
;
import
org.apache.ibatis.annotations.Select
;
import
cn.ibizlab.businesscentral.core.product.domain.ProductSalesLiterature
;
import
cn.ibizlab.businesscentral.core.product.filter.ProductSalesLiteratureSearchContext
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.cache.annotation.Cacheable
;
import
java.io.Serializable
;
import
com.baomidou.mybatisplus.core.toolkit.Constants
;
import
com.alibaba.fastjson.JSONObject
;
public
interface
ProductSalesLiteratureMapper
extends
BaseMapper
<
ProductSalesLiterature
>{
Page
<
ProductSalesLiterature
>
searchDefault
(
IPage
page
,
@Param
(
"srf"
)
ProductSalesLiteratureSearchContext
context
,
@Param
(
"ew"
)
Wrapper
<
ProductSalesLiterature
>
wrapper
)
;
@Override
ProductSalesLiterature
selectById
(
Serializable
id
);
@Override
int
insert
(
ProductSalesLiterature
entity
);
@Override
int
updateById
(
@Param
(
Constants
.
ENTITY
)
ProductSalesLiterature
entity
);
@Override
int
update
(
@Param
(
Constants
.
ENTITY
)
ProductSalesLiterature
entity
,
@Param
(
"ew"
)
Wrapper
<
ProductSalesLiterature
>
updateWrapper
);
@Override
int
deleteById
(
Serializable
id
);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select
(
"${sql}"
)
List
<
JSONObject
>
selectBySQL
(
@Param
(
"sql"
)
String
sql
,
@Param
(
"et"
)
Map
param
);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update
(
"${sql}"
)
boolean
updateBySQL
(
@Param
(
"sql"
)
String
sql
,
@Param
(
"et"
)
Map
param
);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert
(
"${sql}"
)
boolean
insertBySQL
(
@Param
(
"sql"
)
String
sql
,
@Param
(
"et"
)
Map
param
);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete
(
"${sql}"
)
boolean
deleteBySQL
(
@Param
(
"sql"
)
String
sql
,
@Param
(
"et"
)
Map
param
);
List
<
ProductSalesLiterature
>
selectByEntityid
(
@Param
(
"productid"
)
Serializable
productid
)
;
List
<
ProductSalesLiterature
>
selectByEntity2id
(
@Param
(
"salesliteratureid"
)
Serializable
salesliteratureid
)
;
}
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/product/service/IProductSalesLiteratureService.java
0 → 100644
浏览文件 @
b3737bd6
package
cn
.
ibizlab
.
businesscentral
.
core
.
product
.
service
;
import
java.io.Serializable
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.HashMap
;
import
java.util.Collection
;
import
java.math.BigInteger
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
com.alibaba.fastjson.JSONObject
;
import
org.springframework.cache.annotation.CacheEvict
;
import
cn.ibizlab.businesscentral.core.product.domain.ProductSalesLiterature
;
import
cn.ibizlab.businesscentral.core.product.filter.ProductSalesLiteratureSearchContext
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
* 实体[ProductSalesLiterature] 服务对象接口
*/
public
interface
IProductSalesLiteratureService
extends
IService
<
ProductSalesLiterature
>{
boolean
remove
(
String
key
)
;
void
removeBatch
(
Collection
<
String
>
idList
)
;
ProductSalesLiterature
get
(
String
key
)
;
boolean
update
(
ProductSalesLiterature
et
)
;
void
updateBatch
(
List
<
ProductSalesLiterature
>
list
)
;
boolean
checkKey
(
ProductSalesLiterature
et
)
;
ProductSalesLiterature
getDraft
(
ProductSalesLiterature
et
)
;
boolean
save
(
ProductSalesLiterature
et
)
;
void
saveBatch
(
List
<
ProductSalesLiterature
>
list
)
;
boolean
create
(
ProductSalesLiterature
et
)
;
void
createBatch
(
List
<
ProductSalesLiterature
>
list
)
;
Page
<
ProductSalesLiterature
>
searchDefault
(
ProductSalesLiteratureSearchContext
context
)
;
List
<
ProductSalesLiterature
>
selectByEntityid
(
String
productid
)
;
void
removeByEntityid
(
String
productid
)
;
List
<
ProductSalesLiterature
>
selectByEntity2id
(
String
salesliteratureid
)
;
void
removeByEntity2id
(
String
salesliteratureid
)
;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List
<
JSONObject
>
select
(
String
sql
,
Map
param
);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean
execute
(
String
sql
,
Map
param
);
List
<
ProductSalesLiterature
>
getProductsalesliteratureByIds
(
List
<
String
>
ids
)
;
List
<
ProductSalesLiterature
>
getProductsalesliteratureByEntities
(
List
<
ProductSalesLiterature
>
entities
)
;
}
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/product/service/impl/ProductSalesLiteratureServiceImpl.java
0 → 100644
浏览文件 @
b3737bd6
package
cn
.
ibizlab
.
businesscentral
.
core
.
product
.
service
.
impl
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.Map
;
import
java.util.HashSet
;
import
java.util.HashMap
;
import
java.util.Collection
;
import
java.util.Objects
;
import
java.util.Optional
;
import
java.math.BigInteger
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cglib.beans.BeanCopier
;
import
org.springframework.stereotype.Service
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.context.annotation.Lazy
;
import
cn.ibizlab.businesscentral.core.product.domain.ProductSalesLiterature
;
import
cn.ibizlab.businesscentral.core.product.filter.ProductSalesLiteratureSearchContext
;
import
cn.ibizlab.businesscentral.core.product.service.IProductSalesLiteratureService
;
import
cn.ibizlab.businesscentral.util.helper.CachedBeanCopier
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
cn.ibizlab.businesscentral.core.product.mapper.ProductSalesLiteratureMapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.Wrapper
;
import
com.alibaba.fastjson.JSONObject
;
import
org.springframework.util.StringUtils
;
/**
* 实体[产品宣传资料] 服务对象接口实现
*/
@Slf4j
@Service
(
"ProductSalesLiteratureServiceImpl"
)
public
class
ProductSalesLiteratureServiceImpl
extends
ServiceImpl
<
ProductSalesLiteratureMapper
,
ProductSalesLiterature
>
implements
IProductSalesLiteratureService
{
@Autowired
@Lazy
protected
cn
.
ibizlab
.
businesscentral
.
core
.
product
.
service
.
IProductService
productService
;
@Autowired
@Lazy
protected
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
service
.
ISalesLiteratureService
salesliteratureService
;
protected
int
batchSize
=
500
;
@Override
@Transactional
public
boolean
remove
(
String
key
)
{
boolean
result
=
removeById
(
key
);
return
result
;
}
@Override
public
void
removeBatch
(
Collection
<
String
>
idList
)
{
removeByIds
(
idList
);
}
@Override
@Transactional
public
ProductSalesLiterature
get
(
String
key
)
{
ProductSalesLiterature
et
=
getById
(
key
);
if
(
et
==
null
){
et
=
new
ProductSalesLiterature
();
et
.
setRelationshipsid
(
key
);
}
else
{
}
return
et
;
}
@Override
@Transactional
public
boolean
update
(
ProductSalesLiterature
et
)
{
fillParentData
(
et
);
if
(!
update
(
et
,(
Wrapper
)
et
.
getUpdateWrapper
(
true
).
eq
(
"relationshipsid"
,
et
.
getRelationshipsid
())))
return
false
;
CachedBeanCopier
.
copy
(
get
(
et
.
getRelationshipsid
()),
et
);
return
true
;
}
@Override
public
void
updateBatch
(
List
<
ProductSalesLiterature
>
list
)
{
list
.
forEach
(
item
->
fillParentData
(
item
));
updateBatchById
(
list
,
batchSize
);
}
@Override
public
boolean
checkKey
(
ProductSalesLiterature
et
)
{
return
(!
ObjectUtils
.
isEmpty
(
et
.
getRelationshipsid
()))&&(!
Objects
.
isNull
(
this
.
getById
(
et
.
getRelationshipsid
())));
}
@Override
public
ProductSalesLiterature
getDraft
(
ProductSalesLiterature
et
)
{
fillParentData
(
et
);
return
et
;
}
@Override
@Transactional
public
boolean
save
(
ProductSalesLiterature
et
)
{
if
(!
saveOrUpdate
(
et
))
return
false
;
return
true
;
}
@Override
@Transactional
(
rollbackFor
=
{
Exception
.
class
}
)
public
boolean
saveOrUpdate
(
ProductSalesLiterature
et
)
{
if
(
null
==
et
)
{
return
false
;
}
else
{
return
checkKey
(
et
)
?
this
.
update
(
et
)
:
this
.
create
(
et
);
}
}
@Override
public
boolean
saveBatch
(
Collection
<
ProductSalesLiterature
>
list
)
{
list
.
forEach
(
item
->
fillParentData
(
item
));
saveOrUpdateBatch
(
list
,
batchSize
);
return
true
;
}
@Override
public
void
saveBatch
(
List
<
ProductSalesLiterature
>
list
)
{
list
.
forEach
(
item
->
fillParentData
(
item
));
saveOrUpdateBatch
(
list
,
batchSize
);
}
@Override
@Transactional
public
boolean
create
(
ProductSalesLiterature
et
)
{
fillParentData
(
et
);
if
(!
this
.
retBool
(
this
.
baseMapper
.
insert
(
et
)))
return
false
;
CachedBeanCopier
.
copy
(
get
(
et
.
getRelationshipsid
()),
et
);
return
true
;
}
@Override
public
void
createBatch
(
List
<
ProductSalesLiterature
>
list
)
{
list
.
forEach
(
item
->
fillParentData
(
item
));
this
.
saveBatch
(
list
,
batchSize
);
}
@Override
public
List
<
ProductSalesLiterature
>
selectByEntityid
(
String
productid
)
{
return
baseMapper
.
selectByEntityid
(
productid
);
}
@Override
public
void
removeByEntityid
(
String
productid
)
{
this
.
remove
(
new
QueryWrapper
<
ProductSalesLiterature
>().
eq
(
"entityid"
,
productid
));
}
@Override
public
List
<
ProductSalesLiterature
>
selectByEntity2id
(
String
salesliteratureid
)
{
return
baseMapper
.
selectByEntity2id
(
salesliteratureid
);
}
@Override
public
void
removeByEntity2id
(
String
salesliteratureid
)
{
this
.
remove
(
new
QueryWrapper
<
ProductSalesLiterature
>().
eq
(
"entity2id"
,
salesliteratureid
));
}
/**
* 查询集合 DEFAULT
*/
@Override
public
Page
<
ProductSalesLiterature
>
searchDefault
(
ProductSalesLiteratureSearchContext
context
)
{
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
<
ProductSalesLiterature
>
pages
=
baseMapper
.
searchDefault
(
context
.
getPages
(),
context
,
context
.
getSelectCond
());
return
new
PageImpl
<
ProductSalesLiterature
>(
pages
.
getRecords
(),
context
.
getPageable
(),
pages
.
getTotal
());
}
/**
* 为当前实体填充父数据(外键值文本、外键值附加数据)
* @param et
*/
private
void
fillParentData
(
ProductSalesLiterature
et
){
//实体关系[DER1N_PRODUCTSALESLITERATURE_PRODUCT_ENTITYID]
if
(!
ObjectUtils
.
isEmpty
(
et
.
getEntityid
())){
cn
.
ibizlab
.
businesscentral
.
core
.
product
.
domain
.
Product
product
=
et
.
getProduct
();
if
(
ObjectUtils
.
isEmpty
(
product
)){
cn
.
ibizlab
.
businesscentral
.
core
.
product
.
domain
.
Product
majorEntity
=
productService
.
get
(
et
.
getEntityid
());
et
.
setProduct
(
majorEntity
);
product
=
majorEntity
;
}
et
.
setEntityname
(
product
.
getProductname
());
}
//实体关系[DER1N_PRODUCTSALESLITERATURE_SALESLITERATURE_ENTITY2ID]
if
(!
ObjectUtils
.
isEmpty
(
et
.
getEntity2id
())){
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
domain
.
SalesLiterature
salesliterature
=
et
.
getSalesliterature
();
if
(
ObjectUtils
.
isEmpty
(
salesliterature
)){
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
domain
.
SalesLiterature
majorEntity
=
salesliteratureService
.
get
(
et
.
getEntity2id
());
et
.
setSalesliterature
(
majorEntity
);
salesliterature
=
majorEntity
;
}
et
.
setEntity2name
(
salesliterature
.
getSalesliteraturename
());
}
}
@Override
public
List
<
JSONObject
>
select
(
String
sql
,
Map
param
){
return
this
.
baseMapper
.
selectBySQL
(
sql
,
param
);
}
@Override
@Transactional
public
boolean
execute
(
String
sql
,
Map
param
){
if
(
sql
==
null
||
sql
.
isEmpty
())
{
return
false
;
}
if
(
sql
.
toLowerCase
().
trim
().
startsWith
(
"insert"
))
{
return
this
.
baseMapper
.
insertBySQL
(
sql
,
param
);
}
if
(
sql
.
toLowerCase
().
trim
().
startsWith
(
"update"
))
{
return
this
.
baseMapper
.
updateBySQL
(
sql
,
param
);
}
if
(
sql
.
toLowerCase
().
trim
().
startsWith
(
"delete"
))
{
return
this
.
baseMapper
.
deleteBySQL
(
sql
,
param
);
}
log
.
warn
(
"暂未支持的SQL语法"
);
return
true
;
}
@Override
public
List
<
ProductSalesLiterature
>
getProductsalesliteratureByIds
(
List
<
String
>
ids
)
{
return
this
.
listByIds
(
ids
);
}
@Override
public
List
<
ProductSalesLiterature
>
getProductsalesliteratureByEntities
(
List
<
ProductSalesLiterature
>
entities
)
{
List
ids
=
new
ArrayList
();
for
(
ProductSalesLiterature
entity
:
entities
){
Serializable
id
=
entity
.
getRelationshipsid
();
if
(!
ObjectUtils
.
isEmpty
(
id
)){
ids
.
add
(
id
);
}
}
if
(
ids
.
size
()>
0
)
return
this
.
listByIds
(
ids
);
else
return
entities
;
}
}
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/product/service/impl/ProductServiceImpl.java
浏览文件 @
b3737bd6
...
@@ -67,6 +67,9 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
...
@@ -67,6 +67,9 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
protected
cn
.
ibizlab
.
businesscentral
.
core
.
product
.
service
.
IProductPriceLevelService
productpricelevelService
;
protected
cn
.
ibizlab
.
businesscentral
.
core
.
product
.
service
.
IProductPriceLevelService
productpricelevelService
;
@Autowired
@Autowired
@Lazy
@Lazy
protected
cn
.
ibizlab
.
businesscentral
.
core
.
product
.
service
.
IProductSalesLiteratureService
productsalesliteratureService
;
@Autowired
@Lazy
protected
cn
.
ibizlab
.
businesscentral
.
core
.
product
.
service
.
IProductSubstituteService
productsubstituteService
;
protected
cn
.
ibizlab
.
businesscentral
.
core
.
product
.
service
.
IProductSubstituteService
productsubstituteService
;
protected
cn
.
ibizlab
.
businesscentral
.
core
.
product
.
service
.
IProductService
productService
=
this
;
protected
cn
.
ibizlab
.
businesscentral
.
core
.
product
.
service
.
IProductService
productService
=
this
;
...
...
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/sales/domain/CompetitorSalesLiterature.java
0 → 100644
浏览文件 @
b3737bd6
package
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
domain
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.math.BigInteger
;
import
java.util.HashMap
;
import
java.math.BigDecimal
;
import
java.text.SimpleDateFormat
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.DigestUtils
;
import
cn.ibizlab.businesscentral.util.domain.EntityBase
;
import
cn.ibizlab.businesscentral.util.annotation.DEField
;
import
cn.ibizlab.businesscentral.util.enums.DEPredefinedFieldType
;
import
cn.ibizlab.businesscentral.util.enums.DEFieldDefaultValueType
;
import
java.io.Serializable
;
import
lombok.*
;
import
org.springframework.data.annotation.Transient
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
com.baomidou.mybatisplus.annotation.*
;
import
cn.ibizlab.businesscentral.util.domain.EntityMP
;
/**
* 实体[竞争对手宣传资料]
*/
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties
(
value
=
"handler"
)
@TableName
(
value
=
"RELATIONSHIPS"
,
resultMap
=
"CompetitorSalesLiteratureResultMap"
)
public
class
CompetitorSalesLiterature
extends
EntityMP
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 建立时间
*/
@DEField
(
preType
=
DEPredefinedFieldType
.
CREATEDATE
)
@TableField
(
value
=
"createdate"
,
fill
=
FieldFill
.
INSERT
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
locale
=
"zh"
,
timezone
=
"GMT+8"
)
@JSONField
(
name
=
"createdate"
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonProperty
(
"createdate"
)
private
Timestamp
createdate
;
/**
* 建立人
*/
@DEField
(
preType
=
DEPredefinedFieldType
.
CREATEMAN
)
@TableField
(
value
=
"createman"
,
fill
=
FieldFill
.
INSERT
)
@JSONField
(
name
=
"createman"
)
@JsonProperty
(
"createman"
)
private
String
createman
;
/**
* 关系标识
*/
@DEField
(
isKeyField
=
true
)
@TableId
(
value
=
"relationshipsid"
,
type
=
IdType
.
ASSIGN_UUID
)
@JSONField
(
name
=
"relationshipsid"
)
@JsonProperty
(
"relationshipsid"
)
private
String
relationshipsid
;
/**
* 关系名称
*/
@TableField
(
value
=
"relationshipsname"
)
@JSONField
(
name
=
"relationshipsname"
)
@JsonProperty
(
"relationshipsname"
)
private
String
relationshipsname
;
/**
* 关系类型
*/
@DEField
(
defaultValue
=
"COMPETITORSALESLITERATURE"
)
@TableField
(
value
=
"relationshipstype"
)
@JSONField
(
name
=
"relationshipstype"
)
@JsonProperty
(
"relationshipstype"
)
private
String
relationshipstype
;
/**
* 更新时间
*/
@DEField
(
preType
=
DEPredefinedFieldType
.
UPDATEDATE
)
@TableField
(
value
=
"updatedate"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
locale
=
"zh"
,
timezone
=
"GMT+8"
)
@JSONField
(
name
=
"updatedate"
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonProperty
(
"updatedate"
)
private
Timestamp
updatedate
;
/**
* 更新人
*/
@DEField
(
preType
=
DEPredefinedFieldType
.
UPDATEMAN
)
@TableField
(
value
=
"updateman"
)
@JSONField
(
name
=
"updateman"
)
@JsonProperty
(
"updateman"
)
private
String
updateman
;
/**
* 竞争对手
*/
@TableField
(
value
=
"entityid"
)
@JSONField
(
name
=
"entityid"
)
@JsonProperty
(
"entityid"
)
private
String
entityid
;
/**
* 销售宣传资料
*/
@TableField
(
value
=
"entity2id"
)
@JSONField
(
name
=
"entity2id"
)
@JsonProperty
(
"entity2id"
)
private
String
entity2id
;
/**
* 竞争对手
*/
@TableField
(
value
=
"entityname"
)
@JSONField
(
name
=
"entityname"
)
@JsonProperty
(
"entityname"
)
private
String
entityname
;
/**
* 销售宣传资料
*/
@TableField
(
value
=
"entity2name"
)
@JSONField
(
name
=
"entity2name"
)
@JsonProperty
(
"entity2name"
)
private
String
entity2name
;
/**
*
*/
@JsonIgnore
@JSONField
(
serialize
=
false
)
@TableField
(
exist
=
false
)
private
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
domain
.
Competitor
competitor
;
/**
*
*/
@JsonIgnore
@JSONField
(
serialize
=
false
)
@TableField
(
exist
=
false
)
private
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
domain
.
SalesLiterature
salesliterature
;
/**
* 设置 [关系名称]
*/
public
void
setRelationshipsname
(
String
relationshipsname
){
this
.
relationshipsname
=
relationshipsname
;
this
.
modify
(
"relationshipsname"
,
relationshipsname
);
}
/**
* 设置 [关系类型]
*/
public
void
setRelationshipstype
(
String
relationshipstype
){
this
.
relationshipstype
=
relationshipstype
;
this
.
modify
(
"relationshipstype"
,
relationshipstype
);
}
/**
* 设置 [竞争对手]
*/
public
void
setEntityid
(
String
entityid
){
this
.
entityid
=
entityid
;
this
.
modify
(
"entityid"
,
entityid
);
}
/**
* 设置 [销售宣传资料]
*/
public
void
setEntity2id
(
String
entity2id
){
this
.
entity2id
=
entity2id
;
this
.
modify
(
"entity2id"
,
entity2id
);
}
/**
* 设置 [竞争对手]
*/
public
void
setEntityname
(
String
entityname
){
this
.
entityname
=
entityname
;
this
.
modify
(
"entityname"
,
entityname
);
}
/**
* 设置 [销售宣传资料]
*/
public
void
setEntity2name
(
String
entity2name
){
this
.
entity2name
=
entity2name
;
this
.
modify
(
"entity2name"
,
entity2name
);
}
}
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/sales/filter/CompetitorSalesLiteratureSearchContext.java
0 → 100644
浏览文件 @
b3737bd6
package
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
filter
;
import
java.math.BigDecimal
;
import
java.math.BigInteger
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.HashMap
;
import
lombok.*
;
import
lombok.extern.slf4j.Slf4j
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
cn.ibizlab.businesscentral.util.filter.QueryWrapperContext
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
cn.ibizlab.businesscentral.core.sales.domain.CompetitorSalesLiterature
;
/**
* 关系型数据实体[CompetitorSalesLiterature] 查询条件对象
*/
@Slf4j
@Data
public
class
CompetitorSalesLiteratureSearchContext
extends
QueryWrapperContext
<
CompetitorSalesLiterature
>
{
private
String
n_relationshipsname_like
;
//[关系名称]
public
void
setN_relationshipsname_like
(
String
n_relationshipsname_like
)
{
this
.
n_relationshipsname_like
=
n_relationshipsname_like
;
if
(!
ObjectUtils
.
isEmpty
(
this
.
n_relationshipsname_like
)){
this
.
getSearchCond
().
like
(
"relationshipsname"
,
n_relationshipsname_like
);
}
}
private
String
n_relationshipstype_eq
;
//[关系类型]
public
void
setN_relationshipstype_eq
(
String
n_relationshipstype_eq
)
{
this
.
n_relationshipstype_eq
=
n_relationshipstype_eq
;
if
(!
ObjectUtils
.
isEmpty
(
this
.
n_relationshipstype_eq
)){
this
.
getSearchCond
().
eq
(
"relationshipstype"
,
n_relationshipstype_eq
);
}
}
private
String
n_entityid_eq
;
//[竞争对手]
public
void
setN_entityid_eq
(
String
n_entityid_eq
)
{
this
.
n_entityid_eq
=
n_entityid_eq
;
if
(!
ObjectUtils
.
isEmpty
(
this
.
n_entityid_eq
)){
this
.
getSearchCond
().
eq
(
"entityid"
,
n_entityid_eq
);
}
}
private
String
n_entity2id_eq
;
//[销售宣传资料]
public
void
setN_entity2id_eq
(
String
n_entity2id_eq
)
{
this
.
n_entity2id_eq
=
n_entity2id_eq
;
if
(!
ObjectUtils
.
isEmpty
(
this
.
n_entity2id_eq
)){
this
.
getSearchCond
().
eq
(
"entity2id"
,
n_entity2id_eq
);
}
}
private
String
n_entityname_eq
;
//[竞争对手]
public
void
setN_entityname_eq
(
String
n_entityname_eq
)
{
this
.
n_entityname_eq
=
n_entityname_eq
;
if
(!
ObjectUtils
.
isEmpty
(
this
.
n_entityname_eq
)){
this
.
getSearchCond
().
eq
(
"entityname"
,
n_entityname_eq
);
}
}
private
String
n_entityname_like
;
//[竞争对手]
public
void
setN_entityname_like
(
String
n_entityname_like
)
{
this
.
n_entityname_like
=
n_entityname_like
;
if
(!
ObjectUtils
.
isEmpty
(
this
.
n_entityname_like
)){
this
.
getSearchCond
().
like
(
"entityname"
,
n_entityname_like
);
}
}
private
String
n_entity2name_eq
;
//[销售宣传资料]
public
void
setN_entity2name_eq
(
String
n_entity2name_eq
)
{
this
.
n_entity2name_eq
=
n_entity2name_eq
;
if
(!
ObjectUtils
.
isEmpty
(
this
.
n_entity2name_eq
)){
this
.
getSearchCond
().
eq
(
"entity2name"
,
n_entity2name_eq
);
}
}
private
String
n_entity2name_like
;
//[销售宣传资料]
public
void
setN_entity2name_like
(
String
n_entity2name_like
)
{
this
.
n_entity2name_like
=
n_entity2name_like
;
if
(!
ObjectUtils
.
isEmpty
(
this
.
n_entity2name_like
)){
this
.
getSearchCond
().
like
(
"entity2name"
,
n_entity2name_like
);
}
}
/**
* 启用快速搜索
*/
public
void
setQuery
(
String
query
)
{
this
.
query
=
query
;
if
(!
StringUtils
.
isEmpty
(
query
)){
this
.
getSearchCond
().
and
(
wrapper
->
wrapper
.
like
(
"relationshipsname"
,
query
)
);
}
}
}
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/sales/mapper/CompetitorSalesLiteratureMapper.java
0 → 100644
浏览文件 @
b3737bd6
package
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
mapper
;
import
java.util.List
;
import
org.apache.ibatis.annotations.*
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.conditions.Wrapper
;
import
java.util.HashMap
;
import
org.apache.ibatis.annotations.Select
;
import
cn.ibizlab.businesscentral.core.sales.domain.CompetitorSalesLiterature
;
import
cn.ibizlab.businesscentral.core.sales.filter.CompetitorSalesLiteratureSearchContext
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.cache.annotation.Cacheable
;
import
java.io.Serializable
;
import
com.baomidou.mybatisplus.core.toolkit.Constants
;
import
com.alibaba.fastjson.JSONObject
;
public
interface
CompetitorSalesLiteratureMapper
extends
BaseMapper
<
CompetitorSalesLiterature
>{
Page
<
CompetitorSalesLiterature
>
searchDefault
(
IPage
page
,
@Param
(
"srf"
)
CompetitorSalesLiteratureSearchContext
context
,
@Param
(
"ew"
)
Wrapper
<
CompetitorSalesLiterature
>
wrapper
)
;
@Override
CompetitorSalesLiterature
selectById
(
Serializable
id
);
@Override
int
insert
(
CompetitorSalesLiterature
entity
);
@Override
int
updateById
(
@Param
(
Constants
.
ENTITY
)
CompetitorSalesLiterature
entity
);
@Override
int
update
(
@Param
(
Constants
.
ENTITY
)
CompetitorSalesLiterature
entity
,
@Param
(
"ew"
)
Wrapper
<
CompetitorSalesLiterature
>
updateWrapper
);
@Override
int
deleteById
(
Serializable
id
);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select
(
"${sql}"
)
List
<
JSONObject
>
selectBySQL
(
@Param
(
"sql"
)
String
sql
,
@Param
(
"et"
)
Map
param
);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update
(
"${sql}"
)
boolean
updateBySQL
(
@Param
(
"sql"
)
String
sql
,
@Param
(
"et"
)
Map
param
);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert
(
"${sql}"
)
boolean
insertBySQL
(
@Param
(
"sql"
)
String
sql
,
@Param
(
"et"
)
Map
param
);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete
(
"${sql}"
)
boolean
deleteBySQL
(
@Param
(
"sql"
)
String
sql
,
@Param
(
"et"
)
Map
param
);
List
<
CompetitorSalesLiterature
>
selectByEntityid
(
@Param
(
"competitorid"
)
Serializable
competitorid
)
;
List
<
CompetitorSalesLiterature
>
selectByEntity2id
(
@Param
(
"salesliteratureid"
)
Serializable
salesliteratureid
)
;
}
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/sales/service/ICompetitorSalesLiteratureService.java
0 → 100644
浏览文件 @
b3737bd6
package
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
service
;
import
java.io.Serializable
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.HashMap
;
import
java.util.Collection
;
import
java.math.BigInteger
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
com.alibaba.fastjson.JSONObject
;
import
org.springframework.cache.annotation.CacheEvict
;
import
cn.ibizlab.businesscentral.core.sales.domain.CompetitorSalesLiterature
;
import
cn.ibizlab.businesscentral.core.sales.filter.CompetitorSalesLiteratureSearchContext
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
* 实体[CompetitorSalesLiterature] 服务对象接口
*/
public
interface
ICompetitorSalesLiteratureService
extends
IService
<
CompetitorSalesLiterature
>{
boolean
checkKey
(
CompetitorSalesLiterature
et
)
;
boolean
update
(
CompetitorSalesLiterature
et
)
;
void
updateBatch
(
List
<
CompetitorSalesLiterature
>
list
)
;
CompetitorSalesLiterature
get
(
String
key
)
;
boolean
remove
(
String
key
)
;
void
removeBatch
(
Collection
<
String
>
idList
)
;
boolean
create
(
CompetitorSalesLiterature
et
)
;
void
createBatch
(
List
<
CompetitorSalesLiterature
>
list
)
;
boolean
save
(
CompetitorSalesLiterature
et
)
;
void
saveBatch
(
List
<
CompetitorSalesLiterature
>
list
)
;
CompetitorSalesLiterature
getDraft
(
CompetitorSalesLiterature
et
)
;
Page
<
CompetitorSalesLiterature
>
searchDefault
(
CompetitorSalesLiteratureSearchContext
context
)
;
List
<
CompetitorSalesLiterature
>
selectByEntityid
(
String
competitorid
)
;
void
removeByEntityid
(
String
competitorid
)
;
List
<
CompetitorSalesLiterature
>
selectByEntity2id
(
String
salesliteratureid
)
;
void
removeByEntity2id
(
String
salesliteratureid
)
;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List
<
JSONObject
>
select
(
String
sql
,
Map
param
);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean
execute
(
String
sql
,
Map
param
);
List
<
CompetitorSalesLiterature
>
getCompetitorsalesliteratureByIds
(
List
<
String
>
ids
)
;
List
<
CompetitorSalesLiterature
>
getCompetitorsalesliteratureByEntities
(
List
<
CompetitorSalesLiterature
>
entities
)
;
}
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/sales/service/impl/CompetitorSalesLiteratureServiceImpl.java
0 → 100644
浏览文件 @
b3737bd6
package
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
service
.
impl
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.Map
;
import
java.util.HashSet
;
import
java.util.HashMap
;
import
java.util.Collection
;
import
java.util.Objects
;
import
java.util.Optional
;
import
java.math.BigInteger
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cglib.beans.BeanCopier
;
import
org.springframework.stereotype.Service
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.context.annotation.Lazy
;
import
cn.ibizlab.businesscentral.core.sales.domain.CompetitorSalesLiterature
;
import
cn.ibizlab.businesscentral.core.sales.filter.CompetitorSalesLiteratureSearchContext
;
import
cn.ibizlab.businesscentral.core.sales.service.ICompetitorSalesLiteratureService
;
import
cn.ibizlab.businesscentral.util.helper.CachedBeanCopier
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
cn.ibizlab.businesscentral.core.sales.mapper.CompetitorSalesLiteratureMapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.Wrapper
;
import
com.alibaba.fastjson.JSONObject
;
import
org.springframework.util.StringUtils
;
/**
* 实体[竞争对手宣传资料] 服务对象接口实现
*/
@Slf4j
@Service
(
"CompetitorSalesLiteratureServiceImpl"
)
public
class
CompetitorSalesLiteratureServiceImpl
extends
ServiceImpl
<
CompetitorSalesLiteratureMapper
,
CompetitorSalesLiterature
>
implements
ICompetitorSalesLiteratureService
{
@Autowired
@Lazy
protected
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
service
.
ICompetitorService
competitorService
;
@Autowired
@Lazy
protected
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
service
.
ISalesLiteratureService
salesliteratureService
;
protected
int
batchSize
=
500
;
@Override
public
boolean
checkKey
(
CompetitorSalesLiterature
et
)
{
return
(!
ObjectUtils
.
isEmpty
(
et
.
getRelationshipsid
()))&&(!
Objects
.
isNull
(
this
.
getById
(
et
.
getRelationshipsid
())));
}
@Override
@Transactional
public
boolean
update
(
CompetitorSalesLiterature
et
)
{
fillParentData
(
et
);
if
(!
update
(
et
,(
Wrapper
)
et
.
getUpdateWrapper
(
true
).
eq
(
"relationshipsid"
,
et
.
getRelationshipsid
())))
return
false
;
CachedBeanCopier
.
copy
(
get
(
et
.
getRelationshipsid
()),
et
);
return
true
;
}
@Override
public
void
updateBatch
(
List
<
CompetitorSalesLiterature
>
list
)
{
list
.
forEach
(
item
->
fillParentData
(
item
));
updateBatchById
(
list
,
batchSize
);
}
@Override
@Transactional
public
CompetitorSalesLiterature
get
(
String
key
)
{
CompetitorSalesLiterature
et
=
getById
(
key
);
if
(
et
==
null
){
et
=
new
CompetitorSalesLiterature
();
et
.
setRelationshipsid
(
key
);
}
else
{
}
return
et
;
}
@Override
@Transactional
public
boolean
remove
(
String
key
)
{
boolean
result
=
removeById
(
key
);
return
result
;
}
@Override
public
void
removeBatch
(
Collection
<
String
>
idList
)
{
removeByIds
(
idList
);
}
@Override
@Transactional
public
boolean
create
(
CompetitorSalesLiterature
et
)
{
fillParentData
(
et
);
if
(!
this
.
retBool
(
this
.
baseMapper
.
insert
(
et
)))
return
false
;
CachedBeanCopier
.
copy
(
get
(
et
.
getRelationshipsid
()),
et
);
return
true
;
}
@Override
public
void
createBatch
(
List
<
CompetitorSalesLiterature
>
list
)
{
list
.
forEach
(
item
->
fillParentData
(
item
));
this
.
saveBatch
(
list
,
batchSize
);
}
@Override
@Transactional
public
boolean
save
(
CompetitorSalesLiterature
et
)
{
if
(!
saveOrUpdate
(
et
))
return
false
;
return
true
;
}
@Override
@Transactional
(
rollbackFor
=
{
Exception
.
class
}
)
public
boolean
saveOrUpdate
(
CompetitorSalesLiterature
et
)
{
if
(
null
==
et
)
{
return
false
;
}
else
{
return
checkKey
(
et
)
?
this
.
update
(
et
)
:
this
.
create
(
et
);
}
}
@Override
public
boolean
saveBatch
(
Collection
<
CompetitorSalesLiterature
>
list
)
{
list
.
forEach
(
item
->
fillParentData
(
item
));
saveOrUpdateBatch
(
list
,
batchSize
);
return
true
;
}
@Override
public
void
saveBatch
(
List
<
CompetitorSalesLiterature
>
list
)
{
list
.
forEach
(
item
->
fillParentData
(
item
));
saveOrUpdateBatch
(
list
,
batchSize
);
}
@Override
public
CompetitorSalesLiterature
getDraft
(
CompetitorSalesLiterature
et
)
{
fillParentData
(
et
);
return
et
;
}
@Override
public
List
<
CompetitorSalesLiterature
>
selectByEntityid
(
String
competitorid
)
{
return
baseMapper
.
selectByEntityid
(
competitorid
);
}
@Override
public
void
removeByEntityid
(
String
competitorid
)
{
this
.
remove
(
new
QueryWrapper
<
CompetitorSalesLiterature
>().
eq
(
"entityid"
,
competitorid
));
}
@Override
public
List
<
CompetitorSalesLiterature
>
selectByEntity2id
(
String
salesliteratureid
)
{
return
baseMapper
.
selectByEntity2id
(
salesliteratureid
);
}
@Override
public
void
removeByEntity2id
(
String
salesliteratureid
)
{
this
.
remove
(
new
QueryWrapper
<
CompetitorSalesLiterature
>().
eq
(
"entity2id"
,
salesliteratureid
));
}
/**
* 查询集合 DEFAULT
*/
@Override
public
Page
<
CompetitorSalesLiterature
>
searchDefault
(
CompetitorSalesLiteratureSearchContext
context
)
{
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
<
CompetitorSalesLiterature
>
pages
=
baseMapper
.
searchDefault
(
context
.
getPages
(),
context
,
context
.
getSelectCond
());
return
new
PageImpl
<
CompetitorSalesLiterature
>(
pages
.
getRecords
(),
context
.
getPageable
(),
pages
.
getTotal
());
}
/**
* 为当前实体填充父数据(外键值文本、外键值附加数据)
* @param et
*/
private
void
fillParentData
(
CompetitorSalesLiterature
et
){
//实体关系[DER1N_COMPETITORSALESLITERATURE_COMPETITOR_ENTITYID]
if
(!
ObjectUtils
.
isEmpty
(
et
.
getEntityid
())){
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
domain
.
Competitor
competitor
=
et
.
getCompetitor
();
if
(
ObjectUtils
.
isEmpty
(
competitor
)){
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
domain
.
Competitor
majorEntity
=
competitorService
.
get
(
et
.
getEntityid
());
et
.
setCompetitor
(
majorEntity
);
competitor
=
majorEntity
;
}
et
.
setEntityname
(
competitor
.
getCompetitorname
());
}
//实体关系[DER1N_COMPETITORSALESLITERATURE_SALESLITERATURE_ENTITY2ID]
if
(!
ObjectUtils
.
isEmpty
(
et
.
getEntity2id
())){
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
domain
.
SalesLiterature
salesliterature
=
et
.
getSalesliterature
();
if
(
ObjectUtils
.
isEmpty
(
salesliterature
)){
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
domain
.
SalesLiterature
majorEntity
=
salesliteratureService
.
get
(
et
.
getEntity2id
());
et
.
setSalesliterature
(
majorEntity
);
salesliterature
=
majorEntity
;
}
et
.
setEntity2name
(
salesliterature
.
getSalesliteraturename
());
}
}
@Override
public
List
<
JSONObject
>
select
(
String
sql
,
Map
param
){
return
this
.
baseMapper
.
selectBySQL
(
sql
,
param
);
}
@Override
@Transactional
public
boolean
execute
(
String
sql
,
Map
param
){
if
(
sql
==
null
||
sql
.
isEmpty
())
{
return
false
;
}
if
(
sql
.
toLowerCase
().
trim
().
startsWith
(
"insert"
))
{
return
this
.
baseMapper
.
insertBySQL
(
sql
,
param
);
}
if
(
sql
.
toLowerCase
().
trim
().
startsWith
(
"update"
))
{
return
this
.
baseMapper
.
updateBySQL
(
sql
,
param
);
}
if
(
sql
.
toLowerCase
().
trim
().
startsWith
(
"delete"
))
{
return
this
.
baseMapper
.
deleteBySQL
(
sql
,
param
);
}
log
.
warn
(
"暂未支持的SQL语法"
);
return
true
;
}
@Override
public
List
<
CompetitorSalesLiterature
>
getCompetitorsalesliteratureByIds
(
List
<
String
>
ids
)
{
return
this
.
listByIds
(
ids
);
}
@Override
public
List
<
CompetitorSalesLiterature
>
getCompetitorsalesliteratureByEntities
(
List
<
CompetitorSalesLiterature
>
entities
)
{
List
ids
=
new
ArrayList
();
for
(
CompetitorSalesLiterature
entity
:
entities
){
Serializable
id
=
entity
.
getRelationshipsid
();
if
(!
ObjectUtils
.
isEmpty
(
id
)){
ids
.
add
(
id
);
}
}
if
(
ids
.
size
()>
0
)
return
this
.
listByIds
(
ids
);
else
return
entities
;
}
}
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/sales/service/impl/CompetitorServiceImpl.java
浏览文件 @
b3737bd6
...
@@ -44,6 +44,9 @@ import org.springframework.util.StringUtils;
...
@@ -44,6 +44,9 @@ import org.springframework.util.StringUtils;
@Service
(
"CompetitorServiceImpl"
)
@Service
(
"CompetitorServiceImpl"
)
public
class
CompetitorServiceImpl
extends
ServiceImpl
<
CompetitorMapper
,
Competitor
>
implements
ICompetitorService
{
public
class
CompetitorServiceImpl
extends
ServiceImpl
<
CompetitorMapper
,
Competitor
>
implements
ICompetitorService
{
@Autowired
@Lazy
protected
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
service
.
ICompetitorSalesLiteratureService
competitorsalesliteratureService
;
@Autowired
@Autowired
@Lazy
@Lazy
protected
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
service
.
ILeadCompetitorService
leadcompetitorService
;
protected
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
service
.
ILeadCompetitorService
leadcompetitorService
;
...
...
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/sales/service/impl/SalesLiteratureServiceImpl.java
浏览文件 @
b3737bd6
...
@@ -44,6 +44,12 @@ import org.springframework.util.StringUtils;
...
@@ -44,6 +44,12 @@ import org.springframework.util.StringUtils;
@Service
(
"SalesLiteratureServiceImpl"
)
@Service
(
"SalesLiteratureServiceImpl"
)
public
class
SalesLiteratureServiceImpl
extends
ServiceImpl
<
SalesLiteratureMapper
,
SalesLiterature
>
implements
ISalesLiteratureService
{
public
class
SalesLiteratureServiceImpl
extends
ServiceImpl
<
SalesLiteratureMapper
,
SalesLiterature
>
implements
ISalesLiteratureService
{
@Autowired
@Lazy
protected
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
service
.
ICompetitorSalesLiteratureService
competitorsalesliteratureService
;
@Autowired
@Lazy
protected
cn
.
ibizlab
.
businesscentral
.
core
.
product
.
service
.
IProductSalesLiteratureService
productsalesliteratureService
;
@Autowired
@Autowired
@Lazy
@Lazy
protected
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
service
.
ISalesLiteratureItemService
salesliteratureitemService
;
protected
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
service
.
ISalesLiteratureItemService
salesliteratureitemService
;
...
...
businesscentral-core/src/main/resources/liquibase/h2_table.xml
浏览文件 @
b3737bd6
因为 它太大了无法显示 源差异 。您可以改为
查看blob
。
businesscentral-core/src/main/resources/mapper/product/productsalesliterature/ProductSalesLiteratureMapper.xml
0 → 100644
浏览文件 @
b3737bd6
<?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=
"cn.ibizlab.businesscentral.core.product.mapper.ProductSalesLiteratureMapper"
>
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select
id=
"selectById"
resultMap=
"ProductSalesLiteratureResultMap"
databaseId=
"mysql"
>
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`ENTITY2ID`, t1.`ENTITY2NAME`, t1.`ENTITYID`, t1.`ENTITYNAME`, t1.`RELATIONSHIPSID`, t1.`RELATIONSHIPSNAME`, t1.`RELATIONSHIPSTYPE`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `RELATIONSHIPS` t1 ) t1 where relationshipsid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap
id=
"ProductSalesLiteratureResultMap"
type=
"cn.ibizlab.businesscentral.core.product.domain.ProductSalesLiterature"
autoMapping=
"true"
>
<id
property=
"relationshipsid"
column=
"relationshipsid"
/>
<!--主键字段映射-->
<result
property=
"entityid"
column=
"entityid"
/>
<result
property=
"entity2id"
column=
"entity2id"
/>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association
property=
"product"
javaType=
"cn.ibizlab.businesscentral.core.product.domain.Product"
column=
"entityid"
select=
"cn.ibizlab.businesscentral.core.product.mapper.ProductMapper.selectById"
fetchType=
"lazy"
></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association
property=
"salesliterature"
javaType=
"cn.ibizlab.businesscentral.core.sales.domain.SalesLiterature"
column=
"entity2id"
select=
"cn.ibizlab.businesscentral.core.sales.mapper.SalesLiteratureMapper.selectById"
fetchType=
"lazy"
></association>
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCTSALESLITERATURE_PRODUCT_ENTITYID] -->
<select
id=
"selectByEntityid"
resultMap=
"ProductSalesLiteratureResultMap"
>
select t1.* from (
<include
refid=
"Default"
/>
) t1
where entityid=#{productid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PRODUCTSALESLITERATURE_SALESLITERATURE_ENTITY2ID] -->
<select
id=
"selectByEntity2id"
resultMap=
"ProductSalesLiteratureResultMap"
>
select t1.* from (
<include
refid=
"Default"
/>
) t1
where entity2id=#{salesliteratureid}
</select>
<!--数据集合[Default]-->
<select
id=
"searchDefault"
parameterType=
"cn.ibizlab.businesscentral.core.product.filter.ProductSalesLiteratureSearchContext"
resultMap=
"ProductSalesLiteratureResultMap"
>
select t1.* from (
<include
refid=
"Default"
/>
)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]-->
<sql
id=
"Default"
databaseId=
"mysql"
>
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`ENTITY2ID`, t1.`ENTITY2NAME`, t1.`ENTITYID`, t1.`ENTITYNAME`, t1.`RELATIONSHIPSID`, t1.`RELATIONSHIPSNAME`, t1.`RELATIONSHIPSTYPE`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `RELATIONSHIPS` t1
WHERE ( t1.`RELATIONSHIPSTYPE` = 'PRODUCTSALESLITERATURE' )
]]>
</sql>
<!--数据查询[View]-->
<sql
id=
"View"
databaseId=
"mysql"
>
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`ENTITY2ID`, t1.`ENTITY2NAME`, t1.`ENTITYID`, t1.`ENTITYNAME`, t1.`RELATIONSHIPSID`, t1.`RELATIONSHIPSNAME`, t1.`RELATIONSHIPSTYPE`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `RELATIONSHIPS` t1
WHERE ( t1.`RELATIONSHIPSTYPE` = '' )
]]>
</sql>
</mapper>
businesscentral-core/src/main/resources/mapper/sales/competitorsalesliterature/CompetitorSalesLiteratureMapper.xml
0 → 100644
浏览文件 @
b3737bd6
<?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=
"cn.ibizlab.businesscentral.core.sales.mapper.CompetitorSalesLiteratureMapper"
>
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select
id=
"selectById"
resultMap=
"CompetitorSalesLiteratureResultMap"
databaseId=
"mysql"
>
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`ENTITY2ID`, t1.`ENTITY2NAME`, t1.`ENTITYID`, t1.`ENTITYNAME`, t1.`RELATIONSHIPSID`, t1.`RELATIONSHIPSNAME`, t1.`RELATIONSHIPSTYPE`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `RELATIONSHIPS` t1 ) t1 where relationshipsid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap
id=
"CompetitorSalesLiteratureResultMap"
type=
"cn.ibizlab.businesscentral.core.sales.domain.CompetitorSalesLiterature"
autoMapping=
"true"
>
<id
property=
"relationshipsid"
column=
"relationshipsid"
/>
<!--主键字段映射-->
<result
property=
"entityid"
column=
"entityid"
/>
<result
property=
"entity2id"
column=
"entity2id"
/>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association
property=
"competitor"
javaType=
"cn.ibizlab.businesscentral.core.sales.domain.Competitor"
column=
"entityid"
select=
"cn.ibizlab.businesscentral.core.sales.mapper.CompetitorMapper.selectById"
fetchType=
"lazy"
></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association
property=
"salesliterature"
javaType=
"cn.ibizlab.businesscentral.core.sales.domain.SalesLiterature"
column=
"entity2id"
select=
"cn.ibizlab.businesscentral.core.sales.mapper.SalesLiteratureMapper.selectById"
fetchType=
"lazy"
></association>
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_COMPETITORSALESLITERATURE_COMPETITOR_ENTITYID] -->
<select
id=
"selectByEntityid"
resultMap=
"CompetitorSalesLiteratureResultMap"
>
select t1.* from (
<include
refid=
"Default"
/>
) t1
where entityid=#{competitorid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_COMPETITORSALESLITERATURE_SALESLITERATURE_ENTITY2ID] -->
<select
id=
"selectByEntity2id"
resultMap=
"CompetitorSalesLiteratureResultMap"
>
select t1.* from (
<include
refid=
"Default"
/>
) t1
where entity2id=#{salesliteratureid}
</select>
<!--数据集合[Default]-->
<select
id=
"searchDefault"
parameterType=
"cn.ibizlab.businesscentral.core.sales.filter.CompetitorSalesLiteratureSearchContext"
resultMap=
"CompetitorSalesLiteratureResultMap"
>
select t1.* from (
<include
refid=
"Default"
/>
)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]-->
<sql
id=
"Default"
databaseId=
"mysql"
>
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`ENTITY2ID`, t1.`ENTITY2NAME`, t1.`ENTITYID`, t1.`ENTITYNAME`, t1.`RELATIONSHIPSID`, t1.`RELATIONSHIPSNAME`, t1.`RELATIONSHIPSTYPE`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `RELATIONSHIPS` t1
WHERE ( t1.`RELATIONSHIPSTYPE` = '' )
]]>
</sql>
<!--数据查询[View]-->
<sql
id=
"View"
databaseId=
"mysql"
>
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`ENTITY2ID`, t1.`ENTITY2NAME`, t1.`ENTITYID`, t1.`ENTITYNAME`, t1.`RELATIONSHIPSID`, t1.`RELATIONSHIPSNAME`, t1.`RELATIONSHIPSTYPE`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `RELATIONSHIPS` t1
WHERE ( t1.`RELATIONSHIPSTYPE` = '' )
]]>
</sql>
</mapper>
businesscentral-core/src/main/resources/permission/systemResource.json
浏览文件 @
b3737bd6
...
@@ -260,6 +260,14 @@
...
@@ -260,6 +260,14 @@
"datascope"
:[{
"id"
:
"all"
,
"name"
:
"全部数据"
},
{
"id"
:
"createman"
,
"name"
:
"创建人"
}]
"datascope"
:[{
"id"
:
"all"
,
"name"
:
"全部数据"
},
{
"id"
:
"createman"
,
"name"
:
"创建人"
}]
}
}
,
{
,
{
"dename"
:
"SalesLiteratureItem"
,
"delogicname"
:
"销售附件"
,
"sysmoudle"
:{
"id"
:
"SALES"
,
"name"
:
"Sales"
},
"dedataset"
:[{
"id"
:
"Default"
,
"name"
:
"DEFAULT"
}],
"deaction"
:[{
"id"
:
"Save"
,
"name"
:
"Save"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Get"
,
"name"
:
"Get"
,
"type"
:
"BUILTIN"
},{
"id"
:
"GetDraft"
,
"name"
:
"GetDraft"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Remove"
,
"name"
:
"Remove"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Update"
,
"name"
:
"Update"
,
"type"
:
"BUILTIN"
},{
"id"
:
"CheckKey"
,
"name"
:
"CheckKey"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Create"
,
"name"
:
"Create"
,
"type"
:
"BUILTIN"
}],
"datascope"
:[{
"id"
:
"all"
,
"name"
:
"全部数据"
},
{
"id"
:
"createman"
,
"name"
:
"创建人"
}]
}
,
{
"dename"
:
"Contact"
,
"dename"
:
"Contact"
,
"delogicname"
:
"联系人"
,
"delogicname"
:
"联系人"
,
"sysmoudle"
:{
"id"
:
"BASE"
,
"name"
:
"Base"
},
"sysmoudle"
:{
"id"
:
"BASE"
,
"name"
:
"Base"
},
...
@@ -308,6 +316,14 @@
...
@@ -308,6 +316,14 @@
"datascope"
:[{
"id"
:
"all"
,
"name"
:
"全部数据"
},
{
"id"
:
"createman"
,
"name"
:
"创建人"
}]
"datascope"
:[{
"id"
:
"all"
,
"name"
:
"全部数据"
},
{
"id"
:
"createman"
,
"name"
:
"创建人"
}]
}
}
,
{
,
{
"dename"
:
"ProductSalesLiterature"
,
"delogicname"
:
"产品宣传资料"
,
"sysmoudle"
:{
"id"
:
"PRODUCT"
,
"name"
:
"Product"
},
"dedataset"
:[{
"id"
:
"Default"
,
"name"
:
"DEFAULT"
}],
"deaction"
:[{
"id"
:
"Remove"
,
"name"
:
"Remove"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Get"
,
"name"
:
"Get"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Update"
,
"name"
:
"Update"
,
"type"
:
"BUILTIN"
},{
"id"
:
"CheckKey"
,
"name"
:
"CheckKey"
,
"type"
:
"BUILTIN"
},{
"id"
:
"GetDraft"
,
"name"
:
"GetDraft"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Save"
,
"name"
:
"Save"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Create"
,
"name"
:
"Create"
,
"type"
:
"BUILTIN"
}],
"datascope"
:[{
"id"
:
"all"
,
"name"
:
"全部数据"
},
{
"id"
:
"createman"
,
"name"
:
"创建人"
}]
}
,
{
"dename"
:
"Subject"
,
"dename"
:
"Subject"
,
"delogicname"
:
"主题"
,
"delogicname"
:
"主题"
,
"sysmoudle"
:{
"id"
:
"BASE"
,
"name"
:
"Base"
},
"sysmoudle"
:{
"id"
:
"BASE"
,
"name"
:
"Base"
},
...
...
businesscentral-provider/businesscentral-provider-centralapi/src/main/java/cn/ibizlab/businesscentral/centralapi/dto/ProductSalesLiteratureDTO.java
0 → 100644
浏览文件 @
b3737bd6
package
cn
.
ibizlab
.
businesscentral
.
centralapi
.
dto
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.math.BigInteger
;
import
java.util.Map
;
import
java.util.HashMap
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
cn.ibizlab.businesscentral.util.domain.DTOBase
;
import
lombok.Data
;
/**
* 服务DTO对象[ProductSalesLiteratureDTO]
*/
@Data
public
class
ProductSalesLiteratureDTO
extends
DTOBase
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 属性 [CREATEDATE]
*
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
locale
=
"zh"
,
timezone
=
"GMT+8"
)
@JSONField
(
name
=
"createdate"
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonProperty
(
"createdate"
)
private
Timestamp
createdate
;
/**
* 属性 [CREATEMAN]
*
*/
@JSONField
(
name
=
"createman"
)
@JsonProperty
(
"createman"
)
private
String
createman
;
/**
* 属性 [RELATIONSHIPSID]
*
*/
@JSONField
(
name
=
"relationshipsid"
)
@JsonProperty
(
"relationshipsid"
)
private
String
relationshipsid
;
/**
* 属性 [RELATIONSHIPSNAME]
*
*/
@JSONField
(
name
=
"relationshipsname"
)
@JsonProperty
(
"relationshipsname"
)
private
String
relationshipsname
;
/**
* 属性 [RELATIONSHIPSTYPE]
*
*/
@JSONField
(
name
=
"relationshipstype"
)
@JsonProperty
(
"relationshipstype"
)
private
String
relationshipstype
;
/**
* 属性 [UPDATEDATE]
*
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
locale
=
"zh"
,
timezone
=
"GMT+8"
)
@JSONField
(
name
=
"updatedate"
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonProperty
(
"updatedate"
)
private
Timestamp
updatedate
;
/**
* 属性 [UPDATEMAN]
*
*/
@JSONField
(
name
=
"updateman"
)
@JsonProperty
(
"updateman"
)
private
String
updateman
;
/**
* 属性 [ENTITYID]
*
*/
@JSONField
(
name
=
"entityid"
)
@JsonProperty
(
"entityid"
)
private
String
entityid
;
/**
* 属性 [ENTITY2ID]
*
*/
@JSONField
(
name
=
"entity2id"
)
@JsonProperty
(
"entity2id"
)
private
String
entity2id
;
/**
* 属性 [ENTITYNAME]
*
*/
@JSONField
(
name
=
"entityname"
)
@JsonProperty
(
"entityname"
)
private
String
entityname
;
/**
* 属性 [ENTITY2NAME]
*
*/
@JSONField
(
name
=
"entity2name"
)
@JsonProperty
(
"entity2name"
)
private
String
entity2name
;
/**
* 设置 [RELATIONSHIPSNAME]
*/
public
void
setRelationshipsname
(
String
relationshipsname
){
this
.
relationshipsname
=
relationshipsname
;
this
.
modify
(
"relationshipsname"
,
relationshipsname
);
}
/**
* 设置 [RELATIONSHIPSTYPE]
*/
public
void
setRelationshipstype
(
String
relationshipstype
){
this
.
relationshipstype
=
relationshipstype
;
this
.
modify
(
"relationshipstype"
,
relationshipstype
);
}
/**
* 设置 [ENTITYID]
*/
public
void
setEntityid
(
String
entityid
){
this
.
entityid
=
entityid
;
this
.
modify
(
"entityid"
,
entityid
);
}
/**
* 设置 [ENTITY2ID]
*/
public
void
setEntity2id
(
String
entity2id
){
this
.
entity2id
=
entity2id
;
this
.
modify
(
"entity2id"
,
entity2id
);
}
/**
* 设置 [ENTITYNAME]
*/
public
void
setEntityname
(
String
entityname
){
this
.
entityname
=
entityname
;
this
.
modify
(
"entityname"
,
entityname
);
}
/**
* 设置 [ENTITY2NAME]
*/
public
void
setEntity2name
(
String
entity2name
){
this
.
entity2name
=
entity2name
;
this
.
modify
(
"entity2name"
,
entity2name
);
}
}
businesscentral-provider/businesscentral-provider-centralapi/src/main/java/cn/ibizlab/businesscentral/centralapi/dto/SalesLiteratureItemDTO.java
0 → 100644
浏览文件 @
b3737bd6
package
cn
.
ibizlab
.
businesscentral
.
centralapi
.
dto
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.math.BigInteger
;
import
java.util.Map
;
import
java.util.HashMap
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
cn.ibizlab.businesscentral.util.domain.DTOBase
;
import
lombok.Data
;
/**
* 服务DTO对象[SalesLiteratureItemDTO]
*/
@Data
public
class
SalesLiteratureItemDTO
extends
DTOBase
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 属性 [AUTHORNAME]
*
*/
@JSONField
(
name
=
"authorname"
)
@JsonProperty
(
"authorname"
)
private
String
authorname
;
/**
* 属性 [TIMEZONERULEVERSIONNUMBER]
*
*/
@JSONField
(
name
=
"timezoneruleversionnumber"
)
@JsonProperty
(
"timezoneruleversionnumber"
)
private
Integer
timezoneruleversionnumber
;
/**
* 属性 [TITLE]
*
*/
@JSONField
(
name
=
"title"
)
@JsonProperty
(
"title"
)
private
String
title
;
/**
* 属性 [FILESIZE]
*
*/
@JSONField
(
name
=
"filesize"
)
@JsonProperty
(
"filesize"
)
private
Integer
filesize
;
/**
* 属性 [MODE]
*
*/
@JSONField
(
name
=
"mode"
)
@JsonProperty
(
"mode"
)
private
String
mode
;
/**
* 属性 [FILETYPECODE]
*
*/
@JSONField
(
name
=
"filetypecode"
)
@JsonProperty
(
"filetypecode"
)
private
String
filetypecode
;
/**
* 属性 [IMPORTSEQUENCENUMBER]
*
*/
@JSONField
(
name
=
"importsequencenumber"
)
@JsonProperty
(
"importsequencenumber"
)
private
Integer
importsequencenumber
;
/**
* 属性 [SALESLITERATUREITEMID]
*
*/
@JSONField
(
name
=
"salesliteratureitemid"
)
@JsonProperty
(
"salesliteratureitemid"
)
private
String
salesliteratureitemid
;
/**
* 属性 [UPDATEDATE]
*
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
locale
=
"zh"
,
timezone
=
"GMT+8"
)
@JSONField
(
name
=
"updatedate"
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonProperty
(
"updatedate"
)
private
Timestamp
updatedate
;
/**
* 属性 [UPDATEMAN]
*
*/
@JSONField
(
name
=
"updateman"
)
@JsonProperty
(
"updateman"
)
private
String
updateman
;
/**
* 属性 [MIMETYPE]
*
*/
@JSONField
(
name
=
"mimetype"
)
@JsonProperty
(
"mimetype"
)
private
String
mimetype
;
/**
* 属性 [CREATEMAN]
*
*/
@JSONField
(
name
=
"createman"
)
@JsonProperty
(
"createman"
)
private
String
createman
;
/**
* 属性 [KEYWORDS]
*
*/
@JSONField
(
name
=
"keywords"
)
@JsonProperty
(
"keywords"
)
private
String
keywords
;
/**
* 属性 [FILETYPE]
*
*/
@JSONField
(
name
=
"filetype"
)
@JsonProperty
(
"filetype"
)
private
Integer
filetype
;
/**
* 属性 [ATTACHEDDOCUMENTURL]
*
*/
@JSONField
(
name
=
"attacheddocumenturl"
)
@JsonProperty
(
"attacheddocumenturl"
)
private
String
attacheddocumenturl
;
/**
* 属性 [DOCUMENTBODY]
*
*/
@JSONField
(
name
=
"documentbody"
)
@JsonProperty
(
"documentbody"
)
private
String
documentbody
;
/**
* 属性 [VERSIONNUMBER]
*
*/
@JSONField
(
name
=
"versionnumber"
)
@JsonProperty
(
"versionnumber"
)
private
BigInteger
versionnumber
;
/**
* 属性 [ABSTRACT]
*
*/
@JSONField
(
name
=
"ibizabstract"
)
@JsonProperty
(
"ibizabstract"
)
private
String
ibizabstract
;
/**
* 属性 [OVERRIDDENCREATEDON]
*
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
locale
=
"zh"
,
timezone
=
"GMT+8"
)
@JSONField
(
name
=
"overriddencreatedon"
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonProperty
(
"overriddencreatedon"
)
private
Timestamp
overriddencreatedon
;
/**
* 属性 [CUSTOMERVIEWABLE]
*
*/
@JSONField
(
name
=
"customerviewable"
)
@JsonProperty
(
"customerviewable"
)
private
Integer
customerviewable
;
/**
* 属性 [FILENAME]
*
*/
@JSONField
(
name
=
"filename"
)
@JsonProperty
(
"filename"
)
private
String
filename
;
/**
* 属性 [ORGANIZATIONID]
*
*/
@JSONField
(
name
=
"organizationid"
)
@JsonProperty
(
"organizationid"
)
private
String
organizationid
;
/**
* 属性 [CREATEDATE]
*
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
locale
=
"zh"
,
timezone
=
"GMT+8"
)
@JSONField
(
name
=
"createdate"
,
format
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonProperty
(
"createdate"
)
private
Timestamp
createdate
;
/**
* 属性 [UTCCONVERSIONTIMEZONECODE]
*
*/
@JSONField
(
name
=
"utcconversiontimezonecode"
)
@JsonProperty
(
"utcconversiontimezonecode"
)
private
Integer
utcconversiontimezonecode
;
/**
* 属性 [SALESLITERATUREID]
*
*/
@JSONField
(
name
=
"salesliteratureid"
)
@JsonProperty
(
"salesliteratureid"
)
private
String
salesliteratureid
;
/**
* 设置 [AUTHORNAME]
*/
public
void
setAuthorname
(
String
authorname
){
this
.
authorname
=
authorname
;
this
.
modify
(
"authorname"
,
authorname
);
}
/**
* 设置 [TIMEZONERULEVERSIONNUMBER]
*/
public
void
setTimezoneruleversionnumber
(
Integer
timezoneruleversionnumber
){
this
.
timezoneruleversionnumber
=
timezoneruleversionnumber
;
this
.
modify
(
"timezoneruleversionnumber"
,
timezoneruleversionnumber
);
}
/**
* 设置 [TITLE]
*/
public
void
setTitle
(
String
title
){
this
.
title
=
title
;
this
.
modify
(
"title"
,
title
);
}
/**
* 设置 [FILESIZE]
*/
public
void
setFilesize
(
Integer
filesize
){
this
.
filesize
=
filesize
;
this
.
modify
(
"filesize"
,
filesize
);
}
/**
* 设置 [MODE]
*/
public
void
setMode
(
String
mode
){
this
.
mode
=
mode
;
this
.
modify
(
"mode"
,
mode
);
}
/**
* 设置 [FILETYPECODE]
*/
public
void
setFiletypecode
(
String
filetypecode
){
this
.
filetypecode
=
filetypecode
;
this
.
modify
(
"filetypecode"
,
filetypecode
);
}
/**
* 设置 [IMPORTSEQUENCENUMBER]
*/
public
void
setImportsequencenumber
(
Integer
importsequencenumber
){
this
.
importsequencenumber
=
importsequencenumber
;
this
.
modify
(
"importsequencenumber"
,
importsequencenumber
);
}
/**
* 设置 [MIMETYPE]
*/
public
void
setMimetype
(
String
mimetype
){
this
.
mimetype
=
mimetype
;
this
.
modify
(
"mimetype"
,
mimetype
);
}
/**
* 设置 [KEYWORDS]
*/
public
void
setKeywords
(
String
keywords
){
this
.
keywords
=
keywords
;
this
.
modify
(
"keywords"
,
keywords
);
}
/**
* 设置 [FILETYPE]
*/
public
void
setFiletype
(
Integer
filetype
){
this
.
filetype
=
filetype
;
this
.
modify
(
"filetype"
,
filetype
);
}
/**
* 设置 [ATTACHEDDOCUMENTURL]
*/
public
void
setAttacheddocumenturl
(
String
attacheddocumenturl
){
this
.
attacheddocumenturl
=
attacheddocumenturl
;
this
.
modify
(
"attacheddocumenturl"
,
attacheddocumenturl
);
}
/**
* 设置 [DOCUMENTBODY]
*/
public
void
setDocumentbody
(
String
documentbody
){
this
.
documentbody
=
documentbody
;
this
.
modify
(
"documentbody"
,
documentbody
);
}
/**
* 设置 [VERSIONNUMBER]
*/
public
void
setVersionnumber
(
BigInteger
versionnumber
){
this
.
versionnumber
=
versionnumber
;
this
.
modify
(
"versionnumber"
,
versionnumber
);
}
/**
* 设置 [ABSTRACT]
*/
public
void
setIbizabstract
(
String
ibizabstract
){
this
.
ibizabstract
=
ibizabstract
;
this
.
modify
(
"abstract"
,
ibizabstract
);
}
/**
* 设置 [OVERRIDDENCREATEDON]
*/
public
void
setOverriddencreatedon
(
Timestamp
overriddencreatedon
){
this
.
overriddencreatedon
=
overriddencreatedon
;
this
.
modify
(
"overriddencreatedon"
,
overriddencreatedon
);
}
/**
* 设置 [CUSTOMERVIEWABLE]
*/
public
void
setCustomerviewable
(
Integer
customerviewable
){
this
.
customerviewable
=
customerviewable
;
this
.
modify
(
"customerviewable"
,
customerviewable
);
}
/**
* 设置 [FILENAME]
*/
public
void
setFilename
(
String
filename
){
this
.
filename
=
filename
;
this
.
modify
(
"filename"
,
filename
);
}
/**
* 设置 [ORGANIZATIONID]
*/
public
void
setOrganizationid
(
String
organizationid
){
this
.
organizationid
=
organizationid
;
this
.
modify
(
"organizationid"
,
organizationid
);
}
/**
* 设置 [UTCCONVERSIONTIMEZONECODE]
*/
public
void
setUtcconversiontimezonecode
(
Integer
utcconversiontimezonecode
){
this
.
utcconversiontimezonecode
=
utcconversiontimezonecode
;
this
.
modify
(
"utcconversiontimezonecode"
,
utcconversiontimezonecode
);
}
/**
* 设置 [SALESLITERATUREID]
*/
public
void
setSalesliteratureid
(
String
salesliteratureid
){
this
.
salesliteratureid
=
salesliteratureid
;
this
.
modify
(
"salesliteratureid"
,
salesliteratureid
);
}
}
businesscentral-provider/businesscentral-provider-centralapi/src/main/java/cn/ibizlab/businesscentral/centralapi/mapping/ProductSalesLiteratureMapping.java
0 → 100644
浏览文件 @
b3737bd6
package
cn
.
ibizlab
.
businesscentral
.
centralapi
.
mapping
;
import
org.mapstruct.*
;
import
cn.ibizlab.businesscentral.core.product.domain.ProductSalesLiterature
;
import
cn.ibizlab.businesscentral.centralapi.dto.ProductSalesLiteratureDTO
;
import
cn.ibizlab.businesscentral.util.domain.MappingBase
;
import
org.mapstruct.factory.Mappers
;
@Mapper
(
componentModel
=
"spring"
,
uses
=
{},
nullValuePropertyMappingStrategy
=
NullValuePropertyMappingStrategy
.
IGNORE
,
nullValueCheckStrategy
=
NullValueCheckStrategy
.
ALWAYS
)
public
interface
ProductSalesLiteratureMapping
extends
MappingBase
<
ProductSalesLiteratureDTO
,
ProductSalesLiterature
>
{
}
businesscentral-provider/businesscentral-provider-centralapi/src/main/java/cn/ibizlab/businesscentral/centralapi/mapping/SalesLiteratureItemMapping.java
0 → 100644
浏览文件 @
b3737bd6
package
cn
.
ibizlab
.
businesscentral
.
centralapi
.
mapping
;
import
org.mapstruct.*
;
import
cn.ibizlab.businesscentral.core.sales.domain.SalesLiteratureItem
;
import
cn.ibizlab.businesscentral.centralapi.dto.SalesLiteratureItemDTO
;
import
cn.ibizlab.businesscentral.util.domain.MappingBase
;
import
org.mapstruct.factory.Mappers
;
@Mapper
(
componentModel
=
"spring"
,
uses
=
{},
nullValuePropertyMappingStrategy
=
NullValuePropertyMappingStrategy
.
IGNORE
,
nullValueCheckStrategy
=
NullValueCheckStrategy
.
ALWAYS
)
public
interface
SalesLiteratureItemMapping
extends
MappingBase
<
SalesLiteratureItemDTO
,
SalesLiteratureItem
>
{
}
businesscentral-provider/businesscentral-provider-centralapi/src/main/java/cn/ibizlab/businesscentral/centralapi/rest/ProductSalesLiteratureResource.java
0 → 100644
浏览文件 @
b3737bd6
package
cn
.
ibizlab
.
businesscentral
.
centralapi
.
rest
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.math.BigInteger
;
import
java.util.HashMap
;
import
lombok.extern.slf4j.Slf4j
;
import
com.alibaba.fastjson.JSONObject
;
import
javax.servlet.ServletRequest
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cglib.beans.BeanCopier
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.util.StringUtils
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.security.access.prepost.PostAuthorize
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiResponse
;
import
io.swagger.annotations.ApiResponses
;
import
cn.ibizlab.businesscentral.centralapi.dto.*
;
import
cn.ibizlab.businesscentral.centralapi.mapping.*
;
import
cn.ibizlab.businesscentral.core.product.domain.ProductSalesLiterature
;
import
cn.ibizlab.businesscentral.core.product.service.IProductSalesLiteratureService
;
import
cn.ibizlab.businesscentral.core.product.filter.ProductSalesLiteratureSearchContext
;
import
cn.ibizlab.businesscentral.util.annotation.VersionCheck
;
@Slf4j
@Api
(
tags
=
{
"产品宣传资料"
})
@RestController
(
"CentralApi-productsalesliterature"
)
@RequestMapping
(
""
)
public
class
ProductSalesLiteratureResource
{
@Autowired
public
IProductSalesLiteratureService
productsalesliteratureService
;
@Autowired
@Lazy
public
ProductSalesLiteratureMapping
productsalesliteratureMapping
;
@PreAuthorize
(
"hasPermission(this.productsalesliteratureService.get(#productsalesliterature_id),'iBizBusinessCentral-ProductSalesLiterature-Remove')"
)
@ApiOperation
(
value
=
"删除产品宣传资料"
,
tags
=
{
"产品宣传资料"
},
notes
=
"删除产品宣传资料"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/productsalesliteratures/{productsalesliterature_id}"
)
@Transactional
public
ResponseEntity
<
Boolean
>
remove
(
@PathVariable
(
"productsalesliterature_id"
)
String
productsalesliterature_id
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
productsalesliteratureService
.
remove
(
productsalesliterature_id
));
}
@PreAuthorize
(
"hasPermission(this.productsalesliteratureService.getProductsalesliteratureByIds(#ids),'iBizBusinessCentral-ProductSalesLiterature-Remove')"
)
@ApiOperation
(
value
=
"批量删除产品宣传资料"
,
tags
=
{
"产品宣传资料"
},
notes
=
"批量删除产品宣传资料"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/productsalesliteratures/batch"
)
public
ResponseEntity
<
Boolean
>
removeBatch
(
@RequestBody
List
<
String
>
ids
)
{
productsalesliteratureService
.
removeBatch
(
ids
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PostAuthorize
(
"hasPermission(this.productsalesliteratureMapping.toDomain(returnObject.body),'iBizBusinessCentral-ProductSalesLiterature-Get')"
)
@ApiOperation
(
value
=
"获取产品宣传资料"
,
tags
=
{
"产品宣传资料"
},
notes
=
"获取产品宣传资料"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/productsalesliteratures/{productsalesliterature_id}"
)
public
ResponseEntity
<
ProductSalesLiteratureDTO
>
get
(
@PathVariable
(
"productsalesliterature_id"
)
String
productsalesliterature_id
)
{
ProductSalesLiterature
domain
=
productsalesliteratureService
.
get
(
productsalesliterature_id
);
ProductSalesLiteratureDTO
dto
=
productsalesliteratureMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@VersionCheck
(
entity
=
"productsalesliterature"
,
versionfield
=
"updatedate"
)
@PreAuthorize
(
"hasPermission(this.productsalesliteratureService.get(#productsalesliterature_id),'iBizBusinessCentral-ProductSalesLiterature-Update')"
)
@ApiOperation
(
value
=
"更新产品宣传资料"
,
tags
=
{
"产品宣传资料"
},
notes
=
"更新产品宣传资料"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/productsalesliteratures/{productsalesliterature_id}"
)
@Transactional
public
ResponseEntity
<
ProductSalesLiteratureDTO
>
update
(
@PathVariable
(
"productsalesliterature_id"
)
String
productsalesliterature_id
,
@RequestBody
ProductSalesLiteratureDTO
productsalesliteraturedto
)
{
ProductSalesLiterature
domain
=
productsalesliteratureMapping
.
toDomain
(
productsalesliteraturedto
);
domain
.
setRelationshipsid
(
productsalesliterature_id
);
productsalesliteratureService
.
update
(
domain
);
ProductSalesLiteratureDTO
dto
=
productsalesliteratureMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasPermission(this.productsalesliteratureService.getProductsalesliteratureByEntities(this.productsalesliteratureMapping.toDomain(#productsalesliteraturedtos)),'iBizBusinessCentral-ProductSalesLiterature-Update')"
)
@ApiOperation
(
value
=
"批量更新产品宣传资料"
,
tags
=
{
"产品宣传资料"
},
notes
=
"批量更新产品宣传资料"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/productsalesliteratures/batch"
)
public
ResponseEntity
<
Boolean
>
updateBatch
(
@RequestBody
List
<
ProductSalesLiteratureDTO
>
productsalesliteraturedtos
)
{
productsalesliteratureService
.
updateBatch
(
productsalesliteratureMapping
.
toDomain
(
productsalesliteraturedtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"检查产品宣传资料"
,
tags
=
{
"产品宣传资料"
},
notes
=
"检查产品宣传资料"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/productsalesliteratures/checkkey"
)
public
ResponseEntity
<
Boolean
>
checkKey
(
@RequestBody
ProductSalesLiteratureDTO
productsalesliteraturedto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
productsalesliteratureService
.
checkKey
(
productsalesliteratureMapping
.
toDomain
(
productsalesliteraturedto
)));
}
@ApiOperation
(
value
=
"获取产品宣传资料草稿"
,
tags
=
{
"产品宣传资料"
},
notes
=
"获取产品宣传资料草稿"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/productsalesliteratures/getdraft"
)
public
ResponseEntity
<
ProductSalesLiteratureDTO
>
getDraft
()
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
productsalesliteratureMapping
.
toDto
(
productsalesliteratureService
.
getDraft
(
new
ProductSalesLiterature
())));
}
@PreAuthorize
(
"hasPermission(this.productsalesliteratureMapping.toDomain(#productsalesliteraturedto),'iBizBusinessCentral-ProductSalesLiterature-Save')"
)
@ApiOperation
(
value
=
"保存产品宣传资料"
,
tags
=
{
"产品宣传资料"
},
notes
=
"保存产品宣传资料"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/productsalesliteratures/save"
)
public
ResponseEntity
<
Boolean
>
save
(
@RequestBody
ProductSalesLiteratureDTO
productsalesliteraturedto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
productsalesliteratureService
.
save
(
productsalesliteratureMapping
.
toDomain
(
productsalesliteraturedto
)));
}
@PreAuthorize
(
"hasPermission(this.productsalesliteratureMapping.toDomain(#productsalesliteraturedtos),'iBizBusinessCentral-ProductSalesLiterature-Save')"
)
@ApiOperation
(
value
=
"批量保存产品宣传资料"
,
tags
=
{
"产品宣传资料"
},
notes
=
"批量保存产品宣传资料"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/productsalesliteratures/savebatch"
)
public
ResponseEntity
<
Boolean
>
saveBatch
(
@RequestBody
List
<
ProductSalesLiteratureDTO
>
productsalesliteraturedtos
)
{
productsalesliteratureService
.
saveBatch
(
productsalesliteratureMapping
.
toDomain
(
productsalesliteraturedtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasPermission(this.productsalesliteratureMapping.toDomain(#productsalesliteraturedto),'iBizBusinessCentral-ProductSalesLiterature-Create')"
)
@ApiOperation
(
value
=
"新建产品宣传资料"
,
tags
=
{
"产品宣传资料"
},
notes
=
"新建产品宣传资料"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/productsalesliteratures"
)
@Transactional
public
ResponseEntity
<
ProductSalesLiteratureDTO
>
create
(
@RequestBody
ProductSalesLiteratureDTO
productsalesliteraturedto
)
{
ProductSalesLiterature
domain
=
productsalesliteratureMapping
.
toDomain
(
productsalesliteraturedto
);
productsalesliteratureService
.
create
(
domain
);
ProductSalesLiteratureDTO
dto
=
productsalesliteratureMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasPermission(this.productsalesliteratureMapping.toDomain(#productsalesliteraturedtos),'iBizBusinessCentral-ProductSalesLiterature-Create')"
)
@ApiOperation
(
value
=
"批量新建产品宣传资料"
,
tags
=
{
"产品宣传资料"
},
notes
=
"批量新建产品宣传资料"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/productsalesliteratures/batch"
)
public
ResponseEntity
<
Boolean
>
createBatch
(
@RequestBody
List
<
ProductSalesLiteratureDTO
>
productsalesliteraturedtos
)
{
productsalesliteratureService
.
createBatch
(
productsalesliteratureMapping
.
toDomain
(
productsalesliteraturedtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-ProductSalesLiterature-searchDefault-all')"
)
@ApiOperation
(
value
=
"获取DEFAULT"
,
tags
=
{
"产品宣传资料"
}
,
notes
=
"获取DEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/productsalesliteratures/fetchdefault"
)
public
ResponseEntity
<
List
<
ProductSalesLiteratureDTO
>>
fetchDefault
(
ProductSalesLiteratureSearchContext
context
)
{
Page
<
ProductSalesLiterature
>
domains
=
productsalesliteratureService
.
searchDefault
(
context
)
;
List
<
ProductSalesLiteratureDTO
>
list
=
productsalesliteratureMapping
.
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-ProductSalesLiterature-searchDefault-all')"
)
@ApiOperation
(
value
=
"查询DEFAULT"
,
tags
=
{
"产品宣传资料"
}
,
notes
=
"查询DEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/productsalesliteratures/searchdefault"
)
public
ResponseEntity
<
Page
<
ProductSalesLiteratureDTO
>>
searchDefault
(
@RequestBody
ProductSalesLiteratureSearchContext
context
)
{
Page
<
ProductSalesLiterature
>
domains
=
productsalesliteratureService
.
searchDefault
(
context
)
;
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
body
(
new
PageImpl
(
productsalesliteratureMapping
.
toDto
(
domains
.
getContent
()),
context
.
getPageable
(),
domains
.
getTotalElements
()));
}
}
businesscentral-provider/businesscentral-provider-centralapi/src/main/java/cn/ibizlab/businesscentral/centralapi/rest/SalesLiteratureItemResource.java
0 → 100644
浏览文件 @
b3737bd6
package
cn
.
ibizlab
.
businesscentral
.
centralapi
.
rest
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.math.BigInteger
;
import
java.util.HashMap
;
import
lombok.extern.slf4j.Slf4j
;
import
com.alibaba.fastjson.JSONObject
;
import
javax.servlet.ServletRequest
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cglib.beans.BeanCopier
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.util.StringUtils
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.security.access.prepost.PostAuthorize
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiResponse
;
import
io.swagger.annotations.ApiResponses
;
import
cn.ibizlab.businesscentral.centralapi.dto.*
;
import
cn.ibizlab.businesscentral.centralapi.mapping.*
;
import
cn.ibizlab.businesscentral.core.sales.domain.SalesLiteratureItem
;
import
cn.ibizlab.businesscentral.core.sales.service.ISalesLiteratureItemService
;
import
cn.ibizlab.businesscentral.core.sales.filter.SalesLiteratureItemSearchContext
;
import
cn.ibizlab.businesscentral.util.annotation.VersionCheck
;
@Slf4j
@Api
(
tags
=
{
"销售附件"
})
@RestController
(
"CentralApi-salesliteratureitem"
)
@RequestMapping
(
""
)
public
class
SalesLiteratureItemResource
{
@Autowired
public
ISalesLiteratureItemService
salesliteratureitemService
;
@Autowired
@Lazy
public
SalesLiteratureItemMapping
salesliteratureitemMapping
;
@PreAuthorize
(
"hasPermission(this.salesliteratureitemMapping.toDomain(#salesliteratureitemdto),'iBizBusinessCentral-SalesLiteratureItem-Save')"
)
@ApiOperation
(
value
=
"保存销售附件"
,
tags
=
{
"销售附件"
},
notes
=
"保存销售附件"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/salesliteratureitems/save"
)
public
ResponseEntity
<
Boolean
>
save
(
@RequestBody
SalesLiteratureItemDTO
salesliteratureitemdto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
salesliteratureitemService
.
save
(
salesliteratureitemMapping
.
toDomain
(
salesliteratureitemdto
)));
}
@PreAuthorize
(
"hasPermission(this.salesliteratureitemMapping.toDomain(#salesliteratureitemdtos),'iBizBusinessCentral-SalesLiteratureItem-Save')"
)
@ApiOperation
(
value
=
"批量保存销售附件"
,
tags
=
{
"销售附件"
},
notes
=
"批量保存销售附件"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/salesliteratureitems/savebatch"
)
public
ResponseEntity
<
Boolean
>
saveBatch
(
@RequestBody
List
<
SalesLiteratureItemDTO
>
salesliteratureitemdtos
)
{
salesliteratureitemService
.
saveBatch
(
salesliteratureitemMapping
.
toDomain
(
salesliteratureitemdtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PostAuthorize
(
"hasPermission(this.salesliteratureitemMapping.toDomain(returnObject.body),'iBizBusinessCentral-SalesLiteratureItem-Get')"
)
@ApiOperation
(
value
=
"获取销售附件"
,
tags
=
{
"销售附件"
},
notes
=
"获取销售附件"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/salesliteratureitems/{salesliteratureitem_id}"
)
public
ResponseEntity
<
SalesLiteratureItemDTO
>
get
(
@PathVariable
(
"salesliteratureitem_id"
)
String
salesliteratureitem_id
)
{
SalesLiteratureItem
domain
=
salesliteratureitemService
.
get
(
salesliteratureitem_id
);
SalesLiteratureItemDTO
dto
=
salesliteratureitemMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@ApiOperation
(
value
=
"获取销售附件草稿"
,
tags
=
{
"销售附件"
},
notes
=
"获取销售附件草稿"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/salesliteratureitems/getdraft"
)
public
ResponseEntity
<
SalesLiteratureItemDTO
>
getDraft
()
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
salesliteratureitemMapping
.
toDto
(
salesliteratureitemService
.
getDraft
(
new
SalesLiteratureItem
())));
}
@PreAuthorize
(
"hasPermission(this.salesliteratureitemService.get(#salesliteratureitem_id),'iBizBusinessCentral-SalesLiteratureItem-Remove')"
)
@ApiOperation
(
value
=
"删除销售附件"
,
tags
=
{
"销售附件"
},
notes
=
"删除销售附件"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/salesliteratureitems/{salesliteratureitem_id}"
)
@Transactional
public
ResponseEntity
<
Boolean
>
remove
(
@PathVariable
(
"salesliteratureitem_id"
)
String
salesliteratureitem_id
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
salesliteratureitemService
.
remove
(
salesliteratureitem_id
));
}
@PreAuthorize
(
"hasPermission(this.salesliteratureitemService.getSalesliteratureitemByIds(#ids),'iBizBusinessCentral-SalesLiteratureItem-Remove')"
)
@ApiOperation
(
value
=
"批量删除销售附件"
,
tags
=
{
"销售附件"
},
notes
=
"批量删除销售附件"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/salesliteratureitems/batch"
)
public
ResponseEntity
<
Boolean
>
removeBatch
(
@RequestBody
List
<
String
>
ids
)
{
salesliteratureitemService
.
removeBatch
(
ids
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@VersionCheck
(
entity
=
"salesliteratureitem"
,
versionfield
=
"updatedate"
)
@PreAuthorize
(
"hasPermission(this.salesliteratureitemService.get(#salesliteratureitem_id),'iBizBusinessCentral-SalesLiteratureItem-Update')"
)
@ApiOperation
(
value
=
"更新销售附件"
,
tags
=
{
"销售附件"
},
notes
=
"更新销售附件"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/salesliteratureitems/{salesliteratureitem_id}"
)
@Transactional
public
ResponseEntity
<
SalesLiteratureItemDTO
>
update
(
@PathVariable
(
"salesliteratureitem_id"
)
String
salesliteratureitem_id
,
@RequestBody
SalesLiteratureItemDTO
salesliteratureitemdto
)
{
SalesLiteratureItem
domain
=
salesliteratureitemMapping
.
toDomain
(
salesliteratureitemdto
);
domain
.
setSalesliteratureitemid
(
salesliteratureitem_id
);
salesliteratureitemService
.
update
(
domain
);
SalesLiteratureItemDTO
dto
=
salesliteratureitemMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasPermission(this.salesliteratureitemService.getSalesliteratureitemByEntities(this.salesliteratureitemMapping.toDomain(#salesliteratureitemdtos)),'iBizBusinessCentral-SalesLiteratureItem-Update')"
)
@ApiOperation
(
value
=
"批量更新销售附件"
,
tags
=
{
"销售附件"
},
notes
=
"批量更新销售附件"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/salesliteratureitems/batch"
)
public
ResponseEntity
<
Boolean
>
updateBatch
(
@RequestBody
List
<
SalesLiteratureItemDTO
>
salesliteratureitemdtos
)
{
salesliteratureitemService
.
updateBatch
(
salesliteratureitemMapping
.
toDomain
(
salesliteratureitemdtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"检查销售附件"
,
tags
=
{
"销售附件"
},
notes
=
"检查销售附件"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/salesliteratureitems/checkkey"
)
public
ResponseEntity
<
Boolean
>
checkKey
(
@RequestBody
SalesLiteratureItemDTO
salesliteratureitemdto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
salesliteratureitemService
.
checkKey
(
salesliteratureitemMapping
.
toDomain
(
salesliteratureitemdto
)));
}
@PreAuthorize
(
"hasPermission(this.salesliteratureitemMapping.toDomain(#salesliteratureitemdto),'iBizBusinessCentral-SalesLiteratureItem-Create')"
)
@ApiOperation
(
value
=
"新建销售附件"
,
tags
=
{
"销售附件"
},
notes
=
"新建销售附件"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/salesliteratureitems"
)
@Transactional
public
ResponseEntity
<
SalesLiteratureItemDTO
>
create
(
@RequestBody
SalesLiteratureItemDTO
salesliteratureitemdto
)
{
SalesLiteratureItem
domain
=
salesliteratureitemMapping
.
toDomain
(
salesliteratureitemdto
);
salesliteratureitemService
.
create
(
domain
);
SalesLiteratureItemDTO
dto
=
salesliteratureitemMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasPermission(this.salesliteratureitemMapping.toDomain(#salesliteratureitemdtos),'iBizBusinessCentral-SalesLiteratureItem-Create')"
)
@ApiOperation
(
value
=
"批量新建销售附件"
,
tags
=
{
"销售附件"
},
notes
=
"批量新建销售附件"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/salesliteratureitems/batch"
)
public
ResponseEntity
<
Boolean
>
createBatch
(
@RequestBody
List
<
SalesLiteratureItemDTO
>
salesliteratureitemdtos
)
{
salesliteratureitemService
.
createBatch
(
salesliteratureitemMapping
.
toDomain
(
salesliteratureitemdtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','iBizBusinessCentral-SalesLiteratureItem-searchDefault-all')"
)
@ApiOperation
(
value
=
"获取DEFAULT"
,
tags
=
{
"销售附件"
}
,
notes
=
"获取DEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/salesliteratureitems/fetchdefault"
)
public
ResponseEntity
<
List
<
SalesLiteratureItemDTO
>>
fetchDefault
(
SalesLiteratureItemSearchContext
context
)
{
Page
<
SalesLiteratureItem
>
domains
=
salesliteratureitemService
.
searchDefault
(
context
)
;
List
<
SalesLiteratureItemDTO
>
list
=
salesliteratureitemMapping
.
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-SalesLiteratureItem-searchDefault-all')"
)
@ApiOperation
(
value
=
"查询DEFAULT"
,
tags
=
{
"销售附件"
}
,
notes
=
"查询DEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/salesliteratureitems/searchdefault"
)
public
ResponseEntity
<
Page
<
SalesLiteratureItemDTO
>>
searchDefault
(
@RequestBody
SalesLiteratureItemSearchContext
context
)
{
Page
<
SalesLiteratureItem
>
domains
=
salesliteratureitemService
.
searchDefault
(
context
)
;
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
body
(
new
PageImpl
(
salesliteratureitemMapping
.
toDto
(
domains
.
getContent
()),
context
.
getPageable
(),
domains
.
getTotalElements
()));
}
}
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录