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
package com.ibeetl.admin.console.web;
 
import com.ibeetl.admin.console.model.TargetUserModel;
import com.ibeetl.admin.console.service.CuserConsoleService;
import com.ibeetl.admin.console.service.TargetUserConsoleService;
import com.ibeetl.admin.core.annotation.Function;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
 
import java.util.List;
import java.util.Map;
 
/**
 * 意向用户操作
 */
@Controller
public class TagretUserConsoleController {
 
    private static final String MODEL = "/admin/targetUser";
    private final Logger log = LoggerFactory.getLogger(this.getClass());
 
    @Autowired
    TargetUserConsoleService service;
 
    @Autowired
    CuserConsoleService cuserConsoleService;
 
    @Autowired
    CuserConsoleController cuserConsoleController;
 
    @GetMapping(MODEL + "/targetUser/index.do")
    ModelAndView index(){
        ModelAndView view = new ModelAndView("/admin/statis/userStatis.html");
        return view;
    }
 
    /**
     * 查询意向用户列表
     * @param model
     * @return
     */
    @PostMapping(MODEL + "/tuser/queryList.json")
    @ResponseBody
    Map<String, Object> queryList(TargetUserModel model){
        return service.queryList(model);
    }
 
    /**
     * 查询意向用户列表
     * @param model
     * @return
     */
    @PostMapping(MODEL + "/tuser/queryListMap.json")
    @ResponseBody
    Map<String, Object> queryListMap(TargetUserModel model){
 
        return service.queryListMap(model);
    }
 
    /**
     * 查询意向用户列表
     * @param model
     * @return
     */
    @PostMapping(MODEL + "/tuser/back/queryListMap.json")
    @ResponseBody
    Map<String, Object> backQueryListMap(TargetUserModel model){
 
        return service.queryListMap(model);
    }
 
    @GetMapping(MODEL  + "/tuser/cuserDetail.json")
    ModelAndView cuserDetail(String phone){
        // 根据手机号码查询出,这个手机号码在user_info的user_id, phone, userType
        Map<String, Object> map = cuserConsoleService.queryCuserByPhone(phone);
        if(map == null && map.get("data") == null){
            return null;
        }
        List<Map<String, Object>> data = (List<Map<String, Object>>) map.get("data");
        if(data.size() > 0) {
           return cuserConsoleController.queryCuserDetailIndex(data.get(0).get("userId")+"", phone, "1");
        }
        return null;
    }
 
}