Helius
2021-06-16 5728be2af515b2200e782aa201ca5d4d67d9ea47
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
package com.ibeetl.admin.console.service;
 
import com.ibeetl.admin.console.dao.CuserConsoleDao;
import com.ibeetl.admin.console.dao.TargetUserConsoleDao;
import com.ibeetl.admin.console.model.TargetUserModel;
import com.ibeetl.admin.console.model.UserModel;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.*;
 
@Service
public class TargetUserConsoleService{
 
    @Autowired
    TargetUserConsoleDao dao;
    
    @Autowired
    CuserConsoleDao cuserConsoleDao;
 
 
    public Map<String, Object> queryList(TargetUserModel model){
        if(!StringUtils.isEmpty(model.getRegsterType()) && model.getRegsterType().equals("2")){
            model.setRegsterType1("3");
        }
        Map<String, Object> m = new HashMap<>();
        List<TargetUserModel> list = dao.queryList(model);
        m.put("data",list);
        m.put("count",dao.queryListCount(model));
        m.put("code", 0);
        return  m;
    }
    public Map<String, Object> queryListMap(TargetUserModel model){
        if(!StringUtils.isEmpty(model.getRegsterType()) && model.getRegsterType().equals("2")){
            model.setRegsterType1("3");
        }
        Map<String, Object> m = new HashMap<>();
        List<TargetUserModel> list = dao.queryList(model);
        List<TargetUserModel> userList = dao.queryUser();
 
        for(TargetUserModel tum : userList){
            if(StringUtils.isEmpty(tum.getOrderId())){
                tum.setRegsterType("2");
            }else{
                tum.setRegsterType("3");
            }
        }
 
        Map<String, TargetUserModel> mx = new HashMap<>();
        for(TargetUserModel tum : list){
            mx.put(tum.getMobile(), tum);
        }
        for (TargetUserModel tum : userList){
            mx.put(tum.getMobile(), tum);
        }
 
        Collection<TargetUserModel> valueCollection2 = mx.values();
        List<TargetUserModel> valueList= new ArrayList<TargetUserModel>(valueCollection2);//map转list
 
        m.put("data",valueList);
        m.put("count",valueList.size());
        m.put("regCount",userList.size());
        m.put("code", 0);
        return  m;
    }
 
    /*public Map<String, Object> backQueryListMap(TargetUserModel model){
        if(!StringUtils.isEmpty(model.getRegsterType()) && model.getRegsterType().equals("2")){
            model.setRegsterType1("3");
        }
        Map<String, Object> m = new HashMap<>();
        List<TargetUserModel> list = dao.queryList(model);
        List<TargetUserModel> userList = dao.queryUser();
 
        for(TargetUserModel tum : userList){
            if(StringUtils.isEmpty(tum.getOrderId())){
                    tum.setRegsterType("2");
            }else{
                tum.setRegsterType("3");
            }
        }
 
        Map<String, TargetUserModel> mx = new HashMap<>();
        for(TargetUserModel tum : list){
            mx.put(tum.getMobile(), tum);
        }
        for (TargetUserModel tum : userList){
            mx.put(tum.getMobile(), tum);
        }
 
        Collection<TargetUserModel> valueCollection2 = mx.values();
        List<TargetUserModel> valueList= new ArrayList<TargetUserModel>(valueCollection2);//map转list
 
        m.put("data",valueList);
        m.put("count",valueList.size());
        m.put("regCount",userList.size());
        m.put("code", 0);
        return  m;
    }*/
 
}