├── image ├── 1.png ├── 10.png ├── 11.png ├── 12.png ├── 2.png ├── 3.png ├── 4.png ├── 5.png ├── 6.png ├── 7.png ├── 8.png └── 9.png ├── limage ├── 1.png ├── 2.png └── 3.png ├── src └── main │ ├── resources │ ├── img │ │ └── img │ │ │ ├── logo.jpg │ │ │ ├── back-img-bg.jpg │ │ │ ├── front-img-bg.jpg │ │ │ └── back-list-img-bg.jpg │ ├── mapper │ │ ├── ConfigDao.xml │ │ ├── UsersDao.xml │ │ ├── TokenDao.xml │ │ ├── GonggaoDao.xml │ │ ├── SijiDao.xml │ │ ├── DictionaryDao.xml │ │ ├── ShangpinChuruInoutDao.xml │ │ ├── YuangongDao.xml │ │ ├── YonghuDao.xml │ │ ├── CangkuDao.xml │ │ └── CheliangDao.xml │ └── application.yml │ └── java │ └── com │ ├── dao │ ├── ConfigDao.java │ ├── SijiDao.java │ ├── ChatDao.java │ ├── HuowuDao.java │ ├── CangkuDao.java │ ├── YonghuDao.java │ ├── AddressDao.java │ ├── GonggaoDao.java │ ├── CheliangDao.java │ ├── ShangpinDao.java │ ├── YuangongDao.java │ ├── DictionaryDao.java │ ├── ShangpinOrderDao.java │ ├── UsersDao.java │ ├── TokenDao.java │ ├── ShangpinChuruInoutDao.java │ ├── ShangpinCollectionDao.java │ ├── ShangpinChuruInoutListDao.java │ └── CommonDao.java │ ├── annotation │ ├── IgnoreAuth.java │ ├── LoginUser.java │ ├── APPLoginUser.java │ └── ColumnInfo.java │ ├── utils │ ├── StringUtil.java │ ├── DateUtil.java │ ├── MD5Utils.java │ ├── FileUtil.java │ ├── JQPageInfo.java │ ├── R.java │ ├── SQLFilter.java │ ├── HttpClientUtils.java │ ├── ValidatorUtils.java │ ├── SpringContextUtils.java │ ├── CommonUtil.java │ ├── PageUtils.java │ ├── Query.java │ ├── BaiduUtil.java │ └── PoiUtil.java │ ├── service │ ├── ConfigService.java │ ├── SijiService.java │ ├── ChatService.java │ ├── HuowuService.java │ ├── CangkuService.java │ ├── YonghuService.java │ ├── AddressService.java │ ├── GonggaoService.java │ ├── CheliangService.java │ ├── ShangpinService.java │ ├── YuangongService.java │ ├── ShangpinOrderService.java │ ├── ShangpinChuruInoutService.java │ ├── ShangpinCollectionService.java │ ├── ShangpinChuruInoutListService.java │ ├── UsersService.java │ ├── DictionaryService.java │ ├── TokenService.java │ ├── impl │ │ ├── ConfigServiceImpl.java │ │ ├── SijiServiceImpl.java │ │ ├── ChatServiceImpl.java │ │ ├── HuowuServiceImpl.java │ │ ├── CangkuServiceImpl.java │ │ ├── YonghuServiceImpl.java │ │ ├── AddressServiceImpl.java │ │ ├── GonggaoServiceImpl.java │ │ ├── CheliangServiceImpl.java │ │ ├── ShangpinServiceImpl.java │ │ ├── YuangongServiceImpl.java │ │ ├── UsersServiceImpl.java │ │ ├── ShangpinOrderServiceImpl.java │ │ ├── ShangpinChuruInoutServiceImpl.java │ │ ├── ShangpinCollectionServiceImpl.java │ │ ├── ShangpinChuruInoutListServiceImpl.java │ │ ├── CommonServiceImpl.java │ │ └── TokenServiceImpl.java │ └── CommonService.java │ ├── config │ ├── MybatisPlusConfig.java │ ├── MyMetaObjectHandler.java │ └── InterceptorConfig.java │ ├── thread │ └── MyThreadMethod.java │ ├── model │ └── enums │ │ └── TypeEnum.java │ ├── wuliuguanlixitongApplication.java │ ├── entity │ ├── EIException.java │ ├── ConfigEntity.java │ ├── view │ │ ├── DictionaryView.java │ │ ├── SijiView.java │ │ ├── YonghuView.java │ │ ├── YuangongView.java │ │ ├── CangkuView.java │ │ ├── GonggaoView.java │ │ ├── CheliangView.java │ │ └── ShangpinChuruInoutView.java │ ├── UsersEntity.java │ ├── TokenEntity.java │ ├── model │ │ ├── ShangpinCollectionModel.java │ │ ├── GonggaoModel.java │ │ ├── DictionaryModel.java │ │ ├── ShangpinChuruInoutListModel.java │ │ ├── ShangpinChuruInoutModel.java │ │ ├── SijiModel.java │ │ ├── ChatModel.java │ │ ├── HuowuModel.java │ │ └── AddressModel.java │ └── vo │ │ ├── ShangpinCollectionVO.java │ │ ├── GonggaoVO.java │ │ ├── DictionaryVO.java │ │ ├── ShangpinChuruInoutListVO.java │ │ ├── ShangpinChuruInoutVO.java │ │ └── SijiVO.java │ ├── ServletContextListener │ └── DictionaryServletContextListener.java │ ├── controller │ ├── ConfigController.java │ └── FileController.java │ └── interceptor │ └── AuthorizationInterceptor.java ├── .idea ├── .gitignore ├── encodings.xml ├── runConfigurations.xml ├── misc.xml ├── compiler.xml └── jarRepositories.xml └── README.md /image/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No258logistics-management-system/HEAD/image/1.png -------------------------------------------------------------------------------- /image/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No258logistics-management-system/HEAD/image/10.png -------------------------------------------------------------------------------- /image/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No258logistics-management-system/HEAD/image/11.png -------------------------------------------------------------------------------- /image/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No258logistics-management-system/HEAD/image/12.png -------------------------------------------------------------------------------- /image/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No258logistics-management-system/HEAD/image/2.png -------------------------------------------------------------------------------- /image/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No258logistics-management-system/HEAD/image/3.png -------------------------------------------------------------------------------- /image/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No258logistics-management-system/HEAD/image/4.png -------------------------------------------------------------------------------- /image/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No258logistics-management-system/HEAD/image/5.png -------------------------------------------------------------------------------- /image/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No258logistics-management-system/HEAD/image/6.png -------------------------------------------------------------------------------- /image/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No258logistics-management-system/HEAD/image/7.png -------------------------------------------------------------------------------- /image/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No258logistics-management-system/HEAD/image/8.png -------------------------------------------------------------------------------- /image/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No258logistics-management-system/HEAD/image/9.png -------------------------------------------------------------------------------- /limage/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No258logistics-management-system/HEAD/limage/1.png -------------------------------------------------------------------------------- /limage/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No258logistics-management-system/HEAD/limage/2.png -------------------------------------------------------------------------------- /limage/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No258logistics-management-system/HEAD/limage/3.png -------------------------------------------------------------------------------- /src/main/resources/img/img/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No258logistics-management-system/HEAD/src/main/resources/img/img/logo.jpg -------------------------------------------------------------------------------- /src/main/resources/img/img/back-img-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No258logistics-management-system/HEAD/src/main/resources/img/img/back-img-bg.jpg -------------------------------------------------------------------------------- /src/main/resources/img/img/front-img-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No258logistics-management-system/HEAD/src/main/resources/img/img/front-img-bg.jpg -------------------------------------------------------------------------------- /src/main/resources/img/img/back-list-img-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No258logistics-management-system/HEAD/src/main/resources/img/img/back-list-img-bg.jpg -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/main/resources/mapper/ConfigDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/main/java/com/dao/ConfigDao.java: -------------------------------------------------------------------------------- 1 | 2 | package com.dao; 3 | 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import com.entity.ConfigEntity; 6 | 7 | /** 8 | * 配置 9 | */ 10 | public interface ConfigDao extends BaseMapper { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/annotation/IgnoreAuth.java: -------------------------------------------------------------------------------- 1 | package com.annotation; 2 | 3 | import java.lang.annotation.*; 4 | 5 | /** 6 | * 忽略Token验证 7 | */ 8 | @Target(ElementType.METHOD) 9 | @Retention(RetentionPolicy.RUNTIME) 10 | @Documented 11 | public @interface IgnoreAuth { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /src/main/java/com/annotation/LoginUser.java: -------------------------------------------------------------------------------- 1 | package com.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * 登录用户信息 10 | */ 11 | @Target(ElementType.PARAMETER) 12 | @Retention(RetentionPolicy.RUNTIME) 13 | public @interface LoginUser { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/utils/StringUtil.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | public class StringUtil { 4 | 5 | public static boolean isEmpty(String s){ 6 | if(s==null || s.equals("") || s.equals("null")){ 7 | return true; 8 | } 9 | return false; 10 | } 11 | 12 | public static boolean isNotEmpty(String s){ 13 | return !StringUtil.isEmpty(s); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/annotation/APPLoginUser.java: -------------------------------------------------------------------------------- 1 | package com.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * 登录用户信息 10 | */ 11 | @Target(ElementType.PARAMETER) 12 | @Retention(RetentionPolicy.RUNTIME) 13 | public @interface APPLoginUser { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/annotation/ColumnInfo.java: -------------------------------------------------------------------------------- 1 | package com.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Target(ElementType.FIELD) 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface ColumnInfo { 11 | String comment(); 12 | String type(); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/resources/mapper/UsersDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/resources/mapper/TokenDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/java/com/service/ConfigService.java: -------------------------------------------------------------------------------- 1 | 2 | package com.service; 3 | 4 | import java.util.Map; 5 | 6 | import com.baomidou.mybatisplus.service.IService; 7 | import com.entity.ConfigEntity; 8 | import com.utils.PageUtils; 9 | 10 | 11 | /** 12 | * 系统用户 13 | * @author yangliyuan 14 | * @date 2019年10月10日 上午9:18:20 15 | */ 16 | public interface ConfigService extends IService { 17 | PageUtils queryPage(Map params); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/utils/DateUtil.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | import java.text.Format; 4 | import java.text.SimpleDateFormat; 5 | import java.util.Date; 6 | 7 | public class DateUtil { 8 | 9 | 10 | public static String convertString(Date date,String format){ 11 | if(date == null){ 12 | return null; 13 | } 14 | SimpleDateFormat sdf = new SimpleDateFormat(format); 15 | return sdf.format(date); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/main/java/com/service/SijiService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.service.IService; 4 | import com.utils.PageUtils; 5 | import com.entity.SijiEntity; 6 | import java.util.Map; 7 | import javax.servlet.http.HttpServletRequest; 8 | import org.springframework.lang.Nullable; 9 | import java.util.List; 10 | 11 | /** 12 | * 司机 服务类 13 | */ 14 | public interface SijiService extends IService { 15 | 16 | /** 17 | * @param params 查询参数 18 | * @return 带分页的查询出来的数据 19 | */ 20 | PageUtils queryPage(Map params); 21 | 22 | } -------------------------------------------------------------------------------- /src/main/java/com/dao/SijiDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.SijiEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 8 | 9 | import org.apache.ibatis.annotations.Param; 10 | import com.entity.view.SijiView; 11 | 12 | /** 13 | * 司机 Dao 接口 14 | * 15 | * @author 16 | */ 17 | public interface SijiDao extends BaseMapper { 18 | 19 | List selectListView(Pagination page,@Param("params")Map params); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/service/ChatService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.service.IService; 4 | import com.utils.PageUtils; 5 | import com.entity.ChatEntity; 6 | import java.util.Map; 7 | import javax.servlet.http.HttpServletRequest; 8 | import org.springframework.lang.Nullable; 9 | import java.util.List; 10 | 11 | /** 12 | * 反馈信息 服务类 13 | */ 14 | public interface ChatService extends IService { 15 | 16 | /** 17 | * @param params 查询参数 18 | * @return 带分页的查询出来的数据 19 | */ 20 | PageUtils queryPage(Map params); 21 | 22 | } -------------------------------------------------------------------------------- /src/main/java/com/service/HuowuService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.service.IService; 4 | import com.utils.PageUtils; 5 | import com.entity.HuowuEntity; 6 | import java.util.Map; 7 | import javax.servlet.http.HttpServletRequest; 8 | import org.springframework.lang.Nullable; 9 | import java.util.List; 10 | 11 | /** 12 | * 货物 服务类 13 | */ 14 | public interface HuowuService extends IService { 15 | 16 | /** 17 | * @param params 查询参数 18 | * @return 带分页的查询出来的数据 19 | */ 20 | PageUtils queryPage(Map params); 21 | 22 | } -------------------------------------------------------------------------------- /src/main/java/com/dao/ChatDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.ChatEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 8 | 9 | import org.apache.ibatis.annotations.Param; 10 | import com.entity.view.ChatView; 11 | 12 | /** 13 | * 反馈信息 Dao 接口 14 | * 15 | * @author 16 | */ 17 | public interface ChatDao extends BaseMapper { 18 | 19 | List selectListView(Pagination page,@Param("params")Map params); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/dao/HuowuDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.HuowuEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 8 | 9 | import org.apache.ibatis.annotations.Param; 10 | import com.entity.view.HuowuView; 11 | 12 | /** 13 | * 货物 Dao 接口 14 | * 15 | * @author 16 | */ 17 | public interface HuowuDao extends BaseMapper { 18 | 19 | List selectListView(Pagination page,@Param("params")Map params); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/service/CangkuService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.service.IService; 4 | import com.utils.PageUtils; 5 | import com.entity.CangkuEntity; 6 | import java.util.Map; 7 | import javax.servlet.http.HttpServletRequest; 8 | import org.springframework.lang.Nullable; 9 | import java.util.List; 10 | 11 | /** 12 | * 仓库 服务类 13 | */ 14 | public interface CangkuService extends IService { 15 | 16 | /** 17 | * @param params 查询参数 18 | * @return 带分页的查询出来的数据 19 | */ 20 | PageUtils queryPage(Map params); 21 | 22 | } -------------------------------------------------------------------------------- /src/main/java/com/service/YonghuService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.service.IService; 4 | import com.utils.PageUtils; 5 | import com.entity.YonghuEntity; 6 | import java.util.Map; 7 | import javax.servlet.http.HttpServletRequest; 8 | import org.springframework.lang.Nullable; 9 | import java.util.List; 10 | 11 | /** 12 | * 用户 服务类 13 | */ 14 | public interface YonghuService extends IService { 15 | 16 | /** 17 | * @param params 查询参数 18 | * @return 带分页的查询出来的数据 19 | */ 20 | PageUtils queryPage(Map params); 21 | 22 | } -------------------------------------------------------------------------------- /src/main/java/com/service/AddressService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.service.IService; 4 | import com.utils.PageUtils; 5 | import com.entity.AddressEntity; 6 | import java.util.Map; 7 | import javax.servlet.http.HttpServletRequest; 8 | import org.springframework.lang.Nullable; 9 | import java.util.List; 10 | 11 | /** 12 | * 收货地址 服务类 13 | */ 14 | public interface AddressService extends IService { 15 | 16 | /** 17 | * @param params 查询参数 18 | * @return 带分页的查询出来的数据 19 | */ 20 | PageUtils queryPage(Map params); 21 | 22 | } -------------------------------------------------------------------------------- /src/main/java/com/service/GonggaoService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.service.IService; 4 | import com.utils.PageUtils; 5 | import com.entity.GonggaoEntity; 6 | import java.util.Map; 7 | import javax.servlet.http.HttpServletRequest; 8 | import org.springframework.lang.Nullable; 9 | import java.util.List; 10 | 11 | /** 12 | * 公告 服务类 13 | */ 14 | public interface GonggaoService extends IService { 15 | 16 | /** 17 | * @param params 查询参数 18 | * @return 带分页的查询出来的数据 19 | */ 20 | PageUtils queryPage(Map params); 21 | 22 | } -------------------------------------------------------------------------------- /src/main/java/com/dao/CangkuDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.CangkuEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 8 | 9 | import org.apache.ibatis.annotations.Param; 10 | import com.entity.view.CangkuView; 11 | 12 | /** 13 | * 仓库 Dao 接口 14 | * 15 | * @author 16 | */ 17 | public interface CangkuDao extends BaseMapper { 18 | 19 | List selectListView(Pagination page,@Param("params")Map params); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/dao/YonghuDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.YonghuEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 8 | 9 | import org.apache.ibatis.annotations.Param; 10 | import com.entity.view.YonghuView; 11 | 12 | /** 13 | * 用户 Dao 接口 14 | * 15 | * @author 16 | */ 17 | public interface YonghuDao extends BaseMapper { 18 | 19 | List selectListView(Pagination page,@Param("params")Map params); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/service/CheliangService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.service.IService; 4 | import com.utils.PageUtils; 5 | import com.entity.CheliangEntity; 6 | import java.util.Map; 7 | import javax.servlet.http.HttpServletRequest; 8 | import org.springframework.lang.Nullable; 9 | import java.util.List; 10 | 11 | /** 12 | * 车辆 服务类 13 | */ 14 | public interface CheliangService extends IService { 15 | 16 | /** 17 | * @param params 查询参数 18 | * @return 带分页的查询出来的数据 19 | */ 20 | PageUtils queryPage(Map params); 21 | 22 | } -------------------------------------------------------------------------------- /src/main/java/com/service/ShangpinService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.service.IService; 4 | import com.utils.PageUtils; 5 | import com.entity.ShangpinEntity; 6 | import java.util.Map; 7 | import javax.servlet.http.HttpServletRequest; 8 | import org.springframework.lang.Nullable; 9 | import java.util.List; 10 | 11 | /** 12 | * 商品 服务类 13 | */ 14 | public interface ShangpinService extends IService { 15 | 16 | /** 17 | * @param params 查询参数 18 | * @return 带分页的查询出来的数据 19 | */ 20 | PageUtils queryPage(Map params); 21 | 22 | } -------------------------------------------------------------------------------- /src/main/java/com/service/YuangongService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.service.IService; 4 | import com.utils.PageUtils; 5 | import com.entity.YuangongEntity; 6 | import java.util.Map; 7 | import javax.servlet.http.HttpServletRequest; 8 | import org.springframework.lang.Nullable; 9 | import java.util.List; 10 | 11 | /** 12 | * 员工 服务类 13 | */ 14 | public interface YuangongService extends IService { 15 | 16 | /** 17 | * @param params 查询参数 18 | * @return 带分页的查询出来的数据 19 | */ 20 | PageUtils queryPage(Map params); 21 | 22 | } -------------------------------------------------------------------------------- /src/main/java/com/dao/AddressDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.AddressEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 8 | 9 | import org.apache.ibatis.annotations.Param; 10 | import com.entity.view.AddressView; 11 | 12 | /** 13 | * 收货地址 Dao 接口 14 | * 15 | * @author 16 | */ 17 | public interface AddressDao extends BaseMapper { 18 | 19 | List selectListView(Pagination page,@Param("params")Map params); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/dao/GonggaoDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.GonggaoEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 8 | 9 | import org.apache.ibatis.annotations.Param; 10 | import com.entity.view.GonggaoView; 11 | 12 | /** 13 | * 公告 Dao 接口 14 | * 15 | * @author 16 | */ 17 | public interface GonggaoDao extends BaseMapper { 18 | 19 | List selectListView(Pagination page,@Param("params")Map params); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/dao/CheliangDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.CheliangEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 8 | 9 | import org.apache.ibatis.annotations.Param; 10 | import com.entity.view.CheliangView; 11 | 12 | /** 13 | * 车辆 Dao 接口 14 | * 15 | * @author 16 | */ 17 | public interface CheliangDao extends BaseMapper { 18 | 19 | List selectListView(Pagination page,@Param("params")Map params); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/dao/ShangpinDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.ShangpinEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 8 | 9 | import org.apache.ibatis.annotations.Param; 10 | import com.entity.view.ShangpinView; 11 | 12 | /** 13 | * 商品 Dao 接口 14 | * 15 | * @author 16 | */ 17 | public interface ShangpinDao extends BaseMapper { 18 | 19 | List selectListView(Pagination page,@Param("params")Map params); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/dao/YuangongDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.YuangongEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 8 | 9 | import org.apache.ibatis.annotations.Param; 10 | import com.entity.view.YuangongView; 11 | 12 | /** 13 | * 员工 Dao 接口 14 | * 15 | * @author 16 | */ 17 | public interface YuangongDao extends BaseMapper { 18 | 19 | List selectListView(Pagination page,@Param("params")Map params); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/dao/DictionaryDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.DictionaryEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 8 | 9 | import org.apache.ibatis.annotations.Param; 10 | import com.entity.view.DictionaryView; 11 | 12 | /** 13 | * 字典 Dao 接口 14 | * 15 | * @author 16 | */ 17 | public interface DictionaryDao extends BaseMapper { 18 | 19 | List selectListView(Pagination page,@Param("params")Map params); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/service/ShangpinOrderService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.service.IService; 4 | import com.utils.PageUtils; 5 | import com.entity.ShangpinOrderEntity; 6 | import java.util.Map; 7 | import javax.servlet.http.HttpServletRequest; 8 | import org.springframework.lang.Nullable; 9 | import java.util.List; 10 | 11 | /** 12 | * 商品订单 服务类 13 | */ 14 | public interface ShangpinOrderService extends IService { 15 | 16 | /** 17 | * @param params 查询参数 18 | * @return 带分页的查询出来的数据 19 | */ 20 | PageUtils queryPage(Map params); 21 | 22 | } -------------------------------------------------------------------------------- /src/main/java/com/config/MybatisPlusConfig.java: -------------------------------------------------------------------------------- 1 | 2 | package com.config; 3 | 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | import com.baomidou.mybatisplus.mapper.MetaObjectHandler; 8 | import com.baomidou.mybatisplus.plugins.PaginationInterceptor; 9 | 10 | /** 11 | * mybatis-plus配置 12 | */ 13 | @Configuration 14 | public class MybatisPlusConfig { 15 | 16 | /** 17 | * 分页插件 18 | */ 19 | @Bean 20 | public PaginationInterceptor paginationInterceptor() { 21 | return new PaginationInterceptor(); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/dao/ShangpinOrderDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.ShangpinOrderEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 8 | 9 | import org.apache.ibatis.annotations.Param; 10 | import com.entity.view.ShangpinOrderView; 11 | 12 | /** 13 | * 商品订单 Dao 接口 14 | * 15 | * @author 16 | */ 17 | public interface ShangpinOrderDao extends BaseMapper { 18 | 19 | List selectListView(Pagination page,@Param("params")Map params); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/service/ShangpinChuruInoutService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.service.IService; 4 | import com.utils.PageUtils; 5 | import com.entity.ShangpinChuruInoutEntity; 6 | import java.util.Map; 7 | import javax.servlet.http.HttpServletRequest; 8 | import org.springframework.lang.Nullable; 9 | import java.util.List; 10 | 11 | /** 12 | * 出入库 服务类 13 | */ 14 | public interface ShangpinChuruInoutService extends IService { 15 | 16 | /** 17 | * @param params 查询参数 18 | * @return 带分页的查询出来的数据 19 | */ 20 | PageUtils queryPage(Map params); 21 | 22 | } -------------------------------------------------------------------------------- /src/main/java/com/service/ShangpinCollectionService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.service.IService; 4 | import com.utils.PageUtils; 5 | import com.entity.ShangpinCollectionEntity; 6 | import java.util.Map; 7 | import javax.servlet.http.HttpServletRequest; 8 | import org.springframework.lang.Nullable; 9 | import java.util.List; 10 | 11 | /** 12 | * 商品收藏 服务类 13 | */ 14 | public interface ShangpinCollectionService extends IService { 15 | 16 | /** 17 | * @param params 查询参数 18 | * @return 带分页的查询出来的数据 19 | */ 20 | PageUtils queryPage(Map params); 21 | 22 | } -------------------------------------------------------------------------------- /src/main/java/com/dao/UsersDao.java: -------------------------------------------------------------------------------- 1 | 2 | package com.dao; 3 | 4 | import java.util.List; 5 | 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import com.baomidou.mybatisplus.mapper.BaseMapper; 9 | import com.baomidou.mybatisplus.mapper.Wrapper; 10 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 11 | import com.entity.UsersEntity; 12 | 13 | /** 14 | * 用户 15 | */ 16 | public interface UsersDao extends BaseMapper { 17 | 18 | List selectListView(@Param("ew") Wrapper wrapper); 19 | 20 | List selectListView(Pagination page, @Param("ew") Wrapper wrapper); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/thread/MyThreadMethod.java: -------------------------------------------------------------------------------- 1 | package com.thread; 2 | 3 | /** 4 | * 线程执行方法(做一些项目启动后 一直要执行的操作,比如根据时间自动更改订单状态,比如订单签收30天自动收货功能,比如根据时间来更改状态) 5 | */ 6 | public class MyThreadMethod extends Thread { 7 | public void run() { 8 | while (!this.isInterrupted()) {// 线程未中断执行循环 9 | try { 10 | Thread.sleep(5000); //每隔2000ms执行一次 11 | } catch (InterruptedException e) { 12 | e.printStackTrace(); 13 | } 14 | 15 | // ------------------ 开始执行 --------------------------- 16 | // System.out.println("线程执行中:" + System.currentTimeMillis()); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/dao/TokenDao.java: -------------------------------------------------------------------------------- 1 | 2 | package com.dao; 3 | 4 | import java.util.List; 5 | 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import com.baomidou.mybatisplus.mapper.BaseMapper; 9 | import com.baomidou.mybatisplus.mapper.Wrapper; 10 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 11 | import com.entity.TokenEntity; 12 | 13 | /** 14 | * token 15 | */ 16 | public interface TokenDao extends BaseMapper { 17 | 18 | List selectListView(@Param("ew") Wrapper wrapper); 19 | 20 | List selectListView(Pagination page,@Param("ew") Wrapper wrapper); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/service/ShangpinChuruInoutListService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.service.IService; 4 | import com.utils.PageUtils; 5 | import com.entity.ShangpinChuruInoutListEntity; 6 | import java.util.Map; 7 | import javax.servlet.http.HttpServletRequest; 8 | import org.springframework.lang.Nullable; 9 | import java.util.List; 10 | 11 | /** 12 | * 出入库详情 服务类 13 | */ 14 | public interface ShangpinChuruInoutListService extends IService { 15 | 16 | /** 17 | * @param params 查询参数 18 | * @return 带分页的查询出来的数据 19 | */ 20 | PageUtils queryPage(Map params); 21 | 22 | } -------------------------------------------------------------------------------- /src/main/java/com/dao/ShangpinChuruInoutDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.ShangpinChuruInoutEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 8 | 9 | import org.apache.ibatis.annotations.Param; 10 | import com.entity.view.ShangpinChuruInoutView; 11 | 12 | /** 13 | * 出入库 Dao 接口 14 | * 15 | * @author 16 | */ 17 | public interface ShangpinChuruInoutDao extends BaseMapper { 18 | 19 | List selectListView(Pagination page,@Param("params")Map params); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/dao/ShangpinCollectionDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.ShangpinCollectionEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 8 | 9 | import org.apache.ibatis.annotations.Param; 10 | import com.entity.view.ShangpinCollectionView; 11 | 12 | /** 13 | * 商品收藏 Dao 接口 14 | * 15 | * @author 16 | */ 17 | public interface ShangpinCollectionDao extends BaseMapper { 18 | 19 | List selectListView(Pagination page,@Param("params")Map params); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/dao/ShangpinChuruInoutListDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.ShangpinChuruInoutListEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 8 | 9 | import org.apache.ibatis.annotations.Param; 10 | import com.entity.view.ShangpinChuruInoutListView; 11 | 12 | /** 13 | * 出入库详情 Dao 接口 14 | * 15 | * @author 16 | */ 17 | public interface ShangpinChuruInoutListDao extends BaseMapper { 18 | 19 | List selectListView(Pagination page,@Param("params")Map params); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/config/MyMetaObjectHandler.java: -------------------------------------------------------------------------------- 1 | package com.config; 2 | 3 | import java.util.Date; 4 | 5 | import org.apache.ibatis.reflection.MetaObject; 6 | 7 | import com.baomidou.mybatisplus.mapper.MetaObjectHandler; 8 | 9 | /** 10 | * 自定义填充处理器 11 | */ 12 | public class MyMetaObjectHandler extends MetaObjectHandler { 13 | 14 | @Override 15 | public void insertFill(MetaObject metaObject) { 16 | this.setFieldValByName("ctime", new Date(), metaObject); 17 | } 18 | 19 | @Override 20 | public boolean openUpdateFill() { 21 | return false; 22 | } 23 | 24 | @Override 25 | public void updateFill(MetaObject metaObject) { 26 | // 关闭更新填充、这里不执行 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/service/UsersService.java: -------------------------------------------------------------------------------- 1 | 2 | package com.service; 3 | 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.service.IService; 9 | import com.entity.UsersEntity; 10 | import com.utils.PageUtils; 11 | 12 | 13 | /** 14 | * 系统用户 15 | * @author yangliyuan 16 | * @date 2019年10月10日 上午9:18:20 17 | */ 18 | public interface UsersService extends IService { 19 | PageUtils queryPage(Map params); 20 | 21 | List selectListView(Wrapper wrapper); 22 | 23 | PageUtils queryPage(Map params, Wrapper wrapper); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/service/DictionaryService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.service.IService; 4 | import com.utils.PageUtils; 5 | import com.entity.DictionaryEntity; 6 | import java.util.Map; 7 | import javax.servlet.http.HttpServletRequest; 8 | import org.springframework.lang.Nullable; 9 | import java.util.List; 10 | 11 | /** 12 | * 字典 服务类 13 | */ 14 | public interface DictionaryService extends IService { 15 | 16 | /** 17 | * @param params 查询参数 18 | * @return 带分页的查询出来的数据 19 | */ 20 | PageUtils queryPage(Map params); 21 | /** 22 | * 字典表转换 23 | * @param obj 24 | */ 25 | void dictionaryConvert(Object obj, HttpServletRequest request); 26 | 27 | } -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | -------------------------------------------------------------------------------- /src/main/java/com/model/enums/TypeEnum.java: -------------------------------------------------------------------------------- 1 | package com.model.enums; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.baomidou.mybatisplus.enums.IEnum; 6 | 7 | /** 8 | * 必须现在 IEnum 配置 该包扫描自动注入,查看文件 spring-mybatis.xml 参数 typeEnumsPackage 9 | */ 10 | public enum TypeEnum implements IEnum { 11 | DISABLED(0, "禁用"), 12 | NORMAL(1, "正常"); 13 | 14 | private final int value; 15 | private final String desc; 16 | 17 | TypeEnum(final int value, final String desc) { 18 | this.value = value; 19 | this.desc = desc; 20 | } 21 | 22 | @Override 23 | public Serializable getValue() { 24 | return this.value; 25 | } 26 | 27 | // Jackson 注解为 JsonValue 返回中文 json 描述 28 | public String getDesc() { 29 | return this.desc; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/utils/MD5Utils.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | import java.math.BigInteger; 4 | import java.security.MessageDigest; 5 | import java.security.NoSuchAlgorithmException; 6 | 7 | public class MD5Utils { 8 | public static String md5(String plainText) { 9 | byte[] secretBytes = null; 10 | try { 11 | secretBytes = MessageDigest.getInstance("md5").digest( 12 | plainText.getBytes()); 13 | } catch (NoSuchAlgorithmException e) { 14 | throw new RuntimeException("没有这个md5算法!"); 15 | } 16 | String md5code = new BigInteger(1, secretBytes).toString(16); 17 | for (int i = 0; i < 32 - md5code.length(); i++) { 18 | md5code = "0" + md5code; 19 | } 20 | return md5code; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/utils/FileUtil.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | import java.io.ByteArrayOutputStream; 4 | import java.io.File; 5 | import java.io.FileInputStream; 6 | import java.io.IOException; 7 | import java.io.InputStream; 8 | 9 | /** 10 | * @author yangliyuan 11 | * @version 创建时间:2020年2月7日 下午8:01:14 12 | * 类说明 : 13 | */ 14 | 15 | public class FileUtil { 16 | public static byte[] FileToByte(File file) throws IOException { 17 | // 将数据转为流 18 | @SuppressWarnings("resource") 19 | InputStream content = new FileInputStream(file); 20 | ByteArrayOutputStream swapStream = new ByteArrayOutputStream(); 21 | byte[] buff = new byte[100]; 22 | int rc = 0; 23 | while ((rc = content.read(buff, 0, 100)) > 0) { 24 | swapStream.write(buff, 0, rc); 25 | } 26 | // 获得二进制数组 27 | return swapStream.toByteArray(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/service/TokenService.java: -------------------------------------------------------------------------------- 1 | 2 | package com.service; 3 | 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.service.IService; 9 | import com.entity.TokenEntity; 10 | import com.utils.PageUtils; 11 | 12 | 13 | /** 14 | * token 15 | * @author yangliyuan 16 | * @date 2019年10月10日 上午9:18:20 17 | */ 18 | public interface TokenService extends IService { 19 | PageUtils queryPage(Map params); 20 | 21 | List selectListView(Wrapper wrapper); 22 | 23 | PageUtils queryPage(Map params,Wrapper wrapper); 24 | 25 | String generateToken(Integer userid,String username,String tableName, String role); 26 | 27 | TokenEntity getTokenEntity(String token); 28 | } 29 | -------------------------------------------------------------------------------- /.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | -------------------------------------------------------------------------------- /src/main/java/com/utils/JQPageInfo.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | public class JQPageInfo{ 4 | private Integer page; 5 | 6 | private Integer limit; 7 | 8 | private String sidx; 9 | 10 | private String order; 11 | 12 | private Integer offset; 13 | 14 | public Integer getPage() { 15 | return page; 16 | } 17 | 18 | public void setPage(Integer page) { 19 | this.page = page; 20 | } 21 | 22 | public Integer getLimit() { 23 | return limit; 24 | } 25 | 26 | public void setLimit(Integer limit) { 27 | this.limit = limit; 28 | } 29 | 30 | public String getSidx() { 31 | return sidx; 32 | } 33 | 34 | public void setSidx(String sidx) { 35 | this.sidx = sidx; 36 | } 37 | 38 | public String getOrder() { 39 | return order; 40 | } 41 | 42 | public void setOrder(String order) { 43 | this.order = order; 44 | } 45 | 46 | public Integer getOffset() { 47 | return offset; 48 | } 49 | 50 | public void setOffset(Integer offset) { 51 | this.offset = offset; 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/wuliuguanlixitongApplication.java: -------------------------------------------------------------------------------- 1 | package com; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.boot.builder.SpringApplicationBuilder; 7 | import org.springframework.boot.web.servlet.ServletComponentScan; 8 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 9 | 10 | @SpringBootApplication 11 | @ServletComponentScan(value = "com.ServletContextListener") 12 | @MapperScan(basePackages = {"com.dao"}) 13 | public class wuliuguanlixitongApplication extends SpringBootServletInitializer{ 14 | 15 | public static void main(String[] args) { 16 | SpringApplication.run(wuliuguanlixitongApplication.class, args); 17 | } 18 | 19 | @Override 20 | protected SpringApplicationBuilder configure(SpringApplicationBuilder applicationBuilder) { 21 | return applicationBuilder.sources(wuliuguanlixitongApplication.class); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/entity/EIException.java: -------------------------------------------------------------------------------- 1 | 2 | package com.entity; 3 | 4 | /** 5 | * 自定义异常 6 | */ 7 | public class EIException extends RuntimeException { 8 | private static final long serialVersionUID = 1L; 9 | 10 | private String msg; 11 | private int code = 500; 12 | 13 | public EIException(String msg) { 14 | super(msg); 15 | this.msg = msg; 16 | } 17 | 18 | public EIException(String msg, Throwable e) { 19 | super(msg, e); 20 | this.msg = msg; 21 | } 22 | 23 | public EIException(String msg, int code) { 24 | super(msg); 25 | this.msg = msg; 26 | this.code = code; 27 | } 28 | 29 | public EIException(String msg, int code, Throwable e) { 30 | super(msg, e); 31 | this.msg = msg; 32 | this.code = code; 33 | } 34 | 35 | public String getMsg() { 36 | return msg; 37 | } 38 | 39 | public void setMsg(String msg) { 40 | this.msg = msg; 41 | } 42 | 43 | public int getCode() { 44 | return code; 45 | } 46 | 47 | public void setCode(int code) { 48 | this.code = code; 49 | } 50 | 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/utils/R.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | /** 7 | * 返回数据 8 | */ 9 | public class R extends HashMap { 10 | private static final long serialVersionUID = 1L; 11 | 12 | public R() { 13 | put("code", 0); 14 | } 15 | 16 | public static R error() { 17 | return error(500, "未知异常,请联系管理员"); 18 | } 19 | 20 | public static R error(String msg) { 21 | return error(500, msg); 22 | } 23 | 24 | public static R error(int code, String msg) { 25 | R r = new R(); 26 | r.put("code", code); 27 | r.put("msg", msg); 28 | return r; 29 | } 30 | 31 | public static R ok(String msg) { 32 | R r = new R(); 33 | r.put("msg", msg); 34 | return r; 35 | } 36 | 37 | public static R ok(Map map) { 38 | R r = new R(); 39 | r.putAll(map); 40 | return r; 41 | } 42 | 43 | public static R ok() { 44 | return new R(); 45 | } 46 | 47 | public R put(String key, Object value) { 48 | super.put(key, value); 49 | return this; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/ConfigServiceImpl.java: -------------------------------------------------------------------------------- 1 | 2 | package com.service.impl; 3 | 4 | 5 | import java.util.Map; 6 | 7 | import org.springframework.stereotype.Service; 8 | 9 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 10 | import com.baomidou.mybatisplus.plugins.Page; 11 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 12 | import com.dao.ConfigDao; 13 | import com.entity.ConfigEntity; 14 | import com.service.ConfigService; 15 | import com.utils.PageUtils; 16 | import com.utils.Query; 17 | 18 | 19 | /** 20 | * 系统用户 21 | * @author yangliyuan 22 | * @date 2019年10月10日 上午9:17:59 23 | */ 24 | @Service("configService") 25 | public class ConfigServiceImpl extends ServiceImpl implements ConfigService { 26 | @Override 27 | public PageUtils queryPage(Map params) { 28 | Page page = this.selectPage( 29 | new Query(params).getPage(), 30 | new EntityWrapper() 31 | ); 32 | return new PageUtils(page); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/entity/ConfigEntity.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableId; 6 | import com.baomidou.mybatisplus.annotations.TableName; 7 | import com.baomidou.mybatisplus.enums.IdType; 8 | 9 | /** 10 | * @author yangliyuan 11 | * @version 创建时间:2020年2月7日 下午8:36:05 12 | * 类说明 : 13 | */ 14 | @TableName("config") 15 | public class ConfigEntity implements Serializable{ 16 | private static final long serialVersionUID = 1L; 17 | 18 | @TableId(type = IdType.AUTO) 19 | private Long id; 20 | 21 | /** 22 | * key 23 | */ 24 | private String name; 25 | 26 | /** 27 | * value 28 | */ 29 | private String value; 30 | 31 | public Long getId() { 32 | return id; 33 | } 34 | 35 | public void setId(Long id) { 36 | this.id = id; 37 | } 38 | 39 | public String getName() { 40 | return name; 41 | } 42 | 43 | public void setName(String name) { 44 | this.name = name; 45 | } 46 | 47 | public String getValue() { 48 | return value; 49 | } 50 | 51 | public void setValue(String value) { 52 | this.value = value; 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/com/utils/SQLFilter.java: -------------------------------------------------------------------------------- 1 | 2 | package com.utils; 3 | 4 | import org.apache.commons.lang3.StringUtils; 5 | 6 | import com.entity.EIException; 7 | 8 | /** 9 | * SQL过滤 10 | */ 11 | public class SQLFilter { 12 | 13 | /** 14 | * SQL注入过滤 15 | * @param str 待验证的字符串 16 | */ 17 | public static String sqlInject(String str){ 18 | if(StringUtils.isBlank(str)){ 19 | return null; 20 | } 21 | //去掉'|"|;|\字符 22 | str = StringUtils.replace(str, "'", ""); 23 | str = StringUtils.replace(str, "\"", ""); 24 | str = StringUtils.replace(str, ";", ""); 25 | str = StringUtils.replace(str, "\\", ""); 26 | 27 | //转换成小写 28 | str = str.toLowerCase(); 29 | 30 | //非法字符 31 | String[] keywords = {"master", "truncate", "insert", "select", "delete", "update", "declare", "alter", "drop"}; 32 | 33 | //判断是否包含非法字符 34 | for(String keyword : keywords){ 35 | if(str.indexOf(keyword) != -1){ 36 | throw new EIException("包含非法字符"); 37 | } 38 | } 39 | 40 | return str; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/utils/HttpClientUtils.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | import java.io.BufferedReader; 4 | import java.io.InputStreamReader; 5 | import java.net.HttpURLConnection; 6 | import java.net.URL; 7 | 8 | 9 | /** 10 | * HttpClient工具类 11 | */ 12 | public class HttpClientUtils { 13 | 14 | /** 15 | * @param uri 16 | * @return String 17 | * @description get请求方式 18 | * @author: long.he01 19 | */ 20 | public static String doGet(String uri) { 21 | 22 | StringBuilder result = new StringBuilder(); 23 | try { 24 | String res = ""; 25 | URL url = new URL(uri); 26 | HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 27 | BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8")); 28 | String line; 29 | while ((line = in.readLine()) != null) { 30 | res += line+"\n"; 31 | } 32 | in.close(); 33 | return res; 34 | }catch (Exception e) { 35 | e.printStackTrace(); 36 | return null; 37 | } 38 | 39 | } 40 | 41 | } 42 | 43 | -------------------------------------------------------------------------------- /src/main/java/com/utils/ValidatorUtils.java: -------------------------------------------------------------------------------- 1 | 2 | package com.utils; 3 | 4 | 5 | import java.util.Set; 6 | 7 | import javax.validation.ConstraintViolation; 8 | import javax.validation.Validation; 9 | import javax.validation.Validator; 10 | 11 | import com.entity.EIException; 12 | 13 | /** 14 | * hibernate-validator校验工具类 15 | */ 16 | public class ValidatorUtils { 17 | private static Validator validator; 18 | 19 | static { 20 | validator = Validation.buildDefaultValidatorFactory().getValidator(); 21 | } 22 | 23 | /** 24 | * 校验对象 25 | * @param object 待校验对象 26 | * @param groups 待校验的组 27 | * @throws EIException 校验不通过,则报EIException异常 28 | */ 29 | public static void validateEntity(Object object, Class... groups) 30 | throws EIException { 31 | Set> constraintViolations = validator.validate(object, groups); 32 | if (!constraintViolations.isEmpty()) { 33 | ConstraintViolation constraint = (ConstraintViolation)constraintViolations.iterator().next(); 34 | throw new EIException(constraint.getMessage()); 35 | } 36 | } 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/dao/CommonDao.java: -------------------------------------------------------------------------------- 1 | 2 | package com.dao; 3 | 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | /** 8 | * 通用接口 9 | */ 10 | public interface CommonDao{ 11 | List> pieSum(Map params); 12 | List> pieCount(Map params); 13 | List> barSumOne(Map params); 14 | List> barCountOne(Map params); 15 | List> barSumTwo(Map params); 16 | List> barCountTwo(Map params); 17 | Map queryScore(Map params); 18 | /** 19 | * 新的级联字典表的 分组求和方法 20 | * @param params 21 | * @return 22 | */ 23 | List> newSelectGroupSum(Map params); 24 | /** 25 | * 新的级联字典表的 分组条数统计统计方法方法 26 | * @param params 27 | * @return 28 | */ 29 | List> newSelectGroupCount(Map params); 30 | /** 31 | * 柱状图求和 32 | * @param params 33 | * @return 34 | */ 35 | List> barSum(Map params); 36 | 37 | /** 38 | * 柱状图统计 39 | * @param params 40 | * @return 41 | */ 42 | List> barCount(Map params); 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/utils/SpringContextUtils.java: -------------------------------------------------------------------------------- 1 | 2 | package com.utils; 3 | 4 | import org.springframework.beans.BeansException; 5 | import org.springframework.context.ApplicationContext; 6 | import org.springframework.context.ApplicationContextAware; 7 | import org.springframework.stereotype.Component; 8 | 9 | 10 | /** 11 | * Spring Context 工具类 12 | */ 13 | @Component 14 | public class SpringContextUtils implements ApplicationContextAware { 15 | public static ApplicationContext applicationContext; 16 | 17 | @Override 18 | public void setApplicationContext(ApplicationContext applicationContext) 19 | throws BeansException { 20 | SpringContextUtils.applicationContext = applicationContext; 21 | } 22 | 23 | public static Object getBean(String name) { 24 | return applicationContext.getBean(name); 25 | } 26 | 27 | public static T getBean(String name, Class requiredType) { 28 | return applicationContext.getBean(name, requiredType); 29 | } 30 | 31 | public static boolean containsBean(String name) { 32 | return applicationContext.containsBean(name); 33 | } 34 | 35 | public static boolean isSingleton(String name) { 36 | return applicationContext.isSingleton(name); 37 | } 38 | 39 | public static Class getType(String name) { 40 | return applicationContext.getType(name); 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /src/main/java/com/entity/view/DictionaryView.java: -------------------------------------------------------------------------------- 1 | package com.entity.view; 2 | 3 | import org.apache.tools.ant.util.DateUtils; 4 | import com.annotation.ColumnInfo; 5 | import com.entity.DictionaryEntity; 6 | import com.baomidou.mybatisplus.annotations.TableName; 7 | import org.apache.commons.beanutils.BeanUtils; 8 | import java.lang.reflect.InvocationTargetException; 9 | import org.springframework.format.annotation.DateTimeFormat; 10 | import com.fasterxml.jackson.annotation.JsonFormat; 11 | import java.io.Serializable; 12 | import java.util.Date; 13 | import com.utils.DateUtil; 14 | 15 | /** 16 | * 字典 17 | * 后端返回视图实体辅助类 18 | * (通常后端关联的表或者自定义的字段需要返回使用) 19 | */ 20 | @TableName("dictionary") 21 | public class DictionaryView extends DictionaryEntity implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | //当前表 25 | 26 | 27 | 28 | 29 | public DictionaryView() { 30 | 31 | } 32 | 33 | public DictionaryView(DictionaryEntity dictionaryEntity) { 34 | try { 35 | BeanUtils.copyProperties(this, dictionaryEntity); 36 | } catch (IllegalAccessException | InvocationTargetException e) { 37 | // TODO Auto-generated catch block 38 | e.printStackTrace(); 39 | } 40 | } 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | @Override 49 | public String toString() { 50 | return "DictionaryView{" + 51 | "} " + super.toString(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/service/CommonService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | public interface CommonService { 7 | List> pieSum(Map params); 8 | List> pieCount(Map params); 9 | List> barSumOne(Map params); 10 | List> barCountOne(Map params); 11 | List> barSumTwo(Map params); 12 | List> barCountTwo(Map params); 13 | 14 | /** 15 | tableName 查询表 16 | condition1 条件1 17 | condition1Value 条件1值 18 | average 计算平均评分 19 | * */ 20 | Map queryScore(Map params); 21 | /** 22 | * 新的级联字典表的 分组求和统计 23 | * @param params 24 | * @return 25 | */ 26 | List> newSelectGroupSum(Map params); 27 | /** 28 | * 新的级联字典表的 分组求和统计 29 | * @param params 30 | * @return 31 | */ 32 | List> newSelectGroupCount(Map params); 33 | /** 34 | * 柱状图求和 35 | * @param params 36 | * @return 37 | */ 38 | List> barSum(Map params); 39 | /** 40 | * 柱状图统计 41 | * @param params 42 | * @return 43 | */ 44 | List> barCount(Map params); 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/SijiServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import com.utils.StringUtil; 4 | import com.service.DictionaryService; 5 | import com.utils.ClazzDiff; 6 | import org.springframework.beans.BeanUtils; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | import java.lang.reflect.Field; 10 | import java.util.*; 11 | import com.baomidou.mybatisplus.plugins.Page; 12 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 13 | import org.springframework.transaction.annotation.Transactional; 14 | import com.utils.PageUtils; 15 | import com.utils.Query; 16 | import org.springframework.web.context.ContextLoader; 17 | import javax.servlet.ServletContext; 18 | import javax.servlet.http.HttpServletRequest; 19 | import org.springframework.lang.Nullable; 20 | import org.springframework.util.Assert; 21 | import com.dao.SijiDao; 22 | import com.entity.SijiEntity; 23 | import com.service.SijiService; 24 | import com.entity.view.SijiView; 25 | 26 | /** 27 | * 司机 服务实现类 28 | */ 29 | @Service("sijiService") 30 | @Transactional 31 | public class SijiServiceImpl extends ServiceImpl implements SijiService { 32 | 33 | @Override 34 | public PageUtils queryPage(Map params) { 35 | Page page =new Query(params).getPage(); 36 | page.setRecords(baseMapper.selectListView(page,params)); 37 | return new PageUtils(page); 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/ChatServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import com.utils.StringUtil; 4 | import com.service.DictionaryService; 5 | import com.utils.ClazzDiff; 6 | import org.springframework.beans.BeanUtils; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | import java.lang.reflect.Field; 10 | import java.util.*; 11 | import com.baomidou.mybatisplus.plugins.Page; 12 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 13 | import org.springframework.transaction.annotation.Transactional; 14 | import com.utils.PageUtils; 15 | import com.utils.Query; 16 | import org.springframework.web.context.ContextLoader; 17 | import javax.servlet.ServletContext; 18 | import javax.servlet.http.HttpServletRequest; 19 | import org.springframework.lang.Nullable; 20 | import org.springframework.util.Assert; 21 | import com.dao.ChatDao; 22 | import com.entity.ChatEntity; 23 | import com.service.ChatService; 24 | import com.entity.view.ChatView; 25 | 26 | /** 27 | * 反馈信息 服务实现类 28 | */ 29 | @Service("chatService") 30 | @Transactional 31 | public class ChatServiceImpl extends ServiceImpl implements ChatService { 32 | 33 | @Override 34 | public PageUtils queryPage(Map params) { 35 | Page page =new Query(params).getPage(); 36 | page.setRecords(baseMapper.selectListView(page,params)); 37 | return new PageUtils(page); 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/HuowuServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import com.utils.StringUtil; 4 | import com.service.DictionaryService; 5 | import com.utils.ClazzDiff; 6 | import org.springframework.beans.BeanUtils; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | import java.lang.reflect.Field; 10 | import java.util.*; 11 | import com.baomidou.mybatisplus.plugins.Page; 12 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 13 | import org.springframework.transaction.annotation.Transactional; 14 | import com.utils.PageUtils; 15 | import com.utils.Query; 16 | import org.springframework.web.context.ContextLoader; 17 | import javax.servlet.ServletContext; 18 | import javax.servlet.http.HttpServletRequest; 19 | import org.springframework.lang.Nullable; 20 | import org.springframework.util.Assert; 21 | import com.dao.HuowuDao; 22 | import com.entity.HuowuEntity; 23 | import com.service.HuowuService; 24 | import com.entity.view.HuowuView; 25 | 26 | /** 27 | * 货物 服务实现类 28 | */ 29 | @Service("huowuService") 30 | @Transactional 31 | public class HuowuServiceImpl extends ServiceImpl implements HuowuService { 32 | 33 | @Override 34 | public PageUtils queryPage(Map params) { 35 | Page page =new Query(params).getPage(); 36 | page.setRecords(baseMapper.selectListView(page,params)); 37 | return new PageUtils(page); 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/CangkuServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import com.utils.StringUtil; 4 | import com.service.DictionaryService; 5 | import com.utils.ClazzDiff; 6 | import org.springframework.beans.BeanUtils; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | import java.lang.reflect.Field; 10 | import java.util.*; 11 | import com.baomidou.mybatisplus.plugins.Page; 12 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 13 | import org.springframework.transaction.annotation.Transactional; 14 | import com.utils.PageUtils; 15 | import com.utils.Query; 16 | import org.springframework.web.context.ContextLoader; 17 | import javax.servlet.ServletContext; 18 | import javax.servlet.http.HttpServletRequest; 19 | import org.springframework.lang.Nullable; 20 | import org.springframework.util.Assert; 21 | import com.dao.CangkuDao; 22 | import com.entity.CangkuEntity; 23 | import com.service.CangkuService; 24 | import com.entity.view.CangkuView; 25 | 26 | /** 27 | * 仓库 服务实现类 28 | */ 29 | @Service("cangkuService") 30 | @Transactional 31 | public class CangkuServiceImpl extends ServiceImpl implements CangkuService { 32 | 33 | @Override 34 | public PageUtils queryPage(Map params) { 35 | Page page =new Query(params).getPage(); 36 | page.setRecords(baseMapper.selectListView(page,params)); 37 | return new PageUtils(page); 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/YonghuServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import com.utils.StringUtil; 4 | import com.service.DictionaryService; 5 | import com.utils.ClazzDiff; 6 | import org.springframework.beans.BeanUtils; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | import java.lang.reflect.Field; 10 | import java.util.*; 11 | import com.baomidou.mybatisplus.plugins.Page; 12 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 13 | import org.springframework.transaction.annotation.Transactional; 14 | import com.utils.PageUtils; 15 | import com.utils.Query; 16 | import org.springframework.web.context.ContextLoader; 17 | import javax.servlet.ServletContext; 18 | import javax.servlet.http.HttpServletRequest; 19 | import org.springframework.lang.Nullable; 20 | import org.springframework.util.Assert; 21 | import com.dao.YonghuDao; 22 | import com.entity.YonghuEntity; 23 | import com.service.YonghuService; 24 | import com.entity.view.YonghuView; 25 | 26 | /** 27 | * 用户 服务实现类 28 | */ 29 | @Service("yonghuService") 30 | @Transactional 31 | public class YonghuServiceImpl extends ServiceImpl implements YonghuService { 32 | 33 | @Override 34 | public PageUtils queryPage(Map params) { 35 | Page page =new Query(params).getPage(); 36 | page.setRecords(baseMapper.selectListView(page,params)); 37 | return new PageUtils(page); 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/entity/UsersEntity.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | import java.io.Serializable; 4 | import java.util.Date; 5 | 6 | import com.baomidou.mybatisplus.annotations.TableId; 7 | import com.baomidou.mybatisplus.annotations.TableName; 8 | import com.baomidou.mybatisplus.enums.IdType; 9 | 10 | /** 11 | * 用户 12 | */ 13 | @TableName("users") 14 | public class UsersEntity implements Serializable { 15 | private static final long serialVersionUID = 1L; 16 | 17 | @TableId(type = IdType.AUTO) 18 | private Integer id; 19 | 20 | /** 21 | * 用户账号 22 | */ 23 | private String username; 24 | 25 | /** 26 | * 密码 27 | */ 28 | private String password; 29 | 30 | /** 31 | * 用户类型 32 | */ 33 | private String role; 34 | 35 | private Date addtime; 36 | 37 | public String getUsername() { 38 | return username; 39 | } 40 | 41 | public void setUsername(String username) { 42 | this.username = username; 43 | } 44 | 45 | public String getPassword() { 46 | return password; 47 | } 48 | 49 | public void setPassword(String password) { 50 | this.password = password; 51 | } 52 | 53 | public String getRole() { 54 | return role; 55 | } 56 | 57 | public void setRole(String role) { 58 | this.role = role; 59 | } 60 | 61 | public Date getAddtime() { 62 | return addtime; 63 | } 64 | 65 | public void setAddtime(Date addtime) { 66 | this.addtime = addtime; 67 | } 68 | 69 | public Integer getId() { 70 | return id; 71 | } 72 | 73 | public void setId(Integer id) { 74 | this.id = id; 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/AddressServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import com.utils.StringUtil; 4 | import com.service.DictionaryService; 5 | import com.utils.ClazzDiff; 6 | import org.springframework.beans.BeanUtils; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | import java.lang.reflect.Field; 10 | import java.util.*; 11 | import com.baomidou.mybatisplus.plugins.Page; 12 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 13 | import org.springframework.transaction.annotation.Transactional; 14 | import com.utils.PageUtils; 15 | import com.utils.Query; 16 | import org.springframework.web.context.ContextLoader; 17 | import javax.servlet.ServletContext; 18 | import javax.servlet.http.HttpServletRequest; 19 | import org.springframework.lang.Nullable; 20 | import org.springframework.util.Assert; 21 | import com.dao.AddressDao; 22 | import com.entity.AddressEntity; 23 | import com.service.AddressService; 24 | import com.entity.view.AddressView; 25 | 26 | /** 27 | * 收货地址 服务实现类 28 | */ 29 | @Service("addressService") 30 | @Transactional 31 | public class AddressServiceImpl extends ServiceImpl implements AddressService { 32 | 33 | @Override 34 | public PageUtils queryPage(Map params) { 35 | Page page =new Query(params).getPage(); 36 | page.setRecords(baseMapper.selectListView(page,params)); 37 | return new PageUtils(page); 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/GonggaoServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import com.utils.StringUtil; 4 | import com.service.DictionaryService; 5 | import com.utils.ClazzDiff; 6 | import org.springframework.beans.BeanUtils; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | import java.lang.reflect.Field; 10 | import java.util.*; 11 | import com.baomidou.mybatisplus.plugins.Page; 12 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 13 | import org.springframework.transaction.annotation.Transactional; 14 | import com.utils.PageUtils; 15 | import com.utils.Query; 16 | import org.springframework.web.context.ContextLoader; 17 | import javax.servlet.ServletContext; 18 | import javax.servlet.http.HttpServletRequest; 19 | import org.springframework.lang.Nullable; 20 | import org.springframework.util.Assert; 21 | import com.dao.GonggaoDao; 22 | import com.entity.GonggaoEntity; 23 | import com.service.GonggaoService; 24 | import com.entity.view.GonggaoView; 25 | 26 | /** 27 | * 公告 服务实现类 28 | */ 29 | @Service("gonggaoService") 30 | @Transactional 31 | public class GonggaoServiceImpl extends ServiceImpl implements GonggaoService { 32 | 33 | @Override 34 | public PageUtils queryPage(Map params) { 35 | Page page =new Query(params).getPage(); 36 | page.setRecords(baseMapper.selectListView(page,params)); 37 | return new PageUtils(page); 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/CheliangServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import com.utils.StringUtil; 4 | import com.service.DictionaryService; 5 | import com.utils.ClazzDiff; 6 | import org.springframework.beans.BeanUtils; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | import java.lang.reflect.Field; 10 | import java.util.*; 11 | import com.baomidou.mybatisplus.plugins.Page; 12 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 13 | import org.springframework.transaction.annotation.Transactional; 14 | import com.utils.PageUtils; 15 | import com.utils.Query; 16 | import org.springframework.web.context.ContextLoader; 17 | import javax.servlet.ServletContext; 18 | import javax.servlet.http.HttpServletRequest; 19 | import org.springframework.lang.Nullable; 20 | import org.springframework.util.Assert; 21 | import com.dao.CheliangDao; 22 | import com.entity.CheliangEntity; 23 | import com.service.CheliangService; 24 | import com.entity.view.CheliangView; 25 | 26 | /** 27 | * 车辆 服务实现类 28 | */ 29 | @Service("cheliangService") 30 | @Transactional 31 | public class CheliangServiceImpl extends ServiceImpl implements CheliangService { 32 | 33 | @Override 34 | public PageUtils queryPage(Map params) { 35 | Page page =new Query(params).getPage(); 36 | page.setRecords(baseMapper.selectListView(page,params)); 37 | return new PageUtils(page); 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/ShangpinServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import com.utils.StringUtil; 4 | import com.service.DictionaryService; 5 | import com.utils.ClazzDiff; 6 | import org.springframework.beans.BeanUtils; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | import java.lang.reflect.Field; 10 | import java.util.*; 11 | import com.baomidou.mybatisplus.plugins.Page; 12 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 13 | import org.springframework.transaction.annotation.Transactional; 14 | import com.utils.PageUtils; 15 | import com.utils.Query; 16 | import org.springframework.web.context.ContextLoader; 17 | import javax.servlet.ServletContext; 18 | import javax.servlet.http.HttpServletRequest; 19 | import org.springframework.lang.Nullable; 20 | import org.springframework.util.Assert; 21 | import com.dao.ShangpinDao; 22 | import com.entity.ShangpinEntity; 23 | import com.service.ShangpinService; 24 | import com.entity.view.ShangpinView; 25 | 26 | /** 27 | * 商品 服务实现类 28 | */ 29 | @Service("shangpinService") 30 | @Transactional 31 | public class ShangpinServiceImpl extends ServiceImpl implements ShangpinService { 32 | 33 | @Override 34 | public PageUtils queryPage(Map params) { 35 | Page page =new Query(params).getPage(); 36 | page.setRecords(baseMapper.selectListView(page,params)); 37 | return new PageUtils(page); 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/YuangongServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import com.utils.StringUtil; 4 | import com.service.DictionaryService; 5 | import com.utils.ClazzDiff; 6 | import org.springframework.beans.BeanUtils; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | import java.lang.reflect.Field; 10 | import java.util.*; 11 | import com.baomidou.mybatisplus.plugins.Page; 12 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 13 | import org.springframework.transaction.annotation.Transactional; 14 | import com.utils.PageUtils; 15 | import com.utils.Query; 16 | import org.springframework.web.context.ContextLoader; 17 | import javax.servlet.ServletContext; 18 | import javax.servlet.http.HttpServletRequest; 19 | import org.springframework.lang.Nullable; 20 | import org.springframework.util.Assert; 21 | import com.dao.YuangongDao; 22 | import com.entity.YuangongEntity; 23 | import com.service.YuangongService; 24 | import com.entity.view.YuangongView; 25 | 26 | /** 27 | * 员工 服务实现类 28 | */ 29 | @Service("yuangongService") 30 | @Transactional 31 | public class YuangongServiceImpl extends ServiceImpl implements YuangongService { 32 | 33 | @Override 34 | public PageUtils queryPage(Map params) { 35 | Page page =new Query(params).getPage(); 36 | page.setRecords(baseMapper.selectListView(page,params)); 37 | return new PageUtils(page); 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/UsersServiceImpl.java: -------------------------------------------------------------------------------- 1 | 2 | package com.service.impl; 3 | 4 | 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | import com.service.UsersService; 9 | import org.springframework.stereotype.Service; 10 | 11 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 12 | import com.baomidou.mybatisplus.mapper.Wrapper; 13 | import com.baomidou.mybatisplus.plugins.Page; 14 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 15 | import com.dao.UsersDao; 16 | import com.entity.UsersEntity; 17 | import com.utils.PageUtils; 18 | import com.utils.Query; 19 | 20 | 21 | /** 22 | * 系统用户 23 | * @author 24 | */ 25 | @Service("userService") 26 | public class UsersServiceImpl extends ServiceImpl implements UsersService { 27 | 28 | @Override 29 | public PageUtils queryPage(Map params) { 30 | Page page = this.selectPage( 31 | new Query(params).getPage(), 32 | new EntityWrapper() 33 | ); 34 | return new PageUtils(page); 35 | } 36 | 37 | @Override 38 | public List selectListView(Wrapper wrapper) { 39 | return baseMapper.selectListView(wrapper); 40 | } 41 | 42 | @Override 43 | public PageUtils queryPage(Map params, 44 | Wrapper wrapper) { 45 | Page page =new Query(params).getPage(); 46 | page.setRecords(baseMapper.selectListView(page,wrapper)); 47 | PageUtils pageUtil = new PageUtils(page); 48 | return pageUtil; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/ShangpinOrderServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import com.utils.StringUtil; 4 | import com.service.DictionaryService; 5 | import com.utils.ClazzDiff; 6 | import org.springframework.beans.BeanUtils; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | import java.lang.reflect.Field; 10 | import java.util.*; 11 | import com.baomidou.mybatisplus.plugins.Page; 12 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 13 | import org.springframework.transaction.annotation.Transactional; 14 | import com.utils.PageUtils; 15 | import com.utils.Query; 16 | import org.springframework.web.context.ContextLoader; 17 | import javax.servlet.ServletContext; 18 | import javax.servlet.http.HttpServletRequest; 19 | import org.springframework.lang.Nullable; 20 | import org.springframework.util.Assert; 21 | import com.dao.ShangpinOrderDao; 22 | import com.entity.ShangpinOrderEntity; 23 | import com.service.ShangpinOrderService; 24 | import com.entity.view.ShangpinOrderView; 25 | 26 | /** 27 | * 商品订单 服务实现类 28 | */ 29 | @Service("shangpinOrderService") 30 | @Transactional 31 | public class ShangpinOrderServiceImpl extends ServiceImpl implements ShangpinOrderService { 32 | 33 | @Override 34 | public PageUtils queryPage(Map params) { 35 | Page page =new Query(params).getPage(); 36 | page.setRecords(baseMapper.selectListView(page,params)); 37 | return new PageUtils(page); 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/config/InterceptorConfig.java: -------------------------------------------------------------------------------- 1 | package com.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 6 | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; 7 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; 8 | 9 | import com.interceptor.AuthorizationInterceptor; 10 | 11 | @Configuration 12 | public class InterceptorConfig extends WebMvcConfigurationSupport{ 13 | 14 | @Bean 15 | public AuthorizationInterceptor getAuthorizationInterceptor() { 16 | return new AuthorizationInterceptor(); 17 | } 18 | 19 | @Override 20 | public void addInterceptors(InterceptorRegistry registry) { 21 | registry.addInterceptor(getAuthorizationInterceptor()).addPathPatterns("/**").excludePathPatterns("/static/**"); 22 | super.addInterceptors(registry); 23 | } 24 | 25 | /** 26 | * springboot 2.0配置WebMvcConfigurationSupport之后,会导致默认配置被覆盖,要访问静态资源需要重写addResourceHandlers方法 27 | */ 28 | @Override 29 | public void addResourceHandlers(ResourceHandlerRegistry registry) { 30 | registry.addResourceHandler("/**") 31 | .addResourceLocations("classpath:/resources/") 32 | .addResourceLocations("classpath:/static/") 33 | .addResourceLocations("classpath:/admin/") 34 | .addResourceLocations("classpath:/img/") 35 | .addResourceLocations("classpath:/front/") 36 | .addResourceLocations("classpath:/public/"); 37 | super.addResourceHandlers(registry); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/ShangpinChuruInoutServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import com.utils.StringUtil; 4 | import com.service.DictionaryService; 5 | import com.utils.ClazzDiff; 6 | import org.springframework.beans.BeanUtils; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | import java.lang.reflect.Field; 10 | import java.util.*; 11 | import com.baomidou.mybatisplus.plugins.Page; 12 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 13 | import org.springframework.transaction.annotation.Transactional; 14 | import com.utils.PageUtils; 15 | import com.utils.Query; 16 | import org.springframework.web.context.ContextLoader; 17 | import javax.servlet.ServletContext; 18 | import javax.servlet.http.HttpServletRequest; 19 | import org.springframework.lang.Nullable; 20 | import org.springframework.util.Assert; 21 | import com.dao.ShangpinChuruInoutDao; 22 | import com.entity.ShangpinChuruInoutEntity; 23 | import com.service.ShangpinChuruInoutService; 24 | import com.entity.view.ShangpinChuruInoutView; 25 | 26 | /** 27 | * 出入库 服务实现类 28 | */ 29 | @Service("shangpinChuruInoutService") 30 | @Transactional 31 | public class ShangpinChuruInoutServiceImpl extends ServiceImpl implements ShangpinChuruInoutService { 32 | 33 | @Override 34 | public PageUtils queryPage(Map params) { 35 | Page page =new Query(params).getPage(); 36 | page.setRecords(baseMapper.selectListView(page,params)); 37 | return new PageUtils(page); 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/ShangpinCollectionServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import com.utils.StringUtil; 4 | import com.service.DictionaryService; 5 | import com.utils.ClazzDiff; 6 | import org.springframework.beans.BeanUtils; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | import java.lang.reflect.Field; 10 | import java.util.*; 11 | import com.baomidou.mybatisplus.plugins.Page; 12 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 13 | import org.springframework.transaction.annotation.Transactional; 14 | import com.utils.PageUtils; 15 | import com.utils.Query; 16 | import org.springframework.web.context.ContextLoader; 17 | import javax.servlet.ServletContext; 18 | import javax.servlet.http.HttpServletRequest; 19 | import org.springframework.lang.Nullable; 20 | import org.springframework.util.Assert; 21 | import com.dao.ShangpinCollectionDao; 22 | import com.entity.ShangpinCollectionEntity; 23 | import com.service.ShangpinCollectionService; 24 | import com.entity.view.ShangpinCollectionView; 25 | 26 | /** 27 | * 商品收藏 服务实现类 28 | */ 29 | @Service("shangpinCollectionService") 30 | @Transactional 31 | public class ShangpinCollectionServiceImpl extends ServiceImpl implements ShangpinCollectionService { 32 | 33 | @Override 34 | public PageUtils queryPage(Map params) { 35 | Page page =new Query(params).getPage(); 36 | page.setRecords(baseMapper.selectListView(page,params)); 37 | return new PageUtils(page); 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | # Tomcat 2 | server: 3 | tomcat: 4 | uri-encoding: UTF-8 5 | port: 8080 6 | servlet: 7 | context-path: /wuliuguanlixitong 8 | 9 | spring: 10 | datasource: 11 | driverClassName: com.mysql.cj.jdbc.Driver 12 | url: jdbc:mysql://127.0.0.1:3306/wuliuguanlixitong?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&useSSL=false 13 | username: root 14 | password: 123456 15 | 16 | 17 | servlet: 18 | multipart: 19 | max-file-size: 1000MB 20 | max-request-size: 1000MB 21 | resources: 22 | static-locations: classpath:static/,file:static/ 23 | 24 | #mybatis 25 | mybatis-plus: 26 | mapper-locations: classpath*:mapper/*.xml 27 | #实体扫描,多个package用逗号或者分号分隔 28 | typeAliasesPackage: com.entity 29 | global-config: 30 | #主键类型 0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID"; 31 | id-type: 1 32 | #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断" 33 | field-strategy: 2 34 | #驼峰下划线转换 35 | db-column-underline: true 36 | #刷新mapper 调试神器 37 | refresh-mapper: true 38 | #逻辑删除配置 39 | logic-delete-value: -1 40 | logic-not-delete-value: 0 41 | #自定义SQL注入器 42 | sql-injector: com.baomidou.mybatisplus.mapper.LogicSqlInjector 43 | configuration: 44 | map-underscore-to-camel-case: true 45 | cache-enabled: false 46 | call-setters-on-nulls: true 47 | #springboot 项目mybatis plus 设置 jdbcTypeForNull (oracle数据库需配置JdbcType.NULL, 默认是Other) 48 | jdbc-type-for-null: 'null' 49 | 50 | #打印sql语句 51 | logging: 52 | level: 53 | com.dao: debug -------------------------------------------------------------------------------- /src/main/java/com/entity/view/SijiView.java: -------------------------------------------------------------------------------- 1 | package com.entity.view; 2 | 3 | import org.apache.tools.ant.util.DateUtils; 4 | import com.annotation.ColumnInfo; 5 | import com.entity.SijiEntity; 6 | import com.baomidou.mybatisplus.annotations.TableName; 7 | import org.apache.commons.beanutils.BeanUtils; 8 | import java.lang.reflect.InvocationTargetException; 9 | import org.springframework.format.annotation.DateTimeFormat; 10 | import com.fasterxml.jackson.annotation.JsonFormat; 11 | import java.io.Serializable; 12 | import java.util.Date; 13 | import com.utils.DateUtil; 14 | 15 | /** 16 | * 司机 17 | * 后端返回视图实体辅助类 18 | * (通常后端关联的表或者自定义的字段需要返回使用) 19 | */ 20 | @TableName("siji") 21 | public class SijiView extends SijiEntity implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | //当前表 25 | /** 26 | * 性别的值 27 | */ 28 | @ColumnInfo(comment="性别的字典表值",type="varchar(200)") 29 | private String sexValue; 30 | 31 | 32 | 33 | 34 | public SijiView() { 35 | 36 | } 37 | 38 | public SijiView(SijiEntity sijiEntity) { 39 | try { 40 | BeanUtils.copyProperties(this, sijiEntity); 41 | } catch (IllegalAccessException | InvocationTargetException e) { 42 | // TODO Auto-generated catch block 43 | e.printStackTrace(); 44 | } 45 | } 46 | 47 | 48 | 49 | //当前表的 50 | /** 51 | * 获取: 性别的值 52 | */ 53 | public String getSexValue() { 54 | return sexValue; 55 | } 56 | /** 57 | * 设置: 性别的值 58 | */ 59 | public void setSexValue(String sexValue) { 60 | this.sexValue = sexValue; 61 | } 62 | 63 | 64 | 65 | 66 | @Override 67 | public String toString() { 68 | return "SijiView{" + 69 | ", sexValue=" + sexValue + 70 | "} " + super.toString(); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/com/entity/view/YonghuView.java: -------------------------------------------------------------------------------- 1 | package com.entity.view; 2 | 3 | import org.apache.tools.ant.util.DateUtils; 4 | import com.annotation.ColumnInfo; 5 | import com.entity.YonghuEntity; 6 | import com.baomidou.mybatisplus.annotations.TableName; 7 | import org.apache.commons.beanutils.BeanUtils; 8 | import java.lang.reflect.InvocationTargetException; 9 | import org.springframework.format.annotation.DateTimeFormat; 10 | import com.fasterxml.jackson.annotation.JsonFormat; 11 | import java.io.Serializable; 12 | import java.util.Date; 13 | import com.utils.DateUtil; 14 | 15 | /** 16 | * 用户 17 | * 后端返回视图实体辅助类 18 | * (通常后端关联的表或者自定义的字段需要返回使用) 19 | */ 20 | @TableName("yonghu") 21 | public class YonghuView extends YonghuEntity implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | //当前表 25 | /** 26 | * 性别的值 27 | */ 28 | @ColumnInfo(comment="性别的字典表值",type="varchar(200)") 29 | private String sexValue; 30 | 31 | 32 | 33 | 34 | public YonghuView() { 35 | 36 | } 37 | 38 | public YonghuView(YonghuEntity yonghuEntity) { 39 | try { 40 | BeanUtils.copyProperties(this, yonghuEntity); 41 | } catch (IllegalAccessException | InvocationTargetException e) { 42 | // TODO Auto-generated catch block 43 | e.printStackTrace(); 44 | } 45 | } 46 | 47 | 48 | 49 | //当前表的 50 | /** 51 | * 获取: 性别的值 52 | */ 53 | public String getSexValue() { 54 | return sexValue; 55 | } 56 | /** 57 | * 设置: 性别的值 58 | */ 59 | public void setSexValue(String sexValue) { 60 | this.sexValue = sexValue; 61 | } 62 | 63 | 64 | 65 | 66 | @Override 67 | public String toString() { 68 | return "YonghuView{" + 69 | ", sexValue=" + sexValue + 70 | "} " + super.toString(); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/ShangpinChuruInoutListServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import com.utils.StringUtil; 4 | import com.service.DictionaryService; 5 | import com.utils.ClazzDiff; 6 | import org.springframework.beans.BeanUtils; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | import java.lang.reflect.Field; 10 | import java.util.*; 11 | import com.baomidou.mybatisplus.plugins.Page; 12 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 13 | import org.springframework.transaction.annotation.Transactional; 14 | import com.utils.PageUtils; 15 | import com.utils.Query; 16 | import org.springframework.web.context.ContextLoader; 17 | import javax.servlet.ServletContext; 18 | import javax.servlet.http.HttpServletRequest; 19 | import org.springframework.lang.Nullable; 20 | import org.springframework.util.Assert; 21 | import com.dao.ShangpinChuruInoutListDao; 22 | import com.entity.ShangpinChuruInoutListEntity; 23 | import com.service.ShangpinChuruInoutListService; 24 | import com.entity.view.ShangpinChuruInoutListView; 25 | 26 | /** 27 | * 出入库详情 服务实现类 28 | */ 29 | @Service("shangpinChuruInoutListService") 30 | @Transactional 31 | public class ShangpinChuruInoutListServiceImpl extends ServiceImpl implements ShangpinChuruInoutListService { 32 | 33 | @Override 34 | public PageUtils queryPage(Map params) { 35 | Page page =new Query(params).getPage(); 36 | page.setRecords(baseMapper.selectListView(page,params)); 37 | return new PageUtils(page); 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/entity/view/YuangongView.java: -------------------------------------------------------------------------------- 1 | package com.entity.view; 2 | 3 | import org.apache.tools.ant.util.DateUtils; 4 | import com.annotation.ColumnInfo; 5 | import com.entity.YuangongEntity; 6 | import com.baomidou.mybatisplus.annotations.TableName; 7 | import org.apache.commons.beanutils.BeanUtils; 8 | import java.lang.reflect.InvocationTargetException; 9 | import org.springframework.format.annotation.DateTimeFormat; 10 | import com.fasterxml.jackson.annotation.JsonFormat; 11 | import java.io.Serializable; 12 | import java.util.Date; 13 | import com.utils.DateUtil; 14 | 15 | /** 16 | * 员工 17 | * 后端返回视图实体辅助类 18 | * (通常后端关联的表或者自定义的字段需要返回使用) 19 | */ 20 | @TableName("yuangong") 21 | public class YuangongView extends YuangongEntity implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | //当前表 25 | /** 26 | * 性别的值 27 | */ 28 | @ColumnInfo(comment="性别的字典表值",type="varchar(200)") 29 | private String sexValue; 30 | 31 | 32 | 33 | 34 | public YuangongView() { 35 | 36 | } 37 | 38 | public YuangongView(YuangongEntity yuangongEntity) { 39 | try { 40 | BeanUtils.copyProperties(this, yuangongEntity); 41 | } catch (IllegalAccessException | InvocationTargetException e) { 42 | // TODO Auto-generated catch block 43 | e.printStackTrace(); 44 | } 45 | } 46 | 47 | 48 | 49 | //当前表的 50 | /** 51 | * 获取: 性别的值 52 | */ 53 | public String getSexValue() { 54 | return sexValue; 55 | } 56 | /** 57 | * 设置: 性别的值 58 | */ 59 | public void setSexValue(String sexValue) { 60 | this.sexValue = sexValue; 61 | } 62 | 63 | 64 | 65 | 66 | @Override 67 | public String toString() { 68 | return "YuangongView{" + 69 | ", sexValue=" + sexValue + 70 | "} " + super.toString(); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/com/entity/view/CangkuView.java: -------------------------------------------------------------------------------- 1 | package com.entity.view; 2 | 3 | import org.apache.tools.ant.util.DateUtils; 4 | import com.annotation.ColumnInfo; 5 | import com.entity.CangkuEntity; 6 | import com.baomidou.mybatisplus.annotations.TableName; 7 | import org.apache.commons.beanutils.BeanUtils; 8 | import java.lang.reflect.InvocationTargetException; 9 | import org.springframework.format.annotation.DateTimeFormat; 10 | import com.fasterxml.jackson.annotation.JsonFormat; 11 | import java.io.Serializable; 12 | import java.util.Date; 13 | import com.utils.DateUtil; 14 | 15 | /** 16 | * 仓库 17 | * 后端返回视图实体辅助类 18 | * (通常后端关联的表或者自定义的字段需要返回使用) 19 | */ 20 | @TableName("cangku") 21 | public class CangkuView extends CangkuEntity implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | //当前表 25 | /** 26 | * 仓库类型的值 27 | */ 28 | @ColumnInfo(comment="仓库类型的字典表值",type="varchar(200)") 29 | private String cangkuValue; 30 | 31 | 32 | 33 | 34 | public CangkuView() { 35 | 36 | } 37 | 38 | public CangkuView(CangkuEntity cangkuEntity) { 39 | try { 40 | BeanUtils.copyProperties(this, cangkuEntity); 41 | } catch (IllegalAccessException | InvocationTargetException e) { 42 | // TODO Auto-generated catch block 43 | e.printStackTrace(); 44 | } 45 | } 46 | 47 | 48 | 49 | //当前表的 50 | /** 51 | * 获取: 仓库类型的值 52 | */ 53 | public String getCangkuValue() { 54 | return cangkuValue; 55 | } 56 | /** 57 | * 设置: 仓库类型的值 58 | */ 59 | public void setCangkuValue(String cangkuValue) { 60 | this.cangkuValue = cangkuValue; 61 | } 62 | 63 | 64 | 65 | 66 | @Override 67 | public String toString() { 68 | return "CangkuView{" + 69 | ", cangkuValue=" + cangkuValue + 70 | "} " + super.toString(); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/com/utils/CommonUtil.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | import java.util.*; 4 | 5 | /** 6 | * 公共方法 7 | */ 8 | public class CommonUtil { 9 | /** 10 | * 获取随机字符串 11 | * 12 | * @param num 13 | * @return 14 | */ 15 | public static String getRandomString(Integer num) { 16 | String base = "abcdefghijklmnopqrstuvwxyz0123456789"; 17 | Random random = new Random(); 18 | StringBuffer sb = new StringBuffer(); 19 | for (int i = 0; i < num; i++) { 20 | int number = random.nextInt(base.length()); 21 | sb.append(base.charAt(number)); 22 | } 23 | return sb.toString(); 24 | } 25 | 26 | 27 | /** 28 | * 检查map参数并添加缺失参数 29 | * @param params 30 | * @return 31 | */ 32 | public static void checkMap(Map params) { 33 | boolean page=true,limit=true,sort=true,order=true; 34 | Iterator> iter = params.entrySet().iterator(); 35 | while (iter.hasNext()) { 36 | Map.Entry info = iter.next(); 37 | Object key = info.getKey(); 38 | Object value = info.getValue(); 39 | if(value==null || "".equals(value) || "null".equals(value)){ 40 | iter.remove(); 41 | }else if("page".equals(key)){page=false; 42 | }else if("limit".equals(key)){limit=false; 43 | }else if("sort".equals(key)){sort=false; 44 | }else if("order".equals(key)){order=false; 45 | } 46 | } 47 | if(page){params.put("page","1");} 48 | if(limit){params.put("limit","10");} 49 | if(sort){params.put("sort","id");} 50 | if(order){params.put("order","desc");} 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/entity/view/GonggaoView.java: -------------------------------------------------------------------------------- 1 | package com.entity.view; 2 | 3 | import org.apache.tools.ant.util.DateUtils; 4 | import com.annotation.ColumnInfo; 5 | import com.entity.GonggaoEntity; 6 | import com.baomidou.mybatisplus.annotations.TableName; 7 | import org.apache.commons.beanutils.BeanUtils; 8 | import java.lang.reflect.InvocationTargetException; 9 | import org.springframework.format.annotation.DateTimeFormat; 10 | import com.fasterxml.jackson.annotation.JsonFormat; 11 | import java.io.Serializable; 12 | import java.util.Date; 13 | import com.utils.DateUtil; 14 | 15 | /** 16 | * 公告 17 | * 后端返回视图实体辅助类 18 | * (通常后端关联的表或者自定义的字段需要返回使用) 19 | */ 20 | @TableName("gonggao") 21 | public class GonggaoView extends GonggaoEntity implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | //当前表 25 | /** 26 | * 公告类型的值 27 | */ 28 | @ColumnInfo(comment="公告类型的字典表值",type="varchar(200)") 29 | private String gonggaoValue; 30 | 31 | 32 | 33 | 34 | public GonggaoView() { 35 | 36 | } 37 | 38 | public GonggaoView(GonggaoEntity gonggaoEntity) { 39 | try { 40 | BeanUtils.copyProperties(this, gonggaoEntity); 41 | } catch (IllegalAccessException | InvocationTargetException e) { 42 | // TODO Auto-generated catch block 43 | e.printStackTrace(); 44 | } 45 | } 46 | 47 | 48 | 49 | //当前表的 50 | /** 51 | * 获取: 公告类型的值 52 | */ 53 | public String getGonggaoValue() { 54 | return gonggaoValue; 55 | } 56 | /** 57 | * 设置: 公告类型的值 58 | */ 59 | public void setGonggaoValue(String gonggaoValue) { 60 | this.gonggaoValue = gonggaoValue; 61 | } 62 | 63 | 64 | 65 | 66 | @Override 67 | public String toString() { 68 | return "GonggaoView{" + 69 | ", gonggaoValue=" + gonggaoValue + 70 | "} " + super.toString(); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/com/entity/view/CheliangView.java: -------------------------------------------------------------------------------- 1 | package com.entity.view; 2 | 3 | import org.apache.tools.ant.util.DateUtils; 4 | import com.annotation.ColumnInfo; 5 | import com.entity.CheliangEntity; 6 | import com.baomidou.mybatisplus.annotations.TableName; 7 | import org.apache.commons.beanutils.BeanUtils; 8 | import java.lang.reflect.InvocationTargetException; 9 | import org.springframework.format.annotation.DateTimeFormat; 10 | import com.fasterxml.jackson.annotation.JsonFormat; 11 | import java.io.Serializable; 12 | import java.util.Date; 13 | import com.utils.DateUtil; 14 | 15 | /** 16 | * 车辆 17 | * 后端返回视图实体辅助类 18 | * (通常后端关联的表或者自定义的字段需要返回使用) 19 | */ 20 | @TableName("cheliang") 21 | public class CheliangView extends CheliangEntity implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | //当前表 25 | /** 26 | * 车辆类型的值 27 | */ 28 | @ColumnInfo(comment="车辆类型的字典表值",type="varchar(200)") 29 | private String cheliangValue; 30 | 31 | 32 | 33 | 34 | public CheliangView() { 35 | 36 | } 37 | 38 | public CheliangView(CheliangEntity cheliangEntity) { 39 | try { 40 | BeanUtils.copyProperties(this, cheliangEntity); 41 | } catch (IllegalAccessException | InvocationTargetException e) { 42 | // TODO Auto-generated catch block 43 | e.printStackTrace(); 44 | } 45 | } 46 | 47 | 48 | 49 | //当前表的 50 | /** 51 | * 获取: 车辆类型的值 52 | */ 53 | public String getCheliangValue() { 54 | return cheliangValue; 55 | } 56 | /** 57 | * 设置: 车辆类型的值 58 | */ 59 | public void setCheliangValue(String cheliangValue) { 60 | this.cheliangValue = cheliangValue; 61 | } 62 | 63 | 64 | 65 | 66 | @Override 67 | public String toString() { 68 | return "CheliangView{" + 69 | ", cheliangValue=" + cheliangValue + 70 | "} " + super.toString(); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/com/entity/view/ShangpinChuruInoutView.java: -------------------------------------------------------------------------------- 1 | package com.entity.view; 2 | 3 | import org.apache.tools.ant.util.DateUtils; 4 | import com.annotation.ColumnInfo; 5 | import com.entity.ShangpinChuruInoutEntity; 6 | import com.baomidou.mybatisplus.annotations.TableName; 7 | import org.apache.commons.beanutils.BeanUtils; 8 | import java.lang.reflect.InvocationTargetException; 9 | import org.springframework.format.annotation.DateTimeFormat; 10 | import com.fasterxml.jackson.annotation.JsonFormat; 11 | import java.io.Serializable; 12 | import java.util.Date; 13 | import com.utils.DateUtil; 14 | 15 | /** 16 | * 出入库 17 | * 后端返回视图实体辅助类 18 | * (通常后端关联的表或者自定义的字段需要返回使用) 19 | */ 20 | @TableName("shangpin_churu_inout") 21 | public class ShangpinChuruInoutView extends ShangpinChuruInoutEntity implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | //当前表 25 | /** 26 | * 出入库类型的值 27 | */ 28 | @ColumnInfo(comment="出入库类型的字典表值",type="varchar(200)") 29 | private String shangpinChuruInoutValue; 30 | 31 | 32 | 33 | 34 | public ShangpinChuruInoutView() { 35 | 36 | } 37 | 38 | public ShangpinChuruInoutView(ShangpinChuruInoutEntity shangpinChuruInoutEntity) { 39 | try { 40 | BeanUtils.copyProperties(this, shangpinChuruInoutEntity); 41 | } catch (IllegalAccessException | InvocationTargetException e) { 42 | // TODO Auto-generated catch block 43 | e.printStackTrace(); 44 | } 45 | } 46 | 47 | 48 | 49 | //当前表的 50 | /** 51 | * 获取: 出入库类型的值 52 | */ 53 | public String getShangpinChuruInoutValue() { 54 | return shangpinChuruInoutValue; 55 | } 56 | /** 57 | * 设置: 出入库类型的值 58 | */ 59 | public void setShangpinChuruInoutValue(String shangpinChuruInoutValue) { 60 | this.shangpinChuruInoutValue = shangpinChuruInoutValue; 61 | } 62 | 63 | 64 | 65 | 66 | @Override 67 | public String toString() { 68 | return "ShangpinChuruInoutView{" + 69 | ", shangpinChuruInoutValue=" + shangpinChuruInoutValue + 70 | "} " + super.toString(); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 基于Springboot的物流管理系统(程序+论文) 2 | = 3 | ### 完整代码获取地址:从戎源码网 ([https://armycodes.com/](https://armycodes.com/)) 4 | ### 作者微信:19941326836 QQ:952045282 5 | ### 承接计算机毕业设计、Java毕业设计、Python毕业设计、深度学习、机器学习 6 | ### 选题+开题报告+任务书+程序定制+安装调试+论文+答辩ppt 一条龙服务 7 | ### 所有选题地址https://github.com/nature924/allProject 8 | 9 | 一、项目介绍 10 | --- 11 | 基于Spring Boot框架实现的物流管理系统,系统包含三种角色:管理员、用户,员工主要功能如下。 12 | ### 【用户功能】 13 | 14 | 首页:浏览物流管理系统的主要信息。 15 | 仓库:查看仓库相关信息,包括存储货物的情况。 16 | 公告:阅读系统发布的相关通知和公告。 17 | 商品:浏览系统中的商品信息,包括详细描述和价格。 18 | 个人中心:管理个人信息,查看订单历史记录等。 19 | 客服:与系统提供的客服进行实时交流。 20 | 21 | ### 【管理员功能】 22 | 23 | 首页:查看物流管理系统整体概况和关键数据。 24 | 个人中心:修改密码、管理个人信息。 25 | 管理员管理:审核和管理注册管理员用户的信息。 26 | 员工管理:审核和管理注册员工用户的信息。 27 | 用户管理:审核和管理注册普通用户的信息。 28 | 司机管理:管理系统中的司机信息,添加、删除等。 29 | 车辆管理:管理系统中的车辆信息,添加、删除等。 30 | 仓库管理:管理系统中的仓库信息,添加、删除等。 31 | 出入库管理:监管和管理货物的出入库情况,记录和查询。 32 | 商品管理:监管和管理系统中的商品信息,上架、下架等。 33 | 货物管理:查看和管理货物的信息,种类和数量等。 34 | 公告管理:发布、编辑和删除系统的通知和公告。 35 | 反馈信息管理:查看和处理用户的反馈信息。 36 | 基础数据管理:管理系统的基础数据,库类型、车辆类型、公告类型、货物类型、商品类型、出入库类型等。 37 | 轮播图信息:管理系统首页的轮播图。 38 | 39 | ### 【员工功能】 40 | 41 | 首页:查看物流管理系统的主要信息和推荐内容。 42 | 个人中心:管理个人信息。 43 | 司机管理:查看和管理司机信息,包括行车记录等。 44 | 车辆管理:查看和管理车辆信息,包括维护记录等。 45 | 仓库管理:查看和管理仓库信息,包括库存情况等。 46 | 出入库管理:记录和处理货物的出入库情况,包括入库、出库等。 47 | 商品管理:查看和管理商品信息,包括上架、下架等。 48 | 货物管理:查看和管理货物的信息,包括种类和数量等。 49 | 公告管理:查看和阅读系统发布的通知和公告。 50 | 轮播图信息:查看和管理系统首页的轮播图。 51 | 52 | 53 | 54 | 55 | 56 | 二、项目技术 57 | --- 58 | - 编程语言:Java 59 | - 数据库:MySQL 60 | - 项目管理工具:Maven 61 | - 前端技术:VUE、HTML、Jquery、Bootstrap 62 | - 后端技术:Spring、SpringMVC、MyBatis 63 | 64 | 三、运行环境 65 | --- 66 | - 操作系统:Windows、macOS都可以 67 | - JDK版本:JDK1.8以上都可以 68 | - 开发工具:IDEA、Ecplise、Myecplise都可以 69 | - 数据库: MySQL5.7以上都可以 70 | - Tomcat:任意版本都可以 71 | - Maven:任意版本都可以 72 | 73 | 四、运行截图 74 | --- 75 | ### 论文截图: 76 | ![image/1.png](limage/1.png) 77 | ![image/1.png](limage/2.png) 78 | 79 | ### 程序截图: 80 | ![image/1.png](image/1.png) 81 | ![image/1.png](image/2.png) 82 | ![image/1.png](image/3.png) 83 | ![image/1.png](image/4.png) 84 | ![image/1.png](image/5.png) 85 | ![image/1.png](image/6.png) 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /src/main/java/com/utils/PageUtils.java: -------------------------------------------------------------------------------- 1 | 2 | package com.utils; 3 | 4 | import java.io.Serializable; 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | import com.baomidou.mybatisplus.plugins.Page; 9 | 10 | /** 11 | * 分页工具类 12 | */ 13 | public class PageUtils implements Serializable { 14 | private static final long serialVersionUID = 1L; 15 | //总记录数 16 | private long total; 17 | //每页记录数 18 | private int pageSize; 19 | //总页数 20 | private long totalPage; 21 | //当前页数 22 | private int currPage; 23 | //列表数据 24 | private List list; 25 | 26 | /** 27 | * 分页 28 | * @param list 列表数据 29 | * @param totalCount 总记录数 30 | * @param pageSize 每页记录数 31 | * @param currPage 当前页数 32 | */ 33 | public PageUtils(List list, int totalCount, int pageSize, int currPage) { 34 | this.list = list; 35 | this.total = totalCount; 36 | this.pageSize = pageSize; 37 | this.currPage = currPage; 38 | this.totalPage = (int)Math.ceil((double)totalCount/pageSize); 39 | } 40 | 41 | /** 42 | * 分页 43 | */ 44 | public PageUtils(Page page) { 45 | this.list = page.getRecords(); 46 | this.total = page.getTotal(); 47 | this.pageSize = page.getSize(); 48 | this.currPage = page.getCurrent(); 49 | this.totalPage = page.getPages(); 50 | } 51 | 52 | /* 53 | * 空数据的分页 54 | */ 55 | public PageUtils(Map params) { 56 | Page page =new Query(params).getPage(); 57 | new PageUtils(page); 58 | } 59 | 60 | 61 | public int getPageSize() { 62 | return pageSize; 63 | } 64 | 65 | public void setPageSize(int pageSize) { 66 | this.pageSize = pageSize; 67 | } 68 | 69 | public int getCurrPage() { 70 | return currPage; 71 | } 72 | 73 | public void setCurrPage(int currPage) { 74 | this.currPage = currPage; 75 | } 76 | 77 | public List getList() { 78 | return list; 79 | } 80 | 81 | public void setList(List list) { 82 | this.list = list; 83 | } 84 | 85 | public long getTotalPage() { 86 | return totalPage; 87 | } 88 | 89 | public void setTotalPage(long totalPage) { 90 | this.totalPage = totalPage; 91 | } 92 | 93 | public long getTotal() { 94 | return total; 95 | } 96 | 97 | public void setTotal(long total) { 98 | this.total = total; 99 | } 100 | 101 | } 102 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/CommonServiceImpl.java: -------------------------------------------------------------------------------- 1 | 2 | package com.service.impl; 3 | 4 | 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import com.dao.CommonDao; 12 | import com.service.CommonService; 13 | 14 | 15 | /** 16 | * 系统用户 17 | * @author 18 | * @date 19 | */ 20 | @Service("commonService") 21 | public class CommonServiceImpl implements CommonService { 22 | 23 | @Autowired 24 | private CommonDao commonDao; 25 | 26 | public List> pieSum(Map params){ 27 | return commonDao.pieSum(params); 28 | } 29 | public List> pieCount(Map params){ 30 | return commonDao.pieCount(params); 31 | } 32 | public List> barSumOne(Map params){ 33 | return commonDao.barSumOne(params); 34 | } 35 | public List> barCountOne(Map params){ 36 | return commonDao.barCountOne(params); 37 | } 38 | public List> barSumTwo(Map params){ 39 | return commonDao.barSumTwo(params); 40 | } 41 | public List> barCountTwo(Map params){ 42 | return commonDao.barCountTwo(params); 43 | } 44 | /** 45 | tableName 查询表 46 | condition1 条件1 47 | condition1Value 条件1值 48 | average 计算平均评分 49 | * */ 50 | public Map queryScore(Map params){ 51 | return commonDao.queryScore(params); 52 | } 53 | /** 54 | * 新的级联字典表的 分组求和统计 55 | * @param params 56 | * @return 57 | */ 58 | @Override 59 | public List> newSelectGroupSum(Map params) { 60 | return commonDao.newSelectGroupSum(params); 61 | } 62 | /** 63 | * 新的级联字典表的 分组条数统计 64 | * @param params 65 | * @return 66 | */ 67 | @Override 68 | public List> newSelectGroupCount(Map params) { 69 | return commonDao.newSelectGroupCount(params); 70 | } 71 | /** 72 | * 柱状图求和 73 | * @param params 74 | * @return 75 | */ 76 | public List> barSum(Map params){ 77 | return commonDao.barSum(params); 78 | } 79 | 80 | /** 81 | * 柱状图统计 82 | * @param params 83 | * @return 84 | */ 85 | public List> barCount(Map params){ 86 | return commonDao.barCount(params); 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /src/main/resources/mapper/GonggaoDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | a.id as id 8 | ,a.gonggao_name as gonggaoName 9 | ,a.gonggao_photo as gonggaoPhoto 10 | ,a.gonggao_types as gonggaoTypes 11 | ,a.insert_time as insertTime 12 | ,a.gonggao_content as gonggaoContent 13 | ,a.create_time as createTime 14 | 15 | 51 | 52 | -------------------------------------------------------------------------------- /src/main/resources/mapper/SijiDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | a.id as id 8 | ,a.siji_uuid_number as sijiUuidNumber 9 | ,a.siji_name as sijiName 10 | ,a.siji_phone as sijiPhone 11 | ,a.siji_id_number as sijiIdNumber 12 | ,a.siji_photo as sijiPhoto 13 | ,a.sex_types as sexTypes 14 | ,a.siji_email as sijiEmail 15 | ,a.create_time as createTime 16 | 17 | 53 | 54 | -------------------------------------------------------------------------------- /src/main/java/com/ServletContextListener/DictionaryServletContextListener.java: -------------------------------------------------------------------------------- 1 | package com.ServletContextListener; 2 | 3 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 4 | import com.entity.DictionaryEntity; 5 | import com.service.DictionaryService; 6 | import com.thread.MyThreadMethod; 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | import org.springframework.context.ApplicationContext; 10 | import org.springframework.web.context.support.WebApplicationContextUtils; 11 | 12 | import javax.servlet.ServletContextListener; 13 | import javax.servlet.ServletContextEvent; 14 | import javax.servlet.annotation.WebListener; 15 | import java.util.HashMap; 16 | import java.util.List; 17 | import java.util.Map; 18 | 19 | /** 20 | * 字典初始化监视器 用的是服务器监听,每次项目启动,都会调用这个类 21 | */ 22 | @WebListener 23 | public class DictionaryServletContextListener implements ServletContextListener { 24 | 25 | private static final Logger logger = LoggerFactory.getLogger(DictionaryServletContextListener.class); 26 | private MyThreadMethod myThreadMethod; 27 | @Override 28 | public void contextDestroyed(ServletContextEvent sce) { 29 | logger.info("----------服务器停止----------"); 30 | } 31 | 32 | @Override 33 | public void contextInitialized(ServletContextEvent sce) { 34 | ApplicationContext appContext = WebApplicationContextUtils.getWebApplicationContext(sce.getServletContext()); 35 | 36 | logger.info("----------字典表初始化开始----------"); 37 | DictionaryService dictionaryService = (DictionaryService)appContext.getBean("dictionaryService"); 38 | List dictionaryEntities = dictionaryService.selectList(new EntityWrapper()); 39 | Map> map = new HashMap<>(); 40 | for(DictionaryEntity d :dictionaryEntities){ 41 | Map m = map.get(d.getDicCode()); 42 | if(m ==null || m.isEmpty()){ 43 | m = new HashMap<>(); 44 | } 45 | m.put(d.getCodeIndex(),d.getIndexName()); 46 | map.put(d.getDicCode(),m); 47 | } 48 | sce.getServletContext().setAttribute("dictionaryMap", map); 49 | logger.info("----------字典表初始化完成----------"); 50 | 51 | 52 | 53 | logger.info("----------线程执行开始----------"); 54 | if (myThreadMethod == null) { 55 | myThreadMethod = new MyThreadMethod(); 56 | myThreadMethod.start(); // servlet 上下文初始化时启动线程myThreadMethod 57 | } 58 | logger.info("----------线程执行结束----------"); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/TokenServiceImpl.java: -------------------------------------------------------------------------------- 1 | 2 | package com.service.impl; 3 | 4 | 5 | import java.util.Calendar; 6 | import java.util.Date; 7 | import java.util.List; 8 | import java.util.Map; 9 | 10 | import org.springframework.stereotype.Service; 11 | 12 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 13 | import com.baomidou.mybatisplus.mapper.Wrapper; 14 | import com.baomidou.mybatisplus.plugins.Page; 15 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 16 | import com.dao.TokenDao; 17 | import com.entity.TokenEntity; 18 | import com.entity.TokenEntity; 19 | import com.service.TokenService; 20 | import com.utils.CommonUtil; 21 | import com.utils.PageUtils; 22 | import com.utils.Query; 23 | 24 | 25 | /** 26 | * token 27 | * @author 28 | */ 29 | @Service("tokenService") 30 | public class TokenServiceImpl extends ServiceImpl implements TokenService { 31 | 32 | @Override 33 | public PageUtils queryPage(Map params) { 34 | Page page = this.selectPage( 35 | new Query(params).getPage(), 36 | new EntityWrapper() 37 | ); 38 | return new PageUtils(page); 39 | } 40 | 41 | @Override 42 | public List selectListView(Wrapper wrapper) { 43 | return baseMapper.selectListView(wrapper); 44 | } 45 | 46 | @Override 47 | public PageUtils queryPage(Map params, 48 | Wrapper wrapper) { 49 | Page page =new Query(params).getPage(); 50 | page.setRecords(baseMapper.selectListView(page,wrapper)); 51 | PageUtils pageUtil = new PageUtils(page); 52 | return pageUtil; 53 | } 54 | 55 | @Override 56 | public String generateToken(Integer userid,String username, String tableName, String role) { 57 | TokenEntity tokenEntity = this.selectOne(new EntityWrapper().eq("userid", userid).eq("role", role)); 58 | String token = CommonUtil.getRandomString(32); 59 | Calendar cal = Calendar.getInstance(); 60 | cal.setTime(new Date()); 61 | cal.add(Calendar.HOUR_OF_DAY, 1); 62 | if(tokenEntity!=null) { 63 | tokenEntity.setToken(token); 64 | tokenEntity.setExpiratedtime(cal.getTime()); 65 | this.updateById(tokenEntity); 66 | } else { 67 | this.insert(new TokenEntity(userid,username, tableName, role, token, cal.getTime())); 68 | } 69 | return token; 70 | } 71 | 72 | @Override 73 | public TokenEntity getTokenEntity(String token) { 74 | TokenEntity tokenEntity = this.selectOne(new EntityWrapper().eq("token", token)); 75 | if(tokenEntity == null || tokenEntity.getExpiratedtime().getTime() 2 | 3 | 4 | 5 | 6 | 7 | a.id as id 8 | ,a.dic_code as dicCode 9 | ,a.dic_name as dicName 10 | ,a.code_index as codeIndex 11 | ,a.index_name as indexName 12 | ,a.super_id as superId 13 | ,a.beizhu as beizhu 14 | ,a.create_time as createTime 15 | 16 | 60 | 61 | -------------------------------------------------------------------------------- /src/main/java/com/entity/TokenEntity.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | import java.io.Serializable; 4 | import java.util.Date; 5 | 6 | import com.baomidou.mybatisplus.annotations.TableId; 7 | import com.baomidou.mybatisplus.annotations.TableName; 8 | import com.baomidou.mybatisplus.enums.IdType; 9 | 10 | /** 11 | * token表 12 | */ 13 | @TableName("token") 14 | public class TokenEntity implements Serializable { 15 | private static final long serialVersionUID = 1L; 16 | 17 | @TableId(type = IdType.AUTO) 18 | private Integer id; 19 | 20 | /** 21 | * 用户id 22 | */ 23 | private Integer userid; 24 | 25 | /** 26 | * 用户名 27 | */ 28 | private String username; 29 | 30 | /** 31 | * 表名 32 | */ 33 | private String tablename; 34 | 35 | /** 36 | * 角色 37 | */ 38 | private String role; 39 | 40 | /** 41 | * token 42 | */ 43 | private String token; 44 | 45 | /** 46 | * 过期时间 47 | */ 48 | private Date expiratedtime; 49 | 50 | /** 51 | * 新增时间 52 | */ 53 | private Date addtime; 54 | 55 | public Integer getId() { 56 | return id; 57 | } 58 | 59 | public void setId(Integer id) { 60 | this.id = id; 61 | } 62 | 63 | public Integer getUserid() { 64 | return userid; 65 | } 66 | 67 | public void setUserid(Integer userid) { 68 | this.userid = userid; 69 | } 70 | 71 | public String getRole() { 72 | return role; 73 | } 74 | 75 | public void setRole(String role) { 76 | this.role = role; 77 | } 78 | 79 | public String getToken() { 80 | return token; 81 | } 82 | 83 | public String getTablename() { 84 | return tablename; 85 | } 86 | 87 | public void setTablename(String tablename) { 88 | this.tablename = tablename; 89 | } 90 | 91 | public void setToken(String token) { 92 | this.token = token; 93 | } 94 | 95 | public Date getExpiratedtime() { 96 | return expiratedtime; 97 | } 98 | 99 | public void setExpiratedtime(Date expiratedtime) { 100 | this.expiratedtime = expiratedtime; 101 | } 102 | 103 | public Date getAddtime() { 104 | return addtime; 105 | } 106 | 107 | public void setAddtime(Date addtime) { 108 | this.addtime = addtime; 109 | } 110 | 111 | public String getUsername() { 112 | return username; 113 | } 114 | 115 | public void setUsername(String username) { 116 | this.username = username; 117 | } 118 | 119 | public TokenEntity(Integer userid, String username, String tablename,String role, String token, Date expiratedtime) { 120 | super(); 121 | this.userid = userid; 122 | this.username = username; 123 | this.tablename = tablename; 124 | this.role = role; 125 | this.token = token; 126 | this.expiratedtime = expiratedtime; 127 | } 128 | 129 | public TokenEntity() { 130 | } 131 | 132 | } 133 | -------------------------------------------------------------------------------- /src/main/java/com/utils/Query.java: -------------------------------------------------------------------------------- 1 | 2 | package com.utils; 3 | 4 | import java.util.LinkedHashMap; 5 | import java.util.Map; 6 | 7 | import org.apache.commons.lang3.StringUtils; 8 | 9 | import com.baomidou.mybatisplus.plugins.Page; 10 | 11 | /** 12 | * 查询参数 13 | */ 14 | public class Query extends LinkedHashMap { 15 | private static final long serialVersionUID = 1L; 16 | /** 17 | * mybatis-plus分页参数 18 | */ 19 | private Page page; 20 | /** 21 | * 当前页码 22 | */ 23 | private int currPage = 1; 24 | /** 25 | * 每页条数 26 | */ 27 | private int limit = 10; 28 | 29 | public Query(JQPageInfo pageInfo) { 30 | //分页参数 31 | if(pageInfo.getPage()!= null){ 32 | currPage = pageInfo.getPage(); 33 | } 34 | if(pageInfo.getLimit()!= null){ 35 | limit = pageInfo.getLimit(); 36 | } 37 | 38 | 39 | //防止SQL注入(因为sidx、order是通过拼接SQL实现排序的,会有SQL注入风险) 40 | String sidx = SQLFilter.sqlInject(pageInfo.getSidx()); 41 | String order = SQLFilter.sqlInject(pageInfo.getOrder()); 42 | 43 | 44 | //mybatis-plus分页 45 | this.page = new Page<>(currPage, limit); 46 | 47 | //排序 48 | if(StringUtils.isNotBlank(sidx) && StringUtils.isNotBlank(order)){ 49 | this.page.setOrderByField(sidx); 50 | this.page.setAsc("ASC".equalsIgnoreCase(order)); 51 | } 52 | } 53 | 54 | 55 | public Query(Map params){ 56 | this.putAll(params); 57 | 58 | //分页参数 59 | if(params.get("page") != null){ 60 | currPage = Integer.parseInt(String.valueOf(params.get("page"))); 61 | } 62 | if(params.get("limit") != null){ 63 | limit = Integer.parseInt(String.valueOf(params.get("limit"))); 64 | } 65 | 66 | this.put("offset", (currPage - 1) * limit); 67 | this.put("page", currPage); 68 | this.put("limit", limit); 69 | 70 | //防止SQL注入(因为sidx、order是通过拼接SQL实现排序的,会有SQL注入风险) 71 | String sidx = SQLFilter.sqlInject((String)params.get("sidx")); 72 | String order = SQLFilter.sqlInject((String)params.get("order")); 73 | this.put("sidx", sidx); 74 | this.put("order", order); 75 | 76 | //mybatis-plus分页 77 | this.page = new Page<>(currPage, limit); 78 | 79 | //排序 80 | if(StringUtils.isNotBlank(sidx) && StringUtils.isNotBlank(order)){ 81 | this.page.setOrderByField(sidx); 82 | this.page.setAsc("ASC".equalsIgnoreCase(order)); 83 | } 84 | 85 | } 86 | 87 | public Page getPage() { 88 | return page; 89 | } 90 | 91 | public int getCurrPage() { 92 | return currPage; 93 | } 94 | 95 | public int getLimit() { 96 | return limit; 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /src/main/resources/mapper/ShangpinChuruInoutDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | a.id as id 8 | ,a.shangpin_churu_inout_uuid_number as shangpinChuruInoutUuidNumber 9 | ,a.shangpin_churu_inout_name as shangpinChuruInoutName 10 | ,a.shangpin_churu_inout_types as shangpinChuruInoutTypes 11 | ,a.shangpin_churu_inout_content as shangpinChuruInoutContent 12 | ,a.insert_time as insertTime 13 | ,a.create_time as createTime 14 | 15 | 54 | 55 | -------------------------------------------------------------------------------- /src/main/resources/mapper/YuangongDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | a.id as id 8 | ,a.username as username 9 | ,a.password as password 10 | ,a.yuangong_uuid_number as yuangongUuidNumber 11 | ,a.yuangong_name as yuangongName 12 | ,a.yuangong_phone as yuangongPhone 13 | ,a.yuangong_id_number as yuangongIdNumber 14 | ,a.yuangong_photo as yuangongPhoto 15 | ,a.sex_types as sexTypes 16 | ,a.yuangong_email as yuangongEmail 17 | ,a.create_time as createTime 18 | 19 | 61 | 62 | -------------------------------------------------------------------------------- /src/main/java/com/entity/model/ShangpinCollectionModel.java: -------------------------------------------------------------------------------- 1 | package com.entity.model; 2 | 3 | import com.entity.ShangpinCollectionEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import com.fasterxml.jackson.annotation.JsonFormat; 7 | import java.util.Date; 8 | import org.springframework.format.annotation.DateTimeFormat; 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * 商品收藏 14 | * 接收传参的实体类 15 | *(实际开发中配合移动端接口开发手动去掉些没用的字段, 后端一般用entity就够用了) 16 | * 取自ModelAndView 的model名称 17 | */ 18 | public class ShangpinCollectionModel implements Serializable { 19 | private static final long serialVersionUID = 1L; 20 | 21 | 22 | 23 | 24 | /** 25 | * 主键 26 | */ 27 | private Integer id; 28 | 29 | 30 | /** 31 | * 商品 32 | */ 33 | private Integer shangpinId; 34 | 35 | 36 | /** 37 | * 用户 38 | */ 39 | private Integer yonghuId; 40 | 41 | 42 | /** 43 | * 类型 44 | */ 45 | private Integer shangpinCollectionTypes; 46 | 47 | 48 | /** 49 | * 收藏时间 50 | */ 51 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 52 | @DateTimeFormat 53 | private Date insertTime; 54 | 55 | 56 | /** 57 | * 创建时间 show3 photoShow 58 | */ 59 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 60 | @DateTimeFormat 61 | private Date createTime; 62 | 63 | 64 | /** 65 | * 获取:主键 66 | */ 67 | public Integer getId() { 68 | return id; 69 | } 70 | 71 | 72 | /** 73 | * 设置:主键 74 | */ 75 | public void setId(Integer id) { 76 | this.id = id; 77 | } 78 | /** 79 | * 获取:商品 80 | */ 81 | public Integer getShangpinId() { 82 | return shangpinId; 83 | } 84 | 85 | 86 | /** 87 | * 设置:商品 88 | */ 89 | public void setShangpinId(Integer shangpinId) { 90 | this.shangpinId = shangpinId; 91 | } 92 | /** 93 | * 获取:用户 94 | */ 95 | public Integer getYonghuId() { 96 | return yonghuId; 97 | } 98 | 99 | 100 | /** 101 | * 设置:用户 102 | */ 103 | public void setYonghuId(Integer yonghuId) { 104 | this.yonghuId = yonghuId; 105 | } 106 | /** 107 | * 获取:类型 108 | */ 109 | public Integer getShangpinCollectionTypes() { 110 | return shangpinCollectionTypes; 111 | } 112 | 113 | 114 | /** 115 | * 设置:类型 116 | */ 117 | public void setShangpinCollectionTypes(Integer shangpinCollectionTypes) { 118 | this.shangpinCollectionTypes = shangpinCollectionTypes; 119 | } 120 | /** 121 | * 获取:收藏时间 122 | */ 123 | public Date getInsertTime() { 124 | return insertTime; 125 | } 126 | 127 | 128 | /** 129 | * 设置:收藏时间 130 | */ 131 | public void setInsertTime(Date insertTime) { 132 | this.insertTime = insertTime; 133 | } 134 | /** 135 | * 获取:创建时间 show3 photoShow 136 | */ 137 | public Date getCreateTime() { 138 | return createTime; 139 | } 140 | 141 | 142 | /** 143 | * 设置:创建时间 show3 photoShow 144 | */ 145 | public void setCreateTime(Date createTime) { 146 | this.createTime = createTime; 147 | } 148 | 149 | } 150 | -------------------------------------------------------------------------------- /src/main/java/com/controller/ConfigController.java: -------------------------------------------------------------------------------- 1 | 2 | package com.controller; 3 | 4 | 5 | import java.util.Arrays; 6 | import java.util.Map; 7 | 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.web.bind.annotation.PathVariable; 10 | import org.springframework.web.bind.annotation.PostMapping; 11 | import org.springframework.web.bind.annotation.RequestBody; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.RequestParam; 14 | import org.springframework.web.bind.annotation.RestController; 15 | 16 | import com.annotation.IgnoreAuth; 17 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 18 | import com.entity.ConfigEntity; 19 | import com.service.ConfigService; 20 | import com.utils.PageUtils; 21 | import com.utils.R; 22 | import com.utils.ValidatorUtils; 23 | 24 | /** 25 | * 登录相关 26 | */ 27 | @RequestMapping("config") 28 | @RestController 29 | public class ConfigController{ 30 | 31 | @Autowired 32 | private ConfigService configService; 33 | 34 | /** 35 | * 列表 36 | */ 37 | @RequestMapping("/page") 38 | public R page(@RequestParam Map params,ConfigEntity config){ 39 | EntityWrapper ew = new EntityWrapper(); 40 | PageUtils page = configService.queryPage(params); 41 | return R.ok().put("data", page); 42 | } 43 | 44 | /** 45 | * 列表 46 | */ 47 | @IgnoreAuth 48 | @RequestMapping("/list") 49 | public R list(@RequestParam Map params,ConfigEntity config){ 50 | EntityWrapper ew = new EntityWrapper(); 51 | PageUtils page = configService.queryPage(params); 52 | return R.ok().put("data", page); 53 | } 54 | 55 | /** 56 | * 信息 57 | */ 58 | @RequestMapping("/info/{id}") 59 | public R info(@PathVariable("id") String id){ 60 | ConfigEntity config = configService.selectById(id); 61 | return R.ok().put("data", config); 62 | } 63 | 64 | /** 65 | * 详情 66 | */ 67 | @IgnoreAuth 68 | @RequestMapping("/detail/{id}") 69 | public R detail(@PathVariable("id") String id){ 70 | ConfigEntity config = configService.selectById(id); 71 | return R.ok().put("data", config); 72 | } 73 | 74 | /** 75 | * 根据name获取信息 76 | */ 77 | @RequestMapping("/info") 78 | public R infoByName(@RequestParam String name){ 79 | ConfigEntity config = configService.selectOne(new EntityWrapper().eq("name", "faceFile")); 80 | return R.ok().put("data", config); 81 | } 82 | 83 | /** 84 | * 保存 85 | */ 86 | @PostMapping("/save") 87 | public R save(@RequestBody ConfigEntity config){ 88 | // ValidatorUtils.validateEntity(config); 89 | configService.insert(config); 90 | return R.ok(); 91 | } 92 | 93 | /** 94 | * 修改 95 | */ 96 | @RequestMapping("/update") 97 | public R update(@RequestBody ConfigEntity config){ 98 | // ValidatorUtils.validateEntity(config); 99 | configService.updateById(config);//全部更新 100 | return R.ok(); 101 | } 102 | 103 | /** 104 | * 删除 105 | */ 106 | @RequestMapping("/delete") 107 | public R delete(@RequestBody Long[] ids){ 108 | configService.deleteBatchIds(Arrays.asList(ids)); 109 | return R.ok(); 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /src/main/resources/mapper/YonghuDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | a.id as id 8 | ,a.username as username 9 | ,a.password as password 10 | ,a.yonghu_uuid_number as yonghuUuidNumber 11 | ,a.yonghu_name as yonghuName 12 | ,a.yonghu_phone as yonghuPhone 13 | ,a.yonghu_id_number as yonghuIdNumber 14 | ,a.yonghu_photo as yonghuPhoto 15 | ,a.sex_types as sexTypes 16 | ,a.new_money as newMoney 17 | ,a.yonghu_email as yonghuEmail 18 | ,a.create_time as createTime 19 | 20 | 71 | 72 | -------------------------------------------------------------------------------- /src/main/java/com/entity/vo/ShangpinCollectionVO.java: -------------------------------------------------------------------------------- 1 | package com.entity.vo; 2 | 3 | import com.entity.ShangpinCollectionEntity; 4 | import com.baomidou.mybatisplus.annotations.TableField; 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import com.fasterxml.jackson.annotation.JsonFormat; 7 | import java.util.Date; 8 | import org.springframework.format.annotation.DateTimeFormat; 9 | 10 | import java.io.Serializable; 11 | 12 | /** 13 | * 商品收藏 14 | * 手机端接口返回实体辅助类 15 | * (主要作用去除一些不必要的字段) 16 | */ 17 | @TableName("shangpin_collection") 18 | public class ShangpinCollectionVO implements Serializable { 19 | private static final long serialVersionUID = 1L; 20 | 21 | 22 | /** 23 | * 主键 24 | */ 25 | 26 | @TableField(value = "id") 27 | private Integer id; 28 | 29 | 30 | /** 31 | * 商品 32 | */ 33 | 34 | @TableField(value = "shangpin_id") 35 | private Integer shangpinId; 36 | 37 | 38 | /** 39 | * 用户 40 | */ 41 | 42 | @TableField(value = "yonghu_id") 43 | private Integer yonghuId; 44 | 45 | 46 | /** 47 | * 类型 48 | */ 49 | 50 | @TableField(value = "shangpin_collection_types") 51 | private Integer shangpinCollectionTypes; 52 | 53 | 54 | /** 55 | * 收藏时间 56 | */ 57 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 58 | @DateTimeFormat 59 | 60 | @TableField(value = "insert_time") 61 | private Date insertTime; 62 | 63 | 64 | /** 65 | * 创建时间 show3 photoShow 66 | */ 67 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 68 | @DateTimeFormat 69 | 70 | @TableField(value = "create_time") 71 | private Date createTime; 72 | 73 | 74 | /** 75 | * 设置:主键 76 | */ 77 | public Integer getId() { 78 | return id; 79 | } 80 | 81 | 82 | /** 83 | * 获取:主键 84 | */ 85 | 86 | public void setId(Integer id) { 87 | this.id = id; 88 | } 89 | /** 90 | * 设置:商品 91 | */ 92 | public Integer getShangpinId() { 93 | return shangpinId; 94 | } 95 | 96 | 97 | /** 98 | * 获取:商品 99 | */ 100 | 101 | public void setShangpinId(Integer shangpinId) { 102 | this.shangpinId = shangpinId; 103 | } 104 | /** 105 | * 设置:用户 106 | */ 107 | public Integer getYonghuId() { 108 | return yonghuId; 109 | } 110 | 111 | 112 | /** 113 | * 获取:用户 114 | */ 115 | 116 | public void setYonghuId(Integer yonghuId) { 117 | this.yonghuId = yonghuId; 118 | } 119 | /** 120 | * 设置:类型 121 | */ 122 | public Integer getShangpinCollectionTypes() { 123 | return shangpinCollectionTypes; 124 | } 125 | 126 | 127 | /** 128 | * 获取:类型 129 | */ 130 | 131 | public void setShangpinCollectionTypes(Integer shangpinCollectionTypes) { 132 | this.shangpinCollectionTypes = shangpinCollectionTypes; 133 | } 134 | /** 135 | * 设置:收藏时间 136 | */ 137 | public Date getInsertTime() { 138 | return insertTime; 139 | } 140 | 141 | 142 | /** 143 | * 获取:收藏时间 144 | */ 145 | 146 | public void setInsertTime(Date insertTime) { 147 | this.insertTime = insertTime; 148 | } 149 | /** 150 | * 设置:创建时间 show3 photoShow 151 | */ 152 | public Date getCreateTime() { 153 | return createTime; 154 | } 155 | 156 | 157 | /** 158 | * 获取:创建时间 show3 photoShow 159 | */ 160 | 161 | public void setCreateTime(Date createTime) { 162 | this.createTime = createTime; 163 | } 164 | 165 | } 166 | -------------------------------------------------------------------------------- /src/main/java/com/entity/model/GonggaoModel.java: -------------------------------------------------------------------------------- 1 | package com.entity.model; 2 | 3 | import com.entity.GonggaoEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import com.fasterxml.jackson.annotation.JsonFormat; 7 | import java.util.Date; 8 | import org.springframework.format.annotation.DateTimeFormat; 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * 公告 14 | * 接收传参的实体类 15 | *(实际开发中配合移动端接口开发手动去掉些没用的字段, 后端一般用entity就够用了) 16 | * 取自ModelAndView 的model名称 17 | */ 18 | public class GonggaoModel implements Serializable { 19 | private static final long serialVersionUID = 1L; 20 | 21 | 22 | 23 | 24 | /** 25 | * 主键 26 | */ 27 | private Integer id; 28 | 29 | 30 | /** 31 | * 公告名称 32 | */ 33 | private String gonggaoName; 34 | 35 | 36 | /** 37 | * 公告图片 38 | */ 39 | private String gonggaoPhoto; 40 | 41 | 42 | /** 43 | * 公告类型 44 | */ 45 | private Integer gonggaoTypes; 46 | 47 | 48 | /** 49 | * 发布时间 50 | */ 51 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 52 | @DateTimeFormat 53 | private Date insertTime; 54 | 55 | 56 | /** 57 | * 公告详情 58 | */ 59 | private String gonggaoContent; 60 | 61 | 62 | /** 63 | * 创建时间 show1 show2 nameShow 64 | */ 65 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 66 | @DateTimeFormat 67 | private Date createTime; 68 | 69 | 70 | /** 71 | * 获取:主键 72 | */ 73 | public Integer getId() { 74 | return id; 75 | } 76 | 77 | 78 | /** 79 | * 设置:主键 80 | */ 81 | public void setId(Integer id) { 82 | this.id = id; 83 | } 84 | /** 85 | * 获取:公告名称 86 | */ 87 | public String getGonggaoName() { 88 | return gonggaoName; 89 | } 90 | 91 | 92 | /** 93 | * 设置:公告名称 94 | */ 95 | public void setGonggaoName(String gonggaoName) { 96 | this.gonggaoName = gonggaoName; 97 | } 98 | /** 99 | * 获取:公告图片 100 | */ 101 | public String getGonggaoPhoto() { 102 | return gonggaoPhoto; 103 | } 104 | 105 | 106 | /** 107 | * 设置:公告图片 108 | */ 109 | public void setGonggaoPhoto(String gonggaoPhoto) { 110 | this.gonggaoPhoto = gonggaoPhoto; 111 | } 112 | /** 113 | * 获取:公告类型 114 | */ 115 | public Integer getGonggaoTypes() { 116 | return gonggaoTypes; 117 | } 118 | 119 | 120 | /** 121 | * 设置:公告类型 122 | */ 123 | public void setGonggaoTypes(Integer gonggaoTypes) { 124 | this.gonggaoTypes = gonggaoTypes; 125 | } 126 | /** 127 | * 获取:发布时间 128 | */ 129 | public Date getInsertTime() { 130 | return insertTime; 131 | } 132 | 133 | 134 | /** 135 | * 设置:发布时间 136 | */ 137 | public void setInsertTime(Date insertTime) { 138 | this.insertTime = insertTime; 139 | } 140 | /** 141 | * 获取:公告详情 142 | */ 143 | public String getGonggaoContent() { 144 | return gonggaoContent; 145 | } 146 | 147 | 148 | /** 149 | * 设置:公告详情 150 | */ 151 | public void setGonggaoContent(String gonggaoContent) { 152 | this.gonggaoContent = gonggaoContent; 153 | } 154 | /** 155 | * 获取:创建时间 show1 show2 nameShow 156 | */ 157 | public Date getCreateTime() { 158 | return createTime; 159 | } 160 | 161 | 162 | /** 163 | * 设置:创建时间 show1 show2 nameShow 164 | */ 165 | public void setCreateTime(Date createTime) { 166 | this.createTime = createTime; 167 | } 168 | 169 | } 170 | -------------------------------------------------------------------------------- /src/main/resources/mapper/CangkuDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | a.id as id 8 | ,a.cangku_name as cangkuName 9 | ,a.cangku_uuid_number as cangkuUuidNumber 10 | ,a.cangku_photo as cangkuPhoto 11 | ,a.cangku_address as cangkuAddress 12 | ,a.cangku_types as cangkuTypes 13 | ,a.cangku_content as cangkuContent 14 | ,a.cangku_delete as cangkuDelete 15 | ,a.insert_time as insertTime 16 | ,a.create_time as createTime 17 | 18 | 69 | 70 | -------------------------------------------------------------------------------- /src/main/java/com/interceptor/AuthorizationInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.interceptor; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | import com.alibaba.fastjson.JSONObject; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | import org.apache.commons.lang3.StringUtils; 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import org.springframework.stereotype.Component; 14 | import org.springframework.web.method.HandlerMethod; 15 | import org.springframework.web.servlet.HandlerInterceptor; 16 | 17 | import com.annotation.IgnoreAuth; 18 | import com.entity.EIException; 19 | import com.entity.TokenEntity; 20 | import com.service.TokenService; 21 | import com.utils.R; 22 | 23 | /** 24 | * 权限(Token)验证 25 | */ 26 | @Component 27 | public class AuthorizationInterceptor implements HandlerInterceptor { 28 | 29 | public static final String LOGIN_TOKEN_KEY = "Token"; 30 | 31 | @Autowired 32 | private TokenService tokenService; 33 | 34 | @Override 35 | 36 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { 37 | 38 | 39 | String servletPath = request.getServletPath(); 40 | if("/dictionary/page".equals(request.getServletPath()) || "/file/upload".equals(request.getServletPath()) || "/yonghu/register".equals(request.getServletPath()) ){//请求路径是字典表或者文件上传 直接放行 41 | return true; 42 | } 43 | //支持跨域请求 44 | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); 45 | response.setHeader("Access-Control-Max-Age", "3600"); 46 | response.setHeader("Access-Control-Allow-Credentials", "true"); 47 | response.setHeader("Access-Control-Allow-Headers", "x-requested-with,request-source,Token, Origin,imgType, Content-Type, cache-control,postman-token,Cookie, Accept,authorization"); 48 | response.setHeader("Access-Control-Allow-Origin", request.getHeader("Origin")); 49 | 50 | IgnoreAuth annotation; 51 | if (handler instanceof HandlerMethod) { 52 | annotation = ((HandlerMethod) handler).getMethodAnnotation(IgnoreAuth.class); 53 | } else { 54 | return true; 55 | } 56 | 57 | //从header中获取token 58 | String token = request.getHeader(LOGIN_TOKEN_KEY); 59 | 60 | /** 61 | * 不需要验证权限的方法直接放过 62 | */ 63 | if(annotation!=null) { 64 | return true; 65 | } 66 | 67 | TokenEntity tokenEntity = null; 68 | if(StringUtils.isNotBlank(token)) { 69 | tokenEntity = tokenService.getTokenEntity(token); 70 | } 71 | 72 | if(tokenEntity != null) { 73 | request.getSession().setAttribute("userId", tokenEntity.getUserid()); 74 | request.getSession().setAttribute("role", tokenEntity.getRole()); 75 | request.getSession().setAttribute("tableName", tokenEntity.getTablename()); 76 | request.getSession().setAttribute("username", tokenEntity.getUsername()); 77 | return true; 78 | } 79 | 80 | PrintWriter writer = null; 81 | response.setCharacterEncoding("UTF-8"); 82 | response.setContentType("application/json; charset=utf-8"); 83 | try { 84 | writer = response.getWriter(); 85 | writer.print(JSONObject.toJSONString(R.error(401, "请先登录"))); 86 | } finally { 87 | if(writer != null){ 88 | writer.close(); 89 | } 90 | } 91 | // throw new EIException("请先登录", 401); 92 | return false; 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /src/main/java/com/entity/model/DictionaryModel.java: -------------------------------------------------------------------------------- 1 | package com.entity.model; 2 | 3 | import com.entity.DictionaryEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import com.fasterxml.jackson.annotation.JsonFormat; 7 | import java.util.Date; 8 | import org.springframework.format.annotation.DateTimeFormat; 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * 字典 14 | * 接收传参的实体类 15 | *(实际开发中配合移动端接口开发手动去掉些没用的字段, 后端一般用entity就够用了) 16 | * 取自ModelAndView 的model名称 17 | */ 18 | public class DictionaryModel implements Serializable { 19 | private static final long serialVersionUID = 1L; 20 | 21 | 22 | 23 | 24 | /** 25 | * 主键 26 | */ 27 | private Long id; 28 | 29 | 30 | /** 31 | * 字段 32 | */ 33 | private String dicCode; 34 | 35 | 36 | /** 37 | * 字段名 38 | */ 39 | private String dicName; 40 | 41 | 42 | /** 43 | * 编码 44 | */ 45 | private Integer codeIndex; 46 | 47 | 48 | /** 49 | * 编码名字 50 | */ 51 | private String indexName; 52 | 53 | 54 | /** 55 | * 父字段id 56 | */ 57 | private Integer superId; 58 | 59 | 60 | /** 61 | * 备注 62 | */ 63 | private String beizhu; 64 | 65 | 66 | /** 67 | * 创建时间 68 | */ 69 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 70 | @DateTimeFormat 71 | private Date createTime; 72 | 73 | 74 | /** 75 | * 获取:主键 76 | */ 77 | public Long getId() { 78 | return id; 79 | } 80 | 81 | 82 | /** 83 | * 设置:主键 84 | */ 85 | public void setId(Long id) { 86 | this.id = id; 87 | } 88 | /** 89 | * 获取:字段 90 | */ 91 | public String getDicCode() { 92 | return dicCode; 93 | } 94 | 95 | 96 | /** 97 | * 设置:字段 98 | */ 99 | public void setDicCode(String dicCode) { 100 | this.dicCode = dicCode; 101 | } 102 | /** 103 | * 获取:字段名 104 | */ 105 | public String getDicName() { 106 | return dicName; 107 | } 108 | 109 | 110 | /** 111 | * 设置:字段名 112 | */ 113 | public void setDicName(String dicName) { 114 | this.dicName = dicName; 115 | } 116 | /** 117 | * 获取:编码 118 | */ 119 | public Integer getCodeIndex() { 120 | return codeIndex; 121 | } 122 | 123 | 124 | /** 125 | * 设置:编码 126 | */ 127 | public void setCodeIndex(Integer codeIndex) { 128 | this.codeIndex = codeIndex; 129 | } 130 | /** 131 | * 获取:编码名字 132 | */ 133 | public String getIndexName() { 134 | return indexName; 135 | } 136 | 137 | 138 | /** 139 | * 设置:编码名字 140 | */ 141 | public void setIndexName(String indexName) { 142 | this.indexName = indexName; 143 | } 144 | /** 145 | * 获取:父字段id 146 | */ 147 | public Integer getSuperId() { 148 | return superId; 149 | } 150 | 151 | 152 | /** 153 | * 设置:父字段id 154 | */ 155 | public void setSuperId(Integer superId) { 156 | this.superId = superId; 157 | } 158 | /** 159 | * 获取:备注 160 | */ 161 | public String getBeizhu() { 162 | return beizhu; 163 | } 164 | 165 | 166 | /** 167 | * 设置:备注 168 | */ 169 | public void setBeizhu(String beizhu) { 170 | this.beizhu = beizhu; 171 | } 172 | /** 173 | * 获取:创建时间 174 | */ 175 | public Date getCreateTime() { 176 | return createTime; 177 | } 178 | 179 | 180 | /** 181 | * 设置:创建时间 182 | */ 183 | public void setCreateTime(Date createTime) { 184 | this.createTime = createTime; 185 | } 186 | 187 | } 188 | -------------------------------------------------------------------------------- /src/main/java/com/entity/model/ShangpinChuruInoutListModel.java: -------------------------------------------------------------------------------- 1 | package com.entity.model; 2 | 3 | import com.entity.ShangpinChuruInoutListEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import com.fasterxml.jackson.annotation.JsonFormat; 7 | import java.util.Date; 8 | import org.springframework.format.annotation.DateTimeFormat; 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * 出入库详情 14 | * 接收传参的实体类 15 | *(实际开发中配合移动端接口开发手动去掉些没用的字段, 后端一般用entity就够用了) 16 | * 取自ModelAndView 的model名称 17 | */ 18 | public class ShangpinChuruInoutListModel implements Serializable { 19 | private static final long serialVersionUID = 1L; 20 | 21 | 22 | 23 | 24 | /** 25 | * 主键 26 | */ 27 | private Integer id; 28 | 29 | 30 | /** 31 | * 出入库 32 | */ 33 | private Integer shangpinChuruInoutId; 34 | 35 | 36 | /** 37 | * 商品 38 | */ 39 | private Integer shangpinId; 40 | 41 | 42 | /** 43 | * 仓库 44 | */ 45 | private Integer cangkuId; 46 | 47 | 48 | /** 49 | * 操作数量 50 | */ 51 | private Integer shangpinChuruInoutListNumber; 52 | 53 | 54 | /** 55 | * 操作时间 56 | */ 57 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 58 | @DateTimeFormat 59 | private Date insertTime; 60 | 61 | 62 | /** 63 | * 创建时间 64 | */ 65 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 66 | @DateTimeFormat 67 | private Date createTime; 68 | 69 | 70 | /** 71 | * 获取:主键 72 | */ 73 | public Integer getId() { 74 | return id; 75 | } 76 | 77 | 78 | /** 79 | * 设置:主键 80 | */ 81 | public void setId(Integer id) { 82 | this.id = id; 83 | } 84 | /** 85 | * 获取:出入库 86 | */ 87 | public Integer getShangpinChuruInoutId() { 88 | return shangpinChuruInoutId; 89 | } 90 | 91 | 92 | /** 93 | * 设置:出入库 94 | */ 95 | public void setShangpinChuruInoutId(Integer shangpinChuruInoutId) { 96 | this.shangpinChuruInoutId = shangpinChuruInoutId; 97 | } 98 | /** 99 | * 获取:商品 100 | */ 101 | public Integer getShangpinId() { 102 | return shangpinId; 103 | } 104 | 105 | 106 | /** 107 | * 设置:商品 108 | */ 109 | public void setShangpinId(Integer shangpinId) { 110 | this.shangpinId = shangpinId; 111 | } 112 | /** 113 | * 获取:仓库 114 | */ 115 | public Integer getCangkuId() { 116 | return cangkuId; 117 | } 118 | 119 | 120 | /** 121 | * 设置:仓库 122 | */ 123 | public void setCangkuId(Integer cangkuId) { 124 | this.cangkuId = cangkuId; 125 | } 126 | /** 127 | * 获取:操作数量 128 | */ 129 | public Integer getShangpinChuruInoutListNumber() { 130 | return shangpinChuruInoutListNumber; 131 | } 132 | 133 | 134 | /** 135 | * 设置:操作数量 136 | */ 137 | public void setShangpinChuruInoutListNumber(Integer shangpinChuruInoutListNumber) { 138 | this.shangpinChuruInoutListNumber = shangpinChuruInoutListNumber; 139 | } 140 | /** 141 | * 获取:操作时间 142 | */ 143 | public Date getInsertTime() { 144 | return insertTime; 145 | } 146 | 147 | 148 | /** 149 | * 设置:操作时间 150 | */ 151 | public void setInsertTime(Date insertTime) { 152 | this.insertTime = insertTime; 153 | } 154 | /** 155 | * 获取:创建时间 156 | */ 157 | public Date getCreateTime() { 158 | return createTime; 159 | } 160 | 161 | 162 | /** 163 | * 设置:创建时间 164 | */ 165 | public void setCreateTime(Date createTime) { 166 | this.createTime = createTime; 167 | } 168 | 169 | } 170 | -------------------------------------------------------------------------------- /src/main/resources/mapper/CheliangDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | a.id as id 8 | ,a.cheliang_name as cheliangName 9 | ,a.cheliang_uuid_number as cheliangUuidNumber 10 | ,a.cheliang_photo as cheliangPhoto 11 | ,a.cheliang_paizhao as cheliangPaizhao 12 | ,a.cheliang_types as cheliangTypes 13 | ,a.cheliang_content as cheliangContent 14 | ,a.cheliang_delete as cheliangDelete 15 | ,a.insert_time as insertTime 16 | ,a.create_time as createTime 17 | 18 | 69 | 70 | -------------------------------------------------------------------------------- /src/main/java/com/utils/BaiduUtil.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | import java.io.BufferedReader; 4 | import java.io.InputStreamReader; 5 | import java.net.HttpURLConnection; 6 | import java.net.URL; 7 | import java.util.HashMap; 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | import org.json.JSONObject; 12 | 13 | 14 | /** 15 | * @author yangliyuan 16 | * @version 创建时间:2020年2月7日 下午9:37:05 17 | * 类说明 : 18 | */ 19 | 20 | public class BaiduUtil { 21 | 22 | /** 23 | * 根据经纬度获得省市区信息 24 | * @param lon 纬度 25 | * @param lat 经度 26 | * @param coordtype 经纬度坐标系 27 | * @return 28 | */ 29 | public static Map getCityByLonLat(String key, String lng, String lat) { 30 | String location = lat + "," + lng; 31 | try { 32 | //拼装url 33 | String url = "http://api.map.baidu.com/reverse_geocoding/v3/?ak="+key+"&output=json&coordtype=wgs84ll&location="+location; 34 | String result = HttpClientUtils.doGet(url); 35 | JSONObject o = new JSONObject(result); 36 | Map area = new HashMap<>(); 37 | area.put("province", o.getJSONObject("result").getJSONObject("addressComponent").getString("province")); 38 | area.put("city", o.getJSONObject("result").getJSONObject("addressComponent").getString("city")); 39 | area.put("district", o.getJSONObject("result").getJSONObject("addressComponent").getString("district")); 40 | area.put("street", o.getJSONObject("result").getJSONObject("addressComponent").getString("street")); 41 | return area; 42 | }catch (Exception e) { 43 | e.printStackTrace(); 44 | } 45 | return null; 46 | } 47 | 48 | /** 49 | * 获取API访问token 50 | * 该token有一定的有效期,需要自行管理,当失效时需重新获取. 51 | * @param ak - 百度云官网获取的 API Key 52 | * @param sk - 百度云官网获取的 Securet Key 53 | * @return assess_token 54 | */ 55 | public static String getAuth(String ak, String sk) { 56 | // 获取token地址 57 | String authHost = "https://aip.baidubce.com/oauth/2.0/token?"; 58 | String getAccessTokenUrl = authHost 59 | // 1. grant_type为固定参数 60 | + "grant_type=client_credentials" 61 | // 2. 官网获取的 API Key 62 | + "&client_id=" + ak 63 | // 3. 官网获取的 Secret Key 64 | + "&client_secret=" + sk; 65 | try { 66 | URL realUrl = new URL(getAccessTokenUrl); 67 | // 打开和URL之间的连接 68 | HttpURLConnection connection = (HttpURLConnection) realUrl.openConnection(); 69 | connection.setRequestMethod("GET"); 70 | connection.connect(); 71 | // 获取所有响应头字段 72 | Map> map = connection.getHeaderFields(); 73 | // 遍历所有的响应头字段 74 | for (String key : map.keySet()) { 75 | System.err.println(key + "--->" + map.get(key)); 76 | } 77 | // 定义 BufferedReader输入流来读取URL的响应 78 | BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream())); 79 | String result = ""; 80 | String line; 81 | while ((line = in.readLine()) != null) { 82 | result += line; 83 | } 84 | /** 85 | * 返回结果示例 86 | */ 87 | System.err.println("result:" + result); 88 | org.json.JSONObject jsonObject = new org.json.JSONObject(result); 89 | String access_token = jsonObject.getString("access_token"); 90 | return access_token; 91 | } catch (Exception e) { 92 | System.err.printf("获取token失败!"); 93 | e.printStackTrace(System.err); 94 | } 95 | return null; 96 | } 97 | 98 | } 99 | -------------------------------------------------------------------------------- /src/main/java/com/entity/model/ShangpinChuruInoutModel.java: -------------------------------------------------------------------------------- 1 | package com.entity.model; 2 | 3 | import com.entity.ShangpinChuruInoutEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import com.fasterxml.jackson.annotation.JsonFormat; 7 | import java.util.Date; 8 | import org.springframework.format.annotation.DateTimeFormat; 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * 出入库 14 | * 接收传参的实体类 15 | *(实际开发中配合移动端接口开发手动去掉些没用的字段, 后端一般用entity就够用了) 16 | * 取自ModelAndView 的model名称 17 | */ 18 | public class ShangpinChuruInoutModel implements Serializable { 19 | private static final long serialVersionUID = 1L; 20 | 21 | 22 | 23 | 24 | /** 25 | * 主键 26 | */ 27 | private Integer id; 28 | 29 | 30 | /** 31 | * 出入库流水号 32 | */ 33 | private String shangpinChuruInoutUuidNumber; 34 | 35 | 36 | /** 37 | * 出入库名称 38 | */ 39 | private String shangpinChuruInoutName; 40 | 41 | 42 | /** 43 | * 出入库类型 44 | */ 45 | private Integer shangpinChuruInoutTypes; 46 | 47 | 48 | /** 49 | * 备注 50 | */ 51 | private String shangpinChuruInoutContent; 52 | 53 | 54 | /** 55 | * 添加时间 56 | */ 57 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 58 | @DateTimeFormat 59 | private Date insertTime; 60 | 61 | 62 | /** 63 | * 创建时间 64 | */ 65 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 66 | @DateTimeFormat 67 | private Date createTime; 68 | 69 | 70 | /** 71 | * 获取:主键 72 | */ 73 | public Integer getId() { 74 | return id; 75 | } 76 | 77 | 78 | /** 79 | * 设置:主键 80 | */ 81 | public void setId(Integer id) { 82 | this.id = id; 83 | } 84 | /** 85 | * 获取:出入库流水号 86 | */ 87 | public String getShangpinChuruInoutUuidNumber() { 88 | return shangpinChuruInoutUuidNumber; 89 | } 90 | 91 | 92 | /** 93 | * 设置:出入库流水号 94 | */ 95 | public void setShangpinChuruInoutUuidNumber(String shangpinChuruInoutUuidNumber) { 96 | this.shangpinChuruInoutUuidNumber = shangpinChuruInoutUuidNumber; 97 | } 98 | /** 99 | * 获取:出入库名称 100 | */ 101 | public String getShangpinChuruInoutName() { 102 | return shangpinChuruInoutName; 103 | } 104 | 105 | 106 | /** 107 | * 设置:出入库名称 108 | */ 109 | public void setShangpinChuruInoutName(String shangpinChuruInoutName) { 110 | this.shangpinChuruInoutName = shangpinChuruInoutName; 111 | } 112 | /** 113 | * 获取:出入库类型 114 | */ 115 | public Integer getShangpinChuruInoutTypes() { 116 | return shangpinChuruInoutTypes; 117 | } 118 | 119 | 120 | /** 121 | * 设置:出入库类型 122 | */ 123 | public void setShangpinChuruInoutTypes(Integer shangpinChuruInoutTypes) { 124 | this.shangpinChuruInoutTypes = shangpinChuruInoutTypes; 125 | } 126 | /** 127 | * 获取:备注 128 | */ 129 | public String getShangpinChuruInoutContent() { 130 | return shangpinChuruInoutContent; 131 | } 132 | 133 | 134 | /** 135 | * 设置:备注 136 | */ 137 | public void setShangpinChuruInoutContent(String shangpinChuruInoutContent) { 138 | this.shangpinChuruInoutContent = shangpinChuruInoutContent; 139 | } 140 | /** 141 | * 获取:添加时间 142 | */ 143 | public Date getInsertTime() { 144 | return insertTime; 145 | } 146 | 147 | 148 | /** 149 | * 设置:添加时间 150 | */ 151 | public void setInsertTime(Date insertTime) { 152 | this.insertTime = insertTime; 153 | } 154 | /** 155 | * 获取:创建时间 156 | */ 157 | public Date getCreateTime() { 158 | return createTime; 159 | } 160 | 161 | 162 | /** 163 | * 设置:创建时间 164 | */ 165 | public void setCreateTime(Date createTime) { 166 | this.createTime = createTime; 167 | } 168 | 169 | } 170 | -------------------------------------------------------------------------------- /src/main/java/com/utils/PoiUtil.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | import org.apache.commons.io.FileUtils; 4 | import org.apache.poi.hssf.usermodel.HSSFCell; 5 | import org.apache.poi.hssf.usermodel.HSSFRow; 6 | import org.apache.poi.hssf.usermodel.HSSFSheet; 7 | import org.apache.poi.hssf.usermodel.HSSFWorkbook; 8 | import org.apache.poi.ss.usermodel.Cell; 9 | 10 | import java.io.File; 11 | import java.io.FileOutputStream; 12 | import java.util.ArrayList; 13 | import java.util.List; 14 | 15 | /** 16 | * 文件导入到处 17 | */ 18 | public class PoiUtil { 19 | /** 20 | * 导入 21 | * 22 | * @param url 23 | * @return 24 | * @throws Exception 25 | */ 26 | public static List> poiImport(String url) throws Exception { 27 | List> list = new ArrayList<>(); 28 | // 创建Excel 读取文件内容 29 | HSSFWorkbook workbook = new HSSFWorkbook(FileUtils.openInputStream(new File(url))); 30 | /** 31 | * 第一种方式读取Sheet页 32 | */ 33 | // HSSFSheet sheet = workbook.getSheet("Sheet0"); 34 | /** 35 | * 第二种方式读取Sheet页 36 | */ 37 | HSSFSheet sheet = workbook.getSheetAt(0);//获取工作表 38 | for (int i = 0; i < sheet.getLastRowNum()+1; i++) { 39 | HSSFRow row = sheet.getRow(i);//获取行 40 | List rowlist = new ArrayList<>();//行数据 41 | for (int j = 0; j < row.getLastCellNum(); j++) { 42 | HSSFCell cell = row.getCell(j); 43 | cell.setCellType(Cell.CELL_TYPE_STRING); 44 | String value = cell.getStringCellValue(); 45 | rowlist.add(value);//行中数据添加到行中 46 | } 47 | list.add(rowlist);//将行数据添加到list中 48 | } 49 | return list; 50 | } 51 | 52 | 53 | 54 | 55 | 56 | 57 | // 导出 58 | public static void poiExport(List> list, String url) throws Exception { 59 | //创建Excel工作薄 60 | HSSFWorkbook workbook = new HSSFWorkbook(); 61 | //创建一个工作表shheet 62 | HSSFSheet sheet = workbook.createSheet(); 63 | for (int i = 0; i < list.size(); i++) { 64 | HSSFRow row = sheet.createRow(i); 65 | List dataList = list.get(i); 66 | for (int j = 0; j < dataList.size(); j++) { 67 | HSSFCell cell = row.createCell(j); 68 | cell.setCellValue(dataList.get(j)); 69 | } 70 | 71 | } 72 | FileOutputStream stream = FileUtils.openOutputStream(new File(url)); 73 | workbook.write(stream); 74 | stream.close(); 75 | } 76 | 77 | 78 | public static void main(String[] args) { 79 | try { 80 | //导入 81 | List> lists = PoiUtil.poiImport("C:/Users/Administrator/Desktop/工作1.xls"); 82 | System.out.println(); 83 | 84 | 85 | //导出 86 | 87 | PoiUtil.poiExport(lists, "C:/Users/Administrator/Desktop/工作1.xls"); 88 | 89 | // 90 | // List> list = new ArrayList<>(); 91 | // ArrayList dataList = new ArrayList<>(); 92 | // dataList.add("标题1"); 93 | // dataList.add("标题2"); 94 | // dataList.add("标题3"); 95 | // list.add(dataList); 96 | // // 追加数据 97 | // for (int i = 1; i < 10; i++) {// 这里的int 起始是1 也就是第二行开始 98 | // ArrayList dataList111 = new ArrayList<>(); 99 | // dataList111.add("内容" + i); 100 | // dataList111.add("内容1111111121222222222333333333377777777411111111477777777" + i); 101 | // dataList111.add("内容" + i); 102 | // list.add(dataList111); 103 | // } 104 | // PoiUtil.poiExport(list, "C:/Users/Administrator/Desktop/工作1.xls"); 105 | } catch (Exception e) { 106 | e.printStackTrace(); 107 | } 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /src/main/java/com/entity/vo/GonggaoVO.java: -------------------------------------------------------------------------------- 1 | package com.entity.vo; 2 | 3 | import com.entity.GonggaoEntity; 4 | import com.baomidou.mybatisplus.annotations.TableField; 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import com.fasterxml.jackson.annotation.JsonFormat; 7 | import java.util.Date; 8 | import org.springframework.format.annotation.DateTimeFormat; 9 | 10 | import java.io.Serializable; 11 | 12 | /** 13 | * 公告 14 | * 手机端接口返回实体辅助类 15 | * (主要作用去除一些不必要的字段) 16 | */ 17 | @TableName("gonggao") 18 | public class GonggaoVO implements Serializable { 19 | private static final long serialVersionUID = 1L; 20 | 21 | 22 | /** 23 | * 主键 24 | */ 25 | 26 | @TableField(value = "id") 27 | private Integer id; 28 | 29 | 30 | /** 31 | * 公告名称 32 | */ 33 | 34 | @TableField(value = "gonggao_name") 35 | private String gonggaoName; 36 | 37 | 38 | /** 39 | * 公告图片 40 | */ 41 | 42 | @TableField(value = "gonggao_photo") 43 | private String gonggaoPhoto; 44 | 45 | 46 | /** 47 | * 公告类型 48 | */ 49 | 50 | @TableField(value = "gonggao_types") 51 | private Integer gonggaoTypes; 52 | 53 | 54 | /** 55 | * 发布时间 56 | */ 57 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 58 | @DateTimeFormat 59 | 60 | @TableField(value = "insert_time") 61 | private Date insertTime; 62 | 63 | 64 | /** 65 | * 公告详情 66 | */ 67 | 68 | @TableField(value = "gonggao_content") 69 | private String gonggaoContent; 70 | 71 | 72 | /** 73 | * 创建时间 show1 show2 nameShow 74 | */ 75 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 76 | @DateTimeFormat 77 | 78 | @TableField(value = "create_time") 79 | private Date createTime; 80 | 81 | 82 | /** 83 | * 设置:主键 84 | */ 85 | public Integer getId() { 86 | return id; 87 | } 88 | 89 | 90 | /** 91 | * 获取:主键 92 | */ 93 | 94 | public void setId(Integer id) { 95 | this.id = id; 96 | } 97 | /** 98 | * 设置:公告名称 99 | */ 100 | public String getGonggaoName() { 101 | return gonggaoName; 102 | } 103 | 104 | 105 | /** 106 | * 获取:公告名称 107 | */ 108 | 109 | public void setGonggaoName(String gonggaoName) { 110 | this.gonggaoName = gonggaoName; 111 | } 112 | /** 113 | * 设置:公告图片 114 | */ 115 | public String getGonggaoPhoto() { 116 | return gonggaoPhoto; 117 | } 118 | 119 | 120 | /** 121 | * 获取:公告图片 122 | */ 123 | 124 | public void setGonggaoPhoto(String gonggaoPhoto) { 125 | this.gonggaoPhoto = gonggaoPhoto; 126 | } 127 | /** 128 | * 设置:公告类型 129 | */ 130 | public Integer getGonggaoTypes() { 131 | return gonggaoTypes; 132 | } 133 | 134 | 135 | /** 136 | * 获取:公告类型 137 | */ 138 | 139 | public void setGonggaoTypes(Integer gonggaoTypes) { 140 | this.gonggaoTypes = gonggaoTypes; 141 | } 142 | /** 143 | * 设置:发布时间 144 | */ 145 | public Date getInsertTime() { 146 | return insertTime; 147 | } 148 | 149 | 150 | /** 151 | * 获取:发布时间 152 | */ 153 | 154 | public void setInsertTime(Date insertTime) { 155 | this.insertTime = insertTime; 156 | } 157 | /** 158 | * 设置:公告详情 159 | */ 160 | public String getGonggaoContent() { 161 | return gonggaoContent; 162 | } 163 | 164 | 165 | /** 166 | * 获取:公告详情 167 | */ 168 | 169 | public void setGonggaoContent(String gonggaoContent) { 170 | this.gonggaoContent = gonggaoContent; 171 | } 172 | /** 173 | * 设置:创建时间 show1 show2 nameShow 174 | */ 175 | public Date getCreateTime() { 176 | return createTime; 177 | } 178 | 179 | 180 | /** 181 | * 获取:创建时间 show1 show2 nameShow 182 | */ 183 | 184 | public void setCreateTime(Date createTime) { 185 | this.createTime = createTime; 186 | } 187 | 188 | } 189 | -------------------------------------------------------------------------------- /src/main/java/com/entity/vo/DictionaryVO.java: -------------------------------------------------------------------------------- 1 | package com.entity.vo; 2 | 3 | import com.entity.DictionaryEntity; 4 | import com.baomidou.mybatisplus.annotations.TableField; 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import com.fasterxml.jackson.annotation.JsonFormat; 7 | import java.util.Date; 8 | import org.springframework.format.annotation.DateTimeFormat; 9 | 10 | import java.io.Serializable; 11 | 12 | /** 13 | * 字典 14 | * 手机端接口返回实体辅助类 15 | * (主要作用去除一些不必要的字段) 16 | */ 17 | @TableName("dictionary") 18 | public class DictionaryVO implements Serializable { 19 | private static final long serialVersionUID = 1L; 20 | 21 | 22 | /** 23 | * 主键 24 | */ 25 | 26 | @TableField(value = "id") 27 | private Long id; 28 | 29 | 30 | /** 31 | * 字段 32 | */ 33 | 34 | @TableField(value = "dic_code") 35 | private String dicCode; 36 | 37 | 38 | /** 39 | * 字段名 40 | */ 41 | 42 | @TableField(value = "dic_name") 43 | private String dicName; 44 | 45 | 46 | /** 47 | * 编码 48 | */ 49 | 50 | @TableField(value = "code_index") 51 | private Integer codeIndex; 52 | 53 | 54 | /** 55 | * 编码名字 56 | */ 57 | 58 | @TableField(value = "index_name") 59 | private String indexName; 60 | 61 | 62 | /** 63 | * 父字段id 64 | */ 65 | 66 | @TableField(value = "super_id") 67 | private Integer superId; 68 | 69 | 70 | /** 71 | * 备注 72 | */ 73 | 74 | @TableField(value = "beizhu") 75 | private String beizhu; 76 | 77 | 78 | /** 79 | * 创建时间 80 | */ 81 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 82 | @DateTimeFormat 83 | 84 | @TableField(value = "create_time") 85 | private Date createTime; 86 | 87 | 88 | /** 89 | * 设置:主键 90 | */ 91 | public Long getId() { 92 | return id; 93 | } 94 | 95 | 96 | /** 97 | * 获取:主键 98 | */ 99 | 100 | public void setId(Long id) { 101 | this.id = id; 102 | } 103 | /** 104 | * 设置:字段 105 | */ 106 | public String getDicCode() { 107 | return dicCode; 108 | } 109 | 110 | 111 | /** 112 | * 获取:字段 113 | */ 114 | 115 | public void setDicCode(String dicCode) { 116 | this.dicCode = dicCode; 117 | } 118 | /** 119 | * 设置:字段名 120 | */ 121 | public String getDicName() { 122 | return dicName; 123 | } 124 | 125 | 126 | /** 127 | * 获取:字段名 128 | */ 129 | 130 | public void setDicName(String dicName) { 131 | this.dicName = dicName; 132 | } 133 | /** 134 | * 设置:编码 135 | */ 136 | public Integer getCodeIndex() { 137 | return codeIndex; 138 | } 139 | 140 | 141 | /** 142 | * 获取:编码 143 | */ 144 | 145 | public void setCodeIndex(Integer codeIndex) { 146 | this.codeIndex = codeIndex; 147 | } 148 | /** 149 | * 设置:编码名字 150 | */ 151 | public String getIndexName() { 152 | return indexName; 153 | } 154 | 155 | 156 | /** 157 | * 获取:编码名字 158 | */ 159 | 160 | public void setIndexName(String indexName) { 161 | this.indexName = indexName; 162 | } 163 | /** 164 | * 设置:父字段id 165 | */ 166 | public Integer getSuperId() { 167 | return superId; 168 | } 169 | 170 | 171 | /** 172 | * 获取:父字段id 173 | */ 174 | 175 | public void setSuperId(Integer superId) { 176 | this.superId = superId; 177 | } 178 | /** 179 | * 设置:备注 180 | */ 181 | public String getBeizhu() { 182 | return beizhu; 183 | } 184 | 185 | 186 | /** 187 | * 获取:备注 188 | */ 189 | 190 | public void setBeizhu(String beizhu) { 191 | this.beizhu = beizhu; 192 | } 193 | /** 194 | * 设置:创建时间 195 | */ 196 | public Date getCreateTime() { 197 | return createTime; 198 | } 199 | 200 | 201 | /** 202 | * 获取:创建时间 203 | */ 204 | 205 | public void setCreateTime(Date createTime) { 206 | this.createTime = createTime; 207 | } 208 | 209 | } 210 | -------------------------------------------------------------------------------- /src/main/java/com/entity/vo/ShangpinChuruInoutListVO.java: -------------------------------------------------------------------------------- 1 | package com.entity.vo; 2 | 3 | import com.entity.ShangpinChuruInoutListEntity; 4 | import com.baomidou.mybatisplus.annotations.TableField; 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import com.fasterxml.jackson.annotation.JsonFormat; 7 | import java.util.Date; 8 | import org.springframework.format.annotation.DateTimeFormat; 9 | 10 | import java.io.Serializable; 11 | 12 | /** 13 | * 出入库详情 14 | * 手机端接口返回实体辅助类 15 | * (主要作用去除一些不必要的字段) 16 | */ 17 | @TableName("shangpin_churu_inout_list") 18 | public class ShangpinChuruInoutListVO implements Serializable { 19 | private static final long serialVersionUID = 1L; 20 | 21 | 22 | /** 23 | * 主键 24 | */ 25 | 26 | @TableField(value = "id") 27 | private Integer id; 28 | 29 | 30 | /** 31 | * 出入库 32 | */ 33 | 34 | @TableField(value = "shangpin_churu_inout_id") 35 | private Integer shangpinChuruInoutId; 36 | 37 | 38 | /** 39 | * 商品 40 | */ 41 | 42 | @TableField(value = "shangpin_id") 43 | private Integer shangpinId; 44 | 45 | 46 | /** 47 | * 仓库 48 | */ 49 | 50 | @TableField(value = "cangku_id") 51 | private Integer cangkuId; 52 | 53 | 54 | /** 55 | * 操作数量 56 | */ 57 | 58 | @TableField(value = "shangpin_churu_inout_list_number") 59 | private Integer shangpinChuruInoutListNumber; 60 | 61 | 62 | /** 63 | * 操作时间 64 | */ 65 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 66 | @DateTimeFormat 67 | 68 | @TableField(value = "insert_time") 69 | private Date insertTime; 70 | 71 | 72 | /** 73 | * 创建时间 74 | */ 75 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 76 | @DateTimeFormat 77 | 78 | @TableField(value = "create_time") 79 | private Date createTime; 80 | 81 | 82 | /** 83 | * 设置:主键 84 | */ 85 | public Integer getId() { 86 | return id; 87 | } 88 | 89 | 90 | /** 91 | * 获取:主键 92 | */ 93 | 94 | public void setId(Integer id) { 95 | this.id = id; 96 | } 97 | /** 98 | * 设置:出入库 99 | */ 100 | public Integer getShangpinChuruInoutId() { 101 | return shangpinChuruInoutId; 102 | } 103 | 104 | 105 | /** 106 | * 获取:出入库 107 | */ 108 | 109 | public void setShangpinChuruInoutId(Integer shangpinChuruInoutId) { 110 | this.shangpinChuruInoutId = shangpinChuruInoutId; 111 | } 112 | /** 113 | * 设置:商品 114 | */ 115 | public Integer getShangpinId() { 116 | return shangpinId; 117 | } 118 | 119 | 120 | /** 121 | * 获取:商品 122 | */ 123 | 124 | public void setShangpinId(Integer shangpinId) { 125 | this.shangpinId = shangpinId; 126 | } 127 | /** 128 | * 设置:仓库 129 | */ 130 | public Integer getCangkuId() { 131 | return cangkuId; 132 | } 133 | 134 | 135 | /** 136 | * 获取:仓库 137 | */ 138 | 139 | public void setCangkuId(Integer cangkuId) { 140 | this.cangkuId = cangkuId; 141 | } 142 | /** 143 | * 设置:操作数量 144 | */ 145 | public Integer getShangpinChuruInoutListNumber() { 146 | return shangpinChuruInoutListNumber; 147 | } 148 | 149 | 150 | /** 151 | * 获取:操作数量 152 | */ 153 | 154 | public void setShangpinChuruInoutListNumber(Integer shangpinChuruInoutListNumber) { 155 | this.shangpinChuruInoutListNumber = shangpinChuruInoutListNumber; 156 | } 157 | /** 158 | * 设置:操作时间 159 | */ 160 | public Date getInsertTime() { 161 | return insertTime; 162 | } 163 | 164 | 165 | /** 166 | * 获取:操作时间 167 | */ 168 | 169 | public void setInsertTime(Date insertTime) { 170 | this.insertTime = insertTime; 171 | } 172 | /** 173 | * 设置:创建时间 174 | */ 175 | public Date getCreateTime() { 176 | return createTime; 177 | } 178 | 179 | 180 | /** 181 | * 获取:创建时间 182 | */ 183 | 184 | public void setCreateTime(Date createTime) { 185 | this.createTime = createTime; 186 | } 187 | 188 | } 189 | -------------------------------------------------------------------------------- /src/main/java/com/entity/model/SijiModel.java: -------------------------------------------------------------------------------- 1 | package com.entity.model; 2 | 3 | import com.entity.SijiEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import com.fasterxml.jackson.annotation.JsonFormat; 7 | import java.util.Date; 8 | import org.springframework.format.annotation.DateTimeFormat; 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * 司机 14 | * 接收传参的实体类 15 | *(实际开发中配合移动端接口开发手动去掉些没用的字段, 后端一般用entity就够用了) 16 | * 取自ModelAndView 的model名称 17 | */ 18 | public class SijiModel implements Serializable { 19 | private static final long serialVersionUID = 1L; 20 | 21 | 22 | 23 | 24 | /** 25 | * 主键 26 | */ 27 | private Integer id; 28 | 29 | 30 | /** 31 | * 司机编号 32 | */ 33 | private String sijiUuidNumber; 34 | 35 | 36 | /** 37 | * 司机姓名 38 | */ 39 | private String sijiName; 40 | 41 | 42 | /** 43 | * 司机手机号 44 | */ 45 | private String sijiPhone; 46 | 47 | 48 | /** 49 | * 司机身份证号 50 | */ 51 | private String sijiIdNumber; 52 | 53 | 54 | /** 55 | * 司机头像 56 | */ 57 | private String sijiPhoto; 58 | 59 | 60 | /** 61 | * 性别 62 | */ 63 | private Integer sexTypes; 64 | 65 | 66 | /** 67 | * 司机邮箱 68 | */ 69 | private String sijiEmail; 70 | 71 | 72 | /** 73 | * 创建时间 74 | */ 75 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 76 | @DateTimeFormat 77 | private Date createTime; 78 | 79 | 80 | /** 81 | * 获取:主键 82 | */ 83 | public Integer getId() { 84 | return id; 85 | } 86 | 87 | 88 | /** 89 | * 设置:主键 90 | */ 91 | public void setId(Integer id) { 92 | this.id = id; 93 | } 94 | /** 95 | * 获取:司机编号 96 | */ 97 | public String getSijiUuidNumber() { 98 | return sijiUuidNumber; 99 | } 100 | 101 | 102 | /** 103 | * 设置:司机编号 104 | */ 105 | public void setSijiUuidNumber(String sijiUuidNumber) { 106 | this.sijiUuidNumber = sijiUuidNumber; 107 | } 108 | /** 109 | * 获取:司机姓名 110 | */ 111 | public String getSijiName() { 112 | return sijiName; 113 | } 114 | 115 | 116 | /** 117 | * 设置:司机姓名 118 | */ 119 | public void setSijiName(String sijiName) { 120 | this.sijiName = sijiName; 121 | } 122 | /** 123 | * 获取:司机手机号 124 | */ 125 | public String getSijiPhone() { 126 | return sijiPhone; 127 | } 128 | 129 | 130 | /** 131 | * 设置:司机手机号 132 | */ 133 | public void setSijiPhone(String sijiPhone) { 134 | this.sijiPhone = sijiPhone; 135 | } 136 | /** 137 | * 获取:司机身份证号 138 | */ 139 | public String getSijiIdNumber() { 140 | return sijiIdNumber; 141 | } 142 | 143 | 144 | /** 145 | * 设置:司机身份证号 146 | */ 147 | public void setSijiIdNumber(String sijiIdNumber) { 148 | this.sijiIdNumber = sijiIdNumber; 149 | } 150 | /** 151 | * 获取:司机头像 152 | */ 153 | public String getSijiPhoto() { 154 | return sijiPhoto; 155 | } 156 | 157 | 158 | /** 159 | * 设置:司机头像 160 | */ 161 | public void setSijiPhoto(String sijiPhoto) { 162 | this.sijiPhoto = sijiPhoto; 163 | } 164 | /** 165 | * 获取:性别 166 | */ 167 | public Integer getSexTypes() { 168 | return sexTypes; 169 | } 170 | 171 | 172 | /** 173 | * 设置:性别 174 | */ 175 | public void setSexTypes(Integer sexTypes) { 176 | this.sexTypes = sexTypes; 177 | } 178 | /** 179 | * 获取:司机邮箱 180 | */ 181 | public String getSijiEmail() { 182 | return sijiEmail; 183 | } 184 | 185 | 186 | /** 187 | * 设置:司机邮箱 188 | */ 189 | public void setSijiEmail(String sijiEmail) { 190 | this.sijiEmail = sijiEmail; 191 | } 192 | /** 193 | * 获取:创建时间 194 | */ 195 | public Date getCreateTime() { 196 | return createTime; 197 | } 198 | 199 | 200 | /** 201 | * 设置:创建时间 202 | */ 203 | public void setCreateTime(Date createTime) { 204 | this.createTime = createTime; 205 | } 206 | 207 | } 208 | -------------------------------------------------------------------------------- /src/main/java/com/controller/FileController.java: -------------------------------------------------------------------------------- 1 | package com.controller; 2 | 3 | import java.io.File; 4 | import java.io.FileNotFoundException; 5 | import java.io.IOException; 6 | import java.util.Arrays; 7 | import java.util.Date; 8 | import java.util.HashMap; 9 | import java.util.List; 10 | import java.util.Map; 11 | import java.util.Random; 12 | import java.util.UUID; 13 | 14 | import org.apache.commons.io.FileUtils; 15 | import org.apache.commons.lang3.StringUtils; 16 | import org.springframework.beans.factory.annotation.Autowired; 17 | import org.springframework.http.HttpHeaders; 18 | import org.springframework.http.HttpStatus; 19 | import org.springframework.http.MediaType; 20 | import org.springframework.http.ResponseEntity; 21 | import org.springframework.util.ResourceUtils; 22 | import org.springframework.web.bind.annotation.PathVariable; 23 | import org.springframework.web.bind.annotation.RequestBody; 24 | import org.springframework.web.bind.annotation.RequestMapping; 25 | import org.springframework.web.bind.annotation.RequestParam; 26 | import org.springframework.web.bind.annotation.RestController; 27 | import org.springframework.web.multipart.MultipartFile; 28 | 29 | import com.annotation.IgnoreAuth; 30 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 31 | import com.entity.ConfigEntity; 32 | import com.entity.EIException; 33 | import com.service.ConfigService; 34 | import com.utils.R; 35 | 36 | /** 37 | * 上传文件映射表 38 | */ 39 | @RestController 40 | @RequestMapping("file") 41 | @SuppressWarnings({"unchecked","rawtypes"}) 42 | public class FileController{ 43 | @Autowired 44 | private ConfigService configService; 45 | /** 46 | * 上传文件 47 | */ 48 | @RequestMapping("/upload") 49 | public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception { 50 | if (file.isEmpty()) { 51 | throw new EIException("上传文件不能为空"); 52 | } 53 | String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1); 54 | File path = new File(ResourceUtils.getURL("classpath:static").getPath()); 55 | if(!path.exists()) { 56 | path = new File(""); 57 | } 58 | File upload = new File(path.getAbsolutePath(),"/upload/"); 59 | if(!upload.exists()) { 60 | upload.mkdirs(); 61 | } 62 | String fileName = new Date().getTime()+"."+fileExt; 63 | File dest = new File(upload.getAbsolutePath()+"/"+fileName); 64 | file.transferTo(dest); 65 | if(StringUtils.isNotBlank(type) && type.equals("1")) { 66 | ConfigEntity configEntity = configService.selectOne(new EntityWrapper().eq("name", "faceFile")); 67 | if(configEntity==null) { 68 | configEntity = new ConfigEntity(); 69 | configEntity.setName("faceFile"); 70 | configEntity.setValue(fileName); 71 | } else { 72 | configEntity.setValue(fileName); 73 | } 74 | configService.insertOrUpdate(configEntity); 75 | } 76 | return R.ok().put("file", fileName); 77 | } 78 | 79 | /** 80 | * 下载文件 81 | */ 82 | @IgnoreAuth 83 | @RequestMapping("/download") 84 | public ResponseEntity download(@RequestParam String fileName) { 85 | try { 86 | File path = new File(ResourceUtils.getURL("classpath:static").getPath()); 87 | if(!path.exists()) { 88 | path = new File(""); 89 | } 90 | File upload = new File(path.getAbsolutePath(),"/upload/"); 91 | if(!upload.exists()) { 92 | upload.mkdirs(); 93 | } 94 | File file = new File(upload.getAbsolutePath()+"/"+fileName); 95 | if(file.exists()){ 96 | /*if(!fileService.canRead(file, SessionManager.getSessionUser())){ 97 | getResponse().sendError(403); 98 | }*/ 99 | HttpHeaders headers = new HttpHeaders(); 100 | headers.setContentType(MediaType.APPLICATION_OCTET_STREAM); 101 | headers.setContentDispositionFormData("attachment", fileName); 102 | return new ResponseEntity(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED); 103 | } 104 | } catch (IOException e) { 105 | e.printStackTrace(); 106 | } 107 | return new ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR); 108 | } 109 | 110 | } 111 | -------------------------------------------------------------------------------- /src/main/java/com/entity/model/ChatModel.java: -------------------------------------------------------------------------------- 1 | package com.entity.model; 2 | 3 | import com.entity.ChatEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import com.fasterxml.jackson.annotation.JsonFormat; 7 | import java.util.Date; 8 | import org.springframework.format.annotation.DateTimeFormat; 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * 反馈信息 14 | * 接收传参的实体类 15 | *(实际开发中配合移动端接口开发手动去掉些没用的字段, 后端一般用entity就够用了) 16 | * 取自ModelAndView 的model名称 17 | */ 18 | public class ChatModel implements Serializable { 19 | private static final long serialVersionUID = 1L; 20 | 21 | 22 | 23 | 24 | /** 25 | * 主键 26 | */ 27 | private Integer id; 28 | 29 | 30 | /** 31 | * 提问用户 32 | */ 33 | private Integer yonghuId; 34 | 35 | 36 | /** 37 | * 问题 38 | */ 39 | private String chatIssue; 40 | 41 | 42 | /** 43 | * 问题时间 44 | */ 45 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 46 | @DateTimeFormat 47 | private Date issueTime; 48 | 49 | 50 | /** 51 | * 回复 52 | */ 53 | private String chatReply; 54 | 55 | 56 | /** 57 | * 回复时间 58 | */ 59 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 60 | @DateTimeFormat 61 | private Date replyTime; 62 | 63 | 64 | /** 65 | * 状态 66 | */ 67 | private Integer zhuangtaiTypes; 68 | 69 | 70 | /** 71 | * 数据类型 72 | */ 73 | private Integer chatTypes; 74 | 75 | 76 | /** 77 | * 创建时间 78 | */ 79 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 80 | @DateTimeFormat 81 | private Date insertTime; 82 | 83 | 84 | /** 85 | * 获取:主键 86 | */ 87 | public Integer getId() { 88 | return id; 89 | } 90 | 91 | 92 | /** 93 | * 设置:主键 94 | */ 95 | public void setId(Integer id) { 96 | this.id = id; 97 | } 98 | /** 99 | * 获取:提问用户 100 | */ 101 | public Integer getYonghuId() { 102 | return yonghuId; 103 | } 104 | 105 | 106 | /** 107 | * 设置:提问用户 108 | */ 109 | public void setYonghuId(Integer yonghuId) { 110 | this.yonghuId = yonghuId; 111 | } 112 | /** 113 | * 获取:问题 114 | */ 115 | public String getChatIssue() { 116 | return chatIssue; 117 | } 118 | 119 | 120 | /** 121 | * 设置:问题 122 | */ 123 | public void setChatIssue(String chatIssue) { 124 | this.chatIssue = chatIssue; 125 | } 126 | /** 127 | * 获取:问题时间 128 | */ 129 | public Date getIssueTime() { 130 | return issueTime; 131 | } 132 | 133 | 134 | /** 135 | * 设置:问题时间 136 | */ 137 | public void setIssueTime(Date issueTime) { 138 | this.issueTime = issueTime; 139 | } 140 | /** 141 | * 获取:回复 142 | */ 143 | public String getChatReply() { 144 | return chatReply; 145 | } 146 | 147 | 148 | /** 149 | * 设置:回复 150 | */ 151 | public void setChatReply(String chatReply) { 152 | this.chatReply = chatReply; 153 | } 154 | /** 155 | * 获取:回复时间 156 | */ 157 | public Date getReplyTime() { 158 | return replyTime; 159 | } 160 | 161 | 162 | /** 163 | * 设置:回复时间 164 | */ 165 | public void setReplyTime(Date replyTime) { 166 | this.replyTime = replyTime; 167 | } 168 | /** 169 | * 获取:状态 170 | */ 171 | public Integer getZhuangtaiTypes() { 172 | return zhuangtaiTypes; 173 | } 174 | 175 | 176 | /** 177 | * 设置:状态 178 | */ 179 | public void setZhuangtaiTypes(Integer zhuangtaiTypes) { 180 | this.zhuangtaiTypes = zhuangtaiTypes; 181 | } 182 | /** 183 | * 获取:数据类型 184 | */ 185 | public Integer getChatTypes() { 186 | return chatTypes; 187 | } 188 | 189 | 190 | /** 191 | * 设置:数据类型 192 | */ 193 | public void setChatTypes(Integer chatTypes) { 194 | this.chatTypes = chatTypes; 195 | } 196 | /** 197 | * 获取:创建时间 198 | */ 199 | public Date getInsertTime() { 200 | return insertTime; 201 | } 202 | 203 | 204 | /** 205 | * 设置:创建时间 206 | */ 207 | public void setInsertTime(Date insertTime) { 208 | this.insertTime = insertTime; 209 | } 210 | 211 | } 212 | -------------------------------------------------------------------------------- /src/main/java/com/entity/model/HuowuModel.java: -------------------------------------------------------------------------------- 1 | package com.entity.model; 2 | 3 | import com.entity.HuowuEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import com.fasterxml.jackson.annotation.JsonFormat; 7 | import java.util.Date; 8 | import org.springframework.format.annotation.DateTimeFormat; 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * 货物 14 | * 接收传参的实体类 15 | *(实际开发中配合移动端接口开发手动去掉些没用的字段, 后端一般用entity就够用了) 16 | * 取自ModelAndView 的model名称 17 | */ 18 | public class HuowuModel implements Serializable { 19 | private static final long serialVersionUID = 1L; 20 | 21 | 22 | 23 | 24 | /** 25 | * 主键 26 | */ 27 | private Integer id; 28 | 29 | 30 | /** 31 | * 商家 32 | */ 33 | private Integer shangpinOrderId; 34 | 35 | 36 | /** 37 | * 货物名称 38 | */ 39 | private String huowuName; 40 | 41 | 42 | /** 43 | * 货物编号 44 | */ 45 | private String huowuUuidNumber; 46 | 47 | 48 | /** 49 | * 货物类型 50 | */ 51 | private Integer huowuTypes; 52 | 53 | 54 | /** 55 | * 货物介绍 56 | */ 57 | private String huowuContent; 58 | 59 | 60 | /** 61 | * 逻辑删除 62 | */ 63 | private Integer huowuDelete; 64 | 65 | 66 | /** 67 | * 录入时间 68 | */ 69 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 70 | @DateTimeFormat 71 | private Date insertTime; 72 | 73 | 74 | /** 75 | * 创建时间 show3 listShow 76 | */ 77 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 78 | @DateTimeFormat 79 | private Date createTime; 80 | 81 | 82 | /** 83 | * 获取:主键 84 | */ 85 | public Integer getId() { 86 | return id; 87 | } 88 | 89 | 90 | /** 91 | * 设置:主键 92 | */ 93 | public void setId(Integer id) { 94 | this.id = id; 95 | } 96 | /** 97 | * 获取:商家 98 | */ 99 | public Integer getShangpinOrderId() { 100 | return shangpinOrderId; 101 | } 102 | 103 | 104 | /** 105 | * 设置:商家 106 | */ 107 | public void setShangpinOrderId(Integer shangpinOrderId) { 108 | this.shangpinOrderId = shangpinOrderId; 109 | } 110 | /** 111 | * 获取:货物名称 112 | */ 113 | public String getHuowuName() { 114 | return huowuName; 115 | } 116 | 117 | 118 | /** 119 | * 设置:货物名称 120 | */ 121 | public void setHuowuName(String huowuName) { 122 | this.huowuName = huowuName; 123 | } 124 | /** 125 | * 获取:货物编号 126 | */ 127 | public String getHuowuUuidNumber() { 128 | return huowuUuidNumber; 129 | } 130 | 131 | 132 | /** 133 | * 设置:货物编号 134 | */ 135 | public void setHuowuUuidNumber(String huowuUuidNumber) { 136 | this.huowuUuidNumber = huowuUuidNumber; 137 | } 138 | /** 139 | * 获取:货物类型 140 | */ 141 | public Integer getHuowuTypes() { 142 | return huowuTypes; 143 | } 144 | 145 | 146 | /** 147 | * 设置:货物类型 148 | */ 149 | public void setHuowuTypes(Integer huowuTypes) { 150 | this.huowuTypes = huowuTypes; 151 | } 152 | /** 153 | * 获取:货物介绍 154 | */ 155 | public String getHuowuContent() { 156 | return huowuContent; 157 | } 158 | 159 | 160 | /** 161 | * 设置:货物介绍 162 | */ 163 | public void setHuowuContent(String huowuContent) { 164 | this.huowuContent = huowuContent; 165 | } 166 | /** 167 | * 获取:逻辑删除 168 | */ 169 | public Integer getHuowuDelete() { 170 | return huowuDelete; 171 | } 172 | 173 | 174 | /** 175 | * 设置:逻辑删除 176 | */ 177 | public void setHuowuDelete(Integer huowuDelete) { 178 | this.huowuDelete = huowuDelete; 179 | } 180 | /** 181 | * 获取:录入时间 182 | */ 183 | public Date getInsertTime() { 184 | return insertTime; 185 | } 186 | 187 | 188 | /** 189 | * 设置:录入时间 190 | */ 191 | public void setInsertTime(Date insertTime) { 192 | this.insertTime = insertTime; 193 | } 194 | /** 195 | * 获取:创建时间 show3 listShow 196 | */ 197 | public Date getCreateTime() { 198 | return createTime; 199 | } 200 | 201 | 202 | /** 203 | * 设置:创建时间 show3 listShow 204 | */ 205 | public void setCreateTime(Date createTime) { 206 | this.createTime = createTime; 207 | } 208 | 209 | } 210 | -------------------------------------------------------------------------------- /src/main/java/com/entity/vo/ShangpinChuruInoutVO.java: -------------------------------------------------------------------------------- 1 | package com.entity.vo; 2 | 3 | import com.entity.ShangpinChuruInoutEntity; 4 | import com.baomidou.mybatisplus.annotations.TableField; 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import com.fasterxml.jackson.annotation.JsonFormat; 7 | import java.util.Date; 8 | import org.springframework.format.annotation.DateTimeFormat; 9 | 10 | import java.io.Serializable; 11 | 12 | /** 13 | * 出入库 14 | * 手机端接口返回实体辅助类 15 | * (主要作用去除一些不必要的字段) 16 | */ 17 | @TableName("shangpin_churu_inout") 18 | public class ShangpinChuruInoutVO implements Serializable { 19 | private static final long serialVersionUID = 1L; 20 | 21 | 22 | /** 23 | * 主键 24 | */ 25 | 26 | @TableField(value = "id") 27 | private Integer id; 28 | 29 | 30 | /** 31 | * 出入库流水号 32 | */ 33 | 34 | @TableField(value = "shangpin_churu_inout_uuid_number") 35 | private String shangpinChuruInoutUuidNumber; 36 | 37 | 38 | /** 39 | * 出入库名称 40 | */ 41 | 42 | @TableField(value = "shangpin_churu_inout_name") 43 | private String shangpinChuruInoutName; 44 | 45 | 46 | /** 47 | * 出入库类型 48 | */ 49 | 50 | @TableField(value = "shangpin_churu_inout_types") 51 | private Integer shangpinChuruInoutTypes; 52 | 53 | 54 | /** 55 | * 备注 56 | */ 57 | 58 | @TableField(value = "shangpin_churu_inout_content") 59 | private String shangpinChuruInoutContent; 60 | 61 | 62 | /** 63 | * 添加时间 64 | */ 65 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 66 | @DateTimeFormat 67 | 68 | @TableField(value = "insert_time") 69 | private Date insertTime; 70 | 71 | 72 | /** 73 | * 创建时间 74 | */ 75 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 76 | @DateTimeFormat 77 | 78 | @TableField(value = "create_time") 79 | private Date createTime; 80 | 81 | 82 | /** 83 | * 设置:主键 84 | */ 85 | public Integer getId() { 86 | return id; 87 | } 88 | 89 | 90 | /** 91 | * 获取:主键 92 | */ 93 | 94 | public void setId(Integer id) { 95 | this.id = id; 96 | } 97 | /** 98 | * 设置:出入库流水号 99 | */ 100 | public String getShangpinChuruInoutUuidNumber() { 101 | return shangpinChuruInoutUuidNumber; 102 | } 103 | 104 | 105 | /** 106 | * 获取:出入库流水号 107 | */ 108 | 109 | public void setShangpinChuruInoutUuidNumber(String shangpinChuruInoutUuidNumber) { 110 | this.shangpinChuruInoutUuidNumber = shangpinChuruInoutUuidNumber; 111 | } 112 | /** 113 | * 设置:出入库名称 114 | */ 115 | public String getShangpinChuruInoutName() { 116 | return shangpinChuruInoutName; 117 | } 118 | 119 | 120 | /** 121 | * 获取:出入库名称 122 | */ 123 | 124 | public void setShangpinChuruInoutName(String shangpinChuruInoutName) { 125 | this.shangpinChuruInoutName = shangpinChuruInoutName; 126 | } 127 | /** 128 | * 设置:出入库类型 129 | */ 130 | public Integer getShangpinChuruInoutTypes() { 131 | return shangpinChuruInoutTypes; 132 | } 133 | 134 | 135 | /** 136 | * 获取:出入库类型 137 | */ 138 | 139 | public void setShangpinChuruInoutTypes(Integer shangpinChuruInoutTypes) { 140 | this.shangpinChuruInoutTypes = shangpinChuruInoutTypes; 141 | } 142 | /** 143 | * 设置:备注 144 | */ 145 | public String getShangpinChuruInoutContent() { 146 | return shangpinChuruInoutContent; 147 | } 148 | 149 | 150 | /** 151 | * 获取:备注 152 | */ 153 | 154 | public void setShangpinChuruInoutContent(String shangpinChuruInoutContent) { 155 | this.shangpinChuruInoutContent = shangpinChuruInoutContent; 156 | } 157 | /** 158 | * 设置:添加时间 159 | */ 160 | public Date getInsertTime() { 161 | return insertTime; 162 | } 163 | 164 | 165 | /** 166 | * 获取:添加时间 167 | */ 168 | 169 | public void setInsertTime(Date insertTime) { 170 | this.insertTime = insertTime; 171 | } 172 | /** 173 | * 设置:创建时间 174 | */ 175 | public Date getCreateTime() { 176 | return createTime; 177 | } 178 | 179 | 180 | /** 181 | * 获取:创建时间 182 | */ 183 | 184 | public void setCreateTime(Date createTime) { 185 | this.createTime = createTime; 186 | } 187 | 188 | } 189 | -------------------------------------------------------------------------------- /src/main/java/com/entity/model/AddressModel.java: -------------------------------------------------------------------------------- 1 | package com.entity.model; 2 | 3 | import com.entity.AddressEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import com.fasterxml.jackson.annotation.JsonFormat; 7 | import java.util.Date; 8 | import org.springframework.format.annotation.DateTimeFormat; 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * 收货地址 14 | * 接收传参的实体类 15 | *(实际开发中配合移动端接口开发手动去掉些没用的字段, 后端一般用entity就够用了) 16 | * 取自ModelAndView 的model名称 17 | */ 18 | public class AddressModel implements Serializable { 19 | private static final long serialVersionUID = 1L; 20 | 21 | 22 | 23 | 24 | /** 25 | * 主键 26 | */ 27 | private Integer id; 28 | 29 | 30 | /** 31 | * 创建用户 32 | */ 33 | private Integer yonghuId; 34 | 35 | 36 | /** 37 | * 收货人 38 | */ 39 | private String addressName; 40 | 41 | 42 | /** 43 | * 电话 44 | */ 45 | private String addressPhone; 46 | 47 | 48 | /** 49 | * 地址 50 | */ 51 | private String addressDizhi; 52 | 53 | 54 | /** 55 | * 是否默认地址 56 | */ 57 | private Integer isdefaultTypes; 58 | 59 | 60 | /** 61 | * 添加时间 62 | */ 63 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 64 | @DateTimeFormat 65 | private Date insertTime; 66 | 67 | 68 | /** 69 | * 修改时间 70 | */ 71 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 72 | @DateTimeFormat 73 | private Date updateTime; 74 | 75 | 76 | /** 77 | * 创建时间 show3 78 | */ 79 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 80 | @DateTimeFormat 81 | private Date createTime; 82 | 83 | 84 | /** 85 | * 获取:主键 86 | */ 87 | public Integer getId() { 88 | return id; 89 | } 90 | 91 | 92 | /** 93 | * 设置:主键 94 | */ 95 | public void setId(Integer id) { 96 | this.id = id; 97 | } 98 | /** 99 | * 获取:创建用户 100 | */ 101 | public Integer getYonghuId() { 102 | return yonghuId; 103 | } 104 | 105 | 106 | /** 107 | * 设置:创建用户 108 | */ 109 | public void setYonghuId(Integer yonghuId) { 110 | this.yonghuId = yonghuId; 111 | } 112 | /** 113 | * 获取:收货人 114 | */ 115 | public String getAddressName() { 116 | return addressName; 117 | } 118 | 119 | 120 | /** 121 | * 设置:收货人 122 | */ 123 | public void setAddressName(String addressName) { 124 | this.addressName = addressName; 125 | } 126 | /** 127 | * 获取:电话 128 | */ 129 | public String getAddressPhone() { 130 | return addressPhone; 131 | } 132 | 133 | 134 | /** 135 | * 设置:电话 136 | */ 137 | public void setAddressPhone(String addressPhone) { 138 | this.addressPhone = addressPhone; 139 | } 140 | /** 141 | * 获取:地址 142 | */ 143 | public String getAddressDizhi() { 144 | return addressDizhi; 145 | } 146 | 147 | 148 | /** 149 | * 设置:地址 150 | */ 151 | public void setAddressDizhi(String addressDizhi) { 152 | this.addressDizhi = addressDizhi; 153 | } 154 | /** 155 | * 获取:是否默认地址 156 | */ 157 | public Integer getIsdefaultTypes() { 158 | return isdefaultTypes; 159 | } 160 | 161 | 162 | /** 163 | * 设置:是否默认地址 164 | */ 165 | public void setIsdefaultTypes(Integer isdefaultTypes) { 166 | this.isdefaultTypes = isdefaultTypes; 167 | } 168 | /** 169 | * 获取:添加时间 170 | */ 171 | public Date getInsertTime() { 172 | return insertTime; 173 | } 174 | 175 | 176 | /** 177 | * 设置:添加时间 178 | */ 179 | public void setInsertTime(Date insertTime) { 180 | this.insertTime = insertTime; 181 | } 182 | /** 183 | * 获取:修改时间 184 | */ 185 | public Date getUpdateTime() { 186 | return updateTime; 187 | } 188 | 189 | 190 | /** 191 | * 设置:修改时间 192 | */ 193 | public void setUpdateTime(Date updateTime) { 194 | this.updateTime = updateTime; 195 | } 196 | /** 197 | * 获取:创建时间 show3 198 | */ 199 | public Date getCreateTime() { 200 | return createTime; 201 | } 202 | 203 | 204 | /** 205 | * 设置:创建时间 show3 206 | */ 207 | public void setCreateTime(Date createTime) { 208 | this.createTime = createTime; 209 | } 210 | 211 | } 212 | -------------------------------------------------------------------------------- /src/main/java/com/entity/vo/SijiVO.java: -------------------------------------------------------------------------------- 1 | package com.entity.vo; 2 | 3 | import com.entity.SijiEntity; 4 | import com.baomidou.mybatisplus.annotations.TableField; 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import com.fasterxml.jackson.annotation.JsonFormat; 7 | import java.util.Date; 8 | import org.springframework.format.annotation.DateTimeFormat; 9 | 10 | import java.io.Serializable; 11 | 12 | /** 13 | * 司机 14 | * 手机端接口返回实体辅助类 15 | * (主要作用去除一些不必要的字段) 16 | */ 17 | @TableName("siji") 18 | public class SijiVO implements Serializable { 19 | private static final long serialVersionUID = 1L; 20 | 21 | 22 | /** 23 | * 主键 24 | */ 25 | 26 | @TableField(value = "id") 27 | private Integer id; 28 | 29 | 30 | /** 31 | * 司机编号 32 | */ 33 | 34 | @TableField(value = "siji_uuid_number") 35 | private String sijiUuidNumber; 36 | 37 | 38 | /** 39 | * 司机姓名 40 | */ 41 | 42 | @TableField(value = "siji_name") 43 | private String sijiName; 44 | 45 | 46 | /** 47 | * 司机手机号 48 | */ 49 | 50 | @TableField(value = "siji_phone") 51 | private String sijiPhone; 52 | 53 | 54 | /** 55 | * 司机身份证号 56 | */ 57 | 58 | @TableField(value = "siji_id_number") 59 | private String sijiIdNumber; 60 | 61 | 62 | /** 63 | * 司机头像 64 | */ 65 | 66 | @TableField(value = "siji_photo") 67 | private String sijiPhoto; 68 | 69 | 70 | /** 71 | * 性别 72 | */ 73 | 74 | @TableField(value = "sex_types") 75 | private Integer sexTypes; 76 | 77 | 78 | /** 79 | * 司机邮箱 80 | */ 81 | 82 | @TableField(value = "siji_email") 83 | private String sijiEmail; 84 | 85 | 86 | /** 87 | * 创建时间 88 | */ 89 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 90 | @DateTimeFormat 91 | 92 | @TableField(value = "create_time") 93 | private Date createTime; 94 | 95 | 96 | /** 97 | * 设置:主键 98 | */ 99 | public Integer getId() { 100 | return id; 101 | } 102 | 103 | 104 | /** 105 | * 获取:主键 106 | */ 107 | 108 | public void setId(Integer id) { 109 | this.id = id; 110 | } 111 | /** 112 | * 设置:司机编号 113 | */ 114 | public String getSijiUuidNumber() { 115 | return sijiUuidNumber; 116 | } 117 | 118 | 119 | /** 120 | * 获取:司机编号 121 | */ 122 | 123 | public void setSijiUuidNumber(String sijiUuidNumber) { 124 | this.sijiUuidNumber = sijiUuidNumber; 125 | } 126 | /** 127 | * 设置:司机姓名 128 | */ 129 | public String getSijiName() { 130 | return sijiName; 131 | } 132 | 133 | 134 | /** 135 | * 获取:司机姓名 136 | */ 137 | 138 | public void setSijiName(String sijiName) { 139 | this.sijiName = sijiName; 140 | } 141 | /** 142 | * 设置:司机手机号 143 | */ 144 | public String getSijiPhone() { 145 | return sijiPhone; 146 | } 147 | 148 | 149 | /** 150 | * 获取:司机手机号 151 | */ 152 | 153 | public void setSijiPhone(String sijiPhone) { 154 | this.sijiPhone = sijiPhone; 155 | } 156 | /** 157 | * 设置:司机身份证号 158 | */ 159 | public String getSijiIdNumber() { 160 | return sijiIdNumber; 161 | } 162 | 163 | 164 | /** 165 | * 获取:司机身份证号 166 | */ 167 | 168 | public void setSijiIdNumber(String sijiIdNumber) { 169 | this.sijiIdNumber = sijiIdNumber; 170 | } 171 | /** 172 | * 设置:司机头像 173 | */ 174 | public String getSijiPhoto() { 175 | return sijiPhoto; 176 | } 177 | 178 | 179 | /** 180 | * 获取:司机头像 181 | */ 182 | 183 | public void setSijiPhoto(String sijiPhoto) { 184 | this.sijiPhoto = sijiPhoto; 185 | } 186 | /** 187 | * 设置:性别 188 | */ 189 | public Integer getSexTypes() { 190 | return sexTypes; 191 | } 192 | 193 | 194 | /** 195 | * 获取:性别 196 | */ 197 | 198 | public void setSexTypes(Integer sexTypes) { 199 | this.sexTypes = sexTypes; 200 | } 201 | /** 202 | * 设置:司机邮箱 203 | */ 204 | public String getSijiEmail() { 205 | return sijiEmail; 206 | } 207 | 208 | 209 | /** 210 | * 获取:司机邮箱 211 | */ 212 | 213 | public void setSijiEmail(String sijiEmail) { 214 | this.sijiEmail = sijiEmail; 215 | } 216 | /** 217 | * 设置:创建时间 218 | */ 219 | public Date getCreateTime() { 220 | return createTime; 221 | } 222 | 223 | 224 | /** 225 | * 获取:创建时间 226 | */ 227 | 228 | public void setCreateTime(Date createTime) { 229 | this.createTime = createTime; 230 | } 231 | 232 | } 233 | --------------------------------------------------------------------------------