Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
topsun-bpm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
鲁鑫
topsun-bpm
Commits
c8d3ae01
Commit
c8d3ae01
authored
Dec 22, 2023
by
全洪江
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
客户模块前端页面调整,后端查询删除
Signed-off-by:
Hongjiang
<
hongjiang.quan@topsunit.com
>
parent
b8d581c7
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
275 additions
and
178 deletions
+275
-178
customerDetail.js
...-xt/src/main/webapp/biz/topsun/customer/customerDetail.js
+206
-145
customerList.js
...un-xt/src/main/webapp/biz/topsun/customer/customerList.js
+2
-4
CustomerApplication.java
...igou/topsun/customer/application/CustomerApplication.java
+2
-12
CustomerRelatedApplication.java
...psun/customer/application/CustomerRelatedApplication.java
+3
-2
CustomerApplicationImpl.java
...un/customer/application/Impl/CustomerApplicationImpl.java
+27
-3
CustomerRelatedApplicationImpl.java
...omer/application/Impl/CustomerRelatedApplicationImpl.java
+5
-6
CustomerController.java
...huigou/topsun/customer/controller/CustomerController.java
+23
-0
CustomerDebtContactController.java
...un/customer/controller/CustomerDebtContactController.java
+2
-1
CustomerRelatedController.java
...topsun/customer/controller/CustomerRelatedController.java
+3
-3
customerMapper.xml
.../main/resources/config/topsun/customer/customerMapper.xml
+2
-2
No files found.
topsun-xt/src/main/webapp/biz/topsun/customer/customerDetail.js
View file @
c8d3ae01
var
g
ridManager
=
null
;
var
baosheEmail
Manage
=
null
;
var
customerEmail
Manage
=
null
;
var
customerRelated
ListGrid
=
null
;
var
customerPayInfo
ListGrid
=
null
;
var
contactG
ridManager
=
null
;
var
baosheEmail
GridManager
=
null
;
var
customerEmail
GridManager
=
null
;
var
customerRelated
GridManager
=
null
;
var
customerPayInfo
GridManager
=
null
;
$
(
document
).
ready
(
function
()
{
initializeTab
();
initializeUI
();
...
...
@@ -29,38 +29,38 @@ function loadContactListGrid() {
//增删改控件
var
toolbarOptions
=
UICtrl
.
getDefaultToolbarOptions
({
addHandler
:
function
()
{
addHandler
();
},
updateHandler
:
function
()
{
updateHandler
();
addContactHandler
();
},
deleteHandler
:
function
()
{
deleteHandler
();
delete
Contact
Handler
();
}
});
g
ridManager
=
UICtrl
.
grid
(
"#contactListGrid"
,
{
contactG
ridManager
=
UICtrl
.
grid
(
"#contactListGrid"
,
{
columns
:
[
{
display
:
"联系人名称"
,
name
:
"contactName"
,
width
:
300
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
required
:
true
,
type
:
"select"
,
data
:
{
type
:
'system'
,
name
:
"customerContactList"
,
back
:
{
customerContactId
:
"customerContactId"
,
customerId
:
"customerId"
,
contactName
:
"contactName"
,
contactPhone
:
"contactPhone"
,
contactFax
:
"contactFax"
,
contactMail
:
"contactMail"
}
},
required
:
true
,
type
:
"text"
}
},
{
display
:
"联系人电话"
,
name
:
"contactPhone"
,
width
:
300
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"传真"
,
name
:
"contactFax"
,
width
:
300
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"邮箱"
,
name
:
"contactMail"
,
width
:
300
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
}
{
display
:
"联系人电话"
,
name
:
"contactPhone"
,
width
:
300
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
required
:
true
,
type
:
"text"
}
},
{
display
:
"传真"
,
name
:
"contactFax"
,
width
:
300
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
required
:
false
,
type
:
"text"
}
},
{
display
:
"邮箱"
,
name
:
"contactMail"
,
width
:
300
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
required
:
true
,
type
:
"text"
}
}
],
dataAction
:
"server"
,
url
:
web_app
.
name
+
'/customer/slicedContactList.ajax'
,
...
...
@@ -69,58 +69,89 @@ function loadContactListGrid() {
usePager
:
true
,
toolbar
:
toolbarOptions
,
width
:
"100%"
,
height
:
"60%"
,
height
:
"40%"
,
enabledEdit
:
true
,
heightDiff
:
-
8
,
checkbox
:
true
,
fixedCellHeight
:
true
,
selectRowButtonOnly
:
true
,
onDblClickRow
:
function
(
data
,
rowindex
,
rowobj
)
{
updateHandler
(
data
);
}
});
UICtrl
.
setSearchAreaToggle
(
gridManager
);
UICtrl
.
setSearchAreaToggle
(
contactGridManager
);
}
//添加联系人
function
addContactHandler
()
{
UICtrl
.
addGridRow
(
contactGridManager
);
}
//删除联系人
function
deleteContactHandler
()
{
var
_grid
=
UICtrl
.
getGridManager
(
'#contactListGrid'
);
DataUtil
.
delSelectedRows
(
{
action
:
'customer/deleteContact.ajax'
,
param
:
{},
gridManager
:
_grid
,
idFieldName
:
'customerContactId'
,
onSuccess
:
function
()
{
reloadResourceGrid
();
}
}
)
}
function
loadBaoshenEmailListGrid
()
{
var
toolbarOptions
=
UICtrl
.
getDefaultToolbarOptions
(
{
addHandler
:
function
()
{
// addHandlerBaoshenEmail();
},
updateHandler
:
function
()
{
// updateHandlerBaoshenEmail();
UICtrl
.
addGridRow
(
baosheEmailGridManager
);
},
deleteHandler
:
function
()
{
// updateHandlerBaoshenEmail();
var
_grid
=
UICtrl
.
getGridManager
(
'#baoshenEmailListGrid'
);
DataUtil
.
delSelectedRows
(
{
action
:
'customer/deleteBaoshenEmail.ajax'
,
param
:
{},
gridManager
:
_grid
,
idFieldName
:
'customerDebtContactId'
,
onSuccess
:
function
()
{
baosheEmailGridManager
.
loadData
();
}
}
)
}
}
);
baosheEmail
Manage
=
UICtrl
.
grid
(
"#baoshenEmailListGrid"
,
{
baosheEmail
GridManager
=
UICtrl
.
grid
(
"#baoshenEmailListGrid"
,
{
columns
:
[
{
display
:
"邮箱地址"
,
name
:
"customerEmail"
,
width
:
300
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
required
:
true
,
type
:
"select"
,
data
:
{
type
:
'system'
,
name
:
"baoshenEmailList"
,
back
:
{
customerDebtContactId
:
"customerDebtContactId"
,
customerId
:
"customerId"
,
customerEmail
:
"customerEmail"
,
customerContact
:
"customerContact"
,
sendEmail
:
"sendEmail"
,
customerMailType
:
"customerEmailType"
,
createById
:
"createById"
,
createdByName
:
"createdByName"
,
createdDate
:
"createdDate"
}
},
}
required
:
true
,
type
:
"text"
},
},
{
display
:
"联系人"
,
name
:
"customerContact"
,
width
:
300
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
required
:
true
,
type
:
"text"
},
},
{
display
:
"开启邮件发送"
,
name
:
"sendEmail"
,
width
:
300
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
required
:
true
,
type
:
"text"
},
},
{
display
:
"联系人"
,
name
:
"customerContact"
,
width
:
300
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"开启邮件发送"
,
name
:
"sendEmail"
,
width
:
300
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"创建人"
,
name
:
"createdByName"
,
width
:
300
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
}
{
display
:
"创建人"
,
name
:
"createdByName"
,
width
:
300
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
required
:
true
,
type
:
"text"
},
}
],
dataAction
:
"server"
,
url
:
web_app
.
name
+
'/customerDebtContact/slicedCustomerDebtContactList.ajax'
,
...
...
@@ -130,6 +161,7 @@ function loadBaoshenEmailListGrid() {
toolbar
:
toolbarOptions
,
width
:
"100%"
,
height
:
"60%"
,
enabledEdit
:
true
,
heightDiff
:
-
8
,
checkbox
:
true
,
fixedCellHeight
:
true
,
...
...
@@ -141,42 +173,50 @@ function loadCustomerEmailListGrid() {
var
toolbarOptions
=
UICtrl
.
getDefaultToolbarOptions
(
{
addHandler
:
function
()
{
// addHandlerCustomerEmail();
},
updateHandler
:
function
()
{
// updateHandlerCustomerEmail();
UICtrl
.
addGridRow
(
customerEmailGridManager
);
},
deleteHandler
:
function
()
{
// updateHandlerCustomerEmail();
var
_grid
=
UICtrl
.
getGridManager
(
'#customerEmailListGrid'
);
DataUtil
.
delSelectedRows
(
{
action
:
'customer/deleteCustomerEmail.ajax'
,
param
:
{},
gridManager
:
_grid
,
idFieldName
:
'customerDebtContactId'
,
onSuccess
:
function
()
{
customerEmailGridManager
.
loadData
();
}
}
)
}
}
);
customerEmail
Manage
=
UICtrl
.
grid
(
"#customerEmailListGrid"
,
{
customerEmail
GridManager
=
UICtrl
.
grid
(
"#customerEmailListGrid"
,
{
columns
:
[
{
display
:
"邮箱地址"
,
name
:
"customerEmail"
,
width
:
300
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
required
:
true
,
type
:
"select"
,
data
:
{
type
:
'system'
,
name
:
"customerEmailList"
,
back
:
{
customerDebtContactId
:
"customerDebtContactId"
,
customerId
:
"customerId"
,
customerEmail
:
"customerEmail"
,
customerContact
:
"customerContact"
,
sendEmail
:
"sendEmail"
,
customerMailType
:
"customerEmailType"
,
createById
:
"createById"
,
createdByName
:
"createdByName"
,
createdDate
:
"createdDate"
}
},
required
:
true
,
type
:
"text"
,
}
},
{
display
:
"联系人"
,
name
:
"customerContact"
,
width
:
300
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
required
:
true
,
type
:
"text"
,
}
},
{
display
:
"开启邮件发送"
,
name
:
"sendEmail"
,
width
:
300
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
required
:
true
,
type
:
"text"
,
}
},
{
display
:
"联系人"
,
name
:
"customerContact"
,
width
:
300
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"开启邮件发送"
,
name
:
"sendEmail"
,
width
:
300
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"创建人"
,
name
:
"createdByName"
,
width
:
300
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
}
{
display
:
"创建人"
,
name
:
"createdByName"
,
width
:
300
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
required
:
true
,
type
:
"text"
,
}
}
],
dataAction
:
"server"
,
url
:
web_app
.
name
+
'/customerDebtContact/slicedCustomerDebtContactList.ajax'
,
...
...
@@ -186,6 +226,7 @@ function loadCustomerEmailListGrid() {
toolbar
:
toolbarOptions
,
width
:
"100%"
,
height
:
"60%"
,
enabledEdit
:
true
,
heightDiff
:
-
8
,
checkbox
:
true
,
fixedCellHeight
:
true
,
...
...
@@ -197,17 +238,25 @@ function loadCustomerRelatedListGrid() {
var
toolbarOptions
=
UICtrl
.
getDefaultToolbarOptions
(
{
addHandler
:
function
()
{
// addCustomerRelatedEmail();
},
updateHandler
:
function
()
{
// updateCustomerRelatedEmail();
UICtrl
.
addGridRow
(
customerRelatedGridManager
);
},
deleteHandler
:
function
()
{
// updateCustomerRelatedEmail();
var
_grid
=
UICtrl
.
getGridManager
(
'#customerRelatedListGrid'
);
DataUtil
.
delSelectedRows
(
{
action
:
'customer/deleteCustomerRelated.ajax'
,
param
:
{},
gridManager
:
_grid
,
idFieldName
:
'customerRelatedId'
,
onSuccess
:
function
()
{
customerRelatedGridManager
.
loadData
();
}
}
)
}
}
);
customerRelated
ListGrid
=
UICtrl
.
grid
(
"#customerRelatedListGrid"
,
{
customerRelated
GridManager
=
UICtrl
.
grid
(
"#customerRelatedListGrid"
,
{
columns
:
[
{
display
:
"关联客户编码"
,
...
...
@@ -217,20 +266,7 @@ function loadCustomerRelatedListGrid() {
type
:
"string"
,
align
:
"left"
,
editor
:
{
required
:
true
,
type
:
"select"
,
data
:
{
type
:
'system'
,
name
:
"customerRelatedList"
,
back
:
{
customerRelatedId
:
"customerRelatedId"
,
customerId
:
"customerId"
,
customerCodeRelated
:
"customerCodeRelated"
,
customerShortNameRelated
:
"customerShortNameRelated"
,
customerNameRelated
:
"customerNameRelated"
,
createdByName
:
"createdByName"
,
createdDate
:
"createdDate"
}
},
required
:
true
,
type
:
"text"
}
},
{
...
...
@@ -239,7 +275,10 @@ function loadCustomerRelatedListGrid() {
width
:
200
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
align
:
"left"
,
editor
:
{
required
:
true
,
type
:
"text"
}
},
{
display
:
"关联客户全称"
,
...
...
@@ -247,27 +286,38 @@ function loadCustomerRelatedListGrid() {
width
:
200
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
align
:
"left"
,
editor
:
{
required
:
true
,
type
:
"text"
}
},
{
display
:
"录入人"
,
name
:
"createdByName"
,
width
:
200
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
required
:
true
,
type
:
"text"
}
},
{
display
:
"录入时间"
,
name
:
"createdDate"
,
width
:
200
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
required
:
true
,
type
:
"text"
}
},
{
display
:
"录入人"
,
name
:
"createdByName"
,
width
:
200
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"录入时间"
,
name
:
"createdDate"
,
width
:
200
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
],
dataAction
:
"server"
,
url
:
web_app
.
name
+
'/customer
/slicedContact
List.ajax'
,
url
:
web_app
.
name
+
'/customer
Related/slicedCustomerRelated
List.ajax'
,
parms
:
{
customerId
:
$
(
"#customerId"
).
val
()},
pageSize
:
10
,
usePager
:
true
,
toolbar
:
toolbarOptions
,
width
:
"100%"
,
height
:
"40%"
,
enabledEdit
:
true
,
heightDiff
:
-
8
,
checkbox
:
true
,
fixedCellHeight
:
true
,
selectRowButtonOnly
:
true
,
onDblClickRow
:
function
(
data
,
rowindex
,
rowobj
)
{
updateHandler
(
data
);
}
selectRowButtonOnly
:
true
});
}
...
...
@@ -275,17 +325,25 @@ function loadCustomerPayInfoListGrid() {
var
toolbarOptions
=
UICtrl
.
getDefaultToolbarOptions
(
{
addHandler
:
function
()
{
// addCustomerPayInfo();
},
updateHandler
:
function
()
{
// updateCustomerPayInfo();
UICtrl
.
addGridRow
(
customerPayInfoGridManager
);
},
deleteHandler
:
function
()
{
// updateCustomerPayInfo();
var
_grid
=
UICtrl
.
getGridManager
(
'#customerPayInfoListGrid'
);
DataUtil
.
delSelectedRows
(
{
action
:
'customer/deleteCustomerPayInfo.ajax'
,
param
:
{},
gridManager
:
_grid
,
idFieldName
:
'customerPayInfoId'
,
onSuccess
:
function
()
{
customerPayInfoGridManager
.
loadData
();
}
}
)
}
}
);
customerPayInfo
ListGrid
=
UICtrl
.
grid
(
"#customerPayInfoListGrid"
,
{
customerPayInfo
GridManager
=
UICtrl
.
grid
(
"#customerPayInfoListGrid"
,
{
columns
:
[
{
display
:
"支付方户名"
,
...
...
@@ -295,28 +353,33 @@ function loadCustomerPayInfoListGrid() {
type
:
"string"
,
align
:
"left"
,
editor
:
{
required
:
true
,
type
:
"select"
,
data
:
{
type
:
'system'
,
name
:
"customerContactList"
,
back
:
{
customerPayInfoId
:
"customerPayInfoId"
,
customerId
:
"customerId"
,
customerPayAccountName
:
"customerPayAccountName"
,
createdByName
:
"createdByName"
,
createdById
:
"createdById"
,
createdDate
:
"createdDate"
,
lastModifiedById
:
"lastModifiedById"
,
lastModifiedByName
:
"lastModifiedByName"
,
lastModifiedDate
:
"lastModifiedDate"
}
},
required
:
true
,
type
:
"text"
,
}
},
{
display
:
"录入人"
,
name
:
"createdByName"
,
width
:
200
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
required
:
true
,
type
:
"text"
,
}
},
{
display
:
"录入时间"
,
name
:
"createdDate"
,
width
:
200
,
minWidth
:
60
,
type
:
"date"
,
align
:
"left"
,
editor
:
{
required
:
true
,
type
:
"text"
,
}
},
{
display
:
"录入人"
,
name
:
"createdByName"
,
width
:
200
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"录入时间"
,
name
:
"createdDate"
,
width
:
200
,
minWidth
:
60
,
type
:
"date"
,
align
:
"left"
},
{
display
:
"修改人"
,
name
:
"lastModifiedByName"
,
width
:
200
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"修改时间"
,
name
:
"lastModifiedDate"
,
width
:
200
,
minWidth
:
60
,
type
:
"date"
,
align
:
"left"
}
{
display
:
"修改人"
,
name
:
"lastModifiedByName"
,
width
:
200
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
required
:
true
,
type
:
"text"
,
}
},
{
display
:
"修改时间"
,
name
:
"lastModifiedDate"
,
width
:
200
,
minWidth
:
60
,
type
:
"date"
,
align
:
"left"
,
editor
:
{
required
:
true
,
type
:
"text"
,
}
}
],
dataAction
:
"server"
,
url
:
web_app
.
name
+
'/customer/slicedContactList.ajax'
,
...
...
@@ -326,20 +389,18 @@ function loadCustomerPayInfoListGrid() {
toolbar
:
toolbarOptions
,
width
:
"100%"
,
height
:
"40%"
,
enabledEdit
:
true
,
heightDiff
:
-
8
,
checkbox
:
true
,
fixedCellHeight
:
true
,
selectRowButtonOnly
:
true
,
onDblClickRow
:
function
(
data
,
rowindex
,
rowobj
)
{
updateHandler
(
data
);
}
selectRowButtonOnly
:
true
});
}
function
bindEvent
()
{
$
(
"#save"
).
click
(
function
()
{
saveData
(
"save"
);
$
(
"#save"
).
click
(
function
()
{
//保存整体保存
saveData
();
})
$
(
"#close"
).
click
(
function
()
{
//关闭
...
...
@@ -349,7 +410,7 @@ function bindEvent() {
//右上角的保存控件
function
saveData
()
{
// var contactList
}
function
closeDispatchTabItem
()
{
...
...
topsun-xt/src/main/webapp/biz/topsun/customer/customerList.js
View file @
c8d3ae01
...
...
@@ -17,9 +17,7 @@ function loadCustomerInfoListGrid() {
updateHandler
:
function
()
{
updateHandler
();
},
deleteHandler
:
function
()
{
updateHandler
();
}
deleteHandler
:
deleteHandler
,
});
gridManager
=
UICtrl
.
grid
(
"#customerInfoListGrid"
,
{
columns
:
[
...
...
@@ -77,7 +75,7 @@ function addHandler() {
//删除按钮
function
deleteHandler
()
{
DataUtil
.
del
({
action
:
'customer/deleteCustomer.ajax'
,
action
:
'customer/deleteCustomer
AndAffiliatedInfoByCustomerId
.ajax'
,
gridManager
:
gridManager
,
idFieldName
:
'customerId'
,
onSuccess
:
function
()
{
reloadGrid
();
...
...
topsun/src/main/java/com/huigou/topsun/customer/application/CustomerApplication.java
View file @
c8d3ae01
...
...
@@ -14,17 +14,7 @@ public interface CustomerApplication {
Map
<
String
,
Object
>
findCustomerByPage
(
CustomerQueryRequest
customerQueryRequest
);
List
<
CustomerContact
>
findContactByPage
(
String
customerId
);
void
deleteContactById
(
String
id
);
void
deleteContactByIds
(
List
<
String
>
ids
);
}
topsun/src/main/java/com/huigou/topsun/customer/application/CustomerRelatedApplication.java
View file @
c8d3ae01
package
com
.
huigou
.
topsun
.
customer
.
application
;
import
com.huigou.topsun.customer.controller.CustomerRelatedController
;
import
com.huigou.topsun.customer.domain.CustomerRelated
;
import
com.huigou.topsun.customer.domain.query.CustomerRelatedQueryRequest
;
import
com.huigou.topsun.customer.domain.vo.CustomerRelatedVo
;
...
...
@@ -14,9 +15,9 @@ import java.util.Map;
* description:
*/
public
interface
CustomerRelatedApplication
{
public
static
final
String
QUERY_XML_FILE_PATH
=
"config/topsun/customer/customerMapper.xml"
;
Map
<
String
,
Object
>
getCustomerRelatedList
(
CustomerRelatedQueryRequest
queryRequest
);
List
<
CustomerRelated
>
getCustomerRelatedList
(
String
customerId
);
CustomerRelatedVo
saveCustomerRelated
(
CustomerRelated
customerRelated
);
...
...
topsun/src/main/java/com/huigou/topsun/customer/application/Impl/CustomerApplicationImpl.java
View file @
c8d3ae01
package
com
.
huigou
.
topsun
.
customer
.
application
.
Impl
;
import
com.huigou.cache.DictUtil
;
import
com.huigou.data.query.model.QueryDescriptor
;
import
com.huigou.data.query.model.QueryModel
;
import
com.huigou.topsun.customer.application.CustomerApplication
;
import
com.huigou.topsun.customer.domain.CustomerContact
;
import
com.huigou.topsun.customer.domain.query.ContactQueryRequest
;
import
com.huigou.topsun.customer.domain.query.CustomerQueryRequest
;
import
com.huigou.topsun.customer.repository.CustomerRepository
;
import
com.huigou.topsun.customer.repository.Customer
Contact
Repository
;
import
com.huigou.uasp.bmp.common.application.BaseApplication
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -19,6 +20,8 @@ import java.util.Map;
@Service
public
class
CustomerApplicationImpl
extends
BaseApplication
implements
CustomerApplication
{
public
static
final
String
QUERY_XML_FILE_PATH
=
"config/topsun/customer/customerMapper.xml"
;
@Autowired
private
CustomerContactRepository
customerContactRepository
;
/**
...
...
@@ -44,4 +47,25 @@ public class CustomerApplicationImpl extends BaseApplication implements Customer
List
<
CustomerContact
>
customerContactList
=
this
.
sqlExecutorDao
.
queryToList
(
queryDescriptor
.
getSql
(),
CustomerContact
.
class
,
customerId
);
return
customerContactList
;
}
/**
* 根据单个id删除
* @param id
*/
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRES_NEW
)
public
void
deleteContactById
(
String
id
)
{
customerContactRepository
.
delete
(
id
);
}
/**
* 批量进行删除
* @param ids
*/
@Override
@Transactional
public
void
deleteContactByIds
(
List
<
String
>
ids
)
{
ids
.
forEach
(
this
::
deleteContactById
);
}
}
topsun/src/main/java/com/huigou/topsun/customer/application/Impl/CustomerRelatedApplicationImpl.java
View file @
c8d3ae01
...
...
@@ -23,16 +23,15 @@ import java.util.Map;
*/
@Service
public
class
CustomerRelatedApplicationImpl
extends
BaseApplication
implements
CustomerRelatedApplication
{
public
static
final
String
QUERY_XML_FILE_PATH
=
"config/topsun/customer/customerMapper.xml"
;
@Autowired
private
CustomerRelatedRepository
customerRelatedRepository
;
@Override
public
Map
<
String
,
Object
>
getCustomerRelatedList
(
CustomerRelatedQueryRequest
queryRequest
)
{
QueryDescriptor
queryDescriptor
=
this
.
sqlExecutorDao
.
getQuery
(
QUERY_XML_FILE_PATH
,
"customerRelated"
);
QueryModel
queryModel
=
this
.
sqlExecutorDao
.
getQueryModel
(
queryDescriptor
,
queryRequest
);
Map
<
String
,
Object
>
map
=
this
.
sqlExecutorDao
.
executeSlicedQuery
(
queryModel
);
return
map
;
public
List
<
CustomerRelated
>
getCustomerRelatedList
(
String
customerId
)
{
QueryDescriptor
queryDescriptor
=
this
.
sqlExecutorDao
.
getQuery
(
QUERY_XML_FILE_PATH
,
"customerRelated"
);
List
<
CustomerRelated
>
customerRelatedList
=
sqlExecutorDao
.
queryToList
(
queryDescriptor
.
getSql
(),
CustomerRelated
.
class
,
customerId
);
return
customerRelatedList
;
}
@Override
...
...
topsun/src/main/java/com/huigou/topsun/customer/controller/CustomerController.java
View file @
c8d3ae01
...
...
@@ -158,6 +158,29 @@ public class CustomerController extends CommonController {
return
customerBank
;
}
/**
* 根据id列表删除联系人
* @return
*/
public
String
deleteContact
()
{
SDO
sdo
=
getSDO
();
List
<
String
>
ids
=
sdo
.
getIds
();
customerApplication
.
deleteContactByIds
(
ids
);
return
success
();
}
/**
* 删除客户及其附属信息
* @return
*/
public
String
deleteCustomerAndAffiliatedInfoByCustomerId
()
{
SDO
sdo
=
getSDO
();
String
customerId
=
sdo
.
getString
(
"customerId"
);
//TODO
//多表联删
return
success
();
}
...
...
topsun/src/main/java/com/huigou/topsun/customer/controller/CustomerDebtContactController.java
View file @
c8d3ae01
...
...
@@ -51,7 +51,8 @@ public class CustomerDebtContactController extends CommonController {
SDO
sdo
=
this
.
getSDO
();
String
customerId
=
sdo
.
getString
(
"customerId"
);
String
customerEmailType
=
sdo
.
getString
(
"customerEmailType"
);
return
packGridDataAndResult
(
customerDebtContactApplication
.
getCustomerDebtContactList
(
customerId
,
customerEmailType
));
List
<
CustomerDebtContact
>
customerDebtContactList
=
customerDebtContactApplication
.
getCustomerDebtContactList
(
customerId
,
customerEmailType
);
return
packGridDataAndResult
(
customerDebtContactList
);
}
/**
...
...
topsun/src/main/java/com/huigou/topsun/customer/controller/CustomerRelatedController.java
View file @
c8d3ae01
...
...
@@ -47,9 +47,9 @@ public class CustomerRelatedController extends CommonController {
*/
public
String
slicedCustomerRelatedList
()
{
SDO
sdo
=
this
.
getSDO
();
CustomerRelatedQueryRequest
queryRequest
=
sdo
.
toQueryRequest
(
CustomerRelatedQueryRequest
.
class
);
return
toResult
(
customerRelatedApplication
.
getCustomerRelatedList
(
queryRequest
)
);
String
customerId
=
sdo
.
getString
(
"customerId"
);
List
<
CustomerRelated
>
customerRelatedList
=
customerRelatedApplication
.
getCustomerRelatedList
(
customerId
);
return
packGridDataAndResult
(
customerRelatedList
);
}
/**
...
...
topsun/src/main/resources/config/topsun/customer/customerMapper.xml
View file @
c8d3ae01
...
...
@@ -12,8 +12,8 @@
<sql-query>
select c.*
from customer_debt_contact c
where customer_
email_type
= ?
and customer_
id
= ?
where customer_
id
= ?
and customer_
email_type
= ?
</sql-query>
</query>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment