| | |
| | | import com.stylefeng.guns.core.util.*; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.IInviteService; |
| | | import com.stylefeng.guns.modular.system.service.ITCompanyService; |
| | | import com.stylefeng.guns.modular.system.service.ITDriverService; |
| | | import com.stylefeng.guns.modular.system.util.HttpRequestUtil; |
| | | import com.stylefeng.guns.modular.system.util.PushURL; |
| | | import org.apache.commons.lang.time.DateUtils; |
| | |
| | | |
| | | @Autowired |
| | | private ITUserService tUserService; |
| | | |
| | | @Autowired |
| | | private ITDriverService driverService; |
| | | |
| | | /** |
| | | * 跳转到用户管理首页 |
| | |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tUser.html"; |
| | | } |
| | | @RequestMapping("/invite/{id}") |
| | | public String inviteList(@PathVariable("id")Integer id, Model model) { |
| | | model.addAttribute("id",id); |
| | | return PREFIX + "tUser_invite.html"; |
| | | } |
| | | |
| | | /** |
| | |
| | | return PREFIX + "tUser_optUser.html"; |
| | | } |
| | | |
| | | @Autowired |
| | | private IInviteService inviteService; |
| | | /** |
| | | * 获取用户管理列表 |
| | | */ |
| | |
| | | String nickName, |
| | | String phone, |
| | | Integer isAuth, |
| | | Integer state,String companyName) { |
| | | Integer state,String companyName, String inviteUser) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | if (SinataUtil.isNotEmpty(insertTime)){ |
| | |
| | | endTime = timeArray[1]; |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | page.setRecords(tUserService.getUserList(page,beginTime,endTime,ShiroKit.getUser().getRoleType(),ShiroKit.getUser().getObjectId(),isAuth,state,id,nickName,phone,companyName)); |
| | | List<Map<String, Object>> userList = tUserService.getUserList(page, beginTime, endTime, ShiroKit.getUser().getRoleType(), ShiroKit.getUser().getObjectId(), isAuth, |
| | | state, id, nickName, phone, companyName, inviteUser); |
| | | for (Map<String, Object> stringObjectMap : userList) { |
| | | String string = stringObjectMap.get("id").toString(); |
| | | int i = inviteService.selectCount(new EntityWrapper<Invite>() |
| | | .eq("inviteUserId", string) |
| | | .eq("userType",1) |
| | | ); |
| | | stringObjectMap.put("inviteNumber", i); |
| | | Invite invite = inviteService.selectOne(new EntityWrapper<Invite>().eq("userId", string)); |
| | | if(null != invite){ |
| | | String inviteUser1 = ""; |
| | | if(1 == invite.getUserType()){ |
| | | inviteUser1 = tUserService.selectById(invite.getInviteUserId()).getPhone(); |
| | | }else{ |
| | | inviteUser1 = driverService.selectById(invite.getInviteUserId()).getPhone(); |
| | | } |
| | | stringObjectMap.put("inviteUser", inviteUser1); |
| | | } |
| | | |
| | | } |
| | | page.setRecords(userList); |
| | | return super.packForBT(page); |
| | | } |
| | | /** |
| | | * 获取用户管理列表-邀请列表 |
| | | */ |
| | | @RequestMapping(value = "/inviteList") |
| | | @ResponseBody |
| | | public Object list(Integer uid,String userName,String time) { |
| | | if (uid==null)return null; |
| | | String startTime = null; |
| | | String endTime = null; |
| | | if (SinataUtil.isNotEmpty(time)){ |
| | | String[] timeArray = time.split(" - "); |
| | | startTime = timeArray[0]+" 00:00:00"; |
| | | endTime = timeArray[1]+" 23:59:59"; |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | List<Map<String, Object>> userList = tUserService.inviteList(page, startTime,endTime,userName,uid); |
| | | for (Map<String, Object> stringObjectMap : userList) { |
| | | String string = stringObjectMap.get("inviteUserId").toString(); |
| | | TUser tUser = tUserService.selectById(string); |
| | | stringObjectMap.put("inviteUserName",tUser.getNickName()); |
| | | } |
| | | page.setRecords(userList); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | |
| | | shellList.add("紧急联系人电话"); |
| | | shellList.add("是否实名认证"); |
| | | shellList.add("历史出行次数"); |
| | | shellList.add("邀请人"); |
| | | shellList.add("邀请次数"); |
| | | shellList.add("历史消费"); |
| | | shellList.add("积分"); |
| | | shellList.add("备注"); |
| | |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("inviteUser"))){ |
| | | shellList.add(object.get("inviteUser").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("inviteNumber"))){ |
| | | shellList.add(object.get("inviteNumber").toString()); |
| | | }else{ |
| | | shellList.add("0"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("consumptionNum"))){ |
| | | shellList.add(object.get("consumptionNum").toString()); |
| | | }else{ |