优化接口。

dev
kevin jiang 5 years ago
parent e4067e7703
commit acea52a01c

@ -665,22 +665,22 @@ public class CustomerViewService {
shopIdList = list1.stream().map(PoiStore::getId).collect(Collectors.toList()); shopIdList = list1.stream().map(PoiStore::getId).collect(Collectors.toList());
List<String> cpUserIds = privilageCpUserStoreDOMapper.selectCpUserIdsByStoreIds(shopIdList); List<String> cpUserIds = privilageCpUserStoreDOMapper.selectCpUserIdsByStoreIds(shopIdList);
Long all = privilageCpUserDOMapper.selectStoresCount(cpUserIds); Long all = privilageCpUserDOMapper.selectStoresCount(cpUserIds);
List<Map<String, String>> dis = privilageCpUserDOMapper.selectDistinctStoresCount(cpUserIds); List<Map<String, Object>> dis = privilageCpUserDOMapper.selectDistinctStoresCount(cpUserIds);
result.setAllCustomer(all); result.setAllCustomer(all);
if(null != dis){ if(null != dis){
result.setAllValidCustomer(Long.parseLong(dis.get(0).get("rows"))); result.setAllValidCustomer(Long.parseLong(dis.get(0).get("rows").toString()));
} }
} }
//管理员/总运营人员 //管理员/总运营人员
else if (privilageRoleDO.getCode().equals(RoleEnum.ROLE_CODE_GLY.getRoleCode()) || privilageRoleDO.getCode().equals(RoleEnum.ROLE_CODE_ALL_YYRY.getRoleCode())) { else if (privilageRoleDO.getCode().equals(RoleEnum.ROLE_CODE_GLY.getRoleCode()) || privilageRoleDO.getCode().equals(RoleEnum.ROLE_CODE_ALL_YYRY.getRoleCode())) {
Long all = privilageCpUserDOMapper.selectAllCount(); Long all = privilageCpUserDOMapper.selectAllCount();
List<Map<String, String>> dis = privilageCpUserDOMapper.selectDistinctAllCount(); List<Map<String, Object>> dis = privilageCpUserDOMapper.selectDistinctAllCount();
result.setAllCustomer(all); result.setAllCustomer(all);
if(null != dis){ if(null != dis){
result.setAllValidCustomer(Long.parseLong(dis.get(0).get("rows"))); result.setAllValidCustomer(Long.parseLong(dis.get(0).get("rows").toString()));
} }
} }

@ -19,7 +19,7 @@ public interface PrivilageCpUserDOMapper extends BaseMapper<PrivilageCpUserDO> {
Long selectAllCount(); Long selectAllCount();
List<Map<String, String>> selectDistinctAllCount(); List<Map<String, Object>> selectDistinctAllCount();
List<String> selectCustomerIdsByCpUserId(@Param("cpUserId")String cpUserId); List<String> selectCustomerIdsByCpUserId(@Param("cpUserId")String cpUserId);
@ -29,7 +29,7 @@ public interface PrivilageCpUserDOMapper extends BaseMapper<PrivilageCpUserDO> {
Long selectStoresCount(@Param("cpUserIds")List<String> cpUserIds); Long selectStoresCount(@Param("cpUserIds")List<String> cpUserIds);
List<Map<String, String>> selectDistinctStoresCount(@Param("cpUserIds")List<String> cpUserIds); List<Map<String, Object>> selectDistinctStoresCount(@Param("cpUserIds")List<String> cpUserIds);
Long selectStoresCountById(@Param("shopIds")List<Long> shopIds); Long selectStoresCountById(@Param("shopIds")List<Long> shopIds);

Loading…
Cancel
Save