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 queryList(TargetUserModel model){ return service.queryList(model); } /** * 查询意向用户列表 * @param model * @return */ @PostMapping(MODEL + "/tuser/queryListMap.json") @ResponseBody Map queryListMap(TargetUserModel model){ return service.queryListMap(model); } /** * 查询意向用户列表 * @param model * @return */ @PostMapping(MODEL + "/tuser/back/queryListMap.json") @ResponseBody Map backQueryListMap(TargetUserModel model){ return service.queryListMap(model); } @GetMapping(MODEL + "/tuser/cuserDetail.json") ModelAndView cuserDetail(String phone){ // 根据手机号码查询出,这个手机号码在user_info的user_id, phone, userType Map map = cuserConsoleService.queryCuserByPhone(phone); if(map == null && map.get("data") == null){ return null; } List> data = (List>) map.get("data"); if(data.size() > 0) { return cuserConsoleController.queryCuserDetailIndex(data.get(0).get("userId")+"", phone, "1"); } return null; } }