Compare commits
2 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
2a987c9534 | 1 year ago |
|
|
0b1a6c50c6 | 1 year ago |
@ -0,0 +1,53 @@
|
||||
package com.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotations.TableId;
|
||||
import com.baomidou.mybatisplus.annotations.TableName;
|
||||
import com.baomidou.mybatisplus.enums.IdType;
|
||||
|
||||
/**
|
||||
* 类说明 :
|
||||
*/
|
||||
@TableName("config")
|
||||
public class ConfigEntity implements Serializable{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* key
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* value
|
||||
*/
|
||||
private String value;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,52 @@
|
||||
|
||||
package com.entity;
|
||||
|
||||
/**
|
||||
* 自定义异常
|
||||
*/
|
||||
public class EIException extends RuntimeException {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String msg;
|
||||
private int code = 500;
|
||||
|
||||
public EIException(String msg) {
|
||||
super(msg);
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public EIException(String msg, Throwable e) {
|
||||
super(msg, e);
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public EIException(String msg, int code) {
|
||||
super(msg);
|
||||
this.msg = msg;
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public EIException(String msg, int code, Throwable e) {
|
||||
super(msg, e);
|
||||
this.msg = msg;
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,101 @@
|
||||
package com.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotations.TableId;
|
||||
import com.baomidou.mybatisplus.annotations.TableName;
|
||||
import com.baomidou.mybatisplus.enums.IdType;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 用户
|
||||
*/
|
||||
|
||||
@TableName("shangjia")
|
||||
public class ShangjiaEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户账号
|
||||
*/
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 资质
|
||||
*/
|
||||
private String zizhi;
|
||||
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
private String role;
|
||||
|
||||
private Date addtime;
|
||||
|
||||
private String shenhe;
|
||||
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getZizhi() {
|
||||
return zizhi;
|
||||
}
|
||||
|
||||
public void setZizhi(String zizhi) {
|
||||
this.zizhi = zizhi;
|
||||
}
|
||||
|
||||
public String getRole() {
|
||||
return role;
|
||||
}
|
||||
|
||||
public void setRole(String role) {
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
public Date getAddtime() {
|
||||
return addtime;
|
||||
}
|
||||
|
||||
public void setAddtime(Date addtime) {
|
||||
this.addtime = addtime;
|
||||
}
|
||||
|
||||
public String getShenhe() {
|
||||
return shenhe;
|
||||
}
|
||||
|
||||
public void setShenhe(String shenhe) {
|
||||
this.shenhe = shenhe;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,132 @@
|
||||
package com.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotations.TableId;
|
||||
import com.baomidou.mybatisplus.annotations.TableName;
|
||||
import com.baomidou.mybatisplus.enums.IdType;
|
||||
|
||||
/**
|
||||
* token表
|
||||
*/
|
||||
@TableName("token")
|
||||
public class TokenEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userid;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 表名
|
||||
*/
|
||||
private String tablename;
|
||||
|
||||
/**
|
||||
* 角色
|
||||
*/
|
||||
private String role;
|
||||
|
||||
/**
|
||||
* token
|
||||
*/
|
||||
private String token;
|
||||
|
||||
/**
|
||||
* 过期时间
|
||||
*/
|
||||
private Date expiratedtime;
|
||||
|
||||
/**
|
||||
* 新增时间
|
||||
*/
|
||||
private Date addtime;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getUserid() {
|
||||
return userid;
|
||||
}
|
||||
|
||||
public void setUserid(Long userid) {
|
||||
this.userid = userid;
|
||||
}
|
||||
|
||||
public String getRole() {
|
||||
return role;
|
||||
}
|
||||
|
||||
public void setRole(String role) {
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
public String getToken() {
|
||||
return token;
|
||||
}
|
||||
|
||||
public String getTablename() {
|
||||
return tablename;
|
||||
}
|
||||
|
||||
public void setTablename(String tablename) {
|
||||
this.tablename = tablename;
|
||||
}
|
||||
|
||||
public void setToken(String token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public Date getExpiratedtime() {
|
||||
return expiratedtime;
|
||||
}
|
||||
|
||||
public void setExpiratedtime(Date expiratedtime) {
|
||||
this.expiratedtime = expiratedtime;
|
||||
}
|
||||
|
||||
public Date getAddtime() {
|
||||
return addtime;
|
||||
}
|
||||
|
||||
public void setAddtime(Date addtime) {
|
||||
this.addtime = addtime;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public TokenEntity(Long userid, String username, String tablename,String role, String token, Date expiratedtime) {
|
||||
super();
|
||||
this.userid = userid;
|
||||
this.username = username;
|
||||
this.tablename = tablename;
|
||||
this.role = role;
|
||||
this.token = token;
|
||||
this.expiratedtime = expiratedtime;
|
||||
}
|
||||
|
||||
public TokenEntity() {
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,77 @@
|
||||
package com.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotations.TableId;
|
||||
import com.baomidou.mybatisplus.annotations.TableName;
|
||||
import com.baomidou.mybatisplus.enums.IdType;
|
||||
|
||||
/**
|
||||
* 用户
|
||||
*/
|
||||
@TableName("users")
|
||||
public class UserEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户账号
|
||||
*/
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
private String role;
|
||||
|
||||
private Date addtime;
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getRole() {
|
||||
return role;
|
||||
}
|
||||
|
||||
public void setRole(String role) {
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
public Date getAddtime() {
|
||||
return addtime;
|
||||
}
|
||||
|
||||
public void setAddtime(Date addtime) {
|
||||
this.addtime = addtime;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
package service;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.service.IService;
|
||||
import com.utils.PageUtils;
|
||||
import com.entity.CaipindingdanEntity;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.entity.vo.CaipindingdanVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.view.CaipindingdanView;
|
||||
|
||||
|
||||
/**
|
||||
* 菜品订单
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2021-03-20 21:35:40
|
||||
*/
|
||||
public interface CaipindingdanService extends IService<CaipindingdanEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
List<CaipindingdanVO> selectListVO(Wrapper<CaipindingdanEntity> wrapper);
|
||||
|
||||
CaipindingdanVO selectVO(@Param("ew") Wrapper<CaipindingdanEntity> wrapper);
|
||||
|
||||
List<CaipindingdanView> selectListView(Wrapper<CaipindingdanEntity> wrapper);
|
||||
|
||||
CaipindingdanView selectView(@Param("ew") Wrapper<CaipindingdanEntity> wrapper);
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params,Wrapper<CaipindingdanEntity> wrapper);
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,36 @@
|
||||
package service;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.service.IService;
|
||||
import com.utils.PageUtils;
|
||||
import com.entity.CaipinfenleiEntity;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.entity.vo.CaipinfenleiVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.view.CaipinfenleiView;
|
||||
|
||||
|
||||
/**
|
||||
* 菜品分类
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2021-03-20 21:35:40
|
||||
*/
|
||||
public interface CaipinfenleiService extends IService<CaipinfenleiEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
List<CaipinfenleiVO> selectListVO(Wrapper<CaipinfenleiEntity> wrapper);
|
||||
|
||||
CaipinfenleiVO selectVO(@Param("ew") Wrapper<CaipinfenleiEntity> wrapper);
|
||||
|
||||
List<CaipinfenleiView> selectListView(Wrapper<CaipinfenleiEntity> wrapper);
|
||||
|
||||
CaipinfenleiView selectView(@Param("ew") Wrapper<CaipinfenleiEntity> wrapper);
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params,Wrapper<CaipinfenleiEntity> wrapper);
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,36 @@
|
||||
package service;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.service.IService;
|
||||
import com.utils.PageUtils;
|
||||
import com.entity.CaipinpingjiaEntity;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.entity.vo.CaipinpingjiaVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.view.CaipinpingjiaView;
|
||||
|
||||
|
||||
/**
|
||||
* 菜品评价
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2021-03-20 21:35:40
|
||||
*/
|
||||
public interface CaipinpingjiaService extends IService<CaipinpingjiaEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
List<CaipinpingjiaVO> selectListVO(Wrapper<CaipinpingjiaEntity> wrapper);
|
||||
|
||||
CaipinpingjiaVO selectVO(@Param("ew") Wrapper<CaipinpingjiaEntity> wrapper);
|
||||
|
||||
List<CaipinpingjiaView> selectListView(Wrapper<CaipinpingjiaEntity> wrapper);
|
||||
|
||||
CaipinpingjiaView selectView(@Param("ew") Wrapper<CaipinpingjiaEntity> wrapper);
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params,Wrapper<CaipinpingjiaEntity> wrapper);
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,36 @@
|
||||
package service;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.service.IService;
|
||||
import com.utils.PageUtils;
|
||||
import com.entity.CaipinxinxiEntity;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.entity.vo.CaipinxinxiVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.view.CaipinxinxiView;
|
||||
|
||||
|
||||
/**
|
||||
* 菜品信息
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2021-03-20 21:35:40
|
||||
*/
|
||||
public interface CaipinxinxiService extends IService<CaipinxinxiEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
List<CaipinxinxiVO> selectListVO(Wrapper<CaipinxinxiEntity> wrapper);
|
||||
|
||||
CaipinxinxiVO selectVO(@Param("ew") Wrapper<CaipinxinxiEntity> wrapper);
|
||||
|
||||
List<CaipinxinxiView> selectListView(Wrapper<CaipinxinxiEntity> wrapper);
|
||||
|
||||
CaipinxinxiView selectView(@Param("ew") Wrapper<CaipinxinxiEntity> wrapper);
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params,Wrapper<CaipinxinxiEntity> wrapper);
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,36 @@
|
||||
package service;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.service.IService;
|
||||
import com.utils.PageUtils;
|
||||
import com.entity.CanzhuoEntity;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.entity.vo.CanzhuoVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.view.CanzhuoView;
|
||||
|
||||
|
||||
/**
|
||||
* 餐桌
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2021-03-20 21:35:40
|
||||
*/
|
||||
public interface CanzhuoService extends IService<CanzhuoEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
List<CanzhuoVO> selectListVO(Wrapper<CanzhuoEntity> wrapper);
|
||||
|
||||
CanzhuoVO selectVO(@Param("ew") Wrapper<CanzhuoEntity> wrapper);
|
||||
|
||||
List<CanzhuoView> selectListView(Wrapper<CanzhuoEntity> wrapper);
|
||||
|
||||
CanzhuoView selectView(@Param("ew") Wrapper<CanzhuoEntity> wrapper);
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params,Wrapper<CanzhuoEntity> wrapper);
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,22 @@
|
||||
package service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface CommonService {
|
||||
List<String> getOption(Map<String, Object> params);
|
||||
|
||||
List<String> getzhuohaoOption(Map<String, Object> params);
|
||||
|
||||
Map<String, Object> getFollowByOption(Map<String, Object> params);
|
||||
|
||||
void sh(Map<String, Object> params);
|
||||
|
||||
int remindCount(Map<String, Object> params);
|
||||
|
||||
Map<String, Object> selectCal(Map<String, Object> params);
|
||||
|
||||
List<Map<String, Object>> selectGroup(Map<String, Object> params);
|
||||
|
||||
List<Map<String, Object>> selectValue(Map<String, Object> params);
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
|
||||
package service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.service.IService;
|
||||
import com.entity.ConfigEntity;
|
||||
import com.utils.PageUtils;
|
||||
|
||||
|
||||
/**
|
||||
* 系统用户
|
||||
*/
|
||||
public interface ConfigService extends IService<ConfigEntity> {
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
package service;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.service.IService;
|
||||
import com.utils.PageUtils;
|
||||
import com.entity.DiscusscaipinxinxiEntity;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.entity.vo.DiscusscaipinxinxiVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.view.DiscusscaipinxinxiView;
|
||||
|
||||
|
||||
/**
|
||||
* 菜品信息评论表
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2021-03-20 21:35:41
|
||||
*/
|
||||
public interface DiscusscaipinxinxiService extends IService<DiscusscaipinxinxiEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
List<DiscusscaipinxinxiVO> selectListVO(Wrapper<DiscusscaipinxinxiEntity> wrapper);
|
||||
|
||||
DiscusscaipinxinxiVO selectVO(@Param("ew") Wrapper<DiscusscaipinxinxiEntity> wrapper);
|
||||
|
||||
List<DiscusscaipinxinxiView> selectListView(Wrapper<DiscusscaipinxinxiEntity> wrapper);
|
||||
|
||||
DiscusscaipinxinxiView selectView(@Param("ew") Wrapper<DiscusscaipinxinxiEntity> wrapper);
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params,Wrapper<DiscusscaipinxinxiEntity> wrapper);
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,36 @@
|
||||
package service;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.service.IService;
|
||||
import com.utils.PageUtils;
|
||||
import com.entity.NewsEntity;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.entity.vo.NewsVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.view.NewsView;
|
||||
|
||||
|
||||
/**
|
||||
* 菜品资讯
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2021-03-20 21:35:41
|
||||
*/
|
||||
public interface NewsService extends IService<NewsEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
List<NewsVO> selectListVO(Wrapper<NewsEntity> wrapper);
|
||||
|
||||
NewsVO selectVO(@Param("ew") Wrapper<NewsEntity> wrapper);
|
||||
|
||||
List<NewsView> selectListView(Wrapper<NewsEntity> wrapper);
|
||||
|
||||
NewsView selectView(@Param("ew") Wrapper<NewsEntity> wrapper);
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params,Wrapper<NewsEntity> wrapper);
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,23 @@
|
||||
|
||||
package service;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.service.IService;
|
||||
import com.entity.ShangjiaEntity;
|
||||
import com.utils.PageUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 系统用户
|
||||
*/
|
||||
public interface ShangjiaService extends IService<ShangjiaEntity> {
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
List<ShangjiaEntity> selectListView(Wrapper<ShangjiaEntity> wrapper);
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params,Wrapper<ShangjiaEntity> wrapper);
|
||||
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
package service;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.service.IService;
|
||||
import com.utils.PageUtils;
|
||||
import com.entity.StoreupEntity;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.entity.vo.StoreupVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.view.StoreupView;
|
||||
|
||||
|
||||
/**
|
||||
* 收藏表
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2021-03-20 21:35:41
|
||||
*/
|
||||
public interface StoreupService extends IService<StoreupEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
List<StoreupVO> selectListVO(Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
StoreupVO selectVO(@Param("ew") Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
List<StoreupView> selectListView(Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
StoreupView selectView(@Param("ew") Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params,Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,26 @@
|
||||
|
||||
package service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.service.IService;
|
||||
import com.entity.TokenEntity;
|
||||
import com.utils.PageUtils;
|
||||
|
||||
|
||||
/**
|
||||
* token
|
||||
*/
|
||||
public interface TokenService extends IService<TokenEntity> {
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
List<TokenEntity> selectListView(Wrapper<TokenEntity> wrapper);
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params,Wrapper<TokenEntity> wrapper);
|
||||
|
||||
String generateToken(Long userid,String username,String tableName, String role);
|
||||
|
||||
TokenEntity getTokenEntity(String token);
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
|
||||
package service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.service.IService;
|
||||
import com.entity.UserEntity;
|
||||
import com.utils.PageUtils;
|
||||
|
||||
|
||||
/**
|
||||
* 系统用户
|
||||
*/
|
||||
public interface UserService extends IService<UserEntity> {
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
List<UserEntity> selectListView(Wrapper<UserEntity> wrapper);
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params,Wrapper<UserEntity> wrapper);
|
||||
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
package service;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.service.IService;
|
||||
import com.utils.PageUtils;
|
||||
import com.entity.YonghuEntity;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.entity.vo.YonghuVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.view.YonghuView;
|
||||
|
||||
|
||||
/**
|
||||
* 用户
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2021-03-20 21:35:40
|
||||
*/
|
||||
public interface YonghuService extends IService<YonghuEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
List<YonghuVO> selectListVO(Wrapper<YonghuEntity> wrapper);
|
||||
|
||||
YonghuVO selectVO(@Param("ew") Wrapper<YonghuEntity> wrapper);
|
||||
|
||||
List<YonghuView> selectListView(Wrapper<YonghuEntity> wrapper);
|
||||
|
||||
YonghuView selectView(@Param("ew") Wrapper<YonghuEntity> wrapper);
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params,Wrapper<YonghuEntity> wrapper);
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,62 @@
|
||||
package service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.Query;
|
||||
|
||||
|
||||
import com.dao.CaipindingdanDao;
|
||||
import com.entity.CaipindingdanEntity;
|
||||
import com.service.CaipindingdanService;
|
||||
import com.entity.vo.CaipindingdanVO;
|
||||
import com.entity.view.CaipindingdanView;
|
||||
|
||||
@Service("caipindingdanService")
|
||||
public class CaipindingdanServiceImpl extends ServiceImpl<CaipindingdanDao, CaipindingdanEntity> implements CaipindingdanService {
|
||||
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
Page<CaipindingdanEntity> page = this.selectPage(
|
||||
new Query<CaipindingdanEntity>(params).getPage(),
|
||||
new EntityWrapper<CaipindingdanEntity>()
|
||||
);
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params, Wrapper<CaipindingdanEntity> wrapper) {
|
||||
Page<CaipindingdanView> page =new Query<CaipindingdanView>(params).getPage();
|
||||
page.setRecords(baseMapper.selectListView(page,wrapper));
|
||||
PageUtils pageUtil = new PageUtils(page);
|
||||
return pageUtil;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CaipindingdanVO> selectListVO(Wrapper<CaipindingdanEntity> wrapper) {
|
||||
return baseMapper.selectListVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CaipindingdanVO selectVO(Wrapper<CaipindingdanEntity> wrapper) {
|
||||
return baseMapper.selectVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CaipindingdanView> selectListView(Wrapper<CaipindingdanEntity> wrapper) {
|
||||
return baseMapper.selectListView(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CaipindingdanView selectView(Wrapper<CaipindingdanEntity> wrapper) {
|
||||
return baseMapper.selectView(wrapper);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.Query;
|
||||
|
||||
|
||||
import com.dao.CaipinfenleiDao;
|
||||
import com.entity.CaipinfenleiEntity;
|
||||
import com.service.CaipinfenleiService;
|
||||
import com.entity.vo.CaipinfenleiVO;
|
||||
import com.entity.view.CaipinfenleiView;
|
||||
|
||||
@Service("caipinfenleiService")
|
||||
public class CaipinfenleiServiceImpl extends ServiceImpl<CaipinfenleiDao, CaipinfenleiEntity> implements CaipinfenleiService {
|
||||
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
Page<CaipinfenleiEntity> page = this.selectPage(
|
||||
new Query<CaipinfenleiEntity>(params).getPage(),
|
||||
new EntityWrapper<CaipinfenleiEntity>()
|
||||
);
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params, Wrapper<CaipinfenleiEntity> wrapper) {
|
||||
Page<CaipinfenleiView> page =new Query<CaipinfenleiView>(params).getPage();
|
||||
page.setRecords(baseMapper.selectListView(page,wrapper));
|
||||
PageUtils pageUtil = new PageUtils(page);
|
||||
return pageUtil;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CaipinfenleiVO> selectListVO(Wrapper<CaipinfenleiEntity> wrapper) {
|
||||
return baseMapper.selectListVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CaipinfenleiVO selectVO(Wrapper<CaipinfenleiEntity> wrapper) {
|
||||
return baseMapper.selectVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CaipinfenleiView> selectListView(Wrapper<CaipinfenleiEntity> wrapper) {
|
||||
return baseMapper.selectListView(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CaipinfenleiView selectView(Wrapper<CaipinfenleiEntity> wrapper) {
|
||||
return baseMapper.selectView(wrapper);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.Query;
|
||||
|
||||
|
||||
import com.dao.CaipinpingjiaDao;
|
||||
import com.entity.CaipinpingjiaEntity;
|
||||
import com.service.CaipinpingjiaService;
|
||||
import com.entity.vo.CaipinpingjiaVO;
|
||||
import com.entity.view.CaipinpingjiaView;
|
||||
|
||||
@Service("caipinpingjiaService")
|
||||
public class CaipinpingjiaServiceImpl extends ServiceImpl<CaipinpingjiaDao, CaipinpingjiaEntity> implements CaipinpingjiaService {
|
||||
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
Page<CaipinpingjiaEntity> page = this.selectPage(
|
||||
new Query<CaipinpingjiaEntity>(params).getPage(),
|
||||
new EntityWrapper<CaipinpingjiaEntity>()
|
||||
);
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params, Wrapper<CaipinpingjiaEntity> wrapper) {
|
||||
Page<CaipinpingjiaView> page =new Query<CaipinpingjiaView>(params).getPage();
|
||||
page.setRecords(baseMapper.selectListView(page,wrapper));
|
||||
PageUtils pageUtil = new PageUtils(page);
|
||||
return pageUtil;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CaipinpingjiaVO> selectListVO(Wrapper<CaipinpingjiaEntity> wrapper) {
|
||||
return baseMapper.selectListVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CaipinpingjiaVO selectVO(Wrapper<CaipinpingjiaEntity> wrapper) {
|
||||
return baseMapper.selectVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CaipinpingjiaView> selectListView(Wrapper<CaipinpingjiaEntity> wrapper) {
|
||||
return baseMapper.selectListView(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CaipinpingjiaView selectView(Wrapper<CaipinpingjiaEntity> wrapper) {
|
||||
return baseMapper.selectView(wrapper);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.Query;
|
||||
|
||||
|
||||
import com.dao.CaipinxinxiDao;
|
||||
import com.entity.CaipinxinxiEntity;
|
||||
import com.service.CaipinxinxiService;
|
||||
import com.entity.vo.CaipinxinxiVO;
|
||||
import com.entity.view.CaipinxinxiView;
|
||||
|
||||
@Service("caipinxinxiService")
|
||||
public class CaipinxinxiServiceImpl extends ServiceImpl<CaipinxinxiDao, CaipinxinxiEntity> implements CaipinxinxiService {
|
||||
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
Page<CaipinxinxiEntity> page = this.selectPage(
|
||||
new Query<CaipinxinxiEntity>(params).getPage(),
|
||||
new EntityWrapper<CaipinxinxiEntity>()
|
||||
);
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params, Wrapper<CaipinxinxiEntity> wrapper) {
|
||||
Page<CaipinxinxiView> page =new Query<CaipinxinxiView>(params).getPage();
|
||||
page.setRecords(baseMapper.selectListView(page,wrapper));
|
||||
PageUtils pageUtil = new PageUtils(page);
|
||||
return pageUtil;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CaipinxinxiVO> selectListVO(Wrapper<CaipinxinxiEntity> wrapper) {
|
||||
return baseMapper.selectListVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CaipinxinxiVO selectVO(Wrapper<CaipinxinxiEntity> wrapper) {
|
||||
return baseMapper.selectVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CaipinxinxiView> selectListView(Wrapper<CaipinxinxiEntity> wrapper) {
|
||||
return baseMapper.selectListView(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CaipinxinxiView selectView(Wrapper<CaipinxinxiEntity> wrapper) {
|
||||
return baseMapper.selectView(wrapper);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.Query;
|
||||
|
||||
|
||||
import com.dao.CanzhuoDao;
|
||||
import com.entity.CanzhuoEntity;
|
||||
import com.service.CanzhuoService;
|
||||
import com.entity.vo.CanzhuoVO;
|
||||
import com.entity.view.CanzhuoView;
|
||||
|
||||
@Service("canzhuoService")
|
||||
public class CanzhuoServiceImpl extends ServiceImpl<CanzhuoDao, CanzhuoEntity> implements CanzhuoService {
|
||||
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
Page<CanzhuoEntity> page = this.selectPage(
|
||||
new Query<CanzhuoEntity>(params).getPage(),
|
||||
new EntityWrapper<CanzhuoEntity>()
|
||||
);
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params, Wrapper<CanzhuoEntity> wrapper) {
|
||||
Page<CanzhuoView> page =new Query<CanzhuoView>(params).getPage();
|
||||
page.setRecords(baseMapper.selectListView(page,wrapper));
|
||||
PageUtils pageUtil = new PageUtils(page);
|
||||
return pageUtil;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CanzhuoVO> selectListVO(Wrapper<CanzhuoEntity> wrapper) {
|
||||
return baseMapper.selectListVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CanzhuoVO selectVO(Wrapper<CanzhuoEntity> wrapper) {
|
||||
return baseMapper.selectVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CanzhuoView> selectListView(Wrapper<CanzhuoEntity> wrapper) {
|
||||
return baseMapper.selectListView(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CanzhuoView selectView(Wrapper<CanzhuoEntity> wrapper) {
|
||||
return baseMapper.selectView(wrapper);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
|
||||
package service.impl;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.dao.CommonDao;
|
||||
import com.service.CommonService;
|
||||
|
||||
|
||||
/**
|
||||
* 系统用户
|
||||
*/
|
||||
@Service("commonService")
|
||||
public class CommonServiceImpl implements CommonService {
|
||||
|
||||
@Autowired
|
||||
private CommonDao commonDao;
|
||||
|
||||
@Override
|
||||
public List<String> getOption(Map<String, Object> params) {
|
||||
return commonDao.getOption(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getzhuohaoOption(Map<String, Object> params) {
|
||||
return commonDao.getzhuohaoOption(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getFollowByOption(Map<String, Object> params) {
|
||||
return commonDao.getFollowByOption(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sh(Map<String, Object> params) {
|
||||
commonDao.sh(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int remindCount(Map<String, Object> params) {
|
||||
return commonDao.remindCount(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> selectCal(Map<String, Object> params) {
|
||||
return commonDao.selectCal(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> selectGroup(Map<String, Object> params) {
|
||||
return commonDao.selectGroup(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> selectValue(Map<String, Object> params) {
|
||||
return commonDao.selectValue(params);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
|
||||
package service.impl;
|
||||
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
import com.dao.ConfigDao;
|
||||
import com.entity.ConfigEntity;
|
||||
import com.entity.UserEntity;
|
||||
import com.service.ConfigService;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.Query;
|
||||
|
||||
|
||||
/**
|
||||
* 系统用户
|
||||
*/
|
||||
@Service("configService")
|
||||
public class ConfigServiceImpl extends ServiceImpl<ConfigDao, ConfigEntity> implements ConfigService {
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
Page<ConfigEntity> page = this.selectPage(
|
||||
new Query<ConfigEntity>(params).getPage(),
|
||||
new EntityWrapper<ConfigEntity>()
|
||||
);
|
||||
return new PageUtils(page);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.Query;
|
||||
|
||||
|
||||
import com.dao.DiscusscaipinxinxiDao;
|
||||
import com.entity.DiscusscaipinxinxiEntity;
|
||||
import com.service.DiscusscaipinxinxiService;
|
||||
import com.entity.vo.DiscusscaipinxinxiVO;
|
||||
import com.entity.view.DiscusscaipinxinxiView;
|
||||
|
||||
@Service("discusscaipinxinxiService")
|
||||
public class DiscusscaipinxinxiServiceImpl extends ServiceImpl<DiscusscaipinxinxiDao, DiscusscaipinxinxiEntity> implements DiscusscaipinxinxiService {
|
||||
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
Page<DiscusscaipinxinxiEntity> page = this.selectPage(
|
||||
new Query<DiscusscaipinxinxiEntity>(params).getPage(),
|
||||
new EntityWrapper<DiscusscaipinxinxiEntity>()
|
||||
);
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params, Wrapper<DiscusscaipinxinxiEntity> wrapper) {
|
||||
Page<DiscusscaipinxinxiView> page =new Query<DiscusscaipinxinxiView>(params).getPage();
|
||||
page.setRecords(baseMapper.selectListView(page,wrapper));
|
||||
PageUtils pageUtil = new PageUtils(page);
|
||||
return pageUtil;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DiscusscaipinxinxiVO> selectListVO(Wrapper<DiscusscaipinxinxiEntity> wrapper) {
|
||||
return baseMapper.selectListVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DiscusscaipinxinxiVO selectVO(Wrapper<DiscusscaipinxinxiEntity> wrapper) {
|
||||
return baseMapper.selectVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DiscusscaipinxinxiView> selectListView(Wrapper<DiscusscaipinxinxiEntity> wrapper) {
|
||||
return baseMapper.selectListView(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DiscusscaipinxinxiView selectView(Wrapper<DiscusscaipinxinxiEntity> wrapper) {
|
||||
return baseMapper.selectView(wrapper);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.Query;
|
||||
|
||||
|
||||
import com.dao.NewsDao;
|
||||
import com.entity.NewsEntity;
|
||||
import com.service.NewsService;
|
||||
import com.entity.vo.NewsVO;
|
||||
import com.entity.view.NewsView;
|
||||
|
||||
@Service("newsService")
|
||||
public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements NewsService {
|
||||
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
Page<NewsEntity> page = this.selectPage(
|
||||
new Query<NewsEntity>(params).getPage(),
|
||||
new EntityWrapper<NewsEntity>()
|
||||
);
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params, Wrapper<NewsEntity> wrapper) {
|
||||
Page<NewsView> page =new Query<NewsView>(params).getPage();
|
||||
page.setRecords(baseMapper.selectListView(page,wrapper));
|
||||
PageUtils pageUtil = new PageUtils(page);
|
||||
return pageUtil;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NewsVO> selectListVO(Wrapper<NewsEntity> wrapper) {
|
||||
return baseMapper.selectListVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NewsVO selectVO(Wrapper<NewsEntity> wrapper) {
|
||||
return baseMapper.selectVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NewsView> selectListView(Wrapper<NewsEntity> wrapper) {
|
||||
return baseMapper.selectListView(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NewsView selectView(Wrapper<NewsEntity> wrapper) {
|
||||
return baseMapper.selectView(wrapper);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,50 @@
|
||||
|
||||
package service.impl;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
import com.dao.ShangjiaDao;
|
||||
import com.dao.UserDao;
|
||||
import com.entity.ShangjiaEntity;
|
||||
import com.service.ShangjiaService;
|
||||
import com.service.UserService;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.Query;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 系统用户
|
||||
*/
|
||||
@Service("shangjiaService")
|
||||
public class ShangjiaServiceImpl extends ServiceImpl<ShangjiaDao, ShangjiaEntity> implements ShangjiaService {
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
Page<ShangjiaEntity> page = this.selectPage(
|
||||
new Query<ShangjiaEntity>(params).getPage(),
|
||||
new EntityWrapper<ShangjiaEntity>()
|
||||
);
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ShangjiaEntity> selectListView(Wrapper<ShangjiaEntity> wrapper) {
|
||||
return baseMapper.selectListView(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params,
|
||||
Wrapper<ShangjiaEntity> wrapper) {
|
||||
Page<ShangjiaEntity> page =new Query<ShangjiaEntity>(params).getPage();
|
||||
page.setRecords(baseMapper.selectListView(page,wrapper));
|
||||
PageUtils pageUtil = new PageUtils(page);
|
||||
return pageUtil;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.Query;
|
||||
|
||||
|
||||
import com.dao.StoreupDao;
|
||||
import com.entity.StoreupEntity;
|
||||
import com.service.StoreupService;
|
||||
import com.entity.vo.StoreupVO;
|
||||
import com.entity.view.StoreupView;
|
||||
|
||||
@Service("storeupService")
|
||||
public class StoreupServiceImpl extends ServiceImpl<StoreupDao, StoreupEntity> implements StoreupService {
|
||||
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
Page<StoreupEntity> page = this.selectPage(
|
||||
new Query<StoreupEntity>(params).getPage(),
|
||||
new EntityWrapper<StoreupEntity>()
|
||||
);
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params, Wrapper<StoreupEntity> wrapper) {
|
||||
Page<StoreupView> page =new Query<StoreupView>(params).getPage();
|
||||
page.setRecords(baseMapper.selectListView(page,wrapper));
|
||||
PageUtils pageUtil = new PageUtils(page);
|
||||
return pageUtil;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StoreupVO> selectListVO(Wrapper<StoreupEntity> wrapper) {
|
||||
return baseMapper.selectListVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StoreupVO selectVO(Wrapper<StoreupEntity> wrapper) {
|
||||
return baseMapper.selectVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StoreupView> selectListView(Wrapper<StoreupEntity> wrapper) {
|
||||
return baseMapper.selectListView(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StoreupView selectView(Wrapper<StoreupEntity> wrapper) {
|
||||
return baseMapper.selectView(wrapper);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,79 @@
|
||||
|
||||
package service.impl;
|
||||
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
import com.dao.TokenDao;
|
||||
import com.entity.TokenEntity;
|
||||
import com.entity.TokenEntity;
|
||||
import com.service.TokenService;
|
||||
import com.utils.CommonUtil;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.Query;
|
||||
|
||||
|
||||
/**
|
||||
* token
|
||||
*/
|
||||
@Service("tokenService")
|
||||
public class TokenServiceImpl extends ServiceImpl<TokenDao, TokenEntity> implements TokenService {
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
Page<TokenEntity> page = this.selectPage(
|
||||
new Query<TokenEntity>(params).getPage(),
|
||||
new EntityWrapper<TokenEntity>()
|
||||
);
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TokenEntity> selectListView(Wrapper<TokenEntity> wrapper) {
|
||||
return baseMapper.selectListView(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params,
|
||||
Wrapper<TokenEntity> wrapper) {
|
||||
Page<TokenEntity> page =new Query<TokenEntity>(params).getPage();
|
||||
page.setRecords(baseMapper.selectListView(page,wrapper));
|
||||
PageUtils pageUtil = new PageUtils(page);
|
||||
return pageUtil;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String generateToken(Long userid,String username, String tableName, String role) {
|
||||
TokenEntity tokenEntity = this.selectOne(new EntityWrapper<TokenEntity>().eq("userid", userid).eq("role", role));
|
||||
String token = CommonUtil.getRandomString(32);
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(new Date());
|
||||
cal.add(Calendar.HOUR_OF_DAY, 1);
|
||||
if(tokenEntity!=null) {
|
||||
tokenEntity.setToken(token);
|
||||
tokenEntity.setExpiratedtime(cal.getTime());
|
||||
this.updateById(tokenEntity);
|
||||
} else {
|
||||
this.insert(new TokenEntity(userid,username, tableName, role, token, cal.getTime()));
|
||||
}
|
||||
return token;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TokenEntity getTokenEntity(String token) {
|
||||
TokenEntity tokenEntity = this.selectOne(new EntityWrapper<TokenEntity>().eq("token", token));
|
||||
if(tokenEntity == null || tokenEntity.getExpiratedtime().getTime()<new Date().getTime()) {
|
||||
return null;
|
||||
}
|
||||
return tokenEntity;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
|
||||
package service.impl;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
import com.dao.UserDao;
|
||||
import com.entity.UserEntity;
|
||||
import com.service.UserService;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.Query;
|
||||
|
||||
|
||||
/**
|
||||
* 系统用户
|
||||
*/
|
||||
@Service("userService")
|
||||
public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements UserService {
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
Page<UserEntity> page = this.selectPage(
|
||||
new Query<UserEntity>(params).getPage(),
|
||||
new EntityWrapper<UserEntity>()
|
||||
);
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserEntity> selectListView(Wrapper<UserEntity> wrapper) {
|
||||
return baseMapper.selectListView(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params,
|
||||
Wrapper<UserEntity> wrapper) {
|
||||
Page<UserEntity> page =new Query<UserEntity>(params).getPage();
|
||||
page.setRecords(baseMapper.selectListView(page,wrapper));
|
||||
PageUtils pageUtil = new PageUtils(page);
|
||||
return pageUtil;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
package service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.Query;
|
||||
|
||||
|
||||
import com.dao.YonghuDao;
|
||||
import com.entity.YonghuEntity;
|
||||
import com.service.YonghuService;
|
||||
import com.entity.vo.YonghuVO;
|
||||
import com.entity.view.YonghuView;
|
||||
|
||||
|
||||
|
||||
@Service("yonghuService")
|
||||
public class YonghuServiceImpl extends ServiceImpl<YonghuDao, YonghuEntity> implements YonghuService {
|
||||
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
Page<YonghuEntity> page = this.selectPage(
|
||||
new Query<YonghuEntity>(params).getPage(),
|
||||
new EntityWrapper<YonghuEntity>()
|
||||
);
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params, Wrapper<YonghuEntity> wrapper) {
|
||||
Page<YonghuView> page =new Query<YonghuView>(params).getPage();
|
||||
page.setRecords(baseMapper.selectListView(page,wrapper));
|
||||
PageUtils pageUtil = new PageUtils(page);
|
||||
return pageUtil;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<YonghuVO> selectListVO(Wrapper<YonghuEntity> wrapper) {
|
||||
return baseMapper.selectListVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public YonghuVO selectVO(Wrapper<YonghuEntity> wrapper) {
|
||||
return baseMapper.selectVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<YonghuView> selectListView(Wrapper<YonghuEntity> wrapper) {
|
||||
return baseMapper.selectListView(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public YonghuView selectView(Wrapper<YonghuEntity> wrapper) {
|
||||
return baseMapper.selectView(wrapper);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
package utils;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class CommonUtil {
|
||||
/**
|
||||
* 获取随机字符串
|
||||
*
|
||||
* @param num
|
||||
* @return
|
||||
*/
|
||||
public static String getRandomString(Integer num) {
|
||||
String base = "abcdefghijklmnopqrstuvwxyz0123456789";
|
||||
Random random = new Random();
|
||||
StringBuffer sb = new StringBuffer();
|
||||
for (int i = 0; i < num; i++) {
|
||||
int number = random.nextInt(base.length());
|
||||
sb.append(base.charAt(number));
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
package utils;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
/**
|
||||
* 类说明 :
|
||||
*/
|
||||
|
||||
public class FileUtil {
|
||||
public static byte[] FileToByte(File file) throws IOException {
|
||||
// 将数据转为流
|
||||
@SuppressWarnings("resource")
|
||||
InputStream content = new FileInputStream(file);
|
||||
ByteArrayOutputStream swapStream = new ByteArrayOutputStream();
|
||||
byte[] buff = new byte[100];
|
||||
int rc = 0;
|
||||
while ((rc = content.read(buff, 0, 100)) > 0) {
|
||||
swapStream.write(buff, 0, rc);
|
||||
}
|
||||
// 获得二进制数组
|
||||
return swapStream.toByteArray();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package utils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
|
||||
|
||||
/**
|
||||
* HttpClient工具类
|
||||
*/
|
||||
public class HttpClientUtils {
|
||||
|
||||
/**
|
||||
* @param uri
|
||||
* @return String
|
||||
* @description get请求方式
|
||||
* @author: long.he01
|
||||
*/
|
||||
public static String doGet(String uri) {
|
||||
|
||||
StringBuilder result = new StringBuilder();
|
||||
try {
|
||||
String res = "";
|
||||
URL url = new URL(uri);
|
||||
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
|
||||
String line;
|
||||
while ((line = in.readLine()) != null) {
|
||||
res += line+"\n";
|
||||
}
|
||||
in.close();
|
||||
return res;
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,54 @@
|
||||
package utils;
|
||||
|
||||
public class JQPageInfo{
|
||||
private Integer page;
|
||||
|
||||
private Integer limit;
|
||||
|
||||
private String sidx;
|
||||
|
||||
private String order;
|
||||
|
||||
private Integer offset;
|
||||
|
||||
public Integer getPage() {
|
||||
return page;
|
||||
}
|
||||
|
||||
public void setPage(Integer page) {
|
||||
this.page = page;
|
||||
}
|
||||
|
||||
public Integer getLimit() {
|
||||
return limit;
|
||||
}
|
||||
|
||||
public void setLimit(Integer limit) {
|
||||
this.limit = limit;
|
||||
}
|
||||
|
||||
public String getSidx() {
|
||||
return sidx;
|
||||
}
|
||||
|
||||
public void setSidx(String sidx) {
|
||||
this.sidx = sidx;
|
||||
}
|
||||
|
||||
public String getOrder() {
|
||||
return order;
|
||||
}
|
||||
|
||||
public void setOrder(String order) {
|
||||
this.order = order;
|
||||
}
|
||||
|
||||
public Integer getOffset() {
|
||||
return offset;
|
||||
}
|
||||
|
||||
public void setOffset(Integer offset) {
|
||||
this.offset = offset;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package utils;
|
||||
|
||||
import cn.hutool.crypto.digest.DigestUtil;
|
||||
|
||||
public class MD5Util {
|
||||
|
||||
/**
|
||||
* @param text明文
|
||||
* @param key密钥
|
||||
* @return 密文
|
||||
*/
|
||||
// 带秘钥加密
|
||||
public static String md5(String text) {
|
||||
// 加密后的字符串
|
||||
String md5str = DigestUtil.md5Hex(text);
|
||||
return md5str;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,184 @@
|
||||
package utils;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
|
||||
/**
|
||||
* Mybatis-Plus工具类
|
||||
*/
|
||||
public class MPUtil {
|
||||
public static final char UNDERLINE = '_';
|
||||
|
||||
|
||||
//mybatis plus allEQ 表达式转换
|
||||
public static Map allEQMapPre(Object bean,String pre) {
|
||||
Map<String, Object> map =BeanUtil.beanToMap(bean);
|
||||
return camelToUnderlineMap(map,pre);
|
||||
}
|
||||
|
||||
//mybatis plus allEQ 表达式转换
|
||||
public static Map allEQMap(Object bean) {
|
||||
Map<String, Object> map =BeanUtil.beanToMap(bean);
|
||||
return camelToUnderlineMap(map,"");
|
||||
}
|
||||
|
||||
public static Wrapper allLikePre(Wrapper wrapper,Object bean,String pre) {
|
||||
Map<String, Object> map =BeanUtil.beanToMap(bean);
|
||||
Map result = camelToUnderlineMap(map,pre);
|
||||
|
||||
return genLike(wrapper,result);
|
||||
}
|
||||
|
||||
public static Wrapper allLike(Wrapper wrapper,Object bean) {
|
||||
Map result = BeanUtil.beanToMap(bean, true, true);
|
||||
return genLike(wrapper,result);
|
||||
}
|
||||
|
||||
|
||||
public static Wrapper genLike( Wrapper wrapper,Map param) {
|
||||
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
|
||||
int i=0;
|
||||
while (it.hasNext()) {
|
||||
if(i>0) wrapper.and();
|
||||
Map.Entry<String, Object> entry = it.next();
|
||||
String key = entry.getKey();
|
||||
String value = (String) entry.getValue();
|
||||
wrapper.like(key, value);
|
||||
i++;
|
||||
}
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
public static Wrapper likeOrEq(Wrapper wrapper,Object bean) {
|
||||
Map result = BeanUtil.beanToMap(bean, true, true);
|
||||
return genLikeOrEq(wrapper,result);
|
||||
}
|
||||
|
||||
public static Wrapper genLikeOrEq( Wrapper wrapper,Map param) {
|
||||
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
|
||||
int i=0;
|
||||
while (it.hasNext()) {
|
||||
if(i>0) wrapper.and();
|
||||
Map.Entry<String, Object> entry = it.next();
|
||||
String key = entry.getKey();
|
||||
if(entry.getValue().toString().contains("%")) {
|
||||
wrapper.like(key, entry.getValue().toString().replace("%", ""));
|
||||
} else {
|
||||
wrapper.eq(key, entry.getValue());
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
public static Wrapper allEq(Wrapper wrapper,Object bean) {
|
||||
Map result = BeanUtil.beanToMap(bean, true, true);
|
||||
return genEq(wrapper,result);
|
||||
}
|
||||
|
||||
|
||||
public static Wrapper genEq( Wrapper wrapper,Map param) {
|
||||
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
|
||||
int i=0;
|
||||
while (it.hasNext()) {
|
||||
if(i>0) wrapper.and();
|
||||
Map.Entry<String, Object> entry = it.next();
|
||||
String key = entry.getKey();
|
||||
wrapper.eq(key, entry.getValue());
|
||||
i++;
|
||||
}
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
|
||||
public static Wrapper between(Wrapper wrapper,Map<String, Object> params) {
|
||||
for(String key : params.keySet()) {
|
||||
String columnName = "";
|
||||
if(key.endsWith("_start")) {
|
||||
columnName = key.substring(0, key.indexOf("_start"));
|
||||
if(StringUtils.isNotBlank(params.get(key).toString())) {
|
||||
wrapper.ge(columnName, params.get(key));
|
||||
}
|
||||
}
|
||||
if(key.endsWith("_end")) {
|
||||
columnName = key.substring(0, key.indexOf("_end"));
|
||||
if(StringUtils.isNotBlank(params.get(key).toString())) {
|
||||
wrapper.le(columnName, params.get(key));
|
||||
}
|
||||
}
|
||||
}
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
public static Wrapper sort(Wrapper wrapper,Map<String, Object> params) {
|
||||
String order = "";
|
||||
if(params.get("order") != null && StringUtils.isNotBlank(params.get("order").toString())) {
|
||||
order = params.get("order").toString();
|
||||
}
|
||||
if(params.get("sort") != null && StringUtils.isNotBlank(params.get("sort").toString())) {
|
||||
if(order.equalsIgnoreCase("desc")) {
|
||||
wrapper.orderDesc(Arrays.asList(params.get("sort")));
|
||||
} else {
|
||||
wrapper.orderAsc(Arrays.asList(params.get("sort")));
|
||||
}
|
||||
}
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 驼峰格式字符串转换为下划线格式字符串
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
public static String camelToUnderline(String param) {
|
||||
if (param == null || "".equals(param.trim())) {
|
||||
return "";
|
||||
}
|
||||
int len = param.length();
|
||||
StringBuilder sb = new StringBuilder(len);
|
||||
for (int i = 0; i < len; i++) {
|
||||
char c = param.charAt(i);
|
||||
if (Character.isUpperCase(c)) {
|
||||
sb.append(UNDERLINE);
|
||||
sb.append(Character.toLowerCase(c));
|
||||
} else {
|
||||
sb.append(c);
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static void main(String[] ages) {
|
||||
System.out.println(camelToUnderline("ABCddfANM"));
|
||||
}
|
||||
|
||||
public static Map camelToUnderlineMap(Map param, String pre) {
|
||||
|
||||
Map<String, Object> newMap = new HashMap<String, Object>();
|
||||
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
Map.Entry<String, Object> entry = it.next();
|
||||
String key = entry.getKey();
|
||||
String newKey = camelToUnderline(key);
|
||||
if (pre.endsWith(".")) {
|
||||
newMap.put(pre + newKey, entry.getValue());
|
||||
} else if (StringUtils.isEmpty(pre)) {
|
||||
newMap.put(newKey, entry.getValue());
|
||||
} else {
|
||||
|
||||
newMap.put(pre + "." + newKey, entry.getValue());
|
||||
}
|
||||
}
|
||||
return newMap;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,101 @@
|
||||
|
||||
package utils;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
|
||||
/**
|
||||
* 分页工具类
|
||||
*/
|
||||
public class PageUtils implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
//总记录数
|
||||
private long total;
|
||||
//每页记录数
|
||||
private int pageSize;
|
||||
//总页数
|
||||
private long totalPage;
|
||||
//当前页数
|
||||
private int currPage;
|
||||
//列表数据
|
||||
private List<?> list;
|
||||
|
||||
/**
|
||||
* 分页
|
||||
* @param list 列表数据
|
||||
* @param totalCount 总记录数
|
||||
* @param pageSize 每页记录数
|
||||
* @param currPage 当前页数
|
||||
*/
|
||||
public PageUtils(List<?> list, int totalCount, int pageSize, int currPage) {
|
||||
this.list = list;
|
||||
this.total = totalCount;
|
||||
this.pageSize = pageSize;
|
||||
this.currPage = currPage;
|
||||
this.totalPage = (int)Math.ceil((double)totalCount/pageSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*/
|
||||
public PageUtils(Page<?> page) {
|
||||
this.list = page.getRecords();
|
||||
this.total = page.getTotal();
|
||||
this.pageSize = page.getSize();
|
||||
this.currPage = page.getCurrent();
|
||||
this.totalPage = page.getPages();
|
||||
}
|
||||
|
||||
/*
|
||||
* 空数据的分页
|
||||
*/
|
||||
public PageUtils(Map<String, Object> params) {
|
||||
Page page =new Query(params).getPage();
|
||||
new PageUtils(page);
|
||||
}
|
||||
|
||||
|
||||
public int getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(int pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public int getCurrPage() {
|
||||
return currPage;
|
||||
}
|
||||
|
||||
public void setCurrPage(int currPage) {
|
||||
this.currPage = currPage;
|
||||
}
|
||||
|
||||
public List<?> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<?> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
public long getTotalPage() {
|
||||
return totalPage;
|
||||
}
|
||||
|
||||
public void setTotalPage(long totalPage) {
|
||||
this.totalPage = totalPage;
|
||||
}
|
||||
|
||||
public long getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(long total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
package utils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 返回数据
|
||||
*/
|
||||
public class R extends HashMap<String, Object> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public R() {
|
||||
put("code", 0);
|
||||
}
|
||||
|
||||
public static R error() {
|
||||
return error(500, "未知异常,请联系管理员");
|
||||
}
|
||||
|
||||
public static R error(String msg) {
|
||||
return error(500, msg);
|
||||
}
|
||||
|
||||
public static R error(int code, String msg) {
|
||||
R r = new R();
|
||||
r.put("code", code);
|
||||
r.put("msg", msg);
|
||||
return r;
|
||||
}
|
||||
|
||||
public static R ok(String msg) {
|
||||
R r = new R();
|
||||
r.put("msg", msg);
|
||||
return r;
|
||||
}
|
||||
|
||||
public static R ok(Map<String, Object> map) {
|
||||
R r = new R();
|
||||
r.putAll(map);
|
||||
return r;
|
||||
}
|
||||
|
||||
public static R ok() {
|
||||
return new R();
|
||||
}
|
||||
|
||||
public R put(String key, Object value) {
|
||||
super.put(key, value);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
|
||||
package utils;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.entity.EIException;
|
||||
|
||||
/**
|
||||
* SQL过滤
|
||||
*/
|
||||
public class SQLFilter {
|
||||
|
||||
/**
|
||||
* SQL注入过滤
|
||||
* @param str 待验证的字符串
|
||||
*/
|
||||
public static String sqlInject(String str){
|
||||
if(StringUtils.isBlank(str)){
|
||||
return null;
|
||||
}
|
||||
//去掉'|"|;|\字符
|
||||
str = StringUtils.replace(str, "'", "");
|
||||
str = StringUtils.replace(str, "\"", "");
|
||||
str = StringUtils.replace(str, ";", "");
|
||||
str = StringUtils.replace(str, "\\", "");
|
||||
|
||||
//转换成小写
|
||||
str = str.toLowerCase();
|
||||
|
||||
//非法字符
|
||||
String[] keywords = {"master", "truncate", "insert", "select", "delete", "update", "declare", "alter", "drop"};
|
||||
|
||||
//判断是否包含非法字符
|
||||
for(String keyword : keywords){
|
||||
if(str.indexOf(keyword) != -1){
|
||||
throw new EIException("包含非法字符");
|
||||
}
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
|
||||
package utils;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
||||
/**
|
||||
* Spring Context 工具类
|
||||
*/
|
||||
@Component
|
||||
public class SpringContextUtils implements ApplicationContextAware {
|
||||
public static ApplicationContext applicationContext;
|
||||
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext)
|
||||
throws BeansException {
|
||||
SpringContextUtils.applicationContext = applicationContext;
|
||||
}
|
||||
|
||||
public static Object getBean(String name) {
|
||||
return applicationContext.getBean(name);
|
||||
}
|
||||
|
||||
public static <T> T getBean(String name, Class<T> requiredType) {
|
||||
return applicationContext.getBean(name, requiredType);
|
||||
}
|
||||
|
||||
public static boolean containsBean(String name) {
|
||||
return applicationContext.containsBean(name);
|
||||
}
|
||||
|
||||
public static boolean isSingleton(String name) {
|
||||
return applicationContext.isSingleton(name);
|
||||
}
|
||||
|
||||
public static Class<? extends Object> getType(String name) {
|
||||
return applicationContext.getType(name);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in new issue