客户回调接口

master
Caps 6 years ago
parent a9e199f743
commit a4e81708ab

@ -37,11 +37,17 @@ import java.util.stream.Collectors;
@Service
public class RetailCompanyService {
/**区域*/
/**
*
*/
static final Integer LEVEL_REGION = 1;
/**零售公司*/
/**
*
*/
static final Integer LEVEL_COMPANY = 2;
/**客户*/
/**
*
*/
static final Integer LEVEL_CUSTOMER = 3;
private RetailCompanyMapper retailCompanyMapper;
@ -72,6 +78,7 @@ public class RetailCompanyService {
/**
*
*
* @param parentId id
* @param userId id
* @param level
@ -80,14 +87,16 @@ public class RetailCompanyService {
public List<PrivilageOrganizational> getUserOrg(Long parentId, long userId, int level) {
QueryWrapper<PrivilageOrganizationalMember> wrapper1 = new QueryWrapper<>();
if(!check(userId)){
wrapper1.eq("user_id", userId);
}
PrivilageOrganizational p = new PrivilageOrganizational();
List<PrivilageOrganizationalMember> pm = organizationalMemberMapper.selectList(wrapper1);
QueryWrapper<PrivilageOrganizational> wrapper = new QueryWrapper<>();
if(check(userId)){
wrapper.eq("level",level).eq("type",1).eq("status", 1);
return retailCompanyMapper.selectList(wrapper);
}
if (pm.isEmpty()) {
return null;
return new ArrayList<>();
} else {
wrapper.eq("type", 1).eq("status", 1).eq("level", level).
in("id", pm.stream().map(PrivilageOrganizationalMember::getOrgId).
@ -104,13 +113,15 @@ public class RetailCompanyService {
*/
public List<PrivilageOrganizational> listOfBigRetailCompany(long userId) {
QueryWrapper<PrivilageOrganizationalMember> wrapper1 = new QueryWrapper<>();
if(!check(userId)){
wrapper1.eq("user_id", userId);
}
List<PrivilageOrganizationalMember> pm = organizationalMemberMapper.selectList(wrapper1);
QueryWrapper<PrivilageOrganizational> wrapper = new QueryWrapper<>();
if(check(userId)){
wrapper.eq("type", 1).eq("level", 1).eq("status", 1);
return retailCompanyMapper.selectList(wrapper);
}
if (pm.isEmpty()) {
return null;
return new ArrayList<>();
} else {
wrapper.eq("type", 1).eq("level", 1).eq("status", 1).in("id", pm.stream().map(PrivilageOrganizationalMember::getOrgId).collect(Collectors.toList()));
return retailCompanyMapper.selectList(wrapper);
@ -133,10 +144,11 @@ public class RetailCompanyService {
*/
public List<PrivilageOrganizational> listOfRetailOrg(long userId, Long regionId, Long companyId, Long customerId) {
QueryWrapper<PrivilageOrganizationalMember> wrapper1 = new QueryWrapper<>();
if(!check(userId)){
wrapper1.eq("user_id", userId);
}
List<PrivilageOrganizationalMember> pm = organizationalMemberMapper.selectList(wrapper1);
if(check(userId)){
return retailCompanyMapper.selectList(null);
}
if (pm.isEmpty()) {
return new ArrayList<>();
} else {
@ -177,25 +189,27 @@ public class RetailCompanyService {
bigRegionId = null;
}
QueryWrapper<PrivilageOrganizationalMember> wrapper1 = new QueryWrapper<>();
if(!check(userId)){
wrapper1.eq("user_id", userId);
}
List<PrivilageOrganizationalMember> pm = organizationalMemberMapper.selectList(wrapper1);
QueryWrapper<PrivilageOrganizational> wrapper = new QueryWrapper<>();
if(check(userId)){
wrapper.eq("type", 1).eq("level", 2).eq("status", 1);
return retailCompanyMapper.selectList(wrapper);
}
if (pm.isEmpty()) {
return null;
return new ArrayList<>();
} else {
wrapper.eq("type", 1).eq("level", 2).eq("status", 1).in("id", pm.stream().map(PrivilageOrganizationalMember::getOrgId).collect(Collectors.toList()));
if (bigRegionId != null) {
wrapper.eq("parent_id", bigRegionId);
}
List<PrivilageOrganizational> privilageOrganizationals = retailCompanyMapper.selectList(wrapper);
return privilageOrganizationals;
return retailCompanyMapper.selectList(wrapper);
}
}
/**
*
*
* @param orgId id
* @return
*/
@ -209,7 +223,8 @@ public class RetailCompanyService {
/**
*
* @param orgId id
*
* @param bigRegionId id
* @return
*/
public List<PoiStore> selectShopByBigRegion(Long bigRegionId) {
@ -225,6 +240,7 @@ public class RetailCompanyService {
/**
*
*
* @param orgId id
* @return
*/
@ -234,6 +250,7 @@ public class RetailCompanyService {
/**
*
*
* @param shopId id
* @return
*/
@ -243,6 +260,7 @@ public class RetailCompanyService {
/**
* 广
*
* @param startTime
* @param endTime
* @param orgId
@ -316,6 +334,7 @@ public class RetailCompanyService {
/**
*
*
* @param startTime
* @param endTime
* @param organizationalVO
@ -356,6 +375,7 @@ public class RetailCompanyService {
organizationalVO.setAvgNewCustomer(check(countEnd - count, days));
organizationalVO.setAvgNewEffectiveCustomer(check(countEnd2 - count2, days));
}
private void newCustomerStore(String startTime, String endTime, DataVO organizationalVO, List<Long> storeIds) {
//最初时间的总客户人数
QueryWrapper<OpSellerCustomerRelation> wrapper2 = new QueryWrapper<>();
@ -395,6 +415,7 @@ public class RetailCompanyService {
/**
*
*
* @param l1
* @param l2
* @return
@ -409,6 +430,7 @@ public class RetailCompanyService {
/**
* 广
*
* @param startTime
* @param endTime
* @param orgId id
@ -470,6 +492,7 @@ public class RetailCompanyService {
/**
* 广
*
* @param startTime
* @param endTime
* @param orgId id

Loading…
Cancel
Save