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 queryList(TargetUserModel model){ if(!StringUtils.isEmpty(model.getRegsterType()) && model.getRegsterType().equals("2")){ model.setRegsterType1("3"); } Map m = new HashMap<>(); List list = dao.queryList(model); m.put("data",list); m.put("count",dao.queryListCount(model)); m.put("code", 0); return m; } public Map queryListMap(TargetUserModel model){ if(!StringUtils.isEmpty(model.getRegsterType()) && model.getRegsterType().equals("2")){ model.setRegsterType1("3"); } Map m = new HashMap<>(); List list = dao.queryList(model); List userList = dao.queryUser(); for(TargetUserModel tum : userList){ if(StringUtils.isEmpty(tum.getOrderId())){ tum.setRegsterType("2"); }else{ tum.setRegsterType("3"); } } Map mx = new HashMap<>(); for(TargetUserModel tum : list){ mx.put(tum.getMobile(), tum); } for (TargetUserModel tum : userList){ mx.put(tum.getMobile(), tum); } Collection valueCollection2 = mx.values(); List valueList= new ArrayList(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 backQueryListMap(TargetUserModel model){ if(!StringUtils.isEmpty(model.getRegsterType()) && model.getRegsterType().equals("2")){ model.setRegsterType1("3"); } Map m = new HashMap<>(); List list = dao.queryList(model); List userList = dao.queryUser(); for(TargetUserModel tum : userList){ if(StringUtils.isEmpty(tum.getOrderId())){ tum.setRegsterType("2"); }else{ tum.setRegsterType("3"); } } Map mx = new HashMap<>(); for(TargetUserModel tum : list){ mx.put(tum.getMobile(), tum); } for (TargetUserModel tum : userList){ mx.put(tum.getMobile(), tum); } Collection valueCollection2 = mx.values(); List valueList= new ArrayList(valueCollection2);//map转list m.put("data",valueList); m.put("count",valueList.size()); m.put("regCount",userList.size()); m.put("code", 0); return m; }*/ }