Commit c9d21277 by 徐高华

导购转移门店

parent bc7870c6
...@@ -183,5 +183,19 @@ public interface TabHaobanHmClerkRelationMapper { ...@@ -183,5 +183,19 @@ public interface TabHaobanHmClerkRelationMapper {
@Param("storeId") String storeId, @Param("storeId") String storeId,
@Param("storeName") String storeName, @Param("storeName") String storeName,
@Param("storeCode") String storeCode); @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) ;
} }
...@@ -170,4 +170,15 @@ public interface HmClerkRelationService { ...@@ -170,4 +170,15 @@ public interface HmClerkRelationService {
*/ */
List<HmClerkRelationBO> queryByHmIdNotInClerkIds(Long hmId, List<String> clerkIds); 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) ;
} }
package com.gic.haoban.manage.service.service.hm.impl; 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.BasePageInfo;
import com.gic.api.base.commons.Page; 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.EntityUtil;
import com.gic.haoban.common.utils.PageUtil; import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.manage.api.dto.qdto.hm.HmClerkRelationQDTO; import com.gic.haoban.manage.api.dto.qdto.hm.HmClerkRelationQDTO;
...@@ -11,11 +21,6 @@ import com.gic.haoban.manage.service.pojo.bo.hm.HmClerkRelationBO; ...@@ -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.gic.haoban.manage.service.service.hm.HmClerkRelationService;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; 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)表服务实现类 * 多人活码(TabHaobanHmClerkRelation)表服务实现类
...@@ -28,6 +33,10 @@ public class HmClerkRelationServiceImpl implements HmClerkRelationService { ...@@ -28,6 +33,10 @@ public class HmClerkRelationServiceImpl implements HmClerkRelationService {
@Autowired @Autowired
private TabHaobanHmClerkRelationMapper tabHaobanHmClerkRelationMapper; private TabHaobanHmClerkRelationMapper tabHaobanHmClerkRelationMapper;
@Autowired
private ClerkService clerkService ;
@Autowired
private StoreService storeService ;
/** /**
* 通过ID查询单条数据 * 通过ID查询单条数据
...@@ -116,4 +125,16 @@ public class HmClerkRelationServiceImpl implements HmClerkRelationService { ...@@ -116,4 +125,16 @@ public class HmClerkRelationServiceImpl implements HmClerkRelationService {
public List<HmClerkRelationBO> queryByHmIdNotInClerkIds(Long hmId, List<String> clerkIds) { public List<HmClerkRelationBO> queryByHmIdNotInClerkIds(Long hmId, List<String> clerkIds) {
return EntityUtil.changeEntityListByOrika(HmClerkRelationBO.class,tabHaobanHmClerkRelationMapper.queryByHmIdNotInClerkIds(hmId,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) ;
}
} }
...@@ -14,6 +14,7 @@ import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeBO; ...@@ -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.HmClerkRelationService;
import com.gic.haoban.manage.service.service.hm.HmQrcodeService; import com.gic.haoban.manage.service.service.hm.HmQrcodeService;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -33,7 +34,6 @@ public class HmClerkRelationApiServiceImpl implements HmClerkRelationApiService ...@@ -33,7 +34,6 @@ public class HmClerkRelationApiServiceImpl implements HmClerkRelationApiService
@Autowired @Autowired
private HmClerkRelationService hmClerkRelationService; private HmClerkRelationService hmClerkRelationService;
@Override @Override
public ServiceResponse delByClerkId(String clerkId, String enterpriseId, String wxEnterpriseId, Integer invokingType) { public ServiceResponse delByClerkId(String clerkId, String enterpriseId, String wxEnterpriseId, Integer invokingType) {
return this.delByClerkId(clerkId, enterpriseId, wxEnterpriseId, invokingType, null) ; return this.delByClerkId(clerkId, enterpriseId, wxEnterpriseId, invokingType, null) ;
...@@ -47,14 +47,15 @@ public class HmClerkRelationApiServiceImpl implements HmClerkRelationApiService ...@@ -47,14 +47,15 @@ public class HmClerkRelationApiServiceImpl implements HmClerkRelationApiService
if (hmQrcodeBO != null) { if (hmQrcodeBO != null) {
hmQrcodeApiService.delById(hmQrcodeBO.getHmId(), invokingType, null); hmQrcodeApiService.delById(hmQrcodeBO.getHmId(), invokingType, null);
} }
// 多人活码逻辑 // 多人活码逻辑
List<HmClerkRelationBO> hmClerkRelationBOS = hmClerkRelationService.queryByClerkId(clerkId, enterpriseId); List<HmClerkRelationBO> hmClerkRelationBOS = hmClerkRelationService.queryByClerkId(clerkId, enterpriseId);
if (CollectionUtils.isEmpty(hmClerkRelationBOS)) { if (CollectionUtils.isEmpty(hmClerkRelationBOS)) {
logger.info("无多人活码"); logger.info("无多人活码");
return ServiceResponse.success(); return ServiceResponse.success();
} }
if(StringUtils.isNotBlank(newClerkId)) {
this.hmClerkRelationService.updateByClerkChangeStore(enterpriseId, clerkId ,newClerkId);
}else {
for (HmClerkRelationBO hmClerkRelationBO : hmClerkRelationBOS) { for (HmClerkRelationBO hmClerkRelationBO : hmClerkRelationBOS) {
Long hmId = hmClerkRelationBO.getHmId(); Long hmId = hmClerkRelationBO.getHmId();
List<String> clerkIds = hmClerkRelationService.getClerkIdByHmId(hmId); List<String> clerkIds = hmClerkRelationService.getClerkIdByHmId(hmId);
...@@ -71,6 +72,7 @@ public class HmClerkRelationApiServiceImpl implements HmClerkRelationApiService ...@@ -71,6 +72,7 @@ public class HmClerkRelationApiServiceImpl implements HmClerkRelationApiService
hmQrcodeApiService.delById(hmId, invokingType, null); hmQrcodeApiService.delById(hmId, invokingType, null);
} }
} }
}
return ServiceResponse.success(); return ServiceResponse.success();
} }
......
...@@ -212,5 +212,11 @@ ...@@ -212,5 +212,11 @@
where store_id = #{storeId} and enterprise_id = #{enterpriseId} where store_id = #{storeId} and enterprise_id = #{enterpriseId}
</update> </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> </mapper>
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