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
de0e8818
Commit
de0e8818
authored
Dec 28, 2023
by
wanghang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
2dc4dc6b
4b45e918
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
511 additions
and
73 deletions
+511
-73
listeningFromData.js
...xt/src/main/webapp/biz/topsun/common/listeningFromData.js
+85
-24
customerDetail.js
...-xt/src/main/webapp/biz/topsun/customer/customerDetail.js
+1
-1
productDetail.js
...un-xt/src/main/webapp/biz/topsun/product/productDetail.js
+34
-16
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
CustomerContact.java
...va/com/huigou/topsun/customer/domain/CustomerContact.java
+2
-2
ContactQueryRequest.java
...gou/topsun/customer/domain/query/ContactQueryRequest.java
+5
-5
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
ProductApplication.java
...huigou/topsun/product/application/ProductApplication.java
+2
-0
ProductApplicationImpl.java
...psun/product/application/impl/ProductApplicationImpl.java
+31
-7
ProductController.java
...m/huigou/topsun/product/controller/ProductController.java
+13
-0
ProductFace.java
...in/java/com/huigou/topsun/product/domain/ProductFace.java
+12
-4
ProductDetailInfo.java
...m/huigou/topsun/product/repository/ProductDetailInfo.java
+12
-0
ProductInfo.java
...ava/com/huigou/topsun/product/repository/ProductInfo.java
+12
-0
ProductRepository.java
...m/huigou/topsun/product/repository/ProductRepository.java
+4
-0
customerMapper.xml
.../main/resources/config/topsun/customer/customerMapper.xml
+11
-0
No files found.
topsun-xt/src/main/webapp/biz/topsun/common/listeningFromData.js
View file @
de0e8818
/**
* 监听页面动作,维护数据映射及数据集
* 当前主要使用遍历实现。
* 后期优化项目, window.dataSet.newData.backColors.compares 需要向外抛出、并且单独维护。
* @createDate 2019-04-12
*/
...
...
@@ -177,7 +178,10 @@ function checkArrayMapper(str) {
}
/**
* Grid 编辑前触发。 这里记录当前编辑框 对应的 Grid 行索引 GridRowIndex
*
* Grid 编辑前触发。 这里记录当前编辑框 对应的 Grid 行 rowIndex 和列 property <br>
* 这里根据 UI ID生成规则封装。 需要根据此规则维护。 <br>
* 编辑前,根据 UI 生成的编辑框命名规则,定位到当前编辑栏目。修改数据时以此栏目位置为定位标准修改对应数据集。只记录当前栏目,使用完后需要清除。
* @param options
* @private
*/
...
...
@@ -186,53 +190,105 @@ function onBeforeEdit_(options) {
options
.
onBeforeEdit
=
function
(
editParm
,
gg
){
let
domIds
=
editParm
.
column
.
__domid
.
split
(
'|'
),
recordId
=
editParm
.
record
.
__id
,
colName
=
editParm
.
column
.
name
;
let
parentDomId
=
domIds
[
0
]
+
'|'
+
2
+
'|'
+
recordId
;
// +'|'+domIds[2];
let
domId
=
domIds
[
0
]
+
'|'
+
2
+
'|'
+
recordId
+
'|'
+
domIds
[
2
];
let
rowDOM
;
if
(
!
(
rowDOM
=
document
.
getElementById
(
parentDomId
)))
{
parentDomId
=
domIds
[
0
]
+
'|'
+
1
+
'|'
+
recordId
;
rowDOM
=
document
.
getElementById
(
parentDomId
)
}
let
mapper
=
window
.
dataMapping
.
mapper
;
let
rowI
d
=
rowDOM
.
childNodes
[
0
].
childNodes
[
0
].
innerText
;
let
rowI
ndex
=
rowDOM
.
childNodes
[
0
].
childNodes
[
0
].
innerText
;
let
mapperEntry
=
mapper
[
colName
];
let
currentMapper
=
checkArrayMapper
(
domIds
[
0
]);
if
(
currentMapper
.
hasOwnProperty
(
"beanName"
))
{
if
(
!
mapperEntry
[
currentMapper
.
beanName
])
{
console
.
error
(
"dataMapping 中,无法找到该 DOMId 的映射。请检查!"
);
if
(
mapperEntry
[
currentMapper
.
beanName
])
{
mapperEntry
[
currentMapper
.
beanName
][
'rowIndex'
]
=
rowIndex
;
mapperEntry
[
currentMapper
.
beanName
][
'colName'
]
=
colName
;
mapperEntry
[
currentMapper
.
beanName
][
'domId'
]
=
domId
;
mapperEntry
[
currentMapper
.
beanName
][
rowIndex
]
=
editParm
.
rowindex
;
}
else
{
//
mapperEntry[currentMapper.beanName]['rowId'] = parentDomId
;
mapperEntry
[
currentMapper
.
beanName
][
rowId
][
'rowIndex'
]
=
editParm
.
rowindex
;
//
mapperEntry[currentMapper.beanName][rowIndex] = colName
;
// console.error("dataMapping 中,无法找到该 DOMId 的映射。请检查!")
;
}
}
originalOnBeforeEdit
.
call
(
this
,
editParm
,
'11'
);
}
}
function
listeningSearchbox
(
elId
,
options
)
{
/**
* 监听 下拉框初始化 ,使选中值时维护 dataSet。显示值需要自己处理。
* @param elId 需要渲染的下拉框的 DOMId
* @param options
*/
function
listeningSearchbox
(
elId
,
options
,
gridId
)
{
const
originalOnChange
=
options
.
onChange
;
options
.
onChange
=
function
(
value
,
data
)
{
let
eleName
=
this
.
element
[
0
].
name
;
options
.
onChange
=
function
(
value
,
data
,
fillInValue
)
{
let
eleName
=
this
.
element
[
0
].
name
,
beanName
=
''
;
let
currentMapper
=
window
.
dataMapping
.
mapper
[
eleName
];
if
(
!
currentMapper
)
{
console
.
error
(
"找不到该映射,请检查映射配置是否存在该配置: "
+
eleName
);
}
let
fillInValue
;
Object
.
entries
(
currentMapper
).
forEach
(
mapper
=>
{
let
property
=
""
;
if
(
eleName
.
split
(
'_'
).
length
>
1
)
{
property
=
eleName
.
split
(
'_'
)[
1
];
}
else
{
beanName
=
mapper
[
0
];
property
=
mapper
[
1
];
}
let
beanName
=
mapper
[
0
];
if
(
typeof
property
==
'string'
)
{
// ------------------ Form 下拉框执行此逻辑 ------------------
window
.
dataSet
.
newData
[
beanName
][
property
]
=
data
[
property
];
fillInValue
=
data
[
property
];
}
else
if
(
property
instanceof
Object
)
{
// ------------------ Grid 下拉框执行此逻辑 ------------------
if
(
property
.
rowIndex
)
{
let
rowIndex
=
property
.
rowIndex
;
let
propertyName
=
property
.
colName
;
let
domId
=
property
.
domId
;
window
.
dataSet
.
newData
[
beanName
].
compares
[
rowIndex
][
propertyName
]
=
data
[
propertyName
];
fillInValue
=
domId
;
let
gridEdit
=
window
.
dataGrid
[
'fronColorsGrid'
].
editor
;
if
(
gridEdit
.
editParm
.
column
.
editor
.
type
===
'select'
)
{
let
showProperty
=
gridEdit
.
editParm
.
column
.
editor
.
showProperty
window
.
dataGrid
[
gridId
].
editor
.
editParm
.
record
[
propertyName
]
=
data
[
showProperty
];
}
property
.
rowIndex
=
null
;
property
.
colName
=
null
;
property
.
domId
=
null
;
}
window
.
dataSet
.
newData
[
beanName
][
property
]
=
data
[
property
];
fillInValue
=
data
[
property
];
}
}
})
originalOnChange
.
call
(
this
,
value
,
data
,
fillInValue
);
if
(
fillInValue
)
{
originalOnChange
.
call
(
this
,
value
,
data
,
fillInValue
);
}
}
$
(
elId
).
searchbox
(
options
);
}
/**
*
* Gria 中的下拉框 用此方式初始化。此下拉框维护 dataSet, 显示值需要自己处理。
* @param propertyName GridId_propertyName,需要以此定位到需要展开下拉框的栏目(临时)
* @param options
*/
function
listeningGridSearchbox
(
propertyName
,
options
)
{
if
(
!
window
.
gridSearchboxOptions
)
{
window
.
gridSearchboxOptions
=
{};
}
window
.
gridSearchboxOptions
[
propertyName
]
=
options
;
}
function
DropdownTrigger
(
node
)
{
let
nodeId
=
node
.
id
;
let
tempId
=
nodeId
.
slice
(
0
,
nodeId
.
lastIndexOf
(
'_'
));
if
(
node
.
getAttribute
(
'select'
))
{
listeningSearchbox
(
'#'
+
nodeId
,
window
.
gridSearchboxOptions
[
tempId
],
nodeId
.
split
(
'_'
)[
0
]);
}
}
/**
* 若需要监听 Grid 数据,必须在此调用组件初始化,此处获取元素 ID
* @param elId
...
...
@@ -280,8 +336,8 @@ function listeningGrid(elId, options) {
// ------------- 设置 mapper -------------
settingGridMapper
(
currentMapper
.
property
.
columns
,
mapper
,
rowId
,
beanName
,
data
);
data
[
idProperty
]
=
rowId
;
data
[
'rowIndex'
]
=
rowId
//
data[idProperty] = rowId;
data
[
'rowIndex'
]
=
rowId
// ------------- 设置 compares -------------
if
(
!
window
.
dataSet
.
newData
[
beanName
])
{
window
.
dataSet
.
newData
[
beanName
]
=
{};
...
...
@@ -296,7 +352,7 @@ function listeningGrid(elId, options) {
}
window
.
dataSet
.
newData
[
beanName
].
ids
.
push
(
rowId
);
UICtrl
.
addGridRow
(
gridManager
,
data
);
originalOnClick
.
call
(
this
,
data
);
originalOnClick
.
call
(
this
,
data
,
gridManager
);
}
}
if
(
but
.
id
===
"menuDelete"
)
{
...
...
@@ -316,13 +372,17 @@ function listeningGrid(elId, options) {
});
gridManager
.
deleteSelectedRow
();
debugger
;
originalOnClick
.
call
(
this
,
selectRow
);
originalOnClick
.
call
(
this
,
selectRow
,
gridManager
);
}
}
})
}
addObserver
(
elId
);
var
gridManager
=
UICtrl
.
grid
(
elId
,
options
);
if
(
!
window
.
dataGrid
){
window
.
dataGrid
=
{};
}
window
.
dataGrid
[
elId
.
slice
(
1
)]
=
gridManager
;
return
gridManager
;
}
...
...
@@ -359,13 +419,12 @@ function listenerContent(event) {
// Grid 时执行此逻辑
if
(
control
===
'grid'
)
{
debugger
;
tryForEach
(
Object
.
entries
(
beanMapping
),
mapperEntry
=>
{
Object
.
entries
(
beanMapping
).
forEach
(
mapperEntry
=>
{
let
mapperKey
=
mapperEntry
[
0
],
mapperVal
=
mapperEntry
[
1
];
Object
.
entries
(
mapperEntry
[
1
]).
forEach
(
rowEntry
=>
{
let
rowId
=
rowEntry
[
0
];
if
(
rowEntry
[
1
]
.
rowIndex
!
=
undefined
)
{
if
(
rowEntry
[
1
]
.
rowIndex
===
inputIds
[
2
]
*
1
)
{
if
(
rowEntry
[
1
]
!=
=
undefined
)
{
if
(
rowEntry
[
1
]
===
inputIds
[
2
]
*
1
)
{
window
.
dataSet
.
newData
[
mapperKey
].
compares
[
rowId
][
inputIds
[
1
]]
=
event
.
target
.
value
;
console
.
log
(
'Input value changed:'
,
event
.
target
.
value
);
}
...
...
@@ -424,7 +483,8 @@ const observer = new MutationObserver((mutations) => {
let
childNodes
=
addNodes
[
0
].
childNodes
;
if
(
childNodes
.
length
===
1
&&
childNodes
[
0
].
nodeName
===
'INPUT'
)
{
let
node
=
childNodes
[
0
];
node
.
addEventListener
(
'input'
,
gridEditor
)
node
.
addEventListener
(
'input'
,
gridEditor
);
DropdownTrigger
(
node
);
}
}
let
removeNodes
=
mutation
.
removedNodes
;
...
...
@@ -469,6 +529,7 @@ function checkUpdata() {
let
rawIds
=
raw
.
ids
,
nowIds
=
now
.
ids
;
dataSet
.
upData
[
beanName
]
=
{};
dataSet
.
upData
[
beanName
].
del
=
[];
debugger
;
let
delIds
=
rawIds
.
filter
(
x
=>
!
nowIds
.
includes
(
x
));
tryForEach
(
delIds
,
id
=>
{
dataSet
.
upData
[
beanName
].
del
.
push
(
rawCompares
[
id
]);
...
...
topsun-xt/src/main/webapp/biz/topsun/customer/customerDetail.js
View file @
de0e8818
...
...
@@ -70,7 +70,7 @@ function loadContactListGrid() {
}
},
{
display
:
"邮箱"
,
name
:
"contact
M
ail"
,
width
:
300
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
display
:
"邮箱"
,
name
:
"contact
Em
ail"
,
width
:
300
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
required
:
true
,
type
:
"text"
}
...
...
topsun-xt/src/main/webapp/biz/topsun/product/productDetail.js
View file @
de0e8818
...
...
@@ -4,6 +4,7 @@ $(document).ready(function() {
initializeToobarContainer
();
initializeTab
();
initializateSelectC
();
initGridSearchbox
();
// runObserver();
});
...
...
@@ -51,13 +52,23 @@ function initializateSelectC() {
$
(
'#submitForm'
).
formSet
(
showData
);
processedGrid
(
'#processedGrid'
,
window
.
dataSet
.
rawData
.
processed
);
});
// $('#selectedTechnology').val(data.productTechnologyName)
}
});
}
function
initGridSearchbox
()
{
listeningGridSearchbox
(
'fronColorsGrid_colorId'
,
{
type
:
"product"
,
name
:
"color"
,
onChange
:
function
(
value
,
data
,
fillInValue
)
{
console
.
log
(
'fillInValue : '
+
fillInValue
);
}
})
}
function
initializeUI
()
{
UICtrl
.
layout
(
"#layout"
,{
heigth
:
'280px'
,
...
...
@@ -168,11 +179,11 @@ var dataMapping = {
},
fronColors
:
{
id
:
"productFaceColorId"
,
columns
:
[
"productFaceColorId"
,
"coverageRate"
]
columns
:
[
"productFaceColorId"
,
"coverageRate"
,
"productFaceId"
,
"colorId"
]
},
backColors
:
{
id
:
"productFaceColorId"
,
columns
:
[
"productFaceColorId"
,
"coverageRate"
]
columns
:
[
"productFaceColorId"
,
"coverageRate"
,
"productFaceId"
,
"colorId"
]
},
processed
:
{
id
:
"productTechnologyId"
,
...
...
@@ -186,23 +197,29 @@ var dataMapping = {
function
faceGrid
(
elId
,
data
)
{
var
toolbarOptions
=
UICtrl
.
getDefaultToolbarOptions
({
addHandler
:
function
(
rawData
){
debugger
;
addHandler
:
function
(
rawData
,
gridManager
){
let
isBack
=
true
;
if
(
gridManager
.
id
.
indexOf
(
'fronColors'
)
>=
0
)
{
isBack
=
false
;
}
window
.
dataSet
.
newData
.
frontFaces
.
raw
.
forEach
(
item
=>
{
if
(
isBack
===
item
.
back
)
{
if
(
isBack
)
{
window
.
dataSet
.
newData
.
backColors
.
compares
[
rawData
.
rowIndex
].
productFaceId
=
item
.
productFaceId
;
}
else
{
window
.
dataSet
.
newData
.
fronColors
.
compares
[
rawData
.
rowIndex
].
productFaceId
=
item
.
productFaceId
;
}
}
})
},
updateHandler
:
function
(){
updateHandler
();
},
deleteHandler
:
(
rowData
)
=>
{
deleteHandler
:
(
rowData
,
gridManager
)
=>
{
console
.
log
(
rowData
.
rowIndex
);
},
});
var
gridManager
=
listeningGrid
(
elId
,
{
columns
:
[
{
display
:
"颜色名称"
,
name
:
"productFaceColorId"
,
width
:
140
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
type
:
'text'
,
required
:
true
{
display
:
"颜色名称"
,
name
:
"colorId"
,
width
:
140
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
type
:
'select'
,
showProperty
:
'colorName'
}},
{
display
:
"油墨覆盖率(%)"
,
name
:
"coverageRate"
,
width
:
120
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
type
:
'text'
,
required
:
true
}
}
{
display
:
"油墨覆盖率(%)"
,
name
:
"coverageRate"
,
width
:
120
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
type
:
'text'
}
}
],
toolbar
:
toolbarOptions
,
dataType
:
"local"
,
...
...
@@ -211,12 +228,13 @@ function faceGrid(elId, data) {
checkbox
:
true
,
usePager
:
false
,
width
:
"98%"
,
height
:
"9
8
%"
,
height
:
"9
0
%"
,
onBeforeEdit
:
function
(
editParm
,
gg
)
{
console
.
log
(
'original run onBeforeEdit()'
);
},
onDblClickRow
:
function
(
data
,
rowindex
,
rowobj
)
{
}
onAfterEdit
:
function
()
{
debugger
;
},
});
}
...
...
topsun/src/main/java/com/huigou/topsun/customer/application/CustomerApplication.java
View file @
de0e8818
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 @
de0e8818
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 @
de0e8818
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 @
de0e8818
...
...
@@ -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 @
de0e8818
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 @
de0e8818
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/CustomerContact.java
View file @
de0e8818
...
...
@@ -50,8 +50,8 @@ public class CustomerContact implements Serializable {
/**
* 邮件
*/
@Column
(
name
=
"contact_mail"
)
private
String
contact
M
ail
;
@Column
(
name
=
"contact_
e
mail"
)
private
String
contact
Em
ail
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
topsun/src/main/java/com/huigou/topsun/customer/domain/query/ContactQueryRequest.java
View file @
de0e8818
...
...
@@ -35,7 +35,7 @@ public class ContactQueryRequest extends QueryAbstractRequest {
/**
* 邮件
*/
private
String
contact
M
ail
;
private
String
contact
Em
ail
;
public
String
getCustomerContactId
()
{
return
customerContactId
;
...
...
@@ -77,11 +77,11 @@ public class ContactQueryRequest extends QueryAbstractRequest {
this
.
contactFax
=
contactFax
;
}
public
String
getContact
M
ail
()
{
return
contact
M
ail
;
public
String
getContact
Em
ail
()
{
return
contact
Em
ail
;
}
public
void
setContact
Mail
(
String
contactM
ail
)
{
this
.
contact
Mail
=
contactM
ail
;
public
void
setContact
Email
(
String
contactEm
ail
)
{
this
.
contact
Email
=
contactEm
ail
;
}
}
topsun/src/main/java/com/huigou/topsun/customer/domain/query/CustomerOrderQueryRequest.java
0 → 100644
View file @
de0e8818
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 @
de0e8818
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 @
de0e8818
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 @
de0e8818
...
...
@@ -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 @
de0e8818
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 @
de0e8818
...
...
@@ -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/java/com/huigou/topsun/product/application/ProductApplication.java
View file @
de0e8818
...
...
@@ -42,4 +42,6 @@ public interface ProductApplication {
* @createDate 2023/12/8 17:19
*/
HashMap
<
String
,
Object
>
saveOrUpdataOnAllDetail
(
HashMap
<
String
,
Object
>
newData
);
HashMap
<
String
,
Object
>
queryProductList
();
}
topsun/src/main/java/com/huigou/topsun/product/application/impl/ProductApplicationImpl.java
View file @
de0e8818
...
...
@@ -6,6 +6,7 @@ import com.huigou.topsun.product.application.ProductApplication;
import
com.huigou.topsun.product.domain.*
;
import
com.huigou.topsun.product.repository.*
;
import
com.huigou.topsun.util.Snowflake
;
import
com.huigou.uasp.bmp.common.application.BaseApplication
;
import
lombok.RequiredArgsConstructor
;
import
org.apache.commons.beanutils.BeanUtils
;
import
org.springframework.stereotype.Service
;
...
...
@@ -29,7 +30,7 @@ import java.util.stream.Stream;
*/
@Service
@RequiredArgsConstructor
public
class
ProductApplicationImpl
implements
ProductApplication
{
public
class
ProductApplicationImpl
extends
BaseApplication
implements
ProductApplication
{
@PersistenceContext
(
unitName
=
"system"
)
private
EntityManager
entityManager
;
...
...
@@ -107,9 +108,10 @@ public class ProductApplicationImpl implements ProductApplication {
if
(
productDetail
!=
null
)
{
ArrayList
<
ProductFace
>
frontFaces
=
new
ArrayList
<>();
if
(
productDetail
.
getBackProductFaceId
()
!=
null
)
{
ProductFace
frontFace
=
faceRepository
.
findByProductFaceId
(
productDetail
.
getBackProductFaceId
());
ProductFace
frontFace
=
faceRepository
.
findByProductFaceId
(
productDetail
.
getRightProductFaceId
());
frontFace
.
setBack
(
false
);
ArrayList
<
ProductFaceColor
>
fronColors
=
(
ArrayList
<
ProductFaceColor
>)
faceColorRepository
.
findByProductFaceId
(
productDetail
.
get
Back
ProductFaceId
());
(
ArrayList
<
ProductFaceColor
>)
faceColorRepository
.
findByProductFaceId
(
productDetail
.
get
Right
ProductFaceId
());
frontFaces
.
add
(
frontFace
);
assemble
.
put
(
"fronColors"
,
fronColors
==
null
?
new
ArrayList
<>()
:
fronColors
);
}
else
{
...
...
@@ -122,6 +124,7 @@ public class ProductApplicationImpl implements ProductApplication {
}
if
(
productDetail
.
getBackProductFaceId
()
!=
null
)
{
ProductFace
backFace
=
faceRepository
.
findByProductFaceId
(
productDetail
.
getBackProductFaceId
());
backFace
.
setBack
(
true
);
ArrayList
<
ProductFaceColor
>
backColors
=
(
ArrayList
<
ProductFaceColor
>)
faceColorRepository
.
findByProductFaceId
(
productDetail
.
getBackProductFaceId
());
frontFaces
.
add
(
backFace
);
...
...
@@ -221,6 +224,27 @@ public class ProductApplicationImpl implements ProductApplication {
return
map
;
}
@Override
public
HashMap
<
String
,
Object
>
queryProductList
()
{
String
sql
=
"SELECT\n"
+
"\tt.product_id,\n"
+
"\tt.product_category_id,\n"
+
"\tt.product_unit,\n"
+
"\tt.is_only_code,\n"
+
"\tt.brand_name,\n"
+
"\tpc.dispatch_multiple,\n"
+
"\tpc.row_num,\n"
+
"\tpt.product_technology_name\n"
+
"FROM\n"
+
"\tproduct t\n"
+
"\tLEFT JOIN product_published_conf pc ON t.product_id = pc.product_id\n"
+
"\tLEFT JOIN product_technology pt ON t.product_id = pt.product_id"
;
ArrayList
<
Map
<
String
,
Object
>>
list
=
(
ArrayList
<
Map
<
String
,
Object
>>)
this
.
sqlExecutorDao
.
queryToListMap
(
sql
);
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>(
3
);
map
.
put
(
"productList"
,
list
);
return
map
;
}
@SuppressWarnings
(
"unchecked"
)
public
static
<
T
>
T
uncheckedCast
(
Object
obj
)
{
if
(
obj
!=
null
)
{
...
...
@@ -230,10 +254,10 @@ public class ProductApplicationImpl implements ProductApplication {
}
/**
* description 持久化数据.
*
<br> Entity 时,如果 ID 为空执行 Persist,否则执行 Merge
*
<br> List 时,要求数据集格式 :
*
<br> HashMap { ”add“: List< Entity >, ”up“: List< Entity >, ”del“: List< Entity >
}
* description 持久化数据.
<br>
*
Entity 时,如果 ID 为空执行 Persist,否则执行 Merge <br>
*
List 时,要求数据集格式 : <br>
*
HashMap {”add“: List< Entity >,”up“: List< Entity >,”del“: List< Entity >
}
* @param entitys 持久化数据集合 Set { Entity, HashMap }
* @author qinzhenguan
* @createDate 2023/12/26 16:44
...
...
topsun/src/main/java/com/huigou/topsun/product/controller/ProductController.java
View file @
de0e8818
...
...
@@ -11,6 +11,7 @@ import com.huigou.topsun.product.application.ProductProcessApplication;
import
com.huigou.topsun.product.domain.Product
;
import
com.huigou.topsun.product.domain.ProductProcess
;
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.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -118,4 +119,16 @@ public class ProductController extends CommonController {
return
success
(
list
);
}
@SkipAuth
public
String
queryProductList
()
{
HashMap
<
String
,
Object
>
aa
=
productService
.
queryProductList
();
String
json
=
""
;
try
{
json
=
objectMapper
.
writeValueAsString
(
aa
);
}
catch
(
JsonProcessingException
e
)
{
throw
new
RuntimeException
(
e
);
}
return
success
(
aa
);
}
}
\ No newline at end of file
topsun/src/main/java/com/huigou/topsun/product/domain/ProductFace.java
View file @
de0e8818
...
...
@@ -7,10 +7,7 @@ import com.huigou.topsun.common.NumberToStringSerializer;
import
org.apache.commons.lang.builder.EqualsBuilder
;
import
org.apache.commons.lang.builder.HashCodeBuilder
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
javax.persistence.*
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
...
...
@@ -38,6 +35,9 @@ public class ProductFace implements Serializable {
@Column
(
name
=
"product_image"
,
nullable
=
true
,
length
=
512
)
private
String
productImage
;
@Transient
private
Boolean
isBack
;
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
...
...
@@ -66,4 +66,12 @@ public class ProductFace implements Serializable {
public
void
setProductImage
(
String
productImage
)
{
this
.
productImage
=
productImage
;
}
public
Boolean
getBack
()
{
return
isBack
;
}
public
void
setBack
(
Boolean
back
)
{
isBack
=
back
;
}
}
topsun/src/main/java/com/huigou/topsun/product/repository/ProductDetailInfo.java
0 → 100644
View file @
de0e8818
package
com
.
huigou
.
topsun
.
product
.
repository
;
import
java.math.BigDecimal
;
/**
* A Projection for the {@link com.huigou.topsun.product.domain.ProductDetail} entity
*/
public
interface
ProductDetailInfo
{
String
getFactoryName
();
BigDecimal
getBackProductFaceId
();
}
\ No newline at end of file
topsun/src/main/java/com/huigou/topsun/product/repository/ProductInfo.java
0 → 100644
View file @
de0e8818
package
com
.
huigou
.
topsun
.
product
.
repository
;
import
java.math.BigDecimal
;
/**
* A Projection for the {@link com.huigou.topsun.product.domain.Product} entity
*/
public
interface
ProductInfo
{
BigDecimal
getProductId
();
String
getProductName
();
}
\ No newline at end of file
topsun/src/main/java/com/huigou/topsun/product/repository/ProductRepository.java
View file @
de0e8818
...
...
@@ -4,6 +4,8 @@ import com.huigou.topsun.product.domain.Product;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
/**
* @author: xin.lu
* @Date: 2023/11/22/10:40
...
...
@@ -12,4 +14,6 @@ import org.springframework.stereotype.Repository;
@Repository
public
interface
ProductRepository
extends
JpaRepository
<
Product
,
String
>
{
@Override
List
<
Product
>
findAll
();
}
topsun/src/main/resources/config/topsun/customer/customerMapper.xml
View file @
de0e8818
...
...
@@ -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_email,co.remark
FROM customer LEFT JOIN
(SELECT c.customer_id,cc.contact_name,cc.contact_phone,cc.contact_fax,cc.contact_email 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