Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
haoban3.0
haoban-manage3.0
Commits
c9d21277
Commit
c9d21277
authored
Oct 09, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导购转移门店
parent
bc7870c6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
76 additions
and
22 deletions
+76
-22
TabHaobanHmClerkRelationMapper.java
...service/dao/mapper/hm/TabHaobanHmClerkRelationMapper.java
+14
-0
HmClerkRelationService.java
...ban/manage/service/service/hm/HmClerkRelationService.java
+11
-0
HmClerkRelationServiceImpl.java
...e/service/service/hm/impl/HmClerkRelationServiceImpl.java
+26
-5
HmClerkRelationApiServiceImpl.java
...ce/service/out/impl/hm/HmClerkRelationApiServiceImpl.java
+19
-17
TabHaobanHmClerkRelationMapper.xml
...in/resources/mapper/hm/TabHaobanHmClerkRelationMapper.xml
+6
-0
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/hm/TabHaobanHmClerkRelationMapper.java
View file @
c9d21277
...
...
@@ -183,5 +183,19 @@ public interface TabHaobanHmClerkRelationMapper {
@Param
(
"storeId"
)
String
storeId
,
@Param
(
"storeName"
)
String
storeName
,
@Param
(
"storeCode"
)
String
storeCode
);
/**
*
* @Title: updateByClerkChangeStore
* @Description: 导购转移门店,更新多人码门店和导购信息
* @author xugh
* @param tabHaobanHmClerkRelation
* @return
* @throws
*/
int
updateByClerkChangeStore
(
@Param
(
"enterpriseId"
)
String
enterpriseId
,
@Param
(
"clerkId"
)
String
clerkId
,
@Param
(
"clerkCode"
)
String
clerkCode
,
@Param
(
"clerkName"
)
String
clerkName
,
@Param
(
"storeId"
)
String
storeId
,
@Param
(
"storeCode"
)
String
storeCode
,
@Param
(
"storeName"
)
String
storeName
,
@Param
(
"oldClerkId"
)
String
oldClerkId
)
;
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/hm/HmClerkRelationService.java
View file @
c9d21277
...
...
@@ -169,5 +169,16 @@ public interface HmClerkRelationService {
* @date 2022-07-26 15:38:33
*/
List
<
HmClerkRelationBO
>
queryByHmIdNotInClerkIds
(
Long
hmId
,
List
<
String
>
clerkIds
);
/**
*
* @Title: updateByClerkChangeStore
* @Description: 导购转移门店更新多人活码
* @author xugh
* @param bo
* @param oldClerkId
* @throws
*/
void
updateByClerkChangeStore
(
String
enterpriseId
,
String
oldClerkId
,
String
newClerkId
)
;
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/hm/impl/HmClerkRelationServiceImpl.java
View file @
c9d21277
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
hm
.
impl
;
import
java.util.Date
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.gic.api.base.commons.BasePageInfo
;
import
com.gic.api.base.commons.Page
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.enterprise.api.dto.StoreDTO
;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.manage.api.dto.qdto.hm.HmClerkRelationQDTO
;
...
...
@@ -11,11 +21,6 @@ import com.gic.haoban.manage.service.pojo.bo.hm.HmClerkRelationBO;
import
com.gic.haoban.manage.service.service.hm.HmClerkRelationService
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.List
;
/**
* 多人活码(TabHaobanHmClerkRelation)表服务实现类
...
...
@@ -28,6 +33,10 @@ public class HmClerkRelationServiceImpl implements HmClerkRelationService {
@Autowired
private
TabHaobanHmClerkRelationMapper
tabHaobanHmClerkRelationMapper
;
@Autowired
private
ClerkService
clerkService
;
@Autowired
private
StoreService
storeService
;
/**
* 通过ID查询单条数据
...
...
@@ -116,4 +125,16 @@ public class HmClerkRelationServiceImpl implements HmClerkRelationService {
public
List
<
HmClerkRelationBO
>
queryByHmIdNotInClerkIds
(
Long
hmId
,
List
<
String
>
clerkIds
)
{
return
EntityUtil
.
changeEntityListByOrika
(
HmClerkRelationBO
.
class
,
tabHaobanHmClerkRelationMapper
.
queryByHmIdNotInClerkIds
(
hmId
,
clerkIds
));
}
@Override
public
void
updateByClerkChangeStore
(
String
enterpriseId
,
String
oldClerkId
,
String
newClerkId
)
{
ClerkDTO
newClerk
=
this
.
clerkService
.
getclerkById
(
newClerkId
)
;
String
clerkCode
=
newClerk
.
getClerkCode
();
String
clerkName
=
newClerk
.
getClerkName
()
;
String
storeId
=
newClerk
.
getStoreId
();
StoreDTO
newStore
=
this
.
storeService
.
getStore
(
storeId
)
;
String
storeCode
=
newStore
.
getStoreCode
();
String
storeName
=
newStore
.
getStoreName
()
;
this
.
tabHaobanHmClerkRelationMapper
.
updateByClerkChangeStore
(
enterpriseId
,
newClerkId
,
clerkCode
,
clerkName
,
storeId
,
storeCode
,
storeName
,
oldClerkId
)
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/hm/HmClerkRelationApiServiceImpl.java
View file @
c9d21277
...
...
@@ -14,6 +14,7 @@ import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeBO;
import
com.gic.haoban.manage.service.service.hm.HmClerkRelationService
;
import
com.gic.haoban.manage.service.service.hm.HmQrcodeService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -33,7 +34,6 @@ public class HmClerkRelationApiServiceImpl implements HmClerkRelationApiService
@Autowired
private
HmClerkRelationService
hmClerkRelationService
;
@Override
public
ServiceResponse
delByClerkId
(
String
clerkId
,
String
enterpriseId
,
String
wxEnterpriseId
,
Integer
invokingType
)
{
return
this
.
delByClerkId
(
clerkId
,
enterpriseId
,
wxEnterpriseId
,
invokingType
,
null
)
;
...
...
@@ -47,28 +47,30 @@ public class HmClerkRelationApiServiceImpl implements HmClerkRelationApiService
if
(
hmQrcodeBO
!=
null
)
{
hmQrcodeApiService
.
delById
(
hmQrcodeBO
.
getHmId
(),
invokingType
,
null
);
}
// 多人活码逻辑
List
<
HmClerkRelationBO
>
hmClerkRelationBOS
=
hmClerkRelationService
.
queryByClerkId
(
clerkId
,
enterpriseId
);
if
(
CollectionUtils
.
isEmpty
(
hmClerkRelationBOS
))
{
logger
.
info
(
"无多人活码"
);
return
ServiceResponse
.
success
();
}
for
(
HmClerkRelationBO
hmClerkRelationBO
:
hmClerkRelationBOS
)
{
Long
hmId
=
hmClerkRelationBO
.
getHmId
();
List
<
String
>
clerkIds
=
hmClerkRelationService
.
getClerkIdByHmId
(
hmId
);
hmClerkRelationService
.
updateStatusById
(
0
,
hmClerkRelationBO
.
getRelationId
());
clerkIds
.
remove
(
clerkId
);
if
(
CollectionUtils
.
isNotEmpty
(
clerkIds
))
{
// 更新活码
HmQrcodeQDTO
hmQrcodeQDTO
=
new
HmQrcodeQDTO
();
hmQrcodeQDTO
.
setHmId
(
hmId
);
hmQrcodeQDTO
.
setClerkIdList
(
clerkIds
);
hmQrcodeQDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
hmQrcodeApiService
.
update
(
hmQrcodeQDTO
);
}
else
{
hmQrcodeApiService
.
delById
(
hmId
,
invokingType
,
null
);
if
(
StringUtils
.
isNotBlank
(
newClerkId
))
{
this
.
hmClerkRelationService
.
updateByClerkChangeStore
(
enterpriseId
,
clerkId
,
newClerkId
);
}
else
{
for
(
HmClerkRelationBO
hmClerkRelationBO
:
hmClerkRelationBOS
)
{
Long
hmId
=
hmClerkRelationBO
.
getHmId
();
List
<
String
>
clerkIds
=
hmClerkRelationService
.
getClerkIdByHmId
(
hmId
);
hmClerkRelationService
.
updateStatusById
(
0
,
hmClerkRelationBO
.
getRelationId
());
clerkIds
.
remove
(
clerkId
);
if
(
CollectionUtils
.
isNotEmpty
(
clerkIds
))
{
// 更新活码
HmQrcodeQDTO
hmQrcodeQDTO
=
new
HmQrcodeQDTO
();
hmQrcodeQDTO
.
setHmId
(
hmId
);
hmQrcodeQDTO
.
setClerkIdList
(
clerkIds
);
hmQrcodeQDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
hmQrcodeApiService
.
update
(
hmQrcodeQDTO
);
}
else
{
hmQrcodeApiService
.
delById
(
hmId
,
invokingType
,
null
);
}
}
}
return
ServiceResponse
.
success
();
...
...
haoban-manage3-service/src/main/resources/mapper/hm/TabHaobanHmClerkRelationMapper.xml
View file @
c9d21277
...
...
@@ -211,6 +211,12 @@
</set>
where store_id = #{storeId} and enterprise_id = #{enterpriseId}
</update>
<update
id=
"updateByClerkChangeStore"
>
update tab_haoban_hm_clerk_relation set
clerk_id = #{clerkId} , clerk_code=#{clerkCode} , clerk_name=#{clerkName} , store_id=#{storeId} , store_name = #{storeName}, store_code = #{storeCode} , update_time = now()
where clerk_id = #{oldClerkId} and enterprise_id = #{enterpriseId} and `status` = 1
</update>
</mapper>
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