Browse Source

发放积分

傅行帆 5 years ago
parent
commit
d8ad0fe746

+ 4
- 12
src/main/java/com/huiju/estateagents/service/impl/TaPersonServiceImpl.java View File

152
         }
152
         }
153
 
153
 
154
         iTaRecommendCustomerService.newByPerson(person);
154
         iTaRecommendCustomerService.newByPerson(person);
155
-
156
-        //查看是否领取过授权积分
157
-        QueryWrapper<TaPointsRecords> taPointsRecordsQueryWrapper = new QueryWrapper<>();
158
-        taPointsRecordsQueryWrapper.eq("person_id", person.getPersonId());
159
-        taPointsRecordsQueryWrapper.eq("change_type",CommConstant.POINTS_AUTHORIZE);
160
-
161
-        List<TaPointsRecords> taPointsRecordsList = taPointsRecordsMapper.selectList(taPointsRecordsQueryWrapper);
162
-        if (taPointsRecordsList.size() < 1){
163
-            //发放积分(成为经纪人ID 是4)
164
-            applicationContext.publishEvent(new PointsEvent(person.getPersonId(),CommConstant.POINTS_AUTHORIZE));
165
-        }
166
-
155
+        
156
+        //发放积分(成为经纪人ID 是4)
157
+        applicationContext.publishEvent(new PointsEvent(person.getPersonId(),CommConstant.POINTS_AUTHORIZE));
158
+        
167
         return person;
159
         return person;
168
     }
160
     }
169
 
161
 

+ 11
- 2
src/main/java/com/huiju/estateagents/service/impl/TaPointsRecordsServiceImpl.java View File

18
 import org.springframework.stereotype.Service;
18
 import org.springframework.stereotype.Service;
19
 
19
 
20
 import java.time.LocalDateTime;
20
 import java.time.LocalDateTime;
21
+import java.util.List;
21
 import java.util.Map;
22
 import java.util.Map;
22
 
23
 
23
 /**
24
 /**
47
 	
48
 	
48
 	@Override
49
 	@Override
49
 	public void authPoints(String personId) {
50
 	public void authPoints(String personId) {
50
-		TaPerson person = taPersonMapper.selectById(personId);
51
-		sendPoints(person,4,CommConstant.POINTS_AUTHORIZE);
51
+		//查看是否领取过授权积分
52
+		QueryWrapper<TaPointsRecords> taPointsRecordsQueryWrapper = new QueryWrapper<>();
53
+		taPointsRecordsQueryWrapper.eq("person_id", personId);
54
+		taPointsRecordsQueryWrapper.eq("change_type",CommConstant.POINTS_AUTHORIZE);
55
+		
56
+		List<TaPointsRecords> taPointsRecordsList = taPointsRecordsMapper.selectList(taPointsRecordsQueryWrapper);
57
+		if (taPointsRecordsList.size() < 1){
58
+			TaPerson person = taPersonMapper.selectById(personId);
59
+			sendPoints(person,4,CommConstant.POINTS_AUTHORIZE);
60
+		}
52
 	}
61
 	}
53
 	
62
 	
54
 	private void sendPoints(TaPerson person,Integer rulesId,String shareType) {
63
 	private void sendPoints(TaPerson person,Integer rulesId,String shareType) {