大屏接口

dev_0531
yechenhao 5 years ago
parent 5eb5c0c439
commit 13e7340b9d

@ -25,4 +25,5 @@ public interface OpVipDOMapper extends BaseMapper<OpVip> {
Long selectVipCountNew();
Long selectVipCountByStoreIds(@Param("shopIds")List<Long> shopIdList);
}

@ -174,6 +174,8 @@ public class CustomerViewService {
*/
public CustomerViewVO selectCustomerViewMain(Long userId, String selectStartTime, String selectEndTime, String startTime, String endTime){
CustomerViewVO customerViewVO = new CustomerViewVO();
//会员总数
Long vipCount = 0L;
//shopIds
List<Long> shopIdList = new ArrayList<>();
PrivilageRoleDO privilageRoleDO = privilageRoleDOMapper.selectRoleByUserId(userId);
@ -183,6 +185,7 @@ public class CustomerViewService {
//店长
if(privilageRoleDO.getCode().equals(RoleEnum.ROLE_CODE_DZ.getRoleCode())) {
shopIdList = poiStoreStaffDOMapper.selectByUserId(userId);
vipCount = opVipDOMapper.selectVipCountByStoreIds(shopIdList);
}
//运营人员
else if (privilageRoleDO.getCode().equals(RoleEnum.ROLE_CODE_YYRY.getRoleCode())) {
@ -192,10 +195,12 @@ public class CustomerViewService {
//查询零售公司的门店
List<PoiStore> list1 = retailCompanyService.selectShopByCompany(pm.get(0).getOrgId());
shopIdList = list1.stream().map(PoiStore::getId).collect(Collectors.toList());
vipCount = opVipDOMapper.selectVipCountByStoreIds(shopIdList);
}
//管理员/总运营人员
else if (privilageRoleDO.getCode().equals(RoleEnum.ROLE_CODE_GLY.getRoleCode()) || privilageRoleDO.getCode().equals(RoleEnum.ROLE_CODE_ALL_YYRY.getRoleCode())) {
shopIdList = poiStoreStaffDOMapper.selectAllShopId(null,null);
vipCount = opVipDOMapper.selectVipCountNew();
}
if(CollectionUtils.isEmpty(shopIdList)){
@ -204,8 +209,7 @@ public class CustomerViewService {
//柱状图好友趋势图
List<OpCustomer> customerList = opCustomerDOMapper.selectCustomerList(shopIdList, null, null, startTime, endTime);
//会员总数
Long vipCount = opVipDOMapper.selectVipCountNew();
customerViewVO.setAllVipCount(vipCount);
//设置趋势柱状图list

@ -43,6 +43,21 @@
</select>
<!--会员总数-->
<select id="selectVipCountByStoreIds" resultType="Long">
select count(t1.id)
from op_vip t1,op_customer t2
<where>
<if test="shopIds != null and shopIds.size > 0">
and t2.register_store_id in
<foreach collection="shopIds" separator="," item="item" index="index" close=")" open="(">
#{item}
</foreach>
</if>
</where>
</select>
<select id="selectVipCountNew" resultType="Long">
select count(t1.id)
from op_vip t1

Loading…
Cancel
Save