Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-store
Overview
Overview
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
base_platform_enterprise
gic-store
Commits
00c334c0
Commit
00c334c0
authored
Jun 04, 2021
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导购到处调整:提供勾选参数
parent
338a1f20
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
176 additions
and
5 deletions
+176
-5
ClerkSearchDTO.java
...e-api/src/main/java/com/gic/store/dto/ClerkSearchDTO.java
+79
-0
TabClerkMapper.java
...rc/main/java/com/gic/store/dao/mapper/TabClerkMapper.java
+26
-2
ClerkService.java
...ice/src/main/java/com/gic/store/service/ClerkService.java
+10
-1
ClerkServiceImpl.java
...ain/java/com/gic/store/service/impl/ClerkServiceImpl.java
+13
-1
ClerkApiServiceImpl.java
...com/gic/store/service/outer/impl/ClerkApiServiceImpl.java
+14
-1
TabClerkMapper.xml
...tore-service/src/main/resources/mapper/TabClerkMapper.xml
+34
-0
No files found.
gic-store-api/src/main/java/com/gic/store/dto/ClerkSearchDTO.java
View file @
00c334c0
package
com
.
gic
.
store
.
dto
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
*
...
...
@@ -22,6 +25,22 @@ public class ClerkSearchDTO implements Serializable {
private
Integer
clerkType
;
private
String
storeSearch
;
/**
* 门店选择器ID
*/
private
Long
storeResource
;
/**
* 如果勾选了导购,导购ID,英文逗号隔开,用getClerkIdList方法 导出使用
*/
private
String
clerkIds
;
/**
* 为了不与storeInfoIds错乱使用,单独使用一个 导出使用
*/
private
String
storeInfoIdPram
;
private
String
fileName
;
private
Integer
excelExtension
;
private
List
<
String
>
fieldCodeList
;
...
...
@@ -157,6 +176,63 @@ public class ClerkSearchDTO implements Serializable {
this
.
searchType
=
searchType
;
}
public
Long
getStoreResource
()
{
return
storeResource
;
}
public
ClerkSearchDTO
setStoreResource
(
Long
storeResource
)
{
this
.
storeResource
=
storeResource
;
return
this
;
}
public
String
getClerkIds
()
{
return
clerkIds
;
}
public
ClerkSearchDTO
setClerkIds
(
String
clerkIds
)
{
this
.
clerkIds
=
clerkIds
;
return
this
;
}
public
List
<
Integer
>
getClerkIdList
(
String
suffix
)
{
if
(
clerkIds
!=
null
&&
clerkIds
!=
""
)
{
if
(
suffix
==
null
||
suffix
==
""
)
{
//默认空格
suffix
=
","
;
}
return
Arrays
.
stream
(
clerkIds
.
split
(
suffix
))
.
filter
(
e
->
e
!=
null
&&
e
!=
""
)
.
mapToInt
(
e
->
Integer
.
valueOf
(
e
))
.
boxed
()
.
collect
(
Collectors
.
toList
());
}
return
new
ArrayList
<>();
}
public
List
<
Integer
>
getStoreInfoIdParamList
(
String
suffix
)
{
if
(
storeInfoIdPram
!=
null
&&
storeInfoIdPram
!=
""
)
{
if
(
suffix
==
null
||
suffix
==
""
)
{
//默认空格
suffix
=
","
;
}
return
Arrays
.
stream
(
storeInfoIdPram
.
split
(
suffix
))
.
filter
(
e
->
e
!=
null
&&
e
!=
""
)
.
mapToInt
(
e
->
Integer
.
valueOf
(
e
))
.
boxed
()
.
collect
(
Collectors
.
toList
());
}
return
new
ArrayList
<>();
}
public
String
getStoreInfoIdPram
()
{
return
storeInfoIdPram
;
}
public
ClerkSearchDTO
setStoreInfoIdPram
(
String
storeInfoIdPram
)
{
this
.
storeInfoIdPram
=
storeInfoIdPram
;
return
this
;
}
@Override
public
String
toString
()
{
return
"ClerkSearchDTO{"
+
...
...
@@ -175,6 +251,9 @@ public class ClerkSearchDTO implements Serializable {
", fieldCodeList="
+
fieldCodeList
+
", dataType="
+
dataType
+
", status="
+
status
+
", storeResource="
+
storeResource
+
", clerkIds="
+
clerkIds
+
", storeInfoIdPram="
+
storeInfoIdPram
+
'}'
;
}
}
gic-store-service/src/main/java/com/gic/store/dao/mapper/TabClerkMapper.java
View file @
00c334c0
...
...
@@ -104,7 +104,28 @@ public interface TabClerkMapper {
* @Description:
* @author zhiwj
*/
List
<
TabClerk
>
listClerkByStoreInfoId
(
@Param
(
"storeClerkIds"
)
List
<
Integer
>
storeClerkIds
,
@Param
(
"storeInfoIds"
)
String
storeInfoIds
,
@Param
(
"search"
)
String
search
,
@Param
(
"clerkType"
)
Integer
clerkType
,
@Param
(
"status"
)
Integer
status
);
List
<
TabClerk
>
listClerkByStoreInfoId
(
@Param
(
"storeClerkIds"
)
List
<
Integer
>
storeClerkIds
,
@Param
(
"storeInfoIds"
)
String
storeInfoIds
,
@Param
(
"search"
)
String
search
,
@Param
(
"clerkType"
)
Integer
clerkType
,
@Param
(
"status"
)
Integer
status
);
/**
* 查询导购
* @param storeClerkIds
* @param storeInfoIds
* @param search
* @param clerkType
* @param status
* @param clerkIdList
* @return
*/
List
<
TabClerk
>
listClerkByStoreInfoIdAndClerkId
(
@Param
(
"storeClerkIds"
)
List
<
Integer
>
storeClerkIds
,
@Param
(
"storeInfoIds"
)
String
storeInfoIds
,
@Param
(
"search"
)
String
search
,
@Param
(
"clerkType"
)
Integer
clerkType
,
@Param
(
"status"
)
Integer
status
,
@Param
(
"clerkIdList"
)
List
<
Integer
>
clerkIdList
);
/**
* getTotalClerk
...
...
@@ -118,7 +139,10 @@ public interface TabClerkMapper {
* @Description:
* @author zhiwj
*/
Integer
getTotalClerk
(
@Param
(
"storeClerkIds"
)
List
<
Integer
>
storeClerkIds
,
@Param
(
"search"
)
String
search
,
@Param
(
"status"
)
Integer
status
);
Integer
getTotalClerk
(
@Param
(
"storeClerkIds"
)
List
<
Integer
>
storeClerkIds
,
@Param
(
"search"
)
String
search
,
@Param
(
"status"
)
Integer
status
,
@Param
(
"clerkIdList"
)
List
<
Integer
>
clerkIdList
);
/**
* getStoreInfoIdsBySearch
...
...
gic-store-service/src/main/java/com/gic/store/service/ClerkService.java
View file @
00c334c0
...
...
@@ -124,7 +124,16 @@ public interface ClerkService {
* @throws
*/
List
<
TabClerk
>
listClerkByStoreInfoId
(
Integer
enterpriseId
,
List
<
Integer
>
storeInfoIds
,
String
search
,
Integer
clerkType
);
/**
* listClerkByStoreInfoId
* @param enterpriseId
* @param storeInfoIds
* @param search
* @return
*/
List
<
TabClerk
>
listClerkByStoreInfoId
(
Integer
enterpriseId
,
List
<
Integer
>
storeInfoIds
,
ClerkSearchDTO
search
);
/**
* listClerkByStoreInfoId
* @Title: listClerkByStoreInfoId
...
...
gic-store-service/src/main/java/com/gic/store/service/impl/ClerkServiceImpl.java
View file @
00c334c0
...
...
@@ -125,13 +125,25 @@ public class ClerkServiceImpl implements ClerkService {
}
@Override
public
List
<
TabClerk
>
listClerkByStoreInfoId
(
Integer
enterpriseId
,
List
<
Integer
>
storeInfoIdList
,
ClerkSearchDTO
search
)
{
// list 如果太大, 让 mybatis 解析 会打满内存
String
storeInfoIds
=
null
;
if
(
CollectionUtils
.
isNotEmpty
(
storeInfoIdList
))
{
storeInfoIds
=
"("
+
storeInfoIdList
.
stream
().
map
(
Object:
:
toString
).
collect
(
Collectors
.
joining
(
","
))
+
")"
;
}
return
tabClerkMapper
.
listClerkByStoreInfoIdAndClerkId
(
null
,
storeInfoIds
,
search
.
getSearch
(),
search
.
getClerkType
(),
null
,
search
.
getClerkIdList
(
null
));
}
@Override
public
List
<
TabClerk
>
listClerkByStoreInfoId
(
Integer
enterpriseId
,
List
<
Integer
>
storeInfoIds
,
Integer
status
,
String
search
)
{
return
tabClerkMapper
.
listClerkByStoreInfoId
(
storeInfoIds
,
null
,
search
,
null
,
status
);
}
@Override
public
Integer
getTotalClerk
(
Integer
enterpriseId
,
List
<
Integer
>
storeInfoIds
,
ClerkSearchDTO
search
)
{
return
tabClerkMapper
.
getTotalClerk
(
storeInfoIds
,
search
.
getSearch
(),
search
.
getStatus
());
return
tabClerkMapper
.
getTotalClerk
(
storeInfoIds
,
search
.
getSearch
(),
search
.
getStatus
()
,
search
.
getClerkIdList
(
null
)
);
}
@Override
...
...
gic-store-service/src/main/java/com/gic/store/service/outer/impl/ClerkApiServiceImpl.java
View file @
00c334c0
...
...
@@ -396,8 +396,15 @@ public class ClerkApiServiceImpl implements ClerkApiService {
storeClerkDTOList
.
add
(
clerkStoreListDTO
);
storeInfoIds
.
add
(
store
.
getStoreInfoId
());
}
//交集
if
(
CollectionUtils
.
isNotEmpty
(
clerkSearchDTO
.
getStoreInfoIdParamList
(
null
)))
{
//前端勾选的门店数据
storeInfoIds
.
retainAll
(
clerkSearchDTO
.
getStoreInfoIdParamList
(
null
));
}
List
<
TabClerk
>
clerkList
=
clerkService
.
listClerkByStoreInfoId
(
enterpriseId
,
storeInfoIds
,
clerkSearchDTO
.
getSearch
(),
clerkSearchDTO
.
getClerkType
()
);
clerkSearchDTO
);
Map
<
Integer
,
List
<
TabClerk
>>
storeIdMap
=
CollectionUtil
.
group
(
clerkList
,
"storeInfoId"
);
for
(
ClerkStoreListDTO
clerkStoreListDTO
:
storeClerkDTOList
)
{
List
<
TabClerk
>
tabClerks
=
storeIdMap
.
get
(
clerkStoreListDTO
.
getStoreInfoId
());
...
...
@@ -447,6 +454,11 @@ public class ClerkApiServiceImpl implements ClerkApiService {
List
<
Integer
>
storeInfoIds
=
page
.
getResult
().
stream
().
map
(
StoreDTO:
:
getStoreInfoId
)
.
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
storeInfoIds
))
{
//交集
if
(
CollectionUtils
.
isNotEmpty
(
clerkSearchDTO
.
getStoreInfoIdParamList
(
null
)))
{
//前端勾选的门店数据
storeInfoIds
.
retainAll
(
clerkSearchDTO
.
getStoreInfoIdParamList
(
null
));
}
Integer
totalClerk
=
clerkService
.
getTotalClerk
(
enterpriseId
,
storeInfoIds
,
clerkSearchDTO
);
return
ServiceResponse
.
success
(
totalClerk
);
}
else
{
...
...
@@ -474,6 +486,7 @@ public class ClerkApiServiceImpl implements ClerkApiService {
storeSearchDTO
.
setStoreIds
(
clerkSearchDTO
.
getStoreIds
());
storeSearchDTO
.
setSearch
(
clerkSearchDTO
.
getStoreSearch
());
storeSearchDTO
.
setStoreInfoIds
(
clerkSearchDTO
.
getStoreInfoIds
());
storeSearchDTO
.
setStoreResource
(
clerkSearchDTO
.
getStoreResource
());
return
storeApiService
.
listStore
(
storeSearchDTO
,
pageNum
,
pageSize
,
"storeId,storeName,storeCode,storeInfoId,ownType"
);
...
...
gic-store-service/src/main/resources/mapper/TabClerkMapper.xml
View file @
00c334c0
...
...
@@ -255,6 +255,34 @@
</if>
</where>
</select>
<select
id=
"listClerkByStoreInfoIdAndClerkId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_clerk
<where>
<if
test=
"null != storeClerkIds and storeClerkIds.size() > 0"
>
and store_info_id in
<foreach
close=
")"
collection=
"storeClerkIds"
index=
"index"
item=
"item"
open=
"("
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"storeInfoIds != null "
>
and store_info_id in ${storeInfoIds}
</if>
<if
test=
"null != clerkIdList and clerkIdList.size() > 0"
>
and clerk_id in
<foreach
close=
")"
collection=
"clerkIdList"
index=
"index"
item=
"item"
open=
"("
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"search != null and search != '' "
>
and (clerk_code like concat('%', #{search} ,'%') or clerk_name like concat('%', #{search} ,'%') or phone_number like concat('%', #{search} ,'%') )
</if>
<if
test=
"status != null "
>
and status = #{status}
</if>
</where>
</select>
<select
id=
"getTotalClerk"
resultType=
"int"
>
select
count(*)
...
...
@@ -269,6 +297,12 @@
#{item}
</foreach>
</if>
<if
test=
"null != clerkIdList and clerkIdList.size() > 0"
>
and clerk_id in
<foreach
close=
")"
collection=
"clerkIdList"
index=
"index"
item=
"item"
open=
"("
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"search != null and search != '' "
>
and (clerk_code like concat('%', #{search} ,'%') or clerk_name like concat('%', #{search} ,'%') or phone_number like concat('%', #{search} ,'%') )
</if>
...
...
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