|
@@ -193,10 +193,11 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
|
193
|
193
|
from.setPersonName(StringUtils.ifNull(person.getName(), person.getNickname()));
|
194
|
194
|
from.setCreateDate(now);
|
195
|
195
|
|
196
|
|
- Map<String, Number> checkNum = taRecommendCustomerMapper.checkCustomerBy(orgId, person.getPersonId(), consultBuildingIds, null != building ? building.getBuildingId() : null);
|
|
196
|
+ Map<String, Number> checkNum = taRecommendCustomerMapper.checkCustomerBy(orgId, person.getPersonId(), consultBuildingIds, null != building ? building.getBuildingId() : null, consultant != null ? consultant.getPersonId() : null, consultant != null ? consultant.getUserId() : null);
|
197
|
197
|
boolean hasOrgCust = checkNum.get("orgNum").intValue() > 0;
|
198
|
|
- boolean hasConsultCust = checkNum.get("consultNum").intValue() > 0;
|
|
198
|
+ boolean hasConsultBingBuildCust = checkNum.get("consultBindBuildingNum").intValue() > 0;
|
199
|
199
|
boolean hasBuildingCust = checkNum.get("buildingNum").intValue() > 0;
|
|
200
|
+ boolean hasConstCust = checkNum.get("consultNum") == null ? true : checkNum.get("consultNum").intValue() > 0;
|
200
|
201
|
|
201
|
202
|
// 控制是否需要插入小程序级别公客
|
202
|
203
|
boolean inserted = false;
|
|
@@ -206,7 +207,7 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
|
206
|
207
|
boolean personTypeFlag = CommConstant.PERSON_REALTY_CONSULTANT.equals(person.getPersonType()) ? true : false;
|
207
|
208
|
|
208
|
209
|
// 私客
|
209
|
|
- if (null != consultant && !hasConsultCust && null != consultBuildings) {
|
|
210
|
+ if (null != consultant && hasConsultBingBuildCust && null != consultBuildings && !hasConstCust) {
|
210
|
211
|
TaBuilding taBuilding = null;
|
211
|
212
|
if (consultBuildingIds.contains(null != building ? building.getBuildingId() : null)) {
|
212
|
213
|
taBuilding = building;
|