|
@@ -11,6 +11,7 @@ import com.huiju.estateagents.entity.TaPerson;
|
11
|
11
|
import com.huiju.estateagents.entity.TaPointsRecords;
|
12
|
12
|
import com.huiju.estateagents.service.ITaPersonService;
|
13
|
13
|
import com.huiju.estateagents.service.ITaPointsRecordsService;
|
|
14
|
+import org.apache.ibatis.annotations.Mapper;
|
14
|
15
|
import org.slf4j.Logger;
|
15
|
16
|
import org.slf4j.LoggerFactory;
|
16
|
17
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -23,7 +24,9 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
23
|
24
|
import org.springframework.web.bind.annotation.RestController;
|
24
|
25
|
|
25
|
26
|
import javax.servlet.http.HttpServletRequest;
|
|
27
|
+import java.util.HashMap;
|
26
|
28
|
import java.util.List;
|
|
29
|
+import java.util.Map;
|
27
|
30
|
|
28
|
31
|
/**
|
29
|
32
|
* <p>
|
|
@@ -204,7 +207,14 @@ public class TaPointsRecordsController extends BaseController {
|
204
|
207
|
queryWrapper.eq("person_id",taPersonService.getPersonIdByCustomerId(id));
|
205
|
208
|
queryWrapper.orderByDesc("create_date");
|
206
|
209
|
IPage<TaPointsRecords> result = iTaPointsRecordsService.page(pg, queryWrapper);
|
207
|
|
- responseBean.addSuccess(result);
|
|
210
|
+ Integer totalPoints = 0;
|
|
211
|
+ for (int i = 0;i<result.getRecords().size();i++){
|
|
212
|
+ totalPoints += result.getRecords().get(i).getPointsAmount();
|
|
213
|
+ }
|
|
214
|
+ Map<String,Object> data = new HashMap<>();
|
|
215
|
+ data.put("totalPoints",totalPoints);
|
|
216
|
+ data.put("result",result);
|
|
217
|
+ responseBean.addSuccess(data);
|
208
|
218
|
}catch (Exception e){
|
209
|
219
|
e.printStackTrace();
|
210
|
220
|
logger.error("taPointsRecordsList -=- {}",e.toString());
|