Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
iBiz企业中心
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz企业套件
iBiz企业中心
提交
fbcda33c
提交
fbcda33c
编写于
7月 09, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
xignzi006 发布系统代码
上级
41d5ca05
变更
18
展开全部
显示空白字符变更
内嵌
并排
正在显示
18 个修改的文件
包含
2094 行增加
和
1395 行删除
+2094
-1395
account-service-base.ts
app_CRM/src/service/account/account-service-base.ts
+50
-50
campaign-service-base.ts
app_CRM/src/service/campaign/campaign-service-base.ts
+41
-41
contact-service-base.ts
app_CRM/src/service/contact/contact-service-base.ts
+131
-131
ibiz-list-service-base.ts
app_CRM/src/service/ibiz-list/ibiz-list-service-base.ts
+82
-82
lead-service-base.ts
app_CRM/src/service/lead/lead-service-base.ts
+369
-369
opportunity-service-base.ts
app_CRM/src/service/opportunity/opportunity-service-base.ts
+223
-223
product-service-base.ts
app_CRM/src/service/product/product-service-base.ts
+52
-52
sales-literature-service-base.ts
...service/sales-literature/sales-literature-service-base.ts
+47
-47
quick-create-form-base.tsx
...widgets/task/quick-create-form/quick-create-form-base.tsx
+0
-36
ProductServiceImpl.java
...central/core/product/service/impl/ProductServiceImpl.java
+3
-0
CompetitorProduct.java
.../businesscentral/core/sales/domain/CompetitorProduct.java
+182
-0
CompetitorProductSearchContext.java
...ral/core/sales/filter/CompetitorProductSearchContext.java
+89
-0
CompetitorProductMapper.java
...esscentral/core/sales/mapper/CompetitorProductMapper.java
+69
-0
ICompetitorProductService.java
...central/core/sales/service/ICompetitorProductService.java
+63
-0
CompetitorProductServiceImpl.java
...core/sales/service/impl/CompetitorProductServiceImpl.java
+255
-0
CompetitorServiceImpl.java
...entral/core/sales/service/impl/CompetitorServiceImpl.java
+3
-0
h2_table.xml
...esscentral-core/src/main/resources/liquibase/h2_table.xml
+374
-364
CompetitorProductMapper.xml
...apper/sales/competitorproduct/CompetitorProductMapper.xml
+61
-0
未找到文件。
app_CRM/src/service/account/account-service-base.ts
浏览文件 @
fbcda33c
...
@@ -79,6 +79,21 @@ export default class AccountServiceBase extends EntityService {
...
@@ -79,6 +79,21 @@ export default class AccountServiceBase extends EntityService {
}
}
}
}
masterData
.
opportunities
=
opportunitiesData
;
masterData
.
opportunities
=
opportunitiesData
;
let
leadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
)
as
any
);
if
(
leadsData
&&
leadsData
.
length
&&
leadsData
.
length
>
0
){
leadsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
leadid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
leads
=
leadsData
;
let
listaccountsData
:
any
=
[];
let
listaccountsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccounts'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccounts'
),
'undefined'
)){
listaccountsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccounts'
)
as
any
);
listaccountsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccounts'
)
as
any
);
...
@@ -109,21 +124,6 @@ export default class AccountServiceBase extends EntityService {
...
@@ -109,21 +124,6 @@ export default class AccountServiceBase extends EntityService {
}
}
}
}
masterData
.
contacts
=
contactsData
;
masterData
.
contacts
=
contactsData
;
let
leadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
)
as
any
);
if
(
leadsData
&&
leadsData
.
length
&&
leadsData
.
length
>
0
){
leadsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
leadid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
leads
=
leadsData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
data
[
this
.
APPDEKEY
]
=
null
;
...
@@ -134,9 +134,9 @@ export default class AccountServiceBase extends EntityService {
...
@@ -134,9 +134,9 @@ export default class AccountServiceBase extends EntityService {
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_contacts'
,
JSON
.
stringify
(
res
.
data
.
contacts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_contacts'
,
JSON
.
stringify
(
res
.
data
.
contacts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
return
res
;
return
res
;
}
}
...
@@ -166,6 +166,21 @@ export default class AccountServiceBase extends EntityService {
...
@@ -166,6 +166,21 @@ export default class AccountServiceBase extends EntityService {
}
}
}
}
masterData
.
opportunities
=
opportunitiesData
;
masterData
.
opportunities
=
opportunitiesData
;
let
leadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
)
as
any
);
if
(
leadsData
&&
leadsData
.
length
&&
leadsData
.
length
>
0
){
leadsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
leadid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
leads
=
leadsData
;
let
listaccountsData
:
any
=
[];
let
listaccountsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccounts'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccounts'
),
'undefined'
)){
listaccountsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccounts'
)
as
any
);
listaccountsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccounts'
)
as
any
);
...
@@ -196,27 +211,12 @@ export default class AccountServiceBase extends EntityService {
...
@@ -196,27 +211,12 @@ export default class AccountServiceBase extends EntityService {
}
}
}
}
masterData
.
contacts
=
contactsData
;
masterData
.
contacts
=
contactsData
;
let
leadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
)
as
any
);
if
(
leadsData
&&
leadsData
.
length
&&
leadsData
.
length
>
0
){
leadsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
leadid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
leads
=
leadsData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/accounts/
${
context
.
account
}
`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/accounts/
${
context
.
account
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_contacts'
,
JSON
.
stringify
(
res
.
data
.
contacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_contacts'
,
JSON
.
stringify
(
res
.
data
.
contacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
return
res
;
return
res
;
}
}
...
@@ -245,9 +245,9 @@ export default class AccountServiceBase extends EntityService {
...
@@ -245,9 +245,9 @@ export default class AccountServiceBase extends EntityService {
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_contacts'
,
JSON
.
stringify
(
res
.
data
.
contacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_contacts'
,
JSON
.
stringify
(
res
.
data
.
contacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
return
res
;
return
res
;
}
}
...
@@ -264,9 +264,9 @@ export default class AccountServiceBase extends EntityService {
...
@@ -264,9 +264,9 @@ export default class AccountServiceBase extends EntityService {
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/getdraft`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/getdraft`
,
isloading
);
res
.
data
.
account
=
data
.
account
;
res
.
data
.
account
=
data
.
account
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_contacts'
,
JSON
.
stringify
(
res
.
data
.
contacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_contacts'
,
JSON
.
stringify
(
res
.
data
.
contacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
return
res
;
return
res
;
}
}
...
@@ -352,6 +352,21 @@ export default class AccountServiceBase extends EntityService {
...
@@ -352,6 +352,21 @@ export default class AccountServiceBase extends EntityService {
}
}
}
}
masterData
.
opportunities
=
opportunitiesData
;
masterData
.
opportunities
=
opportunitiesData
;
let
leadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
)
as
any
);
if
(
leadsData
&&
leadsData
.
length
&&
leadsData
.
length
>
0
){
leadsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
leadid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
leads
=
leadsData
;
let
listaccountsData
:
any
=
[];
let
listaccountsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccounts'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccounts'
),
'undefined'
)){
listaccountsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccounts'
)
as
any
);
listaccountsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccounts'
)
as
any
);
...
@@ -382,27 +397,12 @@ export default class AccountServiceBase extends EntityService {
...
@@ -382,27 +397,12 @@ export default class AccountServiceBase extends EntityService {
}
}
}
}
masterData
.
contacts
=
contactsData
;
masterData
.
contacts
=
contactsData
;
let
leadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
)
as
any
);
if
(
leadsData
&&
leadsData
.
length
&&
leadsData
.
length
>
0
){
leadsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
leadid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
leads
=
leadsData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/save`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_contacts'
,
JSON
.
stringify
(
res
.
data
.
contacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_contacts'
,
JSON
.
stringify
(
res
.
data
.
contacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
return
res
;
return
res
;
}
}
...
...
app_CRM/src/service/campaign/campaign-service-base.ts
浏览文件 @
fbcda33c
此差异已折叠。
点击以展开。
app_CRM/src/service/contact/contact-service-base.ts
浏览文件 @
fbcda33c
此差异已折叠。
点击以展开。
app_CRM/src/service/ibiz-list/ibiz-list-service-base.ts
浏览文件 @
fbcda33c
此差异已折叠。
点击以展开。
app_CRM/src/service/lead/lead-service-base.ts
浏览文件 @
fbcda33c
此差异已折叠。
点击以展开。
app_CRM/src/service/opportunity/opportunity-service-base.ts
浏览文件 @
fbcda33c
此差异已折叠。
点击以展开。
app_CRM/src/service/product/product-service-base.ts
浏览文件 @
fbcda33c
此差异已折叠。
点击以展开。
app_CRM/src/service/sales-literature/sales-literature-service-base.ts
浏览文件 @
fbcda33c
此差异已折叠。
点击以展开。
app_CRM/src/widgets/task/quick-create-form/quick-create-form-base.tsx
浏览文件 @
fbcda33c
...
@@ -157,42 +157,6 @@ export class QuickCreateEditFormBase extends EditFormControlBase {
...
@@ -157,42 +157,6 @@ export class QuickCreateEditFormBase extends EditFormControlBase {
};
};
/**
* 表单逻辑
*
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @memberof QuickCreateEditFormBase
*/
public
formLogic
({
name
,
newVal
,
oldVal
}:
{
name
:
string
,
newVal
:
any
,
oldVal
:
any
}):
void
{
if
(
Object
.
is
(
name
,
'owneridyominame'
))
{
const
details
:
string
[]
=
[];
this
.
updateFormItems
(
'FillOwn'
,
this
.
data
,
details
,
true
);
}
}
/**
/**
* 新建默认值
* 新建默认值
* @memberof QuickCreateEditFormBase
* @memberof QuickCreateEditFormBase
...
...
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/product/service/impl/ProductServiceImpl.java
浏览文件 @
fbcda33c
...
@@ -44,6 +44,9 @@ import org.springframework.util.StringUtils;
...
@@ -44,6 +44,9 @@ import org.springframework.util.StringUtils;
@Service
(
"ProductServiceImpl"
)
@Service
(
"ProductServiceImpl"
)
public
class
ProductServiceImpl
extends
ServiceImpl
<
ProductMapper
,
Product
>
implements
IProductService
{
public
class
ProductServiceImpl
extends
ServiceImpl
<
ProductMapper
,
Product
>
implements
IProductService
{
@Autowired
@Lazy
protected
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
service
.
ICompetitorProductService
competitorproductService
;
@Autowired
@Autowired
@Lazy
@Lazy
protected
cn
.
ibizlab
.
businesscentral
.
core
.
service
.
service
.
IContractDetailService
contractdetailService
;
protected
cn
.
ibizlab
.
businesscentral
.
core
.
service
.
service
.
IContractDetailService
contractdetailService
;
...
...
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/sales/domain/CompetitorProduct.java
0 → 100644
浏览文件 @
fbcda33c
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
=
"CompetitorProductResultMap"
)
public
class
CompetitorProduct
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
=
"COMPETITORPRODUCT"
)
@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
;
/**
*
*/
@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
.
product
.
domain
.
Product
product
;
/**
* 设置 [关系名称]
*/
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
);
}
}
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/sales/filter/CompetitorProductSearchContext.java
0 → 100644
浏览文件 @
fbcda33c
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.CompetitorProduct
;
/**
* 关系型数据实体[CompetitorProduct] 查询条件对象
*/
@Slf4j
@Data
public
class
CompetitorProductSearchContext
extends
QueryWrapperContext
<
CompetitorProduct
>
{
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
);
}
}
/**
* 启用快速搜索
*/
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/CompetitorProductMapper.java
0 → 100644
浏览文件 @
fbcda33c
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.CompetitorProduct
;
import
cn.ibizlab.businesscentral.core.sales.filter.CompetitorProductSearchContext
;
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
CompetitorProductMapper
extends
BaseMapper
<
CompetitorProduct
>{
Page
<
CompetitorProduct
>
searchDefault
(
IPage
page
,
@Param
(
"srf"
)
CompetitorProductSearchContext
context
,
@Param
(
"ew"
)
Wrapper
<
CompetitorProduct
>
wrapper
)
;
@Override
CompetitorProduct
selectById
(
Serializable
id
);
@Override
int
insert
(
CompetitorProduct
entity
);
@Override
int
updateById
(
@Param
(
Constants
.
ENTITY
)
CompetitorProduct
entity
);
@Override
int
update
(
@Param
(
Constants
.
ENTITY
)
CompetitorProduct
entity
,
@Param
(
"ew"
)
Wrapper
<
CompetitorProduct
>
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
<
CompetitorProduct
>
selectByEntityid
(
@Param
(
"competitorid"
)
Serializable
competitorid
)
;
List
<
CompetitorProduct
>
selectByEntity2id
(
@Param
(
"productid"
)
Serializable
productid
)
;
}
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/sales/service/ICompetitorProductService.java
0 → 100644
浏览文件 @
fbcda33c
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.CompetitorProduct
;
import
cn.ibizlab.businesscentral.core.sales.filter.CompetitorProductSearchContext
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
* 实体[CompetitorProduct] 服务对象接口
*/
public
interface
ICompetitorProductService
extends
IService
<
CompetitorProduct
>{
boolean
create
(
CompetitorProduct
et
)
;
void
createBatch
(
List
<
CompetitorProduct
>
list
)
;
boolean
update
(
CompetitorProduct
et
)
;
void
updateBatch
(
List
<
CompetitorProduct
>
list
)
;
boolean
remove
(
String
key
)
;
void
removeBatch
(
Collection
<
String
>
idList
)
;
CompetitorProduct
get
(
String
key
)
;
CompetitorProduct
getDraft
(
CompetitorProduct
et
)
;
boolean
checkKey
(
CompetitorProduct
et
)
;
boolean
save
(
CompetitorProduct
et
)
;
void
saveBatch
(
List
<
CompetitorProduct
>
list
)
;
Page
<
CompetitorProduct
>
searchDefault
(
CompetitorProductSearchContext
context
)
;
List
<
CompetitorProduct
>
selectByEntityid
(
String
competitorid
)
;
void
removeByEntityid
(
String
competitorid
)
;
List
<
CompetitorProduct
>
selectByEntity2id
(
String
productid
)
;
void
removeByEntity2id
(
String
productid
)
;
/**
*自定义查询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
<
CompetitorProduct
>
getCompetitorproductByIds
(
List
<
String
>
ids
)
;
List
<
CompetitorProduct
>
getCompetitorproductByEntities
(
List
<
CompetitorProduct
>
entities
)
;
}
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/sales/service/impl/CompetitorProductServiceImpl.java
0 → 100644
浏览文件 @
fbcda33c
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.CompetitorProduct
;
import
cn.ibizlab.businesscentral.core.sales.filter.CompetitorProductSearchContext
;
import
cn.ibizlab.businesscentral.core.sales.service.ICompetitorProductService
;
import
cn.ibizlab.businesscentral.util.helper.CachedBeanCopier
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
cn.ibizlab.businesscentral.core.sales.mapper.CompetitorProductMapper
;
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
(
"CompetitorProductServiceImpl"
)
public
class
CompetitorProductServiceImpl
extends
ServiceImpl
<
CompetitorProductMapper
,
CompetitorProduct
>
implements
ICompetitorProductService
{
@Autowired
@Lazy
protected
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
service
.
ICompetitorService
competitorService
;
@Autowired
@Lazy
protected
cn
.
ibizlab
.
businesscentral
.
core
.
product
.
service
.
IProductService
productService
;
protected
int
batchSize
=
500
;
@Override
@Transactional
public
boolean
create
(
CompetitorProduct
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
<
CompetitorProduct
>
list
)
{
list
.
forEach
(
item
->
fillParentData
(
item
));
this
.
saveBatch
(
list
,
batchSize
);
}
@Override
@Transactional
public
boolean
update
(
CompetitorProduct
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
<
CompetitorProduct
>
list
)
{
list
.
forEach
(
item
->
fillParentData
(
item
));
updateBatchById
(
list
,
batchSize
);
}
@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
CompetitorProduct
get
(
String
key
)
{
CompetitorProduct
et
=
getById
(
key
);
if
(
et
==
null
){
et
=
new
CompetitorProduct
();
et
.
setRelationshipsid
(
key
);
}
else
{
}
return
et
;
}
@Override
public
CompetitorProduct
getDraft
(
CompetitorProduct
et
)
{
fillParentData
(
et
);
return
et
;
}
@Override
public
boolean
checkKey
(
CompetitorProduct
et
)
{
return
(!
ObjectUtils
.
isEmpty
(
et
.
getRelationshipsid
()))&&(!
Objects
.
isNull
(
this
.
getById
(
et
.
getRelationshipsid
())));
}
@Override
@Transactional
public
boolean
save
(
CompetitorProduct
et
)
{
if
(!
saveOrUpdate
(
et
))
return
false
;
return
true
;
}
@Override
@Transactional
(
rollbackFor
=
{
Exception
.
class
}
)
public
boolean
saveOrUpdate
(
CompetitorProduct
et
)
{
if
(
null
==
et
)
{
return
false
;
}
else
{
return
checkKey
(
et
)
?
this
.
update
(
et
)
:
this
.
create
(
et
);
}
}
@Override
public
boolean
saveBatch
(
Collection
<
CompetitorProduct
>
list
)
{
list
.
forEach
(
item
->
fillParentData
(
item
));
saveOrUpdateBatch
(
list
,
batchSize
);
return
true
;
}
@Override
public
void
saveBatch
(
List
<
CompetitorProduct
>
list
)
{
list
.
forEach
(
item
->
fillParentData
(
item
));
saveOrUpdateBatch
(
list
,
batchSize
);
}
@Override
public
List
<
CompetitorProduct
>
selectByEntityid
(
String
competitorid
)
{
return
baseMapper
.
selectByEntityid
(
competitorid
);
}
@Override
public
void
removeByEntityid
(
String
competitorid
)
{
this
.
remove
(
new
QueryWrapper
<
CompetitorProduct
>().
eq
(
"entityid"
,
competitorid
));
}
@Override
public
List
<
CompetitorProduct
>
selectByEntity2id
(
String
productid
)
{
return
baseMapper
.
selectByEntity2id
(
productid
);
}
@Override
public
void
removeByEntity2id
(
String
productid
)
{
this
.
remove
(
new
QueryWrapper
<
CompetitorProduct
>().
eq
(
"entity2id"
,
productid
));
}
/**
* 查询集合 DEFAULT
*/
@Override
public
Page
<
CompetitorProduct
>
searchDefault
(
CompetitorProductSearchContext
context
)
{
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
<
CompetitorProduct
>
pages
=
baseMapper
.
searchDefault
(
context
.
getPages
(),
context
,
context
.
getSelectCond
());
return
new
PageImpl
<
CompetitorProduct
>(
pages
.
getRecords
(),
context
.
getPageable
(),
pages
.
getTotal
());
}
/**
* 为当前实体填充父数据(外键值文本、外键值附加数据)
* @param et
*/
private
void
fillParentData
(
CompetitorProduct
et
){
//实体关系[DER1N_COMPETITORPRODUCT_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
());
}
}
@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
<
CompetitorProduct
>
getCompetitorproductByIds
(
List
<
String
>
ids
)
{
return
this
.
listByIds
(
ids
);
}
@Override
public
List
<
CompetitorProduct
>
getCompetitorproductByEntities
(
List
<
CompetitorProduct
>
entities
)
{
List
ids
=
new
ArrayList
();
for
(
CompetitorProduct
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
浏览文件 @
fbcda33c
...
@@ -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
.
ICompetitorProductService
competitorproductService
;
@Autowired
@Autowired
@Lazy
@Lazy
protected
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
service
.
ICompetitorSalesLiteratureService
competitorsalesliteratureService
;
protected
cn
.
ibizlab
.
businesscentral
.
core
.
sales
.
service
.
ICompetitorSalesLiteratureService
competitorsalesliteratureService
;
...
...
businesscentral-core/src/main/resources/liquibase/h2_table.xml
浏览文件 @
fbcda33c
此差异已折叠。
点击以展开。
businesscentral-core/src/main/resources/mapper/sales/competitorproduct/CompetitorProductMapper.xml
0 → 100644
浏览文件 @
fbcda33c
<?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.CompetitorProductMapper"
>
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select
id=
"selectById"
resultMap=
"CompetitorProductResultMap"
databaseId=
"mysql"
>
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`ENTITY2ID`, t1.`ENTITYID`, 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=
"CompetitorProductResultMap"
type=
"cn.ibizlab.businesscentral.core.sales.domain.CompetitorProduct"
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=
"product"
javaType=
"cn.ibizlab.businesscentral.core.product.domain.Product"
column=
"entity2id"
select=
"cn.ibizlab.businesscentral.core.product.mapper.ProductMapper.selectById"
fetchType=
"lazy"
></association>
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_COMPETITORPRODUCT_COMPETITOR_ENTITYID] -->
<select
id=
"selectByEntityid"
resultMap=
"CompetitorProductResultMap"
>
select t1.* from (
<include
refid=
"Default"
/>
) t1
where entityid=#{competitorid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_COMPETITORPRODUCT_PRODUCT_ENTITY2ID] -->
<select
id=
"selectByEntity2id"
resultMap=
"CompetitorProductResultMap"
>
select t1.* from (
<include
refid=
"Default"
/>
) t1
where entity2id=#{productid}
</select>
<!--数据集合[Default]-->
<select
id=
"searchDefault"
parameterType=
"cn.ibizlab.businesscentral.core.sales.filter.CompetitorProductSearchContext"
resultMap=
"CompetitorProductResultMap"
>
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.`ENTITYID`, 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.`ENTITYID`, t1.`RELATIONSHIPSID`, t1.`RELATIONSHIPSNAME`, t1.`RELATIONSHIPSTYPE`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `RELATIONSHIPS` t1
WHERE ( t1.`RELATIONSHIPSTYPE` = '' )
]]>
</sql>
</mapper>
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录