Commit c8d3ae01 authored by 全洪江's avatar 全洪江

客户模块前端页面调整,后端查询删除

Signed-off-by: 全洪江's avatarHongjiang <hongjiang.quan@topsunit.com>
parent b8d581c7
var gridManager = null; var contactGridManager = null;
var baosheEmailManage = null; var baosheEmailGridManager = null;
var customerEmailManage = null; var customerEmailGridManager = null;
var customerRelatedListGrid = null; var customerRelatedGridManager = null;
var customerPayInfoListGrid = null; var customerPayInfoGridManager = null;
$(document).ready(function () { $(document).ready(function () {
initializeTab(); initializeTab();
initializeUI(); initializeUI();
...@@ -29,38 +29,38 @@ function loadContactListGrid() { ...@@ -29,38 +29,38 @@ function loadContactListGrid() {
//增删改控件 //增删改控件
var toolbarOptions = UICtrl.getDefaultToolbarOptions({ var toolbarOptions = UICtrl.getDefaultToolbarOptions({
addHandler: function () { addHandler: function () {
addHandler(); addContactHandler();
},
updateHandler: function () {
updateHandler();
}, },
deleteHandler: function () { deleteHandler: function () {
deleteHandler(); deleteContactHandler();
} }
}); });
gridManager = UICtrl.grid("#contactListGrid", { contactGridManager = UICtrl.grid("#contactListGrid", {
columns: [ columns: [
{ {
display: "联系人名称", name: "contactName", width: 300, minWidth: 60, type: "string", align: "left", display: "联系人名称", name: "contactName", width: 300, minWidth: 60, type: "string", align: "left",
editor: { editor: {
required: true, type: "select", required: true, type: "text"
data: {
type: 'system',
name: "customerContactList",
back: {
customerContactId: "customerContactId",
customerId: "customerId",
contactName: "contactName",
contactPhone: "contactPhone",
contactFax: "contactFax",
contactMail: "contactMail"
}
},
} }
}, },
{display: "联系人电话", name: "contactPhone", width: 300, minWidth: 60, type: "string", align: "left"}, {
{display: "传真", name: "contactFax", width: 300, minWidth: 60, type: "string", align: "left"}, display: "联系人电话", name: "contactPhone", width: 300, minWidth: 60, type: "string", align: "left",
{display: "邮箱", name: "contactMail", 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", dataAction: "server",
url: web_app.name + '/customer/slicedContactList.ajax', url: web_app.name + '/customer/slicedContactList.ajax',
...@@ -69,58 +69,89 @@ function loadContactListGrid() { ...@@ -69,58 +69,89 @@ function loadContactListGrid() {
usePager: true, usePager: true,
toolbar: toolbarOptions, toolbar: toolbarOptions,
width: "100%", width: "100%",
height: "60%", height: "40%",
enabledEdit: true,
heightDiff: -8, heightDiff: -8,
checkbox: true, checkbox: true,
fixedCellHeight: true, fixedCellHeight: true,
selectRowButtonOnly: 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() { function loadBaoshenEmailListGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions( var toolbarOptions = UICtrl.getDefaultToolbarOptions(
{ {
addHandler: function () { addHandler: function () {
// addHandlerBaoshenEmail(); UICtrl.addGridRow(baosheEmailGridManager);
},
updateHandler: function () {
// updateHandlerBaoshenEmail();
}, },
deleteHandler: function () { deleteHandler: function () {
// updateHandlerBaoshenEmail(); var _grid = UICtrl.getGridManager('#baoshenEmailListGrid');
DataUtil.delSelectedRows(
{
action: 'customer/deleteBaoshenEmail.ajax',
param: {},
gridManager: _grid,
idFieldName: 'customerDebtContactId',
onSuccess: function () {
baosheEmailGridManager.loadData();
}
}
)
} }
} }
); );
baosheEmailManage = UICtrl.grid("#baoshenEmailListGrid", { baosheEmailGridManager = UICtrl.grid("#baoshenEmailListGrid", {
columns: [ columns: [
{ {
display: "邮箱地址", name: "customerEmail", width: 300, minWidth: 60, type: "string", align: "left", display: "邮箱地址", name: "customerEmail", width: 300, minWidth: 60, type: "string", align: "left",
editor: { editor: {
required: true, type: "select", required: true, type: "text"
data: { },
type: 'system',
name: "baoshenEmailList", },
back: { {
customerDebtContactId: "customerDebtContactId", display: "联系人", name: "customerContact", width: 300, minWidth: 60, type: "string", align: "left",
customerId: "customerId", editor: {
customerEmail: "customerEmail", required: true, type: "text"
customerContact: "customerContact", },
sendEmail: "sendEmail", },
customerMailType: "customerEmailType", {
createById: "createById", display: "开启邮件发送", name: "sendEmail", width: 300, minWidth: 60, type: "string", align: "left",
createdByName: "createdByName", editor: {
createdDate: "createdDate" 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", dataAction: "server",
url: web_app.name + '/customerDebtContact/slicedCustomerDebtContactList.ajax', url: web_app.name + '/customerDebtContact/slicedCustomerDebtContactList.ajax',
...@@ -130,6 +161,7 @@ function loadBaoshenEmailListGrid() { ...@@ -130,6 +161,7 @@ function loadBaoshenEmailListGrid() {
toolbar: toolbarOptions, toolbar: toolbarOptions,
width: "100%", width: "100%",
height: "60%", height: "60%",
enabledEdit: true,
heightDiff: -8, heightDiff: -8,
checkbox: true, checkbox: true,
fixedCellHeight: true, fixedCellHeight: true,
...@@ -141,42 +173,50 @@ function loadCustomerEmailListGrid() { ...@@ -141,42 +173,50 @@ function loadCustomerEmailListGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions( var toolbarOptions = UICtrl.getDefaultToolbarOptions(
{ {
addHandler: function () { addHandler: function () {
// addHandlerCustomerEmail(); UICtrl.addGridRow(customerEmailGridManager);
},
updateHandler: function () {
// updateHandlerCustomerEmail();
}, },
deleteHandler: function () { deleteHandler: function () {
// updateHandlerCustomerEmail(); var _grid = UICtrl.getGridManager('#customerEmailListGrid');
DataUtil.delSelectedRows(
{
action: 'customer/deleteCustomerEmail.ajax',
param: {},
gridManager: _grid,
idFieldName: 'customerDebtContactId',
onSuccess: function () {
customerEmailGridManager.loadData();
}
}
)
} }
} }
); );
customerEmailManage = UICtrl.grid("#customerEmailListGrid", { customerEmailGridManager = UICtrl.grid("#customerEmailListGrid", {
columns: [ columns: [
{ {
display: "邮箱地址", name: "customerEmail", width: 300, minWidth: 60, type: "string", align: "left", display: "邮箱地址", name: "customerEmail", width: 300, minWidth: 60, type: "string", align: "left",
editor: { editor: {
required: true, type: "select", required: true, type: "text",
data: { }
type: 'system', },
name: "customerEmailList", {
back: { display: "联系人", name: "customerContact", width: 300, minWidth: 60, type: "string", align: "left",
customerDebtContactId: "customerDebtContactId", editor: {
customerId: "customerId", required: true, type: "text",
customerEmail: "customerEmail", }
customerContact: "customerContact", },
sendEmail: "sendEmail", {
customerMailType: "customerEmailType", display: "开启邮件发送", name: "sendEmail", width: 300, minWidth: 60, type: "string", align: "left",
createById: "createById", editor: {
createdByName: "createdByName", required: true, type: "text",
createdDate: "createdDate"
}
},
} }
}, },
{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", dataAction: "server",
url: web_app.name + '/customerDebtContact/slicedCustomerDebtContactList.ajax', url: web_app.name + '/customerDebtContact/slicedCustomerDebtContactList.ajax',
...@@ -186,6 +226,7 @@ function loadCustomerEmailListGrid() { ...@@ -186,6 +226,7 @@ function loadCustomerEmailListGrid() {
toolbar: toolbarOptions, toolbar: toolbarOptions,
width: "100%", width: "100%",
height: "60%", height: "60%",
enabledEdit: true,
heightDiff: -8, heightDiff: -8,
checkbox: true, checkbox: true,
fixedCellHeight: true, fixedCellHeight: true,
...@@ -197,17 +238,25 @@ function loadCustomerRelatedListGrid() { ...@@ -197,17 +238,25 @@ function loadCustomerRelatedListGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions( var toolbarOptions = UICtrl.getDefaultToolbarOptions(
{ {
addHandler: function () { addHandler: function () {
// addCustomerRelatedEmail(); UICtrl.addGridRow(customerRelatedGridManager);
},
updateHandler: function () {
// updateCustomerRelatedEmail();
}, },
deleteHandler: function () { deleteHandler: function () {
// updateCustomerRelatedEmail(); var _grid = UICtrl.getGridManager('#customerRelatedListGrid');
DataUtil.delSelectedRows(
{
action: 'customer/deleteCustomerRelated.ajax',
param: {},
gridManager: _grid,
idFieldName: 'customerRelatedId',
onSuccess: function () {
customerRelatedGridManager.loadData();
}
}
)
} }
} }
); );
customerRelatedListGrid = UICtrl.grid("#customerRelatedListGrid", { customerRelatedGridManager = UICtrl.grid("#customerRelatedListGrid", {
columns: [ columns: [
{ {
display: "关联客户编码", display: "关联客户编码",
...@@ -217,20 +266,7 @@ function loadCustomerRelatedListGrid() { ...@@ -217,20 +266,7 @@ function loadCustomerRelatedListGrid() {
type: "string", type: "string",
align: "left", align: "left",
editor: { editor: {
required: true, type: "select", required: true, type: "text"
data: {
type: 'system',
name: "customerRelatedList",
back: {
customerRelatedId: "customerRelatedId",
customerId: "customerId",
customerCodeRelated: "customerCodeRelated",
customerShortNameRelated: "customerShortNameRelated",
customerNameRelated: "customerNameRelated",
createdByName: "createdByName",
createdDate: "createdDate"
}
},
} }
}, },
{ {
...@@ -239,7 +275,10 @@ function loadCustomerRelatedListGrid() { ...@@ -239,7 +275,10 @@ function loadCustomerRelatedListGrid() {
width: 200, width: 200,
minWidth: 60, minWidth: 60,
type: "string", type: "string",
align: "left" align: "left",
editor: {
required: true, type: "text"
}
}, },
{ {
display: "关联客户全称", display: "关联客户全称",
...@@ -247,27 +286,38 @@ function loadCustomerRelatedListGrid() { ...@@ -247,27 +286,38 @@ function loadCustomerRelatedListGrid() {
width: 200, width: 200,
minWidth: 60, minWidth: 60,
type: "string", 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", dataAction: "server",
url: web_app.name + '/customer/slicedContactList.ajax', url: web_app.name + '/customerRelated/slicedCustomerRelatedList.ajax',
parms: {customerId: $("#customerId").val()}, parms: {customerId: $("#customerId").val()},
pageSize: 10, pageSize: 10,
usePager: true, usePager: true,
toolbar: toolbarOptions, toolbar: toolbarOptions,
width: "100%", width: "100%",
height: "40%", height: "40%",
enabledEdit: true,
heightDiff: -8, heightDiff: -8,
checkbox: true, checkbox: true,
fixedCellHeight: true, fixedCellHeight: true,
selectRowButtonOnly: true, selectRowButtonOnly: true
onDblClickRow: function (data, rowindex, rowobj) {
updateHandler(data);
}
}); });
} }
...@@ -275,17 +325,25 @@ function loadCustomerPayInfoListGrid() { ...@@ -275,17 +325,25 @@ function loadCustomerPayInfoListGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions( var toolbarOptions = UICtrl.getDefaultToolbarOptions(
{ {
addHandler: function () { addHandler: function () {
// addCustomerPayInfo(); UICtrl.addGridRow(customerPayInfoGridManager);
},
updateHandler: function () {
// updateCustomerPayInfo();
}, },
deleteHandler: function () { deleteHandler: function () {
// updateCustomerPayInfo(); var _grid = UICtrl.getGridManager('#customerPayInfoListGrid');
DataUtil.delSelectedRows(
{
action: 'customer/deleteCustomerPayInfo.ajax',
param: {},
gridManager: _grid,
idFieldName: 'customerPayInfoId',
onSuccess: function () {
customerPayInfoGridManager.loadData();
}
}
)
} }
} }
); );
customerPayInfoListGrid = UICtrl.grid("#customerPayInfoListGrid", { customerPayInfoGridManager = UICtrl.grid("#customerPayInfoListGrid", {
columns: [ columns: [
{ {
display: "支付方户名", display: "支付方户名",
...@@ -295,28 +353,33 @@ function loadCustomerPayInfoListGrid() { ...@@ -295,28 +353,33 @@ function loadCustomerPayInfoListGrid() {
type: "string", type: "string",
align: "left", align: "left",
editor: { editor: {
required: true, type: "select", required: true, type: "text",
data: { }
type: 'system', },
name: "customerContactList", {
back: { display: "录入人", name: "createdByName", width: 200, minWidth: 60, type: "string", align: "left",
customerPayInfoId: "customerPayInfoId", editor: {
customerId: "customerId", required: true, type: "text",
customerPayAccountName: "customerPayAccountName", }
createdByName: "createdByName", },
createdById: "createdById", {
createdDate: "createdDate", display: "录入时间", name: "createdDate", width: 200, minWidth: 60, type: "date", align: "left",
lastModifiedById: "lastModifiedById", editor: {
lastModifiedByName: "lastModifiedByName", required: true, type: "text",
lastModifiedDate: "lastModifiedDate"
}
},
} }
}, },
{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: "lastModifiedByName", width: 200, minWidth: 60, type: "string", align: "left"}, editor: {
{display: "修改时间", name: "lastModifiedDate", width: 200, minWidth: 60, type: "date", align: "left"} required: true, type: "text",
}
},
{
display: "修改时间", name: "lastModifiedDate", width: 200, minWidth: 60, type: "date", align: "left",
editor: {
required: true, type: "text",
}
}
], ],
dataAction: "server", dataAction: "server",
url: web_app.name + '/customer/slicedContactList.ajax', url: web_app.name + '/customer/slicedContactList.ajax',
...@@ -326,20 +389,18 @@ function loadCustomerPayInfoListGrid() { ...@@ -326,20 +389,18 @@ function loadCustomerPayInfoListGrid() {
toolbar: toolbarOptions, toolbar: toolbarOptions,
width: "100%", width: "100%",
height: "40%", height: "40%",
enabledEdit: true,
heightDiff: -8, heightDiff: -8,
checkbox: true, checkbox: true,
fixedCellHeight: true, fixedCellHeight: true,
selectRowButtonOnly: true, selectRowButtonOnly: true
onDblClickRow: function (data, rowindex, rowobj) {
updateHandler(data);
}
}); });
} }
function bindEvent() { function bindEvent() {
$("#save").click(function () { $("#save").click(function () {//保存整体保存
saveData("save"); saveData();
}) })
$("#close").click(function () {//关闭 $("#close").click(function () {//关闭
...@@ -349,7 +410,7 @@ function bindEvent() { ...@@ -349,7 +410,7 @@ function bindEvent() {
//右上角的保存控件 //右上角的保存控件
function saveData() { function saveData() {
// var contactList
} }
function closeDispatchTabItem() { function closeDispatchTabItem() {
......
...@@ -17,9 +17,7 @@ function loadCustomerInfoListGrid() { ...@@ -17,9 +17,7 @@ function loadCustomerInfoListGrid() {
updateHandler: function () { updateHandler: function () {
updateHandler(); updateHandler();
}, },
deleteHandler: function () { deleteHandler: deleteHandler,
updateHandler();
}
}); });
gridManager = UICtrl.grid("#customerInfoListGrid", { gridManager = UICtrl.grid("#customerInfoListGrid", {
columns: [ columns: [
...@@ -77,7 +75,7 @@ function addHandler() { ...@@ -77,7 +75,7 @@ function addHandler() {
//删除按钮 //删除按钮
function deleteHandler() { function deleteHandler() {
DataUtil.del({ DataUtil.del({
action: 'customer/deleteCustomer.ajax', action: 'customer/deleteCustomerAndAffiliatedInfoByCustomerId.ajax',
gridManager: gridManager, idFieldName: 'customerId', gridManager: gridManager, idFieldName: 'customerId',
onSuccess: function () { onSuccess: function () {
reloadGrid(); reloadGrid();
......
...@@ -14,17 +14,7 @@ public interface CustomerApplication { ...@@ -14,17 +14,7 @@ public interface CustomerApplication {
Map<String, Object> findCustomerByPage(CustomerQueryRequest customerQueryRequest); Map<String, Object> findCustomerByPage(CustomerQueryRequest customerQueryRequest);
List<CustomerContact> findContactByPage(String customerId); List<CustomerContact> findContactByPage(String customerId);
void deleteContactById(String id);
void deleteContactByIds(List<String> ids);
} }
package com.huigou.topsun.customer.application; 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.CustomerRelated;
import com.huigou.topsun.customer.domain.query.CustomerRelatedQueryRequest; import com.huigou.topsun.customer.domain.query.CustomerRelatedQueryRequest;
import com.huigou.topsun.customer.domain.vo.CustomerRelatedVo; import com.huigou.topsun.customer.domain.vo.CustomerRelatedVo;
...@@ -14,9 +15,9 @@ import java.util.Map; ...@@ -14,9 +15,9 @@ import java.util.Map;
* description: * description:
*/ */
public interface CustomerRelatedApplication { 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); CustomerRelatedVo saveCustomerRelated(CustomerRelated customerRelated);
......
package com.huigou.topsun.customer.application.Impl; 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.QueryDescriptor;
import com.huigou.data.query.model.QueryModel; import com.huigou.data.query.model.QueryModel;
import com.huigou.topsun.customer.application.CustomerApplication; import com.huigou.topsun.customer.application.CustomerApplication;
import com.huigou.topsun.customer.domain.CustomerContact; 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.domain.query.CustomerQueryRequest;
import com.huigou.topsun.customer.repository.CustomerRepository; import com.huigou.topsun.customer.repository.CustomerContactRepository;
import com.huigou.uasp.bmp.common.application.BaseApplication; import com.huigou.uasp.bmp.common.application.BaseApplication;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -19,6 +20,8 @@ import java.util.Map; ...@@ -19,6 +20,8 @@ import java.util.Map;
@Service @Service
public class CustomerApplicationImpl extends BaseApplication implements CustomerApplication { public class CustomerApplicationImpl extends BaseApplication implements CustomerApplication {
public static final String QUERY_XML_FILE_PATH = "config/topsun/customer/customerMapper.xml"; 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 ...@@ -44,4 +47,25 @@ public class CustomerApplicationImpl extends BaseApplication implements Customer
List<CustomerContact> customerContactList = this.sqlExecutorDao.queryToList(queryDescriptor.getSql(), CustomerContact.class, customerId); List<CustomerContact> customerContactList = this.sqlExecutorDao.queryToList(queryDescriptor.getSql(), CustomerContact.class, customerId);
return customerContactList; 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);
}
} }
...@@ -23,16 +23,15 @@ import java.util.Map; ...@@ -23,16 +23,15 @@ import java.util.Map;
*/ */
@Service @Service
public class CustomerRelatedApplicationImpl extends BaseApplication implements CustomerRelatedApplication { public class CustomerRelatedApplicationImpl extends BaseApplication implements CustomerRelatedApplication {
public static final String QUERY_XML_FILE_PATH = "config/topsun/customer/customerMapper.xml";
@Autowired @Autowired
private CustomerRelatedRepository customerRelatedRepository; private CustomerRelatedRepository customerRelatedRepository;
@Override @Override
public Map<String, Object> getCustomerRelatedList(CustomerRelatedQueryRequest queryRequest) { public List<CustomerRelated> getCustomerRelatedList(String customerId) {
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "customerRelated"); QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH,"customerRelated");
QueryModel queryModel = this.sqlExecutorDao.getQueryModel(queryDescriptor, queryRequest); List<CustomerRelated> customerRelatedList = sqlExecutorDao.queryToList(queryDescriptor.getSql(), CustomerRelated.class, customerId);
Map<String, Object> map = this.sqlExecutorDao.executeSlicedQuery(queryModel); return customerRelatedList;
return map;
} }
@Override @Override
......
...@@ -158,6 +158,29 @@ public class CustomerController extends CommonController { ...@@ -158,6 +158,29 @@ public class CustomerController extends CommonController {
return customerBank; 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();
}
......
...@@ -51,7 +51,8 @@ public class CustomerDebtContactController extends CommonController { ...@@ -51,7 +51,8 @@ public class CustomerDebtContactController extends CommonController {
SDO sdo = this.getSDO(); SDO sdo = this.getSDO();
String customerId = sdo.getString("customerId"); String customerId = sdo.getString("customerId");
String customerEmailType = sdo.getString("customerEmailType"); String customerEmailType = sdo.getString("customerEmailType");
return packGridDataAndResult(customerDebtContactApplication.getCustomerDebtContactList(customerId,customerEmailType)); List<CustomerDebtContact> customerDebtContactList = customerDebtContactApplication.getCustomerDebtContactList(customerId, customerEmailType);
return packGridDataAndResult(customerDebtContactList);
} }
/** /**
......
...@@ -47,9 +47,9 @@ public class CustomerRelatedController extends CommonController { ...@@ -47,9 +47,9 @@ public class CustomerRelatedController extends CommonController {
*/ */
public String slicedCustomerRelatedList() { public String slicedCustomerRelatedList() {
SDO sdo = this.getSDO(); SDO sdo = this.getSDO();
CustomerRelatedQueryRequest queryRequest = sdo.toQueryRequest(CustomerRelatedQueryRequest.class); String customerId = sdo.getString("customerId");
List<CustomerRelated> customerRelatedList = customerRelatedApplication.getCustomerRelatedList(customerId);
return toResult(customerRelatedApplication.getCustomerRelatedList(queryRequest)); return packGridDataAndResult(customerRelatedList);
} }
/** /**
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
<sql-query> <sql-query>
select c.* select c.*
from customer_debt_contact c from customer_debt_contact c
where customer_email_type = ? where customer_id = ?
and customer_id = ? and customer_email_type = ?
</sql-query> </sql-query>
</query> </query>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment