删除客户导购关系

dev_0531
yechenhao 5 years ago
parent 4a644581f3
commit 532db849f4

@ -647,9 +647,8 @@ public class CustomerViewService {
//店长
if(privilageRoleDO.getCode().equals(RoleEnum.ROLE_CODE_DZ.getRoleCode())) {
shopIdList = poiStoreStaffDOMapper.selectByUserId(userId);
String cpUserId = privilageCpUserStoreDOMapper.selectCpUserIdByStoreId(shopIdList.get(0));
Long storeAll = privilageCpUserDOMapper.selectStoreCount(cpUserId);
Long storeDis = privilageCpUserDOMapper.selectDistinctStoreCount(cpUserId);
Long storeAll = privilageCpUserDOMapper.selectStoresCountById(shopIdList);
Long storeDis = privilageCpUserDOMapper.selectDistinctStoresCountById(shopIdList);
result.setAllCustomer(storeAll);
result.setAllValidCustomer(storeDis);
@ -663,9 +662,8 @@ public class CustomerViewService {
//查询零售公司的门店
List<PoiStore> list1 = retailCompanyService.selectShopByCompany(pm.get(0).getOrgId());
shopIdList = list1.stream().map(PoiStore::getId).collect(Collectors.toList());
List<String> cpUserIds = privilageCpUserStoreDOMapper.selectCpUserIdsByStoreIds(shopIdList);
Long all = privilageCpUserDOMapper.selectStoresCount(cpUserIds);
Long dis = privilageCpUserDOMapper.selectDistinctStoresCount(cpUserIds);
Long all = privilageCpUserDOMapper.selectStoresCountById(shopIdList);
Long dis = privilageCpUserDOMapper.selectDistinctStoresCountById(shopIdList);
result.setAllCustomer(all);
result.setAllValidCustomer(dis);

@ -31,6 +31,10 @@ public interface PrivilageCpUserDOMapper extends BaseMapper<PrivilageCpUserDO> {
Long selectDistinctStoresCount(@Param("cpUserIds")List<String> cpUserIds);
Long selectStoresCountById(@Param("shopIds")List<Long> shopIds);
Long selectDistinctStoresCountById(@Param("shopIds")List<Long> shopIds);
int deleteCount(@Param("customerUserId")String customerUserId, @Param("cpUserId")String cpUserId);
}

@ -18,11 +18,11 @@
</select>
<select id="selectAllCount" resultType="java.lang.Long">
select count(id) from op_cp_user_customer_relation
select count(id) from op_seller_customer_relation
</select>
<select id="selectDistinctAllCount" resultType="java.lang.Long">
select count(distinct customer_user_id) from op_cp_user_customer_relation
select count(distinct customer_id) from op_seller_customer_relation
</select>
<select id="selectStoreCount" resultType="java.lang.Long">
@ -47,6 +47,19 @@
#{item}
</foreach>
</select>
<select id="selectStoresCountById" resultType="java.lang.Long">
select count(id) from op_seller_customer_relation where store_id in
<foreach collection="shopIds" separator="," item="item" close=")" index="index" open="(">
#{item}
</foreach>
</select>
<select id="selectDistinctStoresCountById" resultType="java.lang.Long">
select count(distinct customer_id) from op_seller_customer_relation where store_id in
<foreach collection="shopIds" separator="," item="item" close=")" index="index" open="(">
#{item}
</foreach>
</select>
<select id="selectCustomerIdsByCpUserId" resultType="java.lang.String">

Loading…
Cancel
Save