├── .gitignore
├── README.md
├── deployment.sh
├── document
├── images
│ ├── 1.PNG
│ ├── 2.PNG
│ ├── 3.PNG
│ ├── 4.PNG
│ └── logo.png
└── xinguan.sql
├── pom.xml
├── xinguan-business
├── pom.xml
├── src
│ └── main
│ │ └── java
│ │ └── com
│ │ └── coderman
│ │ └── business
│ │ ├── converter
│ │ ├── ConsumerConverter.java
│ │ ├── InStockConverter.java
│ │ ├── OutStockConverter.java
│ │ ├── ProductCategoryConverter.java
│ │ ├── ProductConverter.java
│ │ └── SupplierConverter.java
│ │ ├── mapper
│ │ ├── ConsumerMapper.java
│ │ ├── HealthMapper.java
│ │ ├── InStockInfoMapper.java
│ │ ├── InStockMapper.java
│ │ ├── OutStockInfoMapper.java
│ │ ├── OutStockMapper.java
│ │ ├── ProductCategoryMapper.java
│ │ ├── ProductMapper.java
│ │ ├── ProductStockMapper.java
│ │ └── SupplierMapper.java
│ │ └── service
│ │ ├── ConsumerService.java
│ │ ├── HealthService.java
│ │ ├── InStockService.java
│ │ ├── OutStockService.java
│ │ ├── ProductCategoryService.java
│ │ ├── ProductService.java
│ │ ├── SupplierService.java
│ │ └── imp
│ │ ├── ConsumerServiceImpl.java
│ │ ├── HealthServiceImpl.java
│ │ ├── InStockServiceImpl.java
│ │ ├── OutStockServiceImpl.java
│ │ ├── ProductCategoryServiceImpl.java
│ │ ├── ProductServiceImpl.java
│ │ └── SupplierServiceImpl.java
└── xinguan-business.iml
├── xinguan-common
├── pom.xml
├── src
│ └── main
│ │ ├── java
│ │ └── com
│ │ │ └── coderman
│ │ │ └── common
│ │ │ ├── annotation
│ │ │ └── ControllerEndpoint.java
│ │ │ ├── dto
│ │ │ └── UserLoginDTO.java
│ │ │ ├── enums
│ │ │ ├── buisiness
│ │ │ │ └── BizUserTypeEnum.java
│ │ │ └── system
│ │ │ │ ├── RoleStatusEnum.java
│ │ │ │ ├── UserStatusEnum.java
│ │ │ │ └── UserTypeEnum.java
│ │ │ ├── error
│ │ │ ├── BaseError.java
│ │ │ ├── BusinessCodeEnum.java
│ │ │ ├── BusinessException.java
│ │ │ ├── SystemCodeEnum.java
│ │ │ └── SystemException.java
│ │ │ ├── model
│ │ │ ├── business
│ │ │ │ ├── Consumer.java
│ │ │ │ ├── Health.java
│ │ │ │ ├── InStock.java
│ │ │ │ ├── InStockInfo.java
│ │ │ │ ├── OutStock.java
│ │ │ │ ├── OutStockInfo.java
│ │ │ │ ├── Product.java
│ │ │ │ ├── ProductCategory.java
│ │ │ │ ├── ProductStock.java
│ │ │ │ └── Supplier.java
│ │ │ └── system
│ │ │ │ ├── Department.java
│ │ │ │ ├── ImageAttachment.java
│ │ │ │ ├── Log.java
│ │ │ │ ├── LoginLog.java
│ │ │ │ ├── Menu.java
│ │ │ │ ├── Role.java
│ │ │ │ ├── RoleMenu.java
│ │ │ │ ├── User.java
│ │ │ │ └── UserRole.java
│ │ │ ├── response
│ │ │ ├── ActiveUser.java
│ │ │ └── ResponseBean.java
│ │ │ ├── utils
│ │ │ ├── AddressUtil.java
│ │ │ ├── BrowserUtil.java
│ │ │ ├── CategoryTreeBuilder.java
│ │ │ ├── CreateVerifyCode.java
│ │ │ ├── FdfsUtil.java
│ │ │ ├── IPUtil.java
│ │ │ ├── JWTUtils.java
│ │ │ ├── ListPageUtils.java
│ │ │ └── MenuTreeBuilder.java
│ │ │ └── vo
│ │ │ ├── business
│ │ │ ├── ConsumerVO.java
│ │ │ ├── HealthVO.java
│ │ │ ├── InStockDetailVO.java
│ │ │ ├── InStockItemVO.java
│ │ │ ├── InStockVO.java
│ │ │ ├── MusicVO.java
│ │ │ ├── OutStockDetailVO.java
│ │ │ ├── OutStockItemVO.java
│ │ │ ├── OutStockVO.java
│ │ │ ├── ProductCategoryTreeNodeVO.java
│ │ │ ├── ProductCategoryVO.java
│ │ │ ├── ProductStockVO.java
│ │ │ ├── ProductVO.java
│ │ │ └── SupplierVO.java
│ │ │ └── system
│ │ │ ├── DeanVO.java
│ │ │ ├── DepartmentVO.java
│ │ │ ├── ImageAttachmentVO.java
│ │ │ ├── LogVO.java
│ │ │ ├── LoginLogVO.java
│ │ │ ├── MenuNodeVO.java
│ │ │ ├── MenuVO.java
│ │ │ ├── PageVO.java
│ │ │ ├── RoleTransferItemVO.java
│ │ │ ├── RoleVO.java
│ │ │ ├── UserEditVO.java
│ │ │ ├── UserInfoVO.java
│ │ │ └── UserVO.java
│ │ └── resources
│ │ └── ip2region
│ │ └── ip2region.db
└── xinguan-common.iml
├── xinguan-generator
├── pom.xml
└── src
│ └── main
│ ├── java
│ └── com
│ │ └── coderman
│ │ └── generator
│ │ └── MybatisGenerator.java
│ └── resources
│ └── mybatis-generator.xml
├── xinguan-system
├── pom.xml
├── src
│ └── main
│ │ └── java
│ │ └── com
│ │ └── coderman
│ │ └── system
│ │ ├── aspect
│ │ ├── AspectSupport.java
│ │ └── ControllerEndpointAspect.java
│ │ ├── converter
│ │ ├── DepartmentConverter.java
│ │ ├── MenuConverter.java
│ │ ├── RoleConverter.java
│ │ └── UserConverter.java
│ │ ├── mapper
│ │ ├── DepartmentMapper.java
│ │ ├── ImageAttachmentMapper.java
│ │ ├── LogMapper.java
│ │ ├── LoginLogMapper.java
│ │ ├── MenuMapper.java
│ │ ├── RoleMapper.java
│ │ ├── RoleMenuMapper.java
│ │ ├── UserMapper.java
│ │ └── UserRoleMapper.java
│ │ ├── service
│ │ ├── DepartmentService.java
│ │ ├── LogService.java
│ │ ├── LoginLogService.java
│ │ ├── MenuService.java
│ │ ├── RoleService.java
│ │ ├── UploadService.java
│ │ ├── UserService.java
│ │ └── impl
│ │ │ ├── DepartmentServiceImpl.java
│ │ │ ├── LogServiceImpl.java
│ │ │ ├── LoginLogServiceImpl.java
│ │ │ ├── MenuServiceImpl.java
│ │ │ ├── RoleServiceImpl.java
│ │ │ ├── UploadServiceImpl.java
│ │ │ └── UserServiceImpl.java
│ │ ├── shiro
│ │ ├── JWTFilter.java
│ │ ├── JWTToken.java
│ │ ├── ShiroConfig.java
│ │ └── UserRealm.java
│ │ └── util
│ │ └── MD5Utils.java
└── xinguan-system.iml
└── xinguan-web
├── pom.xml
├── src
└── main
│ ├── java
│ └── com
│ │ └── coderman
│ │ ├── XinguanApplication.java
│ │ ├── config
│ │ ├── FdfsConfig.java
│ │ ├── FdfsConfiguration.java
│ │ ├── MyMebMvcConfigurer.java
│ │ └── SwaggerConfig.java
│ │ └── controller
│ │ ├── business
│ │ ├── ConsumerController.java
│ │ ├── HealthController.java
│ │ ├── InStockController.java
│ │ ├── OutStockController.java
│ │ ├── ProductCategoryController.java
│ │ ├── ProductController.java
│ │ └── SupplierController.java
│ │ └── system
│ │ ├── DepartmentController.java
│ │ ├── LogController.java
│ │ ├── LoginLogController.java
│ │ ├── MenuController.java
│ │ ├── RoleController.java
│ │ ├── UploadController.java
│ │ └── UserController.java
│ └── resources
│ ├── 3828034_www.zykhome.club.pfx
│ ├── application-dev.yml
│ ├── application-prod.yml
│ ├── application.yml
│ ├── mapper
│ ├── biz
│ │ └── ProductStockMapper.xml
│ └── system
│ │ └── LoginLogExtMapper.xml
│ ├── pfx-password.txt
│ └── static
│ └── json
│ └── provinces.json
└── xinguan-web.iml
/.gitignore:
--------------------------------------------------------------------------------
1 | xinguan-vue/
2 | .idea
3 | *.iml
4 | target
5 |
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |

2 | xinguan 🚀 新冠-物资管理系统
3 | 2020新冠疫情期间, 寂寞消遣之作~
4 |
5 |
6 |
7 | ---
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | ---
21 |
22 | >该项目是一个以新冠疫情为主题开发的一个物资管理系统,主要分为系统模块和业务模块,业务模块是处理疫情期间,物资的发放,物资入库,以及查看物资的库存等.
23 | 系统模块是一个后台通用的RBAC权限模块,可以精确的控制到后台API级别的权限控制,项目不定期更新中.武汉加油~~
24 | 开发模式:前后端分离,前端负责数据渲染,后端返回数据。
25 |
26 |
27 | ### [在线预览](https://www.zykhome.club/#/login "在线预览") & [后端项目](https://github.com/zykzhangyukang/Xinguan "后端项目") & [前端项目](https://github.com/zykzhangyukang/xinguan-vue "前端项目")
28 |
29 | #### 模块划分
30 |
31 | - xinguan-business: 业务模块,所有与业务相关的代码放在此工程中。
32 | - xinguan-system: 系统模块,权限控制相关的代码放在此工程中。
33 | - xinguan-common: 公共模块,存放工具类、领域模型(DTO)、数据模型对象(DO)一些通用的类。
34 | - xinguan-generator: 代码生成器,生成Controller,Service,ServiceImpl,以及前端代码。
35 | - xinguan-vue: 前端项目, npm install 安装依赖后, npm run serve 启动该项目。
36 | - xinguan-web: 处理前端请求的Controller,放在此工程中。
37 |
38 | #### 技术栈
39 |
40 | SpringBoot, Shiro ,Swagger-UI,mybatis,JWT,Mysql,通用mapper,Vue.js+element-ui,FastDFS,Nginx,Node.js(v12.9.1版本)
41 |
42 | #### 演示页面
43 |
44 |
45 | - 后台系统首页
46 |
47 | 
48 |
49 |
50 | - 附件管理
51 |
52 | 
53 |
54 | - 物资库存管理
55 |
56 | 
57 |
58 | - 物资入库管理
59 |
60 | 
61 |
62 | ### 打赏作者
63 |
64 | > 一分一毛也是爱,用于服务器维护. 欢迎大家提意哦见~
65 |
66 |
67 | 
68 |
69 |
70 | ### QQ交流群: 830790908
71 |
72 |
73 |
--------------------------------------------------------------------------------
/deployment.sh:
--------------------------------------------------------------------------------
1 | #打包完后的jar名称,替换成你自己项目的名称,该名称可以在maven项目的pom中配置
2 | proc="xinguan-web-0.0.1-SNAPSHOT.jar"
3 | #项目源码的目录地址(初始可能需要自己从Git拉下来)
4 | SOURCE_HOME="/root/application/xinguan-api/xinguan-web"
5 | #项目父工程的目录地址
6 | PARENT_HOME="/root/application/xinguan-api"
7 | #日志地址
8 | APP_LOG="$SOURCE_HOME/target/log_info.log"
9 | #环境配置 用户配置开发(dev),测试(test),生产(prod)的配置文件,避免频繁改动
10 | PROFILES_ACTIVE="spring.profiles.active=prod"
11 |
12 | #JVM启动参数,关于JVM调优这里不介绍,感兴趣的可以自行百度 JVM调优
13 | JAVA_OPTS="-server -Xms512M -Xmx512M -Xss256k -Xmn256m -XX:SurvivorRatio=4 -XX:+AggressiveOpts -XX:+UseBiasedLocking -XX:MetaspaceSize=128M -XX:MaxMetaspaceSize=256M -XX:CMSInitiatingOccupancyFraction=90 -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:+DisableExplicitGC -XX:MaxTenuringThreshold=0 -XX:CMSFullGCsBeforeCompaction=100 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -Djava.awt.headless=true"
14 |
15 | psid=0
16 |
17 | #检查进程是否存在
18 | checkpid() {
19 | javaps=$(pgrep -f "$proc")
20 | if [ -n "$javaps" ]; then
21 | psid=$javaps
22 | else
23 | psid=0
24 | fi
25 | }
26 |
27 |
28 | #编写启动方法
29 | start() {
30 | checkpid
31 |
32 | if [ $psid -ne 0 ]; then
33 | echo "================================"
34 | echo "warn: $proc already started! (pid=$psid)"
35 | echo "================================"
36 | else
37 | echo "Starting $proc ..."
38 | #到项目源码目录
39 | cd $SOURCE_HOME
40 | #输出,准备获取最新代码
41 | echo -n "git pull source ,please wait ....."
42 | #获取最新代码,此列只在目录所在分支pull
43 | #若想部署指定分支代码,可以在脚本调用参数中添加一个变量,用git checkout ${targer_branch}
44 | git pull
45 |
46 | #输出,最新代码已拉取完毕,准备打包
47 | echo -n "mvn package source ,please wait ....."
48 |
49 | #maven打包命令,此处特别注意是 —U ,是指引用快照版本的jar(引用自己的项目)每次都更新最新的。
50 | cd $PARENT_HOME
51 | echo "======================================进入父工程中打包============================================"
52 | mvn clean package -Dmaven.test.skip=true
53 | echo "======================================项目打包完成================================================"
54 | #打包成功后默认是在父工程中
55 | #到项目源码目录
56 | cd $SOURCE_HOME
57 | cd target
58 | #输出,准备启动
59 | echo -n $"Starting $proc:"
60 |
61 | #循环加载所需的jar,此处和2的pom配置有关
62 | for name in *.jar
63 | do
64 | APP_CLASS="$name"
65 | done
66 |
67 | #启动脚本,--spring.profiles.active= 用于设置环境所使用的配置文件
68 | JAVA_CMD="java "$JAVA_OPTS" -jar "$APP_CLASS" --"$PROFILES_ACTIVE" &"
69 | #后台运行
70 |
71 | $JAVA_CMD &
72 | sleep 1
73 | checkpid
74 | if [ $psid -ne 0 ]; then
75 | echo "======================================"
76 | echo "$proc Start Success! (pid=$psid)[OK]"
77 | echo "======================================"
78 | else
79 | echo "[Failed]"
80 | fi
81 | fi
82 |
83 | }
84 |
85 |
86 | #查看日志
87 | showlog() {
88 | tail -f $APP_LOG
89 | }
90 |
91 |
92 |
93 | #停用项目
94 | stop() {
95 | checkpid
96 |
97 | if [ $psid -ne 0 ]; then
98 | echo -n "Stopping $proc ...(pid=$psid) "
99 | kill -9 $psid
100 |
101 | if [ $? -eq 0 ]; then
102 | echo "[OK]"
103 | else
104 | echo "[Failed]"
105 | fi
106 |
107 | checkpid
108 | if [ $psid -ne 0 ]; then
109 | stop
110 | fi
111 | else
112 | echo "================================"
113 | echo "warn: $proc is not running"
114 | echo "================================"
115 | fi
116 | }
117 |
118 |
119 | #项目状态
120 | status() {
121 | checkpid
122 | if [ $psid -ne 0 ]; then
123 | echo "$proc is running! (pid=$psid)"
124 | else
125 | echo "$proc is not running"
126 | fi
127 | }
128 |
129 |
130 | #设置脚本参数,启动的时候可以采用./脚本名称.sh start/stop/restart/log/status等参数
131 | case "$1" in
132 | start)
133 | start
134 | ;;
135 | stop)
136 | stop
137 | ;;
138 | log)
139 | showlog
140 | ;;
141 | status)
142 | status
143 | ;;
144 | restart)
145 | stop
146 | start
147 | ;;
148 | esac
149 |
--------------------------------------------------------------------------------
/document/images/1.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zykzhangyukang/Xinguan/4801196cf569f09ed93bb4b6d344351f2225b38e/document/images/1.PNG
--------------------------------------------------------------------------------
/document/images/2.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zykzhangyukang/Xinguan/4801196cf569f09ed93bb4b6d344351f2225b38e/document/images/2.PNG
--------------------------------------------------------------------------------
/document/images/3.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zykzhangyukang/Xinguan/4801196cf569f09ed93bb4b6d344351f2225b38e/document/images/3.PNG
--------------------------------------------------------------------------------
/document/images/4.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zykzhangyukang/Xinguan/4801196cf569f09ed93bb4b6d344351f2225b38e/document/images/4.PNG
--------------------------------------------------------------------------------
/document/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zykzhangyukang/Xinguan/4801196cf569f09ed93bb4b6d344351f2225b38e/document/images/logo.png
--------------------------------------------------------------------------------
/xinguan-business/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | goods
7 | com.coderman
8 | 0.0.1-SNAPSHOT
9 |
10 | jar
11 | 4.0.0
12 |
13 | xinguan-business
14 |
15 |
16 |
17 |
18 | org.apache.shiro
19 | shiro-spring
20 |
21 |
22 | com.coderman
23 | xinguan-common
24 | 0.0.1-SNAPSHOT
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/xinguan-business/src/main/java/com/coderman/business/converter/ConsumerConverter.java:
--------------------------------------------------------------------------------
1 | package com.coderman.business.converter;
2 |
3 |
4 | import com.coderman.common.model.business.Consumer;
5 | import com.coderman.common.vo.business.ConsumerVO;
6 | import org.springframework.beans.BeanUtils;
7 | import org.springframework.util.CollectionUtils;
8 |
9 | import java.util.ArrayList;
10 | import java.util.List;
11 |
12 | /**
13 | * @Author zhangyukang
14 | * @Date 2020/3/16 20:27
15 | * @Version 1.0
16 | **/
17 | public class ConsumerConverter {
18 |
19 | /**
20 | * 转voList
21 | * @param consumers
22 | * @return
23 | */
24 | public static List converterToVOList(List consumers) {
25 | List supplierVOS=new ArrayList<>();
26 | if(!CollectionUtils.isEmpty(consumers)){
27 | for (Consumer supplier : consumers) {
28 | ConsumerVO supplierVO = converterToConsumerVO(supplier);
29 | supplierVOS.add(supplierVO);
30 | }
31 | }
32 | return supplierVOS;
33 | }
34 |
35 |
36 | /***
37 | * 转VO
38 | * @param supplier
39 | * @return
40 | */
41 | public static ConsumerVO converterToConsumerVO(Consumer supplier) {
42 | ConsumerVO supplierVO = new ConsumerVO();
43 | BeanUtils.copyProperties(supplier,supplierVO);
44 | return supplierVO;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/xinguan-business/src/main/java/com/coderman/business/converter/InStockConverter.java:
--------------------------------------------------------------------------------
1 | package com.coderman.business.converter;
2 |
3 | import com.coderman.business.mapper.SupplierMapper;
4 | import com.coderman.common.model.business.InStock;
5 | import com.coderman.common.model.business.Supplier;
6 | import com.coderman.common.vo.business.InStockVO;
7 | import org.springframework.beans.BeanUtils;
8 | import org.springframework.beans.factory.annotation.Autowired;
9 | import org.springframework.stereotype.Component;
10 | import org.springframework.util.CollectionUtils;
11 |
12 | import java.util.ArrayList;
13 | import java.util.List;
14 |
15 | /**
16 | * @Author zhangyukang
17 | * @Date 2020/3/19 09:58
18 | * @Version 1.0
19 | **/
20 | @Component
21 | public class InStockConverter {
22 |
23 | @Autowired
24 | private SupplierMapper supplierMapper;
25 |
26 | /**
27 | * 转voList
28 | * @param inStocks
29 | * @return
30 | */
31 | public List converterToVOList(List inStocks) {
32 | List inStockVOS=new ArrayList<>();
33 | if(!CollectionUtils.isEmpty(inStocks)){
34 | for (InStock inStock : inStocks) {
35 | InStockVO inStockVO = new InStockVO();
36 | BeanUtils.copyProperties(inStock,inStockVO);
37 | Supplier supplier = supplierMapper.selectByPrimaryKey(inStock.getSupplierId());
38 | if(supplier!=null){
39 | inStockVO.setSupplierName(supplier.getName());
40 | inStockVO.setPhone(supplier.getPhone());
41 | }
42 | inStockVOS.add(inStockVO);
43 | }
44 | }
45 | return inStockVOS;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/xinguan-business/src/main/java/com/coderman/business/converter/OutStockConverter.java:
--------------------------------------------------------------------------------
1 | package com.coderman.business.converter;
2 |
3 | import com.coderman.business.mapper.ConsumerMapper;
4 | import com.coderman.common.model.business.Consumer;
5 | import com.coderman.common.model.business.OutStock;
6 | import com.coderman.common.vo.business.OutStockVO;
7 | import org.springframework.beans.BeanUtils;
8 | import org.springframework.beans.factory.annotation.Autowired;
9 | import org.springframework.stereotype.Component;
10 | import org.springframework.util.CollectionUtils;
11 |
12 | import java.util.ArrayList;
13 | import java.util.List;
14 |
15 | /**
16 | * @Author zhangyukang
17 | * @Date 2020/5/10 14:32
18 | * @Version 1.0
19 | **/
20 | @Component
21 | public class OutStockConverter {
22 |
23 | @Autowired
24 | private ConsumerMapper consumerMapper;
25 |
26 | /**
27 | * 转voList
28 | * @param outStocks
29 | * @return
30 | */
31 | public List converterToVOList(List outStocks) {
32 | List outStockVOS=new ArrayList<>();
33 | if(!CollectionUtils.isEmpty(outStocks)){
34 | for (OutStock outStock : outStocks) {
35 | OutStockVO outStockVO = new OutStockVO();
36 | BeanUtils.copyProperties(outStock,outStockVO);
37 | Consumer consumer = consumerMapper.selectByPrimaryKey(outStock.getConsumerId());
38 | if(consumer!=null){
39 | outStockVO.setName(consumer.getName());
40 | outStockVO.setPhone(consumer.getPhone());
41 | }
42 | outStockVOS.add(outStockVO);
43 | }
44 | }
45 | return outStockVOS;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/xinguan-business/src/main/java/com/coderman/business/converter/ProductCategoryConverter.java:
--------------------------------------------------------------------------------
1 | package com.coderman.business.converter;
2 |
3 | import com.coderman.common.model.business.ProductCategory;
4 | import com.coderman.common.vo.business.ProductCategoryTreeNodeVO;
5 | import com.coderman.common.vo.business.ProductCategoryVO;
6 | import org.springframework.beans.BeanUtils;
7 | import org.springframework.util.CollectionUtils;
8 |
9 | import java.util.ArrayList;
10 | import java.util.List;
11 |
12 | /**
13 | * @Author zhangyukang
14 | * @Date 2020/3/16 17:26
15 | * @Version 1.0
16 | **/
17 | public class ProductCategoryConverter {
18 |
19 | /**
20 | * 转vo
21 | * @param productCategory
22 | * @return
23 | */
24 | public static ProductCategoryVO converterToProductCategoryVO(ProductCategory productCategory) {
25 | ProductCategoryVO productCategoryVO = new ProductCategoryVO();
26 | BeanUtils.copyProperties(productCategory,productCategoryVO);
27 | return productCategoryVO;
28 | }
29 |
30 | /**
31 | * 转voList
32 | * @param productCategories
33 | * @return
34 | */
35 | public static List converterToVOList(List productCategories) {
36 | List productCategoryVOS=new ArrayList<>();
37 | if(!CollectionUtils.isEmpty(productCategories)){
38 | for (ProductCategory productCategory : productCategories) {
39 | ProductCategoryVO productCategoryVO = new ProductCategoryVO();
40 | BeanUtils.copyProperties(productCategory,productCategoryVO);
41 | productCategoryVOS.add(productCategoryVO);
42 | }
43 | }
44 | return productCategoryVOS;
45 | }
46 |
47 | /**
48 | * 转树节点
49 | * @param productCategoryVOList
50 | * @return
51 | */
52 | public static List converterToTreeNodeVO(List productCategoryVOList) {
53 | List nodes=new ArrayList<>();
54 | if(!CollectionUtils.isEmpty(productCategoryVOList)){
55 | for (ProductCategoryVO productCategoryVO : productCategoryVOList) {
56 | ProductCategoryTreeNodeVO productCategoryTreeNodeVO = new ProductCategoryTreeNodeVO();
57 | BeanUtils.copyProperties(productCategoryVO,productCategoryTreeNodeVO);
58 | nodes.add(productCategoryTreeNodeVO);
59 | }
60 | }
61 | return nodes;
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/xinguan-business/src/main/java/com/coderman/business/converter/ProductConverter.java:
--------------------------------------------------------------------------------
1 | package com.coderman.business.converter;
2 |
3 | import com.coderman.common.model.business.Product;
4 | import com.coderman.common.vo.business.ProductVO;
5 | import org.springframework.beans.BeanUtils;
6 | import org.springframework.util.CollectionUtils;
7 |
8 | import java.util.ArrayList;
9 | import java.util.List;
10 |
11 | /**
12 | * @Author zhangyukang
13 | * @Date 2020/3/17 09:22
14 | * @Version 1.0
15 | **/
16 | public class ProductConverter {
17 |
18 |
19 | /**
20 | * 转VOList
21 | * @param products
22 | * @return
23 | */
24 | public static List converterToVOList(List products) {
25 | List productVOS=new ArrayList<>();
26 | if(!CollectionUtils.isEmpty(products)){
27 | for (Product product : products) {
28 | ProductVO productVO = converterToProductVO(product);
29 | productVOS.add(productVO);
30 | }
31 | }
32 | return productVOS;
33 | }
34 |
35 | /**
36 | * 转VO
37 | * @param product
38 | * @return
39 | */
40 | public static ProductVO converterToProductVO(Product product) {
41 | ProductVO productVO = new ProductVO();
42 | BeanUtils.copyProperties(product,productVO);
43 | return productVO;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/xinguan-business/src/main/java/com/coderman/business/converter/SupplierConverter.java:
--------------------------------------------------------------------------------
1 | package com.coderman.business.converter;
2 |
3 | import com.coderman.common.model.business.Supplier;
4 | import com.coderman.common.vo.business.SupplierVO;
5 | import org.springframework.beans.BeanUtils;
6 | import org.springframework.util.CollectionUtils;
7 |
8 | import java.util.ArrayList;
9 | import java.util.List;
10 |
11 | /**
12 | * @Author zhangyukang
13 | * @Date 2020/3/16 20:27
14 | * @Version 1.0
15 | **/
16 | public class SupplierConverter {
17 |
18 | /**
19 | * 转voList
20 | * @param suppliers
21 | * @return
22 | */
23 | public static List converterToVOList(List suppliers) {
24 | List supplierVOS=new ArrayList<>();
25 | if(!CollectionUtils.isEmpty(suppliers)){
26 | for (Supplier supplier : suppliers) {
27 | SupplierVO supplierVO = converterToSupplierVO(supplier);
28 | supplierVOS.add(supplierVO);
29 | }
30 | }
31 | return supplierVOS;
32 | }
33 |
34 |
35 | /***
36 | * 转VO
37 | * @param supplier
38 | * @return
39 | */
40 | public static SupplierVO converterToSupplierVO(Supplier supplier) {
41 | SupplierVO supplierVO = new SupplierVO();
42 | BeanUtils.copyProperties(supplier,supplierVO);
43 | return supplierVO;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/xinguan-business/src/main/java/com/coderman/business/mapper/ConsumerMapper.java:
--------------------------------------------------------------------------------
1 | package com.coderman.business.mapper;
2 |
3 |
4 | import com.coderman.common.model.business.Consumer;
5 | import tk.mybatis.mapper.common.Mapper;
6 |
7 | /**
8 | * @Author zhangyukang
9 | * @Date 2020/4/5 09:55
10 | * @Version 1.0
11 | **/
12 | public interface ConsumerMapper extends Mapper {
13 | }
14 |
--------------------------------------------------------------------------------
/xinguan-business/src/main/java/com/coderman/business/mapper/HealthMapper.java:
--------------------------------------------------------------------------------
1 | package com.coderman.business.mapper;
2 |
3 | import com.coderman.common.model.business.Health;
4 | import org.apache.ibatis.annotations.Param;
5 | import org.apache.ibatis.annotations.Select;
6 | import tk.mybatis.mapper.common.Mapper;
7 |
8 | import java.util.List;
9 |
10 | /**
11 | * @Author zhangyukang
12 | * @Date 2020/5/7 10:16
13 | * @Version 1.0
14 | **/
15 | public interface HealthMapper extends Mapper {
16 | /**
17 | * 今日是否打卡
18 | * @param id
19 | * @return
20 | */
21 | @Select("select * from biz_health where create_time < (CURDATE()+1) " +
22 | " and create_time>CURDATE() and user_id=#{id}")
23 | List isReport(@Param("id") Long id);
24 | }
25 |
--------------------------------------------------------------------------------
/xinguan-business/src/main/java/com/coderman/business/mapper/InStockInfoMapper.java:
--------------------------------------------------------------------------------
1 | package com.coderman.business.mapper;
2 |
3 | import com.coderman.common.model.business.InStockInfo;
4 | import tk.mybatis.mapper.common.Mapper;
5 |
6 | /**
7 | * @Author zhangyukang
8 | * @Date 2020/3/20 15:46
9 | * @Version 1.0
10 | **/
11 | public interface InStockInfoMapper extends Mapper {
12 | }
13 |
--------------------------------------------------------------------------------
/xinguan-business/src/main/java/com/coderman/business/mapper/InStockMapper.java:
--------------------------------------------------------------------------------
1 | package com.coderman.business.mapper;
2 |
3 |
4 | import com.coderman.common.model.business.InStock;
5 | import tk.mybatis.mapper.common.Mapper;
6 |
7 | /**
8 | * @Author zhangyukang
9 | * @Date 2020/3/19 09:53
10 | * @Version 1.0
11 | **/
12 | public interface InStockMapper extends Mapper {
13 | }
14 |
--------------------------------------------------------------------------------
/xinguan-business/src/main/java/com/coderman/business/mapper/OutStockInfoMapper.java:
--------------------------------------------------------------------------------
1 | package com.coderman.business.mapper;
2 |
3 |
4 | import com.coderman.common.model.business.OutStockInfo;
5 | import tk.mybatis.mapper.common.Mapper;
6 |
7 | /**
8 | * @Author zhangyukang
9 | * @Date 2020/5/25 11:11
10 | * @Version 1.0
11 | **/
12 | public interface OutStockInfoMapper extends Mapper {
13 | }
14 |
--------------------------------------------------------------------------------
/xinguan-business/src/main/java/com/coderman/business/mapper/OutStockMapper.java:
--------------------------------------------------------------------------------
1 | package com.coderman.business.mapper;
2 |
3 |
4 | import com.coderman.common.model.business.OutStock;
5 | import tk.mybatis.mapper.common.Mapper;
6 |
7 | /**
8 | * @Author zhangyukang
9 | * @Date 2020/3/19 09:53
10 | * @Version 1.0
11 | **/
12 | public interface OutStockMapper extends Mapper {
13 | }
14 |
--------------------------------------------------------------------------------
/xinguan-business/src/main/java/com/coderman/business/mapper/ProductCategoryMapper.java:
--------------------------------------------------------------------------------
1 | package com.coderman.business.mapper;
2 |
3 |
4 | import com.coderman.common.model.business.ProductCategory;
5 | import tk.mybatis.mapper.common.Mapper;
6 |
7 | /**
8 | * @Author zhangyukang
9 | * @Date 2020/3/16 18:16
10 | * @Version 1.0
11 | **/
12 | public interface ProductCategoryMapper extends Mapper {
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/xinguan-business/src/main/java/com/coderman/business/mapper/ProductMapper.java:
--------------------------------------------------------------------------------
1 | package com.coderman.business.mapper;
2 |
3 |
4 | import com.coderman.common.model.business.Product;
5 | import tk.mybatis.mapper.common.Mapper;
6 |
7 | /**
8 | * @Author zhangyukang
9 | * @Date 2020/3/17 09:18
10 | * @Version 1.0
11 | **/
12 | public interface ProductMapper extends Mapper {
13 | }
14 |
--------------------------------------------------------------------------------
/xinguan-business/src/main/java/com/coderman/business/mapper/ProductStockMapper.java:
--------------------------------------------------------------------------------
1 | package com.coderman.business.mapper;
2 |
3 |
4 | import com.coderman.common.model.business.ProductStock;
5 | import com.coderman.common.vo.business.ProductStockVO;
6 | import com.coderman.common.vo.business.ProductVO;
7 | import tk.mybatis.mapper.common.Mapper;
8 |
9 | import java.util.List;
10 |
11 | /**
12 | * @Author zhangyukang
13 | * @Date 2020/3/21 19:38
14 | * @Version 1.0
15 | **/
16 | public interface ProductStockMapper extends Mapper {
17 |
18 | /**
19 | * 库存列表
20 | * @param productVO
21 | * @return
22 | */
23 | List findProductStocks(ProductVO productVO);
24 |
25 | /**
26 | * 库存信息(饼图使用)
27 | * @return
28 | */
29 | List findAllStocks(ProductVO productVO);
30 | }
31 |
--------------------------------------------------------------------------------
/xinguan-business/src/main/java/com/coderman/business/mapper/SupplierMapper.java:
--------------------------------------------------------------------------------
1 | package com.coderman.business.mapper;
2 |
3 |
4 | import com.coderman.common.model.business.Supplier;
5 | import tk.mybatis.mapper.common.Mapper;
6 |
7 | /**
8 | * @Author zhangyukang
9 | * @Date 2020/3/16 20:21
10 | * @Version 1.0
11 | **/
12 | public interface SupplierMapper extends Mapper {
13 | }
14 |
--------------------------------------------------------------------------------
/xinguan-business/src/main/java/com/coderman/business/service/ConsumerService.java:
--------------------------------------------------------------------------------
1 | package com.coderman.business.service;
2 |
3 |
4 | import com.coderman.common.model.business.Consumer;
5 | import com.coderman.common.vo.business.ConsumerVO;
6 | import com.coderman.common.vo.system.PageVO;
7 |
8 | import java.util.List;
9 |
10 | /**
11 | * @Author zhangyukang
12 | * @Date 2020/4/5 09:53
13 | * @Version 1.0
14 | **/
15 | public interface ConsumerService {
16 |
17 | /**
18 | * 添加物资去向
19 | * @param consumerVO
20 | */
21 | Consumer add(ConsumerVO consumerVO);
22 |
23 |
24 | /**
25 | * 物资去向列表
26 | * @param pageNum
27 | * @param pageSize
28 | * @param consumerVO
29 | * @return
30 | */
31 | PageVO findConsumerList(Integer pageNum, Integer pageSize, ConsumerVO consumerVO);
32 |
33 |
34 | /**
35 | * 编辑物资去向
36 | * @param id
37 | * @return
38 | */
39 | ConsumerVO edit(Long id);
40 |
41 | /**
42 | * 更新物资去向
43 | * @param id
44 | * @param consumerVO
45 | */
46 | void update(Long id, ConsumerVO consumerVO);
47 |
48 | /**
49 | * 删除物资去向
50 | * @param id
51 | */
52 | void delete(Long id);
53 |
54 | /**
55 | * 查询所有物资去向
56 | * @return
57 | */
58 | List findAll();
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/xinguan-business/src/main/java/com/coderman/business/service/HealthService.java:
--------------------------------------------------------------------------------
1 | package com.coderman.business.service;
2 |
3 |
4 | import com.coderman.common.error.BusinessException;
5 | import com.coderman.common.model.business.Health;
6 | import com.coderman.common.vo.business.HealthVO;
7 | import com.coderman.common.vo.system.PageVO;
8 |
9 | /**
10 | * @Author zhangyukang
11 | * @Date 2020/5/7 10:20
12 | * @Version 1.0
13 | **/
14 | public interface HealthService {
15 |
16 | /**
17 | * 健康上报
18 | * @param healthVO
19 | */
20 | void report(HealthVO healthVO) throws BusinessException;
21 |
22 | /**
23 | * 今日是否已经报备
24 | * @param id
25 | * @return
26 | */
27 | Health isReport(Long id);
28 |
29 | /**
30 | * 签到记录
31 | * @return
32 | */
33 | PageVO history(Long id, Integer pageNum, Integer pageSize);
34 | }
35 |
--------------------------------------------------------------------------------
/xinguan-business/src/main/java/com/coderman/business/service/InStockService.java:
--------------------------------------------------------------------------------
1 | package com.coderman.business.service;
2 |
3 |
4 | import com.coderman.common.error.BusinessException;
5 | import com.coderman.common.vo.business.InStockDetailVO;
6 | import com.coderman.common.vo.business.InStockVO;
7 | import com.coderman.common.vo.system.PageVO;
8 |
9 | /**
10 | * @Author zhangyukang
11 | * @Date 2020/3/19 09:54
12 | * @Version 1.0
13 | **/
14 | public interface InStockService {
15 |
16 | /**
17 | * 入库单列表
18 | * @param pageNum
19 | * @param pageSize
20 | * @param inStockVO
21 | * @return
22 | */
23 | PageVO findInStockList(Integer pageNum, Integer pageSize, InStockVO inStockVO);
24 |
25 |
26 | /**
27 | * 入库单明细
28 | * @param id
29 | * @return
30 | */
31 | InStockDetailVO detail(Long id, int pageNo, int pageSize) throws BusinessException;
32 |
33 | /**
34 | * 删除入库单
35 | * @param id
36 | */
37 | void delete(Long id) throws BusinessException;
38 |
39 | /**
40 | * 物资入库
41 | * @param inStockVO
42 | */
43 | void addIntoStock(InStockVO inStockVO) throws BusinessException;
44 |
45 | /**
46 | * 移入回收站
47 | * @param id
48 | */
49 | void remove(Long id) throws BusinessException;
50 |
51 | /**
52 | * 还原从回收站中
53 | * @param id
54 | */
55 | void back(Long id) throws BusinessException;
56 |
57 | /**
58 | * 入库审核
59 | * @param id
60 | */
61 | void publish(Long id) throws BusinessException;
62 | }
63 |
--------------------------------------------------------------------------------
/xinguan-business/src/main/java/com/coderman/business/service/OutStockService.java:
--------------------------------------------------------------------------------
1 | package com.coderman.business.service;
2 |
3 |
4 | import com.coderman.common.error.BusinessException;
5 | import com.coderman.common.vo.business.OutStockDetailVO;
6 | import com.coderman.common.vo.business.OutStockVO;
7 | import com.coderman.common.vo.system.PageVO;
8 |
9 | /**
10 | * @Author zhangyukang
11 | * @Date 2020/5/10 14:26
12 | * @Version 1.0
13 | **/
14 | public interface OutStockService {
15 |
16 | /**
17 | * 出库单列表
18 | * @param pageNum
19 | * @param pageSize
20 | * @param outStockVO
21 | * @return
22 | */
23 | PageVO findOutStockList(Integer pageNum, Integer pageSize, OutStockVO outStockVO);
24 |
25 | /**
26 | * 提交物资发放单
27 | * @param outStockVO
28 | */
29 | void addOutStock(OutStockVO outStockVO) throws BusinessException;
30 |
31 | /**
32 | * 移入回收站
33 | * @param id
34 | */
35 | void remove(Long id) throws BusinessException;
36 |
37 | /**
38 | * 恢复发放单
39 | * @param id
40 | */
41 | void back(Long id) throws BusinessException;
42 |
43 | /**
44 | * 发放单详情
45 | * @param id
46 | * @param pageNum
47 | * @param pageSize
48 | * @return
49 | */
50 | OutStockDetailVO detail(Long id, Integer pageNum, Integer pageSize) throws BusinessException;
51 |
52 | /**
53 | * 删除发放单
54 | * @param id
55 | */
56 | void delete(Long id) throws BusinessException;
57 |
58 | /**
59 | * 发放单审核
60 | * @param id
61 | */
62 | void publish(Long id) throws BusinessException;
63 | }
64 |
--------------------------------------------------------------------------------
/xinguan-business/src/main/java/com/coderman/business/service/ProductCategoryService.java:
--------------------------------------------------------------------------------
1 | package com.coderman.business.service;
2 |
3 |
4 | import com.coderman.common.error.BusinessException;
5 | import com.coderman.common.vo.business.ProductCategoryTreeNodeVO;
6 | import com.coderman.common.vo.business.ProductCategoryVO;
7 | import com.coderman.common.vo.system.PageVO;
8 |
9 | import java.util.List;
10 |
11 | /**
12 | * @Author zhangyukang
13 | * @Date 2020/3/16 17:18
14 | * @Version 1.0
15 | **/
16 | public interface ProductCategoryService {
17 |
18 | /**
19 | * 添加物资类别
20 | * @param ProductCategoryVO
21 | */
22 | void add(ProductCategoryVO ProductCategoryVO);
23 |
24 |
25 | /**
26 | * 部门列表
27 | * @param pageNum
28 | * @param pageSize
29 | * @param ProductCategoryVO
30 | * @return
31 | */
32 | PageVO findProductCategoryList(Integer pageNum, Integer pageSize, ProductCategoryVO ProductCategoryVO);
33 |
34 |
35 | /**
36 | * 编辑物资类别
37 | * @param id
38 | * @return
39 | */
40 | ProductCategoryVO edit(Long id);
41 |
42 | /**
43 | * 更新物资类别
44 | * @param id
45 | * @param ProductCategoryVO
46 | */
47 | void update(Long id, ProductCategoryVO ProductCategoryVO);
48 |
49 | /**
50 | * 删除物资类别
51 | * @param id
52 | */
53 | void delete(Long id) throws BusinessException;
54 |
55 | /**
56 | * 查询所物资类别
57 | * @return
58 | */
59 | List findAll();
60 |
61 | /**
62 | * 分类树形
63 | * @return
64 | */
65 | PageVO categoryTree(Integer pageNum, Integer pageSize);
66 |
67 | /**
68 | * 获取父级分类(2级树)
69 | * @return
70 | */
71 | List getParentCategoryTree();
72 |
73 | }
74 |
--------------------------------------------------------------------------------
/xinguan-business/src/main/java/com/coderman/business/service/ProductService.java:
--------------------------------------------------------------------------------
1 | package com.coderman.business.service;
2 |
3 |
4 | import com.coderman.common.error.BusinessException;
5 | import com.coderman.common.vo.business.ProductStockVO;
6 | import com.coderman.common.vo.business.ProductVO;
7 | import com.coderman.common.vo.system.PageVO;
8 |
9 | import java.util.List;
10 |
11 | /**
12 | * @Author zhangyukang
13 | * @Date 2020/3/16 17:18
14 | * @Version 1.0
15 | **/
16 | public interface ProductService {
17 |
18 | /**
19 | * 添加商品
20 | * @param productVO
21 | */
22 | void add(ProductVO productVO);
23 |
24 |
25 | /**
26 | * 商品列表
27 | * @param pageNum
28 | * @param pageSize
29 | * @param productVO
30 | * @return
31 | */
32 | PageVO findProductList(Integer pageNum, Integer pageSize, ProductVO productVO);
33 |
34 |
35 | /**
36 | * 编辑商品
37 | * @param id
38 | * @return
39 | */
40 | ProductVO edit(Long id);
41 |
42 | /**
43 | * 更新商品
44 | * @param id
45 | * @param productVO
46 | */
47 | void update(Long id, ProductVO productVO);
48 |
49 | /**
50 | * 删除商品
51 | * @param id
52 | */
53 | void delete(Long id) throws BusinessException;
54 |
55 | /**
56 | * 库存列表
57 | * @param pageNum
58 | * @param pageSize
59 | * @param productVO
60 | * @return
61 | */
62 | PageVO findProductStocks(Integer pageNum, Integer pageSize, ProductVO productVO);
63 |
64 | /**
65 | * 所有库存信息
66 | * @return
67 | */
68 | List findAllStocks(Integer pageNum, Integer pageSize, ProductVO productVO);
69 |
70 | /**
71 | * 移入回收站
72 | * @param id
73 | */
74 | void remove(Long id) throws BusinessException;
75 |
76 | /**
77 | * 从回收站恢复数据
78 | * @param id
79 | */
80 | void back(Long id) throws BusinessException;
81 |
82 | /**
83 | * 物资添加审核
84 | * @param id
85 | */
86 | void publish(Long id) throws BusinessException;
87 |
88 |
89 | }
90 |
--------------------------------------------------------------------------------
/xinguan-business/src/main/java/com/coderman/business/service/SupplierService.java:
--------------------------------------------------------------------------------
1 | package com.coderman.business.service;
2 |
3 |
4 | import com.coderman.common.model.business.Supplier;
5 | import com.coderman.common.vo.business.SupplierVO;
6 | import com.coderman.common.vo.system.PageVO;
7 |
8 | import java.util.List;
9 |
10 | /**
11 | * @Author zhangyukang
12 | * @Date 2020/3/16 17:18
13 | * @Version 1.0
14 | **/
15 | public interface SupplierService {
16 |
17 | /**
18 | * 添加供应商
19 | * @param supplierVO
20 | */
21 | Supplier add(SupplierVO supplierVO);
22 |
23 |
24 | /**
25 | * 供应商列表
26 | * @param pageNum
27 | * @param pageSize
28 | * @param supplierVO
29 | * @return
30 | */
31 | PageVO findSupplierList(Integer pageNum, Integer pageSize, SupplierVO supplierVO);
32 |
33 |
34 | /**
35 | * 编辑供应商
36 | * @param id
37 | * @return
38 | */
39 | SupplierVO edit(Long id);
40 |
41 | /**
42 | * 更新供应商
43 | * @param id
44 | * @param supplierVO
45 | */
46 | void update(Long id, SupplierVO supplierVO);
47 |
48 | /**
49 | * 删除供应商
50 | * @param id
51 | */
52 | void delete(Long id);
53 |
54 | /**
55 | * 查询所有供应商
56 | * @return
57 | */
58 | List findAll();
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/xinguan-business/src/main/java/com/coderman/business/service/imp/ConsumerServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.coderman.business.service.imp;
2 |
3 | import com.coderman.business.converter.ConsumerConverter;
4 | import com.coderman.business.mapper.ConsumerMapper;
5 | import com.coderman.business.service.ConsumerService;
6 | import com.coderman.common.model.business.Consumer;
7 | import com.coderman.common.vo.business.ConsumerVO;
8 | import com.coderman.common.vo.system.PageVO;
9 | import com.github.pagehelper.PageHelper;
10 | import com.github.pagehelper.PageInfo;
11 | import org.springframework.beans.BeanUtils;
12 | import org.springframework.beans.factory.annotation.Autowired;
13 | import org.springframework.stereotype.Service;
14 | import tk.mybatis.mapper.entity.Example;
15 |
16 | import java.util.Date;
17 | import java.util.List;
18 |
19 | /**
20 | * @Author zhangyukang
21 | * @Date 2020/3/16 17:19
22 | * @Version 1.0
23 | **/
24 | @Service
25 | public class ConsumerServiceImpl implements ConsumerService {
26 |
27 |
28 | @Autowired
29 | private ConsumerMapper consumerMapper;
30 |
31 | /**
32 | * 供应商列表
33 | * @param pageNum
34 | * @param pageSize
35 | * @param consumerVO
36 | * @return
37 | */
38 | @Override
39 | public PageVO findConsumerList(Integer pageNum, Integer pageSize, ConsumerVO consumerVO) {
40 | PageHelper.startPage(pageNum, pageSize);
41 | Example o = new Example(Consumer.class);
42 | Example.Criteria criteria = o.createCriteria();
43 | o.setOrderByClause("sort asc");
44 | if (consumerVO.getName() != null && !"".equals(consumerVO.getName())) {
45 | criteria.andLike("name", "%" + consumerVO.getName() + "%");
46 | }
47 | if (consumerVO.getAddress() != null && !"".equals(consumerVO.getAddress())) {
48 | criteria.andLike("address", "%" + consumerVO.getAddress() + "%");
49 | }
50 | if (consumerVO.getContact() != null && !"".equals(consumerVO.getContact())) {
51 | criteria.andLike("contact", "%" + consumerVO.getContact() + "%");
52 | }
53 | List consumers = consumerMapper.selectByExample(o);
54 | List categoryVOS= ConsumerConverter.converterToVOList(consumers);
55 | PageInfo info = new PageInfo<>(consumers);
56 | return new PageVO<>(info.getTotal(), categoryVOS);
57 | }
58 |
59 |
60 |
61 | /**
62 | * 添加供应商
63 | * @param ConsumerVO
64 | */
65 | @Override
66 | public Consumer add(ConsumerVO ConsumerVO) {
67 | Consumer consumer = new Consumer();
68 | BeanUtils.copyProperties(ConsumerVO,consumer);
69 | consumer.setCreateTime(new Date());
70 | consumer.setModifiedTime(new Date());
71 | consumerMapper.insert(consumer);
72 | return consumer;
73 | }
74 |
75 | /**
76 | * 编辑供应商
77 | * @param id
78 | * @return
79 | */
80 | @Override
81 | public ConsumerVO edit(Long id) {
82 | Consumer consumer = consumerMapper.selectByPrimaryKey(id);
83 | return ConsumerConverter.converterToConsumerVO(consumer);
84 | }
85 |
86 | /**
87 | * 更新供应商
88 | * @param id
89 | * @param ConsumerVO
90 | */
91 | @Override
92 | public void update(Long id, ConsumerVO ConsumerVO) {
93 | Consumer consumer = new Consumer();
94 | BeanUtils.copyProperties(ConsumerVO,consumer);
95 | consumer.setModifiedTime(new Date());
96 | consumerMapper.updateByPrimaryKeySelective(consumer);
97 | }
98 |
99 | /**
100 | * 删除供应商
101 | * @param id
102 | */
103 | @Override
104 | public void delete(Long id) {
105 | consumerMapper.deleteByPrimaryKey(id);
106 | }
107 |
108 | /**
109 | * 查询所有
110 | * @return
111 | */
112 | @Override
113 | public List findAll() {
114 | List consumers = consumerMapper.selectAll();
115 | return ConsumerConverter.converterToVOList(consumers);
116 | }
117 |
118 | }
119 |
--------------------------------------------------------------------------------
/xinguan-business/src/main/java/com/coderman/business/service/imp/HealthServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.coderman.business.service.imp;
2 |
3 | import com.coderman.business.mapper.HealthMapper;
4 | import com.coderman.business.service.HealthService;
5 | import com.coderman.common.error.BusinessCodeEnum;
6 | import com.coderman.common.error.BusinessException;
7 | import com.coderman.common.model.business.Health;
8 | import com.coderman.common.vo.business.HealthVO;
9 | import com.coderman.common.vo.system.PageVO;
10 | import com.github.pagehelper.PageHelper;
11 | import com.github.pagehelper.PageInfo;
12 | import org.springframework.beans.BeanUtils;
13 | import org.springframework.beans.factory.annotation.Autowired;
14 | import org.springframework.stereotype.Service;
15 | import tk.mybatis.mapper.entity.Example;
16 |
17 | import java.util.Date;
18 | import java.util.List;
19 |
20 | /**
21 | * @Author zhangyukang
22 | * @Date 2020/5/7 10:21
23 | * @Version 1.0
24 | **/
25 | @Service
26 | public class HealthServiceImpl implements HealthService {
27 |
28 | @Autowired
29 | private HealthMapper healthMapper;
30 |
31 | /**
32 | * 健康上报
33 | * @param healthVO
34 | */
35 | @Override
36 | public void report(HealthVO healthVO) throws BusinessException {
37 | Health report = isReport(healthVO.getUserId());
38 | if(report!=null) {
39 | throw new BusinessException(BusinessCodeEnum.PARAMETER_ERROR, "今日已经打卡,无法重复打卡!");
40 | }
41 | Health health = new Health();
42 | BeanUtils.copyProperties(healthVO,health);
43 | health.setCreateTime(new Date());
44 | healthMapper.insert(health);
45 | }
46 |
47 | /**
48 | * 今日是否已报备
49 | * @param id
50 | * @return
51 | */
52 | @Override
53 | public Health isReport(Long id) {
54 | List health=healthMapper.isReport(id);
55 | if(health.size()>0){
56 | return health.get(0);
57 | }
58 | return null;
59 | }
60 |
61 | /**
62 | * 签到历史记录
63 | * @return
64 | */
65 | @Override
66 | public PageVO history(Long id,Integer pageNum,Integer pageSize) {
67 | Example o = new Example(Health.class);
68 | o.setOrderByClause("create_time desc");
69 | PageHelper.startPage(pageNum,pageSize);
70 | o.createCriteria().andEqualTo("userId",id);
71 | List health = healthMapper.selectByExample(o);
72 | PageInfo pageInfo=new PageInfo<>(health);
73 | return new PageVO<>(pageInfo.getTotal(),pageInfo.getList());
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/xinguan-business/src/main/java/com/coderman/business/service/imp/SupplierServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.coderman.business.service.imp;
2 |
3 | import com.coderman.business.converter.SupplierConverter;
4 | import com.coderman.business.mapper.SupplierMapper;
5 | import com.coderman.business.service.SupplierService;
6 | import com.coderman.common.model.business.Supplier;
7 | import com.coderman.common.vo.business.SupplierVO;
8 | import com.coderman.common.vo.system.PageVO;
9 | import com.github.pagehelper.PageHelper;
10 | import com.github.pagehelper.PageInfo;
11 | import org.springframework.beans.BeanUtils;
12 | import org.springframework.beans.factory.annotation.Autowired;
13 | import org.springframework.stereotype.Service;
14 | import tk.mybatis.mapper.entity.Example;
15 |
16 | import java.util.Date;
17 | import java.util.List;
18 |
19 | /**
20 | * @Author zhangyukang
21 | * @Date 2020/3/16 17:19
22 | * @Version 1.0
23 | **/
24 | @Service
25 | public class SupplierServiceImpl implements SupplierService {
26 |
27 |
28 | @Autowired
29 | private SupplierMapper supplierMapper;
30 |
31 | /**
32 | * 供应商列表
33 | * @param pageNum
34 | * @param pageSize
35 | * @param supplierVO
36 | * @return
37 | */
38 | @Override
39 | public PageVO findSupplierList(Integer pageNum, Integer pageSize, SupplierVO supplierVO) {
40 | PageHelper.startPage(pageNum, pageSize);
41 | Example o = new Example(Supplier.class);
42 | Example.Criteria criteria = o.createCriteria();
43 | o.setOrderByClause("sort asc");
44 | if (supplierVO.getName() != null && !"".equals(supplierVO.getName())) {
45 | criteria.andLike("name", "%" + supplierVO.getName() + "%");
46 | }
47 | if (supplierVO.getContact() != null && !"".equals(supplierVO.getContact())) {
48 | criteria.andLike("contact", "%" + supplierVO.getContact() + "%");
49 | }
50 | if (supplierVO.getAddress() != null && !"".equals(supplierVO.getAddress())) {
51 | criteria.andLike("address", "%" + supplierVO.getAddress() + "%");
52 | }
53 | List suppliers = supplierMapper.selectByExample(o);
54 | List categoryVOS= SupplierConverter.converterToVOList(suppliers);
55 | PageInfo info = new PageInfo<>(suppliers);
56 | return new PageVO<>(info.getTotal(), categoryVOS);
57 | }
58 |
59 |
60 |
61 | /**
62 | * 添加供应商
63 | * @param SupplierVO
64 | */
65 | @Override
66 | public Supplier add(SupplierVO SupplierVO) {
67 | Supplier supplier = new Supplier();
68 | BeanUtils.copyProperties(SupplierVO,supplier);
69 | supplier.setCreateTime(new Date());
70 | supplier.setModifiedTime(new Date());
71 | supplierMapper.insert(supplier);
72 | return supplier;
73 | }
74 |
75 | /**
76 | * 编辑供应商
77 | * @param id
78 | * @return
79 | */
80 | @Override
81 | public SupplierVO edit(Long id) {
82 | Supplier supplier = supplierMapper.selectByPrimaryKey(id);
83 | return SupplierConverter.converterToSupplierVO(supplier);
84 | }
85 |
86 | /**
87 | * 更新供应商
88 | * @param id
89 | * @param SupplierVO
90 | */
91 | @Override
92 | public void update(Long id, SupplierVO SupplierVO) {
93 | Supplier supplier = new Supplier();
94 | BeanUtils.copyProperties(SupplierVO,supplier);
95 | supplier.setModifiedTime(new Date());
96 | supplierMapper.updateByPrimaryKeySelective(supplier);
97 | }
98 |
99 | /**
100 | * 删除供应商
101 | * @param id
102 | */
103 | @Override
104 | public void delete(Long id) {
105 | supplierMapper.deleteByPrimaryKey(id);
106 | }
107 |
108 | /**
109 | * 查询所有
110 | * @return
111 | */
112 | @Override
113 | public List findAll() {
114 | List suppliers = supplierMapper.selectAll();
115 | return SupplierConverter.converterToVOList(suppliers);
116 | }
117 |
118 | }
119 |
--------------------------------------------------------------------------------
/xinguan-common/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | goods
7 | com.coderman
8 | 0.0.1-SNAPSHOT
9 |
10 | 4.0.0
11 |
12 | jar
13 |
14 | xinguan-common
15 |
16 |
17 |
18 | org.lionsoul
19 | ip2region
20 |
21 |
22 | com.alibaba
23 | druid-spring-boot-starter
24 |
25 |
26 | mysql
27 | mysql-connector-java
28 |
29 |
30 | com.google.code.gson
31 | gson
32 |
33 |
34 | org.springframework.boot
35 | spring-boot-starter-aop
36 | 2.3.3.RELEASE
37 |
38 |
39 | com.alibaba
40 | fastjson
41 |
42 |
43 | org.mybatis.spring.boot
44 | mybatis-spring-boot-starter
45 |
46 |
47 | org.springframework.boot
48 | spring-boot-starter-web
49 |
50 |
51 | org.projectlombok
52 | lombok
53 |
54 |
55 | com.wuwenze
56 | ExcelKit
57 |
58 |
59 | tk.mybatis
60 | mapper
61 |
62 |
63 | io.springfox
64 | springfox-swagger2
65 |
66 |
67 | io.springfox
68 | springfox-swagger-ui
69 |
70 |
71 | com.github.pagehelper
72 | pagehelper-spring-boot-starter
73 |
74 |
75 | eu.bitwalker
76 | UserAgentUtils
77 |
78 |
79 | com.github.tobato
80 | fastdfs-client
81 |
82 |
83 | com.auth0
84 | java-jwt
85 |
86 |
87 |
88 |
89 |
90 |
91 | src/main/java
92 |
93 | **/*.xml
94 |
95 |
96 |
97 | src/main/resources
98 |
99 | **.*
100 | **/*.*
101 | **/*/*.*
102 |
103 |
104 |
105 |
106 |
107 |
108 |
--------------------------------------------------------------------------------
/xinguan-common/src/main/java/com/coderman/common/annotation/ControllerEndpoint.java:
--------------------------------------------------------------------------------
1 | package com.coderman.common.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 | * 自定义注解,用于标注在controller的方法上,异步记录日志
11 | * create by zhangyukang
12 | */
13 | @Target(ElementType.METHOD)
14 | @Retention(RetentionPolicy.RUNTIME)
15 | public @interface ControllerEndpoint {
16 |
17 | String operation() default "";
18 | String exceptionMessage() default "系统内部异常";
19 | }
20 |
--------------------------------------------------------------------------------
/xinguan-common/src/main/java/com/coderman/common/dto/UserLoginDTO.java:
--------------------------------------------------------------------------------
1 | package com.coderman.common.dto;
2 |
3 | import io.swagger.annotations.ApiModel;
4 | import io.swagger.annotations.ApiModelProperty;
5 | import lombok.Data;
6 |
7 | import javax.validation.constraints.NotBlank;
8 |
9 | /**
10 | * @Author zhangyukang
11 | * @Date 2020/12/16 21:40
12 | * @Version 1.0
13 | **/
14 | @Data
15 | @ApiModel(value = "用户登入表单")
16 | public class UserLoginDTO {
17 | @NotBlank(message = "用户名不能为空")
18 | @ApiModelProperty(value = "用户名")
19 | private String username;
20 | @NotBlank(message = "密码不能为空")
21 | @ApiModelProperty(value = "密码")
22 | private String password;
23 | }
24 |
--------------------------------------------------------------------------------
/xinguan-common/src/main/java/com/coderman/common/enums/buisiness/BizUserTypeEnum.java:
--------------------------------------------------------------------------------
1 | package com.coderman.common.enums.buisiness;
2 |
3 | /**
4 | * 业务用户类型
5 | * @Author zhangyukang
6 | * @Date 2020/3/15 18:37
7 | * @Version 1.0
8 | **/
9 | public enum BizUserTypeEnum {
10 |
11 | DEAN("部门主任");
12 | private String val;
13 |
14 | BizUserTypeEnum(String val) {
15 | this.val = val;
16 | }
17 |
18 | public String getVal() {
19 | return val;
20 | }
21 |
22 | public void setVal(String val) {
23 | this.val = val;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/xinguan-common/src/main/java/com/coderman/common/enums/system/RoleStatusEnum.java:
--------------------------------------------------------------------------------
1 | package com.coderman.common.enums.system;
2 |
3 | /**
4 | * @Author zhangyukang
5 | * @Date 2020/5/29 16:52
6 | * @Version 1.0
7 | **/
8 |
9 |
10 | public enum RoleStatusEnum {
11 | DISABLE(0),
12 | AVAILABLE(1);
13 |
14 | private int statusCode;
15 |
16 | RoleStatusEnum(int statusCode) {
17 | this.statusCode = statusCode;
18 | }
19 |
20 | public int getStatusCode() {
21 | return statusCode;
22 | }
23 |
24 | public void setStatusCode(int statusCode) {
25 | this.statusCode = statusCode;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/xinguan-common/src/main/java/com/coderman/common/enums/system/UserStatusEnum.java:
--------------------------------------------------------------------------------
1 | package com.coderman.common.enums.system;
2 |
3 | /**
4 | * 用户状态
5 | * @Author zhangyukang
6 | * @Date 2020/5/29 12:29
7 | * @Version 1.0
8 | **/
9 | public enum UserStatusEnum {
10 |
11 | DISABLE(0),
12 | AVAILABLE(1);
13 |
14 | private int statusCode;
15 |
16 | UserStatusEnum(int statusCode) {
17 | this.statusCode = statusCode;
18 | }
19 |
20 | public int getStatusCode() {
21 | return statusCode;
22 | }
23 |
24 | public void setStatusCode(int statusCode) {
25 | this.statusCode = statusCode;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/xinguan-common/src/main/java/com/coderman/common/enums/system/UserTypeEnum.java:
--------------------------------------------------------------------------------
1 | package com.coderman.common.enums.system;
2 |
3 | /**
4 | * 用户类型
5 | * @Author zhangyukang
6 | * @Date 2020/5/29 12:25
7 | * @Version 1.0
8 | **/
9 | public enum UserTypeEnum {
10 |
11 | SYSTEM_ADMIN(0),//系统管理员admin
12 |
13 | SYSTEM_USER(1);//系统的普通用户
14 |
15 | private int typeCode;
16 |
17 | UserTypeEnum(int typeCode) {
18 | this.typeCode = typeCode;
19 | }
20 |
21 | public int getTypeCode() {
22 | return typeCode;
23 | }
24 |
25 | public void setTypeCode(int typeCode) {
26 | this.typeCode = typeCode;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/xinguan-common/src/main/java/com/coderman/common/error/BaseError.java:
--------------------------------------------------------------------------------
1 | package com.coderman.common.error;
2 |
3 | /**
4 | * 自定义的错误描述枚举类需实现该接口
5 | * @Author zhangyukang
6 | * @Date 2020/3/1 14:49
7 | * @Version 1.0
8 | **/
9 | public interface BaseError {
10 |
11 | /**
12 | * 获取错误码
13 | * @return
14 | */
15 | int getErrorCode();
16 |
17 | /**
18 | * 获取错误信息
19 | * @return
20 | */
21 | String getErrorMsg();
22 |
23 |
24 | /**
25 | * 设置错误信息
26 | * @param message
27 | * @return
28 | */
29 | BaseError setErrorMsg(String message);
30 | }
31 |
--------------------------------------------------------------------------------
/xinguan-common/src/main/java/com/coderman/common/error/BusinessCodeEnum.java:
--------------------------------------------------------------------------------
1 | package com.coderman.common.error;
2 |
3 | import lombok.Getter;
4 |
5 | /**
6 | *
7 | * 业务错误码:返回结果的状态码
8 | *
9 | * 如果想要代码更具维护性一点,可以定义不同种类的错误码,都实现 BaseCodeInterface
10 | * @Author zhangyukang
11 | * @Date 2020/3/1 14:51
12 | * @Version 1.0
13 | **/
14 | @Getter
15 | public enum BusinessCodeEnum implements BaseError {
16 |
17 | //通用的异常以0000开头
18 | PARAMETER_ERROR(00001,"参数不合法"),
19 |
20 | // 数据操作错误定义
21 | BODY_NOT_MATCH(400,"请求的数据格式不符!"),
22 | SIGNATURE_NOT_MATCH(401,"请求的数字签名不匹配!"),
23 | NOT_FOUND(404, "未找到该资源!"),
24 | INTERNAL_SERVER_ERROR(500, "服务器内部错误!"),
25 | SERVER_BUSY(503,"服务器正忙,请稍后再试!"),
26 | //用户相关:10000**
27 | USER_ACCOUNT_NOT_FOUND(10001, "账号不存在!"),
28 | DoNotAllowToDisableTheCurrentUser(10002,"不允许禁用当前用户"),
29 | //业务异常
30 | PRODUCT_IS_REMOVE(30001,"物资已移入回收站"),
31 | PRODUCT_NOT_FOUND(30002,"物资找不到"),
32 | PRODUCT_WAIT_PASS(30003,"物资等待审核"),
33 | PRODUCT_STATUS_ERROR(30004,"物资状态错误"),
34 | PRODUCT_IN_STOCK_NUMBER_ERROR(30005,"物资入库数量非法"),
35 | PRODUCT_OUT_STOCK_NUMBER_ERROR(30008,"物资发放数量非法"),
36 | PRODUCT_IN_STOCK_EMPTY(30006,"物资入库不能为空"),
37 | PRODUCT_OUT_STOCK_EMPTY(30007,"物资发放不能为空"),
38 | PRODUCT_STOCK_ERROR(30009,"物资库存不足");
39 | /** 错误码 */
40 | private int errorCode;
41 |
42 | /** 错误描述 */
43 | private String errorMsg;
44 |
45 | BusinessCodeEnum(int errorCode, String errorMsg) {
46 | this.errorCode = errorCode;
47 | this.errorMsg = errorMsg;
48 | }
49 |
50 | @Override
51 | public int getErrorCode() {
52 | return this.errorCode;
53 | }
54 |
55 | @Override
56 | public String getErrorMsg() {
57 | return this.errorMsg;
58 | }
59 |
60 | @Override
61 | public BaseError setErrorMsg(String errorMsg) {
62 | this.errorMsg=errorMsg;
63 | return this;
64 | }
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/xinguan-common/src/main/java/com/coderman/common/error/BusinessException.java:
--------------------------------------------------------------------------------
1 | package com.coderman.common.error;
2 |
3 | import lombok.Data;
4 |
5 | /**
6 | * 业务异常
7 | * @Author zhangyukang
8 | * @Date 2020/3/1 14:47
9 | * @Version 1.0
10 | **/
11 | @Data
12 | public class BusinessException extends Exception implements BaseError{
13 |
14 | //所有实现了BaseError的ErrorEnum.
15 | private BaseError baseError;
16 |
17 | //直接构造错误消息的构造异常
18 | public BusinessException(BaseError baseError){
19 | super(baseError.getErrorMsg());
20 | this.baseError=baseError;
21 | }
22 |
23 | //自定义错误消息的构造异常
24 | public BusinessException(BaseError baseError,String customErrorMessage){
25 | super();
26 | this.baseError=baseError;
27 | this.baseError.setErrorMsg(customErrorMessage);
28 | }
29 |
30 | @Override
31 | public int getErrorCode() {
32 | return this.baseError.getErrorCode();
33 | }
34 |
35 | @Override
36 | public String getErrorMsg() {
37 | return this.baseError.getErrorMsg();
38 | }
39 |
40 | @Override
41 | public BaseError setErrorMsg(String message) {
42 | this.baseError.setErrorMsg(message);
43 | return this;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/xinguan-common/src/main/java/com/coderman/common/error/SystemCodeEnum.java:
--------------------------------------------------------------------------------
1 | package com.coderman.common.error;
2 |
3 | /**
4 | * @Author zhangyukang
5 | * @Date 2020/12/16 13:00
6 | * @Version 1.0
7 | **/
8 | public enum SystemCodeEnum implements BaseError {
9 | PARAMETER_ERROR(50000,"参数不合法"),
10 | TOKEN_ERROR(50001,"用户未认证")
11 | ;
12 |
13 | /** 错误码 */
14 | private int errorCode;
15 |
16 | /** 错误描述 */
17 | private String errorMsg;
18 |
19 | SystemCodeEnum(int errorCode, String errorMsg) {
20 | this.errorCode = errorCode;
21 | this.errorMsg = errorMsg;
22 | }
23 |
24 | @Override
25 | public int getErrorCode() {
26 | return this.errorCode;
27 | }
28 |
29 | @Override
30 | public String getErrorMsg() {
31 | return this.errorMsg;
32 | }
33 |
34 | @Override
35 | public BaseError setErrorMsg(String errorMsg) {
36 | this.errorMsg=errorMsg;
37 | return this;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/xinguan-common/src/main/java/com/coderman/common/error/SystemException.java:
--------------------------------------------------------------------------------
1 | package com.coderman.common.error;
2 |
3 | /**
4 | * @Author zhangyukang
5 | * @Date 2020/12/16 12:59
6 | * @Version 1.0
7 | **/
8 | public class SystemException extends Exception implements BaseError{
9 | //所有实现了BaseError的ErrorEnum.
10 | private BaseError baseError;
11 |
12 | //直接构造错误消息的构造异常
13 | public SystemException(BaseError baseError){
14 | super(baseError.getErrorMsg());
15 | this.baseError=baseError;
16 | }
17 |
18 | //自定义错误消息的构造异常
19 | public SystemException(BaseError baseError,String customErrorMessage){
20 | super(customErrorMessage);
21 | this.baseError=baseError;
22 | this.baseError.setErrorMsg(customErrorMessage);
23 | }
24 |
25 | @Override
26 | public int getErrorCode() {
27 | return this.baseError.getErrorCode();
28 | }
29 |
30 | @Override
31 | public String getErrorMsg() {
32 | return this.baseError.getErrorMsg();
33 | }
34 |
35 | @Override
36 | public BaseError setErrorMsg(String message) {
37 | this.baseError.setErrorMsg(message);
38 | return this;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/xinguan-common/src/main/java/com/coderman/common/model/business/Consumer.java:
--------------------------------------------------------------------------------
1 | package com.coderman.common.model.business;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.GeneratedValue;
6 | import javax.persistence.Id;
7 | import javax.persistence.Table;
8 | import java.util.Date;
9 |
10 | @Table(name = "biz_consumer")
11 | @Data
12 | public class Consumer {
13 |
14 | @Id
15 | @GeneratedValue(generator = "JDBC")
16 | private Long id;
17 |
18 | private String name;
19 |
20 | private String address;
21 |
22 | private Date createTime;
23 |
24 | private Date modifiedTime;
25 |
26 | private String phone;
27 |
28 | private Integer sort;
29 |
30 | private String contact;
31 | }
32 |
--------------------------------------------------------------------------------
/xinguan-common/src/main/java/com/coderman/common/model/business/Health.java:
--------------------------------------------------------------------------------
1 | package com.coderman.common.model.business;
2 |
3 | import com.fasterxml.jackson.annotation.JsonFormat;
4 | import lombok.Data;
5 |
6 | import javax.persistence.Id;
7 | import javax.persistence.Table;
8 | import java.util.Date;
9 |
10 | @Data
11 | @Table(name = "biz_health")
12 | public class Health {
13 |
14 | @Id
15 | private Long id;
16 |
17 | private String address;
18 |
19 | private Long userId;
20 |
21 | private Integer situation;
22 |
23 | private Integer touch;
24 |
25 | private Integer passby;
26 |
27 | private Integer reception;
28 |
29 | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
30 | private Date createTime;
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/xinguan-common/src/main/java/com/coderman/common/model/business/InStock.java:
--------------------------------------------------------------------------------
1 | package com.coderman.common.model.business;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.Id;
6 | import javax.persistence.Table;
7 | import java.util.Date;
8 |
9 | @Data
10 | @Table(name = "biz_in_stock")
11 | public class InStock {
12 |
13 | @Id
14 | private Long id;
15 |
16 | private String inNum;
17 |
18 | private Integer type;
19 |
20 | private String operator;
21 |
22 | private Long supplierId;
23 |
24 | private Date createTime;
25 |
26 | private Date modified;
27 |
28 | private Integer productNumber;
29 |
30 | private String remark;
31 |
32 | private Integer status;
33 | }
34 |
--------------------------------------------------------------------------------
/xinguan-common/src/main/java/com/coderman/common/model/business/InStockInfo.java:
--------------------------------------------------------------------------------
1 | package com.coderman.common.model.business;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.Id;
6 | import javax.persistence.Table;
7 | import java.util.Date;
8 |
9 | @Data
10 | @Table(name = "biz_in_stock_info")
11 | public class InStockInfo {
12 |
13 | @Id
14 | private Long id;
15 |
16 | private String inNum;
17 |
18 | private String pNum;
19 |
20 | private Integer productNumber;
21 |
22 | private Date createTime;
23 |
24 | private Date modifiedTime;
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/xinguan-common/src/main/java/com/coderman/common/model/business/OutStock.java:
--------------------------------------------------------------------------------
1 | package com.coderman.common.model.business;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.Id;
6 | import javax.persistence.Table;
7 | import java.util.Date;
8 |
9 | @Data
10 | @Table(name = "biz_out_stock")
11 | public class OutStock {
12 |
13 | @Id
14 | private Long id;
15 |
16 | private String outNum;
17 |
18 | private Integer type;
19 |
20 | private String operator;
21 |
22 | private Date createTime;
23 |
24 | private Integer productNumber;
25 |
26 | private Long consumerId;
27 |
28 | private String remark;
29 |
30 | private Integer status;
31 |
32 | private Integer priority;
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/xinguan-common/src/main/java/com/coderman/common/model/business/OutStockInfo.java:
--------------------------------------------------------------------------------
1 | package com.coderman.common.model.business;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.Id;
6 | import javax.persistence.Table;
7 | import java.util.Date;
8 |
9 | @Data
10 | @Table(name = "biz_out_stock_info")
11 | public class OutStockInfo {
12 |
13 | @Id
14 | private Long id;
15 |
16 | private String outNum;
17 |
18 | private String pNum;
19 |
20 | private Integer productNumber;
21 |
22 | private Date createTime;
23 |
24 | private Date modifiedTime;
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/xinguan-common/src/main/java/com/coderman/common/model/business/Product.java:
--------------------------------------------------------------------------------
1 | package com.coderman.common.model.business;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.Id;
6 | import javax.persistence.Table;
7 | import java.util.Date;
8 |
9 | @Data
10 | @Table(name = "biz_product")
11 | public class Product {
12 |
13 | @Id
14 | private Long id;
15 |
16 | private String pNum;
17 |
18 | private String name;
19 |
20 | private String model;
21 |
22 | private String unit;
23 |
24 | private String remark;
25 |
26 | private Integer sort;
27 |
28 | private Date createTime;
29 |
30 | private Date modifiedTime;
31 |
32 | private Long oneCategoryId;
33 |
34 | private Long twoCategoryId;
35 |
36 | private Long threeCategoryId;
37 |
38 | private String imageUrl;
39 |
40 | private Integer status;
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/xinguan-common/src/main/java/com/coderman/common/model/business/ProductCategory.java:
--------------------------------------------------------------------------------
1 | package com.coderman.common.model.business;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.Id;
6 | import javax.persistence.Table;
7 | import java.util.Date;
8 |
9 | @Data
10 | @Table(name = "biz_product_category")
11 | public class ProductCategory {
12 | @Id
13 | private Long id;
14 |
15 | private String name;
16 |
17 | private String remark;
18 |
19 | private Integer sort;
20 |
21 | private Date createTime;
22 |
23 | private Date modifiedTime;
24 |
25 | private Long pid;
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/xinguan-common/src/main/java/com/coderman/common/model/business/ProductStock.java:
--------------------------------------------------------------------------------
1 | package com.coderman.common.model.business;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.Id;
6 | import javax.persistence.Table;
7 |
8 | /**
9 | * 商品库存
10 | */
11 | @Data
12 | @Table(name = "biz_product_stock")
13 | public class ProductStock {
14 | @Id
15 | private Long id;
16 |
17 | private String pNum;
18 |
19 | private Long stock;
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/xinguan-common/src/main/java/com/coderman/common/model/business/Supplier.java:
--------------------------------------------------------------------------------
1 | package com.coderman.common.model.business;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.GeneratedValue;
6 | import javax.persistence.Id;
7 | import javax.persistence.Table;
8 | import java.util.Date;
9 |
10 | @Data
11 | @Table(name = "biz_supplier")
12 | public class Supplier {
13 |
14 | @Id
15 | @GeneratedValue(generator = "JDBC")
16 | private Long id;
17 |
18 | private String name;
19 |
20 | private String address;
21 |
22 | private String email;
23 |
24 | private String phone;
25 |
26 | private Date createTime;
27 |
28 | private Date modifiedTime;
29 |
30 | private Integer sort;
31 |
32 | private String contact;
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/xinguan-common/src/main/java/com/coderman/common/model/system/Department.java:
--------------------------------------------------------------------------------
1 | package com.coderman.common.model.system;
2 |
3 | import com.wuwenze.poi.annotation.Excel;
4 | import com.wuwenze.poi.annotation.ExcelField;
5 | import lombok.Data;
6 |
7 | import javax.persistence.Id;
8 | import javax.persistence.Table;
9 | import java.util.Date;
10 |
11 | @Excel("department")
12 | @Data
13 | @Table(name = "tb_department")
14 | public class Department {
15 | @Id
16 | @ExcelField(value = "编号", width = 50)
17 | private Long id;
18 |
19 | @ExcelField(value = "部门名称", width = 100)
20 | private String name;
21 |
22 | @ExcelField(value = "联系电话", width = 120)
23 | private String phone;
24 |
25 | @ExcelField(value = "部门地址", width = 150)
26 | private String address;
27 |
28 | @ExcelField(value = "创建时间", dateFormat = "yyyy年MM月dd日 HH:mm:ss", width = 180)
29 | private Date createTime;
30 |
31 | @ExcelField(value = "修改时间", dateFormat = "yyyy年MM月dd日 HH:mm:ss", width = 180)
32 | private Date modifiedTime;
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/xinguan-common/src/main/java/com/coderman/common/model/system/ImageAttachment.java:
--------------------------------------------------------------------------------
1 | package com.coderman.common.model.system;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.Id;
6 | import javax.persistence.Table;
7 | import java.util.Date;
8 |
9 | @Data
10 | @Table(name = "tb_image")
11 | public class ImageAttachment {
12 |
13 | @Id
14 | private Long id;
15 |
16 | private String path;
17 |
18 | private Long size;
19 |
20 | private String mediaType;
21 |
22 | private String suffix;
23 |
24 | private Integer height;
25 |
26 | private Integer width;
27 |
28 | private Date createTime;
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/xinguan-common/src/main/java/com/coderman/common/model/system/Log.java:
--------------------------------------------------------------------------------
1 | package com.coderman.common.model.system;
2 |
3 | import com.fasterxml.jackson.annotation.JsonFormat;
4 | import lombok.Data;
5 |
6 | import javax.persistence.Id;
7 | import javax.persistence.Table;
8 | import java.util.Date;
9 |
10 | @Data
11 | @Table(name = "tb_log")
12 | public class Log {
13 |
14 | @Id
15 | private Long id;
16 |
17 | private String username;
18 |
19 | private Long time;
20 |
21 | private String ip;
22 |
23 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
24 | private Date createTime;
25 |
26 | private String location;
27 |
28 | private String operation;
29 |
30 | private String method;
31 |
32 | private String params;
33 | }
34 |
--------------------------------------------------------------------------------
/xinguan-common/src/main/java/com/coderman/common/model/system/LoginLog.java:
--------------------------------------------------------------------------------
1 | package com.coderman.common.model.system;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.Id;
6 | import javax.persistence.Table;
7 | import java.util.Date;
8 |
9 | @Data
10 | @Table(name = "tb_login_log")
11 | public class LoginLog {
12 | @Id
13 | private Long id;
14 |
15 | private String username;
16 |
17 | private Date loginTime;
18 |
19 | private String location;
20 |
21 | private String ip;
22 |
23 | private String userSystem;
24 |
25 | private String userBrowser;
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/xinguan-common/src/main/java/com/coderman/common/model/system/Menu.java:
--------------------------------------------------------------------------------
1 | package com.coderman.common.model.system;
2 |
3 | import com.wuwenze.poi.annotation.Excel;
4 | import com.wuwenze.poi.annotation.ExcelField;
5 | import lombok.Data;
6 |
7 | import javax.persistence.GeneratedValue;
8 | import javax.persistence.Id;
9 | import javax.persistence.Table;
10 | import java.util.Date;
11 |
12 | @Data
13 | @Excel(value = "菜单表格")
14 | @Table(name = "tb_menu")
15 | public class Menu {
16 |
17 | @Id
18 | @ExcelField(value = "编号", width = 50)
19 | @GeneratedValue(generator = "JDBC")
20 | private Long id;
21 |
22 | @ExcelField(value = "父级id", width = 50)
23 | private Long parentId;
24 |
25 | @ExcelField(value = "菜单名称", width = 100)
26 | private String menuName;
27 |
28 | @ExcelField(value = "菜单url", width = 100)
29 | private String url;
30 |
31 | @ExcelField(value = "菜单图标", width = 80)
32 | private String icon;
33 |
34 | @ExcelField(value = "是否展开", width = 50)
35 | private Integer open;
36 |
37 | @ExcelField(value = "菜单类型", width = 80)
38 | private Integer type;
39 |
40 | @ExcelField(value = "排序", width = 90)
41 | private Long orderNum;
42 |
43 | @ExcelField(value = "创建时间", dateFormat = "yyyy年MM月dd日 HH:mm:ss", width = 180)
44 | private Date createTime;
45 |
46 | @ExcelField(value = "修改时间", dateFormat = "yyyy年MM月dd日 HH:mm:ss", width = 180)
47 | private Date modifiedTime;
48 |
49 | @ExcelField(value = "是否可用",width = 80)
50 | private Integer available;
51 |
52 | @ExcelField(value = "权限编码", width = 180)
53 | private String perms;
54 | }
55 |
--------------------------------------------------------------------------------
/xinguan-common/src/main/java/com/coderman/common/model/system/Role.java:
--------------------------------------------------------------------------------
1 | package com.coderman.common.model.system;
2 |
3 | import com.wuwenze.poi.annotation.Excel;
4 | import com.wuwenze.poi.annotation.ExcelField;
5 | import lombok.Data;
6 |
7 | import javax.persistence.Id;
8 | import javax.persistence.Table;
9 | import java.util.Date;
10 |
11 | @Excel(value = "角色表格")
12 | @Data
13 | @Table(name = "tb_role")
14 | public class Role {
15 | @Id
16 | @ExcelField(value = "编号", width = 50)
17 | private Long id;
18 |
19 | @ExcelField(value = "角色名称", width = 100)
20 | private String roleName;
21 |
22 | @ExcelField(value = "备注信息", width = 180)
23 | private String remark;
24 |
25 | @ExcelField(value = "创建时间", dateFormat = "yyyy年MM月dd日 HH:mm:ss", width = 180)
26 | private Date createTime;
27 |
28 | @ExcelField(value = "修改时间", dateFormat = "yyyy年MM月dd日 HH:mm:ss", width = 180)
29 | private Date modifiedTime;
30 |
31 | @ExcelField(value = "禁用状态", width = 50)
32 | private Integer status;
33 |
34 | @Override
35 | public String toString() {
36 | return "Role{" +
37 | "id=" + id +
38 | ", roleName='" + roleName + '\'' +
39 | '}';
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/xinguan-common/src/main/java/com/coderman/common/model/system/RoleMenu.java:
--------------------------------------------------------------------------------
1 | package com.coderman.common.model.system;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.Table;
6 |
7 | @Data
8 | @Table(name = "tb_role_menu")
9 | public class RoleMenu {
10 | private Long roleId;
11 |
12 | private Long menuId;
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/xinguan-common/src/main/java/com/coderman/common/model/system/User.java:
--------------------------------------------------------------------------------
1 | package com.coderman.common.model.system;
2 |
3 | import com.wuwenze.poi.annotation.Excel;
4 | import com.wuwenze.poi.annotation.ExcelField;
5 | import lombok.Data;
6 |
7 | import javax.persistence.Id;
8 | import javax.persistence.Table;
9 | import java.util.Date;
10 |
11 | @Data
12 | @Excel("user")
13 | @Table(name = "tb_user")
14 | public class User {
15 | @Id
16 | @ExcelField(value = "编号", width = 50)
17 | private Long id;
18 |
19 | @ExcelField(value = "用户名", width = 100)
20 | private String username;
21 |
22 | @ExcelField(value = "昵称", width = 100)
23 | private String nickname;
24 |
25 | @ExcelField(value = "邮箱", width = 150)
26 | private String email;
27 |
28 | @ExcelField(value = "电话号码", width = 100)
29 | private String phoneNumber;
30 |
31 | private Integer status;
32 |
33 | @ExcelField(value = "创建时间", dateFormat = "yyyy年MM月dd日 HH:mm:ss", width = 180)
34 | private Date createTime;
35 |
36 | @ExcelField(value = "修改时间", dateFormat = "yyyy年MM月dd日 HH:mm:ss",width = 180)
37 | private Date modifiedTime;
38 |
39 | @ExcelField(//
40 | value = "性别",
41 | readConverterExp = "男=1,女=0",
42 | writeConverterExp = "1=男,0=女"
43 | ,width = 50
44 | )
45 | private Integer sex;
46 |
47 | @ExcelField(value = "密码盐值", width = 100)
48 | private String salt;
49 |
50 | @ExcelField(//
51 | value = "用户类型",
52 | readConverterExp = "超级管理员=0,普通用户=1",
53 | writeConverterExp = "0=超级管理员,1=普通用户"
54 | ,width = 80
55 | )
56 | private Integer type;
57 |
58 | @ExcelField(value = "用户密码", width = 100)
59 | private String password;
60 |
61 | @ExcelField(value = "出生日期", dateFormat = "yyyy/MM/dd",width = 100)
62 | private Date birth;
63 |
64 | private Long departmentId;
65 |
66 | @ExcelField(value = "头像url", width = 200)
67 | private String avatar;
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/xinguan-common/src/main/java/com/coderman/common/model/system/UserRole.java:
--------------------------------------------------------------------------------
1 | package com.coderman.common.model.system;
2 |
3 | import lombok.Data;
4 |
5 | import javax.persistence.Id;
6 | import javax.persistence.Table;
7 |
8 | @Data
9 | @Table(name = "tb_user_role")
10 | public class UserRole {
11 |
12 | @Id
13 | private Long userId;
14 |
15 | private Long roleId;
16 |
17 | public Long getUserId() {
18 | return userId;
19 | }
20 |
21 | public void setUserId(Long userId) {
22 | this.userId = userId;
23 | }
24 |
25 | public Long getRoleId() {
26 | return roleId;
27 | }
28 |
29 | public void setRoleId(Long roleId) {
30 | this.roleId = roleId;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/xinguan-common/src/main/java/com/coderman/common/response/ActiveUser.java:
--------------------------------------------------------------------------------
1 | package com.coderman.common.response;
2 |
3 | import com.coderman.common.model.system.Menu;
4 | import com.coderman.common.model.system.Role;
5 | import com.coderman.common.model.system.User;
6 | import lombok.AllArgsConstructor;
7 | import lombok.Data;
8 | import lombok.NoArgsConstructor;
9 |
10 | import java.util.List;
11 | import java.util.Set;
12 |
13 | @Data
14 | @AllArgsConstructor
15 | @NoArgsConstructor
16 | public class ActiveUser {
17 |
18 | /**
19 | * 当前用户对象
20 | */
21 | private User user;
22 | /**
23 | * 当前用户具有的角色
24 | */
25 | private List roles;
26 | /**
27 | * 当前用户具有的url
28 | */
29 | private Set urls;
30 |
31 | /**
32 | * 包括url+permission
33 | */
34 | private List