@RequestMapping("/list") @ResponseBody public String list(@ModelAttribute PayChannel payChannel, Integer pageIndex, Integer pageSize) { PageModel pageModel = new PageModel(); int count = payChannelService.count(payChannel); if(count <= 0) return JSON.toJSONString(pageModel); List<PayChannel> payChannelList = payChannelService.getPayChannelList((pageIndex-1)*pageSize, pageSize, payChannel); if(!CollectionUtils.isEmpty(payChannelList)) { JSONArray array = new JSONArray(); for(PayChannel pc : payChannelList) { JSONObject object = (JSONObject) JSONObject.toJSON(pc); object.put("createTime", DateUtil.date2Str(pc.getCreateTime())); array.add(object); } pageModel.setList(array); } pageModel.setCount(count); pageModel.setMsg("ok"); pageModel.setRel(true); return JSON.toJSONString(pageModel); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); result = prime * result + ((getChannelId() == null) ? 0 : getChannelId().hashCode()); result = prime * result + ((getChannelName() == null) ? 0 : getChannelName().hashCode()); result = prime * result + ((getChannelMchId() == null) ? 0 : getChannelMchId().hashCode()); result = prime * result + ((getMchId() == null) ? 0 : getMchId().hashCode()); result = prime * result + ((getState() == null) ? 0 : getState().hashCode()); result = prime * result + ((getParam() == null) ? 0 : getParam().hashCode()); result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode()); result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); return result; } }
@Override public boolean equals(Object that) { if (this == that) { return true; } if (that == null) { return false; } if (getClass() != that.getClass()) { return false; } PayChannel other = (PayChannel) that; return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) && (this.getChannelId() == null ? other.getChannelId() == null : this.getChannelId().equals(other.getChannelId())) && (this.getChannelName() == null ? other.getChannelName() == null : this.getChannelName().equals(other.getChannelName())) && (this.getChannelMchId() == null ? other.getChannelMchId() == null : this.getChannelMchId().equals(other.getChannelMchId())) && (this.getMchId() == null ? other.getMchId() == null : this.getMchId().equals(other.getMchId())) && (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState())) && (this.getParam() == null ? other.getParam() == null : this.getParam().equals(other.getParam())) && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark())) && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())); }