yansen 5 年前
父节点
当前提交
53e8d31af2

+ 1
- 1
src/main/java/com/huiju/estateagents/service/ITaRecommendCustomerService.java 查看文件

@@ -187,5 +187,5 @@ public interface ITaRecommendCustomerService extends IService<TaRecommendCustome
187 187
      * @return
188 188
      * @throws Exception
189 189
      */
190
-    List<TaRecommendCustomer> newCustomer(Integer orgId, TaPerson person, TaPerson recommender, TaUser consultant, TaBuilding building, TaCustomerFrom from) throws Exception;
190
+    List<TaRecommendCustomer> newCustomer(Integer orgId, TaPerson person, TaPerson recommender, TaPerson consultant, TaBuilding building, TaCustomerFrom from) throws Exception;
191 191
 }

+ 1
- 2
src/main/java/com/huiju/estateagents/service/impl/TaPersonServiceImpl.java 查看文件

@@ -930,10 +930,9 @@ public class TaPersonServiceImpl extends ServiceImpl<TaPersonMapper, TaPerson> i
930 930
         TaBuilding building = StringUtils.isEmpty(buildingId) ? null : taBuildingMapper.selectById(buildingId);
931 931
         // 是否置业顾问
932 932
         boolean isConsultant = null != recPerson && CommConstant.PERSON_REALTY_CONSULTANT.equals(recPerson.getPersonType());
933
-        TaUser consultant = isConsultant ? taUserMapper.selectById(recPerson.getUserId()) : null;
934 933
 
935 934
         try {
936
-            List<TaRecommendCustomer> customerList = iTaRecommendCustomerService.newCustomer(orgId, person, recPerson, consultant, building, customerFrom);
935
+            List<TaRecommendCustomer> customerList = iTaRecommendCustomerService.newCustomer(orgId, person, recPerson, isConsultant ? recPerson : null, building, customerFrom);
937 936
             if (customerList.size() > 0) {
938 937
                 // 发放积分
939 938
                 applicationContext.publishEvent(new EventBus(person, EventBus.EventType.SignUpAgent, orgId));

+ 8
- 2
src/main/java/com/huiju/estateagents/service/impl/TaRecommendCustomerServiceImpl.java 查看文件

@@ -174,7 +174,7 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
174 174
     }
175 175
 
176 176
     @Override
177
-    public List<TaRecommendCustomer> newCustomer(Integer orgId, TaPerson person, TaPerson recommender, TaUser consultant, TaBuilding building, TaCustomerFrom from) throws Exception {
177
+    public List<TaRecommendCustomer> newCustomer(Integer orgId, TaPerson person, TaPerson recommender, TaPerson consultant, TaBuilding building, TaCustomerFrom from) throws Exception {
178 178
         // 如果置业推荐了非自己绑定楼盘, 会生成 2 条客户记录
179 179
         List<TaRecommendCustomer> result = new ArrayList<>();
180 180
         List<TaBuilding> consultBuildings = null;
@@ -186,11 +186,17 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
186 186
             }
187 187
         }
188 188
 
189
+        //
190
+        LocalDateTime now = LocalDateTime.now();
191
+        from.setOrgId(orgId);
192
+        from.setPersonId(person.getPersonId());
193
+        from.setPersonName(StringUtils.ifNull(person.getName(), person.getNickname()));
194
+        from.setCreateDate(now);
195
+
189 196
         Map<String, Number> checkNum = taRecommendCustomerMapper.checkCustomerBy(orgId, person.getPersonId(), consultBuildingIds, null != building ? building.getBuildingId() : null);
190 197
         boolean hasOrgCust = checkNum.get("orgNum").intValue() > 0;
191 198
         boolean hasConsultCust = checkNum.get("consultNum").intValue() > 0;
192 199
         boolean hasBuildingCust = checkNum.get("buildingNum").intValue() > 0;
193
-        LocalDateTime now = LocalDateTime.now();
194 200
 
195 201
         // 控制是否需要插入小程序级别公客
196 202
         boolean inserted = false;