www 5 months ago
parent 5c34ccdf44
commit 065b437ff9

@ -0,0 +1,31 @@
package com.model.enums;
import java.io.Serializable;
import com.baomidou.mybatisplus.enums.IEnum;
/**
* IEnum spring-mybatis.xml typeEnumsPackage
*/
public enum TypeEnum implements IEnum {
DISABLED(0, "禁用"),
NORMAL(1, "正常");
private final int value;
private final String desc;
TypeEnum(final int value, final String desc) {
this.value = value;
this.desc = desc;
}
@Override
public Serializable getValue() {
return this.value;
}
// Jackson 注解为 JsonValue 返回中文 json 描述
public String getDesc() {
return this.desc;
}
}

@ -0,0 +1,36 @@
package com.service;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.BisaibaomingEntity;
import java.util.List;
import java.util.Map;
import com.entity.vo.BisaibaomingVO;
import org.apache.ibatis.annotations.Param;
import com.entity.view.BisaibaomingView;
/**
*
*
* @author
* @email
* @date 2021-03-24 19:14:37
*/
public interface BisaibaomingService extends IService<BisaibaomingEntity> {
PageUtils queryPage(Map<String, Object> params);
List<BisaibaomingVO> selectListVO(Wrapper<BisaibaomingEntity> wrapper);
BisaibaomingVO selectVO(@Param("ew") Wrapper<BisaibaomingEntity> wrapper);
List<BisaibaomingView> selectListView(Wrapper<BisaibaomingEntity> wrapper);
BisaibaomingView selectView(@Param("ew") Wrapper<BisaibaomingEntity> wrapper);
PageUtils queryPage(Map<String, Object> params,Wrapper<BisaibaomingEntity> wrapper);
}

@ -0,0 +1,36 @@
package com.service;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.BisaixiangmuEntity;
import java.util.List;
import java.util.Map;
import com.entity.vo.BisaixiangmuVO;
import org.apache.ibatis.annotations.Param;
import com.entity.view.BisaixiangmuView;
/**
*
*
* @author
* @email
* @date 2021-03-24 19:14:37
*/
public interface BisaixiangmuService extends IService<BisaixiangmuEntity> {
PageUtils queryPage(Map<String, Object> params);
List<BisaixiangmuVO> selectListVO(Wrapper<BisaixiangmuEntity> wrapper);
BisaixiangmuVO selectVO(@Param("ew") Wrapper<BisaixiangmuEntity> wrapper);
List<BisaixiangmuView> selectListView(Wrapper<BisaixiangmuEntity> wrapper);
BisaixiangmuView selectView(@Param("ew") Wrapper<BisaixiangmuEntity> wrapper);
PageUtils queryPage(Map<String, Object> params,Wrapper<BisaixiangmuEntity> wrapper);
}

@ -0,0 +1,36 @@
package com.service;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.BisaixinxiEntity;
import java.util.List;
import java.util.Map;
import com.entity.vo.BisaixinxiVO;
import org.apache.ibatis.annotations.Param;
import com.entity.view.BisaixinxiView;
/**
*
*
* @author
* @email
* @date 2021-03-24 19:14:37
*/
public interface BisaixinxiService extends IService<BisaixinxiEntity> {
PageUtils queryPage(Map<String, Object> params);
List<BisaixinxiVO> selectListVO(Wrapper<BisaixinxiEntity> wrapper);
BisaixinxiVO selectVO(@Param("ew") Wrapper<BisaixinxiEntity> wrapper);
List<BisaixinxiView> selectListView(Wrapper<BisaixinxiEntity> wrapper);
BisaixinxiView selectView(@Param("ew") Wrapper<BisaixinxiEntity> wrapper);
PageUtils queryPage(Map<String, Object> params,Wrapper<BisaixinxiEntity> wrapper);
}

@ -0,0 +1,36 @@
package com.service;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.CaipanyuanEntity;
import java.util.List;
import java.util.Map;
import com.entity.vo.CaipanyuanVO;
import org.apache.ibatis.annotations.Param;
import com.entity.view.CaipanyuanView;
/**
*
*
* @author
* @email
* @date 2021-03-24 19:14:37
*/
public interface CaipanyuanService extends IService<CaipanyuanEntity> {
PageUtils queryPage(Map<String, Object> params);
List<CaipanyuanVO> selectListVO(Wrapper<CaipanyuanEntity> wrapper);
CaipanyuanVO selectVO(@Param("ew") Wrapper<CaipanyuanEntity> wrapper);
List<CaipanyuanView> selectListView(Wrapper<CaipanyuanEntity> wrapper);
CaipanyuanView selectView(@Param("ew") Wrapper<CaipanyuanEntity> wrapper);
PageUtils queryPage(Map<String, Object> params,Wrapper<CaipanyuanEntity> wrapper);
}

@ -0,0 +1,20 @@
package com.service;
import java.util.List;
import java.util.Map;
public interface CommonService {
List<String> getOption(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 com.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 com.service;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.DuiyuanEntity;
import java.util.List;
import java.util.Map;
import com.entity.vo.DuiyuanVO;
import org.apache.ibatis.annotations.Param;
import com.entity.view.DuiyuanView;
/**
*
*
* @author
* @email
* @date 2021-03-24 19:14:37
*/
public interface DuiyuanService extends IService<DuiyuanEntity> {
PageUtils queryPage(Map<String, Object> params);
List<DuiyuanVO> selectListVO(Wrapper<DuiyuanEntity> wrapper);
DuiyuanVO selectVO(@Param("ew") Wrapper<DuiyuanEntity> wrapper);
List<DuiyuanView> selectListView(Wrapper<DuiyuanEntity> wrapper);
DuiyuanView selectView(@Param("ew") Wrapper<DuiyuanEntity> wrapper);
PageUtils queryPage(Map<String, Object> params,Wrapper<DuiyuanEntity> wrapper);
}

@ -0,0 +1,36 @@
package com.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-24 19:14:37
*/
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,36 @@
package com.service;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.QiquanxinxiEntity;
import java.util.List;
import java.util.Map;
import com.entity.vo.QiquanxinxiVO;
import org.apache.ibatis.annotations.Param;
import com.entity.view.QiquanxinxiView;
/**
*
*
* @author
* @email
* @date 2021-03-24 19:14:37
*/
public interface QiquanxinxiService extends IService<QiquanxinxiEntity> {
PageUtils queryPage(Map<String, Object> params);
List<QiquanxinxiVO> selectListVO(Wrapper<QiquanxinxiEntity> wrapper);
QiquanxinxiVO selectVO(@Param("ew") Wrapper<QiquanxinxiEntity> wrapper);
List<QiquanxinxiView> selectListView(Wrapper<QiquanxinxiEntity> wrapper);
QiquanxinxiView selectView(@Param("ew") Wrapper<QiquanxinxiEntity> wrapper);
PageUtils queryPage(Map<String, Object> params,Wrapper<QiquanxinxiEntity> wrapper);
}

@ -0,0 +1,36 @@
package com.service;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.SaiqianbianpaiEntity;
import java.util.List;
import java.util.Map;
import com.entity.vo.SaiqianbianpaiVO;
import org.apache.ibatis.annotations.Param;
import com.entity.view.SaiqianbianpaiView;
/**
*
*
* @author
* @email
* @date 2021-03-24 19:14:37
*/
public interface SaiqianbianpaiService extends IService<SaiqianbianpaiEntity> {
PageUtils queryPage(Map<String, Object> params);
List<SaiqianbianpaiVO> selectListVO(Wrapper<SaiqianbianpaiEntity> wrapper);
SaiqianbianpaiVO selectVO(@Param("ew") Wrapper<SaiqianbianpaiEntity> wrapper);
List<SaiqianbianpaiView> selectListView(Wrapper<SaiqianbianpaiEntity> wrapper);
SaiqianbianpaiView selectView(@Param("ew") Wrapper<SaiqianbianpaiEntity> wrapper);
PageUtils queryPage(Map<String, Object> params,Wrapper<SaiqianbianpaiEntity> wrapper);
}

@ -0,0 +1,36 @@
package com.service;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.SaiqiantongzhiEntity;
import java.util.List;
import java.util.Map;
import com.entity.vo.SaiqiantongzhiVO;
import org.apache.ibatis.annotations.Param;
import com.entity.view.SaiqiantongzhiView;
/**
*
*
* @author
* @email
* @date 2021-03-24 19:14:37
*/
public interface SaiqiantongzhiService extends IService<SaiqiantongzhiEntity> {
PageUtils queryPage(Map<String, Object> params);
List<SaiqiantongzhiVO> selectListVO(Wrapper<SaiqiantongzhiEntity> wrapper);
SaiqiantongzhiVO selectVO(@Param("ew") Wrapper<SaiqiantongzhiEntity> wrapper);
List<SaiqiantongzhiView> selectListView(Wrapper<SaiqiantongzhiEntity> wrapper);
SaiqiantongzhiView selectView(@Param("ew") Wrapper<SaiqiantongzhiEntity> wrapper);
PageUtils queryPage(Map<String, Object> params,Wrapper<SaiqiantongzhiEntity> wrapper);
}

@ -0,0 +1,36 @@
package com.service;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.SaishichengjiEntity;
import java.util.List;
import java.util.Map;
import com.entity.vo.SaishichengjiVO;
import org.apache.ibatis.annotations.Param;
import com.entity.view.SaishichengjiView;
/**
*
*
* @author
* @email
* @date 2021-03-24 19:14:37
*/
public interface SaishichengjiService extends IService<SaishichengjiEntity> {
PageUtils queryPage(Map<String, Object> params);
List<SaishichengjiVO> selectListVO(Wrapper<SaishichengjiEntity> wrapper);
SaishichengjiVO selectVO(@Param("ew") Wrapper<SaishichengjiEntity> wrapper);
List<SaishichengjiView> selectListView(Wrapper<SaishichengjiEntity> wrapper);
SaishichengjiView selectView(@Param("ew") Wrapper<SaishichengjiEntity> wrapper);
PageUtils queryPage(Map<String, Object> params,Wrapper<SaishichengjiEntity> wrapper);
}

@ -0,0 +1,36 @@
package com.service;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.SaizhongxinxiEntity;
import java.util.List;
import java.util.Map;
import com.entity.vo.SaizhongxinxiVO;
import org.apache.ibatis.annotations.Param;
import com.entity.view.SaizhongxinxiView;
/**
*
*
* @author
* @email
* @date 2021-03-24 19:14:37
*/
public interface SaizhongxinxiService extends IService<SaizhongxinxiEntity> {
PageUtils queryPage(Map<String, Object> params);
List<SaizhongxinxiVO> selectListVO(Wrapper<SaizhongxinxiEntity> wrapper);
SaizhongxinxiVO selectVO(@Param("ew") Wrapper<SaizhongxinxiEntity> wrapper);
List<SaizhongxinxiView> selectListView(Wrapper<SaizhongxinxiEntity> wrapper);
SaizhongxinxiView selectView(@Param("ew") Wrapper<SaizhongxinxiEntity> wrapper);
PageUtils queryPage(Map<String, Object> params,Wrapper<SaizhongxinxiEntity> wrapper);
}

@ -0,0 +1,36 @@
package com.service;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.TeshuduiyuanEntity;
import java.util.List;
import java.util.Map;
import com.entity.vo.TeshuduiyuanVO;
import org.apache.ibatis.annotations.Param;
import com.entity.view.TeshuduiyuanView;
/**
*
*
* @author
* @email
* @date 2021-03-24 19:14:37
*/
public interface TeshuduiyuanService extends IService<TeshuduiyuanEntity> {
PageUtils queryPage(Map<String, Object> params);
List<TeshuduiyuanVO> selectListVO(Wrapper<TeshuduiyuanEntity> wrapper);
TeshuduiyuanVO selectVO(@Param("ew") Wrapper<TeshuduiyuanEntity> wrapper);
List<TeshuduiyuanView> selectListView(Wrapper<TeshuduiyuanEntity> wrapper);
TeshuduiyuanView selectView(@Param("ew") Wrapper<TeshuduiyuanEntity> wrapper);
PageUtils queryPage(Map<String, Object> params,Wrapper<TeshuduiyuanEntity> wrapper);
}

@ -0,0 +1,26 @@
package com.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 com.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,62 @@
package com.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.BisaibaomingDao;
import com.entity.BisaibaomingEntity;
import com.service.BisaibaomingService;
import com.entity.vo.BisaibaomingVO;
import com.entity.view.BisaibaomingView;
@Service("bisaibaomingService")
public class BisaibaomingServiceImpl extends ServiceImpl<BisaibaomingDao, BisaibaomingEntity> implements BisaibaomingService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
Page<BisaibaomingEntity> page = this.selectPage(
new Query<BisaibaomingEntity>(params).getPage(),
new EntityWrapper<BisaibaomingEntity>()
);
return new PageUtils(page);
}
@Override
public PageUtils queryPage(Map<String, Object> params, Wrapper<BisaibaomingEntity> wrapper) {
Page<BisaibaomingView> page =new Query<BisaibaomingView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,wrapper));
PageUtils pageUtil = new PageUtils(page);
return pageUtil;
}
@Override
public List<BisaibaomingVO> selectListVO(Wrapper<BisaibaomingEntity> wrapper) {
return baseMapper.selectListVO(wrapper);
}
@Override
public BisaibaomingVO selectVO(Wrapper<BisaibaomingEntity> wrapper) {
return baseMapper.selectVO(wrapper);
}
@Override
public List<BisaibaomingView> selectListView(Wrapper<BisaibaomingEntity> wrapper) {
return baseMapper.selectListView(wrapper);
}
@Override
public BisaibaomingView selectView(Wrapper<BisaibaomingEntity> wrapper) {
return baseMapper.selectView(wrapper);
}
}

@ -0,0 +1,62 @@
package com.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.BisaixiangmuDao;
import com.entity.BisaixiangmuEntity;
import com.service.BisaixiangmuService;
import com.entity.vo.BisaixiangmuVO;
import com.entity.view.BisaixiangmuView;
@Service("bisaixiangmuService")
public class BisaixiangmuServiceImpl extends ServiceImpl<BisaixiangmuDao, BisaixiangmuEntity> implements BisaixiangmuService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
Page<BisaixiangmuEntity> page = this.selectPage(
new Query<BisaixiangmuEntity>(params).getPage(),
new EntityWrapper<BisaixiangmuEntity>()
);
return new PageUtils(page);
}
@Override
public PageUtils queryPage(Map<String, Object> params, Wrapper<BisaixiangmuEntity> wrapper) {
Page<BisaixiangmuView> page =new Query<BisaixiangmuView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,wrapper));
PageUtils pageUtil = new PageUtils(page);
return pageUtil;
}
@Override
public List<BisaixiangmuVO> selectListVO(Wrapper<BisaixiangmuEntity> wrapper) {
return baseMapper.selectListVO(wrapper);
}
@Override
public BisaixiangmuVO selectVO(Wrapper<BisaixiangmuEntity> wrapper) {
return baseMapper.selectVO(wrapper);
}
@Override
public List<BisaixiangmuView> selectListView(Wrapper<BisaixiangmuEntity> wrapper) {
return baseMapper.selectListView(wrapper);
}
@Override
public BisaixiangmuView selectView(Wrapper<BisaixiangmuEntity> wrapper) {
return baseMapper.selectView(wrapper);
}
}

@ -0,0 +1,62 @@
package com.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.BisaixinxiDao;
import com.entity.BisaixinxiEntity;
import com.service.BisaixinxiService;
import com.entity.vo.BisaixinxiVO;
import com.entity.view.BisaixinxiView;
@Service("bisaixinxiService")
public class BisaixinxiServiceImpl extends ServiceImpl<BisaixinxiDao, BisaixinxiEntity> implements BisaixinxiService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
Page<BisaixinxiEntity> page = this.selectPage(
new Query<BisaixinxiEntity>(params).getPage(),
new EntityWrapper<BisaixinxiEntity>()
);
return new PageUtils(page);
}
@Override
public PageUtils queryPage(Map<String, Object> params, Wrapper<BisaixinxiEntity> wrapper) {
Page<BisaixinxiView> page =new Query<BisaixinxiView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,wrapper));
PageUtils pageUtil = new PageUtils(page);
return pageUtil;
}
@Override
public List<BisaixinxiVO> selectListVO(Wrapper<BisaixinxiEntity> wrapper) {
return baseMapper.selectListVO(wrapper);
}
@Override
public BisaixinxiVO selectVO(Wrapper<BisaixinxiEntity> wrapper) {
return baseMapper.selectVO(wrapper);
}
@Override
public List<BisaixinxiView> selectListView(Wrapper<BisaixinxiEntity> wrapper) {
return baseMapper.selectListView(wrapper);
}
@Override
public BisaixinxiView selectView(Wrapper<BisaixinxiEntity> wrapper) {
return baseMapper.selectView(wrapper);
}
}

@ -0,0 +1,62 @@
package com.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.CaipanyuanDao;
import com.entity.CaipanyuanEntity;
import com.service.CaipanyuanService;
import com.entity.vo.CaipanyuanVO;
import com.entity.view.CaipanyuanView;
@Service("caipanyuanService")
public class CaipanyuanServiceImpl extends ServiceImpl<CaipanyuanDao, CaipanyuanEntity> implements CaipanyuanService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
Page<CaipanyuanEntity> page = this.selectPage(
new Query<CaipanyuanEntity>(params).getPage(),
new EntityWrapper<CaipanyuanEntity>()
);
return new PageUtils(page);
}
@Override
public PageUtils queryPage(Map<String, Object> params, Wrapper<CaipanyuanEntity> wrapper) {
Page<CaipanyuanView> page =new Query<CaipanyuanView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,wrapper));
PageUtils pageUtil = new PageUtils(page);
return pageUtil;
}
@Override
public List<CaipanyuanVO> selectListVO(Wrapper<CaipanyuanEntity> wrapper) {
return baseMapper.selectListVO(wrapper);
}
@Override
public CaipanyuanVO selectVO(Wrapper<CaipanyuanEntity> wrapper) {
return baseMapper.selectVO(wrapper);
}
@Override
public List<CaipanyuanView> selectListView(Wrapper<CaipanyuanEntity> wrapper) {
return baseMapper.selectListView(wrapper);
}
@Override
public CaipanyuanView selectView(Wrapper<CaipanyuanEntity> wrapper) {
return baseMapper.selectView(wrapper);
}
}

@ -0,0 +1,59 @@
package com.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 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 com.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 com.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.DuiyuanDao;
import com.entity.DuiyuanEntity;
import com.service.DuiyuanService;
import com.entity.vo.DuiyuanVO;
import com.entity.view.DuiyuanView;
@Service("duiyuanService")
public class DuiyuanServiceImpl extends ServiceImpl<DuiyuanDao, DuiyuanEntity> implements DuiyuanService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
Page<DuiyuanEntity> page = this.selectPage(
new Query<DuiyuanEntity>(params).getPage(),
new EntityWrapper<DuiyuanEntity>()
);
return new PageUtils(page);
}
@Override
public PageUtils queryPage(Map<String, Object> params, Wrapper<DuiyuanEntity> wrapper) {
Page<DuiyuanView> page =new Query<DuiyuanView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,wrapper));
PageUtils pageUtil = new PageUtils(page);
return pageUtil;
}
@Override
public List<DuiyuanVO> selectListVO(Wrapper<DuiyuanEntity> wrapper) {
return baseMapper.selectListVO(wrapper);
}
@Override
public DuiyuanVO selectVO(Wrapper<DuiyuanEntity> wrapper) {
return baseMapper.selectVO(wrapper);
}
@Override
public List<DuiyuanView> selectListView(Wrapper<DuiyuanEntity> wrapper) {
return baseMapper.selectListView(wrapper);
}
@Override
public DuiyuanView selectView(Wrapper<DuiyuanEntity> wrapper) {
return baseMapper.selectView(wrapper);
}
}

@ -0,0 +1,62 @@
package com.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,62 @@
package com.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.QiquanxinxiDao;
import com.entity.QiquanxinxiEntity;
import com.service.QiquanxinxiService;
import com.entity.vo.QiquanxinxiVO;
import com.entity.view.QiquanxinxiView;
@Service("qiquanxinxiService")
public class QiquanxinxiServiceImpl extends ServiceImpl<QiquanxinxiDao, QiquanxinxiEntity> implements QiquanxinxiService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
Page<QiquanxinxiEntity> page = this.selectPage(
new Query<QiquanxinxiEntity>(params).getPage(),
new EntityWrapper<QiquanxinxiEntity>()
);
return new PageUtils(page);
}
@Override
public PageUtils queryPage(Map<String, Object> params, Wrapper<QiquanxinxiEntity> wrapper) {
Page<QiquanxinxiView> page =new Query<QiquanxinxiView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,wrapper));
PageUtils pageUtil = new PageUtils(page);
return pageUtil;
}
@Override
public List<QiquanxinxiVO> selectListVO(Wrapper<QiquanxinxiEntity> wrapper) {
return baseMapper.selectListVO(wrapper);
}
@Override
public QiquanxinxiVO selectVO(Wrapper<QiquanxinxiEntity> wrapper) {
return baseMapper.selectVO(wrapper);
}
@Override
public List<QiquanxinxiView> selectListView(Wrapper<QiquanxinxiEntity> wrapper) {
return baseMapper.selectListView(wrapper);
}
@Override
public QiquanxinxiView selectView(Wrapper<QiquanxinxiEntity> wrapper) {
return baseMapper.selectView(wrapper);
}
}

@ -0,0 +1,62 @@
package com.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.SaiqianbianpaiDao;
import com.entity.SaiqianbianpaiEntity;
import com.service.SaiqianbianpaiService;
import com.entity.vo.SaiqianbianpaiVO;
import com.entity.view.SaiqianbianpaiView;
@Service("saiqianbianpaiService")
public class SaiqianbianpaiServiceImpl extends ServiceImpl<SaiqianbianpaiDao, SaiqianbianpaiEntity> implements SaiqianbianpaiService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
Page<SaiqianbianpaiEntity> page = this.selectPage(
new Query<SaiqianbianpaiEntity>(params).getPage(),
new EntityWrapper<SaiqianbianpaiEntity>()
);
return new PageUtils(page);
}
@Override
public PageUtils queryPage(Map<String, Object> params, Wrapper<SaiqianbianpaiEntity> wrapper) {
Page<SaiqianbianpaiView> page =new Query<SaiqianbianpaiView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,wrapper));
PageUtils pageUtil = new PageUtils(page);
return pageUtil;
}
@Override
public List<SaiqianbianpaiVO> selectListVO(Wrapper<SaiqianbianpaiEntity> wrapper) {
return baseMapper.selectListVO(wrapper);
}
@Override
public SaiqianbianpaiVO selectVO(Wrapper<SaiqianbianpaiEntity> wrapper) {
return baseMapper.selectVO(wrapper);
}
@Override
public List<SaiqianbianpaiView> selectListView(Wrapper<SaiqianbianpaiEntity> wrapper) {
return baseMapper.selectListView(wrapper);
}
@Override
public SaiqianbianpaiView selectView(Wrapper<SaiqianbianpaiEntity> wrapper) {
return baseMapper.selectView(wrapper);
}
}

@ -0,0 +1,62 @@
package com.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.SaiqiantongzhiDao;
import com.entity.SaiqiantongzhiEntity;
import com.service.SaiqiantongzhiService;
import com.entity.vo.SaiqiantongzhiVO;
import com.entity.view.SaiqiantongzhiView;
@Service("saiqiantongzhiService")
public class SaiqiantongzhiServiceImpl extends ServiceImpl<SaiqiantongzhiDao, SaiqiantongzhiEntity> implements SaiqiantongzhiService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
Page<SaiqiantongzhiEntity> page = this.selectPage(
new Query<SaiqiantongzhiEntity>(params).getPage(),
new EntityWrapper<SaiqiantongzhiEntity>()
);
return new PageUtils(page);
}
@Override
public PageUtils queryPage(Map<String, Object> params, Wrapper<SaiqiantongzhiEntity> wrapper) {
Page<SaiqiantongzhiView> page =new Query<SaiqiantongzhiView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,wrapper));
PageUtils pageUtil = new PageUtils(page);
return pageUtil;
}
@Override
public List<SaiqiantongzhiVO> selectListVO(Wrapper<SaiqiantongzhiEntity> wrapper) {
return baseMapper.selectListVO(wrapper);
}
@Override
public SaiqiantongzhiVO selectVO(Wrapper<SaiqiantongzhiEntity> wrapper) {
return baseMapper.selectVO(wrapper);
}
@Override
public List<SaiqiantongzhiView> selectListView(Wrapper<SaiqiantongzhiEntity> wrapper) {
return baseMapper.selectListView(wrapper);
}
@Override
public SaiqiantongzhiView selectView(Wrapper<SaiqiantongzhiEntity> wrapper) {
return baseMapper.selectView(wrapper);
}
}

@ -0,0 +1,62 @@
package com.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.SaishichengjiDao;
import com.entity.SaishichengjiEntity;
import com.service.SaishichengjiService;
import com.entity.vo.SaishichengjiVO;
import com.entity.view.SaishichengjiView;
@Service("saishichengjiService")
public class SaishichengjiServiceImpl extends ServiceImpl<SaishichengjiDao, SaishichengjiEntity> implements SaishichengjiService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
Page<SaishichengjiEntity> page = this.selectPage(
new Query<SaishichengjiEntity>(params).getPage(),
new EntityWrapper<SaishichengjiEntity>()
);
return new PageUtils(page);
}
@Override
public PageUtils queryPage(Map<String, Object> params, Wrapper<SaishichengjiEntity> wrapper) {
Page<SaishichengjiView> page =new Query<SaishichengjiView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,wrapper));
PageUtils pageUtil = new PageUtils(page);
return pageUtil;
}
@Override
public List<SaishichengjiVO> selectListVO(Wrapper<SaishichengjiEntity> wrapper) {
return baseMapper.selectListVO(wrapper);
}
@Override
public SaishichengjiVO selectVO(Wrapper<SaishichengjiEntity> wrapper) {
return baseMapper.selectVO(wrapper);
}
@Override
public List<SaishichengjiView> selectListView(Wrapper<SaishichengjiEntity> wrapper) {
return baseMapper.selectListView(wrapper);
}
@Override
public SaishichengjiView selectView(Wrapper<SaishichengjiEntity> wrapper) {
return baseMapper.selectView(wrapper);
}
}

@ -0,0 +1,62 @@
package com.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.SaizhongxinxiDao;
import com.entity.SaizhongxinxiEntity;
import com.service.SaizhongxinxiService;
import com.entity.vo.SaizhongxinxiVO;
import com.entity.view.SaizhongxinxiView;
@Service("saizhongxinxiService")
public class SaizhongxinxiServiceImpl extends ServiceImpl<SaizhongxinxiDao, SaizhongxinxiEntity> implements SaizhongxinxiService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
Page<SaizhongxinxiEntity> page = this.selectPage(
new Query<SaizhongxinxiEntity>(params).getPage(),
new EntityWrapper<SaizhongxinxiEntity>()
);
return new PageUtils(page);
}
@Override
public PageUtils queryPage(Map<String, Object> params, Wrapper<SaizhongxinxiEntity> wrapper) {
Page<SaizhongxinxiView> page =new Query<SaizhongxinxiView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,wrapper));
PageUtils pageUtil = new PageUtils(page);
return pageUtil;
}
@Override
public List<SaizhongxinxiVO> selectListVO(Wrapper<SaizhongxinxiEntity> wrapper) {
return baseMapper.selectListVO(wrapper);
}
@Override
public SaizhongxinxiVO selectVO(Wrapper<SaizhongxinxiEntity> wrapper) {
return baseMapper.selectVO(wrapper);
}
@Override
public List<SaizhongxinxiView> selectListView(Wrapper<SaizhongxinxiEntity> wrapper) {
return baseMapper.selectListView(wrapper);
}
@Override
public SaizhongxinxiView selectView(Wrapper<SaizhongxinxiEntity> wrapper) {
return baseMapper.selectView(wrapper);
}
}

@ -0,0 +1,62 @@
package com.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.TeshuduiyuanDao;
import com.entity.TeshuduiyuanEntity;
import com.service.TeshuduiyuanService;
import com.entity.vo.TeshuduiyuanVO;
import com.entity.view.TeshuduiyuanView;
@Service("teshuduiyuanService")
public class TeshuduiyuanServiceImpl extends ServiceImpl<TeshuduiyuanDao, TeshuduiyuanEntity> implements TeshuduiyuanService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
Page<TeshuduiyuanEntity> page = this.selectPage(
new Query<TeshuduiyuanEntity>(params).getPage(),
new EntityWrapper<TeshuduiyuanEntity>()
);
return new PageUtils(page);
}
@Override
public PageUtils queryPage(Map<String, Object> params, Wrapper<TeshuduiyuanEntity> wrapper) {
Page<TeshuduiyuanView> page =new Query<TeshuduiyuanView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,wrapper));
PageUtils pageUtil = new PageUtils(page);
return pageUtil;
}
@Override
public List<TeshuduiyuanVO> selectListVO(Wrapper<TeshuduiyuanEntity> wrapper) {
return baseMapper.selectListVO(wrapper);
}
@Override
public TeshuduiyuanVO selectVO(Wrapper<TeshuduiyuanEntity> wrapper) {
return baseMapper.selectVO(wrapper);
}
@Override
public List<TeshuduiyuanView> selectListView(Wrapper<TeshuduiyuanEntity> wrapper) {
return baseMapper.selectListView(wrapper);
}
@Override
public TeshuduiyuanView selectView(Wrapper<TeshuduiyuanEntity> wrapper) {
return baseMapper.selectView(wrapper);
}
}

@ -0,0 +1,79 @@
package com.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 com.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,96 @@
package com.utils;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.json.JSONObject;
/**
* :
*/
public class BaiduUtil {
/**
*
* @param lon
* @param lat
* @param coordtype
* @return
*/
public static Map<String, String> getCityByLonLat(String key, String lng, String lat) {
String location = lat + "," + lng;
try {
//拼装url
String url = "http://api.map.baidu.com/reverse_geocoding/v3/?ak="+key+"&output=json&coordtype=wgs84ll&location="+location;
String result = HttpClientUtils.doGet(url);
JSONObject o = new JSONObject(result);
Map<String, String> area = new HashMap<>();
area.put("province", o.getJSONObject("result").getJSONObject("addressComponent").getString("province"));
area.put("city", o.getJSONObject("result").getJSONObject("addressComponent").getString("city"));
area.put("district", o.getJSONObject("result").getJSONObject("addressComponent").getString("district"));
area.put("street", o.getJSONObject("result").getJSONObject("addressComponent").getString("street"));
return area;
}catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* API访token
* token.
* @param ak - API Key
* @param sk - Securet Key
* @return assess_token
*/
public static String getAuth(String ak, String sk) {
// 获取token地址
String authHost = "https://aip.baidubce.com/oauth/2.0/token?";
String getAccessTokenUrl = authHost
// 1. grant_type为固定参数
+ "grant_type=client_credentials"
// 2. 官网获取的 API Key
+ "&client_id=" + ak
// 3. 官网获取的 Secret Key
+ "&client_secret=" + sk;
try {
URL realUrl = new URL(getAccessTokenUrl);
// 打开和URL之间的连接
HttpURLConnection connection = (HttpURLConnection) realUrl.openConnection();
connection.setRequestMethod("GET");
connection.connect();
// 获取所有响应头字段
Map<String, List<String>> map = connection.getHeaderFields();
// 遍历所有的响应头字段
for (String key : map.keySet()) {
System.err.println(key + "--->" + map.get(key));
}
// 定义 BufferedReader输入流来读取URL的响应
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String result = "";
String line;
while ((line = in.readLine()) != null) {
result += line;
}
/**
*
*/
System.err.println("result:" + result);
org.json.JSONObject jsonObject = new org.json.JSONObject(result);
String access_token = jsonObject.getString("access_token");
return access_token;
} catch (Exception e) {
System.err.printf("获取token失败");
e.printStackTrace(System.err);
}
return null;
}
}

@ -0,0 +1,22 @@
package com.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 com.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 com.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 com.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 com.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 com.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 com.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,98 @@
package com.utils;
import java.util.LinkedHashMap;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import com.baomidou.mybatisplus.plugins.Page;
/**
*
*/
public class Query<T> extends LinkedHashMap<String, Object> {
private static final long serialVersionUID = 1L;
/**
* mybatis-plus
*/
private Page<T> page;
/**
*
*/
private int currPage = 1;
/**
*
*/
private int limit = 10;
public Query(JQPageInfo pageInfo) {
//分页参数
if(pageInfo.getPage()!= null){
currPage = pageInfo.getPage();
}
if(pageInfo.getLimit()!= null){
limit = pageInfo.getLimit();
}
//防止SQL注入因为sidx、order是通过拼接SQL实现排序的会有SQL注入风险
String sidx = SQLFilter.sqlInject(pageInfo.getSidx());
String order = SQLFilter.sqlInject(pageInfo.getOrder());
//mybatis-plus分页
this.page = new Page<>(currPage, limit);
//排序
if(StringUtils.isNotBlank(sidx) && StringUtils.isNotBlank(order)){
this.page.setOrderByField(sidx);
this.page.setAsc("ASC".equalsIgnoreCase(order));
}
}
public Query(Map<String, Object> params){
this.putAll(params);
//分页参数
if(params.get("page") != null){
currPage = Integer.parseInt((String)params.get("page"));
}
if(params.get("limit") != null){
limit = Integer.parseInt((String)params.get("limit"));
}
this.put("offset", (currPage - 1) * limit);
this.put("page", currPage);
this.put("limit", limit);
//防止SQL注入因为sidx、order是通过拼接SQL实现排序的会有SQL注入风险
String sidx = SQLFilter.sqlInject((String)params.get("sidx"));
String order = SQLFilter.sqlInject((String)params.get("order"));
this.put("sidx", sidx);
this.put("order", order);
//mybatis-plus分页
this.page = new Page<>(currPage, limit);
//排序
if(StringUtils.isNotBlank(sidx) && StringUtils.isNotBlank(order)){
this.page.setOrderByField(sidx);
this.page.setAsc("ASC".equalsIgnoreCase(order));
}
}
public Page<T> getPage() {
return page;
}
public int getCurrPage() {
return currPage;
}
public int getLimit() {
return limit;
}
}

@ -0,0 +1,51 @@
package com.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 com.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 com.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);
}
}

@ -0,0 +1,39 @@
package com.utils;
import java.util.Set;
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import com.entity.EIException;
/**
* hibernate-validator
*/
public class ValidatorUtils {
private static Validator validator;
static {
validator = Validation.buildDefaultValidatorFactory().getValidator();
}
/**
*
* @param object
* @param groups
* @throws EIException EIException
*/
public static void validateEntity(Object object, Class<?>... groups)
throws EIException {
Set<ConstraintViolation<Object>> constraintViolations = validator.validate(object, groups);
if (!constraintViolations.isEmpty()) {
ConstraintViolation<Object> constraint = (ConstraintViolation<Object>)constraintViolations.iterator().next();
throw new EIException(constraint.getMessage());
}
}
}
Loading…
Cancel
Save