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
5c44f576
Commit
5c44f576
authored
Dec 27, 2023
by
全洪江
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
客户查询接口
Signed-off-by:
Hongjiang
<
hongjiang.quan@topsunit.com
>
parent
fa643a23
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
298 additions
and
14 deletions
+298
-14
CustomerApplication.java
...igou/topsun/customer/application/CustomerApplication.java
+8
-5
CustomerOrderApplication.java
...topsun/customer/application/CustomerOrderApplication.java
+7
-0
CustomerApplicationImpl.java
...un/customer/application/Impl/CustomerApplicationImpl.java
+59
-2
CustomerBaseInfoApplicationImpl.java
...mer/application/Impl/CustomerBaseInfoApplicationImpl.java
+1
-1
CustomerOrderApplicationImpl.java
...stomer/application/Impl/CustomerOrderApplicationImpl.java
+21
-0
CustomerController.java
...huigou/topsun/customer/controller/CustomerController.java
+25
-1
CustomerOrderQueryRequest.java
...psun/customer/domain/query/CustomerOrderQueryRequest.java
+7
-0
CustomerContactVo.java
...m/huigou/topsun/customer/domain/vo/CustomerContactVo.java
+25
-0
CustomerListVo.java
.../com/huigou/topsun/customer/domain/vo/CustomerListVo.java
+66
-0
CustomerVo.java
...java/com/huigou/topsun/customer/domain/vo/CustomerVo.java
+4
-4
ReturnCustomerListVo.java
...uigou/topsun/customer/domain/vo/ReturnCustomerListVo.java
+61
-0
CustomerOrderRepository.java
...u/topsun/customer/repository/CustomerOrderRepository.java
+3
-1
customerMapper.xml
.../main/resources/config/topsun/customer/customerMapper.xml
+11
-0
No files found.
topsun/src/main/java/com/huigou/topsun/customer/application/CustomerApplication.java
View file @
5c44f576
package
com
.
huigou
.
topsun
.
customer
.
application
;
import
com.huigou.topsun.customer.domain.CustomerContact
;
import
com.huigou.topsun.customer.domain.CustomerDebtContact
;
import
com.huigou.topsun.customer.domain.CustomerPayInfo
;
import
com.huigou.topsun.customer.domain.CustomerRelated
;
import
com.huigou.topsun.customer.domain.query.ContactQueryRequest
;
import
com.huigou.topsun.customer.domain.*
;
import
com.huigou.topsun.customer.domain.query.CustomerQueryRequest
;
import
com.huigou.topsun.customer.domain.vo.CustomerListVo
;
import
com.huigou.topsun.customer.domain.vo.CustomerVo
;
import
com.huigou.topsun.customer.domain.vo.ReturnCustomerListVo
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -25,4 +23,9 @@ public interface CustomerApplication {
CustomerVo
saveCustomer
(
CustomerVo
customerVo
,
List
<
CustomerContact
>
customerContactList
,
List
<
CustomerDebtContact
>
baoshenEmailList
,
List
<
CustomerDebtContact
>
customerEmailList
,
List
<
CustomerRelated
>
customerRelatedList
,
List
<
CustomerPayInfo
>
customerPayInfoList
);
void
deleteCustomerAndAffiliatedInfoByCustomerId
(
List
<
String
>
customerIds
);
List
<
CustomerListVo
>
getCustomerList
();
List
<
ReturnCustomerListVo
>
getReturnCustomerListVoList
(
List
<
CustomerListVo
>
customerListVoList
);
}
topsun/src/main/java/com/huigou/topsun/customer/application/CustomerOrderApplication.java
0 → 100644
View file @
5c44f576
package
com
.
huigou
.
topsun
.
customer
.
application
;
import
com.huigou.topsun.customer.domain.CustomerOrder
;
public
interface
CustomerOrderApplication
{
CustomerOrder
getCustomerOrderByCustomerId
(
String
customerId
);
}
topsun/src/main/java/com/huigou/topsun/customer/application/Impl/CustomerApplicationImpl.java
View file @
5c44f576
package
com
.
huigou
.
topsun
.
customer
.
application
.
Impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.huigou.data.query.model.QueryDescriptor
;
import
com.huigou.data.query.model.QueryModel
;
import
com.huigou.topsun.customer.application.*
;
import
com.huigou.topsun.customer.domain.*
;
import
com.huigou.topsun.customer.domain.query.CustomerQueryRequest
;
import
com.huigou.topsun.customer.domain.vo.CustomerContactVo
;
import
com.huigou.topsun.customer.domain.vo.CustomerListVo
;
import
com.huigou.topsun.customer.domain.vo.CustomerVo
;
import
com.huigou.topsun.customer.domain.vo.ReturnCustomerListVo
;
import
com.huigou.topsun.customer.repository.*
;
import
com.huigou.uasp.bmp.common.application.BaseApplication
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -16,8 +20,11 @@ import org.springframework.transaction.annotation.Propagation;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
@Service
...
...
@@ -129,12 +136,12 @@ public class CustomerApplicationImpl extends BaseApplication implements Customer
// customerDebtContact.setCustomerEmailType("1");
// CustomerDebtContactRepository.saveAndFlush(customerDebtContact);
// }
customerEmailList
.
forEach
(
customerDebtContact
->{
customerEmailList
.
forEach
(
customerDebtContact
->
{
customerDebtContact
.
setCustomerId
(
customerId
);
customerDebtContact
.
setCustomerEmailType
(
"1"
);
CustomerDebtContactRepository
.
saveAndFlush
(
customerDebtContact
);
});
baoshenEmailList
.
forEach
(
customerDebtContact
->{
baoshenEmailList
.
forEach
(
customerDebtContact
->
{
customerDebtContact
.
setCustomerId
(
customerId
);
customerDebtContact
.
setCustomerEmailType
(
"0"
);
CustomerDebtContactRepository
.
saveAndFlush
(
customerDebtContact
);
...
...
@@ -169,6 +176,56 @@ public class CustomerApplicationImpl extends BaseApplication implements Customer
}
@Override
public
List
<
CustomerListVo
>
getCustomerList
()
{
QueryDescriptor
queryDescriptor
=
this
.
sqlExecutorDao
.
getQuery
(
QUERY_XML_FILE_PATH
,
"getCustomerList"
);
List
<
CustomerListVo
>
customerListVoList
=
this
.
sqlExecutorDao
.
queryToList
(
queryDescriptor
.
getSql
(),
CustomerListVo
.
class
);
return
customerListVoList
;
}
@Override
public
List
<
ReturnCustomerListVo
>
getReturnCustomerListVoList
(
List
<
CustomerListVo
>
customerListVoList
)
{
List
<
ReturnCustomerListVo
>
returnCustomerListVoList
=
new
ArrayList
<>();
List
<
String
>
customerIdList
=
new
ArrayList
<>();
for
(
CustomerListVo
customerListVo
:
customerListVoList
)
{
if
(!
BeanUtil
.
isEmpty
(
customerListVo
))
{
String
customerId
=
customerListVo
.
getCustomerId
();
customerIdList
.
add
(
customerId
);
}
}
List
<
String
>
idList
=
customerIdList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
for
(
String
s
:
idList
)
{
ReturnCustomerListVo
returnCustomerListVo
=
new
ReturnCustomerListVo
();
List
<
CustomerContactVo
>
customerContactVoList
=
new
ArrayList
<>();
for
(
CustomerListVo
customerListVo
:
customerListVoList
)
{
if
(!
BeanUtil
.
isEmpty
(
customerListVo
))
{
if
(
s
.
equals
(
customerListVo
.
getCustomerId
()))
{
CustomerContactVo
customerContactVo
=
new
CustomerContactVo
();
BeanUtil
.
copyProperties
(
customerListVo
,
customerContactVo
);
customerContactVoList
.
add
(
customerContactVo
);
returnCustomerListVo
.
setCustomerContactVoList
(
customerContactVoList
);
// BeanUtil.copyProperties(returnCustomerListVo,customerContactVo);
String
provinceCode
=
customerListVo
.
getProvinceCode
();
List
<
Province
>
provinceList
=
customerBaseInfoApplication
.
findByProvinceCode
(
provinceCode
);
StringBuffer
provinceInfoList
=
new
StringBuffer
();
for
(
Province
province
:
provinceList
)
{
provinceInfoList
.
append
(
province
.
getProvinceName
());
}
String
provinceInfo
=
provinceInfoList
.
toString
();
BeanUtils
.
copyProperties
(
customerListVo
,
returnCustomerListVo
);
returnCustomerListVo
.
setBelongArea
(
provinceInfo
);
}
}
}
returnCustomerListVoList
.
add
(
returnCustomerListVo
);
}
return
returnCustomerListVoList
;
}
public
Customer
getCustomer
(
CustomerVo
customerVo
)
{
Customer
customer
=
new
Customer
();
BeanUtils
.
copyProperties
(
customerVo
,
customer
);
...
...
topsun/src/main/java/com/huigou/topsun/customer/application/Impl/CustomerBaseInfoApplicationImpl.java
View file @
5c44f576
...
...
@@ -90,7 +90,7 @@ public class CustomerBaseInfoApplicationImpl extends BaseApplication implements
@Override
public
CustomerOrder
findCustomerOrderByCustomerId
(
String
customerId
)
{
CustomerOrder
customerOrder
=
customerOrderRepository
.
findCustomer
Bank
ByCustomerId
(
customerId
);
CustomerOrder
customerOrder
=
customerOrderRepository
.
findCustomer
Order
ByCustomerId
(
customerId
);
return
customerOrder
;
}
...
...
topsun/src/main/java/com/huigou/topsun/customer/application/Impl/CustomerOrderApplicationImpl.java
0 → 100644
View file @
5c44f576
package
com
.
huigou
.
topsun
.
customer
.
application
.
Impl
;
import
com.huigou.topsun.customer.application.CustomerOrderApplication
;
import
com.huigou.topsun.customer.domain.CustomerOrder
;
import
com.huigou.topsun.customer.repository.CustomerOrderRepository
;
import
com.huigou.uasp.bmp.common.application.BaseApplication
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
@Service
public
class
CustomerOrderApplicationImpl
extends
BaseApplication
implements
CustomerOrderApplication
{
@Autowired
private
CustomerOrderRepository
customerOrderRepository
;
@Override
public
CustomerOrder
getCustomerOrderByCustomerId
(
String
customerId
)
{
CustomerOrder
customerOrder
=
customerOrderRepository
.
findCustomerOrderByCustomerId
(
customerId
);
return
customerOrder
;
}
}
topsun/src/main/java/com/huigou/topsun/customer/controller/CustomerController.java
View file @
5c44f576
package
com
.
huigou
.
topsun
.
customer
.
controller
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.huigou.topsun.customer.application.CustomerBaseInfoApplication
;
import
com.huigou.topsun.customer.application.CustomerApplication
;
import
com.huigou.topsun.customer.application.CustomerOrderApplication
;
import
com.huigou.topsun.customer.domain.*
;
import
com.huigou.topsun.customer.domain.query.CustomerQueryRequest
;
import
com.huigou.topsun.customer.domain.vo.CustomerListVo
;
import
com.huigou.topsun.customer.domain.vo.CustomerVo
;
import
com.huigou.topsun.customer.domain.vo.ReturnCustomerListVo
;
import
com.huigou.uasp.annotation.ControllerMapping
;
import
com.huigou.uasp.annotation.SkipAuth
;
import
com.huigou.uasp.client.CommonController
;
import
com.huigou.util.SDO
;
import
org.apache.commons.lang.StringUtils
;
...
...
@@ -27,12 +32,31 @@ public class CustomerController extends CommonController {
private
CustomerBaseInfoApplication
customerBaseInfoApplication
;
@Autowired
private
CustomerApplication
customerApplication
;
@Autowired
private
CustomerOrderApplication
customerOrderApplication
;
@Override
protected
String
getPagePath
()
{
return
"/biz/topsun/customer/"
;
}
@SkipAuth
public
String
getCustomerList
()
{
List
<
CustomerListVo
>
customerListVoList
=
customerApplication
.
getCustomerList
();
List
<
ReturnCustomerListVo
>
returnCustomerListVoList
=
customerApplication
.
getReturnCustomerListVoList
(
customerListVoList
);
Map
<
String
,
Object
>
returnCustomerListVoMap
=
new
HashMap
<>();
returnCustomerListVoMap
.
put
(
"customerList"
,
returnCustomerListVoList
);
return
toResult
(
returnCustomerListVoMap
);
}
/**
* 转跳到客户信息列表页面
*
...
...
@@ -96,7 +120,6 @@ public class CustomerController extends CommonController {
}
/**
* 保存客户信息(多表保存,添加事务)
*
...
...
@@ -162,6 +185,7 @@ public class CustomerController extends CommonController {
/**
* 加载订单信息
*
* @return
*/
public
CustomerOrder
loadCustomerOrder
()
{
...
...
topsun/src/main/java/com/huigou/topsun/customer/domain/query/CustomerOrderQueryRequest.java
0 → 100644
View file @
5c44f576
package
com
.
huigou
.
topsun
.
customer
.
domain
.
query
;
import
com.huigou.data.domain.query.QueryAbstractRequest
;
public
class
CustomerOrderQueryRequest
extends
QueryAbstractRequest
{
}
topsun/src/main/java/com/huigou/topsun/customer/domain/vo/CustomerContactVo.java
0 → 100644
View file @
5c44f576
package
com
.
huigou
.
topsun
.
customer
.
domain
.
vo
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
CustomerContactVo
implements
Serializable
{
/**
* 联系人
*/
private
String
contactName
;
/**
* 电话号码 contactPhone
*/
private
String
contactPhone
;
/**
* 传真 contactFax
*/
private
String
contactFax
;
/**
* email contactEmail
*/
private
String
contactEmail
;
}
topsun/src/main/java/com/huigou/topsun/customer/domain/vo/CustomerListVo.java
0 → 100644
View file @
5c44f576
package
com
.
huigou
.
topsun
.
customer
.
domain
.
vo
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
CustomerListVo
implements
Serializable
{
/**
* 客户id
*/
private
String
customerId
;
/**
* 客户全称
*/
private
String
customerName
;
/**
* 地区编码
*/
private
String
provinceCode
;
/**
* 报价币别 quotationCurrency
*/
private
String
quotationCurrency
;
/**
* 结算方式 monthlySettlementMethod
*/
private
String
monthlySettlementMethod
;
/**
* 订单性质 orderKind
*/
private
String
orderKind
;
/**
* 联系人
*/
private
String
contactName
;
/**
* 电话号码 contactPhone
*/
private
String
contactPhone
;
/**
* 传真 contactFax
*/
private
String
contactFax
;
/**
* email contactEmail
*/
private
String
contactEmail
;
/**
* 备注 remark
*/
private
String
remark
;
}
topsun/src/main/java/com/huigou/topsun/customer/domain/vo/CustomerVo.java
View file @
5c44f576
...
...
@@ -281,11 +281,11 @@ public class CustomerVo implements Serializable {
return
customerId
;
}
public
static
CustomerVo
getCustomerVo
(
Customer
Vo
customerVo
){
return
JSON
.
parseObject
(
JSON
.
toJSONString
(
customer
Vo
),
CustomerVo
.
class
);
public
static
CustomerVo
getCustomerVo
(
Customer
customer
){
return
JSON
.
parseObject
(
JSON
.
toJSONString
(
customer
),
CustomerVo
.
class
);
}
public
static
Customer
getCustomer
(
Customer
customer
){
return
JSON
.
parseObject
(
JSON
.
toJSONString
(
customer
),
Customer
.
class
);
public
static
Customer
getCustomer
(
Customer
Vo
customerVo
){
return
JSON
.
parseObject
(
JSON
.
toJSONString
(
customer
Vo
),
Customer
.
class
);
}
}
topsun/src/main/java/com/huigou/topsun/customer/domain/vo/ReturnCustomerListVo.java
0 → 100644
View file @
5c44f576
package
com
.
huigou
.
topsun
.
customer
.
domain
.
vo
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
@Data
public
class
ReturnCustomerListVo
implements
Serializable
{
/**
* 客户全称
*/
private
String
customerName
;
/**
* 所属地区 belongArea
*/
private
String
belongArea
;
/**
* 报价币别 quotationCurrency
*/
private
String
quotationCurrency
;
/**
* 结算方式 monthlySettlementMethod
*/
private
String
monthlySettlementMethod
;
/**
* 订单性质 orderKind
*/
private
String
orderKind
;
// /**
// * 联系人
// */
// private String contactName;
// /**
// * 电话号码 contactPhone
// */
// private String contactPhone;
//
// /**
// * 传真 contactFax
// */
// private String contactFax;
// /**
// * email contactEmail
// */
// private String contactEmail;
/**
* 联系人列表
*/
private
List
<
CustomerContactVo
>
customerContactVoList
;
/**
* 备注 remark
*/
private
String
remark
;
}
topsun/src/main/java/com/huigou/topsun/customer/repository/CustomerOrderRepository.java
View file @
5c44f576
...
...
@@ -4,5 +4,7 @@ import com.huigou.topsun.customer.domain.CustomerOrder;
import
org.springframework.data.jpa.repository.JpaRepository
;
public
interface
CustomerOrderRepository
extends
JpaRepository
<
CustomerOrder
,
String
>
{
CustomerOrder
findCustomerBankByCustomerId
(
String
customerId
);
CustomerOrder
findCustomerOrderByCustomerId
(
String
customerId
);
}
topsun/src/main/resources/config/topsun/customer/customerMapper.xml
View file @
5c44f576
...
...
@@ -16,6 +16,17 @@
<condition
column=
"customer_name"
name=
"customerName"
type=
"java.lang.String"
symbol=
"like"
alias=
"c"
/>
</query>
<query
name=
"getCustomerList"
label=
"对外查询客户信息"
table=
"customer"
>
<sql-query>
SELECT customer.customer_id,customer.customer_name,customer.province_code,co.quotation_currency,co.monthly_settlement_method,co.order_kind,ccc.contact_name,ccc.contact_phone,ccc.contact_fax,ccc.contact_mail,co.remark
FROM customer LEFT JOIN
(SELECT c.customer_id,cc.contact_name,cc.contact_phone,cc.contact_fax,cc.contact_mail FROM customer c LEFT JOIN customer_contact cc ON c.customer_id = cc.customer_id) AS ccc
ON customer.customer_id = ccc.customer_id LEFT JOIN customer_order co
ON customer.customer_id = co.customer_id
</sql-query>
</query>
<query
name=
"customerDebtContact"
label=
"催货款通知邮箱表"
table=
"customer_debt_contact"
>
<sql-query>
select c.*
...
...
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